From f6d46b917f89b0451571177b12dc1767f5f2cf5c Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 25 Mar 2011 11:35:46 +0900 Subject: [PATCH] Commit the vanila glib 2.27.5 with old debian directory Vanila glib 2.27.5 + old debian directory which was used for glib 2.24.2 --- ChangeLog | 33623 ++++++++++++++++--- INSTALL | 6 +- INSTALL.in | 2 +- Makefile.am | 30 +- Makefile.decl | 43 +- Makefile.in | 181 +- NEWS | 1131 +- README | 2 +- README.win32 | 2 +- aclocal.m4 | 2096 +- autogen.sh | 53 +- build/Makefile.in | 24 +- build/win32/Makefile.in | 24 +- build/win32/dirent/Makefile.in | 24 +- build/win32/vs9/Makefile.in | 24 +- build/win32/vs9/README.txt | 20 +- build/win32/vs9/gio.vcproj | 67 +- build/win32/vs9/gio.vcprojin | 7 + build/win32/vs9/glib.sln | 85 + build/win32/vs9/glib.vcproj | 316 +- build/win32/vs9/glib.vcprojin | 314 +- build/win32/vs9/glib.vsprops | 54 +- build/win32/vs9/gmodule.vcproj | 4 +- build/win32/vs9/gobject.vcproj | 1 + config.h.in | 23 +- config.h.win32 | 34 +- config.h.win32.in | 22 +- configure | 18270 +++++----- configure.in => configure.ac | 301 +- debian/rules | 0 docs/Makefile.in | 65 +- docs/reference/Makefile.in | 65 +- docs/reference/gio/Makefile.am | 104 +- docs/reference/gio/Makefile.in | 275 +- docs/reference/gio/gdbus.1 | 249 + docs/reference/gio/gdbus.xml | 267 + docs/reference/gio/gio-docs.xml | 164 +- docs/reference/gio/gio-querymodules.1 | 44 + docs/reference/gio/gio-querymodules.xml | 33 + docs/reference/gio/gio-sections.txt | 1118 +- docs/reference/gio/gio.types | 35 +- docs/reference/gio/glib-compile-schemas.1 | 85 + docs/reference/gio/glib-compile-schemas.xml | 85 + docs/reference/gio/gsettings.1 | 105 + docs/reference/gio/gsettings.xml | 137 + docs/reference/gio/html/GAction.html | 472 + docs/reference/gio/html/GActionGroup.html | 779 + docs/reference/gio/html/GAppInfo.html | 382 +- docs/reference/gio/html/GApplication.html | 1455 + .../gio/html/GApplicationCommandLine.html | 784 + docs/reference/gio/html/GAsyncInitable.html | 323 +- docs/reference/gio/html/GAsyncResult.html | 48 +- docs/reference/gio/html/GBufferedInputStream.html | 181 +- docs/reference/gio/html/GBufferedOutputStream.html | 50 +- docs/reference/gio/html/GCancellable.html | 161 +- docs/reference/gio/html/GCharsetConverter.html | 52 +- docs/reference/gio/html/GConverter.html | 81 +- docs/reference/gio/html/GCredentials.html | 398 + docs/reference/gio/html/GDBusAuthObserver.html | 254 + docs/reference/gio/html/GDBusConnection.html | 6219 ++++ docs/reference/gio/html/GDBusMessage.html | 1827 + docs/reference/gio/html/GDBusMethodInvocation.html | 616 + docs/reference/gio/html/GDBusProxy.html | 2051 ++ docs/reference/gio/html/GDBusServer.html | 1124 + docs/reference/gio/html/GDataInputStream.html | 445 +- docs/reference/gio/html/GDataOutputStream.html | 166 +- docs/reference/gio/html/GDrive.html | 232 +- docs/reference/gio/html/GEmblem.html | 15 +- docs/reference/gio/html/GEmblemedIcon.html | 60 +- docs/reference/gio/html/GFile.html | 1526 +- docs/reference/gio/html/GFileDescriptorBased.html | 15 +- docs/reference/gio/html/GFileEnumerator.html | 113 +- docs/reference/gio/html/GFileIOStream.html | 44 +- docs/reference/gio/html/GFileIcon.html | 12 +- docs/reference/gio/html/GFileInfo.html | 281 +- docs/reference/gio/html/GFileInputStream.html | 40 +- docs/reference/gio/html/GFileMonitor.html | 54 +- docs/reference/gio/html/GFileOutputStream.html | 38 +- docs/reference/gio/html/GFilenameCompleter.html | 32 +- docs/reference/gio/html/GFilterInputStream.html | 32 +- docs/reference/gio/html/GFilterOutputStream.html | 32 +- docs/reference/gio/html/GIOModule.html | 36 +- docs/reference/gio/html/GIOStream.html | 230 +- docs/reference/gio/html/GIcon.html | 56 +- docs/reference/gio/html/GInetAddress.html | 136 +- docs/reference/gio/html/GInetSocketAddress.html | 26 +- docs/reference/gio/html/GInitable.html | 121 +- docs/reference/gio/html/GInputStream.html | 226 +- docs/reference/gio/html/GLoadableIcon.html | 38 +- docs/reference/gio/html/GMemoryInputStream.html | 28 +- docs/reference/gio/html/GMemoryOutputStream.html | 111 +- docs/reference/gio/html/GMount.html | 236 +- docs/reference/gio/html/GMountOperation.html | 78 +- docs/reference/gio/html/GNetworkAddress.html | 135 +- docs/reference/gio/html/GNetworkService.html | 110 +- docs/reference/gio/html/GOutputStream.html | 256 +- docs/reference/gio/html/GPermission.html | 560 + docs/reference/gio/html/GPollableInputStream.html | 414 + docs/reference/gio/html/GPollableOutputStream.html | 349 + docs/reference/gio/html/GProxy.html | 375 + docs/reference/gio/html/GProxyAddress.html | 348 + docs/reference/gio/html/GProxyResolver.html | 327 + docs/reference/gio/html/GResolver.html | 205 +- docs/reference/gio/html/GSeekable.html | 83 +- docs/reference/gio/html/GSettings.html | 2659 ++ docs/reference/gio/html/GSettingsBackend.html | 609 + docs/reference/gio/html/GSimpleAction.html | 345 + docs/reference/gio/html/GSimpleActionGroup.html | 203 + docs/reference/gio/html/GSimpleAsyncResult.html | 577 +- docs/reference/gio/html/GSimplePermission.html | 107 + docs/reference/gio/html/GSocket.html | 811 +- docs/reference/gio/html/GSocketAddress.html | 44 +- docs/reference/gio/html/GSocketClient.html | 636 +- docs/reference/gio/html/GSocketConnectable.html | 157 +- docs/reference/gio/html/GSocketConnection.html | 282 +- docs/reference/gio/html/GSocketControlMessage.html | 32 +- docs/reference/gio/html/GSocketListener.html | 178 +- docs/reference/gio/html/GSocketService.html | 22 +- docs/reference/gio/html/GTcpConnection.html | 166 + docs/reference/gio/html/GTcpWrapperConnection.html | 158 + docs/reference/gio/html/GThemedIcon.html | 40 +- .../reference/gio/html/GThreadedSocketService.html | 24 +- docs/reference/gio/html/GTlsBackend.html | 274 + docs/reference/gio/html/GTlsCertificate.html | 413 + docs/reference/gio/html/GTlsClientConnection.html | 432 + docs/reference/gio/html/GTlsConnection.html | 879 + docs/reference/gio/html/GTlsServerConnection.html | 162 + docs/reference/gio/html/GUnixConnection.html | 297 + .../gio/html/GUnixCredentialsMessage.html | 221 + docs/reference/gio/html/GUnixFDList.html | 92 +- docs/reference/gio/html/GUnixFDMessage.html | 73 +- docs/reference/gio/html/GUnixInputStream.html | 56 +- docs/reference/gio/html/GUnixOutputStream.html | 58 +- docs/reference/gio/html/GUnixSocketAddress.html | 273 +- docs/reference/gio/html/GVfs.html | 32 +- docs/reference/gio/html/GVolume.html | 162 +- docs/reference/gio/html/GVolumeMonitor.html | 83 +- docs/reference/gio/html/GZlibCompressor.html | 84 +- docs/reference/gio/html/GZlibDecompressor.html | 50 +- docs/reference/gio/html/annotation-glossary.html | 80 + docs/reference/gio/html/api-index-2-18.html | 8 +- docs/reference/gio/html/api-index-2-20.html | 13 +- docs/reference/gio/html/api-index-2-22.html | 20 +- docs/reference/gio/html/api-index-2-24.html | 27 +- docs/reference/gio/html/api-index-2-26.html | 1637 + docs/reference/gio/html/api-index-2-28.html | 686 + docs/reference/gio/html/api-index-deprecated.html | 21 +- docs/reference/gio/html/api-index-full.html | 4501 ++- docs/reference/gio/html/application.html | 50 + docs/reference/gio/html/async.html | 10 +- docs/reference/gio/html/ch01.html | 64 +- docs/reference/gio/html/ch02.html | 23 +- docs/reference/gio/html/ch03.html | 137 +- docs/reference/gio/html/{ch19.html => ch26.html} | 16 +- docs/reference/gio/html/{ch20.html => ch27.html} | 38 +- .../gio/html/{ch20s02.html => ch27s02.html} | 22 +- .../gio/html/{ch20s03.html => ch27s03.html} | 28 +- docs/reference/gio/html/ch28.html | 57 + docs/reference/gio/html/ch28s02.html | 59 + docs/reference/gio/html/ch28s03.html | 159 + docs/reference/gio/html/ch28s04.html | 46 + docs/reference/gio/html/ch28s05.html | 48 + docs/reference/gio/html/ch28s06.html | 277 + docs/reference/gio/html/ch28s07.html | 160 + docs/reference/gio/html/ch29.html | 70 + docs/reference/gio/html/ch29s02.html | 130 + docs/reference/gio/html/ch29s03.html | 202 + docs/reference/gio/html/ch29s04.html | 96 + docs/reference/gio/html/ch29s05.html | 823 + docs/reference/gio/html/ch29s06.html | 828 + docs/reference/gio/html/conversion.html | 6 +- docs/reference/gio/html/extending-gio.html | 56 +- docs/reference/gio/html/extending.html | 10 +- .../gio/html/failable_initialization.html | 6 +- docs/reference/gio/html/file_mon.html | 6 +- docs/reference/gio/html/file_ops.html | 6 +- docs/reference/gio/html/gdbus-convenience.html | 41 + docs/reference/gio/html/gdbus-lowlevel.html | 59 + docs/reference/gio/html/gdbus.html | 243 + docs/reference/gio/html/gio-D-Bus-Addresses.html | 314 + .../gio/html/gio-D-Bus-Introspection-Data.html | 1117 + docs/reference/gio/html/gio-D-Bus-Utilities.html | 216 + .../gio/html/gio-Desktop-file-based-GAppInfo.html | 118 +- docs/reference/gio/html/gio-Extension-Points.html | 74 +- docs/reference/gio/html/gio-GContentType.html | 159 +- .../gio/html/gio-GConverterInputstream.html | 15 +- .../gio/html/gio-GConverterOutputstream.html | 19 +- docs/reference/gio/html/gio-GDBusError.html | 908 + docs/reference/gio/html/gio-GFileAttribute.html | 20 +- docs/reference/gio/html/gio-GIOError.html | 101 +- docs/reference/gio/html/gio-GIOScheduler.html | 82 +- docs/reference/gio/html/gio-GSrvTarget.html | 55 +- docs/reference/gio/html/gio-Owning-Bus-Names.html | 736 + docs/reference/gio/html/gio-TLS-Overview.html | 274 + docs/reference/gio/html/gio-Unix-Mounts.html | 157 +- .../reference/gio/html/gio-Watching-Bus-Names.html | 666 + docs/reference/gio/html/gio-hierarchy.html | 51 +- docs/reference/gio/html/gio-querymodules.html | 53 + docs/reference/gio/html/gio.devhelp | 876 +- docs/reference/gio/html/gio.devhelp2 | 1035 +- docs/reference/gio/html/glib-compile-schemas.html | 102 + docs/reference/gio/html/gsettings.html | 129 + docs/reference/gio/html/highlevel-socket.html | 19 +- docs/reference/gio/html/icons.html | 6 +- docs/reference/gio/html/index.html | 219 +- docs/reference/gio/html/index.sgml | 1298 +- docs/reference/gio/html/migrating.html | 44 +- docs/reference/gio/html/networking.html | 28 +- docs/reference/gio/html/permissions.html | 39 + docs/reference/gio/html/pt01.html | 8 +- docs/reference/gio/html/pt02.html | 188 +- docs/reference/gio/html/resolver.html | 13 +- docs/reference/gio/html/settings.html | 38 + docs/reference/gio/html/streaming.html | 14 +- docs/reference/gio/html/style.css | 8 + docs/reference/gio/html/tls.html | 50 + docs/reference/gio/html/tools.html | 44 + docs/reference/gio/html/types.html | 12 +- docs/reference/gio/html/utils.html | 16 +- docs/reference/gio/html/volume_mon.html | 10 +- docs/reference/gio/migrating-gconf.xml | 517 + docs/reference/gio/migrating-gdbus.xml | 340 + .../gio/{migrating.xml => migrating-gnome-vfs.xml} | 35 +- docs/reference/gio/migrating-posix.xml | 27 + docs/reference/gio/overview.xml | 305 +- docs/reference/gio/tmpl/extensionpoints.sgml | 2 - docs/reference/gio/tmpl/gaction.sgml | 125 + docs/reference/gio/tmpl/gactiongroup.sgml | 189 + docs/reference/gio/tmpl/gappinfo.sgml | 33 +- docs/reference/gio/tmpl/gapplication.sgml | 276 + .../gio/tmpl/gapplicationcommandline.sgml | 119 + docs/reference/gio/tmpl/gasyncinitable.sgml | 2 - docs/reference/gio/tmpl/gasyncresult.sgml | 2 - docs/reference/gio/tmpl/gbufferedinputstream.sgml | 2 - docs/reference/gio/tmpl/gbufferedoutputstream.sgml | 2 - docs/reference/gio/tmpl/gcancellable.sgml | 21 +- docs/reference/gio/tmpl/gcharsetconverter.sgml | 2 - docs/reference/gio/tmpl/gcontenttype.sgml | 2 - docs/reference/gio/tmpl/gconverter.sgml | 11 +- docs/reference/gio/tmpl/gconverterinputstream.sgml | 2 - .../reference/gio/tmpl/gconverteroutputstream.sgml | 2 - docs/reference/gio/tmpl/gcredentials.sgml | 107 + docs/reference/gio/tmpl/gdatainputstream.sgml | 42 +- docs/reference/gio/tmpl/gdataoutputstream.sgml | 2 - docs/reference/gio/tmpl/gdbusaddress.sgml | 86 + docs/reference/gio/tmpl/gdbusauthobserver.sgml | 58 + docs/reference/gio/tmpl/gdbusconnection.sgml | 742 + docs/reference/gio/tmpl/gdbuserror.sgml | 187 + docs/reference/gio/tmpl/gdbusintrospection.sgml | 354 + docs/reference/gio/tmpl/gdbusmessage.sgml | 543 + docs/reference/gio/tmpl/gdbusmethodinvocation.sgml | 172 + docs/reference/gio/tmpl/gdbusnameowning.sgml | 127 + docs/reference/gio/tmpl/gdbusnamewatching.sgml | 115 + docs/reference/gio/tmpl/gdbusproxy.sgml | 354 + docs/reference/gio/tmpl/gdbusserver.sgml | 142 + docs/reference/gio/tmpl/gdbusutils.sgml | 76 + docs/reference/gio/tmpl/gdesktopappinfo.sgml | 25 - docs/reference/gio/tmpl/gdrive.sgml | 2 - docs/reference/gio/tmpl/gemblem.sgml | 2 - docs/reference/gio/tmpl/gemblemedicon.sgml | 15 +- docs/reference/gio/tmpl/gfile.sgml | 2 - docs/reference/gio/tmpl/gfileattribute.sgml | 2 - docs/reference/gio/tmpl/gfiledescriptorbased.sgml | 2 - docs/reference/gio/tmpl/gfileenumerator.sgml | 2 - docs/reference/gio/tmpl/gfileicon.sgml | 2 - docs/reference/gio/tmpl/gfileinfo.sgml | 16 +- docs/reference/gio/tmpl/gfileinputstream.sgml | 2 - docs/reference/gio/tmpl/gfileiostream.sgml | 2 - docs/reference/gio/tmpl/gfilemonitor.sgml | 2 - docs/reference/gio/tmpl/gfilenamecompleter.sgml | 2 - docs/reference/gio/tmpl/gfileoutputstream.sgml | 2 - docs/reference/gio/tmpl/gfilterinputstream.sgml | 2 - docs/reference/gio/tmpl/gfilteroutputstream.sgml | 2 - docs/reference/gio/tmpl/gicon.sgml | 2 - docs/reference/gio/tmpl/ginetaddress.sgml | 2 - docs/reference/gio/tmpl/ginetsocketaddress.sgml | 2 - docs/reference/gio/tmpl/ginitable.sgml | 2 - docs/reference/gio/tmpl/ginputstream.sgml | 2 - docs/reference/gio/tmpl/gioerror.sgml | 19 +- docs/reference/gio/tmpl/giomodule.sgml | 2 - docs/reference/gio/tmpl/gioscheduler.sgml | 2 - docs/reference/gio/tmpl/giostream.sgml | 36 +- docs/reference/gio/tmpl/gloadableicon.sgml | 2 - docs/reference/gio/tmpl/gmemoryinputstream.sgml | 2 - docs/reference/gio/tmpl/gmemoryoutputstream.sgml | 11 +- docs/reference/gio/tmpl/gmount.sgml | 2 - docs/reference/gio/tmpl/gmountoperation.sgml | 2 - docs/reference/gio/tmpl/gnetworkaddress.sgml | 27 +- docs/reference/gio/tmpl/gnetworkservice.sgml | 25 +- docs/reference/gio/tmpl/goutputstream.sgml | 2 - docs/reference/gio/tmpl/gpermission.sgml | 147 + docs/reference/gio/tmpl/gpollableinputstream.sgml | 99 + docs/reference/gio/tmpl/gpollableoutputstream.sgml | 80 + docs/reference/gio/tmpl/gproxy.sgml | 101 + docs/reference/gio/tmpl/gproxyaddress.sgml | 120 + docs/reference/gio/tmpl/gproxyresolver.sgml | 99 + docs/reference/gio/tmpl/gresolver.sgml | 2 - docs/reference/gio/tmpl/gseekable.sgml | 2 - docs/reference/gio/tmpl/gsettings.sgml | 534 + docs/reference/gio/tmpl/gsettingsbackend.sgml | 133 + docs/reference/gio/tmpl/gsimpleaction.sgml | 99 + docs/reference/gio/tmpl/gsimpleactiongroup.sgml | 65 + docs/reference/gio/tmpl/gsimpleasyncresult.sgml | 34 +- docs/reference/gio/tmpl/gsimplepermission.sgml | 37 + docs/reference/gio/tmpl/gsocket.sgml | 63 +- docs/reference/gio/tmpl/gsocketaddress.sgml | 2 - docs/reference/gio/tmpl/gsocketclient.sgml | 140 +- docs/reference/gio/tmpl/gsocketconnectable.sgml | 28 +- docs/reference/gio/tmpl/gsocketconnection.sgml | 60 - docs/reference/gio/tmpl/gsocketcontrolmessage.sgml | 2 - docs/reference/gio/tmpl/gsocketlistener.sgml | 2 - docs/reference/gio/tmpl/gsocketservice.sgml | 2 - docs/reference/gio/tmpl/gsrvtarget.sgml | 2 - docs/reference/gio/tmpl/gtcpconnection.sgml | 51 + docs/reference/gio/tmpl/gtcpwrapperconnection.sgml | 52 + docs/reference/gio/tmpl/gthemedicon.sgml | 2 - .../reference/gio/tmpl/gthreadedsocketservice.sgml | 2 - docs/reference/gio/tmpl/gtls.sgml | 65 + docs/reference/gio/tmpl/gtlsbackend.sgml | 91 + docs/reference/gio/tmpl/gtlscertificate.sgml | 115 + docs/reference/gio/tmpl/gtlsclientconnection.sgml | 129 + docs/reference/gio/tmpl/gtlsconnection.sgml | 217 + docs/reference/gio/tmpl/gtlsserverconnection.sgml | 51 + docs/reference/gio/tmpl/gunixconnection.sgml | 73 + .../gio/tmpl/gunixcredentialsmessage.sgml | 76 + docs/reference/gio/tmpl/gunixfdlist.sgml | 2 - docs/reference/gio/tmpl/gunixfdmessage.sgml | 2 - docs/reference/gio/tmpl/gunixinputstream.sgml | 2 - docs/reference/gio/tmpl/gunixmounts.sgml | 8 - docs/reference/gio/tmpl/gunixoutputstream.sgml | 2 - docs/reference/gio/tmpl/gunixsocketaddress.sgml | 38 +- docs/reference/gio/tmpl/gvfs.sgml | 2 - docs/reference/gio/tmpl/gvolume.sgml | 2 - docs/reference/gio/tmpl/gvolumemonitor.sgml | 2 - docs/reference/gio/tmpl/gzcompressor.sgml | 25 +- docs/reference/gio/tmpl/gzdecompressor.sgml | 16 +- docs/reference/gio/version.xml | 2 +- docs/reference/glib/Makefile.am | 38 +- docs/reference/glib/Makefile.in | 117 +- docs/reference/glib/building.sgml | 84 +- docs/reference/glib/changes.sgml | 8 - docs/reference/glib/glib-docs.sgml | 12 + docs/reference/glib/glib-gettextize.1 | 89 +- docs/reference/glib/glib-gettextize.xml | 5 +- docs/reference/glib/glib-sections.txt | 183 +- docs/reference/glib/gtester-report.1 | 19 +- docs/reference/glib/gtester-report.xml | 6 +- docs/reference/glib/gtester.1 | 21 +- docs/reference/glib/gtester.xml | 6 +- docs/reference/glib/gvariant-varargs.xml | 203 +- docs/reference/glib/html/annotation-glossary.html | 83 + docs/reference/glib/html/api-index-2-10.html | 6 +- docs/reference/glib/html/api-index-2-12.html | 6 +- docs/reference/glib/html/api-index-2-14.html | 10 +- docs/reference/glib/html/api-index-2-16.html | 6 +- docs/reference/glib/html/api-index-2-18.html | 6 +- docs/reference/glib/html/api-index-2-2.html | 6 +- docs/reference/glib/html/api-index-2-20.html | 6 +- docs/reference/glib/html/api-index-2-22.html | 6 +- docs/reference/glib/html/api-index-2-24.html | 9 +- docs/reference/glib/html/api-index-2-26.html | 387 + docs/reference/glib/html/api-index-2-28.html | 100 + docs/reference/glib/html/api-index-2-4.html | 13 +- docs/reference/glib/html/api-index-2-6.html | 6 +- docs/reference/glib/html/api-index-2-8.html | 6 +- docs/reference/glib/html/api-index-deprecated.html | 89 +- docs/reference/glib/html/api-index-full.html | 457 +- docs/reference/glib/html/glib-Arrays.html | 10 +- .../glib/html/glib-Asynchronous-Queues.html | 34 +- .../glib/html/glib-Atomic-Operations.html | 115 +- .../html/glib-Automatic-String-Completion.html | 42 +- .../glib/html/glib-Balanced-Binary-Trees.html | 6 +- docs/reference/glib/html/glib-Base64-Encoding.html | 16 +- docs/reference/glib/html/glib-Basic-Types.html | 6 +- .../glib/html/glib-Bookmark-file-parser.html | 82 +- docs/reference/glib/html/glib-Byte-Arrays.html | 8 +- .../glib/html/glib-Byte-Order-Macros.html | 6 +- docs/reference/glib/html/glib-Caches.html | 10 +- .../glib/html/glib-Character-Set-Conversion.html | 281 +- .../glib/html/glib-Commandline-option-parser.html | 140 +- docs/reference/glib/html/glib-Data-Checksums.html | 12 +- docs/reference/glib/html/glib-Datasets.html | 6 +- .../glib/html/glib-Date-and-Time-Functions.html | 91 +- .../glib/html/glib-Double-ended-Queues.html | 8 +- .../glib/html/glib-Doubly-Linked-Lists.html | 37 +- .../glib/html/glib-Dynamic-Loading-of-Modules.html | 8 +- docs/reference/glib/html/glib-Error-Reporting.html | 9 +- docs/reference/glib/html/glib-File-Utilities.html | 64 +- docs/reference/glib/html/glib-GDateTime.html | 2195 ++ docs/reference/glib/html/glib-GTimeZone.html | 535 + docs/reference/glib/html/glib-GVariant.html | 797 +- docs/reference/glib/html/glib-GVariantType.html | 47 +- .../html/glib-Glob-style-pattern-matching.html | 6 +- docs/reference/glib/html/glib-Hash-Tables.html | 19 +- docs/reference/glib/html/glib-Hook-Functions.html | 6 +- .../glib/html/glib-Hostname-Utilities.html | 6 +- docs/reference/glib/html/glib-I18N.html | 79 +- docs/reference/glib/html/glib-IO-Channels.html | 8 +- .../glib/html/glib-Key-value-file-parser.html | 190 +- .../reference/glib/html/glib-Keyed-Data-Lists.html | 12 +- docs/reference/glib/html/glib-Lexical-Scanner.html | 6 +- .../glib/html/glib-Limits-of-Basic-Types.html | 8 +- .../glib/html/glib-Memory-Allocation.html | 68 +- .../glib/html/glib-Memory-Allocators.html | 6 +- docs/reference/glib/html/glib-Memory-Chunks.html | 10 +- docs/reference/glib/html/glib-Memory-Slices.html | 14 +- docs/reference/glib/html/glib-Message-Logging.html | 12 +- .../glib/html/glib-Miscellaneous-Macros.html | 131 +- .../html/glib-Miscellaneous-Utility-Functions.html | 149 +- docs/reference/glib/html/glib-N-ary-Trees.html | 12 +- .../glib/html/glib-Numerical-Definitions.html | 48 +- .../glib-Perl-compatible-regular-expressions.html | 701 +- docs/reference/glib/html/glib-Pointer-Arrays.html | 8 +- docs/reference/glib/html/glib-Quarks.html | 6 +- docs/reference/glib/html/glib-Random-Numbers.html | 14 +- .../glib/html/glib-Relations-and-Tuples.html | 55 +- docs/reference/glib/html/glib-Sequences.html | 128 +- .../glib/html/glib-Shell-related-Utilities.html | 6 +- .../glib/html/glib-Simple-XML-Subset-Parser.html | 21 +- .../glib/html/glib-Singly-Linked-Lists.html | 133 +- .../glib/html/glib-Spawning-Processes.html | 10 +- docs/reference/glib/html/glib-Standard-Macros.html | 10 +- docs/reference/glib/html/glib-String-Chunks.html | 6 +- .../glib/html/glib-String-Utility-Functions.html | 177 +- docs/reference/glib/html/glib-Strings.html | 33 +- docs/reference/glib/html/glib-Testing.html | 124 +- .../glib/html/glib-The-Main-Event-Loop.html | 753 +- docs/reference/glib/html/glib-Thread-Pools.html | 6 +- docs/reference/glib/html/glib-Threads.html | 28 +- docs/reference/glib/html/glib-Timers.html | 19 +- docs/reference/glib/html/glib-Trash-Stacks.html | 6 +- .../glib/html/glib-Type-Conversion-Macros.html | 6 +- docs/reference/glib/html/glib-URI-Functions.html | 94 +- .../glib/html/glib-Unicode-Manipulation.html | 100 +- .../glib/html/glib-Version-Information.html | 16 +- .../glib/html/glib-Warnings-and-Assertions.html | 10 +- .../html/glib-Windows-Compatibility-Functions.html | 6 +- docs/reference/glib/html/glib-building.html | 59 +- docs/reference/glib/html/glib-changes.html | 16 +- docs/reference/glib/html/glib-compiling.html | 8 +- docs/reference/glib/html/glib-core.html | 6 +- docs/reference/glib/html/glib-cross-compiling.html | 6 +- docs/reference/glib/html/glib-data-types.html | 6 +- docs/reference/glib/html/glib-fundamentals.html | 6 +- docs/reference/glib/html/glib-gettextize.html | 16 +- docs/reference/glib/html/glib-regex-syntax.html | 298 +- docs/reference/glib/html/glib-resources.html | 12 +- docs/reference/glib/html/glib-running.html | 33 +- docs/reference/glib/html/glib-utilities.html | 14 +- docs/reference/glib/html/glib.devhelp | 169 +- docs/reference/glib/html/glib.devhelp2 | 261 +- docs/reference/glib/html/glib.html | 6 +- docs/reference/glib/html/gtester-report.html | 14 +- docs/reference/glib/html/gtester.html | 14 +- .../glib/html/gvariant-format-strings.html | 227 +- docs/reference/glib/html/index.html | 19 +- docs/reference/glib/html/index.sgml | 173 +- docs/reference/glib/html/style.css | 8 + docs/reference/glib/html/tools.html | 6 +- docs/reference/glib/regex-syntax.sgml | 204 +- docs/reference/glib/running.sgml | 24 + docs/reference/glib/tmpl/allocators.sgml | 2 - docs/reference/glib/tmpl/arrays.sgml | 2 - docs/reference/glib/tmpl/arrays_byte.sgml | 2 - docs/reference/glib/tmpl/arrays_pointer.sgml | 2 - docs/reference/glib/tmpl/async_queues.sgml | 55 +- docs/reference/glib/tmpl/atomic_operations.sgml | 142 +- docs/reference/glib/tmpl/base64.sgml | 2 - docs/reference/glib/tmpl/bookmarkfile.sgml | 102 +- docs/reference/glib/tmpl/caches.sgml | 2 - docs/reference/glib/tmpl/checksum.sgml | 2 - docs/reference/glib/tmpl/completion.sgml | 2 - docs/reference/glib/tmpl/conversions.sgml | 196 +- docs/reference/glib/tmpl/datalist.sgml | 2 - docs/reference/glib/tmpl/datasets.sgml | 2 - docs/reference/glib/tmpl/date-time.sgml | 529 + docs/reference/glib/tmpl/date.sgml | 29 +- docs/reference/glib/tmpl/error_reporting.sgml | 5 + docs/reference/glib/tmpl/fileutils.sgml | 6 + docs/reference/glib/tmpl/ghostutils.sgml | 2 - docs/reference/glib/tmpl/glib-unused.sgml | 94 +- docs/reference/glib/tmpl/gregex.sgml | 318 +- docs/reference/glib/tmpl/gurifuncs.sgml | 24 +- docs/reference/glib/tmpl/gvariant.sgml | 136 +- docs/reference/glib/tmpl/gvarianttype.sgml | 23 +- docs/reference/glib/tmpl/hash_tables.sgml | 2 - docs/reference/glib/tmpl/i18n.sgml | 21 + docs/reference/glib/tmpl/iochannels.sgml | 2 - docs/reference/glib/tmpl/keyfile.sgml | 46 + docs/reference/glib/tmpl/limits.sgml | 2 +- docs/reference/glib/tmpl/linked_lists_double.sgml | 11 +- docs/reference/glib/tmpl/linked_lists_single.sgml | 11 +- docs/reference/glib/tmpl/macros_misc.sgml | 63 +- docs/reference/glib/tmpl/main.sgml | 364 +- docs/reference/glib/tmpl/memory.sgml | 316 +- docs/reference/glib/tmpl/memory_chunks.sgml | 2 - docs/reference/glib/tmpl/misc_utils.sgml | 18 + docs/reference/glib/tmpl/numerical.sgml | 38 +- docs/reference/glib/tmpl/option.sgml | 2 - docs/reference/glib/tmpl/patterns.sgml | 2 - docs/reference/glib/tmpl/quarks.sgml | 2 - docs/reference/glib/tmpl/random_numbers.sgml | 2 - docs/reference/glib/tmpl/relations.sgml | 2 - docs/reference/glib/tmpl/sequence.sgml | 26 +- docs/reference/glib/tmpl/shell.sgml | 2 - docs/reference/glib/tmpl/string_chunks.sgml | 2 - docs/reference/glib/tmpl/strings.sgml | 9 +- docs/reference/glib/tmpl/testing.sgml | 35 +- docs/reference/glib/tmpl/thread_pools.sgml | 2 - docs/reference/glib/tmpl/threads.sgml | 2 - docs/reference/glib/tmpl/timers.sgml | 2 - docs/reference/glib/tmpl/timezone.sgml | 133 + docs/reference/glib/tmpl/trees-binary.sgml | 2 - docs/reference/glib/tmpl/trees-nary.sgml | 2 - docs/reference/glib/tmpl/unicode.sgml | 15 + docs/reference/glib/version.xml | 2 +- docs/reference/gobject/Makefile.am | 44 +- docs/reference/gobject/Makefile.in | 125 +- docs/reference/gobject/glib-genmarshal.1 | 30 +- docs/reference/gobject/glib-genmarshal.xml | 10 +- docs/reference/gobject/glib-mkenums.1 | 33 +- docs/reference/gobject/glib-mkenums.xml | 21 +- docs/reference/gobject/gobject-docs.sgml | 13 +- docs/reference/gobject/gobject-query.1 | 21 +- docs/reference/gobject/gobject-query.xml | 3 +- docs/reference/gobject/gobject-sections.txt | 53 +- docs/reference/gobject/gobject.types | 1 + docs/reference/gobject/html/GBinding.html | 803 + docs/reference/gobject/html/GTypeModule.html | 6 +- docs/reference/gobject/html/GTypePlugin.html | 6 +- .../gobject/html/annotation-glossary.html | 62 + docs/reference/gobject/html/api-index-2-10.html | 6 +- docs/reference/gobject/html/api-index-2-12.html | 6 +- docs/reference/gobject/html/api-index-2-14.html | 6 +- docs/reference/gobject/html/api-index-2-18.html | 6 +- docs/reference/gobject/html/api-index-2-2.html | 6 +- docs/reference/gobject/html/api-index-2-22.html | 6 +- docs/reference/gobject/html/api-index-2-24.html | 11 +- docs/reference/gobject/html/api-index-2-26.html | 201 + docs/reference/gobject/html/api-index-2-28.html | 47 + docs/reference/gobject/html/api-index-2-4.html | 6 +- docs/reference/gobject/html/api-index-2-6.html | 6 +- docs/reference/gobject/html/api-index-2-8.html | 6 +- .../gobject/html/api-index-deprecated.html | 6 +- docs/reference/gobject/html/api-index-full.html | 164 +- docs/reference/gobject/html/ch01s02.html | 14 +- docs/reference/gobject/html/ch06s03.html | 8 +- docs/reference/gobject/html/chapter-gobject.html | 17 +- docs/reference/gobject/html/chapter-gtype.html | 36 +- docs/reference/gobject/html/chapter-intro.html | 10 +- docs/reference/gobject/html/chapter-signal.html | 30 +- docs/reference/gobject/html/glib-genmarshal.html | 32 +- docs/reference/gobject/html/glib-mkenums.html | 34 +- .../gobject/html/gobject-Boxed-Types.html | 41 +- docs/reference/gobject/html/gobject-Closures.html | 103 +- .../html/gobject-Enumeration-and-Flag-Types.html | 6 +- .../reference/gobject/html/gobject-GParamSpec.html | 22 +- .../gobject/html/gobject-Generic-values.html | 18 +- docs/reference/gobject/html/gobject-Signals.html | 71 +- ...gobject-Standard-Parameter-and-Value-Types.html | 331 +- .../gobject/html/gobject-The-Base-Object-Type.html | 327 +- .../gobject/html/gobject-Type-Information.html | 253 +- .../gobject/html/gobject-Value-arrays.html | 53 +- .../html/gobject-Varargs-Value-Collection.html | 36 +- docs/reference/gobject/html/gobject-memory.html | 10 +- .../reference/gobject/html/gobject-properties.html | 27 +- docs/reference/gobject/html/gobject-query.html | 14 +- docs/reference/gobject/html/gobject.devhelp | 61 +- docs/reference/gobject/html/gobject.devhelp2 | 66 +- docs/reference/gobject/html/gtype-conventions.html | 10 +- .../gobject/html/gtype-instantiable-classed.html | 20 +- .../html/gtype-non-instantiable-classed.html | 24 +- .../gobject/html/gtype-non-instantiable.html | 12 +- .../gobject/html/howto-gobject-chainup.html | 10 +- .../reference/gobject/html/howto-gobject-code.html | 6 +- .../gobject/html/howto-gobject-construction.html | 14 +- .../gobject/html/howto-gobject-destruction.html | 6 +- .../gobject/html/howto-gobject-methods.html | 12 +- docs/reference/gobject/html/howto-gobject.html | 16 +- .../gobject/html/howto-interface-implement.html | 6 +- .../gobject/html/howto-interface-properties.html | 14 +- docs/reference/gobject/html/howto-interface.html | 10 +- docs/reference/gobject/html/howto-signals.html | 10 +- docs/reference/gobject/html/index.html | 26 +- docs/reference/gobject/html/index.sgml | 60 +- docs/reference/gobject/html/pr01.html | 8 +- docs/reference/gobject/html/pt01.html | 14 +- docs/reference/gobject/html/pt02.html | 14 +- docs/reference/gobject/html/pt03.html | 8 +- docs/reference/gobject/html/rn01.html | 11 +- docs/reference/gobject/html/rn02.html | 12 +- docs/reference/gobject/html/signal.html | 18 +- docs/reference/gobject/html/style.css | 8 + docs/reference/gobject/html/tools-ginspector.html | 6 +- docs/reference/gobject/html/tools-gob.html | 6 +- docs/reference/gobject/html/tools-gtkdoc.html | 12 +- docs/reference/gobject/html/tools-refdb.html | 6 +- docs/reference/gobject/html/tools-vala.html | 6 +- .../reference/gobject/tmpl/enumerations_flags.sgml | 2 - docs/reference/gobject/tmpl/gbinding.sgml | 165 + docs/reference/gobject/tmpl/gboxed.sgml | 13 +- docs/reference/gobject/tmpl/gclosure.sgml | 23 +- docs/reference/gobject/tmpl/generic_values.sgml | 2 - docs/reference/gobject/tmpl/gobject-unused.sgml | 87 - docs/reference/gobject/tmpl/gparamspec.sgml | 3 +- docs/reference/gobject/tmpl/gtype.sgml | 61 +- docs/reference/gobject/tmpl/gtypemodule.sgml | 2 - docs/reference/gobject/tmpl/gtypeplugin.sgml | 2 - docs/reference/gobject/tmpl/objects.sgml | 29 +- docs/reference/gobject/tmpl/param_value_types.sgml | 92 +- docs/reference/gobject/tmpl/signals.sgml | 14 +- docs/reference/gobject/tmpl/value_arrays.sgml | 2 - docs/reference/gobject/tmpl/value_collection.sgml | 2 - docs/reference/gobject/tut_gobject.xml | 28 +- docs/reference/gobject/tut_gsignal.xml | 12 +- docs/reference/gobject/tut_gtype.xml | 66 +- docs/reference/gobject/tut_howto.xml | 20 +- docs/reference/gobject/tut_tools.xml | 6 +- docs/reference/gobject/version.xml | 2 +- gio-2.0.pc.in | 1 + gio-windows-2.0.pc.in | 11 + gio/Makefile.am | 233 +- gio/Makefile.in | 764 +- gio/abicheck.sh | 4 +- gio/fam/Makefile.am | 5 +- gio/fam/Makefile.in | 70 +- gio/fam/fam-helper.c | 2 +- gio/fam/fam-module.c | 2 +- gio/fam/gfamdirectorymonitor.c | 2 +- gio/fam/gfamdirectorymonitor.h | 4 +- gio/fam/gfamfilemonitor.c | 2 +- gio/fam/gfamfilemonitor.h | 4 +- gio/fen/Makefile.am | 12 +- gio/fen/Makefile.in | 111 +- gio/fen/fen-data.c | 718 - gio/fen/fen-data.h | 89 - gio/fen/fen-dump.c | 44 +- gio/fen/fen-dump.h | 4 +- gio/fen/fen-helper.c | 327 +- gio/fen/fen-helper.h | 13 +- gio/fen/fen-kernel.c | 776 +- gio/fen/fen-kernel.h | 35 +- gio/fen/fen-missing.c | 121 - gio/fen/fen-node.c | 765 +- gio/fen/fen-node.h | 97 +- gio/fen/gfendirectorymonitor.c | 100 +- gio/fen/gfendirectorymonitor.h | 7 +- gio/fen/gfenfilemonitor.c | 35 +- gio/fen/gfenfilemonitor.h | 3 + gio/gaction.c | 375 + gio/gaction.h | 91 + gio/gactiongroup.c | 518 + gio/gactiongroup.h | 158 + gio/gappinfo.c | 93 +- gio/gappinfo.h | 11 +- gio/gapplication.c | 1431 + gio/gapplication.h | 165 + gio/gapplicationcommandline.c | 543 + gio/gapplicationcommandline.h | 118 + gio/gapplicationimpl-dbus.c | 1036 + gio/gapplicationimpl.h | 54 + gio/gasynchelper.c | 125 +- gio/gasynchelper.h | 31 +- gio/gasyncinitable.c | 140 +- gio/gasyncresult.c | 8 +- gio/gbufferedinputstream.c | 617 +- gio/gbufferedoutputstream.c | 10 +- gio/gbufferedoutputstream.h | 1 - gio/gcancellable.c | 123 +- gio/gcancellable.h | 2 + gio/gcharsetconverter.c | 10 +- gio/gcontenttype.c | 678 +- gio/gcontenttype.h | 36 +- gio/gconverter.c | 39 +- gio/gconverterinputstream.c | 32 +- gio/gconverterinputstream.h | 1 - gio/gconverteroutputstream.c | 35 +- gio/gconverteroutputstream.h | 1 - gio/gcredentials.c | 446 + gio/gcredentials.h | 76 + gio/gdatainputstream.c | 275 +- gio/gdatainputstream.h | 67 +- gio/gdataoutputstream.c | 6 +- gio/gdataoutputstream.h | 1 - gio/gdbus-bash-completion.sh | 33 + gio/gdbus-tool.c | 1795 + gio/gdbusaddress.c | 1289 + gio/gdbusaddress.h | 58 + gio/gdbusauth.c | 1357 + gio/gdbusauth.h | 86 + gio/gdbusauthmechanism.c | 341 + gio/gdbusauthmechanism.h | 154 + gio/gdbusauthmechanismanon.c | 327 + gio/gdbusauthmechanismanon.h | 63 + gio/gdbusauthmechanismexternal.c | 404 + gio/gdbusauthmechanismexternal.h | 63 + gio/gdbusauthmechanismsha1.c | 1219 + gio/gdbusauthmechanismsha1.h | 63 + gio/gdbusauthobserver.c | 234 + gio/gdbusauthobserver.h | 46 + gio/gdbusconnection.c | 6406 ++++ gio/gdbusconnection.h | 562 + gio/gdbuserror.c | 872 + gio/gdbuserror.h | 100 + gio/gdbusintrospection.c | 2065 ++ gio/gdbusintrospection.h | 286 + gio/gdbusmessage.c | 3256 ++ gio/gdbusmessage.h | 149 + gio/gdbusmethodinvocation.c | 607 + gio/gdbusmethodinvocation.h | 73 + gio/gdbusnameowning.c | 923 + gio/gdbusnameowning.h | 112 + gio/gdbusnamewatching.c | 853 + gio/gdbusnamewatching.h | 94 + gio/gdbusprivate.c | 1870 ++ gio/gdbusprivate.h | 129 + gio/gdbusproxy.c | 2496 ++ gio/gdbusproxy.h | 167 + gio/gdbusserver.c | 1133 + gio/gdbusserver.h | 54 + gio/gdbusutils.c | 357 + gio/gdbusutils.h | 44 + gio/gdelayedsettingsbackend.c | 485 + gio/gdelayedsettingsbackend.h | 72 + gio/gdesktopappinfo.c | 595 +- gio/gdesktopappinfo.h | 4 + gio/gdrive.c | 10 +- gio/gdummyfile.c | 1 - gio/gdummyproxyresolver.c | 155 + gio/gdummyproxyresolver.h | 54 + gio/gdummytlsbackend.c | 277 + gio/gdummytlsbackend.h | 46 + gio/gemblem.c | 6 +- gio/gemblemedicon.c | 183 +- gio/gemblemedicon.h | 15 + gio/gfile.c | 445 +- gio/gfileattribute.c | 24 +- gio/gfiledescriptorbased.c | 11 +- gio/gfileenumerator.c | 15 +- gio/gfileenumerator.h | 1 - gio/gfileicon.c | 11 +- gio/gfileinfo.c | 30 +- gio/gfileinfo.h | 1 + gio/gfileinputstream.c | 25 +- gio/gfileinputstream.h | 2 +- gio/gfileiostream.c | 19 +- gio/gfileiostream.h | 2 +- gio/gfilemonitor.c | 32 +- gio/gfilemonitor.h | 2 +- gio/gfilenamecompleter.c | 6 +- gio/gfileoutputstream.c | 16 +- gio/gfileoutputstream.h | 2 +- gio/gfilterinputstream.c | 12 +- gio/gfilteroutputstream.c | 14 +- gio/gicon.c | 9 +- gio/ginetaddress.c | 4 - gio/ginetsocketaddress.c | 8 +- gio/ginitable.c | 43 +- gio/ginputstream.c | 99 +- gio/gio-marshal.c | 885 +- gio/gio-marshal.h | 203 +- gio/gio-marshal.list | 25 + gio/gio.h | 53 +- gio/gio.rc | 8 +- gio/gio.symbols | 733 +- gio/gioalias.h | 3008 -- gio/gioaliasdef.c | 3011 -- gio/gioenums.h | 690 +- gio/gioenumtypes.c | 622 +- gio/gioenumtypes.c.template | 6 - gio/gioenumtypes.h | 54 + gio/gioerror.c | 47 +- gio/gioerror.h | 4 + gio/giomodule.c | 78 +- gio/giomodule.h | 2 +- gio/gioscheduler.c | 5 - gio/giostream.c | 278 +- gio/giostream.h | 11 + gio/giotypes.h | 84 + gio/gkeyfilesettingsbackend.c | 665 + gio/glib-compile-schemas.c | 2015 ++ gio/gloadableicon.c | 11 +- gio/glocaldirectorymonitor.c | 4 - gio/glocalfile.c | 28 +- gio/glocalfileenumerator.c | 8 +- gio/glocalfileinfo.c | 98 +- gio/glocalfileinputstream.c | 23 +- gio/glocalfileiostream.c | 9 +- gio/glocalfilemonitor.c | 4 - gio/glocalfileoutputstream.c | 33 +- gio/glocalfileoutputstream.h | 6 + gio/glocalvfs.c | 1 - gio/gmemoryinputstream.c | 4 - gio/gmemoryoutputstream.c | 35 +- gio/gmemoryoutputstream.h | 1 + gio/gmemorysettingsbackend.c | 176 + gio/gmemorysettingsbackend.h | 30 + gio/gmount.c | 26 +- gio/gmountoperation.c | 4 - gio/gnativevolumemonitor.c | 4 - gio/gnetworkaddress.c | 473 +- gio/gnetworkaddress.h | 4 + gio/gnetworkingprivate.h | 29 + gio/gnetworkservice.c | 498 +- gio/gnetworkservice.h | 2 + gio/gnullsettingsbackend.c | 111 + gio/gnullsettingsbackend.h | 30 + gio/goutputstream.c | 213 +- gio/goutputstream.h | 2 +- gio/gpermission.c | 415 + gio/gpermission.h | 118 + gio/gpollableinputstream.c | 303 + gio/gpollableinputstream.h | 101 + gio/gpollableoutputstream.c | 200 + gio/gpollableoutputstream.h | 98 + gio/gpollfilemonitor.c | 1 - gio/gproxy.c | 208 + gio/gproxy.h | 123 + gio/gproxyaddress.c | 345 + gio/gproxyaddress.h | 76 + gio/gproxyaddressenumerator.c | 722 + gio/gproxyaddressenumerator.h | 75 + gio/gproxyresolver.c | 241 + gio/gproxyresolver.h | 96 + gio/gregistrysettingsbackend.c | 1973 ++ gio/gregistrysettingsbackend.h | 31 + gio/gresolver.c | 28 +- gio/gschema.dtd | 66 + gio/gseekable.c | 7 +- gio/gsettings-bash-completion.sh | 67 + gio/gsettings-mapping.c | 594 + gio/gsettings-mapping.h | 39 + gio/gsettings-tool.c | 694 + gio/gsettings.c | 2941 ++ gio/gsettings.h | 264 + gio/gsettingsbackend.c | 1029 + gio/gsettingsbackend.h | 138 + gio/gsettingsbackendinternal.h | 99 + gio/gsettingsschema.c | 361 + gio/gsettingsschema.h | 78 + gio/gsimpleaction.c | 498 + gio/gsimpleaction.h | 95 + gio/gsimpleactiongroup.c | 380 + gio/gsimpleactiongroup.h | 87 + gio/gsimpleasyncresult.c | 245 +- gio/gsimpleasyncresult.h | 12 +- gio/gsimplepermission.c | 84 + gio/gsimplepermission.h | 45 + gio/gsocket.c | 685 +- gio/gsocket.h | 18 + gio/gsocketaddress.c | 86 +- gio/gsocketaddressenumerator.c | 14 +- gio/gsocketclient.c | 798 +- gio/gsocketclient.h | 29 + gio/gsocketconnectable.c | 67 +- gio/gsocketconnectable.h | 8 +- gio/gsocketconnection.c | 43 +- gio/gsocketcontrolmessage.c | 21 +- gio/gsocketinputstream.c | 122 +- gio/gsocketlistener.c | 26 +- gio/gsocketoutputstream.c | 123 +- gio/gsocketservice.c | 4 - gio/gsocks4aproxy.c | 491 + gio/gsocks4aproxy.h | 55 + gio/gsocks4proxy.c | 71 + gio/gsocks4proxy.h | 44 + gio/gsocks5proxy.c | 1052 + gio/gsocks5proxy.h | 48 + gio/gsrvtarget.c | 25 +- gio/gtcpconnection.c | 23 +- gio/gtcpwrapperconnection.c | 199 + gio/gtcpwrapperconnection.h | 68 + gio/gthemedicon.c | 12 +- gio/gthreadedresolver.c | 4 - gio/gthreadedsocketservice.c | 4 - gio/gtlsbackend.c | 201 + gio/gtlsbackend.h | 92 + gio/gtlscertificate.c | 488 + gio/gtlscertificate.h | 83 + gio/gtlsclientconnection.c | 333 + gio/gtlsclientconnection.h | 72 + gio/gtlsconnection.c | 726 + gio/gtlsconnection.h | 136 + gio/gtlsserverconnection.c | 96 + gio/gtlsserverconnection.h | 61 + gio/gunionvolumemonitor.c | 9 +- gio/gunixconnection.c | 284 +- gio/gunixconnection.h | 9 + gio/gunixcredentialsmessage.c | 392 + gio/gunixcredentialsmessage.h | 82 + gio/gunixfdlist.c | 11 +- gio/gunixfdlist.h | 3 +- gio/gunixfdmessage.c | 22 +- gio/gunixfdmessage.h | 2 +- gio/gunixinputstream.c | 72 +- gio/gunixmount.c | 4 +- gio/gunixmounts.c | 57 +- gio/gunixoutputstream.c | 75 +- gio/gunixresolver.c | 31 +- gio/gunixsocketaddress.c | 219 +- gio/gunixsocketaddress.h | 10 +- gio/gunixvolume.c | 4 +- gio/gunixvolumemonitor.c | 1 - gio/gvdb/gvdb-builder.c | 502 + gio/gvdb/gvdb-builder.h | 57 + gio/gvdb/gvdb-format.h | 87 + gio/gvdb/gvdb-reader.c | 650 + gio/gvdb/gvdb-reader.h | 75 + gio/gvfs.c | 16 +- gio/gvolume.c | 22 +- gio/gvolumemonitor.c | 15 +- gio/gvolumemonitor.h | 1 - gio/gwin32appinfo.c | 23 +- gio/gwin32inputstream.c | 355 + gio/gwin32inputstream.h | 79 + gio/gwin32mount.c | 1 - gio/gwin32outputstream.c | 355 + gio/gwin32outputstream.h | 78 + gio/gwin32resolver.c | 4 - gio/gwin32volumemonitor.c | 1 - gio/gzlibcompressor.c | 130 +- gio/gzlibcompressor.h | 5 + gio/gzlibdecompressor.c | 149 +- gio/gzlibdecompressor.h | 3 + gio/inotify/Makefile.am | 6 +- gio/inotify/Makefile.in | 71 +- gio/inotify/ginotifydirectorymonitor.c | 5 +- gio/inotify/ginotifydirectorymonitor.h | 4 +- gio/inotify/ginotifyfilemonitor.c | 3 - gio/inotify/inotify-helper.c | 17 +- gio/inotify/inotify-kernel.c | 3 +- gio/libasyncns/Makefile.am | 2 +- gio/libasyncns/Makefile.in | 67 +- gio/makefile.msc | 8 - gio/makegioalias.pl | 137 - gio/pltcheck.sh | 19 - gio/strinfo.c | 350 + gio/tests/Makefile.am | 338 +- gio/tests/Makefile.in | 893 +- gio/tests/actions.c | 268 + gio/tests/appinfo-test-gnome.desktop | 6 + gio/tests/appinfo-test-notgnome.desktop | 6 + gio/tests/appinfo-test.c | 20 + gio/tests/appinfo-test.desktop | 10 + gio/tests/appinfo-test2.desktop | 11 + gio/tests/appinfo.c | 263 + gio/tests/async-close-output-stream.c | 286 + gio/tests/buffered-input-stream.c | 178 +- gio/tests/buffered-output-stream.c | 126 + gio/tests/contenttype.c | 132 + gio/tests/contexts.c | 4 + gio/tests/converter-stream.c | 164 +- gio/tests/data-input-stream.c | 102 +- gio/tests/data-output-stream.c | 34 +- gio/tests/de.po | 17 + gio/tests/desktop-app-info.c | 120 + gio/tests/enums.xml.template | 18 + gio/tests/file.c | 612 + gio/tests/filter-cat.c | 38 +- gio/tests/filter-streams.c | 4 +- gio/tests/g-file-info.c | 6 +- gio/tests/g-icon.c | 117 +- gio/tests/gapplication-example-actions.c | 89 + gio/tests/gapplication-example-cmdline.c | 43 + gio/tests/gapplication-example-cmdline2.c | 103 + gio/tests/gapplication-example-open.c | 56 + gio/tests/gapplication.c | 233 + gio/tests/gdbus-addresses.c | 123 + gio/tests/gdbus-bz627724.c | 94 + gio/tests/gdbus-connection-flush-helper.c | 60 + gio/tests/gdbus-connection-slow.c | 214 + gio/tests/gdbus-connection.c | 1076 + gio/tests/gdbus-error.c | 269 + gio/tests/gdbus-example-export.c | 335 + gio/tests/gdbus-example-own-name.c | 86 + gio/tests/gdbus-example-peer.c | 308 + gio/tests/gdbus-example-proxy-subclass.c | 358 + gio/tests/gdbus-example-server.c | 392 + gio/tests/gdbus-example-subtree.c | 400 + gio/tests/gdbus-example-unix-fd-client.c | 134 + gio/tests/gdbus-example-watch-name.c | 88 + gio/tests/gdbus-example-watch-proxy.c | 232 + gio/tests/gdbus-exit-on-close.c | 82 + gio/tests/gdbus-export.c | 1426 + gio/tests/gdbus-introspection.c | 331 + gio/tests/gdbus-message.c | 153 + gio/tests/gdbus-names.c | 765 + gio/tests/gdbus-non-socket.c | 357 + gio/tests/gdbus-peer.c | 1476 + gio/tests/gdbus-proxy-well-known-name.c | 283 + gio/tests/gdbus-proxy.c | 684 + gio/tests/gdbus-serialization.c | 991 + gio/tests/gdbus-sessionbus.c | 344 + .../fen-missing.h => tests/gdbus-sessionbus.h} | 26 +- gio/tests/gdbus-tests.c | 265 + gio/tests/gdbus-tests.h | 146 + gio/tests/gdbus-testserver.py | 287 + gio/tests/gdbus-threading.c | 539 + gio/tests/gschema-compile.c | 143 + gio/tests/gsettings.c | 1978 ++ gio/tests/io-stream.c | 185 + gio/tests/live-g-file.c | 14 +- gio/tests/memory-input-stream.c | 66 + gio/tests/memory-output-stream.c | 31 +- gio/tests/network-address.c | 94 + gio/tests/org.gtk.test.gschema | 39 + gio/tests/org.gtk.test.gschema.xml | 167 + gio/tests/pollable.c | 240 + gio/tests/proxy.c | 662 + gio/tests/readwrite.c | 13 +- gio/tests/resolver.c | 40 +- .../array-default-not-in-choices.gschema.xml | 11 + gio/tests/schema-tests/bad-choice.gschema.xml | 14 + gio/tests/schema-tests/bad-key.gschema.xml | 7 + gio/tests/schema-tests/bad-key2.gschema.xml | 7 + gio/tests/schema-tests/bad-key3.gschema.xml | 7 + gio/tests/schema-tests/bad-key4.gschema.xml | 7 + gio/tests/schema-tests/bad-type.gschema.xml | 7 + gio/tests/schema-tests/bare-alias.gschema.xml | 7 + gio/tests/schema-tests/choice-alias.gschema.xml | 15 + gio/tests/schema-tests/choice-bad.gschema.xml | 14 + gio/tests/schema-tests/choice-badtype.gschema.xml | 7 + .../schema-tests/choice-invalid-alias.gschema.xml | 15 + .../schema-tests/choice-missing-value.gschema.xml | 10 + .../schema-tests/choice-shadowed-alias.gschema.xml | 14 + .../schema-tests/choice-upside-down.gschema.xml | 14 + gio/tests/schema-tests/choice.gschema.xml | 14 + .../schema-tests/choices-wrong-type.gschema.xml | 8 + .../schema-tests/default-in-aliases.gschema.xml | 15 + .../default-not-in-choices.gschema.xml | 11 + .../schema-tests/default-out-of-range.gschema.xml | 8 + gio/tests/schema-tests/empty-key.gschema.xml | 7 + .../schema-tests/enum-with-aliases.gschema.xml | 20 + .../schema-tests/enum-with-bad-default.gschema.xml | 16 + .../enum-with-chained-alias.gschema.xml | 21 + .../schema-tests/enum-with-choice.gschema.xml | 17 + .../enum-with-invalid-alias.gschema.xml | 20 + .../enum-with-repeated-alias.gschema.xml | 21 + .../enum-with-repeated-nick.gschema.xml | 10 + .../enum-with-repeated-value.gschema.xml | 10 + .../enum-with-shadow-alias.gschema.xml | 20 + gio/tests/schema-tests/enum.gschema.xml | 16 + .../extend-and-shadow-indirect.gschema.xml | 17 + .../schema-tests/extend-and-shadow.gschema.xml | 17 + gio/tests/schema-tests/extend-missing.gschema.xml | 3 + gio/tests/schema-tests/extend-nonlist.gschema.xml | 4 + gio/tests/schema-tests/extend-self.gschema.xml | 3 + .../extend-wrong-list-indirect.gschema.xml | 6 + .../schema-tests/extend-wrong-list.gschema.xml | 5 + gio/tests/schema-tests/extending.gschema.xml | 21 + .../schema-tests/flags-aliased-default.gschema.xml | 19 + .../schema-tests/flags-bad-default.gschema.xml | 16 + .../flags-more-than-one-bit.gschema.xml | 10 + .../schema-tests/flags-with-enum-attr.gschema.xml | 14 + .../schema-tests/flags-with-enum-tag.gschema.xml | 14 + gio/tests/schema-tests/from-docs.gschema.xml | 34 + gio/tests/schema-tests/incomplete-list.gschema.xml | 7 + .../inherit-gettext-domain.gschema.xml | 8 + gio/tests/schema-tests/invalid-path.gschema.xml | 3 + .../schema-tests/key-in-list-indirect.gschema.xml | 8 + gio/tests/schema-tests/key-in-list.gschema.xml | 6 + gio/tests/schema-tests/list-of-missing.gschema.xml | 3 + gio/tests/schema-tests/missing-quotes.gschema.xml | 7 + gio/tests/schema-tests/no-default.gschema.xml | 6 + gio/tests/schema-tests/overflow.gschema.xml | 7 + .../schema-tests/override-missing.gschema.xml | 11 + .../schema-tests/override-range-error.gschema.xml | 12 + .../schema-tests/override-then-key.gschema.xml | 15 + gio/tests/schema-tests/override-twice.gschema.xml | 12 + .../schema-tests/override-type-error.gschema.xml | 11 + gio/tests/schema-tests/override.gschema.xml | 34 + gio/tests/schema-tests/range-badtype.gschema.xml | 7 + .../schema-tests/range-default-high.gschema.xml | 8 + .../schema-tests/range-default-low.gschema.xml | 8 + .../schema-tests/range-high-default.gschema.xml | 8 + .../schema-tests/range-low-default.gschema.xml | 8 + .../schema-tests/range-missing-max.gschema.xml | 8 + .../schema-tests/range-missing-min.gschema.xml | 8 + .../schema-tests/range-parse-error.gschema.xml | 8 + .../schema-tests/range-wrong-type.gschema.xml | 8 + gio/tests/schema-tests/range.gschema.xml | 8 + gio/tests/schema-tests/wrong-category.gschema.xml | 7 + gio/tests/send-data.c | 5 + gio/tests/simple-async-result.c | 1 + gio/tests/socket-client.c | 257 +- gio/tests/socket-common.c | 121 + gio/tests/socket-server.c | 253 +- gio/tests/socket.c | 86 + gio/tests/testenum.h | 16 + gio/tests/unix-fd.c | 61 +- gio/tests/unix-streams.c | 2 +- gio/tests/volumemonitor.c | 187 + gio/tests/win32-streams.c | 292 + gio/win32/Makefile.am | 6 +- gio/win32/Makefile.in | 71 +- gio/win32/gwin32directorymonitor.c | 1 - gio/win32/gwin32directorymonitor.h | 4 +- gio/win32/gwinhttpfile.c | 10 +- gio/win32/gwinhttpfileinputstream.c | 6 +- gio/win32/gwinhttpfileoutputstream.c | 6 +- gio/win32/gwinhttpvfs.c | 23 +- gio/win32/gwinhttpvfs.h | 3 +- gio/xdgmime/Makefile.in | 65 +- gio/xdgmime/xdgmime.c | 22 +- gio/xdgmime/xdgmime.h | 14 +- gio/xdgmime/xdgmimealias.c | 4 +- gio/xdgmime/xdgmimealias.h | 3 +- gio/xdgmime/xdgmimecache.c | 8 +- gio/xdgmime/xdgmimecache.h | 6 + gio/xdgmime/xdgmimeglob.c | 7 + gio/xdgmime/xdgmimeglob.h | 2 + gio/xdgmime/xdgmimeicon.c | 2 + gio/xdgmime/xdgmimeicon.h | 2 + gio/xdgmime/xdgmimeparent.c | 2 + gio/xdgmime/xdgmimeparent.h | 2 + glib-zip.in | 1 + glib/Makefile.am | 91 +- glib/Makefile.in | 312 +- glib/abicheck.sh | 4 +- glib/galias.h | 4449 --- glib/galiasdef.c | 4452 --- glib/galloca.h | 47 + glib/garray.c | 19 +- glib/gasyncqueue.c | 93 +- glib/gatomic-gcc.c | 6 +- glib/gatomic.c | 139 +- glib/gatomic.h | 30 +- glib/gbacktrace.c | 66 +- glib/gbacktrace.h | 14 +- glib/gbase64.c | 211 +- glib/gbase64.h | 44 +- glib/gbitlock.c | 4 - glib/gbookmarkfile.c | 54 +- glib/gbookmarkfile.h | 30 +- glib/gbuffer.c | 3 +- glib/gcache.c | 37 +- glib/gcache.h | 2 +- glib/gchecksum.c | 61 +- glib/gchecksum.h | 40 +- glib/gcompletion.c | 29 +- glib/gcompletion.h | 4 + glib/gconvert.c | 147 +- glib/gconvert.h | 28 +- glib/gdataset.c | 62 +- glib/gdatasetprivate.h | 2 +- glib/gdate.c | 22 +- glib/gdatetime.c | 2426 ++ glib/gdatetime.h | 217 + glib/gdir.c | 25 +- glib/gerror.c | 8 +- glib/gfileutils.c | 12 +- glib/ghash.c | 10 +- glib/ghook.c | 12 +- glib/ghostutils.c | 69 +- glib/giochannel.c | 10 +- glib/giounix.c | 35 +- glib/giowin32.c | 5 +- glib/gkeyfile.c | 156 +- glib/gkeyfile.h | 16 + glib/glib-object.h | 1 + glib/glib.h | 2 + glib/glib.py | 5 +- glib/glib.rc | 8 +- glib/glib.stp.in | 84 + glib/glib.symbols | 107 +- glib/glib_probes.d | 8 + gio/fen/fen-sub.h => glib/glib_trace.h | 38 +- glibconfig.h.win32 => glib/glibconfig.h.win32 | 4 +- .../glibconfig.h.win32.in | 0 glib/glibintl.h | 2 + glib/glist.c | 33 +- glib/glist.h | 2 + glib/gmacros.h | 7 + glib/gmain.c | 976 +- glib/gmain.h | 410 +- glib/gmappedfile.c | 4 - glib/gmarkup.c | 24 +- glib/gmarkup.h | 2 +- glib/gmem.c | 266 +- glib/gmem.h | 108 +- glib/gmessages.c | 31 +- glib/gnode.c | 12 +- glib/gnode.h | 6 +- glib/gnulib/Makefile.am | 2 +- glib/gnulib/Makefile.in | 67 +- glib/gnulib/g-gnulib.h | 1 - glib/goption.c | 1907 +- glib/gpattern.c | 4 - glib/gpoll.c | 12 +- glib/gpoll.h | 30 +- glib/gprimes.c | 10 +- glib/gprintf.c | 36 +- glib/gqsort.c | 8 +- glib/gqueue.c | 12 +- glib/grand.c | 20 +- glib/grand.h | 2 +- glib/gregex.c | 1366 +- glib/gregex.h | 228 + glib/grel.c | 39 +- glib/grel.h | 4 + glib/gscanner.c | 30 +- glib/gsequence.c | 781 +- glib/gsequence.h | 8 + glib/gshell.c | 16 +- glib/gslice.c | 25 +- glib/gslist.c | 373 +- glib/gslist.h | 2 + glib/gspawn-win32.c | 4 - glib/gspawn.c | 13 +- glib/gstdio.c | 49 +- glib/gstdio.h | 66 +- glib/gstrfuncs.c | 1180 +- glib/gstrfuncs.h | 4 +- glib/gstring.c | 81 +- glib/gtester-report | 241 +- glib/gtestutils.c | 88 +- glib/gtestutils.h | 33 +- glib/gthread.c | 16 +- glib/gthread.h | 1 - glib/gthreadpool.c | 11 +- glib/gtimer.c | 110 +- glib/gtimezone.c | 790 + glib/gtimezone.h | 81 + glib/gtree.c | 11 +- glib/gtypes.h | 1 + glib/gunibreak.c | 5 - glib/gunibreak.h | 3 + glib/gunicode.h | 19 +- glib/gunicodeprivate.h | 2 +- glib/gunicollate.c | 15 +- glib/gunidecomp.c | 7 +- glib/guniprop.c | 14 +- glib/gurifuncs.c | 6 +- glib/gutf8.c | 41 +- glib/gutils.c | 206 +- glib/gutils.h | 5 +- glib/gvariant-core.c | 123 +- glib/gvariant-parser.c | 377 +- glib/gvariant-serialiser.c | 45 +- glib/gvariant.c | 921 +- glib/gvariant.h | 50 +- glib/gvarianttype.c | 4 - glib/gvarianttype.h | 29 + glib/gvarianttypeinfo.c | 4 - glib/gwin32.c | 4 - glib/libcharset/Makefile.am | 2 +- glib/libcharset/Makefile.in | 67 +- glib/libglib-gdb.py.in | 6 +- glib/makefile.msc | 14 +- glib/makefile.msc.in | 8 - glib/makegalias.pl | 136 - glib/pcre/Makefile.am | 11 +- glib/pcre/Makefile.in | 87 +- glib/pcre/pcre.h | 20 +- glib/pcre/pcre_compile.c | 1332 +- glib/pcre/pcre_config.c | 6 +- glib/pcre/pcre_dfa_exec.c | 514 +- glib/pcre/pcre_exec.c | 1563 +- glib/pcre/pcre_fullinfo.c | 15 +- glib/pcre/pcre_get.c | 3 + glib/pcre/pcre_globals.c | 23 +- glib/pcre/pcre_info.c | 93 - glib/pcre/pcre_internal.h | 759 +- glib/pcre/pcre_maketables.c | 143 - glib/pcre/pcre_newline.c | 8 +- glib/pcre/pcre_refcount.c | 82 - glib/pcre/pcre_study.c | 448 +- glib/pcre/pcre_tables.c | 631 +- glib/pcre/pcre_try_flipped.c | 6 +- glib/pcre/pcre_ucp_searchfuncs.c | 48 +- glib/pcre/pcre_valid_utf8.c | 14 - glib/pcre/pcre_version.c | 90 - glib/pcre/pcre_xclass.c | 7 +- glib/pcre/ucp.h | 53 +- glib/pcre/ucpinternal.h | 92 - glib/pltcheck.sh | 25 - glib/tests/Makefile.am | 121 +- glib/tests/Makefile.in | 394 +- glib/tests/array-test.c | 488 +- tests/testingbase64.c => glib/tests/base64.c | 190 +- glib/tests/bookmarkfile.c | 298 + glib/tests/bookmarks.xbel | 23 + {tests => glib/tests}/bookmarks/fail-01.xbel | 0 {tests => glib/tests}/bookmarks/fail-02.xbel | 0 {tests => glib/tests}/bookmarks/fail-03.xbel | 0 {tests => glib/tests}/bookmarks/fail-04.xbel | 0 {tests => glib/tests}/bookmarks/fail-05.xbel | 0 {tests => glib/tests}/bookmarks/fail-06.xbel | 0 {tests => glib/tests}/bookmarks/fail-07.xbel | 0 {tests => glib/tests}/bookmarks/fail-08.xbel | 0 {tests => glib/tests}/bookmarks/fail-09.xbel | 0 {tests => glib/tests}/bookmarks/fail-10.xbel | 0 {tests => glib/tests}/bookmarks/fail-11.xbel | 0 {tests => glib/tests}/bookmarks/fail-12.xbel | 0 {tests => glib/tests}/bookmarks/fail-13.xbel | 0 {tests => glib/tests}/bookmarks/fail-14.xbel | 0 {tests => glib/tests}/bookmarks/fail-15.xbel | 0 {tests => glib/tests}/bookmarks/fail-16.xbel | 0 {tests => glib/tests}/bookmarks/fail-17.xbel | 0 {tests => glib/tests}/bookmarks/valid-01.xbel | 0 {tests => glib/tests}/bookmarks/valid-02.xbel | 0 {tests => glib/tests}/bookmarks/valid-03.xbel | 0 tests/checksum-test.c => glib/tests/checksum.c | 189 +- glib/tests/collate.c | 217 + tests/convert-test.c => glib/tests/convert.c | 12 +- glib/tests/date.c | 324 + glib/tests/dir.c | 53 + glib/tests/environment.c | 51 + glib/tests/error.c | 72 + glib/tests/gdatetime.c | 1043 + glib/tests/gvariant.c | 417 +- tests/hash-test.c => glib/tests/hash.c | 318 +- glib/tests/hostutils.c | 61 + glib/tests/keyfile.c | 122 + glib/tests/keyfiletest.ini | 4 + glib/tests/list.c | 384 + glib/tests/logging.c | 147 + {tests => glib/tests}/markup-collect.c | 113 +- glib/tests/markup-escape.c | 159 + glib/tests/markup-parse.c | 290 + glib/tests/markup-subparser.c | 2 +- glib/tests/markups/fail-1.expected | 1 + {tests => glib/tests}/markups/fail-1.gmarkup | 0 glib/tests/markups/fail-10.expected | 4 + {tests => glib/tests}/markups/fail-10.gmarkup | 0 glib/tests/markups/fail-11.expected | 7 + {tests => glib/tests}/markups/fail-11.gmarkup | 0 glib/tests/markups/fail-12.expected | 1 + {tests => glib/tests}/markups/fail-12.gmarkup | 0 glib/tests/markups/fail-13.expected | 1 + {tests => glib/tests}/markups/fail-13.gmarkup | 0 glib/tests/markups/fail-14.expected | 4 + {tests => glib/tests}/markups/fail-14.gmarkup | 0 glib/tests/markups/fail-15.expected | 8 + {tests => glib/tests}/markups/fail-15.gmarkup | 0 glib/tests/markups/fail-16.expected | 2 + {tests => glib/tests}/markups/fail-16.gmarkup | 0 glib/tests/markups/fail-17.expected | 1 + {tests => glib/tests}/markups/fail-17.gmarkup | 0 glib/tests/markups/fail-18.expected | 1 + {tests => glib/tests}/markups/fail-18.gmarkup | 0 glib/tests/markups/fail-19.expected | 1 + {tests => glib/tests}/markups/fail-19.gmarkup | 0 glib/tests/markups/fail-2.expected | 1 + {tests => glib/tests}/markups/fail-2.gmarkup | 0 glib/tests/markups/fail-20.expected | 1 + {tests => glib/tests}/markups/fail-20.gmarkup | 0 glib/tests/markups/fail-21.expected | 1 + {tests => glib/tests}/markups/fail-21.gmarkup | 0 glib/tests/markups/fail-22.expected | 2 + {tests => glib/tests}/markups/fail-22.gmarkup | 0 glib/tests/markups/fail-23.expected | 4 + {tests => glib/tests}/markups/fail-23.gmarkup | 0 glib/tests/markups/fail-24.expected | 1 + {tests => glib/tests}/markups/fail-24.gmarkup | 0 glib/tests/markups/fail-25.expected | 1 + {tests => glib/tests}/markups/fail-25.gmarkup | 0 glib/tests/markups/fail-26.expected | 2 + {tests => glib/tests}/markups/fail-26.gmarkup | 0 glib/tests/markups/fail-27.expected | 2 + {tests => glib/tests}/markups/fail-27.gmarkup | 0 glib/tests/markups/fail-28.expected | 2 + {tests => glib/tests}/markups/fail-28.gmarkup | 0 glib/tests/markups/fail-29.expected | 2 + {tests => glib/tests}/markups/fail-29.gmarkup | 0 {tests => glib/tests}/markups/fail-3.gmarkup | 0 glib/tests/markups/fail-30.expected | 2 + {tests => glib/tests}/markups/fail-30.gmarkup | 0 glib/tests/markups/fail-31.expected | 2 + {tests => glib/tests}/markups/fail-31.gmarkup | 0 glib/tests/markups/fail-32.expected | 2 + {tests => glib/tests}/markups/fail-32.gmarkup | 0 glib/tests/markups/fail-33.expected | 2 + {tests => glib/tests}/markups/fail-33.gmarkup | 0 glib/tests/markups/fail-34.expected | 2 + {tests => glib/tests}/markups/fail-34.gmarkup | 0 glib/tests/markups/fail-35.expected | 2 + {tests => glib/tests}/markups/fail-35.gmarkup | 0 {tests => glib/tests}/markups/fail-36.gmarkup | 0 glib/tests/markups/fail-37.expected | 1 + {tests => glib/tests}/markups/fail-37.gmarkup | 0 glib/tests/markups/fail-38.expected | 3 + {tests => glib/tests}/markups/fail-38.gmarkup | 0 glib/tests/markups/fail-39.expected | 3 + {tests => glib/tests}/markups/fail-39.gmarkup | 0 glib/tests/markups/fail-4.expected | 1 + {tests => glib/tests}/markups/fail-4.gmarkup | 0 glib/tests/markups/fail-40.expected | 2 + {tests => glib/tests}/markups/fail-40.gmarkup | 0 glib/tests/markups/fail-5.expected | 1 + {tests => glib/tests}/markups/fail-5.gmarkup | 0 glib/tests/markups/fail-6.expected | 1 + {tests => glib/tests}/markups/fail-6.gmarkup | 0 glib/tests/markups/fail-7.expected | 1 + {tests => glib/tests}/markups/fail-7.gmarkup | 0 glib/tests/markups/fail-8.expected | 3 + {tests => glib/tests}/markups/fail-8.gmarkup | 0 glib/tests/markups/fail-9.expected | 1 + {tests => glib/tests}/markups/fail-9.gmarkup | 0 .../tests/markups/valid-1.expected | 0 {tests => glib/tests}/markups/valid-1.gmarkup | 0 .../tests/markups/valid-10.expected | 0 {tests => glib/tests}/markups/valid-10.gmarkup | 0 .../tests/markups/valid-11.expected | 0 {tests => glib/tests}/markups/valid-11.gmarkup | 0 .../tests/markups/valid-2.expected | 0 {tests => glib/tests}/markups/valid-2.gmarkup | 0 .../tests/markups/valid-3.expected | 0 {tests => glib/tests}/markups/valid-3.gmarkup | 0 .../tests/markups/valid-4.expected | 0 {tests => glib/tests}/markups/valid-4.gmarkup | 0 .../tests/markups/valid-5.expected | 0 {tests => glib/tests}/markups/valid-5.gmarkup | 0 .../tests/markups/valid-6.expected | 0 {tests => glib/tests}/markups/valid-6.gmarkup | 0 .../tests/markups/valid-7.expected | 0 {tests => glib/tests}/markups/valid-7.gmarkup | 0 .../tests/markups/valid-8.expected | 0 {tests => glib/tests}/markups/valid-8.gmarkup | 0 .../tests/markups/valid-9.expected | 0 {tests => glib/tests}/markups/valid-9.gmarkup | 0 glib/tests/mem-overflow.c | 29 + glib/tests/node.c | 409 + glib/tests/option-context.c | 246 +- glib/tests/pattern.c | 244 + glib/tests/printf.c | 262 +- glib/tests/protocol.c | 340 + glib/tests/queue.c | 1043 + glib/tests/rand.c | 3 +- glib/tests/regex.c | 2599 ++ {tests => glib/tests}/scannerapi.c | 3 + glib/tests/sequence.c | 1362 + glib/tests/shell.c | 229 + glib/tests/slist.c | 301 + glib/tests/strfuncs.c | 33 + glib/tests/string.c | 29 +- glib/tests/testing.c | 31 +- tests/tree-test.c => glib/tests/tree.c | 172 +- tests/uri-test.c => glib/tests/uri.c | 281 +- glib/tests/utf8-misc.c | 448 + {tests => glib/tests}/utf8-pointer.c | 78 +- {tests => glib/tests}/utf8-validate.c | 68 +- glib/tests/utils.c | 160 + glib/update-pcre/Makefile.am-1 | 4 +- glib/update-pcre/Makefile.in | 65 +- glib/update-pcre/memory.patch | 3 +- glib/win_iconv.c | 3921 +-- gmodule/Makefile.am | 10 +- gmodule/Makefile.in | 75 +- gmodule/gmodule-win32.c | 82 +- gmodule/gmodule.rc | 8 +- gobject/Makefile.am | 65 +- gobject/Makefile.in | 184 +- gobject/abicheck.sh | 4 +- gobject/gbinding.c | 1188 + gobject/gbinding.h | 136 + gobject/gboxed.c | 225 +- gobject/gboxed.h | 24 +- gobject/gclosure.c | 66 +- gobject/genums.c | 4 - gobject/glib-genmarshal.1 | 212 - gobject/glib-genmarshal.c | 6 +- gobject/glib-mkenums.1 | 169 - gobject/glib-mkenums.in | 42 +- gobject/gmarshal.c | 118 +- gobject/gmarshal.h | 57 +- gobject/gmarshal.list | 3 + gobject/gmarshal.strings | 2 + gobject/gobject.c | 368 +- gobject/gobject.h | 20 + gobject/gobject.rc | 8 +- gobject/gobject.stp.in | 199 + gobject/gobject.symbols | 36 +- gobject/gobject_probes.d | 13 + gio/fen/fen-sub.c => gobject/gobject_trace.h | 45 +- gobject/gobjectalias.h | 1117 - gobject/gobjectaliasdef.c | 1120 - gobject/gobjectnotifyqueue.c | 69 +- gobject/gparam.c | 16 +- gobject/gparam.h | 13 +- gobject/gparamspecs.c | 129 +- gobject/gparamspecs.h | 54 + gobject/gsignal.c | 50 +- gobject/gsignal.h | 5 + gobject/gsourceclosure.c | 55 +- gobject/gsourceclosure.h | 6 +- gobject/gtype.c | 34 +- gobject/gtype.h | 130 +- gobject/gtypemodule.c | 9 +- gobject/gtypeplugin.c | 4 - gobject/gvalue.c | 17 +- gobject/gvaluearray.c | 45 +- gobject/gvaluecollector.h | 7 +- gobject/gvaluetransform.c | 1 - gobject/gvaluetypes.c | 222 +- gobject/gvaluetypes.h | 17 + gobject/libgobject-gdb.py.in | 6 +- gobject/makefile.msc | 14 +- gobject/makefile.msc.in | 8 - gobject/makegobjectalias.pl | 137 - gobject/pltcheck.sh | 17 - gobject/tests/Makefile.am | 9 +- gobject/tests/Makefile.in | 110 +- gobject/tests/binding.c | 505 + gobject/tests/properties.c | 259 + gobject/tests/reference.c | 35 + gthread/Makefile.am | 8 +- gthread/Makefile.in | 73 +- gthread/gthread.rc | 8 +- gthread/tests/1bit-mutex.c | 9 +- gthread/tests/Makefile.am | 2 +- gthread/tests/Makefile.in | 67 +- gtk-doc.make | 14 +- ltmain.sh | 3968 ++- m4macros/Makefile.am | 2 +- m4macros/Makefile.in | 67 +- m4macros/glib-2.0.m4 | 8 +- m4macros/glib-gettext.m4 | 4 +- m4macros/gsettings.m4 | 83 + po/ChangeLog | 4 + po/LINGUAS | 2 + po/Makefile.in.in | 4 +- po/POTFILES.in | 34 + po/af.gmo | Bin 4896 -> 4896 bytes po/af.po | 1081 +- po/am.gmo | Bin 666 -> 653 bytes po/am.po | 1078 +- po/ar.gmo | Bin 40105 -> 45836 bytes po/ar.po | 2636 +- po/as.gmo | Bin 62502 -> 62489 bytes po/as.po | 1084 +- po/ast.gmo | Bin 44984 -> 44970 bytes po/ast.po | 1124 +- po/az.gmo | Bin 10941 -> 10930 bytes po/az.po | 1079 +- po/be.gmo | Bin 19927 -> 75852 bytes po/be.po | 3520 +- po/be@latin.gmo | Bin 35739 -> 35728 bytes po/be@latin.po | 1111 +- po/bg.gmo | Bin 59543 -> 102158 bytes po/bg.po | 2485 +- po/bn.gmo | Bin 70653 -> 70640 bytes po/bn.po | 1084 +- po/bn_IN.gmo | Bin 67057 -> 67046 bytes po/bn_IN.po | 1084 +- po/bs.gmo | Bin 10609 -> 10596 bytes po/bs.po | 1087 +- po/ca.gmo | Bin 47635 -> 47622 bytes po/ca.po | 1134 +- po/ca@valencia.gmo | Bin 47623 -> 47625 bytes po/ca@valencia.po | 2637 +- po/cs.gmo | Bin 43940 -> 76745 bytes po/cs.po | 2470 +- po/cy.gmo | Bin 25655 -> 25655 bytes po/cy.po | 1086 +- po/da.gmo | Bin 43383 -> 75017 bytes po/da.po | 2475 +- po/de.gmo | Bin 46547 -> 80930 bytes po/de.po | 2568 +- po/dz.gmo | Bin 32294 -> 32283 bytes po/dz.po | 1083 +- po/el.gmo | Bin 60379 -> 104806 bytes po/el.po | 2938 +- po/en@shaw.gmo | Bin 63941 -> 72731 bytes po/en@shaw.po | 1213 +- po/en_CA.gmo | Bin 32454 -> 32443 bytes po/en_CA.po | 1082 +- po/en_GB.gmo | Bin 41565 -> 72813 bytes po/en_GB.po | 2462 +- po/eo.gmo | Bin 9888 -> 33479 bytes po/eo.po | 1922 +- po/es.gmo | Bin 46225 -> 83475 bytes po/es.po | 2730 +- po/et.gmo | Bin 42592 -> 45121 bytes po/et.po | 2107 +- po/eu.gmo | Bin 44833 -> 75189 bytes po/eu.po | 2797 +- po/fa.gmo | Bin 21661 -> 21650 bytes po/fa.po | 1101 +- po/fi.gmo | Bin 44955 -> 47221 bytes po/fi.po | 2677 +- po/fr.gmo | Bin 48527 -> 84455 bytes po/fr.po | 3160 +- po/ga.gmo | Bin 10704 -> 10691 bytes po/ga.po | 1084 +- po/gl.gmo | Bin 46598 -> 83856 bytes po/gl.po | 2928 +- po/glib20.pot | 2612 +- po/gu.gmo | Bin 62079 -> 64744 bytes po/gu.po | 1171 +- po/he.gmo | Bin 40396 -> 75533 bytes po/he.po | 3069 +- po/hi.gmo | Bin 63733 -> 63720 bytes po/hi.po | 1084 +- po/hr.gmo | Bin 15688 -> 15675 bytes po/hr.po | 1087 +- po/hu.gmo | Bin 47079 -> 81223 bytes po/hu.po | 2529 +- po/hy.gmo | Bin 2926 -> 95186 bytes po/hy.po | 3185 +- po/id.gmo | Bin 43548 -> 73450 bytes po/id.po | 3482 +- po/is.gmo | Bin 10045 -> 10034 bytes po/is.po | 1079 +- po/it.gmo | Bin 45842 -> 63224 bytes po/it.po | 2458 +- po/ja.gmo | Bin 49410 -> 80410 bytes po/ja.po | 2950 +- po/ka.gmo | Bin 32236 -> 32223 bytes po/ka.po | 1084 +- po/kk.gmo | Bin 0 -> 5390 bytes po/kk.po | 2813 ++ po/kn.gmo | Bin 71424 -> 71373 bytes po/kn.po | 1110 +- po/ko.gmo | Bin 48296 -> 48285 bytes po/ko.po | 1084 +- po/ku.gmo | Bin 1120 -> 1107 bytes po/ku.po | 1078 +- po/lt.gmo | Bin 44087 -> 77074 bytes po/lt.po | 2524 +- po/lv.gmo | Bin 43513 -> 10291 bytes po/lv.po | 2151 +- po/mai.gmo | Bin 41288 -> 41277 bytes po/mai.po | 1081 +- po/mg.gmo | Bin 17869 -> 17858 bytes po/mg.po | 1083 +- po/mk.gmo | Bin 46636 -> 46623 bytes po/mk.po | 1086 +- po/ml.gmo | Bin 75052 -> 75041 bytes po/ml.po | 1084 +- po/mn.gmo | Bin 17321 -> 17308 bytes po/mn.po | 1100 +- po/mr.gmo | Bin 62698 -> 65366 bytes po/mr.po | 1173 +- po/ms.gmo | Bin 10231 -> 10220 bytes po/ms.po | 1079 +- po/nb.gmo | Bin 43074 -> 59310 bytes po/nb.po | 2622 +- po/nds.gmo | Bin 4721 -> 4710 bytes po/nds.po | 1079 +- po/ne.gmo | Bin 23576 -> 23563 bytes po/ne.po | 1079 +- po/nl.gmo | Bin 38047 -> 52140 bytes po/nl.po | 2844 +- po/nn.gmo | Bin 33776 -> 33763 bytes po/nn.po | 1105 +- po/oc.gmo | Bin 1262 -> 1249 bytes po/oc.po | 1078 +- po/or.gmo | Bin 65800 -> 65787 bytes po/or.po | 1084 +- po/pa.gmo | Bin 61881 -> 109514 bytes po/pa.po | 2616 +- po/pl.gmo | Bin 46252 -> 80159 bytes po/pl.po | 2861 +- po/ps.gmo | Bin 9803 -> 9790 bytes po/ps.po | 1081 +- po/pt.gmo | Bin 44753 -> 77393 bytes po/pt.po | 2449 +- po/pt_BR.gmo | Bin 44585 -> 77224 bytes po/pt_BR.po | 2581 +- po/ro.gmo | Bin 46451 -> 79569 bytes po/ro.po | 2547 +- po/ru.gmo | Bin 60209 -> 60196 bytes po/ru.po | 1116 +- po/rw.gmo | Bin 456 -> 443 bytes po/rw.po | 1096 +- po/si.gmo | Bin 9264 -> 9251 bytes po/si.po | 1080 +- po/sk.gmo | Bin 21235 -> 21222 bytes po/sk.po | 1079 +- po/sl.gmo | Bin 43622 -> 75206 bytes po/sl.po | 2885 +- po/sq.gmo | Bin 36379 -> 36368 bytes po/sq.po | 1140 +- po/sr.gmo | Bin 56703 -> 97311 bytes po/sr.po | 2428 +- po/sr@ije.gmo | Bin 13758 -> 13747 bytes po/sr@ije.po | 1079 +- po/sr@latin.gmo | Bin 44269 -> 76677 bytes po/sr@latin.po | 2439 +- po/sv.gmo | Bin 43450 -> 57703 bytes po/sv.po | 2786 +- po/ta.gmo | Bin 66889 -> 66878 bytes po/ta.po | 1084 +- po/te.gmo | Bin 66989 -> 66976 bytes po/te.po | 1084 +- po/th.gmo | Bin 67865 -> 67852 bytes po/th.po | 1088 +- po/tl.gmo | Bin 16024 -> 16011 bytes po/tl.po | 1091 +- po/tr.gmo | Bin 41573 -> 41560 bytes po/tr.po | 1088 +- po/tt.gmo | Bin 5268 -> 5257 bytes po/tt.po | 1078 +- po/ug.gmo | Bin 0 -> 8404 bytes po/ug.po | 3522 ++ po/uk.gmo | Bin 58393 -> 58382 bytes po/uk.po | 1095 +- po/vi.gmo | Bin 48209 -> 67388 bytes po/vi.po | 1353 +- po/wa.gmo | Bin 4497 -> 4486 bytes po/wa.po | 1083 +- po/xh.gmo | Bin 14213 -> 14200 bytes po/xh.po | 1083 +- po/yi.gmo | Bin 13857 -> 13844 bytes po/yi.po | 1092 +- po/zh_CN.gmo | Bin 37755 -> 73309 bytes po/zh_CN.po | 3182 +- po/zh_HK.gmo | Bin 41708 -> 76085 bytes po/zh_HK.po | 2605 +- po/zh_TW.gmo | Bin 41684 -> 76031 bytes po/zh_TW.po | 2608 +- tests/Makefile.am | 64 +- tests/Makefile.in | 365 +- tests/base64-test.c | 138 - tests/bookmarkfile-test.c | 188 - tests/completion-test.c | 8 + tests/date-test.c | 499 - tests/gobject/Makefile.am | 8 +- tests/gobject/Makefile.in | 73 +- tests/gobject/accumulator.c | 81 + tests/gobject/gvalue-test.c | 38 +- tests/gobject/ifaceproperties.c | 2 +- tests/gobject/paramspec-test.c | 46 +- tests/gobject/testmarshal.c | 41 + tests/gobject/testmarshal.h | 8 + tests/gobject/testmarshal.list | 2 +- tests/list-test.c | 212 - tests/mainloop-test.c | 6 +- tests/markup-escape-test.c | 132 - tests/markup-test.c | 214 - tests/node-test.c | 223 - tests/patterntest.c | 308 - tests/queue-test.c | 962 - tests/refcount/Makefile.am | 6 +- tests/refcount/Makefile.in | 101 +- tests/refcount/properties3.c | 204 + tests/refcount/properties4.c | 169 + tests/regex-test.c | 2122 -- tests/run-bookmark-test.sh | 34 - tests/run-markup-tests.sh | 41 - tests/sequence-test.c | 1301 - tests/shell-test.c | 297 - tests/slist-test.c | 204 - tests/testglib.c | 9 +- 1745 files changed, 386453 insertions(+), 101461 deletions(-) rename configure.in => configure.ac (93%) mode change 100755 => 100644 debian/rules create mode 100644 docs/reference/gio/gdbus.1 create mode 100644 docs/reference/gio/gdbus.xml create mode 100644 docs/reference/gio/gio-querymodules.1 create mode 100644 docs/reference/gio/gio-querymodules.xml create mode 100644 docs/reference/gio/glib-compile-schemas.1 create mode 100644 docs/reference/gio/glib-compile-schemas.xml create mode 100644 docs/reference/gio/gsettings.1 create mode 100644 docs/reference/gio/gsettings.xml create mode 100644 docs/reference/gio/html/GAction.html create mode 100644 docs/reference/gio/html/GActionGroup.html create mode 100644 docs/reference/gio/html/GApplication.html create mode 100644 docs/reference/gio/html/GApplicationCommandLine.html create mode 100644 docs/reference/gio/html/GCredentials.html create mode 100644 docs/reference/gio/html/GDBusAuthObserver.html create mode 100644 docs/reference/gio/html/GDBusConnection.html create mode 100644 docs/reference/gio/html/GDBusMessage.html create mode 100644 docs/reference/gio/html/GDBusMethodInvocation.html create mode 100644 docs/reference/gio/html/GDBusProxy.html create mode 100644 docs/reference/gio/html/GDBusServer.html create mode 100644 docs/reference/gio/html/GPermission.html create mode 100644 docs/reference/gio/html/GPollableInputStream.html create mode 100644 docs/reference/gio/html/GPollableOutputStream.html create mode 100644 docs/reference/gio/html/GProxy.html create mode 100644 docs/reference/gio/html/GProxyAddress.html create mode 100644 docs/reference/gio/html/GProxyResolver.html create mode 100644 docs/reference/gio/html/GSettings.html create mode 100644 docs/reference/gio/html/GSettingsBackend.html create mode 100644 docs/reference/gio/html/GSimpleAction.html create mode 100644 docs/reference/gio/html/GSimpleActionGroup.html create mode 100644 docs/reference/gio/html/GSimplePermission.html create mode 100644 docs/reference/gio/html/GTcpConnection.html create mode 100644 docs/reference/gio/html/GTcpWrapperConnection.html create mode 100644 docs/reference/gio/html/GTlsBackend.html create mode 100644 docs/reference/gio/html/GTlsCertificate.html create mode 100644 docs/reference/gio/html/GTlsClientConnection.html create mode 100644 docs/reference/gio/html/GTlsConnection.html create mode 100644 docs/reference/gio/html/GTlsServerConnection.html create mode 100644 docs/reference/gio/html/GUnixConnection.html create mode 100644 docs/reference/gio/html/GUnixCredentialsMessage.html create mode 100644 docs/reference/gio/html/annotation-glossary.html create mode 100644 docs/reference/gio/html/api-index-2-26.html create mode 100644 docs/reference/gio/html/api-index-2-28.html create mode 100644 docs/reference/gio/html/application.html rename docs/reference/gio/html/{ch19.html => ch26.html} (80%) rename docs/reference/gio/html/{ch20.html => ch27.html} (69%) rename docs/reference/gio/html/{ch20s02.html => ch27s02.html} (65%) rename docs/reference/gio/html/{ch20s03.html => ch27s03.html} (50%) create mode 100644 docs/reference/gio/html/ch28.html create mode 100644 docs/reference/gio/html/ch28s02.html create mode 100644 docs/reference/gio/html/ch28s03.html create mode 100644 docs/reference/gio/html/ch28s04.html create mode 100644 docs/reference/gio/html/ch28s05.html create mode 100644 docs/reference/gio/html/ch28s06.html create mode 100644 docs/reference/gio/html/ch28s07.html create mode 100644 docs/reference/gio/html/ch29.html create mode 100644 docs/reference/gio/html/ch29s02.html create mode 100644 docs/reference/gio/html/ch29s03.html create mode 100644 docs/reference/gio/html/ch29s04.html create mode 100644 docs/reference/gio/html/ch29s05.html create mode 100644 docs/reference/gio/html/ch29s06.html create mode 100644 docs/reference/gio/html/gdbus-convenience.html create mode 100644 docs/reference/gio/html/gdbus-lowlevel.html create mode 100644 docs/reference/gio/html/gdbus.html create mode 100644 docs/reference/gio/html/gio-D-Bus-Addresses.html create mode 100644 docs/reference/gio/html/gio-D-Bus-Introspection-Data.html create mode 100644 docs/reference/gio/html/gio-D-Bus-Utilities.html create mode 100644 docs/reference/gio/html/gio-GDBusError.html create mode 100644 docs/reference/gio/html/gio-Owning-Bus-Names.html create mode 100644 docs/reference/gio/html/gio-TLS-Overview.html create mode 100644 docs/reference/gio/html/gio-Watching-Bus-Names.html create mode 100644 docs/reference/gio/html/gio-querymodules.html create mode 100644 docs/reference/gio/html/glib-compile-schemas.html create mode 100644 docs/reference/gio/html/gsettings.html create mode 100644 docs/reference/gio/html/permissions.html create mode 100644 docs/reference/gio/html/settings.html create mode 100644 docs/reference/gio/html/tls.html create mode 100644 docs/reference/gio/html/tools.html create mode 100644 docs/reference/gio/migrating-gconf.xml create mode 100644 docs/reference/gio/migrating-gdbus.xml rename docs/reference/gio/{migrating.xml => migrating-gnome-vfs.xml} (81%) create mode 100644 docs/reference/gio/migrating-posix.xml create mode 100644 docs/reference/gio/tmpl/gaction.sgml create mode 100644 docs/reference/gio/tmpl/gactiongroup.sgml create mode 100644 docs/reference/gio/tmpl/gapplication.sgml create mode 100644 docs/reference/gio/tmpl/gapplicationcommandline.sgml create mode 100644 docs/reference/gio/tmpl/gcredentials.sgml create mode 100644 docs/reference/gio/tmpl/gdbusaddress.sgml create mode 100644 docs/reference/gio/tmpl/gdbusauthobserver.sgml create mode 100644 docs/reference/gio/tmpl/gdbusconnection.sgml create mode 100644 docs/reference/gio/tmpl/gdbuserror.sgml create mode 100644 docs/reference/gio/tmpl/gdbusintrospection.sgml create mode 100644 docs/reference/gio/tmpl/gdbusmessage.sgml create mode 100644 docs/reference/gio/tmpl/gdbusmethodinvocation.sgml create mode 100644 docs/reference/gio/tmpl/gdbusnameowning.sgml create mode 100644 docs/reference/gio/tmpl/gdbusnamewatching.sgml create mode 100644 docs/reference/gio/tmpl/gdbusproxy.sgml create mode 100644 docs/reference/gio/tmpl/gdbusserver.sgml create mode 100644 docs/reference/gio/tmpl/gdbusutils.sgml create mode 100644 docs/reference/gio/tmpl/gpermission.sgml create mode 100644 docs/reference/gio/tmpl/gpollableinputstream.sgml create mode 100644 docs/reference/gio/tmpl/gpollableoutputstream.sgml create mode 100644 docs/reference/gio/tmpl/gproxy.sgml create mode 100644 docs/reference/gio/tmpl/gproxyaddress.sgml create mode 100644 docs/reference/gio/tmpl/gproxyresolver.sgml create mode 100644 docs/reference/gio/tmpl/gsettings.sgml create mode 100644 docs/reference/gio/tmpl/gsettingsbackend.sgml create mode 100644 docs/reference/gio/tmpl/gsimpleaction.sgml create mode 100644 docs/reference/gio/tmpl/gsimpleactiongroup.sgml create mode 100644 docs/reference/gio/tmpl/gsimplepermission.sgml create mode 100644 docs/reference/gio/tmpl/gtcpconnection.sgml create mode 100644 docs/reference/gio/tmpl/gtcpwrapperconnection.sgml create mode 100644 docs/reference/gio/tmpl/gtls.sgml create mode 100644 docs/reference/gio/tmpl/gtlsbackend.sgml create mode 100644 docs/reference/gio/tmpl/gtlscertificate.sgml create mode 100644 docs/reference/gio/tmpl/gtlsclientconnection.sgml create mode 100644 docs/reference/gio/tmpl/gtlsconnection.sgml create mode 100644 docs/reference/gio/tmpl/gtlsserverconnection.sgml create mode 100644 docs/reference/gio/tmpl/gunixconnection.sgml create mode 100644 docs/reference/gio/tmpl/gunixcredentialsmessage.sgml create mode 100644 docs/reference/glib/html/annotation-glossary.html create mode 100644 docs/reference/glib/html/api-index-2-26.html create mode 100644 docs/reference/glib/html/api-index-2-28.html create mode 100644 docs/reference/glib/html/glib-GDateTime.html create mode 100644 docs/reference/glib/html/glib-GTimeZone.html create mode 100644 docs/reference/glib/tmpl/date-time.sgml create mode 100644 docs/reference/glib/tmpl/timezone.sgml create mode 100644 docs/reference/gobject/html/GBinding.html create mode 100644 docs/reference/gobject/html/annotation-glossary.html create mode 100644 docs/reference/gobject/html/api-index-2-26.html create mode 100644 docs/reference/gobject/html/api-index-2-28.html create mode 100644 docs/reference/gobject/tmpl/gbinding.sgml create mode 100644 gio-windows-2.0.pc.in delete mode 100644 gio/fen/fen-data.c delete mode 100644 gio/fen/fen-data.h delete mode 100644 gio/fen/fen-missing.c create mode 100644 gio/gaction.c create mode 100644 gio/gaction.h create mode 100644 gio/gactiongroup.c create mode 100644 gio/gactiongroup.h create mode 100644 gio/gapplication.c create mode 100644 gio/gapplication.h create mode 100644 gio/gapplicationcommandline.c create mode 100644 gio/gapplicationcommandline.h create mode 100644 gio/gapplicationimpl-dbus.c create mode 100644 gio/gapplicationimpl.h create mode 100644 gio/gcredentials.c create mode 100644 gio/gcredentials.h create mode 100644 gio/gdbus-bash-completion.sh create mode 100644 gio/gdbus-tool.c create mode 100644 gio/gdbusaddress.c create mode 100644 gio/gdbusaddress.h create mode 100644 gio/gdbusauth.c create mode 100644 gio/gdbusauth.h create mode 100644 gio/gdbusauthmechanism.c create mode 100644 gio/gdbusauthmechanism.h create mode 100644 gio/gdbusauthmechanismanon.c create mode 100644 gio/gdbusauthmechanismanon.h create mode 100644 gio/gdbusauthmechanismexternal.c create mode 100644 gio/gdbusauthmechanismexternal.h create mode 100644 gio/gdbusauthmechanismsha1.c create mode 100644 gio/gdbusauthmechanismsha1.h create mode 100644 gio/gdbusauthobserver.c create mode 100644 gio/gdbusauthobserver.h create mode 100644 gio/gdbusconnection.c create mode 100644 gio/gdbusconnection.h create mode 100644 gio/gdbuserror.c create mode 100644 gio/gdbuserror.h create mode 100644 gio/gdbusintrospection.c create mode 100644 gio/gdbusintrospection.h create mode 100644 gio/gdbusmessage.c create mode 100644 gio/gdbusmessage.h create mode 100644 gio/gdbusmethodinvocation.c create mode 100644 gio/gdbusmethodinvocation.h create mode 100644 gio/gdbusnameowning.c create mode 100644 gio/gdbusnameowning.h create mode 100644 gio/gdbusnamewatching.c create mode 100644 gio/gdbusnamewatching.h create mode 100644 gio/gdbusprivate.c create mode 100644 gio/gdbusprivate.h create mode 100644 gio/gdbusproxy.c create mode 100644 gio/gdbusproxy.h create mode 100644 gio/gdbusserver.c create mode 100644 gio/gdbusserver.h create mode 100644 gio/gdbusutils.c create mode 100644 gio/gdbusutils.h create mode 100644 gio/gdelayedsettingsbackend.c create mode 100644 gio/gdelayedsettingsbackend.h create mode 100644 gio/gdummyproxyresolver.c create mode 100644 gio/gdummyproxyresolver.h create mode 100644 gio/gdummytlsbackend.c create mode 100644 gio/gdummytlsbackend.h delete mode 100644 gio/gioalias.h delete mode 100644 gio/gioaliasdef.c create mode 100644 gio/gkeyfilesettingsbackend.c create mode 100644 gio/glib-compile-schemas.c create mode 100644 gio/gmemorysettingsbackend.c create mode 100644 gio/gmemorysettingsbackend.h create mode 100644 gio/gnullsettingsbackend.c create mode 100644 gio/gnullsettingsbackend.h create mode 100644 gio/gpermission.c create mode 100644 gio/gpermission.h create mode 100644 gio/gpollableinputstream.c create mode 100644 gio/gpollableinputstream.h create mode 100644 gio/gpollableoutputstream.c create mode 100644 gio/gpollableoutputstream.h create mode 100644 gio/gproxy.c create mode 100644 gio/gproxy.h create mode 100644 gio/gproxyaddress.c create mode 100644 gio/gproxyaddress.h create mode 100644 gio/gproxyaddressenumerator.c create mode 100644 gio/gproxyaddressenumerator.h create mode 100644 gio/gproxyresolver.c create mode 100644 gio/gproxyresolver.h create mode 100644 gio/gregistrysettingsbackend.c create mode 100644 gio/gregistrysettingsbackend.h create mode 100644 gio/gschema.dtd create mode 100644 gio/gsettings-bash-completion.sh create mode 100644 gio/gsettings-mapping.c create mode 100644 gio/gsettings-mapping.h create mode 100644 gio/gsettings-tool.c create mode 100644 gio/gsettings.c create mode 100644 gio/gsettings.h create mode 100644 gio/gsettingsbackend.c create mode 100644 gio/gsettingsbackend.h create mode 100644 gio/gsettingsbackendinternal.h create mode 100644 gio/gsettingsschema.c create mode 100644 gio/gsettingsschema.h create mode 100644 gio/gsimpleaction.c create mode 100644 gio/gsimpleaction.h create mode 100644 gio/gsimpleactiongroup.c create mode 100644 gio/gsimpleactiongroup.h create mode 100644 gio/gsimplepermission.c create mode 100644 gio/gsimplepermission.h create mode 100644 gio/gsocks4aproxy.c create mode 100644 gio/gsocks4aproxy.h create mode 100644 gio/gsocks4proxy.c create mode 100644 gio/gsocks4proxy.h create mode 100644 gio/gsocks5proxy.c create mode 100644 gio/gsocks5proxy.h create mode 100644 gio/gtcpwrapperconnection.c create mode 100644 gio/gtcpwrapperconnection.h create mode 100644 gio/gtlsbackend.c create mode 100644 gio/gtlsbackend.h create mode 100644 gio/gtlscertificate.c create mode 100644 gio/gtlscertificate.h create mode 100644 gio/gtlsclientconnection.c create mode 100644 gio/gtlsclientconnection.h create mode 100644 gio/gtlsconnection.c create mode 100644 gio/gtlsconnection.h create mode 100644 gio/gtlsserverconnection.c create mode 100644 gio/gtlsserverconnection.h create mode 100644 gio/gunixcredentialsmessage.c create mode 100644 gio/gunixcredentialsmessage.h create mode 100644 gio/gvdb/gvdb-builder.c create mode 100644 gio/gvdb/gvdb-builder.h create mode 100644 gio/gvdb/gvdb-format.h create mode 100644 gio/gvdb/gvdb-reader.c create mode 100644 gio/gvdb/gvdb-reader.h create mode 100644 gio/gwin32inputstream.c create mode 100644 gio/gwin32inputstream.h create mode 100644 gio/gwin32outputstream.c create mode 100644 gio/gwin32outputstream.h delete mode 100755 gio/makegioalias.pl delete mode 100755 gio/pltcheck.sh create mode 100644 gio/strinfo.c create mode 100644 gio/tests/actions.c create mode 100644 gio/tests/appinfo-test-gnome.desktop create mode 100644 gio/tests/appinfo-test-notgnome.desktop create mode 100644 gio/tests/appinfo-test.c create mode 100644 gio/tests/appinfo-test.desktop create mode 100644 gio/tests/appinfo-test2.desktop create mode 100644 gio/tests/appinfo.c create mode 100644 gio/tests/async-close-output-stream.c create mode 100644 gio/tests/buffered-output-stream.c create mode 100644 gio/tests/contenttype.c create mode 100644 gio/tests/de.po create mode 100644 gio/tests/enums.xml.template create mode 100644 gio/tests/file.c create mode 100644 gio/tests/gapplication-example-actions.c create mode 100644 gio/tests/gapplication-example-cmdline.c create mode 100644 gio/tests/gapplication-example-cmdline2.c create mode 100644 gio/tests/gapplication-example-open.c create mode 100644 gio/tests/gapplication.c create mode 100644 gio/tests/gdbus-addresses.c create mode 100644 gio/tests/gdbus-bz627724.c create mode 100644 gio/tests/gdbus-connection-flush-helper.c create mode 100644 gio/tests/gdbus-connection-slow.c create mode 100644 gio/tests/gdbus-connection.c create mode 100644 gio/tests/gdbus-error.c create mode 100644 gio/tests/gdbus-example-export.c create mode 100644 gio/tests/gdbus-example-own-name.c create mode 100644 gio/tests/gdbus-example-peer.c create mode 100644 gio/tests/gdbus-example-proxy-subclass.c create mode 100644 gio/tests/gdbus-example-server.c create mode 100644 gio/tests/gdbus-example-subtree.c create mode 100644 gio/tests/gdbus-example-unix-fd-client.c create mode 100644 gio/tests/gdbus-example-watch-name.c create mode 100644 gio/tests/gdbus-example-watch-proxy.c create mode 100644 gio/tests/gdbus-exit-on-close.c create mode 100644 gio/tests/gdbus-export.c create mode 100644 gio/tests/gdbus-introspection.c create mode 100644 gio/tests/gdbus-message.c create mode 100644 gio/tests/gdbus-names.c create mode 100644 gio/tests/gdbus-non-socket.c create mode 100644 gio/tests/gdbus-peer.c create mode 100644 gio/tests/gdbus-proxy-well-known-name.c create mode 100644 gio/tests/gdbus-proxy.c create mode 100644 gio/tests/gdbus-serialization.c create mode 100644 gio/tests/gdbus-sessionbus.c rename gio/{fen/fen-missing.h => tests/gdbus-sessionbus.h} (58%) create mode 100644 gio/tests/gdbus-tests.c create mode 100644 gio/tests/gdbus-tests.h create mode 100755 gio/tests/gdbus-testserver.py create mode 100644 gio/tests/gdbus-threading.c create mode 100644 gio/tests/gschema-compile.c create mode 100644 gio/tests/gsettings.c create mode 100644 gio/tests/io-stream.c create mode 100644 gio/tests/network-address.c create mode 100644 gio/tests/org.gtk.test.gschema create mode 100644 gio/tests/org.gtk.test.gschema.xml create mode 100644 gio/tests/pollable.c create mode 100644 gio/tests/proxy.c create mode 100644 gio/tests/schema-tests/array-default-not-in-choices.gschema.xml create mode 100644 gio/tests/schema-tests/bad-choice.gschema.xml create mode 100644 gio/tests/schema-tests/bad-key.gschema.xml create mode 100644 gio/tests/schema-tests/bad-key2.gschema.xml create mode 100644 gio/tests/schema-tests/bad-key3.gschema.xml create mode 100644 gio/tests/schema-tests/bad-key4.gschema.xml create mode 100644 gio/tests/schema-tests/bad-type.gschema.xml create mode 100644 gio/tests/schema-tests/bare-alias.gschema.xml create mode 100644 gio/tests/schema-tests/choice-alias.gschema.xml create mode 100644 gio/tests/schema-tests/choice-bad.gschema.xml create mode 100644 gio/tests/schema-tests/choice-badtype.gschema.xml create mode 100644 gio/tests/schema-tests/choice-invalid-alias.gschema.xml create mode 100644 gio/tests/schema-tests/choice-missing-value.gschema.xml create mode 100644 gio/tests/schema-tests/choice-shadowed-alias.gschema.xml create mode 100644 gio/tests/schema-tests/choice-upside-down.gschema.xml create mode 100644 gio/tests/schema-tests/choice.gschema.xml create mode 100644 gio/tests/schema-tests/choices-wrong-type.gschema.xml create mode 100644 gio/tests/schema-tests/default-in-aliases.gschema.xml create mode 100644 gio/tests/schema-tests/default-not-in-choices.gschema.xml create mode 100644 gio/tests/schema-tests/default-out-of-range.gschema.xml create mode 100644 gio/tests/schema-tests/empty-key.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-aliases.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-bad-default.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-chained-alias.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-choice.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-invalid-alias.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-repeated-alias.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-repeated-nick.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-repeated-value.gschema.xml create mode 100644 gio/tests/schema-tests/enum-with-shadow-alias.gschema.xml create mode 100644 gio/tests/schema-tests/enum.gschema.xml create mode 100644 gio/tests/schema-tests/extend-and-shadow-indirect.gschema.xml create mode 100644 gio/tests/schema-tests/extend-and-shadow.gschema.xml create mode 100644 gio/tests/schema-tests/extend-missing.gschema.xml create mode 100644 gio/tests/schema-tests/extend-nonlist.gschema.xml create mode 100644 gio/tests/schema-tests/extend-self.gschema.xml create mode 100644 gio/tests/schema-tests/extend-wrong-list-indirect.gschema.xml create mode 100644 gio/tests/schema-tests/extend-wrong-list.gschema.xml create mode 100644 gio/tests/schema-tests/extending.gschema.xml create mode 100644 gio/tests/schema-tests/flags-aliased-default.gschema.xml create mode 100644 gio/tests/schema-tests/flags-bad-default.gschema.xml create mode 100644 gio/tests/schema-tests/flags-more-than-one-bit.gschema.xml create mode 100644 gio/tests/schema-tests/flags-with-enum-attr.gschema.xml create mode 100644 gio/tests/schema-tests/flags-with-enum-tag.gschema.xml create mode 100644 gio/tests/schema-tests/from-docs.gschema.xml create mode 100644 gio/tests/schema-tests/incomplete-list.gschema.xml create mode 100644 gio/tests/schema-tests/inherit-gettext-domain.gschema.xml create mode 100644 gio/tests/schema-tests/invalid-path.gschema.xml create mode 100644 gio/tests/schema-tests/key-in-list-indirect.gschema.xml create mode 100644 gio/tests/schema-tests/key-in-list.gschema.xml create mode 100644 gio/tests/schema-tests/list-of-missing.gschema.xml create mode 100644 gio/tests/schema-tests/missing-quotes.gschema.xml create mode 100644 gio/tests/schema-tests/no-default.gschema.xml create mode 100644 gio/tests/schema-tests/overflow.gschema.xml create mode 100644 gio/tests/schema-tests/override-missing.gschema.xml create mode 100644 gio/tests/schema-tests/override-range-error.gschema.xml create mode 100644 gio/tests/schema-tests/override-then-key.gschema.xml create mode 100644 gio/tests/schema-tests/override-twice.gschema.xml create mode 100644 gio/tests/schema-tests/override-type-error.gschema.xml create mode 100644 gio/tests/schema-tests/override.gschema.xml create mode 100644 gio/tests/schema-tests/range-badtype.gschema.xml create mode 100644 gio/tests/schema-tests/range-default-high.gschema.xml create mode 100644 gio/tests/schema-tests/range-default-low.gschema.xml create mode 100644 gio/tests/schema-tests/range-high-default.gschema.xml create mode 100644 gio/tests/schema-tests/range-low-default.gschema.xml create mode 100644 gio/tests/schema-tests/range-missing-max.gschema.xml create mode 100644 gio/tests/schema-tests/range-missing-min.gschema.xml create mode 100644 gio/tests/schema-tests/range-parse-error.gschema.xml create mode 100644 gio/tests/schema-tests/range-wrong-type.gschema.xml create mode 100644 gio/tests/schema-tests/range.gschema.xml create mode 100644 gio/tests/schema-tests/wrong-category.gschema.xml create mode 100644 gio/tests/socket-common.c create mode 100644 gio/tests/socket.c create mode 100644 gio/tests/testenum.h create mode 100644 gio/tests/volumemonitor.c create mode 100644 gio/tests/win32-streams.c delete mode 100644 glib/galias.h delete mode 100644 glib/galiasdef.c create mode 100644 glib/gdatetime.c create mode 100644 glib/gdatetime.h create mode 100644 glib/glib.stp.in create mode 100644 glib/glib_probes.d rename gio/fen/fen-sub.h => glib/glib_trace.h (57%) rename glibconfig.h.win32 => glib/glibconfig.h.win32 (99%) rename glibconfig.h.win32.in => glib/glibconfig.h.win32.in (100%) create mode 100644 glib/gtimezone.c create mode 100644 glib/gtimezone.h delete mode 100755 glib/makegalias.pl delete mode 100644 glib/pcre/pcre_info.c delete mode 100644 glib/pcre/pcre_maketables.c delete mode 100644 glib/pcre/pcre_refcount.c delete mode 100644 glib/pcre/pcre_valid_utf8.c delete mode 100644 glib/pcre/pcre_version.c delete mode 100644 glib/pcre/ucpinternal.h delete mode 100755 glib/pltcheck.sh rename tests/testingbase64.c => glib/tests/base64.c (66%) create mode 100644 glib/tests/bookmarkfile.c create mode 100644 glib/tests/bookmarks.xbel rename {tests => glib/tests}/bookmarks/fail-01.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-02.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-03.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-04.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-05.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-06.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-07.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-08.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-09.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-10.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-11.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-12.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-13.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-14.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-15.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-16.xbel (100%) rename {tests => glib/tests}/bookmarks/fail-17.xbel (100%) rename {tests => glib/tests}/bookmarks/valid-01.xbel (100%) rename {tests => glib/tests}/bookmarks/valid-02.xbel (100%) rename {tests => glib/tests}/bookmarks/valid-03.xbel (100%) rename tests/checksum-test.c => glib/tests/checksum.c (86%) create mode 100644 glib/tests/collate.c rename tests/convert-test.c => glib/tests/convert.c (98%) create mode 100644 glib/tests/date.c create mode 100644 glib/tests/dir.c create mode 100644 glib/tests/environment.c create mode 100644 glib/tests/error.c create mode 100644 glib/tests/gdatetime.c rename tests/hash-test.c => glib/tests/hash.c (53%) create mode 100644 glib/tests/keyfiletest.ini create mode 100644 glib/tests/list.c create mode 100644 glib/tests/logging.c rename {tests => glib/tests}/markup-collect.c (67%) create mode 100644 glib/tests/markup-escape.c create mode 100644 glib/tests/markup-parse.c create mode 100644 glib/tests/markups/fail-1.expected rename {tests => glib/tests}/markups/fail-1.gmarkup (100%) create mode 100644 glib/tests/markups/fail-10.expected rename {tests => glib/tests}/markups/fail-10.gmarkup (100%) create mode 100644 glib/tests/markups/fail-11.expected rename {tests => glib/tests}/markups/fail-11.gmarkup (100%) create mode 100644 glib/tests/markups/fail-12.expected rename {tests => glib/tests}/markups/fail-12.gmarkup (100%) create mode 100644 glib/tests/markups/fail-13.expected rename {tests => glib/tests}/markups/fail-13.gmarkup (100%) create mode 100644 glib/tests/markups/fail-14.expected rename {tests => glib/tests}/markups/fail-14.gmarkup (100%) create mode 100644 glib/tests/markups/fail-15.expected rename {tests => glib/tests}/markups/fail-15.gmarkup (100%) create mode 100644 glib/tests/markups/fail-16.expected rename {tests => glib/tests}/markups/fail-16.gmarkup (100%) create mode 100644 glib/tests/markups/fail-17.expected rename {tests => glib/tests}/markups/fail-17.gmarkup (100%) create mode 100644 glib/tests/markups/fail-18.expected rename {tests => glib/tests}/markups/fail-18.gmarkup (100%) create mode 100644 glib/tests/markups/fail-19.expected rename {tests => glib/tests}/markups/fail-19.gmarkup (100%) create mode 100644 glib/tests/markups/fail-2.expected rename {tests => glib/tests}/markups/fail-2.gmarkup (100%) create mode 100644 glib/tests/markups/fail-20.expected rename {tests => glib/tests}/markups/fail-20.gmarkup (100%) create mode 100644 glib/tests/markups/fail-21.expected rename {tests => glib/tests}/markups/fail-21.gmarkup (100%) create mode 100644 glib/tests/markups/fail-22.expected rename {tests => glib/tests}/markups/fail-22.gmarkup (100%) create mode 100644 glib/tests/markups/fail-23.expected rename {tests => glib/tests}/markups/fail-23.gmarkup (100%) create mode 100644 glib/tests/markups/fail-24.expected rename {tests => glib/tests}/markups/fail-24.gmarkup (100%) create mode 100644 glib/tests/markups/fail-25.expected rename {tests => glib/tests}/markups/fail-25.gmarkup (100%) create mode 100644 glib/tests/markups/fail-26.expected rename {tests => glib/tests}/markups/fail-26.gmarkup (100%) create mode 100644 glib/tests/markups/fail-27.expected rename {tests => glib/tests}/markups/fail-27.gmarkup (100%) create mode 100644 glib/tests/markups/fail-28.expected rename {tests => glib/tests}/markups/fail-28.gmarkup (100%) create mode 100644 glib/tests/markups/fail-29.expected rename {tests => glib/tests}/markups/fail-29.gmarkup (100%) rename {tests => glib/tests}/markups/fail-3.gmarkup (100%) create mode 100644 glib/tests/markups/fail-30.expected rename {tests => glib/tests}/markups/fail-30.gmarkup (100%) create mode 100644 glib/tests/markups/fail-31.expected rename {tests => glib/tests}/markups/fail-31.gmarkup (100%) create mode 100644 glib/tests/markups/fail-32.expected rename {tests => glib/tests}/markups/fail-32.gmarkup (100%) create mode 100644 glib/tests/markups/fail-33.expected rename {tests => glib/tests}/markups/fail-33.gmarkup (100%) create mode 100644 glib/tests/markups/fail-34.expected rename {tests => glib/tests}/markups/fail-34.gmarkup (100%) create mode 100644 glib/tests/markups/fail-35.expected rename {tests => glib/tests}/markups/fail-35.gmarkup (100%) rename {tests => glib/tests}/markups/fail-36.gmarkup (100%) create mode 100644 glib/tests/markups/fail-37.expected rename {tests => glib/tests}/markups/fail-37.gmarkup (100%) create mode 100644 glib/tests/markups/fail-38.expected rename {tests => glib/tests}/markups/fail-38.gmarkup (100%) create mode 100644 glib/tests/markups/fail-39.expected rename {tests => glib/tests}/markups/fail-39.gmarkup (100%) create mode 100644 glib/tests/markups/fail-4.expected rename {tests => glib/tests}/markups/fail-4.gmarkup (100%) create mode 100644 glib/tests/markups/fail-40.expected rename {tests => glib/tests}/markups/fail-40.gmarkup (100%) create mode 100644 glib/tests/markups/fail-5.expected rename {tests => glib/tests}/markups/fail-5.gmarkup (100%) create mode 100644 glib/tests/markups/fail-6.expected rename {tests => glib/tests}/markups/fail-6.gmarkup (100%) create mode 100644 glib/tests/markups/fail-7.expected rename {tests => glib/tests}/markups/fail-7.gmarkup (100%) create mode 100644 glib/tests/markups/fail-8.expected rename {tests => glib/tests}/markups/fail-8.gmarkup (100%) create mode 100644 glib/tests/markups/fail-9.expected rename {tests => glib/tests}/markups/fail-9.gmarkup (100%) rename tests/markups/expected-1 => glib/tests/markups/valid-1.expected (100%) rename {tests => glib/tests}/markups/valid-1.gmarkup (100%) rename tests/markups/expected-10 => glib/tests/markups/valid-10.expected (100%) rename {tests => glib/tests}/markups/valid-10.gmarkup (100%) rename tests/markups/expected-9 => glib/tests/markups/valid-11.expected (100%) rename {tests => glib/tests}/markups/valid-11.gmarkup (100%) rename tests/markups/expected-2 => glib/tests/markups/valid-2.expected (100%) rename {tests => glib/tests}/markups/valid-2.gmarkup (100%) rename tests/markups/expected-3 => glib/tests/markups/valid-3.expected (100%) rename {tests => glib/tests}/markups/valid-3.gmarkup (100%) rename tests/markups/expected-4 => glib/tests/markups/valid-4.expected (100%) rename {tests => glib/tests}/markups/valid-4.gmarkup (100%) rename tests/markups/expected-5 => glib/tests/markups/valid-5.expected (100%) rename {tests => glib/tests}/markups/valid-5.gmarkup (100%) rename tests/markups/expected-6 => glib/tests/markups/valid-6.expected (100%) rename {tests => glib/tests}/markups/valid-6.gmarkup (100%) rename tests/markups/expected-7 => glib/tests/markups/valid-7.expected (100%) rename {tests => glib/tests}/markups/valid-7.gmarkup (100%) rename tests/markups/expected-8 => glib/tests/markups/valid-8.expected (100%) rename {tests => glib/tests}/markups/valid-8.gmarkup (100%) rename tests/markups/expected-11 => glib/tests/markups/valid-9.expected (100%) rename {tests => glib/tests}/markups/valid-9.gmarkup (100%) create mode 100644 glib/tests/node.c create mode 100644 glib/tests/pattern.c create mode 100644 glib/tests/protocol.c create mode 100644 glib/tests/queue.c create mode 100644 glib/tests/regex.c rename {tests => glib/tests}/scannerapi.c (96%) create mode 100644 glib/tests/sequence.c create mode 100644 glib/tests/shell.c create mode 100644 glib/tests/slist.c rename tests/tree-test.c => glib/tests/tree.c (58%) rename tests/uri-test.c => glib/tests/uri.c (62%) create mode 100644 glib/tests/utf8-misc.c rename {tests => glib/tests}/utf8-pointer.c (67%) rename {tests => glib/tests}/utf8-validate.c (88%) create mode 100644 glib/tests/utils.c create mode 100644 gobject/gbinding.c create mode 100644 gobject/gbinding.h delete mode 100644 gobject/glib-genmarshal.1 delete mode 100644 gobject/glib-mkenums.1 create mode 100644 gobject/gobject.stp.in create mode 100644 gobject/gobject_probes.d rename gio/fen/fen-sub.c => gobject/gobject_trace.h (56%) delete mode 100644 gobject/gobjectalias.h delete mode 100644 gobject/gobjectaliasdef.c delete mode 100755 gobject/makegobjectalias.pl delete mode 100755 gobject/pltcheck.sh create mode 100644 gobject/tests/binding.c create mode 100644 gobject/tests/properties.c create mode 100644 gobject/tests/reference.c create mode 100644 m4macros/gsettings.m4 create mode 100644 po/kk.gmo create mode 100644 po/kk.po create mode 100644 po/ug.gmo create mode 100644 po/ug.po delete mode 100644 tests/base64-test.c delete mode 100644 tests/bookmarkfile-test.c delete mode 100644 tests/date-test.c delete mode 100644 tests/list-test.c delete mode 100644 tests/markup-escape-test.c delete mode 100644 tests/markup-test.c delete mode 100644 tests/node-test.c delete mode 100644 tests/patterntest.c delete mode 100644 tests/queue-test.c create mode 100644 tests/refcount/properties3.c create mode 100644 tests/refcount/properties4.c delete mode 100644 tests/regex-test.c delete mode 100755 tests/run-bookmark-test.sh delete mode 100755 tests/run-markup-tests.sh delete mode 100644 tests/sequence-test.c delete mode 100644 tests/shell-test.c delete mode 100644 tests/slist-test.c diff --git a/ChangeLog b/ChangeLog index eb4f481..54a1a7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,480 +1,25399 @@ -commit 2d765e1533321b5421b410217fe2acbe183375eb +commit 8f5904ccbcd45d30a7ed6da4f0b8b8f0c221bb99 +Author: Matthias Clasen +Date: Mon Dec 20 14:03:45 2010 -0500 + + Update NEWS + + NEWS | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 45 insertions(+), 0 deletions(-) + +commit 30587a3a602fb0de2540ea220c1484763a18ff47 +Author: Xavier Claessens +Date: Mon Dec 20 18:52:44 2010 +0100 + + Add io-stream in gitignore + + gio/tests/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 8d272eb662180fe60cfa566b669797a0b57cbf0d +Author: Xavier Claessens +Date: Mon Dec 20 18:44:49 2010 +0100 + + Add g_sequence_lookup{_iter} into symbols + + glib/glib.symbols | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 6a10591573a56c5dfe1ac5b8315447f63d29dd39 +Author: Cosimo Cecchi +Date: Mon Dec 20 17:44:51 2010 +0100 + + appinfo: avoid overriding the system defaults when adding support + + We want to be compatible with the following situation: + - there's no explicit default set in mimeapps.list + - we add support for a content type to a specific application, + and that + list is empty + - the default should be picked from the system list, not overridden by + the user-added application. + + So we make the default explicit in this case, by adding it to the + relevant section in mimeapps.list. + + https://bugzilla.gnome.org/show_bug.cgi?id=637675 + + gio/gdesktopappinfo.c | 47 + ++++++++++++++++++++++++++++++++++++++--------- + 1 files changed, 38 insertions(+), 9 deletions(-) + +commit e666a2ed696a9545a23371b53c4a07471b635d5c +Author: Xavier Claessens +Date: Fri Dec 10 10:17:44 2010 +0100 + + Add note in g_sequence_search() doc about g_sequence_lookup() + + glib/gsequence.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 50f96ae79b329154e55ac63b1ab8b0ff650bf871 +Author: Xavier Claessens +Date: Fri Dec 10 10:14:06 2010 +0100 + + Add unit test for g_sequence_lookup() and g_sequence_lookup_iter(). + + glib/tests/sequence.c | 76 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 76 insertions(+), 0 deletions(-) + +commit 4e309043311487d66157383991373107eac1f7b9 +Author: Xavier Claessens +Date: Fri Apr 30 13:55:53 2010 +0200 + + New API: g_sequence_lookup() and g_sequence_lookup_iter() + + Fixes bug #617254 + + docs/reference/glib/glib-sections.txt | 2 + + glib/gsequence.c | 132 + ++++++++++++++++++++++++++++++++- + glib/gsequence.h | 8 ++ + 3 files changed, 141 insertions(+), 1 deletions(-) + +commit 1f9e34cab7b474a2b98c52d111a61f596ae33b58 +Author: Christian Dywan +Date: Mon Dec 20 17:15:15 2010 +0100 + + Allow null object in g_simple_async_report_gerror_in_idle + + Follow-up on bug 636673. + + gio/gsimpleasyncresult.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 678bcad92c2a6350cd5dbf4ea3a567d99cf4c29d +Author: Cosimo Cecchi +Date: Wed Dec 15 17:56:22 2010 +0100 + + appinfo: add g_app_info_set_as_last_used_for_type() + + This commit also changes (maintaining compatibility) the way + user-specified default applications are stored (as in, those for which + g_app_info_set_as_default_for_type() has been called. + + We now store the default application for a content type in a new group + in the mimeapps.list keyfile, and "Added Associations" tracks only the + applications that have been added by the user, following a + most-recently-used first order. + + This is useful in GtkAppChooser-like widgets to pre-select the + last used + application when constructing a widget. + + https://bugzilla.gnome.org/show_bug.cgi?id=636311 + + docs/reference/gio/gio-sections.txt | 1 + + gio/gappinfo.c | 27 ++++ + gio/gappinfo.h | 7 + + gio/gdesktopappinfo.c | 291 + +++++++++++++++++++++++++++-------- + gio/gio.symbols | 1 + + gio/tests/desktop-app-info.c | 51 ++++++ + 6 files changed, 314 insertions(+), 64 deletions(-) + +commit 01ba7bd8e8984609d411b70a8ac9db4e8b64fb06 +Author: Cosimo Cecchi +Date: Thu Dec 9 18:31:19 2010 +0100 + + emblemedicon: make GEmblemedIcon subclassable + + Hiding the object/class structs in the source file makes this + class not + subclassable. + + Move them to the public header, and add a property for the icon, + so that + subclasses can just use + + g_object_new (DERIVED_TYPE, + "gicon", icon, + NULL); + + to create an emblemed icon. + + https://bugzilla.gnome.org/show_bug.cgi?id=636892 + + gio/gemblemedicon.c | 119 + +++++++++++++++++++++++++++++++++++++-------------- + gio/gemblemedicon.h | 14 ++++++ + 2 files changed, 101 insertions(+), 32 deletions(-) + +commit bc4e1fc622d0bc61f8978a6c3df98d6c0ab12226 +Author: Matthias Clasen +Date: Mon Dec 20 09:16:05 2010 -0500 + + Add a delay-apply property to GSettings + + Bug 637147, patch by Matt Barnes. + + gio/gsettings.c | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +commit 21c764cd9fca4d0568258d84cbb82b858d06292a +Author: Mattias Põldaru +Date: Mon Dec 20 13:55:19 2010 +0200 + + [l10n] Updated Estonian translation + + po/et.po | 565 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 373 insertions(+), 192 deletions(-) + +commit fef417575c1cac47f9d9a2b386ad386ec4272d45 +Author: Nguyễn Thái Ngọc Duy +Date: Mon Dec 20 17:26:00 2010 +0700 + + Updated Vietnamese translation + + po/vi.po | 621 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 319 insertions(+), 302 deletions(-) + +commit 3264d8d1598916a59775ed07969ff0d20b8790e0 +Author: Pavel Holejsovsky +Date: Sun Dec 19 22:15:42 2010 +0100 + + Add GI annotations to GClosure and friends. + + gobject/gclosure.c | 29 +++++++++++++++-------------- + gobject/gobject.c | 2 +- + 2 files changed, 16 insertions(+), 15 deletions(-) + +commit ea577d60d451bc7102695046fb1c3f80fb3e1769 +Author: Pavel Holejsovsky +Date: Sun Dec 19 10:39:36 2010 +0100 + + Add GI annotations to GValue and GValueArray. + + gobject/gboxed.c | 4 ++-- + gobject/gobject.c | 6 +++--- + gobject/gparam.c | 4 ++-- + gobject/gvalue.c | 13 ++++++------- + gobject/gvaluearray.c | 29 +++++++++++++++-------------- + gobject/gvaluetypes.c | 2 +- + 6 files changed, 29 insertions(+), 29 deletions(-) + +commit ddc126cf2cbbdbc3a98e7bd397f19fb0ac8c27c4 +Author: Christian Dywan +Date: Fri Dec 10 15:07:04 2010 +0100 + + g_simple_async_report_error_in_idle with no object + + Document and allow passing of NULL for the object consistently to + _take_error and _report_error functions. + + Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=636673 + + gio/gsimpleasyncresult.c | 15 +++++++-------- + 1 files changed, 7 insertions(+), 8 deletions(-) + +commit f0354ff0590f0350ebdb1ee8eb84e7b6cdd1e850 +Author: Javier Jardón +Date: Fri Dec 17 16:12:16 2010 +0000 + + grand: Fix URLs for info on the Mersenne Twister + + Reported by Allin Cottrell here: + http://mail.gnome.org/archives/gtk-devel-list/2010-December/msg00134.html + + glib/grand.c | 4 ++-- + glib/grand.h | 2 +- + glib/tests/rand.c | 3 ++- + 3 files changed, 5 insertions(+), 4 deletions(-) + +commit 89b558077f97c630c5b26b3527a6c7d0515f1f2c +Author: Pavel Holejsovsky +Date: Fri Dec 17 16:24:33 2010 +0100 + + [gi] Add annotations for GFile, G[File]{Input|Output|IO}Stream. + + Also make parameter names in virtual function declarations consistent + to silent g-ir-scanner. + + gio/gfile.c | 183 + ++++++++++++++++++++++++----------------------- + gio/gfileinputstream.c | 8 +- + gio/gfileinputstream.h | 2 +- + gio/gfileiostream.c | 8 +- + gio/gfileiostream.h | 2 +- + gio/gfileoutputstream.h | 2 +- + gio/ginputstream.c | 28 ++++---- + gio/giostream.c | 14 ++-- + gio/goutputstream.c | 36 +++++----- + gio/goutputstream.h | 2 +- + 10 files changed, 143 insertions(+), 142 deletions(-) + +commit 101dcecb1f1c53041c228cd4f5c4580743a7362a +Author: Matthias Clasen +Date: Fri Dec 17 08:35:54 2010 -0500 + + Update symbols list for recent changes + + gio/gio.symbols | 18 +++--------------- + 1 files changed, 3 insertions(+), 15 deletions(-) + +commit ac4722df1c9802b0c78bba31aa9004348eb1813d +Author: Will Thompson +Date: Fri Dec 17 12:34:28 2010 +0000 + + g_object_get_property: document that value must be initialized + + I couldn't tell from reading the documentation whether I had to + pass in + an uninitialized value, or a value initialized to the exact type, or + something else. It turns out (from reading the source) that you + have to + pass in an initialized value, but you can use any type to which the + property's actual type can be transformed. + + So, let's document this. + + gobject/gobject.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit d3ce12571cf8dc9f925ffa344887c26b16bcbf1e +Author: Kjartan Maraas +Date: Fri Dec 17 13:03:18 2010 +0100 + + Updated Norwegian bokmål translation + + po/nb.po | 275 + ++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 144 insertions(+), 131 deletions(-) + +commit f33ccd4b41aa4d3bfde71adefef74bb22c6bffcb +Author: Pavel Holejsovsky +Date: Thu Dec 16 21:06:51 2010 +0100 + + [gi] Fix GObject.Object annotations. + + gio/gsettings.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 6f215e477dd91446f64d3ae4a05e47d0138a5d0d +Author: John (J5) Palmieri +Date: Thu Dec 16 13:44:56 2010 -0500 + + [gi] add annotations for methods which take a gpointer which are + really GObjects + + * bindings need to know how to marshal the pointer otherwise they + send in + the raw wrapped pointer causing crashes + + gio/gsettings.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 2b6c801d10b5ee1ab11cf0612e34db74c6985fbd +Author: Murray Cumming +Date: Thu Dec 16 10:57:18 2010 +0100 + + gioenums.h: Remove a trailing comma. + + gio/gioenums.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 274ef35fd44ca272d80966a9f1fd17ecce1bc46f +Author: Cosimo Cecchi +Date: Tue Dec 14 18:33:17 2010 +0100 + + tests: remove a bogus assumption + + gio/tests/desktop-app-info.c | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +commit 683a5632c89b311111503a03290ff75ad705ac46 +Author: Matthias Clasen +Date: Wed Dec 15 11:56:44 2010 -0500 + + Remove GPeriodic for now + + The necessary review and integration work has not happened, and + we don't want to enshrine it in this unproven state. + It will be back when the world is ready for it. + + docs/reference/gio/gio-docs.xml | 4 - + docs/reference/gio/gio-sections.txt | 26 -- + docs/reference/gio/gio.types | 1 - + gio/Makefile.am | 2 - + gio/gio.h | 1 - + gio/gperiodic.c | 765 + ----------------------------------- + gio/gperiodic.h | 88 ---- + 7 files changed, 0 insertions(+), 887 deletions(-) + +commit 1bbf4cb87c2a0b028de4b65377d0b21cbb49d8f2 +Author: Matthias Clasen +Date: Wed Dec 15 11:41:05 2010 -0500 + + Remove the dead --disable-visiblity configure option + + At the same time, document --disable-Bsymbolic. + + configure.ac | 8 -------- + docs/reference/glib/building.sgml | 25 ++++++++++++------------- + gthread/tests/1bit-mutex.c | 3 --- + 3 files changed, 12 insertions(+), 24 deletions(-) + +commit 9411d0c108d6c5b122f82666467ad9cb42eeccd1 +Author: Cosimo Cecchi +Date: Wed Dec 15 12:50:59 2010 +0100 + + docs: fix a typo + + gio/gemblemedicon.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit bfee021cfb24a97b99612f6314e9309f3a70f6db +Author: Cosimo Cecchi +Date: Wed Dec 15 12:49:22 2010 +0100 + + emblemedicon: add docs for _clear_emblems() + + docs/reference/gio/gio-sections.txt | 1 + + gio/gemblemedicon.c | 8 ++++++++ + gio/gio.symbols | 1 + + 3 files changed, 10 insertions(+), 0 deletions(-) + +commit f53d518a3de99eb8418a35b8f1e163026130687b +Author: Cosimo Cecchi +Date: Thu Dec 9 18:16:17 2010 +0100 + + emblemedicon: add g_emblemed_icon_clear_emblems() + + https://bugzilla.gnome.org/show_bug.cgi?id=637171 + + gio/gemblemedicon.c | 12 ++++++++++++ + gio/gemblemedicon.h | 1 + + 2 files changed, 13 insertions(+), 0 deletions(-) + +commit 056a5d753d14b505c3250ccb4a5de92dbdc67a58 +Author: Cosimo Cecchi +Date: Tue Dec 14 17:16:31 2010 +0100 + + gapplication: plug a memory leak + + https://bugzilla.gnome.org/show_bug.cgi?id=637237 + + gio/gapplicationimpl-dbus.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 8c742aea720d491fc62eac24dbdab8986a849c2d +Author: Pavel Holejsovsky +Date: Wed Dec 15 11:17:00 2010 +0100 + + Add missing annotations to GApplication and GApplicationCommandLine. + + gio/gapplication.c | 8 ++++---- + gio/gapplicationcommandline.c | 8 +++++--- + 2 files changed, 9 insertions(+), 7 deletions(-) + +commit 7ee902a3d05cc74a4edaf0197e076611401c029c +Author: Dan Winship +Date: Fri Dec 10 11:42:56 2010 +0100 + + ghostutils: Convert non-ASCII dots to '.' when converting hostnames + + Also add some test cases to test/hostutils for that and a few other + things, and make the test program just act as an ASCII/unicode + hostname converter rather than a test program if it's run with an + argument. + + https://bugzilla.gnome.org/show_bug.cgi?id=633350 + + glib/ghostutils.c | 53 +++++++++++++++++++++++++++++++++-------- + glib/tests/hostutils.c | 61 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 103 insertions(+), 11 deletions(-) + +commit 09ce9dc542b26e133bc798f9a0382b642aea4470 +Author: Ted Gould +Date: Mon Dec 13 13:33:15 2010 -0500 + + Bug 635626 – GDBus message idle can execute while flushes are + pending + + https://bugzilla.gnome.org/show_bug.cgi?id=635626 + + Signed-off-by: David Zeuthen + + gio/gdbusprivate.c | 14 +++++++++++++- + 1 files changed, 13 insertions(+), 1 deletions(-) + +commit 735fcf918e70035874b50785524d25eda557d51f +Author: Peng Huang +Date: Mon Dec 13 13:09:38 2010 -0500 + + Bug 632544 – Cannot send a locked message with PRESERVE_SERIAL flag + + https://bugzilla.gnome.org/show_bug.cgi?id=632544 + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 3 ++- + gio/tests/gdbus-connection.c | 18 +++++++++++++++--- + 2 files changed, 17 insertions(+), 4 deletions(-) + +commit a855f7270066a9268d52e97ad301315d27a6edb7 +Author: Xavier Claessens +Date: Mon Dec 13 17:59:47 2010 +0100 + + Add GIOStreamSpliceFlags to doc + + docs/reference/gio/gio-sections.txt | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e4f25c0fed49acc46de2519837b78db6c12b2df4 +Author: Xavier Claessens +Date: Mon Dec 13 17:42:11 2010 +0100 + + Add Since 2.28 in g_io_stream_splice doc + + gio/gioenums.h | 2 ++ + gio/giostream.c | 4 ++++ + 2 files changed, 6 insertions(+), 0 deletions(-) + +commit 0a2d47b626d130b0b795f76147c68132ede73b08 +Author: Xavier Claessens +Date: Fri Aug 13 10:10:48 2010 +0200 + + Add g_io_stream_splice_async/finish() + + That function splice the output stream of both GIOStreams to the + input stream + of the other GIOStream. + + docs/reference/gio/gio-sections.txt | 2 + + gio/gioenums.h | 19 +++ + gio/giostream.c | 248 + +++++++++++++++++++++++++++++++++++ + gio/giostream.h | 11 ++ + gio/tests/Makefile.am | 4 + + gio/tests/io-stream.c | 185 ++++++++++++++++++++++++++ + 6 files changed, 469 insertions(+), 0 deletions(-) + +commit 69c6e41b54085a7febc769f3b0582abf7c650a5f +Author: Matthias Clasen +Date: Mon Dec 13 09:04:28 2010 -0500 + + Document the GIO_USE_TLS environment variable + + docs/reference/gio/overview.xml | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +commit 78c34bb34f6035e01ee41a57ab4b3f2c2f91cc4d +Author: Christian Persch +Date: Tue Nov 16 19:22:10 2010 +0100 + + Fix gsettings enum rule to work with non-srcdir builds + + Bug #635007. + + m4macros/gsettings.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit ce50df7e0e744a5a6f3d9e41d2b2f872f6174792 +Author: Christian Persch +Date: Tue Nov 9 22:56:28 2010 +0100 + + Better error reporting for g_variant_parse() + + Add error codes, and use them when setting the GError. + + Bug #634583. + + gio/gsettings-tool.c | 4 ++- + glib/gvariant-parser.c | 83 + +++++++++++++++++++++++++++++++++++++++--------- + glib/gvariant.h | 19 ++++++++++- + 3 files changed, 89 insertions(+), 17 deletions(-) + +commit ad56426bc784ab0979264058444781246e42661f +Author: Dan Winship +Date: Fri Dec 10 10:01:01 2010 +0100 + + Add missing property to GDummyTlsCertificate + + gio/gdummytlsbackend.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit ca38bddd6e5dc18db8fd8695d88c4de5183c7fe9 +Author: Benjamin Otte +Date: Tue Dec 7 17:55:03 2010 +0100 + + gio: Add a count to the resolver test for number of enumerators + + This adds the nice stress-test feature of having 5 enumerators running + at the same time. Yay! + + gio/tests/resolver.c | 40 ++++++++++++++++++++++++++-------------- + 1 files changed, 26 insertions(+), 14 deletions(-) + +commit bd227f52195f28460bc96d719d1ff70c28966d26 +Author: Benjamin Otte +Date: Tue Dec 7 17:25:01 2010 +0100 + + gio: Make enumerating a GNetworkAddress work more than once + + Previously, the code only initialized the enumerator if the address + hadn't had cached addresses. But creating an enumerator cached the + addresses, so the second one failed to work. + + gio/gnetworkaddress.c | 94 + ++++++++++++++++++++++++++----------------------- + 1 files changed, 50 insertions(+), 44 deletions(-) + +commit 07fd29c3236e479a217a5ad9875075537dfb3173 +Author: Benjamin Otte +Date: Tue Dec 7 16:06:38 2010 +0100 + + tls: Make g_tls_{client|server}_connection_new() return a GIOStream + + The main use case for these objects is as an IO stream, so it makes + sense to return them that way from the start. + + gio/gsocketclient.c | 12 +++++++----- + gio/gtlsclientconnection.c | 4 ++-- + gio/gtlsclientconnection.h | 2 +- + gio/gtlsserverconnection.c | 4 ++-- + gio/gtlsserverconnection.h | 2 +- + gio/tests/socket-client.c | 2 +- + gio/tests/socket-server.c | 4 ++-- + 7 files changed, 16 insertions(+), 14 deletions(-) + +commit c59ba60fbe0ad4d45b2d84608bece5bb032c3aa9 +Author: Benjamin Otte +Date: Tue Dec 7 15:42:10 2010 +0100 + + tls: Clarify docs for g_tls_client_connection_set_validation_flags() + + And fix a typo in there. + + gio/gtlsclientconnection.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 85adbc99bfa079df777ca148884e52fead3bfe7b +Author: Emilio Pozuelo Monfort +Date: Tue Dec 7 17:45:06 2010 +0100 + + Fix error in GSimpleAsyncResult example + + gio/gsimpleasyncresult.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f5c3e0d3d5aeed065fd09293dae6574b4a31568c +Author: Dan Winship +Date: Tue Dec 7 14:58:42 2010 +0100 + + Change the handling of the peer certificate in GTlsConnection + + Make the certificate and peer-certificate properties virtual, and add + peer-certificate-errors as well. Change the documentation on + peer-certificate to say that it's not set until after the handshake + succeeds (which means notify::peer-certificate can be used to tell + when a handshake has completed). + + docs/reference/gio/gio-sections.txt | 2 +- + gio/gio.symbols | 2 +- + gio/gtlsconnection.c | 162 + ++++++++++++++++------------------- + gio/gtlsconnection.h | 60 ++++++------- + 4 files changed, 105 insertions(+), 121 deletions(-) + +commit b5a707ec90f75aac499c9804592ebb14257cf751 +Author: Dan Winship +Date: Mon Dec 6 17:21:16 2010 +0100 + + Clarify that g_socket_client_connect_to_uri() doesn't know about TLS + + gio/gsocketclient.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 4f6efb681d7a85d9d04ffdba9a5f692e3d53e41e +Author: Dan Winship +Date: Mon Dec 6 13:10:09 2010 +0100 + + Change the semantics of GTlsConnection:require-close-notify + + We were combining "allow un-notified closes" and "close without + notifying" into a single property, which meant that it was impossible + to "be liberal in what you accept and conservative in what you send". + Change require-close-notify to only be about the peer behavior, and + make our connections always close-notify properly when closing (while + noting that you can just close the base-io-stream directly if you want + to do an unclean close). + + gio/gtlsconnection.c | 32 ++++++++++++++++++++------------ + 1 files changed, 20 insertions(+), 12 deletions(-) + +commit 68a3d6b27fec3bdbba27b414c0ed10396c79d3c6 +Author: Dan Winship +Date: Mon Dec 6 12:43:59 2010 +0100 + + add G_TLS_ERROR_UNAVAILABLE + + gio/gdummytlsbackend.c | 4 ++-- + gio/gioenums.h | 2 ++ + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 95cba183494a78ff16924e820c344e8c3fa0e7a6 +Author: Dan Winship +Date: Mon Dec 6 11:04:13 2010 +0100 + + Remove GTlsConnection::need-certificate + + Trying to do this as a signal won't work well with either + GTlsCertificateDB (in which case looking up a certificate in the db is + a blocking/asynchronous act) or session resumption support (in which + case the certificate or lack thereof is part of the session definition + and so needs to be known immediately). Make the caller use + g_tls_connection_set_certificate() ahead of time (or when retrying) + instead. + + docs/reference/gio/gio-sections.txt | 1 - + gio/gio.symbols | 1 - + gio/gioenums.h | 2 +- + gio/gtlsclientconnection.c | 3 +- + gio/gtlsconnection.c | 131 + +++++++++-------------------------- + gio/gtlsconnection.h | 3 - + 6 files changed, 35 insertions(+), 106 deletions(-) + +commit d6e94070ddb015e73573a620234a8929f8aaac16 +Author: Dan Winship +Date: Wed Dec 1 13:49:39 2010 -0500 + + Add GTlsConnection:use-system-certdb + + This can be set FALSE if you don't want to validate certificates + against the system database. + + docs/reference/gio/gio-sections.txt | 2 + + gio/gdummytlsbackend.c | 3 +- + gio/gio.symbols | 2 + + gio/gtlsconnection.c | 70 + +++++++++++++++++++++++++++++++++++ + gio/gtlsconnection.h | 4 ++ + 5 files changed, 80 insertions(+), 1 deletions(-) + +commit 73d6bd8a45429f03706ac96e5d6e045ecee18500 +Author: Dan Winship +Date: Tue Nov 30 19:57:16 2010 -0500 + + Add g_tls_certificate_verify() + + Add a method to verify a certificate against a CA; this can be used + for apps that need to test against non-default CAs. + + Also make the GTlsCertificate::issuer property virtual + + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gtlscertificate.c | 92 + ++++++++++++++++++----------------- + gio/gtlscertificate.h | 32 ++++++++----- + 4 files changed, 69 insertions(+), 57 deletions(-) + +commit 6b631fa106e833c265a4bdc6c021777e2a219f12 +Author: Aron Xu +Date: Mon Dec 6 12:44:18 2010 +0000 + + Complete Simplified Chinese translation. + + po/zh_CN.po | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 67ab5579ba3c9c6a66e82313a61de8fdc9731b15 +Author: Aron Xu +Date: Mon Dec 6 12:40:03 2010 +0000 + + Update Simplified Chinese translation. + + po/zh_CN.po | 672 + ++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 348 insertions(+), 324 deletions(-) + +commit 8530a3b029b7f691284d74e6e0c7883ba4a14725 +Author: Chris Kühl +Date: Mon Dec 6 00:34:43 2010 +0100 + + Added note in g_slist_free about using *free_full to mirror GList docs + + glib/gslist.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 1a638926ff183ddb9afec8c364a58c191457e237 +Author: Yaron Shahrabani +Date: Sun Dec 5 13:19:55 2010 +0200 + + Updated Hebrew translation + + po/he.po | 258 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 136 insertions(+), 122 deletions(-) + +commit b52294d14ce7097c34538d4646f298461fb8d36e +Author: Matthias Clasen +Date: Sat Dec 4 14:12:07 2010 -0500 + + Try to fix the version test on builders + + glib/tests/utils.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +commit 5b43de29327e1f829036ba9629835d2245f15cd3 +Author: Chao-Hsiung Liao +Date: Sat Dec 4 20:01:37 2010 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + + po/zh_HK.po | 1472 + ++++++++++++++++++++++++++++++++++------------------------ + po/zh_TW.po | 1491 + ++++++++++++++++++++++++++++++++++------------------------- + 2 files changed, 1720 insertions(+), 1243 deletions(-) + +commit 4b28e6a0084118c78c177da3f66c8005498b9873 +Author: Matthias Clasen +Date: Fri Dec 3 14:48:35 2010 -0500 + + Add missing Since: tag + + g_simple_async_result_is_valid was added in 2.20. + + Bug 636351 + + gio/gsimpleasyncresult.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 658572978b18cd11ba9d93c02d41969e1d7438eb +Author: Matthias Clasen +Date: Fri Dec 3 14:45:09 2010 -0500 + + Reword awkward sentence in the docs + + Pointed out in bug 636305, the docs for g_queue_remove_all() had + several grammatical errors and sounded awkward. + + glib/gqueue.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 99332dd27c8a62b6d72c70fe284c0477c99d2c61 +Author: Matthias Clasen +Date: Fri Dec 3 14:39:59 2010 -0500 + + Avoid shadowing dir builtin + + This is the same change that was already applied to the other gdb + script we ship. I had forgotten there was a second one. + + glib/libglib-gdb.py.in | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit d11f413345f8ae3da92f4aebcf828ed133cbafbb +Author: Colin Walters +Date: Fri Dec 3 14:25:51 2010 -0500 + + introspection: Remove spurious trailing : + + This isn't valid syntax. + + gio/gsimpleasyncresult.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 807101272893f27469bb5c507c7967334a5a0b8e +Author: Matthias Clasen +Date: Fri Dec 3 14:08:36 2010 -0500 + + Avoid shadowing the dir builtin + + Proposed by David Malcolm, + + https://bugzilla.gnome.org/show_bug.cgi?id=636387 + + gobject/libgobject-gdb.py.in | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 05428e3c1ac4888b841fca3aeb9c7c9b299d2280 +Author: Colin Walters +Date: Fri Dec 3 10:36:16 2010 -0500 + + glib: Document g_string_free semantics better in the FALSE case + + glib/gstring.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 426f90e3cf9f21c6b020cecb05116b331546fe58 +Author: Christian Dywan +Date: Fri Dec 3 16:33:24 2010 +0100 + + Resolve warnings about istream and ostream in socket test + + gio/tests/socket-client.c | 6 +++++- + gio/tests/socket-server.c | 6 ++++++ + 2 files changed, 11 insertions(+), 1 deletions(-) + +commit 8f19d06ed932b8fa8b1d58c7a5676aa5590be1e4 +Author: Thomas Hindoe Paaboel Andersen +Date: Tue Nov 30 02:12:16 2010 +0100 + + Fix typo in docs for extension point + + Introduced in fcd3e3422749ddbbf29809fcc90ffe8df9d5f696 + + docs/reference/gio/overview.xml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 889889a296bfe58fc42a778d792d7f83f816145b +Author: Benjamin Otte +Date: Thu Dec 2 20:10:23 2010 +0100 + + glib: Fix enumeration warnings from gcc 4.5 + + Just introduce more values for our private enum for the cases + that were + missing. + + glib/giounix.c | 19 ++++++++++++------- + 1 files changed, 12 insertions(+), 7 deletions(-) + +commit 67740263e9a3de840e527dd45ba3d6feff512839 +Author: Benjamin Otte +Date: Thu Dec 2 20:09:59 2010 +0100 + + gobject: Cast token type to guint to avoid gcc warning + + The usual fix for all things GScanner... + + gobject/glib-genmarshal.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b9a98a81dad104058a11a4b788a64b21b235c62d +Author: Benjamin Otte +Date: Thu Dec 2 20:09:08 2010 +0100 + + gio: Comment out a whole test + + ... instead of just commenting out the registration and leaving + "unused + function" warnings for gcc. + + gio/tests/gdbus-peer.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit b92e2cd8f8d88a62f14c49e8255802512c156152 +Author: Benjamin Otte +Date: Thu Dec 2 20:08:34 2010 +0100 + + gio: Remove unused variables from test + + gio/tests/gapplication-example-actions.c | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +commit 3e61cb2fcc7648254192d0f174b437336b21c89b +Author: Bastien Nocera +Date: Thu Dec 2 16:59:22 2010 +0000 + + Fix typo in API docs for GDateTime + + s/monty/month/ + + glib/gdatetime.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9fe7fd9120940a2d50ff660f1a3cf7efd08ac01b +Author: Matthew Barnes +Date: Tue Nov 30 18:19:12 2010 -0600 + + Bug 636100 - Can't read GSettings:backend property + + The PROP_BACKEND case was missing from the switch statement in + g_settings_get_property(). + + gio/gsettings.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit beec9743eba6013229befafdfe120cd7701d5214 +Author: Damien Lespiau +Date: Tue Nov 30 23:04:17 2010 +0000 + + gmain: Add Since: 2.28 tag to g_source_{add,remove}_child_source + + New API should have gtk-doc tags to document the version it was + introduced. + + Signed-off-by: Javier Jardón + + glib/gmain.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit c541d234855dc7466c57ebfc3dc44b1829d9a900 +Author: Jorge González +Date: Tue Nov 30 23:42:08 2010 +0100 + + Updated Spanish translation + + po/es.po | 329 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 163 insertions(+), 166 deletions(-) + +commit fdc6c5fbc171187c6c2d7fdf94d0eea7992d11f4 +Author: Fran Diéguez +Date: Mon Nov 29 17:35:51 2010 +0100 + + Updated Galician translations + + po/gl.po | 159 + +++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 86 insertions(+), 73 deletions(-) + +commit c897dea8c164bc081623c13ac4474bcbd66b908d +Author: Matthias Clasen +Date: Mon Nov 29 10:36:43 2010 -0500 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit ff8817b631ab11f00c98ed372746b464a440e7c0 +Author: Matthias Clasen +Date: Mon Nov 29 09:30:07 2010 -0500 + + Update POTFILES.in + + po/POTFILES.in | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 50a8b039a4323faf0fac68bece1be151f7fd2986 +Author: Dan Winship +Date: Mon Nov 29 09:36:07 2010 -0500 + + tiny fix to g_io_modules_scan_all_in_directory() docs + + gio/giomodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 78103b2f1feb5ccbdc97e47d857133826f22820d +Author: Xan Lopez +Date: Mon Nov 29 15:29:12 2010 +0100 + + gsettingsschema: plug leak + + gio/gsettingsschema.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit d7a83d2f590a3568c12a50f31ed5fdc9fc691a47 +Author: Matthias Clasen +Date: Mon Nov 29 08:10:11 2010 -0500 + + Add another bug + + NEWS | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 98bfc8afdaabffe4b63215727a580a139b7f07db +Author: Aleksander Morgado +Date: Thu Nov 18 18:00:57 2010 +0100 + + Fixes GB#635187: Always unbox GVariant parameter received via dbus + for an action + + gio/gapplicationimpl-dbus.c | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit fcd3e3422749ddbbf29809fcc90ffe8df9d5f696 +Author: Matthias Clasen +Date: Mon Nov 29 01:39:06 2010 -0500 + + Add new extension point to the list + + docs/reference/gio/overview.xml | 24 ++++++++++++++++++++++-- + 1 files changed, 22 insertions(+), 2 deletions(-) + +commit db83a96648944bd71ff9c1bd36c7ae898fc06664 +Author: Matthias Clasen +Date: Mon Nov 29 01:20:58 2010 -0500 + + Documentation tweak + + docs/reference/gobject/gobject-sections.txt | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 02978fff17bcff0bf0135859114d6a06463f4e8d +Author: Matthias Clasen +Date: Mon Nov 29 01:16:02 2010 -0500 + + Update NEWS + + NEWS | 39 +++++++++++++++++++++++++++++++++++++++ + glib/gutils.c | 8 +++++--- + 2 files changed, 44 insertions(+), 3 deletions(-) + +commit eed36d38d155898a13961ef9fbb98d09049f331f +Author: Matthias Clasen +Date: Sun Nov 28 23:55:43 2010 -0500 + + Various doc tweaks + + docs/reference/gio/gio-docs.xml | 8 ++-- + docs/reference/gio/gio-sections.txt | 3 +- + gio/gaction.c | 2 +- + gio/gactiongroup.c | 2 +- + gio/gapplicationcommandline.c | 3 +- + gio/gdesktopappinfo.c | 1 + + gio/gperiodic.c | 91 + +++++++++++++++++++++------------- + gio/gpermission.c | 2 +- + gio/gpollableinputstream.c | 9 ++-- + gio/gpollableinputstream.h | 2 +- + gio/gpollableoutputstream.c | 9 ++-- + gio/gsettings.c | 2 +- + gio/gsettingsbackend.c | 2 +- + gio/gsimpleaction.c | 2 +- + gio/gsimpleactiongroup.c | 2 +- + gio/gsimplepermission.c | 2 +- + gio/gtcpconnection.c | 2 +- + gio/gtcpwrapperconnection.c | 3 +- + gio/gtlsbackend.c | 2 +- + gio/gtlscertificate.c | 2 +- + gio/gtlsconnection.c | 7 +++ + 21 files changed, 91 insertions(+), 67 deletions(-) + +commit 1f044a503a9b1b021da970ab1bdfe203547798c1 +Author: Matthias Clasen +Date: Sun Nov 28 22:11:57 2010 -0500 + + Remove nonexisting type + + docs/reference/gio/gio.types | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 4817dae0bb2dfe9d0b575356ddf43b2f3ecd41f5 +Author: Matt Rajca +Date: Sat Nov 13 10:01:34 2010 -0600 + + Removed mention of inexistent GNOME 2.0 porting guide + + docs/reference/glib/changes.sgml | 8 -------- + 1 files changed, 0 insertions(+), 8 deletions(-) + +commit 577ddbf30baf53d8e74cd81f0a2babf590e91c26 +Author: Matt Rajca +Date: Sat Nov 13 13:01:11 2010 -0600 + + Fixed typo in public string in gsocks (630559) + + gio/gsocks5proxy.c | 2 +- + po/ar.po | 2 +- + po/be.po | 2 +- + po/bg.po | 2 +- + po/ca@valencia.po | 2 +- + po/cs.po | 2 +- + po/da.po | 2 +- + po/de.po | 2 +- + po/el.po | 2 +- + po/en_GB.po | 2 +- + po/es.po | 2 +- + po/et.po | 2 +- + po/eu.po | 2 +- + po/fi.po | 2 +- + po/fr.po | 2 +- + po/gl.po | 2 +- + po/he.po | 4 ++-- + po/hu.po | 2 +- + po/hy.po | 2 +- + po/id.po | 2 +- + po/it.po | 2 +- + po/ja.po | 2 +- + po/lt.po | 2 +- + po/nb.po | 2 +- + po/nl.po | 2 +- + po/pa.po | 2 +- + po/pl.po | 2 +- + po/pt.po | 2 +- + po/pt_BR.po | 2 +- + po/ro.po | 2 +- + po/sl.po | 2 +- + po/sr.po | 2 +- + po/sr@latin.po | 2 +- + po/sv.po | 2 +- + po/zh_CN.po | 2 +- + po/zh_HK.po | 2 +- + po/zh_TW.po | 2 +- + 37 files changed, 38 insertions(+), 38 deletions(-) + +commit dec8323b4b301bb5aff006706b5739bb9c930fd8 +Author: Jonas Holmberg +Date: Wed Sep 22 23:02:05 2010 +0200 + + gobject: added property test + + Added test for setting properties with g_object_new. + + gobject/tests/properties.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 files changed, 37 insertions(+), 0 deletions(-) + +commit 349f54756168b76913828136bc646c518c4f475f +Author: Jonas Holmberg +Date: Fri Sep 24 01:20:50 2010 +0200 + + gobject: initialize memory in g_object_new_valist + + memset parameters array in g_object_new_valist to zeroes when + expanding + the array to avoid acces to uninitialized memory. + + gobject/gobject.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 51894b7dd06a3b50654f9ce1fadff418d917aca1 +Author: Aleksander Morgado +Date: Thu Nov 25 18:38:33 2010 +0100 + + Fixes GB#530786: GFileMonitor 'changed' signal underdocumented + + gio/gfilemonitor.c | 12 +++++++++--- + 1 files changed, 9 insertions(+), 3 deletions(-) + +commit b4632e1c98e361cf4700f3e5dcc229a09a6237e4 +Author: Christian Persch +Date: Fri Nov 26 22:46:51 2010 +0100 + + Fix the wrong-category schema test + + It's supposed to test a with a non-existent + category, so make it actually check this! + + Bug #635882. + + gio/tests/gschema-compile.c | 2 +- + gio/tests/schema-tests/wrong-category.gschema.xml | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit bfbd7169a258ac9561f2d01755651046e13f462b +Author: Matthias Clasen +Date: Sun Nov 28 17:14:49 2010 -0500 + + GFileMonitor: Don't accept negative values for rate-limit + + Patch by Alksander Morgado, + https://bugzilla.gnome.org/show_bug.cgi?id=635768 + + gio/gfilemonitor.c | 16 ++++++++-------- + gio/gfilemonitor.h | 2 +- + 2 files changed, 9 insertions(+), 9 deletions(-) + +commit 57143e311d600d3d7bd1f3c901d257918fcdb381 +Author: Christian Persch +Date: Fri Nov 26 21:05:20 2010 +0100 + + Inherit gettext-domain from + + When the doesn't have a 'gettext-domain' attribute, but + the does, use that one. + + Bug #635640. + + gio/glib-compile-schemas.c | 4 +++- + gio/tests/Makefile.am | 1 + + gio/tests/gschema-compile.c | 4 +++- + .../inherit-gettext-domain.gschema.xml | 8 ++++++++ + 4 files changed, 15 insertions(+), 2 deletions(-) + +commit 69129e806532796e44522775656c7800c389e5f8 +Author: Dan Winship +Date: Sat Nov 27 16:56:44 2010 -0500 + + Make gio/tests/g-icon pass again + + It got broken in two different ways by the g_str_hash() change + (354d655b) + + gio/tests/g-icon.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 17979707207ca004cd78991e1c04df60cb3b1cb6 +Author: Christian Persch +Date: Mon Nov 15 19:55:57 2010 +0100 + + Typo fix + + gio/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d19e1a2c3c3da29e6f6c653dda9e4538e55c1838 +Author: Christian Persch +Date: Sat Nov 27 12:45:45 2010 +0100 + + Use same variable names in .h and .c + + glib/gvariant.h | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 59d62726de8efdd478ca1c940134df1112a006f2 +Author: Dan Winship +Date: Mon Dec 21 20:50:32 2009 +0100 + + Add initial TLS (SSL) support to gio + + This adds an extension point for TLS connections to gio, with a + gnutls-based implementation in glib-networking. + + Full TLS support is still a work in progress; the current API is + missing some features, and parts of it may still be changed before + 2.28. + + https://bugzilla.gnome.org/show_bug.cgi?id=588189 + + docs/reference/gio/gio-docs.xml | 9 + + docs/reference/gio/gio-sections.txt | 129 +++++++- + docs/reference/gio/gio.types | 5 + + gio/Makefile.am | 13 +- + gio/gdummytlsbackend.c | 274 +++++++++++++ + gio/gdummytlsbackend.h | 46 +++ + gio/gio-marshal.list | 2 + + gio/gio.h | 5 + + gio/gio.symbols | 77 ++++- + gio/gioenums.h | 100 +++++ + gio/giomodule.c | 6 + + gio/giotypes.h | 8 + + gio/gsocketclient.c | 310 +++++++++++++--- + gio/gsocketclient.h | 7 + + gio/gtlsbackend.c | 201 ++++++++++ + gio/gtlsbackend.h | 92 +++++ + gio/gtlscertificate.c | 486 +++++++++++++++++++++++ + gio/gtlscertificate.h | 75 ++++ + gio/gtlsclientconnection.c | 333 ++++++++++++++++ + gio/gtlsclientconnection.h | 72 ++++ + gio/gtlsconnection.c | 720 + +++++++++++++++++++++++++++++++++++ + gio/gtlsconnection.h | 137 +++++++ + gio/gtlsserverconnection.c | 96 +++++ + gio/gtlsserverconnection.h | 61 +++ + gio/tests/socket-client.c | 195 ++++++---- + gio/tests/socket-common.c | 61 +++ + gio/tests/socket-server.c | 164 +++++---- + 27 files changed, 3473 insertions(+), 211 deletions(-) + +commit a1690339c731cf037d3ed97eda864159f2ba9308 +Author: Dan Winship +Date: Mon Nov 1 20:22:24 2010 -0400 + + make GProxyConnection public, as GTcpWrapperConnection + + GProxyConnection is a class that was added for proxy support; + g_socket_client_connect() returns a GSocketConnection, but in some + cases (eg, encrypted SOCKS), GProxy might return a GIOStream that is + not a GSocketConnection. In that case, GSocketClient would wrap the + stream up in a GProxyConnection, which is a subclass of + GSocketConnection but uses the input/output streams of the wrapped + connection. + + GTlsConnection is not a GSocketConnection, so it has the same problem, + so it will need the same treatment. Rename the class to + GTcpWrapperStream, and make it public, so people can extract the base + stream from it when necessary. + + (This is not ideal and GSocketClient will need to be revisited as an + API at some point...) + + https://bugzilla.gnome.org/show_bug.cgi?id=588189 + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 19 ++++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 4 +- + gio/gio.h | 1 + + gio/gio.symbols | 8 ++ + gio/giotypes.h | 1 + + gio/gproxyconnection.c | 155 --------------------------- + gio/gproxyconnection.h | 69 ------------ + gio/gsocketclient.c | 56 ++++++----- + gio/gtcpwrapperconnection.c | 200 + +++++++++++++++++++++++++++++++++++ + gio/gtcpwrapperconnection.h | 68 ++++++++++++ + 12 files changed, 332 insertions(+), 251 deletions(-) + +commit c20c2c0abd3bdb1b30b85a586ee6095ed75a7bc2 +Author: Dan Winship +Date: Sat Sep 18 13:05:25 2010 -0400 + + Add pollable input/output streams + + When interfacing with APIs that expect unix-style async I/O, it is + useful to be able to tell in advance whether a read/write is going to + block. This adds new interfaces GPollableInputStream and + GPollableOutputStream that can be implemented by a GInputStream or + GOutputStream to add _is_readable/_is_writable, _create_source, and + _read_nonblocking/_write_nonblocking methods. + + Also, implement for GUnixInput/OutputStream and + GSocketInput/OutputStream + + https://bugzilla.gnome.org/show_bug.cgi?id=634241 + + docs/reference/gio/gio-docs.xml | 2 + + docs/reference/gio/gio-sections.txt | 41 +++++ + docs/reference/gio/gio.types | 3 + + gio/Makefile.am | 4 + + gio/gio.h | 2 + + gio/gio.symbols | 21 +++ + gio/giotypes.h | 18 ++ + gio/gpollableinputstream.c | 304 + +++++++++++++++++++++++++++++++++++ + gio/gpollableinputstream.h | 101 ++++++++++++ + gio/gpollableoutputstream.c | 201 +++++++++++++++++++++++ + gio/gpollableoutputstream.h | 98 +++++++++++ + gio/gsocketconnection.c | 3 +- + gio/gsocketinputstream.c | 59 +++++++- + gio/gsocketoutputstream.c | 60 +++++++- + gio/gunixinputstream.c | 51 ++++++- + gio/gunixoutputstream.c | 50 ++++++- + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 4 + + gio/tests/pollable.c | 240 +++++++++++++++++++++++++++ + 19 files changed, 1251 insertions(+), 12 deletions(-) + +commit 6181c7de36771d4d3bb55785912a934e078b16df +Author: Dan Winship +Date: Sat Nov 6 15:49:55 2010 -0400 + + GCancellable: add g_cancellable_create_source() + + g_cancellable_create_source() returns a GSource that triggers when its + corresponding GCancellable is cancelled. This can be used with + g_source_add_child_source() to add cancellability to a source. + + Port gasynchelper's FDSource to use this rather than doing its own + cancellable handling, and also fix up its callback argument order to + be more normal. + + https://bugzilla.gnome.org/show_bug.cgi?id=634239 + + docs/reference/gio/gio-sections.txt | 2 + + gio/gasynchelper.c | 47 +++----------- + gio/gcancellable.c | 116 + +++++++++++++++++++++++++++++++++++ + gio/gcancellable.h | 2 + + gio/gio.symbols | 1 + + gio/giotypes.h | 15 +++++ + 6 files changed, 146 insertions(+), 37 deletions(-) + +commit d15cdbefecc235cfa431ee7de9c35af174bd1552 +Author: Dan Winship +Date: Sat Nov 6 10:11:15 2010 -0400 + + gmain: add g_source_add_child_source and g_source_remove_child_source + + This adds "child source" support to GSource. A child source behaves + basically like a GPollFD; when you add a source to a context, all of + its child sources are added with the same priority; when you destroy a + source, all of its child sources are destroyed; and when a child + source triggers, its parent source's dispatch function is run. + + Use cases include: + + - adding a GTimeoutSource to another source to cause the source to + automatically trigger after a certain timeout. + + - wrapping an existing source type with a new type that has + a different callback signature + + - creating a source that triggers based on different conditions + at different times. + + https://bugzilla.gnome.org/show_bug.cgi?id=634239 + + docs/reference/glib/glib-sections.txt | 2 + + glib/glib.symbols | 2 + + glib/gmain.c | 266 + +++++++++++++++++++++++++++------ + glib/gmain.h | 17 ++- + 4 files changed, 239 insertions(+), 48 deletions(-) + +commit e910205557b2461eaf1b2ce94176c6525cc716d1 +Author: Dan Winship +Date: Sun Nov 7 11:49:40 2010 -0500 + + Add g_source_set_dummy_callback() + + Use g_source_set_closure() and g_close_set_meta_marshal() to allow + setting a do-nothing callback on any source. + + https://bugzilla.gnome.org/show_bug.cgi?id=634239 + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gobject.symbols | 1 + + gobject/gsourceclosure.c | 39 + ++++++++++++++++++++++++++- + gobject/gsourceclosure.h | 6 +++- + 4 files changed, 44 insertions(+), 3 deletions(-) + +commit 73d823ac1ee0716568130407a4c164f6c145a75f +Author: Dan Winship +Date: Sun Nov 7 11:05:26 2010 -0500 + + Implement closure-related methods for gio GSource types + + Also, fix up the argument ordering on GFDSourceFunc + + https://bugzilla.gnome.org/show_bug.cgi?id=634239 + + gio/gasynchelper.c | 59 + +++++++++++++++++++++++++++++++++++++++++++++- + gio/gasynchelper.h | 4 +- + gio/gio-marshal.list | 2 + + gio/gsocket.c | 33 +++++++++++++++++++++++++- + gio/gunixinputstream.c | 4 +- + gio/gunixoutputstream.c | 4 +- + 6 files changed, 97 insertions(+), 9 deletions(-) + +commit ece936e84dd64af12cb609a8d25f3711a288cc57 +Author: Dan Winship +Date: Sat Nov 6 09:45:20 2010 -0400 + + gmain: fix some silly code in a programmer-error case + + Previously if a source got finalized while still attached to a + context, it would warn and re-ref the source. But then it just freed + it anyway... So keep the warning but drop the re-ref. + + https://bugzilla.gnome.org/show_bug.cgi?id=634239 + + glib/gmain.c | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +commit b358202856682e5cdefb0b4b8aaed3a45d9a85fa +Author: Dan Winship +Date: Sat Nov 6 09:35:25 2010 -0400 + + gmain: move finalization of GSource outside of context lock + + This avoids ugly deadlock situations such as in + https://bugzilla.gnome.org/show_bug.cgi?id=586432 + + https://bugzilla.gnome.org/show_bug.cgi?id=626702 + + https://bugzilla.gnome.org/show_bug.cgi?id=634239 + + glib/gmain.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 3570c4a00ef25908172d4d51e30810dddcea1ee8 +Author: Matthias Clasen +Date: Wed Nov 24 16:00:32 2010 -0500 + + Add indices for new symbols in 2.28 + + docs/reference/gio/gio-docs.xml | 4 ++++ + docs/reference/glib/glib-docs.sgml | 4 ++++ + docs/reference/gobject/gobject-docs.sgml | 4 ++++ + 3 files changed, 12 insertions(+), 0 deletions(-) + +commit e5dd266c33509fe214dfa3a0b66f66e9f166ebc6 +Author: Matthias Clasen +Date: Wed Nov 24 15:57:40 2010 -0500 + + Add Since: tags for new api + + Also, remove from things like #GAppInfos. + gtk-doc learned to deal with this a while ago. + + gio/gdesktopappinfo.c | 30 +++++++++++++++++------------- + 1 files changed, 17 insertions(+), 13 deletions(-) + +commit ee94915d0b78da7a016b4df29f0dce6236c1acfc +Author: Javier Jardón +Date: Wed Nov 24 18:06:17 2010 +0100 + + docs: gappinfo: Fix typo -> + + gio/gappinfo.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 5f958e4623df830f89241b158b14ef7d994cf2c2 +Author: Cosimo Cecchi +Date: Fri Nov 19 11:37:44 2010 +0100 + + tests: add a test for recommended and fallback GAppInfos + + gio/tests/desktop-app-info.c | 72 + ++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 72 insertions(+), 0 deletions(-) + +commit b3bf7a648453e59daa83f745faf9102a90cdfbac +Author: Cosimo Cecchi +Date: Fri Nov 19 10:39:33 2010 +0100 + + appinfo: add win32 fallback implementation + + gio/gwin32appinfo.c | 22 ++++++++++++++++++++++ + 1 files changed, 22 insertions(+), 0 deletions(-) + +commit 30c378032fe43975dc3ea1014b5b873ef6e3d017 +Author: Cosimo Cecchi +Date: Fri Nov 19 10:39:16 2010 +0100 + + appinfo: update docs for API addition + + docs/reference/gio/gio-sections.txt | 2 ++ + gio/gdesktopappinfo.c | 22 ++++++++++++++++++++++ + gio/gio.symbols | 2 ++ + 3 files changed, 26 insertions(+), 0 deletions(-) + +commit 182fcff2ea2b8f183570d8c026a9ef4d2ec2afdf +Author: Cosimo Cecchi +Date: Thu Nov 18 18:49:32 2010 +0100 + + appinfo: only rewrite recommended applications when adding non-default + + Otherwise you break the fallback + recommended distinction for + a content + type, as you end up adding support for a given content type to + *all* of + the applications claiming to support the supertype. + + gio/gdesktopappinfo.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 94c67d8420889e950c2f093abdd893ffe3780a97 +Author: Cosimo Cecchi +Date: Thu Nov 18 18:45:56 2010 +0100 + + appinfo: add API to get fallback and recommended GAppInfos for a ctype + + This ways UIs can differentiate between them, and show them in + different + section. + - a recommended app is an application that claims to support a content + type directly, not by a supertype derivation. + - a fallback app is an application that claims to support a + supertype of + a given content type. + + gio/gappinfo.h | 3 + + gio/gdesktopappinfo.c | 127 + +++++++++++++++++++++++++++++++++++++++---------- + 2 files changed, 105 insertions(+), 25 deletions(-) + +commit a70ba9c8b15451a8722aebfb64232bd18abf0a79 +Author: Owen W. Taylor +Date: Sun Nov 21 21:59:57 2010 -0500 + + Fix off-by-1000 for GTimer + + Divide monotonic time by 1e6 not 1e9 to get seconds. + + glib/gtimer.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit ab3a79e2c9be13aea5b2ce0980f3a641c5ed081d +Author: Ignacio Casal Quinteiro +Date: Sun Nov 21 21:20:44 2010 +0100 + + Check for (GIConv)-1 instead of NULL. + + gio/gcharsetconverter.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit bcbf9153d5933476d267ba5da18dd72e99fac20a +Author: Gheyret T.Kenji +Date: Sat Nov 20 11:26:41 2010 +0100 + + Added UG translation + + po/ug.po | 72 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 36 insertions(+), 36 deletions(-) + +commit 96e9677fd7433cfbf27d18f66d55635195fcc44d +Author: Kjartan Maraas +Date: Thu Nov 18 14:08:34 2010 +0100 + + Updated Norwegian bokmål translation + + po/nb.po | 1412 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 780 insertions(+), 632 deletions(-) + +commit 260d005616b7150c3e560a9fc29734a19ab8e24e +Author: Colin Walters +Date: Wed Nov 17 20:06:07 2010 -0500 + + introspection: Add annotations for g_file_copy, g_file_move + + gio/gfile.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 354d655ba8a54b754cb5a3efb42767327775696c +Author: Ryan Lortie +Date: Wed Nov 17 12:19:54 2010 -0500 + + g_str_hash: switch to using DJB hash + + This is the same as what we were already doing with 2 changes: + + - use an initial value of 5381 instead of 0 + + - multiply by 33 in each round instead of 31 + + glib/gstring.c | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +commit f50a99e7827f4b906cfe9ced27096b047f65ac80 +Author: Ryan Lortie +Date: Wed Nov 17 11:57:48 2010 -0500 + + g_str_hash: clean up code + + Un-unroll the first iteration. + + No functional changes here. + + glib/gstring.c | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +commit 2bfcffde9ae5b14e78a4279bf48c71897c5f19d8 +Author: Tomas Bzatek +Date: Tue Nov 16 14:20:07 2010 +0100 + + GIO: Hide mounts having a path element starting with dot + + When a mount is mounted to a directory whose path contains an element + starting with dot, let's treat it as hidden, just like the usual Unix + approach. + + gio/gunixmounts.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 010913c8ab3f161ac8e9c676bc89d3a30db092ce +Author: Javier Jardón +Date: Sun Nov 14 02:08:51 2010 +0100 + + docs: Update the URL of some documentation links + + http://developer.gnome.org -> http://library.gnome.org + + INSTALL.in | 2 +- + docs/reference/gobject/tut_tools.xml | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit f4142b321b2cdc2bb5a74716b29f35a141c9a8d2 +Author: Gheyret T.Kenji +Date: Sun Nov 14 00:05:02 2010 +0100 + + Added UG translation + + po/LINGUAS | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit a0e0f25de687f5d748ae23421572b1fc60b248c2 +Author: Gheyret T.Kenji +Date: Sat Nov 13 22:10:03 2010 +0100 + + Added UG translation + + po/ug.po | 3522 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 3522 insertions(+), 0 deletions(-) + +commit b53b61a000fdd72c76b96f58e3835f50ad8335f1 +Author: Luca Ferretti +Date: Sat Nov 13 14:01:29 2010 +0100 + + [l10n] Updated Italian translation + + po/it.po | 2353 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1556 insertions(+), 797 deletions(-) + +commit 9faed56eda38ed35dd9841d2de1ac659d8db5a36 +Author: Fran Diéguez +Date: Sat Nov 13 00:59:45 2010 +0100 + + Updated Galician translations + + po/gl.po | 144 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 72 insertions(+), 72 deletions(-) + +commit 48ca3add143896fa5664860a94947907cfe5daa2 +Author: Ryan Lortie +Date: Thu Nov 11 21:47:13 2010 -0500 + + G_STATIC_ASSERT: clarify when use is valid + + Clarify when the use of G_STATIC_ASSERT is valid and fix up an invalid + use of it in GDBus. + + docs/reference/glib/tmpl/macros_misc.sgml | 6 ++++++ + gio/gdbusmessage.c | 2 +- + 2 files changed, 7 insertions(+), 1 deletions(-) + +commit 6bc20651ecf8e8b5d9ffea89ae76083ededa3c0b +Author: Ryan Lortie +Date: Thu Nov 11 21:30:03 2010 -0500 + + Partial revert of last commit + + Revert incorrect changes to gdbusmessage.c + + gio/gdbusmessage.c | 5 +---- + 1 files changed, 1 insertions(+), 4 deletions(-) + +commit d28bce02dc62ac863ddafce8d525e6bc929db873 +Author: Cosimo Cecchi +Date: Wed Nov 10 12:03:11 2010 +0100 + + emblemed-icon: allow passing a NULL emblem to g_emblemed_icon_new() + + So that if we already have a list of emblems we know we want to add to + the icon, we can use e.g. a for loop to add them all, without picking + the first and looping from the second. + + https://bugzilla.gnome.org/show_bug.cgi?id=634504 + + gio/gemblemedicon.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit fb94859e84c0b7859a0a5425d461b18e67ea9ac7 +Author: Benjamin Otte +Date: Tue Nov 9 07:19:19 2010 -0500 + + API: Reinstate "gio-desktop-app-info-lookup" extension point + + Removing an extension point is an API and ABI break. In particular, it + causes (older) gvfs versions to fail loading with a linkage error from + ld which in turn makes the desktop unusable. + So this reinstate the extension point and API provided by it, but + deprecates and does not use it. So no functionality is changed. + + This reverts parts of commit 9b262f1c5fe5a6fd879f17cd7b80d8c54e33d80c. + + Complaints-Also-To: Ryan Lortie + + gio/gdesktopappinfo.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + gio/gdesktopappinfo.h | 40 ++++++++++++++++++++++++++++++++++++++++ + gio/gio.symbols | 2 ++ + gio/giomodule.c | 16 +++++++++++++--- + 4 files changed, 97 insertions(+), 3 deletions(-) + +commit 9f02ee790b03b4c9e73490734ddb4740219b1d36 +Author: Chun-wei Fan +Date: Tue Nov 9 20:36:53 2010 +0800 + + gio: Fix C99 style variable declarations (bug #633075) + + -gdbusmessage.c and gregistrysettingsbackend.c is updated to fix + C99-style declarations + -also fixed typo for displaying registry entry in + gregistrysettingsbackend.c (\% -> \\%) + + gio/gdbusmessage.c | 5 ++++- + gio/gregistrysettingsbackend.c | 21 ++++++++++++++------- + 2 files changed, 18 insertions(+), 8 deletions(-) + +commit 029f3070e7334daf8241dfe0db8288f80110f839 +Author: Chun-wei Fan +Date: Tue Nov 9 20:32:39 2010 +0800 + + gtimer.c: Revert accidental overwrite + + Revert accidental overwrite as timing API was changed from 2.27.2 + to 2.27.3 + + glib/gtimer.c | 73 + +++++++-------------------------------------------------- + 1 files changed, 9 insertions(+), 64 deletions(-) + +commit db7ea5e5584f768e978bb101000bf8a602384f6d +Author: Matthias Clasen +Date: Mon Nov 8 23:06:53 2010 -0500 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f023d8b9bc6d86482fc020acf46ce965ff94c37b +Author: Matthias Clasen +Date: Mon Nov 8 21:40:17 2010 -0500 + + Update NEWS + + NEWS | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 49 insertions(+), 0 deletions(-) + +commit 9806040455d6d482db3908f2d56ddfe455bae660 +Author: Chun-wei Fan +Date: Tue Nov 9 09:53:12 2010 +0800 + + Added and Moved checks for includes + + Moved checks for G_OS_WIN32 after GLib header includes and added + other checks + required for Windows/MSVC builds + + glib/gdatetime.c | 10 +++--- + glib/gmessages.c | 18 ++++++------ + glib/gscanner.c | 8 +++--- + glib/gtimer.c | 77 + +++++++++++++++++++++++++++++++++++++++++++++++------- + 4 files changed, 85 insertions(+), 28 deletions(-) + +commit 4a012a9754d51a36914c626b41ad757a89e57f86 +Author: Chun-wei Fan +Date: Tue Nov 9 09:50:11 2010 +0800 + + Updated README.txt for VS9 + + build/win32/vs9/README.txt | 20 +++++++++++++++++--- + 1 files changed, 17 insertions(+), 3 deletions(-) + +commit 0af6343fedaf95d3710af8a1535da4d32cfccff9 +Author: Chun-wei Fan +Date: Tue Nov 9 09:27:27 2010 +0800 + + Updated .def generation for x64 + + Some symbols need to be excluded from the .def file as they are set + to be so on Win64 + + build/win32/vs9/gmodule.vcproj | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 9d4423c15d8684be27496f1905e063ec7e18cc21 +Author: Chun-wei Fan +Date: Tue Nov 9 09:26:05 2010 +0800 + + Various updates... + + -Made up for missed header files in glib and gio during "install" + -Added macro necessary for GLib/GModule .def generation under Win64 + -updated location of getting glibconfig.h.win32 for building + + build/win32/vs9/glib.vsprops | 30 +++++++++++++++++++++++++++--- + 1 files changed, 27 insertions(+), 3 deletions(-) + +commit e655a849e3cd7357dcef873163712df13889353f +Author: Chun-wei Fan +Date: Tue Nov 9 09:23:47 2010 +0800 + + Some enhancements for Win64 and using existing PCRE installtions + + Added option for people to use an existing PCRE build and updated + .def generation for x64 systems (some symbols are set to be excluded + from Win64 builds) + Also fixed the filter "PCRE" for the bundled PCRE as file layout + changed + + build/win32/vs9/glib.vcprojin | 314 + ++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 292 insertions(+), 22 deletions(-) + +commit 50ca3571041881d7728f9a6fb0e924681113fb5e +Author: Chun-wei Fan +Date: Tue Nov 9 09:11:48 2010 +0800 + + Added option to use existing installation of PCRE + + Allow the person compiling GLib to use his/her own copy of PCRE, + bug#633075 + + build/win32/vs9/glib.sln | 85 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 85 insertions(+), 0 deletions(-) + +commit 8c4a96c6ff389aa319993857d79e0afcdf24d7c9 +Author: Chun-wei Fan +Date: Tue Nov 9 09:08:45 2010 +0800 + + Made up for missed source files + + Made up for missing required source files in gio.vcproj(in) for + Windows builds + + build/win32/vs9/gio.vcprojin | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 587c9d09e25b0a0e3779e6a19493c9264696a46f +Author: Ryan Lortie +Date: Mon Nov 8 18:15:32 2010 -0500 + + GPeriodic: enable subclassing + + Move GPeriodic struct and class struct to the header. Do ->priv. + + gio/gperiodic.c | 138 + +++++++++++++++++++++++++++---------------------------- + gio/gperiodic.h | 21 ++++++++ + 2 files changed, 89 insertions(+), 70 deletions(-) + +commit 9fbfac6abb45aad97349f68aef29410e3bef4cfd +Author: Ryan Lortie +Date: Mon Nov 8 16:59:29 2010 -0500 + + GPeriodic: remove repair functions + + Replace it with a single repair signal that either fires or does not. + + docs/reference/gio/gio-sections.txt | 1 - + gio/gio-marshal.list | 2 +- + gio/gperiodic.c | 134 + ++++++++++++++++------------------- + gio/gperiodic.h | 9 +-- + 4 files changed, 63 insertions(+), 83 deletions(-) + +commit 1a1fc130ece13a442dcacaba1db9108089cead38 +Author: Ryan Lortie +Date: Mon Nov 8 16:42:32 2010 -0500 + + New function: g_clear_object() + + By analogy to g_clear_error, takes a pass-by-reference GObject + reference + and, if non-%NULL, unrefs it and sets it equal to %NULL. + + Bug #620263. + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gobject.c | 38 + +++++++++++++++++++++++++++ + gobject/gobject.h | 15 ++++++++++ + gobject/gobject.symbols | 1 + + gobject/tests/.gitignore | 1 + + gobject/tests/Makefile.am | 3 +- + gobject/tests/reference.c | 35 + ++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 1 deletions(-) + +commit 78bc8bec4f44a48e5e538f1f9ac9b9e43a9fc833 +Author: Dan Winship +Date: Sun Nov 7 12:56:44 2010 -0500 + + fix .gitignore + + gio/tests/.gitignore | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 791d91a957f8fc243b6629a015132c22675399ab +Author: Dan Winship +Date: Sun Nov 7 12:56:08 2010 -0500 + + fix make check + + gio/gsettings.c | 2 +- + gio/tests/gsettings.c | 10 +++++----- + glib/glib.symbols | 1 + + 3 files changed, 7 insertions(+), 6 deletions(-) + +commit ba9fccf71e667c1d05d05fab794ab41b2c387a81 +Author: Ryan Lortie +Date: Sat Nov 6 17:34:40 2010 -0400 + + g_get_user_runtime_dir(): New function + + Get the value of the XDG_RUNTIME_DIR environment variable. + + docs/reference/glib/glib-sections.txt | 1 + + glib/gutils.c | 49 + +++++++++++++++++++++++++++++++++ + glib/gutils.h | 2 + + 3 files changed, 52 insertions(+), 0 deletions(-) + +commit 71088701af6ff0658313069219565923d5a03280 +Author: Ryan Lortie +Date: Fri Nov 5 22:07:07 2010 -0400 + + Add G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE + + If specified, the signal subscription is setup client-side but + the match + rule is not sent to the server. This allows the caller to manually + register more detailed match rules. + + gio/gdbusconnection.c | 22 ++++++++++++++++++++-- + gio/gioenums.h | 6 +++++- + 2 files changed, 25 insertions(+), 3 deletions(-) + +commit fa774618fcbd1afaa30507c9d75a46f9fa7bc288 +Author: Christian Persch +Date: Sat Nov 6 12:27:01 2010 +0100 + + Fix docs comment typo + + glib/gvariant.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 8464db88adf36964c0898b74e1d122136fa0696b +Author: A S Alam +Date: Sat Nov 6 10:48:55 2010 +0530 + + update Punjabi Translation by A S Alam + + po/pa.po | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 79a29a10362019b3ec5e361c7dbbadf084355f9c +Author: A S Alam +Date: Sat Nov 6 10:47:54 2010 +0530 + + update Punjabi Translation by A S Alam + + po/pa.po | 901 + ++++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 557 insertions(+), 344 deletions(-) + +commit 7fc6f8a1596b18a23e1570fc6716b34a137b76c6 +Author: Ryan Lortie +Date: Fri Nov 5 21:33:06 2010 -0400 + + Add g_variant_lookup() and tests + + Convenience API for doing lookups in dictionaries where the key is a + string or object path. + + docs/reference/glib/glib-sections.txt | 2 + + glib/glib.symbols | 2 + + glib/gvariant.c | 144 + +++++++++++++++++++++++++++++++++ + glib/gvariant.h | 7 ++ + glib/tests/gvariant.c | 74 +++++++++++++++++ + 5 files changed, 229 insertions(+), 0 deletions(-) + +commit 57b4b7099f6e6918210d5d99a24f42b33021bab0 +Author: Matthias Clasen +Date: Fri Nov 5 14:50:01 2010 -0400 + + Fix markup + + gio/gsettings.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 38bc42d18edcfdc47cad018dbd6e562f21541f9b +Author: Matthias Clasen +Date: Fri Nov 5 14:29:15 2010 -0400 + + Fix up gapplication example + + gio/tests/gapplication-example-cmdline2.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 67c03fee2a90079b75bbbb71c004ef00af750f21 +Author: Matthias Clasen +Date: Fri Nov 5 14:28:44 2010 -0400 + + Describe enum and flags types a bit + + gio/gsettings.c | 22 ++++++++++++++++++++-- + 1 files changed, 20 insertions(+), 2 deletions(-) + +commit d1b00fe23df265f6cf8a288a34db8fdeb31d9900 +Author: Matthias Clasen +Date: Fri Nov 5 13:56:42 2010 -0400 + + Update the gschema dtd to include flags + + gio/gschema.dtd | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +commit bc793255bc75300bfa96bfd842343c26af8b0744 +Author: Matthias Clasen +Date: Fri Nov 5 09:31:36 2010 -0400 + + Report more useful errors from g_settings_set_value + + gio/gsettings.c | 24 ++++++++++++++++++++++-- + 1 files changed, 22 insertions(+), 2 deletions(-) + +commit 393834ac6f32633a31e52441b051dc7d3969a530 +Author: Dan Winship +Date: Thu Nov 4 15:23:22 2010 -0400 + + gsettings.m4: Fix rules to work when there are no schemas + + If there are no schemas, don't try to install "" at install time. + (In particular, automake conditionals don't work properly with + @-expanded rules, so if you conditionally build a schema, you'll + still unconditionally get the install rule.) + + https://bugzilla.gnome.org/show_bug.cgi?id=633381 + + m4macros/gsettings.m4 | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +commit 094082841877b8b70a0d793ff091bb74793210b6 +Author: Tor Lillqvist +Date: Tue Oct 26 12:20:22 2010 +0300 + + Clarify docs for g_path_is_absolute() semantics on Windows + + glib/gutils.c | 29 +++++++++++++++++++++++++---- + 1 files changed, 25 insertions(+), 4 deletions(-) + +commit 954e7d149359152a9b6dccf2322399f87ed5bd1f +Author: Ihar Hrachyshka +Date: Sun Oct 31 20:12:26 2010 +0200 + + Updated Belarusian translation + + po/be.po | 3412 + +++++++++++++++++++++++++++++++++++++++----------------------- + 1 files changed, 2137 insertions(+), 1275 deletions(-) + +commit ba45e36932206f30bb439f27c49529d934207fd1 +Author: Christian Persch +Date: Thu Sep 23 13:47:13 2010 +0200 + + Add g_simple_async_report_take_gerror_in_idle + + ... and use it where appropriate. Saves an extra GError copy. + + Bug #633686. + + docs/reference/gio/gio-sections.txt | 1 + + gio/gbufferedinputstream.c | 3 +-- + gio/gfileinputstream.c | 3 +-- + gio/gfileiostream.c | 3 +-- + gio/gfileoutputstream.c | 3 +-- + gio/ginputstream.c | 9 +++------ + gio/gio.symbols | 1 + + gio/giostream.c | 3 +-- + gio/goutputstream.c | 12 ++++-------- + gio/gsimpleasyncresult.c | 34 + +++++++++++++++++++++++++++++++++- + gio/gsimpleasyncresult.h | 6 +++++- + gio/gsocketclient.c | 6 ++---- + gio/gsocketconnection.c | 3 +-- + gio/gsocketlistener.c | 3 +-- + 14 files changed, 56 insertions(+), 34 deletions(-) + +commit 9e0c07870af1dac84c033031cf301671779c8328 +Author: Christian Persch +Date: Thu Sep 23 13:02:50 2010 +0200 + + Use g_simple_async_result_{new_,}take_error + + Bug #633685. + + gio/gasyncinitable.c | 5 +-- + gio/gbufferedinputstream.c | 32 ++++++--------- + gio/gbufferedoutputstream.c | 5 +-- + gio/gdatainputstream.c | 3 +- + gio/gdbusaddress.c | 5 +-- + gio/gdbusconnection.c | 23 +++-------- + gio/gdbusprivate.c | 9 +--- + gio/gdbusproxy.c | 13 ++---- + gio/gdummyproxyresolver.c | 3 +- + gio/gfile.c | 80 + +++++++++------------------------------- + gio/gfileenumerator.c | 5 +-- + gio/gfileicon.c | 3 +- + gio/gfileinputstream.c | 5 +-- + gio/gfileoutputstream.c | 5 +-- + gio/ginputstream.c | 26 ++++--------- + gio/giostream.c | 5 +-- + gio/gloadableicon.c | 3 +- + gio/gnetworkaddress.c | 3 +- + gio/gnetworkservice.c | 6 +-- + gio/goutputstream.c | 23 +++-------- + gio/gproxyaddressenumerator.c | 17 ++------ + gio/gsocketaddressenumerator.c | 6 +-- + gio/gsocketclient.c | 3 +- + gio/gsocketinputstream.c | 5 +-- + gio/gsocketlistener.c | 3 +- + gio/gsocketoutputstream.c | 5 +-- + gio/gsocks4aproxy.c | 8 +--- + gio/gsocks5proxy.c | 4 +- + gio/gtcpconnection.c | 11 +---- + gio/gunixinputstream.c | 10 +---- + gio/gunixmount.c | 3 +- + gio/gunixoutputstream.c | 10 +---- + gio/gunixresolver.c | 18 ++------- + gio/gunixvolume.c | 3 +- + 34 files changed, 98 insertions(+), 270 deletions(-) + +commit 63b87b2c26bf983823f83943b8d752bd053ce539 +Author: Ryan Lortie +Date: Wed Nov 3 00:16:16 2010 -0400 + + Add simple dynamic scheduling to GPeriodic + + GPeriodic will now try not to use more than 50% of the CPU for its own + purposes unless there are no other tasks attempting to run. + + docs/reference/gio/gio-sections.txt | 3 +- + gio/gio.symbols | 3 +- + gio/gperiodic.c | 155 + ++++++++++++++++++++++++++++++++--- + gio/gperiodic.h | 6 +- + 4 files changed, 151 insertions(+), 16 deletions(-) + +commit 8c7e284116085058fa8b2600e02502aa6acb3f9e +Author: Matthias Clasen +Date: Tue Nov 2 22:39:58 2010 -0400 + + Tweak GApplication docs + + gio/gapplication.c | 9 +++++++++ + gio/tests/gapplication-example-actions.c | 7 ------- + gio/tests/gapplication-example-cmdline.c | 4 ---- + gio/tests/gapplication-example-cmdline2.c | 4 ---- + gio/tests/gapplication-example-open.c | 16 +++++++++++----- + 5 files changed, 20 insertions(+), 20 deletions(-) + +commit 1cf14de82f3ad4beceeeb9ba555763ef8d70ed24 +Author: Ryan Lortie +Date: Tue Nov 2 22:12:55 2010 -0400 + + docs: Recommend against using GTimeVal + + docs/reference/glib/tmpl/date.sgml | 11 +++++++---- + 1 files changed, 7 insertions(+), 4 deletions(-) + +commit e4ad3442c042431918de178c5dc29ce6abb31ff2 +Author: Ryan Lortie +Date: Tue Nov 2 22:03:08 2010 -0400 + + GMainContext: store real time as int64 + + glib/gmain.c | 19 ++++++++++--------- + 1 files changed, 10 insertions(+), 9 deletions(-) + +commit d22681feb44daa0209cf55c8e45cc8f0c13d4ded +Author: Ryan Lortie +Date: Mon Nov 1 17:04:31 2010 -0400 + + glocalfileinfo: remove non-use of GTimeVal + + gio/glocalfileinfo.c | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +commit 5dab4727ee604d3a7a2be3aa7dde739b71d7f5df +Author: Ryan Lortie +Date: Mon Nov 1 16:40:36 2010 -0400 + + Add g_get_real_time() for wall-clock int64 micros + + Similar in spirit to g_get_monotonic_time(). + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gmain.c | 31 + ++++++++++++++++++++++++++++++- + glib/gmain.h | 1 + + 4 files changed, 33 insertions(+), 1 deletions(-) + +commit 38e7aa9855a3e18d5350733ee4177ab00cee15df +Author: Ryan Lortie +Date: Mon Nov 1 16:35:10 2010 -0400 + + Clean up g_usleep() + + Remove some code that was written in 2000 to support OSes that do not + have nanosleep(). nanosleep() has been specified (in POSIX-1.2001) + for + almost a decade now, so assume we have it (except on Windows). + + Remove the checks for nanosleep and nsleep from configure.ac. + + We're removing this code because we honestly believe that nobody + will be + affected. If this change negatively impacts you, please file a bug. + + configure.ac | 1 - + glib/gtimer.c | 48 ++---------------------------------------------- + 2 files changed, 2 insertions(+), 47 deletions(-) + +commit a48faa0aed1c422ba04301a4786419de44ea65e8 +Author: Ryan Lortie +Date: Mon Nov 1 16:06:39 2010 -0400 + + GTimer: switch to monotonic time + + and remove docs notes about threads having to be initialised. + + glib/gtimer.c | 27 ++++++++------------------- + 1 files changed, 8 insertions(+), 19 deletions(-) + +commit 92df8a1d7766dbb51d84c0373daa77eb1cce3a18 +Author: Ryan Lortie +Date: Mon Nov 1 15:47:29 2010 -0400 + + Drop GTimeSpec type + + docs/reference/glib/glib-sections.txt | 1 - + glib/gmain.c | 10 ---------- + glib/gtypes.h | 8 -------- + 3 files changed, 0 insertions(+), 19 deletions(-) + +commit c3a0d32ef1413f942890796aa20f7b1a54254eff +Author: Ryan Lortie +Date: Mon Nov 1 15:46:35 2010 -0400 + + Switch GTimeSpec users to int64 microseconds + + glib is trying to move toward using microseconds-in-gint64 as its + universal time format. + + No real API breaks here since GTimeSpec is new this unstable release + series. + + gio/gperiodic.c | 33 ++--------- + gio/gperiodic.h | 2 +- + gio/gsocket.c | 35 +++++------ + glib/gmain.c | 183 + +++++++++++++++++++++++-------------------------------- + glib/gmain.h | 7 +- + 5 files changed, 101 insertions(+), 159 deletions(-) + +commit d9f5ab56c3b79fb12b4ee4f19a8b6307445cc403 +Author: Ryan Lortie +Date: Mon Nov 1 13:31:37 2010 -0400 + + GTimeout: simplify math for 'seconds' case + + The code was designed to deal with any granularity of timer and due to + the use of GTimeVal/GTimeSpec, the math for this gets extremely + confusing. + + From a practical standpoint, we only ever have a granularity of + seconds. + + Take advantage of that fact in the code and vastly simplify the math. + + glib/gmain.c | 74 + +++++++++++++++++++++------------------------------------ + 1 files changed, 27 insertions(+), 47 deletions(-) + +commit b6854efdb94b74f791cbcc622942825dc042eefc +Author: Jorge González +Date: Tue Nov 2 10:46:10 2010 +0100 + + Updated Spanish translation + + po/es.po | 90 + ++++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 55 insertions(+), 35 deletions(-) + +commit 00e09af412f8d30c5980f549341cf28a2d6a8847 +Author: Jorge González +Date: Mon Nov 1 18:50:46 2010 +0100 + + Updated Spanish translation + + po/es.po | 494 + ++++++++++++++++++++++++++++++++++++++++++-------------------- + 1 files changed, 337 insertions(+), 157 deletions(-) + +commit b2d0260b85c6eb47f9ac0263f26657cbc9fe9909 +Author: Fran Diéguez +Date: Mon Nov 1 17:15:38 2010 +0100 + + Updated Galician translations + + po/gl.po | 620 + ++++++++++++++++++++++++++++++++++++++----------------------- + 1 files changed, 386 insertions(+), 234 deletions(-) + +commit 361afb3a62c7940c0f303eac99d84ac21e4dcb37 +Author: Paolo Borelli +Date: Mon Nov 1 14:36:57 2010 +0100 + + Fix gtk-doc typo + + gio/gmount.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7434c1725dc7a5f44a9f2d9787eaa7c1c9027906 +Author: Christian Persch +Date: Mon Nov 1 11:06:26 2010 +0100 + + Fix Since: for new functions + + g_simple_async_result_new_from_error/take_error are Since: 2.28. + + gio/gsimpleasyncresult.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 5327db4c2f83acf9cda3e7cc3ddca8f3eaeb570f +Author: Yaron Shahrabani +Date: Mon Nov 1 08:17:02 2010 +0200 + + Updated Hebrew translation. + + po/he.po | 406 + ++++++++++++++++++++++++++++++++++++++++++++------------------ + 1 files changed, 292 insertions(+), 114 deletions(-) + +commit 81f93eb29c76c941e6bfe6c20510f8cb04edfa0a +Author: Matthias Clasen +Date: Mon Nov 1 00:32:47 2010 -0400 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a50c0ca69961ef4d1a372cc31483de65266f1a52 +Author: Matthias Clasen +Date: Sun Oct 31 23:32:48 2010 -0400 + + NEWS for 2.27.2 + + NEWS | 36 ++++++++++++++++++++++++++++++++++++ + 1 files changed, 36 insertions(+), 0 deletions(-) + +commit b4248cb5da7751a2b1d16c48ea0acc5f3e7c4348 +Author: Matthias Clasen +Date: Sun Oct 31 23:19:04 2010 -0400 + + Remove nonexisting type from giotypes.h + + GDBusActionGroup does not exist yet. + + gio/giotypes.h | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit d2612ad955c67a6b6791e9db4496087754c20228 +Author: Matthias Clasen +Date: Sun Oct 31 23:13:36 2010 -0400 + + Fix a doc typo + + glib/gdatetime.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 71dcc5ce80e33ac2f5cfd2de7acc392de2cb5d45 +Author: Matthias Clasen +Date: Sun Oct 31 23:10:41 2010 -0400 + + Remove leftover definition from gactiongroup.h + + GContextActionGroupInterface is not currently used anywhere. + + gio/gactiongroup.h | 15 --------------- + 1 files changed, 0 insertions(+), 15 deletions(-) + +commit b49ae1646197e90d273d3ffd5d884d93109c2df7 +Author: Matthias Clasen +Date: Sun Oct 31 22:41:00 2010 -0400 + + Various documentation fixes + + docs/reference/gio/gio-sections.txt | 10 +++++----- + gio/gactiongroup.c | 12 ++++++------ + gio/gappinfo.c | 10 +++++----- + gio/gapplicationcommandline.c | 1 + + 4 files changed, 17 insertions(+), 16 deletions(-) + +commit 85ba8596e235f5f7f351447d20a3bc1baa8402b8 +Author: Matthias Clasen +Date: Sun Oct 31 22:38:38 2010 -0400 + + GSimpleAsyncResult: add error-taking variants + + Add g_simple_async_result_new_take_error and + g_simple_async_result_take_error, which take over ownership of the + given error. Based on a patch by Christian Persch. + + https://bugzilla.gnome.org/show_bug.cgi?id=629247 + + gio/gio.symbols | 2 + + gio/gsimpleasyncresult.c | 62 + +++++++++++++++++++++++++++++++++++++++++++-- + gio/gsimpleasyncresult.h | 6 ++++ + 3 files changed, 67 insertions(+), 3 deletions(-) + +commit 7887103193de4230a1ccb8dc7100816e523e5b9c +Author: Matthias Clasen +Date: Sun Oct 31 22:05:20 2010 -0400 + + Add an example of invoking actions + + gio/tests/gapplication-example-actions.c | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +commit d967b5ed17ae23f8694c5828c5574393bf9df076 +Author: Matthias Clasen +Date: Sun Oct 31 21:08:25 2010 -0400 + + Fix g_action_group_activate_action() docs + + gio/gactiongroup.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9574dbd2282e1fcf7bb5836c85cfff536bf4a7cf +Author: Matthias Clasen +Date: Sun Oct 31 20:58:15 2010 -0400 + + Be more careful about overwriting errors + + When trying to parse again, we don't want to overwrite the exiting + error. + + gio/gsettings-tool.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +commit 78407a00983d2fb70a94e00639408c80a58772b7 +Author: Matthias Clasen +Date: Sun Oct 31 20:49:53 2010 -0400 + + GApplication: Add an action example + + gio/gapplication.c | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit cb8d29a55897b65c5d60077db19f39d1c01b2f86 +Author: Matthias Clasen +Date: Sun Oct 31 20:33:02 2010 -0400 + + Don't leak references in the actions example + + These are not initially unowned... + + gio/tests/gapplication-example-actions.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 09426632796b31a4f978e1c6c5666cc660e14a71 +Author: Takayuki KUSANO +Date: Mon Nov 1 01:28:13 2010 +0900 + + Fix error in Japanese translation + + po/ja.po | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit c34bcefa78faacbda4528de9aeea2e13519c27e0 +Author: Matthias Clasen +Date: Sat Oct 30 22:19:02 2010 -0400 + + Add an example of using GApplication with actions + + gio/tests/Makefile.am | 4 ++ + gio/tests/gapplication-example-actions.c | 82 + ++++++++++++++++++++++++++++++ + 2 files changed, 86 insertions(+), 0 deletions(-) + +commit ab02965c50b8b80a2a676888f5aa4c36cbc7c3df +Author: Christian Persch +Date: Sat Oct 30 21:40:28 2010 -0400 + + Use G_GINT64_CONSTANT here + + Bug #631482. + + glib/gdatetime.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e24dfacd5b81ee0b6b596df3739df4448e5bbf04 +Author: Matthias Clasen +Date: Sat Oct 30 01:13:42 2010 -0400 + + gsettings-tool: Support completion for enum values + + https://bugzilla.gnome.org/show_bug.cgi?id=631264 + + gio/gsettings-bash-completion.sh | 18 ++++++++++++++++++ + gio/gsettings-tool.c | 17 +++++++++++++++++ + 2 files changed, 35 insertions(+), 0 deletions(-) + +commit 6298e88538fb5799432774574713af259701c735 +Author: Matthias Clasen +Date: Sat Oct 30 00:00:06 2010 -0400 + + Add a command to list keys and values recursively + + This is similar to gconftool-2 -R, which is very handy + for collecting information for bug reports, etc. It is now + possible to say gsettings list-recursively org.foo.bar, and + this will produce a list of schemas, keys and values for + org.foo.bar and all its child and grandchild schemata, + recursively. + + https://bugzilla.gnome.org/show_bug.cgi?id=632571 + + gio/gsettings-bash-completion.sh | 6 ++-- + gio/gsettings-tool.c | 66 + ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 69 insertions(+), 3 deletions(-) + +commit d6192166862c6cad3914ddf397b798205263b564 +Author: Matthias Clasen +Date: Fri Oct 29 23:12:07 2010 -0400 + + Make gsettings-tool translatable again + + This regression was caused by the recent rewrite. + + gio/gsettings-tool.c | 92 + ++++++++++++++++++++++++++----------------------- + 1 files changed, 49 insertions(+), 43 deletions(-) + +commit cb647730029d5da388637e2a532f7f54a0d86f47 +Author: Ryan Lortie +Date: Fri Oct 29 16:33:47 2010 -0400 + + Use 'aay' instead of 'as' for environ + + It might contain non-utf8 characters. + + gio/gapplication.c | 10 +++++++--- + gio/gapplicationcommandline.c | 3 ++- + 2 files changed, 9 insertions(+), 4 deletions(-) + +commit 641f622bfe72866baa52dbd1044b7be2b6271999 +Author: Ryan Lortie +Date: Thu Oct 28 23:06:53 2010 -0400 + + GApplication: emit a signal when starting up + + Send a signal to the bus when registration is successful and we + are the + primary instance. + + gio/gapplicationimpl-dbus.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 7aa2e5026260a51e089d10dd18017b8f129b7adf +Author: Ryan Lortie +Date: Thu Oct 28 22:49:12 2010 -0400 + + GApplication: support environment passing + + Add support for passing the full contents of the environment to the + primary instance (by storing it in the platform_data) when + G_APPLICATION_SEND_ENVIRONMENT is in the flags. + + docs/reference/gio/gio-sections.txt | 2 + + gio/gapplication.c | 8 ++++ + gio/gapplicationcommandline.c | 71 + +++++++++++++++++++++++++++++++++++ + gio/gapplicationcommandline.h | 5 ++ + gio/gio.symbols | 2 + + gio/gioenums.h | 5 ++- + 6 files changed, 92 insertions(+), 1 deletions(-) + +commit 99d2c2eef580c6ee4cbcf18b656e574331d6ad08 +Author: Ryan Lortie +Date: Thu Oct 28 22:20:25 2010 -0400 + + Add testcase for environment functions + + glib/tests/.gitignore | 1 + + glib/tests/Makefile.am | 3 ++ + glib/tests/environment.c | 51 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 55 insertions(+), 0 deletions(-) + +commit 29ce7385bb631ac04dc8b965dd0c6fab488c770d +Author: Ryan Lortie +Date: Thu Oct 28 21:26:09 2010 -0400 + + Add g_get_environ(): portable access to 'environ' + + Return a copy of 'environ' on platforms where that is possible, or do + something else on other platforms. + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gutils.c | 39 + +++++++++++++++++++++++++++++++++ + glib/gutils.h | 1 + + 4 files changed, 42 insertions(+), 0 deletions(-) + +commit b4d3b6e0de4fe2f239f414c6a62be35018d05a4c +Author: Carles Ferrando +Date: Fri Oct 29 00:48:48 2010 +0100 + + Updated Catalan (Valencian) translation + + po/ca@valencia.po | 2095 + +++++++++++++++++++++++++++++++++++------------------ + 1 files changed, 1396 insertions(+), 699 deletions(-) + +commit bf7ba2fbdc6fdbb38fe35f71dfdf74dd8fcbf414 +Author: Ryan Lortie +Date: Thu Oct 28 16:46:18 2010 -0400 + + GApplication: use infinite timeout for CommandLine + + Use an infinite DBus timeout for sending a CommandLine request to the + primary instance. + + This resolves a bit of bug #633339. + + gio/gapplicationimpl-dbus.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit fac2a8278e6bc83b281cd85f783e9ae4b05371be +Author: Ryan Lortie +Date: Thu Oct 28 16:14:24 2010 -0400 + + Bug 633356 - (GDBus) Make G_MAXINT mean no timeout + + Don't register a timeout function in the case that G_MAXINT is + given for + the timeout length. + + gio/gdbusconnection.c | 31 +++++++++++++++++++------------ + gio/gdbusproxy.c | 6 ++++-- + 2 files changed, 23 insertions(+), 14 deletions(-) + +commit cd4f818b301bfc6855b27feba5a0dfdca60027c1 +Author: Dan Winship +Date: Thu Oct 28 15:17:17 2010 -0400 + + GNetworkService: fix a small bug + + Fix a small bug in the synchronous lookup code introduced in the fix + for bug 629274 + + gio/gnetworkservice.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit dd9f8b8cc6d873517dedd83935ed0d994bbbd6c9 +Author: Emilio Pozuelo Monfort +Date: Tue Sep 28 11:53:03 2010 +0200 + + Don't enable dtrace support when dtrace isn't available + + Fixes FTBFS when dtrace isn't available but is. + + configure.ac | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit 7c184df292f7552423fa7931c843b2f1949c1455 +Author: Ryan Lortie +Date: Fri Oct 16 12:19:06 2009 +0200 + + Bug 158725 - free linked list with data + + Add some helpers for freeing a linked list along with its elements by + providing a GDestroyNotify to call on each of them. + + Add a test. + + Based on a patch from Cosimo Cecchi. + + docs/reference/glib/glib-sections.txt | 2 + + glib/glib.symbols | 2 + + glib/glist.c | 21 ++++++++++- + glib/glist.h | 2 + + glib/gslist.c | 18 +++++++++ + glib/gslist.h | 2 + + glib/tests/list.c | 63 + +++++++++++++++++++++++++++++++++ + 7 files changed, 109 insertions(+), 1 deletions(-) + +commit 4baad1acbff936284c5367afdb4494cf081ee394 +Author: Ryan Lortie +Date: Wed Oct 27 09:26:01 2010 -0400 + + GApplication: exit_status unset in one branch + + Closes #633206 + + gio/gapplication.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f7a918dcb9fac00c7904b63452a59496594369aa +Author: Ryan Lortie +Date: Fri Oct 22 19:43:11 2010 +0200 + + GPeriodic: allow unblock time to be passed in + + gio/gperiodic.c | 22 ++++++++++++++++++++-- + gio/gperiodic.h | 3 ++- + 2 files changed, 22 insertions(+), 3 deletions(-) + +commit 2af4b6e5440c22f4b56923ac9a749af06b3188d9 +Author: Ryan Lortie +Date: Fri Oct 22 19:20:14 2010 +0200 + + Deprecate g_source_get_current_time() + + glib/glib.symbols | 2 ++ + glib/gmain.c | 2 ++ + glib/gmain.h | 2 ++ + 3 files changed, 6 insertions(+), 0 deletions(-) + +commit 83472b34ef0bd3b53ff0a38b7f8691c3bd6fa0a9 +Author: Ryan Lortie +Date: Fri Oct 22 19:16:57 2010 +0200 + + switch GSocket to monotonic time for timeouts + + gio/gsocket.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit d3fe2efb83b690507eb5513d96c27d06e9206da1 +Author: Ryan Lortie +Date: Fri Oct 22 19:13:01 2010 +0200 + + switch GPeriodic to use monotonic time + + gio/gperiodic.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 91113a8aeea40cc2d7dda65b09537980bb602a06 +Author: Ryan Lortie +Date: Fri Oct 22 19:10:39 2010 +0200 + + switch GTimeoutSource to use monotonic time + + glib/gmain.c | 72 + +++++++++++++++++++++++++++++----------------------------- + 1 files changed, 36 insertions(+), 36 deletions(-) + +commit b7d8363fbec421d1e3e8b1a198fd7efb2ec9d2bc +Author: Ryan Lortie +Date: Fri Oct 22 18:40:08 2010 +0200 + + Add g_source_get_time() + + Cached version of g_get_monotonic_time() that does similar to what + g_source_get_current_time() does for g_get_current_time(). + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gmain.c | 47 + ++++++++++++++++++++++++++++++++- + glib/gmain.h | 2 + + 4 files changed, 50 insertions(+), 1 deletions(-) + +commit bf941f200c9784eb363d3b07b9d828dfc31a3ce2 +Author: Ryan Lortie +Date: Fri Oct 22 18:47:06 2010 +0200 + + Rename time_is_current to current_time_is_fresh + + Internal structure field; no semantic changes. + + glib/gmain.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit ab548d240a9c2862ea7f7685c68b6013a68bf0c8 +Author: Ryan Lortie +Date: Fri Oct 22 18:42:32 2010 +0200 + + Add g_get_monotonic_time() + + Gets the system monotonic time on systems that have it. Otherwise, + call + g_get_current_time(). + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gmain.c | 70 + ++++++++++++++++++++++++++++++++- + glib/gmain.h | 1 + + 4 files changed, 72 insertions(+), 1 deletions(-) + +commit ac82e74895f5a094e07506e48b908188e03006d3 +Author: Ryan Lortie +Date: Fri Oct 22 17:28:46 2010 +0200 + + Add 'GTimeSpec' as 'struct timespec' equivalent + + docs/reference/glib/glib-sections.txt | 3 +++ + docs/reference/glib/tmpl/date.sgml | 8 ++++++++ + glib/gmain.c | 9 +++++++++ + glib/gtypes.h | 9 +++++++++ + 4 files changed, 29 insertions(+), 0 deletions(-) + +commit 817b322ca781009617c40c4a05250ce412ecd0e8 +Author: Ryan Lortie +Date: Fri Oct 22 17:16:47 2010 +0200 + + Link libglib against -lrt if we have clock_gettime + + configure.ac | 2 ++ + glib/Makefile.am | 2 +- + 2 files changed, 3 insertions(+), 1 deletions(-) + +commit dfb0577ef4947afb32d91a72769bd22d6c1edfaa +Author: Ryan Lortie +Date: Wed Oct 27 09:08:32 2010 -0400 + + Bug 632169 - manual use of gsettings-data-convert + + Add some words and example code to the documentation about why + you might + want to manually invoke gsettings-data-convert and how you should go + about doing that. + + docs/reference/gio/migrating-gconf.xml | 64 + ++++++++++++++++++++++++++++++++ + 1 files changed, 64 insertions(+), 0 deletions(-) + +commit 9126f1afae922339949d0b76e282411618bcb565 +Author: Ryan Lortie +Date: Tue Oct 26 12:02:12 2010 -0400 + + gsettings m4: Use --strict for checking + + A while ago we allowed glib-compile-schemas to return a 'success' + status + in the case that just one schema file contained errors. Of course, + this + is the exact opposite of what we want in the case that we are checking + schema validity at compile time. + + Use the --strict flag for that case. + + This closes #633115. + + m4macros/gsettings.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 181982c47cde49b3aff2293729f5aee5987db8af +Author: Ryan Lortie +Date: Tue Oct 26 11:49:32 2010 -0400 + + GVariant: avoid locking in a common case + + Avoid acquiring the lock on the instance on the case of deserialising + a + child. We know that it is safe to do this unlocked because a + serialised + child will never become unserialised. + + Closes #626320 + + glib/gvariant-core.c | 69 + ++++++++++++++++++++++++++++--------------------- + 1 files changed, 39 insertions(+), 30 deletions(-) + +commit e0caf4fd5ee82cc25806e7e86af14a8bf881c513 +Author: Ryan Lortie +Date: Mon Oct 25 14:45:19 2010 -0400 + + GApplicationCommandLine: add printf annotations + + to g_application_command_line_print{,err} + + gio/gapplicationcommandline.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit d8d2513710c5663dc7387d79e443edeb5c75598f +Author: Ryan Lortie +Date: Mon Oct 25 14:32:07 2010 -0400 + + Implement (untested) GApplication actions support + + gio/gactiongroup.h | 29 +++- + gio/gapplication.c | 118 ++++++++-- + gio/gapplicationimpl-dbus.c | 517 + ++++++++++++++++++++++++++++++++++++++----- + gio/gapplicationimpl.h | 23 ++- + gio/giotypes.h | 1 + + 5 files changed, 607 insertions(+), 81 deletions(-) + +commit 196cd41f742730950a567c64381e2e8afadfa88c +Author: Andika Triwidada +Date: Mon Oct 25 22:10:32 2010 +0700 + + Updated Indonesian translation + + po/id.po | 695 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 360 insertions(+), 335 deletions(-) + +commit 66ec8b949ead5593ccb2ce54426fdf7d50ec4077 +Author: Matthias Clasen +Date: Mon Oct 25 09:55:38 2010 -0400 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 11a59404d5623d65e0d09c555ef2d4be50e4023b +Author: Matthias Clasen +Date: Mon Oct 25 08:42:36 2010 -0400 + + More documentation fixups + + docs/reference/gio/gio-sections.txt | 14 ++------------ + gio/gapplication.h | 2 +- + gio/gdatainputstream.c | 2 ++ + 3 files changed, 5 insertions(+), 13 deletions(-) + +commit d10a04b5330c6c4ef23a4e7871c8ced0c8343250 +Author: Matthias Clasen +Date: Mon Oct 25 08:34:00 2010 -0400 + + Remove nonexisting API from the headers + + I couldn't find any trace of g_application_run_with_arguments. + + gio/gapplication.h | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +commit 727c2a58c2468dd2faa442d2be7777b20b7b089b +Author: Matthias Clasen +Date: Mon Oct 25 08:30:28 2010 -0400 + + Add new gmain api to the docs + + docs/reference/glib/glib-sections.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 7bb731d6136a9975b501757836762b91ad6ac416 +Author: Matthias Clasen +Date: Mon Oct 25 08:19:34 2010 -0400 + + Update NEWS for 2.27.1 + + NEWS | 88 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 88 insertions(+), 0 deletions(-) + +commit f67d16c52a244c1db2cf40340700c6dc90ab866a +Author: Yinghua Wang +Date: Sun Oct 24 03:51:46 2010 +0000 + + Update Simplified Chinese translation. + + po/zh_CN.po | 778 + ++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 398 insertions(+), 380 deletions(-) + +commit 00366f440d6322b2742eb1cd35835902269c0e37 +Author: Matthias Clasen +Date: Sat Oct 23 20:43:36 2010 +0200 + + Some more GApplication doc tweaks + + gio/gapplication.c | 54 + +++++++++++++++++++++++----------------- + gio/gapplicationcommandline.c | 16 ++++++++++- + gio/gioenums.h | 9 ++++--- + 3 files changed, 50 insertions(+), 29 deletions(-) + +commit 013f862a03d11708bb08f2ec98c8612f245a8937 +Author: Matthias Clasen +Date: Sat Oct 23 14:04:28 2010 +0200 + + Properly register the inactivity-timeout property + + It is a uint, not a boolean, so register it as such. + Also, only install the service timeout if we are actually registered + as the primary instance. + + gio/gapplication.c | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +commit 7c735b05f7a00c728e23a366128ffb56fee58b4e +Author: Matthias Clasen +Date: Sat Oct 23 12:01:51 2010 +0200 + + Move a confusing comment to the right place + + gio/gapplication.c | 6 ------ + gio/gapplicationimpl-dbus.c | 3 +++ + 2 files changed, 3 insertions(+), 6 deletions(-) + +commit b0e45c97992499929f1393743935438e07e88326 +Author: Matthias Clasen +Date: Sat Oct 23 11:54:50 2010 +0200 + + Add another example for commandline handling + + Also, clarify some aspects in the documentation. + + gio/gapplication.c | 10 ++- + gio/gapplication.h | 7 +- + gio/gapplicationcommandline.c | 4 +- + gio/tests/Makefile.am | 4 + + gio/tests/gapplication-example-cmdline2.c | 106 + +++++++++++++++++++++++++++++ + 5 files changed, 123 insertions(+), 8 deletions(-) + +commit 499d9ba8b8fec44282fac09426b61d027c166459 +Author: Matthias Clasen +Date: Sat Oct 23 02:27:39 2010 +0200 + + Add some examples to the GApplication docs + + gio/gapplication.c | 9 +++++- + gio/gapplicationcommandline.c | 2 + + gio/tests/Makefile.am | 8 +++++ + gio/tests/gapplication-example-cmdline.c | 47 + ++++++++++++++++++++++++++++ + gio/tests/gapplication-example-open.c | 50 + ++++++++++++++++++++++++++++++ + 5 files changed, 115 insertions(+), 1 deletions(-) + +commit 79790b927840b1c2d389753c7237820d2f16899e +Author: Matthias Clasen +Date: Sat Oct 23 00:40:13 2010 +0200 + + Brush up the GApplication docs + + Also, fix up inclusions, mark properties for translation, etc. + + gio/gapplication.c | 124 + ++++++++++++++++++++++++++++++++++------- + gio/gapplication.h | 2 + + gio/gapplicationcommandline.c | 40 ++++++++----- + gio/gdbuserror.c | 2 +- + gio/gioenums.h | 8 ++- + gio/gsimpleaction.c | 2 +- + gio/gsimpleactiongroup.c | 2 +- + 7 files changed, 141 insertions(+), 39 deletions(-) + +commit 210a77a07ebf51156bb7fbc1482ce71fd56cbcd2 +Author: Matthias Clasen +Date: Sat Oct 23 00:32:45 2010 +0200 + + Fix a typo + + gio/gapplication.c | 16 ++++++++++------ + 1 files changed, 10 insertions(+), 6 deletions(-) + +commit e410131021036532e6e9622e8b977222389b44e9 +Author: Dan Winship +Date: Wed Sep 15 10:05:03 2010 -0400 + + GNetworkService: fall back when there is no valid SRV record + + RFC 2782 says that if there is no SRV record for + _SERVICE._PROTOCOL.DOMAIN, you should fall back to trying just DOMAIN, + with the default port for SERVICE. Do that. + + https://bugzilla.gnome.org/show_bug.cgi?id=629274 + + gio/gnetworkservice.c | 50 + ++++++++++++++++++++++++++++++++++++++++++++---- + 1 files changed, 45 insertions(+), 5 deletions(-) + +commit 19243c247d8a89c6467bd21109b7f0d4b1cb081a +Author: Dan Winship +Date: Wed Sep 15 10:22:13 2010 -0400 + + GNetworkService: fix iteration of multiple addresses + + Previously if there were multiple SRV records, only the first would + be iterated by the GSocketConnectable interface + + gio/gnetworkservice.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 87d06109ab325a4a68e151015381e7e1b33bdf7d +Author: Dan Winship +Date: Tue Aug 17 18:34:13 2010 -0400 + + GSocket: set protocol when using g_socket_new_from_fd() + + Otherwise, attempting to create a GSocketConnection from the socket + will likely return the wrong type, since the protocol won't match any + of the registered subtypes. + + Also add the start of a GSocket test program (from davidz). + + https://bugzilla.gnome.org/show_bug.cgi?id=627171 + + gio/gsocket.c | 29 ++++++++++++++-- + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 6 +++- + gio/tests/socket.c | 86 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 117 insertions(+), 5 deletions(-) + +commit a62b43fd9cea5455bead9a5bd12a27f01c4fadf4 +Author: Florian Müllner +Date: Fri Oct 22 13:20:54 2010 +0200 + + Fix deadlock in g_object_remove_toggle_ref() + + The code section guarded with toggle_refs_mutex includes a call to + g_object_unref(), which may call toggle_refs_notify(). As the latter + tries to acquire the same mutex, glib locks up. + + https://bugzilla.gnome.org/show_bug.cgi?id=632884 + + gobject/gobject.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit b7616114c6c1884c3a183a4d83156bdf2151b731 +Author: Alberto Garcia +Date: Fri Mar 26 16:19:13 2010 +0100 + + Protect access to closure, weak refs and toggle refs arrays + + This fixes https://bugzilla.gnome.org/show_bug.cgi?id=613822 + + gobject/gobject.c | 30 ++++++++++++++++++++++++++---- + 1 files changed, 26 insertions(+), 4 deletions(-) + +commit dd6e15dd24a1f1910cfd71c2e21078261936c98d +Author: Ryan Lortie +Date: Thu Oct 21 14:02:41 2010 +0200 + + GApplication: create local commandline properly + + Don't pass a gchar** to g_object_new() when a GVariant* is expected. + + gio/gapplication.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 8690984ceadc35dc4251277ea1ca759d180a8fd6 +Author: Ryan Lortie +Date: Thu Oct 21 01:37:23 2010 +0200 + + GPeriodic: pass microseconds to the tick functions + + ...instead of milliticks, which nobody really cares to understand. + + gio/gperiodic.c | 29 ++++++++++++++++------------- + 1 files changed, 16 insertions(+), 13 deletions(-) + +commit 5400b0b38c513c829a4f0b0fc59188f820435d79 +Author: Ryan Lortie +Date: Wed Oct 20 03:20:34 2010 +0200 + + GPeriodic: a periodic event clock + + Add a new class, GPeriodic. + + We hope to use this as a paint clock that can be shared by GTK and + Clutter. Many changes are still expected to the API. + + docs/reference/gio/gio-docs.xml | 4 + + docs/reference/gio/gio-sections.txt | 26 ++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio-marshal.list | 1 + + gio/gio.h | 1 + + gio/gio.symbols | 14 + + gio/gperiodic.c | 631 + +++++++++++++++++++++++++++++++++++ + gio/gperiodic.h | 69 ++++ + 9 files changed, 749 insertions(+), 0 deletions(-) + +commit e33deea16ce3af7b91386d5debffd284a0109dfc +Author: Ryan Lortie +Date: Tue Oct 19 19:38:00 2010 +0200 + + GApplication: reduce GVariant abuse + + Don't use GVariant* as the representation for the argument array. + + docs/reference/gio/gio-sections.txt | 1 - + gio/gapplication.c | 53 + ++++++++++------------------------- + gio/gapplication.h | 40 +++++++++++++------------- + gio/gapplicationimpl-dbus.c | 8 ++-- + gio/gapplicationimpl.h | 2 +- + gio/gio.symbols | 3 -- + 6 files changed, 40 insertions(+), 67 deletions(-) + +commit a327bc51fc3090ed32d7e250dedadb8c35e84aeb +Author: Ryan Lortie +Date: Tue Oct 19 18:18:13 2010 +0200 + + Cleanup and doc GApplicationCommandLine + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 2 - + gio/gapplicationcommandline.c | 406 + +++++++++++++++++++++++++---------- + gio/gapplicationcommandline.h | 29 +-- + gio/tests/gapplication.c | 2 +- + 5 files changed, 301 insertions(+), 139 deletions(-) + +commit eac4c385f0e34b012d49a09fb48712fdd0e46646 +Author: Ryan Lortie +Date: Tue Oct 19 16:56:18 2010 +0200 + + GIO reference doc cleanups (re: GApplication) + + docs/reference/gio/Makefile.am | 2 + + docs/reference/gio/gio-sections.txt | 84 + ++++++++++++++++++++++++++--------- + 2 files changed, 65 insertions(+), 21 deletions(-) + +commit a2ac9c2515dcf227ed7c4e062b326bb0ac21c5ad +Author: Ryan Lortie +Date: Tue Oct 19 13:45:20 2010 +0200 + + GDBus: disable test to work around bug #631379 + + This test consistently prevents 'make distcheck' from passing + on Ubuntu. + + gio/tests/gdbus-peer.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 0ce1462d1a4d4510bcac1b6fb9cf4d9f38b44de9 +Author: Ryan Lortie +Date: Tue Oct 19 13:44:30 2010 +0200 + + GApplication: merge DBus interface into C source + + instead of having it in a separate file that causes problems to the + build system (I want to avoid using EXTRA_DIST here). + + gio/Makefile.am | 1 + + gio/gapplicationimpl-dbus-interface.c | 93 + --------------------------------- + gio/gapplicationimpl-dbus.c | 84 + ++++++++++++++++++++++++++++- + 3 files changed, 82 insertions(+), 96 deletions(-) + +commit 8ff9150e4422db000289a282b23aadac4dd5ba2c +Author: Ryan Lortie +Date: Tue Oct 19 12:38:40 2010 +0200 + + gio: update symbols + + gio/gio.symbols | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 34f31fdfda549de717bb0ef02f6acfdb6de8ca29 +Author: Ryan Lortie +Date: Tue Oct 19 12:38:01 2010 +0200 + + Don't try to dist old GApplication implementations + + One of them was deleted already, even. + + gio/Makefile.am | 2 +- + gio/gnullapplication.c | 74 + ------------------------------------------------ + 2 files changed, 1 insertions(+), 75 deletions(-) + +commit a6b8a3113bfd5fe9b28d3377865fed1ab1849ce0 +Author: Ryan Lortie +Date: Tue Oct 12 21:42:59 2010 -0400 + + GApplication: use g_signal_accumulator_first_wins + + ...instead of our homebrew version. + + gio/gapplication.c | 14 ++------------ + 1 files changed, 2 insertions(+), 12 deletions(-) + +commit 04b58a3e270c7de520c65cb213f95048db4503c8 +Author: Ryan Lortie +Date: Mon Oct 11 15:57:09 2010 -0400 + + Change 'Since:' to 2.28 for action classes + + gio/gaction.c | 26 +++++++++++++------------- + gio/gactiongroup.c | 34 +++++++++++++++++----------------- + gio/gsimpleaction.c | 18 +++++++++--------- + gio/gsimpleactiongroup.c | 8 ++++---- + 4 files changed, 43 insertions(+), 43 deletions(-) + +commit 3fe94ca9e904a5b85eb4beba978c68e2e01d4a59 +Author: Ryan Lortie +Date: Mon Oct 11 11:54:51 2010 -0400 + + GApplication: fill in action group implementation + + gio/gapplication.c | 119 + +++++++++++++++++++++++++++++++++++++++++++++++---- + gio/gapplication.h | 3 + + 2 files changed, 112 insertions(+), 10 deletions(-) + +commit 491641cf017eff245dc13f7bea6011c7462c51f1 +Author: Ryan Lortie +Date: Mon Oct 11 10:50:41 2010 -0400 + + gio: app info symbol file fixup + + gio/gio.symbols | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 52b7fcf4093ac49860108c52cef58f62491cf1e4 +Author: Ryan Lortie +Date: Mon Oct 11 10:49:20 2010 -0400 + + gio: symbol file updates (actions, command line) + + gio/gio.symbols | 30 +++++++++++++++++++++++------- + 1 files changed, 23 insertions(+), 7 deletions(-) + +commit d6ac6c1850a8cd73775d6e95a20bb13f1f7f9527 +Author: Ryan Lortie +Date: Mon Oct 11 10:45:51 2010 -0400 + + Rename methods on GActionGroup to include 'action' + + Makes explicit the fact that you are interacting with the individual + action rather than the group and removes potential namespace conflicts + with classes implementing the interface (like g_application_activate() + vs g_application_activate_action()). + + gio/gactiongroup.c | 46 ++++++++++++++++---------------- + gio/gactiongroup.h | 66 + +++++++++++++++++++++++----------------------- + gio/gapplication.c | 14 +++++----- + gio/gsimpleactiongroup.c | 14 +++++----- + gio/tests/actions.c | 28 ++++++++++---------- + 5 files changed, 84 insertions(+), 84 deletions(-) + +commit b2f942c142a84aa88b44600250bd93418ed14db3 +Author: Ryan Lortie +Date: Sun Oct 10 20:05:13 2010 -0400 + + GApplication: stub-in GActionGroup implementation + + gio/gapplication.c | 83 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 82 insertions(+), 1 deletions(-) + +commit 582638d7add3cd17b720c6a95bd18e9913c729a6 +Author: Ryan Lortie +Date: Sat Oct 9 17:25:07 2010 -0400 + + GApplication test: test remote commandline + + Also, a few small fixes/tweaks to other places in the test. + + gio/tests/gapplication.c | 68 + +++++++++++++++++++++++++++++++++++++++++---- + 1 files changed, 62 insertions(+), 6 deletions(-) + +commit 3e6eee806cdddd651bc15da9117adae1c3f97e6a +Author: Ryan Lortie +Date: Sat Oct 9 17:24:09 2010 -0400 + + GApplication: add remote commandline support + + gio/Makefile.am | 2 + + gio/gapplication.c | 88 +++++++++-- + gio/gapplication.h | 5 +- + gio/gapplicationcommandline.c | 273 + +++++++++++++++++++++++++++++++++ + gio/gapplicationcommandline.h | 120 +++++++++++++++ + gio/gapplicationimpl-dbus-interface.c | 36 +++++- + gio/gapplicationimpl-dbus.c | 234 +++++++++++++++++++++++++++- + gio/gapplicationimpl.h | 5 + + gio/gio-marshal.list | 1 + + gio/gio.h | 1 + + gio/gioenums.h | 7 +- + 11 files changed, 748 insertions(+), 24 deletions(-) + +commit 2854c373e140e63d6bd1a9f2ac01851c5b6418b1 +Author: Ryan Lortie +Date: Wed Oct 6 14:06:26 2010 -0400 + + GApplication test case + + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 5 +- + gio/tests/gapplication.c | 177 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 182 insertions(+), 1 deletions(-) + +commit 72ce1c7eb6ece6353abaf3882ff4d50a39992efe +Author: Ryan Lortie +Date: Wed Oct 6 14:05:40 2010 -0400 + + GApplication: fix inactivity-timeout + + Create the gobject property for it. + + Tweak the logic of having a pending timeout at the time that the + application starts -- run the mainloop with a use count of zero + if there + is a timeout active. + + gio/gapplication.c | 20 ++++++++++++++------ + 1 files changed, 14 insertions(+), 6 deletions(-) + +commit a7923a4aa3ff6d67672c6c69cd1b7d70fba9c57d +Author: Ryan Lortie +Date: Wed Oct 6 13:08:26 2010 -0400 + + new GApplication implementation + + gio/Makefile.am | 9 +- + gio/gapplication.c | 1790 + ++++++++++++++------------------- + gio/gapplication.h | 175 ++-- + gio/gapplicationimpl-dbus-interface.c | 59 ++ + gio/gapplicationimpl-dbus.c | 304 ++++++ + gio/gapplicationimpl.h | 28 + + gio/gdbusapplication.c | 424 -------- + gio/gio-marshal.list | 3 +- + gio/gio.symbols | 30 +- + gio/gioenums.h | 18 + + gio/giotypes.h | 2 + + gio/tests/.gitignore | 3 - + gio/tests/Makefile.am | 12 - + gio/tests/application.c | 222 ---- + gio/tests/testapp.c | 107 -- + gio/tests/testapps.c | 604 ----------- + 16 files changed, 1258 insertions(+), 2532 deletions(-) + +commit 9d80c361418f94c609840ec9f83741aede7e482c +Author: Tor Lillqvist +Date: Thu Oct 14 22:47:25 2010 +0300 + + Use CSIDL_LOCAL_APPDATA on Windows + + Make g_get_user_data_dir() return the CSIDL_LOCAL_APPDATA folder on + Windows, and not CSIDL_PERSONAL. On Windows 7, that corresponds to the + subfolders AppData\Local vs. Documents under the profile ("home") + folder. This matches what Qt does, for instance, and has been widely + requested. + + Also make g_get_user_config_dir() return this and not the (roaming) + CSIDL_APPDATA folder. The reason for this change is that it would be + surprising and hard to justify if g_get_user_data_dir() returned the + local application data folder while g_get_user_config_dir() would + return the roaming one. Nothing in the function names or the XDG specs + suggests that any roaming vs. local dichotomy would be involved. + + Document the new semantics and the fact that these two functions now + return the same directory on Windows. + + Note that in reality, code that really truly wants to support Windows + as well as possible probably will not use these GLib functions anyway, + but Win32 APIs directly to be sure what it is doing... + + Should hopefully satisfy complaints in bug #620710 and related bugs. + + glib/gutils.c | 18 ++++++++++-------- + 1 files changed, 10 insertions(+), 8 deletions(-) + +commit 9040eac4ebfbe14141d6501f44a501bfe5e61b9c +Author: Matthias Clasen +Date: Sat Oct 16 23:30:30 2010 -0400 + + Prevent error pileup + + gio/glib-compile-schemas.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 3c808dc87471d25a7b06c7f41d1b8341c2ca1e7d +Author: Ryan Lortie +Date: Tue Oct 12 21:34:26 2010 -0400 + + GSignal: fix trivial docs typo + + gobject/gsignal.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 15d87c2cc48c8c1af3ad06ff8aaef766aa21fd6b +Author: Ryan Lortie +Date: Tue Oct 12 20:58:43 2010 -0400 + + GObject: add g_signal_accumulator_first_wins + + Deals with the case where we want exactly one signal handler to run. + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gobject.symbols | 1 + + gobject/gsignal.c | 33 + +++++++++++++++++++++++++++ + gobject/gsignal.h | 5 ++++ + 4 files changed, 40 insertions(+), 0 deletions(-) + +commit 0c21689ed83de2fb7bfb6dc31efa5d687cb7c6f8 +Author: Colin Walters +Date: Tue Oct 12 12:54:36 2010 -0400 + + gthemedicon: Fix annotation for g_themed_icon_get_names + + gio/gthemedicon.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit cdd58347d1ddc282e55f91d0a991b268547d78d9 +Author: Jorge González +Date: Sat Oct 9 14:38:08 2010 +0200 + + Updated Spanish translation + + po/es.po | 700 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 361 insertions(+), 339 deletions(-) + +commit 5fa7a1e9cedb33d32049c54f13adc3504d723573 +Author: Javier Jardón +Date: Fri Oct 8 17:21:53 2010 +0200 + + gtypemodule: Mention g_object_run_dispose correctly in a warning + + https://bugzilla.gnome.org/show_bug.cgi?id=630797 + + gobject/gtypemodule.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 44a8ff2f8f607f725c478793b876742b09f350ef +Author: Emmanuele Bassi +Date: Fri Oct 8 16:09:10 2010 +0100 + + gobject: Improve install_properties() + + Cache the parent type outside of the loop, and fix a typo in the + documentation. + + gobject/gobject.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +commit 3035bf40d0d75632b36fa703c3ac2becc98769d8 +Author: Christian Dywan +Date: Fri Oct 8 16:33:33 2010 +0200 + + Initialise lengths in GvdbReader to silence warnings + + gio/gvdb/gvdb-reader.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit ad363d9aac5a6167121631a1ee8d3cec2784b5c2 +Author: Christian Dywan +Date: Fri Oct 8 16:33:04 2010 +0200 + + Initialise lengths in GDbusAuth to silence warnings + + gio/gdbusauth.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 53f398f52aa07c4ae8c788fcc002f70eac941844 +Author: Christian Dywan +Date: Fri Oct 8 15:17:31 2010 +0200 + + Mention g_object_run_dispose correctly in tutorial + + Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=630797 + + docs/reference/gobject/tut_gobject.xml | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 0e3a39c016c75523efb30531942cfd87976413c8 +Author: Bruce Cowan +Date: Thu Oct 7 21:27:17 2010 +0100 + + Updated British English translation + + po/en_GB.po | 469 + ++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 258 insertions(+), 211 deletions(-) + +commit 7bafb3be95026055b4c9142ea1a82895c9e393bc +Author: William Jon McCann +Date: Thu Oct 7 13:51:21 2010 -0400 + + Remove g_desktop_app_info_lookup_get_type symbol from gio.types + + It was removed in 9b262f1c5fe5a6fd879f17cd7b80d8c54e33d80c + + docs/reference/gio/gio.types | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 46390c9d107b6df55de458b3ffe47a5428d7f287 +Author: Tor Lillqvist +Date: Thu Oct 7 12:04:52 2010 +0300 + + Don't call close() on -1 + + Of course, a proper implementation of close() will just ignore an + invalid parameter silently, and set errno. But apparently the "debug" + version of the Microsoft C library generates some noise in this + case. So avoid that. Thanks to John Emmas for reporting. + + tests/testglib.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 200e3d7307df75803c03a2aebcbba0dc5eaa9161 +Author: Yaron Shahrabani +Date: Wed Oct 6 02:18:30 2010 +0200 + + Updated Hebrew translation. + + po/he.po | 449 + ++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 236 insertions(+), 213 deletions(-) + +commit 9b262f1c5fe5a6fd879f17cd7b80d8c54e33d80c +Author: Bastien Nocera +Date: Tue Oct 5 15:02:37 2010 +0100 + + Replace "gio-desktop-app-info-lookup" extension point + + With a native version, that looks for desktop items supporting + x-scheme-handler/foo, when looking for a handler for the "foo" + URI scheme handler. + + https://bugzilla.gnome.org/show_bug.cgi?id=631410 + + gio/gdesktopappinfo.c | 93 + ++++-------------------------------------------- + gio/gdesktopappinfo.h | 36 ------------------- + gio/gio.symbols | 1 - + gio/giomodule.c | 5 --- + 4 files changed, 8 insertions(+), 127 deletions(-) + +commit 1612a4d5065e3505cf45585ffb7e890a06ff27d6 +Author: Ryan Lortie +Date: Tue Oct 5 02:29:47 2010 -0400 + + volume monitor: don't unref NULL + + Fix a couple more cases of blindly calling g_object_unref() on the + result of a function that is documented as sometimes returning NULL. + + gio/tests/volumemonitor.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit a7662ef315d7f369cbbc438dec76e3b9db3cd5ba +Author: Ryan Lortie +Date: Tue Oct 5 02:11:22 2010 -0400 + + GVariant tests: fix bad allignment assumption + + One of the GVariant test cases allocates a pair of character arrays on + the stack and then passes them to functions that assume that they will + be aligned to a multiple of two. + + This is not the case for some versions of GCC (4.0.3 on PowerPC). + + glib/tests/gvariant.c | 13 ++++++++----- + 1 files changed, 8 insertions(+), 5 deletions(-) + +commit 3c5b50c4243025c9f42caac9a429291194b77be5 +Author: Ryan Lortie +Date: Mon Oct 4 21:07:50 2010 -0400 + + GSettings test: fix error match strings + + The name of the internal function that appears in an assertion message + has changed. Update the tests. + + gio/tests/gsettings.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit c4037230d4afcc0b634dede843a94b3836bb0c39 +Author: Ryan Lortie +Date: Mon Oct 4 03:41:03 2010 -0400 + + gsettings-tool: Add 'range' subcommand + + Provides access to the g_settings_get_range() functionality, + converting + its return value to something that's reasonable for printing at the + console and potentially parseable. The format may change. + + Bug #631264. + + gio/gsettings-bash-completion.sh | 8 ++-- + gio/gsettings-tool.c | 63 + ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 67 insertions(+), 4 deletions(-) + +commit 59bdba3cbb50274b906740d483f049cdc91eb928 +Author: Ryan Lortie +Date: Mon Oct 4 03:40:22 2010 -0400 + + gsettings-tool: implement range-checking + + Prevent assertion messages from spewing forth and also ensure that we + exit with an error status in the event that the value was out + of range. + + Bug #631264. + + gio/gsettings-tool.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit e740c5b4cdcdf8e5f60cd2500451499c499d4ec2 +Author: Ryan Lortie +Date: Mon Oct 4 03:36:09 2010 -0400 + + Update symbols and docs sections + + docs/reference/gio/gio-sections.txt | 6 +++++- + gio/gio.symbols | 2 ++ + 2 files changed, 7 insertions(+), 1 deletions(-) + +commit e81d85615991e40a9c72f4f4319c358a4e1479cd +Author: Ryan Lortie +Date: Mon Oct 4 03:33:06 2010 -0400 + + GSettings: add g_settings_range_check() API + + Checks if a given value is within the correct range for a key. + + gio/gsettings.c | 51 + +++++++++++++++++++++++++++++++++++++++++++-------- + gio/gsettings.h | 3 +++ + 2 files changed, 46 insertions(+), 8 deletions(-) + +commit d6d76783ae9fc473d7fe38683d729d6c2c8e80c4 +Author: Ryan Lortie +Date: Mon Oct 4 02:58:46 2010 -0400 + + Bug 631263 - GSettings needs range/choice APIs + + Add g_settings_get_range() to describe the possible values that may be + provided to g_settings_set_value() without causing an error. + + Add a test case. + + gio/gsettings.c | 84 + ++++++++++++++++++++++++++++++++++++++++++++++++- + gio/gsettings.h | 2 + + gio/strinfo.c | 31 ++++++++++++++++++ + gio/tests/gsettings.c | 43 +++++++++++++++++++++++++ + 4 files changed, 159 insertions(+), 1 deletions(-) + +commit 833e389516b5e5b2271ed84c7b2036801c3100f1 +Author: Ryan Lortie +Date: Mon Oct 4 02:57:06 2010 -0400 + + schema compiler: Don't store zero-valued flags + + Don't store the "none" value for flags into the compiled schema file. + "none" should never appear as a value -- no flags set is indicated + by an + empty array. + + gio/glib-compile-schemas.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit 136e705e8383ff8848e425ac01278102d7badc52 +Author: Ryan Lortie +Date: Mon Oct 4 01:51:11 2010 -0400 + + Bug 627126 - gsettings schemas on FreeBSD + + Rewrite the install rule for GSettings schemas to not depend on an + obscure chunk of non-portable sed that nobody understands the purpose + of. + + Instead, use make's VPATH feature to resolve the paths of the + files that + need to be installed. No need to depend on the .valid targets here + since automake already ensures that 'make all' is complete before + 'make + install' is permitted to run. + + m4macros/gsettings.m4 | 16 ++-------------- + 1 files changed, 2 insertions(+), 14 deletions(-) + +commit 8efcc0d8c86b588eb0ee0e60d3c60d8c107734b5 +Author: Ryan Lortie +Date: Sun Oct 3 23:26:18 2010 -0400 + + glib-compile-schemas: write strinfo little endian + + Ensure that the strinfo is output in little-endian byte order on big + endian machines. + + GSettings is now passing all of its tests on PowerPC. + + Bug #630968 is closed. + + gio/glib-compile-schemas.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 61563d5f555f697824cd2ecc17a6687773e6e70e +Author: Ryan Lortie +Date: Sun Oct 3 23:25:29 2010 -0400 + + GSettings strinfo: byteswap integers + + strinfo is always strictly little endian, so ensure that we + byteswap to + native when comparing and returning. + + gio/strinfo.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 9211d2b00c82057864631a78b1f4ba1d36ee7b5c +Author: Ryan Lortie +Date: Sun Oct 3 23:15:27 2010 -0400 + + GSettings endian: missed a spot + + Missed an instance of get_value -> get_raw_value search/replace. + + gio/gsettingsschema.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c84441fbb3b2eb14775e8467a07cda4eff4502e1 +Author: Ryan Lortie +Date: Sun Oct 3 23:04:00 2010 -0400 + + GSettings big endian tweaks + + GSettings relies on parts of the schema infromation remaining + unbyteswapped (the strinfo database, for example) while requiring + other + parts to be in native order (the default value, constraints, etc.). + + Lift the byteswapping into a place where we can do it selectively. + + gio/gsettings.c | 15 +++++++++++++++ + gio/gsettingsschema.c | 12 +----------- + 2 files changed, 16 insertions(+), 11 deletions(-) + +commit 73ca8b47540d005d5227c03aac143d6780da654c +Merge: 9082232 e5e491c +Author: Ryan Lortie +Date: Sun Oct 3 23:03:12 2010 -0400 + + Merge remote branch 'gvdb/master' + +commit e5e491c96946ec6ff6809e4b2b757b1f2d497867 +Author: Ryan Lortie +Date: Sun Oct 3 22:54:03 2010 -0400 + + Add gvdb_table_get_raw_value() API for GSettings + + gvdb-reader.c | 23 +++++++++++++++++++++++ + gvdb-reader.h | 3 +++ + 2 files changed, 26 insertions(+), 0 deletions(-) + +commit 90822327acdcc0a10f0de41c591e4cee234811db +Author: Ryan Lortie +Date: Sun Oct 3 22:53:49 2010 -0400 + + GSettings test: fix unsafe GObject properties use + + The test case was passing a guint16 to g_object_get() for a guint + property. That's invalid on all systems, although it works (more or + less) on little endian ones. On big endian it's a total no-go. + + gio/tests/gsettings.c | 14 ++++++++------ + 1 files changed, 8 insertions(+), 6 deletions(-) + +commit 2ce2d587edbeb98b355c4038c218d75a8c8f9c99 +Author: Ryan Lortie +Date: Sun Oct 3 22:39:47 2010 -0400 + + GVariant: avoid byteswapping in some cases + + Make g_variant_byteswap() merely return a new reference on the given + value in the event that we know that byteswapping will have no effect + (ie: types which have no alignment requirement). + + This fixes a somewhat complicated interaction between GVariant, + GSettings and GVDB on big endian machines: GSettings assumes that it + can unref values returned from GVDB without losing access to the + underlying data. This only works if the underlying data is in the + mapped file -- not a freshly-allocated buffer that GVariant + byteswapped + into. + + glib/gvariant.c | 40 +++++++++++++++++++++++++++------------- + 1 files changed, 27 insertions(+), 13 deletions(-) + +commit 63adeda0861a26b38ec0adc76255666554c18951 +Merge: cdab385 a35852b +Author: Ryan Lortie +Date: Sun Oct 3 21:11:17 2010 -0400 + + Merge remote branch 'gvdb/master' + +commit a35852bda37400bb4f7c6ee3a3184dde65fadb1f +Author: Ryan Lortie +Date: Sun Oct 3 21:10:35 2010 -0400 + + Fix reader on big endian + + Some of the hashtable code was failing to byteswap properly. + + gvdb-reader.c | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +commit cdab385ad9fcda469c3fae107adc4abc1082c27a +Author: Ryan Lortie +Date: Sun Oct 3 20:47:26 2010 -0400 + + allow libtool 2.4 + + It's released now and it seems to work OK. + + autogen.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0bd50b39eb8223f2eeffe8dc5fe096b2c7695529 +Author: Ryan Lortie +Date: Sun Oct 3 17:30:10 2010 -0400 + + Bug 623400 - acquire context before dispatching + + For GSettings. + + Use the functionality introduced in the last commit to simplify our + notify dispatching and increase the safety of doing so (by ensuring + that + the context is acquired in the current thread for the duration of the + dispatch). + + This closes bugs #623400 and #629849. + + gio/gdelayedsettingsbackend.c | 16 +------- + gio/gsettingsbackend.c | 87 + +++++++++++++++------------------------- + gio/gsettingsbackendinternal.h | 2 - + 3 files changed, 33 insertions(+), 72 deletions(-) + +commit 92974b80fc10f494b33ed6760b5417bbbbb83473 +Author: Ryan Lortie +Date: Sun Oct 3 17:26:37 2010 -0400 + + Bug 618737 - "dispatch to context" functionality + + Adds a new function g_main_context_invoke() (and _full() variant). + + This function takes a main context, a function and a user_data. + If the + main context is already acquired in the current thread, the + function is + invoked directly. If the main context is the default main context of + the current thread and it can be acquired then the function is invoked + directly while the context is owned. Otherwise, the function is + scheduled as an idle on the context. + + glib/glib.symbols | 2 + + glib/gmain.c | 110 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + glib/gmain.h | 9 ++++ + 3 files changed, 121 insertions(+), 0 deletions(-) + +commit 63fb3ff774146a44dcf980bd4cfbca68770a3d93 +Author: Žygimantas Beručka +Date: Sun Oct 3 15:45:33 2010 +0200 + + Updated Lithuanian translation by Aurimas Černius + + po/lt.po | 278 + +++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 158 insertions(+), 120 deletions(-) + +commit 2d6f8a8ea4a0c86c40da60db2d948306f4c2f5c9 +Author: Ryan Lortie +Date: Sun Oct 3 02:40:48 2010 -0400 + + gsettings-tool: Rewrite + + Rewrite the GSettings tool. + + Improvements/changes: + + - simplify the code by performing common actions (like creating a + schema) in only one place instead of one per-command + + - new features (list schemas, list keys, monitor multiple, etc) + + - factor-out bash completion and implement in shellscript + + - input validation: should never abort due to invalid inputs + + Still to do: + + - proper error checking for ranges/choices + + - support for querying range/choice information + + - bash completion support for enums + + Closes bug #629289, possibly among others. + + gio/gsettings-bash-completion.sh | 58 ++- + gio/gsettings-tool.c | 1047 + +++++++++++++------------------------ + 2 files changed, 405 insertions(+), 700 deletions(-) + +commit ed9db23f9a056ae253be25c2262f19047a62fe76 +Author: Ryan Lortie +Date: Sun Oct 3 01:53:09 2010 -0400 + + GSettings: implement .property_get('path') + + This was unimplemented in g_settings_get_property(), leading to + a failed + 'g_assert_not_reached()'. + + gio/gsettings.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 5af11ae4bc74104502da537b5a89e92223f697dc +Author: Ryan Lortie +Date: Sat Oct 2 22:46:53 2010 -0400 + + Add 'Since:' tags for schema listing APIs + + gio/gsettingsschema.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit d2c06994402ee30e989efb9e912d3abd16ca0e10 +Author: Ryan Lortie +Date: Sat Oct 2 22:42:02 2010 -0400 + + Clean up g_settings_list_schemas() + + In its previous form, g_settings_list_schemas() was not useful as + a tool + to prevent aborts due to using g_settings_new() with an invalid schema + name. This is because g_settings_list_scheams() also listed + relocatable + schemas, and calling g_settings_new() for those would abort just the + same as if you called it for a non-existent schema. + + Modify g_settings_list_schemas() so that it only returns schemas for + which it is safe to call g_settings_new(). Add another call for + sake of + completeness: g_settings_list_relocatable_schemas(). + + gio/gio.symbols | 1 + + gio/gsettings.h | 1 + + gio/gsettingsschema.c | 126 + +++++++++++++++++++++++++++++++++++++------------ + gio/tests/gsettings.c | 7 ++- + 4 files changed, 103 insertions(+), 32 deletions(-) + +commit 1fee36f72bdbf87d585222e864cb8494e7156ee0 +Author: Damyan Ivanov +Date: Sat Oct 2 08:57:09 2010 +0300 + + Updated Bulgarian translation + + po/bg.po | 143 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 95 insertions(+), 48 deletions(-) + +commit ba0e608478367cdb7ee550b9efaefba8bd418720 +Author: Ryan Lortie +Date: Mon Sep 27 11:14:08 2010 -0400 + + Improve .gitignore + + gio/tests/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 3e771509b487fbc671e9217f8dcbd20daa44c116 +Author: Ryan Lortie +Date: Mon Sep 27 11:10:11 2010 -0400 + + Bug 628937 - gracefully handle broken schemas + + Implement the second feature requested in the bug: silently ignore + override files that attempt to override schemas that are not currently + installed. + + Also, support 'strictness' being optional for other errors when + parsing + override files (ie: inability to open the file, unknown key name, + parse + errors, out of range). We don't completely back out the file in this + case — as that is difficult with the current implementation — + but just + ignore the override for the single key. + + gio/glib-compile-schemas.c | 121 + ++++++++++++++++++++++++++++++-------------- + 1 files changed, 83 insertions(+), 38 deletions(-) + +commit bd290081ff8c7951c6509d0aee23246739a928a2 +Author: Ryan Lortie +Date: Mon Sep 27 10:36:11 2010 -0400 + + glib-compile-schemas: improve error accuracy + + We wrote " must contain at least one " for empty . + Fix that. + + gio/glib-compile-schemas.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +commit e40f3932dd9d924c3197e98f44950561248297ae +Author: Ryan Lortie +Date: Mon Sep 27 10:27:11 2010 -0400 + + Bug 628937 - gracefully handle broken schemas + + Implement the first of two features requested in the bug: when + encountering a broken .xml schema file, back out the changes in that + file and continue to parse other files. + + This prevents a single broken .xml file from messing up GSettings for + everyone else. + + Add a --strict option to get the old behaviour. Use this from + the test + cases. + + gio/glib-compile-schemas.c | 89 + ++++++++++++++++++++++++++++++++++--------- + gio/tests/gschema-compile.c | 1 + + 2 files changed, 72 insertions(+), 18 deletions(-) + +commit fff6814973356ac23b1022113632441110825283 +Author: Ryan Lortie +Date: Mon Sep 27 09:06:24 2010 -0400 + + Bug 630077 - GDateTime week number support + + Fully implement support for ISO 8601 week dates in GDateTime and + document that this is the case. + + Add an exhaustive test case to ensure correctness. + + docs/reference/glib/glib-sections.txt | 1 + + glib/gdatetime.c | 96 ++++++++++++++++- + glib/gdatetime.h | 1 + + glib/glib.symbols | 1 + + glib/tests/gdatetime.c | 188 + +++++++++++++++++++++++++-------- + 5 files changed, 239 insertions(+), 48 deletions(-) + +commit fe1186a842458dcc647c5f9ab03f17c762354e95 +Author: Matthias Clasen +Date: Thu Sep 30 14:40:50 2010 -0400 + + message_to_write_data_free: Don't unref data->message if it is NULL + + After the recent changes to message filtering, it can happen that + data->message is NULL when we get here. + + gio/gdbusprivate.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit faaa8a9f8af9548e2d6052d1ba465285cb314cee +Author: Giannis Katsampirhs +Date: Thu Sep 30 14:47:58 2010 +0300 + + l10n: Updated Greek translation for glib + + po/el.po | 7535 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 3835 insertions(+), 3700 deletions(-) + +commit 98a0ce64a379a60cfaf9b37f52b300c9297ea44c +Author: Piotr Drąg +Date: Wed Sep 29 18:46:10 2010 +0200 + + Updated Polish translation + + po/pl.po | 1642 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 794 insertions(+), 848 deletions(-) + +commit 755c2dad72650f11397fc5a91ac42af15eafd530 +Author: Colin Walters +Date: Wed Sep 29 10:38:25 2010 -0400 + + introspection: Fix one annotation syntax + + gio/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 01735d6cc09b7d24c2af07f91e1e96fe3cf785d1 +Author: Gabor Kelemen +Date: Wed Sep 29 14:07:05 2010 +0200 + + Updated Hungarian translation + + po/hu.po | 632 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 310 insertions(+), 322 deletions(-) + +commit 38e476ac7da339cec868cabf21beed6a91254935 +Author: Bruno Brouard +Date: Wed Sep 29 09:02:51 2010 +0200 + + Updated French translation + + po/fr.po | 190 + ++++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 116 insertions(+), 74 deletions(-) + +commit 36ba8ffb87a9cf23d37c91d716e3a1512fcc7707 +Author: Petr Kovar +Date: Wed Sep 29 04:41:25 2010 +0200 + + Update Czech translation + + po/cs.po | 994 + +++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 563 insertions(+), 431 deletions(-) + +commit e458687fac24770f368f9caf498c84400b749f6b +Author: Peter Kragelj +Date: Tue Sep 28 21:21:38 2010 +0200 + + Updated Slovenian translation + + po/sl.po | 218 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 109 insertions(+), 109 deletions(-) + +commit afb6e1b4589a5308c3e9d7b2b77fdb8d47419929 +Author: Fran Diéguez +Date: Tue Sep 28 17:35:23 2010 +0200 + + Updated Galician translations + + po/gl.po | 555 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 305 insertions(+), 250 deletions(-) + +commit 339182f575521ede0e380a3cf502f2ff974621b4 +Author: Peter Kragelj +Date: Tue Sep 28 15:12:00 2010 +0200 + + Updated Slovenian translation + + po/sl.po | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 974ab9cfa016e0f6c0b6c58b203fd1b1f891c3a2 +Author: Peter Kragelj +Date: Tue Sep 28 15:10:33 2010 +0200 + + Updated Slovenian translation + + po/sl.po | 623 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 308 insertions(+), 315 deletions(-) + +commit e44f695f64d1baba9cc2f1eb2cdacbe68837dbfd +Author: Gintautas Miliauskas +Date: Tue Sep 28 00:12:42 2010 +0300 + + Updated Lithuanian translation (thanks Aurimas Cernius). + + po/lt.po | 569 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 307 insertions(+), 262 deletions(-) + +commit c4f2bd25934cb322c9910ef46148cea1beae2cca +Author: Mario Blättermann +Date: Mon Sep 27 20:19:46 2010 +0200 + + [i18n] Updated German translation + + po/de.po | 582 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 311 insertions(+), 271 deletions(-) + +commit 973174e5cc56cd4f273c9d3b54a36f803e0b59dd +Author: Fabrício Godoy +Date: Mon Sep 27 08:49:51 2010 -0300 + + Updated Brazilian Portuguese translation + + po/pt_BR.po | 2487 + ++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1588 insertions(+), 899 deletions(-) + +commit e2ea3eb5867b25465ef3ea540a541611aa7fef18 +Author: Damyan Ivanov +Date: Mon Sep 27 13:31:09 2010 +0300 + + Updated Bulgarian translation + + po/bg.po | 2388 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1570 insertions(+), 818 deletions(-) + +commit 1a0dbff2365cc956ed0675a790dc09ea40f04fd1 +Author: Ryan Lortie +Date: Sun Sep 26 18:51:23 2010 -0400 + + clean up g_date_time_get_week_day() + + No functionality changes here. + + Vastly simplify the algorithm for calculating the day of the week. + + Fix the documentation (which is incorrectly stating that 1 means + Sunday) and clarify that the number we return is in line with ISO 8601 + week day numbering. + + glib/gdatetime.c | 24 +++--------------------- + 1 files changed, 3 insertions(+), 21 deletions(-) + +commit e77faeb9209518f422fa6b035b8f4dd4401bf0e1 +Author: Wouter Bolsterlee +Date: Sun Sep 26 22:59:38 2010 +0200 + + Updated Dutch translation by Wouter Bolsterlee + + po/nl.po | 326 + +++++++++++++++++++++++--------------------------------------- + 1 files changed, 119 insertions(+), 207 deletions(-) + +commit 4e091e8647175063d4684cfc6717e70d27f4d625 +Author: Lucian Adrian Grijincu +Date: Sun Sep 26 22:39:14 2010 +0300 + + Updated Romanian translation + + po/ro.po | 2508 + +++++++++++++++++++++++++++++++++++++++++++++++++------------- + 1 files changed, 2003 insertions(+), 505 deletions(-) + +commit 30132c44c18d9a08e4c6a9b4834366bd8628ecfa +Author: Johan Dahlin +Date: Fri Sep 24 18:24:41 2010 -0300 + + Add a lot of missing annotations + + gio/gaction.h | 2 +- + gio/gappinfo.c | 3 +- + gio/gasyncresult.c | 4 +- + gio/gcancellable.c | 2 +- + gio/gcontenttype.c | 4 +- + gio/gconverterinputstream.c | 2 +- + gio/gconverteroutputstream.c | 2 +- + gio/gcredentials.c | 2 +- + gio/gdbusaddress.c | 4 +- + gio/gdbusconnection.c | 12 +++--- + gio/gdbusmessage.c | 12 +++--- + gio/gdbusmethodinvocation.c | 6 ++-- + gio/gdbusproxy.c | 2 +- + gio/gdesktopappinfo.c | 2 +- + gio/gdrive.c | 4 +- + gio/gemblem.c | 2 +- + gio/gemblemedicon.c | 4 +- + gio/gfile.c | 67 + +++++++++++++++++++++------------------ + gio/gfileenumerator.c | 2 +- + gio/gfileicon.c | 4 +- + gio/gfileinfo.c | 4 +- + gio/gfileinputstream.c | 4 +- + gio/gfileiostream.c | 4 +- + gio/gfileoutputstream.c | 4 +- + gio/gicon.c | 4 ++- + gio/ginetsocketaddress.c | 2 +- + gio/ginitable.c | 6 ++-- + gio/giomodule.c | 4 +- + gio/giomodule.h | 2 +- + gio/gkeyfilesettingsbackend.c | 2 +- + gio/gloadableicon.c | 4 +- + gio/gmemoryoutputstream.c | 2 +- + gio/gmount.c | 6 ++-- + gio/gnetworkaddress.c | 8 ++-- + gio/gnetworkservice.c | 2 +- + gio/goutputstream.c | 6 ++-- + gio/gproxy.c | 4 +- + gio/gproxyresolver.c | 6 ++-- + gio/gresolver.c | 2 +- + gio/gseekable.c | 3 +- + gio/gsettings.c | 8 ++-- + gio/gsettingsbackend.c | 6 ++-- + gio/gsettingsschema.c | 2 +- + gio/gsimpleasyncresult.c | 4 +- + gio/gsocket.c | 10 +++--- + gio/gsocketaddressenumerator.c | 4 +- + gio/gsocketclient.c | 18 +++++----- + gio/gsocketconnectable.c | 4 +- + gio/gsocketconnection.c | 6 ++-- + gio/gsocketcontrolmessage.c | 2 +- + gio/gsocketlistener.c | 8 ++-- + gio/gsrvtarget.c | 2 +- + gio/gthemedicon.c | 8 ++-- + gio/gunionvolumemonitor.c | 2 +- + gio/gunixconnection.c | 2 +- + gio/gunixcredentialsmessage.c | 2 +- + gio/gunixfdmessage.c | 2 +- + gio/gunixmounts.c | 6 ++-- + gio/gvfs.c | 12 +++--- + gio/gvolume.c | 2 + + gio/gvolumemonitor.c | 2 +- + 61 files changed, 172 insertions(+), 161 deletions(-) + +commit 701ce5d2011ee4408212461f6e191eaca2290d0a +Author: Johan Dahlin +Date: Fri Sep 24 16:23:31 2010 -0300 + + [introspection] Add GObject annotations + + These were moved in from gobject-introspection + + gobject/gobject.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +commit 835f9cb310b988b07d1822c3f12093b9b01bc496 +Author: Johan Dahlin +Date: Fri Sep 24 15:51:26 2010 -0300 + + [introspection] Move over annotations + + Move all the annotations over from gobject-introspection. + + They will not be used directly by the introspection scanner for now, + instead they will be extracted by a script and updated manually + until introspection is properly integrated into the glib build + + gio/gaction.c | 4 ++-- + gio/gactiongroup.c | 7 ++++--- + gio/gappinfo.c | 6 +++--- + gio/gasyncinitable.c | 2 +- + gio/gcontenttype.c | 2 +- + gio/gdesktopappinfo.c | 2 +- + gio/gemblemedicon.c | 3 ++- + gio/gfile.c | 22 +++++++++++----------- + gio/gfileenumerator.c | 4 ++-- + gio/giomodule.c | 3 ++- + gio/gmount.c | 8 ++++---- + gio/gresolver.c | 22 ++++++++++++---------- + gio/gsettings.c | 7 ++++--- + gio/gsrvtarget.c | 2 +- + gio/gunionvolumemonitor.c | 2 +- + gio/gunixmounts.c | 4 ++-- + gio/gvolume.c | 6 +++--- + gio/gvolumemonitor.c | 2 +- + 18 files changed, 57 insertions(+), 51 deletions(-) + +commit 0927dda8ad29cb4e6b3d19977be1fb747b1d4950 +Author: Christian Dywan +Date: Fri Sep 24 13:56:35 2010 +0200 + + Correct error message when GUnixOutputStream fails to write + + Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=628876 + + gio/gunixoutputstream.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 80de3ca7ccc4bca1beeaf18459ecf4f703c6a2de +Author: Andre Klapper +Date: Fri Sep 24 13:15:23 2010 +0200 + + Add missing file to POTFILES.in + + po/POTFILES.in | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 4d9ae95ae05669f329381898c38e6a98ae7f0cd5 +Author: David Zeuthen +Date: Thu Sep 23 19:16:25 2010 -0400 + + GDBus: Don't use abstract sockets in test code + + It doesn't really work right now because of a dbus-daemon(1) bug - see + the comment added in the TODO section of gdbusconnection.c. So revert + to old behavior. The downside is a lot of files in /tmp but right now + that's better than not being able to run tests in a loop. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 9 +++++++++ + gio/tests/gdbus-sessionbus.c | 6 ++---- + 2 files changed, 11 insertions(+), 4 deletions(-) + +commit a35eb7047116d0614d9d8dc9d1e435d45659d0d6 +Author: David Zeuthen +Date: Thu Sep 23 18:57:35 2010 -0400 + + GDBus: Use abstract namespace in test cases to avoid littering all + over /tmp + + Signed-off-by: David Zeuthen + + gio/tests/gdbus-sessionbus.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +commit 7036415cc1a32bbd9cc08e516196dbd704f8b5eb +Author: David Zeuthen +Date: Thu Sep 23 17:23:30 2010 -0400 + + GDBusConnection: Use correct GMainContext when invoking free functions + + Without this fix, the ./gdbus-connection test case occasionally + fails, see + + https://bugzilla.gnome.org/show_bug.cgi?id=629945#c5 + + like this + + /gdbus/connection/basic: OK + /gdbus/connection/life-cycle: ** + ERROR:gdbus-connection.c:223:test_connection_life_cycle: assertion + failed: + (!quit_mainloop_fired) + cleaning up bus with pid 21794 + Aborted (core dumped) + + because the callback didn't happen on the same thread as where we are + running the loop. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 93 + +++++++++++++++++++++++++++++++++++++----- + gio/tests/gdbus-connection.c | 57 +++++++++++++++++++++----- + 2 files changed, 129 insertions(+), 21 deletions(-) + +commit 919f64acab8a0bfb1262f3df1cdda4383054e0f1 +Author: Stefan Kost +Date: Thu Sep 23 18:41:57 2010 +0300 + + build: fix out of srcdir build + + The gtk-doc makefile rules do cd srcdir && cp $(HTML_IMAGES) target/ + and this + breaks for "srcdir" != ".". + + docs/reference/gobject/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 643e5526c515f0ee6e681b806fda36eaaa3f263c +Author: David Zeuthen +Date: Thu Sep 23 16:27:52 2010 -0400 + + GDBus: fix name test cases + + Since we make message buses come and go, we need to ensure that the + singleton connection instance goes away before attempting to call + g_bus_get_sync() or similar. + + Signed-off-by: David Zeuthen + + gio/tests/gdbus-names.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 71b1d738e2c0fe900b6bb6672aa464ce74b489b3 +Author: David Zeuthen +Date: Thu Sep 23 16:09:25 2010 -0400 + + GDBus: bump timeout for some tests + + When under load, a one second timeout is just not enough. This can be + observed by e.g. restarting a CPU- and IO-intensive application like a + web browser with many tabs while running the test cases. Therefore, + bump the timeouts to 30 seconds. + + Signed-off-by: David Zeuthen + + gio/tests/gdbus-connection.c | 8 ++++---- + gio/tests/gdbus-tests.c | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +commit 1f6a9f1e2d2ebc5f37e7c526344d7aa26cee148d +Author: David Zeuthen +Date: Thu Sep 23 15:47:46 2010 -0400 + + GDBus: Move "slow" connection test cases into separate test program + + Signed-off-by: David Zeuthen + + gio/tests/Makefile.am | 4 + + gio/tests/gdbus-connection-slow.c | 214 + +++++++++++++++++++++++++++++++++++++ + gio/tests/gdbus-connection.c | 160 --------------------------- + 3 files changed, 218 insertions(+), 160 deletions(-) + +commit f0b04acfd31b768151a88db3f8d3347f55b2a7b3 +Author: David Zeuthen +Date: Thu Sep 23 15:10:50 2010 -0400 + + GDBusConnection: Avoid callbacks on finalized connection + + Turns out that GDBusWorker will issue callbacks (in its own thread) + even after g_dbus_worker_stop() has been called. This would rarely + happen (and unreffing a connection is even rarer) so only saw this bug + occasionally when running the gdbus-connection test case in a loop. + + Fix up this issue by maintaining a set of GDBusConnection objects that + are currently "alive" and do nothing in the callbacks if the passed + user_data pointer is not in this set. + + Also attempted to fix up a race condition with + _g_object_wait_for_single_ref_do() and its use of GObject toggle + references - for now, just resort to busy waiting, thereby + sidestepping the toggle reference mess altogether. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 65 + ++++++++++++++++++++++++++++++++++++++---- + gio/gdbusprivate.c | 14 ++------- + gio/tests/gdbus-connection.c | 8 +++-- + gio/tests/gdbus-tests.c | 50 +++++++++++++++++++++++++++++++- + 4 files changed, 115 insertions(+), 22 deletions(-) + +commit c3c0e4d11d0682d832d199de31b35457f6078d5c +Author: Takayuki KUSANO +Date: Fri Sep 24 02:09:10 2010 +0900 + + Updated Japanese translation (symbolic link related) + + po/ja.po | 58 + ++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 30 insertions(+), 28 deletions(-) + +commit e7df1a4157cc95e658a31de55e8374c4364a2238 +Author: Nicolas Dufresne +Date: Wed Sep 22 13:11:59 2010 -0400 + + Fix memory leak in SOCKSv5 implementation + + gio/gsocks5proxy.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 99d57b5ce952b7f43ff52b41362035bfa193eb5f +Author: Benjamin Otte +Date: Thu Sep 23 13:57:22 2010 +0200 + + glib-2.0.m4: Use unsigned variables for version numbers + + When using signed, we get complaints from gcc about comparing + signed to + unsigned with -Wsign-compare. And combined with -Werror in users' + CFLAGS + it breaks configure runs. + + m4macros/glib-2.0.m4 | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 24a706404ded0578b029b2fb65e6418bda84d32f +Author: Bruno Brouard +Date: Thu Sep 23 08:47:54 2010 +0200 + + Updated French translation + + po/fr.po | 1706 + ++++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 1044 insertions(+), 662 deletions(-) + +commit 61453216803d745b1d563710f8ec3aa918d2e819 +Author: Ryan Lortie +Date: Wed Sep 22 06:45:02 2010 -0400 + + GSocketControlMessage: clean up confusing code + + It looks like the deserialisation function in GSocketControlMessage + can + potentially leak a reference to the class structure of a + GSocketControlMessage subclass (although the particular code path is + probably never hit). + + Clean up the code a bit. + + Also, make sure that the GUnixCredentialsMessage type is registered + before attempting deserialisation. + + Closes bug #629687. + + gio/gsocketcontrolmessage.c | 15 +++++++-------- + 1 files changed, 7 insertions(+), 8 deletions(-) + +commit 02451227ec8bafae48af4c519c9e0441176d1978 +Author: Ryan Lortie +Date: Wed Sep 22 06:28:49 2010 -0400 + + fix argument order for g_date_time_difference() + + The names of the arguments in the header file was reversed. + + Closes bug #630000 + + glib/gdatetime.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 86d3342f854f11c1a35f02ec4f54c7aec345bae5 +Author: Claude Paroz +Date: Wed Sep 22 10:42:55 2010 +0200 + + Add translator comments for command parameter translation + + gio/gsettings-tool.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 0a68f09494dea14d90ab802862eaa04d1ac54169 +Author: Mattias Põldaru +Date: Tue Sep 21 19:18:38 2010 +0300 + + [l10n] Updated Estonian translation + + po/et.po | 20 ++++++++++---------- + 1 files changed, 10 insertions(+), 10 deletions(-) + +commit 33216f3d07d21bb5a8af62cfffeb18c8352cf114 +Author: Inaki Larranaga Murgoitio +Date: Tue Sep 21 14:42:23 2010 +0200 + + Updated Basque language + + po/eu.po | 1435 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 699 insertions(+), 736 deletions(-) + +commit 60def049d95e82c836cfc8b2f13a4ed8472f7865 +Author: Philip Withnall +Date: Mon Sep 20 17:56:30 2010 +0100 + + Bug 630185 — Allow NULL strings in g_quark_try_string() + + Allow NULL strings to be passed to g_quark_try_string(), returning + a 0 quark + in that case, as per the existing documentation. Closes: bgo#630185 + + glib/gdataset.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit f1f7e771d7b3d9f8b7c656c6d9a9d8112f32732d +Author: Behdad Esfahbod +Date: Mon Sep 20 22:51:26 2010 -0400 + + Fix typo + + glib/giochannel.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 291545b6eee306249529652a2d1422d0e7a460c8 +Author: Colin Walters +Date: Mon Sep 20 13:20:04 2010 -0400 + + gdir: Clarify in documentation that ordering is not defined + + glib/gdir.c | 16 ++++++++++++---- + 1 files changed, 12 insertions(+), 4 deletions(-) + +commit 909fad7583ae9459fc3301e6de184b56a963464c +Author: Michael Kotsarinis +Date: Mon Sep 20 19:40:53 2010 +0300 + + l10n: Updated Greek translation for glib + + po/el.po | 6698 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 3700 insertions(+), 2998 deletions(-) + +commit 05e185728a9b7decfd13f4bffaad9f240253e83f +Author: Yaron Shahrabani +Date: Mon Sep 20 15:15:46 2010 +0200 + + Updated Hebrew translation. + + po/he.po | 1134 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 579 insertions(+), 555 deletions(-) + +commit de432280a0e93aa1ebde4512fc1dd248af88bb32 +Author: Stefan Kost +Date: Sun Sep 19 22:06:10 2010 +0300 + + docs: shorten var name in example + + We use 'pspec' instead of 'maman_param_spec' elsewhere too. + + docs/reference/gobject/tut_howto.xml | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit aa8c8df44fc1e2b852bb6a0cfb516f976f841de5 +Author: Stefan Kost +Date: Sun Sep 19 22:03:40 2010 +0300 + + docs: fix iface type naming + + docs/reference/gobject/tut_gtype.xml | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +commit 58e5b01fbc208a8cd374b60951c70e3d5c4355de +Author: Stefan Kost +Date: Sun Sep 19 21:50:31 2010 +0300 + + docs: fix docbook validity + + 'type' must be inside of 'link'. + + docs/reference/gobject/tut_gobject.xml | 19 ++++++----- + docs/reference/gobject/tut_gsignal.xml | 12 +++--- + docs/reference/gobject/tut_gtype.xml | 56 + ++++++++++++++++---------------- + docs/reference/gobject/tut_howto.xml | 10 +++--- + 4 files changed, 49 insertions(+), 48 deletions(-) + +commit 409f7db894bcfc6574d86aec34af6851dacc1666 +Author: Stefan Kost +Date: Sun Sep 19 21:37:19 2010 +0300 + + docs: cleanup constructor example + + Remove unused var and chain-up the sane way we do elsewhere. + + docs/reference/gobject/tut_gobject.xml | 5 +---- + 1 files changed, 1 insertions(+), 4 deletions(-) + +commit a6ad0fbec23d78611bafd217ea56fcd58aea1405 +Author: Stefan Kost +Date: Sun Sep 19 21:33:52 2010 +0300 + + docs: use passive voice. + + docs/reference/gobject/tut_howto.xml | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 062e7f7848eb0577e4745b3e8c6a4e8312e360c3 +Author: Takayuki KUSANO +Date: Mon Sep 20 02:02:32 2010 +0900 + + Updated Japanese translation + + po/ja.po | 802 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 413 insertions(+), 389 deletions(-) + +commit 5bb2da9b999b414ea65a7d89168101ddf87856f1 +Author: Ask H. Larsen +Date: Sun Sep 19 18:07:57 2010 +0200 + + Updated Danish translation + + po/da.po | 1305 + +++++++++++++++++++++++++++++++++++++------------------------- + 1 files changed, 772 insertions(+), 533 deletions(-) + +commit 29393abf05b7322b1b1d267c5a929136ed8a7c70 +Author: Wouter Bolsterlee +Date: Sun Sep 19 17:08:25 2010 +0200 + + Updated Dutch translation by Wouter Bolsterlee + + po/nl.po | 2089 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1372 insertions(+), 717 deletions(-) + +commit abfa91e655254180ce134012cbbcffa8e150a00b +Author: Mattias Põldaru +Date: Sun Sep 19 11:52:30 2010 +0300 + + [l10n] Updated Estonian translation + + po/et.po | 1189 + ++++++++++++++++++++++++++++---------------------------------- + 1 files changed, 531 insertions(+), 658 deletions(-) + +commit cec629972b2a599cb28eb9d61cc000c4dc97f534 +Author: Ryan Lortie +Date: Sat Sep 18 16:31:00 2010 -0400 + + GDateTime: G_GNUC_WARN_UNUSED_RESULT for modifiers + + Emmanuele suggested adding G_GNUC_WARN_UNUSED_RESULT to all of the + g_date_time_add_* functions to help deal with the situation where + people + may mistakenly believe that these functions are inplace modifiers. + + glib/gdatetime.h | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit ac05f990db211a27a950d61ef4bf47335ced7cc4 +Author: Ryan Lortie +Date: Sat Sep 18 12:52:58 2010 -0400 + + Fix header cleaup fallout when using system pcre + + Using the internal pcre has the side effect of exposing gregex.c to + glib.h. When we use the system one, we lose that, so we need to + explicitly include the things we use (glist, gatomic, etc..) + + glib/gregex.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 1bc08279b907529627677c9191664862c063de49 +Author: Duarte Loreto +Date: Sat Sep 18 12:30:00 2010 +0100 + + Updated Portuguese translation + + po/pt.po | 770 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 397 insertions(+), 373 deletions(-) + +commit c1b7697a8ba4cf016f1efef86369376917acccdb +Author: Ryan Lortie +Date: Fri Sep 17 20:48:25 2010 -0400 + + bump version to 2.27.1 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit dda9707377f43c827860dbce8bf09c7b98e2ad14 +Author: Ryan Lortie +Date: Fri Sep 17 17:57:19 2010 -0400 + + release 2.27.0 + + NEWS | 104 + +++++++++++++++++++++++++++++ + docs/reference/glib/tmpl/glib-unused.sgml | 40 ----------- + docs/reference/glib/tmpl/messages.sgml | 27 ++++++-- + docs/reference/glib/tmpl/version.sgml | 41 +++++++++++ + 4 files changed, 166 insertions(+), 46 deletions(-) + +commit 6393ffa3a6ac50b4b2cc1ed92760544caf9bb90a +Author: Ryan Lortie +Date: Sat Sep 18 01:18:13 2010 +0300 + + GDateTime: fix a test that fails from time to time + + The test fails if it's a different date in the time zone of the + machine + running the test than it currently is in UTC. + + glib/tests/gdatetime.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7be2ba4d945682c30a91ff35dac255e0f4a0b038 +Author: Ryan Lortie +Date: Fri Sep 17 13:27:38 2010 -0400 + + Bump to version 2.27.0 after branching glib-2-26 + + configure.ac | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit b4ee303ed6bc35b5dbb73bfa4b3a27eaba23a83c +Author: Ryan Lortie +Date: Fri Sep 17 13:26:50 2010 -0400 + + .gitignore some test cases + + gio/tests/.gitignore | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 5109778e939265087d1b1257daf6ba5f454ff346 +Author: Ryan Lortie +Date: Fri Sep 17 13:20:17 2010 -0400 + + .gitignore some sgml + + docs/reference/glib/tmpl/.gitignore | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit cf73ba47f14a5793b9575ce542edf558fe5abee8 +Author: Ryan Lortie +Date: Fri Sep 17 13:14:59 2010 -0400 + + Deal with gtk-doc's insane sensitivty to spaces + + ...by inserting a few of them. + + glib/goption.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 6b0e31ce4891883b3923c40c68347dcf5fe54165 +Author: Ryan Lortie +Date: Thu Sep 16 04:44:59 2010 -0400 + + Clean-up/tweaking of GDateTime and GTimeZone + + docs/reference/glib/glib-docs.sgml | 1 + + docs/reference/glib/glib-sections.txt | 99 +- + glib/Makefile.am | 2 + + glib/gdatetime.c | 2681 + +++++++++++++++------------------ + glib/gdatetime.h | 247 ++-- + glib/glib.h | 1 + + glib/glib.symbols | 49 +- + glib/gtimezone.c | 790 ++++++++++ + glib/gtimezone.h | 81 + + glib/tests/gdatetime.c | 314 ++--- + 10 files changed, 2373 insertions(+), 1892 deletions(-) + +commit 909289c76330f66b87a51fbfc645fb4d474f1301 +Author: Emmanuele Bassi +Date: Wed Sep 15 14:47:15 2010 +0100 + + datetime: Fix hashing + + Convert to the epoch, just like we do when checking for equality, so + that timezones are correctly handled. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + glib/gdatetime.c | 83 + +++++++++++++++++++++++++++++------------------------ + 1 files changed, 45 insertions(+), 38 deletions(-) + +commit 3e9fb52214da793ef1320775f1ab8226bdca6ae2 +Author: Emmanuele Bassi +Date: Wed Sep 15 14:39:26 2010 +0100 + + datetime: Rename g_date_time_printf() to g_date_time_format() + + The function does not use any printf() modifiers, so using printf() + is a + misnomer. + + Prior art: strftime, g_ascii_formatd + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + glib/gdatetime.c | 8 ++++---- + glib/gdatetime.h | 2 +- + glib/tests/gdatetime.c | 6 +++--- + 3 files changed, 8 insertions(+), 8 deletions(-) + +commit 4bac6613cfca4b0676a51e1df0848fa2e4d35120 +Author: Emmanuele Bassi +Date: Wed Sep 15 13:55:36 2010 +0100 + + datetime: Update modifiers for DST changes + + If a DateTime gets modified to cross the DST state from its previous + state then we want to update the DateTime to compensate for the new + offset. + + In other words, if we have a DateTime defined as: + + DateTime({ y: 2009, m: 8, d: 15, hh: 3, mm: 0, tz: 'Europe/London' + }); + + and we add six months to it, the hour must be changed to 60 minutes + behind, as the DST comes into effect. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + glib/gdatetime.c | 270 + +++++++++++++++++++++++++++++------------------- + glib/tests/gdatetime.c | 67 ++++++++++-- + 2 files changed, 220 insertions(+), 117 deletions(-) + +commit 0746f7403638a6f17c61ec04beb4f692914ce9a0 +Author: Emmanuele Bassi +Date: Wed Sep 15 10:05:41 2010 +0100 + + datetime: Allow setting fractionary seconds in new_full() + + Otherwise we'll have to do: + + dt = g_date_time_new_full (Y, M, D, h, m, s, tz); + tmp = g_date_time_add_usec (dt, usec); + g_date_time_unref (dt); + dt = tmp; + + With its additional allocations. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + glib/gdatetime.c | 6 +++--- + glib/gdatetime.h | 2 +- + glib/tests/gdatetime.c | 6 +++++- + 3 files changed, 9 insertions(+), 5 deletions(-) + +commit 67f1e52ce2a1372e4f8ffc5fdf292b33120264ab +Author: Emmanuele Bassi +Date: Tue Sep 14 08:00:40 2010 +0100 + + datetime: Rework time zone support in constructors + + Timezone handling is complicated. Really complicated. + + In order to simplify it a little bit, we need to expose the GTimeZone + structure. + + First of all, we allow creating time zone information directly + from the + offset and the DST state, and then pass it to the + g_date_time_new_full() + constructor. We also need to clean up the mess that is + UTC-vs.-localtime + for the other constructors. + + We also allow creating a GTimeZone from the Olson zoneinfo database + names; a time zone created like this will be "floating": it will just + reference the zoneinfo file - which are mmap()'ed, kept in a cache and + refcounted. Once the GTimeZone has been associated with a GDateTime, + it + will be "anchored" to it: the offset will be resolved, as well as the + DST state. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + docs/reference/glib/glib-sections.txt | 1 - + glib/gdatetime.c | 812 + +++++++++++++++++++++++---------- + glib/gdatetime.h | 39 ++- + glib/glib.symbols | 11 +- + glib/tests/gdatetime.c | 51 ++- + 5 files changed, 630 insertions(+), 284 deletions(-) + +commit bff4ac15d09a3f80551fda41f8ff2e2c1ae30d91 +Author: Dan Winship +Date: Fri Sep 17 10:21:57 2010 -0400 + + g_output_stream_write: fix misleadingly ungrammatical documentation + + pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=626866 + + gio/goutputstream.c | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +commit 8a7365d892c23573ef659d7a93ce1518ddf58763 +Author: Žygimantas Beručka +Date: Fri Sep 17 03:48:23 2010 +0300 + + Updated Lithuanian translation + + po/lt.po | 128 + ++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 63 insertions(+), 65 deletions(-) + +commit d6af283f4e76163abd6b4e740cb95861080f1014 +Author: Gintautas Miliauskas +Date: Thu Sep 16 22:13:54 2010 +0300 + + Updated Lithuanian translation by Aurimas Cernius. + + po/lt.po | 2338 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 1530 insertions(+), 808 deletions(-) + +commit 1c658c9c692643463c3f215ef73f8b72b046f2b7 +Author: Petr Kovar +Date: Thu Sep 16 01:56:26 2010 +0200 + + Update Czech translation + + po/cs.po | 16 +++++++++------- + 1 files changed, 9 insertions(+), 7 deletions(-) + +commit 0469782af5bda7fe9e9be9dfc2eda68a98c7ca49 +Author: Petr Kovar +Date: Wed Sep 15 21:43:18 2010 +0200 + + Update Czech translation + + po/cs.po | 2006 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1327 insertions(+), 679 deletions(-) + +commit 11f06115a4cc6972aedb810848e4a0f06165eb83 +Author: Ryan Lortie +Date: Wed Sep 15 11:20:51 2010 -0400 + + Bug 629709 - Empty variants + + Fix some GVariant bugs uncovered by calling g_variant_new_from_data + with + invalid data (which it should be immune to). + + glib/gvariant-core.c | 26 ++++++++++++++++++++++++-- + glib/gvariant-serialiser.c | 3 +++ + 2 files changed, 27 insertions(+), 2 deletions(-) + +commit 1c5b96e92b9a5923be4686802025b455fb353429 +Author: Jorge González +Date: Wed Sep 15 09:10:32 2010 +0200 + + Updated Spanish translation + + po/es.po | 1002 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 510 insertions(+), 492 deletions(-) + +commit 780b76bd3ae9c13ae065fc4bdf84dc10ca69f23d +Author: Andika Triwidada +Date: Wed Sep 15 07:44:48 2010 +0700 + + Updated Indonesian translation + + po/id.po | 968 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 496 insertions(+), 472 deletions(-) + +commit 1220501ec86b87e6cfe8ab3eac4a1fc6ea7a8acc +Author: Christian Persch +Date: Tue Sep 14 19:38:14 2010 +0200 + + GDBusConnection leaks its GCredentials + + ==7269== 144 bytes in 6 blocks are definitely lost in loss record + 1,282 of 1,325 + ==7269== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==7269== by 0x4056B74: g_malloc (gmem.c:164) + ==7269== by 0x406EDB6: g_slice_alloc (gslice.c:842) + ==7269== by 0x406EDFB: g_slice_alloc0 (gslice.c:854) + ==7269== by 0x413C627: g_type_create_instance (gtype.c:1867) + ==7269== by 0x412276A: g_object_constructor (gobject.c:1480) + ==7269== by 0x4121E5D: g_object_newv (gobject.c:1264) + ==7269== by 0x4121BD3: g_object_new (gobject.c:1176) + ==7269== by 0x417CFB9: g_credentials_new (gcredentials.c:156) + ==7269== by 0x41D9DBC: g_unix_credentials_message_deserialize + (gunixcredentialsmessage.c:149) + ==7269== by 0x41C422C: g_socket_control_message_deserialize + (gsocketcontrolmessage.c:198) + ==7269== by 0x41BFCE3: g_socket_receive_message (gsocket.c:3289) + ==7269== by 0x41D99CE: g_unix_connection_receive_credentials + (gunixconnection.c:476) + ==7269== by 0x41FA829: _g_dbus_auth_run_server (gdbusauth.c:987) + ==7269== by 0x4205DDB: initable_init (gdbusconnection.c:2196) + + Bug #629689. + + gio/gdbusconnection.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 235820d0ef817d549844fa898349e31f28fb833d +Author: Ryan Lortie +Date: Tue Sep 14 14:55:38 2010 -0400 + + GVariant: Check for size == 0 in get_bytestring + + And add a test from David that shows the problem. + + Closes #629698 + + glib/gvariant.c | 2 +- + glib/tests/gvariant.c | 8 ++++++++ + 2 files changed, 9 insertions(+), 1 deletions(-) + +commit 2211ab1240d9bbab2a17197f6d97fafc9373ff46 +Author: Piotr Drąg +Date: Tue Sep 14 19:10:35 2010 +0200 + + Updated Polish translation + + po/pl.po | 2082 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 1101 insertions(+), 981 deletions(-) + +commit f497f3b7aee06cc2d1f04b9f9adf3555353f2579 +Author: Ryan Lortie +Date: Tue Sep 14 11:25:57 2010 -0400 + + GSettings: reverse accidental addition to .h file + + A couple of extra function prototypes snuck into commit + 77e3badcf3f15c7ac235904160d775febfcebcb5. Take those out. + + gio/gsettings.h | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +commit 7d143d420b0e3d02e1103a0c9decccd18b6024c9 +Author: Gabor Kelemen +Date: Tue Sep 14 14:10:17 2010 +0200 + + Updated Hungarian translation + + po/hu.po | 836 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 430 insertions(+), 406 deletions(-) + +commit 152f0dd3dbc9237f24830eeea76a84332d4f14a4 +Author: Christian.Kirbach +Date: Tue Sep 14 11:18:20 2010 +0200 + + [l10n] Updated German translation + + po/de.po | 627 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 325 insertions(+), 302 deletions(-) + +commit 3d1c463b48a6d54b671d7c8f39a7b4efba636d2b +Author: Aron Xu +Date: Tue Sep 14 16:35:31 2010 +0800 + + Update Simplified Chinese translation. + + po/zh_CN.po | 1307 + +++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 827 insertions(+), 480 deletions(-) + +commit 5ec302deceeb0c5f5f34be41b775fd295784c012 +Author: Timo Jyrinki +Date: Tue Sep 14 09:37:45 2010 +0300 + + (slightly) updated Finnish translation. + + po/fi.po | 1999 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1323 insertions(+), 676 deletions(-) + +commit 8fbfcd90adce11c95d9a89c2f79f61a2d72f01ab +Author: Philip Withnall +Date: Mon Sep 13 23:22:02 2010 +0100 + + Update British English translation + + po/en_GB.po | 966 + ++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 495 insertions(+), 471 deletions(-) + +commit f5edeea0e5791de8d0f0936fa821ecd22fcd30b5 +Author: Fran Diéguez +Date: Mon Sep 13 23:46:03 2010 +0200 + + Updated Galician translations + + po/gl.po | 984 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 504 insertions(+), 480 deletions(-) + +commit f3770593f8691ce4cc1d597482d9b0f457066848 +Author: Matej Urbančič +Date: Mon Sep 13 21:54:45 2010 +0200 + + Updated Slovenian translation + + po/sl.po | 2534 + +++++++++++++++++++++++++++++++++++++++----------------------- + 1 files changed, 1579 insertions(+), 955 deletions(-) + +commit ba17efc3961b094cc853b66d66e09a3d8b0444a1 +Author: Will Thompson +Date: Thu Sep 9 17:24:00 2010 +0100 + + g_strdup_value_contents(): dump GStrv more usefully + + Previously, dumping a GValue holding a GStrv just yielded "((GStrv *) + 0xDEADBEEF)". I think it'd be more useful to dump a Python list-style + representation of the GStrv's contents, if it's not NULL. + + Fixes: + + gobject/gvaluetypes.c | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +commit cb2ddac7a29f534350f07afdbe5631b2f9df176f +Author: A S Alam +Date: Mon Sep 13 23:09:33 2010 +0530 + + update for Punjabi + + po/pa.po | 977 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 497 insertions(+), 480 deletions(-) + +commit 2e78d07f86d70de274f126a3ff00bd4af90a5c90 +Author: Ryan Lortie +Date: Tue Mar 23 01:12:01 2010 -0500 + + Add g_data_input_stream_read_upto{,async,finish} + + These functions are meant to replace the read_until() flavour, + with the + following improvements: + + - consistency between the synchronous and asynchronous versions + as to + if the separator character is read (it never is). + + - support for using a nul byte as a separator character by way of + addition of a length parameter which allows stop_chars to + be treated + as a byte array rather than a nul-terminated string. + + The read_until() functions are not yet formally deprecated, but a note + has been added to the documentation warning not to use them as + they will + be in the future. + + This is bug #584284. + + docs/reference/gio/gio-sections.txt | 3 + + gio/gdatainputstream.c | 257 + ++++++++++++++++++++++++++++------- + gio/gdatainputstream.h | 66 ++++++---- + gio/gio.symbols | 3 + + gio/tests/data-input-stream.c | 61 ++++++++- + 5 files changed, 312 insertions(+), 78 deletions(-) + +commit 0ecfc6e1f9fa3439f733fc75cc462218a0a1974e +Author: Matthias Clasen +Date: Mon Sep 13 12:02:13 2010 -0400 + + Better msgctxt for month and weekday names + + The current msgctxt string 'GDateTime" lead to the unability to + differentiate between the full and abbreviated name for May. + Therefore, the msgctxt strings have been changed to + 'full month name' + 'abbreviated month name' + 'full weekday name' + 'abbreviated weekday name' + This is a string change, but all translations have been updated + using an sed script. + + Bug 629429 + + glib/gdatetime.c | 86 + +++++++++++++++++++++++++++++------------------------- + po/ar.po | 74 +++++++++++++++++++++++----------------------- + po/de.po | 74 +++++++++++++++++++++++----------------------- + po/en_GB.po | 74 +++++++++++++++++++++++----------------------- + po/es.po | 74 +++++++++++++++++++++++----------------------- + po/eu.po | 74 +++++++++++++++++++++++----------------------- + po/gl.po | 74 +++++++++++++++++++++++----------------------- + po/he.po | 74 +++++++++++++++++++++++----------------------- + po/hu.po | 74 +++++++++++++++++++++++----------------------- + po/id.po | 74 +++++++++++++++++++++++----------------------- + po/ja.po | 74 +++++++++++++++++++++++----------------------- + po/nb.po | 74 +++++++++++++++++++++++----------------------- + po/pa.po | 74 +++++++++++++++++++++++----------------------- + po/pl.po | 74 +++++++++++++++++++++++----------------------- + po/pt.po | 74 +++++++++++++++++++++++----------------------- + po/sr.po | 74 +++++++++++++++++++++++----------------------- + po/sr@latin.po | 74 +++++++++++++++++++++++----------------------- + po/sv.po | 74 +++++++++++++++++++++++----------------------- + po/zh_HK.po | 74 +++++++++++++++++++++++----------------------- + po/zh_TW.po | 74 +++++++++++++++++++++++----------------------- + 20 files changed, 749 insertions(+), 743 deletions(-) + +commit bd569dc3c97fb23447951388cc57ff23844f96e3 +Author: Matthias Clasen +Date: Mon Sep 13 11:58:56 2010 -0400 + + Adapt POTFILES.in to source file renaming + + po/POTFILES.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 445f708b8ff93b96ff1e440fe9c26bf8b19ff706 +Author: Ryan Lortie +Date: Mon Sep 13 12:07:51 2010 -0400 + + Const 'parser' arg to g_markup_parse_context_push + + This is a vtable structure and very likely the user has allocated + it in + static storage and wants it to be const. Since we never modify it, no + harm is done to us to have it const. + + Closes bug #629328. + + glib/gmarkup.c | 2 +- + glib/gmarkup.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 124023b06d39c5b94605368abd8f9576ece45ca4 +Author: Tomeu Vizoso +Date: Mon Sep 13 17:53:54 2010 +0200 + + Make g_variant_builder_end's return to be (allow none) because callers + need to add a ref to it in addition to sinking it. + + glib/gvariant.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 8466ba8dc120c7e95df8a147ade9d5b449727c0e +Author: Kristian Rietveld +Date: Mon Sep 13 16:52:51 2010 +0200 + + Include giochannel.c for G_IO_IN, etc. + + Fixes build on OS X. + + glib/gpoll.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 9cd43d7a4c5d3a50187c2eaba7ab903cf6456d7d +Author: Emmanuele Bassi +Date: Wed Aug 18 15:32:27 2010 +0100 + + gobject: Add install_properties() + + Since we added g_object_notify_by_pspec(), an efficient way to install + and notify properties relies on storing the GParamSpec pointers inside + a static arrays, like we do for signal identifiers. + + Instead of multiple calls to g_object_class_install_property(), we + should have a single function to take the static array of GParamSpecs + and iterate it. + + https://bugzilla.gnome.org/show_bug.cgi?id=626919 + + Signed-off-by: Emmanuele Bassi + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gobject.c | 121 ++++++++++++++- + gobject/gobject.h | 3 + + gobject/gobject.symbols | 1 + + gobject/tests/.gitignore | 1 + + gobject/tests/Makefile.am | 4 +- + gobject/tests/properties.c | 222 + +++++++++++++++++++++++++++ + 7 files changed, 350 insertions(+), 3 deletions(-) + +commit 58a40904af47fbc838bea29cc6ab068b26eb74c5 +Author: Daniel Nylander +Date: Sun Sep 12 20:25:57 2010 +0200 + + Updated Swedish translation + + po/sv.po | 700 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 361 insertions(+), 339 deletions(-) + +commit 681a72ea9923a3b37d8258b2b25e8f734d92bf21 +Author: Ryan Lortie +Date: Sun Sep 12 13:35:30 2010 -0400 + + GSettings: no writability->value change assumption + + GSettings internally assumed that a change in key writability + implied a + change in value. That may be true for some backends. Let those + backends deal with the situation for themselves. + + gio/gsettings.c | 10 ++-------- + 1 files changed, 2 insertions(+), 8 deletions(-) + +commit 8a8cdd1d328df0f2429e2c49050dae1aec4abf36 +Author: Tor Lillqvist +Date: Sun Sep 12 13:58:13 2010 +0300 + + Add some more individual own header includes where required + + gio/gdbusprivate.c | 1 + + glib/gunicollate.c | 3 +++ + glib/guniprop.c | 3 +++ + 3 files changed, 7 insertions(+), 0 deletions(-) + +commit fc3abfffcf63a12f766f86bca29bd71544aa0416 +Author: Mario Blättermann +Date: Sun Sep 12 11:02:47 2010 +0200 + + [i18n] Updated German translation + + po/de.po | 2092 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1382 insertions(+), 710 deletions(-) + +commit 825576322ab491d79fc272c5d536b241b8dad352 +Author: Takayuki KUSANO +Date: Sun Sep 12 03:02:24 2010 +0900 + + Updatede Japanese translation. + + po/ja.po | 2420 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 1568 insertions(+), 852 deletions(-) + +commit 38a3b1730de7ec40627c2f6f75320e9e432ce12c +Author: Tomeu Vizoso +Date: Sat Sep 11 17:01:10 2010 +0200 + + Add annotation for g_variant_get_string + + glib/gvariant.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e7f04bf29af35e606920abb2e04a277ccb6de2bd +Author: Andika Triwidada +Date: Sat Sep 11 16:29:06 2010 +0700 + + Updated Indonesian translation + + po/id.po | 46 +++++++++++++++++++++++----------------------- + 1 files changed, 23 insertions(+), 23 deletions(-) + +commit dc8dc56ddd5da7d9e4a10891ba917e424cb6b7d8 +Author: Tor Lillqvist +Date: Sat Sep 11 12:08:32 2010 +0300 + + dos2unix glib/win_iconv.c + + glib/win_iconv.c | 3930 + +++++++++++++++++++++++++++--------------------------- + 1 files changed, 1965 insertions(+), 1965 deletions(-) + +commit 1254104cea92c02f3d0e9cf10b99382dd7e71439 +Author: Benjamin Otte +Date: Sat Sep 11 00:12:13 2010 +0200 + + docs: Clarify string encoding for GFile constructors + + The encoding was deduced from looking at the source code, feel free to + fix if it's wrong (the docs _and_ the source code). + + gio/gfile.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 0b74058fa3144f85b5fefd4c81129b971010452a +Author: David Zeuthen +Date: Fri Sep 10 16:21:37 2010 -0400 + + Add work-around for Bug 627724 + + The root problem is with GObject - for now, just work around it in + GDBus. Also include a test-case. See + + https://bugzilla.gnome.org/show_bug.cgi?id=627724 + + for more information. + + Signed-off-by: David Zeuthen + + gio/gdbusprivate.c | 44 +++++++++++++++++++- + gio/tests/Makefile.am | 4 ++ + gio/tests/gdbus-bz627724.c | 94 + ++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 140 insertions(+), 2 deletions(-) + +commit 12029eeb6a54f2445bde0af314116844122b535b +Author: David Zeuthen +Date: Fri Sep 10 13:27:48 2010 -0400 + + Remove g_dbus_message_filter_result_get_type() from gio.symbols + + Pointed out by danw on IRC. + + Signed-off-by: David Zeuthen + + gio/gio.symbols | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit bc29aa9b0956dec53c0b957ce879b41329307058 +Author: Dan Winship +Date: Fri Sep 10 09:12:17 2010 -0400 + + g_socket_client_connect_async: fix when g_socket_connect succeeds + immediately + + https://bugzilla.gnome.org/show_bug.cgi?id=629251 + + gio/gsocketclient.c | 31 ++++++++++++++++++------------- + 1 files changed, 18 insertions(+), 13 deletions(-) + +commit 59383c8bea00b8f4bf50cf82ae9f3e7ce1df1a03 +Author: Dan Winship +Date: Fri Sep 10 08:51:21 2010 -0400 + + Fix IPv6 parsing in _g_uri_parse_authority, add _g_uri_from_authority + + Fixes connections to IPv6 address literals. + + https://bugzilla.gnome.org/show_bug.cgi?id=629259 + + gio/gnetworkaddress.c | 49 + +++++++++++++++++++++++++++++++++++++++++++-- + gio/gnetworkingprivate.h | 4 +++ + gio/gnetworkservice.c | 9 ++++--- + gio/gsocketaddress.c | 2 +- + 4 files changed, 56 insertions(+), 8 deletions(-) + +commit f8cb2a60b9fb79f4d3719f842d71245d844ee9c0 +Author: Ryan Lortie +Date: Thu Sep 9 16:28:18 2010 -0400 + + Add 3 new restrictions to the schema compiler + + - can not extend schemas that already have paths + - can not form list of schemas that already have paths + - the path of a list schema, if given, must end with ':/' + + gio/glib-compile-schemas.c | 25 ++++++++++++++++++++++++- + 1 files changed, 24 insertions(+), 1 deletions(-) + +commit 7777dd2c3951e14fadb56a01b5c31b6404253cd3 +Author: Ryan Lortie +Date: Thu Sep 9 16:12:45 2010 -0400 + + Rename gschema-compile.c -> glib-compile-schemas.c + + gio/Makefile.am | 2 +- + gio/glib-compile-schemas.c | 1880 + ++++++++++++++++++++++++++++++++++++++++++++ + gio/gschema-compile.c | 1880 + -------------------------------------------- + 3 files changed, 1881 insertions(+), 1881 deletions(-) + +commit 77e3badcf3f15c7ac235904160d775febfcebcb5 +Author: Ryan Lortie +Date: Mon Sep 6 12:47:37 2010 -0400 + + split GSettings.list_items => list_{children,keys} + + This is an incompatible public API/ABI change. + + gio/gio.symbols | 3 +- + gio/gsettings-tool.c | 18 ++++----- + gio/gsettings.c | 88 + +++++++++++++++++++++++++++++++++++++++--------- + gio/gsettings.h | 6 +++- + gio/tests/gsettings.c | 18 ++++++---- + 5 files changed, 97 insertions(+), 36 deletions(-) + +commit 7b4cbbb7b21c9d53922a79aa499892b3de5642dc +Author: Ryan Lortie +Date: Thu Sep 9 15:45:53 2010 -0400 + + Create GSettingsListenerVTable + + ...instead of passing a whole whack of function pointers around + + This is an internal API. + + gio/gdelayedsettingsbackend.c | 35 +++++++------ + gio/gsettings.c | 48 +++++++++--------- + gio/gsettingsbackend.c | 54 ++++++++------------ + gio/gsettingsbackendinternal.h | 108 + +++++++++++++++++++--------------------- + 4 files changed, 115 insertions(+), 130 deletions(-) + +commit 7c6606854400ba2a4d0c5b5a0eb96ba90845f82e +Author: David Zeuthen +Date: Thu Sep 9 15:15:13 2010 -0400 + + GDBusMessage: Don't reset serial number when copying + + Ryan pointed out that it's safe to do this because we have the + G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag and that it simplifies + how filter functions work. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.h | 12 ++++++------ + gio/gdbusmessage.c | 3 ++- + gio/gdbusprivate.c | 6 ------ + gio/tests/gdbus-message.c | 2 +- + 4 files changed, 9 insertions(+), 14 deletions(-) + +commit a51df8cefb17cdaea61a468076e0b67868439b4d +Author: David Zeuthen +Date: Thu Sep 9 14:14:45 2010 -0400 + + GUnixConnection: Remove comment about Linux + + Since the previous commit, the g_unix_connection_send_credentials() / + g_unix_connection_receive_credentials() functions now also works on + FreeBSD since GUnixCredentialsMessage now works there. + + The main idea is that the g_unix_connection_send_credentials() / + g_unix_connection_receive_credentials() functions are the "main" API + for getting credentials (one way or the other). So it's better to + avoid advertising where it is currently implemented. + + Signed-off-by: David Zeuthen + + gio/gunixconnection.c | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +commit 964eb62343b53cf9172d409adacbb58d78896092 +Author: Joe Marcus Clarke +Date: Thu Sep 9 14:10:01 2010 -0400 + + Bug 628904 – Add credential support for FreeBSD and fix a socket + issue + + Signed-off-by: David Zeuthen + + gio/gcredentials.c | 53 + +++++++++++++++++++++++++++++++++++++++++ + gio/gioenums.h | 4 ++- + gio/gsocket.c | 9 +++++- + gio/gunixcredentialsmessage.c | 46 +++++++++++++++++++++++++++++++++++ + 4 files changed, 109 insertions(+), 3 deletions(-) + +commit ee945d8f621609086a8777ca4226cb93308c12e4 +Author: David Zeuthen +Date: Thu Sep 9 14:00:46 2010 -0400 + + GDBusServer: Make ::new-connection return whether the connection + was claimed + + Otherwise things probably won't work in a garbage-collected world + (consider the trivial GC that never collects garbage). + + This commit breaks GDBusServer ABI. No known released software is + using this code. + + Signed-off-by: David Zeuthen + + gio/gdbusserver.c | 34 ++++++++++++++++++++++------------ + gio/gio-marshal.list | 1 + + gio/tests/gdbus-example-peer.c | 4 +++- + gio/tests/gdbus-peer.c | 12 +++++++++--- + 4 files changed, 35 insertions(+), 16 deletions(-) + +commit c3371efcaa47b03941c6c8148687b0a21d18dfbe +Author: David Zeuthen +Date: Thu Sep 9 13:21:35 2010 -0400 + + Bug 624546 – Modification of GDBusMessage in filter function + + Rework filter functions as per + + https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8 + + This commit breaks ABI. However, this ABI break affects only + applications using filter functions. The only known user of is dconf. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 1 - + gio/gdbusconnection.c | 95 + ++++++++++++++--------------------- + gio/gdbusconnection.h | 81 ++++++++++++++++++++++++----- + gio/gdbusprivate.c | 37 ++++++++------ + gio/gdbusprivate.h | 6 +- + gio/gioenums.h | 25 --------- + gio/tests/gdbus-connection.c | 69 ++++++++++++++++--------- + gio/tests/gdbus-peer.c | 4 +- + 8 files changed, 175 insertions(+), 143 deletions(-) + +commit 3d8095588a149826872d97151db6370e9772c42e +Author: David Zeuthen +Date: Thu Sep 9 12:00:00 2010 -0400 + + Fix tmpl files + + Signed-off-by: David Zeuthen + + docs/reference/glib/tmpl/conversions.sgml | 12 +- + docs/reference/glib/tmpl/glib-unused.sgml | 40 ++++++++ + docs/reference/glib/tmpl/gregex.sgml | 142 + ++++++++++++++--------------- + docs/reference/glib/tmpl/messages.sgml | 27 +---- + docs/reference/glib/tmpl/version.sgml | 41 -------- + 5 files changed, 122 insertions(+), 140 deletions(-) + +commit 67a00658eadfd99ffd1be8cb5a7387e3d77e63a7 +Author: David Zeuthen +Date: Thu Sep 9 11:37:14 2010 -0400 + + GDBusMessage: Make it possible to lock and copy messages + + Don't actually use this yet as that will require a couple of + modifications to the filter function signature. This is part of the + bug-fix for + + https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8 + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 3 + + gio/gdbusmessage.c | 210 + ++++++++++++++++++++++++++++++++++- + gio/gdbusmessage.h | 5 +- + gio/gio.symbols | 3 + + gio/tests/Makefile.am | 4 + + gio/tests/gdbus-message.c | 153 +++++++++++++++++++++++++ + 6 files changed, 375 insertions(+), 3 deletions(-) + +commit 016cecb179de46defe84d674c277add5c2a1bd3f +Author: Emmanuele Bassi +Date: Wed Sep 8 11:58:42 2010 +0300 + + Revert hack that broke things badly on Windows + + This should fix bug #628952. + + Don't include glib/gdatasetprivate.h directly. Especially don't define + GLIB_COMPILATION when doing that, as that causes breakage on Windows + because of the variable dllimport/dllexport stuff in gtypes.h that + checks GLIB_COMPILATION. That macro really should be defined only when + compiling code that goes into the libglib DLL. Otherwise the compiler + thinks that variables that should be imported from libglib are + actually defined in the code being compiled. + + Just call g_atomic_pointer_get() as such, don't bother with + G_DATALIST_GET_FLAGS. + + Signed-off-by: Tor Lillqvist + + gobject/gobject.c | 9 +-------- + 1 files changed, 1 insertions(+), 8 deletions(-) + +commit 349322622a46cafbda7d4d16c0fa9b245467d720 +Author: Inaki Larranaga Murgoitio +Date: Tue Sep 7 18:03:19 2010 +0200 + + Updated Basque language + + po/eu.po | 2300 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1526 insertions(+), 774 deletions(-) + +commit e96bbfe63a3d6f1a16a417ce0d1f839b77cf4f93 +Author: Piotr Drąg +Date: Tue Sep 7 17:43:37 2010 +0200 + + Updated Polish translation + + po/pl.po | 1791 + +++++++++++++++++++++++++------------------------------------- + 1 files changed, 713 insertions(+), 1078 deletions(-) + +commit c3a7e51edfadbd9fb53db5c9443aa64d82dd763d +Author: Piotr Drąg +Date: Tue Sep 7 17:42:19 2010 +0200 + + Updated Polish translation + + po/pl.po | 2578 + +++++++++++++++++++++++++++++++++++++++++++------------------- + 1 files changed, 1800 insertions(+), 778 deletions(-) + +commit c406b272a6b9d89f3061632507d7fc2538011b34 +Author: Duarte Loreto +Date: Tue Sep 7 00:33:02 2010 +0100 + + Updated Portuguese translation + + po/pt.po | 276 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 153 insertions(+), 123 deletions(-) + +commit 5a0ba0f7fc056ec800454f4977d3307c879335d4 +Author: Duarte Loreto +Date: Tue Sep 7 00:29:36 2010 +0100 + + Updated Portuguese translation + + po/pt.po | 2291 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 1494 insertions(+), 797 deletions(-) + +commit d0a4fae95f46e9b6a67057f241d7b904b5a7dbd3 +Author: Daniel Nylander +Date: Mon Sep 6 23:10:09 2010 +0200 + + Updated Swedish translation + + po/sv.po | 849 + ++++++++++++++++++++++++++++++++++++++++++-------------------- + 1 files changed, 582 insertions(+), 267 deletions(-) + +commit 3b9055265fd30a215cbd230dc61f77ef02337193 +Author: Gabor Kelemen +Date: Mon Sep 6 15:07:02 2010 +0200 + + Updated Hungarian translation + + po/hu.po | 2287 + +++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1503 insertions(+), 784 deletions(-) + +commit 548ddd5fe92fd9e14e217e68930bd036bffadc5f +Author: Tor Lillqvist +Date: Mon Sep 6 15:56:16 2010 +0300 + + Fix build on Windows and possibly other non-Linux platforms + + Include glibconfig.h in files that test G_OS_WIN32. Include headers + for GLib APIs used conditionally where needed. + + glib/gbacktrace.c | 1 + + glib/gconvert.c | 6 ++++++ + glib/gdate.c | 5 +++++ + glib/gfileutils.c | 1 + + glib/gmain.c | 18 ++++++++++++++++++ + glib/gpoll.c | 4 ++++ + glib/gslice.c | 1 + + glib/gstdio.c | 1 + + glib/gtimer.c | 2 +- + glib/gutils.c | 6 ++++++ + 10 files changed, 44 insertions(+), 1 deletions(-) + +commit 2aa135ee3d7b0a3e3140ce994ef0f554cadf9ab4 +Author: Emmanuele Bassi +Date: Mon Sep 6 12:26:40 2010 +0100 + + Whitespace fixes + + glib/gdatetime.c | 20 +++++++++++--------- + 1 files changed, 11 insertions(+), 9 deletions(-) + +commit 43098d0038ce1273844e2fba34cfa2408cd6e3bd +Author: Damien Lespiau +Date: Sun Sep 5 21:47:44 2010 +0100 + + datetime: Rename shadowing variables + + timezone and tzname shadow variables declared in time.h. Let's rename + them to time_zone and tz_name then. + + https://bugzilla.gnome.org/show_bug.cgi?id=628839 + + glib/gdatetime.c | 46 +++++++++++++++++++++++----------------------- + glib/gdatetime.h | 2 +- + 2 files changed, 24 insertions(+), 24 deletions(-) + +commit 875ad12345e22b3189e524d9bede58f6e7b5cf88 +Author: Thiago Santos +Date: Fri Sep 3 14:43:11 2010 +0100 + + gdatetime: Use proleptic gregorian + + Use Proleptic Gregorian calendar instead of the Julian calendar + as the internal representation. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + Signed-off-by: Emmanuele Bassi + + glib/gdatetime.c | 227 + +++++++++++++++++++++++++++-------------------- + glib/tests/gdatetime.c | 32 +++++++ + 2 files changed, 162 insertions(+), 97 deletions(-) + +commit 6bb89501cf7bfb5e4365d8dd3ef045a0c096af0c +Author: Christian Hergert +Date: Tue Aug 31 09:27:58 2010 -0700 + + datetime: use g_utf8_next_char() to walk utf8 string + + Previously, the format string was iterated many times by + walking to the given offset in the string repeatedly. + This patch instead walks the string using g_utf8_next_char(). + + Additionally, the character for lookups was a char and could + loose content. This uses gunichar instead. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + glib/gdatetime.c | 29 +++++++++++++---------------- + 1 files changed, 13 insertions(+), 16 deletions(-) + +commit 52e44ddec27cca394e7aa047d994530783b7026a +Author: Christian Hergert +Date: Tue Aug 31 09:10:16 2010 -0700 + + datetime: avoid using __year + + These were left over from when the inline functions where implemented + as macros. They are no longer needed and where clashing with the + global __year anyway. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + glib/gdatetime.c | 54 + +++++++++++++++++++++++++++--------------------------- + 1 files changed, 27 insertions(+), 27 deletions(-) + +commit 64300c0cc44b206db3f4dd206cced56ddda33038 +Author: Emmanuele Bassi +Date: Thu Aug 26 15:23:13 2010 +0100 + + datetime: Add get_week_of_year() + + https://bugzilla.gnome.org/show_bug.cgi?id=628029 + + Based on a patch by: Joseph Pingenot + + Signed-off-by: Emmanuele Bassi + + docs/reference/glib/glib-sections.txt | 25 +++++++++++++------------ + glib/gdatetime.c | 21 +++++++++++++++++++++ + glib/gdatetime.h | 1 + + glib/glib.symbols | 1 + + 4 files changed, 36 insertions(+), 12 deletions(-) + +commit 70ef2e3bf64b4bfe85d2cf60daf95c50aa292039 +Author: Emmanuele Bassi +Date: Thu Aug 26 13:11:46 2010 +0100 + + datetime: Rename internal method + + Use add_ymd(), to reflect the order of the arguments. + + glib/gdatetime.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit 959886d95e0f4caafbfd300320dc8055e8bbbac7 +Author: Emmanuele Bassi +Date: Mon Sep 6 11:43:04 2010 +0100 + + build: Fix warnings caused by missing includes + + glib/giounix.c | 1 + + glib/gslice.c | 2 ++ + glib/gspawn.c | 2 ++ + 3 files changed, 5 insertions(+), 0 deletions(-) + +commit 438d195d19f627dc9da9d72ca153f5caba5db151 +Author: Khaled Hosny +Date: Sun Sep 5 16:23:00 2010 +0200 + + Updated Arabic translation + + po/ar.po | 1982 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 1297 insertions(+), 685 deletions(-) + +commit f4c84a59f89f3f22958cf5b263963e801d76065d +Author: Chao-Hsiung Liao +Date: Sun Sep 5 19:24:01 2010 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + + po/zh_HK.po | 546 + +++++++++++++++++++++++++++++++++++++++++------------------ + po/zh_TW.po | 546 + +++++++++++++++++++++++++++++++++++++++++------------------ + 2 files changed, 758 insertions(+), 334 deletions(-) + +commit f13d5612116de1e968764721fbc60b8e1d378430 +Author: Matthias Clasen +Date: Sun Sep 5 00:23:03 2010 -0400 + + More header inclusion cleanup + + glib/gatomic-gcc.c | 2 +- + glib/gatomic.c | 2 +- + glib/gerror.c | 4 +++- + glib/giounix.c | 10 +++++++--- + glib/gprintf.c | 1 - + glib/gslice.c | 15 +++++++++------ + glib/gspawn.c | 7 ++++++- + glib/gunidecomp.c | 3 ++- + glib/gutils.c | 10 +++++++++- + 9 files changed, 38 insertions(+), 16 deletions(-) + +commit 19972a1b57ef092067f001bb8d870fa552cc20a2 +Author: Emmanuele Bassi +Date: Sat Sep 4 18:24:50 2010 +0100 + + build: Quench the compiler's thirst for warnings + + gio/gdbusauthmechanismsha1.c | 1 + + gio/gdbusmessage.c | 1 + + gio/gdbusproxy.c | 1 + + gio/gdbusserver.c | 1 + + gio/tests/gdbus-introspection.c | 5 ++++- + gio/tests/gdbus-peer.c | 1 + + 6 files changed, 9 insertions(+), 1 deletions(-) + +commit 581e68b7d3f57654d881cea6de7bdfabae62e368 +Author: Emmanuele Bassi +Date: Sat Sep 4 18:15:15 2010 +0100 + + gmain: Define _GNU_SOURCE before including glibconfig.h + + As it pulls in unistd.h from something else. + + glib/gmain.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit ca7dee5949185cd43a1f71c4e2b15987a0cc3160 +Author: Emmanuele Bassi +Date: Sat Sep 4 18:04:34 2010 +0100 + + Build fixes for the fall-out of the inclusion changes + + glib/gbacktrace.c | 3 +++ + glib/gchecksum.c | 1 + + glib/gdataset.c | 1 + + glib/gdatetime.c | 3 +++ + glib/gdatetime.h | 2 +- + glib/gdir.c | 1 + + glib/ghash.c | 1 + + glib/ghostutils.c | 1 + + glib/giochannel.c | 1 + + glib/gpoll.c | 1 + + glib/grand.c | 1 + + glib/gscanner.c | 1 + + glib/gshell.c | 1 + + 13 files changed, 17 insertions(+), 1 deletions(-) + +commit b1dbcc40237f77f3648b8f5fd654ce30d260f7ba +Author: Emmanuele Bassi +Date: Sat Sep 4 18:03:33 2010 +0100 + + gtimer: Fix a compilation warning + + glib/gtimer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 01a46e5c652ec8030226a9cf54025e175f56caac +Author: Emmanuele Bassi +Date: Sat Sep 4 17:22:39 2010 +0100 + + Hack to include glib/gdatasetprivate.h directly + + The gdatasetprivate.h header includes gatomic.h directly. It all works + well in GLib, but inside GObject it will trigger the single inclusion + guard. + + Since this is a private header, and it's kind of a special case, + one way + to fix it is to declare GLIB_COMPILATION around it and fool the single + inclusion guard in gatomic.h into thinking we're compiling GLib + and not + GObject. + + gobject/gobject.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 82db1446b39a4579b342b89fd0eba50c4f93441b +Author: Emmanuele Bassi +Date: Sat Sep 4 17:22:18 2010 +0100 + + Add missing gstrfuncs.h include + + For g_strdup() and friends. + + glib/gutf8.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 04077ff5c5f57dd8c55c47bfb80d551e594a525c +Author: Matthias Clasen +Date: Fri Sep 3 23:03:14 2010 -0400 + + More include cleanups + + glib/gconvert.c | 16 +- + glib/gdataset.c | 11 +- + glib/gdate.c | 10 +- + glib/gdir.c | 4 +- + glib/gfileutils.c | 4 +- + glib/ghash.c | 5 +- + glib/ghook.c | 8 +- + glib/ghostutils.c | 11 +- + glib/giochannel.c | 3 +- + glib/gmain.c | 17 +- + glib/gpoll.c | 2 +- + glib/gqsort.c | 4 +- + glib/gscanner.c | 27 +- + glib/gshell.c | 9 +- + glib/gstdio.c | 2 - + glib/gstrfuncs.c | 1128 + ++++++++++++++++++++++++++-------------------------- + glib/gthreadpool.c | 7 +- + glib/gtimer.c | 10 +- + glib/gunicollate.c | 7 +- + glib/guniprop.c | 6 +- + 20 files changed, 672 insertions(+), 619 deletions(-) + +commit dc2e46b2aa5b57883379807421eb1d0493ae343e +Author: Matthias Clasen +Date: Fri Sep 3 21:24:40 2010 -0400 + + Don't include glib.h in other headers + + glib/gdatasetprivate.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2effb8d0eaf8041615dda14e4cc82ed764255859 +Author: Matthias Clasen +Date: Fri Sep 3 21:20:07 2010 -0400 + + Remove excessive header includes + + glib/goption.c | 1898 + ++++++++++++++++++++++++++++---------------------------- + 1 files changed, 951 insertions(+), 947 deletions(-) + +commit 7c68050451b0480673bb389c70f238fcd871790b +Author: Matthias Clasen +Date: Fri Sep 3 21:15:45 2010 -0400 + + Remove excessive header includes + + glib/gdatetime.c | 8 ++++---- + glib/gdatetime.h | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit aad19216518126306a385dd5b6fb2448bc1d3b22 +Author: Matthias Clasen +Date: Fri Sep 3 21:12:03 2010 -0400 + + Don't include glib.h in other headers + + glib/gunicodeprivate.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 349aec676c01d72c42ce186b258fdde52acd6611 +Author: Matthias Clasen +Date: Fri Sep 3 20:57:05 2010 -0400 + + Remove excessive header inclusions + + glib/glist.c | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +commit 633f438300ab08b97f8f4ea8ff1b06bd8413cf24 +Author: Matthias Clasen +Date: Fri Sep 3 20:55:17 2010 -0400 + + Remove excessive header inclusions + + glib/gqueue.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 7ddd2100c36215b8806569933d046b96d7eea09a +Author: Matthias Clasen +Date: Fri Sep 3 20:53:37 2010 -0400 + + Remove excessive header inclusions + + glib/gmarkup.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit 56818094485fdfb26ee57b86afe1526704158a73 +Author: Matthias Clasen +Date: Fri Sep 3 20:51:08 2010 -0400 + + Remove excessive header inclusions + + glib/gmessages.c | 23 ++++++++++++++++------- + 1 files changed, 16 insertions(+), 7 deletions(-) + +commit a376d9f4c85bdac832f404175b4e65e0a81825a1 +Author: Matthias Clasen +Date: Fri Sep 3 20:46:40 2010 -0400 + + Remove some unneeded headers + + glib/gnode.c | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +commit 92c577eeff6c42247a4eb3a74eb3f4894a143f9d +Author: Matthias Clasen +Date: Fri Sep 3 20:44:59 2010 -0400 + + Remove eexcessive header inclusions + + glib/grand.c | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +commit 0a9eb80798274cb4faffcf8bd6fee829d767b336 +Author: Matthias Clasen +Date: Fri Sep 3 20:41:52 2010 -0400 + + Remove redundant header inclusions + + glib/gprimes.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 6e3b14e155d08e7fee722c282f2b0c42c4bb7bbe +Author: Matthias Clasen +Date: Fri Sep 3 20:38:30 2010 -0400 + + Remove redundant header inclusions + + glib/gunibreak.c | 1 - + glib/gunibreak.h | 3 +++ + 2 files changed, 3 insertions(+), 1 deletions(-) + +commit c5049d86f94cc7f943ee63c93bb01100e759769b +Author: Matthias Clasen +Date: Fri Sep 3 20:34:15 2010 -0400 + + Remove redundant header inclusions + + glib/gstring.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +commit 96d87da379879f20e2c162b468525aaa1a0a82dd +Author: Matthias Clasen +Date: Fri Sep 3 20:30:54 2010 -0400 + + Remove redundant header inclusions + + glib/gregex.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 3e2f1e38255d8157a2ecf244d6a5f6515b8c2d6b +Author: Matthias Clasen +Date: Fri Sep 3 20:27:45 2010 -0400 + + Remove redundant header inclusions + + and some whitespace cleanup. + + glib/gsequence.c | 638 + +++++++++++++++++++++++++++--------------------------- + 1 files changed, 320 insertions(+), 318 deletions(-) + +commit 8f81ee86ee307448d9a687c01d4958914e5ebc90 +Author: Matthias Clasen +Date: Fri Sep 3 20:15:16 2010 -0400 + + Remove redundant header inclusions + + glib/gslist.c | 345 + +++++++++++++++++++++++++++++---------------------------- + 1 files changed, 173 insertions(+), 172 deletions(-) + +commit d95c6b88348a7c6480c3368d7762137a40a490ba +Author: Matthias Clasen +Date: Fri Sep 3 20:12:09 2010 -0400 + + Remove redundant header inclusions + + glib/gvariant-parser.c | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletions(-) + +commit 1409bbab674d935dd3e8072a17719be1e0ba9d66 +Author: Matthias Clasen +Date: Fri Sep 3 20:05:27 2010 -0400 + + Remove redundant header inclusions + + glib/gtree.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 9471902d4d386328f248e2db2e3be895c4ecd5f1 +Author: Matthias Clasen +Date: Fri Sep 3 20:01:55 2010 -0400 + + Remove redundant header inclusions + + glib/gutf8.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit ebcdbd9555b7a1a06ad666d1fef187779f085ea1 +Author: Matthias Clasen +Date: Fri Sep 3 19:49:34 2010 -0400 + + Remove redundant header inclusions + + and clean up some whitespace + + glib/gchecksum.c | 50 + ++++++++++++++++++++++++++------------------------ + glib/gchecksum.h | 40 ++++++++++++++++++++-------------------- + 2 files changed, 46 insertions(+), 44 deletions(-) + +commit 9b3fb41a5e4fd9d87c606dcea0fd1cd505b54311 +Author: Matthias Clasen +Date: Fri Sep 3 19:41:49 2010 -0400 + + Remove redundant header inclusions + + and clean up some whitespace + + glib/gbacktrace.c | 58 + +++++++++++++++++++++++++++------------------------- + glib/gbacktrace.h | 14 ++++++------ + 2 files changed, 37 insertions(+), 35 deletions(-) + +commit 156a3f71952e37aef199ab381f552a5fe014decb +Author: Matthias Clasen +Date: Fri Sep 3 19:38:56 2010 -0400 + + Whitespace cleanup + + glib/gcache.c | 28 ++++++++++++++-------------- + glib/gcache.h | 2 +- + 2 files changed, 15 insertions(+), 15 deletions(-) + +commit 8300820f7bacd8eb85446be5a5edd7829bd640a6 +Author: Matthias Clasen +Date: Fri Sep 3 19:37:54 2010 -0400 + + Remove redundant header inclusions + + glib/gcache.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 5d4ef36f91074a4477bca67e2519e2ca13f3ae2c +Author: Matthias Clasen +Date: Fri Sep 3 19:33:11 2010 -0400 + + Whitespace cleanup + + glib/gbase64.c | 196 + ++++++++++++++++++++++++++++---------------------------- + glib/gbase64.h | 44 ++++++------ + 2 files changed, 120 insertions(+), 120 deletions(-) + +commit 489b780bb95d9941617ab21160823e0ad268f1b7 +Author: Matthias Clasen +Date: Fri Sep 3 19:32:02 2010 -0400 + + Remove redundant header inclusions + + glib/gbase64.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 4e5532ec51e7091656f2853895cee3dc69f8ad5e +Author: Matthias Clasen +Date: Fri Sep 3 19:03:34 2010 -0400 + + Sort extensions properly + + Just taking the difference of the priorities has overflow issues, + as pointed out in bug 623069. + + gio/giomodule.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 42080449d078c27f2098419b27d0f63269ee2d70 +Author: Matthias Clasen +Date: Fri Sep 3 18:11:08 2010 -0400 + + Add a note about size limits of private structures + + Also add some assertions to check these limits, instead of + failing silently. Bug 604479. + + gobject/gtype.c | 21 ++++++++++++++++----- + 1 files changed, 16 insertions(+), 5 deletions(-) + +commit db4fb1b115b2cd4142454db64da2b0abfedcd31b +Author: Christian Persch +Date: Fri Sep 3 16:05:28 2010 -0400 + + Plug a mem leak in the gdbus-proxy test + + ==23341== 65 bytes in 3 blocks are definitely lost in loss record + 927 of 1,020 + ==23341== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==23341== by 0x4057094: g_malloc (gmem.c:134) + ==23341== by 0x40573DB: g_malloc_n (gmem.c:281) + ==23341== by 0x40717FC: g_strdup (gstrfuncs.c:101) + ==23341== by 0x4147F56: value_lcopy_string (gvaluetypes.c:313) + ==23341== by 0x4123F0B: g_object_get_valist (gobject.c:1643) + ==23341== by 0x41240FF: g_object_get (gobject.c:1731) + ==23341== by 0x804C39E: test_basic (gdbus-proxy.c:522) + + Bug #628331. + + gio/tests/gdbus-proxy.c | 9 ++++++--- + 1 files changed, 6 insertions(+), 3 deletions(-) + +commit 5de1bf4a91f405ed5bca4768961e830c8b95e48c +Author: Christian Persch +Date: Fri Sep 3 16:04:29 2010 -0400 + + Plug a mem leak in the gdbus-proxy test + + ==23341== 85 (24 direct, 61 indirect) bytes in 1 blocks are definitely + lost in loss record 900 of 971 + ==23341== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==23341== by 0x4057094: g_malloc (gmem.c:134) + ==23341== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==23341== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==23341== by 0x403A751: g_error_new_valist (gerror.c:54) + ==23341== by 0x403AAD4: g_set_error (gerror.c:240) + ==23341== by 0x420B807: decode_method_reply + (gdbusconnection.c:4774) + ==23341== by 0x420C2BA: g_dbus_connection_call_sync + (gdbusconnection.c:5188) + ==23341== by 0x421B7C9: g_dbus_proxy_call_sync (gdbusproxy.c:2477) + ==23341== by 0x804BD89: test_bogus_method_return + (gdbus-proxy.c:430) + + Bug #628331. + + gio/tests/gdbus-proxy.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit be33ef85d0a89c2ded655785a4b930926e403e64 +Author: Christian Persch +Date: Fri Sep 3 16:03:48 2010 -0400 + + Plug some mem leaks in gdbus-peer test + + ==29535== 56 (24 direct, 32 indirect) bytes in 1 blocks are definitely + lost in loss record 1,112 of 1,264 + ==29535== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==29535== by 0x4057094: g_malloc (gmem.c:134) + ==29535== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==29535== by 0x406F364: g_slice_copy (gslice.c:858) + ==29535== by 0x403A9B2: g_error_copy (gerror.c:160) + ==29535== by 0x42066D3: initable_init (gdbusconnection.c:2314) + ==29535== by 0x41A73E5: g_initable_init (ginitable.c:105) + ==29535== by 0x41A7587: g_initable_new_valist (ginitable.c:218) + ==29535== by 0x41A742A: g_initable_new (ginitable.c:138) + ==29535== by 0x4206DCC: g_dbus_connection_new_for_address_sync + (gdbusconnection.c:2585) + ==29535== by 0x804D63A: test_nonce_tcp (gdbus-peer.c:1229) + + ==29535== 107 (24 direct, 83 indirect) bytes in 1 blocks are + definitely lost in loss record 1,188 of 1,264 + ==29535== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==29535== by 0x4057094: g_malloc (gmem.c:134) + ==29535== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==29535== by 0x406F364: g_slice_copy (gslice.c:858) + ==29535== by 0x403A9B2: g_error_copy (gerror.c:160) + ==29535== by 0x42066D3: initable_init (gdbusconnection.c:2314) + ==29535== by 0x41A73E5: g_initable_init (ginitable.c:105) + ==29535== by 0x41A7587: g_initable_new_valist (ginitable.c:218) + ==29535== by 0x41A742A: g_initable_new (ginitable.c:138) + ==29535== by 0x4206DCC: g_dbus_connection_new_for_address_sync + (gdbusconnection.c:2585) + ==29535== by 0x804D8E8: test_nonce_tcp (gdbus-peer.c:1259) + + ==29535== 112 (24 direct, 88 indirect) bytes in 1 blocks are + definitely lost in loss record 1,193 of 1,264 + ==29535== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==29535== by 0x4057094: g_malloc (gmem.c:134) + ==29535== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==29535== by 0x406F364: g_slice_copy (gslice.c:858) + ==29535== by 0x403A9B2: g_error_copy (gerror.c:160) + ==29535== by 0x42066D3: initable_init (gdbusconnection.c:2314) + ==29535== by 0x41A73E5: g_initable_init (ginitable.c:105) + ==29535== by 0x41A7587: g_initable_new_valist (ginitable.c:218) + ==29535== by 0x41A742A: g_initable_new (ginitable.c:138) + ==29535== by 0x4206DCC: g_dbus_connection_new_for_address_sync + (gdbusconnection.c:2585) + ==29535== by 0x804D79A: test_nonce_tcp (gdbus-peer.c:1248) + + ==29535== 73 (24 direct, 49 indirect) bytes in 1 blocks are definitely + lost in loss record 1,152 of 1,264 + ==29535== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==29535== by 0x4057094: g_malloc (gmem.c:134) + ==29535== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==29535== by 0x406F364: g_slice_copy (gslice.c:858) + ==29535== by 0x403A9B2: g_error_copy (gerror.c:160) + ==29535== by 0x42066D3: initable_init (gdbusconnection.c:2314) + ==29535== by 0x41A73E5: g_initable_init (ginitable.c:105) + ==29535== by 0x41A7587: g_initable_new_valist (ginitable.c:218) + ==29535== by 0x41A742A: g_initable_new (ginitable.c:138) + ==29535== by 0x4206DCC: g_dbus_connection_new_for_address_sync + (gdbusconnection.c:2585) + ==29535== by 0x804C6CE: test_peer (gdbus-peer.c:803) + + Bug #628331. + + gio/tests/gdbus-peer.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 3df586613916b44cb23edb296f5f468ac6bd80f2 +Author: Christian Persch +Date: Fri Sep 3 16:02:11 2010 -0400 + + Plug a mem leak in the gdbus-peer test + + ==6793== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely + lost in loss record 779 of 1,423 + ==6793== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==6793== by 0x4057094: g_malloc (gmem.c:134) + ==6793== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==6793== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==6793== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==6793== by 0x412372A: g_object_constructor (gobject.c:1482) + ==6793== by 0x4122E1D: g_object_newv (gobject.c:1266) + ==6793== by 0x4122B93: g_object_new (gobject.c:1178) + ==6793== by 0x41DB4F9: g_unix_fd_list_new (gunixfdlist.c:159) + ==6793== by 0x804AADD: test_interface_method_call + (gdbus-peer.c:172) + + Bug #628331. + + gio/tests/gdbus-peer.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit bd2faedefdbbfa0cbe5c0ee2b3e50eed91617990 +Author: Christian Persch +Date: Fri Sep 3 16:01:10 2010 -0400 + + Plug a mem leak in network-address test + + ==4616== 46 (32 direct, 14 indirect) bytes in 1 blocks are definitely + lost in loss record 193 of 305 + ==4616== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==4616== by 0x4057094: g_malloc (gmem.c:134) + ==4616== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==4616== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==4616== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==4616== by 0x412372A: g_object_constructor (gobject.c:1482) + ==4616== by 0x4123147: g_object_newv (gobject.c:1347) + ==4616== by 0x41236BB: g_object_new_valist (gobject.c:1463) + ==4616== by 0x4122BB4: g_object_new (gobject.c:1181) + ==4616== by 0x41B2D0F: g_network_address_new + (gnetworkaddress.c:262) + ==4616== by 0x8048A70: test_basic (network-address.c:10) + + Bug #628331. + + gio/tests/network-address.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit fa6937603c098e8c6e83c8e3bd35ed7bab56ca38 +Author: Christian Persch +Date: Fri Sep 3 16:00:15 2010 -0400 + + Plug a mem leak in contexts test + + ==14059== 96 bytes in 2 blocks are definitely lost in loss record + 520 of 543 + ==14059== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==14059== by 0x4057094: g_malloc (gmem.c:134) + ==14059== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==14059== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==14059== by 0x41385BB: g_type_create_instance (gtype.c:1867) + ==14059== by 0x411E72A: g_object_constructor (gobject.c:1482) + ==14059== by 0x411DE1D: g_object_newv (gobject.c:1266) + ==14059== by 0x411DB93: g_object_new (gobject.c:1178) + ==14059== by 0x42296AF: _g_local_file_input_stream_new + (glocalfileinputstream.c:152) + ==14059== by 0x422281F: g_local_file_read (glocalfile.c:1322) + ==14059== by 0x418A8A9: open_read_async_thread (gfile.c:5050) + ==14059== by 0x41B71BB: run_in_thread (gsimpleasyncresult.c:853) + ==14059== by 0x41A5FBC: io_job_thread (gioscheduler.c:181) + ==14059== by 0x407DCDE: g_thread_pool_thread_proxy + (gthreadpool.c:314) + ==14059== by 0x407C6B0: g_thread_create_proxy (gthread.c:1897) + ==14059== by 0x57D918: start_thread (pthread_create.c:301) + ==14059== by 0x4C6CBD: clone (clone.S:133) + + Bug #628331. + + gio/tests/contexts.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 60349ecc4d41c57d9461355a137316aef224b3c2 +Author: Christian Persch +Date: Fri Sep 3 15:58:51 2010 -0400 + + Plug mem leaks in contexts test + + ==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely + lost in loss record 515 of 547 + ==2464== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2464== by 0x4057094: g_malloc (gmem.c:134) + ==2464== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2464== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2464== by 0x41385BB: g_type_create_instance (gtype.c:1867) + ==2464== by 0x411E72A: g_object_constructor (gobject.c:1482) + ==2464== by 0x411DE1D: g_object_newv (gobject.c:1266) + ==2464== by 0x411DB93: g_object_new (gobject.c:1178) + ==2464== by 0x4220D74: _g_local_file_new (glocalfile.c:310) + ==2464== by 0x422C897: g_local_vfs_get_file_for_path + (glocalvfs.c:84) + ==2464== by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94) + ==2464== by 0x418C1B6: g_file_new_for_path (gfile.c:5898) + ==2464== by 0x8049509: test1_thread (contexts.c:110) + + ==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely + lost in loss record 516 of 547 + ==2464== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2464== by 0x4057094: g_malloc (gmem.c:134) + ==2464== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2464== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2464== by 0x41385BB: g_type_create_instance (gtype.c:1867) + ==2464== by 0x411E72A: g_object_constructor (gobject.c:1482) + ==2464== by 0x411DE1D: g_object_newv (gobject.c:1266) + ==2464== by 0x411DB93: g_object_new (gobject.c:1178) + ==2464== by 0x4220D74: _g_local_file_new (glocalfile.c:310) + ==2464== by 0x422C897: g_local_vfs_get_file_for_path + (glocalvfs.c:84) + ==2464== by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94) + ==2464== by 0x418C1B6: g_file_new_for_path (gfile.c:5898) + ==2464== by 0x804964D: test_context_independence (contexts.c:144) + + Bug #628331. + + gio/tests/contexts.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit e4a6b1dcdc9bbe0b5d06228a662d8f3d0ce50e9c +Author: Christian Persch +Date: Fri Sep 3 15:57:26 2010 -0400 + + Plug a mem leak in buffered-input-stream test + + ==2429== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely + lost in loss record 276 of 355 + ==2429== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2429== by 0x4057094: g_malloc (gmem.c:134) + ==2429== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2429== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2429== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==2429== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==2429== by 0x4175525: g_buffered_input_stream_read_byte + (gbufferedinputstream.c:880) + ==2429== by 0x804A21A: test_read_byte (buffered-input-stream.c:153) + + Bug #628331. + + gio/tests/buffered-input-stream.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 01a19dee6855d3caede22ef8dc28606ee89cf60e +Author: Christian Persch +Date: Fri Sep 3 15:56:23 2010 -0400 + + Plug a mem leak in g-icon test + + ==2428== 256 bytes in 1 blocks are definitely lost in loss record + 591 of 604 + ==2428== at 0x4005CD2: realloc (vg_replace_malloc.c:476) + ==2428== by 0x40571A5: g_realloc (gmem.c:181) + ==2428== by 0x4075287: g_string_maybe_expand (gstring.c:395) + ==2428== by 0x40760D8: g_string_insert_c (gstring.c:1049) + ==2428== by 0x4074D41: g_string_append_c_inline (gstring.h:153) + ==2428== by 0x4075B3C: g_string_append_uri_escaped (gstring.c:822) + ==2428== by 0x41A46AC: g_icon_to_string_tokenized (gicon.c:164) + ==2428== by 0x41A498F: g_icon_to_string (gicon.c:252) + ==2428== by 0x8049E1A: test_g_icon_serialize (g-icon.c:222) + + Bug #628331. + + gio/tests/g-icon.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e8bdd2cb7af29ca20a02f4ebef1c6301e22d1856 +Author: Christian Persch +Date: Fri Sep 3 15:55:10 2010 -0400 + + Plug a huge mem leak in data-output-stream test + + ==12763== 16,777,215 bytes in 1 blocks are possibly lost in loss + record 357 of 357 + ==12763== at 0x4004F1B: calloc (vg_replace_malloc.c:418) + ==12763== by 0x405711D: g_malloc0 (gmem.c:157) + ==12763== by 0x8048ED6: test_basic (data-output-stream.c:40) + + Bug #628331. + + gio/tests/data-output-stream.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 05d6fcf88cee64e168e978800fb66523c36a94fc +Author: Christian Persch +Date: Fri Sep 3 15:53:56 2010 -0400 + + Plug a mem leak in data-output-stream test + + ==2426== 45,034 bytes in 4,094 blocks are definitely lost in loss + record 358 of 361 + ==2426== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2426== by 0x4057094: g_malloc (gmem.c:134) + ==2426== by 0x40573DB: g_malloc_n (gmem.c:281) + ==2426== by 0x4071ABD: g_strconcat (gstrfuncs.c:315) + ==2426== by 0x804916A: test_read_lines (data-output-stream.c:83) + + Bug #628331. + + gio/tests/data-output-stream.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 45331a46408777fc6a888302bad216cedbb16635 +Author: Christian Persch +Date: Fri Sep 3 15:53:05 2010 -0400 + + Plug a mem leak in data-input-stream test + + ==12351== 45,045 bytes in 4,095 blocks are definitely lost in loss + record 377 of 380 + ==12351== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==12351== by 0x4057094: g_malloc (gmem.c:134) + ==12351== by 0x40573DB: g_malloc_n (gmem.c:281) + ==12351== by 0x4071ABD: g_strconcat (gstrfuncs.c:315) + ==12351== by 0x8049811: test_read_lines (data-input-stream.c:99) + + Bug #628331. + + gio/tests/data-input-stream.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 36c7d95c9c18e36468755dc8a7cfced32170c6ca +Author: Christian Persch +Date: Fri Sep 3 15:47:38 2010 -0400 + + Plug a mem leak in data-input-stream test + + ==2415== 45,045 bytes in 4,095 blocks are definitely lost in loss + record 393 of 399 + ==2415== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2415== by 0x4057094: g_malloc (gmem.c:134) + ==2415== by 0x417FC29: g_data_input_stream_read_line + (gdatainputstream.c:797) + ==2415== by 0x8049874: test_read_lines (data-input-stream.c:111) + + ==12088== 360 bytes in 40 blocks are definitely lost in loss record + 368 of 381 + ==12088== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==12088== by 0x4057094: g_malloc (gmem.c:134) + ==12088== by 0x417FF4C: g_data_input_stream_read_until + (gdatainputstream.c:914) + ==12088== by 0x8049B6F: test_read_until (data-input-stream.c:182) + + Bug #628331. + + gio/tests/data-input-stream.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 91e380359604dfabf5c98fab8e317c655d32f98b +Author: Christian Persch +Date: Fri Sep 3 15:45:48 2010 -0400 + + Plug a mem leak in data-input-stream test + + ==2415== 165 (72 direct, 93 indirect) bytes in 3 blocks are definitely + lost in loss record 373 of 399 + ==2415== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2415== by 0x4057094: g_malloc (gmem.c:134) + ==2415== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2415== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2415== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==2415== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==2415== by 0x417ED29: read_data (gdatainputstream.c:309) + ==2415== by 0x417EE9D: g_data_input_stream_read_byte + (gdatainputstream.c:344) + ==2415== by 0x8049DEC: test_data_array (data-input-stream.c:263) + + Bug #628331. + + gio/tests/data-input-stream.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 31b15451cf657499c15c1d08ccee0062a3486a9f +Author: Christian Persch +Date: Fri Sep 3 15:44:28 2010 -0400 + + Plug a mem leak in readwrite test + + ==10395== 80 (24 direct, 56 indirect) bytes in 1 blocks are definitely + lost in loss record 529 of 561 + ==10395== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==10395== by 0x4057094: g_malloc (gmem.c:134) + ==10395== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==10395== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==10395== by 0x403A751: g_error_new_valist (gerror.c:54) + ==10395== by 0x403AAD4: g_set_error (gerror.c:240) + ==10395== by 0x4230328: _g_local_file_output_stream_create + (glocalfileoutputstream.c:628) + ==10395== by 0x4227A04: g_local_file_create_readwrite + (glocalfile.c:1388) + ==10395== by 0x418974C: g_file_create_readwrite (gfile.c:1784) + ==10395== by 0x8049FCD: test_g_file_create_readwrite + (readwrite.c:187) + + Bug #628331. + + gio/tests/readwrite.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 94102a40f733dc86e61aaaee0822b8ecc2e9927b +Author: Christian Persch +Date: Fri Sep 3 15:43:03 2010 -0400 + + Plug some huge mem leaks in converter-stream test + + ==8564== 24,000,000 bytes in 6 blocks are possibly lost in loss + record 592 of 594 + ==8564== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==8564== by 0x4057094: g_malloc (gmem.c:134) + ==8564== by 0x804AA37: test_corruption (converter-stream.c:589) + ==8564== by 0x804B05B: test_roundtrip (converter-stream.c:652) + + ==9459== 25,165,824 bytes in 6 blocks are possibly lost in loss + record 593 of 594 + ==9459== at 0x4005CD2: realloc (vg_replace_malloc.c:476) + ==9459== by 0x40571A5: g_realloc (gmem.c:181) + ==9459== by 0x41B08A3: array_resize (gmemoryoutputstream.c:501) + ==9459== by 0x41B0A5D: g_memory_output_stream_write + (gmemoryoutputstream.c:578) + ==9459== by 0x41B57EF: g_output_stream_write (goutputstream.c:216) + ==9459== by 0x41B591B: g_output_stream_write_all + (goutputstream.c:268) + ==9459== by 0x417D617: flush_buffer (gconverteroutputstream.c:359) + ==9459== by 0x417D958: g_converter_output_stream_write + (gconverteroutputstream.c:502) + ==9459== by 0x41B5D7F: g_output_stream_real_splice + (goutputstream.c:428) + ==9459== by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380) + ==9459== by 0x804AB10: test_corruption (converter-stream.c:600) + + ==9785== 25,165,824 bytes in 6 blocks are possibly lost in loss + record 592 of 592 + ==9785== at 0x4005CD2: realloc (vg_replace_malloc.c:476) + ==9785== by 0x40571A5: g_realloc (gmem.c:181) + ==9785== by 0x41B08A3: array_resize (gmemoryoutputstream.c:501) + ==9785== by 0x41B0A5D: g_memory_output_stream_write + (gmemoryoutputstream.c:578) + ==9785== by 0x41B5D7F: g_output_stream_real_splice + (goutputstream.c:428) + ==9785== by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380) + ==9785== by 0x804ADF1: test_corruption (converter-stream.c:622) + ==9785== by 0x804B06C: test_roundtrip (converter-stream.c:652) + + Bug #628331. + + gio/tests/converter-stream.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit 24bee1a130152dece7f7ae470b81bd6ed69a9a4f +Author: Christian Persch +Date: Fri Sep 3 15:40:55 2010 -0400 + + Plug a mem leak in convert-stream test + + ==7540== 487 (64 direct, 423 indirect) bytes in 2 blocks are + definitely lost in loss record 597 of 615 + ==7540== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==7540== by 0x4057094: g_malloc (gmem.c:134) + ==7540== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==7540== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==7540== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==7540== by 0x412372A: g_object_constructor (gobject.c:1482) + ==7540== by 0x4123147: g_object_newv (gobject.c:1347) + ==7540== by 0x41236BB: g_object_new_valist (gobject.c:1463) + ==7540== by 0x41A756E: g_initable_new_valist (ginitable.c:214) + ==7540== by 0x41A743E: g_initable_new (ginitable.c:138) + ==7540== by 0x417B67A: g_charset_converter_new + (gcharsetconverter.c:215) + ==7540== by 0x804B043: test_charset (converter-stream.c:675) + + Bug #628331. + + gio/tests/converter-stream.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit ac8600a14b7e79c6eb19dd779be3b2c8a492d934 +Author: Christian Persch +Date: Fri Sep 3 15:39:58 2010 -0400 + + Plug a mem leak in converter-stream test + + ==2396== 168 (92 direct, 76 indirect) bytes in 1 blocks are definitely + lost in loss record 598 of 625 + ==2396== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2396== by 0x4057094: g_malloc (gmem.c:134) + ==2396== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2396== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2396== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==2396== by 0x412372A: g_object_constructor (gobject.c:1482) + ==2396== by 0x4123147: g_object_newv (gobject.c:1347) + ==2396== by 0x41236BB: g_object_new_valist (gobject.c:1463) + ==2396== by 0x4122BB4: g_object_new (gobject.c:1181) + ==2396== by 0x417C54D: g_converter_input_stream_new + (gconverterinputstream.c:204) + ==2396== by 0x804A53E: test_compressor (converter-stream.c:484) + + Bug #628331. + + gio/tests/converter-stream.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 85179745ac72280746da101a5232f7843f2426d3 +Author: Christian Persch +Date: Fri Sep 3 15:39:07 2010 -0400 + + Plug a mem leak in converter-stream test + + ==2396== 66 (24 direct, 42 indirect) bytes in 1 blocks are definitely + lost in loss record 565 of 625 + ==2396== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2396== by 0x4057094: g_malloc (gmem.c:134) + ==2396== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2396== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2396== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==2396== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==2396== by 0x417BA38: g_charset_converter_convert + (gcharsetconverter.c:344) + ==2396== by 0x417BF67: g_converter_convert (gconverter.c:174) + ==2396== by 0x417C9EB: g_converter_input_stream_read + (gconverterinputstream.c:403) + ==2396== by 0x41A7A17: g_input_stream_read (ginputstream.c:204) + ==2396== by 0x41A7B43: g_input_stream_read_all (ginputstream.c:256) + ==2396== by 0x804B0E4: test_charset (converter-stream.c:682) + + Bug #628331. + + gio/tests/converter-stream.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 7ec414229b8d42a5ce4f5519d18af59a3098f544 +Author: Christian Persch +Date: Fri Sep 3 15:37:56 2010 -0400 + + Plug a mem leak in converter-stream test + + ==2396== 39 (24 direct, 15 indirect) bytes in 1 blocks are definitely + lost in loss record 398 of 625 + ==2396== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2396== by 0x4057094: g_malloc (gmem.c:134) + ==2396== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2396== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2396== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==2396== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==2396== by 0x80498F7: g_compressor_converter_convert + (converter-stream.c:244) + ==2396== by 0x417BF67: g_converter_convert (gconverter.c:174) + ==2396== by 0x417CBDE: g_converter_input_stream_read + (gconverterinputstream.c:460) + ==2396== by 0x41A7A17: g_input_stream_read (ginputstream.c:204) + ==2396== by 0x804A832: test_compressor (converter-stream.c:545) + + Bug #628331. + + gio/tests/converter-stream.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit d5d277dccf3637518b3a34af1609ffd60ce1e308 +Author: Christian Persch +Date: Fri Sep 3 15:37:08 2010 -0400 + + Plug a mem leak in g-file-info test + + ==2395== 64 bytes in 1 blocks are definitely lost in loss record + 381 of 407 + ==2395== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2395== by 0x4005C66: realloc (vg_replace_malloc.c:476) + ==2395== by 0x40571A5: g_realloc (gmem.c:181) + ==2395== by 0x401D670: g_ptr_array_maybe_expand (garray.c:968) + ==2395== by 0x401DD0B: g_ptr_array_add (garray.c:1225) + ==2395== by 0x4199AA9: g_file_info_list_attributes + (gfileinfo.c:646) + ==2395== by 0x80491CE: test_g_file_info (g-file-info.c:76) + + ==2395== 132 (64 direct, 68 indirect) bytes in 1 blocks are definitely + lost in loss record 396 of 407 + ==2395== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2395== by 0x4005C66: realloc (vg_replace_malloc.c:476) + ==2395== by 0x40571A5: g_realloc (gmem.c:181) + ==2395== by 0x401D670: g_ptr_array_maybe_expand (garray.c:968) + ==2395== by 0x401DD0B: g_ptr_array_add (garray.c:1225) + ==2395== by 0x4199A82: g_file_info_list_attributes + (gfileinfo.c:642) + ==2395== by 0x80492B7: test_g_file_info (g-file-info.c:86) + + Bug #628331. + + gio/tests/g-file-info.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 35e101fa0a96fb03db4f503a4b24f4818ada114f +Author: Christian Persch +Date: Fri Sep 3 15:35:44 2010 -0400 + + Plug a mem leak in the readwrite test + + And use g_assert_[no_]error(). + + ==2392== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely + lost in loss record 451 of 573 + ==2392== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2392== by 0x4057094: g_malloc (gmem.c:134) + ==2392== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2392== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2392== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==2392== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==2392== by 0x41B7619: g_output_stream_set_pending + (goutputstream.c:1198) + ==2392== by 0x41B5799: g_output_stream_write (goutputstream.c:210) + ==2392== by 0x41B590B: g_output_stream_write_all + (goutputstream.c:268) + ==2392== by 0x8049B54: verify_iostream (readwrite.c:110) + + Bug #628331. + + gio/tests/readwrite.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +commit 93d85ade571b87d1c71ac6ef3fb5e40eaceb68d7 +Author: Christian Persch +Date: Fri Sep 3 15:34:12 2010 -0400 + + Plug a mem leak in the readwrite test + + ==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely + lost in loss record 369 of 573 + ==2392== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2392== by 0x4057094: g_malloc (gmem.c:134) + ==2392== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2392== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2392== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==2392== by 0x412372A: g_object_constructor (gobject.c:1482) + ==2392== by 0x4122E1D: g_object_newv (gobject.c:1266) + ==2392== by 0x4122B93: g_object_new (gobject.c:1178) + ==2392== by 0x4225D74: _g_local_file_new (glocalfile.c:310) + ==2392== by 0x4231897: g_local_vfs_get_file_for_path + (glocalvfs.c:84) + ==2392== by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94) + ==2392== by 0x41911B6: g_file_new_for_path (gfile.c:5898) + ==2392== by 0x804A2B9: test_g_file_replace_readwrite + (readwrite.c:235) + + Bug #628331. + + gio/tests/readwrite.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 9fba7a43be2481d59ae887f23d831947f27537d3 +Author: Christian Persch +Date: Fri Sep 3 15:33:28 2010 -0400 + + Plug a mem leak in the readwrite test + + ==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely + lost in loss record 368 of 573 + ==2392== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2392== by 0x4057094: g_malloc (gmem.c:134) + ==2392== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2392== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2392== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==2392== by 0x412372A: g_object_constructor (gobject.c:1482) + ==2392== by 0x4122E1D: g_object_newv (gobject.c:1266) + ==2392== by 0x4122B93: g_object_new (gobject.c:1178) + ==2392== by 0x4225D74: _g_local_file_new (glocalfile.c:310) + ==2392== by 0x4231897: g_local_vfs_get_file_for_path + (glocalvfs.c:84) + ==2392== by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94) + ==2392== by 0x41911B6: g_file_new_for_path (gfile.c:5898) + ==2392== by 0x8049F23: test_g_file_create_readwrite + (readwrite.c:183) + + Bug #628331. + + gio/tests/readwrite.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e481bf8bf68f46e82fa5624cd941f7880321e945 +Author: Christian Persch +Date: Fri Sep 3 15:32:32 2010 -0400 + + Plug a mem leak in the readwrite test + + ==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely + lost in loss record 367 of 573 + ==2392== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2392== by 0x4057094: g_malloc (gmem.c:134) + ==2392== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2392== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2392== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==2392== by 0x412372A: g_object_constructor (gobject.c:1482) + ==2392== by 0x4122E1D: g_object_newv (gobject.c:1266) + ==2392== by 0x4122B93: g_object_new (gobject.c:1178) + ==2392== by 0x4225D74: _g_local_file_new (glocalfile.c:310) + ==2392== by 0x4231897: g_local_vfs_get_file_for_path + (glocalvfs.c:84) + ==2392== by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94) + ==2392== by 0x41911B6: g_file_new_for_path (gfile.c:5898) + ==2392== by 0x8049E30: test_g_file_open_readwrite (readwrite.c:153) + + Bug #628331. + + gio/tests/readwrite.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 689b054b6e176c2f1b4bb90ca2a0e514de5e2a0e +Author: Christian Persch +Date: Fri Sep 3 15:31:37 2010 -0400 + + Plug a mem leak in the memory-input-stream test + + ==2389== 84 (44 direct, 40 indirect) bytes in 1 blocks are definitely + lost in loss record 299 of 315 + ==2389== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2389== by 0x4057094: g_malloc (gmem.c:134) + ==2389== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2389== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2389== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==2389== by 0x412372A: g_object_constructor (gobject.c:1482) + ==2389== by 0x4122E1D: g_object_newv (gobject.c:1266) + ==2389== by 0x4122B93: g_object_new (gobject.c:1178) + ==2389== by 0x41AF54C: g_memory_input_stream_new + (gmemoryinputstream.c:199) + ==2389== by 0x8048BD1: test_read_chunks (memory-input-stream.c:40) + + Bug #628331. + + gio/tests/memory-input-stream.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 53ae72b926e34b22f36fbc162cd12fc4d0bd7028 +Author: Christian Persch +Date: Fri Sep 3 15:30:47 2010 -0400 + + Plug a mem leak in the memory-input-stream test + + ==2389== 59 (24 direct, 35 indirect) bytes in 1 blocks are definitely + lost in loss record 290 of 315 + ==2389== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2389== by 0x4057094: g_malloc (gmem.c:134) + ==2389== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==2389== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==2389== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==2389== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==2389== by 0x41AFD15: g_memory_input_stream_truncate + (gmemoryinputstream.c:517) + ==2389== by 0x41BAC0F: g_seekable_truncate (gseekable.c:174) + ==2389== by 0x8049595: test_truncate (memory-input-stream.c:123) + + Bug #628331. + + gio/tests/memory-input-stream.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 6320b04fe97bcdb16e6ca4235db6c85eb91d2bab +Author: Christian Persch +Date: Fri Sep 3 15:29:51 2010 -0400 + + Plug a mem leak in gsettings test + + ==2530== 13 bytes in 1 blocks are definitely lost in loss record + 373 of 681 + ==2530== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==2530== by 0x4057094: g_malloc (gmem.c:134) + ==2530== by 0x40573DB: g_malloc_n (gmem.c:281) + ==2530== by 0x40717FC: g_strdup (gstrfuncs.c:101) + ==2530== by 0x4147F56: value_lcopy_string (gvaluetypes.c:313) + ==2530== by 0x4123F0B: g_object_get_valist (gobject.c:1643) + ==2530== by 0x41240FF: g_object_get (gobject.c:1731) + ==2530== by 0x804A4BA: test_basic (gsettings.c:28) + + Bug #628331. + + gio/tests/gsettings.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e8fc3ba3d0dbb4e8d0592fddcbdc189c9d20056a +Author: Christian Persch +Date: Tue Aug 31 19:42:32 2010 +0200 + + Plug a mem leak + + Don't leak the ptr arrays in the + map_sender_unique_name_to_signal_data_array + hash table. + + ==23440== 84 (20 direct, 64 indirect) bytes in 1 blocks are definitely + lost in loss record 920 of 993 + ==23440== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==23440== by 0x4057094: g_malloc (gmem.c:134) + ==23440== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==23440== by 0x401D2D0: g_ptr_array_sized_new (garray.c:799) + ==23440== by 0x401D2AC: g_ptr_array_new (garray.c:783) + ==23440== by 0x420834A: g_dbus_connection_signal_subscribe + (gdbusconnection.c:3084) + + Bug #628436. + + gio/gdbusconnection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 8795f52aae10add70929cd0fad1ccf6d0c8db4af +Author: Christian Persch +Date: Mon Aug 30 19:31:09 2010 +0200 + + Plug a mem leak + + ==31063== 98 (24 direct, 74 indirect) bytes in 1 blocks are definitely + lost in loss record 946 of 1,136 + ==31063== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==31063== by 0x4057094: g_malloc (gmem.c:134) + ==31063== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==31063== by 0x4092383: g_variant_get_child_value + (gvariant-core.c:847) + ==31063== by 0x408BE9E: g_variant_get_variant (gvariant.c:709) + ==31063== by 0x40903F5: g_variant_valist_get_nnp (gvariant.c:3767) + ==31063== by 0x40907A9: g_variant_valist_get_leaf (gvariant.c:3884) + ==31063== by 0x4090D10: g_variant_valist_get (gvariant.c:4065) + ==31063== by 0x4090E59: g_variant_valist_get (gvariant.c:4100) + ==31063== by 0x40911B6: g_variant_get_va (gvariant.c:4296) + ==31063== by 0x40910BC: g_variant_get (gvariant.c:4248) + ==31063== by 0x4208DAF: invoke_set_property_in_idle_cb + (gdbusconnection.c:3676) + + Bug #628346. + + gio/gdbusconnection.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 1f49f3fa349a49bf17f6cb58d060173b7a448bf5 +Author: Christian Persch +Date: Mon Aug 30 19:00:05 2010 +0200 + + Plug a mem leak + + ... and use g_error_matches(). + + ==29535== 1,360 (408 direct, 952 indirect) bytes in 17 blocks are + definitely lost in loss record 1,252 of 1,264 + ==29535== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==29535== by 0x4057094: g_malloc (gmem.c:134) + ==29535== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==29535== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==29535== by 0x403A751: g_error_new_valist (gerror.c:54) + ==29535== by 0x403AAD4: g_set_error (gerror.c:240) + ==29535== by 0x41C06C8: g_socket_send_message (gsocket.c:2967) + ==29535== by 0x421CB64: write_message_continue_writing + (gdbusprivate.c:958) + ==29535== by 0x421CE2A: write_message_async (gdbusprivate.c:1049) + ==29535== by 0x421D4DD: maybe_write_next_message + (gdbusprivate.c:1291) + ==29535== by 0x421D26B: message_written (gdbusprivate.c:1187) + ==29535== by 0x421D322: write_message_cb (gdbusprivate.c:1216) + + Bug #628345. + + gio/gdbusprivate.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit c75429d0a0564c3620c6f72afea9838f661c4e88 +Author: Matthias Clasen +Date: Fri Sep 3 14:52:16 2010 -0400 + + Make ordering for overridden interface properties consistent + + g_object_class_list_properties tries to sort the returned list of + paramspecs by 'type depth' and param_id. But all the overridden + interface properties have a param_id of 0, so they come out in + a random order. + + Bug 628253. + + gobject/gparam.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 6ddef375c8eb41da3160ac6984f707a19f1da63b +Author: Tor Lillqvist +Date: Thu Sep 2 21:56:02 2010 +0300 + + Recuce DLL hijack risk on Windows + + Don't call LoadLibrary() on shell32.dll or kernel32.dll. kernel32.dll + is always loaded. Shell32.dll is also already loaded as glib links to + functions in it. So just call GetModuleHandle() on them. + + For mlang.dll in win_iconv.c and winhttp.dll in gwinhttpvfs.c, always + try loading them from a complete path, from the Windows system + directory. + + Use the "tool help" API to enumerate modules in gmodule-win32.c. It is + present in all Windows versions since Windows 2000, which is all we + support anyway. Thus no need to look that API up dynamically. Just + link to it normally. We can bin the fallback code that attempts to use + the psapi API. + + gio/win32/gwinhttpvfs.c | 15 +++++++- + glib/gutils.c | 6 ++- + glib/win_iconv.c | 14 +++++++- + gmodule/gmodule-win32.c | 82 + ++-------------------------------------------- + 4 files changed, 33 insertions(+), 84 deletions(-) + +commit 54c51c73c60008868f6718a23b4b00a5db61c167 +Author: Kjartan Maraas +Date: Thu Sep 2 11:56:09 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 708 + +++++++++++++++++++++++++++++++++++++++++++++----------------- + 1 files changed, 515 insertions(+), 193 deletions(-) + +commit b4d3acf9be3aeaf60326e44b0ad706c45e68f590 +Author: noch +Date: Thu Sep 2 12:35:02 2010 +0500 + + Modified Armenian translation - po file + + po/hy.po | 1139 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 576 insertions(+), 563 deletions(-) + +commit db0eaa299c66d82552645fa42f20d13a791bc53c +Author: Christian Persch +Date: Wed Sep 1 15:05:59 2010 +0200 + + Fix building with zlib < 1.2.4 on win32 + + The gzip header processing functions were only exported + since 1.2.4 on win32, so #ifdef this code accordingly. + + Bug #628505. + + gio/gzlibcompressor.c | 3 +++ + gio/gzlibdecompressor.c | 5 +++++ + 2 files changed, 8 insertions(+), 0 deletions(-) + +commit ed72dcdd4507865780ebc14567bf582721a6bce4 +Author: Ryan Lortie +Date: Wed Sep 1 15:04:41 2010 +0200 + + Fix small bug in registry backend + + 'n' and 'q' types had their signed/unsigned meaning inverted. + + gio/gregistrysettingsbackend.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 3209024c3ba730df9551074819672756477bd5aa +Author: Sam Thursfield +Date: Thu Aug 12 16:10:23 2010 +0100 + + Add GSettings Windows Registry backend + + gio/Makefile.am | 7 +- + gio/giomodule.c | 4 + + gio/gregistrysettingsbackend.c | 1966 + ++++++++++++++++++++++++++++++++++++++++ + gio/gregistrysettingsbackend.h | 31 + + 4 files changed, 2007 insertions(+), 1 deletions(-) + +commit fb15dde6c171acb445da5e51ce17e241bf9c52fb +Author: Jon Nordby +Date: Thu Aug 26 16:51:33 2010 +0200 + + docs: Inline docs from tmpl/memory.smgl + + docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/memory.sgml | 428 + ---------------------------------- + glib/galloca.h | 47 ++++ + glib/gmem.c | 201 ++++++++++++++++- + glib/gmem.h | 106 +++++++++ + glib/gstrfuncs.c | 11 + + 6 files changed, 365 insertions(+), 429 deletions(-) + +commit 4497e84215e37f1d7dc55432ab50825652f9fe80 +Author: Andika Triwidada +Date: Wed Sep 1 09:54:52 2010 +0700 + + Updated Indonesian translation + + po/id.po | 2301 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 1479 insertions(+), 822 deletions(-) + +commit 94e34d8a12e94c6aa2d2fcc8440439de5671f6f2 +Author: noch +Date: Tue Aug 31 16:49:31 2010 +0500 + + Modified hy.po + + po/hy.po | 1776 + +++++++++++++++++++++++++++++++++++++------------------------- + 1 files changed, 1061 insertions(+), 715 deletions(-) + +commit b10d3a73bc39763ed528baaf93b1143157115690 +Author: noch +Date: Tue Aug 31 12:34:36 2010 +0500 + + Modified hy.po + + po/hy.po | 971 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 470 insertions(+), 501 deletions(-) + +commit e57884041bf17d851915994370f480f554b49c6a +Author: Matthias Clasen +Date: Mon Aug 30 20:47:40 2010 -0400 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 31a72dd719940ca5b97da9eb36ce5467458ed7f5 +Author: Matthias Clasen +Date: Mon Aug 30 19:29:09 2010 -0400 + + Update symbol list + + gio/gio.symbols | 14 ++++++++++---- + 1 files changed, 10 insertions(+), 4 deletions(-) + +commit ee2c6f4554661ed449dda0076bc4d7627ed05e80 +Author: Branko Kokanović +Date: Tue Aug 31 02:33:26 2010 +0200 + + Updated Serbian translation + + po/sr.po | 125 + ++++++++++++++++++++++++++------------------------------ + po/sr@latin.po | 125 + ++++++++++++++++++++++++++------------------------------ + 2 files changed, 116 insertions(+), 134 deletions(-) + +commit 1d2229129cd5a6ac09cd94b5f9751a8f32d81e05 +Author: Philip Withnall +Date: Mon Aug 30 22:13:18 2010 +0100 + + Update British English translation + + po/en_GB.po | 35 ++++++++++++++++++----------------- + 1 files changed, 18 insertions(+), 17 deletions(-) + +commit 6f327315dcd617f93a59ba235f48f9125a0ee593 +Author: Matthias Clasen +Date: Mon Aug 30 16:08:25 2010 -0400 + + Add one more bug ref + + NEWS | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit f4f45e980ba222f749e533b445d88996ed66ebe0 +Author: David Zeuthen +Date: Mon Aug 30 13:58:41 2010 -0400 + + GDBusProxy: remove superfluous -gdbus-proxy-method-name qdata + + Looks like we're not using this anymore. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +commit 52348e15874869cb02052253847358361f10ec7f +Author: David Zeuthen +Date: Mon Aug 30 13:45:46 2010 -0400 + + Bug 628324 – Invalid reads in gdbus-export test + + Looks like we forgot to ref the returned GVariant in + g_dbus_proxy_call_finish(). + + It's a good question why code using g_dbus_proxy_call() and + g_dbus_proxy_call_finish() worked in the first place - probably the + answer is that no-one really used these APIs. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 72ea8b1df744ef8a11e67d1b7df121849c0298fb +Author: Matthias Clasen +Date: Mon Aug 30 13:28:06 2010 -0400 + + Tweak the wording + + NEWS | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 846b0b34660279871bbafb476adf5b5c597eb08d +Author: Ryan Lortie +Date: Mon Aug 30 18:58:49 2010 +0200 + + GAction is now an interface + + the new class GSimpleAction is the implementation half + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 40 ++- + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gaction.c | 416 +++++------------------------ + gio/gaction.h | 69 ++---- + gio/gactiongroup.c | 2 +- + gio/gio.h | 1 + + gio/giotypes.h | 1 + + gio/gsimpleaction.c | 498 + +++++++++++++++++++++++++++++++++++ + gio/gsimpleaction.h | 95 +++++++ + gio/tests/actions.c | 83 +++--- + 12 files changed, 754 insertions(+), 455 deletions(-) + +commit 6cd62920bbb8ed42c7381bb56deca820515500f9 +Author: Ryan Lortie +Date: Mon Aug 30 17:31:06 2010 +0200 + + GActionGroup is now an interface + + - make GAction.get_state() return a reference + - fix some leaks/warnings in the tests + - fix signal propagation in GSimpleActionGroup + + gio/gaction.c | 9 +++-- + gio/gactiongroup.c | 46 +++++++++++++---------- + gio/gactiongroup.h | 43 ++++------------------ + gio/gsimpleactiongroup.c | 89 + +++++++++++++++++---------------------------- + gio/gsimpleactiongroup.h | 8 +--- + gio/tests/actions.c | 21 +++++++---- + 6 files changed, 90 insertions(+), 126 deletions(-) + +commit 75891001bc5ed5a99c9a9af17407b0a797f79df4 +Author: Matthias Clasen +Date: Mon Aug 30 13:11:52 2010 -0400 + + Update NEWS for 2.25.15 + + NEWS | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit 949392585402916d86920c652d182e92ad109a6d +Author: Christian Persch +Date: Mon Aug 30 16:12:42 2010 +0200 + + Make g_emblemed_icon_add_emblem() keep the list sorted + + Fixes bug #628317. + + gio/gemblemedicon.c | 37 +++++++++++++++++-------------------- + 1 files changed, 17 insertions(+), 20 deletions(-) + +commit 7a6f8bd3c34e5f5e20f6770d54406b7abc5a396d +Author: Christian Persch +Date: Mon Aug 30 15:53:49 2010 +0200 + + Don't leak the FD list + + ==6793== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely + lost in loss record 780 of 1,423 + ==6793== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==6793== by 0x4057094: g_malloc (gmem.c:134) + ==6793== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==6793== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==6793== by 0x413D5BB: g_type_create_instance (gtype.c:1867) + ==6793== by 0x412372A: g_object_constructor (gobject.c:1482) + ==6793== by 0x4122E1D: g_object_newv (gobject.c:1266) + ==6793== by 0x4122B93: g_object_new (gobject.c:1178) + ==6793== by 0x41DB582: g_unix_fd_list_new_from_array + (gunixfdlist.c:191) + ==6793== by 0x421BFD6: _g_dbus_worker_do_read_cb + (gdbusprivate.c:590) + + Bug #628329. + + gio/gdbusprivate.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit fa671dc5e28369c50aaef525c6980803a9946471 +Author: Christian Persch +Date: Mon Aug 30 10:21:43 2010 -0400 + + Fix invalid reads + + Don't use a guint16* when getting a guint property via g_object_get()! + + Bug #628323. + + gio/gproxyaddressenumerator.c | 5 ++++- + gio/tests/network-address.c | 2 +- + 2 files changed, 5 insertions(+), 2 deletions(-) + +commit 08924ad1472a17cd6c144ae25a350af0b2d9afe7 +Author: Christian Persch +Date: Mon Aug 30 10:18:30 2010 -0400 + + Plug a mem leak in GConverterOutputStream + + ==8221== 1,047 (672 direct, 375 indirect) bytes in 28 blocks are + definitely lost in loss record 589 of 603 + ==8221== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==8221== by 0x4057094: g_malloc (gmem.c:134) + ==8221== by 0x406F2D6: g_slice_alloc (gslice.c:836) + ==8221== by 0x406F31B: g_slice_alloc0 (gslice.c:848) + ==8221== by 0x403A8A6: g_error_new_literal (gerror.c:117) + ==8221== by 0x403AC31: g_set_error_literal (gerror.c:314) + ==8221== by 0x80499DC: g_compressor_converter_convert + (converter-stream.c:267) + ==8221== by 0x417BF67: g_converter_convert (gconverter.c:174) + ==8221== by 0x417D7F0: g_converter_output_stream_write + (gconverteroutputstream.c:428) + ==8221== by 0x41B57DF: g_output_stream_write (goutputstream.c:216) + ==8221== by 0x804A367: test_compressor (converter-stream.c:456) + + Bug #628309. + + gio/gconverteroutputstream.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 802c25832cb34976308a8a2b356ad3273108761f +Author: Christian Persch +Date: Mon Aug 30 10:16:31 2010 -0400 + + Plug a mem leak + + ==6793== 19 (8 direct, 11 indirect) bytes in 1 blocks are definitely + lost in loss record 640 of 1,423 + ==6793== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==6793== by 0x4057094: g_malloc (gmem.c:134) + ==6793== by 0x40573DB: g_malloc_n (gmem.c:281) + ==6793== by 0x4073D1B: g_strsplit (gstrfuncs.c:2436) + ==6793== by 0x4224A89: initable_init (gdbusserver.c:1040) + ==6793== by 0x41A73F9: g_initable_init (ginitable.c:105) + ==6793== by 0x41A759B: g_initable_new_valist (ginitable.c:218) + ==6793== by 0x41A743E: g_initable_new (ginitable.c:138) + ==6793== by 0x42238F5: g_dbus_server_new_sync (gdbusserver.c:484) + + Bug #628328. + + gio/gdbusserver.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 6879256f360ed46c2238b273a239f99d08a62915 +Author: Christian Persch +Date: Mon Aug 30 10:14:39 2010 -0400 + + Plug a mem leak + + ==6793== 16 bytes in 1 blocks are definitely lost in loss record + 632 of 1,423 + ==6793== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==6793== by 0x4057094: g_malloc (gmem.c:134) + ==6793== by 0x417FC29: g_data_input_stream_read_line + (gdatainputstream.c:797) + ==6793== by 0x41F99C1: _my_g_data_input_stream_read_line + (gdbusauth.c:279) + ==6793== by 0x41FA728: _g_dbus_auth_run_client (gdbusauth.c:759) + + Bug #628327. + + gio/gdbusauth.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit bb221b68df5de89fce4cb70b789df6173d9c2c92 +Author: Matthias Clasen +Date: Mon Aug 30 10:02:32 2010 -0400 + + Add an annotation + + gio/gdbusmessage.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a3cc274fc681f5266b621f730d3d8eef811e41cf +Author: Dan Winship +Date: Mon Aug 30 09:23:09 2010 -0400 + + GSocketClient: fix a crash on cancellation + + some code rearrangement when adding proxy support resulted in + trying to + use a GSocket that wasn't there. + + https://bugzilla.gnome.org/show_bug.cgi?id=628296 + + gio/gsocketclient.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit b8ff287167f668d0c10c2b98c13661042633163e +Author: Matthias Clasen +Date: Mon Aug 30 08:58:31 2010 -0400 + + Disable the 'extra data' test for now + + gio/tests/gdbus-introspection.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit b4a61235da4e604eca92d3f38a391a1e76a63d1c +Author: Matthias Clasen +Date: Mon Aug 30 08:50:09 2010 -0400 + + Introspection: make 'direction' default to 'in' for methods + + gio/gdbusintrospection.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit c3135d1d39cbbbb1947843d3937984887764137e +Author: Matthias Clasen +Date: Mon Aug 30 08:49:41 2010 -0400 + + Add some more gdbus introspection tests (currently failing) + + gio/tests/gdbus-introspection.c | 90 + ++++++++++++++++++++++++++++++++++++-- + 1 files changed, 85 insertions(+), 5 deletions(-) + +commit 1ce14a88d6b2ff7007163bef929c88daed0183e5 +Author: Branko Kokanović +Date: Sun Aug 29 19:07:46 2010 +0200 + + Updated Serbian translation + + po/sr.po | 801 + +++++++++++++++++++++++++++++++++++++++----------------- + po/sr@latin.po | 801 + +++++++++++++++++++++++++++++++++++++++----------------- + 2 files changed, 1118 insertions(+), 484 deletions(-) + +commit 0e93b0f5c0dfb0bd3a828c5c8a7295c4085598f5 +Author: Yaron Shahrabani +Date: Sun Aug 29 15:57:41 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 30 +++++++++++++++--------------- + 1 files changed, 15 insertions(+), 15 deletions(-) + +commit b09a01c6264c08abc2e5eda54fe30d56f06802dd +Author: Jorge González +Date: Sun Aug 29 11:33:56 2010 +0200 + + Updated Spanish translation + + po/es.po | 26 +++++++++++++++++--------- + 1 files changed, 17 insertions(+), 9 deletions(-) + +commit 2286d1d669ac3bcef1faa709290831df9197ba02 +Author: A S Alam +Date: Sun Aug 29 09:32:03 2010 +0530 + + update translation for Punjabi + + po/pa.po | 360 + ++++++++++++++++++++++++++++++++++++++++++++++++++------------ + 1 files changed, 291 insertions(+), 69 deletions(-) + +commit 849dbc12056b72f4284bcb6e4b466ec3fcea13f4 +Author: Fran Diéguez +Date: Sun Aug 29 04:19:12 2010 +0200 + + Added Galician help translations + + po/gl.po | 18 +++++++++--------- + 1 files changed, 9 insertions(+), 9 deletions(-) + +commit 1399913f31b60ffebb84e08d8901e82aab2bb075 +Author: Philip Withnall +Date: Sat Aug 28 12:18:37 2010 +0100 + + Change "type-string" to "type string" in translatable strings + + Helps: bgo#628193 + + gio/gdbusmessage.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit ea9f5f025188731f4347f5be1248e84dc3710c7b +Author: Philip Withnall +Date: Sat Aug 28 12:17:45 2010 +0100 + + Change "lock-file" to "lock file" in translatable strings + + Helps: bgo#628193 + + gio/gdbusauthmechanismsha1.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit 61e53e0d196d12d7ea612794ce2ff3550927f9d0 +Author: Philip Withnall +Date: Sat Aug 28 11:54:01 2010 +0100 + + Update British English translation + + po/en_GB.po | 2289 + ++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 1493 insertions(+), 796 deletions(-) + +commit 62788fdf66f321edb15671cb895aa9072df38149 +Author: Jorge González +Date: Sat Aug 28 10:08:04 2010 +0200 + + Updated Spanish translation + + po/es.po | 287 + +++++++++++++++++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 249 insertions(+), 38 deletions(-) + +commit 5a76228e458ccd9846f7dbe2ad35f9e874a07be4 +Author: Yaron Shahrabani +Date: Sat Aug 28 10:46:19 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 230 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 files changed, 223 insertions(+), 7 deletions(-) + +commit e0aa877e64b5d2de27c9d6c00119a33b735f5b58 +Author: Fran Diéguez +Date: Fri Aug 27 23:15:49 2010 +0200 + + Update Galician translations + + po/gl.po | 279 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 files changed, 248 insertions(+), 31 deletions(-) + +commit 52a41b81bd6770434a62aa4a4b7bef100e27da44 +Author: Claude Paroz +Date: Fri Aug 27 20:04:38 2010 +0200 + + Added missing files in POTFILES.in + + po/POTFILES.in | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 1e7243ad7b48d833ef6eec8fa305f25487f640b0 +Author: David Zeuthen +Date: Fri Aug 27 10:50:03 2010 -0400 + + Bug 628084 – gdbus-peer fails with assertion + + Make it work on systems where /etc/hosts is bigger than 1024 bytes. + + https://bugzilla.gnome.org/show_bug.cgi?id=628084 + + Signed-off-by: David Zeuthen + + gio/tests/gdbus-peer.c | 67 + +++++++++++++++++++++++++++++++++++++++++++----- + 1 files changed, 60 insertions(+), 7 deletions(-) + +commit 95107e0ab69fdcc9e7f27832dd492582c4e3fb3e +Author: Yaron Shahrabani +Date: Fri Aug 27 14:53:57 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 72 + ++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 35 insertions(+), 37 deletions(-) + +commit db7ddcc19529a101b820347e8cca419fb37f6a02 +Author: Jens Georg +Date: Wed Aug 25 00:18:23 2010 +0300 + + Improve parsing of date-only iso8601 strings + + glib/gtimer.c | 15 +++++++++++++-- + tests/testglib.c | 4 ++++ + 2 files changed, 17 insertions(+), 2 deletions(-) + +commit 9a61fb2c640708070a32c18bd06ae94ee71c925f +Author: Emmanuele Bassi +Date: Thu Aug 26 12:58:19 2010 +0100 + + datetime: Re-use add_dmy() + + Avoid code duplication. + + glib/gdatetime.c | 55 + +++++------------------------------------------ + glib/tests/gdatetime.c | 5 +++- + 2 files changed, 10 insertions(+), 50 deletions(-) + +commit 3c86a77ae5efa57a6f62c2eeec9c67aa66246496 +Author: Tor Lillqvist +Date: Thu Aug 26 12:41:46 2010 +0300 + + Fix Win32 build + + configure.ac | 1 + + glib/gdatetime.c | 2 +- + glib/tests/gdatetime.c | 26 +++++++++++++++++++++++--- + 3 files changed, 25 insertions(+), 4 deletions(-) + +commit ca26f9a5029cfd97f92c81f3993628068d60c4a9 +Author: Matthias Clasen +Date: Thu Aug 26 00:16:30 2010 -0400 + + Make this thing work + + glib/gtester-report | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b52cdaf2f01411df86b418f45a7dc04f1499fabe +Author: Matthias Clasen +Date: Thu Aug 26 00:00:56 2010 -0400 + + Improve g_file_set_contents docs + + Mention that the temporary filename is longer than the passed-in + filename, so people can avoid passing a name that is already + NAME_MAX long. + + glib/gfileutils.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 925b4231dc7af90fa9ec2c442e640ebe20aedb5c +Author: Matthias Clasen +Date: Wed Aug 25 22:07:59 2010 -0400 + + Point out that g_type_init() is required + + docs/reference/gio/overview.xml | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 1681f7410a90f8408fd9dbd5b7e58a6e38c06fe7 +Author: A S Alam +Date: Wed Aug 25 22:00:53 2010 +0530 + + update translation for Punjabi + + po/pa.po | 658 + ++++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 402 insertions(+), 256 deletions(-) + +commit 8803182f4a1d0d3aa51407bad633dfa1c3f71890 +Author: Matthias Clasen +Date: Wed Aug 25 20:04:45 2010 -0400 + + Guarantee that g_get_tmp_dir () doesn't return an empty string + + If it does, g_file_open_tmp() would be in trouble. Pointed + out by Morten Welinder in bug 627969. + + glib/gutils.c | 12 ++++++------ + glib/tests/utils.c | 14 ++++++++++++++ + 2 files changed, 20 insertions(+), 6 deletions(-) + +commit 8e16bf2fb61bf38c9b634c18d9d7ca48e3623169 +Author: Matthias Clasen +Date: Wed Aug 25 18:44:59 2010 -0400 + + NEWS for 2.25.15 + + NEWS | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 52 insertions(+), 0 deletions(-) + +commit 08877ee0dc61b73978d6e7f46216c9405498dbf8 +Author: Emmanuele Bassi +Date: Wed Aug 25 23:08:18 2010 +0100 + + datetime: Fix a thinko + + We need to check if a year is a leap one *after* we increased it with + the given value, not before. + + glib/gdatetime.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 026375b395fcdc2336666546afd2f21e7ee8bc67 +Author: Emmanuele Bassi +Date: Wed Aug 25 23:00:31 2010 +0100 + + datetime: Avoid excessive copies in add_full() + + The current implementation of g_date_time_add_full() creates multiple + GDateTime temporary objects and unrefs them immediately; even with the + slice allocator this could result in a performance bottleneck, + especially if the atomic integer operations fall back to slow paths. + + We can isolate the components of the add_full() operation and create + internal modifiers that operate on an existing GDateTime; this brings + down the number of GDateTime copies created from six to one. + + While at it, the test suite for add_full() should have more checks for + roll-over of months and days. + + Signed-off-by: Emmanuele Bassi + + glib/gdatetime.c | 133 + +++++++++++++++++++++++++++++++++-------------- + glib/tests/gdatetime.c | 24 +++++--- + 2 files changed, 108 insertions(+), 49 deletions(-) + +commit 0d0a9bb4485069a56caf139346e6a6aad81c4efd +Author: David Zeuthen +Date: Wed Aug 25 14:45:28 2010 -0400 + + GDBusConnection: Document memory management semantics for + get_property() + + Turns out we are leaking non-floating GVariant instances returned by + get_property() functions. + + Also avoid imprecise language such as "newly-allocated GVariant" as + this doesn't specify whether the variant can be floating or not. + + Also see https://bugzilla.gnome.org/show_bug.cgi?id=627974 as it is + very related to this change. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 6 +++++- + gio/gdbusconnection.h | 4 +++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +commit d31c1c863a357e94b87529dfdfb6abad3fcef84b +Author: Emmanuele Bassi +Date: Wed Aug 25 16:24:46 2010 +0100 + + docs: Fix up GDateTime for the GObject reference + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gboxed.h | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + +commit 99621efbd559afe9c3833befab90daf6d00fc8a9 +Author: Emmanuele Bassi +Date: Wed Aug 25 16:23:34 2010 +0100 + + docs: Reword the datetime short description + + glib/gdatetime.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 250b1d576b71f2bafd6cf7abbe679dc2a21fbd65 +Author: Emmanuele Bassi +Date: Wed Aug 25 16:13:24 2010 +0100 + + docs: Fix the section name for GDateTime + + docs/reference/glib/glib-sections.txt | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5e65ed4e4458d0a359259298c33b222e16441e5e +Author: Emmanuele Bassi +Date: Wed Aug 25 12:30:09 2010 +0100 + + datetime: Fix leap year check + + Remove a FIXME and an approximation when computing the seconds from + the Unix epoch. + + glib/gdatetime.c | 23 +++++++++++++++-------- + 1 files changed, 15 insertions(+), 8 deletions(-) + +commit 2952e908e4a67929a72c5ad9a26db95f1dde2d29 +Author: Emmanuele Bassi +Date: Wed Aug 25 12:24:54 2010 +0100 + + datetime: Fix coding style + + glib/gdatetime.c | 310 + ++++++++++++++++++++++++++---------------------------- + 1 files changed, 148 insertions(+), 162 deletions(-) + +commit 0a59ab6e8594f0f2f9203390052364bef9212697 +Author: Emmanuele Bassi +Date: Wed Aug 25 12:14:04 2010 +0100 + + datetime: Use %Z for the timezone name + + We should try and follow strftime(3) for the format control characters + as much as possible. + + glib/gdatetime.c | 4 ++-- + glib/tests/gdatetime.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit b4c0b958af875bcba830ee734cd50df30a88236a +Author: Emmanuele Bassi +Date: Wed Aug 25 12:09:16 2010 +0100 + + datetime: Fix the format documentation + + The %x format is for the preferred date, and the %X format is for the + preferred time. + + glib/gdatetime.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 9a39b1d7051bd5a8f725aacf621649619067857b +Author: Emmanuele Bassi +Date: Wed Aug 25 12:06:47 2010 +0100 + + datetime: Clean up macros and unused variables + + The most complex macros should be converted to inlined functions, + instead, to guarantee some type safety. + + glib/gdatetime.c | 147 + +++++++++++++++++++++++++++--------------------------- + 1 files changed, 73 insertions(+), 74 deletions(-) + +commit 0f87f09397ef9a796258ec3200e0e987a761e505 +Author: Emmanuele Bassi +Date: Wed Aug 25 00:27:49 2010 +0100 + + datetime: Remove the translation marker for a warning message + + glib/gdatetime.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 96dc06e6e06ec0347ecb4e44b15acf8ce7e31af0 +Author: Emmanuele Bassi +Date: Tue Aug 24 23:30:30 2010 +0100 + + docs: Add GDateTime to the GLib API reference + + docs/reference/glib/glib-docs.sgml | 1 + + docs/reference/glib/glib-sections.txt | 62 + +++++++++++++++++++++++++++++++++ + 2 files changed, 63 insertions(+), 0 deletions(-) + +commit d62eb80c5489bbd4590c10f218b9eb71393bdfaf +Author: Emmanuele Bassi +Date: Tue Aug 24 21:37:43 2010 +0100 + + docs: Mention TZDIR + + The timezone code in GDateTime honours the TZDIR environment variable, + so it should be mentioned in the list of variables GLib checks at + runtime. + + docs/reference/glib/running.sgml | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit e35ed21f43f94443e5b137d85120b87542261c5b +Author: Thiago Santos +Date: Fri May 28 08:19:29 2010 -0300 + + datetime: Add GDateTime to the GType system + + As with other GLib data types, use a GBoxed. + + gobject/gboxed.c | 2 ++ + gobject/gboxed.h | 10 +++++++++- + gobject/gobject.symbols | 1 + + 3 files changed, 12 insertions(+), 1 deletions(-) + +commit e1f13ee9ed38d4f14bf927b6fa3f28530afc3640 +Author: Thiago Santos +Date: Fri May 28 08:19:29 2010 -0300 + + Add GDateTime to GLib + + GDateTime is an opaque data type containing a date and time + representation. It's immutable once created and reference + counted. + + https://bugzilla.gnome.org/show_bug.cgi?id=50076 + + Based on the code by: Christian Hergert + + Signed-off-by: Emmanuele Bassi + + glib/Makefile.am | 16 +- + glib/gdatetime.c | 2227 + ++++++++++++++++++++++++++++++++++++++++++++++++ + glib/gdatetime.h | 190 ++++ + glib/glib.h | 1 + + glib/glib.symbols | 51 ++ + glib/tests/.gitignore | 1 + + glib/tests/Makefile.am | 5 +- + glib/tests/gdatetime.c | 962 +++++++++++++++++++++ + 8 files changed, 3445 insertions(+), 8 deletions(-) + +commit 3cee971db55da9b3bdd1c05e5be68152cd6fd165 +Author: Emmanuele Bassi +Date: Tue Aug 24 22:47:02 2010 +0100 + + Add C_() to glibintl.h + + glib/glibintl.h | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 0a9bfa1c7d1d30a926c20cb45f935d05e2d2752a +Author: Cody Russell +Date: Mon Aug 23 12:34:53 2010 -0500 + + Add const to _pcre_ucp_othercase() definition in pcre_internal.h + + glib/pcre/pcre_internal.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5ff83633744db6f07fa990deab20b17c583b40e9 +Author: Jorge González +Date: Mon Aug 23 17:40:02 2010 +0200 + + Updated Spanish translation + + po/es.po | 67 + +++++++++++++++++++++++++++++++++++-------------------------- + 1 files changed, 38 insertions(+), 29 deletions(-) + +commit 6c24062880b19a239b57435694a9daed1c90edca +Author: Tor Lillqvist +Date: Mon Aug 23 14:31:20 2010 +0300 + + Include gproxyaddress.h explicitly + + gio/gsocketaddress.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 780d6bfa88900fa5a01375467b0cbb686f7b1d1f +Author: Matthias Clasen +Date: Mon Aug 23 00:37:52 2010 -0400 + + Improve testutils test coverage + + glib/tests/testing.c | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit fa6926e5d4ff7fc7efde46222ff70f2a75298ac4 +Author: Matthias Clasen +Date: Mon Aug 23 00:37:37 2010 -0400 + + Improve printf test coverage + + glib/tests/printf.c | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +commit 7d970fadbc4bad8635f2e5e109517bc015e0e14a +Author: Matthias Clasen +Date: Mon Aug 23 00:37:21 2010 -0400 + + Improve GDate test coverate + + glib/tests/date.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 files changed, 37 insertions(+), 0 deletions(-) + +commit 8f40c0e45a158440edb7f4e4fcc95471c028a2e3 +Author: Matthias Clasen +Date: Mon Aug 23 00:36:36 2010 -0400 + + Improve GDBus introspection test coverage + + gio/tests/gdbus-introspection.c | 81 + +++++++++++++++++++++++++++++++++++++++ + gio/tests/gdbus-peer.c | 4 ++ + 2 files changed, 85 insertions(+), 0 deletions(-) + +commit 847e4dfe7d2ff84c23fba332381e5121ab54aa39 +Author: David Zeuthen +Date: Sun Aug 22 22:56:49 2010 -0400 + + GDBusMethodInvocation: nuke constructor + + ... that is, make it private. This makes sense because users are never + expected to create such objects themselves - only the GDBus core will + need this. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 1 - + gio/gdbusconnection.c | 18 +++++++++--------- + gio/gdbusmethodinvocation.c | 22 +++++++++++----------- + gio/gdbusmethodinvocation.h | 9 --------- + gio/gdbusprivate.h | 12 ++++++++++++ + gio/gio.symbols | 1 - + 6 files changed, 32 insertions(+), 31 deletions(-) + +commit 5668d52babfd40ac502463006f964665f3561008 +Author: Fran Diéguez +Date: Mon Aug 23 02:24:25 2010 +0200 + + Updated galician translations + + po/gl.po | 47 +++++++++++++++++++++++------------------------ + 1 files changed, 23 insertions(+), 24 deletions(-) + +commit ff59b66ebaaf580cb355f187e83ce36b198ee880 +Author: Jorge González +Date: Sun Aug 22 21:17:53 2010 +0200 + + Updated Spanish translation + + po/es.po | 160 + ++++++++++++++++++++++++++++++++++++++++++++++++++------------ + 1 files changed, 130 insertions(+), 30 deletions(-) + +commit 3ff9894826215790fdd6c8b53584f94a7172c39f +Author: David Zeuthen +Date: Thu Aug 5 20:37:27 2010 -0400 + + Bug 624546 – Modification of GDBusMessage in filter function + + Allow modifying a GDBusMessage in a filter function and also add tests + for this. This breaks API but leaves ABI (almost) intact - at least + dconf's GSettings backend (the only big user I know of) will keep + working. + + https://bugzilla.gnome.org/show_bug.cgi?id=624546 + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 1 + + gio/gdbusconnection.c | 85 +++++++++++++++----- + gio/gdbusconnection.h | 18 +++-- + gio/gdbusprivate.c | 59 +++++++++++--- + gio/gdbusprivate.h | 6 +- + gio/gio.symbols | 1 + + gio/gioenums.h | 25 ++++++ + gio/tests/gdbus-connection.c | 147 + ++++++++++++++++++++++++++++++++++- + gio/tests/gdbus-peer.c | 4 +- + 9 files changed, 298 insertions(+), 48 deletions(-) + +commit 6d359d60290f5651b868d326e1e9514f68dfaa32 +Author: Ask H. Larsen +Date: Sun Aug 22 13:17:24 2010 +0200 + + Updated Danish translation + + po/da.po | 2102 + +++++++++++++++++++++++++++++++++++++++----------------------- + 1 files changed, 1310 insertions(+), 792 deletions(-) + +commit ef16ea4616b6d47b533474dd163ae23add7037bc +Author: Matthias Clasen +Date: Sat Aug 21 22:22:25 2010 -0400 + + Add proxy extension point to overview docs + + The 'Extending GIO' section is supposed to list all extension + points, so add the proxy extension point here. + + docs/reference/gio/overview.xml | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit 040bffed38529f18d71713fce994b8ea705dbfb6 +Author: Matthias Clasen +Date: Sat Aug 21 22:14:28 2010 -0400 + + Fix build on !unix + + There was one code block still referring to fd_list outside of + the ifdef G_OS_UNIX. Pointed out by Sam Thursfield in bug 627392. + + gio/gdbusprivate.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 41ce91d0579aa05b89e357c9fd59d9530ad7bf76 +Author: Matthias Clasen +Date: Sat Aug 21 22:09:32 2010 -0400 + + Better fix for the build problem + + Use gnetworkingprivate.h instead, patch by Emilio Pozuelo Monfort, + bug 627407. + + gio/tests/gdbus-peer.c | 11 +---------- + 1 files changed, 1 insertions(+), 10 deletions(-) + +commit 3d01283f6908000e0a989ba22769c869461be398 +Author: Matthias Clasen +Date: Sat Aug 21 22:06:56 2010 -0400 + + Make gdbus-peer build on !linux + + Based on a patch by Koop Mast, bug 627088. + + gio/tests/gdbus-peer.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 61de05e774829f1687244b014732490005cf4b48 +Author: Matthias Clasen +Date: Sat Aug 21 21:58:51 2010 -0400 + + Fix a duplicate word + + Pointed out in bug 627604. + + gio/gdbusmessage.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a54e2c4fb302ebbeae3e28c70f2342a57edb7521 +Author: Matthias Clasen +Date: Sat Aug 21 19:27:11 2010 -0400 + + Add some more annotations + + gio/gactiongroup.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 892f9b64584b7a05c517f19f8a9a22d8533a6413 +Author: Matthias Clasen +Date: Sat Aug 21 19:18:40 2010 -0400 + + Improve test coverage for actions and action groups + + gio/tests/actions.c | 116 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 116 insertions(+), 0 deletions(-) + +commit 33b775308bd97c02ecdd6de4f91a619c8fcdc282 +Author: Matthias Clasen +Date: Sat Aug 21 19:18:17 2010 -0400 + + Document behaviour wrt. to floating variants + + gio/gaction.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 9581b33ca5c2cc56d0e6f1fef5d437f856928494 +Author: Matthias Clasen +Date: Sat Aug 21 19:11:03 2010 -0400 + + Document behaviour wrt to floating variants + + gio/gactiongroup.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit e8ffb1ae83cf63837254ee5979798b2ada18c38a +Author: Matthias Clasen +Date: Sat Aug 21 16:30:50 2010 -0400 + + Add some annotations + + gio/gaction.c | 18 +++++++++++------- + 1 files changed, 11 insertions(+), 7 deletions(-) + +commit 5b38bc5ad5181bb4900c1da898b2e4fcdcec1757 +Author: Ryan Lortie +Date: Sat Aug 21 17:35:32 2010 -0400 + + Simplify/fix state logic in GAction, test it. + + gio/gaction.c | 55 + ++++++++++++++++++++++++++++++++------------------ + gio/tests/actions.c | 35 ++++++++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+), 20 deletions(-) + +commit 3c5388d9f41b39c939cb67c5fa28cf38ec832cd0 +Author: Matthias Clasen +Date: Sat Aug 21 15:40:46 2010 -0400 + + Add some forgotten symbols + + docs/reference/gio/gio-sections.txt | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit bff2af486827499c2da507f17e61fc88c96b43ba +Author: Matthias Clasen +Date: Sat Aug 21 15:40:32 2010 -0400 + + Ignore some more private headers + + docs/reference/gio/Makefile.am | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit b876e47e3b623b50dcced6c1c8f6f953c1113753 +Author: Matthias Clasen +Date: Sat Aug 21 15:34:40 2010 -0400 + + Fix documentation issues + + Gtk-doc is unhappy if the parameter names don't match between header + and source. + + gio/gnetworkservice.c | 4 +++- + gio/gproxy.c | 18 +++++++++--------- + 2 files changed, 12 insertions(+), 10 deletions(-) + +commit 4831a102e51825b79d39686983326bcf82490ede +Author: Matthias Clasen +Date: Sat Aug 21 15:34:18 2010 -0400 + + Fix GActionGroup docs + + gio/gactiongroup.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit fceea19be5a7744904f793e38e090b627b8c0ed8 +Author: Милош Поповић +Date: Sat Aug 21 20:05:14 2010 +0200 + + Updated Serbian translation + + po/sr.po | 1756 + ++++++++++++++++++++++++++++++++++--------------------- + po/sr@latin.po | 1767 + +++++++++++++++++++++++++++++++++++--------------------- + 2 files changed, 2185 insertions(+), 1338 deletions(-) + +commit de07279709d35aeb28dfb60ea836cd043eb4cfc2 +Author: Chao-Hsiung Liao +Date: Sat Aug 21 19:43:37 2010 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + + po/zh_HK.po | 951 + +++++++++++++++++++++++++++++++++++++++------------------- + po/zh_TW.po | 964 + ++++++++++++++++++++++++++++++++++++++++------------------- + 2 files changed, 1305 insertions(+), 610 deletions(-) + +commit 276a9ba385a2cde538c7d5176ea5ee761c21e9ed +Author: Yaron Shahrabani +Date: Sat Aug 21 02:35:07 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 157 + ++++++++++++++++++++++++++++++++++++++++++++++++++------------ + 1 files changed, 127 insertions(+), 30 deletions(-) + +commit 8524f0dc0d0c2742a90a3fee6dbb7fe290dfb8dd +Author: Fran Diéguez +Date: Fri Aug 20 13:23:11 2010 +0200 + + Updated galician translations + + po/gl.po | 396 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 254 insertions(+), 142 deletions(-) + +commit 8f5ec0dad328cbb498fe2f60bd465f0e4c5d4cad +Author: Dan Winship +Date: Thu Aug 19 18:24:53 2010 -0400 + + Fix misc compiler warnings in (mostly) test programs + + gio/gdbusmessage.c | 2 +- + gio/gio.symbols | 1 - + gio/tests/file.c | 17 +++++++++++++++-- + gio/tests/g-icon.c | 2 +- + glib/tests/date.c | 2 +- + glib/tests/node.c | 2 +- + glib/tests/shell.c | 4 ++-- + tests/gobject/ifaceproperties.c | 2 +- + 8 files changed, 22 insertions(+), 10 deletions(-) + +commit 22b3f0d4b26d0b729c1850f45670a9050dc10772 +Author: Dan Winship +Date: Thu Aug 19 17:51:24 2010 -0400 + + gio.symbols: add missing g_simple_action_group stuff + + gio/gio.symbols | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit ab778737aa6d145a0d19d0775270959a72716260 +Author: Dan Winship +Date: Thu Aug 19 17:51:01 2010 -0400 + + gproxyaddressenumerator.h: add missing G_END_DECLS + + gio/gproxyaddressenumerator.h | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit de1598a34d920882991d6b5166bce815ca4aa428 +Author: Nicolas Dufresne +Date: Thu Aug 19 17:31:42 2010 -0400 + + gio/proxy: Fixed compilation warnings + + * Wrong return type (NULL instead of FALSE) + * Unused static function declaration + + gio/gproxy.c | 2 +- + gio/gsocks4proxy.c | 2 -- + 2 files changed, 1 insertions(+), 3 deletions(-) + +commit 0958e663175fe51361aa1e6a87a3f3c5de08bebf +Author: Nicolas Dufresne +Date: Thu Aug 19 16:23:50 2010 -0400 + + Add support for g_socket_client_add_application_proxy() + + This allow application to take control over certain proxy protocol + handling. When a proxy protocol must be used and is found in the + application proxies, GSocketClient will simply TCP connect to + the proxy + server and return the connection. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gsocketclient.c | 41 + +++++++++++++++++++++++++++++++++- + gio/gsocketclient.h | 2 + + 4 files changed, 43 insertions(+), 2 deletions(-) + +commit ced1d0e2e7d164873d8b7e335a00cfac13785760 +Author: Nicolas Dufresne +Date: Tue May 25 16:02:42 2010 -0400 + + Implemented SOCKSv4 and SOCKSv4a + + gio/Makefile.am | 4 + + gio/giomodule.c | 4 + + gio/gsocks4aproxy.c | 495 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + gio/gsocks4aproxy.h | 55 ++++++ + gio/gsocks4proxy.c | 73 ++++++++ + gio/gsocks4proxy.h | 44 +++++ + po/POTFILES.in | 1 + + 7 files changed, 676 insertions(+), 0 deletions(-) + +commit e2a90bcb5fc50f099cbf8df01a09697f7e48522d +Author: Nicolas Dufresne +Date: Fri May 7 16:35:04 2010 -0400 + + Implemented proxy sample code that connect to proxy + + gio/tests/proxy.c | 83 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 83 insertions(+), 0 deletions(-) + +commit 0ebb79a7488121ae4a18cc84ac92e25ddb2b9544 +Author: Nicolas Dufresne +Date: Thu Apr 29 18:51:42 2010 -0400 + + Implemented g_socket_client_connect_to_uri() method + + Using this rather than g_socket_client_connect() or + g_socket_client_connect_to_host() allows #GSocketClient to + determine when to use application-specific proxy protocols. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 3 + + gio/gio.symbols | 3 + + gio/gsocketclient.c | 122 + ++++++++++++++++++++++++++++++++++- + gio/gsocketclient.h | 14 ++++ + 4 files changed, 141 insertions(+), 1 deletions(-) + +commit a6c3820f46b9caabc45ab19aaf2669b4cb04c5d5 +Author: Nicolas Dufresne +Date: Tue Aug 10 16:48:45 2010 -0400 + + Hooked proxy enumeration into GSocketClient + + This functionnallity can be disabled using property enable-proxy. It + enumerates addresses using GSocketConnectable::proxy_enumerate() + instead of + enumerate(). When the returned address is of type GProxyAddress + (a type + based on GInetSocketAddress), it gets the proxy protocol handler using + g_proxy_get_default_for_protocol() and call connect() on it. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gsocketclient.c | 307 + +++++++++++++++++++++++++++++++---- + gio/gsocketclient.h | 3 + + 4 files changed, 282 insertions(+), 32 deletions(-) + +commit ee3dbf747e48a41c916674f111906f57996fd626 +Author: Nicolas Dufresne +Date: Thu Jul 22 20:51:23 2010 -0400 + + Implement GProxyConnection a GIOStream+GTcpConn wrapper + + This class inherit from GTcpConnection by refing the socket of + an existing GTcpConnection and wraps a custom GIOStream into + itself. This + is to allow implementing proxies that alters data stream, like + when using + GSSAPI privacy inside SOCKS5. + + gio/Makefile.am | 2 + + gio/gproxyconnection.c | 155 + ++++++++++++++++++++++++++++++++++++++++++++++++ + gio/gproxyconnection.h | 69 +++++++++++++++++++++ + 3 files changed, 226 insertions(+), 0 deletions(-) + +commit 6fa113660057e0e6592b180d1a2aead617e71dec +Author: Nicolas Dufresne +Date: Thu Apr 29 15:22:55 2010 -0400 + + Implemented SOCKSv5 proxy support + + gio/Makefile.am | 2 + + gio/giomodule.c | 2 + + gio/gsocks5proxy.c | 1053 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + gio/gsocks5proxy.h | 48 +++ + po/POTFILES.in | 1 + + 5 files changed, 1106 insertions(+), 0 deletions(-) + +commit c32ef1d85e0b7cca02677bbe50fef2ef79a98002 +Author: Dan Winship +Date: Fri Jun 25 14:28:02 2010 -0400 + + GSocket: store the remote_address when connecting + + This way, if g_socket_connect() is called with a GProxyAddress, + g_socket_get_remote_address() will later return that same address. + + Reviewed-by: Nicolas Dufresne + + gio/gsocket.c | 51 +++++++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 43 insertions(+), 8 deletions(-) + +commit b304a23af73374857e6bb18fc636d83fe9ed58ea +Author: Nicolas Dufresne +Date: Wed Apr 28 15:39:56 2010 -0400 + + Extend IO_ERROR enum for Proxy support + + gio/gioenums.h | 17 ++++++++++++++++- + gio/gioerror.c | 18 ++++++++++++++++++ + 2 files changed, 34 insertions(+), 1 deletions(-) + +commit 1094c84238e05304e4175990c5e0e018cdf97e28 +Author: Nicolas Dufresne +Date: Fri May 7 16:32:05 2010 -0400 + + Implemented proxy sample for all Connectables + + gio/tests/proxy.c | 309 + +++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 files changed, 290 insertions(+), 19 deletions(-) + +commit fc03ecce831cd94639df1a355f5dd8c9b8eebfae +Author: Nicolas Dufresne +Date: Tue Aug 10 15:45:32 2010 -0400 + + Implemented proxy_enumerate() for all Connectables + + This patch implements method proxy_enumerate from GSocketConnectable + for + all connectables (GNetworkAddress, GNetworkService, GInetSocketAddress + and GUnixSocketAddress). + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gnetworkaddress.c | 28 ++- + gio/gnetworkservice.c | 441 + ++++++++++++++++++++--------------- + gio/gnetworkservice.h | 2 + + gio/gsocketaddress.c | 42 ++++- + 6 files changed, 329 insertions(+), 188 deletions(-) + +commit f82f484b8ffa18aab10e79baa96bcfa438f8dc5b +Author: Nicolas Dufresne +Date: Tue Aug 10 16:53:25 2010 -0400 + + Added proxy_enumerate method to GSocketConnectable + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 3 ++- + gio/gnetworkaddress.c | 2 +- + gio/gnetworkingprivate.h | 5 +++++ + gio/gsocketconnectable.c | 31 + +++++++++++++++++++++++++++++++ + gio/gsocketconnectable.h | 8 +++++++- + 6 files changed, 47 insertions(+), 3 deletions(-) + +commit 6749ffce594b146ef49c8fe014bfa8b0272b6b9f +Author: Nicolas Dufresne +Date: Fri May 7 16:27:34 2010 -0400 + + Added GProxyAddressEnumerator to proxy sample code + + gio/tests/proxy.c | 133 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 133 insertions(+), 0 deletions(-) + +commit a7e0e8fc0852255d430daa90e7345db67a2a9594 +Author: Nicolas Dufresne +Date: Tue Aug 10 15:25:11 2010 -0400 + + Adding GProxyAddressEnumerator class + + An implementation of GSocketAddressEnumerator that handles proxy + enumeration. This class is mainly usefull for Connectables + implementation + such as NetworkService, NetworkAddress and SocketAddress to handle + proxies. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 11 + + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/gio.symbols | 6 + + gio/giotypes.h | 1 + + gio/gproxyaddressenumerator.c | 728 + +++++++++++++++++++++++++++++++++++ + gio/gproxyaddressenumerator.h | 73 ++++ + 8 files changed, 823 insertions(+), 0 deletions(-) + +commit d76de5e3591431c03a5812acd7682f2ff68fba69 +Author: Nicolas Dufresne +Date: Tue Aug 10 15:24:37 2010 -0400 + + Added GProxy interface for proxy extension point + + Implement an extension point for proxy protocol implementation. This + is mainly useful for socket-based proxy where it is possible to + use the + proxied socket the same way it would for other stream based socket. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 19 +++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/gio.symbols | 11 ++ + gio/giomodule.c | 4 + + gio/giotypes.h | 1 + + gio/gproxy.c | 208 + +++++++++++++++++++++++++++++++++++ + gio/gproxy.h | 123 +++++++++++++++++++++ + 10 files changed, 371 insertions(+), 0 deletions(-) + +commit 63105d1074ce54fdda9c81bb0353abc9b0a24d62 +Author: Nicolas Dufresne +Date: Tue Aug 10 15:23:37 2010 -0400 + + Added method g_network_address_parse_uri() + + This method allow creating a network address from a URI. If no port is + found in the URI, the default_port parameter will be used. Note + that new + property scheme is there for future TLS implementation. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gnetworkaddress.c | 296 + +++++++++++++++++++++++++++++++++++ + gio/gnetworkaddress.h | 4 + + 4 files changed, 304 insertions(+), 0 deletions(-) + +commit 466111c9605ace99389d56ace213621db01e18d9 +Author: Nicolas Dufresne +Date: Mon Apr 26 17:27:33 2010 -0400 + + Implement GProxyAddress + + A GSocketInetAddress representing the proxy server address with + additional + properties proxy type, destination address and port, username and + password. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 23 +++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/gio.symbols | 12 ++ + gio/giotypes.h | 1 + + gio/gproxyaddress.c | 345 + +++++++++++++++++++++++++++++++++++ + gio/gproxyaddress.h | 76 ++++++++ + 9 files changed, 462 insertions(+), 0 deletions(-) + +commit 6b1d851cc5ba8ce4276f2e3236da7554b763cf0c +Author: Nicolas Dufresne +Date: Fri May 7 16:23:45 2010 -0400 + + Implemented proxy sample code + + Reviewed-by: Dan Winship + + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 5 ++ + gio/tests/proxy.c | 175 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 181 insertions(+), 0 deletions(-) + +commit f3debedfd2a3197230ac6f09f56741c3eda61e29 +Author: Nicolas Dufresne +Date: Fri May 7 15:55:54 2010 -0400 + + Implemented proxy-resolver extension point + + This extension point allow extending GLib with library like LibProxy + that + interprets system proxy settings and finds the appropriate + configuration + based on the type of connection being made. + + Reviewed-by: Dan Winship + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 20 +++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 4 + + gio/gdummyproxyresolver.c | 156 ++++++++++++++++++++++ + gio/gdummyproxyresolver.h | 54 ++++++++ + gio/gio.h | 1 + + gio/gio.symbols | 11 ++ + gio/giomodule.c | 7 + + gio/giotypes.h | 9 ++ + gio/gproxyresolver.c | 241 + +++++++++++++++++++++++++++++++++++ + gio/gproxyresolver.h | 96 ++++++++++++++ + 12 files changed, 601 insertions(+), 0 deletions(-) + +commit f82740f7beeac91398fc152a3efef0918540cd7b +Author: Jorge González +Date: Thu Aug 19 21:17:09 2010 +0200 + + Updated Spanish translation + + po/es.po | 295 + +++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 150 insertions(+), 145 deletions(-) + +commit b4b5ca4fd89a469c423df9d917af0c523196aab5 +Author: Yaron Shahrabani +Date: Thu Aug 19 09:31:02 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 285 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 146 insertions(+), 139 deletions(-) + +commit 7d6a6ca57b5a5dc1ad55a785dfd79fa98d7e4093 +Author: David Zeuthen +Date: Wed Aug 18 13:07:25 2010 -0400 + + Bug 627188 – gdbus-non-socket test occasionally fails + + Fix logical bug in test case to avoid race condition between the + client and the server. + + Signed-off-by: David Zeuthen + + gio/tests/gdbus-non-socket.c | 19 +++++++++++++++---- + 1 files changed, 15 insertions(+), 4 deletions(-) + +commit 6c340c0b0312fc12f01ba1887e559fd36fcf28cb +Author: Matthias Clasen +Date: Wed Aug 18 12:07:01 2010 -0400 + + Make gunixcredentialsmessage.h standalone includable + + gio/gunixcredentialsmessage.h | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit 81b91a8852c0840d907c8192c67b2e65b29d41c6 +Author: Emmanuele Bassi +Date: Wed Aug 18 16:54:36 2010 +0100 + + action: Minor fixes + + • Argument validation. + + • Since: annotations. + + • Remove (allow-none) annotations from return values. + + • Coding style fixes. + + gio/gaction.c | 89 +++++++++++++++++++++---------- + gio/gactiongroup.c | 154 + +++++++++++++++++++++++++++++++++++----------------- + 2 files changed, 166 insertions(+), 77 deletions(-) + +commit 504117e284682bff973ad73646fa67103978d016 +Author: Emmanuele Bassi +Date: Wed Aug 18 16:54:11 2010 +0100 + + action-group: Check aginst the correct GType macro + + G_TYPE_ACTION_GROUP is not a G_TYPE_ACTION. + + gio/gactiongroup.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 5bb94348f4760352f6ae974002db48cb130343a4 +Author: David Zeuthen +Date: Wed Aug 18 11:35:25 2010 -0400 + + GDBusProxy: Call into well-known name if no name owner currently + exists + + This is really what (API) users expect from GDBusProxy - in + particular, mclasen and I ran into this problem while debugging a + upower issue, see + + https://bugzilla.redhat.com/show_bug.cgi?id=624125 + + In a nutshell, the problem is that polkitd crashes while upower holds + a PolkitAuthority object (which in turns contains a GDBusProxy for the + well-known name org.freedesktop.PolicyKit1). This means that + subsequent calls on the PolkitAuthority (which is translated into + calls into the GDBusProxy) fails since :g-name-owner is NULL. + + With this fix, we'll be requesting the bus daemon to launch polkitd + since we will start calling into org.freedesktop.PolicyKit1 as soon as + we notice that there is no owner for this name. + + Unfortunately our test suite doesn't cover service activation so there + is no way to reliably test this. I will file a bug about this. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 108 + ++++++++++++++++++++++++++++++++++++++++-------------- + 1 files changed, 80 insertions(+), 28 deletions(-) + +commit c2945808acc09562fad0ecd1247fcc3e53eeb913 +Author: David Zeuthen +Date: Wed Aug 18 10:52:28 2010 -0400 + + GDBusProxy: Use %, not #, for referencing enum constants in gtk-doc + comments + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit a35efb0939c05d572b3a601fb3de62c599d2cf9c +Author: Christian Persch +Date: Wed Aug 18 01:02:22 2010 +0200 + + G_OPTION_FLAG_NO_ARG is only for callback options + + Bug #627252. + + glib/tests/option-context.c | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +commit 5db9e5ad58040b5ccdba73c59a76522f9c35aa34 +Author: Ryan Lortie +Date: Wed Aug 18 02:15:09 2010 -0400 + + add GSimpleActionGroup + + and a simple test + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 28 +++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/giotypes.h | 1 + + gio/gsimpleactiongroup.c | 401 + +++++++++++++++++++++++++++++++++++ + gio/gsimpleactiongroup.h | 91 ++++++++ + gio/tests/actions.c | 28 +++ + 9 files changed, 554 insertions(+), 0 deletions(-) + +commit 972c563f2328e5d1e176d99dd8abaf490b5db324 +Author: Ryan Lortie +Date: Wed Aug 18 02:14:37 2010 -0400 + + add some missed bits in the docs + + docs/reference/gio/gio-sections.txt | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +commit e1ded9f900349a64d25f659b0515e61956325557 +Author: Ryan Lortie +Date: Wed Aug 18 01:56:34 2010 -0400 + + add gaction.h to gio.h + + gio/gio.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 8014e9c6e67958103ef490e1bc753e4426751751 +Author: Ryan Lortie +Date: Wed Aug 18 01:55:48 2010 -0400 + + add testcase for GAction + + fix some small bugs it found + + gio/gaction.c | 9 ++++-- + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 3 ++ + gio/tests/actions.c | 81 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 91 insertions(+), 3 deletions(-) + +commit 8475d6d7d05f00e6fd43ffe882b47025330caa6f +Author: Ryan Lortie +Date: Wed Aug 18 01:45:15 2010 -0400 + + add GAction base class + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 31 ++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gaction.c | 597 + +++++++++++++++++++++++++++++++++++ + gio/gaction.h | 120 +++++++ + gio/gio.symbols | 17 + + gio/giotypes.h | 1 + + 8 files changed, 770 insertions(+), 0 deletions(-) + +commit a3f4ff52ca7e8cea8db6374d55d44729936da243 +Author: Ryan Lortie +Date: Wed Aug 18 01:07:07 2010 -0400 + + gio.symbols: Fix missed symbol name tweak + + gio/gio.symbols | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6e04125e3543fd59a067abefc72011433a7db915 +Author: Ryan Lortie +Date: Wed Aug 18 00:37:50 2010 -0400 + + pad the GActionGroup vtable + + gio/gactiongroup.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 6fe74a4c6ab9895f77e889253ad9a369a0f9d1cc +Author: Ryan Lortie +Date: Wed Aug 18 00:33:17 2010 -0400 + + Add gactiongroup.h to gio.h + + gio/gio.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e71dbb97326f767881142cb24cf0850ee8c40008 +Author: Ryan Lortie +Date: Wed Aug 18 00:30:44 2010 -0400 + + add GActionGroup base class + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 38 +++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 14 +- + gio/gactiongroup.c | 453 + +++++++++++++++++++++++++++++++++++ + gio/gactiongroup.h | 173 +++++++++++++ + gio/gio-marshal.list | 1 + + gio/gio.symbols | 20 ++ + gio/giotypes.h | 1 + + 9 files changed, 699 insertions(+), 3 deletions(-) + +commit ddad707b85bf2075c0ca37b4a2267c6eac60a358 +Author: Dan Winship +Date: Tue Aug 17 18:38:34 2010 -0400 + + update gio/tests/.gitignore + + gio/tests/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit c56379264dd8714bdf08675927a5e59debaa7fc3 +Author: Christian Persch +Date: Tue Aug 17 18:38:46 2010 +0200 + + Plug a mem leak in GDBusWorker + + Free the read buffer. + + ==26538== 4,096 bytes in 1 blocks are definitely lost in loss record + 781 of 781 + ==26538== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==26538== by 0x4005C66: realloc (vg_replace_malloc.c:476) + ==26538== by 0x405244D: g_realloc (gmem.c:181) + ==26538== by 0x420E066: _g_dbus_worker_do_read_unlocked + (gdbusprivate.c:780) + ==26538== by 0x420E1D1: _g_dbus_worker_do_read (gdbusprivate.c:812) + ==26538== by 0x420F14A: _g_dbus_worker_thread_begin_func + (gdbusprivate.c:1318) + ==26538== by 0x420D2ED: invoke_caller (gdbusprivate.c:266) + ==26538== by 0x404DA7C: g_idle_dispatch (gmain.c:4224) + ==26538== by 0x4049FCD: g_main_dispatch (gmain.c:2119) + ==26538== by 0x404B2C1: g_main_context_dispatch (gmain.c:2672) + ==26538== by 0x404B716: g_main_context_iterate (gmain.c:2750) + ==26538== by 0x404BE7F: g_main_loop_run (gmain.c:2958) + ==26538== by 0x420D2B5: shared_thread_func (gdbusprivate.c:248) + ==26538== by 0x4077958: g_thread_create_proxy (gthread.c:1897) + ==26538== by 0x57D918: start_thread (pthread_create.c:301) + ==26538== by 0x4C6CBD: clone (clone.S:133) + + Bug #627187. + + gio/gdbusprivate.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit a91a4a420e8ba6428e7db13bd9c308256cfbb323 +Author: Christian Persch +Date: Tue Aug 17 18:29:14 2010 +0200 + + Plug a mem leak in gdbus-connection test + + ==26538== 145 (24 direct, 121 indirect) bytes in 1 blocks are + definitely lost in loss record 765 of 790 + ==26538== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==26538== by 0x405233C: g_malloc (gmem.c:134) + ==26538== by 0x406A57E: g_slice_alloc (gslice.c:836) + ==26538== by 0x406A60C: g_slice_copy (gslice.c:858) + ==26538== by 0x4035C5A: g_error_copy (gerror.c:160) + ==26538== by 0x41B6387: g_simple_async_result_set_from_error + (gsimpleasyncresult.c:638) + ==26538== by 0x41FCDEB: g_dbus_connection_call_done + (gdbusconnection.c:4808) + ==26538== by 0x41B682E: g_simple_async_result_complete + (gsimpleasyncresult.c:762) + ==26538== by 0x41B686A: complete_in_idle_cb + (gsimpleasyncresult.c:772) + ==26538== by 0x404DA7C: g_idle_dispatch (gmain.c:4224) + ==26538== by 0x4049FCD: g_main_dispatch (gmain.c:2119) + ==26538== by 0x404B2C1: g_main_context_dispatch (gmain.c:2672) + ==26538== by 0x404B716: g_main_context_iterate (gmain.c:2750) + ==26538== by 0x404BE7F: g_main_loop_run (gmain.c:2958) + ==26538== by 0x804B5CC: test_connection_send + (gdbus-connection.c:407) + ==26538== by 0x4073D04: test_case_run (gtestutils.c:1174) + + Bug #627187. + + gio/tests/gdbus-connection.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 75563e81c2b6bab345e08daafd3206cec699f2ea +Author: Christian Persch +Date: Tue Aug 17 18:20:23 2010 +0200 + + Plug a mem leak in gdbus-connection test + + ==25403== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely + lost in loss record 603 of 787 + ==25403== at 0x4005BDC: malloc (vg_replace_malloc.c:195) + ==25403== by 0x405233C: g_malloc (gmem.c:134) + ==25403== by 0x406A57E: g_slice_alloc (gslice.c:836) + ==25403== by 0x406A5C3: g_slice_alloc0 (gslice.c:848) + ==25403== by 0x4035B4E: g_error_new_literal (gerror.c:117) + ==25403== by 0x4035ED9: g_set_error_literal (gerror.c:314) + ==25403== by 0x41F6434: g_dbus_connection_close_sync + (gdbusconnection.c:1284) + ==25403== by 0x804A861: test_connection_life_cycle + (gdbus-connection.c:158) + ==25403== by 0x4073D04: test_case_run (gtestutils.c:1174) + ==25403== by 0x4073FC2: g_test_run_suite_internal + (gtestutils.c:1223) + ==25403== by 0x4074077: g_test_run_suite_internal + (gtestutils.c:1233) + ==25403== by 0x4074077: g_test_run_suite_internal + (gtestutils.c:1233) + ==25403== by 0x40741FB: g_test_run_suite (gtestutils.c:1274) + ==25403== by 0x40733E5: g_test_run (gtestutils.c:877) + ==25403== by 0x804DC92: main (gdbus-connection.c:1024) + + Bug #627187. + + gio/tests/gdbus-connection.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit a62a2fd8edc0ca771ca1c1df1889766f3c73b0e4 +Author: Christian Persch +Date: Tue Aug 17 18:08:07 2010 +0200 + + Plug a mem leak in the gdbus-connection test + + Bug #627182. + + gio/tests/gdbus-connection.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 7191fc3f17d39a3fa27e990a3723403066d34826 +Author: Christian Persch +Date: Sun Jun 20 14:33:27 2010 +0200 + + Use g_memory_output_stream_steal_data here + + ... instead of one extra g_memdup(). + + Bug #627181. + + gio/gdbusmessage.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 71e73ffdfbd7a33f4e233cfe1353adf143a2c14c +Author: Christian Persch +Date: Sat May 24 16:08:28 2008 +0200 + + Use G_DEFINE_[BOXED|POINTER]_TYPE instead of handwritten code + + Now that we have convenience macros to implement boxed and pointer + types, use them. + + gio/gdbusintrospection.c | 17 +--- + gio/gfileattribute.c | 20 +---- + gio/gfileinfo.c | 20 +---- + gio/gsrvtarget.c | 17 +--- + gobject/gboxed.c | 215 + ++++++++-------------------------------------- + gobject/gsourceclosure.c | 14 +--- + gobject/gvaluetypes.c | 10 +-- + 7 files changed, 50 insertions(+), 263 deletions(-) + +commit dc1999316da0409c5bc15e37a0a568a8309bb5a3 +Author: Christian Persch +Date: Sat May 24 16:08:04 2008 +0200 + + Add G_DEFINE_{BOXED,POINTER}_TYPE[_WITH_CODE] + + Add convenience type definition macros for boxed and pointer types + similar to G_DEFINE_TYPE for object types. Bug #449565. + + docs/reference/gobject/gobject-sections.txt | 4 + + gobject/gtype.h | 110 + +++++++++++++++++++++++++++ + 2 files changed, 114 insertions(+), 0 deletions(-) + +commit cae86073eaf932b85836e98df8d87c65d90f5842 +Author: Christian Persch +Date: Thu May 13 19:57:41 2010 +0200 + + Add GZIP header processing to GZlibCompressor/GZlibDecompressor + + Add GZlibCompressor:file-info property. If it contains a non-NULL + GFileInfo, and the compressor is in GZIP mode, the filename and + modification time from the file info are written to the GZIP header + in the output data. + + Add GZlibDeompressor:file-info property. If the decompressor is + in GZIP + mode, and the GZIP data contains a GZIP header, the filename and + modification time are read from it, stored in a GFileInfo, and the + file-info property is notified. + + Bug #617691. + + docs/reference/gio/gio-sections.txt | 3 + + gio/gio.symbols | 3 + + gio/gzlibcompressor.c | 117 + ++++++++++++++++++++++++++++++- + gio/gzlibcompressor.h | 5 ++ + gio/gzlibdecompressor.c | 134 + ++++++++++++++++++++++++++++++++-- + gio/gzlibdecompressor.h | 3 + + gio/tests/filter-cat.c | 38 ++++++++++- + 7 files changed, 293 insertions(+), 10 deletions(-) + +commit b196cd74473cbc812359ee3b484a3986604e9aba +Author: Christian Persch +Date: Sun Jun 20 14:32:52 2010 +0200 + + Add g_memory_output_stream_steal_data + + Bug #622184. + + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gmemoryoutputstream.c | 29 +++++++++++++++++++++++++++++ + gio/gmemoryoutputstream.h | 1 + + 4 files changed, 32 insertions(+), 0 deletions(-) + +commit 322ac7ff68205daf52a2d0bcecc098edd6b413b9 +Author: Matthias Clasen +Date: Mon Aug 16 16:36:38 2010 -0400 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 503b0744744517ecf1c29eaa83e8e69537ae3547 +Author: Matthias Clasen +Date: Mon Aug 16 15:44:40 2010 -0400 + + Fix a typo + + NEWS | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e21e44fc2e96d86c9cdeb6b904b29fed70acec18 +Author: David Zeuthen +Date: Mon Aug 16 15:42:23 2010 -0400 + + Add NEWS item for bug 627071 + + Signed-off-by: David Zeuthen + + NEWS | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit b8e7ef6e90512999be0340a6ef3f20e1783647c4 +Author: David Zeuthen +Date: Mon Aug 16 15:37:01 2010 -0400 + + Bug 627071 – g_output_stream_write() clarification + + This patch guarantees that g_output_stream_write() can never fail with + G_IO_ERROR_WOULD_BLOCK. Without such a guarantee, we would need some + kind of GIOPollable interface or some way to get an event when the + stream is writable again. Which is mostly useless considering that + this method is asynchronous anyway. + + Note: this patch just codifies existing behavior - GUnixOutputStream, + GSocketOutputStream and other implementations already work this way. + + See also bug 626748 comment 5 for how the GDBus code relies on this + guarantee. + + https://bugzilla.gnome.org/show_bug.cgi?id=627071 + + Signed-off-by: David Zeuthen + + gio/goutputstream.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 285170637de0df2011b9b667cab5c68640832580 +Author: Matthias Clasen +Date: Mon Aug 16 15:32:13 2010 -0400 + + More NEWS + + NEWS | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 789c0cc877a41a65417b0ee1d6eed5803c48c238 +Author: Matthias Clasen +Date: Mon Aug 16 15:28:36 2010 -0400 + + Fix a doc format issue + + glib/gregex.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d848a5eade18ba4567899601d5e34e381a636817 +Author: Matthias Clasen +Date: Mon Aug 16 15:16:16 2010 -0400 + + Update NEWS for 2.25.14 + + NEWS | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 8a3a4596e2e3a718d77bf214c6e2d16c21856da2 +Author: David Zeuthen +Date: Mon Aug 16 13:43:35 2010 -0400 + + Bug 626748 – Use async methods for writing and handle EAGAIN + + If sending a lot of data and/or the other peer is not reading it, then + socket buffers can overflow. This is communicated from the kernel by + returning EAGAIN. In GIO, it is modelled by g_output_stream_write() + and g_socket_send_message() returning G_IO_ERROR_WOULD_BLOCK. + + It is also problematic that that we're using synchronous IO in the + shared GDBus IO thread. It means that one GDBusConnection can lock up + others. + + It turns out that by porting from g_output_stream_write() to + g_output_stream_write_async() we fix the EAGAIN issue. For GSocket, we + still need to handle things manually (by creating a GSource) as + g_socket_send_message() is used. + + We check the new behavior in Michael's producer/consumer test case (at + /gdbus/overflow in gdbus-peer.c) added in the last commit. + + Also add a test case that sends and receives a 20 MiB message. + + Also add a new `transport' G_DBUS_DEBUG option so it is easy to + inspect partial writes: + + $ G_DBUS_DEBUG=transport ./gdbus-connection -p + /gdbus/connection/large_message + [...] + ======================================================================== + GDBus-debug:Transport: + >>>> WROTE 128000 bytes of message with serial 4 and + size 20971669 from offset 0 on a GSocketOutputStream + ======================================================================== + GDBus-debug:Transport: + >>>> WROTE 128000 bytes of message with serial 4 and + size 20971669 from offset 128000 on a GSocketOutputStream + ======================================================================== + GDBus-debug:Transport: + >>>> WROTE 128000 bytes of message with serial 4 and + size 20971669 from offset 256000 on a GSocketOutputStream + [...] + ======================================================================== + GDBus-debug:Transport: + >>>> WROTE 43669 bytes of message with serial 4 and + size 20971669 from offset 20928000 on a GSocketOutputStream + [...] + ======================================================================== + GDBus-debug:Transport: + <<<< READ 16 bytes of message with serial 3 and + size 20971620 to offset 0 from a GSocketInputStream + ======================================================================== + GDBus-debug:Transport: + <<<< READ 15984 bytes of message with serial 3 and + size 20971620 to offset 16 from a GSocketInputStream + ======================================================================== + GDBus-debug:Transport: + <<<< READ 16000 bytes of message with serial 3 and + size 20971620 to offset 16000 from a GSocketInputStream + [...] + ======================================================================== + GDBus-debug:Transport: + <<<< READ 144000 bytes of message with serial 3 and + size 20971620 to offset 20720000 from a GSocketInputStream + ======================================================================== + GDBus-debug:Transport: + <<<< READ 107620 bytes of message with serial 3 and + size 20971620 to offset 20864000 from a GSocketInputStream + OK + + https://bugzilla.gnome.org/show_bug.cgi?id=626748 + + Signed-off-by: David Zeuthen + + docs/reference/gio/overview.xml | 4 + + gio/gdbusprivate.c | 589 + ++++++++++++++++++++++++++++++--------- + gio/gdbusprivate.h | 1 + + gio/tests/gdbus-connection.c | 80 ++++++ + gio/tests/gdbus-peer.c | 76 ++++-- + 5 files changed, 596 insertions(+), 154 deletions(-) + +commit a6264a3a19c29fc7c4fe0719a8c2ff1554924b12 +Author: David Zeuthen +Date: Mon Aug 16 12:30:25 2010 -0400 + + GSocket: Properly initialize msg.msg_control + + This patch fixes this problem + + Syscall param socketcall.sendmsg(msg.msg_control) points to + uninitialised byte(s) + at 0x3D5B00EA60: __sendmsg_nocancel (syscall-template.S:82) + by 0x53F9790: g_socket_send_message (gsocket.c:2918) + by 0x540FDD0: g_unix_connection_send_credentials + (gunixconnection.c:351) + by 0x542B93F: _g_dbus_auth_run_client (gdbusauth.c:618) + by 0x5438001: initable_init (gdbusconnection.c:2191) + by 0x53E09CC: g_initable_init (ginitable.c:105) + by 0x543F6E9: g_bus_get_sync (gdbusconnection.c:6091) + by 0x402C7E: test_connection_life_cycle (gdbus-connection.c:126) + by 0x4C7CABB: test_case_run (gtestutils.c:1174) + by 0x4C7CD84: g_test_run_suite_internal (gtestutils.c:1223) + by 0x4C7CE49: g_test_run_suite_internal (gtestutils.c:1233) + by 0x4C7CE49: g_test_run_suite_internal (gtestutils.c:1233) + Address 0x7fefff9fc is on thread 1's stack + + Signed-off-by: David Zeuthen + + gio/gsocket.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 4bc4590c7bb5d8e7c248347e4b702ab8b506d937 +Author: Matthias Clasen +Date: Mon Aug 16 10:21:38 2010 -0400 + + Declare stream base classes as abstract + + gio/gfilterinputstream.c | 2 +- + gio/gfilteroutputstream.c | 2 +- + gio/ginputstream.c | 2 +- + gio/giostream.c | 2 +- + gio/goutputstream.c | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +commit 547311bfd8661e25e588e1f434f15c5f2f32c3a7 +Author: Dan Winship +Date: Thu Jun 24 13:09:14 2010 -0400 + + Always do async vs sync correctly in GSocketConnection streams + + Previously if a GSocketConnection had a blocking GSocket, it would + sometimes block during asynchonous I/O, and if it had a non-blocking + socket, it would sometimes return G_IO_ERROR_WOULD_BLOCK from + synchronous I/O. This fixes the connection to not depend on the socket + state. + + https://bugzilla.gnome.org/show_bug.cgi?id=616458 + + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gsocket.c | 70 + +++++++++++++++++++++++++++++++++-- + gio/gsocket.h | 13 ++++++ + gio/gsocketinputstream.c | 16 ++++--- + gio/gsocketoutputstream.c | 16 ++++--- + 6 files changed, 101 insertions(+), 18 deletions(-) + +commit 17fea2f749a407a15a82977b3488530cd5305266 +Author: Dan Winship +Date: Sun Aug 15 07:57:37 2010 -0400 + + Belatedly add g_socket_client_get/set_timeout to docs and symbols + + docs/reference/gio/gio-sections.txt | 2 ++ + gio/gio.symbols | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +commit b76b24f1b3f82c2400cce8948b44ae32aa0e23ee +Author: Dan Winship +Date: Sat Aug 14 16:15:39 2010 -0400 + + GSocketClient: plug two leaks + + g_socket_client_connect_async() was always leaking its GCancellable, + and would also leak any GSocket that eventually failed to connect + after returning G_IO_ERROR_PENDING. + + gio/gsocketclient.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 16bafb479995e69417b86b5b26682ec7c2ceb5a0 +Author: Dan Winship +Date: Sat Aug 14 15:04:24 2010 -0400 + + GSocketClient: add a timeout property + + GSocket has a timeout flag now, but when using GSocketClient there was + no way to set the timeout until after connecting (or failing). Fix + that by adding a timeout property to GSocketClient. + + gio/gsocketclient.c | 69 + ++++++++++++++++++++++++++++++++++++++++++++++++- + gio/gsocketclient.h | 3 ++ + gio/tests/send-data.c | 5 +++ + 3 files changed, 76 insertions(+), 1 deletions(-) + +commit 28a4fff7ec63000238c7e20ff965238027922c47 +Author: Will Thompson +Date: Fri Aug 13 23:34:44 2010 -0400 + + Add examples for GAsyncInitiable and GSimpleAsyncResult + + Bug 602417 + + gio/gasyncinitable.c | 94 +++++++++++++++++++++++++++++++++++++++++ + gio/gsimpleasyncresult.c | 104 + +++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 197 insertions(+), 1 deletions(-) + +commit 7a32e34f7c46a4e1e2fe6f35490b1f8469ed08b7 +Author: Will Thompson +Date: Fri Aug 13 23:20:06 2010 -0400 + + Document that _complete() et al. ref the GSimpleAsyncResult + + gio/gsimpleasyncresult.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit ec31612ea00e2babd5d6b02d65966164594a03f8 +Author: Will Thompson +Date: Fri Aug 13 23:15:27 2010 -0400 + + _simple_async_result_is_valid: allow tag to be NULL + + Because g_simple_async_report_[g]error_in_idle() don't take a + source tag + parameter, code that uses them can't currently use + g_simple_async_result_is_valid() (at least, not for the error case). + + Bug 602417 + + gio/gsimpleasyncresult.c | 13 ++++++++----- + 1 files changed, 8 insertions(+), 5 deletions(-) + +commit c29d800d84d446d3762329815824a8be269c969b +Author: Simon McVittie +Date: Fri Aug 13 22:42:24 2010 -0400 + + GVariant: be more explicit about adopting and returning floating refs + + Bug: https://bugzilla.gnome.org/show_bug.cgi?id=622770 + + docs/reference/glib/gvariant-varargs.xml | 4 ++- + glib/gvariant.c | 53 + +++++++++++++++++++----------- + 2 files changed, 37 insertions(+), 20 deletions(-) + +commit e02571e93bb4c1986ec1190fb6c7d02eba0c746a +Author: Matthias Clasen +Date: Fri Aug 13 21:22:45 2010 -0400 + + Add bug references to some tests + + gio/tests/async-close-output-stream.c | 8 ++++++++ + gio/tests/converter-stream.c | 4 ++++ + glib/tests/mem-overflow.c | 29 + +++++++++++++++++++++++++++++ + gobject/tests/binding.c | 4 ++++ + 4 files changed, 45 insertions(+), 0 deletions(-) + +commit ea8a963936655ee3c13c5552cce96c309f8a384f +Author: Matthias Clasen +Date: Fri Aug 13 21:21:43 2010 -0400 + + Document vendor override files + + Features without documentation, tsk tsk. + + docs/reference/gio/glib-compile-schemas.xml | 6 +++ + gio/gsettings.c | 48 + +++++++++++++++++++-------- + 2 files changed, 40 insertions(+), 14 deletions(-) + +commit 63d19f065690b77059c335c0378a93f1a18b09c9 +Author: Matthias Clasen +Date: Fri Aug 13 21:05:05 2010 -0400 + + Fix doc format errors + + glib/gconvert.c | 4 ++-- + glib/gregex.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 4160c5c74a06404037462dde572ec49663d685ea +Author: Matthias Clasen +Date: Fri Aug 13 19:40:48 2010 -0400 + + Add tests for async file replace and load + + gio/tests/file.c | 151 + +++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 143 insertions(+), 8 deletions(-) + +commit c003468296642dccdca230e5fbec22ceab0a9959 +Author: Matthias Clasen +Date: Fri Aug 13 17:22:28 2010 -0400 + + Correct a comment + + gio/inotify/inotify-kernel.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 93bd5298c7f78fd7cb12734b6f3df5aa93f2c82b +Author: Matthias Clasen +Date: Fri Aug 13 17:21:22 2010 -0400 + + Add an async file create/write/read/delete test + + gio/tests/file.c | 163 + +++++++++++++++++++++++++++++++++++++++++++++++------ + 1 files changed, 144 insertions(+), 19 deletions(-) + +commit 7ed4762190afca85424903a0977300585169b510 +Author: Matthias Clasen +Date: Fri Aug 13 17:19:01 2010 -0400 + + Fix a typo, and some doc reformatting + + gio/ginputstream.c | 32 ++++++++++++++++---------------- + 1 files changed, 16 insertions(+), 16 deletions(-) + +commit effdb785fd941daf5fdec7df434242de25e5127e +Author: Matthias Clasen +Date: Fri Aug 13 16:04:04 2010 -0400 + + Add some long descriptions for filter streams + + gio/gfilterinputstream.c | 4 ++++ + gio/gfilteroutputstream.c | 6 +++++- + 2 files changed, 9 insertions(+), 1 deletions(-) + +commit 13e55b84ebb1aa148260a7d21da6a592d1e1dadb +Author: Matthias Clasen +Date: Fri Aug 13 15:15:21 2010 -0400 + + Run volumemonitor test with local vfs + + This is an attempt to stop the test from hanging on some build bots + in build.gnome.org. + + gio/tests/volumemonitor.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit d344ff9d67a7e723a1c2163e7d9254dd6ef049d2 +Author: David Zeuthen +Date: Fri Aug 13 13:58:27 2010 -0400 + + Bug 626841 – Add test-case for non-socket GIOStream + + Also fix a couple of bugs so it actually works. + + https://bugzilla.gnome.org/show_bug.cgi?id=626841 + + Signed-off-by: David Zeuthen + + gio/gdbusprivate.c | 146 +++++++++--------- + gio/tests/Makefile.am | 6 +- + gio/tests/gdbus-non-socket.c | 346 + ++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 427 insertions(+), 71 deletions(-) + +commit 9be94e88999b5f10347b5c1b8542b88a35d3f93a +Author: Michael Meeks +Date: Fri Aug 13 17:56:19 2010 +0100 + + Add test for EAGAIN overflow in gdbusconnection based on David's test. + + gio/tests/gdbus-peer.c | 110 + +++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 109 insertions(+), 1 deletions(-) + +commit 5d9d3f03182d732ad732370dffc7d268c9d65e9d +Author: Matthias Clasen +Date: Fri Aug 13 12:04:21 2010 -0400 + + Add some async file tests + + gio/tests/file.c | 237 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 237 insertions(+), 0 deletions(-) + +commit ee38c03582df8b757c2fe64b3b5a6be9b6083135 +Author: Matthias Clasen +Date: Fri Aug 13 00:47:02 2010 -0400 + + Collect NEWS for 2.25.14 + + NEWS | 24 ++++++++++++++++++++++++ + 1 files changed, 24 insertions(+), 0 deletions(-) + +commit ef4b0afc0b3217ce65e12c0606855af52659490b +Author: Matthias Clasen +Date: Fri Aug 13 00:30:58 2010 -0400 + + Bump version + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 106bde0a8fa34a72f66f037b0428a3105cb953bc +Author: Havoc Pennington +Date: Thu Aug 12 23:57:26 2010 -0400 + + GAsyncQueue: use g_queue_init() not g_queue_new() + + By using g_queue_init() instead of g_queue_new(), we can avoid + a separate memory allocation. + + Bug 626704 + + glib/gasyncqueue.c | 28 ++++++++++++++-------------- + 1 files changed, 14 insertions(+), 14 deletions(-) + +commit f424aa9581ff4fedb9205f360112b6b17518edeb +Author: Daniel Nylander +Date: Thu Aug 12 13:19:50 2010 +0200 + + Updated Swedish translation + + po/sv.po | 2135 + ++++++++++++++++++++++++++++++++++++-------------------------- + 1 files changed, 1226 insertions(+), 909 deletions(-) + +commit 398f9841eddc10e0e6b1ccee4823e2ea3650bd9a +Author: Tor Lillqvist +Date: Tue Aug 10 16:01:39 2010 +0300 + + Fix gio/win32 build after -I flag changes + + gio/win32/gwin32directorymonitor.c | 1 - + gio/win32/gwin32directorymonitor.h | 4 ++-- + gio/win32/gwinhttpfile.c | 8 ++++---- + gio/win32/gwinhttpfileinputstream.c | 4 ++-- + gio/win32/gwinhttpfileoutputstream.c | 4 ++-- + gio/win32/gwinhttpvfs.c | 6 +++--- + gio/win32/gwinhttpvfs.h | 3 +-- + 7 files changed, 14 insertions(+), 16 deletions(-) + +commit 304c0c4746fb8df993a3e6429414d6cf1ba287b8 +Author: Aron Xu +Date: Mon Aug 9 14:26:38 2010 +0800 + + Update Simplified Chinese translation. + + po/zh_CN.po | 594 + ++++++++++++++++++++++++++++++++++++++++------------------- + 1 files changed, 405 insertions(+), 189 deletions(-) + +commit 43c0aa9ebe16cf17009678732decc9e852701f15 +Author: Matthias Clasen +Date: Sun Aug 8 23:53:52 2010 -0400 + + Replace the explicit list of character categories by a reference + to the GUnicodeType docs. + + docs/reference/glib/regex-syntax.sgml | 124 + +-------------------------------- + 1 files changed, 3 insertions(+), 121 deletions(-) + +commit 4e42893369c8b8092de7feedb447ca538f8dccf2 +Author: Matthias Clasen +Date: Sun Aug 8 23:43:29 2010 -0400 + + Refer to GUnicodeScript docs instead of listing scripts explicitly + + docs/reference/glib/regex-syntax.sgml | 80 + ++++---------------------------- + 1 files changed, 10 insertions(+), 70 deletions(-) + +commit 733d209b14f1b88288e08241a64ef77284108505 +Author: Matthias Clasen +Date: Sun Aug 8 23:21:54 2010 -0400 + + Move GRegex docs inline + + docs/reference/glib/tmpl/gregex.sgml | 290 + ++++++++++------------------------ + glib/gregex.c | 60 +++++++ + glib/gregex.h | 225 ++++++++++++++++++++++++++ + 3 files changed, 365 insertions(+), 210 deletions(-) + +commit c3e5b3cca883546a40a5d7aa219c74cb6574bcd6 +Author: Matthias Clasen +Date: Sun Aug 8 22:19:10 2010 -0400 + + Whitespace cleanup + + glib/gregex.c | 1067 + ++++++++++++++++++++++++++++----------------------------- + 1 files changed, 533 insertions(+), 534 deletions(-) + +commit de3c6efa222389ef253fbe1b7b868b95a37aedb1 +Author: Matthias Clasen +Date: Sun Aug 8 22:15:16 2010 -0400 + + Remove two redundant comments + + glib/garray.c | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +commit b5bda64a730876205ce5aae069f11161d6b94cc4 +Author: Matthias Clasen +Date: Sun Aug 8 22:14:56 2010 -0400 + + Fix up a doc typo + + glib/gbase64.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit f5a58639759af5333990a24ef6c8275c8f5afcde +Author: Matthias Clasen +Date: Sun Aug 8 22:12:40 2010 -0400 + + Minor cleanup + + The definition is now present in pcre.h + + glib/gregex.c | 5 ----- + 1 files changed, 0 insertions(+), 5 deletions(-) + +commit def0dc01f74e9b8b0904c6b8866835f9efb640a8 +Author: Matthias Clasen +Date: Sun Aug 8 22:11:38 2010 -0400 + + Move GConvert docs inline + + docs/reference/glib/tmpl/conversions.sgml | 174 + ++--------------------------- + glib/gconvert.c | 121 ++++++++++++++++++++ + glib/gconvert.h | 28 +++++- + 3 files changed, 157 insertions(+), 166 deletions(-) + +commit f837e15972d7cd93ac8bddbaeed60289c7263c1a +Author: A S Alam +Date: Tue Aug 10 06:24:02 2010 +0530 + + update translation for master + + po/pa.po | 1808 + ++++++++++++++++++++++++++++++++++++-------------------------- + 1 files changed, 1048 insertions(+), 760 deletions(-) + +commit f9a4b4ecc7a0f838897797dc5b478520c9f05168 +Author: Matthias Clasen +Date: Sun Aug 8 21:29:26 2010 -0400 + + Add introspection annotations in gregex.c + + Also, make the new getters follow the style of other GRegex getters, + and take a const GRegex *. + + glib/gregex.c | 192 + +++++++++++++++++++++++++++++---------------------------- + glib/gregex.h | 4 +- + 2 files changed, 100 insertions(+), 96 deletions(-) + +commit 14e0ad7c5379e14f31a0e54bc2bf73f3c2d07d0d +Author: Matthias Clasen +Date: Sun Aug 8 20:49:59 2010 -0400 + + Don't compile some unused functions in gio/xdgmime/ + + gio/xdgmime/xdgmime.c | 22 +++++++++++++++++++++- + gio/xdgmime/xdgmime.h | 14 ++++++++++++-- + gio/xdgmime/xdgmimealias.c | 4 +++- + gio/xdgmime/xdgmimealias.h | 3 ++- + gio/xdgmime/xdgmimecache.c | 8 +++++++- + gio/xdgmime/xdgmimecache.h | 6 ++++++ + gio/xdgmime/xdgmimeglob.c | 7 +++++++ + gio/xdgmime/xdgmimeglob.h | 2 ++ + gio/xdgmime/xdgmimeicon.c | 2 ++ + gio/xdgmime/xdgmimeicon.h | 2 ++ + gio/xdgmime/xdgmimeparent.c | 2 ++ + gio/xdgmime/xdgmimeparent.h | 2 ++ + glib/pcre/pcre_compile.c | 4 +++- + glib/pcre/pcre_get.c | 2 +- + glib/pcre/pcre_ucp_searchfuncs.c | 4 +++- + 15 files changed, 75 insertions(+), 9 deletions(-) + +commit 7acdaf6f1db90c17985b81033050e1814723d6ae +Author: Matthias Clasen +Date: Sun Aug 8 18:35:12 2010 -0400 + + Don't compile an unused function + + glib/pcre/pcre_compile.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 3fd1fc4f9a8511587637efc9b0942e4919fab031 +Author: Matthias Clasen +Date: Sun Aug 8 18:34:59 2010 -0400 + + Trivial typo fix + + glib/gregex.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c9916d64b1cf996a4cdb9f8887972038b492426d +Author: Matthias Clasen +Date: Sun Aug 8 18:34:38 2010 -0400 + + Improve regex test coverage + + glib/tests/regex.c | 559 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 558 insertions(+), 1 deletions(-) + +commit 584787f580cf6e36c020b7d7ee0a01baea8896aa +Author: Matthias Clasen +Date: Sun Aug 8 11:32:50 2010 -0400 + + Improve the async result test coverage + + gio/tests/simple-async-result.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 7c129c901121b2ca8374d64c716828101ce79cb9 +Author: Matthias Clasen +Date: Sun Aug 8 11:31:53 2010 -0400 + + Improve dbus address test coverage + + gio/tests/gdbus-addresses.c | 32 ++++++++++++++++++++++++++++++++ + 1 files changed, 32 insertions(+), 0 deletions(-) + +commit ae8b375f0ffe4c26c366728a33b04167d3f1fd1b +Author: Fran Diéguez +Date: Mon Aug 9 01:11:59 2010 +0200 + + Updated galician translations + + po/gl.po | 11 +++++++++-- + 1 files changed, 9 insertions(+), 2 deletions(-) + +commit bbd1d2a72429929d15c0764853addcf3a6a8bead +Author: Matthias Clasen +Date: Sun Aug 8 01:09:18 2010 -0400 + + Improve regex test coverage + + glib/tests/regex.c | 66 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 66 insertions(+), 0 deletions(-) + +commit 6ada7532b5e8d3c613e26144afbf4c38367afd90 +Author: Matthias Clasen +Date: Sun Aug 8 01:08:34 2010 -0400 + + Drop some unused code + + Some functions in pcre_get.c are not used. + + glib/pcre/pcre_get.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 8804d6a98ffabc83bea2a35d4aaf26617fa062f0 +Author: Matthias Clasen +Date: Sun Aug 8 01:07:53 2010 -0400 + + Simplify gcov generation + + lcov seems to handle .libs just fine on its own. + + Makefile.decl | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +commit 01cae84e47ff749e475d7931106c8b00829021e5 +Author: Ryan Lortie +Date: Sat Aug 7 19:58:12 2010 -0400 + + Bug 578295 - gtester has a race condition + + Deal with the race in GMainLoop by installing a do-nothing timeout. + + glib/gtester.c | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit 51ad83f7119bcf43d5e9b6b89fd3f33bd9ab1e3d +Author: Matthias Clasen +Date: Sat Aug 7 18:56:12 2010 -0400 + + Make g_dbus_error_unregister_error work + + gio/gdbuserror.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 8e236f7ec1e0f620a516255a6b8ed7ae169bc87e +Author: Matthias Clasen +Date: Sat Aug 7 18:55:21 2010 -0400 + + Add some more test about gdbus_error apis + + gio/tests/gdbus-error.c | 71 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 71 insertions(+), 0 deletions(-) + +commit 7de6658f74a43065fa9a27db6cb4d26b6a946a32 +Author: Matthias Clasen +Date: Sat Aug 7 17:08:54 2010 -0400 + + Make g_simple_async_result_is_valid work without source + + The problem was pointed out by Xavier Claessens in bug 626208. + + gio/gsimpleasyncresult.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 402ad1958ccdb4586da9614ec4276396fd4c0faf +Author: Matthias Clasen +Date: Sat Aug 7 16:27:38 2010 -0400 + + Make the closure variants of name owning and watching actually work + + The GClosure API is a bit funky (and badly documented), and requires + you to set a marshaller on the closure, and the marshaller has an + implicit 'this' argument, and the caller is reponsible for unsetting + the values after invoking the closure. + + I've added some calls of the _with_closures variants to the + gdbus-names test now. + + gio/gdbusnameowning.c | 92 + ++++++++++++++++++++++++++-------------------- + gio/gdbusnamewatching.c | 76 ++++++++++++++++++++------------------- + gio/gio-marshal.list | 2 + + gio/tests/gdbus-names.c | 57 ++++++++++++++++++----------- + 4 files changed, 128 insertions(+), 99 deletions(-) + +commit c15d20e53a9fdccd4fbe17c6a51c57e6b34410fd +Author: Kjartan Maraas +Date: Sat Aug 7 18:43:01 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 179 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 115 insertions(+), 64 deletions(-) + +commit 4ac7f8f08433c37cf0a69cdea601514a0c06c1b6 +Author: Benjamin Otte +Date: Fri Aug 6 23:15:28 2010 +0200 + + notifyqueue: Dedup pspecs when adding + + The previous code dedup'd when thawing and threw nasty warnings + your way + if you notified too often. This can now easily be avoided. + + Performance should be roughly identical, as both are O(n²). + + gobject/gobjectnotifyqueue.c | 23 +++++++---------------- + 1 files changed, 7 insertions(+), 16 deletions(-) + +commit e88eb048659be2e09081a27ddaef0e261667b6b8 +Author: Ryan Lortie +Date: Fri Aug 6 16:48:03 2010 -0400 + + Prepare to release glib 2.25.13 + + NEWS | 67 + +++++++++++++++++++++++++++++ + docs/reference/glib/tmpl/glib-unused.sgml | 40 ----------------- + docs/reference/glib/tmpl/messages.sgml | 27 +++++++++--- + docs/reference/glib/tmpl/version.sgml | 41 +++++++++++++++++ + 4 files changed, 129 insertions(+), 46 deletions(-) + +commit 80046f36e0ed2fe3d12c3128145033043f46734d +Author: Ryan Lortie +Date: Fri Aug 6 16:42:36 2010 -0400 + + gitignore update + + glib/tests/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit d96b7c5c8aacc2b8516c03a2801db731d4171570 +Author: Ryan Lortie +Date: Fri Aug 6 15:28:58 2010 -0400 + + gtester: Run tests only once on 'make check' + + The gtester makefile runs 'make test' on 'make check' and also + recurses + on 'make test'. automake recurses on 'make check'. + + This means that every level of recursive make that we go through + results + in the tests running twice as many times. If you type 'make check' at + the toplevel, for example, tests in gio/tests/ run 4 times. + + Fix that by introducing a 'test-nonrecursive' target and using + that one + from 'make check'. 'make test', 'make test-report', etc. are still + recursive. + + Makefile.decl | 15 ++++++++++----- + 1 files changed, 10 insertions(+), 5 deletions(-) + +commit b91f9274d9de1e9f0a1b407913ab893cfe1d5b25 +Author: Ryan Lortie +Date: Fri Aug 6 13:12:20 2010 -0400 + + Fix volumemonitor test case + + Don't blindly g_object_unref() that which may be NULL. + + gio/tests/volumemonitor.c | 13 +++++++++---- + 1 files changed, 9 insertions(+), 4 deletions(-) + +commit 889a7f81dd808d35a17baa53a87255ef588d27da +Author: Ryan Lortie +Date: Fri Aug 6 13:11:38 2010 -0400 + + gio.symbols: add g_dbus_message_[gs]et_byte_order + + gio/gio.symbols | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 5e044a943c96967841c3c341ac5975c36064d640 +Author: Ryan Lortie +Date: Fri Aug 6 13:11:20 2010 -0400 + + typo fix: Dist the data for the test cases + + change 'dist_hook:' to 'dist-hook:' + + glib/tests/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b3b7ea8e227035ae27d6ac62595478d27b8152e8 +Author: Ryan Lortie +Date: Fri Aug 6 13:09:26 2010 -0400 + + Replace -I with $(glib_INCLUDES) and friends + + Stop using ad hoc -I in all of our Makefile.am. Use the new variables + instead. + + docs/reference/gio/Makefile.am | 10 +--------- + docs/reference/gobject/Makefile.am | 5 +---- + gio/Makefile.am | 6 +----- + gio/fam/Makefile.am | 5 +---- + gio/fen/Makefile.am | 6 +----- + gio/inotify/Makefile.am | 6 +----- + gio/libasyncns/Makefile.am | 2 +- + gio/tests/Makefile.am | 7 +------ + gio/win32/Makefile.am | 6 +----- + glib/Makefile.am | 2 +- + glib/gnulib/Makefile.am | 3 +-- + glib/libcharset/Makefile.am | 2 +- + glib/pcre/Makefile.am | 5 +---- + glib/tests/Makefile.am | 4 +--- + glib/update-pcre/Makefile.am-1 | 4 +--- + gmodule/Makefile.am | 5 +---- + gobject/Makefile.am | 5 +---- + gobject/tests/Makefile.am | 2 +- + gthread/Makefile.am | 5 +---- + gthread/tests/Makefile.am | 2 +- + tests/Makefile.am | 5 +---- + tests/gobject/Makefile.am | 5 +---- + tests/refcount/Makefile.am | 5 +---- + 23 files changed, 23 insertions(+), 84 deletions(-) + +commit 8ad9d9dbe35973951faaf595b1fe847b6b180159 +Author: Ryan Lortie +Date: Fri Aug 6 13:07:31 2010 -0400 + + configure.ac: define glib_INCLUDES and friends + + These macros should be used instead of -I for things in the tree that + depend on various bits of glib. + + also gobject_INCLUDES, gthread_INCLUDES, gmodule_INCLUDES, + gio_INCLUDES + + configure.ac | 39 +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 39 insertions(+), 0 deletions(-) + +commit ba0208b3a8076f8c3c545ba5716347ad446525f7 +Author: Ryan Lortie +Date: Fri Aug 6 13:05:18 2010 -0400 + + Clean up improper #includes + + We have a lot of broken #including going on around the tree. This has + gone unnoticed due to our sloppy use of -I. + + gio/fam/fam-helper.c | 2 +- + gio/fam/fam-module.c | 2 +- + gio/fam/gfamdirectorymonitor.c | 2 +- + gio/fam/gfamdirectorymonitor.h | 4 ++-- + gio/fam/gfamfilemonitor.c | 2 +- + gio/fam/gfamfilemonitor.h | 4 ++-- + gio/fen/fen-helper.c | 2 +- + gio/fen/fen-node.c | 2 +- + gio/fen/gfendirectorymonitor.c | 2 +- + gio/fen/gfendirectorymonitor.h | 4 ++-- + gio/inotify/ginotifydirectorymonitor.c | 2 +- + gio/inotify/ginotifydirectorymonitor.h | 4 ++-- + gio/tests/application.c | 2 +- + gio/tests/gschema-compile.c | 2 +- + gio/tests/testapp.c | 2 +- + 15 files changed, 19 insertions(+), 19 deletions(-) + +commit 78f7f14b34b4c04742fc848eec536ffdb8c8ab01 +Author: Ryan Lortie +Date: Fri Aug 6 10:53:07 2010 -0400 + + Don't dist 'glibconfig.h' + + This is causing very serious problems when doing out-of-tree + builds from + tarballs on architectures that are different from the architecture + that + the tarball was created on. + + This commit breaks the build in those cases, but I'll fix that in the + next commits. + + https://bugzilla.gnome.org/show_bug.cgi?id=626107 + + glib/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 25c6bdc22add2f306c24e5200de2899f39f86c48 +Author: Ryan Lortie +Date: Fri Aug 6 10:29:32 2010 -0400 + + error test case: don't double-free the source + + g_propagate_prefixed_error() frees the source already, don't + g_error_free() it. + + glib/tests/error.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit a1b015f7b70b3851d5a6e45fd4114c7723b4f1ea +Author: Hannes Müller +Date: Thu Aug 5 23:11:03 2010 +0200 + + avoid warning in gutils.h when using gcc with -Wconversion + + https://bugzilla.gnome.org/show_bug.cgi?id=619026 + + glib/gutils.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 970d0634e9ade050158bdb529a6f8a7deb8fb319 +Author: Fran Diéguez +Date: Thu Aug 5 15:36:39 2010 +0200 + + Updated Galician translations + + po/gl.po | 234 + +++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 149 insertions(+), 85 deletions(-) + +commit c789f72f9dfb6dcb86c536dfa6f65e5a7e5c72f4 +Author: Claude Paroz +Date: Thu Aug 5 15:17:40 2010 +0200 + + Updated French translation + + Contributed by Gérard Baylard and Claude Paroz + + po/fr.po | 2016 + +++++++++++++++++++++++++++++++++++++------------------------- + 1 files changed, 1220 insertions(+), 796 deletions(-) + +commit 9f6faaffb6491a8de5508b7678ab48fee4f59efa +Author: paul +Date: Thu Aug 5 09:08:34 2010 -0400 + + Add $(top_builddir)/glib to includes + + This is required to find glibconfig.h during srcdir != builddir builds + + gio/Makefile.am | 1 + + gio/tests/Makefile.am | 1 + + glib/gnulib/Makefile.am | 3 ++- + glib/tests/Makefile.am | 1 + + gmodule/Makefile.am | 1 + + gobject/Makefile.am | 1 + + gobject/tests/Makefile.am | 2 +- + gthread/Makefile.am | 1 + + tests/Makefile.am | 1 + + tests/gobject/Makefile.am | 1 + + tests/refcount/Makefile.am | 1 + + 11 files changed, 12 insertions(+), 2 deletions(-) + +commit 38c3f9964c2c0b7243cf5033ffc1d197c292b337 +Author: Jorge González +Date: Thu Aug 5 12:11:05 2010 +0200 + + Updated Spanish translation + + po/es.po | 238 + ++++++++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 156 insertions(+), 82 deletions(-) + +commit abe820e0d935f41744292146c71ccc4cf479751e +Author: Philip Withnall +Date: Mon Aug 2 14:14:11 2010 +0100 + + Expand documentation about error quark naming + + Closes: bgo#625827 + + docs/reference/glib/tmpl/error_reporting.sgml | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 008615f9999641158a89e3e6163b1580cac53dd0 +Author: Matthias Clasen +Date: Thu Aug 5 02:23:42 2010 -0400 + + Test an option handling corner-case + + glib/tests/option-context.c | 59 + ++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 58 insertions(+), 1 deletions(-) + +commit e2657d8dce32e10869ec2b18edc7dbf489dd2941 +Author: Matthias Clasen +Date: Thu Aug 5 02:01:58 2010 -0400 + + Add a not about arguments beginning with dashes + + glib/goption.c | 28 +++++++++++++++------------- + 1 files changed, 15 insertions(+), 13 deletions(-) + +commit e4994cb0a10c35f373b17ef970e2f8e4034d387c +Author: Yaron Shahrabani +Date: Thu Aug 5 09:14:40 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 205 + ++++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 133 insertions(+), 72 deletions(-) + +commit 84d3aa652f4e5853d5612bd4b189c2146168f038 +Author: Matthias Clasen +Date: Thu Aug 5 01:53:15 2010 -0400 + + Beautify configure output + + Checking for cpp before using it avoids somewhat ugly + nested output. Pointed out in bug 593544. + + configure.ac | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 530f67384ea656ef9a5d8c05df5c35a9bf2a5ec0 +Author: Matthias Clasen +Date: Thu Aug 5 01:45:26 2010 -0400 + + Modernize pkg-config check + + As pointed out in bug 599590, our hand-rolled check fails to find + cross-complication variants of pkg-config like + i686-pc-mingw32-pkg-config. + + configure.ac | 14 +------------- + 1 files changed, 1 insertions(+), 13 deletions(-) + +commit 3e8a9c7b52211ad1991711e02d682dc6e03439c6 +Author: Matthias Clasen +Date: Thu Aug 5 01:39:02 2010 -0400 + + Add missing files + + Reported in bug 624739 + + po/POTFILES.in | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit d52e1c33f71a28908dac3658a8d5394e333324fc +Author: David Zeuthen +Date: Wed Aug 4 16:59:26 2010 -0400 + + GDBus: Add `return' debug option + + This prints all GDBusMethodInvocation API usage and is normally used + with the `incoming' option. Example: + + # G_DBUS_DEBUG=incoming,return ./polkitd --replace + Entering main event loop + Connected to the system bus + Registering null backend at priority -10 + [...] + Acquired the name org.freedesktop.PolicyKit1 + [...] + + ======================================================================== + GDBus-debug:Incoming: + <<<< METHOD INVOCATION + org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent() + on object /org/freedesktop/PolicyKit1/Authority + invoked by name :1.26 + serial 299 + ======================================================================== + GDBus-debug:Return: + >>>> METHOD ERROR org.freedesktop.PolicyKit1.Error.Failed + message `Cannot determine session the caller is in' + in response to + org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent() + on object /org/freedesktop/PolicyKit1/Authority + to name :1.26 + reply-serial 299 + + [...] + + ======================================================================== + GDBus-debug:Incoming: + <<<< METHOD INVOCATION + org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent() + on object /org/freedesktop/PolicyKit1/Authority + invoked by name :1.2402 + serial 25 + ======================================================================== + GDBus-debug:Return: + >>>> METHOD RETURN + in response to + org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent() + on object /org/freedesktop/PolicyKit1/Authority + to name :1.2402 + reply-serial 25 + + Signed-off-by: David Zeuthen + + docs/reference/gio/overview.xml | 10 ++++++++-- + gio/gdbusconnection.c | 6 ++++-- + gio/gdbusmethodinvocation.c | 37 + +++++++++++++++++++++++++++++++++++++ + gio/gdbusprivate.c | 13 +++++++++++-- + gio/gdbusprivate.h | 1 + + 5 files changed, 61 insertions(+), 6 deletions(-) + +commit 89a1b571adde644664093dd4763fb9aa077dfafc +Author: David Zeuthen +Date: Wed Aug 4 14:38:51 2010 -0400 + + GDBusMessage: Validate header fields when serializing/deserializing + + The D-Bus spec mentions exactly what header fields are required for + various message types. Add tests for this as well. + + Also disallow empty interfaces for signals since the D-Bus spec says + this is Verboten already. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 5 - + gio/gdbusmessage.c | 119 ++++++++++++++++++++++++++++-- + gio/tests/gdbus-serialization.c | 155 + +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 268 insertions(+), 11 deletions(-) + +commit 6f070be65bb4bb665cb8a4c1f48cac59c1f4fba3 +Author: David Zeuthen +Date: Wed Aug 4 13:32:19 2010 -0400 + + GDBusMessage: Add a way to get/set byte order of a message + + Also use this in the test cases to check that serialization to and + from both big and little endian works. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 3 + + gio/gdbusmessage.c | 85 +++++++++++++++++---- + gio/gdbusmessage.h | 4 + + gio/gio.symbols | 1 + + gio/gioenums.h | 15 ++++ + gio/tests/gdbus-serialization.c | 139 + +++++++++++++++++++++-------------- + 6 files changed, 175 insertions(+), 72 deletions(-) + +commit 6e723e8b3e5f138f8e0b4fe45c5872a92510d5d3 +Author: David Zeuthen +Date: Wed Aug 4 12:24:22 2010 -0400 + + GDBusMessage: Assert various things when serializing to a blob + + We use g_assert() instead of setting the GError because it is a + programming error if the GVariant contains invalid data - see commit + 5e6f762d61db1a5c64bd1d33e5ba112755106581 for where the last hole in + GVariant was closed. + + So if we can trust GVariant to only contain valid data (ignoring the + case where unsafe API such as g_variant_new_from_data() is used), why + g_assert() at all with costly g_utf8_validate() checks? Because a) it + is relatively inexpensive; and b) it helps find bugs such as the one + fixed in commit 5e6f762d61db1a5c64bd1d33e5ba112755106581. + + If performance is a concern we can play games like introducing + environment variables or other machinery to avoid such "costly" + checks. I doubt it will ever be an issue. + + Also replace two "Hmm" TODO item with a static assert - the code that + serializes a gdouble into the D-Bus wire format by treating it as a + guint64 is indeed correct - endianess needs to be taken into account + (see the D-Bus reference implementation for similar code). But we want + to make sure that we're indeed using an architecture/compiler where a + gdouble takes up 8 bytes - hence the assertion. + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 14 ++++++++------ + 1 files changed, 8 insertions(+), 6 deletions(-) + +commit 5bd34a820eb79f0765e312215e0a3e0a339ace78 +Author: David Zeuthen +Date: Wed Aug 4 11:26:48 2010 -0400 + + GDBusMessage: Validate UTF-8 strings when serializing from blob + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 24 +++++++++- + gio/tests/gdbus-serialization.c | 88 + +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 109 insertions(+), 3 deletions(-) + +commit e62bc8e8f66c096829b282a53a769fbb55ab6b4d +Author: Dan Winship +Date: Wed Aug 4 07:36:04 2010 -0400 + + remove a junk line + + gio/tests/.gitignore | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 27bc1d60ebcbd1b6e887fde138840a9ddda7fc3b +Author: Kjartan Maraas +Date: Wed Aug 4 13:23:02 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 554 + ++++++++++++++++++++++++++++++++++++++++++-------------------- + 1 files changed, 376 insertions(+), 178 deletions(-) + +commit 4bc9654c63feee596de5aa214d7cbd8fc293cd9d +Author: Emmanuele Bassi +Date: Wed Aug 4 00:57:52 2010 +0100 + + binding: Add a default marshaller for the closure API + + The g_object_bind_property_with_closures() function should set a + marshaller if the two GClosures don't have one already. This + simplifies + the caller code and avoids duplication. + + We need to add a new marshaller to the gmarshal.list matching the + signature of the GBindingTransformFunc function. + + gobject/gbinding.c | 7 +++++++ + gobject/gclosure.c | 15 +++++++++++++++ + gobject/gmarshal.list | 1 + + gobject/gobject.symbols | 1 + + gobject/tests/binding.c | 39 --------------------------------------- + 5 files changed, 24 insertions(+), 39 deletions(-) + +commit f5cd8ddeaac7e6df484629b7ae54a86ffa155a05 +Author: David Zeuthen +Date: Tue Aug 3 15:36:16 2010 -0400 + + GDBusConnection: Debug messages when receiving signals and method + invocations + + Spell out "RECEIVED SIGNAL" instead of "SIGNAL" to emphasize this is + about receiving a signal, not emitting one (which is "SIGNAL + EMISSION"). Also make the "arrows" point in the "right" direction + ("<<<<" vs ">>>>") - like this: + + ======================================================================== + GDBus-debug:Signal: + <<<< RECEIVED SIGNAL org.freedesktop.DBus.NameOwnerChanged + on object /org/freedesktop/DBus + sent by name org.freedesktop.DBus + + and + + ======================================================================== + GDBus-debug:Incoming: + <<<< METHOD INVOCATION + org.freedesktop.PolicyKit1.Authority.EnumerateTemporaryAuthorizations() + on object /org/freedesktop/PolicyKit1/Authority + invoked by name :1.2176 + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 69341e2ba9a864ed2848527570988afc3e1c9df4 +Author: David Zeuthen +Date: Tue Aug 3 14:32:29 2010 -0400 + + glib-compile-schemas: Pass a C string, not a GString wrapper + + Commit 5e6f762d61db1a5c64bd1d33e5ba112755106581 (introducing UTF-8 + validity checks for GVariant instances containing strsings) actually + uncovered a bug in glib-compile-schemas - a GString was passed when a + C string was expected. + + Signed-off-by: David Zeuthen + + gio/gschema-compile.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5e6f762d61db1a5c64bd1d33e5ba112755106581 +Author: David Zeuthen +Date: Tue Aug 3 13:33:03 2010 -0400 + + GVariant: validate that passed string is UTF-8 + + As discussed with Ryan on IRC. + + This check is crucial because it guarantees that + g_variant_get_string() will _always_ return valid UTF-8. Except in + cases where the programmer used unsafe API such as + g_variant_new_from_data() and setting @trusted to TRUE. + + In fact, this check revealed a flaw in my polkit gdbus port + + (lt-polkitd:11632): GLib-CRITICAL **: g_variant_new_string: assertion + `g_utf8_validate (string, len, NULL)' failed + + and with this I could easily find the problem by using gdb(1) and + G_DBUS=fatal-warnings. + + Without this check we'd pass the non-UTF8 string all the way to the + message bus and the bus would then disconnect us. So instead I was + seeing + + g_dbus_connection_real_closed: Remote peer vanished with error: + Underlying GIOStream returned 0 bytes on an async read + (g-io-error-quark, 0). Exiting. + + and then SIGTERM as raised by g_dbus_connection_real_closed() and my + polkitd process would exit. This behavior is much harder to debug than + failing early (as this patch implements). + + Signed-off-by: David Zeuthen + + glib/gvariant.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 86d947f01fba4b79aa9f0bdcea9d510f5411ea4b +Author: David Zeuthen +Date: Tue Aug 3 12:47:07 2010 -0400 + + Fix gdbus-exit-on-close test case + + Forgot to update the test case after last commit. + + Signed-off-by: David Zeuthen + + gio/tests/gdbus-exit-on-close.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6a492a45191335ac97f54785db543f21dfce379c +Author: David Zeuthen +Date: Tue Aug 3 12:24:48 2010 -0400 + + GDBus: If exiting b/c remote peer disconnected and error is set, + print it + + This should make things easier to debug: + + g_dbus_connection_real_closed: Remote peer vanished with error: + Underlying GIOStream returned 0 bytes on an async read + (g-io-error-quark, 0). Exiting. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 12 +++++++++++- + 1 files changed, 11 insertions(+), 1 deletions(-) + +commit 3940cc9a11fde063bb9f83cc362e575e5f378609 +Author: David Zeuthen +Date: Tue Aug 3 11:14:21 2010 -0400 + + GDBusProxy: Don't leak a GSimpleAsyncResult when doing async calls + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit b2715bbc5eaa1454df879964f58e36dbed65dc77 +Author: Matthias Clasen +Date: Tue Aug 3 10:41:21 2010 -0400 + + Fix a possible deadlock + + the FdSource was calling g_cancellable_disconnect while holding the + main context lock, which is bad news if the ::cancelled handler is + trying to get that lock to wake up the mainloop... + + Bug 586432 + + gio/gasynchelper.c | 8 ++++++-- + gio/tests/unix-streams.c | 22 +--------------------- + 2 files changed, 7 insertions(+), 23 deletions(-) + +commit 5179d92e9ce8f5b88db73613ef0485c82656801e +Author: Matthias Clasen +Date: Sun Aug 1 02:36:27 2010 -0400 + + fix the completion test + + tests/completion-test.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 21d98dbc4b57783bc98f612ca459562bcd25bd5b +Author: Matthias Clasen +Date: Sun Aug 1 02:11:15 2010 -0400 + + improve completion test coverage + + tests/completion-test.c | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit 9b96e31968383619ff0a76212c5200022d62b23c +Author: Matthias Clasen +Date: Sun Aug 1 02:07:50 2010 -0400 + + Don't assert too much + + glib/gbookmarkfile.c | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +commit e4b5104003e9281e5737a9611517c4878522df5c +Author: Matthias Clasen +Date: Sun Aug 1 02:07:21 2010 -0400 + + Move bookmarkfile tests to the test framework + + glib/tests/Makefile.am | 7 + + glib/tests/bookmarkfile.c | 298 + ++++++++++++++++++++++++++++++++++++ + glib/tests/bookmarks/fail-02.xbel | 2 + + glib/tests/bookmarks/fail-03.xbel | 18 +++ + glib/tests/bookmarks/fail-04.xbel | 21 +++ + glib/tests/bookmarks/fail-05.xbel | 21 +++ + glib/tests/bookmarks/fail-06.xbel | 19 +++ + glib/tests/bookmarks/fail-07.xbel | 21 +++ + glib/tests/bookmarks/fail-08.xbel | 18 +++ + glib/tests/bookmarks/fail-09.xbel | 20 +++ + glib/tests/bookmarks/fail-10.xbel | 21 +++ + glib/tests/bookmarks/fail-11.xbel | 22 +++ + glib/tests/bookmarks/fail-12.xbel | 22 +++ + glib/tests/bookmarks/fail-13.xbel | 22 +++ + glib/tests/bookmarks/fail-14.xbel | 24 +++ + glib/tests/bookmarks/fail-15.xbel | 23 +++ + glib/tests/bookmarks/fail-16.xbel | 24 +++ + glib/tests/bookmarks/fail-17.xbel | 22 +++ + glib/tests/bookmarks/valid-01.xbel | 21 +++ + glib/tests/bookmarks/valid-02.xbel | 15 ++ + glib/tests/bookmarks/valid-03.xbel | 21 +++ + tests/Makefile.am | 8 +- + tests/bookmarkfile-test.c | 188 ----------------------- + tests/bookmarks/fail-02.xbel | 2 - + tests/bookmarks/fail-03.xbel | 18 --- + tests/bookmarks/fail-04.xbel | 21 --- + tests/bookmarks/fail-05.xbel | 21 --- + tests/bookmarks/fail-06.xbel | 19 --- + tests/bookmarks/fail-07.xbel | 21 --- + tests/bookmarks/fail-08.xbel | 18 --- + tests/bookmarks/fail-09.xbel | 20 --- + tests/bookmarks/fail-10.xbel | 21 --- + tests/bookmarks/fail-11.xbel | 22 --- + tests/bookmarks/fail-12.xbel | 22 --- + tests/bookmarks/fail-13.xbel | 22 --- + tests/bookmarks/fail-14.xbel | 24 --- + tests/bookmarks/fail-15.xbel | 23 --- + tests/bookmarks/fail-16.xbel | 24 --- + tests/bookmarks/fail-17.xbel | 22 --- + tests/bookmarks/valid-01.xbel | 21 --- + tests/bookmarks/valid-02.xbel | 15 -- + tests/bookmarks/valid-03.xbel | 21 --- + tests/run-bookmark-test.sh | 34 ---- + 43 files changed, 684 insertions(+), 605 deletions(-) + +commit b3de028a43873913106c31fa2c4b6e31d14b9fc1 +Author: Emmanuele Bassi +Date: Tue Aug 3 14:21:02 2010 +0100 + + Update the Git ignore files + + gio/tests/.gitignore | 2 ++ + glib/tests/.gitignore | 8 ++++++++ + m4macros/.gitignore | 5 +++++ + 3 files changed, 15 insertions(+), 0 deletions(-) + +commit f8ec75620d5e7c2d139cc523729a1223875f1fa0 +Author: Mark Wielaard +Date: Mon Aug 2 23:28:50 2010 +0200 + + Don't add (extra) DESTDIR to tapsetdir for tapset_DATA. + + https://bugzilla.gnome.org/show_bug.cgi?id=625876 + + glib/Makefile.am | 2 +- + gobject/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 5e1c4b18a806cd8a0f259b314f64f3d99e824773 +Author: Emmanuele Bassi +Date: Tue Aug 3 10:34:59 2010 +0100 + + docs: Clarify user_data behavior for bind_property_full() + + gobject/gbinding.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 90f7f171e621c296526b3978a75433c30c088b46 +Author: Emmanuele Bassi +Date: Tue Aug 3 10:29:50 2010 +0100 + + binding: Add G_BINDING_INVERT_BOOLEAN + + Since GSettings got the same functionality and flag in commit + ca3b7b75b + GBinding should also have the ability to automatically invert + a boolean + value without requiring a custom transformation function. + + gobject/gbinding.c | 61 + +++++++++++++++++++++++++++++++++++++++++++- + gobject/gbinding.h | 18 +++++++++---- + gobject/tests/binding.c | 64 + +++++++++++++++++++++++++++++++++++++++++++--- + 3 files changed, 130 insertions(+), 13 deletions(-) + +commit 3be3ad61d142ca5bbd5659809af749ea5bf441ac +Author: Emmanuele Bassi +Date: Tue Jul 13 06:03:03 2010 +0100 + + binding: Add a closure-based variant of bind_property_full() + + Since using the function pointer version muddles the memory management + requirements of language bindings, we should implement a + GClosure-based + variant on top of g_object_bind_property_full(). + + https://bugzilla.gnome.org/show_bug.cgi?id=622278 + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gbinding.c | 183 + +++++++++++++++++++++++++-- + gobject/gbinding.h | 35 +++-- + gobject/gobject.symbols | 1 + + gobject/tests/binding.c | 76 +++++++++++- + 5 files changed, 271 insertions(+), 25 deletions(-) + +commit ca3b7b75bff00ea05c967eea06e2c3397da17e41 +Author: Ryan Lortie +Date: Tue Aug 3 02:08:03 2010 -0400 + + GSettings: add G_SETTINGS_BIND_INVERT_BOOLEAN flag + + When binding a boolean setting to a boolean property, invert the + values. + This avoids the requirement for writing a pair of mapping functions + for + this extremely common case. + + Add a test. + + https://bugzilla.gnome.org/show_bug.cgi?id=625833 + + gio/gsettings.c | 71 + +++++++++++++++++++++++++++++++++--- + gio/gsettings.h | 6 +++- + gio/tests/gsettings.c | 21 ++++++++++- + gio/tests/org.gtk.test.gschema.xml | 3 ++ + 4 files changed, 93 insertions(+), 8 deletions(-) + +commit dd2bbc95330355d5ff044dc76649e41ee5063894 +Author: Fridrich Štrba +Date: Mon Aug 2 10:16:29 2010 +0200 + + On windows, export also symbols defined in gio/gwin32appinfo.c + + gio/gio.symbols | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit 9c399b10b8da98e87d12c1fbd8f8e6a44256f68b +Author: Fran Diéguez +Date: Sun Aug 1 23:18:31 2010 +0200 + + Updated Galician translations + + po/gl.po | 259 + ++++++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 files changed, 212 insertions(+), 47 deletions(-) + +commit 892012b951a5222a3e47afc18179b064420ff98b +Author: Carlos Garcia Campos +Date: Sun Aug 1 12:56:06 2010 +0200 + + GDBusConnection: fix message flags in g_dbus_connection_call_sync() + + GDBusCallFlags were used instead of GDBusSendMessageFlags for + g_dbus_connection_send_message_with_reply_sync(). Fixes bug #625753. + + gio/gdbusconnection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e7c7e46cf20cbca1684cecd1ba45e5555797844e +Author: Stef Walter +Date: Sun Aug 1 07:14:43 2010 +0200 + + Add comment to g_date_set_time_val about local timezone. + + Local time zone is used in conversion during g_date_set_time_val(). + We now mention this in the documentation. + + Fixes bug #625500 + + glib/gdate.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit d01a4374901af59a9b80fed1372a1366c9c9705d +Author: Milan Crha +Date: Sat Jul 31 23:51:45 2010 -0400 + + Silence valgrind + + Initialize all fields of struct msghdr. Bug 625472. + + gio/gsocket.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit b6c42d05c07479c49f5dd36ad74caae518568381 +Author: Jorge González +Date: Sat Jul 31 15:11:48 2010 +0200 + + Updated Spanish translation + + po/es.po | 206 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 files changed, 182 insertions(+), 24 deletions(-) + +commit 7e33c4977c1772a741d9beb1f5ceca2009a0cea5 +Author: Yaron Shahrabani +Date: Sat Jul 31 10:05:05 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 253 + ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- + 1 files changed, 213 insertions(+), 40 deletions(-) + +commit 917456973643cfe303017f1bb3266d41bba7cfd2 +Author: Matthias Clasen +Date: Sat Jul 31 02:40:16 2010 -0400 + + Also use trylock in the bitlock tests + + gthread/tests/1bit-mutex.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit ce7463a87b8f039490be075ba0505fa2986509b6 +Author: Matthias Clasen +Date: Sat Jul 31 02:39:53 2010 -0400 + + improve scanner api test coverage + + glib/tests/scannerapi.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 6d41af0f724fad717b2cba4dc0001cd53564a9eb +Author: Matthias Clasen +Date: Sat Jul 31 02:15:03 2010 -0400 + + Improve tree test coverage + + glib/tests/tree.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 42 insertions(+), 0 deletions(-) + +commit a94657782680312592f860d5d867a446b8beda85 +Author: Matthias Clasen +Date: Sat Jul 31 02:14:51 2010 -0400 + + Improve keyfile test coverage + + glib/tests/keyfile.c | 48 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 48 insertions(+), 0 deletions(-) + +commit ef4690c6c96824a2099a5feca11a1785329ec5ca +Author: Matthias Clasen +Date: Sat Jul 31 02:14:28 2010 -0400 + + Test some GError functionality explicitly + + glib/tests/Makefile.am | 3 ++ + glib/tests/error.c | 73 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 76 insertions(+), 0 deletions(-) + +commit a4d0038c288587bd2d8b50a7b5b442e6ba0f59a7 +Author: Matthias Clasen +Date: Sat Jul 31 02:14:01 2010 -0400 + + Add a test for g_variant_builder_add_parsed + + glib/tests/gvariant.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 3c0f77a499f01f42c70313568870681f00e4cc82 +Author: Matthias Clasen +Date: Sat Jul 31 02:07:38 2010 -0400 + + Fix a typo + + glib/gvariant-parser.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 12e47411c3ad3d04619036a1001801382ea9e9da +Author: Matthias Clasen +Date: Sat Jul 31 00:56:11 2010 -0400 + + Improve string test coverage + + glib/tests/string.c | 29 ++++++++++++++++++++++++++++- + 1 files changed, 28 insertions(+), 1 deletions(-) + +commit dd25bdeff14ebad9c0ffc5231032ede0c761c47e +Author: Matthias Clasen +Date: Sat Jul 31 00:55:57 2010 -0400 + + Improve byte array test coverage + + glib/tests/array-test.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 8246bf4bdebb1a12e40111b483e7d6a474ec6b58 +Author: Matthias Clasen +Date: Sat Jul 31 00:13:02 2010 -0400 + + Improve gdbus test coverage + + gio/tests/gdbus-connection.c | 61 ++++++++++++++++++++-- + gio/tests/gdbus-proxy.c | 118 + ++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 171 insertions(+), 8 deletions(-) + +commit 116b945c944a8dcfeb21e9b9ea7781a492a81101 +Author: Matthias Clasen +Date: Fri Jul 30 23:44:30 2010 -0400 + + Fix a typo + + Its credentials, not crendentials + + gio/gdbusconnection.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit eb3e926b09538f22ac115ce0f18ac7530dc2dc87 +Author: Matthias Clasen +Date: Fri Jul 30 16:44:25 2010 -0400 + + Fix an off-by-one error + + gio/gapplication.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5033be80d15cfb6c0a89f4ab0bc5e76cc2cd0a71 +Author: Matthias Clasen +Date: Fri Jul 30 16:21:49 2010 -0400 + + Add a test for g_dbus_proxy_get_cached_property_names + + gio/tests/gdbus-proxy.c | 65 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 65 insertions(+), 0 deletions(-) + +commit 5f89498f071a100d3e159dd0d967477047249d73 +Author: Matthias Clasen +Date: Fri Jul 30 15:36:15 2010 -0400 + + improve printf tests coverage + + glib/tests/printf.c | 241 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 227 insertions(+), 14 deletions(-) + +commit 9100828185316503e2da366a8e0de8e361944301 +Author: Matthias Clasen +Date: Fri Jul 30 15:35:47 2010 -0400 + + Improve option context test coverage + + glib/tests/option-context.c | 65 + +++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 65 insertions(+), 0 deletions(-) + +commit 027905c27aca3cdedca59a3d084e9a9279e03b19 +Author: Matthias Clasen +Date: Thu Jul 29 23:08:07 2010 -0400 + + Improve array test coverage + + glib/tests/array-test.c | 461 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 455 insertions(+), 6 deletions(-) + +commit 03be0d7237c7f250e01b785af4e4e4e8724a3e8f +Author: Matthias Clasen +Date: Thu Jul 29 20:52:31 2010 -0400 + + Move markup parse tests to the test framework + + glib/tests/Makefile.am | 20 ++- + glib/tests/markup-parse.c | 290 + ++++++++++++++++++++++++++++++++++ + glib/tests/markups/fail-1.expected | 1 + + glib/tests/markups/fail-10.expected | 4 + + glib/tests/markups/fail-10.gmarkup | 2 + + glib/tests/markups/fail-11.expected | 7 + + glib/tests/markups/fail-11.gmarkup | 4 + + glib/tests/markups/fail-12.expected | 1 + + glib/tests/markups/fail-12.gmarkup | 1 + + glib/tests/markups/fail-13.expected | 1 + + glib/tests/markups/fail-13.gmarkup | 1 + + glib/tests/markups/fail-14.expected | 4 + + glib/tests/markups/fail-14.gmarkup | 2 + + glib/tests/markups/fail-15.expected | 8 + + glib/tests/markups/fail-15.gmarkup | 3 + + glib/tests/markups/fail-16.expected | 2 + + glib/tests/markups/fail-16.gmarkup | 1 + + glib/tests/markups/fail-17.expected | 1 + + glib/tests/markups/fail-17.gmarkup | 1 + + glib/tests/markups/fail-18.expected | 1 + + glib/tests/markups/fail-18.gmarkup | 1 + + glib/tests/markups/fail-19.expected | 1 + + glib/tests/markups/fail-19.gmarkup | 1 + + glib/tests/markups/fail-2.expected | 1 + + glib/tests/markups/fail-2.gmarkup | 1 + + glib/tests/markups/fail-20.expected | 1 + + glib/tests/markups/fail-20.gmarkup | 1 + + glib/tests/markups/fail-21.expected | 1 + + glib/tests/markups/fail-21.gmarkup | 1 + + glib/tests/markups/fail-22.expected | 2 + + glib/tests/markups/fail-22.gmarkup | 1 + + glib/tests/markups/fail-23.expected | 4 + + glib/tests/markups/fail-23.gmarkup | 2 + + glib/tests/markups/fail-24.expected | 1 + + glib/tests/markups/fail-24.gmarkup | 1 + + glib/tests/markups/fail-25.expected | 1 + + glib/tests/markups/fail-25.gmarkup | 1 + + glib/tests/markups/fail-26.expected | 2 + + glib/tests/markups/fail-26.gmarkup | 1 + + glib/tests/markups/fail-27.expected | 2 + + glib/tests/markups/fail-27.gmarkup | 1 + + glib/tests/markups/fail-28.expected | 2 + + glib/tests/markups/fail-28.gmarkup | 1 + + glib/tests/markups/fail-29.expected | 2 + + glib/tests/markups/fail-29.gmarkup | 1 + + glib/tests/markups/fail-3.gmarkup | 49 ++++++ + glib/tests/markups/fail-30.expected | 2 + + glib/tests/markups/fail-30.gmarkup | 1 + + glib/tests/markups/fail-31.expected | 2 + + glib/tests/markups/fail-31.gmarkup | 1 + + glib/tests/markups/fail-32.expected | 2 + + glib/tests/markups/fail-32.gmarkup | 1 + + glib/tests/markups/fail-33.expected | 2 + + glib/tests/markups/fail-33.gmarkup | 1 + + glib/tests/markups/fail-34.expected | 2 + + glib/tests/markups/fail-34.gmarkup | 1 + + glib/tests/markups/fail-35.expected | 2 + + glib/tests/markups/fail-35.gmarkup | 1 + + glib/tests/markups/fail-36.gmarkup | 1 + + glib/tests/markups/fail-37.expected | 1 + + glib/tests/markups/fail-37.gmarkup | 1 + + glib/tests/markups/fail-38.expected | 3 + + glib/tests/markups/fail-38.gmarkup | 1 + + glib/tests/markups/fail-39.expected | 3 + + glib/tests/markups/fail-39.gmarkup | 1 + + glib/tests/markups/fail-4.expected | 1 + + glib/tests/markups/fail-4.gmarkup | 1 + + glib/tests/markups/fail-40.expected | 2 + + glib/tests/markups/fail-40.gmarkup | 1 + + glib/tests/markups/fail-5.expected | 1 + + glib/tests/markups/fail-5.gmarkup | 2 + + glib/tests/markups/fail-6.expected | 1 + + glib/tests/markups/fail-6.gmarkup | 2 + + glib/tests/markups/fail-7.expected | 1 + + glib/tests/markups/fail-7.gmarkup | 2 + + glib/tests/markups/fail-8.expected | 3 + + glib/tests/markups/fail-8.gmarkup | 2 + + glib/tests/markups/fail-9.expected | 1 + + glib/tests/markups/fail-9.gmarkup | 2 + + glib/tests/markups/valid-1.expected | 37 +++++ + glib/tests/markups/valid-1.gmarkup | 9 + + glib/tests/markups/valid-10.expected | 6 + + glib/tests/markups/valid-10.gmarkup | 6 + + glib/tests/markups/valid-11.expected | 3 + + glib/tests/markups/valid-11.gmarkup | 2 + + glib/tests/markups/valid-2.expected | 51 ++++++ + glib/tests/markups/valid-2.gmarkup | 49 ++++++ + glib/tests/markups/valid-3.expected | 61 +++++++ + glib/tests/markups/valid-3.gmarkup | 10 ++ + glib/tests/markups/valid-4.expected | 29 ++++ + glib/tests/markups/valid-4.gmarkup | 8 + + glib/tests/markups/valid-5.expected | 4 + + glib/tests/markups/valid-5.gmarkup | 2 + + glib/tests/markups/valid-6.expected | 6 + + glib/tests/markups/valid-6.gmarkup | 4 + + glib/tests/markups/valid-7.expected | 4 + + glib/tests/markups/valid-7.gmarkup | 2 + + glib/tests/markups/valid-8.expected | 5 + + glib/tests/markups/valid-8.gmarkup | 1 + + glib/tests/markups/valid-9.expected | 3 + + glib/tests/markups/valid-9.gmarkup | 2 + + tests/Makefile.am | 8 +- + tests/markup-test.c | 214 ------------------------- + tests/markups/expected-1 | 37 ----- + tests/markups/expected-10 | 6 - + tests/markups/expected-11 | 3 - + tests/markups/expected-2 | 51 ------ + tests/markups/expected-3 | 61 ------- + tests/markups/expected-4 | 29 ---- + tests/markups/expected-5 | 4 - + tests/markups/expected-6 | 6 - + tests/markups/expected-7 | 4 - + tests/markups/expected-8 | 5 - + tests/markups/expected-9 | 3 - + tests/markups/fail-10.gmarkup | 2 - + tests/markups/fail-11.gmarkup | 4 - + tests/markups/fail-12.gmarkup | 1 - + tests/markups/fail-13.gmarkup | 1 - + tests/markups/fail-14.gmarkup | 2 - + tests/markups/fail-15.gmarkup | 3 - + tests/markups/fail-16.gmarkup | 1 - + tests/markups/fail-17.gmarkup | 1 - + tests/markups/fail-18.gmarkup | 1 - + tests/markups/fail-19.gmarkup | 1 - + tests/markups/fail-2.gmarkup | 1 - + tests/markups/fail-20.gmarkup | 1 - + tests/markups/fail-21.gmarkup | 1 - + tests/markups/fail-22.gmarkup | 1 - + tests/markups/fail-23.gmarkup | 2 - + tests/markups/fail-24.gmarkup | 1 - + tests/markups/fail-25.gmarkup | 1 - + tests/markups/fail-26.gmarkup | 1 - + tests/markups/fail-27.gmarkup | 1 - + tests/markups/fail-28.gmarkup | 1 - + tests/markups/fail-29.gmarkup | 1 - + tests/markups/fail-3.gmarkup | 49 ------ + tests/markups/fail-30.gmarkup | 1 - + tests/markups/fail-31.gmarkup | 1 - + tests/markups/fail-32.gmarkup | 1 - + tests/markups/fail-33.gmarkup | 1 - + tests/markups/fail-34.gmarkup | 1 - + tests/markups/fail-35.gmarkup | 1 - + tests/markups/fail-36.gmarkup | 1 - + tests/markups/fail-37.gmarkup | 1 - + tests/markups/fail-38.gmarkup | 1 - + tests/markups/fail-39.gmarkup | 1 - + tests/markups/fail-4.gmarkup | 1 - + tests/markups/fail-40.gmarkup | 1 - + tests/markups/fail-5.gmarkup | 2 - + tests/markups/fail-6.gmarkup | 2 - + tests/markups/fail-7.gmarkup | 2 - + tests/markups/fail-8.gmarkup | 2 - + tests/markups/fail-9.gmarkup | 2 - + tests/markups/valid-1.gmarkup | 9 - + tests/markups/valid-10.gmarkup | 6 - + tests/markups/valid-11.gmarkup | 2 - + tests/markups/valid-2.gmarkup | 49 ------ + tests/markups/valid-3.gmarkup | 10 -- + tests/markups/valid-4.gmarkup | 8 - + tests/markups/valid-5.gmarkup | 2 - + tests/markups/valid-6.gmarkup | 4 - + tests/markups/valid-7.gmarkup | 2 - + tests/markups/valid-8.gmarkup | 1 - + tests/markups/valid-9.gmarkup | 2 - + tests/run-markup-tests.sh | 41 ----- + 165 files changed, 789 insertions(+), 671 deletions(-) + +commit aa196c60df8bbe6f8e998780579b12863098107f +Author: Matthias Clasen +Date: Thu Jul 29 02:20:43 2010 -0400 + + Improve coverage of buffered output stream tests + + gio/tests/buffered-output-stream.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit ffa938fc652543c70c8bada3f65f1626e127731b +Author: Matthias Clasen +Date: Thu Jul 29 02:20:29 2010 -0400 + + Improve coverage of credentials tests + + gio/tests/gdbus-peer.c | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +commit 670528c187b0ae59a8fca1b6921722461992a9fb +Author: Matthias Clasen +Date: Thu Jul 29 02:20:15 2010 -0400 + + Improve coverage of converter stream tests + + gio/tests/converter-stream.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 9794a648a9af25a9d409ce6aef97ac95f94c5cfb +Author: Matthias Clasen +Date: Thu Jul 29 02:19:46 2010 -0400 + + Improve coverage of memory stream tests + + gio/tests/memory-input-stream.c | 63 + ++++++++++++++++++++++++++++++++++++++ + gio/tests/memory-output-stream.c | 29 +++++++++++++++++- + 2 files changed, 91 insertions(+), 1 deletions(-) + +commit 620582e59c9caf355c12b072258ea74ad1aadc1e +Author: Matthias Clasen +Date: Thu Jul 29 02:19:27 2010 -0400 + + Remove redundant include + + gio/tests/unix-streams.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 17d4898d75fc41038a1d13740bfe1279ca902235 +Author: Matthias Clasen +Date: Thu Jul 29 02:19:01 2010 -0400 + + Improve coverage of icon tests + + gio/tests/g-icon.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 7710c50fb22d44bc8554ad811418141490e09f78 +Author: Matthias Clasen +Date: Thu Jul 29 02:18:45 2010 -0400 + + Improve coverage of application tests + + gio/tests/application.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 files changed, 36 insertions(+), 0 deletions(-) + +commit 758c3216cddf35721b3c1fc244f93f6169d9a84b +Author: Matthias Clasen +Date: Thu Jul 29 00:54:23 2010 -0400 + + Improve coverage of stream tests + + gio/tests/buffered-input-stream.c | 2 ++ + gio/tests/converter-stream.c | 4 ++++ + gio/tests/data-input-stream.c | 31 +++++++++++++++++++++++++++++++ + gio/tests/data-output-stream.c | 32 ++++++++++++++++++++++++++++---- + 4 files changed, 65 insertions(+), 4 deletions(-) + +commit c6b050716717529a4b31f4eb2bae3fef06277bb3 +Author: Matthias Clasen +Date: Thu Jul 29 00:53:30 2010 -0400 + + Reenable unix-streams test + + gio/tests/Makefile.am | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 04c7abba11abb54fe8f43b027ed42ed4ff46aa82 +Author: Matthias Clasen +Date: Thu Jul 29 00:52:34 2010 -0400 + + Work around deadlock in unix-streams test + + gio/tests/unix-streams.c | 23 ++++++++++++++++++++++- + 1 files changed, 22 insertions(+), 1 deletions(-) + +commit b463b2ea25d214c9ba3fc2c5a77b3d321eb842d1 +Author: Matthias Clasen +Date: Wed Jul 28 16:59:11 2010 -0400 + + Add tests about file associations + + gio/tests/appinfo.c | 62 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 62 insertions(+), 0 deletions(-) + +commit 60932b2f3deeb612a7e6c097973f2fb17f557202 +Author: Matthias Clasen +Date: Wed Jul 28 16:05:19 2010 -0400 + + Improve regex test coverage + + glib/tests/regex.c | 106 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 106 insertions(+), 0 deletions(-) + +commit 154880b2ad9064ac78c8e1d55a2ae96bf48d159a +Author: Matthias Clasen +Date: Tue Jul 27 18:21:15 2010 -0400 + + Remove duplicate utf8 strreverse test + + Also add some tests for find next/prev char. + + glib/tests/utf8-misc.c | 18 ++++++++++++++++++ + glib/tests/utf8-pointer.c | 41 + ++++++++++++++++++++++++++++++++--------- + 2 files changed, 50 insertions(+), 9 deletions(-) + +commit 0e48b7ea7c436dde8e1e3d432a4c0dd6da7055fa +Author: Matthias Clasen +Date: Tue Jul 27 16:52:36 2010 -0400 + + Improve strfuncs test coverage a bit + + glib/tests/strfuncs.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit c617e94cf111b435cc2765b9ffcb219fec7b4016 +Author: Matthias Clasen +Date: Tue Jul 27 16:25:13 2010 -0400 + + Improve option context test coverage a bit + + glib/tests/option-context.c | 116 + +++++++++++++++++++++++++++--------------- + 1 files changed, 74 insertions(+), 42 deletions(-) + +commit c4dd9fa41b9ec8387e765d9463e181d0be33c5ae +Author: Matthias Clasen +Date: Tue Jul 27 16:24:56 2010 -0400 + + Move markup collect tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/markup-collect.c | 113 + +++++++++++++++---------------------------- + 2 files changed, 43 insertions(+), 73 deletions(-) + +commit 13ac9f94fdc1fcbf2be15e65af57c362a1c71f5d +Author: Matthias Clasen +Date: Tue Jul 27 16:24:08 2010 -0400 + + Add some more GFile tests + + gio/tests/file.c | 38 ++++++++ + glib/tests/markup-collect.c | 221 + +++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 1 - + tests/markup-collect.c | 221 + ------------------------------------------- + 4 files changed, 259 insertions(+), 222 deletions(-) + +commit 8263d691cb0cf5d2c80d1c949a3c693d333510c0 +Author: Matthias Clasen +Date: Tue Jul 27 14:01:48 2010 -0400 + + Improve compressor test coverage a bit + + gio/tests/converter-stream.c | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit b77a19f238e34cd2ba7ecf204beacc7252477605 +Author: Matthias Clasen +Date: Tue Jul 27 01:00:55 2010 -0400 + + Test g_settings_list_schemas + + gio/tests/gsettings.c | 24 ++++++++++++++++++++++++ + 1 files changed, 24 insertions(+), 0 deletions(-) + +commit b4ed2af52fbe195aab3771066dac71172f8716ed +Author: Matthias Clasen +Date: Tue Jul 27 00:17:20 2010 -0400 + + Improve GNode test coverage a bit + + glib/tests/node.c | 117 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 117 insertions(+), 0 deletions(-) + +commit 568eeeafe1636bba440dc18cd34c4fce551ddd15 +Author: Matthias Clasen +Date: Mon Jul 26 23:24:31 2010 -0400 + + Add some logging tests + + glib/tests/Makefile.am | 3 + + glib/tests/logging.c | 147 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 150 insertions(+), 0 deletions(-) + +commit 2b113e4a9ad375691d72347d31999fd5654f5361 +Author: Matthias Clasen +Date: Mon Jul 26 23:06:33 2010 -0400 + + Silence log handler tests + + glib/tests/testing.c | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +commit b91cde61408bfe58c849b44ca3100ba4c5f8a3fc +Author: Matthias Clasen +Date: Mon Jul 26 22:13:25 2010 -0400 + + Improve tree test coverage + + glib/tests/tree.c | 24 +++++++++++++++++++++++- + 1 files changed, 23 insertions(+), 1 deletions(-) + +commit c972d4df64299b335012b7af2b902589d191f8e0 +Author: Matthias Clasen +Date: Mon Jul 26 22:12:59 2010 -0400 + + Move markup escape tests to test framework + + glib/tests/Makefile.am | 4 + + glib/tests/markup-escape.c | 159 + ++++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 3 - + tests/markup-escape-test.c | 132 ------------------------------------ + 4 files changed, 163 insertions(+), 135 deletions(-) + +commit a804e22ed047514d7f267a8e991eca82bc5eaf57 +Author: Matthias Clasen +Date: Mon Jul 26 21:19:04 2010 -0400 + + More pattern tests + + glib/tests/pattern.c | 400 + +++++++++++++++++++++----------------------------- + 1 files changed, 168 insertions(+), 232 deletions(-) + +commit d3f00313617c3e646d5a236f1f06a84a07279c2a +Author: Matthias Clasen +Date: Mon Jul 26 21:18:22 2010 -0400 + + Add tests for g_utf8_strreverse + + glib/tests/utf8-misc.c | 26 ++++++++++++++++++++++++++ + 1 files changed, 26 insertions(+), 0 deletions(-) + +commit caa9453b72ca3a7b7bafb8cafac84934f7036682 +Author: Matthias Clasen +Date: Mon Jul 26 21:17:56 2010 -0400 + + Fix a warning + + gio/tests/network-address.c | 3 ++- + glib/pcre/Makefile.am | 5 ----- + glib/pcre/pcre_internal.h | 2 +- + 3 files changed, 3 insertions(+), 7 deletions(-) + +commit d0750c9d6e2b0479a47f93c545607ac43da0b1dd +Author: Matthias Clasen +Date: Mon Jul 26 21:16:03 2010 -0400 + + Don't leak in converter test + + gio/tests/converter-stream.c | 4 + + glib/tests/Makefile.am | 2 + + glib/tests/pattern.c | 308 + ++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 2 - + tests/patterntest.c | 308 + ------------------------------------------ + 5 files changed, 314 insertions(+), 310 deletions(-) + +commit 63bdeb0dab81a4aed4a2e215cae4669de7f583c3 +Author: Matthias Clasen +Date: Mon Jul 26 20:22:33 2010 -0400 + + Fix an icon test + + gio/tests/g-icon.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a8f83ea8340459e22a2f2d18f4aa410ccf1cde34 +Author: Matthias Clasen +Date: Mon Jul 26 19:07:16 2010 -0400 + + Add tests for GNetworkAddress + + gio/tests/Makefile.am | 8 ++-- + gio/tests/network-address.c | 91 + +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 95 insertions(+), 4 deletions(-) + +commit e103b93694be98b5b7bfcfbb22ef0be014079f1a +Author: Matthias Clasen +Date: Mon Jul 26 18:40:17 2010 -0400 + + Drop an unneeded if + + gio/gnetworkaddress.c | 3 +- + gio/tests/g-icon.c | 112 + ++++++++++++++++++++++++++++++++++++++++++++- + gio/tests/icons.c | 122 + ------------------------------------------------- + 3 files changed, 112 insertions(+), 125 deletions(-) + +commit 9d93dc5554b7b7da4a724d6b9d464cb8be1e0475 +Author: Matthias Clasen +Date: Mon Jul 26 18:15:24 2010 -0400 + + Remove some unused pcre code + + glib/pcre/pcre_info.c | 93 ---------------------------- + glib/pcre/pcre_maketables.c | 143 + ------------------------------------------- + glib/pcre/pcre_refcount.c | 82 ------------------------ + glib/pcre/pcre_valid_utf8.c | 14 ---- + glib/pcre/pcre_version.c | 90 --------------------------- + 5 files changed, 0 insertions(+), 422 deletions(-) + +commit 9fc3c980ccbaa6772f9b97b60c786546b67ae8b4 +Author: Matthias Clasen +Date: Mon Jul 26 17:59:18 2010 -0400 + + Add some volume monitor tests + + Although not much of this is easily testable. + + gio/tests/Makefile.am | 4 + + gio/tests/volumemonitor.c | 178 +++++++++++++++++++++++++++ + glib/tests/Makefile.am | 3 + + glib/tests/shell.c | 229 ++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 2 - + tests/shell-test.c | 297 + --------------------------------------------- + 6 files changed, 414 insertions(+), 299 deletions(-) + +commit e5a72ae3c415ae6e8437a0714f48311b534684c9 +Author: Matthias Clasen +Date: Sun Jul 25 19:12:51 2010 -0400 + + Move queue tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/queue.c | 1043 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 2 - + tests/queue-test.c | 962 + -------------------------------------------- + 4 files changed, 1046 insertions(+), 964 deletions(-) + +commit dbf230991bab03e64b5bc1a2bb5ab618de2f9212 +Author: David Zeuthen +Date: Fri Jul 30 16:33:29 2010 -0400 + + Bug 625628 – GDBusProxy: wrong property name sorting + + https://bugzilla.gnome.org/show_bug.cgi?id=625628 + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +commit aefc6df6bbf318c01eff32e631cc796aabcbf31f +Author: David Zeuthen +Date: Fri Jul 30 16:30:34 2010 -0400 + + Fix gschema-compile test + + This was broken by commit 1b5b87bfa0f5435dd6e973a4e36076db083dc5c7 + + Signed-off-by: David Zeuthen + + gio/tests/gschema-compile.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit d2d97a214d1d9e96f09955212e669c3c9447ff73 +Author: David Zeuthen +Date: Fri Jul 30 16:01:03 2010 -0400 + + Bug 625584 – Crashes application on unref with signal subscription + + Don't do too much work in the finalizer - in particular, there's no + need to send RemoveMatch() messages to the bus daemon since we're + going to sever the connection and the bus will garbage collect + anyway. In this case it crashed the process. + + Also add a test case that checks that the appropriate GDestroyNotify + callbacks are called when unreffing a connection with either 1) + exported objects; 2) signal subscriptions or 3) filter functions + .. yes, ideally apps would unregister such callbacks before giving up + their ref but that's not how things work :-) + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 19 ++++-- + gio/tests/gdbus-connection.c | 132 + ++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 134 insertions(+), 17 deletions(-) + +commit 1b5b87bfa0f5435dd6e973a4e36076db083dc5c7 +Author: Ryan Lortie +Date: Fri Jul 30 21:10:53 2010 +0200 + + GSettings: Mark some strings for cat translation + + *miaou* + + gio/gschema-compile.c | 105 + ++++++++++++++++++++++++------------------------- + 1 files changed, 52 insertions(+), 53 deletions(-) + +commit 14f17c13889215adbc9c56e4ea4f46662fa68ee5 +Author: David Zeuthen +Date: Fri Jul 30 11:40:00 2010 -0400 + + GDBusConnection: Fix up debug output when completing calls + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 173977a7015c45e5dc3c43534cd3deb81159ad1f +Author: David Zeuthen +Date: Fri Jul 30 11:26:43 2010 -0400 + + GCredentials: use effective uid/gid + + Otherwise e.g. setuid root processes can't connect to the system + bus. This was discovered when porting PolicyKit's pkexec(1) command to + a PolicyKit library using GDBus. + + Signed-off-by: David Zeuthen + + docs/reference/glib/tmpl/glib-unused.sgml | 40 + ++++++++++++++++++++++++++++ + docs/reference/glib/tmpl/messages.sgml | 27 ++++--------------- + docs/reference/glib/tmpl/version.sgml | 41 + ----------------------------- + gio/gcredentials.c | 4 +- + 4 files changed, 48 insertions(+), 64 deletions(-) + +commit f9845bcbece022e9ec55c18b0a855b718155a1d1 +Author: Ryan Lortie +Date: Thu Jul 29 22:04:43 2010 +0200 + + *bump* + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1fd1543bdcc6ee897b1ebd566cbcbfd9d76e386c +Author: Ryan Lortie +Date: Thu Jul 29 16:52:34 2010 +0200 + + add one more NEWS item + + NEWS | 36 +++++++++++++++++++----------------- + 1 files changed, 19 insertions(+), 17 deletions(-) + +commit 8673f0b06c255e36189950b671911c38e91affd5 +Author: Eduardo Lima Mitev +Date: Mon Jul 26 17:21:14 2010 +0200 + + GIO: Add G-I annotations for several methods + + Specifically: + - g_io_stream_get_input/output_stream() + - g_socket_client_get_local_address() + - g_socket_connection_get_socket() + - g_socket_listener_add_address() + - g_socket_listener_accept_socket() + - g_socket_listener_accept() + - g_io_extension_point_get_extensions() + + gio/giomodule.c | 7 ++++--- + gio/giostream.c | 6 ++++-- + gio/gsocketclient.c | 2 +- + gio/gsocketconnection.c | 2 +- + gio/gsocketlistener.c | 6 +++--- + 5 files changed, 13 insertions(+), 10 deletions(-) + +commit e4f90c82624a623098c53c7158a46bf702ff5fc9 +Author: Ryan Lortie +Date: Thu Jul 29 12:01:46 2010 +0200 + + get a start on the NEWS + + NEWS | 67 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 67 insertions(+), 0 deletions(-) + +commit 015df7e369cf37929acfebec0a705d5531ac355a +Author: Owen Taylor +Date: Wed Jul 28 15:15:57 2010 -0400 + + [gschema-compile] fix segfault + + If files are passed on the command line and we don't set + override_files + at all, don't try to read from the array. + + gio/gschema-compile.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 19ef26c9c5e088817e2a392f79f343021f2259c8 +Author: David Zeuthen +Date: Wed Jul 28 12:58:04 2010 -0400 + + Use correct type for GDBusServer:active property + + It's a boolean, not a string. + + Signed-off-by: David Zeuthen + + gio/gdbusserver.c | 16 ++++++++-------- + 1 files changed, 8 insertions(+), 8 deletions(-) + +commit 133e87ca87cc86e6410bb9e19eacd8ddb11eadfc +Author: David Zeuthen +Date: Wed Jul 28 12:48:17 2010 -0400 + + GDBusConnection: Pass the GObject to g_simple_async_result_new() + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit a6f1bb4e177750ef9c50a3813eb3be867a927fbe +Author: Ryan Lortie +Date: Tue Jul 27 22:56:30 2010 +0200 + + Add support for vendor override files + + You can drop a key-file in the schema directory that looks like: + + [org.gtk.Example] + key='value' + + to override the default value of 'key' in schema 'org.gtk.Example'. + + gio/gschema-compile.c | 154 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 154 insertions(+), 0 deletions(-) + +commit 723692dfb91a2de8c5337e9e1b50c2cf3abfb374 +Author: Fran Diéguez +Date: Tue Jul 27 17:47:22 2010 +0200 + + Updated Galician translations + + po/gl.po | 54 +++++++++++++++++++++++++++++++----------------------- + 1 files changed, 31 insertions(+), 23 deletions(-) + +commit 12d0cbdac555db479e4c6631bfd15d3c8a5dc2ed +Author: Jorge González +Date: Mon Jul 26 20:58:59 2010 +0200 + + Updated Spanish translation + + po/es.po | 176 + +++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 99 insertions(+), 77 deletions(-) + +commit e8923ff232bb34f27dfda8ba19df1af379da892c +Author: Yaron Shahrabani +Date: Sat Jul 24 13:31:31 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 44 ++++++++++++++++++++++++++------------------ + 1 files changed, 26 insertions(+), 18 deletions(-) + +commit 633d9efc62eca490b489e05d571681f8b15d8aca +Author: Murray Cumming +Date: Fri Jul 23 13:24:43 2010 +0200 + + [gio]: gioenums.h: Remove trailing comma again. + + gio/gioenums.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 86040bb2eb11ad9501cc0c94754e8d8f29ba8f17 +Author: Benjamin Otte +Date: Fri Jul 23 10:51:14 2010 +0200 + + Revert "notify: Remove unused g_object_notify_queue_clear()" + + This reverts commit 0201a81f04ae5fd46c6db25859e90dde1fc35d4b and adds + locks in the right place. + + As this file is a public header (see last commit), we cannot just + remove + functions from it. + + gobject/gobjectnotifyqueue.c | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 2819dd60b7b2feaa0609c1017e20105852ca92e4 +Author: Benjamin Otte +Date: Fri Jul 23 10:49:26 2010 +0200 + + notify: Readd g_object_notify_queue_from_object() + + gobjectnotifyqueue.c is a public header, so we cannot remove + files from + it. (Yes you read that right, this .c file is a public header. See + your + installation directory.) + + gobject/gobjectnotifyqueue.c | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit 4a83ee208fe08533a43a51c8fd2bd83794a1cd27 +Author: Tao Wang +Date: Fri Jul 23 13:18:43 2010 +0800 + + Complete Simplified Chinese translation. + + po/zh_CN.po | 24 +++++++----------------- + 1 files changed, 7 insertions(+), 17 deletions(-) + +commit fd0a2b27891ec38e0190916af761c3daf4daa78f +Author: Tao Wang +Date: Fri Jul 23 13:05:37 2010 +0800 + + Update Simplified Chinese translation. + + po/zh_CN.po | 359 + ++++++++++++++++++++++++++++++++-------------------------- + 1 files changed, 198 insertions(+), 161 deletions(-) + +commit d5bd531d96a48ba2dac84e0ac7bffa4cf5481738 +Author: Ryan Lortie +Date: Thu Jul 22 18:39:50 2010 -0400 + + Cleanup the GSettingsBackend API + + This is a substantial ABI break. Rebuild dconf. + + gio/gdelayedsettingsbackend.c | 15 +----- + gio/gkeyfilesettingsbackend.c | 18 +------ + gio/gmemorysettingsbackend.c | 4 +- + gio/gnullsettingsbackend.c | 12 +---- + gio/gsettings-tool.c | 102 + +++++++++++++++++++++++++++++++++++++++- + gio/gsettingsbackend.c | 22 +-------- + gio/gsettingsbackend.h | 19 +++----- + gio/gsettingsbackendinternal.h | 2 +- + gio/tests/gsettings.c | 5 ++ + 9 files changed, 125 insertions(+), 74 deletions(-) + +commit aed440815ec5c87f2439d723b60b8255578afdff +Author: Ryan Lortie +Date: Thu Jul 22 17:49:40 2010 -0400 + + GSettings: add g_settings_reset() + + Resets a key to its default value. + + docs/reference/gio/gio-sections.txt | 1 + + gio/gdelayedsettingsbackend.c | 37 + ++++++++++++++++++++++++++++------ + gio/gio.symbols | 1 + + gio/gmemorysettingsbackend.c | 20 ++++++++++++++++++- + gio/gsettings.c | 24 +++++++++++++++++++++- + gio/gsettings.h | 2 + + 6 files changed, 76 insertions(+), 9 deletions(-) + +commit f6d3e224dfa9e8b69403a8c79a27a58b5c9f66b7 +Author: Olivier Crête +Date: Thu Jul 22 21:52:54 2010 +0200 + + notify: Add tests for threadsafe object notifies + + https://bugzilla.gnome.org/show_bug.cgi?id=166020 + + tests/.gitignore | 2 + + tests/refcount/Makefile.am | 2 + + tests/refcount/properties3.c | 204 + ++++++++++++++++++++++++++++++++++++++++++ + tests/refcount/properties4.c | 169 ++++++++++++++++++++++++++++++++++ + 4 files changed, 377 insertions(+), 0 deletions(-) + +commit 0483ef000ae323415bb0c7b762dd587f1384b1f3 +Author: Benjamin Otte +Date: Thu Jul 22 21:51:28 2010 +0200 + + notify: Make dedup code clearer + + A for loops seems easier to understand to me than gotos. + + gobject/gobjectnotifyqueue.c | 17 +++++++++-------- + 1 files changed, 9 insertions(+), 8 deletions(-) + +commit 9026b11e380a9b6479c0fcb852a5aba297ed9dd4 +Author: Olivier Crête +Date: Thu Jul 22 21:26:32 2010 +0200 + + notify: Make GObject property change notifications thread safe + + Adds locking around object property change notification handling. The + notifications are only emitted after all threads have called + g_object_thaw_notify(). + + https://bugzilla.gnome.org/show_bug.cgi?id=166020 + + gobject/gobjectnotifyqueue.c | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +commit 65797f7e54061a21866261d00a1c5533cd6a4f81 +Author: Olivier Crête +Date: Thu Jul 22 21:20:35 2010 +0200 + + notify: Remove g_object_notify_queue_from_object() + + The function will not be safe with object locking in place, so + we remove + it. The workaround is somewhat ugly, but it works. + + https://bugzilla.gnome.org/show_bug.cgi?id=166020 + + gobject/gobject.c | 14 ++++++++------ + gobject/gobjectnotifyqueue.c | 7 ------- + 2 files changed, 8 insertions(+), 13 deletions(-) + +commit 83026092eba98c2e6e0a96112555f980382a99e7 +Author: Olivier Crête +Date: Thu Jul 22 20:25:00 2010 +0200 + + notify: Refactor g_object_notify_queue_thaw() + + This adds better error reporting and simplifies the code for adding + thread safety. + + https://bugzilla.gnome.org/show_bug.cgi?id=166020 + + gobject/gobjectnotifyqueue.c | 12 ++++++++++-- + 1 files changed, 10 insertions(+), 2 deletions(-) + +commit 0201a81f04ae5fd46c6db25859e90dde1fc35d4b +Author: Olivier Crête +Date: Thu Jul 22 09:02:18 2010 +0200 + + notify: Remove unused g_object_notify_queue_clear() + + https://bugzilla.gnome.org/show_bug.cgi?id=166020 + + gobject/gobjectnotifyqueue.c | 11 ----------- + 1 files changed, 0 insertions(+), 11 deletions(-) + +commit a2c5bba31d19dcd7f3726c99280ff794cbf744a9 +Author: Benjamin Otte +Date: Thu Jul 22 08:52:25 2010 +0200 + + notify: Emit a g_critical() instead g_return_if_fail()ing + + This does not change the code semantically in any way but avoids a + return in the middle of the code. + + https://bugzilla.gnome.org/show_bug.cgi?id=166020 + + gobject/gobjectnotifyqueue.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit 24161d9c4621ef0a674c31146e9fd0d2e9ad8d0f +Author: Benjamin Otte +Date: Thu Jul 22 20:24:29 2010 +0200 + + binding: Cast to avoid compiler warning + + gobject/tests/binding.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit dd1d1b3510536d4156eb79bb7161023c464e721f +Author: Benjamin Otte +Date: Thu Jul 22 20:23:28 2010 +0200 + + tests: Use GPOINTER_TO_SIZE() instead of just casting to guint + + a) gcc doesn't like this ("Cast to pointer of different size) + b) It compares only half of the pointer + + gio/tests/memory-output-stream.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 284ea16b9d94b28b632063333140b99e419d6b0a +Author: Benjamin Otte +Date: Thu Jul 22 20:23:04 2010 +0200 + + inotify: Constify function argument + + gcc complained... + + gio/inotify/inotify-helper.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit dc7348b305c72c757f8ed1d8ba2cae2a19a3c684 +Author: Ryan Lortie +Date: Thu Jul 22 11:49:30 2010 -0400 + + Fix very small leak in the GSettings test + + gio/tests/gsettings.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 23a904fc1520b06aefa1e51e690d2e7b2fcc3ead +Author: Ryan Lortie +Date: Wed Jul 21 20:10:31 2010 -0700 + + Bug 624991 - GSettings mapping for G_TYPE_STRV + + Added default mapping for G_TYPE_STRV based on a patch from Garrett + Regier. + + Add a test case. + + gio/gsettings-mapping.c | 18 +++++++++++++++++- + gio/tests/gsettings.c | 31 +++++++++++++++++++++++++++++++ + gio/tests/org.gtk.test.gschema.xml | 3 +++ + 3 files changed, 51 insertions(+), 1 deletions(-) + +commit 76aef137c8ba8410bd2b5bc31873db5d60dad961 +Author: Fran Diéguez +Date: Thu Jul 22 16:23:18 2010 +0200 + + Updated Galician translations + + po/gl.po | 132 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 70 insertions(+), 62 deletions(-) + +commit 8f80ff02af2fabd22d5aac1d1b853d1ac7865e85 +Author: Behdad Esfahbod +Date: Wed Jul 21 16:08:19 2010 -0400 + + Bug 624968 - div by zero in g_malloc_n family + + glib/gmem.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5063d78baac684a1c53a6a1620ff94789026ae26 +Author: Yaron Shahrabani +Date: Wed Jul 21 19:11:53 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 124 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 64 insertions(+), 60 deletions(-) + +commit 9b0a08449fd966aff7a6c164c9913b01106a37cc +Author: David Zeuthen +Date: Tue Jul 20 15:02:36 2010 -0400 + + GDBusAuthObserver: Fix docs + + Signed-off-by: David Zeuthen + + gio/gdbusauthobserver.c | 53 + +++++++++------------------------------------- + 1 files changed, 11 insertions(+), 42 deletions(-) + +commit 7eba41346e014649d8f9cf8ab675d1f091f7cf38 +Author: David Zeuthen +Date: Tue Jul 20 14:02:14 2010 -0400 + + Bug 617483 – Credentials passing + + - Make GCredentials instance and class structures private so it can't + be subclassed and we don't have to worry about ABI compat + issues. This also allows us to get rid of the GCredentialsPrivate + struct. + + - Add a GCredentialsType enumeration that is used whenever exchanging + pointers with the user. This allows us to support OSes with + multiple native credential types. In particular, it allows + supporting OSes where the native credential evolves or even changes + over time. + + - Add g_socket_get_credentials() method. + + - Add tests for g_socket_get_credentials(). Right now this is in the + GDBus peer-to-peer test case but we can change that later. + + - Move GTcpConnection into a separate gtk-doc page as was already + half-done with GUnixConnection. Also finish the GUnixConnection + move and ensure send_credentials() and receive_credentials() + methods are in the docs. Also nuke comment about GTcpConnection + being empty compared to its superclass. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 43 ++++++----- + gio/gcredentials.c | 135 + ++++++++++++++++++++++++----------- + gio/gcredentials.h | 44 +---------- + gio/gio.symbols | 2 + + gio/gioenums.h | 15 ++++ + gio/gnetworkingprivate.h | 8 ++ + gio/gsocket.c | 72 ++++++++++++++++++- + gio/gsocket.h | 2 + + gio/gtcpconnection.c | 7 +-- + gio/gunixconnection.c | 6 ++ + gio/gunixcredentialsmessage.c | 18 +++-- + gio/tests/gdbus-peer.c | 36 +++++++++ + 13 files changed, 273 insertions(+), 116 deletions(-) + +commit b3cf5cbd0bfcfe53f82a72d276683aebd15d3828 +Author: David Zeuthen +Date: Tue Jul 20 12:14:30 2010 -0400 + + GDBusServer: Avoid handling incoming connections after stop() has + been called + + Without this fix, we'd sometimes run code after stop() and finalize() + to handle incoming requests. This was observed in the gdbus-peer test + case occasionally crashing: + + $ ./gdbus-peer + /gdbus/peer-to-peer: OK + /gdbus/delayed-message-processing: OK + /gdbus/nonce-tcp: + GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' + in cast to `GDBusServer' + aborting... + + Signed-off-by: David Zeuthen + + gio/gdbusserver.c | 15 +++++++++++---- + 1 files changed, 11 insertions(+), 4 deletions(-) + +commit 2be167f57c2b59d427aa54e2204bfaa906391b3e +Author: David Zeuthen +Date: Tue Jul 20 11:38:23 2010 -0400 + + GDBus: Add support for D-Bus type 'h' (ie. G_VARIANT_TYPE_HANDLE) + + This allows sending and receiving D-Bus messages with instances of the + 'h' D-Bus type. Unlike libdbus-1's dbus_message_iter_get_basic() + method, g_variant_get_handle() does not return a duplicated unix file + descriptor (that must be closed with close(2)) - instead, it returns + an index that can be used to get/dup the file descriptor from a + GUnixFDList object that can be obtained from the GDBusMessage object. + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 22 ++++++++++++++++++++++ + gio/tests/gdbus-serialization.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 50 insertions(+), 0 deletions(-) + +commit 66388120d23a2fcec345874cc1a6259c08a6ef38 +Author: Ryan Lortie +Date: Tue Jul 20 10:45:52 2010 -0400 + + Move #include down + + Until after we include the glib stuff, so that we have G_OS_UNIX + defined. + + For some reason pulls in on Fedora so this + wasn't a problem, but many others have reported the issue. + + gio/gdbusaddress.c | 4 +--- + 1 files changed, 1 insertions(+), 3 deletions(-) + +commit 2f5056755763e4628ed0e64954229e0a7dd9dbfb +Author: Jorge González +Date: Tue Jul 20 08:57:35 2010 +0200 + + Updated Spanish translation + + po/es.po | 19 +++++++------------ + 1 files changed, 7 insertions(+), 12 deletions(-) + +commit c3737739aeeeac27e68d50d8c48dfa0ae7d23ee9 +Author: noch +Date: Tue Jul 20 10:33:32 2010 +0500 + + Corrected and updated the new version of the Armenian translation - + po file. + + po/hy.po | 3004 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 1617 insertions(+), 1387 deletions(-) + +commit 493d8cb2926c0d54a45fd1fdb7f383c730321aa8 +Author: David Zeuthen +Date: Mon Jul 19 17:03:07 2010 -0400 + + GDBus: Introduce G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL + + This is preferable to the current magical solution whereby the serial + is only rewritten if non-zero. In particular, it makes it easier to + send the same message on multiple connections without having to reset + the serial number. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 45 + ++++++++++++++++++++++----------------------- + gio/gioenums.h | 6 +++++- + 2 files changed, 27 insertions(+), 24 deletions(-) + +commit 9d7b00638fa6d0701ca8f883edf9e218c3a54412 +Author: David Zeuthen +Date: Mon Jul 19 16:10:50 2010 -0400 + + GDBus: Forgot to add g_dbus_send_message_flags_get_type() to + gio.symbols + + Signed-off-by: David Zeuthen + + gio/gio.symbols | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 0b2b4deac549623beb90228a0ad36f8c2c315710 +Author: David Zeuthen +Date: Mon Jul 19 16:07:57 2010 -0400 + + GDBus: Add GDBusSendMessageFlags + + This is currently unused but might be useful in the future. For + example, it might be nice with a way to bypass the current queue of + outgoing messages - having a flag enumeration allows us to add a + G_DBUS_SEND_MESSAGE_FLAGS_BYPASS_QUEUE etc. etc. + + This commit breaks ABI and API. Users of the (rarely used) API to send + messages will have to port to this new API. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 1 + + gio/gdbusconnection.c | 64 + ++++++++++++++++++------------ + gio/gdbusconnection.h | 3 + + gio/gdbusmethodinvocation.c | 4 +- + gio/gioenums.h | 13 ++++++ + gio/tests/gdbus-connection.c | 6 ++- + gio/tests/gdbus-example-server.c | 1 + + gio/tests/gdbus-example-unix-fd-client.c | 1 + + gio/tests/gdbus-peer.c | 4 +- + 9 files changed, 67 insertions(+), 30 deletions(-) + +commit 7190af4394541c1adbe87769f7bd6db030e33605 +Author: David Zeuthen +Date: Mon Jul 19 15:45:27 2010 -0400 + + GDBus: Remove constness from introspection data structures + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 15 +++---- + gio/gdbus-tool.c | 4 +- + gio/gdbusapplication.c | 2 +- + gio/gdbusconnection.c | 16 ++++---- + gio/gdbusconnection.h | 2 +- + gio/gdbusintrospection.c | 60 +++++++++++++++--------------- + gio/gdbusintrospection.h | 71 + +++++++++++++++++------------------ + gio/tests/gdbus-export.c | 26 ++++++------ + gio/tests/gdbus-introspection.c | 6 +- + gio/tests/gdbus-peer.c | 2 +- + 10 files changed, 101 insertions(+), 103 deletions(-) + +commit 4a1c5a1b98aed12308361d7adb6089a9fb171583 +Author: David Zeuthen +Date: Mon Jul 19 15:03:00 2010 -0400 + + GDBus: Add GDBusSignalFlags and use it in + g_dbus_connection_signal_subscribe() + + This is currently unused but will probably be useful in the + future. For example, we could have a _ARG0_IS_PATH to specify that + arg0 should be used for arg0path. + + This commit breaks API and ABI. Users of + g_dbus_connection_signal_subscribe() will need to port to this new + version. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 1 + + gio/gdbus-tool.c | 1 + + gio/gdbusconnection.c | 2 ++ + gio/gdbusconnection.h | 1 + + gio/gdbusnameowning.c | 2 ++ + gio/gdbusnamewatching.c | 1 + + gio/gdbusproxy.c | 3 +++ + gio/gio.symbols | 1 + + gio/gioenums.h | 13 +++++++++++++ + gio/tests/gdbus-connection.c | 21 +++++++++++++-------- + gio/tests/gdbus-threading.c | 1 + + gio/tests/testapps.c | 1 + + 12 files changed, 40 insertions(+), 8 deletions(-) + +commit 1a06bd8d3f8ccf040901b4aa4b1197d189b8ab4e +Author: Ryan Lortie +Date: Mon Jul 19 15:03:54 2010 -0400 + + Update the GDBus subtree example for the new API + + docs/reference/glib/tmpl/messages.sgml | 27 +++++++++++++++++++++------ + gio/tests/gdbus-example-subtree.c | 21 ++++++++++++--------- + 2 files changed, 33 insertions(+), 15 deletions(-) + +commit c7c573afb6eef461bfe70bb848c90b1d58b3d4d9 +Author: David Hoyt +Date: Mon Jul 19 13:52:17 2010 -0400 + + Bug 624754 – gdbusaddress.c missing sys/wait.h + + https://bugzilla.gnome.org/show_bug.cgi?id=624754 + + Signed-off-by: David Zeuthen + + gio/gdbusaddress.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit d63f199d921b2444e25bc9f39cc12a84ad9695b5 +Author: Ryan Lortie +Date: Sun Jul 18 21:43:18 2010 -0400 + + Fix is_valid() API + + Actually dereference the pointer instead of just checking for NULL + + gvdb-reader.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit df40747190a0fff4582c84b101f74e5da91f8f72 +Author: Ryan Lortie +Date: Sun Jul 18 20:45:37 2010 -0400 + + Add gvdb_table_is_valid() API + + Checks that the on-disk file is still valid. + + gvdb-reader.c | 17 +++++++++++++++++ + gvdb-reader.h | 3 +++ + 2 files changed, 20 insertions(+), 0 deletions(-) + +commit f81601f735c3b5be0cb21031979071b2dff1ceb2 +Author: Jorge González +Date: Sun Jul 18 20:29:41 2010 +0200 + + Updated Spanish translation + + po/es.po | 282 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 154 insertions(+), 128 deletions(-) + +commit 8ab26d42e97c5e751f78d2b08d71cddcc5a37031 +Author: Fran Diéguez +Date: Sun Jul 18 19:58:33 2010 +0200 + + Fixed headers in galician translation file + + po/gl.po | 1181 + +++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 600 insertions(+), 581 deletions(-) + +commit 5fb9c9f7de9700fe1639deb381bab7e3b2785689 +Author: Yaron Shahrabani +Date: Sat Jul 17 13:11:08 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 85 + +++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 51 insertions(+), 34 deletions(-) + +commit f30aef9a105a2cb44bac1bbe3b8bb93387a41d9a +Author: David Zeuthen +Date: Fri Jul 16 13:19:48 2010 -0400 + + GDBus: Add nonce-tcp: test case + + Also fix a couple of TODO items in gdbusaddress.c + + Signed-off-by: David Zeuthen + + gio/gdbusaddress.c | 85 +++++++++++++------- + gio/tests/gdbus-peer.c | 203 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 259 insertions(+), 29 deletions(-) + +commit 27cee11b6c1558f44cc89cd46576e11413370abf +Author: Yaron Shahrabani +Date: Fri Jul 16 17:20:42 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 1221 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 633 insertions(+), 588 deletions(-) + +commit fe6338f446f52deeb64aa10fab1c72fa64953472 +Author: Ryan Lortie +Date: Thu Jul 15 19:37:26 2010 -0400 + + g_warning on inconsistent subtree behaviour + + If the subtree introspection function indicates that an interface + exists + but then the dispatch function returns a NULL vtable for that + interface, + issue a g_warning pointing programmers in the right direction. + + gio/gdbusconnection.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit 732ff1b27cc6f7bbbb1133bf8e7cb3de8475f72a +Author: Julien Cristau +Date: Thu Jul 15 15:26:02 2010 +0100 + + gio: don't assume that SOCK_CLOEXEC is supported whenever it's defined + + Just because SOCK_CLOEXEC was defined at build time doesn't mean the + kernel we're running on supports it. So if socket() fails with + EINVAL, + try again without the flag. + + https://bugzilla.gnome.org/show_bug.cgi?id=624463 + + gio/gsocket.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 8a2d157d49c3dceda029bd0e14f8c7367daa2a36 +Author: Ryan Lortie +Date: Thu Jul 15 16:53:43 2010 -0400 + + Bug 624484: GDBusSubtreeDispatchFunc clarification + + Pass NULL rather than "/" for the toplevel of a subtree. + + Add clarification to the docs about how trees are flat. + + gio/gdbusconnection.c | 4 ++-- + gio/gdbusconnection.h | 10 ++++++++-- + gio/tests/gdbus-export.c | 10 +++++----- + 3 files changed, 15 insertions(+), 9 deletions(-) + +commit ca14ab7ac0d93b2ccd0977d905b19094e7317490 +Author: Ryan Lortie +Date: Thu Jul 15 16:47:32 2010 -0400 + + Bug 624483: GDBusSubtreeEnumerateFunc clarification + + Clarify a couple of things in the docs: + + 1) you must return flat names (no slashes) + + 2) g_strfreev() will be called on the result + + 3) a benefit of using the DISPATCH_TO_UNENUMERATED flag + + gio/gdbusconnection.h | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit e6b5546cf573e6594b33b2ce19ad839c1c694909 +Author: Ryan Lortie +Date: Thu Jul 15 16:26:42 2010 -0400 + + Bug 624473: GDBusSubtreeIntrospectFunc return type + + Return a NULL terminated C array instead of a GPtrArray + + Also, document that %NULL is a permitted return value and clarify its + meaning. + + Finally, avoid calling the enumeration function during dispatch + when the + G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag was given. + + gio/gdbusconnection.c | 76 + ++++++++++++++++++++++++++-------------------- + gio/gdbusconnection.h | 27 ++++++++++++---- + gio/tests/gdbus-export.c | 25 +++++++-------- + 3 files changed, 74 insertions(+), 54 deletions(-) + +commit 48b1fe948c4424cbc7e68ecca32b0ddac0f7410b +Author: David Zeuthen +Date: Thu Jul 15 12:19:24 2010 -0400 + + Bug 623810 – Message serialization bug + + https://bugzilla.gnome.org/show_bug.cgi?id=623810 + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 2 +- + gio/tests/gdbus-serialization.c | 40 + +++++++++++++++++++++++++++----------- + 2 files changed, 29 insertions(+), 13 deletions(-) + +commit 44cf10adceb673deefebe348350268d9436f3fab +Author: Tomeu Vizoso +Date: Thu Jul 15 17:05:00 2010 +0200 + + Add annotations for g_variant_new_strv and g_variant_get_strv + + glib/gvariant.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 58f1977151a78bd48e0277cefe6a767595ecb095 +Author: Tomeu Vizoso +Date: Thu Jul 15 15:32:45 2010 +0200 + + Add annotations to g_dbus_proxy_new_sync + + gio/gdbusproxy.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 63938335703ea3608f7b0901d1cdcec4855e8880 +Author: Aron Xu +Date: Thu Jul 15 17:56:14 2010 +0800 + + Update Simplified Chinese translation. + + po/zh_CN.po | 1418 + +++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 738 insertions(+), 680 deletions(-) + +commit 2bd201c8b21a5daa666169701b1c12dd3b151a26 +Author: Lucian Adrian Grijincu +Date: Thu Jul 15 02:10:43 2010 +0300 + + po: Updated Romanian translation + + po/ro.po | 1796 + +++++++++++++++++--------------------------------------------- + 1 files changed, 490 insertions(+), 1306 deletions(-) + +commit d581a7faf1080e67fd6c731cd04beefbc77cf41a +Author: Mario Blättermann +Date: Wed Jul 14 23:06:18 2010 +0200 + + [i18n] Updated German translation + + po/de.po | 1567 + ++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 822 insertions(+), 745 deletions(-) + +commit baf383d1b14ebcd217a587fe8c78202fc5e9193b +Author: David Zeuthen +Date: Wed Jul 14 14:46:12 2010 -0400 + + GDBusConnection: copy object and subtree virtual tables + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 58 + +++++++++++++++++++++++++++++++++++++++++------- + gio/gdbusconnection.h | 19 +++++++-------- + 2 files changed, 58 insertions(+), 19 deletions(-) + +commit 914b046226c762bae578e17f7ed9a0fdf058045a +Author: David Zeuthen +Date: Wed Jul 14 12:37:32 2010 -0400 + + GDBusConnection: Fix up g_dbus_connection_close() + + ... so it is async, cancelable and returns an error. Also provide a + synchronous version. + + This is an API/ABI break but it is expected that only very few + applications use this API. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 2 + + gio/gdbusconnection.c | 151 + +++++++++++++++++++++++++++++++---- + gio/gdbusconnection.h | 14 +++- + gio/gio.symbols | 2 + + gio/tests/gdbus-connection.c | 8 ++- + 5 files changed, 158 insertions(+), 19 deletions(-) + +commit 14e37ef7967a2da594faaab24fe2c9c117cf099f +Author: David Zeuthen +Date: Wed Jul 14 11:39:22 2010 -0400 + + GDBusMessage: Make endianness for D-Bus messages match host byte order + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 12 +++++++++++- + 1 files changed, 11 insertions(+), 1 deletions(-) + +commit 497edd8b40edfbf85e029a9300e0d99ac6f08630 +Author: David Zeuthen +Date: Wed Jul 14 11:14:58 2010 -0400 + + Bug 623815 – Don't check sender for GDBusProxy objects where name + is not set + + Based on a patch from Peng Huang , thanks! + + https://bugzilla.gnome.org/show_bug.cgi?id=623815 + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 4 +- + gio/tests/gdbus-peer.c | 72 + ++++++++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 69 insertions(+), 7 deletions(-) + +commit 8a2e7d371fdf55c23c61be908761431509cd3a7c +Author: Colin Walters +Date: Fri Jun 18 14:19:57 2010 -0400 + + Make default-quit not apply if register=FALSE + + Callers who are using g_application_unregistered_try_new are + likely wanting to continue doing something else if _register() + fails. Change the semantics so that passing register=FALSE + unsets default-quit as well. This means that a later _register() + call will send Activate but continue the process. + + https://bugzilla.gnome.org/show_bug.cgi?id=622005 + + gio/gapplication.c | 23 ++++++++++++++++++----- + gio/gdbusapplication.c | 9 +++++++-- + 2 files changed, 25 insertions(+), 7 deletions(-) + +commit 7e0121dfe0a9377cd35c9d4b90c477b96d56c43f +Author: Chao-Hsiung Liao +Date: Wed Jul 14 19:28:34 2010 +0800 + + Updated Traditional Chinese translation(Hong Kong and Taiwan) + + po/zh_HK.po | 1717 + +++++++++++++++++++++++++++++++---------------------------- + po/zh_TW.po | 1700 + +++++++++++++++++++++++++++++++---------------------------- + 2 files changed, 1803 insertions(+), 1614 deletions(-) + +commit 463edcb045b287cd0df8f44322e133ae32fe5e87 +Author: Stefan Kost +Date: Wed Jul 14 11:56:41 2010 +0300 + + docs: xi:include the annotation glossary to kill warnings and make + them work + + docs/reference/gio/gio-docs.xml | 3 +++ + docs/reference/glib/glib-docs.sgml | 2 ++ + docs/reference/gobject/gobject-docs.sgml | 2 ++ + 3 files changed, 7 insertions(+), 0 deletions(-) + +commit de56aca0b5cf2eaf99ba501dd3d55b750c752433 +Author: Javier Jardón +Date: Tue Jul 13 05:05:48 2010 +0200 + + Clean autotools config a bit + + New requirements: + autoconf >= 2.62 + automake >= 1.10 + libtool >= 2.2 + + Makefile.am | 4 +--- + autogen.sh | 10 +++------- + configure.ac | 14 +++++--------- + 3 files changed, 9 insertions(+), 19 deletions(-) + +commit 3a8ab85d967c3b0fa1b7d702d640df61020d92a0 +Author: Ryan Lortie +Date: Tue Jul 13 11:59:16 2010 -0400 + + rename configure.in to configure.ac + + README.win32 | 2 +- + config.h.win32.in | 2 +- + configure.ac | 3756 + ++++++++++++++++++++++++++++++++++++++++++++++ + configure.in | 3756 + ---------------------------------------------- + glib/gmem.c | 2 +- + glib/gthread.c | 4 +- + m4macros/glib-gettext.m4 | 4 +- + 7 files changed, 3763 insertions(+), 3763 deletions(-) + +commit 0bb7cc3fceb9223845d2032c9d381f2e15c5285d +Author: Ryan Lortie +Date: Tue Jul 13 09:24:16 2010 -0400 + + Remove GUnixVolumeMonitor, GUnixMount from docs + + David says that they're supposed to be private. + + docs/reference/gio/Makefile.am | 3 ++ + docs/reference/gio/gio-sections.txt | 15 ---------- + docs/reference/glib/tmpl/glib-unused.sgml | 40 + ---------------------------- + docs/reference/glib/tmpl/version.sgml | 41 + +++++++++++++++++++++++++++++ + 4 files changed, 44 insertions(+), 55 deletions(-) + +commit 5344c22810c01a0cd708562be563f81f15f517f3 +Author: Ryan Lortie +Date: Mon Jul 12 18:30:14 2010 -0400 + + gio/ docs fixup + + docs/reference/gio/Makefile.am | 5 ++ + docs/reference/gio/gio-sections.txt | 32 +-------------- + docs/reference/glib/tmpl/glib-unused.sgml | 59 + +++++++++++++++-------------- + gio/fen/fen-kernel.c | 6 +- + gio/fen/fen-node.c | 8 ++-- + gio/fen/libfen_la-fen-dump.loT | 7 --- + gio/gappinfo.h | 1 - + gio/gbufferedoutputstream.h | 1 - + gio/gconverterinputstream.h | 1 - + gio/gconverteroutputstream.h | 1 - + gio/gdatainputstream.h | 1 - + gio/gdataoutputstream.h | 1 - + gio/gfileenumerator.h | 1 - + gio/gkeyfilesettingsbackend.c | 2 +- + gio/gsettings.c | 8 ++-- + gio/gsettings.h | 2 +- + gio/gsettingsschema.c | 2 +- + gio/gunixconnection.c | 2 +- + gio/gvolumemonitor.h | 1 - + 19 files changed, 53 insertions(+), 88 deletions(-) + +commit adde752ec5a600a71f8c9acf1be032ab5f5de46c +Author: Ryan Lortie +Date: Mon Jul 12 17:46:17 2010 -0400 + + More docs fixes + + Remove the g*alias.h from the ignore lists + + Remove other old files from ignore lists + + Clean up gobject docs + + docs/reference/gio/Makefile.am | 2 -- + docs/reference/glib/Makefile.am | 6 ------ + docs/reference/gobject/Makefile.am | 2 +- + gobject/gparamspecs.h | 2 ++ + gobject/gvaluecollector.h | 7 ++++++- + 5 files changed, 9 insertions(+), 10 deletions(-) + +commit de5afbc7cc262b677e00704e1bf3562f45dbede0 +Author: Ryan Lortie +Date: Mon Jul 12 17:32:44 2010 -0400 + + More gtk-doc cleanups for glib/ + + docs/reference/glib/Makefile.am | 2 ++ + docs/reference/glib/glib-sections.txt | 6 ++++++ + docs/reference/glib/tmpl/glib-unused.sgml | 9 --------- + docs/reference/glib/tmpl/i18n.sgml | 10 ++++++++++ + 4 files changed, 18 insertions(+), 9 deletions(-) + +commit 92df91590fd4b1ca4921cc3f89421928b857e75c +Author: Ryan Lortie +Date: Mon Jul 12 17:31:03 2010 -0400 + + trivial whitespace fix + + glib/gmem.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7791fce38a1a7d292e94d3bb5a0ffb8d6da9333d +Author: Ryan Lortie +Date: Mon Jul 12 16:37:56 2010 -0400 + + Fix some glib docs warnings + + Remove some symbols from glib-sections.txt that gtk-doc has no idea + about. + + Add proper callback typedefs for GTester (gtk-doc dislikes inline + function types). + + Fix some other minor issues. + + docs/reference/glib/glib-sections.txt | 9 +++- + docs/reference/glib/tmpl/fileutils.sgml | 6 +++ + docs/reference/glib/tmpl/testing.sgml | 35 +++++++++++++++-- + glib/gstdio.c | 8 ++++ + glib/gstrfuncs.c | 10 ++-- + glib/gtestutils.c | 62 + ++++++++++++++++++++++-------- + glib/gtestutils.h | 30 +++++++++------ + glib/gutf8.c | 2 +- + glib/gvariant.c | 2 +- + 9 files changed, 121 insertions(+), 43 deletions(-) + +commit dc8cf867c805095b7acd7842b731c6eff32ee18f +Author: Matthias Clasen +Date: Mon Jul 12 07:50:36 2010 -0400 + + Don't return FALSE when a pointer is expected + + Pointed out in bug 623956 + + glib/gvariant-parser.c | 8 ++++---- + glib/tests/markup-subparser.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit 90285b0643d23059bdf28aff4afd337f91a556a6 +Author: Ryan Lortie +Date: Mon Jul 12 15:30:26 2010 -0400 + + Bump gtk-doc dependency to 1.15 + + Use the multiple source-directory support contained therein. + + configure.in | 2 +- + docs/reference/glib/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 83d67bf2e79e1cb984e398b218cedd0b1e50bd1f +Author: Ryan Lortie +Date: Sun Jul 11 21:08:42 2010 -0400 + + move glibconfig.h to glib/ + + .gitignore | 2 - + Makefile.am | 18 +--- + configure.in | 14 +- + gio/abicheck.sh | 2 +- + glib/.gitignore | 4 + + glib/Makefile.am | 29 ++++- + glib/abicheck.sh | 2 +- + glib/glibconfig.h.win32.in | 284 + ++++++++++++++++++++++++++++++++++++++++++++ + glibconfig.h.win32.in | 284 + -------------------------------------------- + gobject/abicheck.sh | 2 +- + 10 files changed, 325 insertions(+), 316 deletions(-) + +commit 29a6fb68b7d73648992ea55d17cc54fc1261fe29 +Author: Colin Walters +Date: Fri Jun 25 09:37:06 2010 -0400 + + Don't attempt to build dtrace support on OS X + + Apparently the OS X "dtrace" command is different from the Sun one, + which is what Linux supports. Since I don't have access to an OS X + machine to test build patches on, simply disable dtrace on OS X + for now. + + https://bugzilla.gnome.org/show_bug.cgi?id=622697 + + configure.in | 22 +++++++++++++--------- + 1 files changed, 13 insertions(+), 9 deletions(-) + +commit e5834637eb4a336393989dc68d7615abf153335f +Author: Baurzhan Muftakhidinov +Date: Mon Jul 12 16:19:45 2010 +0300 + + Added Kazakh translation for Kazakh + + po/LINGUAS | 1 + + po/kk.po | 2813 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 2814 insertions(+), 0 deletions(-) + +commit 82318fbda3441615e11fe5fa25144d27096286fe +Author: Ryan Lortie +Date: Sun Jul 11 12:51:54 2010 -0400 + + bump the version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit be247c24c6b532b2acfe52424ffdcc79bdc48bf4 +Author: Ryan Lortie +Date: Sun Jul 11 12:51:33 2010 -0400 + + This is glib 2.25.11 + + NEWS | 1 + + docs/reference/glib/tmpl/atomic_operations.sgml | 42 + +++++++++++++---------- + docs/reference/glib/tmpl/bookmarkfile.sgml | 16 ++++---- + docs/reference/glib/tmpl/conversions.sgml | 22 ------------ + docs/reference/glib/tmpl/numerical.sgml | 10 +++++ + 5 files changed, 43 insertions(+), 48 deletions(-) + +commit 8c36b1ad2bf03141cd1aacbb0fa9d19ba7c72c17 +Author: Kjartan Maraas +Date: Sun Jul 11 15:51:04 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 1387 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 732 insertions(+), 655 deletions(-) + +commit 358b9d6ac750c3d35b259df2b59353d004a32ace +Author: Matthias Clasen +Date: Sat Jul 10 23:53:36 2010 -0400 + + Move main loop docs inline + + docs/reference/glib/tmpl/main.sgml | 288 +++++----------------------- + glib/gmain.c | 76 ++++++++ + glib/gmain.h | 374 + ++++++++++++++++++++++++++++-------- + glib/gpoll.h | 30 +++- + 4 files changed, 448 insertions(+), 320 deletions(-) + +commit ab8cb652c83d77471b2e0f56b270d4ef8704dae9 +Author: Matthias Clasen +Date: Sat Jul 10 22:30:04 2010 -0400 + + Fix a typo + + docs/reference/glib/tmpl/bookmarkfile.sgml | 100 + ++++------------------------ + glib/gatomic.c | 2 +- + glib/gbookmarkfile.c | 44 ++++++++++++ + glib/gbookmarkfile.h | 30 ++++++++- + glib/tests/Makefile.am | 3 +- + glib/tests/bookmarks.xbel | 23 +++++++ + 6 files changed, 109 insertions(+), 93 deletions(-) + +commit e57291efdc53a2f7732e39730ef91dab266ade83 +Author: Matthias Clasen +Date: Sat Jul 10 21:51:34 2010 -0400 + + Move docs for atomic operations inline + + docs/reference/glib/tmpl/atomic_operations.sgml | 136 + +++++------------------ + glib/gatomic.c | 133 + ++++++++++++++++++++++- + glib/gatomic.h | 22 ++++- + 3 files changed, 183 insertions(+), 108 deletions(-) + +commit e8503fddee2c5426a98d066c5a24afd9ae7ade50 +Author: Matthias Clasen +Date: Sat Jul 10 21:26:28 2010 -0400 + + Move GAsyncQueue docs inline + + docs/reference/glib/tmpl/async_queues.sgml | 55 + +--------------------------- + glib/gasyncqueue.c | 53 + +++++++++++++++++++++++++++ + 2 files changed, 55 insertions(+), 53 deletions(-) + +commit db0c58062dd208982521dfc99b0da59a5bd4327b +Author: Ryan Lortie +Date: Sat Jul 10 23:28:30 2010 -0400 + + NEWS for the pending release + + NEWS | 152 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 152 insertions(+), 0 deletions(-) + +commit d2fe46b476a183168d57581c41b763b9e8f03c7c +Author: Colin Walters +Date: Sat Jul 10 20:09:34 2010 -0400 + + Annotate all custom GIO GSource using g_source_set_name + + Naming the sources allows easier debugging with e.g. SystemTap + probes. + + https://bugzilla.gnome.org/show_bug.cgi?id=620536 + + gio/gsocket.c | 1 + + gio/gunixinputstream.c | 1 + + gio/gunixoutputstream.c | 1 + + gio/inotify/inotify-kernel.c | 1 + + glib/giounix.c | 1 + + glib/giowin32.c | 1 + + 6 files changed, 6 insertions(+), 0 deletions(-) + +commit 7568bb66f996bdf94da6963399333236f73adb1b +Author: Matthias Clasen +Date: Sat Jul 10 20:00:49 2010 -0400 + + use proper feature test macros for isnan + + Problem pointed out in bug 581354 + + glib/tests/strfuncs.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit d9dc570c593a29be62b3d85cef43f92f52dcce8e +Author: Matthias Clasen +Date: Sat Jul 10 19:46:40 2010 -0400 + + Add ACLOCAL_AMFLAGS to Makefile.am + + Patch by Vincent Untz, bug 570036 + + Makefile.am | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 3dca4ce434f30a5c72f773c5c0437d4ac92413ab +Author: Matthias Clasen +Date: Sat Jul 10 19:16:27 2010 -0400 + + One more dubious return + + gio/gsocketlistener.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d44ae96cb1566447ce44034b8b9290badacb6fe4 +Author: Ryan Lortie +Date: Sat Jul 10 17:54:08 2010 -0400 + + GVariant: fix some more leaks in error cases + + glib/gvariant-parser.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 90c49a0654f4aa556f3d2ccb7c91b6e480eef1ae +Author: Ryan Lortie +Date: Sat Jul 10 17:45:51 2010 -0400 + + move the g_free() from the last commit down + + It is needed for the error message... + + glib/gvariant-parser.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 29babb9fc8baf2327b2e0781fbf07bed76a4cbde +Author: Matthias Clasen +Date: Sat Jul 10 18:04:22 2010 -0400 + + Minor cleanup + + gio/glocalfileenumerator.c | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +commit f8e22856c643bfccaf03db6f84738126cff374d0 +Author: Matthias Clasen +Date: Sat Jul 10 17:57:45 2010 -0400 + + Add a GAppInfoCreate flag for startup-notification + + Using this flag, it will be possible to launch apps without a + desktop file, in the same way that gdk_spawn_... lets you do. + + Requested in bug 599223. + + gio/gdesktopappinfo.c | 2 +- + gio/gioenums.h | 8 +++++--- + 2 files changed, 6 insertions(+), 4 deletions(-) + +commit 5f1490e94aa0fcfe72b92377dc7efae4b3300a6c +Author: Matthias Clasen +Date: Sat Jul 10 17:21:32 2010 -0400 + + Fix sparse warnings + + These were listed in bug 623955 + + gio/gconverteroutputstream.c | 2 +- + gio/gdbusauthmechanismsha1.c | 4 ++-- + gio/gdbusconnection.c | 2 +- + gio/gfileinfo.c | 4 ++-- + gio/ginetsocketaddress.c | 2 +- + gio/gmount.c | 6 +++--- + gio/gschema-compile.c | 6 +++--- + gio/gunixfdmessage.c | 2 +- + gio/gunixresolver.c | 9 ++++++--- + 9 files changed, 20 insertions(+), 17 deletions(-) + +commit 41f4aba2d22ceec7f8dd0916aae99fb3eea5699f +Author: Matthias Clasen +Date: Sat Jul 10 17:12:31 2010 -0400 + + Chain up in g_settings_finalize + + Requested in bug 623954 + + gio/gsettings.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 61027a8b5ce75c68f2a6e84134ea88af1f8a5556 +Author: Matthias Clasen +Date: Sat Jul 10 17:06:41 2010 -0400 + + Turn on glibc malloc checking features for make check + + Makefile.decl | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 48a04f9303294304db5693acb1e4421cfdd4464a +Author: Ryan Lortie +Date: Sat Jul 10 16:56:51 2010 -0400 + + GVariant: don't leak during type inferencing + + glib/gvariant-parser.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit b1c4dec264eeff92fc9afd112c6b6fc4fd74c087 +Author: Jorge González +Date: Sat Jul 10 11:03:52 2010 +0200 + + Updated Spanish translation + + po/es.po | 1179 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 588 insertions(+), 591 deletions(-) + +commit 551461b23a52f4c49633352e538184cd8cb250ad +Author: Matthias Clasen +Date: Fri Jul 9 08:33:27 2010 -0400 + + Fix some leaks in the inotify code + + Also avoid creating some unused objects. Patch by Carlos Garnacho, + bug 613057 + + gio/inotify/inotify-helper.c | 11 ++--------- + 1 files changed, 2 insertions(+), 9 deletions(-) + +commit c24a29e13bcf2c36140c5d8467a9258402c347aa +Author: Matthias Clasen +Date: Fri Jul 9 07:24:08 2010 -0400 + + Adapt to recent MLS changes + + g_file_query_info returns non-NULL more often now. + + gio/gfile.c | 7 ++++--- + gio/tests/live-g-file.c | 5 +---- + 2 files changed, 5 insertions(+), 7 deletions(-) + +commit e302e919e5c8329ae293f0ba5921c6dfce289beb +Author: Matthias Clasen +Date: Thu Jul 8 19:52:36 2010 -0400 + + Remove dead links from the IEEE float documentation + + docs/reference/glib/tmpl/numerical.sgml | 46 + +++++++++++-------------------- + 1 files changed, 16 insertions(+), 30 deletions(-) + +commit 0c357a2d149080c4e4fefb29436c03e7879ce437 +Author: Matthias Clasen +Date: Thu Jul 8 19:37:31 2010 -0400 + + Improve the long description of GString + + It is more similar to a Java StringBuffer than to a C string. + See bug 612439. + + docs/reference/glib/tmpl/strings.sgml | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit 2504ec988e0288b8616907b43e489c74d49a08f0 +Author: Will Thompson +Date: Thu Jul 8 19:30:53 2010 -0400 + + Document NULL shortcut to g_value_array_insert etc. + + You can pass a NULL GValue * to any of g_value_array_insert, + _prepend or + _append to add a new, uninitialized value. This is a very useful + shortcut, and it should be documented rather than left languishing + in a + comment in the implementation. + + Fixes Gnome bug #552363. + + gobject/gvaluearray.c | 18 ++++++++++-------- + 1 files changed, 10 insertions(+), 8 deletions(-) + +commit cc44ef148c578ec87f71c155549a5d352a30bb3a +Author: Matthias Clasen +Date: Thu Jul 8 19:26:25 2010 -0400 + + Improve some GNode docs + + See bug 561248 + + glib/gnode.h | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit ac342a8d0c4e50b5983631808ca6b7dc7508e17d +Author: Matthias Clasen +Date: Thu Jul 8 19:23:42 2010 -0400 + + Expand the g_sprintf docs + + As requested in bug 576833. + + glib/gprintf.c | 31 ++++++++++++++++++------------- + 1 files changed, 18 insertions(+), 13 deletions(-) + +commit 7cfa23b17785218463274854753494b5e49584c8 +Author: Matthias Clasen +Date: Thu Jul 8 19:03:18 2010 -0400 + + Add a note about l10n to the g_strconcat docs + + As requested in bug 576854 + + glib/gstrfuncs.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit e0017f24c58ba756c186026e42d59ed3015e80ce +Author: Matthias Clasen +Date: Thu Jul 8 17:38:47 2010 -0400 + + Move uri conversion functions to a better place in the docs + + g_filename_from/to_uri are better off in the section called + "URI functions". Requested in bug 582227. + + docs/reference/glib/glib-sections.txt | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 3c6304a332c8da9275569c9820660e859b4ac160 +Author: Jorge González +Date: Thu Jul 8 23:25:01 2010 +0200 + + Updated Spanish translation + + po/es.po | 176 + ++++++++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 109 insertions(+), 67 deletions(-) + +commit e0f2d0f28e3074ba839f997a15997a2d878d2f76 +Author: Matthias Clasen +Date: Thu Jul 8 16:32:08 2010 -0400 + + Comment out an unused function + + it is causing warnings, so it needs to die...bug 622600 + + glib/pcre/pcre_ucp_searchfuncs.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 448ac22e80bcd947d255616a9147dbce5c85e120 +Author: Matthias Clasen +Date: Thu Jul 8 16:24:44 2010 -0400 + + Fix an oversight in the previous commit + + gio/gdesktopappinfo.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 33f7f6a7485189ef15c953c74dac276e762b3bb9 +Author: Matthias Clasen +Date: Thu Jul 8 16:22:16 2010 -0400 + + Use glib infrastructure to parse debug flags + + Proposed in bug 623319 + + gio/gdbusprivate.c | 41 +++++++++++++++-------------------------- + 1 files changed, 15 insertions(+), 26 deletions(-) + +commit 29850d03e8456ff7b05d7bd6fc9eba9895b50ff6 +Author: Matthias Clasen +Date: Thu Jul 8 15:18:05 2010 -0400 + + Be a bit more picky when deciding if mounts are internal + + Complained about in bug 623780. + + gio/gunixmounts.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit 349aab2bd4cb221b99d98802339bde8d0adc178d +Author: Matthias Clasen +Date: Thu Jul 8 15:11:24 2010 -0400 + + A little more correctness in formatting pids + + Requested in bug 623772 + + gio/gdesktopappinfo.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit fcddf9c2a1e0c76843af91d6d530194bcb7d8791 +Author: Matthias Clasen +Date: Thu Jul 8 14:58:33 2010 -0400 + + Escape arguments when putting together a cmdline + + See bug 623770 + + gio/gdesktopappinfo.c | 16 +++++++++++++--- + 1 files changed, 13 insertions(+), 3 deletions(-) + +commit 607fec50e65eef943bc5dd6254bf0b331b682cca +Author: Matthias Clasen +Date: Thu Jul 8 14:38:55 2010 -0400 + + xinclude the dtd + + Keeping two copies in sync manually gets tiresome. + + gio/gsettings.c | 65 + +------------------------------------------------------ + 1 files changed, 1 insertions(+), 64 deletions(-) + +commit c7816005f99c5293b608c70d4b341d410cb5aea4 +Author: Matthias Clasen +Date: Thu Jul 8 14:29:17 2010 -0400 + + Update the dtd to match the implementation + + See bug 623720 + + gio/gschema.dtd | 30 +++++++++++++++++++++++++----- + 1 files changed, 25 insertions(+), 5 deletions(-) + +commit 71e7b5800a310ae7424f3eec4ebcdcc1becaa6e7 +Author: Matthias Clasen +Date: Thu Jul 8 14:19:08 2010 -0400 + + Handle MLS selinux policy better + + Following the behaviour of ls here, we should return at least the + file name, if we can't get any other information about a file. To + do this, handle EACCESS on stat() calls. + + Patch by Tomas Bzatek, see bug 623692 + + gio/glocalfileinfo.c | 76 + +++++++++++++++++++++++++++++++------------------ + 1 files changed, 48 insertions(+), 28 deletions(-) + +commit 1e8656fe24e846f3bb0533e96afb1e0b46a37b49 +Author: Matthias Clasen +Date: Thu Jul 8 14:12:28 2010 -0400 + + Check for zlib using pkg-config + + Based on a patch by Felipe Contreras, see bug 623473. + + configure.in | 14 ++++++++------ + 1 files changed, 8 insertions(+), 6 deletions(-) + +commit 5adf506d5bb8b0d13ded7fd8480d17d27e7ae31e +Author: Matthias Clasen +Date: Thu Jul 8 11:33:21 2010 -0400 + + Use proper variables + + And also make sure we don't read garbage. + + gio/tests/gsettings.c | 35 ++++++++++++++++++++++++++--------- + 1 files changed, 26 insertions(+), 9 deletions(-) + +commit a00fa340cb776976b14fd1b9476d1488a75d8377 +Author: Ryan Lortie +Date: Wed Jul 7 22:00:43 2010 -0400 + + base64: remove unnecessary assertions + + Allow base64 encoding/decoding of empty strings. + + glib/gbase64.c | 5 +---- + 1 files changed, 1 insertions(+), 4 deletions(-) + +commit ddb919245c33f23c45d69b9e2aea85458d8d67f2 +Author: Matthias Clasen +Date: Wed Jul 7 20:36:28 2010 -0400 + + forgotten file + + glib/tests/keyfiletest.ini | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 5b946e0504952a472cea1ef95df0967e8a4a7b47 +Author: Ryan Lortie +Date: Wed Jul 7 19:53:22 2010 -0400 + + gio/: fully remove gioalias hacks + + gio/.gitignore | 2 - + gio/Makefile.am | 16 +---- + gio/fen/fen-dump.c | 1 - + gio/fen/fen-helper.c | 1 - + gio/fen/fen-kernel.c | 1 - + gio/fen/fen-node.c | 1 - + gio/fen/gfendirectorymonitor.c | 3 - + gio/fen/gfenfilemonitor.c | 3 - + gio/gappinfo.c | 5 - + gio/gapplication.c | 4 - + gio/gasynchelper.c | 1 - + gio/gasyncinitable.c | 4 - + gio/gasyncresult.c | 4 - + gio/gbufferedinputstream.c | 5 - + gio/gbufferedoutputstream.c | 5 - + gio/gcancellable.c | 4 - + gio/gcharsetconverter.c | 4 - + gio/gcontenttype.c | 4 - + gio/gconverter.c | 4 - + gio/gconverterinputstream.c | 4 - + gio/gconverteroutputstream.c | 4 - + gio/gcredentials.c | 4 - + gio/gdatainputstream.c | 5 - + gio/gdataoutputstream.c | 6 +- + gio/gdbusaddress.c | 4 - + gio/gdbusapplication.c | 1 - + gio/gdbusauth.c | 4 - + gio/gdbusauthmechanism.c | 4 - + gio/gdbusauthmechanismanon.c | 4 - + gio/gdbusauthmechanismexternal.c | 4 - + gio/gdbusauthmechanismsha1.c | 4 - + gio/gdbusauthobserver.c | 6 -- + gio/gdbusconnection.c | 4 - + gio/gdbuserror.c | 4 - + gio/gdbusintrospection.c | 4 - + gio/gdbusmessage.c | 5 - + gio/gdbusmethodinvocation.c | 4 - + gio/gdbusnameowning.c | 4 - + gio/gdbusnamewatching.c | 4 - + gio/gdbusprivate.c | 4 - + gio/gdbusproxy.c | 4 - + gio/gdbusserver.c | 4 - + gio/gdbusutils.c | 4 - + gio/gdelayedsettingsbackend.c | 1 - + gio/gdesktopappinfo.c | 4 - + gio/gdrive.c | 4 - + gio/gdummyfile.c | 1 - + gio/gemblem.c | 4 - + gio/gemblemedicon.c | 4 - + gio/gfile.c | 4 - + gio/gfileattribute.c | 4 - + gio/gfiledescriptorbased.c | 5 - + gio/gfileenumerator.c | 4 - + gio/gfileicon.c | 4 - + gio/gfileinfo.c | 4 - + gio/gfileinputstream.c | 5 - + gio/gfileiostream.c | 4 - + gio/gfilemonitor.c | 4 - + gio/gfilenamecompleter.c | 4 - + gio/gfileoutputstream.c | 4 - + gio/gfilterinputstream.c | 4 - + gio/gfilteroutputstream.c | 4 - + gio/gicon.c | 5 - + gio/ginetaddress.c | 4 - + gio/ginetsocketaddress.c | 4 - + gio/ginitable.c | 4 - + gio/ginputstream.c | 4 - + gio/gio.symbols | 4 +- + gio/gioenumtypes.c.template | 6 -- + gio/gioerror.c | 4 - + gio/giomodule.c | 4 - + gio/gioscheduler.c | 5 - + gio/giostream.c | 4 - + gio/gkeyfilesettingsbackend.c | 4 - + gio/gloadableicon.c | 4 - + gio/glocaldirectorymonitor.c | 4 - + gio/glocalfile.c | 1 - + gio/glocalfileenumerator.c | 3 - + gio/glocalfileinfo.c | 1 - + gio/glocalfileinputstream.c | 1 - + gio/glocalfileiostream.c | 1 - + gio/glocalfilemonitor.c | 4 - + gio/glocalfileoutputstream.c | 1 - + gio/glocalvfs.c | 1 - + gio/gmemoryinputstream.c | 4 - + gio/gmemoryoutputstream.c | 4 - + gio/gmemorysettingsbackend.c | 1 - + gio/gmount.c | 4 - + gio/gmountoperation.c | 4 - + gio/gnativevolumemonitor.c | 4 - + gio/gnetworkaddress.c | 4 - + gio/gnetworkservice.c | 4 - + gio/gnullapplication.c | 1 - + gio/gnullsettingsbackend.c | 1 - + gio/goutputstream.c | 4 - + gio/gpermission.c | 4 - + gio/gpollfilemonitor.c | 1 - + gio/gresolver.c | 4 - + gio/gseekable.c | 4 - + gio/gsettings.c | 3 - + gio/gsettingsbackend.c | 4 - + gio/gsimpleasyncresult.c | 4 - + gio/gsimplepermission.c | 4 - + gio/gsocket.c | 4 - + gio/gsocketaddress.c | 4 - + gio/gsocketaddressenumerator.c | 4 - + gio/gsocketclient.c | 4 - + gio/gsocketconnectable.c | 4 - + gio/gsocketconnection.c | 4 - + gio/gsocketcontrolmessage.c | 4 - + gio/gsocketinputstream.c | 4 - + gio/gsocketlistener.c | 4 - + gio/gsocketoutputstream.c | 4 - + gio/gsocketservice.c | 4 - + gio/gsrvtarget.c | 4 - + gio/gtcpconnection.c | 5 - + gio/gthemedicon.c | 4 - + gio/gthreadedresolver.c | 4 - + gio/gthreadedsocketservice.c | 4 - + gio/gunionvolumemonitor.c | 5 - + gio/gunixconnection.c | 4 - + gio/gunixcredentialsmessage.c | 5 - + gio/gunixfdlist.c | 4 - + gio/gunixfdmessage.c | 4 - + gio/gunixinputstream.c | 4 - + gio/gunixmount.c | 1 - + gio/gunixmounts.c | 4 - + gio/gunixoutputstream.c | 4 - + gio/gunixresolver.c | 4 - + gio/gunixsocketaddress.c | 4 - + gio/gunixvolume.c | 1 - + gio/gunixvolumemonitor.c | 1 - + gio/gvfs.c | 4 - + gio/gvolume.c | 6 -- + gio/gvolumemonitor.c | 5 - + gio/gwin32appinfo.c | 1 - + gio/gwin32inputstream.c | 4 - + gio/gwin32mount.c | 1 - + gio/gwin32outputstream.c | 4 - + gio/gwin32resolver.c | 4 - + gio/gwin32volumemonitor.c | 1 - + gio/gzlibcompressor.c | 4 - + gio/gzlibdecompressor.c | 4 - + gio/inotify/ginotifydirectorymonitor.c | 3 - + gio/inotify/ginotifyfilemonitor.c | 3 - + gio/inotify/inotify-helper.c | 3 - + gio/makefile.msc | 8 -- + gio/makegioalias.pl | 139 + -------------------------------- + gio/pltcheck.sh | 21 ----- + gio/win32/gwinhttpfile.c | 2 - + gio/win32/gwinhttpfileinputstream.c | 2 - + gio/win32/gwinhttpfileoutputstream.c | 2 - + gio/win32/gwinhttpvfs.c | 2 - + 153 files changed, 3 insertions(+), 709 deletions(-) + +commit 0fc50fa5f7424d21ff43a79838fe76ff73ad869b +Author: Ryan Lortie +Date: Wed Jul 7 19:40:48 2010 -0400 + + gobject/: fully remove gobjectalias hacks + + gobject/.gitignore | 2 - + gobject/Makefile.am | 18 +---- + gobject/gbinding.c | 4 - + gobject/gboxed.c | 4 - + gobject/gclosure.c | 4 - + gobject/genums.c | 4 - + gobject/gobject.c | 6 -- + gobject/gobject.symbols | 4 +- + gobject/gparam.c | 4 - + gobject/gparamspecs.c | 4 - + gobject/gsignal.c | 4 - + gobject/gsourceclosure.c | 4 - + gobject/gtype.c | 4 - + gobject/gtypemodule.c | 5 -- + gobject/gtypeplugin.c | 4 - + gobject/gvalue.c | 4 - + gobject/gvaluearray.c | 4 - + gobject/gvaluetransform.c | 1 - + gobject/gvaluetypes.c | 4 - + gobject/makefile.msc.in | 8 --- + gobject/makegobjectalias.pl | 139 + ------------------------------------------- + gobject/pltcheck.sh | 19 ------ + 22 files changed, 5 insertions(+), 249 deletions(-) + +commit 2e53e50244b85d7e0b5358d617fabc15e8ec8bd7 +Author: Ryan Lortie +Date: Wed Jul 7 19:34:03 2010 -0400 + + glib/: fully remove galias hacks + + glib/.gitignore | 2 - + glib/Makefile.am | 18 +----- + glib/garray.c | 4 - + glib/gasyncqueue.c | 4 - + glib/gatomic-gcc.c | 4 - + glib/gatomic.c | 4 - + glib/gbacktrace.c | 4 - + glib/gbase64.c | 5 -- + glib/gbitlock.c | 4 - + glib/gbookmarkfile.c | 4 - + glib/gbuffer.c | 1 - + glib/gcache.c | 4 - + glib/gchecksum.c | 4 - + glib/gcompletion.c | 4 - + glib/gconvert.c | 4 - + glib/gdataset.c | 4 - + glib/gdate.c | 5 -- + glib/gdir.c | 4 - + glib/gerror.c | 4 - + glib/gfileutils.c | 4 - + glib/ghash.c | 4 - + glib/ghook.c | 4 - + glib/ghostutils.c | 4 - + glib/giochannel.c | 4 - + glib/giounix.c | 4 - + glib/giowin32.c | 4 - + glib/gkeyfile.c | 4 - + glib/glib.py | 5 +- + glib/glib.symbols | 4 +- + glib/glist.c | 4 - + glib/gmain.c | 4 - + glib/gmappedfile.c | 4 - + glib/gmarkup.c | 4 - + glib/gmem.c | 4 - + glib/gmessages.c | 16 ----- + glib/gnode.c | 4 - + glib/gnulib/g-gnulib.h | 1 - + glib/goption.c | 5 -- + glib/gpattern.c | 4 - + glib/gpoll.c | 4 - + glib/gprimes.c | 4 - + glib/gprintf.c | 4 - + glib/gqsort.c | 4 - + glib/gqueue.c | 4 - + glib/grand.c | 5 -- + glib/gregex.c | 4 - + glib/grel.c | 4 - + glib/gscanner.c | 4 - + glib/gsequence.c | 5 -- + glib/gshell.c | 4 - + glib/gslice.c | 4 - + glib/gslist.c | 4 - + glib/gspawn-win32.c | 4 - + glib/gspawn.c | 4 - + glib/gstdio.c | 4 - + glib/gstrfuncs.c | 5 -- + glib/gstring.c | 4 - + glib/gtestutils.c | 4 - + glib/gthread.c | 5 -- + glib/gthreadpool.c | 4 - + glib/gtimer.c | 4 - + glib/gtree.c | 6 -- + glib/gunibreak.c | 4 - + glib/gunicollate.c | 5 -- + glib/gunidecomp.c | 4 - + glib/guniprop.c | 5 -- + glib/gurifuncs.c | 4 - + glib/gutf8.c | 5 -- + glib/gutils.c | 4 - + glib/gvariant-core.c | 4 - + glib/gvariant-parser.c | 5 -- + glib/gvariant-serialiser.c | 4 - + glib/gvariant.c | 4 - + glib/gvarianttype.c | 4 - + glib/gvarianttypeinfo.c | 4 - + glib/gwin32.c | 4 - + glib/makefile.msc.in | 8 --- + glib/makegalias.pl | 138 + ----------------------------------------- + glib/pcre/pcre.h | 1 - + glib/pltcheck.sh | 27 -------- + glib/update-pcre/memory.patch | 3 +- + glib/win_iconv.c | 1 - + 82 files changed, 6 insertions(+), 508 deletions(-) + +commit c243905c95e012eb295ee5487087043ce4a4027b +Author: Ryan Lortie +Date: Wed Jul 7 16:52:23 2010 -0400 + + .gitignore updates + + gio/tests/.gitignore | 17 +++++++++++------ + glib/tests/.gitignore | 6 ++++++ + 2 files changed, 17 insertions(+), 6 deletions(-) + +commit abc65b233ccb14366fbd07bbed3ee3cacd5e79ea +Author: David Zeuthen +Date: Wed Jul 7 16:35:17 2010 -0400 + + GDBus: Hide instance structures for classes we don't want to be + subclassed + + This also allows us to nuke the priv-> pointers and save a couple of + indirections. + + Signed-off-by: David Zeuthen + + gio/gdbusauthobserver.c | 21 ++- + gio/gdbusauthobserver.h | 20 -- + gio/gdbusconnection.c | 431 + ++++++++++++++++++++++--------------------- + gio/gdbusconnection.h | 21 -- + gio/gdbusmessage.c | 166 +++++++++-------- + gio/gdbusmessage.h | 21 -- + gio/gdbusmethodinvocation.c | 81 +++++---- + gio/gdbusmethodinvocation.h | 21 -- + gio/gdbusserver.c | 186 ++++++++++--------- + gio/gdbusserver.h | 21 -- + 10 files changed, 459 insertions(+), 530 deletions(-) + +commit 32ce3e051af4260a65478acf738e82dec6a864bd +Author: Ryan Lortie +Date: Wed Jul 7 16:32:46 2010 -0400 + + fix trivial copy/paste error in bytestring docs + + glib/gvariant.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d9e90c3894739bdfa642e35bdea866c6d0ab7ef2 +Author: Ryan Lortie +Date: Wed Jul 7 10:37:16 2010 -0400 + + GVariant: improve bytestring support + + - add G_VARIANT_TYPE_BYTESTRING, _BYTESTRING_ARRAY, _STRING_ARRAY + + - remove g_variant_{new,get}_byte_array functions + + - add g_variant_{new,get,dup}_bytestring{,_array} functions + + - remove undocumented support for deserialising arrays of objectpaths + or signature strngs using g_variant_get_strv() + + - add and document new format strings '^ay', '^&ay', '^aay' and + '^a&ay' + + - update GApplication to use the new API + + - update GSettings binding code to use the new API + + - add tests + + docs/reference/glib/glib-sections.txt | 9 +- + docs/reference/glib/gvariant-varargs.xml | 184 +++++++++-- + docs/reference/glib/tmpl/glib-unused.sgml | 40 +--- + gio/gapplication.c | 32 +-- + gio/gsettings-mapping.c | 8 +- + gio/tests/gsettings.c | 2 +- + gio/tests/testapp.c | 4 +- + glib/glib.symbols | 8 +- + glib/gvariant-parser.c | 179 ++++++++++- + glib/gvariant.c | 477 + +++++++++++++++++++++-------- + glib/gvariant.h | 14 +- + glib/gvarianttype.h | 25 ++ + glib/tests/gvariant.c | 129 ++++++-- + 13 files changed, 836 insertions(+), 275 deletions(-) + +commit 2d2a321a4b5943d408cabe54e3da48360ae7e4ac +Author: David Zeuthen +Date: Wed Jul 7 15:57:37 2010 -0400 + + GDBus: Hide class structures for classes we don't want to be + subclassed + + E.g. move these C structures out of public header files and into their + respective C files. Also nuke padding since this is no longer needed. + + This leaves only GDBusProxy as an extendable type. + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 9 ++------- + gio/gdbusauth.h | 4 ---- + gio/gdbusauthmechanism.h | 4 ---- + gio/gdbusauthmechanismanon.h | 4 ---- + gio/gdbusauthmechanismexternal.h | 4 ---- + gio/gdbusauthmechanismsha1.h | 4 ---- + gio/gdbusauthobserver.c | 21 +++++++++++++++++++++ + gio/gdbusauthobserver.h | 27 --------------------------- + gio/gdbusconnection.c | 20 ++++++++++++++++++++ + gio/gdbusconnection.h | 24 ------------------------ + gio/gdbusmessage.c | 14 ++++++++++++++ + gio/gdbusmessage.h | 17 ----------------- + gio/gdbusmethodinvocation.c | 13 +++++++++++++ + gio/gdbusmethodinvocation.h | 17 ----------------- + gio/gdbusserver.c | 19 +++++++++++++++++++ + gio/gdbusserver.h | 23 ----------------------- + 16 files changed, 89 insertions(+), 135 deletions(-) + +commit 62a1ccf526e7b23ac39cdf7251eac5706eef3f57 +Author: David Zeuthen +Date: Wed Jul 7 15:00:23 2010 -0400 + + Bug 618882 – No way to ensure that a message is sent + + Add g_dbus_connection_flush{_finish,sync}(). + + https://bugzilla.gnome.org/show_bug.cgi?id=618882 + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 3 + + gio/gdbusconnection.c | 157 + ++++++++++++++++++++++++++++- + gio/gdbusconnection.h | 14 +++ + gio/gdbusprivate.c | 81 +++++++++++++++ + gio/gdbusprivate.h | 5 + + gio/gio.symbols | 3 + + gio/tests/Makefile.am | 4 + + gio/tests/gdbus-connection-flush-helper.c | 60 +++++++++++ + gio/tests/gdbus-connection.c | 82 +++++++++++++++ + 9 files changed, 406 insertions(+), 3 deletions(-) + +commit d4f35ae9ed230ccc04b8f50067a0d0dda95b7d5f +Author: Fran Diéguez +Date: Wed Jul 7 18:25:19 2010 +0200 + + Updated Galician translations + + po/gl.po | 386 + +++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 218 insertions(+), 168 deletions(-) + +commit acc9bb24033cdb93be6b9c00012f86ac56904cc9 +Author: David Zeuthen +Date: Wed Jul 7 11:02:08 2010 -0400 + + GDBus: Only rewrite serial number if g_dbus_message_get_serial() + returns 0 + + While this a dangerous thing to allow (collissions, reply_serial not + matching up etc.), the added flexibility makes this a good trade-off - + for example, with this feature, it's now a lot easier to build message + routers. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 27 ++++++++++++++++++++------- + gio/tests/gdbus-connection.c | 3 +++ + 2 files changed, 23 insertions(+), 7 deletions(-) + +commit 746721293b8963fbefd98bdba7ef0645b6940052 +Author: Ryan Lortie +Date: Wed Jul 7 10:56:57 2010 -0400 + + GSettings: warn if use the 'memory' backend + + but only if it was not explicitly selected. + + gio/gsettingsbackend.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 6ae4d31e75b123bcf4caf867f36cc59570a37a57 +Author: Ryan Lortie +Date: Wed Jul 7 10:46:13 2010 -0400 + + trivial GSettings docs fix + + docs/reference/glib/tmpl/glib-unused.sgml | 52 + +++++++++++++++++++++++++++++ + gio/gsettings.c | 8 ++-- + 2 files changed, 56 insertions(+), 4 deletions(-) + +commit a38fed1b43cb688001c6343cc30022013c0ea25b +Author: David Zeuthen +Date: Wed Jul 7 09:50:44 2010 -0400 + + Bug 623538 – GDBusProxy::g-properties-changed emission for corner + cases + + Also emit GDBusProxy::g-properties-changed when dropping (when the + name owner vanishes) or populating (when loading properties) the + property cache. + + https://bugzilla.gnome.org/show_bug.cgi?id=623538 + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 52 + ++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 files changed, 48 insertions(+), 4 deletions(-) + +commit ea0607438bfb1fb2ae7cd22757ecdb53946a00b0 +Author: David Zeuthen +Date: Wed Jul 7 09:05:42 2010 -0400 + + Bug 623537 – GDBusProxy has weird checking on NameOwnerChanged + + Remove misleading (and always true) check on the name that the + NameOwnerChanged signal is for. + + https://bugzilla.gnome.org/show_bug.cgi?id=623537 + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 7 +------ + 1 files changed, 1 insertions(+), 6 deletions(-) + +commit 99670eaccc05a4d5e9725614550e1da75cda45c0 +Author: Matthias Clasen +Date: Wed Jul 7 07:37:42 2010 -0400 + + Fix some errors in translated strings + + gettext can't handle macros, so we have to use literal format + specifiers, unfortunately. + + gio/gdbusaddress.c | 3 ++- + gio/gdbusmessage.c | 9 ++++++--- + 2 files changed, 8 insertions(+), 4 deletions(-) + +commit bad9a3718e84549de23b56eed980f97a0b9c8b7e +Author: Matthias Clasen +Date: Wed Jul 7 01:00:58 2010 -0400 + + Clear the buffer initially + + gio/tests/converter-stream.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 46a80b38c394619300c6ff95fffb1b56115e610b +Author: Matthias Clasen +Date: Wed Jul 7 00:38:27 2010 -0400 + + Don't forget to dist keyfiletest.ini + + glib/tests/Makefile.am | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit be247379f003bbb619a71f351e53fba14eec7a15 +Author: Danielle Madeley +Date: Wed Jul 7 12:47:54 2010 +1000 + + Include sys/wait.h for WEXITSTATUS() + + gio/gdbusaddress.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit aab6d9ed1c54f215838da7939a97e33d46d94036 +Author: David Zeuthen +Date: Tue Jul 6 16:57:28 2010 -0400 + + GDBus: Handle autolaunching on UNIX/Freedesktop OSes + + Also add a 'address' G_DBUS_DEBUG option that will print out useful + debug information such as + + GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus + type `session' + GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set + GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set + GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set + GDBus-debug:Address: Running `dbus-launch + --autolaunch=05e508961149264c9b750a4c494aa6f7 --binary-syntax + --close-stderr' to get bus address (possibly autolaunching) + GDBus-debug:Address: dbus-launch output: + 0000: 75 6e 69 78 3a 61 62 73 74 72 61 63 74 3d 2f 74 + unix:abstract=/t + 0010: 6d 70 2f 64 62 75 73 2d 77 42 41 6f 4b 59 49 52 + mp/dbus-wBAoKYIR + 0020: 7a 75 2c 67 75 69 64 3d 30 34 30 64 31 33 66 33 + zu,guid=040d13f3 + 0030: 30 61 30 62 35 32 63 32 30 66 36 32 63 34 31 63 + 0a0b52c20f62c41c + 0040: 30 30 30 30 35 30 38 64 00 d2 38 00 00 01 00 40 + 0000508d..8....@ + 0050: 05 00 00 00 00 ..... + GDBus-debug:Address: dbus-launch stderr output: + 14542: Autolaunch enabled (using X11). + 14542: --exit-with-session automatically enabled + 14542: Connected to X11 display ':0.0' + 14542: === Parent dbus-launch continues + 14542: Waiting for babysitter's intermediate parent + 14542: Reading address from bus + 14542: Reading PID from daemon + 14542: Saving x11 address + 14542: Created window 88080385 + 14542: session file: + /root/.dbus/session-bus/05e508961149264c9b750a4c494aa6f7-0 + 14542: dbus-launch exiting + GDBus-debug:Address: Returning address + `unix:abstract=/tmp/dbus-wBAoKYIRzu,guid=040d13f30a0b52c20f62c41c0000508d' + for bus type `session' + + and + + GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus + type `session' + GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set + GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set + GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set + GDBus-debug:Address: Running `dbus-launch + --autolaunch=05e508961149264c9b750a4c494aa6f7 --binary-syntax + --close-stderr' to get bus address (possibly autolaunching) + GDBus-debug:Address: dbus-launch output: + 0000: 75 6e 69 78 3a 61 62 73 74 72 61 63 74 3d 2f 74 + unix:abstract=/t + 0010: 6d 70 2f 64 62 75 73 2d 77 42 41 6f 4b 59 49 52 + mp/dbus-wBAoKYIR + 0020: 7a 75 2c 67 75 69 64 3d 30 34 30 64 31 33 66 33 + zu,guid=040d13f3 + 0030: 30 61 30 62 35 32 63 32 30 66 36 32 63 34 31 63 + 0a0b52c20f62c41c + 0040: 30 30 30 30 35 30 38 64 00 d2 38 00 00 01 00 40 + 0000508d..8....@ + 0050: 05 00 00 00 00 ..... + GDBus-debug:Address: dbus-launch stderr output: + 14549: Autolaunch enabled (using X11). + 14549: --exit-with-session automatically enabled + 14549: Connected to X11 display ':0.0' + 14549: dbus-daemon is already running. Returning existing + parameters. + 14549: dbus-launch exiting + GDBus-debug:Address: Returning address + `unix:abstract=/tmp/dbus-wBAoKYIRzu,guid=040d13f30a0b52c20f62c41c0000508d' + for bus type `session' + + Note that things work exactly like libdbus, e.g. from the + dbus-launch(1) man page: + + Whenever an autolaunch occurs, the application that had to start a + new bus will be in its own little world; it can effectively end up + starting a whole new session if it tries to use a lot of bus + services. This can be suboptimal or even totally broken, depending + on the app and what it tries to do. + + [...] + + You can always avoid autolaunch by manually setting + DBUS_SESSION_BUS_ADDRESS. Autolaunch happens because the default + address if none is set is "autolaunch:", so if any other address is + set there will be no autolaunch. You can however include autolaunch + in an explicit session bus address as a fallback, for example + DBUS_SESSION_BUS_ADDRESS="something:,autolaunch:" - in that case if + the first address doesn't work, processes will autolaunch. (The bus + address variable contains a comma-separated list of addresses to + try.) + + Signed-off-by: David Zeuthen + + docs/reference/gio/overview.xml | 4 + + gio/gdbusaddress.c | 255 + ++++++++++++++++++++++++++++++++++++--- + gio/gdbusconnection.c | 20 +-- + gio/gdbusmessage.c | 21 +--- + gio/gdbusprivate.c | 52 ++++++++ + gio/gdbusprivate.h | 6 + + 6 files changed, 310 insertions(+), 48 deletions(-) + +commit ef296440630ca01a8bc0a9dc58722bf1d6dc1ab7 +Author: David Zeuthen +Date: Tue Jul 6 13:56:35 2010 -0400 + + GDBus: Properly handle empty address strings + + Changes this error + + DBUS_SESSION_BUS_ADDRESS= \ + gdbus introspect --session \ + --dest org.freedesktop.DBus \ + --object-path /org/freedesktop/DBus + ** + GLib-GIO:ERROR:gdbusaddress.c:913:g_dbus_address_get_stream_sync: + assertion failed: (last_error != NULL) + Aborted (core dumped) + + to + + DBUS_SESSION_BUS_ADDRESS= \ + gdbus introspect --session \ + --dest org.freedesktop.DBus \ + --object-path /org/freedesktop/DBus + Error connecting: The given address is empty + + which is much more preferable. + + Signed-off-by: David Zeuthen + + gio/gdbusaddress.c | 13 ++++++++++++- + gio/tests/gdbus-addresses.c | 14 ++++++++++++++ + 2 files changed, 26 insertions(+), 1 deletions(-) + +commit f0b6cbb13951549b9e17ee0366fc5be3e4b69f2f +Author: Matthias Clasen +Date: Tue Jul 6 07:43:19 2010 -0400 + + Fix problems with the keyfile test + + We must set XDG_DATA_HOME early on, and we must clear error + before using it. + + glib/tests/keyfile.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit eea9d343ccd059b8d53009d64197ff343338c05f +Author: Matthias Clasen +Date: Tue Jul 6 00:01:40 2010 -0400 + + Improve keyfile test coverage + + glib/tests/keyfile.c | 23 +++++++++++++++++++++++ + 1 files changed, 23 insertions(+), 0 deletions(-) + +commit ee89ed241c5b386bf8d846f4496e46059d0a686b +Author: Matthias Clasen +Date: Tue Jul 6 00:01:15 2010 -0400 + + Define SRCDIR + + glib/tests/Makefile.am | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit a3bda1acfc5f3e8f4f672cc81f388ffabf1e7b58 +Author: Matthias Clasen +Date: Mon Jul 5 23:43:47 2010 -0400 + + Add some GDir tests + + glib/tests/Makefile.am | 3 ++ + glib/tests/dir.c | 53 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+), 0 deletions(-) + +commit c5fcd21e33282676f9bfbaa71ca5fb7d54e30057 +Author: Matthias Clasen +Date: Mon Jul 5 23:30:10 2010 -0400 + + Improve uri test coverage + + glib/tests/uri.c | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit b720732059eec5d87d86d784f25c57a2132475a2 +Author: Matthias Clasen +Date: Mon Jul 5 23:06:50 2010 -0400 + + Move uri tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/uri.c | 333 +++++++++++++++++++++++++++++++++ + tests/Makefile.am | 4 +- + tests/uri-test.c | 477 + ------------------------------------------------ + 4 files changed, 337 insertions(+), 480 deletions(-) + +commit 123ba622d3511509f7cce9459ab48db8a0d28c3d +Author: Matthias Clasen +Date: Mon Jul 5 22:40:46 2010 -0400 + + Add more list tests + + glib/tests/list.c | 142 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + glib/tests/slist.c | 122 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 264 insertions(+), 0 deletions(-) + +commit 953962d783e46c8aa17301ec733fa54483e3fab7 +Author: Matthias Clasen +Date: Mon Jul 5 22:40:26 2010 -0400 + + Move tree tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/tree.c | 286 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 2 - + tests/tree-test.c | 246 ----------------------------------------- + 4 files changed, 289 insertions(+), 248 deletions(-) + +commit 5123bc69e75418c9192a94d802fca76b18444233 +Author: Matthias Clasen +Date: Mon Jul 5 21:06:28 2010 -0400 + + Move slist tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/slist.c | 179 ++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 3 - + tests/slist-test.c | 204 + ------------------------------------------------ + 4 files changed, 182 insertions(+), 207 deletions(-) + +commit b61fd45ac3305ec20b156bbeeed5494b9a445c8a +Author: Matthias Clasen +Date: Mon Jul 5 20:51:29 2010 -0400 + + Move list tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/list.c | 179 ++++++++++++++++++++++++++++++++++++++++ + tests/list-test.c | 212 + ------------------------------------------------ + 3 files changed, 182 insertions(+), 212 deletions(-) + +commit c2997efb6688255c885f4bf1f4248bee2c8f6e11 +Author: Matthias Clasen +Date: Mon Jul 5 19:49:03 2010 -0400 + + Add some more checks to the binding tests + + gobject/tests/binding.c | 19 ++++++++++++++++++- + 1 files changed, 18 insertions(+), 1 deletions(-) + +commit 4e97c96654d2c0f637ea20b22f0d70aa12c7cfab +Author: Matthias Clasen +Date: Mon Jul 5 19:48:04 2010 -0400 + + Remove a redundant branch + + Since the name has been interned already at pspec creation time, + we can just call g_intern_string(). + + gobject/gbinding.c | 10 ++-------- + 1 files changed, 2 insertions(+), 8 deletions(-) + +commit af299df44e067b949a039c56b5081558288f41aa +Author: Matthias Clasen +Date: Mon Jul 5 19:45:55 2010 -0400 + + Remove cases of ;; + + gio/gdbusauthobserver.c | 2 +- + gio/gdbusmessage.c | 2 +- + glib/gshell.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit fb0242240495772bbb1a8ef2b88cacb60b090242 +Author: Matthias Clasen +Date: Mon Jul 5 19:33:05 2010 -0400 + + Test charset conversion with fallbacks + + gio/tests/converter-stream.c | 51 + ++++++++++++++++++++++++++++++++++++----- + 1 files changed, 44 insertions(+), 7 deletions(-) + +commit 05a865344ba1f9a14524d87e2ab2a1cb4fdbc9cb +Author: Matthias Clasen +Date: Mon Jul 5 15:54:11 2010 -0400 + + Fix the get_property implementation for GSettings::schema + + gio/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 20dca5935c186654e8e13904d2c5c67a9622ec8e +Author: Matthias Clasen +Date: Mon Jul 5 15:53:58 2010 -0400 + + Add several more settings tests + + gio/tests/gsettings.c | 234 + +++++++++++++++++++++++++++++++++++- + gio/tests/org.gtk.test.gschema.xml | 23 ++++ + 2 files changed, 255 insertions(+), 2 deletions(-) + +commit 958f15013c29e0f8313a9eb7e2e75efa324c484c +Author: Matthias Clasen +Date: Mon Jul 5 15:53:21 2010 -0400 + + Small documentation addition + + gio/gsettingsbackend.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c6e8d0ada84185f807b8101cada91030bd91e48a +Author: Matthias Clasen +Date: Mon Jul 5 12:08:29 2010 -0400 + + Fix icons test to compile + + gio/tests/icons.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 81a0a268133ba5cb58a4e7893d4eaf039bc21b4c +Author: Matthias Clasen +Date: Mon Jul 5 12:08:17 2010 -0400 + + Test enum mapping + + gio/tests/gsettings.c | 47 + +++++++++++++++++++++++++++++++++++- + gio/tests/org.gtk.test.gschema.xml | 3 ++ + 2 files changed, 49 insertions(+), 1 deletions(-) + +commit 2764b75d5373d03b46d04fdfa3cc64becf274294 +Author: Matthias Clasen +Date: Mon Jul 5 11:38:31 2010 -0400 + + More stream tests + + gio/tests/buffered-input-stream.c | 35 + +++++++++++++++++++++++++++++++++++ + gio/tests/buffered-output-stream.c | 35 + +++++++++++++++++++++++++++++++++++ + gio/tests/converter-stream.c | 2 ++ + 3 files changed, 72 insertions(+), 0 deletions(-) + +commit 10b2606af5c350c30bbd52977b688d8a2dd106b4 +Author: Matthias Clasen +Date: Mon Jul 5 11:13:36 2010 -0400 + + Add more checks + + gio/tests/buffered-input-stream.c | 105 + +++++++++++++++++++++++++++++-------- + 1 files changed, 82 insertions(+), 23 deletions(-) + +commit aec652677bed2d82201b0234e04e95f164e20770 +Author: Matthias Clasen +Date: Mon Jul 5 11:12:49 2010 -0400 + + Add some buffered output tests + + gio/tests/Makefile.am | 4 ++ + gio/tests/buffered-output-stream.c | 86 + ++++++++++++++++++++++++++++++++++++ + 2 files changed, 90 insertions(+), 0 deletions(-) + +commit 4ab9b708c0d8c901a2e4137c9ac03fc2414336af +Author: Matthias Clasen +Date: Mon Jul 5 08:28:54 2010 -0400 + + Add some more tests for the buffered read code + + gio/tests/buffered-input-stream.c | 46 + ++++++++++++++++++++++++++++++++++++- + 1 files changed, 45 insertions(+), 1 deletions(-) + +commit 1ba87d1a0e8a6377d3f49731e8412fedfc7a8725 +Author: Matthias Clasen +Date: Mon Jul 5 07:40:38 2010 -0400 + + Trivial cleanups + + gio/gbufferedinputstream.c | 585 + ++++++++++++++++++++++--------------------- + 1 files changed, 299 insertions(+), 286 deletions(-) + +commit 48881bad99807381afcb55137eced4d7c50ac5a7 +Author: Ryan Lortie +Date: Mon Jul 5 13:10:28 2010 -0400 + + Add --disable-Bsymbolic flag + + configure.in | 27 ++++++++++++++++++--------- + 1 files changed, 18 insertions(+), 9 deletions(-) + +commit dea042b85514f997df0f77006cdcca063486097b +Author: Matthias Clasen +Date: Mon Jul 5 03:09:36 2010 -0400 + + Misc test additions + + gio/tests/Makefile.am | 7 ++++ + gio/tests/appinfo.c | 27 ++++++++++++++- + gio/tests/contenttype.c | 4 ++ + gio/tests/file.c | 64 + ++++++++++++++++++++++++++++++++++++ + gio/tests/gsettings.c | 56 +++++++++++++++++++++++++++++++ + gio/tests/live-g-file.c | 9 +++++ + gio/tests/org.gtk.test.gschema.xml | 3 ++ + 7 files changed, 168 insertions(+), 2 deletions(-) + +commit 211210c1ce15e19e424d12b14ab79f8dfb0379d4 +Author: Matthias Clasen +Date: Mon Jul 5 02:36:48 2010 -0400 + + Fix a typo + + gio/gappinfo.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c53c701e53afcd15cadc7d727ceea303b915dd44 +Author: Matthias Clasen +Date: Mon Jul 5 00:56:12 2010 -0400 + + Cleanups + + gio/gcontenttype.c | 674 + ++++++++++++++++++++------------------- + gio/gcontenttype.h | 36 +- + gio/tests/appinfo-test2.desktop | 11 + + 3 files changed, 372 insertions(+), 349 deletions(-) + +commit f90eb144d404c76180ba7facf32b4c9751aed4b5 +Author: Matthias Clasen +Date: Sun Jul 4 23:42:07 2010 -0400 + + Add some more tests + + gio/tests/contenttype.c | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 74fbd3296d259b04e4fe17e4ebd358827ae07e1f +Author: Matthias Clasen +Date: Sun Jul 4 23:41:40 2010 -0400 + + Add some GAppLaunchContext tests + + gio/tests/appinfo.c | 26 +++++++++++++++++++++++++- + 1 files changed, 25 insertions(+), 1 deletions(-) + +commit c915c68b6be1cdd21ec79b4a1f715d38976cdd86 +Author: Matthias Clasen +Date: Sun Jul 4 23:40:42 2010 -0400 + + Add the new tests to the correct variable + + gio/tests/Makefile.am | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 14db75381ee7f21f6b62401177cfaa9d6891ddf4 +Author: Matthias Clasen +Date: Sun Jul 4 22:27:01 2010 -0400 + + Add some contenttype tests + + gio/tests/Makefile.am | 4 ++ + gio/tests/contenttype.c | 113 + +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 117 insertions(+), 0 deletions(-) + +commit fb120b5d8717f9798be28cdc7bab768f7ca0309a +Author: Matthias Clasen +Date: Sun Jul 4 20:50:50 2010 -0400 + + Add a test for skipping + + gio/tests/buffered-input-stream.c | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +commit 9788c4c7e6a9eaa8f7d7a999d201767470a75d85 +Author: Matthias Clasen +Date: Sun Jul 4 20:49:29 2010 -0400 + + Add some CharsetConverter tests + + gio/tests/converter-stream.c | 56 + +++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 52 insertions(+), 4 deletions(-) + +commit 26e29cb360e81e4530c218a6ddea339759f078bd +Author: Matthias Clasen +Date: Sat Jul 3 13:43:25 2010 -0400 + + Move charset conversion tests to the test framework + + glib/tests/Makefile.am | 23 +- + glib/tests/convert.c | 664 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 2 - + tests/convert-test.c | 662 + ----------------------------------------------- + 4 files changed, 677 insertions(+), 674 deletions(-) + +commit 401fa10445e092e4f1d7e29dd2af128012d32981 +Author: Matthias Clasen +Date: Sat Jul 3 12:49:46 2010 -0400 + + Add some more appinfo tests + + gio/tests/appinfo-test-gnome.desktop | 6 ++ + gio/tests/appinfo-test-notgnome.desktop | 6 ++ + gio/tests/appinfo-test.desktop | 8 ++- + gio/tests/appinfo.c | 129 + +++++++++++++++++++++++++++++++ + 4 files changed, 148 insertions(+), 1 deletions(-) + +commit 7a5df4265d444f0a4b0687bed63d6adf3b143953 +Author: Jorge González +Date: Sun Jul 4 13:49:55 2010 +0200 + + Updated Spanish translation + + po/es.po | 60 + +++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 31 insertions(+), 29 deletions(-) + +commit 7cc15910bec9b652ef9610a8c9cc9d96c2185936 +Author: Jorge González +Date: Sat Jul 3 13:48:56 2010 +0200 + + Updated Spanish translation + + po/es.po | 133 + ++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 74 insertions(+), 59 deletions(-) + +commit 9fd133946059c315eeb4a445c1f46dd636b33106 +Author: Matthias Clasen +Date: Sat Jul 3 03:31:24 2010 -0400 + + Move GZlibConverter tests + + gio/tests/converter-stream.c | 33 +++++++++++++++++++++++++++------ + 1 files changed, 27 insertions(+), 6 deletions(-) + +commit aaba9276f7cceca9f6493b5a4a7f81e4f9fa75a5 +Author: Matthias Clasen +Date: Sat Jul 3 03:31:07 2010 -0400 + + Add tests for GIcon + + gio/tests/Makefile.am | 4 ++ + gio/tests/icons.c | 121 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 125 insertions(+), 0 deletions(-) + +commit 37c4fcb36abedfd7896ef70eaec75bba33a0331f +Author: David Zeuthen +Date: Fri Jul 2 17:09:55 2010 -0400 + + GDBus: Rename "Introspection XML" section to "D-Bus Introspection + Data" + + Signed-off-by: David Zeuthen + + gio/gdbusintrospection.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit a16128655fed37a3975fdb8ea0d31ef0fa29e882 +Author: Ryan Lortie +Date: Fri Jul 2 11:35:43 2010 -0400 + + Bug 623407 - g_keyfile_settings_backend_new crash + + The keyfile backend forms paths like this: + + prefix + group_name + '/' + keyname + + If the prefix is '/apps/yelp/' and the group name is '/' then + this means + that we end up with a key name of (for example): + + '/apps/yelp/' + '/' + '/' + 'font-adjustment' + + = '/apps/yelp///font-adjustment' + + which is obviously not a valid key name. + + This patch rejects group names starting or ending with '/' or + containing + '//' and also rejects keys containing '/'. This should make it + impossible for invalid keys to be formed. + + gio/gkeyfilesettingsbackend.c | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit a941660873ad4db42f1799e444d46d95721af840 +Author: Ryan Lortie +Date: Fri Jul 2 11:14:28 2010 -0400 + + Bug 623402 - schema compiler reports wrong line + + Don't reuse the GMarkupParseContext in order to avoid inaccurate line + number reports. Fix a memory leak, too. + + gio/gschema-compile.c | 12 +++++++----- + 1 files changed, 7 insertions(+), 5 deletions(-) + +commit 7a44a2d223f3ad8c6e142b94725ab55cf3f84173 +Author: Ryan Lortie +Date: Fri Jul 2 11:11:45 2010 -0400 + + Bug 623401 - schema compiler: process enums first + + Process *.enum.xml before any *.gschema.xml files to ensure that all + enums have been defined. + + gio/gschema-compile.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +commit 1ca6a4687a9b66e0060f16583ac21ef94f24a38e +Author: David Zeuthen +Date: Fri Jul 2 09:40:59 2010 -0400 + + GDBus: Hold lock when printing debug messages + + Signed-off-by: David Zeuthen + + gio/gdbusauth.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit c29ad239284608c2a03043f9dc16f3ca1a28542e +Author: David Zeuthen +Date: Fri Jul 2 09:34:03 2010 -0400 + + GDBus: make G_DBUS_DEBUG=authentication work again + + This was inadvertently removed in this commit + + http://git.gnome.org/browse/glib/commit/?id=1d22b64843c83631bcd0e5255930f3a4e990961e + + Signed-off-by: David Zeuthen + + docs/reference/gio/overview.xml | 2 +- + gio/gdbusauth.c | 4 ---- + 2 files changed, 1 insertions(+), 5 deletions(-) + +commit cd8361f4ddd0e88fb7e3941a0d0fd12fe538c093 +Author: Tor Lillqvist +Date: Fri Jul 2 15:31:24 2010 +0300 + + Update headers being installed in the Visual Studio project + + It sucks to have the lists of public headers duplicated in the + Makefile.am files and the glib.vsprops file. But it isn't exactly easy + to work around all the weirdness in autotools, Visual Studio, and bat + files either to do it another way. + + build/win32/vs9/glib.vsprops | 20 +++++++++++++++++++- + 1 files changed, 19 insertions(+), 1 deletions(-) + +commit 5383c7110f793bfa749370cec9d708a6a5018751 +Author: Ryan Lortie +Date: Thu Jul 1 18:58:56 2010 -0400 + + Bug 622124 - implement flags for GSettings + + Add a tag to the schema file format and a flags='' + attribute to + go along with. Add some extra test cases for those. + + Add new g_settings_{get,set}_flags() calls and support binding to + GParamSpecFlags properties. Add test cases. + + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gschema-compile.c | 161 + +++++++++++++---- + gio/gsettings-mapping.c | 65 +++++++- + gio/gsettings.c | 194 + +++++++++++++++++++- + gio/gsettings.h | 5 + + gio/strinfo.c | 8 + + gio/tests/Makefile.am | 7 + + gio/tests/gschema-compile.c | 11 +- + gio/tests/gsettings.c | 80 ++++++++- + gio/tests/org.gtk.test.gschema.xml | 9 + + .../enum-with-repeated-nick.gschema.xml | 10 + + .../enum-with-repeated-value.gschema.xml | 10 + + .../schema-tests/flags-aliased-default.gschema.xml | 19 ++ + .../schema-tests/flags-bad-default.gschema.xml | 16 ++ + .../flags-more-than-one-bit.gschema.xml | 10 + + .../schema-tests/flags-with-enum-attr.gschema.xml | 14 ++ + .../schema-tests/flags-with-enum-tag.gschema.xml | 14 ++ + gio/tests/testenum.h | 9 + + 19 files changed, 594 insertions(+), 52 deletions(-) + +commit 69fe50c116541afbfeaf9ad78b030f53e9906604 +Author: Jorge González +Date: Thu Jul 1 21:39:37 2010 +0200 + + Updated Spanish translation + + po/es.po | 42 +++++++++++++++++++++++++----------------- + 1 files changed, 25 insertions(+), 17 deletions(-) + +commit bd8d837f573a784a234740bd49f9103cdf70c268 +Author: David Zeuthen +Date: Thu Jul 1 14:37:16 2010 -0400 + + Bug 620913 – More control with G_DBUS_DEBUG + + This commit adds the following G_DBUS_DEBUG flags + + - emission + - incoming + - call + - signal + - payload + + https://bugzilla.gnome.org/show_bug.cgi?id=620913 + + Signed-off-by: David Zeuthen + + docs/reference/gio/overview.xml | 20 ++++++ + gio/gdbusconnection.c | 141 + +++++++++++++++++++++++++++++++++++++-- + gio/gdbusprivate.c | 86 ++++++++++++++++++++++-- + gio/gdbusprivate.h | 7 ++ + 4 files changed, 242 insertions(+), 12 deletions(-) + +commit 51ed44e7add7ca1d3b764f13df2cf80ebe32c3f9 +Author: David Zeuthen +Date: Thu Jul 1 13:06:56 2010 -0400 + + GDBus: Fix bug in child enumeration + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 3 +-- + gio/tests/gdbus-export.c | 28 +++++++++++++++++++++++++++- + 2 files changed, 28 insertions(+), 3 deletions(-) + +commit 93bf09a9e7a7d35d50802faf4b271ca4267e49cb +Author: Ryan Lortie +Date: Thu Jul 1 12:55:04 2010 -0400 + + Use "unix:" instead of tcp in test for now... + + Temporarily avoids the issue reported in bug #623306. + + gio/tests/gdbus-peer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 21d7ce97c38bafa1fdbedc19fe9634bc3333e7c6 +Author: David Zeuthen +Date: Wed Jun 30 16:36:47 2010 -0400 + + GDBus: plug some memory leaks + + These fixes makes udisks-daemon from udisks' gdbus-port branch, see + + http://cgit.freedesktop.org/udisks/log/?h=gdbus-port + + handle 200 add/remove uevents generated by e.g. + + #!/bin/bash + DEV=mmcblk0p1 + for n in `seq 200` ; do + udevadm trigger --sysname-match=$DEV --action=remove + udevadm trigger --sysname-match=$DEV --action=add + echo foo $n + done + + without any substantial leaks. + + Signed-off-by: David Zeuthen + + gio/gdbusauth.c | 14 +++++++++----- + gio/gdbusmessage.c | 52 + +++++++++++++++++++++++++++++++++++++--------------- + gio/gdbusprivate.c | 1 + + 3 files changed, 47 insertions(+), 20 deletions(-) + +commit 40d5da99d6d07bdbb6267f6b5625ac2ca93e85ea +Author: Ryan Lortie +Date: Wed Jun 30 13:27:38 2010 -0400 + + GSettings: accept as an alias for + + until we have proper support for flags... + + gio/gschema-compile.c | 9 ++++++--- + 1 files changed, 6 insertions(+), 3 deletions(-) + +commit e73b631f6eb8d2f1ff9c65fe2c258dc2b6083c73 +Author: Ryan Lortie +Date: Wed Jun 30 13:12:19 2010 -0400 + + gsettings.m4: add support for enums + + m4macros/gsettings.m4 | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +commit 87fa3a6e75132f68edfbd457632332c52c2048ba +Author: David Zeuthen +Date: Wed Jun 30 12:19:28 2010 -0400 + + GDBus: Take a reference to the GDBusInterfaceInfo object + + Things will still work fine if the GDBusInterfaceInfo is allocated + statically because if so the ref_count will be -1. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 4 +++- + gio/tests/gdbus-peer.c | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 5ac272297584d2c1f73815e842108b6704f862a9 +Author: David Zeuthen +Date: Wed Jun 30 12:10:00 2010 -0400 + + GDBus: Rename `introspection_data' parameter to `interface_info' + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 64 + ++++++++++++++++++++++++------------------------ + gio/gdbusconnection.h | 2 +- + 2 files changed, 33 insertions(+), 33 deletions(-) + +commit 038d03cd08bdb42e6f83f6041ec01732476e900b +Author: David Zeuthen +Date: Wed Jun 30 11:43:42 2010 -0400 + + Bug 623142 – Ensure ::new-connection runs before processing D-Bus + messages + + Without this guarantee, peer-to-peer connections are not very + useful. However, with this guarantee it's possible to export objects + in a handler for the GDBusServer::new-connection signal. + + There are two caveats with this patch + + - it won't work on message bus connections + - we don't queue up messages to be written + + that can be addresses later if needed. + + https://bugzilla.gnome.org/show_bug.cgi?id=623142 + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-sections.txt | 1 + + gio/gdbusconnection.c | 30 ++++++- + gio/gdbusconnection.h | 1 + + gio/gdbusprivate.c | 84 +++++++++++++++- + gio/gdbusprivate.h | 4 + + gio/gdbusserver.c | 11 ++- + gio/gio.symbols | 1 + + gio/gioenums.h | 5 +- + gio/tests/gdbus-peer.c | 187 + +++++++++++++++++++++++++++++++++++ + 9 files changed, 316 insertions(+), 8 deletions(-) + +commit 137ae2413c9d25edd3f886fd25b6353c8170f7ba +Author: Ryan Lortie +Date: Wed Jun 30 10:02:45 2010 -0400 + + g_settings_list_keys() -> _list_items() + + This function returns children as well. + + docs/reference/gio/gio-sections.txt | 2 +- + gio/gio.symbols | 2 +- + gio/gsettings-tool.c | 4 ++-- + gio/gsettings.c | 12 ++++++++---- + gio/gsettings.h | 2 +- + 5 files changed, 13 insertions(+), 9 deletions(-) + +commit 3628b0b4992e9d1c915c38f8844eab9ba7a7112f +Author: Ryan Lortie +Date: Tue Jun 29 20:24:39 2010 -0400 + + GSettings: add , tests, modify output + + Add tag, more tests, and actually output the results + of these + new tags to the gschemas.compiled file. + + gio/gschema-compile.c | 149 + ++++++++++++++++++-- + gio/tests/Makefile.am | 8 + + gio/tests/gschema-compile.c | 10 ++- + .../extend-and-shadow-indirect.gschema.xml | 17 +++ + .../schema-tests/extend-and-shadow.gschema.xml | 17 +++ + .../schema-tests/override-missing.gschema.xml | 11 ++ + .../schema-tests/override-range-error.gschema.xml | 12 ++ + .../schema-tests/override-then-key.gschema.xml | 15 ++ + gio/tests/schema-tests/override-twice.gschema.xml | 12 ++ + .../schema-tests/override-type-error.gschema.xml | 11 ++ + gio/tests/schema-tests/override.gschema.xml | 34 +++++ + 11 files changed, 284 insertions(+), 12 deletions(-) + +commit 900a756e8fb70bcd6e725f0696d8094a7208f905 +Author: Ryan Lortie +Date: Tue Jun 29 14:41:04 2010 -0400 + + GSettings: new tags 'extends', 'list-of' + + Add support for extends='' and list-of='' tags to the + element. + The attributes are parsed and some sanity-checking is done but + currently + nothing happens as a result. + + Add some tests. + + gio/gschema-compile.c | 124 + ++++++++++++++++++-- + gio/tests/Makefile.am | 10 ++- + gio/tests/gschema-compile.c | 11 ++- + gio/tests/schema-tests/extend-missing.gschema.xml | 3 + + gio/tests/schema-tests/extend-nonlist.gschema.xml | 4 + + gio/tests/schema-tests/extend-self.gschema.xml | 3 + + .../extend-wrong-list-indirect.gschema.xml | 6 + + .../schema-tests/extend-wrong-list.gschema.xml | 5 + + gio/tests/schema-tests/extending.gschema.xml | 21 ++++ + .../schema-tests/key-in-list-indirect.gschema.xml | 8 ++ + gio/tests/schema-tests/key-in-list.gschema.xml | 6 + + gio/tests/schema-tests/list-of-missing.gschema.xml | 3 + + 12 files changed, 192 insertions(+), 12 deletions(-) + +commit 101bfec676feb2c3d414fff11a31541318d87896 +Author: Ryan Lortie +Date: Tue Jun 29 14:40:44 2010 -0400 + + glib-compile-schemas: fix small leak + + gio/gschema-compile.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6d4ade4cf0d6ed64ce59f3db4f270be08a4478fd +Author: David Zeuthen +Date: Tue Jun 29 15:19:56 2010 -0400 + + Bug 623143 – Never require non-closed connections + + There's a couple of places in GDBus where it's a programming error + (e.g. we'll assert or spew via e.g. g_warning()) to use the API on a + closed connection. This approach can never work since a + GDBusConnection can be closed at any point in time outside of + programmer control. + + Just change the code to return a run-time error (e.g. return + G_IO_ERROR_CLOSED when sending messages, invoking methods) or silently + accept the request (e.g. exporting objects, registering for signals) + without doing anything. + + Note that a GDBusConnection object is always useless after being + closed - e.g. there's no way to "reopen" a connection - the user will + have to create a new object and use that instead. + + https://bugzilla.gnome.org/show_bug.cgi?id=623143 + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 5 ----- + gio/gdbusnameowning.c | 5 ++--- + gio/gdbusnamewatching.c | 4 ++-- + 3 files changed, 4 insertions(+), 10 deletions(-) + +commit ab6b6c68c5b060057fd2953435c090b4d53fe93c +Author: Milan Bouchet-Valat +Date: Mon Jun 21 17:09:07 2010 +0200 + + Bug 622294 - More annotations for GVariant + + This adds annotations to all functions in gvariant.c. A few docs + were also fixed (wrong parameter names, missing mention that NULL + is allowed). + + glib/gvariant.c | 69 + +++++++++++++++++++++++++++++++------------------------ + 1 files changed, 39 insertions(+), 30 deletions(-) + +commit 0a2c9d67da311d8e276dd3835db56c59d8be2cab +Author: Colin Walters +Date: Mon Jun 28 17:16:44 2010 -0400 + + [autogen.sh] Support NOCONFIGURE (from gnome-common) + + gnome-common's autogen.sh uses NOCONFIGURE to skip running configure. + Support that in addition to the current AUTOGEN_SUBDIR_MODE. + + autogen.sh | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit c649615f17dc9d9644d742c48bf34c9000aa41b7 +Author: Jorge González +Date: Mon Jun 28 20:57:31 2010 +0200 + + Updated Spanish translation + + po/es.po | 220 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 120 insertions(+), 100 deletions(-) + +commit 8a7d9906983c23c9bafa8b10c1fd089fcd7989f8 +Author: Ryan Lortie +Date: Mon Jun 28 14:06:32 2010 -0400 + + Bug 622565 - compile-schemas fails when no schemas + + Neutralise and deprecate the --uninstall option in the schema compiler + and remove it from gsettings.m4. + + Make the new default behaviour a compromise between the old default + behaviour and the previous --uninstall option: + + - never return a failure code if no schema files are found + + - issue a warning instead + + - remove the gschemas.compiled file if it exists + + gio/gschema-compile.c | 19 +++++++++---------- + m4macros/gsettings.m4 | 2 +- + 2 files changed, 10 insertions(+), 11 deletions(-) + +commit ab1111b8bbb7a6057248658013eb23d80f4721cf +Author: Ryan Lortie +Date: Mon Jun 28 13:58:25 2010 -0400 + + GSettings: peek instead of ref/unref enum class + + We only ever do the enum mapping for the property binding in the case + that a GParamSpecEnum exists and in that case the class is already + referenced by the GParamSpec. Use peek instead of ref/unref and add a + clarifying note. + + gio/gsettings-mapping.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 168cfc592283c992d6a6803a91528f87cec2d902 +Author: Ryan Lortie +Date: Mon Jun 28 10:18:45 2010 -0400 + + Bug 622127 - GSettings extended key validation + + First shot at attempting to implement this in a reasonable way. See + the bug for more information about why this is needed. + + docs/reference/gio/gio-sections.txt | 4 ++ + gio/gio.symbols | 1 + + gio/gsettings.c | 83 + ++++++++++++++++++++++++++++++++++- + gio/gsettings.h | 27 +++++++++++ + 4 files changed, 114 insertions(+), 1 deletions(-) + +commit aad7176c622b78dbdef5c8d1e0fa51b9612198ad +Author: Yaron Shahrabani +Date: Mon Jun 28 12:28:47 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 1280 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 657 insertions(+), 623 deletions(-) + +commit eb454a1cb4d8ea16f6b5575c69e58c2877ea350e +Author: Matthias Clasen +Date: Sun Jun 27 19:27:04 2010 -0400 + + Fix a alloc/free mismatch + + Pointed out in http://bugzilla.redhat.com/show_bug.cgi?id=608453 + by David Tardon. + + glib/gbuffer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d20969e07b8cc0233536cf929db0107b2c21c53e +Author: Matthias Clasen +Date: Sun Jun 27 16:31:53 2010 -0400 + + Filter out child schema entries when listing keys + + gio/gsettings-tool.c | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +commit 025435329a7159a906a66f6b15facc2d611be4fb +Author: Matthias Clasen +Date: Sun Jun 27 16:00:20 2010 -0400 + + Implement bash completion for gsettings + + gio/Makefile.am | 4 +- + gio/gsettings-bash-completion.sh | 33 +++ + gio/gsettings-tool.c | 498 + ++++++++++++++++++++++++++++++++------ + 3 files changed, 455 insertions(+), 80 deletions(-) + +commit 795d2bf8cf13d03214af3eb857d235c2917f9945 +Author: Ryan Lortie +Date: Sun Jun 27 10:11:45 2010 -0400 + + GSettings: Don't free value before using its type + + Fix a bug where the type from g_variant_get_type() was used after + freeing the variant. This works for base types (since they are cached + and live forever) but not for arrays (where the bug was first seen). + + gio/gsettings-tool.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 87fd38bc4dd095d598ec375dbecb40d1393c3f8b +Author: Kristian Rietveld +Date: Sat Jun 26 22:55:47 2010 +0200 + + Add PCRE_EXP_DECL to pcre_callout declaration + + Fixes build on Mac OS X. + + glib/pcre/pcre.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 840c5dd0da885fc42e498f165d59a5d0b4b97af2 +Author: Jorge González +Date: Sat Jun 26 10:14:52 2010 +0200 + + Updated Spanish translation + + po/es.po | 1297 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 670 insertions(+), 627 deletions(-) + +commit 7cdc592ae478b71a66aa1541b81588b5b200e5f2 +Author: Ryan Lortie +Date: Fri Jun 25 10:52:32 2010 -0400 + + Bug 622128 - retry with default for failed mapping + + Hold the GSettingsKeyInfo as part of the binding structure to + save work + on each get/set. Use our copy of this structure to call the internal + get/set APIs. Give more descriptive error messages in the case of + invalid data on sets and retry using the translated default then + schema + default value in case of failure to map on reads. + + gio/gsettings.c | 137 + ++++++++++++++++++++++++++++++++++--------------------- + 1 files changed, 85 insertions(+), 52 deletions(-) + +commit 499ece9b52ec18e7a0ab5c9cda6b0b82946a8c7e +Author: Colin Walters +Date: Wed Jun 16 22:44:58 2010 -0400 + + [gbinding] Move argument reference out of first column + + It makes gobject-introspection complain. + + gobject/gbinding.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 1ad08a6a9fc5bf700de31c928d4fc7031bd8fd19 +Author: Dan Winship +Date: Thu Jun 24 14:23:37 2010 -0400 + + Hack up glib/tests/array-test to not actually malloc 2G + + Fixes the test on machines where that allocation takes very long. + + https://bugzilla.gnome.org/show_bug.cgi?id=610784 + + glib/tests/array-test.c | 28 ++++++++++++++++++++-------- + 1 files changed, 20 insertions(+), 8 deletions(-) + +commit 48f3f262639b473c9be168d0491bedd357bcbca7 +Author: Ryan Lortie +Date: Thu Jun 24 13:32:26 2010 -0400 + + version.bump() + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit cc295f09768d10576deba929ab8b7bc766cd207f +Author: Ryan Lortie +Date: Thu Jun 24 13:18:44 2010 -0400 + + Release glib 2.25.10 + + NEWS | 73 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 73 insertions(+), 0 deletions(-) + +commit de0464cf891c386b0166066ac797255cd973b6e2 +Author: Ryan Lortie +Date: Thu Jun 24 12:25:48 2010 -0400 + + Tweak GSettings key/schema listing APIs + + docs/reference/gio/gio-sections.txt | 4 +- + gio/gio.symbols | 2 +- + gio/gsettings.c | 12 ++-- + gio/gsettings.h | 4 +- + gio/gsettingsschema.c | 89 + ++++++++++++++++++++++++---------- + 5 files changed, 75 insertions(+), 36 deletions(-) + +commit e3d0d07b043334890deaf30d5b1e5072c9c7e742 +Author: Ryan Lortie +Date: Thu Jun 24 02:28:01 2010 -0400 + + Clarify GSettings documentation wrt errors + + Make it clear about exactly what "@key is valid" means. + + gio/gsettings.c | 73 + ++++++++++++++++++++++++++++--------------------------- + 1 files changed, 37 insertions(+), 36 deletions(-) + +commit 887d9d83aa232058b8446eafb7f0681db4219a77 +Author: Ryan Lortie +Date: Thu Jun 24 02:21:58 2010 -0400 + + g_keyfile_settings_backend_new doc improvement + + gio/gkeyfilesettingsbackend.c | 17 +++++++++++------ + 1 files changed, 11 insertions(+), 6 deletions(-) + +commit 123699465d2d07c18823f41dfc6a48dd7cefc603 +Author: Ryan Lortie +Date: Thu Jun 24 02:15:15 2010 -0400 + + GSettings: add g_settings_list_keys() + + Second half of bug #622554. + + docs/reference/gio/gio-sections.txt | 2 ++ + gio/gio.symbols | 1 + + gio/gsettings.c | 33 + ++++++++++++++++++++++++++++++++- + gio/gsettings.h | 1 + + 4 files changed, 36 insertions(+), 1 deletions(-) + +commit 6218d8047a9f073dc9e6eab009d70dc7933c5fd7 +Author: Ryan Lortie +Date: Thu Jun 24 01:49:27 2010 -0400 + + Add g_settings_schema_exists + + Solves half of #622554. + + gio/gio.symbols | 4 ++++ + gio/gsettings.h | 1 + + gio/gsettingsschema.c | 25 +++++++++++++++++++++++++ + 3 files changed, 30 insertions(+), 0 deletions(-) + +commit 726e4dd6e7e12800db90a5159f5cb6fc3509e9e7 +Author: Ryan Lortie +Date: Thu Jun 24 01:49:00 2010 -0400 + + KeyfileSettingsBackend: fix symbol visibility leak + + gio/gkeyfilesettingsbackend.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 65fc931fb9df391a8a7ff8e279820fd2fed04bc0 +Author: Ryan Lortie +Date: Tue Jun 22 08:12:04 2010 -0400 + + Rework the GSettings keyfile backend + + docs/reference/gio/gio-sections.txt | 1 + + gio/Makefile.am | 1 - + gio/gkeyfilesettingsbackend.c | 811 + ++++++++++++++++++++--------------- + gio/gkeyfilesettingsbackend.h | 71 --- + gio/gsettingsbackend.h | 4 +- + gio/tests/gsettings.c | 6 +- + 6 files changed, 475 insertions(+), 419 deletions(-) + +commit 6d828dae3804af311ffa8387a4e74bc28024351b +Author: Ryan Lortie +Date: Thu Jun 24 00:55:14 2010 -0400 + + GSettingsBackend: some debug code + + gio/gsettingsbackend.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit b638a675a8dae242347a721837c0b6c24e953665 +Author: Ryan Lortie +Date: Thu Jun 24 00:41:05 2010 -0400 + + Ignore more glib test cases + + glib/tests/.gitignore | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 519edcc2b3fd23fc29b38b581480adf39dd93451 +Author: Ryan Lortie +Date: Thu Jun 24 00:36:42 2010 -0400 + + fix leaks in the GSettings test case + + gio/tests/gsettings.c | 27 +++++++++++++++++++++++---- + 1 files changed, 23 insertions(+), 4 deletions(-) + +commit fb94e65a640d21b2e1a5c6e79eb3d755ba34c0e6 +Author: Ryan Lortie +Date: Thu Jun 24 00:35:10 2010 -0400 + + GChecksum: accept NULL pointer with length 0 + + Several GChecksum functions were incorrectly aborting when passed + a NULL + data pointer, even if the length parameter was equal to zero. + + glib/gchecksum.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit f76c4d062966afdcdf5306f4c769a7ab0934e843 +Author: Ryan Lortie +Date: Thu Jun 24 00:38:01 2010 -0400 + + GSettings "delayed": don't leak unapplied keys + + GDelayedSettingsBackend was leaking the GTree holding the list of + unapplied keys on finalize. + + gio/gdelayedsettingsbackend.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 17bc9bf94f2a11ce553d784e55649b43f3ed0130 +Author: Matthias Clasen +Date: Wed Jun 23 22:32:35 2010 -0400 + + Deprecate some rarely-used APIS + + GRelation and GCompletion are almost never used, and not very actively + maintained. Mark them as deprecated to make this clear. Bug #551271. + + glib/gcompletion.c | 25 ++++++++++++++++++++++++- + glib/gcompletion.h | 4 ++++ + glib/grel.c | 35 ++++++++++++++++++++++++++++++++++- + glib/grel.h | 4 ++++ + 4 files changed, 66 insertions(+), 2 deletions(-) + +commit 272836936e76a9bf0a0237e6489ce0508fa85534 +Author: Christian Dywan +Date: Fri Jun 18 16:14:27 2010 +0200 + + Introduce G_PARAM_DEPRECATED and G_ENABLE_DIAGNOSTIC + + See https://bugzilla.gnome.org/show_bug.cgi?id=601686 + + gobject/gobject.c | 16 ++++++++++++++++ + gobject/gparam.h | 11 ++++++++--- + 2 files changed, 24 insertions(+), 3 deletions(-) + +commit f587cb57f249a8f4b869231ca20f5f19602a20ec +Author: Emmanuele Bassi +Date: Mon Jun 21 12:26:42 2010 +0100 + + binding: Add SYNC_CREATE to the flags + + When creating a binding between two object properties we might want to + automatically synchronize the two values at the moment of the binding + creation, instead of waiting for the next change. + + The G_BINDING_SYNC_CREATE flag does exactly what it says on the tin. + + https://bugzilla.gnome.org/show_bug.cgi?id=622281 + + gobject/gbinding.c | 9 +++++++++ + gobject/gbinding.h | 6 +++++- + gobject/tests/binding.c | 36 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 50 insertions(+), 1 deletions(-) + +commit d3af9c0ec59465e4076791881bc89fe51539f3fd +Author: Ryan Lortie +Date: Wed Jun 23 10:12:14 2010 -0400 + + neutralise pltcheck.sh + + gio/pltcheck.sh | 2 ++ + glib/pltcheck.sh | 2 ++ + gobject/pltcheck.sh | 2 ++ + 3 files changed, 6 insertions(+), 0 deletions(-) + +commit 13ac216ca386715a915ec8acd8178c528774273a +Author: Matthias Clasen +Date: Wed Jun 23 09:03:51 2010 -0400 + + GIO doc cleanups + + docs/reference/gio/Makefile.am | 18 ++++++++++++++++++ + docs/reference/gio/gio-sections.txt | 28 +++++++++++++++++++++++++++- + gio/gsettings.c | 2 +- + 3 files changed, 46 insertions(+), 2 deletions(-) + +commit fadac4bd0f008dae058bcbc56b3073c6c38092a6 +Author: Matthias Clasen +Date: Wed Jun 23 07:32:24 2010 -0400 + + Document g_cclosure_marshal_VOID__VARIANT + + gobject/gclosure.c | 18 +++++++++++++++++- + 1 files changed, 17 insertions(+), 1 deletions(-) + +commit 3549e06f81768453b8c389331705615ae3529041 +Author: Matthias Clasen +Date: Wed Jun 23 07:22:49 2010 -0400 + + Ignore gatomicarray.h + + Otherwise gtk-doc picks up declarations from that header and is + disappointed when they are not documented. + + docs/reference/gobject/Makefile.am | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 9c6130cdde846cee4e8ad93504a6cb4745a35cea +Author: Matthias Clasen +Date: Wed Jun 23 07:21:50 2010 -0400 + + silence gtk-doc + + Add g_error_get_type to a private section in gobject-sections.txt + so gtk-doc doesn't complain about it. + + docs/reference/gobject/gobject-sections.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 8eb755e78e56036b93a7b11d3d6fe4237ab708be +Author: Matthias Clasen +Date: Wed Jun 23 00:20:11 2010 -0400 + + Add some more unicode property tests + + glib/tests/utf8-misc.c | 32 +++++++++++++++++++++++++++++++- + 1 files changed, 31 insertions(+), 1 deletions(-) + +commit e26b92b94775c8b1b6e94ca29a6d3a4404db449b +Author: Matthias Clasen +Date: Tue Jun 22 23:39:51 2010 -0400 + + Move node tests to the test framework + + glib/tests/node.c | 70 + +++++++++++++++++++++++++++++++++++++---------------- + tests/.gitignore | 1 - + tests/Makefile.am | 2 - + 3 files changed, 49 insertions(+), 24 deletions(-) + +commit 464b5ff3570fd43fa52b6ec5571a02bd705f9e9c +Author: Matthias Clasen +Date: Tue Jun 22 22:25:02 2010 -0400 + + Some more hash, utils and checksum tests + + glib/tests/checksum.c | 18 ++++++++- + glib/tests/hash.c | 102 + +++++++++++++++++++++++++++++++++++++++++++++++++ + glib/tests/utils.c | 31 +++++++++++++++ + 3 files changed, 149 insertions(+), 2 deletions(-) + +commit 01abbc4bd37649bf75642ba98f8f6109065a7333 +Author: Matthias Clasen +Date: Tue Jun 22 22:24:29 2010 -0400 + + Move node test to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/node.c | 264 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/node-test.c | 223 ---------------------------------------- + 3 files changed, 267 insertions(+), 223 deletions(-) + +commit 5c1b3a02637c8ed767c94f30df994fed9b3bddfc +Author: Matthias Clasen +Date: Tue Jun 22 19:50:35 2010 -0400 + + Move date tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/date.c | 287 +++++++++++++++++++++++++++ + tests/.gitignore | 1 - + tests/Makefile.am | 1 - + tests/date-test.c | 499 + ------------------------------------------------ + 5 files changed, 290 insertions(+), 501 deletions(-) + +commit 7d81e99c4bfea343ce653668b6d2d00e79324688 +Author: Matthias Clasen +Date: Tue Jun 22 17:42:30 2010 -0400 + + Add an index for 2.26 api additions + + docs/reference/gobject/gobject-docs.sgml | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit b116838da31dc212c60f13821dfe87187731dc78 +Author: Milan Bouchet-Valat +Date: Wed Jun 23 12:17:29 2010 +0200 + + Improve documentation for g_strcmp0() + + Be more explicit about the handling of two NULL pointers. + + https://bugzilla.gnome.org/show_bug.cgi?id=622480 + + glib/gtestutils.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 6920e503e637e70a44f7baf899de4bd171534d39 +Author: David Zeuthen +Date: Tue Jun 22 17:48:35 2010 -0400 + + GDBusProxy: Don't warn when calling methods on other interfaces + + If we know the expected interface (e.g. :g-interface-info is set), + then we always warned when calling a method on a different + interface. Don't do that, there's no way the expected interface can + know anything about this method. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit d68f8012b2d8b9b86b47ed1f091f29d70016cf73 +Author: Dan Winship +Date: Tue Jun 22 15:31:55 2010 -0400 + + gio/tests/testapps: Fix source refcounting + + Either child_watch_source or timeout_source will already have been + destroyed after we finish the loop, and it's not safe to call + g_source_destroy() on it a second time unless we're still holding a + ref on it. + + gio/tests/testapps.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit a0e1b226a21ca498b301981b0c89e89ad9a31eb1 +Author: Dan Winship +Date: Fri Apr 23 08:47:18 2010 -0400 + + GSocketConnection: don't close the socket if it's still reffed + + When disposing a GSocketConnection, don't explicitly close the + underlying GSocket. The GSocket will close itself if it gets + destroyed, and if it doesn't get destroyed, that presumably means the + app still wants to use it. Eg, this lets you use GSocketClient to + create a GSocketConnection, and then take the GSocket and destroy the + GSocketConnection. + + https://bugzilla.gnome.org/show_bug.cgi?id=616855 + + gio/gsocketconnection.c | 25 +++++++++++++++++++++++++ + 1 files changed, 25 insertions(+), 0 deletions(-) + +commit e0ff84e68817d12ebf4cde9433c4e1ed703d1eb4 +Author: Dan Winship +Date: Fri Apr 23 08:21:41 2010 -0400 + + GSocketInput/OutputStream: fix non-blocking on Windows + + The GSocket docs point out that g_socket_send/g_socket_receive may + return G_IO_ERROR_WOULD_BLOCK even if g_socket_condition_check claimed + that they wouldn't. Fix the socket streams to check for that. + + https://bugzilla.gnome.org/show_bug.cgi?id=603309 + + gio/gsocket.c | 8 +++++++ + gio/gsocketinputstream.c | 46 + +++++++++++++++++--------------------------- + gio/gsocketoutputstream.c | 46 + +++++++++++++++++--------------------------- + 3 files changed, 44 insertions(+), 56 deletions(-) + +commit 2be38f6926d8bf2738c3898e831dcb3928925f90 +Author: David Zeuthen +Date: Tue Jun 22 12:12:16 2010 -0400 + + GDBus: update padding + + Add lots of padding for public class structures. Notably, we seemed to + lack any padding whatsoever in the GDBusMessageClass struct (spotted + by Dan Winship). Also switch to using + + gpointer padding[N]; + + instead of + + void (*_g_reserved1) (void); + ... + void (*_g_reservedN) (void); + + Signed-off-by: David Zeuthen + + gio/gdbusauth.h | 4 ++++ + gio/gdbusauthmechanism.h | 18 +----------------- + gio/gdbusauthmechanismanon.h | 17 +---------------- + gio/gdbusauthmechanismexternal.h | 17 +---------------- + gio/gdbusauthmechanismsha1.h | 17 +---------------- + gio/gdbusauthobserver.h | 17 +---------------- + gio/gdbusconnection.h | 18 ++---------------- + gio/gdbusmessage.h | 4 ++++ + gio/gdbusmethodinvocation.h | 9 +-------- + gio/gdbusproxy.h | 9 +-------- + gio/gdbusserver.h | 9 +-------- + 11 files changed, 18 insertions(+), 121 deletions(-) + +commit d19380c809525559f55ba5f3304c0e787c2ebfac +Author: Matthias Clasen +Date: Tue Jun 22 08:24:30 2010 -0400 + + Improve g_application_new documentation + + Patch by Saleem Abdulrasool, bug 622154. + + gio/gapplication.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 16c2f080497d1ed663237e725192c4f411f92f8f +Author: Ryan Lortie +Date: Tue Jun 22 08:09:27 2010 -0400 + + Add single include guards to gvariant[type].h + + glib/gvariant.h | 4 ++++ + glib/gvarianttype.h | 4 ++++ + 2 files changed, 8 insertions(+), 0 deletions(-) + +commit 05354cefc54a0f42e5d7dee1798d2b56c135c12c +Author: Tor Lillqvist +Date: Tue Jun 22 12:41:01 2010 +0300 + + Make the protocol.c test program compile on Windows + + Note that it does not actually work, though. Maybe because + g_io_channel_set_flags() is not implemented for file descriptor based + GIOChannels on Windows. + + glib/tests/protocol.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit efb1a054b0858b4475941892f53bbc5186065df9 +Author: Tor Lillqvist +Date: Tue Jun 22 12:13:21 2010 +0300 + + Fix build with the Microsoft compiler + + Correct a few gccisms and C99isms. Ensure the Windows-specific gio + source files are listed in the generated gio VS project file. + + gio/Makefile.am | 12 +++++++----- + gio/gcredentials.c | 2 ++ + gio/gdbusauthmechanismexternal.c | 2 ++ + gio/gdbusauthmechanismsha1.c | 5 +++++ + gio/gdbusconnection.c | 2 +- + gio/gdbuserror.c | 2 +- + gio/gdbusintrospection.c | 2 +- + gio/gdbusserver.c | 3 +++ + gio/gio.symbols | 2 ++ + gio/glocalfileinputstream.c | 6 ++++-- + gio/glocalfileoutputstream.c | 6 ++++-- + 11 files changed, 32 insertions(+), 12 deletions(-) + +commit 2e842490826644210bc5d2df2df8092597b3f708 +Author: Tor Lillqvist +Date: Tue Jun 22 12:10:34 2010 +0300 + + Bypass a few functions not used on Windows when compiling for Windows + + gio/glocalfile.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 045c96b71a7755927e258c2b116c7c0ee8326bd1 +Author: Matthias Clasen +Date: Mon Jun 21 23:07:46 2010 -0400 + + Add a test for g_strip_prefix + + glib/tests/strfuncs.c | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +commit 2f438f18ae8794747dadf5018616d1dcc52a0924 +Author: Matthias Clasen +Date: Mon Jun 21 23:06:17 2010 -0400 + + Move hash tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/hash.c | 525 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/.gitignore | 1 - + tests/Makefile.am | 2 - + tests/hash-test.c | 459 ------------------------------------------ + 5 files changed, 528 insertions(+), 462 deletions(-) + +commit 7d14b5fbf1fcda2068dc01f9a0a2e4b9796daea6 +Author: Matthias Clasen +Date: Mon Jun 21 22:25:28 2010 -0400 + + Some more tests + + glib/tests/checksum.c | 72 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 72 insertions(+), 0 deletions(-) + +commit 5629366c3d245b78ad148576f2dccabed83baa71 +Author: Matthias Clasen +Date: Mon Jun 21 21:22:09 2010 -0400 + + Move checksum tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/checksum.c | 679 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/.gitignore | 1 - + tests/Makefile.am | 2 - + tests/checksum-test.c | 676 + ----------------------------------------------- + 5 files changed, 682 insertions(+), 679 deletions(-) + +commit 839078ea63f697f1066a040425e1d2070f3c81a2 +Author: Matthias Clasen +Date: Mon Jun 21 20:07:26 2010 -0400 + + Add some more Unicode tests + + glib/tests/utf8-misc.c | 263 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 263 insertions(+), 0 deletions(-) + +commit 45411ccbe3c9d1b08332942d1e7b594330688126 +Author: David Zeuthen +Date: Mon Jun 21 16:08:53 2010 -0400 + + Bug 621945 – Filter outgoing messages in GDBusConnection + + This patch breaks some rarely-used public API (only known user is + dconf). + + This patch is based on work from Peng Huang . + + See https://bugzilla.gnome.org/show_bug.cgi?id=621945 + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 66 + +++++++++++++++++++++++++++++++++++++--- + gio/gdbusconnection.h | 3 ++ + gio/gdbusprivate.c | 69 + ++++++++++++++++++++++++++++------------- + gio/gdbusprivate.h | 5 +++ + gio/tests/gdbus-connection.c | 16 ++++++++-- + 5 files changed, 129 insertions(+), 30 deletions(-) + +commit a4cd39e74122c9376954204cb45c6be4926e5ee9 +Author: Ryan Lortie +Date: Mon Jun 21 14:01:50 2010 -0400 + + gobject docs: ignore some sgml files + + docs/reference/gobject/tmpl/.gitignore | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit a4b42d3a751bcbe22bb41ddfced68eebcce0e386 +Author: Ryan Lortie +Date: Mon Jun 21 13:57:54 2010 -0400 + + .gitignore the moved tests + + glib/tests/.gitignore | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit c9553af68f543113be41e6ae8dcdd9ee5e2267bc +Author: Ryan Lortie +Date: Mon Jun 21 13:55:28 2010 -0400 + + Use -Bsymbolic-functions, drop g*alias PLT hackery + + This is a minimal patch-out of the galias functionality. We will do a + release like this so that we can easily back it out if there are + reported problems. + + A more substantial cleanup (mostly removing #includes from every file) + will follow if there are no issues. + + configure.in | 2 +- + gio/Makefile.am | 6 +++--- + gio/makegioalias.pl | 2 ++ + glib/Makefile.am | 2 +- + glib/makegalias.pl | 2 ++ + gmodule/Makefile.am | 2 +- + gobject/Makefile.am | 6 +++--- + gobject/makegobjectalias.pl | 2 ++ + gthread/Makefile.am | 2 +- + 9 files changed, 16 insertions(+), 10 deletions(-) + +commit e549bbf66406fc483cd43ce860ba88e7d83d3c80 +Author: Ryan Lortie +Date: Mon Jun 21 13:25:51 2010 -0400 + + distcheck fix + + gio/tests/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit d5dc656d35887780008c95c5ed496f628948813c +Author: Ryan Lortie +Date: Mon Jun 21 13:25:44 2010 -0400 + + Add check for -Bsymbolic-functions linker flag + + configure.in | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 7556f660b551d0713100af6672287393350d9a19 +Author: Ryan Lortie +Date: Mon Jun 21 11:30:26 2010 -0400 + + Remove gsettings-schema-convert tool + + Having this tool in GLib is a bad idea for a number of reasons: + + - experience has shown that the simple file format was a bad idea + + - the tool is currently implemented with a hack that would require a + dependency inversion to solve (the tool needs to depend on Python + GVariant bindings) + + - the tool itself is unmaintained + + It will be moved to the GConf git repository so people can continue to + use it for the purpose of converting GConf schemas. + + docs/reference/gio/Makefile.am | 2 - + docs/reference/gio/gio-docs.xml | 1 - + docs/reference/gio/glib-compile-schemas.xml | 6 - + docs/reference/gio/gsettings-schema-convert.xml | 113 --- + docs/reference/gio/migrating-gconf.xml | 2 +- + gio/Makefile.am | 1 - + gio/gsettings-schema-convert | 1076 + ----------------------- + 7 files changed, 1 insertions(+), 1200 deletions(-) + +commit 95c4ec1056468764dd6c71971ad06370c0f1b99b +Author: Javier Jardón +Date: Mon Jun 21 17:28:15 2010 +0200 + + [docs] Fix typo + + docs/reference/glib/building.sgml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6c02c99df0cb1c3b9bdb20c8fd56eddc7ae8bf2a +Author: Sven Herzberg +Date: Tue Apr 20 15:01:17 2010 +0200 + + don't treat debug/info/message as fatal messages by default + + * glib/gtestutils.c: don't treat non-fatal messages as errors + * glib/tests/.gitignore: silence + * glib/tests/Makefile.am: updated + * glib/tests/protocol.c: add a test for the message treatment + + glib/gtestutils.c | 8 +- + glib/tests/.gitignore | 1 + + glib/tests/Makefile.am | 10 +- + glib/tests/protocol.c | 334 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 348 insertions(+), 5 deletions(-) + +commit 60a5b197991aae58de4a85c9020a49edc5003457 +Author: Matthias Clasen +Date: Mon Jun 21 00:00:51 2010 -0400 + + Add a test for g_unichar_validate + + glib/tests/utf8-misc.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit f13618623b191c539cc151d19f7f5b54e24b3607 +Author: Matthias Clasen +Date: Sun Jun 20 23:46:01 2010 -0400 + + Test inplace decoding + + glib/tests/base64.c | 36 +++++++++++++++++++++++++++++++++++- + 1 files changed, 35 insertions(+), 1 deletions(-) + +commit db5bd7b90b78508b8be448b8cd5de7735b3ca520 +Author: Matthias Clasen +Date: Sun Jun 20 23:35:31 2010 -0400 + + Some more utf8 tests + + glib/tests/Makefile.am | 3 + + glib/tests/utf8-misc.c | 99 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 102 insertions(+), 0 deletions(-) + +commit a2f4564fd9bee001e6b4d60df257ab6b2110f22f +Author: Matthias Clasen +Date: Sun Jun 20 23:07:39 2010 -0400 + + Test glib_check_version + + glib/tests/utils.c | 24 ++++++++++++++++++++++++ + 1 files changed, 24 insertions(+), 0 deletions(-) + +commit cca48bd5b9de1d4902b12acc86778def3ae00cbe +Author: Matthias Clasen +Date: Sun Jun 20 22:46:47 2010 -0400 + + Add support for coverage reports with lcov + + Patch by Patrick Hulin, bug #501057. + + Makefile.am | 2 +- + Makefile.decl | 22 ++++++++++++ + configure.in | 69 + +++++++++++++++++++++++++++++++++++++ + docs/reference/glib/building.sgml | 19 ++++++++++- + 4 files changed, 110 insertions(+), 2 deletions(-) + +commit bad7f1e54f03284cfd6235d345270ecada4379b5 +Author: Matthias Clasen +Date: Sun Jun 20 22:18:30 2010 -0400 + + Some fixes + + glib/tests/collate.c | 2 + + glib/tests/utf8-pointer.c | 39 +++++++++++++----------- + glib/tests/utf8-validate.c | 68 + +++++++++++++++++-------------------------- + 3 files changed, 50 insertions(+), 59 deletions(-) + +commit 7bea2a7a4fec3dda19d08474c73f56a0f7cf2741 +Author: Matthias Clasen +Date: Sun Jun 20 21:16:24 2010 -0400 + + Move utf8 validation tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/utf8-validate.c | 319 + ++++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 3 - + tests/utf8-validate.c | 319 + -------------------------------------------- + 4 files changed, 322 insertions(+), 322 deletions(-) + +commit 5b08ef84e4132db8f3e873f52c4bc929949dff4d +Author: Matthias Clasen +Date: Sun Jun 20 21:04:47 2010 -0400 + + Move utf8 pointer tests to test framework + + glib/tests/Makefile.am | 6 ++ + glib/tests/collate.c | 215 + +++++++++++++++++++++++++++++++++++++++++++++ + glib/tests/utf8-pointer.c | 112 +++++++++++++++++++++++ + tests/Makefile.am | 1 - + tests/utf8-pointer.c | 112 ----------------------- + 5 files changed, 333 insertions(+), 113 deletions(-) + +commit 0ed575213b0be6553f08c7e3b35e49faae09f7ad +Author: Matthias Clasen +Date: Sun Jun 20 16:24:56 2010 -0400 + + Consolide base64 tests in a single file + + glib/tests/base64.c | 197 +++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 3 - + tests/testingbase64.c | 236 + ------------------------------------------------- + 3 files changed, 197 insertions(+), 239 deletions(-) + +commit 08d6e535be868b04fe83d02cb8a99a8db96d2192 +Author: Matthias Clasen +Date: Sun Jun 20 12:29:17 2010 -0400 + + Move scanner tests to glib/tests + + glib/tests/Makefile.am | 3 + + glib/tests/scannerapi.c | 139 + +++++++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 7 --- + tests/scannerapi.c | 139 + ----------------------------------------------- + 4 files changed, 142 insertions(+), 146 deletions(-) + +commit 87df095de3246142c9407f088b300c3a18846a94 +Author: Ryan Lortie +Date: Sun Jun 20 12:32:00 2010 -0400 + + GVariant: fix doc copy/paste error + + glib/gvariant.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit ede159ec452aa27d7ea0058833ea39baed14756e +Author: Ryan Lortie +Date: Sun Jun 20 12:30:27 2010 -0400 + + Add enum type for GVariantParseError + + docs/reference/glib/glib-sections.txt | 1 + + glib/gvariant-parser.c | 7 +++++++ + glib/gvariant.h | 5 +++++ + 3 files changed, 13 insertions(+), 0 deletions(-) + +commit 09aa2e79ab9b39b92c1cc911b95b49872a417382 +Author: Matthias Clasen +Date: Sun Jun 20 12:23:13 2010 -0400 + + Move sequence tests to the test framework + + glib/tests/Makefile.am | 3 + + glib/tests/sequence.c | 1286 + +++++++++++++++++++++++++++++++++++++++++++++++ + tests/sequence-test.c | 1301 + ------------------------------------------------ + 3 files changed, 1289 insertions(+), 1301 deletions(-) + +commit bf8ce25216c14c8f6f3267b0af107c03390e63bf +Author: Matthias Clasen +Date: Sun Jun 20 11:34:31 2010 -0400 + + Move base64 tests of to test framework + + glib/tests/Makefile.am | 3 + + glib/tests/base64.c | 139 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/base64-test.c | 138 + ----------------------------------------------- + 3 files changed, 142 insertions(+), 138 deletions(-) + +commit 9a85f654c77dab88f625169a0128d890acf50b0b +Author: Matthias Clasen +Date: Sun Jun 20 11:20:41 2010 -0400 + + Add new scripts to docs + + docs/reference/glib/tmpl/unicode.sgml | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit f849dbac05bad8e60b00707823f5c6d935ff36c1 +Author: Matthias Clasen +Date: Sun Jun 20 11:07:49 2010 -0400 + + Move regex tests to the g_test framework + + glib/tests/Makefile.am | 3 + + glib/tests/regex.c | 1870 ++++++++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 4 +- + tests/regex-test.c | 2122 + ------------------------------------------------ + 4 files changed, 1874 insertions(+), 2125 deletions(-) + +commit fc5f3a96be53ceb8b431dffa675e622ec8a48186 +Author: Christian Persch +Date: Sun Jun 20 02:32:35 2010 +0200 + + Docs fix + + gio/gdatainputstream.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit 85621f1a0f4d77cde71e37ed8212e707f4af441d +Author: Matthias Clasen +Date: Sun Jun 20 01:46:35 2010 -0400 + + Update the include pcre to 8.02 + + glib/pcre/Makefile.am | 1 - + glib/pcre/pcre.h | 21 +- + glib/pcre/pcre_compile.c | 1329 ++++++++++++++++++++++---------- + glib/pcre/pcre_config.c | 6 +- + glib/pcre/pcre_dfa_exec.c | 514 +++++++++---- + glib/pcre/pcre_exec.c | 1563 + +++++++++++++++++++++++++++++--------- + glib/pcre/pcre_fullinfo.c | 15 +- + glib/pcre/pcre_globals.c | 23 +- + glib/pcre/pcre_info.c | 4 +- + glib/pcre/pcre_internal.h | 759 +++++++++++++++++-- + glib/pcre/pcre_newline.c | 8 +- + glib/pcre/pcre_study.c | 448 ++++++++++- + glib/pcre/pcre_tables.c | 631 ++++++++++------ + glib/pcre/pcre_try_flipped.c | 6 +- + glib/pcre/pcre_ucp_searchfuncs.c | 46 ++- + glib/pcre/pcre_xclass.c | 7 +- + glib/pcre/ucp.h | 53 +- + glib/pcre/ucpinternal.h | 92 --- + 18 files changed, 4133 insertions(+), 1393 deletions(-) + +commit b0b7aeffc063981c32ff99da0385841ba18f5847 +Author: Matthias Clasen +Date: Sun Jun 20 01:14:55 2010 -0400 + + Add Unicode 5.2 scripts + + glib/gunicode.h | 19 ++++++++++++++++++- + 1 files changed, 18 insertions(+), 1 deletions(-) + +commit 5fffa39b6ae8f8faf1036fbf07de02ffe84ef099 +Author: Matthias Clasen +Date: Sun Jun 20 00:09:00 2010 -0400 + + Fix a memory leak in g_ptr_array_remove_index_fast + + We need to call the element_free_func even if we remove the + last element. Bug #618866. + + glib/garray.c | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +commit ea6470e31a6884a7243e9cd4df9734f1dc4828b9 +Author: Ryan Lortie +Date: Sat Jun 19 16:13:58 2010 -0400 + + GSettings: complete support for enum binding + + gio/gsettings-mapping.c | 22 ++++++++++++++++++++++ + 1 files changed, 22 insertions(+), 0 deletions(-) + +commit dbe68f7c834c152c111afba41ffffd70a8e6997c +Author: Johan Dahlin +Date: Sat Jun 19 15:23:35 2010 -0300 + + [configure] Require dbus 1.2.14 + + dbus_message_set_serial requires dbus 1.2.14, make the dependency + explicit instead of failing to compile a test. + + configure.in | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 2d4e48b73c3efe74c3818616de6fcc332f2e640a +Author: Christian Persch +Date: Sat Jun 19 20:04:20 2010 +0200 + + Tiny docs fix + + gobject/gvaluetypes.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit db68f8203ab9b81e70dbada99faaf69c727f793c +Author: Christian Persch +Date: Fri Jun 18 01:08:13 2010 +0200 + + Add g_value_take_variant + + Turns out we do need g_value_take_variant(), so we can correctly + implement VARIANT:* marshalers. + + Bug #621947. + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/glib-genmarshal.c | 2 +- + gobject/gobject.symbols | 1 + + gobject/gtype.h | 7 ++ + gobject/gvaluetypes.c | 39 +++++++++++++ + gobject/gvaluetypes.h | 2 + + tests/gobject/accumulator.c | 81 + +++++++++++++++++++++++++++ + tests/gobject/testmarshal.list | 2 +- + 8 files changed, 133 insertions(+), 2 deletions(-) + +commit 052ef2614af7a8706035982d8211fff64241e83f +Author: Christian Persch +Date: Sat Jun 19 16:42:11 2010 +0200 + + Add g_variant_is_floating + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gvariant-core.c | 24 ++++++++++++++++++++++++ + glib/gvariant.h | 1 + + glib/tests/gvariant.c | 13 +++++++++++++ + 5 files changed, 40 insertions(+), 0 deletions(-) + +commit 7bb00fd0e8a18b3e20d30053579f002e587dfbbb +Author: Christian Persch +Date: Sat Jun 19 16:41:25 2010 +0200 + + Fix a preprocessor warning with --disable-visibility + + Don't redefine DISABLE_VISIBILITY when already building with + --disable-visibility. + + gthread/tests/1bit-mutex.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit a558e460a2f493670932faa4c947ffc42ea8bc70 +Author: Milan Bouchet-Valat +Date: Sat Jun 19 19:00:13 2010 +0200 + + Fix gsettings tool crash, part 2 + + Same as previous commit, but for two other functions it missed. + + gio/gsettings-tool.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit 62939f5e45cd102313285ec13f90c3b4763e6ca8 +Author: Milan Bouchet-Valat +Date: Sat Jun 19 18:33:26 2010 +0200 + + Fix gsettings tool crash + + When no path is provided for the schema, we have call + g_settings_new() instead of g_settings_new_with_path() + passing a NULL path. + + This was crashing the tool on start since an assertion was + recently added to g_settings_new_with_path() to refuse NULL. + + gio/gsettings-tool.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit a7689537605ade51b19be76baa3fba303527483d +Author: Ryan Lortie +Date: Sat Jun 19 11:38:57 2010 -0400 + + Fix bug in strinfo + + We can't search for a larger needle inside of a smaller haystack, and + unsigned integer subtraction tends to result in very large numbers + rather than small ones. + + Add a check for this case and abort out immediately. + + Also add a test case (lifted directly from the docs) that demonstrates + the problem. + + Issue discovered and tracked down by Milan Bouchet-Valat + + gio/strinfo.c | 3 ++ + gio/tests/gschema-compile.c | 3 +- + gio/tests/schema-tests/from-docs.gschema.xml | 34 + ++++++++++++++++++++++++++ + 3 files changed, 39 insertions(+), 1 deletions(-) + +commit e91541bf8c2e915b330c6dfee46a7709949da3a9 +Author: Fran Diéguez +Date: Sat Jun 19 15:13:41 2010 +0200 + + Updated Galician translations + + po/gl.po | 104 + ++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 58 insertions(+), 46 deletions(-) + +commit a2888fbbf0f1a61436e036ff81a14f19fe45d5d0 +Author: Ryan Lortie +Date: Fri Jun 18 23:14:46 2010 -0400 + + Add a note to docs about paragraphs in schemas + + docs/reference/gio/migrating-gconf.xml | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 6217c9b41eb369cac48149639369f51b85763986 +Author: Ryan Lortie +Date: Fri Jun 18 22:59:43 2010 -0400 + + Conditional gsettings.m4 support, AC_PATH_PROG + + Add new support for conditional enabling of GSettings (as per + bug #616718) and use AC_PATH_PROG instead of AC_PATH_TOOL (as per + bug #621172). + + configure.in | 2 +- + m4macros/gsettings.m4 | 6 ++++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +commit 1ed105b19b31bd5265de7d62156732b343c086e3 +Author: Jürg Billeter +Date: Fri Jun 18 23:48:28 2010 +0200 + + GDBus: Sink closures in _with_closures functions + + See https://bugzilla.gnome.org/show_bug.cgi?id=621092#c12 + + Signed-off-by: David Zeuthen + + gio/gdbusnameowning.c | 25 ++++++++++++++++++++----- + gio/gdbusnamewatching.c | 20 ++++++++++++++++---- + 2 files changed, 36 insertions(+), 9 deletions(-) + +commit 8f5bde679e7cf5b519988b0fa36c300ecce3f19f +Author: Colin Walters +Date: Wed Jun 16 14:17:26 2010 -0400 + + [GApplication] Add working directory to platform data + + https://bugzilla.gnome.org/show_bug.cgi?id=621838 + + gio/gapplication.c | 51 + ++++++++++++++++++++++++++++++++++++++++++----- + gio/gdbusapplication.c | 12 +--------- + gio/tests/testapp.c | 20 ++++++++++++++++++ + 3 files changed, 67 insertions(+), 16 deletions(-) + +commit 6ff13071ae4729b0a0e2ba9404fef5e5dd6c14b2 +Author: Tor Lillqvist +Date: Fri Jun 18 10:56:25 2010 +0300 + + Fix build on non-Unix + + gio/gnullapplication.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 4edfc34e5bae34f69d6771e2732f54821a4f7307 +Author: Matthias Clasen +Date: Thu Jun 17 19:42:46 2010 -0400 + + 2.25.9 + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7b1f45c2e8b5f3ba3595c5cf74fbfc70f03b61c0 +Author: Matthias Clasen +Date: Thu Jun 17 19:08:13 2010 -0400 + + Fix a mismerge + + docs/reference/gio/gio-sections.txt | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 9b59059d9e85d10406393cef08e432626dcc78da +Author: Matthias Clasen +Date: Thu Jun 17 19:04:03 2010 -0400 + + Fix distcheck + + gio/gio.symbols | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit bdd8fef4c05b41f534f138b0cf2f252e6ebd379f +Author: Christian Persch +Date: Fri Jun 18 00:38:46 2010 +0200 + + Fix VARIANT out args + + Use g_value_set_variant(), not the nonexistent g_value_take_variant(). + + gobject/glib-genmarshal.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 30df71e382f76626f8abcdd16b800392be183b42 +Author: Christian Persch +Date: Fri Jun 18 00:10:17 2010 +0200 + + Add VARIANT to glib-genmarshal docs + + docs/reference/gobject/glib-genmarshal.xml | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 79d32c2fc18dcd62e9e12ca871676d35697c9d41 +Author: David Zeuthen +Date: Thu Jun 17 17:58:25 2010 -0400 + + GDBusMessage: Fix bug when deserializing a message + + See https://bugzilla.gnome.org/show_bug.cgi?id=621838 for the whole + story. The problem was that we ended up reading data from arrays of + arrays when we were just supposed to be aligning the buffers. + + Also add a host of debug infrastructure that was needed to find the + root cause. For now it can be turned on only via defining + DEBUG_SERIALIZER. In the future we might want to make it work via + G_DBUS_DEBUG. In a nutshell, the added debug info looks like this + + Parsing blob (blob_len = 0x0084 bytes) + 0000: 6c 01 00 01 3c 00 00 00 41 00 00 00 37 00 00 00 + l...<...A...7... + 0010: 08 01 67 00 08 61 61 79 61 7b 73 76 7d 00 00 00 + ..g..aaya{sv}... + 0020: 01 01 6f 00 08 00 00 00 2f 66 6f 6f 2f 62 61 72 + ..o...../foo/bar + 0030: 00 00 00 00 00 00 00 00 03 01 73 00 06 00 00 00 + ..........s..... + 0040: 4d 65 6d 62 65 72 00 00 00 00 00 00 34 00 00 00 + Member......4... + 0050: 03 00 00 00 63 77 64 00 01 73 00 00 23 00 00 00 + ....cwd..s..#... + 0060: 2f 68 6f 6d 65 2f 64 61 76 69 64 7a 2f 48 61 63 + /home/davidz/Hac + 0070: 6b 69 6e 67 2f 67 6c 69 62 2f 67 69 6f 2f 74 65 + king/glib/gio/te + 0080: 73 74 73 00 sts. + + Parsing headers (blob_len = 0x0084 bytes) + Reading type a{yv} from offset 0x000c: array spans 0x0037 bytes + Reading type {yv} from offset 0x0010 + Reading type y from offset 0x0010: 0x08 ' + Reading type v from offset 0x0011 + Reading type g from offset 0x0014: 'aaya{sv}' + Reading type {yv} from offset 0x001e + Reading type y from offset 0x0020: 0x01 '' + Reading type v from offset 0x0021 + Reading type o from offset 0x0024: '/foo/bar' + Reading type {yv} from offset 0x0031 + Reading type y from offset 0x0038: 0x03 '' + Reading type v from offset 0x0039 + Reading type s from offset 0x003c: 'Member' + Parsing body (blob_len = 0x0084 bytes) + Reading type (aaya{sv}) from offset 0x0047 + Reading type aay from offset 0x0048: array spans 0x0000 bytes + Reading type a{sv} from offset 0x004c: array spans 0x0034 bytes + Reading type {sv} from offset 0x0050 + Reading type s from offset 0x0050: 'cwd' + Reading type v from offset 0x0058 + Reading type s from offset 0x005b: + '/home/davidz/Hacking/glib/gio/tests' + OK + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 132 + ++++++++++++++++++++++++++++++++++---- + gio/gdbusprivate.c | 10 ++-- + gio/gdbusprivate.h | 2 + + gio/tests/gdbus-serialization.c | 9 +++ + 4 files changed, 134 insertions(+), 19 deletions(-) + +commit 86d681ba3eb0df135b9ac592594c397021455425 +Author: Christian Persch +Date: Thu Jun 17 23:44:25 2010 +0200 + + Distcheck fix + + Add a missing symbol to gobject.symbols. + + gobject/gobject.symbols | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 0766981a1e634b850bec602d0bea6bc255377edb +Author: Ryan Lortie +Date: Thu Jun 17 16:56:09 2010 -0400 + + Make g_settings_sync() a proper prototype. + + gio/gsettings-tool.c | 2 +- + gio/gsettings.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 408daaa29445264073da1ac296dba5697ed4883c +Author: Matthias Clasen +Date: Thu Jun 17 16:36:58 2010 -0400 + + Fix the build + + gio/gapplication.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit df81e3f33e710ce64060a87b8ecf0aab1360bd5a +Author: Matthias Clasen +Date: Thu Jun 17 16:13:29 2010 -0400 + + Updates + + NEWS | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) + +commit 0c506f200a60124197e8c20507a86516bb950ec4 +Author: David Zeuthen +Date: Thu Jun 17 16:09:12 2010 -0400 + + GDBus: Complain via g_warning() if an invalid message is received + + While we are already propagating the error to the user via the + GDBusConnection::disconnected signal (because the only safe thing is + to disconnect the other peer), changes are the user is simply not + listening to this signal. + + This should never ever happen unless there's a bug in the + serializaer/deserializer so it's fine to complain via g_warning() + here. + + Bug 621838, see + + https://bugzilla.gnome.org/show_bug.cgi?id=621838 + + is related to this. + + Signed-off-by: David Zeuthen + + gio/gdbusprivate.c | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit 57dff1e06011347cc11492a36dc187cbcf5eece8 +Author: David Zeuthen +Date: Thu Jun 17 16:02:24 2010 -0400 + + GDBusMessage: Properly check error and bail if set + + Otherwise we may set a GError on top of it. + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 8a105625b0261e2e3f45241e2892475fa7b45b88 +Author: Matthias Clasen +Date: Thu Jun 17 16:07:52 2010 -0400 + + Documentation fixups + + docs/reference/gio/gio-sections.txt | 10 +++++----- + gio/gapplication.c | 10 ++++++---- + gio/gapplication.h | 6 +++--- + gio/gunixconnection.c | 8 ++++---- + 4 files changed, 18 insertions(+), 16 deletions(-) + +commit 19a752a5f4b39ce43e6e3a26a478c1594b0627ca +Author: Matthias Clasen +Date: Thu Jun 17 15:51:37 2010 -0400 + + fix a typo + + gobject/gvaluetypes.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 10e430bcc09d82cf9b3634242981296e0d47693b +Author: Christian Persch +Date: Thu Jun 17 21:40:47 2010 +0200 + + Fix GApplication for the G_TYPE_VARIANT change + + gio/gapplication.c | 54 + +++++++++++++++++++++---------------------------- + gio/gio-marshal.list | 5 ++- + 2 files changed, 26 insertions(+), 33 deletions(-) + +commit daee48a0af26105175db5768f770ddb8f1a4a7b1 +Author: Matthias Clasen +Date: Thu Jun 17 15:29:45 2010 -0400 + + Update api docs to current api + + docs/reference/gio/gio-sections.txt | 9 ++------- + 1 files changed, 2 insertions(+), 7 deletions(-) + +commit 0a7e6255b37efd2005bb86a5843921d4adc3bdf8 +Author: David Zeuthen +Date: Thu Jun 17 15:27:18 2010 -0400 + + Catch up with G_TYPE_VARIANT changes + + The GType for a GVariant is now a fundamental GType instead of a boxed + one so use the right marshaller. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 4 ++-- + gio/gio-marshal.list | 2 ++ + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 2c5e1d51934a7983acea9e392de5741c47b8be14 +Author: Matthias Clasen +Date: Thu Jun 17 15:07:08 2010 -0400 + + Fix a typo + + gio/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0010e86572092ba00eaf01796c863e7584e29611 +Author: Ryan Lortie +Date: Thu Jun 17 15:06:33 2010 -0400 + + GSettings: remove "context" from backend too. + + Note: this is a GSettingsBackend API/ABI change. + + gio/gsettingsbackend.c | 73 + +----------------------------------------------- + gio/gsettingsbackend.h | 2 - + 2 files changed, 1 insertions(+), 74 deletions(-) + +commit 4708b8ecc3f00e49aa98cb5989b5474a3257906c +Author: Christian Persch +Date: Thu Jun 17 18:03:51 2010 +0200 + + Add fundamental type and pspec for GVariant + + Make G_TYPE_VARIANT a fundamental type instead of boxed, and add + g_variant_{set,get,dup}_variant. + + Add GParamSpecVariant. + + Bug #610863. + + NEWS | 4 + + docs/reference/gobject/gobject-sections.txt | 13 ++- + gobject/gboxed.c | 15 ++-- + gobject/gboxed.h | 13 +-- + gobject/glib-genmarshal.c | 4 + + gobject/gmarshal.list | 2 + + gobject/gobject.symbols | 6 +- + gobject/gparamspecs.c | 127 + +++++++++++++++++++++++- + gobject/gparamspecs.h | 52 ++++++++++ + gobject/gtype.h | 13 ++- + gobject/gvaluetypes.c | 148 + +++++++++++++++++++++++++++ + gobject/gvaluetypes.h | 15 +++ + tests/gobject/gvalue-test.c | 38 ++++++-- + tests/gobject/paramspec-test.c | 46 +++++++-- + 14 files changed, 461 insertions(+), 35 deletions(-) + +commit f2ae6217771b1014efb86eab0f5346d3b297024e +Author: Ryan Lortie +Date: Thu Jun 17 14:58:46 2010 -0400 + + Revert "GVariant: add g_variant_default_value()" + + This reverts commit b205dc77cb14f67818eaac23d0eb3f5d1b867921. + + We decided to go the other route with the GParamSpec. + + docs/reference/glib/glib-sections.txt | 1 - + glib/glib.symbols | 1 - + glib/gvariant.c | 32 + ++------------------------------ + glib/gvariant.h | 1 - + 4 files changed, 2 insertions(+), 33 deletions(-) + +commit 58e000d30127b70f147f5f615fddea5358992029 +Author: Ryan Lortie +Date: Thu Jun 17 14:33:50 2010 -0400 + + Only run the schema compiler from the test cases + + gio/tests/Makefile.am | 6 ------ + 1 files changed, 0 insertions(+), 6 deletions(-) + +commit 6c3ae976e61a9c680c7e18ff89d41d0808a066c4 +Author: Ryan Lortie +Date: Thu Jun 17 14:05:40 2010 -0400 + + Bug 621266 - GSettings "context" clarification + + Remove the concept of "context" in favour of dealing with + GSettingsBackend directly. + + gio/gio.symbols | 9 +-- + gio/gkeyfilesettingsbackend.c | 39 +-------- + gio/gsettings.c | 80 +++++++--------- + gio/gsettings.h | 11 +-- + gio/gsettingsbackend.c | 192 + +++++++++------------------------------- + gio/gsettingsbackend.h | 23 ++--- + gio/gsettingsbackendinternal.h | 30 +++---- + gio/tests/Makefile.am | 11 ++- + gio/tests/gsettings.c | 9 +- + 9 files changed, 120 insertions(+), 284 deletions(-) + +commit b3cc28bc34bd0b341f1786dc478cff259ce5d1da +Author: Cosimo Cecchi +Date: Thu Jun 17 18:26:15 2010 +0200 + + Bug 621905 – Assume a ref when doing async work + + When asynchronously acquiring the DBus connection, assume a + reference to + the proxy object, to avoid destroying it in the middle of the + operation. + + See https://bugzilla.gnome.org/show_bug.cgi?id=621905 + + gio/gdbusproxy.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit d352ec2bf383754f352fc7cbfb7a48918cc0d9ea +Author: Ryan Lortie +Date: Thu Jun 17 10:50:47 2010 -0400 + + GSettings-related distcheck fixups + + gio/tests/Makefile.am | 92 + ++++++++++++++++++++++++++++++------------------ + gio/tests/gsettings.c | 6 ++- + 2 files changed, 61 insertions(+), 37 deletions(-) + +commit fcbddd746b73bc2c4ab2754f66355bd8b59d9a6b +Author: Ryan Lortie +Date: Thu Jun 17 09:38:39 2010 -0400 + + Add 'if' that was absorbed by $(AM_V_GEN) + + From commit 1b8ee5196eb8ed684b0ee0d2f0d26e6bd82656af + + Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e7cd94a481065806eff1f330c2b4fe0cf8c913fb +Author: Ryan Lortie +Date: Thu Jun 17 08:57:19 2010 -0400 + + More GSettings doc fixups + + gio/gsettings.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 92375a8c8e14517fd7b6d2321e73b4acf15f1442 +Author: Ryan Lortie +Date: Thu Jun 17 08:08:28 2010 -0400 + + takes mandatory target='' arg + + gio/gsettings.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit d405ad8a09806361637b0abed76e62bc64b66cbe +Author: Ryan Lortie +Date: Thu Jun 17 08:06:52 2010 -0400 + + GSettings: Fix comment formatting, whitespace. + + gio/gsettings.c | 20 ++++++++++---------- + 1 files changed, 10 insertions(+), 10 deletions(-) + +commit 24f1fa12c148141b8be39083f0ba7106fd97590f +Author: Matthias Clasen +Date: Thu Jun 17 01:51:23 2010 -0400 + + Add new api + + docs/reference/gio/gio-sections.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 61af83c5b6a632448e9330eedebf7f8aa225f2e3 +Author: Matthias Clasen +Date: Thu Jun 17 01:38:14 2010 -0400 + + Add some schema examples + + gio/gsettings.c | 82 + +++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 80 insertions(+), 2 deletions(-) + +commit fbf93c371a8e9c8f5593ba34917e112b9759a801 +Author: Matthias Clasen +Date: Thu Jun 17 00:45:43 2010 -0400 + + Typo fix + + gio/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 345a1ee31c9d8783670ca3ad3c7d6e526b0c039c +Author: Matthias Clasen +Date: Thu Jun 17 00:37:12 2010 -0400 + + Update the dtd to match the schema parser + + The aliases element was not mentioned here. + + gio/gsettings.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 3fbac9940263def7a741570ca71e07962fe365c3 +Author: Matthias Clasen +Date: Wed Jun 16 22:42:16 2010 -0400 + + Updates + + NEWS | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 61 insertions(+), 0 deletions(-) + +commit fc538894d38780be8fb46735a07e2d36c34eaacb +Author: Ryan Lortie +Date: Thu Jun 17 00:03:44 2010 -0400 + + GSettings: enum/choices/aliases/range test cases + + Fix a small bug that one of the tests uncovered. + + gio/gschema-compile.c | 10 +++--- + gio/strinfo.c | 2 +- + gio/tests/.gitignore | 1 + + gio/tests/gschema-compile.c | 27 + +++++++++++++++++++- + gio/tests/schema-tests/bad-choice.gschema.xml | 14 ++++++++++ + gio/tests/schema-tests/bare-alias.gschema.xml | 7 +++++ + gio/tests/schema-tests/choice-alias.gschema.xml | 15 +++++++++++ + gio/tests/schema-tests/choice-bad.gschema.xml | 14 ++++++++++ + gio/tests/schema-tests/choice-badtype.gschema.xml | 7 +++++ + .../schema-tests/choice-invalid-alias.gschema.xml | 15 +++++++++++ + .../schema-tests/choice-shadowed-alias.gschema.xml | 14 ++++++++++ + .../schema-tests/choice-upside-down.gschema.xml | 14 ++++++++++ + gio/tests/schema-tests/choice.gschema.xml | 14 ++++++++++ + .../schema-tests/default-in-aliases.gschema.xml | 15 +++++++++++ + .../schema-tests/enum-with-aliases.gschema.xml | 20 ++++++++++++++ + .../schema-tests/enum-with-bad-default.gschema.xml | 16 +++++++++++ + .../enum-with-chained-alias.gschema.xml | 21 +++++++++++++++ + .../schema-tests/enum-with-choice.gschema.xml | 17 ++++++++++++ + .../enum-with-invalid-alias.gschema.xml | 20 ++++++++++++++ + .../enum-with-repeated-alias.gschema.xml | 21 +++++++++++++++ + .../enum-with-shadow-alias.gschema.xml | 20 ++++++++++++++ + gio/tests/schema-tests/enum.gschema.xml | 16 +++++++++++ + gio/tests/schema-tests/range-badtype.gschema.xml | 7 +++++ + .../schema-tests/range-default-high.gschema.xml | 8 ++++++ + .../schema-tests/range-default-low.gschema.xml | 8 ++++++ + .../schema-tests/range-high-default.gschema.xml | 8 ++++++ + .../schema-tests/range-low-default.gschema.xml | 8 ++++++ + .../schema-tests/range-parse-error.gschema.xml | 8 ++++++ + gio/tests/schema-tests/range.gschema.xml | 8 ++++++ + 29 files changed, 368 insertions(+), 7 deletions(-) + +commit be8f938b6309afccd85e8f79d5e8c42a1ab11131 +Author: Ryan Lortie +Date: Wed Jun 16 18:49:20 2010 -0400 + + move GSettings(Backend) to giotypes.h + + gio/giotypes.h | 5 ++++- + gio/gsettings.h | 3 +-- + gio/gsettingsbackend.h | 2 -- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit f0d30e0c0c645b585478dcae58a4e8d4cdd80fd8 +Author: Ryan Lortie +Date: Wed Jun 16 18:36:24 2010 -0400 + + Bug 621319 - more leaked GVariants in GSettings + + Caught by Felix Riemann. + + gio/gsettings.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 4275c68c30bc372b4aa5d9f5a5ee7f2817d49d4e +Author: Ryan Lortie +Date: Wed Jun 16 18:22:48 2010 -0400 + + GVariant serialiser: fix small type error + + glib/gvariant-serialiser.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 597290d5c81bf889a694e286ea2434655b82a404 +Author: Ryan Lortie +Date: Mon Jun 14 17:29:41 2010 -0400 + + GSettings: major refactor. Add enums, range. + + gio/Makefile.am | 2 +- + gio/gio.symbols | 2 + + gio/gschema-compile.c | 1326 ++++++++++++++++------ + gio/gsettings-mapping.c | 24 +- + gio/gsettings.c | 2287 + +++++++++++++++++++++--------------- + gio/gsettings.h | 6 +- + gio/gsettingsbackend.c | 27 +- + gio/gsettingsschema.c | 45 +- + gio/gsettingsschema.h | 5 +- + gio/strinfo.c | 308 +++++ + gio/tests/enums.xml.template | 18 + + gio/tests/gsettings.c | 148 +++- + gio/tests/org.gtk.test.gschema.xml | 28 + + gio/tests/testenum.h | 7 + + 14 files changed, 2893 insertions(+), 1340 deletions(-) + +commit b205dc77cb14f67818eaac23d0eb3f5d1b867921 +Author: Ryan Lortie +Date: Wed Jun 16 15:56:51 2010 -0400 + + GVariant: add g_variant_default_value() + + Returns various kinds of false, zero, empty arrays, etc. + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gvariant.c | 32 + ++++++++++++++++++++++++++++++-- + glib/gvariant.h | 1 + + 4 files changed, 33 insertions(+), 2 deletions(-) + +commit 6a1cb9f697c0cd69d717b2a1457dd696702f4e48 +Author: Christian Persch +Date: Wed Jun 16 18:47:20 2010 +0200 + + Typo fix + + gobject/gparam.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b90f11ff970a39ea6d9d7abbe01b07043c70de6b +Author: Christian Persch +Date: Wed Jun 16 17:48:02 2010 +0200 + + Typo fix + + gio/gapplication.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 102c5f6a7d13ec099a8c89db0651172fd3230268 +Author: Colin Walters +Date: Wed Jun 16 00:18:09 2010 -0400 + + Rework GApplication API to use GInitable + + https://bugzilla.gnome.org/show_bug.cgi?id=620952 + + gio/gapplication.c | 407 + +++++++++++++++++++++++++++++++++++------------ + gio/gapplication.h | 21 ++- + gio/gdbusapplication.c | 119 ++++++-------- + gio/gio.symbols | 5 +- + gio/gnullapplication.c | 13 +- + gio/tests/application.c | 2 +- + gio/tests/testapp.c | 8 +- + 7 files changed, 388 insertions(+), 187 deletions(-) + +commit 25ba90ffdd744d4c3c59cc550cdf08f3de11d542 +Author: Emmanuele Bassi +Date: Wed Jun 16 15:09:33 2010 +0100 + + Add gdbus-proxy-well-known-name to the ignore file + + gio/tests/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 33aa4b4c662f18433ed27cd319ab5c97e5a9d9da +Author: Emmanuele Bassi +Date: Wed Jun 16 15:08:10 2010 +0100 + + binding: Use a hash table + + Since an object instance might have a lot of bindings, using a list + might become a performance issue when removing them. Using a simple + hash table guarantees constant time lookup, which is the most common + operation. + + gobject/gbinding.c | 31 ++++++++++++++++++++++++------- + 1 files changed, 24 insertions(+), 7 deletions(-) + +commit f72f65643fb1d832e8296b26cff77dedbdac310f +Author: Emmanuele Bassi +Date: Wed Jun 16 14:47:06 2010 +0100 + + tests: Add a chain binding + + Test the case with a chain like A → B, B → C, and what happens + when + switching to a direct A → C link. + + https://bugzilla.gnome.org/show_bug.cgi?id=621782 + + gobject/tests/binding.c | 35 +++++++++++++++++++++++++++++++++++ + 1 files changed, 35 insertions(+), 0 deletions(-) + +commit 48e3b31042c9a86d06740f2c73cbb6ffa140ba54 +Author: Matthias Clasen +Date: Tue Jun 15 22:06:56 2010 -0400 + + Properly initialize GError + + Pointed out by Florian Müllner in bug #621702 + + gio/gdbusproxy.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 1b8ee5196eb8ed684b0ee0d2f0d26e6bd82656af +Author: Christian Persch +Date: Tue Jun 15 22:01:02 2010 -0400 + + Sprinkle some $(AM_V_GEN) around to make the build more silent. + + Makefile.am | 5 ++--- + gio/Makefile.am | 14 +++++++------- + glib/Makefile.am | 8 ++++---- + gmodule/Makefile.am | 4 ++-- + gobject/Makefile.am | 16 ++++++++-------- + gthread/Makefile.am | 2 +- + tests/gobject/Makefile.am | 4 ++-- + 7 files changed, 26 insertions(+), 27 deletions(-) + +commit 062148ae9a4176a28c055a6e3505f4e5c9ff6313 +Author: Matthias Clasen +Date: Tue Jun 15 21:57:57 2010 -0400 + + Correct some documentation mistakes in gunixmounts.c + + Pointed out by Ross Burton in bug #618904 + + gio/gunixmounts.c | 26 +++++++++++++------------- + 1 files changed, 13 insertions(+), 13 deletions(-) + +commit 6d1d9cf1b551845a159a6b822500bb40e33fda74 +Author: Emmanuele Bassi +Date: Fri Jun 4 16:17:15 2010 +0100 + + gobject: Add GBinding + + GBinding is a simple, opaque object that represents a binding + between a + property on a GObject instance (source) and property on another + GObject + instance (target). + + https://bugzilla.gnome.org/show_bug.cgi?id=348080 + + docs/reference/gobject/gobject-docs.sgml | 1 + + docs/reference/gobject/gobject-sections.txt | 23 + + docs/reference/gobject/gobject.types | 1 + + glib/glib-object.h | 1 + + gobject/Makefile.am | 5 +- + gobject/gbinding.c | 937 + +++++++++++++++++++++++++++ + gobject/gbinding.h | 119 ++++ + gobject/gobject.symbols | 15 + + gobject/tests/.gitignore | 1 + + gobject/tests/Makefile.am | 4 +- + gobject/tests/binding.c | 326 ++++++++++ + 11 files changed, 1430 insertions(+), 3 deletions(-) + +commit f3879a4bdca2ff1cf6c6b016d67a7e5d40c0e86b +Author: Damien Lespiau +Date: Sat Apr 10 15:50:40 2010 +0100 + + Introduce g_object_notify_by_pspec() + + g_object_notify_by_pspec() will emit the "notify" signal on the given + pspec, short-circuiting the hash table lookup needed by + g_object_notify(). The suggested and documented way of using + g_object_notify_by_pspec() is similar to the way of emitting signals + with their ID. + + Emission tests (with no handler attached to the notify signal) show a + 10-15% speedup over using g_object_notify(). + + https://bugzilla.gnome.org/show_bug.cgi?id=615425 + + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gobject.c | 82 + ++++++++++++++++++++++++-- + gobject/gobject.h | 2 + + gobject/gobject.symbols | 1 + + 4 files changed, 79 insertions(+), 7 deletions(-) + +commit 08f473ffeff7524e619dc0459c07a981a3b4285c +Author: Matthias Clasen +Date: Tue Jun 15 02:01:16 2010 -0400 + + Prevent division by zero if no tests + + glib/gtester-report | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 53f70ac43b0a4d2de109a73b0ea3724aefe95d5d +Author: Matthias Clasen +Date: Tue Jun 15 01:50:15 2010 -0400 + + Forgotten file + + glib/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit f9e8b5d9d47859c7bb62430753ce77e981e4ee65 +Author: Robert Collins +Date: Tue Jun 15 01:49:44 2010 -0400 + + Add subunit support to gtester-report + + This patch adds subunit support to gtester-report via a -s + switch. Subunit + (https://launchpad.net/subunit) is a language neutral test activity + protocol. + This can be used to integrate gtester tests with the Hudson CI + tool amongst + other things. + + Bug #611869. + + glib/gtester-report | 141 + ++++++++++++++++++++++++++++++++++++++++++++++---- + 1 files changed, 129 insertions(+), 12 deletions(-) + +commit 8de6d03c4417a16cad2d089805f93da4b4160602 +Author: Robert Collins +Date: Tue Jun 15 01:37:14 2010 -0400 + + Use optparse to parse gtester-report commandline options + + See bug #611778. + + glib/gtester-report | 54 + +++++++++++++++++++++----------------------------- + 1 files changed, 23 insertions(+), 31 deletions(-) + +commit ddb9a2f26490b45f9cbda51b79ebcafb38b6ca81 +Author: Emmanuele Bassi +Date: Tue Jun 15 01:31:18 2010 -0400 + + Add package and version to the test report XML + + Makefile.decl | 8 ++++++-- + glib/gtester-report | 16 ++++++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +commit 9971686b7e0d3a3f8416534a55e246bbfd901d0a +Author: Matthias Clasen +Date: Tue Jun 15 00:50:36 2010 -0400 + + Reword a doc comment + + To take out some awkward wording. + + glib/gmarkup.c | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +commit a500de820260915c6b4d4724d6029ee5b8552ae7 +Author: Hib Eris +Date: Tue Jun 15 00:39:46 2010 -0400 + + Let GLIB_SETTINGS macro use glib-compile-schemas from PATH when + cross compiling + + See bug #621172 + + m4macros/gsettings.m4 | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit b079d6a54616514e80b552ebe0a42f45e379b0e8 +Author: Hib Eris +Date: Tue Jun 15 00:38:35 2010 -0400 + + Use native glib-compile-schemas when cross compiling + + configure.in | 8 +++++++- + gio/tests/Makefile.am | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +commit 85210bcf9b7f597aa2ad2a7087709c6091638805 +Author: Colin Walters +Date: Tue Jun 8 16:25:33 2010 -0400 + + Switch to using variants for timestamps, split out signals + + Like how we're handling activation, use GVariant for timestamps. To + avoid polluting the GtkApplication API with GVariants, we rename the + GApplication signals to "quit-with-data" and "action-with-data". + GtkApplication will then wrap those as just "quit" and "action". + + https://bugzilla.gnome.org/show_bug.cgi?id=621002 + + gio/gapplication.c | 94 + ++++++++++++++++++++++++---------------------- + gio/gapplication.h | 27 +++++-------- + gio/gdbusapplication.c | 47 +++++++++++++++-------- + gio/gio-marshal.list | 2 + + gio/gio.symbols | 2 +- + gio/tests/application.c | 63 +++++++++++++++++++++++++------ + gio/tests/testapp.c | 4 +- + gio/tests/testapps.c | 17 ++++++-- + 8 files changed, 159 insertions(+), 97 deletions(-) + +commit 8c4e1fa0afd97ae211260e4990585629d3c010a1 +Author: Christian Persch +Date: Sun Jun 13 15:16:33 2010 +0200 + + Add --xml to gdbus-tool to print raw introspected XML + + Bug #621442. + + docs/reference/gio/gdbus.xml | 1 + + gio/gdbus-tool.c | 23 ++++++++++++++++------- + 2 files changed, 17 insertions(+), 7 deletions(-) + +commit fdb15058a4625e0f2eb56c56d945e032d8a833ca +Author: Matthias Clasen +Date: Sat Jun 12 18:40:45 2010 -0400 + + Avoid a race in application registration + + We need to register the object before taking the name. + Remove the workarounds for this race from the test suite. + + gio/gdbusapplication.c | 45 + ++++++++++++++++++++++++++------------------- + gio/tests/testapps.c | 7 +------ + 2 files changed, 27 insertions(+), 25 deletions(-) + +commit 5e03f273be30d0f5756102d49b20bbabc5743113 +Author: Fran Diéguez +Date: Sat Jun 12 17:47:40 2010 +0200 + + Updated Galician translations + + po/gl.po | 1290 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 663 insertions(+), 627 deletions(-) + +commit 19012ada573221aeedaa982336f2f7b945860bb3 +Author: Matthias Clasen +Date: Sat Jun 12 01:55:25 2010 -0400 + + Accept no-reply errors + + This can happen if the app quits before the dbus reply can be + sent out. + + gio/tests/testapps.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 330cdfbdf1959af90506aa24cc276a20b00878b8 +Author: Matthias Clasen +Date: Fri Jun 11 23:21:49 2010 -0400 + + Make the tests not fall over every other time + + gio/tests/testapps.c | 80 + +++++++++++++++++++++++++++++++------------------ + 1 files changed, 50 insertions(+), 30 deletions(-) + +commit 32f2e9a85beedeea36ac7623f68f6eb878465d44 +Author: David Zeuthen +Date: Fri Jun 11 15:45:18 2010 -0400 + + Bug 621213 – GDBusProxy and well-known names + + Allow constructing a GDBusProxy for well-known names as discussed here + http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00075.html + including test cases. + + Make it possible to create a GDBusProxy for a GBusType instead of a + GDBusConnection. This requires G_BUS_TYPE_NONE so add that too. + + Nuke g_bus_watch_proxy() since one can now more or less use GDBusProxy + for this. + + Port gdbus-example-watch-proxy to this new API and include this + example in the GDBusProxy doc page. + + Also nuke the GType parameter from the GDBusProxy constructors as + requested here: https://bugzilla.gnome.org/show_bug.cgi?id=621229 + + Also update the porting guide and other API docs for this change. + + Also fix a bug in the signal dispatching code so each subscriber only + get notified once, not N times, for the same signal. Also add a test + case for this. + + https://bugzilla.gnome.org/show_bug.cgi?id=621213 + + Signed-off-by: David Zeuthen + + docs/reference/gio/gio-docs.xml | 1 - + docs/reference/gio/gio-sections.txt | 17 +- + docs/reference/gio/migrating-gdbus.xml | 62 +-- + gio/Makefile.am | 2 - + gio/gdbusconnection.c | 152 +++-- + gio/gdbusproxy.c | 1071 + ++++++++++++++++++++++++------ + gio/gdbusproxy.h | 28 +- + gio/gdbusproxywatching.c | 666 ------------------- + gio/gdbusproxywatching.h | 115 ---- + gio/gio.h | 1 - + gio/gio.symbols | 16 +- + gio/gioenums.h | 14 +- + gio/tests/Makefile.am | 4 + + gio/tests/gdbus-connection.c | 22 +- + gio/tests/gdbus-example-proxy-subclass.c | 83 --- + gio/tests/gdbus-example-watch-proxy.c | 149 +++-- + gio/tests/gdbus-export.c | 5 - + gio/tests/gdbus-introspection.c | 55 +- + gio/tests/gdbus-peer.c | 1 - + gio/tests/gdbus-proxy-well-known-name.c | 283 ++++++++ + gio/tests/gdbus-proxy.c | 84 +-- + gio/tests/gdbus-threading.c | 55 +- + 22 files changed, 1508 insertions(+), 1378 deletions(-) + +commit e0f8d30dea3d9509867f29289835ea3d58b32730 +Author: Ryan Lortie +Date: Fri Jun 11 14:52:17 2010 -0400 + + gitignore GApplication test-cases + + gio/tests/.gitignore | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 0fc60514fcf9b0d38292ca3a9c416943f722227a +Author: Felix Riemann +Date: Fri Jun 11 00:10:05 2010 +0200 + + Close memory leak in GSettings + + Fixes bug #621252. + + gio/gsettings.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit aeb41b56e123a4946fd76e89b2cf47a46e6411f6 +Author: Alexander Larsson +Date: Fri Jun 11 09:59:56 2010 +0200 + + converter streams: make code more readable + + The name buffer_availabile was kinda confusing, so its been renamed + to buffer_data_size() to match buffer_data(). + + Also I added a comment to buffer_ensure_space because its behaviour + wasn't obvious. + + gio/gconverterinputstream.c | 26 ++++++++++++++------------ + gio/gconverteroutputstream.c | 26 ++++++++++++++------------ + 2 files changed, 28 insertions(+), 24 deletions(-) + +commit 6858ab20330ec31322dacbbdfaf66838fdcbfb78 +Author: Jürg Billeter +Date: Fri May 28 11:00:37 2010 +0200 + + Use correct offset for buffer data in GConverterOutputStream + + Otherwise we overwrite already converted data in the case that more + than one call to g_converter_convert is necessary in write() or + flush(). + + https://bugzilla.gnome.org/show_bug.cgi?id=619945 + + gio/gconverteroutputstream.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 86592d675ff8f1bf0f647fe926ea6085e7b1f2bc +Author: Jürg Billeter +Date: Thu May 27 16:55:53 2010 +0200 + + Ensure we always have some target space in GConverterOutputStream + + When the converter fills the whole buffer without reading all input, + we need to enlarge the buffer. Otherwise we get an assertion failure + for `outbuf_size > 0' in g_converter_convert. + + https://bugzilla.gnome.org/show_bug.cgi?id=619945 + + gio/gconverteroutputstream.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 85ea72c0c5716b6ebd62272e17e8e4e3b9014f65 +Author: Christian Dywan +Date: Fri Jun 11 09:46:47 2010 +0200 + + Add a regression test for GConverterOutputStream corruption + + See bug #619945 for background + + gio/tests/converter-stream.c | 54 + ++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 54 insertions(+), 0 deletions(-) + +commit ceee4c21a31e01009960af1be331154f47548291 +Author: Ryan Lortie +Date: Thu Jun 10 22:35:31 2010 -0400 + + GSettings test case fixes + + - call g_settings_sync() + - fix bug #618715 by not forking if a backend is specified via + environment variable + + gio/tests/gsettings.c | 53 + ++++++++++++++++++++++++++++++++++++------------- + 1 files changed, 39 insertions(+), 14 deletions(-) + +commit a8b5353b1480edbb6a28afe39056bf6a64a1e42d +Author: Ryan Lortie +Date: Thu Jun 10 22:30:44 2010 -0400 + + Add g_settings_sync() and use it + + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gsettings-tool.c | 19 +------------------ + gio/gsettings.c | 28 ++++++++++++++++++++++++++++ + gio/gsettings.h | 1 + + gio/gsettingsbackend.c | 15 +++++++++++++++ + gio/gsettingsbackendinternal.h | 2 ++ + 7 files changed, 49 insertions(+), 18 deletions(-) + +commit afea703422001cbbe8bbd2e13842008a482cd9ae +Author: Ryan Lortie +Date: Thu Jun 10 15:27:46 2010 -0400 + + Implement byteswapping in the reader + + gvdb-reader.c | 23 ++++++++++++++++++++++- + 1 files changed, 22 insertions(+), 1 deletions(-) + +commit 7c36619d269284597d5df4f366b6389df9bcf617 +Author: Colin Walters +Date: Thu Jun 10 14:02:15 2010 -0400 + + [Gio] Merge in introspection annotations from gobject-introspection + gio-2.0.c + + This is not an exhaustive set, but covers everything we have so far. + + gio/gappinfo.c | 10 +++++----- + gio/gdesktopappinfo.c | 6 +++--- + gio/gdrive.c | 2 +- + gio/gfile.c | 34 +++++++++++++++++----------------- + gio/gfileenumerator.c | 2 +- + gio/gfileinfo.c | 14 +++++++------- + gio/gfilenamecompleter.c | 2 +- + gio/gfilterinputstream.c | 2 +- + gio/gfilteroutputstream.c | 2 +- + gio/goutputstream.c | 6 +++--- + gio/gvolume.c | 8 ++++---- + gio/gvolumemonitor.c | 6 +++--- + 12 files changed, 47 insertions(+), 47 deletions(-) + +commit 3a062d2e33aa1d54dd460a1a2cb297009d94d4d6 +Author: Ryan Lortie +Date: Thu Jun 10 13:49:57 2010 -0400 + + GSettings: store (default, options) in gvdb + + gvdb just dropped the ability to have a separate "options" field. We + now store the options into a GVariant along with the default value. + + For now, we use a small shim in GSettingsSchema in order not to touch + too much code. A more complete rewrite will follow. + + This represents a change to the schema file format with another likely + to follow. glib-compile-schemas needs to be re-run after installing + this change. + + gio/gschema-compile.c | 7 +++---- + gio/gsettings.c | 12 +++++------- + gio/gsettingsschema.c | 25 ++++++++++++++++--------- + gio/gsettingsschema.h | 3 +++ + 4 files changed, 27 insertions(+), 20 deletions(-) + +commit 73007021796f33d7ccec4e5f2bb2b2f8660347f2 +Merge: 45e604d 9a8cba9 +Author: Ryan Lortie +Date: Thu Jun 10 13:35:25 2010 -0400 + + Merge remote branch 'gvdb/master' + +commit 9a8cba9eb53f105b752aac7bb16c7c83c6617caf +Author: Ryan Lortie +Date: Thu Jun 10 13:34:56 2010 -0400 + + drop "options" support + + gvdb-builder.c | 41 ----------------------------------------- + gvdb-builder.h | 3 --- + gvdb-format.h | 2 -- + gvdb-reader.c | 32 ++------------------------------ + gvdb-reader.h | 3 +-- + 5 files changed, 3 insertions(+), 78 deletions(-) + +commit 45e604d029980f90a7304b6311fc43cc0cc2ab69 +Author: Tomeu Vizoso +Date: Thu Jun 10 18:29:23 2010 +0200 + + Add _with_closures alternative functions for those in GDBus that + accept more than one callback. + + g_bus_own_name_with_closures + g_bus_own_name_on_connection_with_closures + g_bus_watch_name_with_closures + g_bus_watch_name_on_connection_with_closures + g_bus_watch_proxy_with_closures + g_bus_watch_proxy_on_connection_with_closures + + https://bugzilla.gnome.org/show_bug.cgi?id=621092 + + docs/reference/gio/gio-sections.txt | 6 + + gio/gdbusnameowning.c | 173 + ++++++++++++++++++++++++++++++++++ + gio/gdbusnameowning.h | 14 +++ + gio/gdbusnamewatching.c | 149 +++++++++++++++++++++++++++++ + gio/gdbusnamewatching.h | 11 ++ + gio/gdbusproxywatching.c | 177 + +++++++++++++++++++++++++++++++++++ + gio/gdbusproxywatching.h | 19 ++++ + gio/gio.symbols | 6 + + gio/pltcheck.sh | 2 +- + 9 files changed, 556 insertions(+), 1 deletions(-) + +commit 8cab5e46934554d899274dd96e6a1d5fbbbc9ea6 +Author: Colin Walters +Date: Wed Jun 9 17:17:14 2010 -0400 + + [GApplication] Tweak docs a bit + + gio/gapplication.c | 34 ++++++++++++++++++++++++---------- + 1 files changed, 24 insertions(+), 10 deletions(-) + +commit cc19922183b18683da192cc7371a510cf648ec64 +Author: Colin Walters +Date: Tue Jun 8 21:43:16 2010 -0400 + + Rewrite apps test to ensure children are killed + + Create a function run_with_application that both ensures the + app is running exactly while the test is running, which most + of the tests use. We start it beforehand, and kill it after. + This avoids having any interdependence between the tests (and + there definitely was before, because we didn't wait for + the process to actually terminate after a kill() call). + + Also, open a pipe between the two, and have the child app + monitor that pipe. If it gets closed (e.g. because the parent + died), the child exits. This is the most reliable way to + avoid stale children; before, if we failed an assertion, the + parent would abort, and not run kill(). + + https://bugzilla.gnome.org/show_bug.cgi?id=621034 + + gio/tests/testapp.c | 50 +++--- + gio/tests/testapps.c | 512 + ++++++++++++++++++++++++++------------------------ + 2 files changed, 298 insertions(+), 264 deletions(-) + +commit 8d3fea9cff848d1b45c0a6371ef448c11d992757 +Author: Ryan Lortie +Date: Thu Jun 10 08:06:32 2010 -0400 + + Mention GVariant format string docs from iter docs + + It's not entirely clear what @format_string in iter_next() and + iter_loop() should be. Include a link to the GVariant format string + docs as a hint. + + glib/gvariant.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 507c266c3bdf03d9d75ad11bb346f013172f5ad5 +Author: Tor Lillqvist +Date: Thu Jun 10 11:52:25 2010 +0300 + + Plug memory leak on Windows + + Intern the string returned from g_win32_getlocale() and then free it. + Fixes bug #621168. + + glib/gutils.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 6720596544112a40e8133aea86672197edb46eed +Author: Matthias Clasen +Date: Wed Jun 9 23:44:13 2010 -0400 + + Fix GApplication tests to run without a session bus + + We reuse code from the GDBus tests here to launch a session bus. + + gio/tests/Makefile.am | 4 ++-- + gio/tests/application.c | 15 ++++++++++++++- + gio/tests/testapps.c | 15 ++++++++++++++- + 3 files changed, 30 insertions(+), 4 deletions(-) + +commit db0c55608f0500e8ab47a222a644ea3085b80151 +Author: David Zeuthen +Date: Wed Jun 9 17:57:04 2010 -0400 + + GDBusConnection: Do not dispatch calls to unregistered objects + or subtrees + + There was a slight race where we ended up calling into user code if + the user managed to unregister an object (or subtree) in the window + between + + - processing the remote call on the worker thread; and + - continuing handling it on the user code thread (via an idle + handler) + + This patch fixes the problem. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 123 + ++++++++++++++++++++++++++++++++++++++++++++++-- + 1 files changed, 117 insertions(+), 6 deletions(-) + +commit ed7f59770e01623fa411530c81cbb04f73555a4c +Author: David Zeuthen +Date: Wed Jun 9 17:08:34 2010 -0400 + + GDBusProxy: Fix error handling in synchronous initialization codepath + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit 653921e17a00d161a25b21d61ff12b8d03208202 +Author: Ryan Lortie +Date: Wed Jun 9 12:43:13 2010 -0400 + + g_variant_builder_add_parsed: fix type error + + Problem caught by Juan A. Suarez Romero + + glib/gvariant-parser.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f265319b59239f7ad74283b79a62e28afe4ff111 +Author: Richard Hughes +Date: Wed Jun 9 09:36:47 2010 +0100 + + Do not do update-po at distcheck time to avoid touching files checked + into version control + + po/Makefile.in.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1951c39c44afad8273e2978b4c1420e975882934 +Author: David Zeuthen +Date: Wed Jun 9 10:56:35 2010 -0400 + + Bug 621119 – GDBusProxy and objects with no properties + + Fix proxy construction for objects with no properties in the case + where G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES isn't set. + + The unfortunate side-effect here is that GDBusProxy can no longer be + used to test for "object existence", e.g. creating a GDBusProxy for + any path and interface will not fail. But that's not really a big + deal, if apps rely on that they are doing something very wrong. + + https://bugzilla.gnome.org/show_bug.cgi?id=621119 + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 42 +++++++++++++++++++++++++++++++----------- + 1 files changed, 31 insertions(+), 11 deletions(-) + +commit 67193f55c3201e32405c5a15621d49f703b83f8f +Author: Juan A. Suarez Romero +Date: Wed Jun 9 10:27:39 2010 +0200 + + Fix warning + + Disable functions defined but not used. + + gio/tests/filter-streams.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 992e07c8b2e8f75bcc87c30e1ac2aca1ccf432e3 +Author: Juan A. Suarez Romero +Date: Wed Jun 9 10:23:39 2010 +0200 + + Fix warnings + + Do explicit casts to avoid warnings. + + gio/inotify/inotify-helper.c | 2 +- + gio/tests/memory-output-stream.c | 2 +- + tests/testglib.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 2b72587bedfe293964529aa9f6d6034e7976209b +Author: blue dark +Date: Wed Jun 9 15:13:14 2010 +0800 + + Updated zh_CN translation. + + po/ChangeLog | 4 + + po/zh_CN.po | 1682 + +++++++++++++++++++++++++++++----------------------------- + 2 files changed, 859 insertions(+), 827 deletions(-) + +commit d8dca11733e483670f47fa5c4d8f4a5cb97f6b5b +Author: Christian Persch +Date: Tue Jun 8 19:40:58 2010 +0200 + + Fix thinko + + When replacing strcmp() with g_variant_is_of_type(), remove the "== 0" + part! Found by Colin Walters. + + gio/gapplication.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0ed183b572db48d0091f9c6ee5e3e005a382c66a +Author: Colin Walters +Date: Tue Jun 8 11:21:48 2010 -0400 + + [GDBusConnection] Use Gio's default async implementation again + + The fix was committed in git. + + https://bugzilla.gnome.org/show_bug.cgi?id=620990 + + gio/gdbusconnection.c | 46 + +--------------------------------------------- + 1 files changed, 1 insertions(+), 45 deletions(-) + +commit 06e74ca96928550a31fc05991df01e68300d8a45 +Author: Christian Persch +Date: Tue Jun 8 13:40:38 2010 +0200 + + g_dbus_method_invocation_return_value consumes the floating variant + + Bug #620953. + + gio/gdbusmethodinvocation.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 2ab9a07ec79b7dd979253340cf7a471048be0c8f +Author: Christian Persch +Date: Tue Jun 8 13:36:58 2010 +0200 + + Simplify variant builder + + Build the full return value with one builder, and don't unref the + unowned return value! + + Bug #620954. + + gio/gdbusapplication.c | 13 +++++-------- + 1 files changed, 5 insertions(+), 8 deletions(-) + +commit d3b091f63abde2f7de587986a65004ddf2c4ed2a +Author: Christian Persch +Date: Tue Jun 8 13:36:00 2010 +0200 + + Use g_variant_is_of_type() + + ... instead of strcmp()'ing the type strings. + + Bug #620954. + + gio/gapplication.c | 2 +- + gio/gdbusapplication.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit b75e7eb95d4782160a88ea7c4dc714368807408c +Author: Christian Persch +Date: Tue Jun 8 13:35:22 2010 +0200 + + Plug a mem leak + + Bug #620954. + + gio/gdbusapplication.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 471c4e413c91e0bae040de4e048a9846a1447515 +Author: Javier Jardón +Date: Tue Jun 8 16:25:38 2010 +0200 + + [docs] Fix typos in some g_file_* functions + + Reported by Alexander Saprykin in bug + https://bugzilla.gnome.org/show_bug.cgi?id=620947 + + gio/gfile.c | 18 +++++++++--------- + 1 files changed, 9 insertions(+), 9 deletions(-) + +commit b482eab3fa14edabb9f237d4a2cf1e6b2ad6e388 +Author: Matthias Clasen +Date: Tue Jun 8 01:10:17 2010 -0400 + + Bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1a963c659cad268a6689d941bd5a06ab5a12abf1 +Author: Matthias Clasen +Date: Tue Jun 8 01:09:06 2010 -0400 + + 2.25.8 + + po/af.po | 74 ++-- + po/am.po | 74 ++-- + po/ar.po | 74 ++-- + po/as.po | 74 ++-- + po/ast.po | 74 ++-- + po/az.po | 74 ++-- + po/be.po | 74 ++-- + po/be@latin.po | 74 ++-- + po/bg.po | 74 ++-- + po/bn.po | 74 ++-- + po/bn_IN.po | 74 ++-- + po/bs.po | 74 ++-- + po/ca.po | 74 ++-- + po/ca@valencia.po | 74 ++-- + po/cs.po | 74 ++-- + po/cy.po | 74 ++-- + po/da.po | 74 ++-- + po/de.po | 74 ++-- + po/dz.po | 74 ++-- + po/el.po | 74 ++-- + po/en@shaw.po | 74 ++-- + po/en_CA.po | 74 ++-- + po/en_GB.po | 74 ++-- + po/eo.po | 805 ++++++++++++++++++++++++-- + po/es.po | 1268 +++++++++++++++++++-------------------- + po/et.po | 74 ++-- + po/eu.po | 74 ++-- + po/fa.po | 74 ++-- + po/fi.po | 74 ++-- + po/fr.po | 74 ++-- + po/ga.po | 74 ++-- + po/gl.po | 1249 +++++++++++++++++++------------------- + po/gu.po | 74 ++-- + po/he.po | 76 ++-- + po/hi.po | 74 ++-- + po/hr.po | 74 ++-- + po/hu.po | 74 ++-- + po/hy.po | 74 ++-- + po/id.po | 1252 +++++++++++++++++++------------------- + po/is.po | 74 ++-- + po/it.po | 74 ++-- + po/ja.po | 74 ++-- + po/ka.po | 74 ++-- + po/kn.po | 74 ++-- + po/ko.po | 74 ++-- + po/ku.po | 74 ++-- + po/lt.po | 74 ++-- + po/lv.po | 74 ++-- + po/mai.po | 74 ++-- + po/mg.po | 74 ++-- + po/mk.po | 74 ++-- + po/ml.po | 74 ++-- + po/mn.po | 74 ++-- + po/mr.po | 74 ++-- + po/ms.po | 74 ++-- + po/nb.po | 1249 +++++++++++++++++++------------------- + po/nds.po | 74 ++-- + po/ne.po | 74 ++-- + po/nl.po | 74 ++-- + po/nn.po | 74 ++-- + po/oc.po | 74 ++-- + po/or.po | 74 ++-- + po/pa.po | 74 ++-- + po/pl.po | 74 ++-- + po/ps.po | 74 ++-- + po/pt.po | 74 ++-- + po/pt_BR.po | 74 ++-- + po/ro.po | 74 ++-- + po/ru.po | 74 ++-- + po/rw.po | 74 ++-- + po/si.po | 74 ++-- + po/sk.po | 74 ++-- + po/sl.po | 1731 + +++++++++++++++++++++++++--------------------------- + po/sq.po | 74 ++-- + po/sr.po | 74 ++-- + po/sr@ije.po | 74 ++-- + po/sr@latin.po | 74 ++-- + po/sv.po | 74 ++-- + po/ta.po | 74 ++-- + po/te.po | 74 ++-- + po/th.po | 74 ++-- + po/tl.po | 74 ++-- + po/tr.po | 74 ++-- + po/tt.po | 74 ++-- + po/uk.po | 74 ++-- + po/vi.po | 74 ++-- + po/wa.po | 74 ++-- + po/xh.po | 74 ++-- + po/yi.po | 74 ++-- + po/zh_CN.po | 74 ++-- + po/zh_HK.po | 74 ++-- + po/zh_TW.po | 74 ++-- + 92 files changed, 7255 insertions(+), 6665 deletions(-) + +commit 795ddeb421eb01bbadf98e05657b92877cd93d96 +Author: Matthias Clasen +Date: Mon Jun 7 23:41:06 2010 -0400 + + Add missing marshaler + + gio/gio-marshal.list | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e300c7e622d3e5a5e3eaa339c875484b0e4534eb +Author: Matthias Clasen +Date: Mon Jun 7 23:28:30 2010 -0400 + + Fix a missing parameter in a doc comment + + Pointed out by David Zeuthen. + + gio/gapplication.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit a89b10c1dc587cd6806954dc04c3f3e36ee393a5 +Author: Matthias Clasen +Date: Mon Jun 7 23:27:21 2010 -0400 + + Fix a signal signature + + GApplication::action was erroneously declaring the timestamp parameter + as int instead of uint. + + gio/gapplication.c | 11 ++++++++--- + 1 files changed, 8 insertions(+), 3 deletions(-) + +commit 063470ea0d1a97f964d3901b7873fddcbadc4c0d +Author: Matthias Clasen +Date: Mon Jun 7 22:34:07 2010 -0400 + + Fix a misspelt doc comment + + gio/gapplication.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 3b11a7d3f20df2f44b3a97db58bb0ffd02a5f0c0 +Author: Matthias Clasen +Date: Mon Jun 7 22:22:39 2010 -0400 + + Add a lost
+ + docs/reference/gio/gio-sections.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 32b7fbb8907757d8c19c50b48f5917bbad18e43d +Author: Matthias Clasen +Date: Mon Jun 7 22:21:47 2010 -0400 + + Rename GApplication::appid to GApplication::application-id + + gio/gapplication.c | 16 ++++++++-------- + 1 files changed, 8 insertions(+), 8 deletions(-) + +commit c59cc943188753e0f72a8e554f8142351970aa20 +Author: Matthias Clasen +Date: Mon Jun 7 21:53:32 2010 -0400 + + Fix !srcdir checks + + gio/tests/Makefile.am | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 14c62ff722d74af3baca7cc527f316e4ab095dae +Author: Matthias Clasen +Date: Mon Jun 7 21:23:37 2010 -0400 + + Updates + + NEWS | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 51 insertions(+), 0 deletions(-) + +commit fdc99873eeffc36ea2bb0423b586cc3115c76ed2 +Author: Matthias Clasen +Date: Mon Jun 7 18:27:33 2010 -0400 + + Document signals + + gio/gapplication.c | 28 +++++++++++++++++++++++++++- + 1 files changed, 27 insertions(+), 1 deletions(-) + +commit d68100afccc9260309e573bbcb9f0bb387044340 +Author: Javier Jardón +Date: Mon Jun 7 23:55:34 2010 +0200 + + [docs] GApplication is available since Gio 2.26 + + gio/gapplication.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit c2a539eff05f1afd43e1c3c0feb9c98ccfdd0a85 +Author: Matthias Clasen +Date: Mon Jun 7 17:48:09 2010 -0400 + + Use g types for consistency + + gio/gapplication.c | 26 +++++++++++++------------- + gio/gapplication.h | 26 +++++++++++++------------- + gio/gdbusapplication.c | 8 ++++---- + gio/gnullapplication.c | 2 +- + 4 files changed, 31 insertions(+), 31 deletions(-) + +commit 6427e93757dbc38cc53ffeb87ed814cdb9df0ed4 +Author: Matthias Clasen +Date: Mon Jun 7 13:25:39 2010 -0400 + + Merge the wip/gapplication branch + + This adds a GApplication object to GIO, which is the core of + an application support class, supporting + - uniqueness + - exporting actions (simple scripting) + - standard actions (quit, activate) + + The implementation for Linux uses D-Bus, takes a name on the + session bus, and exports a org.gtk.Application interface. + + Implementations for Win32 and OS X are still missing. + + docs/reference/gio/gio-docs.xml | 4 + + docs/reference/gio/gio-sections.txt | 32 + + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 5 + + gio/gappinfo.c | 42 +- + gio/gapplication.c | 1058 + +++++++++++++++++++++++++++++++++++ + gio/gapplication.h | 151 +++++ + gio/gdbusapplication.c | 426 ++++++++++++++ + gio/gdbusconnection.h | 2 +- + gio/gdesktopappinfo.c | 12 + + gio/gio-marshal.list | 3 + + gio/gio.h | 1 + + gio/gio.symbols | 21 + + gio/gnullapplication.c | 70 +++ + gio/tests/Makefile.am | 20 + + gio/tests/appinfo-test.c | 20 + + gio/tests/appinfo-test.desktop | 4 + + gio/tests/appinfo.c | 25 + + gio/tests/application.c | 134 +++++ + gio/tests/testapp.c | 79 +++ + gio/tests/testapps.c | 533 ++++++++++++++++++ + 21 files changed, 2626 insertions(+), 17 deletions(-) + +commit af78f6d418788fa76a2c78298896f9c656d8eb85 +Author: Ryan Lortie +Date: Mon Jun 7 12:58:57 2010 +0200 + + Bug 620767 - Typo in GSettings documentation + + Use the correct variable name and work around the escaping of '@'. + Expand/clarify the section on how translation of is handled. + + docs/reference/gio/migrating-gconf.xml | 25 ++++++++++++++++++++----- + 1 files changed, 20 insertions(+), 5 deletions(-) + +commit 486c46b9459f7b28528d9144296da9e4a32023d3 +Author: Matthias Clasen +Date: Mon Jun 7 06:23:24 2010 -0400 + + Include the right header + + docs/reference/gio/migrating-gconf.xml | 2 +- + gio/tests/gsettings.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 71c5e3f899bf15c9dee09b36f146c5e72652d72b +Author: Ryan Lortie +Date: Mon Jun 7 10:18:43 2010 +0200 + + Bug 620496 - schema compiler: reject invalid paths + + The GSettings schema compiler was accepting any string as a path. + It is + probably quite a common mistake to suspect that '/apps/foo' is a valid + path name when this will cause all sorts of trouble later. Check for + this case and report the error. + + gio/gschema-compile.c | 16 ++++++++++++++-- + gio/tests/gschema-compile.c | 1 + + gio/tests/schema-tests/invalid-path.gschema.xml | 3 +++ + 3 files changed, 18 insertions(+), 2 deletions(-) + +commit a0c044b5c65500080c15e2c5e315bf87487e63b7 +Author: Matthias Clasen +Date: Sun Jun 6 16:42:06 2010 -0400 + + Make g_assertion_message_error take a const GError* + + This was requested in bug 620265. + + glib/gtestutils.c | 2 +- + glib/gtestutils.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 87ee5f36413ba421c58bd4e5cbf1d11a681c2abe +Author: Christian Persch +Date: Sun Jun 6 16:32:04 2010 -0400 + + Don't do an extra strlen when g_variant_get_string() returns it + already + + gio/gdbusmessage.c | 12 ++++-------- + 1 files changed, 4 insertions(+), 8 deletions(-) + +commit 2aca3b506a2405927a621bb37447dc96b2aa6174 +Author: Matthias Clasen +Date: Sun Jun 6 16:20:21 2010 -0400 + + Add single-include guards to new headers + + As pointed out by Christian Persch in bug 620173, all the new + gdbus and gsettings headers were missing these. + + gio/gcredentials.h | 4 ++++ + gio/gdbusaddress.h | 4 ++++ + gio/gdbusauthobserver.h | 4 ++++ + gio/gdbusconnection.h | 4 ++++ + gio/gdbuserror.h | 4 ++++ + gio/gdbusintrospection.h | 4 ++++ + gio/gdbusmessage.h | 4 ++++ + gio/gdbusmethodinvocation.h | 4 ++++ + gio/gdbusnameowning.h | 4 ++++ + gio/gdbusnamewatching.h | 4 ++++ + gio/gdbusproxy.h | 4 ++++ + gio/gdbusproxywatching.h | 4 ++++ + gio/gdbusserver.h | 4 ++++ + gio/gdbusutils.h | 4 ++++ + gio/gsettings.h | 4 ++++ + 15 files changed, 60 insertions(+), 0 deletions(-) + +commit 9371ca0cc27573174dfc0419e121f8ac718fe061 +Author: Matthias Clasen +Date: Sun Jun 6 16:15:44 2010 -0400 + + Sort gio.h includes alphabetically + + gio/gio.h | 49 +++++++++++++++++++++++++------------------------ + 1 files changed, 25 insertions(+), 24 deletions(-) + +commit 3944a63fed37e86515178c362b478eafd80199c0 +Author: Michael Natterer +Date: Sun Jun 6 21:15:42 2010 +0200 + + gio: fix the build + + gio/gpermission.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 92fab483875c2d78ae2cb4749ae283cd26afa451 +Author: Matthias Clasen +Date: Sun Jun 6 14:22:48 2010 -0400 + + Some cleanups + + Always include config.h, make property strings for translation, + add since tags. + + gio/gpermission.c | 49 + +++++++++++++++++++++++++++++++++++++--------- + gio/gsimplepermission.c | 6 ++++- + po/POTFILES.in | 1 + + 3 files changed, 45 insertions(+), 11 deletions(-) + +commit 40e10764b343b7cdcf270107d9a5b56e8fa142ec +Author: Will Thompson +Date: Thu Jun 3 15:09:09 2010 +0100 + + Add some symbols to glib-sections.txt + + Most of these are private; the few that aren't were already documented + but not included in the gtkdoc output. + + docs/reference/glib/glib-sections.txt | 12 ++++++++++++ + docs/reference/glib/tmpl/main.sgml | 27 +++++++++++++++++++++++++++ + 2 files changed, 39 insertions(+), 0 deletions(-) + +commit f291d3bb3ce1245981363395ac576d74e918cb0a +Author: Will Thompson +Date: Thu Jun 3 15:08:58 2010 +0100 + + Document G_GNUC_DEPRECATED_FOR + + docs/reference/glib/glib-sections.txt | 1 + + docs/reference/glib/tmpl/macros_misc.sgml | 13 +++++++++++++ + 2 files changed, 14 insertions(+), 0 deletions(-) + +commit 157116b8dd58429335a16c4d0d2c8ee4ef287302 +Author: Will Thompson +Date: Thu Jun 3 14:50:19 2010 +0100 + + Add examples for G_STRINGIFY and G_PASTE + + docs/reference/glib/tmpl/macros_misc.sgml | 37 + ++++++++++++++++++++++++++-- + 1 files changed, 34 insertions(+), 3 deletions(-) + +commit 28f9f03a3b7dc015ff1b0c6865a952e2ee0f17f3 +Author: Will Thompson +Date: Thu Jun 3 14:43:30 2010 +0100 + + Hide G_PASTE_ARGS in gtkdocs. + + docs/reference/glib/glib-sections.txt | 2 +- + docs/reference/glib/tmpl/macros_misc.sgml | 9 --------- + 2 files changed, 1 insertions(+), 10 deletions(-) + +commit a131beda54a15b071b6571b12f2f2ad8cb342c04 +Author: Javier Jardón +Date: Sun Jun 6 05:25:59 2010 +0200 + + [docs] Improve the g_get_system_config_dirs() docs. + + The retrieved list of directories is XDG_CONFIG_DIRS, + Also mention the retrieved directory on Windows: CSIDL_COMMON_APPDATA + + glib/gutils.c | 12 ++++++++++-- + 1 files changed, 10 insertions(+), 2 deletions(-) + +commit e08c7b86c43f3eb8c230355be5fa92b504e3fff9 +Author: Javier Jardón +Date: Sun Jun 6 05:13:06 2010 +0200 + + [docs] Improve the g_get_system_data_dirs() docs. + + The retrieved list of directories is XDG_DATA_DIRS + + glib/gutils.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 07777db60d82c8f81feb407ec453f244ba10787c +Author: Javier Jardón +Date: Sun Jun 6 05:05:15 2010 +0200 + + [docs] Improve the g_get_user_cache_dir() docs + + The retrieved directory is XDG_CACHE_HOME on UNIX platforms. + Also mention the retrieved directory on Windows: CSIDL_INTERNET_CACHE. + + glib/gutils.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit e40b5ae3ef6a637f1469557b8d7be94a9cf59f6e +Author: Javier Jardón +Date: Sun Jun 6 04:57:46 2010 +0200 + + [docs] Improve the g_get_user_data_dir() docs + + The retrieved directory is XDG_DATA_HOME on UNIX platforms. + Also mention the retrieved directory on Windows: CSIDL_PERSONAL. + + glib/gutils.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +commit b2718ee71ad85f2536e5e127239a5a438648de0c +Author: Javier Jardón +Date: Sat Jun 5 18:34:38 2010 +0200 + + [docs] Improve the g_get_user_config_dir() docs a bit + + The retrieved directory is XDG_CONFIG_HOME on UNIX platforms. + Also mention the retrieved directory on Windows: CSIDL_APPDATA. + + glib/gutils.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit 61f3f45cb95f022d99689e0fee9b0cb97c5112a3 +Author: Ryan Lortie +Date: Fri Jun 4 23:07:40 2010 +0200 + + add get_permission API to GSettingsBackend + + implement it in the various in-tree backends + + also, lots of whitespace changes to realign the vtable members + + gio/gdelayedsettingsbackend.c | 11 ++++++ + gio/gkeyfilesettingsbackend.c | 9 +++++ + gio/gmemorysettingsbackend.c | 9 +++++ + gio/gnullsettingsbackend.c | 11 ++++++- + gio/gsettingsbackend.c | 25 ++++++++++++++ + gio/gsettingsbackend.h | 69 + +++++++++++++++++++++------------------- + gio/gsettingsbackendinternal.h | 3 ++ + 7 files changed, 103 insertions(+), 34 deletions(-) + +commit 95c564cabe2837be56f2cf3901a4d6d9d84ab6c9 +Author: Ryan Lortie +Date: Fri Jun 4 23:02:44 2010 +0200 + + gsettingsbackend.h: pretend to be gio.h + + Since #include is a perfectly valid thing for + applications to do, and since we want to include gio headers from + gsettingsbackend.h, we need to effectively disable the #error we would + get from those headers (because we're not coming via gio.h). + + We don't want to #include here because this would cause + needless rebuilding of GSettingsBackend, GSettings, + GDelayedSettingsBackend, etc... every time someone changed anything in + any public header. + + gio/gsettingsbackend.h | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 473348817809f7aed492245469092901d28de91d +Author: Ryan Lortie +Date: Fri Jun 4 22:32:01 2010 +0200 + + Bug 620582 - a simple GPermission implementation + + add GSimplePermission, a trivial const implementation of GPermission + + can-request and can-release are always false for this implementation + and + the value of 'allowed' is decided at construction. + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 8 +++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.symbols | 7 +++ + gio/giotypes.h | 1 + + gio/gsimplepermission.c | 84 + +++++++++++++++++++++++++++++++++++ + gio/gsimplepermission.h | 45 +++++++++++++++++++ + 8 files changed, 149 insertions(+), 0 deletions(-) + +commit 0957f76878046d848ea42bab09d9b129a60476a5 +Author: Matej Urbančič +Date: Fri Jun 4 20:03:41 2010 +0200 + + Updated Slovenian translation + + po/sl.po | 1979 + +++++++++++++++++++++++++++++++++----------------------------- + 1 files changed, 1039 insertions(+), 940 deletions(-) + +commit 7a4860d69ad7b6daf6cce0063cbc52070d21bd7b +Author: Ryan Lortie +Date: Thu Jun 3 22:58:52 2010 +0200 + + Bug 620519 - GPermission + + Add an abstract interface representing the permission to perform an + action. + + docs/reference/gio/gio-docs.xml | 4 + + docs/reference/gio/gio-sections.txt | 21 ++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/gio.symbols | 16 ++ + gio/giotypes.h | 1 + + gio/gpermission.c | 390 + +++++++++++++++++++++++++++++++++++ + gio/gpermission.h | 118 +++++++++++ + 9 files changed, 554 insertions(+), 0 deletions(-) + +commit 07b5cee2a8273d7fdd20371b5494ecd320c3cd1c +Author: Murray Cumming +Date: Fri Jun 4 17:07:05 2010 +0200 + + Gio: gioenums.h: Remove trailing commas to avoid C++ warnings. + + gio/gioenums.h | 22 +++++++++++----------- + 1 files changed, 11 insertions(+), 11 deletions(-) + +commit af3f4cbe77584acabf289f4c3f9beccd6bfcfd21 +Author: Javier Jardón +Date: Sun May 30 14:56:55 2010 +0200 + + gdbusaddress: Fix typo + + gio/gdbusaddress.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 644584e7e6bcff65e5bd819a4756dc7597526961 +Author: Kristjan Schmidt +Date: Thu Jun 3 18:19:31 2010 +0200 + + Updated Esperanto translation + + po/eo.po | 1661 + +++++++++++++++++--------------------------------------------- + 1 files changed, 437 insertions(+), 1224 deletions(-) + +commit e608b1f067c76db196a63723b50167a00ab39921 +Author: Matthias Clasen +Date: Thu Jun 3 11:40:02 2010 -0400 + + Don't spew a g_warning if inotify setup fails + + We use is_supported when we are trying to find a local file monitor + implementation that works, and having the g_warning in there trips + the test suite. + + gio/inotify/inotify-helper.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 9562726f35b3e19d5d50d4e2e01bd8c37c7727ab +Author: Ryan Lortie +Date: Thu Jun 3 11:24:31 2010 +0200 + + Bug 620350 - add g_variant_builder_add_parsed() + + A delicious blend of g_variant_new_parsed() and + g_variant_builder_add_value(). Now available in a GLib near you. + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gvariant-parser.c | 44 + +++++++++++++++++++++++++++++++++ + glib/gvariant.h | 3 ++ + 4 files changed, 49 insertions(+), 0 deletions(-) + +commit 44db2b6b7447680fa3f8d3bce6f2bda26a6b498e +Author: Ryan Lortie +Date: Thu Jun 3 09:41:33 2010 +0200 + + Bug 620349 – utf8ify GVariant printer + + Take advantage of our knowledge that GVariant strings are always valid + utf8 when printing and parsing: + + - allow valid printing unicode characters to pass through unescaped + + - escape non-printing characters using \uxxxx or \Uxxxxxxxx format + + - do the same in the parser + + - update existing test cases to use utf8, add a new test case + + glib/gvariant-parser.c | 64 + +++++++++++++++++++++++++++++++++++++--------- + glib/gvariant.c | 65 + ++++++++++++++++++++++++++++++++++++++++++----- + glib/tests/gvariant.c | 26 +++++++++++++++++-- + 3 files changed, 132 insertions(+), 23 deletions(-) + +commit 36826661401f1912eef8c710609f4bd6454720ad +Author: Milan Bouchet-Valat +Date: Wed Jun 2 16:05:13 2010 +0200 + + Annotate GVariant and GSettings _strv() functions + + Add GObject introspection annotations so that the length parameter is + correctly detected for g_variant_new_strv(), g_variant_get_strv() and + g_variant_dup_strv(). Also specify that it can be a NULL pointer in + g_variant_get_strv() and g_variant_dup_strv(). + + For g_settings_set_strv(), detect that a NULL value is allowed, + meaning + empty array. + + Closes bug #620384. + + Signed-off-by: Ryan Lortie + + gio/gsettings.c | 2 +- + glib/gvariant.c | 10 +++++----- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit 0e691f27ecfe1d7f86214f16c00f91fc55f95e9c +Author: Ryan Lortie +Date: Wed Jun 2 19:34:45 2010 +0200 + + improve gitignore (systemtap) + + .gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 20ab1e667308741de01fa9d1afc106dcd8b313d9 +Author: Kjartan Maraas +Date: Wed Jun 2 15:41:01 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 1305 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 659 insertions(+), 646 deletions(-) + +commit b5c8496b4c06fc7be5672e29a771064d3247d0cc +Author: Ryan Lortie +Date: Wed Jun 2 04:00:58 2010 +0200 + + Support NULL value for g_settings_set_strv() + + Allow easy setting of the empty array that we lost with the last + patch. + + gio/gsettings.c | 14 +++++++++++--- + 1 files changed, 11 insertions(+), 3 deletions(-) + +commit bf9edb5cd5a75a4bc9946f0ef106c3d541fdb89f +Author: Milan Bouchet-Valat +Date: Tue Jun 1 23:16:19 2010 +0200 + + Remove length parameter for g_settings_[gs]et_strv + + Length of the array is redundant since it's NULL-terminated. This + is not + consistent with many GLib and GTK+ functions, and adds complexity with + no real gain, while these convenience functions should be kept simple. + + Closes bug #620312 + + gio/gsettings.c | 12 ++++-------- + gio/gsettings.h | 6 ++---- + 2 files changed, 6 insertions(+), 12 deletions(-) + +commit dc7b1c5b42175cd3e52b57c427545d6c4d9b1cee +Author: Jorge González +Date: Sun May 30 18:23:21 2010 +0200 + + Updated Spanish translation + + po/es.po | 19 ++++++++----------- + 1 files changed, 8 insertions(+), 11 deletions(-) + +commit 7d04f0a915f290b47382d8f2cc989cb6de91e781 +Author: Fran Diéguez +Date: Sun May 30 17:43:57 2010 +0200 + + Updated Galician translations + + po/gl.po | 83 + ++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 41 insertions(+), 42 deletions(-) + +commit 1afaeb9976334ebdcba53ab258aa3922a872bfb9 +Author: Andika Triwidada +Date: Sun May 30 17:10:51 2010 +0700 + + Updated Indonesian translation + + po/id.po | 1590 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 826 insertions(+), 764 deletions(-) + +commit be94532e634772115e5fabefb69c803a5c5e4672 +Author: Jorge González +Date: Sat May 29 12:06:16 2010 +0200 + + Updated Spanish translation + + po/es.po | 69 + ++++++++++++++++++++++++++++--------------------------------- + 1 files changed, 32 insertions(+), 37 deletions(-) + +commit b208c2d75654ee3cf6cadf0a796976426c7b3df0 +Author: Jorge González +Date: Fri May 28 20:21:02 2010 +0200 + + Updated Spanish translation + + po/es.po | 16 +++++++++------- + 1 files changed, 9 insertions(+), 7 deletions(-) + +commit e7c1aaf9259b64bc40d2851df9b988627e783421 +Author: Jorge González +Date: Fri May 28 19:45:51 2010 +0200 + + Updated Spanish translation + + po/es.po | 28 ++++++++++++++-------------- + 1 files changed, 14 insertions(+), 14 deletions(-) + +commit 5451cd0804f196f30a8cc58eee029c8b4acc54e0 +Author: Yaron Shahrabani +Date: Fri May 28 16:57:56 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 18 +++++++++--------- + 1 files changed, 9 insertions(+), 9 deletions(-) + +commit ecc5fbb479e529d17885e3b746f78c05758c1bb0 +Author: Yaron Shahrabani +Date: Fri May 28 16:54:58 2010 +0300 + + Updated Hebrew translation. + + po/he.po | 356 + +++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 200 insertions(+), 156 deletions(-) + +commit c874a76a8bf4f3b31e480a9184983cd5e85aeb4c +Author: Lin Ma +Date: Fri May 28 16:57:10 2010 +0800 + + After talk with FEN dev, we dicide simply disable monitor function if + the current filesystem doesn't suport FEN. + + gio/fen/fen-kernel.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 8e41be13efe06a0bbd89beefc6e7ae7279b56834 +Author: Alexander Larsson +Date: Fri Jan 1 21:39:52 2010 +0100 + + Add dtrace and systemtap support for gobject + + This adds static markers and systemtap tapsets for: + + * type creation + * object lifetimes (creation, ref, unref, dispose, finalize) + * signal creation and emission + + Signal emissions and finalization marker have a corresponding + *_end (or *-end in dtrace) version that is when the corresponding + operation is finished. + + https://bugzilla.gnome.org/show_bug.cgi?id=606044 + + configure.in | 1 + + gobject/Makefile.am | 22 +++++ + gobject/gobject.c | 28 +++++-- + gobject/gobject.stp.in | 199 + ++++++++++++++++++++++++++++++++++++++++++++++ + gobject/gobject_probes.d | 13 +++ + gobject/gobject_trace.h | 43 ++++++++++ + gobject/gsignal.c | 11 ++- + gobject/gtype.c | 9 ++- + 8 files changed, 316 insertions(+), 10 deletions(-) + +commit bef9efd0a99a9a3bd6a2d713423edc37d6a38f21 +Author: Alexander Larsson +Date: Fri Dec 18 21:25:47 2009 +0100 + + Initial support for dtrace and systemtap + + This adds static markers for dtrace, which are also usable + by systemtap. Additionally it adds a tapset for systemtap + that makes it easier to use the static markers. + + These are enabled by default. + + This initial set of probes is rather limited: + + * allocation and free using g_malloc & co + * allocation and free using g_slice + * gquark name tracking (useful for converting quarks to strings + in probes) + + Notes on naming: + + Its traditional with dtrace to use probe names with dashes as + delimiter (slice-alloc). Since dashes are not usable in identifiers + the C code uses double underscores (slice__alloc) which is converted + to dashes in the UI. We follow this for the shared lowlevel probe + names. + + Additionally dtrace supports putting a "provider" part in the probe + names which is essentially a namespacing thing. On systemtap this + field is currently ignored (but may be implemented in the future), but + this is not really a problem since in systemtap the probes are + specified by combining the solib file and the marker name, so there + can't really be name conflicts. + + For the systemtap tapset highlevel probes we instead use names that + are systemtapish with single dashes as separators. + + https://bugzilla.gnome.org/show_bug.cgi?id=606044 + + configure.in | 53 +++++++++++++++++++++++ + docs/reference/glib/building.sgml | 42 ++++++++++++++++++ + docs/reference/glib/running.sgml | 13 ++++++ + glib/Makefile.am | 23 ++++++++++ + glib/gdataset.c | 6 ++- + glib/glib.stp.in | 84 + +++++++++++++++++++++++++++++++++++++ + glib/glib_probes.d | 8 ++++ + glib/glib_trace.h | 43 +++++++++++++++++++ + glib/gmem.c | 52 ++++++++++++++++++----- + glib/gslice.c | 5 ++ + 10 files changed, 317 insertions(+), 12 deletions(-) + +commit c3bc0f4f8fc5125a732f383671ee5bff939423d2 +Author: Mikhail Zabaluev +Date: Thu May 27 14:00:12 2010 -0400 + + Optimized the overlong sequence check in g_utf8_get_char_extended() + + Rather make it branch to get the due sequence length for the resulting + character code, we can as well get the minimum code value in the + initial + branching. + + glib/gutf8.c | 26 +++++++++++++++++--------- + 1 files changed, 17 insertions(+), 9 deletions(-) + +commit 30a856294613ab1119c0972b35bac5bbf3294692 +Author: Ryan Lortie +Date: Thu May 27 13:11:49 2010 -0400 + + GSettings schema docs: mention need for EXTRA_DIST + + Mention that you will need to use EXTRA_DIST for your schema file + if it + is distributed with your project. + + docs/reference/gio/migrating-gconf.xml | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit f2687f588e3a2b338242d73b6898eb93689b264b +Author: Ryan Lortie +Date: Thu May 27 13:07:54 2010 -0400 + + Remove duplicate copies of migration docs + + Fixup for commit 133f66538dbf266be3c99b34f1eeee0a5e6068ac which + duplicated the contents of most of the migration documentation by + splitting it out into separate files but keeping the original file + intact (with a rename). + + This removes the duplicated content from the renamed file. + + docs/reference/gio/migrating-posix.xml | 554 + -------------------------------- + 1 files changed, 0 insertions(+), 554 deletions(-) + +commit b3593693d918f0ae97094f6712d817180b8eea6a +Author: Ryan Lortie +Date: Thu May 27 11:58:54 2010 -0400 + + gsettings m4: check for .xml in src/builddir + + This checks for the .gschema.xml file in the srcdir and builddir and + runs the schema validation on which one it finds. This handles + non-srcdir builds in both cases: .gschema.xml is in the tarball and + .gschema.xml is generated. + + m4macros/gsettings.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e7927faf1792ad4c3c8a5b599240a7ee94b1a0cc +Author: Ryan Lortie +Date: Thu May 27 11:32:34 2010 -0400 + + GVariant: One more FreeBSD fix + + FreeBSD's malloc() sometimes returns unaligned memory if you are + requesting small sizes. This can get GVariant into trouble. For + example, consider the type "mmi" containing the value "just nothing". + According to the type signature, the memory containing this should be + aligned to a boundary of 4 since it might contain an int. The + serialised size of this value is 1 byte, however, and when you ask + FreeBSD to allocate memory of that size, it knows you can't put an int + into it so it doesn't bother aligning it. + + This patch modifies the GVariant serialiser to not assert the + alignment + constraint in the case that the size of the serialised data is smaller + than its own alignment requirement. + + glib/gvariant-serialiser.c | 12 +++++++++++- + 1 files changed, 11 insertions(+), 1 deletions(-) + +commit 271997deb56cc17af5fa7b59b3a67f4ee347be6c +Author: Ryan Lortie +Date: Wed May 26 23:34:31 2010 -0400 + + More alignment-related fixes. + + Partial-backout 8a21d8d23317ecebe46007f1fd5f7459bf182415. The + assertions should have remained relaxed since these functions are used + with non-posix_memalign()ed data. + + glib/tests/gvariant.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 866e3dda60d7de45ae7f6c962a0bb4167abd8147 +Author: Lin Ma +Date: Thu May 27 10:24:58 2010 +0800 + + Remove unused code. + + gio/fen/fen-node.c | 13 ------------- + 1 files changed, 0 insertions(+), 13 deletions(-) + +commit 91ec834456b419c0270072d52d28b365aa160dfb +Author: Ryan Lortie +Date: Wed May 26 17:35:18 2010 -0400 + + include "config.h" for HAVE_POSIX_MEMALIGN + + glib/tests/gvariant.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 8a21d8d23317ecebe46007f1fd5f7459bf182415 +Author: Ryan Lortie +Date: Wed May 26 17:31:52 2010 -0400 + + Use aligned memory in GVariant test cases. + + The GVariant serialiser works well with non-8-aligned memory, but the + comparison serialiser in the test case depends on memory being + 8-aligned. Use posix_memalign() to get the memory used by this + serialiser. + + glib/tests/gvariant.c | 47 + ++++++++++++++++++++++++++++++++++++----------- + 1 files changed, 36 insertions(+), 11 deletions(-) + +commit 183102104a3762bab4c50fc54cd11979ca085859 +Author: Colin Walters +Date: Wed May 26 16:21:15 2010 -0400 + + [mainloop-test] Fix compilation errors + + tests/mainloop-test.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit ba1163a33cdfb7f67cbd311ae2b74ae40831cd05 +Author: Colin Walters +Date: Wed May 26 15:59:36 2010 -0400 + + [tests/gvariant] Handle flavored_free(NULL), since flavored_malloc + can return NULL + + glib/tests/gvariant.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 88a1e6c1021644f9ae42c558b23e3c6a1e4055a6 +Author: Jorge González +Date: Wed May 26 18:12:22 2010 +0200 + + Updated Spanish translation + + po/es.po | 389 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 201 insertions(+), 188 deletions(-) + +commit 39123880387b19f034ae0bed9492d5a1b4f026ab +Author: Jorge González +Date: Wed May 26 18:09:46 2010 +0200 + + Updated Spanish translation + + po/es.po | 1361 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 696 insertions(+), 665 deletions(-) + +commit 798eed43a2ee756b32651559f95ce55f0a448e7b +Author: Lin Ma +Date: Wed May 26 14:32:37 2010 +0800 + + bugster#6955199, on hsfs portfs will fail, and FEN backend will fail + to run lstat and port_associate on root node. + + gio/fen/fen-node.c | 21 ++++++++++++++++++--- + 1 files changed, 18 insertions(+), 3 deletions(-) + +commit 6b53e4826fba3827ac7273a344b46f854ee81d0b +Author: Havoc Pennington +Date: Tue Apr 20 17:47:44 2010 -0400 + + GSource: add g_source_set_name, g_source_get_name, + g_source_set_name_by_id + + These allow applications to give meaningful names to their sources. + Source names can then be used for debugging and profiling, for + example with systemtap or gdb. + + https://bugzilla.gnome.org/show_bug.cgi?id=606044 + + glib/gmain.c | 5 ++++- + tests/mainloop-test.c | 6 +++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +commit e5696c282e2c48ac0f822c4e6d33c8507a77e998 +Author: Havoc Pennington +Date: Tue Apr 20 17:47:44 2010 -0400 + + GSource: add g_source_set_name, g_source_get_name, + g_source_set_name_by_id + + These allow applications to give meaningful names to their sources. + Source names can then be used for debugging and profiling, for + example with systemtap or gdb. + + https://bugzilla.gnome.org/show_bug.cgi?id=606044 + + glib/glib.symbols | 3 ++ + glib/gmain.c | 83 + ++++++++++++++++++++++++++++++++++++++++++++++++++++- + glib/gmain.h | 9 +++++- + 3 files changed, 93 insertions(+), 2 deletions(-) + +commit eec66b2f9424dd6db25867ee0a32e0341def15b8 +Author: David Zeuthen +Date: Tue May 25 11:59:57 2010 -0400 + + GDBus: Big-endian fixes + + Tested this on my Powerbook G4 12", 867MHz PowerPC G4 running Fedora + 11ish. + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 8 ++++++-- + gio/tests/gdbus-threading.c | 2 +- + 2 files changed, 7 insertions(+), 3 deletions(-) + +commit a81c2f2c7ad260bc3033648bb274a3b321df8b49 +Author: Ryan Lortie +Date: Tue May 25 11:25:34 2010 -0400 + + GVariant: deal with non-8-aligned malloc() + + Closes bug #619585. + + glib/gvariant-serialiser.c | 18 +++++++++++ + glib/tests/gvariant.c | 72 + ++++++++++++++++++++++++++++---------------- + 2 files changed, 64 insertions(+), 26 deletions(-) + +commit 9e25ec592ba32797230650b2236935deb2022960 +Author: Matthias Clasen +Date: Tue May 25 10:43:29 2010 -0400 + + Document that vtable is not copied + + gio/gdbusconnection.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 857a40fafb98934c954649e712bc35633438ebcf +Author: Fran Diéguez +Date: Tue May 25 09:56:33 2010 +0200 + + Updated Galician translations + + po/gl.po | 1270 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 646 insertions(+), 624 deletions(-) + +commit 32c84552f6dfb05f990e8740a75c8b1fed753ea8 +Author: Ryan Lortie +Date: Mon May 24 23:21:01 2010 -0400 + + .gitignore manpages (*.1) + + docs/reference/.gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit dcd13e39be34ec4b396bab4dbaa976d2917cf7b5 +Author: Ryan Lortie +Date: Mon May 24 23:03:36 2010 -0400 + + post-release version bump. + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2db2d13fdbfe80d89cb4d5fecfa13619909f4ac5 +Author: Ryan Lortie +Date: Mon May 24 23:02:18 2010 -0400 + + Release 2.25.7. + + NEWS | 34 + + docs/reference/glib/tmpl/i18n.sgml | 11 + + po/af.po | 297 +++++---- + po/am.po | 293 +++++---- + po/ar.po | 297 +++++---- + po/as.po | 297 +++++---- + po/ast.po | 297 +++++---- + po/az.po | 293 +++++---- + po/be.po | 296 +++++---- + po/be@latin.po | 300 +++++---- + po/bg.po | 297 +++++---- + po/bn.po | 297 +++++---- + po/bn_IN.po | 297 +++++---- + po/bs.po | 293 +++++---- + po/ca.po | 297 +++++---- + po/ca@valencia.po | 297 +++++---- + po/cs.po | 297 +++++---- + po/cy.po | 297 +++++---- + po/da.po | 297 +++++---- + po/de.po | 297 +++++---- + po/dz.po | 293 +++++---- + po/el.po | 297 +++++---- + po/en@shaw.po | 297 +++++---- + po/en_CA.po | 297 +++++---- + po/en_GB.po | 297 +++++---- + po/eo.po | 293 +++++---- + po/es.po | 297 +++++---- + po/et.po | 672 ++++++++++++++++++- + po/eu.po | 297 +++++---- + po/fa.po | 293 +++++---- + po/fi.po | 297 +++++---- + po/fr.po | 297 +++++---- + po/ga.po | 297 +++++---- + po/gl.po | 1287 + ++++++++++++++++++------------------ + po/gu.po | 297 +++++---- + po/he.po | 297 +++++---- + po/hi.po | 297 +++++---- + po/hr.po | 293 +++++---- + po/hu.po | 297 +++++---- + po/hy.po | 293 +++++---- + po/id.po | 297 +++++---- + po/is.po | 293 +++++---- + po/it.po | 297 +++++---- + po/ja.po | 297 +++++---- + po/ka.po | 293 +++++---- + po/kn.po | 297 +++++---- + po/ko.po | 297 +++++---- + po/ku.po | 293 +++++---- + po/lt.po | 297 +++++---- + po/lv.po | 293 +++++---- + po/mai.po | 297 +++++---- + po/mg.po | 293 +++++---- + po/mk.po | 297 +++++---- + po/ml.po | 297 +++++---- + po/mn.po | 293 +++++---- + po/mr.po | 297 +++++---- + po/ms.po | 293 +++++---- + po/nb.po | 1274 + ++++++++++++++++++------------------ + po/nds.po | 297 +++++---- + po/ne.po | 293 +++++---- + po/nl.po | 297 +++++---- + po/nn.po | 297 +++++---- + po/oc.po | 293 +++++---- + po/or.po | 297 +++++---- + po/pa.po | 297 +++++---- + po/pl.po | 297 +++++---- + po/ps.po | 297 +++++---- + po/pt.po | 297 +++++---- + po/pt_BR.po | 297 +++++---- + po/ro.po | 297 +++++---- + po/ru.po | 297 +++++---- + po/rw.po | 296 +++++---- + po/si.po | 293 +++++---- + po/sk.po | 297 +++++---- + po/sl.po | 297 +++++---- + po/sq.po | 311 +++++---- + po/sr.po | 297 +++++---- + po/sr@ije.po | 293 +++++---- + po/sr@latin.po | 297 +++++---- + po/sv.po | 297 +++++---- + po/ta.po | 297 +++++---- + po/te.po | 297 +++++---- + po/th.po | 297 +++++---- + po/tl.po | 293 +++++---- + po/tr.po | 297 +++++---- + po/tt.po | 293 +++++---- + po/uk.po | 297 +++++---- + po/vi.po | 297 +++++---- + po/wa.po | 293 +++++---- + po/xh.po | 293 +++++---- + po/yi.po | 293 +++++---- + po/zh_CN.po | 297 +++++---- + po/zh_HK.po | 297 +++++---- + po/zh_TW.po | 297 +++++---- + 94 files changed, 15547 insertions(+), 14083 deletions(-) + +commit 47e07f9f78e7fc9e4d7e8fb96420009560662519 +Author: Ryan Lortie +Date: Mon May 24 22:37:43 2010 -0400 + + another occurrence of the last fix (@XSLTPROC@) + + docs/reference/gobject/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b295e6a28a590ada8f8d3c3a50fb5250dd339eed +Author: Ryan Lortie +Date: Mon May 24 22:35:33 2010 -0400 + + man pages: fix broken @XSLTPROC@ substitution + + docs/reference/glib/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 84a0605342368c2edad99abd364791bf3b2ebc14 +Author: Ryan Lortie +Date: Mon May 24 22:20:47 2010 -0400 + + change GSettingsBackend.list() API + + gio/gsettingsbackend.c | 2 +- + gio/gsettingsbackend.h | 60 + ++++++++++++++++++++++++----------------------- + 2 files changed, 32 insertions(+), 30 deletions(-) + +commit 1b7f64549258c971fcc7c15ebfb532e4bc0b4174 +Author: Matthias Clasen +Date: Mon May 24 21:09:55 2010 -0400 + + Improve the g_file_make_symbolic_link docs + + Following a proposal by Neil Williams in bug 619527. + + gio/gfile.c | 17 +++++++++-------- + 1 files changed, 9 insertions(+), 8 deletions(-) + +commit 77b9a4646179daae04590ab1f62d575be93e1f89 +Author: Ryan Lortie +Date: Mon May 24 17:03:26 2010 -0400 + + GIO: Add g_d{,c}gettext to PLT check exceptions + + gio/pltcheck.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 3160bcad6a0cf3c1f1042b85f38492a5674324a3 +Author: Ryan Lortie +Date: Mon May 24 16:46:24 2010 -0400 + + GDBusConnection.call(): add 'reply_type' argument + + This allows the caller to specify the reply type that they are + expecting + for this call. If the reply comes back with the wrong type, + GDBus will + generate an appropriate error internally. + + - add a GVariantType * argument to g_dbus_connection_call() and + _call_sync(). + + - move the internal API for computing message types from + introspection + data to be based on GVariantType instead of strings. Update users + of this code. + + - have GDBusProxy pass this calculated GVariantType into + g_dbus_connection_call(). Remove the checks done in GDBusProxy. + + - Update other users of the code (test cases, gdbus-tool, GSettings + tool, etc). In some cases, remove redundant checks; in some other + cases, we are fixing bugs because no checking was done where it + should have been. + + Closes bug #619391. + + gio/gdbus-tool.c | 49 ++------- + gio/gdbusconnection.c | 236 + ++++++++++++++++++++++++++++------------ + gio/gdbusconnection.h | 2 + + gio/gdbusmethodinvocation.c | 28 ++--- + gio/gdbusnameowning.c | 2 + + gio/gdbusnamewatching.c | 2 + + gio/gdbusprivate.c | 30 +++-- + gio/gdbusprivate.h | 3 +- + gio/gdbusproxy.c | 78 ++++---------- + gio/gsettings-tool.c | 2 +- + gio/tests/gdbus-connection.c | 11 +- + gio/tests/gdbus-example-peer.c | 1 + + gio/tests/gdbus-export.c | 2 +- + gio/tests/gdbus-names.c | 2 + + gio/tests/gdbus-threading.c | 6 +- + 15 files changed, 246 insertions(+), 208 deletions(-) + +commit 100df5287d51fd005d64f2c06f4fe4276da1c4d8 +Author: Richard Hughes +Date: Mon May 24 17:22:38 2010 +0100 + + Fix up a typo in the g_variant_builder_add() docs + + glib/gvariant.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit a83a9a43ed2f461fea7a652470a3ef376aebd1f2 +Author: Tor Lillqvist +Date: Mon May 24 11:22:41 2010 +0300 + + Most of the gdbus test programs build only on Unix + + gio/tests/Makefile.am | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit d7b077dc84b22c4502e27252d32303d9985f9aeb +Author: Kjartan Maraas +Date: Sun May 23 16:27:17 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 1381 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 704 insertions(+), 677 deletions(-) + +commit b1bf5a5bb9725b1468ae82b636e35288fd3cf3ad +Author: Kjartan Maraas +Date: Sun May 23 16:27:08 2010 +0200 + + Add two missing files + + po/POTFILES.in | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 3caef4eef0c6ae946333633c1e27f4548a1ce42b +Author: Fran Diéguez +Date: Sun May 23 00:22:48 2010 +0200 + + Updated Galician translations + + po/gl.po | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 925a6f29114769d575ecdfbaaf5c236517edb98f +Author: Fran Diéguez +Date: Sun May 23 00:20:26 2010 +0200 + + Updated Galician translations + + po/gl.po | 64 + +++++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 41 insertions(+), 23 deletions(-) + +commit c17bb8f44514027c36825c1ca16ce67ae291c3ad +Author: Fran Diéguez +Date: Thu May 20 21:52:11 2010 +0200 + + Updated Galician translations + + po/gl.po | 290 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 148 insertions(+), 142 deletions(-) + +commit 8db946fdfb71167dd8b740b4ba20213303a0f2bf +Author: Matthias Clasen +Date: Fri May 21 22:28:42 2010 -0400 + + Clean up man page handling + + Remove all formatted man pages from git, and use the same + Makefile fragment in all doc dirs. + + docs/reference/glib/Makefile.am | 30 ++- + docs/reference/glib/glib-gettextize.1 | 71 ------- + docs/reference/glib/gtester-report.1 | 44 ----- + docs/reference/glib/gtester.1 | 101 ---------- + docs/reference/gobject/Makefile.am | 35 +++- + docs/reference/gobject/glib-genmarshal.1 | 307 + ------------------------------ + docs/reference/gobject/glib-mkenums.1 | 246 ------------------------ + docs/reference/gobject/gobject-query.1 | 83 -------- + gobject/Makefile.am | 2 - + gobject/glib-genmarshal.1 | 212 -------------------- + gobject/glib-mkenums.1 | 169 ---------------- + 11 files changed, 48 insertions(+), 1252 deletions(-) + +commit d818bebf4949617fdf5ffc7833c8f87ccca5c1a1 +Author: Ryan Lortie +Date: Fri May 21 20:08:49 2010 -0400 + + add .SECONDARY: rule to preserve generated schemas + + If the .gschema.xml file was generated as the result of an implicit + make + rule then make would 'rm' it after creating the validity stamp. This + would cause 'make install' to fail. + + m4macros/gsettings.m4 | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit bf24dff88eb3c794ae846cb7b8397510407ad9f5 +Author: David Zeuthen +Date: Fri May 21 12:09:27 2010 -0400 + + Return an error for calls into unknown interfaces or unknown objects + + Ryan pointed out on IRC that we didn't do anything here. Looking at + the code, it's painfully obvious that we should be returning an error + here since a comment already says that we've exhausted all possible + options. + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 10 +++++++++- + gio/tests/gdbus-export.c | 12 ++++++++++++ + 2 files changed, 21 insertions(+), 1 deletions(-) + +commit c7f0f2c4377c5fd242c52d30a09df74e6d6e9828 +Author: Christian Persch +Date: Fri May 14 14:00:24 2010 +0200 + + Use stack-allocated GVariantBuilders + + This saves a few allocations. + Also simplify the code a bit in gdbusconnection. + + Bug #618616. + + gio/gdbusconnection.c | 19 ++++++------------- + gio/gdbusmessage.c | 30 +++++++++++++++--------------- + 2 files changed, 21 insertions(+), 28 deletions(-) + +commit 41b3f6885d26908627c8a132f63aab4ba1d83582 +Author: Christian Persch +Date: Thu May 20 00:54:51 2010 +0200 + + Add g_dc[p]gettext, and use it in gsettings + + Avoid using LC_MESSAGES, and just call g_d[c]gettext directly. + + Bug #617004. + + docs/reference/glib/glib-sections.txt | 1 + + gio/gsettings.c | 7 ++----- + glib/glib.symbols | 1 + + glib/gstrfuncs.c | 27 +++++++++++++++++++++++++++ + glib/gstrfuncs.h | 4 +++- + po/Makefile.in.in | 2 ++ + 6 files changed, 36 insertions(+), 6 deletions(-) + +commit e8f723245a4b1667949dc9715bc5bc2f263317a4 +Author: Fran Diéguez +Date: Thu May 20 19:30:39 2010 +0200 + + Updated Galician translations + + po/gl.po | 1274 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 644 insertions(+), 630 deletions(-) + +commit 366b3ffcde4f19cabf8685efdc1ccd20dcade0ca +Author: David Zeuthen +Date: Thu May 20 10:51:00 2010 -0400 + + Bug 619142 – Build fixes + + - Fix various #include issues + + - Change #error to #warning for the EXTERNAL authentication + mechanism. + It is not clear if this should work on Win32 at all. + + - Call close() before unlink() for the SHA1 keyring + + - Change #error to #warning so we don't forget to do + permission checking of the .dbus-keyrings directory + + - Use Win32 SID for the SHA1 auth mech + + - Apparently we can't use word 'interface' as an identifier + + - Implement a _g_dbus_win32_get_user_sid() function. For now it's + private. Don't know if it should be public somewhere. Maybe in + a future GCredentials support for Win32? I don't know. + + - GFileDescriptorBased is not available on Win32. So avoid using + it in GLocalFile stuff. Now, Win32 still uses GLocalFile + friends + (which works with file descriptors) so expose a private function + to get the fd for an OutputStream so things still work. + + - Fixup gio.symbols + + - Fixup tests/gdbus-peer.c so it builds + + With this, at least things compile and the gdbus-peer.exe test case + passes. Which is a great start. I've tested this by cross-compiling on + a x86_64 Fedora 13 host using mingw32 and running the code on a 32-bit + Windows 7 box. + + https://bugzilla.gnome.org/show_bug.cgi?id=619142 + + Signed-off-by: David Zeuthen + + gio/gdbusaddress.c | 6 +++ + gio/gdbusauth.c | 8 ++- + gio/gdbusauthmechanismexternal.c | 4 +- + gio/gdbusauthmechanismsha1.c | 27 ++++++------- + gio/gdbusconnection.c | 2 + + gio/gdbusmessage.c | 20 +++++----- + gio/gdbusmessage.h | 4 +- + gio/gdbusprivate.c | 76 + ++++++++++++++++++++++++++++++++++++++ + gio/gdbusprivate.h | 4 ++ + gio/gdbusserver.c | 7 +++ + gio/gio.symbols | 12 +++++- + gio/glocalfileinputstream.c | 20 ++++++++- + gio/glocalfileiostream.c | 8 +++- + gio/glocalfileoutputstream.c | 30 ++++++++++++-- + gio/glocalfileoutputstream.h | 6 +++ + gio/tests/Makefile.am | 2 +- + gio/tests/gdbus-peer.c | 18 +++++++++ + 17 files changed, 208 insertions(+), 46 deletions(-) + +commit 152448cb299cd1b22da585dcd7e86ee6e27e1169 +Author: Ivar Smolin +Date: Thu May 20 14:56:46 2010 +0300 + + Estonian translation updated + + po/et.po | 704 + ++++---------------------------------------------------------- + 1 files changed, 41 insertions(+), 663 deletions(-) + +commit 3b8d0a4ac2df7d055168dff2ca360489adbea563 +Author: Javier Jardón +Date: Thu May 20 01:55:58 2010 +0200 + + Add G_TYPE_CLASS_GET_PRIVATE macro to docs + + docs/reference/gobject/gobject-sections.txt | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 2dfc7b0294542954539940955bef1b93a95513e0 +Author: Ryan Lortie +Date: Wed May 19 17:38:17 2010 -0400 + + Version bump. + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d4648965e4dee14955ade5eb94221ad5da5f45b8 +Author: Ryan Lortie +Date: Wed May 19 17:32:42 2010 -0400 + + Release 2.25.6 + + NEWS | 27 + + po/af.po | 633 ++++++++++++++++++++- + po/am.po | 631 ++++++++++++++++++++- + po/ar.po | 635 ++++++++++++++++++++- + po/as.po | 637 ++++++++++++++++++++- + po/ast.po | 637 ++++++++++++++++++++- + po/az.po | 632 ++++++++++++++++++++- + po/be.po | 652 +++++++++++++++++++++- + po/be@latin.po | 655 +++++++++++++++++++++- + po/bg.po | 637 ++++++++++++++++++++- + po/bn.po | 637 ++++++++++++++++++++- + po/bn_IN.po | 637 ++++++++++++++++++++- + po/bs.po | 632 ++++++++++++++++++++- + po/ca.po | 637 ++++++++++++++++++++- + po/ca@valencia.po | 637 ++++++++++++++++++++- + po/cs.po | 637 ++++++++++++++++++++- + po/cy.po | 634 ++++++++++++++++++++- + po/da.po | 639 ++++++++++++++++++++- + po/de.po | 637 ++++++++++++++++++++- + po/dz.po | 632 ++++++++++++++++++++- + po/el.po | 648 +++++++++++++++++++++- + po/en@shaw.po | 645 ++++++++++++++++++++- + po/en_CA.po | 635 ++++++++++++++++++++- + po/en_GB.po | 637 ++++++++++++++++++++- + po/eo.po | 631 ++++++++++++++++++++- + po/es.po | 1290 +++++++++++++++++++++---------------------- + po/et.po | 637 ++++++++++++++++++++- + po/eu.po | 637 ++++++++++++++++++++- + po/fa.po | 632 ++++++++++++++++++++- + po/fi.po | 637 ++++++++++++++++++++- + po/fr.po | 637 ++++++++++++++++++++- + po/ga.po | 633 ++++++++++++++++++++- + po/gl.po | 1249 +++++++++++++++++++++--------------------- + po/gu.po | 637 ++++++++++++++++++++- + po/he.po | 637 ++++++++++++++++++++- + po/hi.po | 637 ++++++++++++++++++++- + po/hr.po | 632 ++++++++++++++++++++- + po/hu.po | 637 ++++++++++++++++++++- + po/hy.po | 632 ++++++++++++++++++++- + po/id.po | 1608 + ++++++++++++++++++++++++++++++++++++----------------- + po/is.po | 632 ++++++++++++++++++++- + po/it.po | 641 ++++++++++++++++++++- + po/ja.po | 637 ++++++++++++++++++++- + po/ka.po | 633 ++++++++++++++++++++- + po/kn.po | 637 ++++++++++++++++++++- + po/ko.po | 637 ++++++++++++++++++++- + po/ku.po | 631 ++++++++++++++++++++- + po/lt.po | 637 ++++++++++++++++++++- + po/lv.po | 631 ++++++++++++++++++++- + po/mai.po | 634 ++++++++++++++++++++- + po/mg.po | 632 ++++++++++++++++++++- + po/mk.po | 635 ++++++++++++++++++++- + po/ml.po | 637 ++++++++++++++++++++- + po/mn.po | 632 ++++++++++++++++++++- + po/mr.po | 637 ++++++++++++++++++++- + po/ms.po | 632 ++++++++++++++++++++- + po/nb.po | 637 ++++++++++++++++++++- + po/nds.po | 632 ++++++++++++++++++++- + po/ne.po | 632 ++++++++++++++++++++- + po/nl.po | 646 ++++++++++++++++++++- + po/nn.po | 635 ++++++++++++++++++++- + po/oc.po | 631 ++++++++++++++++++++- + po/or.po | 637 ++++++++++++++++++++- + po/pa.po | 637 ++++++++++++++++++++- + po/pl.po | 637 ++++++++++++++++++++- + po/ps.po | 634 ++++++++++++++++++++- + po/pt.po | 637 ++++++++++++++++++++- + po/pt_BR.po | 637 ++++++++++++++++++++- + po/ro.po | 637 ++++++++++++++++++++- + po/ru.po | 637 ++++++++++++++++++++- + po/rw.po | 644 ++++++++++++++++++++- + po/si.po | 633 ++++++++++++++++++++- + po/sk.po | 632 ++++++++++++++++++++- + po/sl.po | 637 ++++++++++++++++++++- + po/sq.po | 669 +++++++++++++++++++++-- + po/sr.po | 637 ++++++++++++++++++++- + po/sr@ije.po | 632 ++++++++++++++++++++- + po/sr@latin.po | 637 ++++++++++++++++++++- + po/sv.po | 637 ++++++++++++++++++++- + po/ta.po | 637 ++++++++++++++++++++- + po/te.po | 637 ++++++++++++++++++++- + po/th.po | 637 ++++++++++++++++++++- + po/tl.po | 632 ++++++++++++++++++++- + po/tr.po | 637 ++++++++++++++++++++- + po/tt.po | 631 ++++++++++++++++++++- + po/uk.po | 637 ++++++++++++++++++++- + po/vi.po | 637 ++++++++++++++++++++- + po/wa.po | 632 ++++++++++++++++++++- + po/xh.po | 632 ++++++++++++++++++++- + po/yi.po | 631 ++++++++++++++++++++- + po/zh_CN.po | 637 ++++++++++++++++++++- + po/zh_HK.po | 637 ++++++++++++++++++++- + po/zh_TW.po | 637 ++++++++++++++++++++- + 93 files changed, 56499 insertions(+), 4314 deletions(-) + +commit caae8ac57a2d24a5de21d1ac6d6122897a418e72 +Author: Ryan Lortie +Date: Wed May 19 16:02:05 2010 -0400 + + Add --uninstall option to glib-compile-schemas + + If --uninstall is given then don't give an error if the schema + directory + is empty. Instead, erase the gschemas.compiled file, if it exists. + This is the right thing to do in the 'make uninstall' rule, where the + schema directory could very well be left empty as a result. + + Modify gsettings.m4 to use this option. + + gio/gschema-compile.c | 15 +++++++++++++-- + m4macros/gsettings.m4 | 2 +- + 2 files changed, 14 insertions(+), 3 deletions(-) + +commit b59a5551ecd448187d752d93a06c2298db121ace +Author: Ryan Lortie +Date: Tue May 18 18:28:39 2010 -0400 + + Bug 619038 - increase gsettings.m4 power + + handle schema checking, installation, uninstallation, cleaning + + docs/reference/gio/migrating-gconf.xml | 21 ++++----- + m4macros/gsettings.m4 | 71 + +++++++++++++++++++++++--------- + 2 files changed, 61 insertions(+), 31 deletions(-) + +commit 3e3779b7d0edbdfbea38655e353d0723a1b918d5 +Author: Tor Lillqvist +Date: Wed May 19 10:47:02 2010 +0300 + + Make config.h.win32.in match what configure produces + + No semantic changes. + + config.h.win32.in | 20 +++++++++++++++++--- + 1 files changed, 17 insertions(+), 3 deletions(-) + +commit 8eb377b6f6661022a1917b8cd465ed3e52fecf88 +Author: Ryan Lortie +Date: Tue May 18 18:24:04 2010 -0400 + + glib-compile-schemas rename missed in docs + + change a mention of gschema_compile in the docs + + docs/reference/gio/migrating-gconf.xml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 257c519ba2ed91f7dfc94d5a07a0cc6c7a3644f1 +Author: Javier Jardón +Date: Tue May 18 23:45:54 2010 +0200 + + Fix trivial typo in GCredentials code + + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=618839 + + gio/gcredentials.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 719e2dcb3b35dbab9cfaa7d0f711b0949b57ad35 +Author: Ryan Lortie +Date: Tue May 18 17:25:43 2010 -0400 + + Bug 619031 - method-calls-in-thread test failing + + The test was assuming that g_timeout_add() waited for at least the + amount of + time given to it before running the function. This is not the case + -- the + function can be run as much as 1ms early. Make the lower time + bound asserted + in the test more permissive to account for this. + + gio/tests/gdbus-threading.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit 6067f9f794954b8545776e14d059a7bb15d99e99 +Author: Ryan Lortie +Date: Tue May 18 16:43:36 2010 -0400 + + Bug 618839 - Typo at translation message + + Fix trivial typo in GCredentials code + + gio/gcredentials.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 12a8c0f50d72829af4cc436a455396bf5190b40e +Author: Ryan Lortie +Date: Tue May 18 16:13:58 2010 -0400 + + Add sync method to GSettingsBackend, and pad + + gio/gsettingsbackend.h | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 7fcf353325a41b75701688364a497d5790ea83a0 +Author: Ryan Lortie +Date: Tue May 18 13:43:42 2010 -0400 + + whitespace fix + + gio/gsettingsbackend.h | 56 + ++++++++++++++++++++++++------------------------ + 1 files changed, 28 insertions(+), 28 deletions(-) + +commit 587bdf3f0acfdc46e708214c5201336d81e3307c +Author: Robert Ancell +Date: Tue May 18 12:01:25 2010 +1000 + + Add missing gunixfdlist.h include in gdbus-example-server.c + + gio/tests/gdbus-example-server.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit a977f032358325c8ad558f675530569add68daaf +Author: David Zeuthen +Date: Mon May 17 19:51:49 2010 -0400 + + GDBus: Fix obvious crasher when looking up annotations + + Signed-off-by: David Zeuthen + + gio/gdbusintrospection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 74cafe871c42c21e7485ee7d80257ef987819979 +Author: Fran Diéguez +Date: Mon May 17 23:59:42 2010 +0200 + + Updated Galician translations + + po/gl.po | 629 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 607 insertions(+), 22 deletions(-) + +commit a621e0ed10eb8a7c5b89ee1d96ae877908e4d74b +Author: David Zeuthen +Date: Mon May 17 11:08:53 2010 -0400 + + gdbus(1): Don't fetch props if introspection data indicates none + are available + + Signed-off-by: David Zeuthen + + gio/gdbus-tool.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 98e4f7f6fbd1b8ac889327559a50e4369d064a74 +Author: David Zeuthen +Date: Mon May 17 11:07:53 2010 -0400 + + GDBus: Fix introspection of objects registered at / + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 799e0242ae31dd66b102342927583f1f34806c54 +Author: Ryan Lortie +Date: Sun May 16 16:56:36 2010 -0400 + + improve thread safety in GDelayedSettingsBackend + + - hold a lock while accessing the tree of delayed values + - use weak reference counts with the owner object to avoid doing + g_object_notify on a dead object + - dispatch the "has-unapplied" notify to the proper main context + + gio/gdelayedsettingsbackend.c | 128 + ++++++++++++++++++++++++++++++++++----- + gio/gdelayedsettingsbackend.h | 5 +- + gio/gsettings.c | 4 +- + gio/gsettingsbackend.c | 6 +- + gio/gsettingsbackendinternal.h | 2 + + 5 files changed, 121 insertions(+), 24 deletions(-) + +commit 61219e264083184eada5c5ef2795b7c531470704 +Author: Ryan Lortie +Date: Sun May 16 14:17:34 2010 -0400 + + GSettingsBackend: make signal dispatch threadsafe + + This commit fixes up a few race conditions in the GSettingsBackend, + mostly with + respect to change notifications occuring at the same time as the + last reference + count on a GSettings is dropped. With GDBus feeding us our incoming + signals in + a separate thread, this is something that could easily happen. + + gio/gdelayedsettingsbackend.c | 40 ++-- + gio/gsettings.c | 43 ++--- + gio/gsettingsbackend.c | 410 + ++++++++++++++++++++++++---------------- + gio/gsettingsbackendinternal.h | 26 ++-- + 4 files changed, 301 insertions(+), 218 deletions(-) + +commit 4967b6d2ab5a0a83609a825ea113bc75f61bfdb1 +Author: Ryan Lortie +Date: Sun May 16 18:14:46 2010 +0200 + + gitignore additions for gdbus, new test cases + + gio/.gitignore | 1 + + gio/tests/.gitignore | 23 ++++++++++++++++++++++- + glib/tests/.gitignore | 1 + + 3 files changed, 24 insertions(+), 1 deletions(-) + +commit 984258c662d3f571fcd0ea415923aec7a3746826 +Author: Ryan Lortie +Date: Sun May 16 13:02:23 2010 +0200 + + GSettings: support emitting signals in threads + + The thread-default context that was in effect at the time that the + GSettings was created will be used for emitting signals on that + GSettings. + + gio/gdelayedsettingsbackend.c | 2 +- + gio/gsettings.c | 18 +++++ + gio/gsettingsbackend.c | 139 + +++++++++++++++++++++++++++++++++++++++- + gio/gsettingsbackendinternal.h | 2 + + 4 files changed, 159 insertions(+), 2 deletions(-) + +commit 849684e540bb714bc60c2bce3a086e5ffb8933c0 +Author: Ryan Lortie +Date: Sun May 16 13:03:34 2010 +0200 + + GSettings tool: work-around GDBus issue + + There is currently no way (near as I can tell) to ensure that + a message + has been sent when using GDBus. If we exit() before we are sure, then + it is very possible that the message isn't sent at all. + This behaviour + was observed when using the GSettings commandline tool with dconf. + + A quick and dirty workaround for now. + + gio/gsettings-tool.c | 18 ++++++++++++++++++ + 1 files changed, 18 insertions(+), 0 deletions(-) + +commit 8e060adb2cecb7a801d54e3cbdb0c6eb12f56c12 +Author: Ryan Lortie +Date: Sun May 16 10:19:46 2010 +0200 + + intern a key name instead of using strdup() + + gio/gsettings.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit e5440f865d79795061cf5e64d8ed7300222c4a79 +Author: Lin Ma +Date: Mon May 17 14:42:52 2010 +0800 + + Reworked Solaris file event notification for GIO. See + https://defect.opensolaris.org/bz/show_bug.cgi?id=10194 + + Updated copyright. + + gio/fen/Makefile.am | 6 - + gio/fen/fen-data.c | 718 + ------------------------------------- + gio/fen/fen-data.h | 89 ----- + gio/fen/fen-dump.c | 43 +-- + gio/fen/fen-dump.h | 4 +- + gio/fen/fen-helper.c | 326 +++++------------ + gio/fen/fen-helper.h | 13 +- + gio/fen/fen-kernel.c | 775 + ++++++++++++++++++++-------------------- + gio/fen/fen-kernel.h | 35 +-- + gio/fen/fen-missing.c | 121 ------- + gio/fen/fen-missing.h | 38 -- + gio/fen/fen-node.c | 762 + ++++++++++++++++++++++++--------------- + gio/fen/fen-node.h | 97 ++++-- + gio/fen/fen-sub.c | 42 --- + gio/fen/fen-sub.h | 39 -- + gio/fen/gfendirectorymonitor.c | 95 +++--- + gio/fen/gfendirectorymonitor.h | 3 + + gio/fen/gfenfilemonitor.c | 32 +- + gio/fen/gfenfilemonitor.h | 3 + + 19 files changed, 1114 insertions(+), 2127 deletions(-) + +commit 794a4a8dbda6b63b15705d689c9785fc07ff7a40 +Author: Jorge González +Date: Mon May 17 07:41:48 2010 +0200 + + Updated Spanish translation + + po/es.po | 1648 + +++++++++++++++++++++++++++++++++++++++++++------------------- + 1 files changed, 1142 insertions(+), 506 deletions(-) + +commit 2ec41fad532c046b04b55e0a2b7883b344727c64 +Author: Matthias Clasen +Date: Sun May 16 13:07:25 2010 -0400 + + Add GDBus files to POTFILES.in + + po/POTFILES.in | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit d899c57a819685f2a9e66927f040cbdfea8ae572 +Author: Fran Diéguez +Date: Sun May 16 16:31:25 2010 +0200 + + Updated Galician translations + + po/gl.po | 1022 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 518 insertions(+), 504 deletions(-) + +commit b298c9430e197ca7f31ecfa0089f51e410bced36 +Author: Andika Triwidada +Date: Sun May 16 16:30:38 2010 +0700 + + Updated Indonesian translation + + po/id.po | 1966 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 945 insertions(+), 1021 deletions(-) + +commit 5d379f1c37ee8b5eb7020ebf7165290f5258045e +Author: Sebastian Dröge +Date: Sat May 15 10:17:35 2010 +0200 + + Fix gio tests linking with binutils gold linker + + gio/tests/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e6c08a458c6b6b6eb12b39593bc356dd2d215aec +Author: Sebastian Dröge +Date: Sat May 15 10:13:28 2010 +0200 + + Fix build of gdbus tool with binutils gold linker + + gio/Makefile.am | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 4b0fd52e52968723ee2a415f0d2fae965aa96867 +Author: Matthias Clasen +Date: Sat May 15 18:23:23 2010 -0400 + + Expand information about schema translation + + I have added some hints on how to use intltool for translation + of summary and description elements, taken from comments in bug + #618523. + + docs/reference/gio/migrating-gconf.xml | 14 ++++++++++++-- + 1 files changed, 12 insertions(+), 2 deletions(-) + +commit 2ad4b2d716220f0ef45bbeb56fb90a7438afa21a +Author: Matthias Clasen +Date: Sat May 15 18:15:30 2010 -0400 + + Fix build on !linux + + Don't define __USE_GNU, thats a glibc-internal macro, and + don't use SOL_SOCKET when not including sys/socket.h. + Maybe this file should be called glinuxcredentialsmessage.c... + + Bug #618730 + + gio/gunixcredentialsmessage.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 63d74caabe6f7b85ad13cad922fff239911fb5a0 +Author: Christian Persch +Date: Sat May 15 11:56:21 2010 +0200 + + Use the new option name + + It's --schema-file now, not --schema-files. + Bug #616864. + + m4macros/gsettings.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 50f422b5fd10fd4b709d2c5babce7fdc4987ff36 +Author: Matthias Clasen +Date: Fri May 14 22:30:19 2010 -0400 + + Bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5810cce252cc3d42377a0dca9a6d8c0a68eaf031 +Author: Matthias Clasen +Date: Fri May 14 22:28:46 2010 -0400 + + 2.25.5 + + po/af.po | 2 +- + po/am.po | 2 +- + po/ar.po | 2 +- + po/as.po | 2 +- + po/ast.po | 2 +- + po/az.po | 2 +- + po/be.po | 2 +- + po/be@latin.po | 2 +- + po/bg.po | 2 +- + po/bn.po | 2 +- + po/bn_IN.po | 2 +- + po/bs.po | 2 +- + po/ca.po | 2 +- + po/ca@valencia.po | 2 +- + po/cs.po | 2 +- + po/cy.po | 2 +- + po/da.po | 2 +- + po/de.po | 2 +- + po/dz.po | 2 +- + po/el.po | 2 +- + po/en@shaw.po | 2 +- + po/en_CA.po | 2 +- + po/en_GB.po | 2 +- + po/eo.po | 2 +- + po/es.po | 1009 + ++++++++++++++++++++++++++--------------------------- + po/et.po | 2 +- + po/eu.po | 2 +- + po/fa.po | 2 +- + po/fi.po | 2 +- + po/fr.po | 2 +- + po/ga.po | 2 +- + po/gl.po | 2 +- + po/gu.po | 2 +- + po/he.po | 2 +- + po/hi.po | 2 +- + po/hr.po | 2 +- + po/hu.po | 2 +- + po/hy.po | 2 +- + po/id.po | 2 +- + po/is.po | 2 +- + po/it.po | 2 +- + po/ja.po | 2 +- + po/ka.po | 2 +- + po/kn.po | 2 +- + po/ko.po | 2 +- + po/ku.po | 2 +- + po/lt.po | 2 +- + po/lv.po | 2 +- + po/mai.po | 2 +- + po/mg.po | 2 +- + po/mk.po | 2 +- + po/ml.po | 2 +- + po/mn.po | 2 +- + po/mr.po | 2 +- + po/ms.po | 2 +- + po/nb.po | 2 +- + po/nds.po | 2 +- + po/ne.po | 2 +- + po/nl.po | 2 +- + po/nn.po | 2 +- + po/oc.po | 2 +- + po/or.po | 2 +- + po/pa.po | 2 +- + po/pl.po | 2 +- + po/ps.po | 2 +- + po/pt.po | 2 +- + po/pt_BR.po | 2 +- + po/ro.po | 2 +- + po/ru.po | 2 +- + po/rw.po | 2 +- + po/si.po | 2 +- + po/sk.po | 2 +- + po/sl.po | 2 +- + po/sq.po | 2 +- + po/sr.po | 2 +- + po/sr@ije.po | 2 +- + po/sr@latin.po | 2 +- + po/sv.po | 2 +- + po/ta.po | 2 +- + po/te.po | 2 +- + po/th.po | 2 +- + po/tl.po | 2 +- + po/tr.po | 2 +- + po/tt.po | 2 +- + po/uk.po | 2 +- + po/vi.po | 2 +- + po/wa.po | 2 +- + po/xh.po | 2 +- + po/yi.po | 2 +- + po/zh_CN.po | 2 +- + po/zh_HK.po | 2 +- + po/zh_TW.po | 2 +- + 92 files changed, 589 insertions(+), 602 deletions(-) + +commit 34020f9dd4f497066ff79c0ab7cc534e21abc66b +Author: Matthias Clasen +Date: Fri May 14 22:03:03 2010 -0400 + + Updates + + NEWS | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +commit 2ed13de1533a1fafaac97be0fdc4154eb84ac35c +Author: Matthias Clasen +Date: Fri May 14 21:58:08 2010 -0400 + + Fix issues with GSETTINGS_CHECK_RULE + + Rename the --schema-files option to --schema-file, since it only + accepts one file at a time. Change the GSETTINGS_CHECK_RULE to + use it that way, too. And also make it work better with !srcdir + builds. + + Bugs #616731 and #616864 + + gio/gschema-compile.c | 2 +- + gio/tests/gschema-compile.c | 2 +- + m4macros/gsettings.m4 | 5 ++--- + 3 files changed, 4 insertions(+), 5 deletions(-) + +commit 763c1dab1f2c92526330425d77211b704668a3a3 +Author: David Zeuthen +Date: Fri May 14 21:08:01 2010 -0400 + + GDBus: Use specific variant type in GetAll() + + Without this fix, we segfault if the exported object returned an error + on all get_property() calls (in reality, this never happens). + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 4baf104f0a369348185a2e2c9fdebc1423ec7f8e +Author: David Zeuthen +Date: Fri May 14 20:52:15 2010 -0400 + + GDBus: Fix a double free + + Fix an unintentional double free introduced in commit + 4ad4c306c3b80620185cf975b402e17a6174aea9. + + This bug manifested itself when trying to complete this + + $ gdbus introspect --system --dest + + gio/gdbus-tool.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 661e5ea69f2d370af6e4e9c73242cf158414dd5d +Author: Christian Persch +Date: Fri May 14 20:07:15 2010 +0200 + + Plug mem leaks in gdbus tests & examples + + Use "&s" instead of "s", and free the variant iters after use. + + Bug #618663. + + gio/tests/gdbus-example-peer.c | 4 ++-- + gio/tests/gdbus-example-proxy-subclass.c | 12 +++--------- + gio/tests/gdbus-example-server.c | 2 +- + gio/tests/gdbus-example-subtree.c | 6 +++--- + gio/tests/gdbus-example-watch-proxy.c | 12 ++++-------- + gio/tests/gdbus-export.c | 8 +++----- + gio/tests/gdbus-introspection.c | 2 +- + gio/tests/gdbus-peer.c | 8 ++++---- + gio/tests/gdbus-proxy.c | 2 +- + 9 files changed, 22 insertions(+), 34 deletions(-) + +commit 60c53fef4788d4773704cb1affd2fb0f4d1d8830 +Author: Christian Persch +Date: Fri May 14 18:21:01 2010 +0200 + + Plug a mem leak in gdbusauth + + From valgrind running gdbus-peer test: + + ==20513== 32 bytes in 1 blocks are definitely lost in loss record + 1 of 15 + ==20513== at 0x4024E4C: realloc (vg_replace_malloc.c:429) + ==20513== by 0x4079BB1: g_realloc (gmem.c:174) + ==20513== by 0x4099472: g_string_maybe_expand (gstring.c:396) + ==20513== by 0x409A42A: g_string_insert_c (gstring.c:1050) + ==20513== by 0x42169AC: g_string_append_c_inline (gstring.h:153) + ==20513== by 0x421682C: _my_g_input_stream_read_line_safe + (gdbusauth.c:336) + ==20513== by 0x421843E: _g_dbus_auth_run_server (gdbusauth.c:1265) + ==20513== by 0x4222B94: initable_init (gdbusconnection.c:1783) + ==20513== by 0x41CF8D5: g_initable_init (ginitable.c:106) + ==20513== by 0x41CFA8D: g_initable_new_valist (ginitable.c:219) + ==20513== by 0x41CF920: g_initable_new (ginitable.c:139) + ==20513== by 0x4223479: g_dbus_connection_new_sync + (gdbusconnection.c:2046) + + Bug #618650. + + gio/gdbusauth.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 5bc9d43288d4991b9c3ef1fc38d231113b633ec7 +Author: Christian Persch +Date: Fri May 14 14:27:08 2010 +0200 + + Plug mem leak in g_dbus_address_get_stream_sync + + ==6279== 21,615 (4,708 direct, 16,907 indirect) bytes in 169 + blocks are + definitely lost in loss record 12 of 13 + ==6279== at 0x4024D2E: malloc (vg_replace_malloc.c:207) + ==6279== by 0x4079A90: g_malloc (gmem.c:135) + ==6279== by 0x4079DC8: g_malloc_n (gmem.c:252) + ==6279== by 0x4097E66: g_strsplit (gstrfuncs.c:2434) + ==6279== by 0x42169A2: g_dbus_address_get_stream_sync + (gdbusaddress.c:875) + + Bug #618622. + + gio/gdbusaddress.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit dc39825aa3b1556e57460df1cca0b764a5741a66 +Author: Christian Persch +Date: Fri May 14 14:22:45 2010 +0200 + + Plug a mem leak in get_uninitialized_connection + + Free the bus address after creating the singleton. + + ==26308== 39,736 (10,517 direct, 29,219 indirect) bytes in 388 blocks + are definitely lost in loss record 14 of 15 + ==26308== at 0x4024D2E: malloc (vg_replace_malloc.c:207) + ==26308== by 0x4079A90: g_malloc (gmem.c:135) + ==26308== by 0x4079DC8: g_malloc_n (gmem.c:252) + ==26308== by 0x4095607: g_strdup (gstrfuncs.c:102) + ==26308== by 0x4216B9A: g_dbus_address_get_for_bus_sync + (gdbusaddress.c:961) + ==26308== by 0x422A7AE: get_uninitialized_connection + (gdbusconnection.c:5241) + + Bug #618622. + + gio/gdbusconnection.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 5b2c7f10bd5a42d2956b53b13f3aabb947f901dd +Author: Christian Persch +Date: Fri May 14 14:15:42 2010 +0200 + + Plug mem leaks in parse_value_from_blob + + The result of read_string() was leaked. + + Bug #618615. + + gio/gdbusmessage.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 0a7c0ac74bd55d06265e9441c5728119adc254ab +Author: Christian Persch +Date: Fri May 14 18:08:29 2010 -0400 + + Plug a mem leak + + This code leaked the return value of g_variant_get_child_value(); + use g_variant_get() instead and free the iter when done. + + gio/gdbusproxy.c | 22 +++++++++------------- + 1 files changed, 9 insertions(+), 13 deletions(-) + +commit ddc94bd0a65a17471e50d0c659d9c59a1804c3f1 +Author: David Zeuthen +Date: Fri May 14 12:55:25 2010 -0400 + + GDBus: Remove cached value if a property is invalidated + + Also add a test case to catch this. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 6 ++++++ + gio/tests/gdbus-proxy.c | 36 ++++++++++++++++++++++++++++++++++++ + gio/tests/gdbus-testserver.py | 16 ++++++++++++++++ + 3 files changed, 58 insertions(+), 0 deletions(-) + +commit bb6530eb34a16cbf34ce130c21071a25666a704b +Author: David Zeuthen +Date: Fri May 14 12:49:51 2010 -0400 + + GDBus: Fix serialization of empty arrays + + It turns out that we didn't observe padding (neither when reading nor + writing) for empty arrays which (apparently) is needed according to + the D-Bus spec and reference implementation. A simple test case to + provoke this behavior is as follows (notice the lack of 4 bytes worth + of padding at position 0x0064): + + Error calling dbus_message_demarshal() on this blob: + org.freedesktop.DBus.Error.InvalidArgs: Message is corrupted + (Alignment padding not null) + 0000: 6c 01 00 01 2e 00 00 00 41 00 00 00 37 00 00 00 + l.......A...7... + 0010: 08 01 67 00 08 73 61 7b 73 76 7d 61 73 00 00 00 + ..g..sa{sv}as... + 0020: 01 01 6f 00 08 00 00 00 2f 66 6f 6f 2f 62 61 72 + ..o...../foo/bar + 0030: 00 00 00 00 00 00 00 00 03 01 73 00 06 00 00 00 + ..........s..... + 0040: 4d 65 6d 62 65 72 00 00 11 00 00 00 30 31 32 33 + Member......0123 + 0050: 34 35 36 37 38 39 30 31 32 33 34 35 36 00 00 00 + 4567890123456... + 0060: 00 00 00 00 0e 00 00 00 09 00 00 00 53 6f 6d 65 + ............Some + 0070: 74 68 69 6e 67 00 thing. + + The blob was generated from the following GVariant value: + ('01234567890123456', @a{sv} {}, ['Something']) + + If the blob was encoded using DBusMessageIter, the payload would + have been: + + 0000: 6c 01 00 01 32 00 00 00 41 00 00 00 36 00 00 00 + l...2...A...6... + 0010: 01 01 6f 00 08 00 00 00 2f 66 6f 6f 2f 62 61 72 + ..o...../foo/bar + 0020: 00 00 00 00 00 00 00 00 03 01 73 00 06 00 00 00 + ..........s..... + 0030: 4d 65 6d 62 65 72 00 00 08 01 67 00 08 73 61 7b + Member....g..sa{ + 0040: 73 76 7d 61 73 00 00 00 11 00 00 00 30 31 32 33 + sv}as.......0123 + 0050: 34 35 36 37 38 39 30 31 32 33 34 35 36 00 00 00 + 4567890123456... + 0060: 00 00 00 00 00 00 00 00 0e 00 00 00 09 00 00 00 + ................ + 0070: 53 6f 6d 65 74 68 69 6e 67 00 + Something. + ** ERROR:gdbus-serialization.c:547:check_serialization: code should + not be reached + Aborted + + and this is now in the libdbus-1-using serialization test case. + + Signed-off-by: David Zeuthen + + gio/gdbusmessage.c | 680 + ++++++++++++++++++++++++--------------- + gio/tests/gdbus-serialization.c | 12 + + 2 files changed, 439 insertions(+), 253 deletions(-) + +commit 285a124608b28ca62db7350632a48bd9257038c0 +Author: Jorge González +Date: Fri May 14 17:55:37 2010 +0200 + + Updated Spanish translation + + po/es.po | 1026 + +++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 521 insertions(+), 505 deletions(-) + +commit 02af71c7ff9689a75069b0a7bc84349dac0b13b4 +Author: Matthias Clasen +Date: Fri May 14 11:49:15 2010 -0400 + + bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit cff9d83f75b90301909f2c7d46a16e5f618e3e0b +Author: Matthias Clasen +Date: Fri May 14 11:25:11 2010 -0400 + + 2.25.4 + + po/af.po | 184 +++++---- + po/am.po | 184 +++++---- + po/ar.po | 184 +++++---- + po/as.po | 184 +++++---- + po/ast.po | 184 +++++---- + po/az.po | 184 +++++---- + po/be.po | 186 ++++++---- + po/be@latin.po | 186 ++++++---- + po/bg.po | 184 +++++---- + po/bn.po | 184 +++++---- + po/bn_IN.po | 184 +++++---- + po/bs.po | 184 +++++---- + po/ca.po | 184 +++++---- + po/ca@valencia.po | 184 +++++---- + po/cs.po | 184 +++++---- + po/cy.po | 184 +++++---- + po/da.po | 184 +++++---- + po/de.po | 184 +++++---- + po/dz.po | 184 +++++---- + po/el.po | 184 +++++---- + po/en@shaw.po | 1121 + +++++++++++++++++++++++++++-------------------------- + po/en_CA.po | 184 +++++---- + po/en_GB.po | 184 +++++---- + po/eo.po | 184 +++++---- + po/es.po | 1027 + +++++++++++++++++++++++++------------------------ + po/et.po | 184 +++++---- + po/eu.po | 184 +++++---- + po/fa.po | 184 +++++---- + po/fi.po | 184 +++++---- + po/fr.po | 184 +++++---- + po/ga.po | 184 +++++---- + po/gl.po | 1024 + +++++++++++++++++++++++++------------------------ + po/gu.po | 184 +++++---- + po/he.po | 184 +++++---- + po/hi.po | 184 +++++---- + po/hr.po | 184 +++++---- + po/hu.po | 184 +++++---- + po/hy.po | 184 +++++---- + po/id.po | 184 +++++---- + po/is.po | 184 +++++---- + po/it.po | 184 +++++---- + po/ja.po | 184 +++++---- + po/ka.po | 184 +++++---- + po/kn.po | 184 +++++---- + po/ko.po | 184 +++++---- + po/ku.po | 184 +++++---- + po/lt.po | 184 +++++---- + po/lv.po | 184 +++++---- + po/mai.po | 184 +++++---- + po/mg.po | 184 +++++---- + po/mk.po | 184 +++++---- + po/ml.po | 184 +++++---- + po/mn.po | 184 +++++---- + po/mr.po | 184 +++++---- + po/ms.po | 184 +++++---- + po/nb.po | 1024 + +++++++++++++++++++++++++------------------------ + po/nds.po | 184 +++++---- + po/ne.po | 184 +++++---- + po/nl.po | 185 ++++++---- + po/nn.po | 184 +++++---- + po/oc.po | 184 +++++---- + po/or.po | 184 +++++---- + po/pa.po | 184 +++++---- + po/pl.po | 184 +++++---- + po/ps.po | 184 +++++---- + po/pt.po | 184 +++++---- + po/pt_BR.po | 184 +++++---- + po/ro.po | 184 +++++---- + po/ru.po | 184 +++++---- + po/rw.po | 186 ++++++---- + po/si.po | 184 +++++---- + po/sk.po | 184 +++++---- + po/sl.po | 184 +++++---- + po/sq.po | 192 ++++++---- + po/sr.po | 184 +++++---- + po/sr@ije.po | 184 +++++---- + po/sr@latin.po | 184 +++++---- + po/sv.po | 184 +++++---- + po/ta.po | 184 +++++---- + po/te.po | 184 +++++---- + po/th.po | 184 +++++---- + po/tl.po | 184 +++++---- + po/tr.po | 184 +++++---- + po/tt.po | 184 +++++---- + po/uk.po | 184 +++++---- + po/vi.po | 184 +++++---- + po/wa.po | 184 +++++---- + po/xh.po | 184 +++++---- + po/yi.po | 184 +++++---- + po/zh_CN.po | 184 +++++---- + po/zh_HK.po | 184 +++++---- + po/zh_TW.po | 184 +++++---- + 92 files changed, 11669 insertions(+), 8734 deletions(-) + +commit c57c61c930896f278de61de170e57affc243e427 +Author: Ryan Lortie +Date: Fri May 14 17:06:24 2010 +0200 + + fix glaring inaccuracy in GVariant docs + + glib/gvariant.c | 12 ++++-------- + 1 files changed, 4 insertions(+), 8 deletions(-) + +commit ee9b16242c2f1e5e29170a8885fd146d44f83197 +Author: Matthias Clasen +Date: Fri May 14 10:49:03 2010 -0400 + + another !srcdir build fix + + gio/tests/Makefile.am | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 159f533abf9e653fa31dba5b3c12f024165c29db +Author: Matthias Clasen +Date: Fri May 14 10:25:31 2010 -0400 + + More !srcdir build fixes + + gio/tests/gdbus-introspection.c | 2 +- + gio/tests/gdbus-threading.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit d8d1a02c556ed9fc4c436888c965bc8dee62ad81 +Author: Ryan Lortie +Date: Fri May 14 15:30:33 2010 +0200 + + include gunixcredentialsmessage from unixsocket + + fixes a build issue + + gio/gunixconnection.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 1d22b64843c83631bcd0e5255930f3a4e990961e +Author: Matthias Clasen +Date: Fri May 14 08:38:07 2010 -0400 + + Cleanups + + Sort #includes a bit better, and don't include platform-specific + headers in gio.h. + + gio/gcredentials.c | 9 +++++---- + gio/gdbus-tool.c | 4 ++-- + gio/gdbusauth.c | 11 ++++++----- + gio/gdbusauthmechanismexternal.c | 9 ++++----- + gio/gdbusauthmechanismsha1.c | 18 ++++++++---------- + gio/gdbusconnection.c | 10 ++++++---- + gio/gdbusmessage.c | 11 ++++++----- + gio/gdbusprivate.c | 8 ++------ + gio/gdbusproxywatching.c | 1 - + gio/gdbusserver.c | 4 +++- + gio/gio.h | 1 - + 11 files changed, 42 insertions(+), 44 deletions(-) + +commit 054079899128cfc4a9e50a3750d927724604eedb +Author: Matthias Clasen +Date: Fri May 14 01:36:25 2010 -0400 + + Fix !srcdir build + + Thankfully we already had a SRCDIR define. + + gio/tests/gdbus-proxy.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c6f01b329c0d6488d15223c0d8bf286d8ff444a5 +Author: Matthias Clasen +Date: Fri May 14 00:59:42 2010 -0400 + + Fix a typo + + docs/reference/gio/gio-sections.txt | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 45cad58b4611aa6678f50a4545cb3b14b24b9c39 +Author: Matthias Clasen +Date: Fri May 14 00:51:51 2010 -0400 + + Updates + + NEWS | 34 ++++++++++++++++++++++++++++++++++ + 1 files changed, 34 insertions(+), 0 deletions(-) + +commit 4e7764fb2d843fbc89847036a3d8fcb47edf9c4d +Author: Matthias Clasen +Date: Fri May 14 00:21:39 2010 -0400 + + Documentation cleanups + + docs/reference/gio/Makefile.am | 7 ++++ + docs/reference/gio/gio-sections.txt | 61 + ++++++++++++++++++++++++++-------- + gio/giotypes.h | 1 - + gio/gunixcredentialsmessage.c | 1 + + 4 files changed, 54 insertions(+), 16 deletions(-) + +commit 6223341cacc7dfa34a8d60ec1b4828382dee6d07 +Merge: a7c4c7d 6e8637e +Author: Matthias Clasen +Date: Thu May 13 23:08:34 2010 -0400 + + Merge branch 'gdbus-merge' + + Conflicts: + docs/reference/gio/gio-docs.xml + docs/reference/gio/gio-sections.txt + gio/tests/Makefile.am + +commit a7c4c7de58a48c179e4dc3336814f63c33ad07ff +Author: Matthias Clasen +Date: Tue May 11 12:48:22 2010 -0400 + + Remove a reference to Pango + + docs/reference/gio/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6e8637e4783ae4e573f6784f005920930d9fca87 +Author: Matthias Clasen +Date: Thu May 13 22:15:47 2010 -0400 + + The default timeout is 25s + + gio/gdbusconnection.c | 7 +------ + 1 files changed, 1 insertions(+), 6 deletions(-) + +commit bdc29f82d39619747ac564918e041181b26449ee +Author: Matthias Clasen +Date: Thu May 13 21:53:51 2010 -0400 + + Document more floating variant details. + + gio/gdbusconnection.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit e72f7f52de9e482eb9d5dd1c47eb0d1bea5f4631 +Author: Matthias Clasen +Date: Thu May 13 21:45:18 2010 -0400 + + Add some more details to the long description + + gio/gdbusproxy.c | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +commit 8f89b63930181696a3f4a9c441ffd97230577d64 +Author: Matthias Clasen +Date: Thu May 13 20:29:04 2010 -0400 + + Clean up platform-specific includes + + The problem was pointed out in bug 618029. To solve it, we moved + the GUnixFDList typedef to giotypes.h. + + gio/gdbusmessage.c | 2 ++ + gio/gdbusmessage.h | 6 ------ + gio/giotypes.h | 1 + + gio/gunixfdlist.h | 3 +-- + gio/gunixfdmessage.c | 1 + + gio/gunixfdmessage.h | 2 +- + gio/tests/gdbus-example-unix-fd-client.c | 1 + + gio/tests/gdbus-peer.c | 1 + + 8 files changed, 8 insertions(+), 9 deletions(-) + +commit 62c0454b34191b56d439521e537915b0514f8dbb +Author: Ryan Lortie +Date: Fri May 14 01:54:30 2010 +0200 + + documentation for glib-mkenums @valuenum@ + + docs/reference/gobject/glib-mkenums.1 | 24 ++++++++++++++++++++++-- + docs/reference/gobject/glib-mkenums.xml | 12 ++++++++++++ + 2 files changed, 34 insertions(+), 2 deletions(-) + +commit e1fb92551f7be3dbaad9d9a5c80dc30ed7b83048 +Author: Ryan Lortie +Date: Tue May 11 19:48:19 2010 +0200 + + check for working gettext() before running tests + + gio/tests/gsettings.c | 31 +++++++++++++++++++++++-------- + 1 files changed, 23 insertions(+), 8 deletions(-) + +commit 1165007023bf34c5624574703acd2d183b1d14f5 +Author: Ryan Lortie +Date: Fri May 14 00:53:42 2010 +0200 + + Add configure check for memmem() + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit dd3551e7c3ae5e6e8b21dd77ce09d72b799e7b1d +Author: David Zeuthen +Date: Thu May 13 18:19:16 2010 -0400 + + GDBus: update gdbus(1) man page + + docs/reference/gio/gdbus.xml | 14 ++++++++------ + 1 files changed, 8 insertions(+), 6 deletions(-) + +commit 68078ed648eec314507ff997e89b053a1d9a6891 +Author: David Zeuthen +Date: Thu May 13 18:04:48 2010 -0400 + + GDBus: Nuke G_BUS_TYPE_NONE + + gio/gdbusnameowning.c | 1 - + gio/gdbusnamewatching.c | 1 - + gio/gdbusproxywatching.c | 3 +-- + gio/gioenums.h | 12 +++++------- + gio/tests/gdbus-peer.c | 1 - + 5 files changed, 6 insertions(+), 12 deletions(-) + +commit 1fd55b8bbfe58adb749d4eee68ca5a71e56e6f82 +Author: David Zeuthen +Date: Thu May 13 17:44:42 2010 -0400 + + GDBus: Remove g_dbus_is_activated() + + It's generally hard to get this right so don't attempt to do so. + + docs/reference/gio/gio-sections.txt | 1 - + gio/gdbusutils.c | 20 -------------------- + gio/gdbusutils.h | 2 -- + gio/gio.symbols | 1 - + 4 files changed, 0 insertions(+), 24 deletions(-) + +commit 51446baa52e8cebea57124eb99a32e77a13b1551 +Author: David Zeuthen +Date: Thu May 13 17:20:39 2010 -0400 + + GDBus: subscribe to PropertiesChanged() before calling GetAll() + + Otherwise there's a slight chance of a race. + + gio/gdbusproxy.c | 35 ++++++++++++++++++++--------------- + 1 files changed, 20 insertions(+), 15 deletions(-) + +commit 0e2c708bb298c98c136d507427e7b731b5cbd962 +Author: David Zeuthen +Date: Thu May 13 17:10:15 2010 -0400 + + GDBus: Don't take a GError for + g_dbus_proxy_get_cached_property_names() + + We stopped doing this for get_cached_property() so no reason to do it + here. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 29 + +++++++++-------------------- + gio/gdbusproxy.h | 3 +-- + gio/tests/gdbus-example-watch-proxy.c | 2 +- + 3 files changed, 11 insertions(+), 23 deletions(-) + +commit 3ca28ef718d402bd65cd9f291c67b299f1ef74cf +Author: David Zeuthen +Date: Thu May 13 16:57:29 2010 -0400 + + GDBus: Update docs for GDBusProxy::g-properties-changed signal + + Also update the example. See + + https://bugzilla.gnome.org/show_bug.cgi?id=618559 + + for more details. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 10 +++++----- + gio/tests/gdbus-example-watch-proxy.c | 7 +++++-- + 2 files changed, 10 insertions(+), 7 deletions(-) + +commit e3f5d3c00595ca017d83015fa2b9832d1c87828f +Author: Christian Persch +Date: Thu May 13 19:01:04 2010 +0200 + + Make GVariant handling in PropertiesChanged more efficient + + There's no need to re-build the a{sv} array, just get it right out of + the parameters. Also avoid some string copies. + + Signed-off-by: David Zeuthen + + gio/gdbusproxy.c | 82 + ++++++++++------------------------------------------- + 1 files changed, 16 insertions(+), 66 deletions(-) + +commit 4ad4c306c3b80620185cf975b402e17a6174aea9 +Author: Christian Persch +Date: Thu May 13 19:20:26 2010 +0200 + + Plug some mem leaks + + g_variant_get (v, "s", &str) returns a string copy; use "&s" instead. + + Signed-off-by: David Zeuthen + + gio/gdbus-tool.c | 20 ++++++++++---------- + gio/gdbusconnection.c | 22 ++++++++++------------ + gio/gdbusmessage.c | 2 +- + gio/gdbusnameowning.c | 4 ++-- + gio/gdbusnamewatching.c | 4 ++-- + gio/gdbusproxy.c | 4 ++-- + 6 files changed, 27 insertions(+), 29 deletions(-) + +commit 60e7ae26af2fc31d59e36f8798d383fa9d87db92 +Author: David Zeuthen +Date: Thu May 13 16:32:11 2010 -0400 + + GDBus: Add GDBusAuthObserver param in + g_dbus_connection_new_for_address() + + This is to match g_dbus_connection_new(). This extension allows us to + extend GDBusAuthObserver to also be used in client-side authentication + in the future (right now it's only used on the server-side). + + gio/gdbus-tool.c | 1 + + gio/gdbusconnection.c | 18 ++++++++++++++---- + gio/gdbusconnection.h | 2 ++ + gio/tests/gdbus-example-peer.c | 1 + + gio/tests/gdbus-peer.c | 4 ++++ + gio/tests/gdbus-tests.c | 1 + + 6 files changed, 23 insertions(+), 4 deletions(-) + +commit cb753dfd496ae70b069c1698da8211c454953f08 +Author: David Zeuthen +Date: Thu May 13 16:20:31 2010 -0400 + + GDBus: Rename ::deny-authentication-peer to + ::authorize-authenticated-peer + + docs/reference/gio/gio-sections.txt | 2 +- + gio/gdbusauth.c | 8 ++-- + gio/gdbusauthobserver.c | 74 + +++++++++++++++++++++-------------- + gio/gdbusauthobserver.h | 18 ++++---- + gio/gdbusconnection.c | 2 - + gio/gio.symbols | 2 +- + gio/tests/gdbus-peer.c | 20 +++++----- + 7 files changed, 70 insertions(+), 56 deletions(-) + +commit 9e90b381f58c4a06f49e622a07ee0b56fb52b3f1 +Author: Matthias Clasen +Date: Thu May 13 14:25:29 2010 -0400 + + Remove the credentials argument from g_unix_connect_send_credentials() + + Instead, make it always send the current credentials. + + gio/gdbusauth.c | 3 +-- + gio/gunixconnection.c | 16 +++++++--------- + gio/gunixconnection.h | 1 - + 3 files changed, 8 insertions(+), 12 deletions(-) + +commit 33952347ff9bc2875e7e1a2709566b38fc391bda +Author: David Zeuthen +Date: Thu May 13 14:01:41 2010 -0400 + + GDBus: Make message serialization routines take capabilities param + + This is needed to e.g. allow encoding maybe types (once we add + G_DBUS_CAPABILITY_FLAGS_MAYBE_TYPES) if, and only if, that capability + has been negotiated with the peer (via authentication). + + gio/gdbusconnection.c | 1 + + gio/gdbusmessage.c | 26 +++++++++++++++++--------- + gio/gdbusmessage.h | 2 ++ + gio/gdbusprivate.c | 1 + + gio/tests/gdbus-serialization.c | 6 +++++- + 5 files changed, 26 insertions(+), 10 deletions(-) + +commit 107b4d4bae7dba4281bfaa0bef827f7b2376946a +Author: Matthias Clasen +Date: Thu May 13 13:09:58 2010 -0400 + + remove the redundant interface_name parameter + + gio/gdbusconnection.c | 12 +++++------- + gio/gdbusconnection.h | 1 - + gio/tests/gdbus-example-export.c | 1 - + gio/tests/gdbus-example-peer.c | 1 - + gio/tests/gdbus-example-server.c | 1 - + gio/tests/gdbus-export.c | 12 ------------ + gio/tests/gdbus-peer.c | 2 -- + 7 files changed, 5 insertions(+), 25 deletions(-) + +commit 82158afdadd10e6ffd1540f695931f64957b59f6 +Author: David Zeuthen +Date: Thu May 13 11:56:15 2010 -0400 + + GDBus: Catch up with new PropertiesChanged signal + + After a long discussion, this has finally been standardized in the + D-Bus spec. See + + http://lists.freedesktop.org/archives/dbus/2010-May/012667.html + http://lists.freedesktop.org/archives/dbus/2010-May/012712.html + + Signed-off-by: David Zeuthen + + gio/gdbusconnection.c | 1 + + gio/gdbusproxy.c | 74 + ++++++++++++++++++++++++------ + gio/gdbusproxy.h | 13 +++-- + gio/gio-marshal.list | 1 + + gio/tests/gdbus-example-export.c | 7 ++- + gio/tests/gdbus-example-proxy-subclass.c | 34 ++++++++------ + gio/tests/gdbus-example-server.c | 12 +++-- + gio/tests/gdbus-example-watch-proxy.c | 55 ++++++++++++++-------- + gio/tests/gdbus-testserver.py | 1 + + 9 files changed, 136 insertions(+), 62 deletions(-) + +commit 2d75583fb2a8fdb71b9ee880dc0cf4605ab7bc6c +Author: Matthias Clasen +Date: Thu May 13 01:04:29 2010 -0400 + + Fill out the export section of the migration guide + + docs/reference/gio/migrating-gdbus.xml | 66 + ++++++++++++++++++++++++++++++++ + gio/tests/gdbus-example-export.c | 6 ++- + 2 files changed, 70 insertions(+), 2 deletions(-) + +commit 195cdcfabf962989f2bcc8c225a287517d7eacd9 +Author: Thomas Thurman +Date: Thu May 13 00:51:30 2010 -0400 + + Update Shavian transliteration + + po/en@shaw.po | 128 + +++++++++++++++++++++------------------------------------ + 1 files changed, 47 insertions(+), 81 deletions(-) + +commit 9a065edf6f51be2ad189cfb02ddd2c806b656303 +Author: Matthias Clasen +Date: Thu May 13 00:39:26 2010 -0400 + + Add an example of exporting a GObject + + This is more manual work than dbus-glib. + + gio/gdbusconnection.c | 2 + + gio/tests/Makefile.am | 4 + + gio/tests/gdbus-example-export.c | 331 + ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 337 insertions(+), 0 deletions(-) + +commit ea1e0496b0329147b932d5a1486f5a81b4121651 +Author: David Zeuthen +Date: Wed May 12 23:12:14 2010 -0400 + + GDBus: add 'monitor' verb to gdbus(1) + + This uncovered a bug in name watching if the name wasn't activatable. + + Also provoked the need for on_connection variants of g_bus_watch_name + (added g_bus_watch_proxy's variant as well). + + docs/reference/gio/gdbus.xml | 43 ++++++ + docs/reference/gio/gio-sections.txt | 2 + + gio/gdbus-tool.c | 253 + ++++++++++++++++++++++++++++++++++- + gio/gdbusnamewatching.c | 69 +++++++++- + gio/gdbusnamewatching.h | 23 ++- + gio/gdbusproxywatching.c | 86 ++++++++++++ + gio/gdbusproxywatching.h | 35 +++-- + gio/gio.symbols | 2 + + 8 files changed, 489 insertions(+), 24 deletions(-) + +commit 9695c23d4c29e79afbe14e3584b6c42e98e8f0d9 +Author: David Zeuthen +Date: Wed May 12 22:09:18 2010 -0400 + + GDBus: Make gdbus(1) print annotations when introspecting data + + Also make the gdbus-example-server include some example + annotations. The output looks like this: + + $ gdbus introspect --session --dest org.gtk.GDBus.TestServer + --object-path /org/gtk/GDBus/TestObject + node /org/gtk/GDBus/TestObject { + interface org.freedesktop.DBus.Properties { + methods: + Get(in s interface_name, + in s property_name, + out v value); + GetAll(in s interface_name, + out a{sv} properties); + Set(in s interface_name, + in s property_name, + in v value); + signals: + PropertiesChanged(s interface_name, + a{sv} changed_properties); + }; + interface org.freedesktop.DBus.Introspectable { + methods: + Introspect(out s xml_data); + }; + interface org.freedesktop.DBus.Peer { + methods: + Ping(); + GetMachineId(out s machine_uuid); + }; + @org.gtk.GDBus.Annotation("OnInterface") + @org.gtk.GDBus.Annotation("AlsoOnInterface") + interface org.gtk.GDBus.TestInterface { + methods: + @org.gtk.GDBus.Annotation("OnMethod") + HelloWorld(in s greeting, + out s response); + EmitSignal(@org.gtk.GDBus.Annotation.("OnArg") + in d speed_in_mph); + GimmeStdout(); + signals: + @org.gtk.GDBus.Annotation("Onsignal") + VelocityChanged(d speed_in_mph, + @org.gtk.GDBus.Annotation.("OnArg_NonFirst") + s speed_as_string); + properties: + @org.gtk.GDBus.Annotation("OnProperty") + @org.gtk.GDBus.Annotation("OnAnnotation_YesThisIsCrazy") + readonly s FluxCapicitorName = 'DeLorean'; + readwrite s Title = 'Back To C!'; + readonly s ReadingAlwaysThrowsError; + readwrite s WritingAlwaysThrowsError = "There's no home + like home"; + writeonly s OnlyWritable; + readonly s Foo = 'Tick'; + readonly s Bar = 'Tock'; + }; + }; + + gio/gdbus-tool.c | 43 + ++++++++++++++++++++++++++++++++++++++ + gio/tests/gdbus-example-server.c | 18 +++++++++++++-- + 2 files changed, 58 insertions(+), 3 deletions(-) + +commit cce08f197313bad1516924b3eb7305e7e6818971 +Author: Matthias Clasen +Date: Wed May 12 21:51:06 2010 -0400 + + Add a note about implemented standard interfaces + + gio/gdbusconnection.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit f909cb5b2713c8cd5f587c7a70e468d29bdcd429 +Author: David Zeuthen +Date: Wed May 12 20:43:40 2010 -0400 + + GDBusProxy: Remove error in get_cached_property() and add + set_cached_property() + + This makes it possible to use the cached properties mechanism even if + constructing the proxy with the DO_NOT_LOAD_PROPERTIES flag. + + This is useful for cases where you obtain the and track object + properties out-of-band. For example, in udisks, the plan is to have + something like this + + Manager.GetObjects (out ao paths, out aa{sa{sv}} all_properties); + Manager.ObjectAdded (o path, a{sa{sv}} all_properties); + Manager.ObjectChanged (o path, a{sa{sv}} all_properties); + Manager.ObjectRemoved (o path, a{sa{sv}} all_properties); + + E.g. the first GetObjects() call will return *all* data about *all* + exported objects. Further, this way a client will only need to listen + these three signals (three AddMatch) on the Manager object and it will + never need to do GetAll() etc (e.g. can use DO_NOT_LOAD_PROPERTIES). + + (Of course this only works if the client is interested in all + objects... while this is true for udisks it is generally not true for + other D-Bus services). + + Also use expected_interface to check for programming errors. + + docs/reference/gio/gio-sections.txt | 3 +- + gio/gdbusproxy.c | 162 + +++++++++++++++++++++++------- + gio/gdbusproxy.h | 4 +- + gio/gio.symbols | 1 + + gio/tests/gdbus-example-proxy-subclass.c | 6 +- + gio/tests/gdbus-example-watch-proxy.c | 2 +- + gio/tests/gdbus-peer.c | 3 +- + gio/tests/gdbus-proxy.c | 44 +++++++- + 8 files changed, 174 insertions(+), 51 deletions(-) + +commit 72731fb6ad99da076605ca7d8b1bee232b38e734 +Author: Thomas Thurman +Date: Wed May 12 18:41:27 2010 -0400 + + Updated Shavian transliteration + + po/en@shaw.po | 1176 + +++++++++++++++++++++++++++++---------------------------- + 1 files changed, 602 insertions(+), 574 deletions(-) + +commit b690e637d46057f6914a6b6f20b2688cd03f0ac5 +Author: Matthias Clasen +Date: Wed May 12 17:56:56 2010 -0400 + + Add some more verbiage + + docs/reference/gio/migrating-gdbus.xml | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit d40767fc62972f9cc85ebfb23e113068cc316f3a +Author: David Zeuthen +Date: Wed May 12 15:49:48 2010 -0400 + + GDBus: Add an example of a GDBusProxy subclass + + docs/reference/gio/migrating-gdbus.xml | 55 ++++ + gio/gdbusconnection.c | 2 - + gio/tests/Makefile.am | 4 + + gio/tests/gdbus-example-proxy-subclass.c | 443 + ++++++++++++++++++++++++++++++ + 4 files changed, 502 insertions(+), 2 deletions(-) + +commit 7c0196f0267aa77c80fb85320ef9583c7fc64ad7 +Author: Matthias Clasen +Date: Wed May 12 13:01:40 2010 -0400 + + Update an example to the latest auth observer api + + gio/gdbusauthobserver.c | 17 ++++++++++------- + gio/gdbusconnection.c | 2 +- + 2 files changed, 11 insertions(+), 8 deletions(-) + +commit 371a3373bbf190054076896ed32d28d546f23930 +Author: Matthias Clasen +Date: Wed May 12 13:01:02 2010 -0400 + + Correct env var names + + and add a note about priority + + docs/reference/gio/overview.xml | 12 ++++++++++-- + 1 files changed, 10 insertions(+), 2 deletions(-) + +commit af3afc804064ec17e89a6cdef4cc3e63015c8a77 +Author: Matthias Clasen +Date: Wed May 12 12:13:57 2010 -0400 + + placeholder for more migration docs + + docs/reference/gio/migrating-gdbus.xml | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 246db9bfdb5919a77ce5ae0d2f426f163f7702c1 +Author: Jesse van den Kieboom +Date: Fri May 7 11:55:40 2010 +0200 + + Added test cases for g_output_stream_close_async + + https://bugzilla.gnome.org/show_bug.cgi?id=617937 + + gio/tests/Makefile.am | 6 +- + gio/tests/async-close-output-stream.c | 278 + +++++++++++++++++++++++++++++++++ + 2 files changed, 283 insertions(+), 1 deletions(-) + +commit adc5162b742c702f37f385dcffba3802f0e55095 +Author: Jesse van den Kieboom +Date: Mon May 10 23:49:41 2010 +0200 + + Flush when closing output stream async + + https://bugzilla.gnome.org/show_bug.cgi?id=617937 + + gio/goutputstream.c | 117 + +++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 110 insertions(+), 7 deletions(-) + +commit e2b9d077659df82f9603352e6ce4ff1ceb4b1b8a +Author: Matthias Clasen +Date: Tue May 11 23:26:51 2010 -0400 + + Update TODO list + + gio/gdbusconnection.c | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +commit a63d3bb868b0ee17404cf85520e48d441abbcdf3 +Author: Matthias Clasen +Date: Tue May 11 23:18:48 2010 -0400 + + mention inline use of floating variants + + gio/gdbusconnection.c | 37 ++++++++++++++++++++++++++++++++++++- + gio/gdbusproxy.c | 42 ++++++++++++++++++++++++++++++++++++------ + 2 files changed, 72 insertions(+), 7 deletions(-) + +commit ab2ff1a307f6bf7825e02b0d09e25b8ea7570c07 +Author: Matthias Clasen +Date: Tue May 11 22:51:14 2010 -0400 + + Remove properties from GDBusMethodInvocation class + + gio/gdbusconnection.c | 3 - + gio/gdbusmethodinvocation.c | 330 + +++---------------------------------------- + 2 files changed, 18 insertions(+), 315 deletions(-) + +commit c4cf88c22f731878cbc740e4721e07215385201b +Author: Matthias Clasen +Date: Tue May 11 22:50:40 2010 -0400 + + Document remove_filter + + gio/gdbusconnection.c | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) + +commit d7095dd4700b38c202a43b7c21f93db20a9ede44 +Author: Matthias Clasen +Date: Tue May 11 22:35:59 2010 -0400 + + Document DBUS address env vars + + docs/reference/gio/overview.xml | 28 ++++++++++++++++++++++++++++ + gio/gdbusintrospection.c | 2 +- + 2 files changed, 29 insertions(+), 1 deletions(-) + +commit 84a6475b6e52fd481bf0e7191a6ea16168d35a3f +Author: Matthias Clasen +Date: Tue May 11 22:03:40 2010 -0400 + + Trivial: tweak section heading + + docs/reference/gio/migrating-gdbus.xml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9c128ca83536b6c6c823bb83606b09193d814738 +Author: Matthias Clasen +Date: Tue May 11 22:00:54 2010 -0400 + + Trivial formatting fix + + docs/reference/gio/migrating-gdbus.xml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit fdfd3d5e7536313dde1fc02b45ca04a6e4704b50 +Author: Matthias Clasen +Date: Tue May 11 22:00:06 2010 -0400 + + Fill out the proxy section of the migration guide + + docs/reference/gio/migrating-gdbus.xml | 53 + ++++++++++++++++++++++++++++++++ + 1 files changed, 53 insertions(+), 0 deletions(-) + +commit 26f65d83c5078e48e414a1cbe593bf349d96a033 +Author: Matthias Clasen +Date: Tue May 11 21:59:42 2010 -0400 + + Don't refer to nonexisting API. + + gio/gdbusconnection.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1af277f16779f072bc0c326aa8024747ad8c13e9 +Author: Matthias Clasen +Date: Tue May 11 21:32:29 2010 -0400 + + Fix a typo + + docs/reference/gio/migrating-gdbus.xml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9b05e0bc3e88f9e54710aabb2ad29908739e6345 +Author: Matthias Clasen +Date: Tue May 11 21:30:53 2010 -0400 + + Complete the name owning section of the migration guide + + docs/reference/gio/migrating-gdbus.xml | 136 + ++++++++++++++++++-------------- + 1 files changed, 76 insertions(+), 60 deletions(-) + +commit e4b1e48fca9d1d2ca7e0ec54ebc9ea421aebff71 +Author: Matthias Clasen +Date: Tue May 11 20:57:44 2010 -0400 + + Match up parameter names + + and similar cleanups to make gtk-doc happy. + + docs/reference/gio/gio-sections.txt | 1 - + gio/gdbusconnection.c | 17 +++--- + gio/gdbusconnection.h | 4 +- + gio/gdbusintrospection.c | 102 + ++++++++++++++++++++--------------- + gio/gunixcredentialsmessage.c | 2 +- + 5 files changed, 71 insertions(+), 55 deletions(-) + +commit 1d43e4140b9c890eca50f3845bff3d800d66b6f9 +Author: Matthias Clasen +Date: Tue May 11 20:03:44 2010 -0400 + + Line up prototypes + + gio/gdbusproxy.c | 34 +++++++++++++++++----------------- + 1 files changed, 17 insertions(+), 17 deletions(-) + +commit 8d66ede1abbc4b84bcf13c4420719cb06fbe3b96 +Author: Matthias Clasen +Date: Tue May 11 17:15:11 2010 -0400 + + More gdbus migration stuff + + docs/reference/gio/migrating-gdbus.xml | 89 + ++++++++++++++++++++++++++++++- + 1 files changed, 86 insertions(+), 3 deletions(-) + +commit 54a57bb894d3c098bf972ecec71823b2822128b6 +Author: Matthias Clasen +Date: Tue May 11 15:50:19 2010 -0400 + + Strip copyright headers from examples + + These are included wholesale in the docs, and the copyright + headers make them even more overwhelming. Plus, we don't have + copyright headers on examples anywhere else. + + gio/tests/gdbus-example-own-name.c | 13 ------------- + gio/tests/gdbus-example-peer.c | 13 ------------- + gio/tests/gdbus-example-server.c | 13 ------------- + gio/tests/gdbus-example-subtree.c | 13 ------------- + gio/tests/gdbus-example-unix-fd-client.c | 13 ------------- + gio/tests/gdbus-example-watch-name.c | 13 ------------- + gio/tests/gdbus-example-watch-proxy.c | 13 ------------- + 7 files changed, 0 insertions(+), 91 deletions(-) + +commit 9a2422b216263dd7bc4f27a98bc89d5ea6dfe791 +Author: Matthias Clasen +Date: Tue May 11 15:42:15 2010 -0400 + + Trivial: rename a file + + docs/reference/gio/Makefile.am | 4 +- + docs/reference/gio/gio-docs.xml | 2 +- + docs/reference/gio/migrating-dbus-glib.xml | 70 + ---------------------------- + docs/reference/gio/migrating-gdbus.xml | 70 + ++++++++++++++++++++++++++++ + 4 files changed, 73 insertions(+), 73 deletions(-) + +commit 0e98557753ad5f5f9b74fd135dcdbe18055dc11a +Author: Kjartan Maraas +Date: Tue May 11 19:54:06 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 92 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 46 insertions(+), 46 deletions(-) + +commit 8c523c069b79a746c2dcdfe7e253513ff489cd39 +Author: David Zeuthen +Date: Tue May 11 12:04:37 2010 -0400 + + GDBus: Update TODO list + + gio/gdbusconnection.c | 28 ++++++++++++++++++++++++++++ + 1 files changed, 28 insertions(+), 0 deletions(-) + +commit 6d5ac8163b962803fedcf57b9ccad8a2c1205c82 +Author: Sebastian Dröge +Date: Mon May 10 09:48:49 2010 +0200 + + gio: Fix gsettings build with binutils gold linker + + gio/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 936ff022f21a43f39552799dc1b3988379563959 +Author: Sebastian Dröge +Date: Mon May 10 09:51:49 2010 +0200 + + Don't include __bss_start, _edata and _end symbols in the abichecks + + They are added by the binutils gold linker. + + gio/abicheck.sh | 2 +- + glib/abicheck.sh | 2 +- + gobject/abicheck.sh | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 2d208c9d364369d68a54cfd0682e17f2ce771db5 +Author: David Zeuthen +Date: Mon May 10 16:20:59 2010 -0400 + + GDBus: In gdbus(1), try Get() if GetAll() fails + + This fixes a problem with services that doesn't implement GetAll() for + one reason or another. + + $ gdbus introspect --session --dest + org.freedesktop.ReserveDevice1.Audio0 --object-path + /org/freedesktop/ReserveDevice1/Audio0 + node /org/freedesktop/ReserveDevice1/Audio0 { + interface org.freedesktop.ReserveDevice1 { + methods: + RequestRelease(in i priority, + out b result); + properties: + readonly i Priority = 0; + readonly s ApplicationName = 'PulseAudio Sound Server'; + readonly s ApplicationDeviceName = 'Internal Audio Analog + Stereo'; + }; + interface org.freedesktop.DBus.Properties { + methods: + Get(in s interface, + in s property, + out v value); + }; + interface org.freedesktop.DBus.Introspectable { + methods: + Introspect(out s data); + }; + }; + + gio/gdbus-tool.c | 28 ++++++++++++++++++++++++++++ + 1 files changed, 28 insertions(+), 0 deletions(-) + +commit 6e23b0b7850c170405aa25d9441a9cd8cc05a38b +Author: David Zeuthen +Date: Mon May 10 14:43:08 2010 -0400 + + GDBus: Add TODO item about a need to validate data / messages + + gio/gdbusconnection.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit adf50912ddb29c8c6b36702df1162e6211765dea +Author: David Zeuthen +Date: Mon May 10 14:07:13 2010 -0400 + + GDBus Add TODO items about finding and launching bus instances + + gio/gdbusconnection.c | 28 ++++++++++++++++++++++++++++ + 1 files changed, 28 insertions(+), 0 deletions(-) + +commit 5800a1f91162ec5a0e96fae12857be2ebe404d3a +Author: Jorge González +Date: Mon May 10 19:38:57 2010 +0200 + + Updated Spanish translation + + po/es.po | 91 + +++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 49 insertions(+), 42 deletions(-) + +commit 7e8b07ae3be5ce63ba17183a410ac8512a29cb13 +Author: David Zeuthen +Date: Mon May 10 13:31:54 2010 -0400 + + GDBus: Use GVariant instead of GHashTable for + GDBusProxy::g-properties-changed + + gio/gdbusconnection.c | 13 ------------- + gio/gdbusproxy.c | 24 +++++++++++------------- + gio/gdbusproxy.h | 2 +- + gio/tests/gdbus-example-watch-proxy.c | 21 +++++++++++++++------ + 4 files changed, 27 insertions(+), 33 deletions(-) + +commit 869b4c68332f36377bbdfd186e37f6194ae5ed5a +Author: David Zeuthen +Date: Mon May 10 11:47:08 2010 -0400 + + GDBus: Use call() instead of invoke_method() + + Lots of people been suggesting this. We still use MethodInvocation / + method_invocation for handling incoming method calls so use call() + instead of invoke_method() helps to separate the client and server + facilities. Which is a good thing(tm). + + docs/reference/gio/gio-sections.txt | 14 +- + docs/reference/gio/migrating-dbus-glib.xml | 6 +- + gio/gdbus-tool.c | 160 +++++++++--------- + gio/gdbusauthmechanismexternal.c | 2 +- + gio/gdbusconnection.c | 104 ++++++------ + gio/gdbusconnection.h | 10 +- + gio/gdbuserror.c | 13 +- + gio/gdbusnameowning.c | 52 +++--- + gio/gdbusnamewatching.c | 56 +++--- + gio/gdbusproxy.c | 142 ++++++++-------- + gio/gdbusproxy.h | 10 +- + gio/gio.symbols | 14 +- + gio/gioenums.h | 14 +- + gio/tests/gdbus-connection.c | 160 +++++++++--------- + gio/tests/gdbus-example-peer.c | 20 +- + gio/tests/gdbus-export.c | 252 + ++++++++++++++-------------- + gio/tests/gdbus-introspection.c | 14 +- + gio/tests/gdbus-names.c | 40 +++--- + gio/tests/gdbus-peer.c | 44 +++--- + gio/tests/gdbus-proxy.c | 146 ++++++++-------- + gio/tests/gdbus-threading.c | 114 +++++++------- + 21 files changed, 694 insertions(+), 693 deletions(-) + +commit 728c4e38e72055080c148f9cebca85a08d16a445 +Author: Matthias Clasen +Date: Mon May 10 08:07:28 2010 -0400 + + More copyright year updates + + gio/tests/gdbus-addresses.c | 2 +- + gio/tests/gdbus-connection.c | 2 +- + gio/tests/gdbus-error.c | 2 +- + gio/tests/gdbus-exit-on-close.c | 2 +- + gio/tests/gdbus-export.c | 2 +- + gio/tests/gdbus-introspection.c | 2 +- + gio/tests/gdbus-names.c | 2 +- + gio/tests/gdbus-peer.c | 2 +- + gio/tests/gdbus-proxy.c | 2 +- + gio/tests/gdbus-serialization.c | 2 +- + gio/tests/gdbus-sessionbus.c | 2 +- + gio/tests/gdbus-tests.c | 2 +- + gio/tests/gdbus-threading.c | 2 +- + 13 files changed, 13 insertions(+), 13 deletions(-) + +commit 5d1135618e6ec5c6a6c41bed602cec643f9d8b8f +Author: Matthias Clasen +Date: Mon May 10 08:07:07 2010 -0400 + + Trivia + + gio/gdbusaddress.c | 34 +++++++++++++++++----------------- + gio/gdbusconnection.c | 34 +++++++++++++++++++++------------- + 2 files changed, 38 insertions(+), 30 deletions(-) + +commit 25a8aa5d88d3d4b8ebcf8be42a2adc233dbb104c +Author: Matthias Clasen +Date: Sun May 9 22:13:18 2010 -0400 + + Cosmetic fixes + + Use P_() for properties, fix up indentation, etc. + + gio/gdbusauth.c | 4 +- + gio/gdbusauthmechanism.c | 71 +++--- + gio/gdbusconnection.c | 514 + ++++++++++++++++++----------------------- + gio/gdbusmethodinvocation.c | 69 +++--- + gio/gdbusproxy.c | 145 ++++++------ + gio/gdbusserver.c | 81 +++---- + gio/gunixcredentialsmessage.c | 7 +- + 7 files changed, 407 insertions(+), 484 deletions(-) + +commit 0cf467c2ca92ece9625dbc54ad3065ad5298f735 +Author: Matthias Clasen +Date: Sun May 9 13:14:55 2010 -0400 + + Update copyright years to include 2010 + + gio/gcredentials.c | 2 +- + gio/gcredentials.h | 2 +- + gio/gdbus-tool.c | 2 +- + gio/gdbusaddress.c | 2 +- + gio/gdbusaddress.h | 2 +- + gio/gdbusauth.c | 2 +- + gio/gdbusauth.h | 2 +- + gio/gdbusauthmechanism.c | 2 +- + gio/gdbusauthmechanism.h | 2 +- + gio/gdbusauthmechanismanon.c | 2 +- + gio/gdbusauthmechanismanon.h | 2 +- + gio/gdbusauthmechanismexternal.c | 2 +- + gio/gdbusauthmechanismexternal.h | 2 +- + gio/gdbusauthmechanismsha1.c | 2 +- + gio/gdbusauthmechanismsha1.h | 2 +- + gio/gdbusauthobserver.c | 2 +- + gio/gdbusauthobserver.h | 2 +- + gio/gdbusconnection.c | 2 +- + gio/gdbusconnection.h | 2 +- + gio/gdbuserror.c | 2 +- + gio/gdbuserror.h | 2 +- + gio/gdbusintrospection.c | 2 +- + gio/gdbusintrospection.h | 2 +- + gio/gdbusmessage.c | 2 +- + gio/gdbusmessage.h | 2 +- + gio/gdbusmethodinvocation.c | 2 +- + gio/gdbusmethodinvocation.h | 2 +- + gio/gdbusnameowning.c | 2 +- + gio/gdbusnameowning.h | 2 +- + gio/gdbusnamewatching.c | 2 +- + gio/gdbusnamewatching.h | 2 +- + gio/gdbusprivate.c | 2 +- + gio/gdbusprivate.h | 2 +- + gio/gdbusproxy.c | 2 +- + gio/gdbusproxy.h | 2 +- + gio/gdbusproxywatching.c | 2 +- + gio/gdbusproxywatching.h | 2 +- + gio/gdbusserver.c | 2 +- + gio/gdbusserver.h | 2 +- + gio/gdbusutils.c | 2 +- + gio/gdbusutils.h | 2 +- + 41 files changed, 41 insertions(+), 41 deletions(-) + +commit e82eea6fdae1a24b58bbd9a440c6c37bd2980afd +Author: Matthias Clasen +Date: Sun May 9 13:09:54 2010 -0400 + + Microoptimize string reallocations + + gio/gdbusconnection.c | 86 + +++++++++++++++++++++++++++--------------------- + 1 files changed, 48 insertions(+), 38 deletions(-) + +commit b87dd96a8a418f4f5915e4a1cb59737a009efdd8 +Author: Matthias Clasen +Date: Sun May 9 12:41:02 2010 -0400 + + Move some platform sources around + + gunixcredentialsmessage.h ought to live with other UNIX headers, + and the credentials are moved from dbus-specific to just GIO sources. + Also move gfiledescriptorbased.c to the UNIX sources. + + gio/Makefile.am | 12 +++++------- + 1 files changed, 5 insertions(+), 7 deletions(-) + +commit b96c3b6d60a87f31a46ff5499c133571f0470940 +Author: Matthias Clasen +Date: Sun May 9 12:24:56 2010 -0400 + + Mention multithreading as a reason for not using libdbus + + docs/reference/gio/migrating-dbus-glib.xml | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 03b5db44779c54947c3801609a42b2d2801b5a97 +Author: Robert Bragg +Date: Thu May 6 15:46:00 2010 +0100 + + gtester-report: cope with binaries with no test cases + + It's possible that a given binary may conditionally decided not to run + any test cases (e.g. since they are all slow but -m=quick is currently + in use) In this case the xml may contain nodes with no + children. This was resulting in a divide by zero when + calculating the green → red color interpolation. + + https://bugzilla.gnome.org/show_bug.cgi?id=617914 + + glib/gtester-report | 25 +++++++++++++++---------- + 1 files changed, 15 insertions(+), 10 deletions(-) + +commit c148cafdd16f8bfed46cf5b0af05af3cbdc550c7 +Author: David Zeuthen +Date: Sun May 9 10:02:56 2010 -0400 + + GDBus: Rework GCredentials type + + These changes are is related to + + https://bugzilla.gnome.org/show_bug.cgi?id=617483 + + and IRC discussions with danw. + + docs/reference/gio/gio-sections.txt | 15 +- + gio/gcredentials.c | 435 + +++++++++++++---------------------- + gio/gcredentials.h | 44 ++-- + gio/gdbusauth.c | 2 +- + gio/gdbusauthmechanismexternal.c | 19 +-- + gio/gio.symbols | 15 +- + gio/gunixcredentialsmessage.c | 13 +- + 7 files changed, 193 insertions(+), 350 deletions(-) + +commit bb7106c5dfce5597bcc4a0682200fb50f5201c29 +Author: Matthias Clasen +Date: Sun May 9 02:27:09 2010 -0400 + + Add some conceptual changes + + docs/reference/gio/migrating-dbus-glib.xml | 95 + +++++++++++++++++++--------- + gio/gdbusaddress.c | 2 +- + gio/gdbusintrospection.c | 2 +- + 3 files changed, 66 insertions(+), 33 deletions(-) + +commit 8315eb77d57de73b950d152edbc7a104d378642c +Author: Matthias Clasen +Date: Sun May 9 01:44:11 2010 -0400 + + Some documentation tweaks + + Add links to the D-Bus docs in some places, and various + other additions. + + docs/reference/gio/overview.xml | 6 +++--- + gio/gdbusaddress.c | 4 +++- + gio/gdbusconnection.c | 14 +++++++------- + gio/gdbusintrospection.c | 6 +++++- + gio/gdbusmethodinvocation.c | 4 ++++ + gio/gdbusnameowning.c | 18 ++++++++++-------- + gio/gdbusproxywatching.c | 2 +- + 7 files changed, 33 insertions(+), 21 deletions(-) + +commit 7ca2e000546733446f737ec8fe425dd17218eada +Author: Matthias Clasen +Date: Sat May 8 23:28:17 2010 -0400 + + Doc improvements + + Make sure all unix-specific apis are marked as such. + + docs/reference/gio/gio-docs.xml | 19 ++++++++++--------- + docs/reference/gio/gio-sections.txt | 22 ++++++++++++++-------- + gio/gdesktopappinfo.c | 16 ++++++++-------- + gio/gfiledescriptorbased.c | 6 +++++- + gio/gunixconnection.c | 11 ++++++++--- + gio/gunixfdlist.c | 7 ++++++- + gio/gunixfdmessage.c | 13 +++++++++---- + gio/gunixinputstream.c | 4 ++-- + gio/gunixmounts.c | 8 ++++---- + gio/gunixoutputstream.c | 6 +++--- + gio/gunixsocketaddress.c | 14 +++++++++----- + 11 files changed, 78 insertions(+), 48 deletions(-) + +commit 6bea235c8b3bb79b508491985dd38c2074ee6843 +Author: Simon McVittie +Date: Sat May 8 21:30:27 2010 -0400 + + Support 64bit integers in GKeyFile + + docs/reference/glib/glib-sections.txt | 4 + + glib/gkeyfile.c | 152 + +++++++++++++++++++++++++++++++++ + glib/gkeyfile.h | 16 ++++ + glib/glib.symbols | 4 + + glib/tests/keyfile.c | 46 ++++++++++ + 5 files changed, 222 insertions(+), 0 deletions(-) + +commit 08b5f866971eb2f44e572390f8e9f322fa8a2840 +Author: Matthias Clasen +Date: Sat May 8 21:18:48 2010 -0400 + + Make GSETTINGS_CHECK_RULE work in !srcdir builds + + This problem was reported in bug 617823. + + m4macros/gsettings.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c13c36e3b9db500e30055e616ffa52672281fc49 +Author: Matthias Clasen +Date: Sat May 8 20:58:10 2010 -0400 + + Add test for g_get_language_names + + glib/tests/Makefile.am | 3 ++ + glib/tests/utils.c | 84 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 87 insertions(+), 0 deletions(-) + +commit e8bc8c6cbf86ee07a56f3eaa9fdb44b97ad12c6d +Author: Matthias Clasen +Date: Sat May 8 20:10:57 2010 -0400 + + Document length parameter of g_settings_get/set_strv + + This parameter was not mentioned in the doc comment, as pointed + out in bug 617767. + + gio/gsettings.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 9164fd02c9043baee99199a3ba33c98e2309dc00 +Author: Matthias Clasen +Date: Sat May 8 20:10:57 2010 -0400 + + Document length parameter of g_settings_get/set_strv + + This parameter was not mentioned in the doc comment, as pointed + out in bug 617767. + + gio/gsettings.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit af263a3a10ff9f3ae41d30e8cb9753b8b9f1ad43 +Author: Dan Winship +Date: Fri May 7 19:08:13 2010 -0400 + + remove broken useless initialization in socket-client/socket-server + + https://bugzilla.gnome.org/show_bug.cgi?id=618051 + + gio/tests/socket-client.c | 2 +- + gio/tests/socket-server.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f1855c2f77fb76347c332b21865e5513f89b15b9 +Author: David Zeuthen +Date: Fri May 7 15:02:37 2010 -0400 + + GDBus: add TODO item about maybe having to rework + ::g-properties-changed + + gio/gdbusconnection.c | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit 85c85ae63a95f4004020db56da6242b26ce073c0 +Author: David Zeuthen +Date: Fri May 7 14:57:20 2010 -0400 + + GDBus: add TODO item about the need to rewrite private GDBusAuth* + classes + + gio/gdbusconnection.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 5bd876bef0235ec5c745ac948e906bf51adf2fef +Author: David Zeuthen +Date: Fri May 7 14:56:01 2010 -0400 + + Add TODO item about wanting G_DBUS_NONCE_TCP_TMPDIR + + gio/gdbusconnection.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 5134a1d151f14cfadfa72c23d0660f3928bda821 +Author: David Zeuthen +Date: Fri May 7 14:36:07 2010 -0400 + + GDBus: Document environment variables in "Running GIO applications" + + docs/reference/gio/overview.xml | 45 + +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 45 insertions(+), 0 deletions(-) + +commit 1ddda12d646f67fcb558399dce20ecff2405bf20 +Author: Matthias Clasen +Date: Thu May 6 20:54:04 2010 -0400 + + A quick cheat sheet + + docs/reference/gio/migrating-dbus-glib.xml | 30 + +++++++++++++++++++++++++++- + 1 files changed, 29 insertions(+), 1 deletions(-) + +commit f309334bc629b9b148d9ce2887489930d4eedd3f +Author: David Zeuthen +Date: Thu May 6 19:39:16 2010 -0400 + + GDBus: add a man page for gdbus(1) + + docs/reference/gio/Makefile.am | 7 +- + docs/reference/gio/gdbus.xml | 221 + +++++++++++++++++++++++++++++++++++++++ + docs/reference/gio/gio-docs.xml | 1 + + 3 files changed, 227 insertions(+), 2 deletions(-) + +commit f14e30818c7d355f0c3d61bab2f2a702dc747952 +Author: Matthias Clasen +Date: Thu May 6 18:15:00 2010 -0400 + + Mention D-Bus functionality in the overview + + docs/reference/gio/overview.xml | 39 + +++++++++++++++++++++++++++------------ + 1 files changed, 27 insertions(+), 12 deletions(-) + +commit 133f66538dbf266be3c99b34f1eeee0a5e6068ac +Author: Matthias Clasen +Date: Thu May 6 17:52:54 2010 -0400 + + Add a migration chapter for dbus bits + + Also split migration.xml into separate files per chapter, it was + getting unwieldy. + + docs/reference/gio/Makefile.am | 10 +- + docs/reference/gio/gio-docs.xml | 8 +- + docs/reference/gio/migrating-dbus-glib.xml | 7 + + docs/reference/gio/migrating-gconf.xml | 418 ++++++++++++++++++++ + docs/reference/gio/migrating-gnome-vfs.xml | 133 +++++++ + docs/reference/gio/migrating-posix.xml | 581 + ++++++++++++++++++++++++++++ + docs/reference/gio/migrating.xml | 581 + ---------------------------- + 7 files changed, 1154 insertions(+), 584 deletions(-) + +commit 44fd23b649ebe2f8f6d31e78400d3230b2c38366 +Author: David Zeuthen +Date: Thu May 6 17:41:31 2010 -0400 + + GDBus: Add more symbols to pltcheck.sh's SKIP variable + + In particular, add these symbols + + g_memdup + g_print + g_random_int + g_propagate_prefixed_e + g_thread_create_full + g_int_hash + g_file_open_tmp + g_thread_self + g_usleep + + gio/pltcheck.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 46ce134d516f4a246996328c980efe16195ab429 +Author: David Zeuthen +Date: Thu May 6 17:31:51 2010 -0400 + + GDBus: Add new symbols to gio.symbols + + docs/reference/gio/gio-sections.txt | 6 +- + docs/reference/gio/gio.types | 2 +- + gio/gcredentials.c | 4 + + gio/gdbusaddress.c | 4 + + gio/gdbusauth.c | 4 + + gio/gdbusauthmechanism.c | 4 + + gio/gdbusauthmechanismanon.c | 4 + + gio/gdbusauthmechanismexternal.c | 4 + + gio/gdbusauthmechanismsha1.c | 4 + + gio/gdbusauthobserver.c | 4 + + gio/gdbusconnection.c | 10 +- + gio/gdbuserror.c | 4 + + gio/gdbusintrospection.c | 5 + + gio/gdbusmessage.c | 20 +- + gio/gdbusmessage.h | 8 +- + gio/gdbusmethodinvocation.c | 4 + + gio/gdbusnameowning.c | 4 + + gio/gdbusnamewatching.c | 4 + + gio/gdbusprivate.c | 4 + + gio/gdbusproxy.c | 4 + + gio/gdbusproxywatching.c | 4 + + gio/gdbusserver.c | 4 + + gio/gdbusutils.c | 4 + + gio/gio.symbols | 299 + ++++++++++++++++++++++++++++++ + gio/gunixcredentialsmessage.c | 4 + + gio/tests/gdbus-example-unix-fd-client.c | 2 +- + gio/tests/gdbus-peer.c | 2 +- + gio/tests/gdbus-serialization.c | 2 +- + 28 files changed, 405 insertions(+), 23 deletions(-) + +commit fb1b4599a0effe728f42da8748b469a62f91ed8d +Author: David Zeuthen +Date: Thu May 6 16:34:23 2010 -0400 + + GDBus: Fix up i18n + + gio/gcredentials.c | 3 ++- + gio/gdbus-tool.c | 4 +++- + gio/gdbusaddress.c | 5 +++-- + gio/gdbusauth.c | 4 ++-- + gio/gdbusauthmechanism.c | 4 ++-- + gio/gdbusauthmechanismanon.c | 4 ++-- + gio/gdbusauthmechanismexternal.c | 4 +++- + gio/gdbusauthmechanismsha1.c | 4 +++- + gio/gdbusauthobserver.c | 4 ++-- + gio/gdbusconnection.c | 27 +++++++++++++++------------ + gio/gdbuserror.c | 5 +++-- + gio/gdbusintrospection.c | 5 +++-- + gio/gdbusmessage.c | 3 ++- + gio/gdbusmethodinvocation.c | 3 ++- + gio/gdbusnameowning.c | 4 ++-- + gio/gdbusnamewatching.c | 5 +++-- + gio/gdbusprivate.c | 16 ++++++++++++++-- + gio/gdbusproxy.c | 5 ++++- + gio/gdbusproxywatching.c | 4 ++-- + gio/gdbusserver.c | 16 ++++++++++------ + gio/gdbusutils.c | 4 ++-- + gio/gunixcredentialsmessage.c | 4 ++-- + 22 files changed, 86 insertions(+), 51 deletions(-) + +commit 0fd6498cd89888023fb2161bfdde9339a4346986 +Author: David Zeuthen +Date: Thu May 6 16:02:08 2010 -0400 + + Add "Since: 2.26" to all new GDBus API + + docs/reference/gio/gio-docs.xml | 2 +- + gio/gcredentials.c | 32 +++++++++++++ + gio/gcredentials.h | 4 ++ + gio/gdbusaddress.c | 12 +++++ + gio/gdbusauthobserver.c | 6 +++ + gio/gdbusauthobserver.h | 4 ++ + gio/gdbusconnection.c | 94 + ++++++++++++++++++++++++++++++++++++-- + gio/gdbusconnection.h | 24 ++++++++++ + gio/gdbuserror.c | 20 ++++++++ + gio/gdbuserror.h | 4 ++ + gio/gdbusintrospection.c | 52 ++++++++++++++++++++-- + gio/gdbusintrospection.h | 28 ++++++++++++ + gio/gdbusmessage.c | 88 + ++++++++++++++++++++++++++++++++++++ + gio/gdbusmessage.h | 4 ++ + gio/gdbusmethodinvocation.c | 50 +++++++++++++++++++++ + gio/gdbusmethodinvocation.h | 4 ++ + gio/gdbusnameowning.c | 10 +++- + gio/gdbusnameowning.h | 6 +++ + gio/gdbusnamewatching.c | 8 +++- + gio/gdbusnamewatching.h | 4 ++ + gio/gdbusprivate.c | 2 +- + gio/gdbusproxy.c | 70 +++++++++++++++++++++++++---- + gio/gdbusproxy.h | 4 ++ + gio/gdbusproxywatching.c | 6 ++- + gio/gdbusproxywatching.h | 4 ++ + gio/gdbusserver.c | 28 ++++++++++++ + gio/gdbusserver.h | 4 ++ + gio/gdbusutils.c | 15 ++++++- + gio/gioenums.h | 30 ++++++++++++- + gio/gunixcredentialsmessage.c | 4 ++ + gio/gunixcredentialsmessage.h | 15 ++++++ + 31 files changed, 611 insertions(+), 27 deletions(-) + +commit c490c14f4e3fbbe8c74b26e6cacac31b0e744c92 +Author: David Zeuthen +Date: Thu May 6 15:31:45 2010 -0400 + + Set up gtk-doc for GDBus + + Also move send_credentials() and receive_credentials() to + GUnixConnection. This code might change, discussion is still ongoing + in + + https://bugzilla.gnome.org/show_bug.cgi?id=617483. + + docs/reference/gio/gio-docs.xml | 21 ++ + docs/reference/gio/gio-sections.txt | 390 + +++++++++++++++++++++++++++++++++++ + docs/reference/gio/gio.types | 11 + + gio/gcredentials.c | 4 +- + gio/gdbusaddress.c | 2 +- + gio/gdbusauth.c | 189 ----------------- + gio/gdbusauthobserver.c | 2 +- + gio/gdbusconnection.c | 8 +- + gio/gdbuserror.c | 2 +- + gio/gdbusintrospection.c | 2 +- + gio/gdbusmessage.c | 2 +- + gio/gdbusmethodinvocation.c | 2 +- + gio/gdbusnameowning.c | 4 +- + gio/gdbusnamewatching.c | 4 +- + gio/gdbusproxy.c | 2 +- + gio/gdbusproxywatching.c | 4 +- + gio/gdbusserver.c | 4 +- + gio/gdbusutils.c | 2 +- + gio/gunixconnection.c | 258 +++++++++++++++++++++++ + gio/gunixconnection.h | 10 + + 20 files changed, 712 insertions(+), 211 deletions(-) + +commit 47805f4e0cadf35bd6882d7e54374fead25637d2 +Author: Ryan Lortie +Date: Thu May 6 14:19:58 2010 -0500 + + Bug 617947 - glib-mkenums: add @valuenum@ support + + Add a @valuenum@ substitution that outputs the integer value of a + particular enum value. The value is determined by using (sandboxed) + perl to evaluate C expression. If evaluation fails then glib-mkenums + dies loudly. Evaluation is only enabled if '@valuenum@' appears + in the + template file, so existing users will not be affected. + + gobject/glib-mkenums.in | 36 ++++++++++++++++++++++++++++++------ + 1 files changed, 30 insertions(+), 6 deletions(-) + +commit 7aa71527e592d3c46d08a784cf061c79e61d11d8 +Author: Ryan Lortie +Date: Thu May 6 12:36:10 2010 -0500 + + glib-mkenums: Fix support for comment templates + + Currently, specifying a comment template in the template file + results in + the given template being appended to the default (C-style) one rather + than replacing it. + + This causes it to be replaced outright. + + Bug 617940. + + gobject/glib-mkenums.in | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit d0a14469d09d5fe23de219ba293fd4a266b02ced +Author: David Zeuthen +Date: Thu May 6 14:13:59 2010 -0400 + + Initial GDBus code-drop from GDBus-standalone repo + + Things compile and the test-suite passes. Still need to hook up + gio.symbols and docs. There are still a bunch of TODOs left in the + sources that needs to be addressed. + + Signed-off-by: David Zeuthen + + configure.in | 10 + + gio/Makefile.am | 58 +- + gio/gcredentials.c | 427 +++ + gio/gcredentials.h | 104 + + gio/gdbus-bash-completion.sh | 33 + + gio/gdbus-tool.c | 1491 +++++++++ + gio/gdbusaddress.c | 1004 ++++++ + gio/gdbusaddress.h | 54 + + gio/gdbusauth.c | 1538 +++++++++ + gio/gdbusauth.h | 86 + + gio/gdbusauthmechanism.c | 342 ++ + gio/gdbusauthmechanism.h | 174 + + gio/gdbusauthmechanismanon.c | 327 ++ + gio/gdbusauthmechanismanon.h | 82 + + gio/gdbusauthmechanismexternal.c | 416 +++ + gio/gdbusauthmechanismexternal.h | 82 + + gio/gdbusauthmechanismsha1.c | 1216 +++++++ + gio/gdbusauthmechanismsha1.h | 82 + + gio/gdbusauthobserver.c | 218 ++ + gio/gdbusauthobserver.h | 100 + + gio/gdbusconnection.c | 5280 + ++++++++++++++++++++++++++++++ + gio/gdbusconnection.h | 467 +++ + gio/gdbuserror.c | 847 +++++ + gio/gdbuserror.h | 92 + + gio/gdbusintrospection.c | 2009 ++++++++++++ + gio/gdbusintrospection.h | 255 ++ + gio/gdbusmessage.c | 2421 ++++++++++++++ + gio/gdbusmessage.h | 172 + + gio/gdbusmethodinvocation.c | 795 +++++ + gio/gdbusmethodinvocation.h | 119 + + gio/gdbusnameowning.c | 713 ++++ + gio/gdbusnameowning.h | 88 + + gio/gdbusnamewatching.c | 620 ++++ + gio/gdbusnamewatching.h | 68 + + gio/gdbusprivate.c | 1040 ++++++ + gio/gdbusprivate.h | 83 + + gio/gdbusproxy.c | 1542 +++++++++ + gio/gdbusproxy.h | 146 + + gio/gdbusproxywatching.c | 397 +++ + gio/gdbusproxywatching.h | 77 + + gio/gdbusserver.c | 1043 ++++++ + gio/gdbusserver.h | 97 + + gio/gdbusutils.c | 364 ++ + gio/gdbusutils.h | 42 + + gio/gio-marshal.list | 2 + + gio/gio.h | 16 + + gio/gioenums.h | 372 +++- + gio/giotypes.h | 19 + + gio/gunixcredentialsmessage.c | 341 ++ + gio/gunixcredentialsmessage.h | 68 + + gio/tests/Makefile.am | 98 +- + gio/tests/gdbus-addresses.c | 77 + + gio/tests/gdbus-connection.c | 653 ++++ + gio/tests/gdbus-error.c | 198 ++ + gio/tests/gdbus-example-own-name.c | 99 + + gio/tests/gdbus-example-peer.c | 318 ++ + gio/tests/gdbus-example-server.c | 388 +++ + gio/tests/gdbus-example-subtree.c | 410 +++ + gio/tests/gdbus-example-unix-fd-client.c | 145 + + gio/tests/gdbus-example-watch-name.c | 101 + + gio/tests/gdbus-example-watch-proxy.c | 205 ++ + gio/tests/gdbus-exit-on-close.c | 82 + + gio/tests/gdbus-export.c | 1410 ++++++++ + gio/tests/gdbus-introspection.c | 169 + + gio/tests/gdbus-names.c | 749 +++++ + gio/tests/gdbus-peer.c | 746 +++++ + gio/tests/gdbus-proxy.c | 455 +++ + gio/tests/gdbus-serialization.c | 650 ++++ + gio/tests/gdbus-sessionbus.c | 342 ++ + gio/tests/gdbus-sessionbus.h | 38 + + gio/tests/gdbus-tests.c | 218 ++ + gio/tests/gdbus-tests.h | 146 + + gio/tests/gdbus-testserver.py | 270 ++ + gio/tests/gdbus-threading.c | 532 +++ + 74 files changed, 35927 insertions(+), 11 deletions(-) + +commit 5b4189fc42afa697b7f13c38d9d6b441d731ed11 +Author: Vincent Untz +Date: Thu May 6 12:45:37 2010 +0200 + + Fix binding between writability of key and sensitivity of a widget + + We were not setting the key correctly, result in usage of invalid + keys. + + Bug 617788. + + gio/gsettings.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 81e98c399e11d7621c91ff2911ef4f92c7a382e5 +Author: Javier Jardón +Date: Thu May 6 06:28:54 2010 +0200 + + Clean Glib header #include issues: gthread + + glib/gthread.c | 7 ++++++- + glib/gthread.h | 1 - + 2 files changed, 6 insertions(+), 2 deletions(-) + +commit c7940d81802194abe1d4497d3daa2f9c59addb5e +Author: Javier Jardón +Date: Wed May 5 18:32:03 2010 +0200 + + Clean Glib header #include issues: gmem + + glib/gmem.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 21302a741cbb3d6373a368df148f6267a0705366 +Author: Javier Jardón +Date: Wed May 5 18:24:33 2010 +0200 + + Clean Glib header #include issues: gtestutils + + glib/gtestutils.c | 13 +++++++++++-- + glib/gtestutils.h | 1 - + 2 files changed, 11 insertions(+), 3 deletions(-) + +commit d1642386c96b4a2a4479cd7c2b5cd8ddadae99e4 +Author: Javier Jardón +Date: Wed May 5 18:12:04 2010 +0200 + + Clean Glib header #include issues: gasyncqueue + + glib/gasyncqueue.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 434a4e1d250157b13d7036592f097c18fb8376b1 +Author: Javier Jardón +Date: Wed May 5 17:32:12 2010 +0200 + + Do not include "glib.h" in gio files + + gio/gcharsetconverter.c | 4 ++-- + gio/gsocket.c | 4 ++-- + gio/gzlibcompressor.c | 6 +++--- + gio/gzlibdecompressor.c | 6 +++--- + 4 files changed, 10 insertions(+), 10 deletions(-) + +commit cbbc99d972a7c8ef4a37b29c19f46cfc11628e97 +Author: Tor Lillqvist +Date: Wed May 5 09:43:30 2010 +0300 + + Minor updates to README.win32. + + README.win32 | 57 + ++++++++++++++++++++++++++++++++------------------------- + 1 files changed, 32 insertions(+), 25 deletions(-) + +commit b3c9c17956a2e2640c1846879d930fd706eaf966 +Author: Xan Lopez +Date: Tue May 4 18:09:01 2010 +0200 + + Fix typo in limits documentation + + docs/reference/glib/tmpl/limits.sgml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f39a49b03610a1cd54b9feb18528f5c74539d5c9 +Author: Torsten Schönfeld +Date: Mon Apr 26 23:38:41 2010 +0200 + + gio: Add a boxed type for GFileAttributeMatcher + + https://bugzilla.gnome.org/show_bug.cgi?id=616892 + + docs/reference/gio/gio.types | 1 + + gio/gfileinfo.c | 18 ++++++++++++++++++ + gio/gfileinfo.h | 1 + + gio/gio.symbols | 1 + + 4 files changed, 21 insertions(+), 0 deletions(-) + +commit 4487b326d781d4359fd76ce51ce4002c9db5d6d5 +Author: Tor Lillqvist +Date: Mon May 3 19:56:46 2010 +0300 + + Fix list of sources in the gio Visual Studio project + + List the additional sources needed in gio/Makefile.am, not in + gio.vcprojin. Fix broken usage of sort. Filter out Unix-only source + files. + + build/win32/vs9/gio.vcprojin | 9 --------- + gio/Makefile.am | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 11 deletions(-) + +commit 0f795345d68be2af96cc030972786f2989ffd8c0 +Author: Tor Lillqvist +Date: Mon May 3 19:24:35 2010 +0300 + + Fix misspelled identifier in the Win32 code + + gio/gsocket.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 622916b731354c2dcd4178abf3ada08ca51dd38c +Author: Dan Winship +Date: Sun Apr 25 22:54:12 2010 -0400 + + g_cancellable_release_fd: allow NULL cancellable + + Almost all GCancellable methods silently do nothing if passed NULL for + the cancellable. Make g_cancellable_release_fd() do that as well. + + gio/gcancellable.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 644dfbd704d103df3a7ac13f31cfb87aa03f377d +Author: Ryan Lortie +Date: Sun May 2 14:14:30 2010 -0500 + + GSettings: fix mixed use of a pointer + + - used in some places as a move-along-as-we-go pointer + - used in other places as a pointer to the fixed base of an array + + Switch all users to the first style to avoid a crasher. + + gio/gsettingsbackend.c | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +commit 5821b7f099feaa58e9e476187d22a0a917cb099e +Author: Kjartan Maraas +Date: Sat May 1 14:25:22 2010 +0200 + + Updated Norwegian bokmål translation + + po/nb.po | 1024 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 517 insertions(+), 507 deletions(-) + +commit 4c10cad66175c9a4a79b764c2f807482811c5dcc +Author: Christian Persch +Date: Wed Apr 28 12:36:30 2010 +0200 + + Add API to get the compile and match flags from a GRegex + + Bug #616967. + + docs/reference/glib/glib-sections.txt | 2 + + docs/reference/glib/tmpl/gregex.sgml | 18 ++++++++++++++++ + glib/glib.symbols | 2 + + glib/gregex.c | 36 + +++++++++++++++++++++++++++++++++ + glib/gregex.h | 3 ++ + 5 files changed, 61 insertions(+), 0 deletions(-) + +commit 3d5ce40624561dc2f4779c5f9fc7f8b7d745aecd +Author: Shaun McCance +Date: Thu Apr 29 19:27:56 2010 -0500 + + [gvariant-varargs.xml] Fix some outdated documentation + + docs/reference/glib/gvariant-varargs.xml | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +commit 8dddf6499e9e8a052a5673fe8771aeaac08cccae +Author: Ryan Lortie +Date: Sun Apr 25 22:00:28 2010 -0500 + + GSettingsBackend API/ABI change + + - add list() virtual method + - add 'default_value' flag to read() call + + gio/gdelayedsettingsbackend.c | 8 ++- + gio/gio.symbols | 1 + + gio/gkeyfilesettingsbackend.c | 6 ++- + gio/gmemorysettingsbackend.c | 7 ++- + gio/gnullsettingsbackend.c | 3 +- + gio/gsettings.c | 2 +- + gio/gsettingsbackend.c | 91 + +++++++++++++++++++++++++++++----------- + gio/gsettingsbackend.h | 10 ++++- + gio/gsettingsbackendinternal.h | 3 +- + 9 files changed, 96 insertions(+), 35 deletions(-) + +commit 5215d4b6d316c9357b832c84aae4c4d756224b5d +Author: Ryan Lortie +Date: Wed Apr 28 12:39:02 2010 -0500 + + Add API for dconf's sake. + + gvdb-builder.c | 6 +- + gvdb-reader.c | 155 + +++++++++++++++++++++++++++++++++++++++++++++++--------- + gvdb-reader.h | 16 ++++++ + 3 files changed, 150 insertions(+), 27 deletions(-) + +commit 9ba690b386ebb8dc35665ff07b43c9a5874fda4b +Author: Dan Winship +Date: Tue Apr 27 09:25:45 2010 -0400 + + .gitignore updates for gsettings stuff + + docs/reference/gio/.gitignore | 1 + + gio/.gitignore | 2 ++ + gio/tests/.gitignore | 5 +++++ + 3 files changed, 8 insertions(+), 0 deletions(-) + +commit 9e40529e040e715ca65df735013969e20b05a150 +Author: Jorge González +Date: Tue Apr 27 21:05:13 2010 +0200 + + Updated Spanish translation + + po/es.po | 76 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 38 insertions(+), 38 deletions(-) + +commit 9ca75da1210bb88dc64b768db219f19de2b57573 +Author: Jorge González +Date: Tue Apr 27 20:59:07 2010 +0200 + + Updated Spanish translation + + po/es.po | 1041 + ++++++++++++++++++++++++++++++++------------------------------ + 1 files changed, 530 insertions(+), 511 deletions(-) + +commit 5046dfc85d7df95d7f8c87e3b41d9152bc50549a +Author: Dan Winship +Date: Mon Apr 12 10:21:20 2010 -0400 + + GSocket: fix garbled error messages on windows + + socket_strerror() was assuming all "strerror" messages are shorter + than 128 bytes, which is certainly true on Linux, but apparently not + on Windows. + + https://bugzilla.gnome.org/show_bug.cgi?id=615494 + + gio/gsocket.c | 17 +++++------------ + 1 files changed, 5 insertions(+), 12 deletions(-) + +commit 270a954b54521ce0eca6d408b8e8c081c70c3455 +Author: Alexander Larsson +Date: Tue Apr 27 09:23:07 2010 +0200 + + Allocate quarks in chunks to avoid overhead and fragmentation + + See bug 616720 for some measurements. + + glib/gdataset.c | 36 ++++++++++++++++++++++++++++++++++-- + 1 files changed, 34 insertions(+), 2 deletions(-) + +commit 3ceddd74bb4304e4e9b2e8955b80212108703632 +Author: David Zeuthen +Date: Mon Apr 26 16:37:02 2010 -0400 + + Bug 616877 – Several issues with g_socket_receive_message + + The messages array was not reallocated correctly because it was using + malloc instead of realloc. Also, if the user requested messages but + none were received we would segfault. Rewrite the code to fix this + and, for better readability, use GPtrArray instead of rolling our own. + + Also make the docs mention that the user need to free the returned + GSocketControlMessage objects using g_object_unref(). + + Clarify that *messages may be set to %NULL if there are no messages + (this will save pointless allocs of arrays). + + Finally, the Win32 version didn't set messages to the expected value. + + https://bugzilla.gnome.org/show_bug.cgi?id=616877 + + Signed-off-by: David Zeuthen + + gio/gsocket.c | 63 + ++++++++++++++++++++++++++++++++------------------------ + 1 files changed, 36 insertions(+), 27 deletions(-) + +commit cd062e841fecd51845b4a66473c7636706021dff +Author: Ryan Lortie +Date: Sun Apr 25 20:08:59 2010 -0500 + + docs and glib.symbols update + + docs/reference/glib/glib-sections.txt | 2 ++ + glib/glib.symbols | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +commit 6f7fb3744bbb4d1ee04d4e526d2ff7225c56c426 +Author: Christian Persch +Date: Sun Apr 25 20:07:26 2010 -0500 + + Add testcases for and + + Bug #616102. + + gio/tests/Makefile.am | 48 + +++++++++++++------- + gio/tests/gschema-compile.c | 40 + ++++++++++------- + .../array-default-not-in-choices.gschema.xml | 11 +++++ + .../schema-tests/choice-missing-value.gschema.xml | 10 ++++ + .../schema-tests/choices-wrong-type.gschema.xml | 8 +++ + .../default-not-in-choices.gschema.xml | 11 +++++ + .../schema-tests/default-out-of-range.gschema.xml | 8 +++ + .../schema-tests/range-missing-max.gschema.xml | 8 +++ + .../schema-tests/range-missing-min.gschema.xml | 8 +++ + .../schema-tests/range-wrong-type.gschema.xml | 8 +++ + 10 files changed, 127 insertions(+), 33 deletions(-) + +commit 22ce6ed82d9d1de823fab071d6dc288abedc1735 +Author: Ryan Lortie +Date: Sun Apr 25 19:59:59 2010 -0500 + + Add range restriction to gschema-compiler + + Patch from Christian Persch, with minor modifications. + + Bug #616102 + + gio/gschema-compile.c | 174 + ++++++++++++++++++++++++++++++++++++++++++++----- + gio/gschema.dtd | 6 +- + gio/gsettings.c | 6 +- + 3 files changed, 163 insertions(+), 23 deletions(-) + +commit 5e6e7cbadf2ee48c0e439a416e5fb74e8e5d8dee +Author: Ryan Lortie +Date: Sun Apr 25 19:10:44 2010 -0500 + + GVariant: add bind map for strings to byte arrays + + gio/gsettings-mapping.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit a52b6f7df2f91d4aae7f240038ab193a70052db5 +Author: Ryan Lortie +Date: Sun Apr 25 19:09:35 2010 -0500 + + Add g_variant_{new,get}_byte_array() + + Now that strings are strictly utf8 this provides a convenient API for + storing non-utf8 string data. + + glib/gvariant.c | 79 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + glib/gvariant.h | 4 +++ + 2 files changed, 83 insertions(+), 0 deletions(-) + +commit 4c189ba6b0ff81e13725029a00f2c4c7ab6a3b00 +Author: Shaun McCance +Date: Fri Apr 23 21:08:27 2010 -0500 + + Make glib_compile_schemas point to a binary that exists + + gio-2.0.pc.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9eeab5868f0d8633f63e40f61263cd731ad99d0e +Author: Ryan Lortie +Date: Sun Apr 25 13:36:36 2010 -0500 + + GVariant: strings are now utf8 + + - modify serialiser validation function to enforce utf8 encoding + - add documentation to g_variant_new_string(), + g_variant_get_string(), + g_variant_dup_string() + - add 2 new test cases to check that it works + + glib/gvariant-serialiser.c | 10 +++------- + glib/gvariant.c | 12 +++++++++--- + glib/tests/gvariant.c | 33 +++++++++++++++++++++++++++++++++ + 3 files changed, 45 insertions(+), 10 deletions(-) + +commit da306296cf1eb2ce7346e253c3ca46f784a04f8f +Author: Tor Lillqvist +Date: Sun Apr 25 17:26:41 2010 +0300 + + Can't use stderr as a field name + + gio/tests/gschema-compile.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 93d300742d6047f121c614df412717e09bc8def0 +Author: Fran Diéguez +Date: Sat Apr 24 03:46:59 2010 +0200 + + Updated Galician translation + + po/gl.po | 1002 + +++++++++++++++++++++++++++++++------------------------------- + 1 files changed, 506 insertions(+), 496 deletions(-) + +commit c50754c7c9286ba145a52885d65bb6ad50c8a2ef +Author: Matthias Clasen +Date: Fri Apr 23 20:50:27 2010 -0400 + + bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit afe3aef7b02e94e1d2b926e131beea2de5f5c96d +Author: Matthias Clasen +Date: Fri Apr 23 20:49:02 2010 -0400 + + 2.25.3 + + po/af.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/am.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ar.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/as.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ast.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/az.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/be.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/be@latin.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/bg.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/bn.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/bn_IN.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/bs.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ca.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ca@valencia.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/cs.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/cy.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/da.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/de.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/dz.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/el.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/en@shaw.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/en_CA.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/en_GB.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/eo.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/es.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/et.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/eu.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/fa.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/fi.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/fr.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ga.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/gl.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/gu.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/he.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/hi.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/hr.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/hu.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/hy.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/id.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/is.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/it.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ja.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ka.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/kn.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ko.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ku.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/lt.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/lv.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/mai.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/mg.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/mk.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ml.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/mn.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/mr.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ms.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/nb.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/nds.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ne.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/nl.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/nn.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/oc.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/or.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/pa.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/pl.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ps.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/pt.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/pt_BR.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ro.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ru.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/rw.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/si.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sk.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sl.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sq.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sr.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sr@ije.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sr@latin.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/sv.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/ta.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/te.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/th.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/tl.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/tr.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/tt.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/uk.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/vi.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/wa.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/xh.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/yi.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/zh_CN.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/zh_HK.po | 52 + ++++++++++++++++++++++++++++------------------------ + po/zh_TW.po | 52 + ++++++++++++++++++++++++++++------------------------ + 92 files changed, 2576 insertions(+), 2208 deletions(-) + +commit daa405c191c5efa8ad364414470b8fbdb0673401 +Author: Matthias Clasen +Date: Fri Apr 23 19:57:14 2010 -0400 + + Rename in more places + + gio/tests/Makefile.am | 2 +- + gio/tests/gsettings.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 72b80c5bdd6105ea06a55a4dba1c3350a459bb01 +Author: Matthias Clasen +Date: Fri Apr 23 19:18:41 2010 -0400 + + Updates + + NEWS | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +commit ec664445a9cf1769e440a25ffb4e17e9e644f6d0 +Author: Matthias Clasen +Date: Fri Apr 23 17:27:26 2010 -0400 + + Rename gschema-compile to glib-compile-schemas + + And clean up the autofoo a bit: use an uppercase variable, + check for pkg-config, check for presence of glib-compile-schemas. + + docs/reference/gio/Makefile.am | 4 +- + docs/reference/gio/gio-docs.xml | 2 +- + docs/reference/gio/glib-compile-schemas.xml | 85 + +++++++++++++++++++++++ + docs/reference/gio/gschema-compile.xml | 85 + ----------------------- + docs/reference/gio/gsettings-schema-convert.xml | 2 +- + docs/reference/gio/migrating.xml | 6 +- + gio-2.0.pc.in | 2 +- + gio/Makefile.am | 6 +- + gio/gsettings.c | 5 +- + gio/tests/gschema-compile.c | 2 +- + m4macros/gsettings.m4 | 13 +++- + 11 files changed, 109 insertions(+), 103 deletions(-) + +commit e6e7015bbd253b01b51186a931cdd58dfb4390f2 +Author: Matthias Clasen +Date: Fri Apr 23 14:52:26 2010 -0400 + + Fix up man page handling + + Turns out the formatted man pages did not end up in the tarballs. Doh. + + docs/reference/gio/Makefile.am | 32 +++++++++++++++++++++----------- + 1 files changed, 21 insertions(+), 11 deletions(-) + +commit 172c229c8f7965d2b40da56ec7147a250dfdee83 +Author: Ryan Lortie +Date: Fri Apr 23 13:54:02 2010 -0400 + + add missing #endif from last patch + + gio/gnetworkingprivate.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 1504a77655ec5291b8bccb321bc7e349dd2d53d3 +Author: Dan Winship +Date: Thu Feb 25 11:40:31 2010 -0500 + + GSocket: define CMSG_LEN and CMSG_SPACE if the system doesn't + + https://bugzilla.gnome.org/show_bug.cgi?id=589989 + + gio/gnetworkingprivate.h | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit 29f3e3f7663606872361079b6475b441df1f4a63 +Author: Dan Winship +Date: Thu Dec 31 10:29:23 2009 -0500 + + GSocket: add support for timeouts + + Also add options for testing timeouts to socket test programs + + https://bugzilla.gnome.org/show_bug.cgi?id=587898 + + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gsocket.c | 184 + ++++++++++++++++++++++++++++++++--- + gio/gsocket.h | 3 + + gio/tests/socket-client.c | 6 + + gio/tests/socket-server.c | 15 +++ + 6 files changed, 200 insertions(+), 12 deletions(-) + +commit 2c4a79c810a3fde1e30989b0c35677bf6e1337fc +Author: Dan Winship +Date: Thu Jul 9 09:55:00 2009 -0400 + + GSocket: Merge the unix and windows socket sources together + + And remove the bits that were added to gasynchelper.c to support the + previous unix socket source. + + part of https://bugzilla.gnome.org/show_bug.cgi?id=587898 + + gio/gasynchelper.c | 38 +++---------- + gio/gasynchelper.h | 27 +--------- + gio/gsocket.c | 144 + +++++++++++++++++++++++---------------------------- + 3 files changed, 77 insertions(+), 132 deletions(-) + +commit 5b329c506a8de5d21c3cd251be05a8d6b1f7fdba +Author: Dan Winship +Date: Fri Apr 23 12:21:38 2010 -0400 + + gio/tests/socket-client, socket-server: fix for win32 + + The addition of unix socket support broke these on win32 + + gio/tests/socket-client.c | 2 ++ + gio/tests/socket-common.c | 6 +++++- + gio/tests/socket-server.c | 2 ++ + 3 files changed, 9 insertions(+), 1 deletions(-) + +commit 3baff96b37060d5f771337e797343e507a79baf1 +Author: David Zeuthen +Date: Fri Apr 23 12:14:37 2010 -0400 + + Make sure G_TYPE_ERROR shows up in the docs + + This is related to bug 614541. + + Signed-off-by: David Zeuthen + + docs/reference/gobject/gobject-sections.txt | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit f68dc4d97d7aeaa8588a4ea0d36f057cd5aaf42e +Author: Javier Jardón +Date: Fri Apr 23 15:39:44 2010 +0200 + + [gsettings] Change AM_GSETTINGS macro to GLIB_GSETTINGS + + So we don't use Automake's macro namespace + + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=616648 + + docs/reference/gio/migrating.xml | 4 ++-- + m4macros/gsettings.m4 | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 38e2273207783e4396aabd47bdab5f28155ad6ae +Author: Emmanuele Bassi +Date: Tue Apr 6 16:17:18 2010 +0100 + + Add G_GNUC_DEPRECATED_FOR macro + + It would be good, error reporting-wise, to be able to signal which + function should be used instead of a deprecated one. GCC 4.5 added an + optional "message" payload to the deprecated attribute, so that: + + void f1 (void) __attribute__((deprecated("Use f2 instead"))); + + Will expand to: + + warning: f1 is deprecated: Use f2 instead + + Instead of just printing: + + warning: f1 is deprecated + + Since we already have a G_GNUC_DEPRECATED macro we should provide a + G_GNUC_DEPRECATED_FOR macro defined as: + + G_GNUC_DEPRECATED_FOR(bar) + + Which would expand the deprecation message to "Use bar instead" + automatically. The deprecation message should probably be similar + to what we use in gtk-doc to match up with the documentation. + + https://bugzilla.gnome.org/show_bug.cgi?id=614965 + + glib/gmacros.h | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 8f82b994c9963ad23a32f302dc2166f5ca4c2564 +Author: Matthias Clasen +Date: Thu Apr 22 22:24:38 2010 -0400 + + bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7c5849abc06a04c0dbaf2902b8104dcec90fa9b6 +Author: Matthias Clasen +Date: Thu Apr 22 22:23:09 2010 -0400 + + 2.25.2 + + po/af.po | 117 ++++++- + po/am.po | 117 ++++++- + po/ar.po | 117 ++++++- + po/as.po | 117 ++++++- + po/ast.po | 117 ++++++- + po/az.po | 117 ++++++- + po/be.po | 117 ++++++- + po/be@latin.po | 117 ++++++- + po/bg.po | 117 ++++++- + po/bn.po | 117 ++++++- + po/bn_IN.po | 117 ++++++- + po/bs.po | 117 ++++++- + po/ca.po | 117 ++++++- + po/ca@valencia.po | 990 + ++++++++++++++++++++++++------------------------- + po/cs.po | 117 ++++++- + po/cy.po | 117 ++++++- + po/da.po | 117 ++++++- + po/de.po | 117 ++++++- + po/dz.po | 117 ++++++- + po/el.po | 117 ++++++- + po/en@shaw.po | 117 ++++++- + po/en_CA.po | 117 ++++++- + po/en_GB.po | 117 ++++++- + po/eo.po | 117 ++++++- + po/es.po | 1078 + +++++++++++++++++++++++++++------------------------- + po/et.po | 117 ++++++- + po/eu.po | 117 ++++++- + po/fa.po | 117 ++++++- + po/fi.po | 117 ++++++- + po/fr.po | 117 ++++++- + po/ga.po | 117 ++++++- + po/gl.po | 990 + ++++++++++++++++++++++++------------------------- + po/gu.po | 117 ++++++- + po/he.po | 117 ++++++- + po/hi.po | 117 ++++++- + po/hr.po | 117 ++++++- + po/hu.po | 117 ++++++- + po/hy.po | 117 ++++++- + po/id.po | 117 ++++++- + po/is.po | 117 ++++++- + po/it.po | 118 ++++++- + po/ja.po | 117 ++++++- + po/ka.po | 117 ++++++- + po/kn.po | 1011 + +++++++++++++++++++++++++------------------------- + po/ko.po | 117 ++++++- + po/ku.po | 117 ++++++- + po/lt.po | 117 ++++++- + po/lv.po | 117 ++++++- + po/mai.po | 117 ++++++- + po/mg.po | 117 ++++++- + po/mk.po | 117 ++++++- + po/ml.po | 117 ++++++- + po/mn.po | 117 ++++++- + po/mr.po | 117 ++++++- + po/ms.po | 117 ++++++- + po/nb.po | 117 ++++++- + po/nds.po | 117 ++++++- + po/ne.po | 117 ++++++- + po/nl.po | 118 ++++++- + po/nn.po | 117 ++++++- + po/oc.po | 117 ++++++- + po/or.po | 117 ++++++- + po/pa.po | 117 ++++++- + po/pl.po | 117 ++++++- + po/ps.po | 117 ++++++- + po/pt.po | 117 ++++++- + po/pt_BR.po | 117 ++++++- + po/ro.po | 117 ++++++- + po/ru.po | 117 ++++++- + po/rw.po | 117 ++++++- + po/si.po | 117 ++++++- + po/sk.po | 117 ++++++- + po/sl.po | 117 ++++++- + po/sq.po | 117 ++++++- + po/sr.po | 117 ++++++- + po/sr@ije.po | 117 ++++++- + po/sr@latin.po | 117 ++++++- + po/sv.po | 117 ++++++- + po/ta.po | 117 ++++++- + po/te.po | 117 ++++++- + po/th.po | 117 ++++++- + po/tl.po | 117 ++++++- + po/tr.po | 117 ++++++- + po/tt.po | 117 ++++++- + po/uk.po | 117 ++++++- + po/vi.po | 117 ++++++- + po/wa.po | 117 ++++++- + po/xh.po | 117 ++++++- + po/yi.po | 117 ++++++- + po/zh_CN.po | 117 ++++++- + po/zh_HK.po | 117 ++++++- + po/zh_TW.po | 117 ++++++- + 92 files changed, 12078 insertions(+), 2289 deletions(-) + +commit 25725345fbb184ecbdc62c7ac418cd01f0fc8b0f +Author: Matthias Clasen +Date: Thu Apr 22 22:01:19 2010 -0400 + + Fix up distcheck + + docs/reference/gio/Makefile.am | 2 +- + docs/reference/gio/gio.types | 1 + + gio/gio.symbols | 1 + + 3 files changed, 3 insertions(+), 1 deletions(-) + +commit b2ee97d00db227c042158951467495baf68529e4 +Author: Matthias Clasen +Date: Thu Apr 22 20:48:24 2010 -0400 + + Fix up g_variant_compare addition + + docs/reference/glib/glib-sections.txt | 1 + + glib/glib.symbols | 1 + + glib/gvariant.c | 2 ++ + glib/gvariant.h | 3 ++- + 4 files changed, 6 insertions(+), 1 deletions(-) + +commit 8f7122433f69180533b15584ae5abf0e50007207 +Author: Matthias Clasen +Date: Thu Apr 22 20:15:29 2010 -0400 + + More updates + + NEWS | 30 ++++++++++++++++++++++++++++-- + 1 files changed, 28 insertions(+), 2 deletions(-) + +commit b440cc154669b492b5301e221d85bf6b8586a994 +Author: Matthias Clasen +Date: Thu Apr 22 20:10:56 2010 -0400 + + Add a boxed type for GError + + Patch by Sebastian Dröge, bug 614541 + + gobject/gboxed.c | 13 +++++++++++++ + gobject/gboxed.h | 9 +++++++++ + gobject/gobject.symbols | 1 + + 3 files changed, 23 insertions(+), 0 deletions(-) + +commit 4a62a00c4c52634062caaaa1de9c48246f393967 +Author: Matthias Clasen +Date: Thu Apr 22 20:02:49 2010 -0400 + + Document --dry-run option of gschema-compile + + docs/reference/gio/gschema-compile.xml | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 00a7c2e635a4fa95257779c271f0eaa5992e2b37 +Author: Behdad Esfahbod +Date: Thu Apr 22 19:48:13 2010 -0400 + + Bug 615379 - g_new macros crash if sizeof(struct_type) == 0 + + glib/gmem.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 7b43d2d299ef58f5d174b1b5bf4704488981259b +Author: Matthias Clasen +Date: Thu Apr 22 19:31:39 2010 -0400 + + Fix !srcdir build + + Bug 616216 + + gthread/tests/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 708d540a6f364b254f001b863be837ca9a0e1797 +Author: Matthias Clasen +Date: Thu Apr 22 01:29:53 2010 -0400 + + Updates + + NEWS | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit 626e90403e8b77ebd77e75e7239defbfe06eb941 +Author: Carles Ferrando +Date: Fri Apr 23 00:45:49 2010 +0200 + + Updated Catalan (Valencian) translation + + po/ca@valencia.po | 1363 + +++++++++++++++++++++++++++++------------------------ + 1 files changed, 748 insertions(+), 615 deletions(-) + +commit daa1a73c752e66d53de6016a9baa2be14d59af61 +Author: Ryan Lortie +Date: Thu Apr 22 15:44:54 2010 -0400 + + Add a missing 'static' on internal functions + + gvdb-builder.c | 2 +- + gvdb-reader.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 19d8cc33759e38a7cfcf7ddaa2e80e7c4ddc2d3c +Author: Dan Winship +Date: Tue Apr 20 17:23:49 2010 -0400 + + GUnixSocketAddress: handle abstract sockets with non-0-padded names + + There are apparently two incompatible ways of naming abstract sockets: + pad the sockaddr with 0s and use the entire thing as the name, or else + don't, and just pass a shorter length value to the relevant functions. + We previously only supported the former method. Add support for the + latter. + + Also correctly handle "anonymous" unix sockaddrs (eg, the client side + of a connection, or a socketpair() socket), and add unix domain socket + support to the socket-client and socket-server test programs to make + sure this all works. + + https://bugzilla.gnome.org/show_bug.cgi?id=615960 + + docs/reference/gio/gio-sections.txt | 3 + + gio/gio.symbols | 10 ++- + gio/gioenums.h | 34 ++++++ + gio/gsocketaddress.c | 41 ++++++- + gio/gunixsocketaddress.c | 209 + ++++++++++++++++++++++++++++------- + gio/gunixsocketaddress.h | 10 ++- + gio/tests/Makefile.am | 1 + + gio/tests/socket-client.c | 54 ++++++---- + gio/tests/socket-common.c | 56 +++++++++ + gio/tests/socket-server.c | 68 ++++++++---- + gio/tests/unix-fd.c | 61 ++++++++--- + 11 files changed, 438 insertions(+), 109 deletions(-) + +commit 5e892de8afaf564838910f11bdc383ab441417ca +Author: Fran Diéguez +Date: Thu Apr 22 16:29:06 2010 +0200 + + Updated Galician translations + + po/gl.po | 1079 + +++++++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 611 insertions(+), 468 deletions(-) + +commit 3e9a296b29c613b8f09c735ad2dabd9048e9025b +Author: Shankar Prasad +Date: Thu Apr 22 16:09:58 2010 +0530 + + Updated Kannada translations + + po/kn.po | 1122 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 614 insertions(+), 508 deletions(-) + +commit f3e04973e7977841dc946089967c397490f4fd57 +Author: Matthias Clasen +Date: Thu Apr 22 01:15:54 2010 -0400 + + Rename gsettings-tool to gsettings + + And make it verb-based. + + docs/reference/gio/Makefile.am | 10 +- + docs/reference/gio/gio-docs.xml | 8 +- + docs/reference/gio/gschema-compile.xml | 7 +- + docs/reference/gio/gsettings-tool.xml | 93 ------- + docs/reference/gio/gsettings.xml | 137 +++++++++++ + gio/Makefile.am | 6 +- + gio/gsettings-tool.c | 410 + ++++++++++++++++++++++++-------- + 7 files changed, 464 insertions(+), 207 deletions(-) + +commit bf0f8ad8ee800b9a1f76a57684b45f79e2e6e5d8 +Author: Javier Jardón +Date: Thu Apr 22 03:20:17 2010 +0200 + + [gsettings] Add g_return_*_if_fail() guards in GSettingsBackend + + gio/gsettingsbackend.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 0fa791b29d4b3aa2154f322dda5a7c0d2caa1ede +Author: Javier Jardón +Date: Thu Apr 22 03:07:49 2010 +0200 + + [gsettings] Add g_return_*_if_fail() guards + + Reported by Christian Persch here: + https://bugzilla.gnome.org/show_bug.cgi?id=616405 + + gio/gsettings.c | 16 ++++++++++++++++ + 1 files changed, 16 insertions(+), 0 deletions(-) + +commit 78ed401a5146ac1d2f83f19b6a6fcfe789d847cb +Author: Matthias Clasen +Date: Wed Apr 21 21:03:53 2010 -0400 + + Add a test for g_settings_get_child + + gio/tests/gsettings.c | 30 ++++++++++++++++++++++++++++++ + 1 files changed, 30 insertions(+), 0 deletions(-) + +commit 88ff21ee92237858b65560d20f255506f2125a55 +Author: Matthias Clasen +Date: Wed Apr 21 18:08:05 2010 -0400 + + Be more careful about memory management + + This was leading to crashes, e.g. bug 616432. + + gio/gschema-compile.c | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +commit 89b718f7d396c165a023e46c5111549a2a1e2d1c +Author: Matthias Clasen +Date: Wed Apr 21 17:44:47 2010 -0400 + + Pedantic terminology fix + + Elements are not function calls and attributes are not arguments... + + gio/gschema-compile.c | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +commit 0d9a40b8943ec3b9926efad93a28687708cc2038 +Author: Colin Walters +Date: Wed Apr 21 16:44:26 2010 -0400 + + Fix typo in GMutex error message + + gthread/gthread-impl.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 585a37f37455e1b91029db6c40b3a0e2932e0604 +Author: Matthias Clasen +Date: Wed Apr 21 14:47:32 2010 -0400 + + Handle NULL string properties in bindings + + Admittely, we just handle them by failing the conversion... + + gio/gsettings-mapping.c | 4 +++- + gio/gsettings.c | 6 +++--- + gio/tests/gsettings.c | 1 - + 3 files changed, 6 insertions(+), 5 deletions(-) + +commit 3814868b7a1950286f875b193dd10aa20b482fe6 +Author: Dan Winship +Date: Wed Apr 21 13:37:59 2010 -0400 + + gio.symbols: add two missing G_GNUC_CONSTs + + gio/gio.symbols | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 887dd88ac2615d8837e06ce9b18cddeeb04f4494 +Author: Jorge González +Date: Wed Apr 21 18:46:19 2010 +0200 + + Updated Spanish translation + + po/es.po | 1044 + ++++++++++++++++++++++++++++++++++---------------------------- + 1 files changed, 569 insertions(+), 475 deletions(-) + +commit 03a0f05058a1156edaab463da03f58b0f4988625 +Author: Matthias Clasen +Date: Wed Apr 21 12:37:38 2010 -0400 + + Add a note about requiring a new enough GConf + + docs/reference/gio/migrating.xml | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit ccf9361490fa3684b22e52655e3236b2cd28a517 +Author: Matthias Clasen +Date: Wed Apr 21 12:31:33 2010 -0400 + + Handle non-readable/-writable properties when binding + + And document readability/writability requirements for binding flags. + + gio/gsettings.c | 31 ++++++++++++++++++++++++++++++- + gio/gsettings.h | 6 ++++-- + 2 files changed, 34 insertions(+), 3 deletions(-) + +commit 8a988e8e88f0b3463c7dd6fc5145174035d4e815 +Author: Matthias Clasen +Date: Wed Apr 21 12:31:10 2010 -0400 + + Test binding non-readable/writable properties + + gio/tests/gsettings.c | 88 + ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 87 insertions(+), 1 deletions(-) + +commit 3bfd739154b09c42b29bfcc38b03ff9b98ed4c4f +Author: Matthias Clasen +Date: Wed Apr 21 11:50:21 2010 -0400 + + Rename gsettingsschemaupdatecache to the more sane gschema_compile + + To follow existing glib pc variables for binaries. + + docs/reference/gio/migrating.xml | 7 ++++--- + gio-2.0.pc.in | 2 +- + m4macros/gsettings.m4 | 4 ++-- + 3 files changed, 7 insertions(+), 6 deletions(-) + +commit 662f97fefbdb26eff4283757912350c3c15adf49 +Author: Bastien Nocera +Date: Wed Apr 21 16:49:00 2010 +0100 + + Update GSettings porting guide for new m4 macro + + docs/reference/gio/migrating.xml | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +commit 0d322e77a55c3b457361ede40c391a6a0b825c78 +Author: Bastien Nocera +Date: Wed Apr 21 12:25:23 2010 +0100 + + Add GSettings m4 macros helper + + https://bugzilla.gnome.org/show_bug.cgi?id=616312 + + m4macros/Makefile.am | 2 +- + m4macros/gsettings.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+), 1 deletions(-) + +commit 12b801cab4d639f3ac86f1009e6bfb3f589729c5 +Author: Matthias Clasen +Date: Wed Apr 21 10:58:05 2010 -0400 + + Nuke the gsettingsschemadir pc variable + + Not really useful, just use $(prefix)/glib-2.0/schemas. We are getting + m4 sugar to coat this over, anyway. + + docs/reference/gio/migrating.xml | 21 ++++++++++++++------- + gio-2.0.pc.in | 1 - + 2 files changed, 14 insertions(+), 8 deletions(-) + +commit e63a1a3d6e6ce4aa8dd7fb65ccaac0b989de12d9 +Author: Bastien Nocera +Date: Wed Apr 21 15:02:50 2010 +0100 + + Fix gschema-compile tests for --schema-files changes + + gio/tests/gschema-compile.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1c2aea7854e468651807994ad168564c626ae58b +Author: Matthias Clasen +Date: Wed Apr 21 09:50:17 2010 -0400 + + Add tests for --allow-any-name + + gio/tests/gschema-compile.c | 40 + +++++++++++++++++--------- + gio/tests/schema-tests/bad-key.gschema.xml | 2 +- + gio/tests/schema-tests/bad-key2.gschema.xml | 2 +- + gio/tests/schema-tests/bad-key3.gschema.xml | 2 +- + gio/tests/schema-tests/bad-key4.gschema.xml | 2 +- + 5 files changed, 30 insertions(+), 18 deletions(-) + +commit 0b61a87c29f27f988538f92d676a04adfd65b0fd +Author: Bastien Nocera +Date: Wed Apr 21 12:14:40 2010 +0100 + + Allow passing multiple schemas to gschema-compile + + To make test suites easier to implement + + https://bugzilla.gnome.org/show_bug.cgi?id=616312 + + gio/gschema-compile.c | 24 ++++++++++++------------ + 1 files changed, 12 insertions(+), 12 deletions(-) + +commit 9176175fc878bde7143d22f5671b58836985bf44 +Author: Bastien Nocera +Date: Wed Apr 21 11:15:30 2010 +0100 + + Add mention of GConfBridge in conversion docs + + https://bugzilla.gnome.org/show_bug.cgi?id=616384 + + docs/reference/gio/migrating.xml | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 97084317883ea13f5e9ddc3b496cf1f756d85e4f +Author: Matthias Clasen +Date: Wed Apr 21 09:34:57 2010 -0400 + + Remove leftover test data + + gio/tests/schema-tests/bad-type/test.gschema.xml | 7 ------- + .../schema-tests/incomplete-list/test.gschema.xml | 7 ------- + .../schema-tests/missing-quotes/test.gschema.xml | 7 ------- + gio/tests/schema-tests/no-default/test.gschema.xml | 6 ------ + gio/tests/schema-tests/overflow/test.gschema.xml | 7 ------- + .../schema-tests/wrong-category/test.gschema.xml | 7 ------- + 6 files changed, 0 insertions(+), 41 deletions(-) + +commit 64cc81f769ef6ac97b8b9ff4d2693066ffcac63f +Author: Matthias Clasen +Date: Wed Apr 21 09:33:57 2010 -0400 + + Add an --allow-any-name option + + This will make it easier for people to keep their GConf key names + in the transition period. + + Conflicts: + + gio/gschema-compile.c + + gio/gschema-compile.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit c83a9762453ea996c5619b8a681d3d1fd2cf473f +Author: Matthias Clasen +Date: Wed Apr 21 00:43:55 2010 -0400 + + Add some more schema compiler tests + + gio/tests/Makefile.am | 7 +- + gio/tests/gschema-compile.c | 143 + ++++++-------------------- + gio/tests/schema-tests/bad-key.gschema.xml | 7 ++ + gio/tests/schema-tests/bad-key2.gschema.xml | 7 ++ + gio/tests/schema-tests/bad-key3.gschema.xml | 7 ++ + gio/tests/schema-tests/bad-key4.gschema.xml | 7 ++ + gio/tests/schema-tests/empty-key.gschema.xml | 7 ++ + 7 files changed, 75 insertions(+), 110 deletions(-) + +commit 564714bc95a11fdb06206e91f46a713b67be30ae +Author: Matthias Clasen +Date: Tue Apr 20 23:40:22 2010 -0400 + + Fix type mapping for float in gsettings-schema-convert + + Bug 616331. + + gio/gsettings-schema-convert | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit afff087785e1206c4a112367aaf3445dd5cf0c08 +Author: Matthias Clasen +Date: Tue Apr 20 23:28:49 2010 -0400 + + Simplify gschema-compile test suite + + Add --one-schema-file option to gschema-compile to allow easier test + setup. Simplify the test setup. + + Bug #616276. + + gio/gschema-compile.c | 52 + +++++++++++++------- + gio/tests/Makefile.am | 20 ++++---- + gio/tests/schema-tests/bad-type.gschema.xml | 7 +++ + gio/tests/schema-tests/incomplete-list.gschema.xml | 7 +++ + gio/tests/schema-tests/missing-quotes.gschema.xml | 7 +++ + gio/tests/schema-tests/no-default.gschema.xml | 6 ++ + gio/tests/schema-tests/overflow.gschema.xml | 7 +++ + gio/tests/schema-tests/wrong-category.gschema.xml | 7 +++ + 8 files changed, 85 insertions(+), 28 deletions(-) + +commit 463203ee0aa75e727df3b756fcf589fefc8a99cc +Author: Matthias Clasen +Date: Tue Apr 20 22:49:32 2010 -0400 + + Add gettext-domain when required, and allow to specify it on the + cmdline + + Bug 616309 + + docs/reference/gio/gsettings-schema-convert.xml | 8 ++++++++ + gio/gsettings-schema-convert | 16 +++++++++++++--- + 2 files changed, 21 insertions(+), 3 deletions(-) + +commit bedf4c3259756caec97d5aa4cd32d501de2be82e +Author: Matthias Clasen +Date: Tue Apr 20 22:41:12 2010 -0400 + + Add documentation and translation for gsettings-tool + + docs/reference/gio/Makefile.am | 3 + + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gsettings-tool.xml | 93 + +++++++++++++++++++++++++++++++++ + gio/gschema-compile.c | 27 ++++++---- + gio/gsettings-tool.c | 33 ++++++------ + po/POTFILES.in | 4 ++ + 6 files changed, 135 insertions(+), 26 deletions(-) + +commit 1dbe06c30a766171d4f018539a92cee237cb63c7 +Author: Matthias Clasen +Date: Tue Apr 20 20:54:53 2010 -0400 + + Add a minimal commandline utility to poke GSettings + + gio/Makefile.am | 8 ++- + gio/gsettings-tool.c | 169 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 176 insertions(+), 1 deletions(-) + +commit 3569de342e415c887537d811a0df373cfdb85bc6 +Author: Javier Jardón +Date: Tue Apr 20 05:38:02 2010 +0200 + + [gio] Use G_DEFINE_INTERFACE macro + + Use this macro in gasyncinitable, gconverter, ginitable and + gsocketconnectable + + https://bugzilla.gnome.org/show_bug.cgi?id=616245 + + gio/gasyncinitable.c | 35 +++-------------------------------- + gio/gconverter.c | 35 +++-------------------------------- + gio/ginitable.c | 33 +++++---------------------------- + gio/gsocketconnectable.c | 32 +++++--------------------------- + 4 files changed, 16 insertions(+), 119 deletions(-) + +commit 3585e64be81a6846b23ca0c0c2969a83080a460d +Author: Tor Lillqvist +Date: Wed Apr 21 03:22:59 2010 +0300 + + Tweak the generation of the file list in gio.vcproj + + Visual Studio doesn't like slash as directory separator, so use + backslash. While at it, sort the list of files put in the project file + just for clarity. + + gio/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 8b6d2c1fc15c91ec174a6b346257a228d3db08e2 +Author: Ryan Lortie +Date: Tue Apr 20 20:14:50 2010 -0400 + + remove empty initialisers { } for MSVC's sake + + gio/gsettings.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit a4e38786750d538b334b8a7a7cc9f5a3ff48bc33 +Merge: 31a5342 291a5c9 +Author: Ryan Lortie +Date: Tue Apr 20 20:13:56 2010 -0400 + + Merge remote branch 'gvdb/master' + +commit 291a5c9ed98cf5456c8d6af0c3113610646de7b3 +Author: Ryan Lortie +Date: Tue Apr 20 20:12:41 2010 -0400 + + __value -> value to avoid stomping the C compiler + + gvdb-format.h | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 31a534278405b77fe8ea4aaa85ba5ae80c92d80e +Author: Matthias Clasen +Date: Tue Apr 20 19:51:28 2010 -0400 + + Refer to the right directory + + docs/reference/gio/migrating.xml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9488d18a87bdba2b4180280d8109ab5381acf9c8 +Author: Christian Persch +Date: Tue Apr 20 19:39:03 2010 -0400 + + Fix gsettings mapping for uint64 + + Bug #616295. + + gio/gsettings-mapping.c | 4 ++-- + gio/tests/gsettings.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 1b61680abbf8ba10a24aff52397364c844f368bb +Author: Matthias Clasen +Date: Tue Apr 20 19:23:52 2010 -0400 + + Flesh out the porting guide some more + + docs/reference/gio/migrating.xml | 154 + ++++++++++++++++++++++++++++++-------- + gio/gsettings.c | 17 +++- + 2 files changed, 135 insertions(+), 36 deletions(-) + +commit 3277b77769def1aabfa850858197d02b0afca364 +Author: Matthias Clasen +Date: Tue Apr 20 15:13:07 2010 -0400 + + Document g_settings_bind_writable + + docs/reference/gio/gio-sections.txt | 1 + + gio/gsettings.c | 36 + ++++++++++++++++++++++++++++++++++- + 2 files changed, 36 insertions(+), 1 deletions(-) + +commit 9717833e8200929f908fa682262fcfda8f964653 +Author: Richard Hughes +Date: Tue Apr 20 22:25:23 2010 +0100 + + Don't crash gsettings-schema-convert for GConf schemas that contain + empty elements + + This can be observed in gnome-power-manager with one of the entries + that + contains + + gio/gsettings-schema-convert | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit f82839b8fe6e112b9cc02637e7544e800524c179 +Author: Ryan Lortie +Date: Tue Apr 20 17:27:17 2010 -0400 + + gschema-compile: output to srcdir by default + + If the target directory is not explicitly set then output to the + source + directory. Closes bug #616311 reported by Bastien Nocera. + + gio/gschema-compile.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit f5990c1aefe364cfdd8c6d4bcdcc5dce60ced003 +Author: Ryan Lortie +Date: Tue Apr 20 12:30:12 2010 -0400 + + GSettings: bind to writablity of a key + + gio/gio.symbols | 1 + + gio/gsettings.c | 103 + ++++++++++++++++++++++++++++++++++++++---------------- + gio/gsettings.h | 5 +++ + 3 files changed, 78 insertions(+), 31 deletions(-) + +commit 890a842b2692292d207e1c473718c57ee1e51c32 +Author: Richard Hughes +Date: Tue Apr 20 16:14:11 2010 +0100 + + Fix up the gtk-doc comment for the GSettings::changed signal + + gio/gsettings.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 5445ae78c21a71b3d8eea393bfe70d2ab1c24766 +Author: Ryan Lortie +Date: Mon Apr 19 14:16:06 2010 -0400 + + Add g_variant_compare() for like basic types + + glib/gvariant.c | 105 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 104 insertions(+), 1 deletions(-) + +commit 3c54cc074dc783ab4944e1cc15d690b467a09684 +Author: Ryan Lortie +Date: Mon Apr 19 11:05:04 2010 -0400 + + gschema-compile: return quickly on parse error + + Suggested by Christian Persch in #616102 + + gio/gschema-compile.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit bed462046afd33356b0b0554d0ee8ed31d4a2de0 +Author: Javier Jardón +Date: Tue Apr 20 01:04:31 2010 +0200 + + [docs] Fix G_VALUE_COLLECT_INIT documentation + + Add the documentation to the corresponding section + + This macro was introduced in + commit 546fc0ca331c8d1b3393fe218a697b6a1a1c1072 + + docs/reference/gobject/gobject-sections.txt | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 4c276d05aa010d54e921ca1de7bdafe262dd278e +Author: Matthias Clasen +Date: Mon Apr 19 19:01:46 2010 -0400 + + Bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f8fa527bfd73833ec1fcdaa13c6b8b5701fb65ae +Author: Matthias Clasen +Date: Mon Apr 19 19:00:28 2010 -0400 + + 2.25.1 + + po/af.po | 2 +- + po/am.po | 2 +- + po/ar.po | 2 +- + po/as.po | 2 +- + po/ast.po | 2 +- + po/az.po | 2 +- + po/be.po | 2 +- + po/be@latin.po | 2 +- + po/bg.po | 2 +- + po/bn.po | 2 +- + po/bn_IN.po | 2 +- + po/bs.po | 2 +- + po/ca.po | 2 +- + po/ca@valencia.po | 2 +- + po/cs.po | 2 +- + po/cy.po | 2 +- + po/da.po | 2 +- + po/de.po | 2 +- + po/dz.po | 2 +- + po/el.po | 2 +- + po/en@shaw.po | 2 +- + po/en_CA.po | 2 +- + po/en_GB.po | 2 +- + po/eo.po | 2 +- + po/es.po | 2 +- + po/et.po | 2 +- + po/eu.po | 2 +- + po/fa.po | 2 +- + po/fi.po | 2 +- + po/fr.po | 2 +- + po/ga.po | 2 +- + po/gl.po | 2 +- + po/gu.po | 2 +- + po/he.po | 2 +- + po/hi.po | 2 +- + po/hr.po | 2 +- + po/hu.po | 2 +- + po/hy.po | 2 +- + po/id.po | 2 +- + po/is.po | 2 +- + po/it.po | 2 +- + po/ja.po | 2 +- + po/ka.po | 2 +- + po/kn.po | 2 +- + po/ko.po | 2 +- + po/ku.po | 2 +- + po/lt.po | 2 +- + po/lv.po | 2 +- + po/mai.po | 2 +- + po/mg.po | 2 +- + po/mk.po | 2 +- + po/ml.po | 2 +- + po/mn.po | 2 +- + po/mr.po | 2 +- + po/ms.po | 2 +- + po/nb.po | 2 +- + po/nds.po | 2 +- + po/ne.po | 2 +- + po/nl.po | 2 +- + po/nn.po | 2 +- + po/oc.po | 2 +- + po/or.po | 2 +- + po/pa.po | 2 +- + po/pl.po | 2 +- + po/ps.po | 2 +- + po/pt.po | 2 +- + po/pt_BR.po | 2 +- + po/ro.po | 2 +- + po/ru.po | 2 +- + po/rw.po | 2 +- + po/si.po | 2 +- + po/sk.po | 2 +- + po/sl.po | 2 +- + po/sq.po | 2 +- + po/sr.po | 2 +- + po/sr@ije.po | 2 +- + po/sr@latin.po | 2 +- + po/sv.po | 2 +- + po/ta.po | 2 +- + po/te.po | 2 +- + po/th.po | 2 +- + po/tl.po | 2 +- + po/tr.po | 2 +- + po/tt.po | 2 +- + po/uk.po | 2 +- + po/vi.po | 2 +- + po/wa.po | 2 +- + po/xh.po | 2 +- + po/yi.po | 2 +- + po/zh_CN.po | 2 +- + po/zh_HK.po | 2 +- + po/zh_TW.po | 2 +- + 92 files changed, 92 insertions(+), 92 deletions(-) + +commit 3b9de5f10a15086dd4c95e6260a20b8f5e917281 +Author: Matthias Clasen +Date: Mon Apr 19 18:26:41 2010 -0400 + + Don't forget to install and distribute gsettings-schema-convert + + gio/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7d330078e77c51ede181ceda10260fb79a7e2425 +Author: Matthias Clasen +Date: Mon Apr 19 18:26:41 2010 -0400 + + Don't forget to install and distribute gsettings-schema-convert + + gio/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit ca4f0a3d6d99ee1eb4f21aa753b2cc29ac5e2d36 +Author: Matthias Clasen +Date: Mon Apr 19 17:33:03 2010 -0400 + + Bump version + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit cd9b8b563f3dc094b72ebc0c7f55e35f4782aab1 +Author: Matthias Clasen +Date: Mon Apr 19 17:30:42 2010 -0400 + + 2.25.0 + + docs/reference/glib/glib-gettextize.1 | 80 ++- + docs/reference/glib/gtester-report.1 | 10 +- + docs/reference/glib/gtester.1 | 12 +- + docs/reference/glib/tmpl/async_queues.sgml | 4 + + docs/reference/glib/tmpl/atomic_operations.sgml | 33 +- + docs/reference/glib/tmpl/bookmarkfile.sgml | 4 + + docs/reference/glib/tmpl/byte_order.sgml | 3 + + docs/reference/glib/tmpl/conversions.sgml | 3 + + docs/reference/glib/tmpl/date.sgml | 4 + + docs/reference/glib/tmpl/error_reporting.sgml | 3 + + docs/reference/glib/tmpl/fileutils.sgml | 3 + + docs/reference/glib/tmpl/gregex.sgml | 3 + + docs/reference/glib/tmpl/hooks.sgml | 3 + + docs/reference/glib/tmpl/i18n.sgml | 4 + + docs/reference/glib/tmpl/keyfile.sgml | 4 + + docs/reference/glib/tmpl/limits.sgml | 3 + + docs/reference/glib/tmpl/macros.sgml | 3 + + docs/reference/glib/tmpl/macros_misc.sgml | 3 + + docs/reference/glib/tmpl/main.sgml | 10 + + docs/reference/glib/tmpl/markup.sgml | 3 + + docs/reference/glib/tmpl/memory.sgml | 5 + + docs/reference/glib/tmpl/memory_slices.sgml | 3 + + docs/reference/glib/tmpl/messages.sgml | 3 + + docs/reference/glib/tmpl/misc_utils.sgml | 19 + + docs/reference/glib/tmpl/modules.sgml | 5 + + docs/reference/glib/tmpl/numerical.sgml | 3 + + docs/reference/glib/tmpl/queue.sgml | 4 + + docs/reference/glib/tmpl/scanner.sgml | 3 + + docs/reference/glib/tmpl/spawn.sgml | 3 + + docs/reference/glib/tmpl/string_utils.sgml | 3 + + docs/reference/glib/tmpl/strings.sgml | 3 + + docs/reference/glib/tmpl/testing.sgml | 22 +- + docs/reference/glib/tmpl/trash_stack.sgml | 3 + + docs/reference/glib/tmpl/type_conversion.sgml | 3 + + docs/reference/glib/tmpl/types.sgml | 3 + + docs/reference/glib/tmpl/unicode.sgml | 3 + + docs/reference/glib/tmpl/version.sgml | 3 + + docs/reference/glib/tmpl/warnings.sgml | 3 + + docs/reference/glib/tmpl/windows.sgml | 5 + + docs/reference/gobject/glib-genmarshal.1 | 10 +- + docs/reference/gobject/glib-mkenums.1 | 13 +- + docs/reference/gobject/gobject-query.1 | 10 +- + gio/tests/Makefile.am | 8 +- + gio/tests/gschema-compile.c | 78 ++- + gio/tests/gsettings.c | 6 +- + po/af.po | 108 ++-- + po/am.po | 108 ++-- + po/ar.po | 108 ++-- + po/as.po | 108 ++-- + po/ast.po | 108 ++-- + po/az.po | 108 ++-- + po/be.po | 108 ++-- + po/be@latin.po | 108 ++-- + po/bg.po | 108 ++-- + po/bn.po | 978 + +++++++++++------------ + po/bn_IN.po | 108 ++-- + po/bs.po | 108 ++-- + po/ca.po | 952 + +++++++++++----------- + po/ca@valencia.po | 108 ++-- + po/cs.po | 108 ++-- + po/cy.po | 108 ++-- + po/da.po | 942 + +++++++++++----------- + po/de.po | 108 ++-- + po/dz.po | 108 ++-- + po/el.po | 108 ++-- + po/en@shaw.po | 108 ++-- + po/en_CA.po | 108 ++-- + po/en_GB.po | 108 ++-- + po/eo.po | 108 ++-- + po/es.po | 108 ++-- + po/et.po | 108 ++-- + po/eu.po | 108 ++-- + po/fa.po | 108 ++-- + po/fi.po | 108 ++-- + po/fr.po | 108 ++-- + po/ga.po | 108 ++-- + po/gl.po | 108 ++-- + po/gu.po | 974 + ++++++++++++----------- + po/he.po | 108 ++-- + po/hi.po | 108 ++-- + po/hr.po | 108 ++-- + po/hu.po | 108 ++-- + po/hy.po | 108 ++-- + po/id.po | 108 ++-- + po/is.po | 108 ++-- + po/it.po | 108 ++-- + po/ja.po | 108 ++-- + po/ka.po | 108 ++-- + po/kn.po | 108 ++-- + po/ko.po | 108 ++-- + po/ku.po | 108 ++-- + po/lt.po | 108 ++-- + po/lv.po | 108 ++-- + po/mai.po | 108 ++-- + po/mg.po | 108 ++-- + po/mk.po | 108 ++-- + po/ml.po | 108 ++-- + po/mn.po | 108 ++-- + po/mr.po | 974 + ++++++++++++----------- + po/ms.po | 108 ++-- + po/nb.po | 108 ++-- + po/nds.po | 108 ++-- + po/ne.po | 108 ++-- + po/nl.po | 108 ++-- + po/nn.po | 108 ++-- + po/oc.po | 108 ++-- + po/or.po | 108 ++-- + po/pa.po | 108 ++-- + po/pl.po | 108 ++-- + po/ps.po | 108 ++-- + po/pt.po | 108 ++-- + po/pt_BR.po | 108 ++-- + po/ro.po | 108 ++-- + po/ru.po | 108 ++-- + po/rw.po | 108 ++-- + po/si.po | 108 ++-- + po/sk.po | 108 ++-- + po/sl.po | 108 ++-- + po/sq.po | 108 ++-- + po/sr.po | 108 ++-- + po/sr@ije.po | 108 ++-- + po/sr@latin.po | 108 ++-- + po/sv.po | 108 ++-- + po/ta.po | 108 ++-- + po/te.po | 108 ++-- + po/th.po | 108 ++-- + po/tl.po | 108 ++-- + po/tr.po | 108 ++-- + po/tt.po | 108 ++-- + po/uk.po | 108 ++-- + po/vi.po | 108 ++-- + po/wa.po | 108 ++-- + po/xh.po | 108 ++-- + po/yi.po | 108 ++-- + po/zh_CN.po | 108 ++-- + po/zh_HK.po | 957 + +++++++++++----------- + po/zh_TW.po | 942 + +++++++++++----------- + 137 files changed, 8245 insertions(+), 8073 deletions(-) + +commit 80ac5df96b2a5b6c1436e597487526a77b8130fb +Author: Matthias Clasen +Date: Mon Apr 19 15:07:52 2010 -0400 + + Reset interface age to 0 + + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 27d2dbacd4d4833c9846a2872cb04f7bced3a3c3 +Author: Christian Persch +Date: Mon Apr 19 14:18:59 2010 -0400 + + Use g_set_error_literal where appropriate + + gio/gschema-compile.c | 22 +++++++++++----------- + 1 files changed, 11 insertions(+), 11 deletions(-) + +commit 40869e9544c27bc2d7f3b53aa1f1dda1edf47a8d +Author: Matthias Clasen +Date: Mon Apr 19 14:04:42 2010 -0400 + + Install a dtd in /usr/share/glib-2.0/schemas/gschema.dtd + + gio/Makefile.am | 4 ++++ + gio/gschema.dtd | 40 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+), 0 deletions(-) + +commit 2d38da0746d15e20e832d8573af106a1e83267eb +Author: Matthias Clasen +Date: Mon Apr 19 13:25:52 2010 -0400 + + Remove misnamed files + + .../schema-tests/no-default/no-default.gschema.xml | 6 ------ + 1 files changed, 0 insertions(+), 6 deletions(-) + +commit 0e48b0638dd54fda1d567c294db0feeb52b324af +Author: Matthias Clasen +Date: Mon Apr 19 13:14:30 2010 -0400 + + Some tests for gschema-compile + + Mostly making sure that we produce reasonable error messages for + typical mistakes. + + gio/tests/Makefile.am | 26 +++++-- + gio/tests/gschema-compile.c | 81 + +++++++++++++++++++- + gio/tests/schema-tests/bad-type/test.gschema.xml | 7 ++ + .../schema-tests/incomplete-list/test.gschema.xml | 7 ++ + .../schema-tests/missing-quotes/test.gschema.xml | 7 ++ + gio/tests/schema-tests/no-default/test.gschema.xml | 6 ++ + gio/tests/schema-tests/overflow/test.gschema.xml | 7 ++ + .../schema-tests/wrong-category/test.gschema.xml | 7 ++ + 8 files changed, 139 insertions(+), 9 deletions(-) + +commit a64625a134ac2d028e7288a640dc7b01e36edcf5 +Author: Javier Jardón +Date: Mon Apr 19 17:58:37 2010 +0200 + + Little fix in gio/test/Makefile.am + + This was introduced in + commit 4a605693fce718a81f809245be2ebad9978031ac + + gio/tests/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 32477d4fbff400a235f501967492349ae44a475d +Author: Matthias Clasen +Date: Mon Apr 19 11:40:23 2010 -0400 + + Another shadowed variable fix + + See bug 616154. + + gio/gsettings.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 4a605693fce718a81f809245be2ebad9978031ac +Author: Matthias Clasen +Date: Mon Apr 19 11:31:21 2010 -0400 + + Don't segfault when is missing + + Also add a framework for schema compiler tests. + + Fixes bug 616086. + + gio/gschema-compile.c | 10 +++++- + gio/tests/Makefile.am | 20 +++++++++-- + gio/tests/gschema-compile.c | 35 + ++++++++++++++++++++ + .../schema-tests/no-default/no-default.gschema.xml | 6 +++ + 4 files changed, 67 insertions(+), 4 deletions(-) + +commit ccbafd0f14cca899c07cd6a630096125988be8a9 +Author: David Zeuthen +Date: Mon Apr 19 10:42:42 2010 -0400 + + Bug 615111 – GAsyncInitable's default implementation is broken + + Signed-off-by: David Zeuthen + + gio/gasyncinitable.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 40fdc929f86243a936609a4008e9fb013c9f4f7d +Author: Ryan Lortie +Date: Mon Apr 19 10:28:44 2010 -0400 + + Don't write out zero-byte sections in builder + + This and the previous issue caught by Christian Persch in bug #616156 + + gio/gvdb/gvdb-builder.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 646dc7de87a90a833fb86f88c01c0131cabebb22 +Author: Ryan Lortie +Date: Mon Apr 19 10:18:44 2010 -0400 + + Whitespace fixups + + gio/gvdb/gvdb-builder.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 33104067d485fdc7596df7da57d43ba123d64927 Author: Ryan Lortie -Date: Sat Aug 7 19:58:12 2010 -0400 +Date: Mon Apr 19 10:17:31 2010 -0400 - Bug 578295 - gtester has a race condition + Fix logic error for missing options in reader - Deal with the race in GMainLoop by installing a do-nothing timeout. + gio/gvdb/gvdb-reader.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - glib/gtester.c | 9 +++++++++ - 1 files changed, 9 insertions(+), 0 deletions(-) +commit 3f354af402b466b194b313d280adaab07123d9e8 +Author: Matthias Clasen +Date: Mon Apr 19 10:34:42 2010 -0400 -commit 17bde58552d91d90536458e36445c1eff9d4f0d0 -Author: Andika Triwidada -Date: Fri Aug 6 15:58:03 2010 +0700 + Handle int64 and double types correctly - Updated Indonesian translation + gio/gsettings-mapping.c | 146 + +++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 122 insertions(+), 24 deletions(-) - po/id.po | 2150 - +++++++++++++++++++++++++++++++++++++++++--------------------- - 1 files changed, 1425 insertions(+), 725 deletions(-) +commit a072c1fc293ab7b5e81fd5e5ea29b15941af17fe +Author: Matthias Clasen +Date: Mon Apr 19 10:34:22 2010 -0400 -commit 0ca62609d72dff6b93f57be3a019ecb72f021869 -Author: Lucian Adrian Grijincu -Date: Thu Jul 15 02:07:08 2010 +0300 + Fix up some typos in the new tests - po: Updated Romanian translation + gio/tests/gsettings.c | 14 ++++++++++---- + 1 files changed, 10 insertions(+), 4 deletions(-) - po/ro.po | 1051 - +++++++++++++++++++++++++++++--------------------------------- - 1 files changed, 486 insertions(+), 565 deletions(-) +commit 2d9811ebdaee294ac9a1826db5be891b2b90d67f +Author: Ryan Lortie +Date: Mon Apr 19 10:28:44 2010 -0400 -commit 07ae0361da9347e4d2f5f6496b838b3dc4f2992c -Author: Rudolfs Mazurs -Date: Mon Jun 21 00:12:02 2010 +0300 + Don't write out zero-byte sections in builder - Updated Latvian translation. + This and the previous issue caught by Christian Persch in bug #616156 - po/lv.po | 1931 - +++++++++++++++++++++++++++++++------------------------------- - 1 files changed, 971 insertions(+), 960 deletions(-) + gvdb-builder.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) -commit 21ee3b69d3b47124950925beb79f237b8da6761f -Author: Christian Dywan -Date: Fri Jun 11 09:46:47 2010 +0200 +commit 6713b3dbaaabf9bbf196e6bc45d200b092239b59 +Author: Ryan Lortie +Date: Mon Apr 19 10:18:44 2010 -0400 - Add a regression test for GConverterOutputStream corruption + Whitespace fixups - See bug #619945 for background - (cherry picked from commit 85ea72c0c5716b6ebd62272e17e8e4e3b9014f65) + gvdb-builder.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - gio/tests/converter-stream.c | 54 - ++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 54 insertions(+), 0 deletions(-) +commit dc2b43b3e7bebe5c1fb9dedcb8630c4d45a99266 +Author: Ryan Lortie +Date: Mon Apr 19 10:17:31 2010 -0400 -commit 1f0694e51b8c8ed894cf2d7b690c666dc03bb145 -Author: Jürg Billeter -Date: Fri May 28 11:00:37 2010 +0200 + Fix logic error for missing options in reader - Use correct offset for buffer data in GConverterOutputStream + gvdb-reader.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - Otherwise we overwrite already converted data in the case that more - than one call to g_converter_convert is necessary in write() or - flush(). +commit 230038f684282372f2e9843a7c92273c916ffd49 +Author: Christian Persch +Date: Mon Apr 19 10:00:03 2010 -0400 - https://bugzilla.gnome.org/show_bug.cgi?id=619945 - (cherry picked from commit 6858ab20330ec31322dacbbdfaf66838fdcbfb78) + Add testcase for g_settings_bind with [u]int64 properties - gio/gconverteroutputstream.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) + And use different values for the doubles test. -commit efff840412e1de09f4dcc4d06aa8577a09dc7669 -Author: Jürg Billeter -Date: Thu May 27 16:55:53 2010 +0200 + All of these fail currently since g_settings_bind default mapping + truncate to glong (eek!). - Ensure we always have some target space in GConverterOutputStream + Bug #616119 - When the converter fills the whole buffer without reading all input, - we need to enlarge the buffer. Otherwise we get an assertion failure - for `outbuf_size > 0' in g_converter_convert. + gio/tests/gsettings.c | 50 + +++++++++++++++++++++++++++++++++--- + gio/tests/org.gtk.test.gschema.xml | 6 ++++ + 2 files changed, 52 insertions(+), 4 deletions(-) - https://bugzilla.gnome.org/show_bug.cgi?id=619945 - (cherry picked from commit 86592d675ff8f1bf0f647fe926ea6085e7b1f2bc) +commit fac8b91eafb7658ced725265d5df20a5b784698b +Author: Matthias Clasen +Date: Mon Apr 19 09:49:22 2010 -0400 - gio/gconverteroutputstream.c | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) + Add gsettings-related variables + + gio-2.0.pc.in | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit dd98785e85b3f8f030b1fc6ebe1610ddf0bf971f +Author: Christian Persch +Date: Mon Apr 19 09:46:32 2010 -0400 + + Rename shadowed variables + + Bug #616154. + + gio/gsettings.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 69bd033e11f63d50f551754dc9e98906d28e3561 +Author: Matthias Clasen +Date: Mon Apr 19 09:30:22 2010 -0400 + + Call setlocale initially + + That seems to be required to make bindtextdomain work in the + l10n tests. See bug 616152. + + gio/tests/gsettings.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) -commit f06f37e2b09763593ba840f7f99f427a42feefa4 +commit 4523b2b9cdb2fecdcfe197a73e645282d2d9b8ae Author: Tor Lillqvist -Date: Thu Jun 10 11:52:25 2010 +0300 +Date: Mon Apr 19 16:13:13 2010 +0300 - Plug memory leak on Windows + Bypass l10n tests for now on Windows - Intern the string returned from g_win32_getlocale() and then free it. - Fixes bug #621168. + gio/tests/gsettings.c | 25 +++++++++++++++++++++++++ + 1 files changed, 25 insertions(+), 0 deletions(-) - glib/gutils.c | 7 +++++-- - 1 files changed, 5 insertions(+), 2 deletions(-) +commit 1064097504c180ad5ed8fd8ce80500da0aca9266 +Author: Matthias Clasen +Date: Mon Apr 19 08:54:01 2010 -0400 + + Add a bit about autofoo for schemas + + Always a good idea to have copiable snipplets in a porting guide... + + docs/reference/gio/migrating.xml | 37 + ++++++++++++++++++++++++++++++------- + 1 files changed, 30 insertions(+), 7 deletions(-) + +commit a96360ad68405304f60636f6048aa2bdf268066d +Author: Tor Lillqvist +Date: Mon Apr 19 15:48:30 2010 +0300 + + Avoid non-portable API + + And thus we can build gschema-compile on all platforms, and run it in + tests. + + gio/Makefile.am | 6 +----- + gio/gschema-compile.c | 34 +++++++++++++++++----------------- + gio/tests/Makefile.am | 6 +----- + 3 files changed, 19 insertions(+), 27 deletions(-) + +commit c279b5b999c4a8fea934184eb36d2a994dc07868 +Author: Matthias Clasen +Date: Mon Apr 19 08:04:57 2010 -0400 + + Add a schema convertion script + + gio/gsettings-schema-convert | 1064 + ++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 1064 insertions(+), 0 deletions(-) + +commit df8800e59a88c011ed84e7a05c6ddeb2a9b38921 +Author: Tor Lillqvist +Date: Mon Apr 19 12:25:22 2010 +0300 + + Portability improvements + + Gschema-compile uses glob which is available on Unix only. Thus can't + run the gschema-compile test except on Unix either. + + To avoid an Automake error, comment out the SOURCES and LDADD of + unix-streams which for some reason has been commented out from + TEST_PROGS. + + Can't use a Makefile.am target called foo_PROGRAMS for random files + that aren't actually programs, as Automake assumes EXEEXT should be + appended to the file names. + + gio/Makefile.am | 7 ++++++- + gio/tests/Makefile.am | 18 +++++++++++------- + 2 files changed, 17 insertions(+), 8 deletions(-) + +commit 9af8b8321146cddbe5bee09e972507f023e58ce0 +Author: Tor Lillqvist +Date: Mon Apr 19 11:32:05 2010 +0300 + + Add GWin32InputStream and GWin32OutputStream classes + + Correspond to GUnixInputStream and GUnixOutputStream. No true async + support though. But that is how the Win32 API is, for files not + explicitly opened for so-called overlapped IO. + + The API to create these streams takes Win32 HANDLEs. Not file + descriptors, because file descriptors are specific to the C library + used. The user code and GLib might be using different C libraries. + + Also add a test program for the new classes, and a gio-windows-2.0.pc + file. + + Makefile.am | 5 + + build/win32/vs9/glib.vsprops | 4 + + configure.in | 1 + + gio-windows-2.0.pc.in | 11 ++ + gio/Makefile.am | 11 ++- + gio/gio.symbols | 27 +++ + gio/gioerror.c | 27 +++ + gio/gioerror.h | 4 + + gio/gwin32inputstream.c | 359 + ++++++++++++++++++++++++++++++++++++++++++ + gio/gwin32inputstream.h | 79 +++++++++ + gio/gwin32outputstream.c | 359 + ++++++++++++++++++++++++++++++++++++++++++ + gio/gwin32outputstream.h | 78 +++++++++ + gio/tests/Makefile.am | 8 + + gio/tests/win32-streams.c | 292 ++++++++++++++++++++++++++++++++++ + glib-zip.in | 1 + + 15 files changed, 1265 insertions(+), 1 deletions(-) + +commit 48cd4cbba5e580a30aef7b0073e647bcc7118c67 +Author: Matthias Clasen +Date: Sun Apr 18 23:53:31 2010 -0400 + + Silence a warning + + g_string_insert_len (s, pos, NULL, 0) is a harmless nop, don't + spew warnings in this case. + + glib/gstring.c | 41 ++++++++++++++++++++++------------------- + 1 files changed, 22 insertions(+), 19 deletions(-) + +commit 32de7d6905d9e26b1de8e030cb275381fde00f03 +Author: Matthias Clasen +Date: Sun Apr 18 15:57:11 2010 -0400 + + Fix up docs for backend setup functions + + docs/reference/gio/gio-sections.txt | 4 ++++ + gio/gkeyfilesettingsbackend.c | 2 ++ + gio/gsettingsbackend.c | 2 ++ + 3 files changed, 8 insertions(+), 0 deletions(-) + +commit fd8cdb83e1b5a4b71aa84ca26a000e2fbd7a3d37 +Author: Matthias Clasen +Date: Sun Apr 18 15:55:14 2010 -0400 + + Refer to gio-querymodules in the extension point docs + + gio/giomodule.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit b7afff0033a43c10012491ab44d2abd4b06bd039 +Author: Matthias Clasen +Date: Sun Apr 18 15:54:54 2010 -0400 + + Add a man page for gio-querymodules + + docs/reference/gio/Makefile.am | 3 ++ + docs/reference/gio/gio-docs.xml | 5 ++++ + docs/reference/gio/gio-querymodules.xml | 33 + +++++++++++++++++++++++++++++++ + 3 files changed, 41 insertions(+), 0 deletions(-) + +commit e0850b56e2eb13280aa692cb3275640470f59d0d +Author: Matthias Clasen +Date: Sun Apr 18 15:37:55 2010 -0400 + + Correct filename extension in help output. + + gio/gschema-compile.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit eaae8f6578b4d08146e5599f5b3022485bec629f +Author: Matthias Clasen +Date: Sun Apr 18 15:35:22 2010 -0400 + + Whitespace fix + + docs/reference/gio/gschema-compile.xml | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +commit a6bd74a08d6f9e3fe930ddcb9e93bf19ae4e240a +Author: Matthias Clasen +Date: Sun Apr 18 14:58:50 2010 -0400 + + Update the gschema-compile docs + + Correct the schema file extension, mention the usual locations + for schemas and add a reference to gsettings-schema-convert. + + docs/reference/gio/gschema-compile.xml | 18 +++++++++++++++++- + 1 files changed, 17 insertions(+), 1 deletions(-) + +commit 9023ac09345d9569d11bc55d66adcfaa92d8811a +Author: David King +Date: Fri Jul 17 23:06:03 2009 +0200 + + [docs] Remove unused sgml template from GObject documentation + + https://bugzilla.gnome.org/show_bug.cgi?id=589351 + + Signed-off-by: Javier Jardón + + docs/reference/gobject/tmpl/gobject-unused.sgml | 87 + ----------------------- + 1 files changed, 0 insertions(+), 87 deletions(-) + +commit 626d8ac9e1f806363160634502ff008a71d7f507 +Author: Matthias Clasen +Date: Sat Apr 17 21:31:30 2010 -0400 + + More distcheck fixes + + gio/tests/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 187883dc586c4b5545d4e58e8c8af176da690ef6 +Author: Matthias Clasen +Date: Sat Apr 17 21:19:45 2010 -0400 + + add a keyfile test + + gio/tests/Makefile.am | 2 +- + gio/tests/gsettings.c | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 33 insertions(+), 1 deletions(-) + +commit f07613997c345224df702076e793dabaada58ec3 +Author: Matthias Clasen +Date: Sat Apr 17 20:54:53 2010 -0400 + + More distcheck fix attempts + + gio/tests/Makefile.am | 18 ++++++++++-------- + 1 files changed, 10 insertions(+), 8 deletions(-) + +commit 87e68c75bc874c94f6152e069f904673243f4fb0 +Author: Matthias Clasen +Date: Sat Apr 17 20:13:59 2010 -0400 + + Distcheck fixes + + docs/reference/gio/Makefile.am | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit 3db0f554e41496b07c82db96457b8df98947aa0e +Author: Matthias Clasen +Date: Sat Apr 17 16:57:28 2010 -0400 + + Some build fixes + + docs/reference/gio/Makefile.am | 3 ++- + gio/tests/Makefile.am | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit 137cee425f4b5b29ac47ce433e02f6f2734eca47 +Author: Matthias Clasen +Date: Sat Apr 17 16:48:10 2010 -0400 + + Correct the sense of an assertion + + gio/tests/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d2b837df5d230f6658bafe3bd980f87c590f2b78 +Author: Matthias Clasen +Date: Sat Apr 17 16:13:22 2010 -0400 + + Document the tests + + Add a short note for each test that explains what it tries to test. + + gio/tests/gsettings.c | 73 + ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 72 insertions(+), 1 deletions(-) + +commit 118ae129bc24597d937f30998e643ba83db908f4 +Author: Ryan Lortie +Date: Sat Apr 17 11:58:52 2010 -0400 + + GDelayedSettingsBackend: another mandatory fixup + + - emit the "has-unapplied" property notify if dropping the last key + from the changeset due to a mandatory key + + gio/gdelayedsettingsbackend.c | 37 + ++++++++++++++++++++++++++----------- + 1 files changed, 26 insertions(+), 11 deletions(-) + +commit e06e441ac23f3752f252e86e1d930678de53c778 +Author: Ryan Lortie +Date: Sat Apr 17 11:39:04 2010 -0400 + + GSettings delayed: fix handling of mandatory keys + + - if a key becomes mandatory, drop it from the changeset + + - if we still get failing writes (ie: because of a race) then + drop the + entire changeset and signal that it happened + + gio/gdelayedsettingsbackend.c | 61 + +++++++++++++++++++++++++++++++++++----- + 1 files changed, 53 insertions(+), 8 deletions(-) + +commit eaaa4d14aa8166b72b4dd7b703b1cca143d725cc +Author: Ryan Lortie +Date: Sat Apr 17 10:26:10 2010 -0400 + + add backend setup APIs + + gio/gio.symbols | 5 ++ + gio/gkeyfilesettingsbackend.c | 116 + ++++++++++++++++++++++------------------- + gio/gsettingsbackend.c | 46 ++++++++++++++-- + gio/gsettingsbackend.h | 5 ++ + 4 files changed, 114 insertions(+), 58 deletions(-) + +commit 21f064486c0bf7e338acebcc90b3f21aa57ee7b9 +Author: Matthias Clasen +Date: Sat Apr 17 01:55:55 2010 -0400 + + Updates + + NEWS | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +commit c8a7bb6ccd6e56623e549676f826c7a714093cf6 +Author: Matthias Clasen +Date: Sat Apr 17 01:43:58 2010 -0400 + + Merge GSettings tests + + gio/tests/Makefile.am | 19 +- + gio/tests/de.po | 17 + + gio/tests/gsettings.c | 917 + ++++++++++++++++++++++++++++++++++++ + gio/tests/org.gtk.test.gschema | 39 ++ + gio/tests/org.gtk.test.gschema.xml | 89 ++++ + 5 files changed, 1079 insertions(+), 2 deletions(-) + +commit 265ca3db9d3fa74ec0035ab70db2b907fade6d26 +Author: Ryan Lortie +Date: Sat Apr 17 01:27:00 2010 -0400 + + let binding functions return a floating GVariant + + gio/gsettings.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c8e264b6d0e258241420800978745ca6dcd95137 +Author: Ryan Lortie +Date: Sat Apr 17 01:02:57 2010 -0400 + + add GMemorySettingsBackend + + gio/Makefile.am | 2 + + gio/giomodule.c | 2 + + gio/gmemorysettingsbackend.c | 147 + ++++++++++++++++++++++++++++++++++++++++++ + gio/gmemorysettingsbackend.h | 30 +++++++++ + 4 files changed, 181 insertions(+), 0 deletions(-) + +commit 77ab3c28b9ea692476695243b91931cb3c01b24e +Author: Ryan Lortie +Date: Sat Apr 17 01:02:05 2010 -0400 + + add pltcheck.sh exception for GChecksum + + gio/pltcheck.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 79bc511d95650231fad8b4a3184ab55dbcc327ff +Author: Ryan Lortie +Date: Sat Apr 17 00:03:48 2010 -0400 + + XML schemas are now *.gschema.xml + + gio/gschema-compile.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0d7fbae04c616fcce2dec57787b1f0266763735e +Author: Matthias Clasen +Date: Sat Apr 17 00:36:14 2010 -0400 + + Remove garbage + + docs/reference/gio/#gio-unused.txt# | 100 + ----------------------------------- + 1 files changed, 0 insertions(+), 100 deletions(-) + +commit bd273f9e09b42969eacbf3fc62a5dee187d96346 +Author: Matthias Clasen +Date: Sat Apr 17 00:31:41 2010 -0400 + + Merge the GSettings docs + + docs/reference/gio/Makefile.am | 28 +++- + docs/reference/gio/gio-docs.xml | 76 ++++--- + docs/reference/gio/gio-sections.txt | 82 +++++++ + docs/reference/gio/gio.types | 2 + + docs/reference/gio/gschema-compile.xml | 61 +++++ + docs/reference/gio/gsettings-schema-convert.xml | 105 +++++++++ + docs/reference/gio/migrating.xml | 287 + ++++++++++++++++++++++- + docs/reference/gio/overview.xml | 128 +++++++--- + 8 files changed, 691 insertions(+), 78 deletions(-) + +commit 16637a16873124cd2837502c662c89834786cea5 +Author: Matthias Clasen +Date: Sat Apr 17 00:16:01 2010 -0400 + + Document G_SETTINGS_BIND_GET_NO_CHANGES + + gio/gsettings.h | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +commit a2716ad02085b7d5d19732c187a8b89debf4fc8f +Author: Matthias Clasen +Date: Fri Apr 16 23:57:26 2010 -0400 + + Merge the keyfile settings backend. + + gio/Makefile.am | 2 + + gio/gkeyfilesettingsbackend.c | 553 + +++++++++++++++++++++++++++++++++++++++++ + gio/gkeyfilesettingsbackend.h | 71 ++++++ + 3 files changed, 626 insertions(+), 0 deletions(-) + +commit a187634b29b87c25ea0525d01ee2deffea0fb719 +Author: Ryan Lortie +Date: Fri Apr 16 23:17:01 2010 -0400 + + merge GSettings + + gio/Makefile.am | 30 +- + gio/gio-marshal.list | 2 + + gio/gio.h | 1 + + gio/gio.symbols | 34 + + gio/gsettings-mapping.c | 367 ++++++++++ + gio/gsettings-mapping.h | 39 ++ + gio/gsettings.c | 1715 + +++++++++++++++++++++++++++++++++++++++++++++++ + gio/gsettings.h | 203 ++++++ + gio/pltcheck.sh | 2 +- + 9 files changed, 2379 insertions(+), 14 deletions(-) + +commit 43a72ce1bea72a581faf34a505004cac941690c3 +Author: Ryan Lortie +Date: Fri Apr 16 23:20:48 2010 -0400 + + GSettingsSchema: add call to get list of keys + + gio/gsettingsschema.c | 32 ++++++++++++++++++++++++++++++++ + gio/gsettingsschema.h | 3 +++ + 2 files changed, 35 insertions(+), 0 deletions(-) + +commit 61a5692fa15156ea33f8353e62c0357c46c22f77 +Author: Matthias Clasen +Date: Fri Apr 16 20:43:53 2010 -0400 + + Man page tweaks + + Add enough info to keep the docbook stylesheets from embedding + FIXMEs in the formatted output. -commit b5d200de7ef973bbbcf35fa55b5756a8480a8330 -Author: Ryan Lortie -Date: Fri May 14 17:06:24 2010 +0200 + docs/reference/gobject/glib-genmarshal.xml | 3 ++- + docs/reference/gobject/glib-mkenums.xml | 9 +++++++-- + docs/reference/gobject/gobject-query.xml | 3 ++- + 3 files changed, 11 insertions(+), 4 deletions(-) - fix glaring inaccuracy in GVariant docs +commit 51d40405de0df498e003ffd24399e11cf63f0ef9 +Author: Matthias Clasen +Date: Fri Apr 16 20:40:02 2010 -0400 - glib/gvariant.c | 12 ++++-------- - 1 files changed, 4 insertions(+), 8 deletions(-) + Man page tweaks -commit 1fd2aa21e600384f2619e6899a15497c602eb1c9 -Author: Ivar Smolin -Date: Thu May 20 15:00:12 2010 +0300 + docs/reference/glib/glib-gettextize.xml | 5 +++-- + docs/reference/glib/gtester-report.xml | 6 +++++- + docs/reference/glib/gtester.xml | 6 +++++- + 3 files changed, 13 insertions(+), 4 deletions(-) - Estonian translation updated +commit a922596e549eb26fac6119457bc019c851f69148 +Author: Matthias Clasen +Date: Fri Apr 16 19:30:58 2010 -0400 - po/et.po | 489 - ++------------------------------------------------------------ - 1 files changed, 9 insertions(+), 480 deletions(-) + Some doc tweaks -commit 770efbbd8976c617a735acc1194b2d20a03f0f2c -Merge: b3db4e4 2e43d1e -Author: Fran Diéguez -Date: Thu May 13 01:02:23 2010 +0200 + gio/gsettingsbackend.c | 7 +++---- + 1 files changed, 3 insertions(+), 4 deletions(-) - Updated Galician translations +commit 4c90d4cd45768be45c1dcea74703bfda00849ef4 +Author: Matthias Clasen +Date: Fri Apr 16 19:13:51 2010 -0400 -commit b3db4e4551ff445af009a232284b42a470357472 -Author: Fran Diéguez -Date: Thu May 13 00:59:38 2010 +0200 + Add indices for 2.26 api additions - Updated Galician translations + docs/reference/gio/gio-docs.xml | 4 ++++ + docs/reference/glib/glib-docs.sgml | 4 ++++ + 2 files changed, 8 insertions(+), 0 deletions(-) - po/gl.po | 949 - +++++++++++++++++++++++++++++++------------------------------- - 1 files changed, 479 insertions(+), 470 deletions(-) +commit ac5c1e2db6203cf3fa78233886529711c6282ea2 +Author: Ryan Lortie +Date: Fri Apr 16 14:30:12 2010 -0400 -commit 2e43d1e614c328cf6514282307e06dfb63ca9ed7 -Author: Matthias Clasen -Date: Thu Apr 22 19:31:39 2010 -0400 + set version to 2.25.0 - Fix !srcdir build + configure.in | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) - Bug 616216 +commit d4a4a4ccdb30456ba2486f8b2196cfbcb30bd312 +Author: Ryan Lortie +Date: Fri Apr 16 12:02:44 2010 -0400 - gthread/tests/Makefile.am | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + GSettings: import delayed backend to master -commit ad9ff29e0c286ec44b470ac6bd9d9a87b29cded3 -Author: Jorge González -Date: Mon May 10 19:55:45 2010 +0200 + gio/Makefile.am | 2 + + gio/gdelayedsettingsbackend.c | 317 + +++++++++++++++++++++++++++++++++++++++++ + gio/gdelayedsettingsbackend.h | 73 ++++++++++ + 3 files changed, 392 insertions(+), 0 deletions(-) - Updated Spanish translation +commit 04c1eadfff5b382f4f54877d62b4703b6f1620f4 +Author: Ryan Lortie +Date: Fri Apr 16 12:02:29 2010 -0400 - po/es.po | 952 - +++++++++++++++++++++++++++++++------------------------------- - 1 files changed, 481 insertions(+), 471 deletions(-) + GSettings: more PLT/visibility fixups -commit 001fed0c1489a66cd8903f4c1f1f64ebe8655c6f -Author: Luca Ferretti -Date: Mon May 10 09:49:29 2010 +0200 + gio/gnullsettingsbackend.c | 3 +++ + gio/gsettingsbackendinternal.h | 5 ----- + gio/gsettingsschema.h | 6 ++++++ + gio/pltcheck.sh | 2 +- + 4 files changed, 10 insertions(+), 6 deletions(-) - Updated Italian translation +commit 149224664f639efaf5cc2a928ed9ffb525ec8591 +Author: Ryan Lortie +Date: Fri Apr 16 11:58:04 2010 -0400 - po/it.po | 951 - +++++++++++++++++++++++++++++++------------------------------- - 1 files changed, 480 insertions(+), 471 deletions(-) + gio.symbols: remove pointless whitespace -commit 335ab181596368c82e143820c6c30376f86dd418 -Author: Claude Paroz -Date: Mon May 10 08:43:21 2010 +0200 + gio/gio.symbols | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) - Updated French translation +commit 2474ebf15eccb9fd8513a7dc40789d3a7f0bbb9c +Author: Ryan Lortie +Date: Fri Apr 16 12:01:40 2010 -0400 - po/fr.po | 951 - +++++++++++++++++++++++++++++++------------------------------- - 1 files changed, 480 insertions(+), 471 deletions(-) + GSettingsBackend: fix type in g_return_val_if_fail -commit 4e44073e4640380a8dd409139f6b4b1c59be9c9d -Author: Tor Lillqvist -Date: Wed May 5 09:43:30 2010 +0300 + gio/gsettingsbackend.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - Minor updates to README.win32. +commit 69801f8dc84c0c9403df6802eccc5d03328cd3ae +Merge: 897bd9f caad55d +Author: Ryan Lortie +Date: Fri Apr 16 11:05:22 2010 -0400 - README.win32 | 57 - ++++++++++++++++++++++++++++++++------------------------- - 1 files changed, 32 insertions(+), 25 deletions(-) + Merge remote branch 'gvdb/master' -commit aa6beb3559ce09baecd6c6801a7728a5d4e401c8 -Author: Tor Lillqvist -Date: Mon May 3 20:07:20 2010 +0300 +commit caad55d7266c2658f823ea734c4381f19b4c5827 +Author: Ryan Lortie +Date: Fri Apr 16 11:04:15 2010 -0400 - Fix list of sources in the gio Visual Studio project + Fix uninitialised header in the builder. - List the additional sources needed in gio/Makefile.am, not in - gio.vcprojin. Fix broken usage of sort. Filter out Unix-only source - files. + gvdb-builder.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - build/win32/vs9/gio.vcprojin | 9 --------- - gio/Makefile.am | 14 ++++++++++++-- - 2 files changed, 12 insertions(+), 11 deletions(-) +commit 897bd9f3843aabcf9c0d4367c341b04d964bcf0c +Author: Ryan Lortie +Date: Thu Apr 15 23:35:49 2010 -0400 -commit d6434b89f495c1f31e61a025f973f350537e67e3 -Author: Matthias Clasen -Date: Sun May 2 21:50:14 2010 -0400 + GSettings: merge the schema compiler - Bump version + gio/.gitignore | 1 + + gio/Makefile.am | 9 +- + gio/gschema-compile.c | 544 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 553 insertions(+), 1 deletions(-) - configure.in | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) +commit 2bc81577350ad479c6e261b998269bcbde489b5d +Author: Ryan Lortie +Date: Thu Apr 15 22:30:11 2010 -0400 -commit 3c822b423db4ad6e612f68adefd5cb5899793ade -Author: Matthias Clasen -Date: Sun May 2 21:47:49 2010 -0400 + merge GSettingsSchema - 2.24.1 + gio/Makefile.am | 7 ++- + gio/gsettingsschema.c | 205 + +++++++++++++++++++++++++++++++++++++++++++++++++ + gio/gsettingsschema.h | 67 ++++++++++++++++ + 3 files changed, 278 insertions(+), 1 deletions(-) - docs/reference/glib/gtester-report.1 | 6 +- - docs/reference/glib/tmpl/async_queues.sgml | 4 + - docs/reference/glib/tmpl/atomic_operations.sgml | 33 +- - docs/reference/glib/tmpl/bookmarkfile.sgml | 4 + - docs/reference/glib/tmpl/byte_order.sgml | 3 + - docs/reference/glib/tmpl/conversions.sgml | 3 + - docs/reference/glib/tmpl/date.sgml | 4 + - docs/reference/glib/tmpl/error_reporting.sgml | 3 + - docs/reference/glib/tmpl/fileutils.sgml | 3 + - docs/reference/glib/tmpl/gregex.sgml | 3 + - docs/reference/glib/tmpl/hooks.sgml | 3 + - docs/reference/glib/tmpl/i18n.sgml | 4 + - docs/reference/glib/tmpl/keyfile.sgml | 4 + - docs/reference/glib/tmpl/limits.sgml | 3 + - docs/reference/glib/tmpl/macros.sgml | 3 + - docs/reference/glib/tmpl/macros_misc.sgml | 3 + - docs/reference/glib/tmpl/main.sgml | 10 + - docs/reference/glib/tmpl/markup.sgml | 3 + - docs/reference/glib/tmpl/memory.sgml | 5 + - docs/reference/glib/tmpl/memory_slices.sgml | 3 + - docs/reference/glib/tmpl/messages.sgml | 3 + - docs/reference/glib/tmpl/misc_utils.sgml | 19 + - docs/reference/glib/tmpl/modules.sgml | 5 + - docs/reference/glib/tmpl/numerical.sgml | 3 + - docs/reference/glib/tmpl/queue.sgml | 4 + - docs/reference/glib/tmpl/scanner.sgml | 3 + - docs/reference/glib/tmpl/spawn.sgml | 3 + - docs/reference/glib/tmpl/string_utils.sgml | 3 + - docs/reference/glib/tmpl/strings.sgml | 3 + - docs/reference/glib/tmpl/testing.sgml | 22 +- - docs/reference/glib/tmpl/trash_stack.sgml | 3 + - docs/reference/glib/tmpl/type_conversion.sgml | 3 + - docs/reference/glib/tmpl/types.sgml | 3 + - docs/reference/glib/tmpl/unicode.sgml | 3 + - docs/reference/glib/tmpl/version.sgml | 3 + - docs/reference/glib/tmpl/warnings.sgml | 3 + - docs/reference/glib/tmpl/windows.sgml | 5 + - docs/reference/gobject/glib-genmarshal.1 | 6 +- - docs/reference/gobject/glib-mkenums.1 | 6 +- - po/af.po | 2 +- - po/am.po | 2 +- - po/ar.po | 2 +- - po/as.po | 2 +- - po/ast.po | 2 +- - po/az.po | 2 +- - po/be.po | 2 +- - po/be@latin.po | 2 +- - po/bg.po | 2 +- - po/bn.po | 978 - +++++++++++------------ - po/bn_IN.po | 2 +- - po/bs.po | 2 +- - po/ca.po | 952 - +++++++++++----------- - po/ca@valencia.po | 942 - +++++++++++----------- - po/cs.po | 2 +- - po/cy.po | 2 +- - po/da.po | 942 - +++++++++++----------- - po/de.po | 2 +- - po/dz.po | 2 +- - po/el.po | 2 +- - po/en@shaw.po | 2 +- - po/en_CA.po | 2 +- - po/en_GB.po | 2 +- - po/eo.po | 2 +- - po/es.po | 2 +- - po/et.po | 2 +- - po/eu.po | 2 +- - po/fa.po | 2 +- - po/fi.po | 2 +- - po/fr.po | 2 +- - po/ga.po | 2 +- - po/gl.po | 2 +- - po/gu.po | 2 +- - po/he.po | 2 +- - po/hi.po | 2 +- - po/hr.po | 2 +- - po/hu.po | 2 +- - po/hy.po | 2 +- - po/id.po | 2 +- - po/is.po | 2 +- - po/it.po | 2 +- - po/ja.po | 2 +- - po/ka.po | 2 +- - po/kn.po | 963 - +++++++++++----------- - po/ko.po | 2 +- - po/ku.po | 2 +- - po/lt.po | 2 +- - po/lv.po | 2 +- - po/mai.po | 2 +- - po/mg.po | 2 +- - po/mk.po | 2 +- - po/ml.po | 2 +- - po/mn.po | 2 +- - po/mr.po | 2 +- - po/ms.po | 2 +- - po/nb.po | 2 +- - po/nds.po | 2 +- - po/ne.po | 2 +- - po/nl.po | 2 +- - po/nn.po | 2 +- - po/oc.po | 2 +- - po/or.po | 2 +- - po/pa.po | 2 +- - po/pl.po | 2 +- - po/ps.po | 2 +- - po/pt.po | 2 +- - po/pt_BR.po | 2 +- - po/ro.po | 2 +- - po/ru.po | 2 +- - po/rw.po | 2 +- - po/si.po | 2 +- - po/sk.po | 2 +- - po/sl.po | 2 +- - po/sq.po | 2 +- - po/sr.po | 2 +- - po/sr@ije.po | 2 +- - po/sr@latin.po | 2 +- - po/sv.po | 2 +- - po/ta.po | 2 +- - po/te.po | 2 +- - po/th.po | 2 +- - po/tl.po | 2 +- - po/tr.po | 2 +- - po/tt.po | 2 +- - po/uk.po | 2 +- - po/vi.po | 2 +- - po/wa.po | 2 +- - po/xh.po | 2 +- - po/yi.po | 2 +- - po/zh_CN.po | 2 +- - po/zh_HK.po | 957 - +++++++++++----------- - po/zh_TW.po | 942 - +++++++++++----------- - 131 files changed, 3580 insertions(+), 3476 deletions(-) +commit 45a1c41e8cfdeb4edeb7a671b95e599a49c6c281 +Merge: defd75f 3c10369 +Author: Ryan Lortie +Date: Thu Apr 15 22:14:18 2010 -0400 -commit 87e4516650bb0f01033268e3f7f77ecd5d4cab2a -Author: Matthias Clasen -Date: Sun May 2 20:56:24 2010 -0400 + Merge remote branch 'gvdb/master' - Updates +commit 3c10369bf6df1bad9d25a83b48d6256e5c8ce8f6 +Author: Ryan Lortie +Date: Thu Apr 15 22:09:42 2010 -0400 - NEWS | 23 +++++++++++++++++++++++ - 1 files changed, 23 insertions(+), 0 deletions(-) + Recommend git-merge(1) over git-submodule(1). -commit 503949b12d100ff2d89b8bbb1771729f8a251688 -Author: Behdad Esfahbod -Date: Thu Apr 22 19:48:13 2010 -0400 + gvdb.doap | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - Bug 615379 - g_new macros crash if sizeof(struct_type) == 0 - (cherry picked from commit 00a7c2e635a4fa95257779c271f0eaa5992e2b37) +commit 3938c735470a3164f1cf21d9e30652d46323b9a9 +Author: Ryan Lortie +Date: Thu Apr 15 21:32:54 2010 -0400 - glib/gmem.h | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) + Add a brief description to the .doap -commit f2b4060717dc4bd63b21a6c1d554fe06ece59de7 -Author: Colin Walters -Date: Wed Apr 21 16:44:26 2010 -0400 + gvdb.doap | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) - Fix typo in GMutex error message - (cherry picked from commit 0d9a40b8943ec3b9926efad93a28687708cc2038) +commit 0fec2048f0b0296fad7a2c7e5db5011d2ecdd323 +Author: Ryan Lortie +Date: Thu Apr 15 21:26:34 2010 -0400 - gthread/gthread-impl.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + Initial commit + + gvdb-builder.c | 540 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + gvdb-builder.h | 60 +++++++ + gvdb-format.h | 89 +++++++++ + gvdb-reader.c | 510 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + gvdb-reader.h | 54 ++++++ + gvdb.doap | 19 ++ + 6 files changed, 1272 insertions(+), 0 deletions(-) -commit e7a7d6873cb49f6c8bba5c2a5d078dbe607d62bd +commit defd75fbc53511e27d178373ba6caa226c1ab3cf Author: Ryan Lortie -Date: Thu Apr 15 10:11:30 2010 -0400 +Date: Thu Apr 15 18:30:06 2010 -0400 - g_string_append_len() accept NULL with length == 0 - (cherry picked from commit 056326c1e96db2c2101fa320062e0c9146f0d73f) + GSettingsBackend: fix NULL vs "" context issues - glib/gstring.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + gio/gsettingsbackend.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) -commit 7fb9b876fa6ec63c05df1c5e441bcc87e48397e2 +commit 3e36ee34269273df6a8d56fee7e7ee10eb913379 Author: Ryan Lortie -Date: Wed Apr 14 23:35:56 2010 -0400 +Date: Thu Apr 15 18:22:14 2010 -0400 - GVariant: fix for g_variant_iter_loop() - (cherry picked from commit d17f4bee175cd9149d5f2b1ed1ae6d262d6a1394) + add 'null' GSettings backend - glib/gvariant.c | 14 +++++++++----- - 1 files changed, 9 insertions(+), 5 deletions(-) + gio/Makefile.am | 2 + + gio/gnullsettingsbackend.c | 107 + ++++++++++++++++++++++++++++++++++++++++++++ + gio/gnullsettingsbackend.h | 30 ++++++++++++ + 3 files changed, 139 insertions(+), 0 deletions(-) -commit e61a90b9eea2eac924f66c1d137381daff6cedfd -Author: Benjamin Otte -Date: Fri Mar 26 20:37:09 2010 +0100 +commit c2675af4d7d54676745d2c36821ce085cce12111 +Author: Ryan Lortie +Date: Thu Apr 15 18:21:49 2010 -0400 - Fix race in g_cancellable_cancel() + GSettings: Modify backend API - We need to check priv->cancelled after taking the lock. Previously we - only checked it just before taking the lock, which left a small chance - for a race. - (cherry picked from commit e7763678b56e3be073cc55d707a6e92fc2055ee0) + gio/gsettingsbackend.c | 54 + +++++++++++++++++++++++++-------------- + gio/gsettingsbackend.h | 11 +++++--- + gio/gsettingsbackendinternal.h | 14 ++++++--- + 3 files changed, 50 insertions(+), 29 deletions(-) - gio/gcancellable.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) +commit 18ba085d0ad28e7edbe575addacbaa2bb13d9f1c +Author: Ryan Lortie +Date: Thu Apr 15 14:59:41 2010 -0400 -commit c25c40fdd9be7612882c4d3162d3bf3917ee2e6d -Author: Benjamin Otte -Date: Fri Mar 26 20:36:10 2010 +0100 + merge GSettingsBackend - Remove unneccessary variable from g_cancellable_cancel() + docs/reference/gio/Makefile.am | 1 + + gio/Makefile.am | 9 + + gio/gio.symbols | 14 + + gio/gsettingsbackend.c | 877 + ++++++++++++++++++++++++++++++++++++++++ + gio/gsettingsbackend.h | 122 ++++++ + gio/gsettingsbackendinternal.h | 100 +++++ + gio/pltcheck.sh | 2 +- + 7 files changed, 1124 insertions(+), 1 deletions(-) + +commit 8d6492ed153fa30b9edaa839a2d93f2651e7aa46 +Author: Ryan Lortie +Date: Thu Apr 15 14:44:59 2010 -0400 - The variable makes a complicated function even more complicated. - (cherry picked from commit 5527a2ac2ce2b5bea10867fb2e39d2f1914cfbe6) + Remove accidental checkins - gio/gcancellable.c | 25 ++++++++++--------------- - 1 files changed, 10 insertions(+), 15 deletions(-) + docs/reference/gio/aa | 74 + ----------------------------------------------- + docs/reference/gio/b | 77 + ------------------------------------------------- + docs/reference/gio/bb | 77 + ------------------------------------------------- + 3 files changed, 0 insertions(+), 228 deletions(-) -commit b28b1e589e0464bb92aef75e7b03797410a7ec56 -Author: Carles Ferrando -Date: Fri Apr 23 00:42:04 2010 +0200 +commit bf2719c815d719d1899b4bdb1b81ff6798471094 +Author: Lars Ellenberg +Date: Thu Apr 15 19:03:05 2010 +0200 - Updated Catalan (Valencian) translation + Cast to volatile to avoid warnings from -Wcast-qual - po/ca@valencia.po | 1252 - +++++++++++++++++++++++++++-------------------------- - 1 files changed, 636 insertions(+), 616 deletions(-) + https://bugzilla.gnome.org/show_bug.cgi?id=457641 -commit d4f50a33d46e61fe065a1cdfc266159d4a612197 -Author: Shankar Prasad -Date: Thu Apr 22 16:21:42 2010 +0530 + glib/gatomic.h | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) - Updated Kannada translations +commit 056326c1e96db2c2101fa320062e0c9146f0d73f +Author: Ryan Lortie +Date: Thu Apr 15 10:11:30 2010 -0400 - po/kn.po | 1025 - +++++++++++++++++++++++++++++++------------------------------- - 1 files changed, 517 insertions(+), 508 deletions(-) + g_string_append_len() accept NULL with length == 0 -commit f54c7f9c7736247b113bb643ac7e90150d8dd1b8 -Author: Javier Jardón -Date: Tue Apr 20 01:04:31 2010 +0200 + glib/gstring.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - [docs] Fix G_VALUE_COLLECT_INIT documentation +commit 066df8d867f78ac40368c0d37f20fae400fc03b3 +Author: Sweta Kothari +Date: Thu Apr 15 16:43:36 2010 +0530 - Add the documentation to the corresponding section + Updated gujarati translations - This macro was introduced in - commit 546fc0ca331c8d1b3393fe218a697b6a1a1c1072 + po/gu.po | 1059 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 513 insertions(+), 546 deletions(-) - docs/reference/gobject/gobject-sections.txt | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) +commit ddc6136e1f8f64c97744c4b725cad8cbac5ef8a3 +Author: Sandeep Shedmake +Date: Thu Apr 15 15:47:39 2010 +0530 -commit 324f928af62d8a0aa132a5caaec107d4daa76429 -Author: David Zeuthen -Date: Mon Apr 19 10:42:42 2010 -0400 + Updated Marathi Translations - Bug 615111 – GAsyncInitable's default implementation is broken + po/mr.po | 1061 + ++++++++++++++++++++++++++++++-------------------------------- + 1 files changed, 514 insertions(+), 547 deletions(-) - Signed-off-by: David Zeuthen +commit d17f4bee175cd9149d5f2b1ed1ae6d262d6a1394 +Author: Ryan Lortie +Date: Wed Apr 14 23:35:56 2010 -0400 - gio/gasyncinitable.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + GVariant: fix for g_variant_iter_loop() + + glib/gvariant.c | 14 +++++++++----- + 1 files changed, 9 insertions(+), 5 deletions(-) -commit e51ec13ab4bc629f73b41f2ad3e96b3a787a8760 +commit 3349bab02259bc66dbc128ce088ec6415d3e30f0 Author: Ryan Lortie -Date: Sat Apr 10 22:01:02 2010 -0400 +Date: Sat Apr 10 22:01:02 2010 -0400 Add g_return_if_fail()s to g_variant_new_from_data() @@ -483,9 +25402,18 @@ Date: Sat Apr 10 22:01:02 2010 -0400 glib/gvariant.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) -commit 48cfffc7b185f3e3367bac0beb04e66f536ec25d +commit a3dc7f8006e24a14a314ffbffa564d3d76f9cc95 +Author: Theppitak Karoonboonyanan +Date: Tue Apr 6 14:53:20 2010 +0700 + + Updated Thai translation. + + po/th.po | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +commit 34b9e9bdd24c8a19c235af58a7c90707fc179f87 Author: Jordi Serratosa -Date: Fri Apr 2 14:03:16 2010 +0200 +Date: Fri Apr 2 14:03:16 2010 +0200 Fixes to Catalan translation @@ -493,31 +25421,78 @@ Date: Fri Apr 2 14:03:16 2010 +0200 +++++++++++++++++++++++++++++++------------------------------- 1 files changed, 482 insertions(+), 476 deletions(-) -commit 634fdaa4ba91ee49fa95f5f62e045f0901ae4e4f -Author: Theppitak Karoonboonyanan -Date: Tue Apr 6 14:41:11 2010 +0700 +commit 93ea4ab6106327e2f417df1d9b00a5ec597e4a48 +Author: Behdad Esfahbod +Date: Wed Mar 31 10:50:08 2010 -0400 - Updated Thai translation. + Improve docs - po/th.po | 9 ++++----- - 1 files changed, 4 insertions(+), 5 deletions(-) + glib/gstring.c | 2 +- + glib/gurifuncs.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -commit 70a4217ba35492cd8e3549ca8da3fcc950421790 +commit f8470ed55ad3bf29cdc8c151b76c4f14b6be928a Author: Tor Lillqvist -Date: Tue Mar 30 19:39:19 2010 +0300 +Date: Tue Mar 30 20:46:46 2010 +0300 - Clarify _g_stat_struct mess + Fix build breakage on Unix - Use "struct stat" instead of "struct _stat" in the MinGW-or-64-bit - case. Should fix bug #614372. + glib/gstdio.h | 50 +++++++++++++++++++++++++------------------------- + 1 files changed, 25 insertions(+), 25 deletions(-) - glib/gstdio.c | 2 +- - glib/gstdio.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) +commit 1229281d95802c4c190284c7d331f67194a2553e +Author: Tor Lillqvist +Date: Sun Mar 21 20:04:18 2010 +0200 + + Define a public documented type for the struct stat used by g_stat() + + Define GStatBuf as the type used by g_stat() and g_lstat(). Replaces + the non-public struct tag _g_stat_struct. Mostly relevant for Windows + where there are several variants of stat-style structs. On POSIX, is + just another name for struct stat. + + Actually, also on many POSIX systems there are in fact several + variants of struct stat and corresponding stat() and lstat() + functions, but as g_stat and g_lstat are normally on POSIX just macros + that expand to stat and lstat, this should not cause a problem. It's + only when it's the actual g_stat() or g_lstat() implementation inside + GLib that gets called that one needs to be sure the passed struct is + the same as what GLib expects.) + + gio/giomodule.c | 6 +----- + gio/glocalfile.c | 23 +++++++++-------------- + gio/glocalfileinfo.c | 7 +------ + glib/gstdio.c | 32 ++++++++++++++++++-------------- + glib/gstdio.h | 38 +++++++++++++------------------------- + 5 files changed, 42 insertions(+), 64 deletions(-) + +commit e7763678b56e3be073cc55d707a6e92fc2055ee0 +Author: Benjamin Otte +Date: Fri Mar 26 20:37:09 2010 +0100 + + Fix race in g_cancellable_cancel() + + We need to check priv->cancelled after taking the lock. Previously we + only checked it just before taking the lock, which left a small chance + for a race. + + gio/gcancellable.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 5527a2ac2ce2b5bea10867fb2e39d2f1914cfbe6 +Author: Benjamin Otte +Date: Fri Mar 26 20:36:10 2010 +0100 + + Remove unneccessary variable from g_cancellable_cancel() + + The variable makes a complicated function even more complicated. + + gio/gcancellable.c | 25 ++++++++++--------------- + 1 files changed, 10 insertions(+), 15 deletions(-) commit c3f1025c33ab295eedcf41beeea276171ae2dc27 Author: Javier Jardón -Date: Mon Mar 29 18:20:03 2010 +0200 +Date: Mon Mar 29 18:20:03 2010 +0200 Remove g_type_class_get_private() public documentation @@ -532,7 +25507,7 @@ Date: Mon Mar 29 18:20:03 2010 +0200 commit 0f51e995658a50dbecb74b006f05a1ea69f43558 Author: Javier Jardón -Date: Sun Mar 28 17:43:33 2010 +0200 +Date: Sun Mar 28 17:43:33 2010 +0200 Fix g_type_class_add_private() documentation @@ -545,7 +25520,7 @@ Date: Sun Mar 28 17:43:33 2010 +0200 commit 461a4097d1a0a10106254a8fe917fc4e78ccff92 Author: Ask H. Larsen -Date: Sun Mar 28 00:13:28 2010 +0100 +Date: Sun Mar 28 00:13:28 2010 +0100 Updated Danish translation @@ -555,19 +25530,19 @@ Date: Sun Mar 28 00:13:28 2010 +0100 commit 2e27703a815e221052dd4db3e9e848e2401c3b8b Author: Chao-Hsiung Liao -Date: Sat Mar 27 20:50:57 2010 +0800 +Date: Sat Mar 27 20:50:57 2010 +0800 Updated Traditional Chinese translation(Hong Kong and Taiwan) - po/zh_HK.po | 966 + po/zh_HK.po | 966 +++++++++++++++++++++++++++++----------------------------- - po/zh_TW.po | 951 + po/zh_TW.po | 951 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 962 insertions(+), 955 deletions(-) commit 0e3c6ef848259051e4c8c8996a71c0d2d8c9b9f0 Author: Jamil Ahmed -Date: Sat Mar 27 17:44:03 2010 +0600 +Date: Sat Mar 27 17:44:03 2010 +0600 Updated Bengali translation @@ -577,7 +25552,7 @@ Date: Sat Mar 27 17:44:03 2010 +0600 commit 22dc3dd6487e2c794376a5c6850c3a3e7c2beea9 Author: Matthias Clasen -Date: Fri Mar 26 15:09:13 2010 -0400 +Date: Fri Mar 26 15:09:13 2010 -0400 Bump version @@ -586,117 +25561,117 @@ Date: Fri Mar 26 15:09:13 2010 -0400 commit ca631653acc1e1db0c3ebb05759d05f8bdc35ba6 Author: Matthias Clasen -Date: Fri Mar 26 15:08:00 2010 -0400 +Date: Fri Mar 26 15:08:00 2010 -0400 2.24.0 - po/af.po | 24 +- - po/am.po | 24 +- - po/ar.po | 24 +- - po/as.po | 24 +- - po/ast.po | 24 +- - po/az.po | 24 +- - po/be.po | 24 +- + po/af.po | 24 +- + po/am.po | 24 +- + po/ar.po | 24 +- + po/as.po | 24 +- + po/ast.po | 24 +- + po/az.po | 24 +- + po/be.po | 24 +- po/be@latin.po | 24 +- - po/bg.po | 24 +- - po/bn.po | 24 +- - po/bn_IN.po | 24 +- - po/bs.po | 24 +- - po/ca.po | 24 +- + po/bg.po | 24 +- + po/bn.po | 24 +- + po/bn_IN.po | 24 +- + po/bs.po | 24 +- + po/ca.po | 24 +- po/ca@valencia.po | 24 +- - po/cs.po | 24 +- - po/cy.po | 24 +- - po/da.po | 24 +- - po/de.po | 24 +- - po/dz.po | 24 +- - po/el.po | 24 +- - po/en@shaw.po | 24 +- - po/en_CA.po | 24 +- - po/en_GB.po | 24 +- - po/eo.po | 24 +- - po/es.po | 24 +- - po/et.po | 24 +- - po/eu.po | 82 ++-- - po/fa.po | 24 +- - po/fi.po | 24 +- - po/fr.po | 24 +- - po/ga.po | 24 +- - po/gl.po | 24 +- - po/gu.po | 24 +- - po/he.po | 24 +- - po/hi.po | 24 +- - po/hr.po | 24 +- - po/hu.po | 24 +- - po/hy.po | 24 +- - po/id.po | 24 +- - po/is.po | 24 +- - po/it.po | 24 +- - po/ja.po | 24 +- - po/ka.po | 24 +- - po/kn.po | 24 +- - po/ko.po | 24 +- - po/ku.po | 24 +- - po/lt.po | 24 +- - po/lv.po | 24 +- - po/mai.po | 24 +- - po/mg.po | 24 +- - po/mk.po | 24 +- - po/ml.po | 24 +- - po/mn.po | 24 +- - po/mr.po | 24 +- - po/ms.po | 24 +- - po/nb.po | 24 +- - po/nds.po | 24 +- - po/ne.po | 24 +- - po/nl.po | 24 +- - po/nn.po | 24 +- - po/oc.po | 24 +- - po/or.po | 24 +- - po/pa.po | 24 +- - po/pl.po | 24 +- - po/ps.po | 24 +- - po/pt.po | 24 +- - po/pt_BR.po | 24 +- - po/ro.po | 24 +- - po/ru.po | 24 +- - po/rw.po | 24 +- - po/si.po | 24 +- - po/sk.po | 24 +- - po/sl.po | 24 +- - po/sq.po | 24 +- - po/sr.po | 24 +- - po/sr@ije.po | 24 +- + po/cs.po | 24 +- + po/cy.po | 24 +- + po/da.po | 24 +- + po/de.po | 24 +- + po/dz.po | 24 +- + po/el.po | 24 +- + po/en@shaw.po | 24 +- + po/en_CA.po | 24 +- + po/en_GB.po | 24 +- + po/eo.po | 24 +- + po/es.po | 24 +- + po/et.po | 24 +- + po/eu.po | 82 ++-- + po/fa.po | 24 +- + po/fi.po | 24 +- + po/fr.po | 24 +- + po/ga.po | 24 +- + po/gl.po | 24 +- + po/gu.po | 24 +- + po/he.po | 24 +- + po/hi.po | 24 +- + po/hr.po | 24 +- + po/hu.po | 24 +- + po/hy.po | 24 +- + po/id.po | 24 +- + po/is.po | 24 +- + po/it.po | 24 +- + po/ja.po | 24 +- + po/ka.po | 24 +- + po/kn.po | 24 +- + po/ko.po | 24 +- + po/ku.po | 24 +- + po/lt.po | 24 +- + po/lv.po | 24 +- + po/mai.po | 24 +- + po/mg.po | 24 +- + po/mk.po | 24 +- + po/ml.po | 24 +- + po/mn.po | 24 +- + po/mr.po | 24 +- + po/ms.po | 24 +- + po/nb.po | 24 +- + po/nds.po | 24 +- + po/ne.po | 24 +- + po/nl.po | 24 +- + po/nn.po | 24 +- + po/oc.po | 24 +- + po/or.po | 24 +- + po/pa.po | 24 +- + po/pl.po | 24 +- + po/ps.po | 24 +- + po/pt.po | 24 +- + po/pt_BR.po | 24 +- + po/ro.po | 24 +- + po/ru.po | 24 +- + po/rw.po | 24 +- + po/si.po | 24 +- + po/sk.po | 24 +- + po/sl.po | 24 +- + po/sq.po | 24 +- + po/sr.po | 24 +- + po/sr@ije.po | 24 +- po/sr@latin.po | 24 +- - po/sv.po | 24 +- - po/ta.po | 24 +- - po/te.po | 24 +- - po/th.po | 24 +- - po/tl.po | 24 +- - po/tr.po | 24 +- - po/tt.po | 24 +- - po/uk.po | 946 +++++++++++++++++++------------------- - po/vi.po | 1311 + po/sv.po | 24 +- + po/ta.po | 24 +- + po/te.po | 24 +- + po/th.po | 24 +- + po/tl.po | 24 +- + po/tr.po | 24 +- + po/tt.po | 24 +- + po/uk.po | 946 +++++++++++++++++++------------------- + po/vi.po | 1311 +++++++++++++++++++++++++---------------------------- - po/wa.po | 24 +- - po/xh.po | 24 +- - po/yi.po | 24 +- - po/zh_CN.po | 24 +- - po/zh_HK.po | 24 +- - po/zh_TW.po | 24 +- + po/wa.po | 24 +- + po/xh.po | 24 +- + po/yi.po | 24 +- + po/zh_CN.po | 24 +- + po/zh_HK.po | 24 +- + po/zh_TW.po | 24 +- 92 files changed, 2209 insertions(+), 2266 deletions(-) commit 5ba8043f1217b338e220f0c6b427e58e28c241e8 Author: Matthias Clasen -Date: Fri Mar 26 11:15:49 2010 -0400 +Date: Fri Mar 26 11:15:49 2010 -0400 Third try to get this right... - docs/reference/gio/gio-sections.txt | 2 +- + docs/reference/gio/gio-sections.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit f6532620bc2439641b31a5df1d15489121fe918d Author: Matthias Clasen -Date: Fri Mar 26 11:05:28 2010 -0400 +Date: Fri Mar 26 11:05:28 2010 -0400 And another one... @@ -705,7 +25680,7 @@ Date: Fri Mar 26 11:05:28 2010 -0400 commit 7c8a1081651d4d17823ac8c6a35d3a60c85c81ac Author: Matthias Clasen -Date: Fri Mar 26 11:05:02 2010 -0400 +Date: Fri Mar 26 11:05:02 2010 -0400 Fix a typo @@ -714,7 +25689,7 @@ Date: Fri Mar 26 11:05:02 2010 -0400 commit 55e44a67e6bc4bf09d4de85ad64627a02595d07f Author: Matthias Clasen -Date: Fri Mar 26 10:39:56 2010 -0400 +Date: Fri Mar 26 10:39:56 2010 -0400 Bump version to 2.24.0 @@ -723,7 +25698,7 @@ Date: Fri Mar 26 10:39:56 2010 -0400 commit 8ee5ded1e9098adb54005851c09e38cf24bb6a32 Author: Matthias Clasen -Date: Fri Mar 26 10:39:33 2010 -0400 +Date: Fri Mar 26 10:39:33 2010 -0400 Updates @@ -732,16 +25707,16 @@ Date: Fri Mar 26 10:39:33 2010 -0400 commit 6cce575a25abc8157873d070bb317d66a225485a Author: Matthias Clasen -Date: Fri Mar 26 10:24:06 2010 -0400 +Date: Fri Mar 26 10:24:06 2010 -0400 Fix a typo - docs/reference/gio/gio-sections.txt | 2 +- + docs/reference/gio/gio-sections.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 78b764f325c12a518e5bcc06771347da06d5ea68 Author: Matthias Clasen -Date: Fri Mar 26 10:19:57 2010 -0400 +Date: Fri Mar 26 10:19:57 2010 -0400 More doc fixups @@ -750,20 +25725,20 @@ Date: Fri Mar 26 10:19:57 2010 -0400 commit 81e2aa941bbfd02bf1b6235da12834d282ceda0c Author: Matthias Clasen -Date: Fri Mar 26 10:11:46 2010 -0400 +Date: Fri Mar 26 10:11:46 2010 -0400 Some more doc cleanups - docs/reference/gio/gio-sections.txt | 2 + - docs/reference/gobject/gobject-sections.txt | 2 +- + docs/reference/gio/gio-sections.txt | 2 + + docs/reference/gobject/gobject-sections.txt | 2 +- docs/reference/gobject/tmpl/gobject-unused.sgml | 9 +++++ - gobject/gtype.c | 37 + gobject/gtype.c | 37 +++------------------- 4 files changed, 17 insertions(+), 33 deletions(-) commit c4ea7d58f78ca946fe84718386f9f888b5f93520 Author: Matthias Clasen -Date: Fri Mar 26 09:30:25 2010 -0400 +Date: Fri Mar 26 09:30:25 2010 -0400 Small doc addition @@ -772,40 +25747,40 @@ Date: Fri Mar 26 09:30:25 2010 -0400 commit 431840a44e1ec799c974c7ea626c3164ec9dc2bb Author: Matthias Clasen -Date: Fri Mar 26 09:22:58 2010 -0400 +Date: Fri Mar 26 09:22:58 2010 -0400 Add g_io_module_query to docs - docs/reference/gio/gio-sections.txt | 1 + + docs/reference/gio/gio-sections.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit 6e77ee097100dc3fd695a6dad8811253cea23436 Author: Matthias Clasen -Date: Fri Mar 26 09:01:48 2010 -0400 +Date: Fri Mar 26 09:01:48 2010 -0400 Correct the error handling in splice_stream_with_progress We need to get out of both loops, so a simple 'break' doesn't cut it. Bugs 613748 and 613923 - gio/gfile.c | 5 +++-- + gio/gfile.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) commit 409a3a61ece7bbdacbf2469eb7b86c3aa3c44653 Author: Ryan Lortie -Date: Fri Mar 26 08:01:51 2010 -0500 +Date: Fri Mar 26 08:01:51 2010 -0500 GVariant: Stop lexing format strings at : Lets us parse this successfully: {%s: %s}. glib/gvariant-parser.c | 7 ++++--- - glib/tests/gvariant.c | 1 + + glib/tests/gvariant.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) commit df67a0662b0c20ab58f992fc114a48039e7fb9e0 Author: Maxim V. Dziumanenko -Date: Fri Mar 26 11:42:19 2010 +0200 +Date: Fri Mar 26 11:42:19 2010 +0200 Updated Ukrainian translation @@ -815,7 +25790,7 @@ Date: Fri Mar 26 11:42:19 2010 +0200 commit fd448dd7ceeb4be93f2cfea54a78e0564a3718f0 Author: Ryan Lortie -Date: Tue Mar 23 10:01:53 2010 -0500 +Date: Tue Mar 23 10:01:53 2010 -0500 Add doc note about read_until() inconsistency. @@ -826,7 +25801,7 @@ Date: Tue Mar 23 10:01:53 2010 -0500 commit a6c57591c0928fee3d3f026289972024bd2b00ec Author: Ryan Lortie -Date: Tue Mar 23 09:17:15 2010 -0500 +Date: Tue Mar 23 09:17:15 2010 -0500 Support &s as key of dict entry in format string @@ -838,7 +25813,7 @@ Date: Tue Mar 23 09:17:15 2010 -0500 commit 816990a0118f33ae280846ac040803ce58979162 Author: Ryan Lortie -Date: Tue Mar 23 09:06:52 2010 -0500 +Date: Tue Mar 23 09:06:52 2010 -0500 GVariant: Removing mentions of &a from docs @@ -851,7 +25826,7 @@ Date: Tue Mar 23 09:06:52 2010 -0500 commit 35059f2c0415fbd521632d29ecb91e8c93545e0e Author: Christian Dywan -Date: Tue Mar 23 11:59:43 2010 +0100 +Date: Tue Mar 23 11:59:43 2010 +0100 Correct typo of libray/ library in GObject tutorial @@ -862,7 +25837,7 @@ Date: Tue Mar 23 11:59:43 2010 +0100 commit ace9a25fb39781a01a78c8e9aa1c58a51224e8b8 Author: Ryan Lortie -Date: Mon Mar 22 11:59:08 2010 -0500 +Date: Mon Mar 22 11:59:08 2010 -0500 Bug 613601 - buglet in dup_close_on_exec_fd() @@ -870,24 +25845,24 @@ Date: Mon Mar 22 11:59:08 2010 -0500 instead of just setting it outright. - gio/gunixfdlist.c | 9 +++++++-- + gio/gunixfdlist.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) commit 440713e393cf99e29f716f5f634d4bc4ce0e281c Author: Tor Lillqvist -Date: Mon Mar 22 15:53:47 2010 +0200 +Date: Mon Mar 22 15:53:47 2010 +0200 Filter out gatomic-gcc.c from the VS project sources Instead, explicitly include gatomic.c. build/win32/vs9/glib.vcprojin | 1 + - glib/Makefile.am | 6 ++++-- + glib/Makefile.am | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) commit 365fd70f263b99646cef7a5335282fd3f1efb520 Author: Tor Lillqvist -Date: Mon Mar 22 15:33:38 2010 +0200 +Date: Mon Mar 22 15:33:38 2010 +0200 Make config.h.win32 match what the configure script produces @@ -897,7 +25872,7 @@ Date: Mon Mar 22 15:33:38 2010 +0200 commit 580ecb32d9af4a7c8a00076a23d82d9729131361 Author: Inaki Larranaga Murgoitio -Date: Mon Mar 22 12:34:25 2010 +0100 +Date: Mon Mar 22 12:34:25 2010 +0100 Updated Basque language @@ -907,7 +25882,7 @@ Date: Mon Mar 22 12:34:25 2010 +0100 commit e2434fd2d659f976febc3abe08abe82149447d46 Author: Clytie -Date: Mon Mar 22 21:33:36 2010 +1030 +Date: Mon Mar 22 21:33:36 2010 +1030 Updated Vietnamese translation @@ -917,7 +25892,7 @@ Date: Mon Mar 22 21:33:36 2010 +1030 commit db83dd27c571e34e2974a4cff560fdfb255c2bf2 Author: Ryan Lortie -Date: Sun Mar 21 20:12:18 2010 -0500 +Date: Sun Mar 21 20:12:18 2010 -0500 Drop { } for favour of { 0, }. @@ -926,7 +25901,7 @@ Date: Sun Mar 21 20:12:18 2010 -0500 commit 468bbbfce1736259ae75bd27847b5b25332ada5c Author: Ryan Lortie -Date: Sun Mar 21 20:07:45 2010 -0500 +Date: Sun Mar 21 20:07:45 2010 -0500 Bump version @@ -935,112 +25910,112 @@ Date: Sun Mar 21 20:07:45 2010 -0500 commit 0afc140712a7c6b7cf2179626370b33ca930dea2 Author: Ryan Lortie -Date: Sun Mar 21 20:06:39 2010 -0500 +Date: Sun Mar 21 20:06:39 2010 -0500 2.23.6 - NEWS | 41 + + NEWS | 41 + docs/reference/glib/tmpl/glib-unused.sgml | 67 ++ - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/version.sgml | 68 -- - po/af.po | 951 ++++++++++++------------ - po/am.po | 80 +- - po/ar.po | 80 +- - po/as.po | 80 +- - po/ast.po | 80 +- - po/az.po | 80 +- - po/be.po | 80 +- - po/be@latin.po | 80 +- - po/bg.po | 80 +- - po/bn.po | 80 +- - po/bn_IN.po | 80 +- - po/bs.po | 80 +- - po/ca.po | 80 +- - po/ca@valencia.po | 80 +- - po/cs.po | 942 ++++++++++++------------ - po/cy.po | 80 +- - po/da.po | 80 +- - po/de.po | 80 +- - po/dz.po | 80 +- - po/el.po | 942 ++++++++++++------------ - po/en@shaw.po | 80 +- - po/en_CA.po | 80 +- - po/en_GB.po | 80 +- - po/eo.po | 80 +- - po/es.po | 80 +- - po/et.po | 80 +- - po/eu.po | 80 +- - po/fa.po | 80 +- - po/fi.po | 952 ++++++++++++------------ - po/fr.po | 80 +- - po/ga.po | 80 +- - po/gl.po | 951 ++++++++++++------------ - po/gu.po | 80 +- - po/he.po | 80 +- - po/hi.po | 80 +- - po/hr.po | 80 +- - po/hu.po | 80 +- - po/hy.po | 80 +- - po/id.po | 80 +- - po/is.po | 80 +- - po/it.po | 80 +- - po/ja.po | 80 +- - po/ka.po | 80 +- - po/kn.po | 80 +- - po/ko.po | 80 +- - po/ku.po | 80 +- - po/lt.po | 80 +- - po/lv.po | 80 +- - po/mai.po | 80 +- - po/mg.po | 80 +- - po/mk.po | 80 +- - po/ml.po | 80 +- - po/mn.po | 80 +- - po/mr.po | 80 +- - po/ms.po | 80 +- - po/nb.po | 80 +- - po/nds.po | 1187 + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/version.sgml | 68 -- + po/af.po | 951 ++++++++++++------------ + po/am.po | 80 +- + po/ar.po | 80 +- + po/as.po | 80 +- + po/ast.po | 80 +- + po/az.po | 80 +- + po/be.po | 80 +- + po/be@latin.po | 80 +- + po/bg.po | 80 +- + po/bn.po | 80 +- + po/bn_IN.po | 80 +- + po/bs.po | 80 +- + po/ca.po | 80 +- + po/ca@valencia.po | 80 +- + po/cs.po | 942 ++++++++++++------------ + po/cy.po | 80 +- + po/da.po | 80 +- + po/de.po | 80 +- + po/dz.po | 80 +- + po/el.po | 942 ++++++++++++------------ + po/en@shaw.po | 80 +- + po/en_CA.po | 80 +- + po/en_GB.po | 80 +- + po/eo.po | 80 +- + po/es.po | 80 +- + po/et.po | 80 +- + po/eu.po | 80 +- + po/fa.po | 80 +- + po/fi.po | 952 ++++++++++++------------ + po/fr.po | 80 +- + po/ga.po | 80 +- + po/gl.po | 951 ++++++++++++------------ + po/gu.po | 80 +- + po/he.po | 80 +- + po/hi.po | 80 +- + po/hr.po | 80 +- + po/hu.po | 80 +- + po/hy.po | 80 +- + po/id.po | 80 +- + po/is.po | 80 +- + po/it.po | 80 +- + po/ja.po | 80 +- + po/ka.po | 80 +- + po/kn.po | 80 +- + po/ko.po | 80 +- + po/ku.po | 80 +- + po/lt.po | 80 +- + po/lv.po | 80 +- + po/mai.po | 80 +- + po/mg.po | 80 +- + po/mk.po | 80 +- + po/ml.po | 80 +- + po/mn.po | 80 +- + po/mr.po | 80 +- + po/ms.po | 80 +- + po/nb.po | 80 +- + po/nds.po | 1187 +++++++++++++---------------- - po/ne.po | 80 +- - po/nl.po | 80 +- - po/nn.po | 80 +- - po/oc.po | 80 +- - po/or.po | 80 +- - po/pa.po | 970 ++++++++++++------------ - po/pl.po | 80 +- - po/ps.po | 80 +- - po/pt.po | 80 +- - po/pt_BR.po | 80 +- - po/ro.po | 948 ++++++++++++------------ - po/ru.po | 80 +- - po/rw.po | 80 +- - po/si.po | 80 +- - po/sk.po | 80 +- - po/sl.po | 80 +- - po/sq.po | 80 +- - po/sr.po | 950 ++++++++++++------------ - po/sr@ije.po | 80 +- - po/sr@latin.po | 961 ++++++++++++------------ - po/sv.po | 80 +- - po/ta.po | 80 +- - po/te.po | 80 +- - po/th.po | 80 +- - po/tl.po | 80 +- - po/tr.po | 80 +- - po/tt.po | 80 +- - po/uk.po | 80 +- - po/vi.po | 80 +- - po/wa.po | 80 +- - po/xh.po | 80 +- - po/yi.po | 80 +- - po/zh_CN.po | 80 +- - po/zh_HK.po | 80 +- - po/zh_TW.po | 80 +- + po/ne.po | 80 +- + po/nl.po | 80 +- + po/nn.po | 80 +- + po/oc.po | 80 +- + po/or.po | 80 +- + po/pa.po | 970 ++++++++++++------------ + po/pl.po | 80 +- + po/ps.po | 80 +- + po/pt.po | 80 +- + po/pt_BR.po | 80 +- + po/ro.po | 948 ++++++++++++------------ + po/ru.po | 80 +- + po/rw.po | 80 +- + po/si.po | 80 +- + po/sk.po | 80 +- + po/sl.po | 80 +- + po/sq.po | 80 +- + po/sr.po | 950 ++++++++++++------------ + po/sr@ije.po | 80 +- + po/sr@latin.po | 961 ++++++++++++------------ + po/sv.po | 80 +- + po/ta.po | 80 +- + po/te.po | 80 +- + po/th.po | 80 +- + po/tl.po | 80 +- + po/tr.po | 80 +- + po/tt.po | 80 +- + po/uk.po | 80 +- + po/vi.po | 80 +- + po/wa.po | 80 +- + po/xh.po | 80 +- + po/yi.po | 80 +- + po/zh_CN.po | 80 +- + po/zh_HK.po | 80 +- + po/zh_TW.po | 80 +- 96 files changed, 8192 insertions(+), 8303 deletions(-) commit 5620f96305ee276ac758de989589a93de89ed40a Author: Ryan Lortie -Date: Sun Mar 21 14:17:21 2010 -0500 +Date: Sun Mar 21 14:17:21 2010 -0500 silence some false-alarm uninitialised warnings @@ -1049,65 +26024,65 @@ Date: Sun Mar 21 14:17:21 2010 -0500 commit 6f330383974bb235d7050ebef61426541823c33a Author: Ryan Lortie -Date: Sun Mar 21 14:04:07 2010 -0500 +Date: Sun Mar 21 14:04:07 2010 -0500 gtk-doc fixups - docs/reference/glib/glib-sections.txt | 2 +- - docs/reference/gobject/gobject-sections.txt | 2 ++ - glib/ghash.c | 4 ++-- - glib/gvariant-parser.c | 7 +++++++ + docs/reference/glib/glib-sections.txt | 2 +- + docs/reference/gobject/gobject-sections.txt | 2 ++ + glib/ghash.c | 4 ++-- + glib/gvariant-parser.c | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) commit c5a1c95b1f991db6700a204e5d41c8cc650c7d42 Author: Ryan Lortie -Date: Sun Mar 21 13:46:09 2010 -0500 +Date: Sun Mar 21 13:46:09 2010 -0500 GVariant docs fixes glib/gvariant-parser.c | 16 +++++++++++++++- - glib/gvariant.h | 6 +++--- + glib/gvariant.h | 6 +++--- 2 files changed, 18 insertions(+), 4 deletions(-) commit 5c419c300b43b4e3ac462761dda4360ed1c5de9b Author: Ryan Lortie -Date: Sun Mar 21 13:07:36 2010 -0500 +Date: Sun Mar 21 13:07:36 2010 -0500 gitignore for win32 build stuff - .gitignore | 1 + - build/win32/vs9/.gitignore | 3 +++ + .gitignore | 1 + + build/win32/vs9/.gitignore | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) commit bf4dbdbf0e1a3ac4349980942b9e91056ce7e448 Author: Ryan Lortie -Date: Sun Mar 21 12:31:46 2010 -0500 +Date: Sun Mar 21 12:31:46 2010 -0500 merge GVariant parser docs/reference/glib/glib-sections.txt | 7 + - glib/Makefile.am | 1 + - glib/glib.symbols | 7 + - glib/gvariant-parser.c | 2185 + glib/Makefile.am | 1 + + glib/glib.symbols | 7 + + glib/gvariant-parser.c | 2185 +++++++++++++++++++++++++++++++++ - glib/gvariant.c | 28 +- - glib/gvariant.h | 13 + - glib/tests/gvariant.c | 249 ++++- + glib/gvariant.c | 28 +- + glib/gvariant.h | 13 + + glib/tests/gvariant.c | 249 ++++- 7 files changed, 2473 insertions(+), 17 deletions(-) commit 2a209cb2516999c4d2f08368c720f7506acde9a5 Author: Ryan Lortie -Date: Sun Mar 21 12:54:36 2010 -0500 +Date: Sun Mar 21 12:54:36 2010 -0500 make check / makedistcheck fixes - configure.in | 1 - + configure.in | 1 - gobject/gobject.symbols | 2 ++ 2 files changed, 2 insertions(+), 1 deletions(-) commit 3369548130bdd02534f2a6c6e7baa1f29375a41d Author: Tor Lillqvist -Date: Sun Mar 21 16:54:11 2010 +0200 +Date: Sun Mar 21 16:54:11 2010 +0200 Add new headers to be installed the VS "install" project @@ -1120,7 +26095,7 @@ Date: Sun Mar 21 16:54:11 2010 +0200 commit 226cc663e40606e9749a368e9d2b2e61d9a9d532 Author: Tor Lillqvist -Date: Sun Mar 21 16:11:49 2010 +0200 +Date: Sun Mar 21 16:11:49 2010 +0200 Avoid much of duplication in lists of source files @@ -1134,24 +26109,24 @@ Date: Sun Mar 21 16:11:49 2010 +0200 Windows-specific source files, and the sources files of gnulib and pcre. - build/win32/vs9/Makefile.am | 3 + - build/win32/vs9/README.txt | 3 +- - build/win32/vs9/gio.vcproj | 608 + build/win32/vs9/Makefile.am | 3 + + build/win32/vs9/README.txt | 3 +- + build/win32/vs9/gio.vcproj | 608 -------------------------------------- - build/win32/vs9/gio.vcprojin | 234 +++++++++++++++ - build/win32/vs9/glib.vcproj | 570 + build/win32/vs9/gio.vcprojin | 234 +++++++++++++++ + build/win32/vs9/glib.vcproj | 570 ----------------------------------- - build/win32/vs9/glib.vcprojin | 298 +++++++++++++++++++ + build/win32/vs9/glib.vcprojin | 298 +++++++++++++++++++ build/win32/vs9/gobject.vcproj | 281 ------------------ build/win32/vs9/gobject.vcprojin | 218 ++++++++++++++ - gio/Makefile.am | 11 +- - glib/Makefile.am | 11 +- - gobject/Makefile.am | 11 +- + gio/Makefile.am | 11 +- + glib/Makefile.am | 11 +- + gobject/Makefile.am | 11 +- 11 files changed, 785 insertions(+), 1463 deletions(-) commit 504b8b8f0125dcba530d4f34c4beaaa129cc5d85 Author: Tor Lillqvist -Date: Sun Mar 21 14:50:45 2010 +0200 +Date: Sun Mar 21 14:50:45 2010 +0200 Avoid struct stat issues with MSVC @@ -1160,53 +26135,53 @@ Date: Sun Mar 21 14:50:45 2010 +0200 commit 28b025de962a798fa7a9fb9adbfdfcc4852fddec Author: Tor Lillqvist -Date: Sun Mar 21 13:33:44 2010 +0200 +Date: Sun Mar 21 13:33:44 2010 +0200 Drop empty Tool elements from the project files for clarity Makes the files appear a bit simpler when edited manually. - build/win32/vs9/gio.vcproj | 12 ------------ - build/win32/vs9/glib-genmarshal.vcproj | 12 ------------ - build/win32/vs9/glib.vcproj | 12 ------------ - build/win32/vs9/gmodule.vcproj | 12 ------------ - build/win32/vs9/gobject.vcproj | 12 ------------ - build/win32/vs9/gspawn-win32-helper-console.vcproj | 12 ------------ - build/win32/vs9/gspawn-win32-helper.vcproj | 12 ------------ - build/win32/vs9/gthread.vcproj | 12 ------------ - build/win32/vs9/testglib.vcproj | 12 ------------ + build/win32/vs9/gio.vcproj | 12 ------------ + build/win32/vs9/glib-genmarshal.vcproj | 12 ------------ + build/win32/vs9/glib.vcproj | 12 ------------ + build/win32/vs9/gmodule.vcproj | 12 ------------ + build/win32/vs9/gobject.vcproj | 12 ------------ + build/win32/vs9/gspawn-win32-helper-console.vcproj | 12 ------------ + build/win32/vs9/gspawn-win32-helper.vcproj | 12 ------------ + build/win32/vs9/gthread.vcproj | 12 ------------ + build/win32/vs9/testglib.vcproj | 12 ------------ 9 files changed, 0 insertions(+), 108 deletions(-) commit 2ab76c5b3610faa20dfae2550688ab0d6620b29b Author: Tor Lillqvist -Date: Sun Mar 21 11:22:06 2010 +0200 +Date: Sun Mar 21 11:22:06 2010 +0200 Make the GVariant code compile with a non-gcc compiler In particular, tested with Microsoft Visual C 2008. - glib/gvariant-core.c | 2 +- - glib/gvariant-serialiser.c | 28 ++++++++++++++-------------- - glib/gvariant.c | 8 ++++++-- - glib/gvarianttypeinfo.c | 22 ++++++++++++---------- + glib/gvariant-core.c | 2 +- + glib/gvariant-serialiser.c | 28 ++++++++++++++-------------- + glib/gvariant.c | 8 ++++++-- + glib/gvarianttypeinfo.c | 22 ++++++++++++---------- 4 files changed, 33 insertions(+), 27 deletions(-) commit dc51eff2a9ca234fbb09c7b94c4643ea3750d80d Author: Tor Lillqvist -Date: Sat Mar 20 13:32:37 2010 +0200 +Date: Sat Mar 20 13:32:37 2010 +0200 Update with new source files and dependencies - build/win32/vs9/gio.vcproj | 36 + build/win32/vs9/gio.vcproj | 36 ++++++++++++++++++++++++++++++++---- - build/win32/vs9/glib.sln | 1 + - build/win32/vs9/glib.vcproj | 21 +++++++++++++++++++++ + build/win32/vs9/glib.sln | 1 + + build/win32/vs9/glib.vcproj | 21 +++++++++++++++++++++ build/win32/vs9/gobject.vcproj | 4 ++++ 4 files changed, 58 insertions(+), 4 deletions(-) commit 782de94c587cc3eed53653443439b62aaee19200 Author: Tor Lillqvist -Date: Sat Mar 20 13:31:55 2010 +0200 +Date: Sat Mar 20 13:31:55 2010 +0200 Drop the unmaintained vs8 project files from dist @@ -1215,7 +26190,7 @@ Date: Sat Mar 20 13:31:55 2010 +0200 commit 77cc740243e9f55603d833f129e999f8824a18f1 Author: Tommi Vainikainen -Date: Sat Mar 20 00:01:00 2010 +0200 +Date: Sat Mar 20 00:01:00 2010 +0200 Updated Finnish translation @@ -1225,7 +26200,7 @@ Date: Sat Mar 20 00:01:00 2010 +0200 commit 34d0db361ea514c026c54f14853120d601e1d0b5 Author: A S Alam -Date: Fri Mar 19 08:18:41 2010 +0530 +Date: Fri Mar 19 08:18:41 2010 +0530 update Punjabi Translation @@ -1235,7 +26210,7 @@ Date: Fri Mar 19 08:18:41 2010 +0530 commit bedaa8027537378c8b7fec68acb422eac44f240e Author: Nikos Bakaoukas -Date: Fri Mar 19 00:10:07 2010 +0200 +Date: Fri Mar 19 00:10:07 2010 +0200 Updated Greek translation for glib @@ -1245,7 +26220,7 @@ Date: Fri Mar 19 00:10:07 2010 +0200 commit 6243b1eb5f8f55abc8c05a18d7dfbdd7968fab50 Author: Dumitru Mișu Moldovan -Date: Thu Mar 18 22:47:55 2010 +0200 +Date: Thu Mar 18 22:47:55 2010 +0200 Updated Romanian translation @@ -1255,7 +26230,7 @@ Date: Thu Mar 18 22:47:55 2010 +0200 commit 3628f7815d13d8b495cd27ce49f3c15372f23cfb Author: Nils-Christoph Fiedler -Date: Thu Mar 18 13:54:17 2010 +0100 +Date: Thu Mar 18 13:54:17 2010 +0100 Updated LowGerman translation @@ -1265,7 +26240,7 @@ Date: Thu Mar 18 13:54:17 2010 +0100 commit 41383b303c0bb54da68bbf5500b5e2d9e552ab69 Author: Sebastian Dröge -Date: Wed Mar 17 15:11:00 2010 +0100 +Date: Wed Mar 17 15:11:00 2010 +0100 Bug 612502 - Add support for class private data @@ -1280,7 +26255,7 @@ Date: Wed Mar 17 15:11:00 2010 +0100 commit 2295ba857f09fa58c6e61ec4147536021055bbf6 Author: Benjamin Otte -Date: Tue Mar 16 16:34:50 2010 +0100 +Date: Tue Mar 16 16:34:50 2010 +0100 The fallback parameter to g_convert_with_fallback() should be const @@ -1292,7 +26267,7 @@ Date: Tue Mar 16 16:34:50 2010 +0100 commit 751feb916ab2f0cd74839233101fc0b9d2fb994c Author: Ryan Lortie -Date: Mon Mar 15 17:45:02 2010 -0400 +Date: Mon Mar 15 17:45:02 2010 -0400 Bug 612502 - build fails on glib/tests/gvariant.c @@ -1306,19 +26281,19 @@ Date: Mon Mar 15 17:45:02 2010 -0400 commit 1953b4087f2852e43c0a4dd46bfbd6228135cf70 Author: Christian Persch -Date: Sun Feb 7 13:39:10 2010 +0100 +Date: Sun Feb 7 13:39:10 2010 +0100 Use static assert over runtime assert if possible We can test the these at compile time. Bug #609231. - glib/gmappedfile.c | 19 ++++++++++--------- - glib/gvariant.c | 13 ++++++++----- + glib/gmappedfile.c | 19 ++++++++++--------- + glib/gvariant.c | 13 ++++++++----- 2 files changed, 18 insertions(+), 14 deletions(-) commit 24aeaebc48a5636c2f5391de646225d1e471f7ba Author: Nils-Christoph Fiedler -Date: Mon Mar 15 14:18:48 2010 +0100 +Date: Mon Mar 15 14:18:48 2010 +0100 Added LowGerman translation @@ -1328,16 +26303,16 @@ Date: Mon Mar 15 14:18:48 2010 +0100 commit 2b1b1563a0119de94d2ec0d05f1db493872852dc Author: Nils-Christoph Fiedler -Date: Mon Mar 15 14:18:43 2010 +0100 +Date: Mon Mar 15 14:18:43 2010 +0100 Added LowGerman translation - po/LINGUAS | 1 + + po/LINGUAS | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit 7e4d88b290589a2a91d90b084751002c246564d6 Author: Ryan Lortie -Date: Sun Mar 14 22:27:06 2010 -0400 +Date: Sun Mar 14 22:27:06 2010 -0400 gvariant test: Remove unused variable @@ -1346,7 +26321,7 @@ Date: Sun Mar 14 22:27:06 2010 -0400 commit 9f16c70c16ec90be209fdaa120d2810f4128f2f0 Author: Petr Kovar -Date: Mon Mar 15 02:30:27 2010 +0100 +Date: Mon Mar 15 02:30:27 2010 +0100 Update Czech translation @@ -1356,22 +26331,22 @@ Date: Mon Mar 15 02:30:27 2010 +0100 commit 9dea0253a3ded0e32daa33f11850797109018326 Author: Ryan Lortie -Date: Sun Mar 14 15:55:48 2010 -0400 +Date: Sun Mar 14 15:55:48 2010 -0400 GVariant: add loading, byteswapping, normalisation docs/reference/glib/glib-sections.txt | 4 + - glib/glib.symbols | 5 + - glib/gvariant-core.c | 61 +++++++++- - glib/gvariant.c | 207 + glib/glib.symbols | 5 + + glib/gvariant-core.c | 61 +++++++++- + glib/gvariant.c | 207 +++++++++++++++++++++++++++++++++ - glib/gvariant.h | 10 ++ - glib/tests/gvariant.c | 72 ++++++++++++ + glib/gvariant.h | 10 ++ + glib/tests/gvariant.c | 72 ++++++++++++ 6 files changed, 355 insertions(+), 4 deletions(-) commit 1ac590b7f728d4a029a354be9aad24863badba02 Author: Ryan Lortie -Date: Sun Mar 14 13:04:43 2010 -0400 +Date: Sun Mar 14 13:04:43 2010 -0400 GBuffer: very small cosmetic fix to header file @@ -1380,7 +26355,7 @@ Date: Sun Mar 14 13:04:43 2010 -0400 commit 056feef60b79e867190697f2d26e3ac7edf903a5 Author: Ryan Lortie -Date: Sat Mar 13 19:55:56 2010 -0500 +Date: Sat Mar 13 19:55:56 2010 -0500 GVariantIter: expand the size of the dummy struct @@ -1392,7 +26367,7 @@ Date: Sat Mar 13 19:55:56 2010 -0500 commit f552689058c27ccebaf4271c4a5afc4197b74a8f Author: Colin Walters -Date: Sat Mar 13 18:11:31 2010 -0500 +Date: Sat Mar 13 18:11:31 2010 -0500 [GDesktopAppInfo] New function g_desktop_app_info_get_filename @@ -1400,15 +26375,15 @@ Date: Sat Mar 13 18:11:31 2010 -0500 https://bugzilla.gnome.org/show_bug.cgi?id=612832 - docs/reference/gio/gio-sections.txt | 1 + - gio/gdesktopappinfo.c | 17 +++++++++++++++++ - gio/gdesktopappinfo.h | 2 ++ - gio/gio.symbols | 1 + + docs/reference/gio/gio-sections.txt | 1 + + gio/gdesktopappinfo.c | 17 +++++++++++++++++ + gio/gdesktopappinfo.h | 2 ++ + gio/gio.symbols | 1 + 4 files changed, 21 insertions(+), 0 deletions(-) commit 1be8ad35144d34de99b6153cbbfa8f9add46888b Author: Thomas Kristensen -Date: Sun Mar 14 11:47:17 2010 +0200 +Date: Sun Mar 14 11:47:17 2010 +0200 Close the socket event in finalizer instead of in close method @@ -1429,7 +26404,7 @@ Date: Sun Mar 14 11:47:17 2010 +0200 commit 6c5d2798f600a0536306e1c67b2e26e2c6eff006 Author: Fran Diéguez -Date: Sat Mar 13 21:00:44 2010 +0100 +Date: Sat Mar 13 21:00:44 2010 +0100 Update Galician translation @@ -1439,31 +26414,31 @@ Date: Sat Mar 13 21:00:44 2010 +0100 commit 31cf766e647b46cd28cc6d2405c729d06063680d Author: Friedel Wolff -Date: Sat Mar 13 20:48:05 2010 +0100 +Date: Sat Mar 13 20:48:05 2010 +0100 Add Afrikaans translation - po/LINGUAS | 1 + + po/LINGUAS | 1 + po/af.po | 2015 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2016 insertions(+), 0 deletions(-) commit 62a133f55dcd5626e9583aabc2d95926936a8475 Author: Javier Jardón -Date: Fri Mar 12 20:37:04 2010 +0100 +Date: Fri Mar 12 20:37:04 2010 +0100 Improve the documentation about single include exceptions Also, reenable the compiling Glib application section Fixes https://bugzilla.gnome.org/show_bug.cgi?id=612736 - docs/reference/glib/compiling.sgml | 9 +++++++++ - docs/reference/glib/glib-docs.sgml | 1 + + docs/reference/glib/compiling.sgml | 9 +++++++++ + docs/reference/glib/glib-docs.sgml | 1 + 2 files changed, 10 insertions(+), 0 deletions(-) commit 5b19345246aa179788b09b7a82702e79f9d815d8 Author: Ryan Lortie -Date: Fri Mar 12 15:38:47 2010 -0500 +Date: Fri Mar 12 15:38:47 2010 -0500 Bug 610858 - gvariant test fails sometimes @@ -1478,7 +26453,7 @@ Date: Fri Mar 12 15:38:47 2010 -0500 commit a57522deae75264bade35eae8826cda2771530c6 Author: Tor Lillqvist -Date: Fri Mar 12 10:42:43 2010 +0200 +Date: Fri Mar 12 10:42:43 2010 +0200 The SO_KEEPALIVE value seems to actually be a char on Windows @@ -1490,7 +26465,7 @@ Date: Fri Mar 12 10:42:43 2010 +0200 commit 1caaa4f591ead74f0a146d73155f9cfb65899bed Author: Javier Jardón -Date: Wed Mar 10 05:06:50 2010 +0100 +Date: Wed Mar 10 05:06:50 2010 +0100 [docs] Don't reference deprecated functions @@ -1499,16 +26474,16 @@ Date: Wed Mar 10 05:06:50 2010 +0100 gtk_input_remove(), gdk_input_add(), gdk_input_add_full() and gdk_input_remove() - glib/giochannel.c | 5 ++--- + glib/giochannel.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) commit 95d42761a9fff5813db46a41bc2ec6c86a2eb947 Author: Miloš Popović -Date: Tue Mar 9 20:29:43 2010 +0100 +Date: Tue Mar 9 20:29:43 2010 +0100 Updated Serbian translations - po/sr.po | 1017 + po/sr.po | 1017 +++++++++++++++++++++++++++---------------------------- po/sr@latin.po | 1028 ++++++++++++++++++++++++++++---------------------------- @@ -1516,18 +26491,18 @@ Date: Tue Mar 9 20:29:43 2010 +0100 commit a85b9c4badf22777b1b099befcd9e033afa45dbf Author: Ryan Lortie -Date: Tue Mar 9 13:34:00 2010 -0500 +Date: Tue Mar 9 13:34:00 2010 -0500 'default: g_assert_not_reached();' to silence GCC Closes bug #612327 reported by Claudio Saavedra. - glib/gvariant-serialiser.c | 3 +++ + glib/gvariant-serialiser.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) commit 89fa967ba1c72081a1698d35e6c10c99190b612d Author: Dagobert Michelsen -Date: Tue Mar 9 15:02:57 2010 +0100 +Date: Tue Mar 9 15:02:57 2010 +0100 Use G_STRFUNC instead of explicit gcc-only __PRETTY_FUNC__ @@ -1536,16 +26511,16 @@ Date: Tue Mar 9 15:02:57 2010 +0100 commit c69e6fd837cb92d0c7050d8ea2d0f98b6f70fbe8 Author: Behdad Esfahbod -Date: Mon Mar 8 14:28:23 2010 -0500 +Date: Mon Mar 8 14:28:23 2010 -0500 Cosmetic - glib/gmem.h | 18 ++++++++++-------- + glib/gmem.h | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) commit f6166be24d6c43ccbaf80439aefe8eff83e7843d Author: Ryan Lortie -Date: Mon Mar 8 11:53:36 2010 -0500 +Date: Mon Mar 8 11:53:36 2010 -0500 Bump version @@ -1554,108 +26529,108 @@ Date: Mon Mar 8 11:53:36 2010 -0500 commit c58ce0e60c1a243df6326c26cf7d255d3af4ab2d Author: Ryan Lortie -Date: Mon Mar 8 11:48:14 2010 -0500 +Date: Mon Mar 8 11:48:14 2010 -0500 2.23.5 - NEWS | 50 ++ - po/am.po | 93 ++-- - po/ar.po | 98 ++-- - po/as.po | 98 ++-- - po/ast.po | 98 ++-- - po/az.po | 98 ++-- - po/be.po | 102 +++-- + NEWS | 50 ++ + po/am.po | 93 ++-- + po/ar.po | 98 ++-- + po/as.po | 98 ++-- + po/ast.po | 98 ++-- + po/az.po | 98 ++-- + po/be.po | 102 +++-- po/be@latin.po | 102 +++-- - po/bg.po | 942 ++++++++++++++++++------------------- - po/bn.po | 98 ++-- - po/bn_IN.po | 98 ++-- - po/bs.po | 98 ++-- - po/ca.po | 952 +++++++++++++++++++------------------- + po/bg.po | 942 ++++++++++++++++++------------------- + po/bn.po | 98 ++-- + po/bn_IN.po | 98 ++-- + po/bs.po | 98 ++-- + po/ca.po | 952 +++++++++++++++++++------------------- po/ca@valencia.po | 98 ++-- - po/cs.po | 97 ++-- - po/cy.po | 98 ++-- - po/da.po | 953 +++++++++++++++++++------------------- - po/de.po | 955 +++++++++++++++++++------------------- - po/dz.po | 98 ++-- - po/el.po | 98 ++-- - po/en@shaw.po | 98 ++-- - po/en_CA.po | 98 ++-- - po/en_GB.po | 942 ++++++++++++++++++------------------- - po/eo.po | 97 ++-- - po/es.po | 951 +++++++++++++++++++------------------- - po/et.po | 477 +++++++++++++++++++- - po/eu.po | 1005 ++++++++++++++++++++------------------- - po/fa.po | 98 ++-- - po/fi.po | 98 ++-- - po/fr.po | 950 +++++++++++++++++++------------------- - po/ga.po | 94 ++-- - po/gl.po | 97 ++-- - po/gu.po | 98 ++-- - po/he.po | 98 ++-- - po/hi.po | 98 ++-- - po/hr.po | 98 ++-- - po/hu.po | 1021 ++++++++++++++++++++-------------------- - po/hy.po | 94 ++-- - po/id.po | 98 ++-- - po/is.po | 98 ++-- - po/it.po | 955 +++++++++++++++++++------------------- - po/ja.po | 98 ++-- - po/ka.po | 98 ++-- - po/kn.po | 98 ++-- - po/ko.po | 97 ++-- - po/ku.po | 93 ++-- - po/lt.po | 942 ++++++++++++++++++------------------- - po/lv.po | 97 ++-- - po/mai.po | 98 ++-- - po/mg.po | 98 ++-- - po/mk.po | 98 ++-- - po/ml.po | 98 ++-- - po/mn.po | 98 ++-- - po/mr.po | 98 ++-- - po/ms.po | 98 ++-- - po/nb.po | 942 ++++++++++++++++++------------------- - po/ne.po | 98 ++-- - po/nl.po | 98 ++-- - po/nn.po | 98 ++-- - po/oc.po | 93 ++-- - po/or.po | 98 ++-- - po/pa.po | 98 ++-- - po/pl.po | 942 ++++++++++++++++++------------------- - po/ps.po | 94 ++-- - po/pt.po | 952 +++++++++++++++++++------------------- - po/pt_BR.po | 942 ++++++++++++++++++------------------- - po/ro.po | 97 ++-- - po/ru.po | 942 ++++++++++++++++++------------------- - po/rw.po | 98 ++-- - po/si.po | 98 ++-- - po/sk.po | 98 ++-- - po/sl.po | 1324 + po/cs.po | 97 ++-- + po/cy.po | 98 ++-- + po/da.po | 953 +++++++++++++++++++------------------- + po/de.po | 955 +++++++++++++++++++------------------- + po/dz.po | 98 ++-- + po/el.po | 98 ++-- + po/en@shaw.po | 98 ++-- + po/en_CA.po | 98 ++-- + po/en_GB.po | 942 ++++++++++++++++++------------------- + po/eo.po | 97 ++-- + po/es.po | 951 +++++++++++++++++++------------------- + po/et.po | 477 +++++++++++++++++++- + po/eu.po | 1005 ++++++++++++++++++++------------------- + po/fa.po | 98 ++-- + po/fi.po | 98 ++-- + po/fr.po | 950 +++++++++++++++++++------------------- + po/ga.po | 94 ++-- + po/gl.po | 97 ++-- + po/gu.po | 98 ++-- + po/he.po | 98 ++-- + po/hi.po | 98 ++-- + po/hr.po | 98 ++-- + po/hu.po | 1021 ++++++++++++++++++++-------------------- + po/hy.po | 94 ++-- + po/id.po | 98 ++-- + po/is.po | 98 ++-- + po/it.po | 955 +++++++++++++++++++------------------- + po/ja.po | 98 ++-- + po/ka.po | 98 ++-- + po/kn.po | 98 ++-- + po/ko.po | 97 ++-- + po/ku.po | 93 ++-- + po/lt.po | 942 ++++++++++++++++++------------------- + po/lv.po | 97 ++-- + po/mai.po | 98 ++-- + po/mg.po | 98 ++-- + po/mk.po | 98 ++-- + po/ml.po | 98 ++-- + po/mn.po | 98 ++-- + po/mr.po | 98 ++-- + po/ms.po | 98 ++-- + po/nb.po | 942 ++++++++++++++++++------------------- + po/ne.po | 98 ++-- + po/nl.po | 98 ++-- + po/nn.po | 98 ++-- + po/oc.po | 93 ++-- + po/or.po | 98 ++-- + po/pa.po | 98 ++-- + po/pl.po | 942 ++++++++++++++++++------------------- + po/ps.po | 94 ++-- + po/pt.po | 952 +++++++++++++++++++------------------- + po/pt_BR.po | 942 ++++++++++++++++++------------------- + po/ro.po | 97 ++-- + po/ru.po | 942 ++++++++++++++++++------------------- + po/rw.po | 98 ++-- + po/si.po | 98 ++-- + po/sk.po | 98 ++-- + po/sl.po | 1324 +++++++++++++++++++++++++--------------------------- - po/sq.po | 98 ++-- - po/sr.po | 98 ++-- - po/sr@ije.po | 98 ++-- + po/sq.po | 98 ++-- + po/sr.po | 98 ++-- + po/sr@ije.po | 98 ++-- po/sr@latin.po | 98 ++-- - po/sv.po | 1353 + po/sv.po | 1353 ++++++++++++++++++++++++++--------------------------- - po/ta.po | 98 ++-- - po/te.po | 98 ++-- - po/th.po | 97 ++-- - po/tl.po | 98 ++-- - po/tr.po | 98 ++-- - po/tt.po | 93 ++-- - po/uk.po | 98 ++-- - po/vi.po | 98 ++-- - po/wa.po | 98 ++-- - po/xh.po | 98 ++-- - po/yi.po | 97 ++-- - po/zh_CN.po | 98 ++-- - po/zh_HK.po | 968 +++++++++++++++++++------------------- - po/zh_TW.po | 953 +++++++++++++++++++------------------- + po/ta.po | 98 ++-- + po/te.po | 98 ++-- + po/th.po | 97 ++-- + po/tl.po | 98 ++-- + po/tr.po | 98 ++-- + po/tt.po | 93 ++-- + po/uk.po | 98 ++-- + po/vi.po | 98 ++-- + po/wa.po | 98 ++-- + po/xh.po | 98 ++-- + po/yi.po | 97 ++-- + po/zh_CN.po | 98 ++-- + po/zh_HK.po | 968 +++++++++++++++++++------------------- + po/zh_TW.po | 953 +++++++++++++++++++------------------- 91 files changed, 13883 insertions(+), 13260 deletions(-) commit f9d8d70396978ae201ce79708f7cd69cf6f93399 Author: Ryan Lortie -Date: Mon Mar 8 11:29:27 2010 -0500 +Date: Mon Mar 8 11:29:27 2010 -0500 gtk-doc: ignore gvariant-internal.h @@ -1664,7 +26639,7 @@ Date: Mon Mar 8 11:29:27 2010 -0500 commit 929a2e1ae10083d647a77dd36c17071e7fac1593 Author: Ryan Lortie -Date: Mon Mar 8 11:25:37 2010 -0500 +Date: Mon Mar 8 11:25:37 2010 -0500 Add gvariant-varargs.xml to the distribution @@ -1673,7 +26648,7 @@ Date: Mon Mar 8 11:25:37 2010 -0500 commit 6393ca443af7f588275aa6ee8b051bb1d41394e8 Author: Ryan Lortie -Date: Mon Mar 8 10:54:23 2010 -0500 +Date: Mon Mar 8 10:54:23 2010 -0500 distcheck: add gvariant-internal.h to SOURCES @@ -1682,7 +26657,7 @@ Date: Mon Mar 8 10:54:23 2010 -0500 commit 75f761bcaa66c82d132c9e3d8cdfcb8ee0971eb6 Author: Ryan Lortie -Date: Mon Mar 8 10:30:59 2010 -0500 +Date: Mon Mar 8 10:30:59 2010 -0500 GVariant variable arguments, tests, cleanups @@ -1696,24 +26671,24 @@ Date: Mon Mar 8 10:30:59 2010 -0500 Increase test coverage in a few other areas. - docs/reference/glib/glib-docs.sgml | 1 + - docs/reference/glib/glib-sections.txt | 11 + + docs/reference/glib/glib-docs.sgml | 1 + + docs/reference/glib/glib-sections.txt | 11 + docs/reference/glib/gvariant-varargs.xml | 987 +++++++++++++++++++++ - glib/glib.symbols | 48 +- - glib/gvariant-internal.h | 49 + - glib/gvariant-serialiser.c | 4 + - glib/gvariant-serialiser.h | 9 - - glib/gvariant.c | 1397 + glib/glib.symbols | 48 +- + glib/gvariant-internal.h | 49 + + glib/gvariant-serialiser.c | 4 + + glib/gvariant-serialiser.h | 9 - + glib/gvariant.c | 1397 ++++++++++++++++++++++++++---- - glib/gvariant.h | 18 + - glib/gvarianttypeinfo.c | 11 +- - glib/gvarianttypeinfo.h | 10 +- - glib/tests/gvariant.c | 773 ++++++++++++++++- + glib/gvariant.h | 18 + + glib/gvarianttypeinfo.c | 11 +- + glib/gvarianttypeinfo.h | 10 +- + glib/tests/gvariant.c | 773 ++++++++++++++++- 12 files changed, 3110 insertions(+), 208 deletions(-) commit 8cd5c94f42fb362e1620368e805d50e3804e7bc2 Author: Alexander Larsson -Date: Mon Mar 8 12:03:40 2010 +0100 +Date: Mon Mar 8 12:03:40 2010 +0100 Add pregenerated ids for TRASH_ORIG_PATH and TRASH_DELETION_DATE @@ -1724,7 +26699,7 @@ Date: Mon Mar 8 12:03:40 2010 +0100 commit fe4839dbb8358b65d19370114dc9d43cc71e6773 Author: Piotr Drąg -Date: Mon Mar 8 10:51:11 2010 +0100 +Date: Mon Mar 8 10:51:11 2010 +0100 Updated Polish translation @@ -1734,7 +26709,7 @@ Date: Mon Mar 8 10:51:11 2010 +0100 commit 826abbefcee6c7f64ed8c21d9a2671f9cd0be089 Author: Matthias Clasen -Date: Mon Mar 8 00:36:00 2010 -0500 +Date: Mon Mar 8 00:36:00 2010 -0500 Add defines for trash::orig-path and trash::deletion-date @@ -1746,7 +26721,7 @@ Date: Mon Mar 8 00:36:00 2010 -0500 commit 96d105906ef267b687ee6fbe085a791f3b17afc6 Author: Priit Laes -Date: Mon Mar 8 00:16:23 2010 -0500 +Date: Mon Mar 8 00:16:23 2010 -0500 Fix run-assert-msg-test to work with libtool-2.2.x. @@ -1755,7 +26730,7 @@ Date: Mon Mar 8 00:16:23 2010 -0500 commit 0a51b58e0776f2d5a82a5346ab81fb50ee75f9f4 Author: Matthias Clasen -Date: Mon Mar 8 00:12:33 2010 -0500 +Date: Mon Mar 8 00:12:33 2010 -0500 Minor doc clarification @@ -1767,7 +26742,7 @@ Date: Mon Mar 8 00:12:33 2010 -0500 commit 42f042d5fb381151a999e38740720e9244caa6da Author: Matthias Clasen -Date: Mon Mar 8 00:04:11 2010 -0500 +Date: Mon Mar 8 00:04:11 2010 -0500 Minor doc clarification @@ -1779,7 +26754,7 @@ Date: Mon Mar 8 00:04:11 2010 -0500 commit 485077e9ce78ad2b55bdb471b57dc9fe21259922 Author: Duarte Loreto -Date: Mon Mar 8 02:31:12 2010 +0000 +Date: Mon Mar 8 02:31:12 2010 +0000 Updated Portuguese translation @@ -1788,7 +26763,7 @@ Date: Mon Mar 8 02:31:12 2010 +0000 commit 9dd6c60fbfc742eb08a5b5b27986395ed439fbc1 Author: Matthias Clasen -Date: Sun Mar 7 17:42:25 2010 -0500 +Date: Sun Mar 7 17:42:25 2010 -0500 Plug a memleak in g_io_modules_scan_all_in_directory @@ -1800,7 +26775,7 @@ Date: Sun Mar 7 17:42:25 2010 -0500 commit 5f424088f5bdf041d5653f5f2aa310150155f58c Author: Jorge González -Date: Sun Mar 7 11:49:58 2010 +0100 +Date: Sun Mar 7 11:49:58 2010 +0100 Updated Spanish translation @@ -1810,7 +26785,7 @@ Date: Sun Mar 7 11:49:58 2010 +0100 commit a9d57e990b878d2b602b247dba676cd257426e23 Author: Ryan Lortie -Date: Sun Mar 7 03:02:08 2010 -0500 +Date: Sun Mar 7 03:02:08 2010 -0500 .gitignore mem-overflow test @@ -1819,7 +26794,7 @@ Date: Sun Mar 7 03:02:08 2010 -0500 commit dfcee5865b7c677db722640dec5e34a8e89b4d07 Author: Ryan Lortie -Date: Sun Mar 7 02:15:37 2010 -0500 +Date: Sun Mar 7 02:15:37 2010 -0500 gtk-doc: ignore GBuffer @@ -1828,7 +26803,7 @@ Date: Sun Mar 7 02:15:37 2010 -0500 commit a1b9743e1816c5269029e8ae2e21e8950c411f5c Author: Ryan Lortie -Date: Sat Mar 6 23:21:27 2010 -0500 +Date: Sat Mar 6 23:21:27 2010 -0500 Bug 608196 - Overflow-safe g_new family @@ -1843,14 +26818,14 @@ Date: Sat Mar 6 23:21:27 2010 -0500 caught under the case that does the inline multiplication and the multiplication by 1 will be optimised away. - glib/gmem.c | 8 ----- - glib/gmem.h | 83 + glib/gmem.c | 8 ----- + glib/gmem.h | 83 +++++++++++++++++++++++++---------------------------------- 2 files changed, 35 insertions(+), 56 deletions(-) commit 01ef92178b9978b7491bbb3397de9ee08e38af20 Author: Alexander Shopov -Date: Sat Mar 6 20:22:49 2010 +0200 +Date: Sat Mar 6 20:22:49 2010 +0200 Updated Bulgarian translation @@ -1859,7 +26834,7 @@ Date: Sat Mar 6 20:22:49 2010 +0200 commit 7fa6d67bdb3b4d467931d88e7c5ba38481df8bab Author: Gil Forcada -Date: Sat Mar 6 13:34:27 2010 +0100 +Date: Sat Mar 6 13:34:27 2010 +0100 Updated Catalan translation @@ -1868,7 +26843,7 @@ Date: Sat Mar 6 13:34:27 2010 +0100 commit 3d98c449b1638a4dc242279737c36fa3e37cb8ce Author: Stefan Kost -Date: Sat Mar 6 14:15:25 2010 +0200 +Date: Sat Mar 6 14:15:25 2010 +0200 gsignal: improve g_signal_new docs. @@ -1876,12 +26851,12 @@ Date: Sat Mar 6 14:15:25 2010 +0200 when running out of slots in the lass structure. - gobject/gsignal.c | 7 ++++++- + gobject/gsignal.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) commit fa32ee56109e295f3dae95c8bbdf98a99f1bc66e Author: Stefan Kost -Date: Sat Mar 6 13:36:38 2010 +0200 +Date: Sat Mar 6 13:36:38 2010 +0200 docs: exchange "Subversion" with "source code repository" @@ -1892,7 +26867,7 @@ Date: Sat Mar 6 13:36:38 2010 +0200 commit ada60fd83fdd4fa694d8d872ea7cbe14b09cbfcc Author: Luca Ferretti -Date: Sat Mar 6 01:05:40 2010 +0100 +Date: Sat Mar 6 01:05:40 2010 +0100 Updated Italian translation @@ -1902,7 +26877,7 @@ Date: Sat Mar 6 01:05:40 2010 +0100 commit bed0e3f14020bce9ea4eabfe846abb2b4cdfc83e Author: Daniel Nylander -Date: Sat Mar 6 00:28:38 2010 +0100 +Date: Sat Mar 6 00:28:38 2010 +0100 Updated Swedish translation @@ -1912,7 +26887,7 @@ Date: Sat Mar 6 00:28:38 2010 +0100 commit 54e830100de02d49d11842e9464511f160c8fbbc Author: Fridrich Strba -Date: Fri Mar 5 23:15:45 2010 +0100 +Date: Fri Mar 5 23:15:45 2010 +0100 Adding new defines first appeared in 2.22 into glibconfig.h.win32.in @@ -1921,7 +26896,7 @@ Date: Fri Mar 5 23:15:45 2010 +0100 commit 0772298b9bc43af10ddb53f63e2c6faca6371a82 Author: Claude Paroz -Date: Fri Mar 5 22:32:07 2010 +0100 +Date: Fri Mar 5 22:32:07 2010 +0100 Updated French translation @@ -1931,7 +26906,7 @@ Date: Fri Mar 5 22:32:07 2010 +0100 commit 6949099124ddd6bed660c146a42800402b5807ea Author: Gabor Kelemen -Date: Fri Mar 5 22:03:27 2010 +0100 +Date: Fri Mar 5 22:03:27 2010 +0100 Updated Hungarian translation @@ -1941,16 +26916,16 @@ Date: Fri Mar 5 22:03:27 2010 +0100 commit 0edd7cb8a10388e22cd6b3a37295a6ffddf7e693 Author: Ryan Lortie -Date: Fri Mar 5 15:52:38 2010 -0500 +Date: Fri Mar 5 15:52:38 2010 -0500 undef the proper macros to avoid warning message - glib/tests/mem-overflow.c | 4 ++-- + glib/tests/mem-overflow.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit a3420d8713d6b5425b80f30e5cb61e88bb9d46e2 Author: Behdad Esfahbod -Date: Fri Mar 5 15:48:08 2010 -0500 +Date: Fri Mar 5 15:48:08 2010 -0500 Add makegalias.pl dep on galias.h and co @@ -1959,7 +26934,7 @@ Date: Fri Mar 5 15:48:08 2010 -0500 commit 4882be674326f85aaef479ba2aa6b63565f818b3 Author: Leonid Kanter -Date: Fri Mar 5 15:49:12 2010 +0200 +Date: Fri Mar 5 15:49:12 2010 +0200 update Russian translation @@ -1969,7 +26944,7 @@ Date: Fri Mar 5 15:49:12 2010 +0200 commit 24768ebd8f3a792a091f5583ab301424f84d77d3 Author: Matej Urbančič -Date: Fri Mar 5 14:32:01 2010 +0100 +Date: Fri Mar 5 14:32:01 2010 +0100 Updated Slovenian translation @@ -1979,7 +26954,7 @@ Date: Fri Mar 5 14:32:01 2010 +0100 commit 7026365db22a12b7606bf1e2defac803b359cf68 Author: Ryan Lortie -Date: Fri Mar 5 06:10:01 2010 -0500 +Date: Fri Mar 5 06:10:01 2010 -0500 g_variant_get_strv: support objects and signatures @@ -1988,7 +26963,7 @@ Date: Fri Mar 5 06:10:01 2010 -0500 commit 118d59ba15324b49ab9f8b61332364148102d3fd Author: Ryan Lortie -Date: Fri Mar 5 06:09:38 2010 -0500 +Date: Fri Mar 5 06:09:38 2010 -0500 GVariant: fix some refcounting issues @@ -1997,7 +26972,7 @@ Date: Fri Mar 5 06:09:38 2010 -0500 commit 3297185f3962bd73714c376c101c891897b999b4 Author: Ivar Smolin -Date: Fri Mar 5 13:08:05 2010 +0200 +Date: Fri Mar 5 13:08:05 2010 +0200 Estonian translation updated @@ -2007,7 +26982,7 @@ Date: Fri Mar 5 13:08:05 2010 +0200 commit 6c58d5f8aeb420bd95caaf6ec62be60b47c819b7 Author: Gintautas Miliauskas -Date: Fri Mar 5 11:16:33 2010 +0200 +Date: Fri Mar 5 11:16:33 2010 +0200 Updated Lithuanian translation. @@ -2016,16 +26991,16 @@ Date: Fri Mar 5 11:16:33 2010 +0200 commit e0fff9a057dffc795146d5baa9a9e186587344b5 Author: Philip Withnall -Date: Thu Mar 4 23:54:07 2010 +0000 +Date: Thu Mar 4 23:54:07 2010 +0000 Updated British English translation - po/en_GB.po | 19 +++++++++++-------- + po/en_GB.po | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) commit e583d05374fc26de0e52ea20722254cdb081b23c Author: Kjartan Maraas -Date: Thu Mar 4 22:57:03 2010 +0100 +Date: Thu Mar 4 22:57:03 2010 +0100 Updated Norwegian bokmål translation @@ -2034,7 +27009,7 @@ Date: Thu Mar 4 22:57:03 2010 +0100 commit 1b1af2fa240f96fda5361784d1d80a94fae5752c Author: Kjartan Maraas -Date: Thu Mar 4 22:56:37 2010 +0100 +Date: Thu Mar 4 22:56:37 2010 +0100 Updated Norwegian bokmål translation @@ -2043,7 +27018,7 @@ Date: Thu Mar 4 22:56:37 2010 +0100 commit fe3c945a3fe15b6d4b1177c20f88ac7441d5dca9 Author: Mario Blättermann -Date: Thu Mar 4 22:02:43 2010 +0100 +Date: Thu Mar 4 22:02:43 2010 +0100 Updated German translation @@ -2053,7 +27028,7 @@ Date: Thu Mar 4 22:02:43 2010 +0100 commit 983fd35c7c38ab54b2e39e25102990184377fbb3 Author: Inaki Larranaga Murgoitio -Date: Thu Mar 4 21:31:54 2010 +0100 +Date: Thu Mar 4 21:31:54 2010 +0100 Updated Basque language @@ -2062,26 +27037,26 @@ Date: Thu Mar 4 21:31:54 2010 +0100 commit 976cce06fc863496a595240ceb6af07b90d41313 Author: Jonh Wendell -Date: Thu Mar 4 17:13:56 2010 -0300 +Date: Thu Mar 4 17:13:56 2010 -0300 Updated Brazilian Portuguese translation - po/pt_BR.po | 958 + po/pt_BR.po | 958 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 484 insertions(+), 474 deletions(-) commit 7504095de09756efec4bc39225986c5db10d6ace Author: Jonh Wendell -Date: Thu Mar 4 17:03:13 2010 -0300 +Date: Thu Mar 4 17:03:13 2010 -0300 Mark a string for translation - gio/gfile.c | 2 +- + gio/gfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 766183c079192d8fb71044770456c8c9662bd5db Author: Claudio Saavedra -Date: Thu Mar 4 19:18:12 2010 +0200 +Date: Thu Mar 4 19:18:12 2010 +0200 Remove GUtf8InputStream leftover in docs @@ -2092,28 +27067,28 @@ Date: Thu Mar 4 19:18:12 2010 +0200 commit f3425cc38dae31b815db1038dcaac29848840409 Author: Behdad Esfahbod -Date: Thu Mar 4 10:38:31 2010 -0500 +Date: Thu Mar 4 10:38:31 2010 -0500 Fix galias build breakage with g_malloc_n macros - glib/gmem.c | 15 +++++++++------ + glib/gmem.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) commit c423c3a9c951a64b2c3d3eea67e15fce752a2bd0 Author: Christian Dywan -Date: Thu Mar 4 11:02:31 2010 +0100 +Date: Thu Mar 4 11:02:31 2010 +0100 Add licence headers to gnativevolumemonitor.c/h Fixes bug #609531 - gio/gnativevolumemonitor.c | 22 ++++++++++++++++++++++ - gio/gnativevolumemonitor.h | 22 ++++++++++++++++++++++ + gio/gnativevolumemonitor.c | 22 ++++++++++++++++++++++ + gio/gnativevolumemonitor.h | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 0 deletions(-) commit 343cbf25c7104f782b9d0070cb623c7605dab646 Author: Behdad Esfahbod -Date: Tue Feb 2 23:48:42 2010 -0500 +Date: Tue Feb 2 23:48:42 2010 -0500 Bug 608196 - Overflow-safe g_new family @@ -2128,20 +27103,20 @@ Date: Tue Feb 2 23:48:42 2010 -0500 docs/reference/glib/glib-sections.txt | 6 ++ docs/reference/glib/tmpl/memory.sgml | 82 ++++++++++++++++++++++++- - glib/glib.symbols | 6 ++ - glib/gmem.c | 95 + glib/glib.symbols | 6 ++ + glib/gmem.c | 95 ++++++++++++++++++++++++++++- - glib/gmem.h | 92 +++++++++++++++++++++++----- - glib/tests/Makefile.am | 3 + - glib/tests/mem-overflow.c | 108 + glib/gmem.h | 92 +++++++++++++++++++++++----- + glib/tests/Makefile.am | 3 + + glib/tests/mem-overflow.c | 108 +++++++++++++++++++++++++++++++++ - glib/tests/printf.c | 2 +- - glib/tests/rand.c | 2 +- + glib/tests/printf.c | 2 +- + glib/tests/rand.c | 2 +- 9 files changed, 375 insertions(+), 21 deletions(-) commit 373f3d8b52ca8b08de0af6062eb284c2a7a856d9 Author: Felix Riemann -Date: Wed Feb 24 12:54:17 2010 +0100 +Date: Wed Feb 24 12:54:17 2010 +0100 Fix API docs for GZlibCompressor and GZlibDecompressor @@ -2149,14 +27124,14 @@ Date: Wed Feb 24 12:54:17 2010 +0100 implemented interfaces appear. - docs/reference/gio/gio-sections.txt | 4 ++-- - gio/gzlibcompressor.c | 4 ++-- - gio/gzlibdecompressor.c | 2 +- + docs/reference/gio/gio-sections.txt | 4 ++-- + gio/gzlibcompressor.c | 4 ++-- + gio/gzlibdecompressor.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) commit 560f5187432fc890725c5bb5c74a0997affb888c Author: Ryan Lortie -Date: Wed Mar 3 11:36:52 2010 -0500 +Date: Wed Mar 3 11:36:52 2010 -0500 GVariantBuilder: loosen assertion check @@ -2169,7 +27144,7 @@ Date: Wed Mar 3 11:36:52 2010 -0500 commit 9a886135c80233a5a40071189df7693151201954 Author: Dan Winship -Date: Wed Mar 3 08:35:32 2010 -0500 +Date: Wed Mar 3 08:35:32 2010 -0500 GResolver: fix Windows 2000 workaround @@ -2179,12 +27154,12 @@ Date: Wed Mar 3 08:35:32 2010 -0500 https://bugzilla.gnome.org/show_bug.cgi?id=611696 gio/gnetworkingprivate.h | 8 ++++++++ - gio/gwin32resolver.c | 8 -------- + gio/gwin32resolver.c | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) commit 67ba99f7abfba0d24719950b55e88024acfc91ae Author: Kjartan Maraas -Date: Wed Mar 3 13:49:10 2010 +0100 +Date: Wed Mar 3 13:49:10 2010 +0100 Updated Norwegian bokmål translation @@ -2194,21 +27169,21 @@ Date: Wed Mar 3 13:49:10 2010 +0100 commit fe6e278a870c7b2a3e76ba9ef17a9b99a4c0c474 Author: Ryan Lortie -Date: Wed Mar 3 03:37:37 2010 -0500 +Date: Wed Mar 3 03:37:37 2010 -0500 GVariantBuilder: allow for stack allocation docs/reference/glib/glib-sections.txt | 2 + - glib/glib.symbols | 6 +- - glib/gvariant.c | 553 + glib/glib.symbols | 6 +- + glib/gvariant.c | 553 ++++++++++++++++++++------------- - glib/gvariant.h | 13 +- - glib/tests/gvariant.c | 13 +- + glib/gvariant.h | 13 +- + glib/tests/gvariant.c | 13 +- 5 files changed, 352 insertions(+), 235 deletions(-) commit bb0808638c5b4bac11355bc94434d35e76b53364 Author: Gabor Kelemen -Date: Tue Mar 2 17:18:52 2010 +0100 +Date: Tue Mar 2 17:18:52 2010 +0100 Updated Hungarian translation @@ -2218,7 +27193,7 @@ Date: Tue Mar 2 17:18:52 2010 +0100 commit 2927c5e0c628dfe97f2649661db703a30dbebd8b Author: Inaki Larranaga Murgoitio -Date: Tue Mar 2 12:39:33 2010 +0100 +Date: Tue Mar 2 12:39:33 2010 +0100 Updated Basque language @@ -2228,19 +27203,19 @@ Date: Tue Mar 2 12:39:33 2010 +0100 commit 277b9717da6261d089772684669bc55c5a0e911b Author: Paolo Borelli -Date: Mon Mar 1 10:24:43 2010 +0100 +Date: Mon Mar 1 10:24:43 2010 +0100 Remove utf8inputstream leftovers in a few other places - docs/reference/gio/gio-docs.xml | 1 - - docs/reference/gio/gio-sections.txt | 18 ------------------ - gio/giotypes.h | 1 - - po/POTFILES.in | 1 - + docs/reference/gio/gio-docs.xml | 1 - + docs/reference/gio/gio-sections.txt | 18 ------------------ + gio/giotypes.h | 1 - + po/POTFILES.in | 1 - 4 files changed, 0 insertions(+), 21 deletions(-) commit 2bfddf162e686c750beb2af2e4cb2e8d8d523440 Author: Alexander Larsson -Date: Mon Mar 1 09:56:02 2010 +0100 +Date: Mon Mar 1 09:56:02 2010 +0100 Remove GUtf8InputStream for now @@ -2253,19 +27228,19 @@ Date: Mon Mar 1 09:56:02 2010 +0100 The basic feature seems to have some utility though, so we hope for it to eventually return in a better form. - gio/Makefile.am | 2 - - gio/gio.h | 1 - - gio/gio.symbols | 7 - + gio/Makefile.am | 2 - + gio/gio.h | 1 - + gio/gio.symbols | 7 - gio/gutf8inputstream.c | 327 ----------------------------------------- gio/gutf8inputstream.h | 80 ---------- - gio/tests/Makefile.am | 4 - + gio/tests/Makefile.am | 4 - gio/tests/utf8-input-stream.c | 252 ------------------------------- 7 files changed, 0 insertions(+), 673 deletions(-) commit c47e1949e215126c70503843ebb7759449160212 Author: Gil Forcada -Date: Sun Feb 28 18:55:54 2010 +0100 +Date: Sun Feb 28 18:55:54 2010 +0100 Updated Catalan translation @@ -2275,19 +27250,19 @@ Date: Sun Feb 28 18:55:54 2010 +0100 commit 92d4cfbd1584847ea689146c57f3c79282813ae3 Author: Chao-Hsiung Liao -Date: Sat Feb 27 20:40:04 2010 +0800 +Date: Sat Feb 27 20:40:04 2010 +0800 Updated Traditional Chinese translation(Hong Kong and Taiwan) - po/zh_HK.po | 965 + po/zh_HK.po | 965 ++++++++++++++++++++++++++++++----------------------------- - po/zh_TW.po | 950 + po/zh_TW.po | 950 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 962 insertions(+), 953 deletions(-) commit a3c7406cce2af55aea4ffdf1ceb8b828f5ef3219 Author: Ryan Lortie -Date: Thu Feb 25 18:09:23 2010 -0500 +Date: Thu Feb 25 18:09:23 2010 -0500 GVariantTypeInfo: fix thread safety bug @@ -2310,7 +27285,7 @@ Date: Thu Feb 25 18:09:23 2010 -0500 commit 43b6c2b8f5a9000373b448eca7edea2e3dad4248 Author: Duarte Loreto -Date: Thu Feb 25 02:03:17 2010 +0000 +Date: Thu Feb 25 02:03:17 2010 +0000 Updated Portuguese translation @@ -2320,7 +27295,7 @@ Date: Thu Feb 25 02:03:17 2010 +0000 commit 24decf7658368ebcae012d82224627668485137a Author: Bruce Cowan -Date: Wed Feb 24 15:28:15 2010 +0000 +Date: Wed Feb 24 15:28:15 2010 +0000 Updated British English translation @@ -2330,7 +27305,7 @@ Date: Wed Feb 24 15:28:15 2010 +0000 commit cf07bb353433234268b599d11afc0b0245fdddae Author: Leonid Kanter -Date: Wed Feb 24 10:49:16 2010 +0200 +Date: Wed Feb 24 10:49:16 2010 +0200 Update Russian translation by Yuri Kozlov @@ -2340,7 +27315,7 @@ Date: Wed Feb 24 10:49:16 2010 +0200 commit a495a2122d404fdf2c6cf5e3aa0524cf0437ec30 Author: Saleem Abdulrasool -Date: Tue Feb 23 15:28:51 2010 -0800 +Date: Tue Feb 23 15:28:51 2010 -0800 include gio.h, not giotypes.h @@ -2348,12 +27323,12 @@ Date: Tue Feb 23 15:28:51 2010 -0800 failure for users of the header as giotypes.h may not be included directly. - gio/gfiledescriptorbased.h | 2 +- + gio/gfiledescriptorbased.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 8413dfda9b71ff671a92df2c1d3451fb7c0b2085 Author: Gintautas Miliauskas -Date: Tue Feb 23 23:45:09 2010 +0200 +Date: Tue Feb 23 23:45:09 2010 +0200 Updated Lithuanian translation. @@ -2363,7 +27338,7 @@ Date: Tue Feb 23 23:45:09 2010 +0200 commit ec0e3089c0e80219ad6e7806b27363ac9c990462 Author: Ask H. Larsen -Date: Tue Feb 23 22:25:51 2010 +0100 +Date: Tue Feb 23 22:25:51 2010 +0100 Updated Danish translation @@ -2373,7 +27348,7 @@ Date: Tue Feb 23 22:25:51 2010 +0100 commit 1903c229a267611a2624409371390a472d97ad4c Author: Mario Blättermann -Date: Tue Feb 23 22:23:36 2010 +0100 +Date: Tue Feb 23 22:23:36 2010 +0100 Updated German translation @@ -2383,16 +27358,16 @@ Date: Tue Feb 23 22:23:36 2010 +0100 commit 2940285002c3504fb49fb7388d2265b464c92dcc Author: Ryan Lortie -Date: Tue Feb 23 12:49:08 2010 -0500 +Date: Tue Feb 23 12:49:08 2010 -0500 .gitignore gcov output (*.gcov, *.gcno, *.gcda) - .gitignore | 3 +++ + .gitignore | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) commit cecf61d1c3e8ff07b1595641bad85fb9f9b03ddf Author: Edward Hervey -Date: Mon Dec 7 11:23:55 2009 +0100 +Date: Mon Dec 7 11:23:55 2009 +0100 gobject: Don't use G_PARAM_SPEC_VALUE_TYPE when we know the pspec is valid @@ -2404,7 +27379,7 @@ Date: Mon Dec 7 11:23:55 2009 +0100 commit a7cc500d3829db1a8757ae940db09869b78bdca8 Author: Emilio Pozuelo Monfort -Date: Tue Feb 23 18:19:16 2010 +0100 +Date: Tue Feb 23 18:19:16 2010 +0100 Test for unexisting files in $TMP and not in $HOME @@ -2419,7 +27394,7 @@ Date: Tue Feb 23 18:19:16 2010 +0100 commit 355246579ee08753e80bef5d31816a6ef52da73b Author: Alexander Shopov -Date: Tue Feb 23 09:30:39 2010 +0200 +Date: Tue Feb 23 09:30:39 2010 +0200 Updated Bulgarian translation @@ -2429,7 +27404,7 @@ Date: Tue Feb 23 09:30:39 2010 +0200 commit 1f66523ad325c301d9caf7130b99d3fd74940338 Author: Ryan Lortie -Date: Tue Feb 23 02:00:11 2010 -0500 +Date: Tue Feb 23 02:00:11 2010 -0500 Fix backward logic in g_return_if_fail(). @@ -2438,7 +27413,7 @@ Date: Tue Feb 23 02:00:11 2010 -0500 commit 360b9b540ee5e88de01a4c8aaf16c84f6cf23dc8 Author: Ryan Lortie -Date: Tue Feb 23 01:59:57 2010 -0500 +Date: Tue Feb 23 01:59:57 2010 -0500 GVariant: Improve test coverage. @@ -2448,7 +27423,7 @@ Date: Tue Feb 23 01:59:57 2010 -0500 commit 202d7d37d6ce066291504276810c350c9a3feb7a Author: Emilio Pozuelo Monfort -Date: Fri Feb 19 19:00:02 2010 +0100 +Date: Fri Feb 19 19:00:02 2010 +0100 Don't fail a couple of tests when running as root @@ -2463,7 +27438,7 @@ Date: Fri Feb 19 19:00:02 2010 +0100 commit 4535683b3f42b6840e01bd94fe6ea792b0ebeecf Author: Alexander Larsson -Date: Mon Feb 22 12:37:16 2010 +0100 +Date: Mon Feb 22 12:37:16 2010 +0100 Keep metadata when files are renamed and trashed @@ -2474,25 +27449,25 @@ Date: Mon Feb 22 12:37:16 2010 +0100 commit 515434bdcb63073d62b424c4b352a9d509cee5e6 Author: Ryan Lortie -Date: Mon Feb 22 00:39:01 2010 -0500 +Date: Mon Feb 22 00:39:01 2010 -0500 GVariantIter, GVariantBuilder - docs/reference/glib/glib-sections.txt | 22 + + docs/reference/glib/glib-sections.txt | 22 + docs/reference/glib/tmpl/glib-unused.sgml | 67 -- - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/version.sgml | 68 ++ - glib/glib.symbols | 18 + - glib/gvariant.c | 1531 + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/version.sgml | 68 ++ + glib/glib.symbols | 18 + + glib/gvariant.c | 1531 ++++++++++++++++++++++------- - glib/gvariant.h | 36 + - glib/gvarianttype.c | 17 + - glib/gvarianttype.h | 1 + + glib/gvariant.h | 36 + + glib/gvarianttype.c | 17 + + glib/gvarianttype.h | 1 + 9 files changed, 1367 insertions(+), 398 deletions(-) commit b9d728474ebc51c0d4ff46cb44d97134730174fc Author: Ryan Lortie -Date: Sun Feb 21 19:39:33 2010 -0500 +Date: Sun Feb 21 19:39:33 2010 -0500 Remove redudant check for direct #include gslice.h @@ -2506,7 +27481,7 @@ Date: Sun Feb 21 19:39:33 2010 -0500 commit 0a1ce31b6e8d3a7683ae5164d51e325d3669f53f Author: Matthias Clasen -Date: Sun Feb 21 21:38:33 2010 -0500 +Date: Sun Feb 21 21:38:33 2010 -0500 Bump version @@ -2515,106 +27490,106 @@ Date: Sun Feb 21 21:38:33 2010 -0500 commit 7fea53a4a290f1cd2c052320b21ee3405e1ed605 Author: Matthias Clasen -Date: Sun Feb 21 21:37:33 2010 -0500 +Date: Sun Feb 21 21:37:33 2010 -0500 2.23.4 - po/am.po | 115 +++--- - po/ar.po | 115 +++--- - po/as.po | 115 +++--- - po/ast.po | 115 +++--- - po/az.po | 115 +++--- - po/be.po | 116 +++--- + po/am.po | 115 +++--- + po/ar.po | 115 +++--- + po/as.po | 115 +++--- + po/ast.po | 115 +++--- + po/az.po | 115 +++--- + po/be.po | 116 +++--- po/be@latin.po | 116 +++--- - po/bg.po | 115 +++--- - po/bn.po | 115 +++--- - po/bn_IN.po | 115 +++--- - po/bs.po | 115 +++--- - po/ca.po | 115 +++--- + po/bg.po | 115 +++--- + po/bn.po | 115 +++--- + po/bn_IN.po | 115 +++--- + po/bs.po | 115 +++--- + po/ca.po | 115 +++--- po/ca@valencia.po | 115 +++--- - po/cs.po | 942 +++++++++++++++++++------------------- - po/cy.po | 115 +++--- - po/da.po | 115 +++--- - po/de.po | 956 +++++++++++++++++++------------------- - po/dz.po | 115 +++--- - po/el.po | 115 +++--- - po/en@shaw.po | 115 +++--- - po/en_CA.po | 115 +++--- - po/en_GB.po | 115 +++--- - po/eo.po | 115 +++--- - po/es.po | 951 +++++++++++++++++++------------------- - po/et.po | 477 +++++++++++++++++++- - po/eu.po | 115 +++--- - po/fa.po | 115 +++--- - po/fi.po | 115 +++--- - po/fr.po | 115 +++--- - po/ga.po | 115 +++--- - po/gl.po | 942 +++++++++++++++++++------------------- - po/gu.po | 115 +++--- - po/he.po | 115 +++--- - po/hi.po | 115 +++--- - po/hr.po | 115 +++--- - po/hu.po | 115 +++--- - po/hy.po | 115 +++--- - po/id.po | 115 +++--- - po/is.po | 115 +++--- - po/it.po | 115 +++--- - po/ja.po | 115 +++--- - po/ka.po | 115 +++--- - po/kn.po | 115 +++--- - po/ko.po | 952 +++++++++++++++++++------------------- - po/ku.po | 115 +++--- - po/lt.po | 115 +++--- - po/lv.po | 115 +++--- - po/mai.po | 115 +++--- - po/mg.po | 115 +++--- - po/mk.po | 115 +++--- - po/ml.po | 115 +++--- - po/mn.po | 115 +++--- - po/mr.po | 115 +++--- - po/ms.po | 115 +++--- - po/nb.po | 115 +++--- - po/ne.po | 115 +++--- - po/nl.po | 116 +++--- - po/nn.po | 115 +++--- - po/oc.po | 115 +++--- - po/or.po | 115 +++--- - po/pa.po | 115 +++--- - po/pl.po | 942 +++++++++++++++++++------------------- - po/ps.po | 115 +++--- - po/pt.po | 115 +++--- - po/pt_BR.po | 115 +++--- - po/ro.po | 954 +++++++++++++++++++------------------- - po/ru.po | 115 +++--- - po/rw.po | 116 +++--- - po/si.po | 115 +++--- - po/sk.po | 115 +++--- - po/sl.po | 1323 + po/cs.po | 942 +++++++++++++++++++------------------- + po/cy.po | 115 +++--- + po/da.po | 115 +++--- + po/de.po | 956 +++++++++++++++++++------------------- + po/dz.po | 115 +++--- + po/el.po | 115 +++--- + po/en@shaw.po | 115 +++--- + po/en_CA.po | 115 +++--- + po/en_GB.po | 115 +++--- + po/eo.po | 115 +++--- + po/es.po | 951 +++++++++++++++++++------------------- + po/et.po | 477 +++++++++++++++++++- + po/eu.po | 115 +++--- + po/fa.po | 115 +++--- + po/fi.po | 115 +++--- + po/fr.po | 115 +++--- + po/ga.po | 115 +++--- + po/gl.po | 942 +++++++++++++++++++------------------- + po/gu.po | 115 +++--- + po/he.po | 115 +++--- + po/hi.po | 115 +++--- + po/hr.po | 115 +++--- + po/hu.po | 115 +++--- + po/hy.po | 115 +++--- + po/id.po | 115 +++--- + po/is.po | 115 +++--- + po/it.po | 115 +++--- + po/ja.po | 115 +++--- + po/ka.po | 115 +++--- + po/kn.po | 115 +++--- + po/ko.po | 952 +++++++++++++++++++------------------- + po/ku.po | 115 +++--- + po/lt.po | 115 +++--- + po/lv.po | 115 +++--- + po/mai.po | 115 +++--- + po/mg.po | 115 +++--- + po/mk.po | 115 +++--- + po/ml.po | 115 +++--- + po/mn.po | 115 +++--- + po/mr.po | 115 +++--- + po/ms.po | 115 +++--- + po/nb.po | 115 +++--- + po/ne.po | 115 +++--- + po/nl.po | 116 +++--- + po/nn.po | 115 +++--- + po/oc.po | 115 +++--- + po/or.po | 115 +++--- + po/pa.po | 115 +++--- + po/pl.po | 942 +++++++++++++++++++------------------- + po/ps.po | 115 +++--- + po/pt.po | 115 +++--- + po/pt_BR.po | 115 +++--- + po/ro.po | 954 +++++++++++++++++++------------------- + po/ru.po | 115 +++--- + po/rw.po | 116 +++--- + po/si.po | 115 +++--- + po/sk.po | 115 +++--- + po/sl.po | 1323 +++++++++++++++++++++++++---------------------------- - po/sq.po | 119 +++--- - po/sr.po | 115 +++--- - po/sr@ije.po | 115 +++--- + po/sq.po | 119 +++--- + po/sr.po | 115 +++--- + po/sr@ije.po | 115 +++--- po/sr@latin.po | 115 +++--- - po/sv.po | 115 +++--- - po/ta.po | 115 +++--- - po/te.po | 115 +++--- - po/th.po | 115 +++--- - po/tl.po | 115 +++--- - po/tr.po | 115 +++--- - po/tt.po | 115 +++--- - po/uk.po | 115 +++--- - po/vi.po | 115 +++--- - po/wa.po | 115 +++--- - po/xh.po | 115 +++--- - po/yi.po | 115 +++--- - po/zh_CN.po | 115 +++--- - po/zh_HK.po | 960 +++++++++++++++++++------------------- - po/zh_TW.po | 945 +++++++++++++++++++------------------- + po/sv.po | 115 +++--- + po/ta.po | 115 +++--- + po/te.po | 115 +++--- + po/th.po | 115 +++--- + po/tl.po | 115 +++--- + po/tr.po | 115 +++--- + po/tt.po | 115 +++--- + po/uk.po | 115 +++--- + po/vi.po | 115 +++--- + po/wa.po | 115 +++--- + po/xh.po | 115 +++--- + po/yi.po | 115 +++--- + po/zh_CN.po | 115 +++--- + po/zh_HK.po | 960 +++++++++++++++++++------------------- + po/zh_TW.po | 945 +++++++++++++++++++------------------- 90 files changed, 10110 insertions(+), 9327 deletions(-) commit 9a08cd5b042a1550cd446724e1ce71ff5379ed2b Author: Matthias Clasen -Date: Sun Feb 21 20:28:34 2010 -0500 +Date: Sun Feb 21 20:28:34 2010 -0500 More distcheck fixes @@ -2623,7 +27598,7 @@ Date: Sun Feb 21 20:28:34 2010 -0500 commit ef497e8e64100f672509b8398a9805677ce80bcb Author: Matthias Clasen -Date: Sun Feb 21 20:11:33 2010 -0500 +Date: Sun Feb 21 20:11:33 2010 -0500 Fix some distcheck issues @@ -2632,49 +27607,49 @@ Date: Sun Feb 21 20:11:33 2010 -0500 commit 3983418c25037dd01fea4b7a52eecdc703535d78 Author: Matthias Clasen -Date: Sun Feb 21 19:55:02 2010 -0500 +Date: Sun Feb 21 19:55:02 2010 -0500 Fix up GFileDescriptorBased docs - docs/reference/gio/gio-docs.xml | 1 + - docs/reference/gio/gio-sections.txt | 13 +++++++++++++ - docs/reference/gio/gio.types | 1 + - gio/gfiledescriptorbased.c | 4 ++-- + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 13 +++++++++++++ + docs/reference/gio/gio.types | 1 + + gio/gfiledescriptorbased.c | 4 ++-- 4 files changed, 17 insertions(+), 2 deletions(-) commit 03fc92784d0ba995883fa2cbae96531ff3db8672 Author: Matthias Clasen -Date: Sun Feb 21 19:48:22 2010 -0500 +Date: Sun Feb 21 19:48:22 2010 -0500 Add indices for 2.24 additions - docs/reference/glib/glib-docs.sgml | 4 ++++ + docs/reference/glib/glib-docs.sgml | 4 ++++ docs/reference/gobject/gobject-docs.sgml | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-) commit 80a160c7c6c1028febfda3d5bf3b557406a9555c Author: Matthias Clasen -Date: Sun Feb 21 19:46:57 2010 -0500 +Date: Sun Feb 21 19:46:57 2010 -0500 Small doc fixes - docs/reference/glib/glib-sections.txt | 5 +++++ - docs/reference/gobject/gobject-sections.txt | 2 ++ + docs/reference/glib/glib-sections.txt | 5 +++++ + docs/reference/gobject/gobject-sections.txt | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) commit 2de84d65943c29b86c24f2da9c9e7ca094e9c3a6 Author: Matthias Clasen -Date: Sun Feb 21 19:42:37 2010 -0500 +Date: Sun Feb 21 19:42:37 2010 -0500 Fix up make check - gio/gfiledescriptorbased.c | 2 ++ - gio/gio.symbols | 13 ++++++++++--- + gio/gfiledescriptorbased.c | 2 ++ + gio/gio.symbols | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) commit fd751cc2a2906bf4fd19cadacf202de9819247c4 Author: Matthias Clasen -Date: Sun Feb 21 19:17:50 2010 -0500 +Date: Sun Feb 21 19:17:50 2010 -0500 More updates @@ -2683,7 +27658,7 @@ Date: Sun Feb 21 19:17:50 2010 -0500 commit e0e57fd97d156e860f1211887b6f302c68c86202 Author: Matthias Clasen -Date: Sun Feb 21 17:59:15 2010 -0500 +Date: Sun Feb 21 17:59:15 2010 -0500 Fix a doc typo. @@ -2694,7 +27669,7 @@ Date: Sun Feb 21 17:59:15 2010 -0500 commit dcdc409cd88f6d47eb54a7eee528be6c8667d394 Author: Matthias Clasen -Date: Sun Feb 21 16:29:15 2010 -0500 +Date: Sun Feb 21 16:29:15 2010 -0500 Fix the large array test to work @@ -2705,21 +27680,21 @@ Date: Sun Feb 21 16:29:15 2010 -0500 commit 21080a33e12e87144e0534cd18b3699a9dbc2f36 Author: Matthias Clasen -Date: Sun Feb 21 16:12:35 2010 -0500 +Date: Sun Feb 21 16:12:35 2010 -0500 Add missign single include guards Reported in bug 609530. patch by Christian Dywan. - gio/gcharsetconverter.h | 4 ++++ - gio/gnativevolumemonitor.h | 4 ++++ - gio/gzlibcompressor.h | 4 ++++ - gio/gzlibdecompressor.h | 4 ++++ + gio/gcharsetconverter.h | 4 ++++ + gio/gnativevolumemonitor.h | 4 ++++ + gio/gzlibcompressor.h | 4 ++++ + gio/gzlibdecompressor.h | 4 ++++ 4 files changed, 16 insertions(+), 0 deletions(-) commit dd7bd61c5301f92408ccb420a5bbd094faa863c3 Author: Matthias Clasen -Date: Sun Feb 21 16:04:21 2010 -0500 +Date: Sun Feb 21 16:04:21 2010 -0500 Documentation improvement @@ -2732,19 +27707,19 @@ Date: Sun Feb 21 16:04:21 2010 -0500 commit 6c1a914d511b9a94fbeb3e30d93608c3f537c0a7 Author: Matthias Clasen -Date: Sun Feb 21 15:55:10 2010 -0500 +Date: Sun Feb 21 15:55:10 2010 -0500 Fix build on Solaris 8 System header fun. See bug 610131. - configure.in | 2 +- + configure.in | 2 +- gio/libasyncns/asyncns.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) commit de6914a46a0af720de3df34539e61973e9d4446b Author: Matthias Clasen -Date: Sun Feb 21 15:32:08 2010 -0500 +Date: Sun Feb 21 15:32:08 2010 -0500 Add a pointer to G_DEFINE_INTERFACE @@ -2753,7 +27728,7 @@ Date: Sun Feb 21 15:32:08 2010 -0500 commit ecb45f43824cdae003cf1280eb0c13039619d6b5 Author: Matthias Clasen -Date: Sun Feb 21 15:28:04 2010 -0500 +Date: Sun Feb 21 15:28:04 2010 -0500 Fix an oversight @@ -2765,7 +27740,7 @@ Date: Sun Feb 21 15:28:04 2010 -0500 commit 19e438556cd0d958b34cd9a63bd528d680d77c45 Author: Matthias Clasen -Date: Sun Feb 21 15:19:06 2010 -0500 +Date: Sun Feb 21 15:19:06 2010 -0500 Updates @@ -2774,7 +27749,7 @@ Date: Sun Feb 21 15:19:06 2010 -0500 commit e377a6f4816ceef23a730c6e431d9ccbb052e7f0 Author: Fran Diéguez -Date: Sat Feb 20 22:22:04 2010 +0100 +Date: Sat Feb 20 22:22:04 2010 +0100 Updated Galician Translation @@ -2784,7 +27759,7 @@ Date: Sat Feb 20 22:22:04 2010 +0100 commit af22e5739ba89a9795f046ddaf00a506b77c5a8e Author: Piotr Drąg -Date: Sat Feb 20 22:20:04 2010 +0100 +Date: Sat Feb 20 22:20:04 2010 +0100 Updated Polish translation @@ -2794,7 +27769,7 @@ Date: Sat Feb 20 22:20:04 2010 +0100 commit 5047fd7f688dc0a3e4c148864f63961389bc83f9 Author: Colin Walters -Date: Fri Feb 19 16:06:22 2010 -0500 +Date: Fri Feb 19 16:06:22 2010 -0500 [gutf8.c] Add a bit of documentation to UNICODE_VALID @@ -2803,23 +27778,23 @@ Date: Fri Feb 19 16:06:22 2010 -0500 commit ed3c914cdbdd02d1af6d2f6a3a3f3a9fdc8dc1c2 Author: Ryan Lortie -Date: Fri Feb 19 10:42:53 2010 -0500 +Date: Fri Feb 19 10:42:53 2010 -0500 Merge the main public API of GVariant docs/reference/glib/glib-sections.txt | 60 +- - glib/Makefile.am | 1 + - glib/glib.symbols | 56 + - glib/gvariant-core.c | 18 + - glib/gvariant.c | 1858 + glib/Makefile.am | 1 + + glib/glib.symbols | 56 + + glib/gvariant-core.c | 18 + + glib/gvariant.c | 1858 +++++++++++++++++++++++++++++++++ - glib/gvariant.h | 95 ++- - glib/tests/gvariant.c | 179 +++- + glib/gvariant.h | 95 ++- + glib/tests/gvariant.c | 179 +++- 7 files changed, 2259 insertions(+), 8 deletions(-) commit afa5dc0c6d9e1aa9b6e057d93562e6ee5796bf46 Author: Petr Kovar -Date: Thu Feb 18 20:07:56 2010 +0100 +Date: Thu Feb 18 20:07:56 2010 +0100 Update Czech translation @@ -2829,7 +27804,7 @@ Date: Thu Feb 18 20:07:56 2010 +0100 commit 48f74cab395044a07e1220440cdc816db01b9984 Author: Christian Kellner -Date: Thu Feb 18 15:49:58 2010 +0100 +Date: Thu Feb 18 15:49:58 2010 +0100 Move event support in the inotify backend @@ -2839,19 +27814,19 @@ Date: Thu Feb 18 15:49:58 2010 +0100 Based heavily on a patch by Martyn Russel . gio/inotify/ginotifydirectorymonitor.c | 7 +++- - gio/inotify/ginotifyfilemonitor.c | 9 +++++- - gio/inotify/inotify-helper.c | 49 + gio/inotify/ginotifyfilemonitor.c | 9 +++++- + gio/inotify/inotify-helper.c | 49 ++++++++++++++++++++++++++++---- - gio/inotify/inotify-kernel.c | 4 +- - gio/inotify/inotify-path.c | 18 +++++++++++ - gio/inotify/inotify-path.h | 8 ++-- - gio/inotify/inotify-sub.c | 6 ++- - gio/inotify/inotify-sub.h | 3 +- + gio/inotify/inotify-kernel.c | 4 +- + gio/inotify/inotify-path.c | 18 +++++++++++ + gio/inotify/inotify-path.h | 8 ++-- + gio/inotify/inotify-sub.c | 6 ++- + gio/inotify/inotify-sub.h | 3 +- 8 files changed, 86 insertions(+), 18 deletions(-) commit 239af977126a4a4b6c68cb43e0876847c7ce2211 Author: Christian Kellner -Date: Thu Feb 18 15:43:45 2010 +0100 +Date: Thu Feb 18 15:43:45 2010 +0100 GLocalFileMonitor: Support for GFileMonitorFlags @@ -2864,7 +27839,7 @@ Date: Thu Feb 18 15:43:45 2010 +0100 commit 41956b237601a1c5ded0ba5e8821b9f5d09278be Author: Christian Kellner -Date: Thu Feb 18 15:40:13 2010 +0100 +Date: Thu Feb 18 15:40:13 2010 +0100 Move event support for fs-monitoring: Event & flag @@ -2878,7 +27853,7 @@ Date: Thu Feb 18 15:40:13 2010 +0100 commit a5dc1af0a230ecfca2dac7fa0dcdf8359537a9f6 Author: Ivar Smolin -Date: Thu Feb 18 11:46:06 2010 +0200 +Date: Thu Feb 18 11:46:06 2010 +0200 Estonian translation updated @@ -2888,7 +27863,7 @@ Date: Thu Feb 18 11:46:06 2010 +0200 commit e1cc5a5fecc1847a6080435fc8a40f2d8d534bbb Author: Mario Blättermann -Date: Wed Feb 17 09:00:04 2010 +0100 +Date: Wed Feb 17 09:00:04 2010 +0100 Updated German translation @@ -2898,7 +27873,7 @@ Date: Wed Feb 17 09:00:04 2010 +0100 commit 63a6666ab7a54c9584b6579e323301f3528e86b3 Author: Benjamin Otte -Date: Wed Feb 17 08:45:28 2010 +0100 +Date: Wed Feb 17 08:45:28 2010 +0100 Make g_type_interface_prerequisites() only return one instantiable type @@ -2913,7 +27888,7 @@ Date: Wed Feb 17 08:45:28 2010 +0100 commit 9fdbae9344a04479ccb601ebd4ae2c709e7856d9 Author: Matej Urbančič -Date: Tue Feb 16 12:38:11 2010 +0100 +Date: Tue Feb 16 12:38:11 2010 +0100 Updated Slovenian translation @@ -2923,19 +27898,19 @@ Date: Tue Feb 16 12:38:11 2010 +0100 commit b899bfc7415ec76ef563de3fc945b84675357464 Author: Ryan Lortie -Date: Mon Feb 15 19:11:58 2010 -0500 +Date: Mon Feb 15 19:11:58 2010 -0500 GVariant: create child instance from its own data also: white-space fix in the serialiser - glib/gvariant-core.c | 8 ++++++-- - glib/gvariant-serialiser.c | 1 - + glib/gvariant-core.c | 8 ++++++-- + glib/gvariant-serialiser.c | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) commit 7fb9d536c0c89800f745ea2c05380efd8f371bf1 Author: Changwoo Ryu -Date: Tue Feb 16 03:42:19 2010 +0900 +Date: Tue Feb 16 03:42:19 2010 +0900 Updated Korean translation @@ -2945,7 +27920,7 @@ Date: Tue Feb 16 03:42:19 2010 +0900 commit 68505d5a9f0b2cbacee4eafa3ba754612f052a5f Author: Jorge González -Date: Mon Feb 15 17:54:26 2010 +0100 +Date: Mon Feb 15 17:54:26 2010 +0100 Updated Spanish translation @@ -2955,7 +27930,7 @@ Date: Mon Feb 15 17:54:26 2010 +0100 commit 36d29e06f9459ce28206d212667aee3adc1fd780 Author: Fran Diéguez -Date: Mon Feb 15 17:10:21 2010 +0100 +Date: Mon Feb 15 17:10:21 2010 +0100 Updated Galician Translation @@ -2965,7 +27940,7 @@ Date: Mon Feb 15 17:10:21 2010 +0100 commit bb4f63d6390fe5efd183f259e5bd891f89de9e24 Author: Christian Kellner -Date: Sun Feb 7 17:23:38 2010 +0100 +Date: Sun Feb 7 17:23:38 2010 +0100 GFile: Support for splice(2) in copy_fallback @@ -2981,7 +27956,7 @@ Date: Sun Feb 7 17:23:38 2010 +0100 commit 28f90db1edf938c04f0b5c8a2f54f8add50db234 Author: Christian Kellner -Date: Sun Feb 7 17:18:06 2010 +0100 +Date: Sun Feb 7 17:18:06 2010 +0100 GLocalFileOutputStream: Implement GFileDescriptorBased @@ -2995,32 +27970,32 @@ Date: Sun Feb 7 17:18:06 2010 +0100 commit 670f6210ced672eb9c8a500b3dd6cfd22346472b Author: Christian Kellner -Date: Sun Feb 7 17:17:44 2010 +0100 +Date: Sun Feb 7 17:17:44 2010 +0100 GLocalFileInputStream: Implement GFileDescriptorBased - gio/glocalfileinputstream.c | 22 +++++++++++++++++++++- + gio/glocalfileinputstream.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) commit 4536a4adbc290f56f3686dec0c8e05c15049a602 Author: Christian Kellner -Date: Sun Feb 7 14:51:01 2010 +0100 +Date: Sun Feb 7 14:51:01 2010 +0100 GFileDescriptorBased: New interface New interface for file descriptor based io object. The interface is only exported on unix based systems. See bug 604086. - gio/Makefile.am | 3 ++ - gio/gfiledescriptorbased.c | 72 + gio/Makefile.am | 3 ++ + gio/gfiledescriptorbased.c | 72 ++++++++++++++++++++++++++++++++++++++++++++ - gio/gfiledescriptorbased.h | 63 ++++++++++++++++++++++++++++++++++++++ - gio/giotypes.h | 1 + + gio/gfiledescriptorbased.h | 63 ++++++++++++++++++++++++++++++++++++++ + gio/giotypes.h | 1 + 4 files changed, 139 insertions(+), 0 deletions(-) commit 3840151012b6ed01bfa9aada2914cce974398d0d Author: Chao-Hsiung Liao -Date: Mon Feb 15 19:15:38 2010 +0800 +Date: Mon Feb 15 19:15:38 2010 +0800 Updated Traditional Chinese translation(Hong Kong and Taiwan) @@ -3032,18 +28007,18 @@ Date: Mon Feb 15 19:15:38 2010 +0800 commit b37da7134b127e6c92e7002150077515dc7d42b4 Author: Alexander Larsson -Date: Mon Feb 15 10:13:10 2010 +0100 +Date: Mon Feb 15 10:13:10 2010 +0100 Set result_uncertain in win32 g_content_type_guess implementation Fixes bug #609143 - gio/gcontenttype.c | 3 +++ + gio/gcontenttype.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) commit 83c6087dcc2168cc41db3a328bbd30341ac3955b Author: Lucian Grijincu -Date: Sat Feb 13 19:35:42 2010 +0200 +Date: Sat Feb 13 19:35:42 2010 +0200 Updated Romanian translation @@ -3053,7 +28028,7 @@ Date: Sat Feb 13 19:35:42 2010 +0200 commit e66d66c5559f4f0423d015a4d006f170dcb5d582 Author: Ryan Lortie -Date: Thu Feb 11 16:52:20 2010 -0500 +Date: Thu Feb 11 16:52:20 2010 -0500 GVariant: lock before freeing, to avoid assert @@ -3062,7 +28037,7 @@ Date: Thu Feb 11 16:52:20 2010 -0500 commit fd3923aba2f827b47c54edc9728c953b9520fa52 Author: Benjamin Otte -Date: Thu Feb 11 21:08:57 2010 +0100 +Date: Thu Feb 11 21:08:57 2010 +0100 Move offsets array from interface data member to TypeNode @@ -3073,7 +28048,7 @@ Date: Thu Feb 11 21:08:57 2010 +0100 commit 61b649cffd26c3feafe4158da01ebb1394a1b574 Author: Benjamin Otte -Date: Thu Feb 11 21:05:41 2010 +0100 +Date: Thu Feb 11 21:05:41 2010 +0100 Move prerequisites out of _prot struct @@ -3084,7 +28059,7 @@ Date: Thu Feb 11 21:05:41 2010 +0100 commit 1e6b18422563bc428e17e8a4e3c84dac8ed02ab2 Author: Ryan Lortie -Date: Wed Feb 10 13:59:14 2010 -0500 +Date: Wed Feb 10 13:59:14 2010 -0500 add performance tests to gitignore @@ -3093,7 +28068,7 @@ Date: Wed Feb 10 13:59:14 2010 -0500 commit 3e30e8a87e18952e9c26c0d05f5c336a110f2bed Author: Ryan Lortie -Date: Wed Feb 10 11:29:12 2010 -0500 +Date: Wed Feb 10 11:29:12 2010 -0500 make tests not dynamic link against /lib/libglib @@ -3104,35 +28079,35 @@ Date: Wed Feb 10 11:29:12 2010 -0500 Adding the libglib.la file as an explicit LDFLAG fixes it. - tests/gobject/Makefile.am | 8 +++++++- + tests/gobject/Makefile.am | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) commit 1e655eb02c6cadee45a28df359327ce9fb41c6a5 Author: Ryan Lortie -Date: Wed Feb 10 11:13:06 2010 -0500 +Date: Wed Feb 10 11:13:06 2010 -0500 merge GVariant - docs/reference/glib/Makefile.am | 7 +- - docs/reference/glib/glib-docs.sgml | 1 + - docs/reference/glib/glib-sections.txt | 18 + - docs/reference/glib/tmpl/.gitignore | 1 + - docs/reference/gobject/gobject-sections.txt | 2 + - glib/Makefile.am | 4 + - glib/glib.h | 1 + - glib/glib.symbols | 13 + - glib/gvariant-core.c | 855 + docs/reference/glib/Makefile.am | 7 +- + docs/reference/glib/glib-docs.sgml | 1 + + docs/reference/glib/glib-sections.txt | 18 + + docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/gobject/gobject-sections.txt | 2 + + glib/Makefile.am | 4 + + glib/glib.h | 1 + + glib/glib.symbols | 13 + + glib/gvariant-core.c | 855 +++++++++++++++++++++++++++ - glib/gvariant-core.h | 46 ++ - glib/gvariant.h | 47 ++ - gobject/gboxed.c | 27 + - gobject/gboxed.h | 18 + - gobject/gobject.symbols | 2 + + glib/gvariant-core.h | 46 ++ + glib/gvariant.h | 47 ++ + gobject/gboxed.c | 27 + + gobject/gboxed.h | 18 + + gobject/gobject.symbols | 2 + 14 files changed, 1039 insertions(+), 3 deletions(-) commit 2afe2325c4c9e42dab8ebfed11b86d24715837e0 Author: Matej Urbančič -Date: Wed Feb 10 16:34:53 2010 +0100 +Date: Wed Feb 10 16:34:53 2010 +0100 Updated Slovenian translation @@ -3142,7 +28117,7 @@ Date: Wed Feb 10 16:34:53 2010 +0100 commit 243e340d6edde4d7ae1c45b3041489332f83a6d5 Author: Matthias Clasen -Date: Tue Feb 9 10:35:01 2010 -0500 +Date: Tue Feb 9 10:35:01 2010 -0500 bump version @@ -3151,106 +28126,106 @@ Date: Tue Feb 9 10:35:01 2010 -0500 commit 1831ff2d30ee837179d9d79d9dbf36016564e0f0 Author: Matthias Clasen -Date: Tue Feb 9 10:20:37 2010 -0500 +Date: Tue Feb 9 10:20:37 2010 -0500 2.23.3 - po/am.po | 250 ++++++----- - po/ar.po | 254 ++++++----- - po/as.po | 254 ++++++----- - po/ast.po | 254 ++++++----- - po/az.po | 253 ++++++----- - po/be.po | 263 ++++++----- + po/am.po | 250 ++++++----- + po/ar.po | 254 ++++++----- + po/as.po | 254 ++++++----- + po/ast.po | 254 ++++++----- + po/az.po | 253 ++++++----- + po/be.po | 263 ++++++----- po/be@latin.po | 260 ++++++----- - po/bg.po | 254 ++++++----- - po/bn.po | 254 ++++++----- - po/bn_IN.po | 254 ++++++----- - po/bs.po | 253 ++++++----- - po/ca.po | 254 ++++++----- + po/bg.po | 254 ++++++----- + po/bn.po | 254 ++++++----- + po/bn_IN.po | 254 ++++++----- + po/bs.po | 253 ++++++----- + po/ca.po | 254 ++++++----- po/ca@valencia.po | 254 ++++++----- - po/cs.po | 940 +++++++++++++++++++------------------- - po/cy.po | 254 ++++++----- - po/da.po | 254 ++++++----- - po/de.po | 254 ++++++----- - po/dz.po | 253 ++++++----- - po/el.po | 254 ++++++----- - po/en@shaw.po | 254 ++++++----- - po/en_CA.po | 254 ++++++----- - po/en_GB.po | 254 ++++++----- - po/eo.po | 251 ++++++----- - po/es.po | 955 +++++++++++++++++++------------------- - po/et.po | 254 ++++++----- - po/eu.po | 255 ++++++----- - po/fa.po | 253 ++++++----- - po/fi.po | 254 ++++++----- - po/fr.po | 950 +++++++++++++++++++------------------- - po/ga.po | 251 ++++++----- - po/gl.po | 254 ++++++----- - po/gu.po | 254 ++++++----- - po/he.po | 254 ++++++----- - po/hi.po | 254 ++++++----- - po/hr.po | 253 ++++++----- - po/hu.po | 254 ++++++----- - po/hy.po | 251 ++++++----- - po/id.po | 253 ++++++----- - po/is.po | 253 ++++++----- - po/it.po | 254 ++++++----- - po/ja.po | 254 ++++++----- - po/ka.po | 254 ++++++----- - po/kn.po | 254 ++++++----- - po/ko.po | 254 ++++++----- - po/ku.po | 250 ++++++----- - po/lt.po | 254 ++++++----- - po/lv.po | 251 ++++++----- - po/mai.po | 254 ++++++----- - po/mg.po | 253 ++++++----- - po/mk.po | 254 ++++++----- - po/ml.po | 254 ++++++----- - po/mn.po | 253 ++++++----- - po/mr.po | 254 ++++++----- - po/ms.po | 253 ++++++----- - po/nb.po | 940 +++++++++++++++++++------------------- - po/ne.po | 253 ++++++----- - po/nl.po | 256 ++++++----- - po/nn.po | 254 ++++++----- - po/oc.po | 249 ++++++----- - po/or.po | 254 ++++++----- - po/pa.po | 254 ++++++----- - po/pl.po | 254 ++++++----- - po/ps.po | 253 ++++++----- - po/pt.po | 254 ++++++----- - po/pt_BR.po | 940 +++++++++++++++++++------------------- - po/ro.po | 254 ++++++----- - po/ru.po | 258 ++++++----- - po/rw.po | 253 ++++++----- - po/si.po | 254 ++++++----- - po/sk.po | 253 ++++++----- - po/sl.po | 1340 + po/cs.po | 940 +++++++++++++++++++------------------- + po/cy.po | 254 ++++++----- + po/da.po | 254 ++++++----- + po/de.po | 254 ++++++----- + po/dz.po | 253 ++++++----- + po/el.po | 254 ++++++----- + po/en@shaw.po | 254 ++++++----- + po/en_CA.po | 254 ++++++----- + po/en_GB.po | 254 ++++++----- + po/eo.po | 251 ++++++----- + po/es.po | 955 +++++++++++++++++++------------------- + po/et.po | 254 ++++++----- + po/eu.po | 255 ++++++----- + po/fa.po | 253 ++++++----- + po/fi.po | 254 ++++++----- + po/fr.po | 950 +++++++++++++++++++------------------- + po/ga.po | 251 ++++++----- + po/gl.po | 254 ++++++----- + po/gu.po | 254 ++++++----- + po/he.po | 254 ++++++----- + po/hi.po | 254 ++++++----- + po/hr.po | 253 ++++++----- + po/hu.po | 254 ++++++----- + po/hy.po | 251 ++++++----- + po/id.po | 253 ++++++----- + po/is.po | 253 ++++++----- + po/it.po | 254 ++++++----- + po/ja.po | 254 ++++++----- + po/ka.po | 254 ++++++----- + po/kn.po | 254 ++++++----- + po/ko.po | 254 ++++++----- + po/ku.po | 250 ++++++----- + po/lt.po | 254 ++++++----- + po/lv.po | 251 ++++++----- + po/mai.po | 254 ++++++----- + po/mg.po | 253 ++++++----- + po/mk.po | 254 ++++++----- + po/ml.po | 254 ++++++----- + po/mn.po | 253 ++++++----- + po/mr.po | 254 ++++++----- + po/ms.po | 253 ++++++----- + po/nb.po | 940 +++++++++++++++++++------------------- + po/ne.po | 253 ++++++----- + po/nl.po | 256 ++++++----- + po/nn.po | 254 ++++++----- + po/oc.po | 249 ++++++----- + po/or.po | 254 ++++++----- + po/pa.po | 254 ++++++----- + po/pl.po | 254 ++++++----- + po/ps.po | 253 ++++++----- + po/pt.po | 254 ++++++----- + po/pt_BR.po | 940 +++++++++++++++++++------------------- + po/ro.po | 254 ++++++----- + po/ru.po | 258 ++++++----- + po/rw.po | 253 ++++++----- + po/si.po | 254 ++++++----- + po/sk.po | 253 ++++++----- + po/sl.po | 1340 ++++++++++++++++++++++++++--------------------------- - po/sq.po | 256 ++++++----- - po/sr.po | 254 ++++++----- - po/sr@ije.po | 253 ++++++----- + po/sq.po | 256 ++++++----- + po/sr.po | 254 ++++++----- + po/sr@ije.po | 253 ++++++----- po/sr@latin.po | 254 ++++++----- - po/sv.po | 254 ++++++----- - po/ta.po | 254 ++++++----- - po/te.po | 254 ++++++----- - po/th.po | 21 +- - po/tl.po | 253 ++++++----- - po/tr.po | 254 ++++++----- - po/tt.po | 250 ++++++----- - po/uk.po | 254 ++++++----- - po/vi.po | 254 ++++++----- - po/wa.po | 253 ++++++----- - po/xh.po | 253 ++++++----- - po/yi.po | 251 ++++++----- - po/zh_CN.po | 254 ++++++----- - po/zh_HK.po | 254 ++++++----- - po/zh_TW.po | 254 ++++++----- + po/sv.po | 254 ++++++----- + po/ta.po | 254 ++++++----- + po/te.po | 254 ++++++----- + po/th.po | 21 +- + po/tl.po | 253 ++++++----- + po/tr.po | 254 ++++++----- + po/tt.po | 250 ++++++----- + po/uk.po | 254 ++++++----- + po/vi.po | 254 ++++++----- + po/wa.po | 253 ++++++----- + po/xh.po | 253 ++++++----- + po/yi.po | 251 ++++++----- + po/zh_CN.po | 254 ++++++----- + po/zh_HK.po | 254 ++++++----- + po/zh_TW.po | 254 ++++++----- 90 files changed, 15161 insertions(+), 11981 deletions(-) commit f570cf99b32d65633082f451a41d3336de0ec005 Author: Matthias Clasen -Date: Tue Feb 9 09:16:23 2010 -0500 +Date: Tue Feb 9 09:16:23 2010 -0500 Doc cleanups @@ -3259,7 +28234,7 @@ Date: Tue Feb 9 09:16:23 2010 -0500 commit a68c0cde8f3b3ca7aa581843a65e43fcc2b11409 Author: Matthias Clasen -Date: Tue Feb 9 08:46:50 2010 -0500 +Date: Tue Feb 9 08:46:50 2010 -0500 Updates @@ -3268,7 +28243,7 @@ Date: Tue Feb 9 08:46:50 2010 -0500 commit bd6a88aef70cb93d79580c00dae420c4a4729f1e Author: Ryan Lortie -Date: Mon Feb 8 00:43:17 2010 -0500 +Date: Mon Feb 8 00:43:17 2010 -0500 gstrfuncs.h: needs gmacros.h for G_BEGIN_DECLS @@ -3277,7 +28252,7 @@ Date: Mon Feb 8 00:43:17 2010 -0500 commit 0be1a4fb973e6a10c12ad9d67344281ccee5ce7e Author: Theppitak Karoonboonyanan -Date: Mon Feb 8 09:57:37 2010 +0700 +Date: Mon Feb 8 09:57:37 2010 +0700 Updated Thai translation. @@ -3287,32 +28262,32 @@ Date: Mon Feb 8 09:57:37 2010 +0700 commit e04c9c699c1ca181419d3d325aade70cf3e14763 Author: Ryan Lortie -Date: Sun Feb 7 15:41:21 2010 -0500 +Date: Sun Feb 7 15:41:21 2010 -0500 add missing #include "config.h" - glib/gbuffer.c | 2 ++ - glib/gurifuncs.c | 2 ++ - glib/gvariant-serialiser.c | 2 ++ - glib/gvarianttype.c | 2 ++ - glib/gvarianttypeinfo.c | 2 ++ + glib/gbuffer.c | 2 ++ + glib/gurifuncs.c | 2 ++ + glib/gvariant-serialiser.c | 2 ++ + glib/gvarianttype.c | 2 ++ + glib/gvarianttypeinfo.c | 2 ++ 5 files changed, 10 insertions(+), 0 deletions(-) commit 218c691ca33f556033535fa43a39b65cd2276282 Author: Ryan Lortie -Date: Sun Feb 7 03:14:28 2010 -0500 +Date: Sun Feb 7 03:14:28 2010 -0500 remove #include from some .c files include individual headers instead - glib/gurifuncs.c | 9 +++++++-- + glib/gurifuncs.c | 9 +++++++-- glib/gvarianttypeinfo.c | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) commit ea2917b01f045d8e7ede4824039d462203af3290 Author: Ryan Lortie -Date: Sun Feb 7 03:08:08 2010 -0500 +Date: Sun Feb 7 03:08:08 2010 -0500 gurifuncs.c: #include "string.h" -> @@ -3321,7 +28296,7 @@ Date: Sun Feb 7 03:08:08 2010 -0500 commit 9f303375736edbb6c7d39f339b89be14d621fd8e Author: Ryan Lortie -Date: Sun Feb 7 02:52:07 2010 -0500 +Date: Sun Feb 7 02:52:07 2010 -0500 GVariantTypeInfo: free hash table when not in use @@ -3330,32 +28305,32 @@ Date: Sun Feb 7 02:52:07 2010 -0500 commit 80538aba7ea8f9a05ea1a6a66eb202a4ccfe4b5f Author: Ryan Lortie -Date: Thu Feb 4 21:18:53 2010 -0500 +Date: Thu Feb 4 21:18:53 2010 -0500 merge the GVariant serialiser - glib/Makefile.am | 2 + + glib/Makefile.am | 2 + glib/gvariant-serialiser.c | 1656 ++++++++++++++++++++++++++++++++++++++++++++ - glib/gvariant-serialiser.h | 75 ++ - glib/tests/gvariant.c | 1245 +++++++++++++++++++++++++++++++++ + glib/gvariant-serialiser.h | 75 ++ + glib/tests/gvariant.c | 1245 +++++++++++++++++++++++++++++++++ 4 files changed, 2978 insertions(+), 0 deletions(-) commit eea6042f5f4db2f123763097ac2fd4738cef24ee Author: Ryan Lortie -Date: Fri Feb 5 12:37:43 2010 -0500 +Date: Fri Feb 5 12:37:43 2010 -0500 GMappedFile: minimal changes to support GBuffer Just reorganise the GMappedFile struct to be binary compatible with GBuffer. If GBuffer becomes public later then we can revisit this. - glib/gmappedfile.c | 46 +++++++++++++++++++++++++++++++--------------- + glib/gmappedfile.c | 46 +++++++++++++++++++++++++++++++--------------- 1 files changed, 31 insertions(+), 15 deletions(-) commit 3f4b7f6d37cd0036f65c31eeee033d650072561e Author: Ryan Lortie -Date: Sat Feb 6 10:18:07 2010 -0500 +Date: Sat Feb 6 10:18:07 2010 -0500 add private GBuffer type @@ -3367,7 +28342,7 @@ Date: Sat Feb 6 10:18:07 2010 -0500 commit 813d0d17a65be2ecb5961a96630d11a195ce6a67 Author: Tim-Philipp Müller -Date: Fri Feb 5 01:14:20 2010 +0000 +Date: Fri Feb 5 01:14:20 2010 +0000 Don't leak filename in g_io_modules_scan_all_in_directory @@ -3378,7 +28353,7 @@ Date: Fri Feb 5 01:14:20 2010 +0000 commit 4adde81771f5a4471a568a409a38fd9162d49418 Author: Hans Breuer -Date: Sat Feb 6 13:22:39 2010 +0100 +Date: Sat Feb 6 13:22:39 2010 +0100 Fix inconsistent line-endings @@ -3393,28 +28368,28 @@ Date: Sat Feb 6 13:22:39 2010 +0100 commit 00b55e2bc7cb7f4ff7adb3b40e1b41becce6cba1 Author: Tor Lillqvist -Date: Sat Feb 6 10:40:03 2010 +0200 +Date: Sat Feb 6 10:40:03 2010 +0200 Drop empty elements from the VS9 vcproj files Dunno if this makes sense, if one lets VS edit the it will put them back anyway. But it's more pleasing to the eye. - build/win32/vs9/gio.vcproj | 50 ----- - build/win32/vs9/glib-genmarshal.vcproj | 50 ----- - build/win32/vs9/glib.vcproj | 230 + build/win32/vs9/gio.vcproj | 50 ----- + build/win32/vs9/glib-genmarshal.vcproj | 50 ----- + build/win32/vs9/glib.vcproj | 230 +++++--------------- - build/win32/vs9/gmodule.vcproj | 50 ----- - build/win32/vs9/gobject.vcproj | 50 ----- - build/win32/vs9/gspawn-win32-helper-console.vcproj | 50 ----- - build/win32/vs9/gspawn-win32-helper.vcproj | 50 ----- - build/win32/vs9/gthread.vcproj | 50 ----- - build/win32/vs9/testglib.vcproj | 50 ----- + build/win32/vs9/gmodule.vcproj | 50 ----- + build/win32/vs9/gobject.vcproj | 50 ----- + build/win32/vs9/gspawn-win32-helper-console.vcproj | 50 ----- + build/win32/vs9/gspawn-win32-helper.vcproj | 50 ----- + build/win32/vs9/gthread.vcproj | 50 ----- + build/win32/vs9/testglib.vcproj | 50 ----- 9 files changed, 60 insertions(+), 570 deletions(-) commit 10cd6df4a8b947b3b2b68891c779f5318b46e8de Author: Jonh Wendell -Date: Fri Feb 5 11:09:26 2010 -0300 +Date: Fri Feb 5 11:09:26 2010 -0300 Updated Brazilian Portuguese translation @@ -3424,15 +28399,15 @@ Date: Fri Feb 5 11:09:26 2010 -0300 commit 5e753d6abcad6040a6fd25f5ac34d5dab4f7ae22 Author: Ryan Lortie -Date: Thu Feb 4 20:27:11 2010 -0500 +Date: Thu Feb 4 20:27:11 2010 -0500 rename test: gvarianttype -> gvariant More test cases will be added to this file. - glib/tests/.gitignore | 2 +- - glib/tests/Makefile.am | 4 +- - glib/tests/gvariant.c | 1041 + glib/tests/.gitignore | 2 +- + glib/tests/Makefile.am | 4 +- + glib/tests/gvariant.c | 1041 +++++++++++++++++++++++++++++++++++++++++++++ glib/tests/gvarianttype.c | 1041 --------------------------------------------- @@ -3440,7 +28415,7 @@ Date: Thu Feb 4 20:27:11 2010 -0500 commit 9a990cea0cfc7357000e30f3c24030fed2ff4708 Author: Petr Kovar -Date: Thu Feb 4 23:54:15 2010 +0100 +Date: Thu Feb 4 23:54:15 2010 +0100 Update Czech translation @@ -3450,49 +28425,49 @@ Date: Thu Feb 4 23:54:15 2010 +0100 commit 762e18d8cebf907e51aed14298525048f7c9e015 Author: Tor Lillqvist -Date: Thu Feb 4 19:57:38 2010 +0200 +Date: Thu Feb 4 19:57:38 2010 +0200 Further work on VS9 project files - build/win32/vs9/README.txt | 16 ++++++++++++---- - build/win32/vs9/glib.vsprops | 32 ++++++++++++++++++++++++++++++-- + build/win32/vs9/README.txt | 16 ++++++++++++---- + build/win32/vs9/glib.vsprops | 32 ++++++++++++++++++++++++++++++-- build/win32/vs9/install.vcproj | 8 ++++---- 3 files changed, 46 insertions(+), 10 deletions(-) commit 021643cda4f9b13fd72e898165744e9aefb346cd Author: Tor Lillqvist -Date: Thu Feb 4 19:54:50 2010 +0200 +Date: Thu Feb 4 19:54:50 2010 +0200 Clarify use of struct stat on Windows gio/glocalfile.c | 23 ++++++++++++++--------- gio/glocalfileinfo.c | 10 ++++++---- - glib/gstdio.c | 24 +++++++++++++++++++----- - glib/gstdio.h | 37 +++++++++++++++++++++++++++++++++++++ + glib/gstdio.c | 24 +++++++++++++++++++----- + glib/gstdio.h | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 18 deletions(-) commit 5589d2b45567a0b35e8d8f55f20b1e381c53ca04 Author: Tor Lillqvist -Date: Thu Feb 4 19:20:08 2010 +0200 +Date: Thu Feb 4 19:20:08 2010 +0200 Internally use the _stati64 API explicitly on Windows Avoids warnings and confusion when compiling with MSVC. - glib/giowin32.c | 24 ++++++++++-------------- - glib/gkeyfile.c | 5 ++--- - glib/gmappedfile.c | 5 ++--- + glib/giowin32.c | 24 ++++++++++-------------- + glib/gkeyfile.c | 5 ++--- + glib/gmappedfile.c | 5 ++--- 3 files changed, 14 insertions(+), 20 deletions(-) commit 05291c0d11f269dedacde62e767b75976c27bd33 Author: Tor Lillqvist -Date: Thu Feb 4 15:24:56 2010 +0200 +Date: Thu Feb 4 15:24:56 2010 +0200 Enable libtool compatible DLL naming in the VS9 projects - build/win32/vs9/gio.vcproj | 8 ++++---- - build/win32/vs9/glib.vcproj | 8 ++++---- - build/win32/vs9/glib.vsprops | 28 +++++++++++++++++++++++++++- + build/win32/vs9/gio.vcproj | 8 ++++---- + build/win32/vs9/glib.vcproj | 8 ++++---- + build/win32/vs9/glib.vsprops | 28 +++++++++++++++++++++++++++- build/win32/vs9/gmodule.vcproj | 8 ++++---- build/win32/vs9/gobject.vcproj | 8 ++++---- build/win32/vs9/gthread.vcproj | 8 ++++---- @@ -3500,36 +28475,36 @@ Date: Thu Feb 4 15:24:56 2010 +0200 commit bfd60d8835149ede901b52f42d2a56c8ec6e7f77 Author: Ryan Lortie -Date: Thu Feb 4 09:06:56 2010 -0500 +Date: Thu Feb 4 09:06:56 2010 -0500 GVariantType test case: assert all memory freed Make sure we've freed all TypeInfos at the end of the test. - glib/tests/gvarianttype.c | 2 ++ + glib/tests/gvarianttype.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) commit 6d6d7a8bb2c58b4cce7031e68d31978b2f83e6ff Author: Ryan Lortie -Date: Thu Feb 4 09:04:32 2010 -0500 +Date: Thu Feb 4 09:04:32 2010 -0500 GVariantTypeInfo tweaks 1) always emit ending type FIXED for fixed sized items - The serialiser needs to know if it dealing with a fixed sized item - in case the serialised data is corrupt and the item has the wrong - size. + The serialiser needs to know if it dealing with a fixed sized item + in case the serialised data is corrupt and the item has the wrong + size. 2) add a macro that will be used by test cases to check that all - memory has been freed. + memory has been freed. glib/gvarianttypeinfo.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) commit cb7dfdc1943c016fe05c67ccedf653bfb7bc3891 Author: Tor Lillqvist -Date: Thu Feb 4 15:00:15 2010 +0200 +Date: Thu Feb 4 15:00:15 2010 +0200 Use inherited properties in all configurations in gmodule, too @@ -3538,18 +28513,18 @@ Date: Thu Feb 4 15:00:15 2010 +0200 commit 79eb03aa4f6f75c7049a3c5b11cb83fea0685b88 Author: Tor Lillqvist -Date: Thu Feb 4 14:51:56 2010 +0200 +Date: Thu Feb 4 14:51:56 2010 +0200 Use README.txt instead of README for Windows developer friendliness - build/win32/vs9/Makefile.am | 2 +- - build/win32/vs9/README | 29 ----------------------------- - build/win32/vs9/README.txt | 29 +++++++++++++++++++++++++++++ + build/win32/vs9/Makefile.am | 2 +- + build/win32/vs9/README | 29 ----------------------------- + build/win32/vs9/README.txt | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 30 deletions(-) commit ec1944781589fdb15d61b2b251d51bd7e4617832 Author: Tor Lillqvist -Date: Thu Feb 4 14:50:36 2010 +0200 +Date: Thu Feb 4 14:50:36 2010 +0200 Update README for VS9 build @@ -3558,36 +28533,36 @@ Date: Thu Feb 4 14:50:36 2010 +0200 commit 9d444f7b12fff6b7f9e6ba4a2667ab293af793eb Author: Tor Lillqvist -Date: Thu Feb 4 14:36:23 2010 +0200 +Date: Thu Feb 4 14:36:23 2010 +0200 Refactor VS9 project files Factor out common parts into a vsprops file. Drop empty elements for tools that aren't used. - build/win32/vs9/Makefile.am | 9 +- - build/win32/vs9/gio.vcproj | 184 + build/win32/vs9/Makefile.am | 9 +- + build/win32/vs9/gio.vcproj | 184 +++---------------- - build/win32/vs9/glib-genmarshal.vcproj | 138 +------------- - build/win32/vs9/glib.vcproj | 194 + build/win32/vs9/glib-genmarshal.vcproj | 138 +------------- + build/win32/vs9/glib.vcproj | 194 +++----------------- - build/win32/vs9/glib.vsprops | 196 + build/win32/vs9/glib.vsprops | 196 ++++++++++++++++++++ - build/win32/vs9/gmodule.vcproj | 173 + build/win32/vs9/gmodule.vcproj | 173 ++---------------- - build/win32/vs9/gobject.vcproj | 178 + build/win32/vs9/gobject.vcproj | 178 ++---------------- build/win32/vs9/gspawn-win32-helper-console.vcproj | 142 +-------------- - build/win32/vs9/gspawn-win32-helper.vcproj | 142 +-------------- - build/win32/vs9/gthread.vcproj | 150 +-------------- - build/win32/vs9/install.vcproj | 164 + build/win32/vs9/gspawn-win32-helper.vcproj | 142 +-------------- + build/win32/vs9/gthread.vcproj | 150 +-------------- + build/win32/vs9/install.vcproj | 164 +---------------- - build/win32/vs9/testglib.vcproj | 142 +-------------- + build/win32/vs9/testglib.vcproj | 142 +-------------- 12 files changed, 319 insertions(+), 1493 deletions(-) commit 241c7f476d8867d4d380c655d15a8963152a1fa0 Author: Tor Lillqvist -Date: Thu Feb 4 14:35:04 2010 +0200 +Date: Thu Feb 4 14:35:04 2010 +0200 Don't use deprecated g_win32 API @@ -3596,20 +28571,20 @@ Date: Thu Feb 4 14:35:04 2010 +0200 commit 3f3c163aa2ddbfb756b556b70901d2a58b1313d9 Author: Tor Lillqvist -Date: Thu Feb 4 00:37:13 2010 +0200 +Date: Thu Feb 4 00:37:13 2010 +0200 Put a version info resource also in the gio DLL Also, distribute gio/gio.rc(.in). - configure.in | 1 + + configure.in | 1 + gio/Makefile.am | 18 +++++++++++++++++- - gio/gio.rc.in | 2 +- + gio/gio.rc.in | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) commit 154a5314be98b22cb3171721d40cb9c4e6d5f102 Author: Tor Lillqvist -Date: Thu Feb 4 00:11:44 2010 +0200 +Date: Thu Feb 4 00:11:44 2010 +0200 Update copyright years @@ -3621,7 +28596,7 @@ Date: Thu Feb 4 00:11:44 2010 +0200 commit 33b011ce7d9415d60493595bbfe14dbc02c2d201 Author: Krzesimir Nowak -Date: Wed Jan 13 18:40:17 2010 +0100 +Date: Wed Jan 13 18:40:17 2010 +0100 Add checks for NULL pointer in arrays. @@ -3637,7 +28612,7 @@ Date: Wed Jan 13 18:40:17 2010 +0100 commit 2b121c02efc13f4b8c6c771b33a2363a21e7757f Author: River Tarnell -Date: Wed Feb 3 17:31:02 2010 +0100 +Date: Wed Feb 3 17:31:02 2010 +0100 properly guard the includes @@ -3652,7 +28627,7 @@ Date: Wed Feb 3 17:31:02 2010 +0100 commit e62e7227bf6d97215b697fd9a1d7b4a5addd70cb Author: Tor Lillqvist -Date: Wed Feb 3 18:09:28 2010 +0200 +Date: Wed Feb 3 18:09:28 2010 +0200 Fix the "install" VS9 project @@ -3665,7 +28640,7 @@ Date: Wed Feb 3 18:09:28 2010 +0200 commit 0ac2277b490dae967b7a5083966610cffe8582e1 Author: Ryan Lortie -Date: Tue Feb 2 23:38:20 2010 -0500 +Date: Tue Feb 2 23:38:20 2010 -0500 GVariantTypeInfo changes @@ -3675,30 +28650,30 @@ Date: Tue Feb 2 23:38:20 2010 -0500 glib/gvarianttypeinfo.c | 23 ++++++++++++++++------- glib/gvarianttypeinfo.h | 21 ++++++++++++++++++++- - glib/tests/gvarianttype.c | 6 +++--- + glib/tests/gvarianttype.c | 6 +++--- 3 files changed, 39 insertions(+), 11 deletions(-) commit 1de58ef708fb1972445a65e184e1579f0d0bbaaf Author: Tor Lillqvist -Date: Tue Feb 2 21:24:45 2010 +0200 +Date: Tue Feb 2 21:24:45 2010 +0200 Link with dnsapi.lib also in 32-bit builds - build/win32/vs9/gio.vcproj | 4 ++-- + build/win32/vs9/gio.vcproj | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 57d3e4cba3a0a273d93a25356801080d710d926e Author: Tor Lillqvist -Date: Tue Feb 2 21:23:27 2010 +0200 +Date: Tue Feb 2 21:23:27 2010 +0200 Include also testglib.vcproj in tarball - build/win32/vs9/Makefile.am | 1 + + build/win32/vs9/Makefile.am | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit cf0e4c33fa8a7efdc62d52cad0d7dc9135dccdf8 Author: Philip Withnall -Date: Tue Feb 2 10:41:00 2010 +0000 +Date: Tue Feb 2 10:41:00 2010 +0000 Don't use a compiler keyword as a variable name @@ -3714,7 +28689,7 @@ Date: Tue Feb 2 10:41:00 2010 +0000 commit e2bc5c21122b0a0703524a37df6cef43577a46f7 Author: Ryan Lortie -Date: Mon Feb 1 18:30:57 2010 -0500 +Date: Mon Feb 1 18:30:57 2010 -0500 g_bit_lock: remove double variable declarations @@ -3728,145 +28703,145 @@ Date: Mon Feb 1 18:30:57 2010 -0500 commit 27a080537efdb8660c62445427b53fc29735f304 Author: Dan Winship -Date: Mon Feb 1 18:11:43 2010 -0500 +Date: Mon Feb 1 18:11:43 2010 -0500 ghostutils: Fix a crash and add some tests https://bugzilla.gnome.org/show_bug.cgi?id=608743 - glib/ghostutils.c | 13 ++++++++++++- + glib/ghostutils.c | 13 ++++++++++++- glib/tests/hostutils.c | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletions(-) commit 3443f47ddf520b044997d5b09b95dec692e34ae5 Author: Ryan Lortie -Date: Sun Jan 31 14:30:08 2010 -0500 +Date: Sun Jan 31 14:30:08 2010 -0500 G{Byte,Ptr,}Array: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 3 + - docs/reference/glib/tmpl/arrays.sgml | 339 -------------- + docs/reference/glib/tmpl/.gitignore | 3 + + docs/reference/glib/tmpl/arrays.sgml | 339 -------------- docs/reference/glib/tmpl/arrays_byte.sgml | 211 --------- docs/reference/glib/tmpl/arrays_pointer.sgml | 308 ------------- - glib/garray.c | 629 + glib/garray.c | 629 ++++++++++++++++++++++++++ 5 files changed, 632 insertions(+), 858 deletions(-) commit 501a2906d3208440a74bebe8736ea39b3f5b5947 Author: Ryan Lortie -Date: Sun Jan 31 13:07:16 2010 -0500 +Date: Sun Jan 31 13:07:16 2010 -0500 GList, GSList: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 2 + + docs/reference/glib/tmpl/.gitignore | 2 + docs/reference/glib/tmpl/linked_lists_double.sgml | 467 --------------------- docs/reference/glib/tmpl/linked_lists_single.sgml | 394 ----------------- - glib/glist.c | 154 +++++++ - glib/gslist.c | 113 +++++ + glib/glist.c | 154 +++++++ + glib/gslist.c | 113 +++++ 5 files changed, 269 insertions(+), 861 deletions(-) commit c8c5c5a991b384964d0650d7fec02663dddc9035 Author: Ryan Lortie -Date: Sun Jan 31 01:26:49 2010 -0500 +Date: Sun Jan 31 01:26:49 2010 -0500 remove trailing whitespace breaking .gitignore - docs/reference/glib/tmpl/.gitignore | 2 +- + docs/reference/glib/tmpl/.gitignore | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 4bdf7d12a8ef7e027dced8d0da46986c2009180e Author: Ryan Lortie -Date: Sun Jan 31 00:39:40 2010 -0500 +Date: Sun Jan 31 00:39:40 2010 -0500 GIOChannel: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/iochannels.sgml | 666 ------------------------------ - glib/giochannel.c | 196 +++++++++ - glib/giounix.c | 36 ++ - glib/giowin32.c | 52 +++ + glib/giochannel.c | 196 +++++++++ + glib/giounix.c | 36 ++ + glib/giowin32.c | 52 +++ 5 files changed, 285 insertions(+), 666 deletions(-) commit 4353151449fedf8e018c07ae4d196652a39f0528 Author: Ryan Lortie -Date: Sun Jan 31 00:27:28 2010 -0500 +Date: Sun Jan 31 00:27:28 2010 -0500 GTree, GNode: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 2 + + docs/reference/glib/tmpl/.gitignore | 2 + docs/reference/glib/tmpl/trees-binary.sgml | 250 -------------- docs/reference/glib/tmpl/trees-nary.sgml | 501 ---------------------------- - glib/gnode.c | 116 +++++++ - glib/gtree.c | 67 ++++ + glib/gnode.c | 116 +++++++ + glib/gtree.c | 67 ++++ 5 files changed, 185 insertions(+), 751 deletions(-) commit d81506a154ba387e339dfb5ff6acddac1e4866c5 Author: Ryan Lortie -Date: Sun Jan 31 00:18:09 2010 -0500 +Date: Sun Jan 31 00:18:09 2010 -0500 GThreadPool: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/thread_pools.sgml | 202 ---------------------------- - glib/gthreadpool.c | 50 +++++++ + glib/gthreadpool.c | 50 +++++++ 3 files changed, 51 insertions(+), 202 deletions(-) commit c471468ca477b44c1c14038951f720fd1ca26070 Author: Ryan Lortie -Date: Sun Jan 31 00:16:14 2010 -0500 +Date: Sun Jan 31 00:16:14 2010 -0500 GRelation: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/relations.sgml | 204 ------------------------------- - glib/grel.c | 162 ++++++++++++++++++++++++ + glib/grel.c | 162 ++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 204 deletions(-) commit 21a6b69f4fe85948e6e97650ccdd6e280098a790 Author: Ryan Lortie -Date: Sun Jan 31 00:10:58 2010 -0500 +Date: Sun Jan 31 00:10:58 2010 -0500 GCache: move docs from tmpl to .c docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/caches.sgml | 162 ---------------------------------- - glib/gcache.c | 134 ++++++++++++++++++++++++++++ + glib/gcache.c | 134 ++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 162 deletions(-) commit fa7cafae5cfea880a1d6cfc82b000eecd34534e1 Author: Ryan Lortie -Date: Sun Jan 31 00:05:48 2010 -0500 +Date: Sun Jan 31 00:05:48 2010 -0500 GChecksum: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/checksum.sgml | 145 -------------------------------- - glib/gchecksum.c | 22 +++++ + glib/gchecksum.c | 22 +++++ 3 files changed, 23 insertions(+), 145 deletions(-) commit 5ee096636b3e603863e0935c2e7ff107b4d72f63 Author: Ryan Lortie -Date: Sun Jan 31 00:03:33 2010 -0500 +Date: Sun Jan 31 00:03:33 2010 -0500 GCompletion: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/completion.sgml | 158 ------------------------------ - glib/gcompletion.c | 122 +++++++++++++++++++++++ + glib/gcompletion.c | 122 +++++++++++++++++++++++ 3 files changed, 123 insertions(+), 158 deletions(-) commit 75b3bd99e1a219fdd8d8f0be5a9fdddfda120ace Author: Christian Dywan -Date: Mon Feb 1 12:37:23 2010 +0100 +Date: Mon Feb 1 12:37:23 2010 +0100 Fix typo in introduction to threads in Glib @@ -3875,7 +28850,7 @@ Date: Mon Feb 1 12:37:23 2010 +0100 commit f25e756ab65fef3bd793aaf234a82b4a82d19d67 Author: Kjartan Maraas -Date: Sun Jan 31 19:57:59 2010 +0100 +Date: Sun Jan 31 19:57:59 2010 +0100 Updated Norwegian bokmål translation @@ -3885,7 +28860,7 @@ Date: Sun Jan 31 19:57:59 2010 +0100 commit aa67c725e1bde15c900b65c1971771ec084cef20 Author: Philip Withnall -Date: Sun Jan 31 16:15:32 2010 +0000 +Date: Sun Jan 31 16:15:32 2010 +0000 Fix shadowing of G_VALUE_COLLECT variables in G_VALUE_COLLECT_INIT @@ -3896,96 +28871,96 @@ Date: Sun Jan 31 16:15:32 2010 +0000 commit 6d52d34dff51676bdfa42d09c26c683304275c39 Author: Ryan Lortie -Date: Sat Jan 30 23:34:19 2010 -0500 +Date: Sat Jan 30 23:34:19 2010 -0500 data{list,sets}, quarks: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 3 + + docs/reference/glib/tmpl/.gitignore | 3 + docs/reference/glib/tmpl/datalist.sgml | 244 ------------------ docs/reference/glib/tmpl/datasets.sgml | 212 ---------------- - docs/reference/glib/tmpl/quarks.sgml | 124 --------- - glib/gdataset.c | 428 + docs/reference/glib/tmpl/quarks.sgml | 124 --------- + glib/gdataset.c | 428 +++++++++++++++++++++++++++++++- 5 files changed, 429 insertions(+), 582 deletions(-) commit c7000fcfecca109a9f35c8c2e4e56d3a63cf5bd6 Author: Ryan Lortie -Date: Sat Jan 30 23:10:34 2010 -0500 +Date: Sat Jan 30 23:10:34 2010 -0500 GPattern: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/patterns.sgml | 124 -------------------------------- - glib/gpattern.c | 103 ++++++++++++++++++++++++++ + glib/gpattern.c | 103 ++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 124 deletions(-) commit 84572f81bfc2696390625e814d0200cbb26220cb Author: Ryan Lortie -Date: Sat Jan 30 23:04:52 2010 -0500 +Date: Sat Jan 30 23:04:52 2010 -0500 String chunks: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + - docs/reference/glib/tmpl/string_chunks.sgml | 108 + docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/string_chunks.sgml | 108 --------------------------- - glib/gstring.c | 35 +++++++++ + glib/gstring.c | 35 +++++++++ 3 files changed, 36 insertions(+), 108 deletions(-) commit 4431ac5dda5a3f130c9eb8f41445c883d960fe4c Author: Ryan Lortie -Date: Sat Jan 30 22:58:43 2010 -0500 +Date: Sat Jan 30 22:58:43 2010 -0500 Move allocator and memchunk docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 2 + - docs/reference/glib/tmpl/allocators.sgml | 57 ----- - docs/reference/glib/tmpl/memory_chunks.sgml | 331 + docs/reference/glib/tmpl/.gitignore | 2 + + docs/reference/glib/tmpl/allocators.sgml | 57 ----- + docs/reference/glib/tmpl/memory_chunks.sgml | 331 ------------------------- - glib/gmem.c | 353 + glib/gmem.c | 353 +++++++++++++++++++++++++++ - glib/gtimer.c | 3 +- + glib/gtimer.c | 3 +- 5 files changed, 357 insertions(+), 389 deletions(-) commit 3a161ee8f34f8c5861075a4b0d52730f7ba5bec0 Author: Ryan Lortie -Date: Sat Jan 30 22:19:29 2010 -0500 +Date: Sat Jan 30 22:19:29 2010 -0500 GSequence: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/sequence.sgml | 432 -------------------------------- - glib/gsequence.c | 69 +++++ + glib/gsequence.c | 69 +++++ 3 files changed, 70 insertions(+), 432 deletions(-) commit 0ab7bb4b18908813b484514b8d2f597d962dd3c7 Author: Ryan Lortie -Date: Sat Jan 30 22:15:35 2010 -0500 +Date: Sat Jan 30 22:15:35 2010 -0500 GShell: move docs from tmpl to .c - docs/reference/glib/tmpl/.gitignore | 1 + - docs/reference/glib/tmpl/shell.sgml | 68 + docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/shell.sgml | 68 ----------------------------------- - glib/gshell.c | 22 +++++++++++ + glib/gshell.c | 22 +++++++++++ 3 files changed, 23 insertions(+), 68 deletions(-) commit f6482a1eaa10f6e21536776ca667980ccd9e5f77 Author: Ryan Lortie -Date: Sat Jan 30 22:12:22 2010 -0500 +Date: Sat Jan 30 22:12:22 2010 -0500 GTimer: move docs from tmpl to .c docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/timers.sgml | 110 ---------------------------------- - glib/gtimer.c | 91 +++++++++++++++++++++++++++- + glib/gtimer.c | 91 +++++++++++++++++++++++++++- 3 files changed, 91 insertions(+), 111 deletions(-) commit d87712d3e6d3975b2c0a5fb436b8b8d3e009a3e1 Author: Ryan Lortie -Date: Sat Jan 30 21:55:03 2010 -0500 +Date: Sat Jan 30 21:55:03 2010 -0500 Fix up gthread.c documentation @@ -3998,11 +28973,11 @@ Date: Sat Jan 30 21:55:03 2010 -0500 commit 0f246e28ca6651b7b40a5a5668b45729226ca177 Author: Ryan Lortie -Date: Sat Jan 30 20:15:25 2010 -0500 +Date: Sat Jan 30 20:15:25 2010 -0500 merge GVariantTypeInfo - glib/Makefile.am | 2 + + glib/Makefile.am | 2 + glib/gvarianttypeinfo.c | 841 +++++++++++++++++++++++++++++++++++++++++++++ glib/gvarianttypeinfo.h | 140 ++++++++ @@ -4011,23 +28986,23 @@ Date: Sat Jan 30 20:15:25 2010 -0500 commit 4c58a85dd1eb89fe45b8fc5730291238c057d63e Author: Ryan Lortie -Date: Sat Jan 30 16:00:51 2010 -0500 +Date: Sat Jan 30 16:00:51 2010 -0500 Revert accidental commit "dirt" This reverts commit c46bc6ba1fc8c5045c9a93b95e78e81936e2d954. - docs/reference/glib/Makefile.am | 1 - - docs/reference/glib/glib-sections.txt | 2 + + docs/reference/glib/Makefile.am | 1 - + docs/reference/glib/glib-sections.txt | 2 + docs/reference/glib/tmpl/glib-unused.sgml | 847 ++--------------------------- - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/version.sgml | 68 --- + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/version.sgml | 68 --- 5 files changed, 44 insertions(+), 879 deletions(-) commit f411e23043a5f97010ee12895f78a779df43b3dd Author: Ryan Lortie -Date: Sat Jan 30 14:06:12 2010 -0500 +Date: Sat Jan 30 14:06:12 2010 -0500 GIO: Remove trailing "." from Since: tags in docs @@ -4036,38 +29011,38 @@ Date: Sat Jan 30 14:06:12 2010 -0500 file (ie: the last '.' is taken to be part of the version number). gio/gfileinfo.h | 4 ++-- - gio/gsocket.c | 2 +- + gio/gsocket.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit c46bc6ba1fc8c5045c9a93b95e78e81936e2d954 Author: Ryan Lortie -Date: Sat Jan 30 13:00:01 2010 -0500 +Date: Sat Jan 30 13:00:01 2010 -0500 dirt - docs/reference/glib/Makefile.am | 1 + - docs/reference/glib/glib-sections.txt | 2 - + docs/reference/glib/Makefile.am | 1 + + docs/reference/glib/glib-sections.txt | 2 - docs/reference/glib/tmpl/glib-unused.sgml | 847 +++++++++++++++++++++++++++-- - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/version.sgml | 68 +++ + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/version.sgml | 68 +++ 5 files changed, 879 insertions(+), 44 deletions(-) commit 6857767b8600a361188f75e62c086ed7d7c06d7c Author: Ryan Lortie -Date: Sat Jan 30 12:32:09 2010 -0500 +Date: Sat Jan 30 12:32:09 2010 -0500 move threads docs to .c docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/threads.sgml | 1801 --------------------------------- - glib/gthread.c | 1492 +++++++++++++++++++++++++++- + glib/gthread.c | 1492 +++++++++++++++++++++++++++- 3 files changed, 1475 insertions(+), 1819 deletions(-) commit 4234481855b8bef92d594421977a2aa130ac3ad6 Author: Ryan Lortie -Date: Sat Jan 30 13:29:23 2010 -0500 +Date: Sat Jan 30 13:29:23 2010 -0500 GIOChannel: fill in missing docs @@ -4076,7 +29051,7 @@ Date: Sat Jan 30 13:29:23 2010 -0500 commit 7b6c8a56059657073f56dbc2a9d04acde2588349 Author: Ryan Lortie -Date: Sat Jan 30 12:30:53 2010 -0500 +Date: Sat Jan 30 12:30:53 2010 -0500 g_strlcpy doc: small fixup @@ -4087,7 +29062,7 @@ Date: Sat Jan 30 12:30:53 2010 -0500 commit 522dafe126ed814a1699238142fbc12b7f55b0b6 Author: Ryan Lortie -Date: Sat Jan 30 12:13:50 2010 -0500 +Date: Sat Jan 30 12:13:50 2010 -0500 gbitlock: fix gtkdoc brokenness @@ -4097,19 +29072,19 @@ Date: Sat Jan 30 12:13:50 2010 -0500 commit d51b6c471ab13348077630e8f7a3a480b3d266f0 Author: Ryan Lortie -Date: Sat Jan 30 01:00:50 2010 -0500 +Date: Sat Jan 30 01:00:50 2010 -0500 GRand: move docs from tmpl to inline comments - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/random_numbers.sgml | 206 -------------------------- - glib/grand.c | 64 ++++++++ + glib/grand.c | 64 ++++++++ 3 files changed, 65 insertions(+), 206 deletions(-) commit 3de141b8d5d410a87481a2dec1bb3227464d97c8 Author: Jorge González -Date: Sat Jan 30 12:37:00 2010 +0100 +Date: Sat Jan 30 12:37:00 2010 +0100 Updated Spanish translation @@ -4119,32 +29094,32 @@ Date: Sat Jan 30 12:37:00 2010 +0100 commit 2f4bc34b324505cc6b196a9793b71e8455fe8540 Author: Ryan Lortie -Date: Sat Jan 30 00:00:48 2010 -0500 +Date: Sat Jan 30 00:00:48 2010 -0500 gvarianttype: fix a trivial missing const - glib/gvarianttype.c | 2 +- + glib/gvarianttype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 1d55cfb51e03f4ba23191df4625ca62d3624652e Author: Ryan Lortie -Date: Fri Jan 29 23:56:04 2010 -0500 +Date: Fri Jan 29 23:56:04 2010 -0500 don't #include from other public headers fix up some problems that were hidden by that - glib/glib.symbols | 6 ++++-- - glib/gtestutils.c | 1 + - glib/gtestutils.h | 6 +++++- - glib/gurifuncs.c | 1 + - glib/gurifuncs.h | 2 +- - glib/gvarianttype.c | 1 + + glib/glib.symbols | 6 ++++-- + glib/gtestutils.c | 1 + + glib/gtestutils.h | 6 +++++- + glib/gurifuncs.c | 1 + + glib/gurifuncs.h | 2 +- + glib/gvarianttype.c | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) commit 71b14dedd8fa7b141e1496ba0b727996f6808579 Author: Claude Paroz -Date: Fri Jan 29 22:52:58 2010 +0100 +Date: Fri Jan 29 22:52:58 2010 +0100 Updated French translation @@ -4154,7 +29129,7 @@ Date: Fri Jan 29 22:52:58 2010 +0100 commit a4f5a3705b7df850cac0313853f8f95b5cfe24df Author: Andre Klapper -Date: Fri Jan 29 22:33:06 2010 +0100 +Date: Fri Jan 29 22:33:06 2010 +0100 Update POTFILES.in to make l10n.gnome.org happy @@ -4163,35 +29138,35 @@ Date: Fri Jan 29 22:33:06 2010 +0100 commit 6aa73f03eb14188b71b91c647442488e776a4952 Author: Ryan Lortie -Date: Thu Jan 28 22:43:51 2010 -0500 +Date: Thu Jan 28 22:43:51 2010 -0500 improve gitignore - .gitignore | 3 +++ - glib/.gitignore | 4 ++++ - gmodule/.gitignore | 1 + - gobject/.gitignore | 1 + - gthread/.gitignore | 1 + - po/.gitignore | 1 + - tests/.gitignore | 2 ++ + .gitignore | 3 +++ + glib/.gitignore | 4 ++++ + gmodule/.gitignore | 1 + + gobject/.gitignore | 1 + + gthread/.gitignore | 1 + + po/.gitignore | 1 + + tests/.gitignore | 2 ++ 7 files changed, 13 insertions(+), 0 deletions(-) commit c73d2818432956aaedb12886ea0011847b7d030e Author: Ryan Lortie -Date: Thu Jan 28 22:36:48 2010 -0500 +Date: Thu Jan 28 22:36:48 2010 -0500 GHash: move docs from tmpl to inline comments - docs/reference/glib/tmpl/.gitignore | 1 + + docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/hash_tables.sgml | 489 ----------------------------- - glib/ghash.c | 114 +++++++ - glib/ghash.h | 17 +- + glib/ghash.c | 114 +++++++ + glib/ghash.h | 17 +- 4 files changed, 130 insertions(+), 491 deletions(-) commit fe89b2ea293cbcd02de2cba1834e03eee0190cdc Author: Ryan Lortie -Date: Thu Jan 28 19:12:55 2010 -0500 +Date: Thu Jan 28 19:12:55 2010 -0500 Since: markers for g_bit_*lock() @@ -4200,7 +29175,7 @@ Date: Thu Jan 28 19:12:55 2010 -0500 commit 40eae351b1a95626f49ea042e5f5e9824c171c50 Author: Ryan Lortie -Date: Thu Jan 28 18:41:19 2010 -0500 +Date: Thu Jan 28 18:41:19 2010 -0500 Bug 548967 - 1 bit mutex lock: add tests @@ -4210,18 +29185,18 @@ Date: Thu Jan 28 18:41:19 2010 -0500 with futex support. - configure.in | 1 + - glib/gbitlock.c | 4 ++ - gthread/Makefile.am | 3 + - gthread/tests/.gitignore | 2 + + configure.in | 1 + + glib/gbitlock.c | 4 ++ + gthread/Makefile.am | 3 + + gthread/tests/.gitignore | 2 + gthread/tests/1bit-mutex.c | 127 ++++++++++++++++++++++++++++++++++++++++++++ - gthread/tests/Makefile.am | 15 +++++ + gthread/tests/Makefile.am | 15 +++++ 6 files changed, 152 insertions(+), 0 deletions(-) commit 669b0f2d6b5ef3a4924a1402d569c4e38e4fb41c Author: Ryan Lortie -Date: Thu Jan 28 11:32:07 2010 -0500 +Date: Thu Jan 28 11:32:07 2010 -0500 Bug 548967 - 1 bit mutex lock @@ -4231,25 +29206,25 @@ Date: Thu Jan 28 11:32:07 2010 -0500 (at a higher cost) on systems that don't have it -- but only in the contended case. - configure.in | 26 +++ + configure.in | 26 +++ docs/reference/glib/glib-sections.txt | 5 + - glib/Makefile.am | 2 + - glib/gbitlock.c | 292 + glib/Makefile.am | 2 + + glib/gbitlock.c | 292 +++++++++++++++++++++++++++++++++ - glib/gbitlock.h | 43 +++++ - glib/glib.h | 1 + - glib/glib.symbols | 8 + - glib/gthread.c | 1 + - glib/gthreadprivate.h | 1 + + glib/gbitlock.h | 43 +++++ + glib/glib.h | 1 + + glib/glib.symbols | 8 + + glib/gthread.c | 1 + + glib/gthreadprivate.h | 1 + 9 files changed, 379 insertions(+), 0 deletions(-) commit 595cad2531ac8bb4a4954337931134cb304088df Author: Ryan Lortie -Date: Thu Jan 28 12:39:46 2010 -0500 +Date: Thu Jan 28 12:39:46 2010 -0500 glib docs: Delete and ignore empty .tmpl files - docs/reference/glib/tmpl/.gitignore | 4 + + docs/reference/glib/tmpl/.gitignore | 4 + docs/reference/glib/tmpl/ghostutils.sgml | 64 ------------------ docs/reference/glib/tmpl/gurifuncs.sgml | 104 ------------------------------ @@ -4257,7 +29232,7 @@ Date: Thu Jan 28 12:39:46 2010 -0500 commit b0a0ac51cb7e628f90b8293c098a6a1a26425301 Author: Ryan Lortie -Date: Wed Jan 27 21:30:26 2010 -0500 +Date: Wed Jan 27 21:30:26 2010 -0500 Return NULL from g_mapped_file_get_contents() @@ -4265,13 +29240,13 @@ Date: Wed Jan 27 21:30:26 2010 -0500 that the return result of g_mapped_file_get_contents() will always be page-aligned. - README.in | 5 +++++ - glib/gmappedfile.c | 6 ++++-- + README.in | 5 +++++ + glib/gmappedfile.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) commit 2a19bb7699c13e6d7cc5761d9285617e6b2b51f7 Author: Matej Urbančič -Date: Wed Jan 27 13:16:13 2010 +0100 +Date: Wed Jan 27 13:16:13 2010 +0100 Updated Slovenian translation @@ -4281,17 +29256,17 @@ Date: Wed Jan 27 13:16:13 2010 +0100 commit 082ff883b64ca39a197b7fccb520f0b5fa707e8a Author: Behdad Esfahbod -Date: Tue Jan 26 16:12:20 2010 -0500 +Date: Tue Jan 26 16:12:20 2010 -0500 Improve type documentation - docs/reference/glib/tmpl/types.sgml | 31 + docs/reference/glib/tmpl/types.sgml | 31 +++++++++++++++++++------------ 1 files changed, 19 insertions(+), 12 deletions(-) commit 7d6af08777d4762ec17bfe8a4fa6eb83ba8d6f36 Author: Christian Dywan -Date: Tue Jan 26 20:45:40 2010 +0100 +Date: Tue Jan 26 20:45:40 2010 +0100 Add gtk-doc comments with Since tags to GMemoryOutputStream properties @@ -4300,29 +29275,29 @@ Date: Tue Jan 26 20:45:40 2010 +0100 commit b0d2f344a68abcc14558c0363ffbe5bfdcba2a66 Author: Javier Jardón -Date: Tue Jan 26 19:15:48 2010 +0100 +Date: Tue Jan 26 19:15:48 2010 +0100 [glib/gvarianttype] Move some documentation to header file Also, change G_VARIANT_TYPE(str) for G_VARIANT_TYPE(type_string) so It's correctly documented now. - glib/gvarianttype.c | 23 ----------------------- - glib/gvarianttype.h | 30 ++++++++++++++++++++++++++---- + glib/gvarianttype.c | 23 ----------------------- + glib/gvarianttype.h | 30 ++++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 27 deletions(-) commit 3c66490503534eccdd9d3082684ca5c9abf89c0c Author: Javier Jardón -Date: Tue Jan 26 19:00:41 2010 +0100 +Date: Tue Jan 26 19:00:41 2010 +0100 [glib/gvariantype] Added missing "Since: 2.24" tag - glib/gvarianttype.c | 2 ++ + glib/gvarianttype.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) commit 3658727cfa0eca8c66bc2cdff46992099caf0acd Author: Martin Pitt -Date: Tue Jan 26 11:22:31 2010 +0100 +Date: Tue Jan 26 11:22:31 2010 +0100 always use our own internal assertion message symbol @@ -4337,15 +29312,15 @@ Date: Tue Jan 26 11:22:31 2010 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=594872 - configure.in | 14 -------------- - glib/gtestutils.c | 26 +++++++++----------------- - tests/Makefile.am | 2 +- + configure.in | 14 -------------- + glib/gtestutils.c | 26 +++++++++----------------- + tests/Makefile.am | 2 +- tests/run-assert-msg-test.sh | 17 +++++------------ 4 files changed, 15 insertions(+), 44 deletions(-) commit e84a3f824855419c361ebc9f2e04768f96c6f3b9 Author: Matthias Clasen -Date: Mon Jan 25 14:16:09 2010 -0500 +Date: Mon Jan 25 14:16:09 2010 -0500 Bump version @@ -4354,135 +29329,135 @@ Date: Mon Jan 25 14:16:09 2010 -0500 commit 079c980ecabf42ee9d0a061f9a11b078c6394225 Author: Matthias Clasen -Date: Mon Jan 25 14:14:14 2010 -0500 +Date: Mon Jan 25 14:14:14 2010 -0500 2.23.2 - po/am.po | 42 +- - po/ar.po | 45 ++- - po/as.po | 45 ++- - po/ast.po | 1355 + po/am.po | 42 +- + po/ar.po | 45 ++- + po/as.po | 45 ++- + po/ast.po | 1355 ++++++++++++++++++++++++++--------------------------- - po/az.po | 42 +- - po/be.po | 42 +- + po/az.po | 42 +- + po/be.po | 42 +- po/be@latin.po | 45 ++- - po/bg.po | 921 ++++++++++++++++++------------------ - po/bn.po | 1256 + po/bg.po | 921 ++++++++++++++++++------------------ + po/bn.po | 1256 +++++++++++++++++++++++-------------------------- - po/bn_IN.po | 45 ++- - po/bs.po | 42 +- - po/ca.po | 45 ++- + po/bn_IN.po | 45 ++- + po/bs.po | 42 +- + po/ca.po | 45 ++- po/ca@valencia.po | 45 ++- - po/cs.po | 45 ++- - po/cy.po | 42 +- - po/da.po | 45 ++- - po/de.po | 45 ++- - po/dz.po | 42 +- - po/el.po | 45 ++- - po/en@shaw.po | 45 ++- - po/en_CA.po | 45 ++- - po/en_GB.po | 45 ++- - po/eo.po | 42 +- - po/es.po | 929 ++++++++++++++++++------------------ - po/et.po | 484 +++++++++++++++++++- - po/eu.po | 996 ++++++++++++++++++++------------------- - po/fa.po | 42 +- - po/fi.po | 45 ++- - po/fr.po | 45 ++- - po/ga.po | 42 +- - po/gl.po | 45 ++- - po/gu.po | 45 ++- - po/he.po | 45 ++- - po/hi.po | 45 ++- - po/hr.po | 42 +- - po/hu.po | 45 ++- - po/hy.po | 42 +- - po/id.po | 42 +- - po/is.po | 42 +- - po/it.po | 45 ++- - po/ja.po | 45 ++- - po/ka.po | 42 +- - po/kn.po | 45 ++- - po/ko.po | 45 ++- - po/ku.po | 42 +- - po/lt.po | 45 ++- - po/lv.po | 42 +- - po/mai.po | 45 ++- - po/mg.po | 42 +- - po/mk.po | 45 ++- - po/ml.po | 45 ++- - po/mn.po | 42 +- - po/mr.po | 45 ++- - po/ms.po | 42 +- - po/nb.po | 925 ++++++++++++++++++------------------ - po/ne.po | 42 +- - po/nl.po | 45 ++- - po/nn.po | 45 ++- - po/oc.po | 42 +- - po/or.po | 45 ++- - po/pa.po | 45 ++- - po/pl.po | 45 ++- - po/ps.po | 42 +- - po/pt.po | 45 ++- - po/pt_BR.po | 45 ++- - po/ro.po | 45 ++- - po/ru.po | 45 ++- - po/rw.po | 42 +- - po/si.po | 42 +- - po/sk.po | 42 +- - po/sl.po | 45 ++- - po/sq.po | 47 ++- - po/sr.po | 45 ++- - po/sr@ije.po | 42 +- + po/cs.po | 45 ++- + po/cy.po | 42 +- + po/da.po | 45 ++- + po/de.po | 45 ++- + po/dz.po | 42 +- + po/el.po | 45 ++- + po/en@shaw.po | 45 ++- + po/en_CA.po | 45 ++- + po/en_GB.po | 45 ++- + po/eo.po | 42 +- + po/es.po | 929 ++++++++++++++++++------------------ + po/et.po | 484 +++++++++++++++++++- + po/eu.po | 996 ++++++++++++++++++++------------------- + po/fa.po | 42 +- + po/fi.po | 45 ++- + po/fr.po | 45 ++- + po/ga.po | 42 +- + po/gl.po | 45 ++- + po/gu.po | 45 ++- + po/he.po | 45 ++- + po/hi.po | 45 ++- + po/hr.po | 42 +- + po/hu.po | 45 ++- + po/hy.po | 42 +- + po/id.po | 42 +- + po/is.po | 42 +- + po/it.po | 45 ++- + po/ja.po | 45 ++- + po/ka.po | 42 +- + po/kn.po | 45 ++- + po/ko.po | 45 ++- + po/ku.po | 42 +- + po/lt.po | 45 ++- + po/lv.po | 42 +- + po/mai.po | 45 ++- + po/mg.po | 42 +- + po/mk.po | 45 ++- + po/ml.po | 45 ++- + po/mn.po | 42 +- + po/mr.po | 45 ++- + po/ms.po | 42 +- + po/nb.po | 925 ++++++++++++++++++------------------ + po/ne.po | 42 +- + po/nl.po | 45 ++- + po/nn.po | 45 ++- + po/oc.po | 42 +- + po/or.po | 45 ++- + po/pa.po | 45 ++- + po/pl.po | 45 ++- + po/ps.po | 42 +- + po/pt.po | 45 ++- + po/pt_BR.po | 45 ++- + po/ro.po | 45 ++- + po/ru.po | 45 ++- + po/rw.po | 42 +- + po/si.po | 42 +- + po/sk.po | 42 +- + po/sl.po | 45 ++- + po/sq.po | 47 ++- + po/sr.po | 45 ++- + po/sr@ije.po | 42 +- po/sr@latin.po | 45 ++- - po/sv.po | 1323 + po/sv.po | 1323 ++++++++++++++++++++++++++-------------------------- - po/ta.po | 45 ++- - po/te.po | 45 ++- - po/th.po | 45 ++- - po/tl.po | 42 +- - po/tr.po | 45 ++- - po/tt.po | 42 +- - po/uk.po | 939 +++++++++++++++++++------------------ - po/vi.po | 45 ++- - po/wa.po | 42 +- - po/xh.po | 42 +- - po/yi.po | 42 +- - po/zh_CN.po | 45 ++- - po/zh_HK.po | 45 ++- - po/zh_TW.po | 45 ++- + po/ta.po | 45 ++- + po/te.po | 45 ++- + po/th.po | 45 ++- + po/tl.po | 42 +- + po/tr.po | 45 ++- + po/tt.po | 42 +- + po/uk.po | 939 +++++++++++++++++++------------------ + po/vi.po | 45 ++- + po/wa.po | 42 +- + po/xh.po | 42 +- + po/yi.po | 42 +- + po/zh_CN.po | 45 ++- + po/zh_HK.po | 45 ++- + po/zh_TW.po | 45 ++- 90 files changed, 7008 insertions(+), 5674 deletions(-) commit 975aea7bce39a2909607c6c40c2c0c945169b0c6 Author: Matthias Clasen -Date: Mon Jan 25 14:13:48 2010 -0500 +Date: Mon Jan 25 14:13:48 2010 -0500 Disable yet another failing test that was recently added... - tests/Makefile.am | 2 +- + tests/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit f13804f68e37c597533644e671d38229e80b917a Author: Matthias Clasen -Date: Mon Jan 25 12:46:35 2010 -0500 +Date: Mon Jan 25 12:46:35 2010 -0500 Minor docs update - docs/reference/gio/gio-sections.txt | 1 + + docs/reference/gio/gio-sections.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit bc4f3904f27652b844f9786ba2b243a5ea3368b5 Author: Matthias Clasen -Date: Mon Jan 25 12:43:10 2010 -0500 +Date: Mon Jan 25 12:43:10 2010 -0500 Another few failing tests disabled - gio/tests/filter-streams.c | 2 ++ + gio/tests/filter-streams.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) commit 305c9c6de5436b35fc3929d4c4ff3f29c00d8678 Author: Matthias Clasen -Date: Mon Jan 25 12:29:09 2010 -0500 +Date: Mon Jan 25 12:29:09 2010 -0500 Disable a failing test, tsk, tsk. @@ -4491,7 +29466,7 @@ Date: Mon Jan 25 12:29:09 2010 -0500 commit 81f186d1e55621622fc3a29f43522a8d5494edde Author: Matthias Clasen -Date: Mon Jan 25 12:00:06 2010 -0500 +Date: Mon Jan 25 12:00:06 2010 -0500 Mention GVariant @@ -4500,7 +29475,7 @@ Date: Mon Jan 25 12:00:06 2010 -0500 commit e0d1124bd9bc516daaa84c94fee39decf9acc1d8 Author: Matthias Clasen -Date: Mon Jan 25 11:57:47 2010 -0500 +Date: Mon Jan 25 11:57:47 2010 -0500 Updates @@ -4509,19 +29484,19 @@ Date: Mon Jan 25 11:57:47 2010 -0500 commit b4c0b10658bb77f14005a117d5abdb620fec4068 Author: Ryan Lortie -Date: Mon Jan 25 11:31:56 2010 -0500 +Date: Mon Jan 25 11:31:56 2010 -0500 add testcase for GVariantType - glib/tests/.gitignore | 1 + - glib/tests/Makefile.am | 3 + + glib/tests/.gitignore | 1 + + glib/tests/Makefile.am | 3 + glib/tests/gvarianttype.c | 650 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 654 insertions(+), 0 deletions(-) commit 0ccb288da103890dcf89ceda75fb8b488077a1de Author: Ryan Lortie -Date: Mon Jan 25 11:26:27 2010 -0500 +Date: Mon Jan 25 11:26:27 2010 -0500 merge GVariantType @@ -4529,17 +29504,17 @@ Date: Mon Jan 25 11:26:27 2010 -0500 docs/reference/glib/glib-docs.sgml | 1 + docs/reference/glib/glib-sections.txt | 68 ++ - glib/Makefile.am | 2 + - glib/glib.h | 1 + - glib/glib.symbols | 34 + - glib/gvarianttype.c | 1495 + glib/Makefile.am | 2 + + glib/glib.h | 1 + + glib/glib.symbols | 34 + + glib/gvarianttype.c | 1495 +++++++++++++++++++++++++++++++++ - glib/gvarianttype.h | 282 +++++++ + glib/gvarianttype.h | 282 +++++++ 7 files changed, 1883 insertions(+), 0 deletions(-) commit 11d4e59712b5a19c9847facf6da79946c9bd24aa Author: Benjamin Otte -Date: Wed Jan 20 21:06:30 2010 +0100 +Date: Wed Jan 20 21:06:30 2010 +0100 Move the boxed private type data to TypeNode @@ -4549,16 +29524,16 @@ Date: Wed Jan 20 21:06:30 2010 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=554887 - gobject/Makefile.am | 5 ++- - gobject/gboxed.c | 72 + gobject/Makefile.am | 5 ++- + gobject/gboxed.c | 72 +++------------------------------------------- gobject/gtype-private.h | 41 ++++++++++++++++++++++++++ - gobject/gtype.c | 45 +++++++++++++++++++++++++++++ + gobject/gtype.c | 45 +++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 68 deletions(-) commit ac666d2ae35b86c0d92ae70a0fb77b9df91035d1 Author: Benjamin Otte -Date: Wed Jan 20 20:02:24 2010 +0100 +Date: Wed Jan 20 20:02:24 2010 +0100 Put calls to registered copy/free functions into separate functions @@ -4575,7 +29550,7 @@ Date: Wed Jan 20 20:02:24 2010 +0100 commit 4ecf8655b315f9da3d108356c8f39394300deae3 Author: Alexander Shopov -Date: Mon Jan 25 11:58:18 2010 +0200 +Date: Mon Jan 25 11:58:18 2010 +0200 Updated Bulgarian translation @@ -4585,7 +29560,7 @@ Date: Mon Jan 25 11:58:18 2010 +0200 commit d819c8e486c9aaa2602d93fdd5cd1743d5a46624 Author: Matthias Clasen -Date: Sun Jan 24 20:50:51 2010 -0500 +Date: Sun Jan 24 20:50:51 2010 -0500 Typo fixes @@ -4594,7 +29569,7 @@ Date: Sun Jan 24 20:50:51 2010 -0500 commit cd59feff775e3cf9b15190dd6d75c4e6b98336e8 Author: Jamil Ahmed -Date: Sun Jan 24 22:54:12 2010 +0600 +Date: Sun Jan 24 22:54:12 2010 +0600 Updated Bengali translation @@ -4604,7 +29579,7 @@ Date: Sun Jan 24 22:54:12 2010 +0600 commit e71dcb204e3be3c0129c0782f3b5420be47fb2ef Author: Ryan Lortie -Date: Sat Jan 23 01:07:46 2010 -0500 +Date: Sat Jan 23 01:07:46 2010 -0500 gio: .gitignore gio-querymodules @@ -4613,7 +29588,7 @@ Date: Sat Jan 23 01:07:46 2010 -0500 commit c8fc3112f910b544ace0e1cb14d47555b38be6d8 Author: Ryan Lortie -Date: Fri Jan 22 20:18:58 2010 -0500 +Date: Fri Jan 22 20:18:58 2010 -0500 Bug 448888 - don't init g_slice for always-malloc @@ -4622,7 +29597,7 @@ Date: Fri Jan 22 20:18:58 2010 -0500 commit 7693b0af445645f09e55ed7cebe0051c3d1fdd8d Author: Alberto Garcia -Date: Wed Jan 20 18:53:08 2010 +0100 +Date: Wed Jan 20 18:53:08 2010 +0100 [tests] Remove C++ style comments @@ -4633,14 +29608,14 @@ Date: Wed Jan 20 18:53:08 2010 +0100 Signed-off-by: Javier Jardón - gobject/tests/threadtests.c | 8 ++++---- - tests/slice-concurrent.c | 2 +- - tests/slice-test.c | 2 +- + gobject/tests/threadtests.c | 8 ++++---- + tests/slice-concurrent.c | 2 +- + tests/slice-test.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) commit 6c3551fedb7bfde716fa00cfcbba00ca987c2a79 Author: Dan Winship -Date: Mon Jan 18 09:46:19 2010 -0500 +Date: Mon Jan 18 09:46:19 2010 -0500 [configure] More -lresolv-checking-fixing @@ -4651,7 +29626,7 @@ Date: Mon Jan 18 09:46:19 2010 -0500 commit 914120b9701650ccf7bede1907b69b521ca43236 Author: Benjamin Otte -Date: Mon Jan 18 14:03:16 2010 +0100 +Date: Mon Jan 18 14:03:16 2010 +0100 Ensure values are memset to 0 when calling G_VALUE_COLLECT_INIT() @@ -4661,14 +29636,14 @@ Date: Mon Jan 18 14:03:16 2010 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=603590 - gobject/gobject.c | 2 +- - gobject/gsignal.c | 4 ++-- - gobject/gvaluecollector.h | 3 +-- + gobject/gobject.c | 2 +- + gobject/gsignal.c | 4 ++-- + gobject/gvaluecollector.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) commit 956b3b507d03b6d10f8bef34b3775a409c5ba9ee Author: Dan Winship -Date: Wed Jan 13 11:24:28 2010 -0500 +Date: Wed Jan 13 11:24:28 2010 -0500 [configure] Fix res_query check for OS X @@ -4680,20 +29655,20 @@ Date: Wed Jan 13 11:24:28 2010 -0500 commit a6ab4b78725f6376c04f7fb2eb6cbf9a56387253 Author: Javier Jardón -Date: Tue Nov 17 21:15:15 2009 +0100 +Date: Tue Nov 17 21:15:15 2009 +0100 Upgrade to version 0.8 of libasyncns Fixes https://bugzilla.gnome.org/show_bug.cgi?id=602240 - gio/libasyncns/asyncns.c | 94 + gio/libasyncns/asyncns.c | 94 +++++++++++++++++++++++++++----------------- - gio/libasyncns/g-asyncns.h | 16 +------ + gio/libasyncns/g-asyncns.h | 16 +------ 2 files changed, 61 insertions(+), 49 deletions(-) commit fe23567c436612e7a167c1681d6cb69392769fb7 Author: Inaki Larranaga Murgoitio -Date: Wed Jan 13 17:29:39 2010 +0100 +Date: Wed Jan 13 17:29:39 2010 +0100 Updated Basque language @@ -4703,7 +29678,7 @@ Date: Wed Jan 13 17:29:39 2010 +0100 commit b577c207a5279667801c44d8f1d9469ca431478b Author: Kjartan Maraas -Date: Wed Jan 13 16:20:56 2010 +0100 +Date: Wed Jan 13 16:20:56 2010 +0100 Updated Norwegian bokmål translation @@ -4713,7 +29688,7 @@ Date: Wed Jan 13 16:20:56 2010 +0100 commit 7448eb71c3ac85a08c8f0fceaf9747e6298ae5c9 Author: Sven Herzberg -Date: Wed Jan 13 14:47:58 2010 +0100 +Date: Wed Jan 13 14:47:58 2010 +0100 properly abort instead of looping infinitely @@ -4726,34 +29701,34 @@ Date: Wed Jan 13 14:47:58 2010 +0100 size left * tests/array-test.c: reproduce the error condition of the bug report - glib/garray.c | 18 ++++++++++-------- + glib/garray.c | 18 ++++++++++-------- glib/tests/array-test.c | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) commit 820181a5de46da070d7792128fe148b51fc79a20 Author: Alexander Larsson -Date: Wed Jan 13 10:25:52 2010 +0100 +Date: Wed Jan 13 10:25:52 2010 +0100 Fix docs in previous commit - gobject/gvaluecollector.h | 4 ++-- + gobject/gvaluecollector.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 3c5e1fd903ce18efe51672074e01d1637c4bc0b2 Author: Alexander Larsson -Date: Wed Jan 13 10:24:09 2010 +0100 +Date: Wed Jan 13 10:24:09 2010 +0100 Remove additional thread support in performance test We're always enabling threads now so this is not needed. - tests/gobject/performance.c | 6 ------ + tests/gobject/performance.c | 6 ------ tests/gobject/run-performance.sh | 3 +-- 2 files changed, 1 insertions(+), 8 deletions(-) commit 40bf3aa5d2fd9d2aa6244ce8023ad1eed3bf0383 Author: Edward Hervey -Date: Wed Dec 2 11:50:02 2009 +0100 +Date: Wed Dec 2 11:50:02 2009 +0100 gobject: Use new G_VALUE_COLLECT_INIT variant @@ -4769,7 +29744,7 @@ Date: Wed Dec 2 11:50:02 2009 +0100 commit 0f25115ffc887110993f6947f9907a85374933d3 Author: Edward Hervey -Date: Wed Dec 2 11:49:49 2009 +0100 +Date: Wed Dec 2 11:49:49 2009 +0100 gsignal: Use new G_VALUE_COLLECT_INIT variant @@ -4786,7 +29761,7 @@ Date: Wed Dec 2 11:49:49 2009 +0100 commit 546fc0ca331c8d1b3393fe218a697b6a1a1c1072 Author: Edward Hervey -Date: Wed Dec 2 11:48:18 2009 +0100 +Date: Wed Dec 2 11:48:18 2009 +0100 gvaluecollector: Add variant of G_VALUE_COLLECT for most used cases. @@ -4805,16 +29780,16 @@ Date: Wed Dec 2 11:48:18 2009 +0100 commit 3bb404f13329dbd6c67f777e5a6d9228716ab440 Author: Alexander Larsson -Date: Tue Jan 12 21:55:15 2010 +0100 +Date: Tue Jan 12 21:55:15 2010 +0100 Mention thread changes in NEWS - README.in | 8 ++++++++ + README.in | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) commit 94b8613b5ffefadb5c82424bd1f3083ff11fa811 Author: Alexander Larsson -Date: Tue Jan 12 21:28:23 2010 +0100 +Date: Tue Jan 12 21:28:23 2010 +0100 Use unconditional thread calls in gio and gobject @@ -4826,14 +29801,14 @@ Date: Tue Jan 12 21:28:23 2010 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=606775 - configure.in | 1 + - gio/Makefile.am | 5 +++++ - gobject/Makefile.am | 5 +++++ + configure.in | 1 + + gio/Makefile.am | 5 +++++ + gobject/Makefile.am | 5 +++++ 3 files changed, 11 insertions(+), 0 deletions(-) commit de5c708e0b3d257388d3a5d09c80806d27069c88 Author: Alexander Larsson -Date: Tue Jan 12 21:26:52 2010 +0100 +Date: Tue Jan 12 21:26:52 2010 +0100 Make thread calls unconditional if G_THREADS_MANDATORY is set @@ -4849,7 +29824,7 @@ Date: Tue Jan 12 21:26:52 2010 +0100 commit fa2bced1f30f93443ef43ce8b5b1e437cd07168c Author: Alexander Larsson -Date: Tue Jan 12 21:22:45 2010 +0100 +Date: Tue Jan 12 21:22:45 2010 +0100 Enable threads in g_type_init() @@ -4868,15 +29843,15 @@ Date: Tue Jan 12 21:22:45 2010 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=606775 docs/reference/glib/tmpl/threads.sgml | 8 ++++++++ - gobject-2.0-uninstalled.pc.in | 2 +- - gobject-2.0.pc.in | 2 +- - gobject/Makefile.am | 2 +- - gobject/gtype.c | 9 ++++++++- + gobject-2.0-uninstalled.pc.in | 2 +- + gobject-2.0.pc.in | 2 +- + gobject/Makefile.am | 2 +- + gobject/gtype.c | 9 ++++++++- 5 files changed, 19 insertions(+), 4 deletions(-) commit 0df3ca8f9bbb624b219ecdb25d3fe8aa4a51d953 Author: Alexander Larsson -Date: Tue Jan 12 21:16:59 2010 +0100 +Date: Tue Jan 12 21:16:59 2010 +0100 Relax g_thread_init() requirements @@ -4893,12 +29868,12 @@ Date: Tue Jan 12 21:16:59 2010 +0100 docs/reference/glib/tmpl/threads.sgml | 55 +++++++++++--------------------- - gthread/gthread-impl.c | 7 +++- + gthread/gthread-impl.c | 7 +++- 2 files changed, 25 insertions(+), 37 deletions(-) commit 74ad124cfba3278c385d177a527f19574fda9670 Author: Alexander Larsson -Date: Tue Jan 12 13:09:10 2010 +0100 +Date: Tue Jan 12 13:09:10 2010 +0100 Implement lazy loading of fam plugin @@ -4908,7 +29883,7 @@ Date: Tue Jan 12 13:09:10 2010 +0100 commit 57b771235e8e548ba3bb68a49ae4f016072ee89f Author: Alexander Larsson -Date: Tue Jan 12 13:11:22 2010 +0100 +Date: Tue Jan 12 13:11:22 2010 +0100 Add gio-querymodule program @@ -4916,14 +29891,14 @@ Date: Tue Jan 12 13:11:22 2010 +0100 with giomodules in order to support lazy module loading. - gio/Makefile.am | 10 ++++ + gio/Makefile.am | 10 ++++ gio/gio-querymodules.c | 133 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 0 deletions(-) commit 682b3da99b1766b3dda0ee5978040e11108e063c Author: Alexander Larsson -Date: Tue Jan 12 11:57:17 2010 +0100 +Date: Tue Jan 12 11:57:17 2010 +0100 Use the new lazy loading of modules for gio modules @@ -4932,7 +29907,7 @@ Date: Tue Jan 12 11:57:17 2010 +0100 commit 488bede191081f035f24f7c3e55a86bc8ee2d7ae Author: Alexander Larsson -Date: Tue Jan 12 11:36:12 2010 +0100 +Date: Tue Jan 12 11:36:12 2010 +0100 Add support for lazy loading of giomodules @@ -4955,7 +29930,7 @@ Date: Tue Jan 12 11:36:12 2010 +0100 commit 6aa1aef5562b2db9777ad17183427dbbb88599b2 Author: Ignacio Casal Quinteiro -Date: Tue Jan 12 12:54:49 2010 +0100 +Date: Tue Jan 12 12:54:49 2010 +0100 Flush gcharsetconverter when needed. @@ -4967,7 +29942,7 @@ Date: Tue Jan 12 12:54:49 2010 +0100 commit f4ccd96ea1a137eb0c533f177ff87290a84ee0d5 Author: Kamal Mostafa -Date: Fri Jan 1 20:36:28 2010 -0800 +Date: Fri Jan 1 20:36:28 2010 -0800 g_object_new(): skip varargs for simple calls @@ -4975,12 +29950,12 @@ Date: Fri Jan 1 20:36:28 2010 -0800 with no properties. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=605883 - gobject/gobject.c | 4 ++++ + gobject/gobject.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) commit 8c293b0ae0f3d7a404b3249872a1591313467b4f Author: Daniel Nylander -Date: Sat Jan 9 16:43:35 2010 +0100 +Date: Sat Jan 9 16:43:35 2010 +0100 Updated Swedish translation @@ -4990,7 +29965,7 @@ Date: Sat Jan 9 16:43:35 2010 +0100 commit e61fed47b39265056dc2f9f5c3c5a6fc14bc0bf2 Author: Jorge González -Date: Thu Jan 7 20:26:48 2010 +0100 +Date: Thu Jan 7 20:26:48 2010 +0100 Updated Spanish translation @@ -5000,37 +29975,37 @@ Date: Thu Jan 7 20:26:48 2010 +0100 commit 37716bd00a7911de545ebca3dc7a248503eaf46e Author: Hiroyuki Ikezoe -Date: Thu Jan 7 19:33:39 2010 +0900 +Date: Thu Jan 7 19:33:39 2010 +0900 Use GCC atomic builtin operations. Fix for bug #531902. - configure.in | 211 + configure.in | 211 ++++++++++++++++++++++++++++------------------------ - glib/Makefile.am | 8 ++- - glib/gatomic-gcc.c | 92 +++++++++++++++++++++++ + glib/Makefile.am | 8 ++- + glib/gatomic-gcc.c | 92 +++++++++++++++++++++++ 3 files changed, 214 insertions(+), 97 deletions(-) commit 7211f7f8eb6845b010f45dd9084f67f80af40412 Author: Stefan Kost -Date: Thu Jan 7 10:47:20 2010 +0200 +Date: Thu Jan 7 10:47:20 2010 +0200 docs: switch to xi:inbclude for the content to save some more seconds docs/reference/gobject/gobject-docs.sgml | 77 +++------- docs/reference/gobject/tut_gobject.xml | 3 + docs/reference/gobject/tut_gsignal.xml | 3 + - docs/reference/gobject/tut_gtype.xml | 5 +- - docs/reference/gobject/tut_howto.xml | 21 ++- - docs/reference/gobject/tut_intro.xml | 3 + - docs/reference/gobject/tut_tools.xml | 221 + docs/reference/gobject/tut_gtype.xml | 5 +- + docs/reference/gobject/tut_howto.xml | 21 ++- + docs/reference/gobject/tut_intro.xml | 3 + + docs/reference/gobject/tut_tools.xml | 221 +++++++++++++++-------------- 7 files changed, 163 insertions(+), 170 deletions(-) commit 00db5238d9cdd1034f39749cac2d7b18df4b231c Author: Stefan Kost -Date: Thu Jan 7 11:31:24 2010 +0200 +Date: Thu Jan 7 11:31:24 2010 +0200 docs: switch to xi:inbclude for the content to save some more seconds @@ -5047,7 +30022,7 @@ Date: Thu Jan 7 11:31:24 2010 +0200 commit d01e2527ce59b5daac2b63a6ac0074cbec8bebe5 Author: Stefan Kost -Date: Thu Jan 7 10:22:14 2010 +0200 +Date: Thu Jan 7 10:22:14 2010 +0200 docs: use xi:include to use the generated indexes if available. @@ -5055,8 +30030,8 @@ Date: Thu Jan 7 10:22:14 2010 +0200 (>=1.11) and significantly improves the build time. - docs/reference/gio/gio-docs.xml | 19 ++++++--- - docs/reference/glib/glib-docs.sgml | 62 + docs/reference/gio/gio-docs.xml | 19 ++++++--- + docs/reference/glib/glib-docs.sgml | 62 ++++++++++++++++++----------- docs/reference/gobject/gobject-docs.sgml | 54 ++++++++++++++++---------- @@ -5064,7 +30039,7 @@ Date: Thu Jan 7 10:22:14 2010 +0200 commit 4c55b45162a3a76ca6c1d1c450ea667eeb7bae44 Author: Haakon Sporsheim -Date: Thu Jan 7 10:12:13 2010 +0200 +Date: Thu Jan 7 10:12:13 2010 +0200 Don't do pointer arithmetics on void* @@ -5077,21 +30052,21 @@ Date: Thu Jan 7 10:12:13 2010 +0200 commit 759fbac7b765e3ef3df4e64e534c99d45526bdd3 Author: Matthias Clasen -Date: Wed Jan 6 17:37:11 2010 -0500 +Date: Wed Jan 6 17:37:11 2010 -0500 Add properties to GMemoryOutputStream This helps bindings. Patch by Krzysztof Kosiński. See bug 605733. - gio/gmemoryoutputstream.c | 308 + gio/gmemoryoutputstream.c | 308 +++++++++++++++++++++++++++----------- - gio/gmemoryoutputstream.h | 6 +- + gio/gmemoryoutputstream.h | 6 +- gio/tests/memory-output-stream.c | 37 +++++ 3 files changed, 260 insertions(+), 91 deletions(-) commit f2d8f6287d6e3fcb9e58402c2051d557f7e41632 Author: Matthias Clasen -Date: Wed Jan 6 13:23:48 2010 -0500 +Date: Wed Jan 6 13:23:48 2010 -0500 Fix the filename roundtrip check @@ -5103,7 +30078,7 @@ Date: Wed Jan 6 13:23:48 2010 -0500 commit baf20e09842a97c2d7925dff5ff9c6d35e36b27d Author: Ryan Lortie -Date: Tue Jan 5 18:49:23 2010 -0500 +Date: Tue Jan 5 18:49:23 2010 -0500 GUnixFDMessage: fix a small typo in an extra check @@ -5121,7 +30096,7 @@ Date: Tue Jan 5 18:49:23 2010 -0500 commit b00c6d7fb5798b4e528554e1221a553ab95506ed Author: Matthias Clasen -Date: Tue Jan 5 18:18:55 2010 -0500 +Date: Tue Jan 5 18:18:55 2010 -0500 Fix a memleak @@ -5133,18 +30108,18 @@ Date: Tue Jan 5 18:18:55 2010 -0500 commit 6cee86a3efc98333282218f8eb1e0149a7cd703d Author: Matthias Clasen -Date: Tue Jan 5 18:16:37 2010 -0500 +Date: Tue Jan 5 18:16:37 2010 -0500 Fix an off-by-one error Reported by Steve Grubb. - gio/gcontenttype.c | 2 +- + gio/gcontenttype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 95889d19275fd0f8f47f6c7f0e5b37861aa28497 Author: Maxim V. Dziumanenko -Date: Tue Jan 5 16:53:01 2010 +0200 +Date: Tue Jan 5 16:53:01 2010 +0200 Update Ukrainian translation @@ -5154,7 +30129,7 @@ Date: Tue Jan 5 16:53:01 2010 +0200 commit e8ccfd1bb2e17037d54440290b718bd19567a2e4 Author: Haakon Sporsheim -Date: Tue Jan 5 11:28:43 2010 +0200 +Date: Tue Jan 5 11:28:43 2010 +0200 Avoid compilation warning from MSVC @@ -5165,7 +30140,7 @@ Date: Tue Jan 5 11:28:43 2010 +0200 commit d13c552dafe93e819e9c17bb68f46c33c9e97b10 Author: Piotr Eljasiak -Date: Tue Jan 5 00:48:02 2010 +0100 +Date: Tue Jan 5 00:48:02 2010 +0100 Fix a typo in the docs @@ -5174,16 +30149,16 @@ Date: Tue Jan 5 00:48:02 2010 +0100 commit c4600066a60e4ade006eeba196e560232f26116a Author: Xandru Armesto Fernandez -Date: Mon Jan 4 22:10:47 2010 +0100 +Date: Mon Jan 4 22:10:47 2010 +0100 Added asturian language - po/LINGUAS | 1 + + po/LINGUAS | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit 4655e85081f1fe62a0dd01342dab2109d2979b16 Author: Xandru Armesto Fernandez -Date: Mon Jan 4 22:10:29 2010 +0100 +Date: Mon Jan 4 22:10:29 2010 +0100 Updated asturian translations @@ -5193,7 +30168,7 @@ Date: Mon Jan 4 22:10:29 2010 +0100 commit 3f5fb1ee9c2e3c09bc21913f02c1797550acdcea Author: Javier Jardón -Date: Sun Jan 3 23:34:26 2010 +0100 +Date: Sun Jan 3 23:34:26 2010 +0100 [docs] Fix @title usage in "Enumeration and flags types" section @@ -5202,7 +30177,7 @@ Date: Sun Jan 3 23:34:26 2010 +0100 commit a91514ba1946ee048d9b2ddb049bc7dff5998940 Author: Matthias Clasen -Date: Sat Jan 2 19:50:55 2010 -0500 +Date: Sat Jan 2 19:50:55 2010 -0500 Document that various functions ref GSimpleAsyncResult @@ -5214,41 +30189,41 @@ Date: Sat Jan 2 19:50:55 2010 -0500 commit f58fa6934315bc83d57a6d63ae1f9ca08dd9731b Author: Matthias Clasen -Date: Sat Jan 2 19:44:26 2010 -0500 +Date: Sat Jan 2 19:44:26 2010 -0500 Document that _finish() must be called at most once. The patch was provided by Will Thompson in bug 602417. - gio/gasyncresult.c | 22 +++++++++++----------- + gio/gasyncresult.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) commit 74af99b860db66d6e32ed12c54016246e60be99a Author: Matthias Clasen -Date: Sat Jan 2 19:35:08 2010 -0500 +Date: Sat Jan 2 19:35:08 2010 -0500 Fix a typo ...and some whitespace fixes. Pointed out by Will Thompson in bug 602417. - gio/gasyncresult.c | 69 + gio/gasyncresult.c | 69 ++++++++++++++++++++++++++------------------------- 1 files changed, 35 insertions(+), 34 deletions(-) commit 0542e6dbf9b817a3ad4f0dbf4b85177536e11277 Author: Pablo Castellano -Date: Sun Jan 3 01:23:53 2010 +0100 +Date: Sun Jan 3 01:23:53 2010 +0100 Updated .gitignore files - glib/.gitignore | 1 + - gobject/.gitignore | 1 + + glib/.gitignore | 1 + + gobject/.gitignore | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) commit ab799115defeab7771f3cb5cd0c88eba0d73558a Author: Matthias Clasen -Date: Sat Jan 2 19:17:37 2010 -0500 +Date: Sat Jan 2 19:17:37 2010 -0500 Don't return anything from a void function @@ -5259,7 +30234,7 @@ Date: Sat Jan 2 19:17:37 2010 -0500 commit 05af612943b4f34b63e4bfcb7dc7bbab6725417b Author: Ivar Smolin -Date: Sat Jan 2 22:42:01 2010 +0200 +Date: Sat Jan 2 22:42:01 2010 +0200 Updating Estonian translation @@ -5269,7 +30244,7 @@ Date: Sat Jan 2 22:42:01 2010 +0200 commit 32f79f55ef287bf505ff434f13d79d89f3630bb2 Author: Paolo Borelli -Date: Thu Dec 31 12:42:41 2009 +0100 +Date: Thu Dec 31 12:42:41 2009 +0100 Bug 604457 - gutf8inputstream.c: increasing unknown size pointer @@ -5278,7 +30253,7 @@ Date: Thu Dec 31 12:42:41 2009 +0100 commit 73ca6f70199353c22bf2d6aa99d5cd1eaea76702 Author: Javier Jardón -Date: Mon Dec 28 02:04:01 2009 +0100 +Date: Mon Dec 28 02:04:01 2009 +0100 [docs] Fix 'Deprecated' tag on some win32 functions @@ -5290,7 +30265,7 @@ Date: Mon Dec 28 02:04:01 2009 +0100 commit 85e00d3a9433a5f83f9897c832fa00e4e0540e2c Author: Javier Jardón -Date: Thu Dec 24 05:05:21 2009 +0100 +Date: Thu Dec 24 05:05:21 2009 +0100 [docs] Fix 'Deprecated' tag in g_date_set_time() @@ -5299,7 +30274,7 @@ Date: Thu Dec 24 05:05:21 2009 +0100 commit da66897950431870390f8dc3f798e24f23ffb8c8 Author: Martin Pitt -Date: Tue Dec 22 11:09:20 2009 +0100 +Date: Tue Dec 22 11:09:20 2009 +0100 Support storing assertion messages into core dump @@ -5332,8 +30307,8 @@ Date: Tue Dec 22 11:09:20 2009 +0100 #include int main() { - g_assert(1 < 0); - return 0; + g_assert(1 < 0); + return 0; } $ ./test @@ -5346,10 +30321,10 @@ Date: Tue Dec 22 11:09:20 2009 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=594872 - configure.in | 14 ++++++++++++ - glib/gtestutils.c | 23 ++++++++++++++++++++ - tests/.gitignore | 1 + - tests/Makefile.am | 6 +++- + configure.in | 14 ++++++++++++ + glib/gtestutils.c | 23 ++++++++++++++++++++ + tests/.gitignore | 1 + + tests/Makefile.am | 6 +++- tests/assert-msg-test.c | 8 +++++++ tests/run-assert-msg-test.sh | 48 ++++++++++++++++++++++++++++++++++++++++++ @@ -5357,7 +30332,7 @@ Date: Tue Dec 22 11:09:20 2009 +0100 commit e9ab9eaff66b62c9653b90cca2eaf1d142f716a1 Author: Theppitak Karoonboonyanan -Date: Tue Dec 22 23:39:21 2009 +0700 +Date: Tue Dec 22 23:39:21 2009 +0700 Updated Thai translation. @@ -5366,18 +30341,18 @@ Date: Tue Dec 22 23:39:21 2009 +0700 commit 8202728f067c5d418f4fcc5172a990aa1c68312b Author: Tor Lillqvist -Date: Tue Dec 22 00:46:12 2009 +0200 +Date: Tue Dec 22 00:46:12 2009 +0200 Install gio-unix-2.0.pc only on Unix The gio-unix-2.0 headers are installed only on Unix anyway. - Makefile.am | 6 +++++- + Makefile.am | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) commit dba6cef3c9c29314c20a122647c23b12329025dc Author: Javier Jardón -Date: Mon Dec 21 23:04:43 2009 +0100 +Date: Mon Dec 21 23:04:43 2009 +0100 [docs] Fix G_DEFINE_INTERFACE "Since" tag @@ -5388,7 +30363,7 @@ Date: Mon Dec 21 23:04:43 2009 +0100 commit e7488ca85721b05181f699f4e8b12098077ce210 Author: Behdad Esfahbod -Date: Fri Jun 5 23:28:17 2009 -0400 +Date: Fri Jun 5 23:28:17 2009 -0400 [gobject] Grow gvalue transform array exponentially @@ -5401,7 +30376,7 @@ Date: Fri Jun 5 23:28:17 2009 -0400 commit 88261680f518c3c701154504011f778866d6dc2a Author: Matthias Clasen -Date: Mon Dec 21 10:56:03 2009 -0500 +Date: Mon Dec 21 10:56:03 2009 -0500 Bump version @@ -5410,107 +30385,107 @@ Date: Mon Dec 21 10:56:03 2009 -0500 commit d7bdc48c2618cbc6b99c161592fd59c92d28d1c8 Author: Matthias Clasen -Date: Mon Dec 21 10:54:11 2009 -0500 +Date: Mon Dec 21 10:54:11 2009 -0500 2.23.1 - po/am.po | 80 +++--- - po/ar.po | 80 +++--- - po/as.po | 80 +++--- - po/az.po | 80 +++--- - po/be.po | 80 +++--- + po/am.po | 80 +++--- + po/ar.po | 80 +++--- + po/as.po | 80 +++--- + po/az.po | 80 +++--- + po/be.po | 80 +++--- po/be@latin.po | 80 +++--- - po/bg.po | 80 +++--- - po/bn.po | 80 +++--- - po/bn_IN.po | 80 +++--- - po/bs.po | 80 +++--- - po/ca.po | 80 +++--- + po/bg.po | 80 +++--- + po/bn.po | 80 +++--- + po/bn_IN.po | 80 +++--- + po/bs.po | 80 +++--- + po/ca.po | 80 +++--- po/ca@valencia.po | 80 +++--- - po/cs.po | 80 +++--- - po/cy.po | 917 + po/cs.po | 80 +++--- + po/cy.po | 917 ++++++++++++++++++++++++++-------------------------- - po/da.po | 80 +++--- - po/de.po | 80 +++--- - po/dz.po | 80 +++--- - po/el.po | 80 +++--- - po/en@shaw.po | 80 +++--- - po/en_CA.po | 80 +++--- - po/en_GB.po | 80 +++--- - po/eo.po | 80 +++--- - po/es.po | 80 +++--- - po/et.po | 465 ++++++++++++++++++++++++++- - po/eu.po | 80 +++--- - po/fa.po | 80 +++--- - po/fi.po | 80 +++--- - po/fr.po | 80 +++--- - po/ga.po | 80 +++--- - po/gl.po | 80 +++--- - po/gu.po | 80 +++--- - po/he.po | 930 + po/da.po | 80 +++--- + po/de.po | 80 +++--- + po/dz.po | 80 +++--- + po/el.po | 80 +++--- + po/en@shaw.po | 80 +++--- + po/en_CA.po | 80 +++--- + po/en_GB.po | 80 +++--- + po/eo.po | 80 +++--- + po/es.po | 80 +++--- + po/et.po | 465 ++++++++++++++++++++++++++- + po/eu.po | 80 +++--- + po/fa.po | 80 +++--- + po/fi.po | 80 +++--- + po/fr.po | 80 +++--- + po/ga.po | 80 +++--- + po/gl.po | 80 +++--- + po/gu.po | 80 +++--- + po/he.po | 930 ++++++++++++++++++++++++++--------------------------- - po/hi.po | 80 +++--- - po/hr.po | 80 +++--- - po/hu.po | 80 +++--- - po/hy.po | 80 +++--- - po/id.po | 80 +++--- - po/is.po | 80 +++--- - po/it.po | 80 +++--- - po/ja.po | 80 +++--- - po/ka.po | 80 +++--- - po/kn.po | 80 +++--- - po/ko.po | 80 +++--- - po/ku.po | 80 +++--- - po/lt.po | 80 +++--- - po/lv.po | 80 +++--- - po/mai.po | 80 +++--- - po/mg.po | 80 +++--- - po/mk.po | 80 +++--- - po/ml.po | 80 +++--- - po/mn.po | 80 +++--- - po/mr.po | 80 +++--- - po/ms.po | 80 +++--- - po/nb.po | 917 + po/hi.po | 80 +++--- + po/hr.po | 80 +++--- + po/hu.po | 80 +++--- + po/hy.po | 80 +++--- + po/id.po | 80 +++--- + po/is.po | 80 +++--- + po/it.po | 80 +++--- + po/ja.po | 80 +++--- + po/ka.po | 80 +++--- + po/kn.po | 80 +++--- + po/ko.po | 80 +++--- + po/ku.po | 80 +++--- + po/lt.po | 80 +++--- + po/lv.po | 80 +++--- + po/mai.po | 80 +++--- + po/mg.po | 80 +++--- + po/mk.po | 80 +++--- + po/ml.po | 80 +++--- + po/mn.po | 80 +++--- + po/mr.po | 80 +++--- + po/ms.po | 80 +++--- + po/nb.po | 917 ++++++++++++++++++++++++++-------------------------- - po/ne.po | 80 +++--- - po/nl.po | 80 +++--- - po/nn.po | 80 +++--- - po/oc.po | 80 +++--- - po/or.po | 80 +++--- - po/pa.po | 80 +++--- - po/pl.po | 80 +++--- - po/ps.po | 80 +++--- - po/pt.po | 80 +++--- - po/pt_BR.po | 80 +++--- - po/ro.po | 80 +++--- - po/ru.po | 80 +++--- - po/rw.po | 80 +++--- - po/si.po | 80 +++--- - po/sk.po | 80 +++--- - po/sl.po | 80 +++--- - po/sq.po | 80 +++--- - po/sr.po | 80 +++--- - po/sr@ije.po | 80 +++--- + po/ne.po | 80 +++--- + po/nl.po | 80 +++--- + po/nn.po | 80 +++--- + po/oc.po | 80 +++--- + po/or.po | 80 +++--- + po/pa.po | 80 +++--- + po/pl.po | 80 +++--- + po/ps.po | 80 +++--- + po/pt.po | 80 +++--- + po/pt_BR.po | 80 +++--- + po/ro.po | 80 +++--- + po/ru.po | 80 +++--- + po/rw.po | 80 +++--- + po/si.po | 80 +++--- + po/sk.po | 80 +++--- + po/sl.po | 80 +++--- + po/sq.po | 80 +++--- + po/sr.po | 80 +++--- + po/sr@ije.po | 80 +++--- po/sr@latin.po | 80 +++--- - po/sv.po | 80 +++--- - po/ta.po | 80 +++--- - po/te.po | 80 +++--- - po/th.po | 80 +++--- - po/tl.po | 80 +++--- - po/tr.po | 80 +++--- - po/tt.po | 80 +++--- - po/uk.po | 80 +++--- - po/vi.po | 127 ++++---- - po/wa.po | 80 +++--- - po/xh.po | 80 +++--- - po/yi.po | 80 +++--- - po/zh_CN.po | 80 +++--- - po/zh_HK.po | 80 +++--- - po/zh_TW.po | 80 +++--- + po/sv.po | 80 +++--- + po/ta.po | 80 +++--- + po/te.po | 80 +++--- + po/th.po | 80 +++--- + po/tl.po | 80 +++--- + po/tr.po | 80 +++--- + po/tt.po | 80 +++--- + po/uk.po | 80 +++--- + po/vi.po | 127 ++++---- + po/wa.po | 80 +++--- + po/xh.po | 80 +++--- + po/yi.po | 80 +++--- + po/zh_CN.po | 80 +++--- + po/zh_HK.po | 80 +++--- + po/zh_TW.po | 80 +++--- 89 files changed, 5260 insertions(+), 4816 deletions(-) commit ad1580e516fd481eaa1c6bb9134c1c11a517e824 Author: Matthias Clasen -Date: Mon Dec 21 10:02:07 2009 -0500 +Date: Mon Dec 21 10:02:07 2009 -0500 Update release notes @@ -5519,7 +30494,7 @@ Date: Mon Dec 21 10:02:07 2009 -0500 commit 7af2609a44f26b8a6e65601fc2fa6f7453ff73c5 Author: Matthias Clasen -Date: Mon Dec 21 09:59:24 2009 -0500 +Date: Mon Dec 21 09:59:24 2009 -0500 Updates @@ -5528,7 +30503,7 @@ Date: Mon Dec 21 09:59:24 2009 -0500 commit 52405a6b5dcaa1e8e6268192760ee6e11939a3b5 Author: Iestyn Pryce -Date: Mon Dec 21 14:57:15 2009 +0000 +Date: Mon Dec 21 14:57:15 2009 +0000 Updated Welsh translation @@ -5538,16 +30513,16 @@ Date: Mon Dec 21 14:57:15 2009 +0000 commit 71d508776efc69e2ee97b424bbeb25d3ced38ac8 Author: Matthias Clasen -Date: Mon Dec 21 09:21:54 2009 -0500 +Date: Mon Dec 21 09:21:54 2009 -0500 Remove comment as well - glib/tests/option-context.c | 4 ---- + glib/tests/option-context.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) commit 7db8b92b979b2f95268d42eecf9dc7a361e6f5d1 Author: Matthias Clasen -Date: Mon Dec 21 09:11:23 2009 -0500 +Date: Mon Dec 21 09:11:23 2009 -0500 Revert the g_set_prgname change @@ -5555,13 +30530,13 @@ Date: Mon Dec 21 09:11:23 2009 -0500 all applications. See bug 563627. - glib/gutils.c | 11 ++--------- - glib/tests/option-context.c | 2 -- + glib/gutils.c | 11 ++--------- + glib/tests/option-context.c | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) commit 473fd041324931cc1267e354408475058611d740 Author: Iestyn Pryce -Date: Sun Dec 20 12:03:19 2009 +0000 +Date: Sun Dec 20 12:03:19 2009 +0000 Updated Welsh translation @@ -5571,7 +30546,7 @@ Date: Sun Dec 20 12:03:19 2009 +0000 commit ccd33a4043008f2927df6988bfe623341afb91f9 Author: Behdad Esfahbod -Date: Sat Dec 19 11:46:19 2009 +0100 +Date: Sat Dec 19 11:46:19 2009 +0100 Bug 501166 - Warning message says IA__g_type_init instead of g_type_init @@ -5581,7 +30556,7 @@ Date: Sat Dec 19 11:46:19 2009 +0100 commit 991702494946bdfcea958c6bd421b51867ea7545 Author: Javier Jardón -Date: Tue Dec 15 21:15:41 2009 +0100 +Date: Tue Dec 15 21:15:41 2009 +0100 G_DEFINE_INTERFACE_* documentation is not generated @@ -5594,38 +30569,38 @@ Date: Tue Dec 15 21:15:41 2009 +0100 commit 046e521b4f08a88c889620225faea7284356eb23 Author: Kamal Mostafa -Date: Fri Dec 18 10:34:05 2009 -0800 +Date: Fri Dec 18 10:34:05 2009 -0800 Fix typo "Performace" in gtester-report Details pop-up window - glib/gtester-report | 2 +- + glib/gtester-report | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit f74c0e257fef1b6304294d34130e74b591b14acf Author: Dan Winship -Date: Fri Dec 18 12:27:36 2009 +0100 +Date: Fri Dec 18 12:27:36 2009 +0100 update .gitignores - gio/tests/.gitignore | 26 +++++++++++++++----------- + gio/tests/.gitignore | 26 +++++++++++++++----------- gobject/tests/.gitignore | 1 + 2 files changed, 16 insertions(+), 11 deletions(-) commit 28d91b5bb6f0543c259976d8338a7b4d95054dd3 Author: Dan Winship -Date: Fri Dec 18 10:26:09 2009 +0100 +Date: Fri Dec 18 10:26:09 2009 +0100 Fix UnixWare build by not using "sa_len" as a variable name https://bugzilla.gnome.org/show_bug.cgi?id=604875 gio/gnetworkingprivate.h | 2 +- - gio/gresolver.c | 4 ++-- + gio/gresolver.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 50741f2fb2db13ef236974e676d1b6472c3aef5c Author: Nguyễn Thái Ngọc Duy -Date: Fri Dec 18 15:00:54 2009 +0700 +Date: Fri Dec 18 15:00:54 2009 +0700 vi.po: updated Vietnamese translation @@ -5635,7 +30610,7 @@ Date: Fri Dec 18 15:00:54 2009 +0700 commit 3f41e31bf974f6abaeb28264654d6b46b87b7428 Author: Gian Mario Tagliaretti -Date: Tue Dec 15 23:49:18 2009 +0100 +Date: Tue Dec 15 23:49:18 2009 +0100 Remove wrong file imports, only gio/gio.h should be included @@ -5644,7 +30619,7 @@ Date: Tue Dec 15 23:49:18 2009 +0100 commit a0bcd63304c683d54e1d55203922a58de672b8f6 Author: Tor Lillqvist -Date: Mon Dec 14 03:16:55 2009 +0200 +Date: Mon Dec 14 03:16:55 2009 +0200 Don't check for headers we include unconditionally @@ -5652,13 +30627,13 @@ Date: Mon Dec 14 03:16:55 2009 +0200 script as we include these unconditionally when building for Windows anyway. - config.h.win32.in | 3 --- - configure.in | 2 +- + config.h.win32.in | 3 --- + configure.in | 2 +- 2 files changed, 1 insertions(+), 4 deletions(-) commit 8dc200db043fb7251baed6e346a7c5542a24a7b9 Author: Tor Lillqvist -Date: Mon Dec 14 03:09:46 2009 +0200 +Date: Mon Dec 14 03:09:46 2009 +0200 Check for and use it if present @@ -5666,13 +30641,13 @@ Date: Mon Dec 14 03:09:46 2009 +0200 . config.h.win32.in | 7 +++++++ - configure.in | 2 +- + configure.in | 2 +- gio/gwin32resolver.c | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletions(-) commit cdf00a6a9b98574dd4a06779de43612b9c8fa42a Author: Paolo Borelli -Date: Tue Dec 8 17:05:09 2009 +0100 +Date: Tue Dec 8 17:05:09 2009 +0100 Add unit tests for some more methods @@ -5682,7 +30657,7 @@ Date: Tue Dec 8 17:05:09 2009 +0100 commit 4fbbe190b7cbfd271bbb18428bc103ebffa41112 Author: Alexander Larsson -Date: Mon Dec 7 22:00:51 2009 +0100 +Date: Mon Dec 7 22:00:51 2009 +0100 Remove default implementation of async filter steam ops @@ -5701,7 +30676,7 @@ Date: Mon Dec 7 22:00:51 2009 +0100 commit 8a6d5e203eb22dad7e197f33b8c7d96f72be4bea Author: Paolo Borelli -Date: Sun Dec 6 15:45:37 2009 +0100 +Date: Sun Dec 6 15:45:37 2009 +0100 Fix makefile typo @@ -5710,29 +30685,29 @@ Date: Sun Dec 6 15:45:37 2009 +0100 commit 568cd48365a8c8ffa6fc25d5282ec92de6e2ff31 Author: Paolo Borelli -Date: Sat Nov 28 23:39:48 2009 +0100 +Date: Sat Nov 28 23:39:48 2009 +0100 Add GUtf8InputStream - Bug #603270 Add a filter input stream that performs utf8 validation. - docs/reference/gio/gio-docs.xml | 1 + - docs/reference/gio/gio-sections.txt | 18 ++ - docs/reference/gio/gio.types | 1 + - gio/Makefile.am | 2 + - gio/gio.h | 1 + - gio/gio.symbols | 7 + - gio/giotypes.h | 1 + - gio/gutf8inputstream.c | 327 + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 18 ++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/gio.symbols | 7 + + gio/giotypes.h | 1 + + gio/gutf8inputstream.c | 327 +++++++++++++++++++++++++++++++++++ - gio/gutf8inputstream.h | 80 +++++++++ - gio/tests/Makefile.am | 4 + - gio/tests/utf8-input-stream.c | 252 +++++++++++++++++++++++++++ + gio/gutf8inputstream.h | 80 +++++++++ + gio/tests/Makefile.am | 4 + + gio/tests/utf8-input-stream.c | 252 +++++++++++++++++++++++++++ 11 files changed, 694 insertions(+), 0 deletions(-) commit c20280b41bc084793e2baa094dc03dc9d1d75f8b Author: Yair Hershkovitz -Date: Sun Dec 6 08:41:49 2009 +0200 +Date: Sun Dec 6 08:41:49 2009 +0200 Updated Hebrew translation @@ -5742,7 +30717,7 @@ Date: Sun Dec 6 08:41:49 2009 +0200 commit efb594b7d49e5058de621f1253671ec192eae695 Author: Kjartan Maraas -Date: Fri Dec 4 21:18:32 2009 +0100 +Date: Fri Dec 4 21:18:32 2009 +0100 Updated Norwegian bokmål translation. @@ -5752,7 +30727,7 @@ Date: Fri Dec 4 21:18:32 2009 +0100 commit 2321e5aed07154761223bb124770beba56700e41 Author: Matthew W. S. Bell -Date: Wed Dec 2 01:48:30 2009 +0100 +Date: Wed Dec 2 01:48:30 2009 +0100 Initialise variable in g_time_val_from_iso8601() @@ -5767,7 +30742,7 @@ Date: Wed Dec 2 01:48:30 2009 +0100 commit 3d8035f799f632f196d914fde02dc052b7944581 Author: Jeroen Nijhof -Date: Tue Dec 1 19:42:09 2009 +0100 +Date: Tue Dec 1 19:42:09 2009 +0100 [gio] Remove some commas at end of enumerator list @@ -5778,7 +30753,7 @@ Date: Tue Dec 1 19:42:09 2009 +0100 commit 39cd766e8ef6901c097fdf2d3148fdc952f06b0e Author: Dan Winship -Date: Tue Dec 1 10:42:58 2009 +0100 +Date: Tue Dec 1 10:42:58 2009 +0100 Use G_DEFINE_INTERFACE in gio @@ -5789,19 +30764,19 @@ Date: Tue Dec 1 10:42:58 2009 +0100 gio/gappinfo.c | 45 +------------ gio/gasyncresult.c | 44 +------------ gio/gdesktopappinfo.c | 44 +------------ - gio/gdrive.c | 175 + gio/gdrive.c | 175 ++++++++++++++++++------------------------------- - gio/gfile.c | 46 +------------ - gio/gicon.c | 44 +------------ + gio/gfile.c | 46 +------------ + gio/gicon.c | 44 +------------ gio/gloadableicon.c | 45 +------------ - gio/gmount.c | 143 ++++++++++++++-------------------------- + gio/gmount.c | 143 ++++++++++++++-------------------------- gio/gseekable.c | 38 +---------- - gio/gvolume.c | 103 ++++++++--------------------- + gio/gvolume.c | 103 ++++++++--------------------- 10 files changed, 164 insertions(+), 563 deletions(-) commit 91d96350a7eed2e2acfc0c254b6dfc4e6fe81a8b Author: Dan Winship -Date: Tue Dec 1 10:33:12 2009 +0100 +Date: Tue Dec 1 10:33:12 2009 +0100 Add G_DEFINE_INTERFACE @@ -5810,29 +30785,29 @@ Date: Tue Dec 1 10:33:12 2009 +0100 For discussion, see bug #320482 - docs/reference/gobject/gobject-sections.txt | 2 + - gobject/gtype.h | 70 + docs/reference/gobject/gobject-sections.txt | 2 + + gobject/gtype.h | 70 ++++++++++++++++++++++++++- - gobject/tests/threadtests.c | 30 ----------- + gobject/tests/threadtests.c | 30 ----------- 3 files changed, 70 insertions(+), 32 deletions(-) commit 74a970f754bbffcc9f0a3fa6dd9977a8640544c8 Author: Ryan Lortie -Date: Mon Nov 30 19:50:21 2009 -0500 +Date: Mon Nov 30 19:50:21 2009 -0500 Add byteswap macros for gsize/gssize. - configure.in | 5 ++ - docs/reference/glib/glib-sections.txt | 12 +++++ + configure.in | 5 ++ + docs/reference/glib/glib-sections.txt | 12 +++++ docs/reference/glib/tmpl/byte_order.sgml | 72 ++++++++++++++++++++++++++++++ - glib/gtypes.h | 5 ++ - glibconfig.h.win32.in | 4 ++ + glib/gtypes.h | 5 ++ + glibconfig.h.win32.in | 4 ++ 5 files changed, 98 insertions(+), 0 deletions(-) commit 2a78adc5e3f5b33e92cc55570397da24e062aa24 Author: Benjamin Otte -Date: Thu Oct 8 20:01:15 2009 +0200 +Date: Thu Oct 8 20:01:15 2009 +0200 Only add object to list new objects when it has a custom constructor @@ -5855,7 +30830,7 @@ Date: Thu Oct 8 20:01:15 2009 +0200 commit f0f32a7ef0f7ae8cdd2aa2992d2e116dd7b602fe Author: Benjamin Otte -Date: Thu Sep 24 15:04:20 2009 +0200 +Date: Thu Sep 24 15:04:20 2009 +0200 Remove more read locks usage @@ -5869,7 +30844,7 @@ Date: Thu Sep 24 15:04:20 2009 +0200 commit 5cac5c828b9d56ed0b1932deb7364d6ba926eb96 Author: Benjamin Otte -Date: Thu Sep 24 14:57:19 2009 +0200 +Date: Thu Sep 24 14:57:19 2009 +0200 Make g_type_class_peek[_static]() not take any locks @@ -5882,7 +30857,7 @@ Date: Thu Sep 24 14:57:19 2009 +0200 commit 83ee0d947d7c103e975be0fc4e62415ad7d57571 Author: Edward Hervey -Date: Thu Sep 24 13:19:46 2009 +0200 +Date: Thu Sep 24 13:19:46 2009 +0200 gobject/tests: New test for dynamic class creation/destruction @@ -5896,7 +30871,7 @@ Date: Thu Sep 24 13:19:46 2009 +0200 commit 35c376a8a6be94f6fd5c22164a5e0968f4d3e26e Author: Edward Hervey -Date: Thu Sep 24 12:42:49 2009 +0200 +Date: Thu Sep 24 12:42:49 2009 +0200 Add type_data_ref_U() and use it in g_type_class_ref() @@ -5918,7 +30893,7 @@ Date: Thu Sep 24 12:42:49 2009 +0200 commit 5160175656797fde6b301b0d832b692052b96e3e Author: Edward Hervey -Date: Thu Sep 24 12:29:25 2009 +0200 +Date: Thu Sep 24 12:29:25 2009 +0200 Reorganize g_type_class_ref() @@ -5931,7 +30906,7 @@ Date: Thu Sep 24 12:29:25 2009 +0200 commit 00a4470ad07551f3629029892b819c18d8902f2f Author: Benjamin Otte -Date: Thu Sep 24 12:26:53 2009 +0200 +Date: Thu Sep 24 12:26:53 2009 +0200 Make ClassData->init_state atomic @@ -5948,7 +30923,7 @@ Date: Thu Sep 24 12:26:53 2009 +0200 commit 4c243b1cba6e94658e68c3e4b188d0d784ed7463 Author: Edward Hervey -Date: Thu Sep 24 11:45:13 2009 +0200 +Date: Thu Sep 24 11:45:13 2009 +0200 Make type_data_unref_U not take locks in the common case @@ -5959,7 +30934,7 @@ Date: Thu Sep 24 11:45:13 2009 +0200 commit 5e7dba0501f4af4ac5427bbf1227ba5cb026cffa Author: Edward Hervey -Date: Thu Sep 24 11:38:49 2009 +0200 +Date: Thu Sep 24 11:38:49 2009 +0200 Make all accesses of Node->ref_count atomic @@ -5976,7 +30951,7 @@ Date: Thu Sep 24 11:38:49 2009 +0200 commit 2ec989902b2800d150bbb2cf6c3b6924f43ed736 Author: Edward Hervey -Date: Thu Sep 24 11:19:58 2009 +0200 +Date: Thu Sep 24 11:19:58 2009 +0200 type_data_unref_Wm => type_data_unref_U @@ -5990,7 +30965,7 @@ Date: Thu Sep 24 11:19:58 2009 +0200 commit b163759320ddfce0276b20bb453de70919aeeff3 Author: Benjamin Otte -Date: Thu Sep 24 11:16:10 2009 +0200 +Date: Thu Sep 24 11:16:10 2009 +0200 Add a NODE_REFCOUNT getter @@ -6004,7 +30979,7 @@ Date: Thu Sep 24 11:16:10 2009 +0200 commit 170423f924950728cec21a784787aa43b0be71bc Author: Edward Hervey -Date: Thu Sep 24 10:44:17 2009 +0200 +Date: Thu Sep 24 10:44:17 2009 +0200 Move setting the refcount to the end of the function @@ -6017,7 +30992,7 @@ Date: Thu Sep 24 10:44:17 2009 +0200 commit f8d24e849533e0e43cd7c9cf9a9692e4779c0472 Author: Edward Hervey -Date: Thu Sep 24 10:16:48 2009 +0200 +Date: Thu Sep 24 10:16:48 2009 +0200 Pass the TypeNode to type_data_last_unref_Wm() @@ -6032,7 +31007,7 @@ Date: Thu Sep 24 10:16:48 2009 +0200 commit 718b476c4474e5c9e973046ef555ffcb9bfd38a1 Author: Edward Hervey -Date: Thu Sep 24 10:03:14 2009 +0200 +Date: Thu Sep 24 10:03:14 2009 +0200 Move ref_count from TypeNode->data to TypeNode @@ -6043,7 +31018,7 @@ Date: Thu Sep 24 10:03:14 2009 +0200 commit 69961d27a13b2083d864884b40c861c5e97a5c12 Author: Alexander Larsson -Date: Wed Sep 9 16:42:32 2009 +0200 +Date: Wed Sep 9 16:42:32 2009 +0200 Implement O(1) interface lookups @@ -6062,7 +31037,7 @@ Date: Wed Sep 9 16:42:32 2009 +0200 commit 8f27a5e62129672f5c17b140ca854fd2307a9734 Author: Alexander Larsson -Date: Wed Sep 9 16:51:28 2009 +0200 +Date: Wed Sep 9 16:51:28 2009 +0200 Implement lock free interface lookup @@ -6096,7 +31071,7 @@ Date: Wed Sep 9 16:51:28 2009 +0200 commit 75ce4741f9a7a26098a77407de9b4cc2b985a254 Author: Alexander Larsson -Date: Wed Sep 9 16:47:44 2009 +0200 +Date: Wed Sep 9 16:47:44 2009 +0200 Add GAtomicArray for RCU-style lockless updates @@ -6110,7 +31085,7 @@ Date: Wed Sep 9 16:47:44 2009 +0200 This doesn't free things like RCU normally does, instead it pushes the memory on a free list that is reused for other atomic arrays. - gobject/Makefile.am | 3 +- + gobject/Makefile.am | 3 +- gobject/gatomicarray.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++++ gobject/gatomicarray.h | 60 +++++++++++++++++ @@ -6118,7 +31093,7 @@ Date: Wed Sep 9 16:47:44 2009 +0200 commit f55752b10cc29090550005e16e9e7f72c5c060fa Author: Ivar Smolin -Date: Mon Nov 30 13:08:18 2009 +0200 +Date: Mon Nov 30 13:08:18 2009 +0200 Updating Estonian translation @@ -6128,7 +31103,7 @@ Date: Mon Nov 30 13:08:18 2009 +0200 commit 8df6191a322d6b412448aa5618daf68c4e0ab3da Author: Matthias Clasen -Date: Mon Nov 30 00:11:10 2009 -0500 +Date: Mon Nov 30 00:11:10 2009 -0500 Bump version @@ -6137,109 +31112,109 @@ Date: Mon Nov 30 00:11:10 2009 -0500 commit 2532707ce420623acaf7f1fc0bd3670bb3a8a86b Author: Matthias Clasen -Date: Mon Nov 30 00:09:36 2009 -0500 +Date: Mon Nov 30 00:09:36 2009 -0500 2.23.0 docs/reference/glib/tmpl/glib-unused.sgml | 67 ++ - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/version.sgml | 68 -- - po/am.po | 282 ++++--- - po/ar.po | 285 ++++--- - po/as.po | 287 ++++--- - po/az.po | 282 ++++--- - po/be.po | 283 ++++--- - po/be@latin.po | 286 ++++--- - po/bg.po | 287 ++++--- - po/bn.po | 287 ++++--- - po/bn_IN.po | 287 ++++--- - po/bs.po | 282 ++++--- - po/ca.po | 917 ++++++++++---------- - po/ca@valencia.po | 285 ++++--- - po/cs.po | 287 ++++--- - po/cy.po | 282 ++++--- - po/da.po | 287 ++++--- - po/de.po | 287 ++++--- - po/dz.po | 282 ++++--- - po/el.po | 286 ++++--- - po/en@shaw.po | 966 +++++++++++---------- - po/en_CA.po | 285 ++++--- - po/en_GB.po | 287 ++++--- - po/eo.po | 282 ++++--- - po/es.po | 930 ++++++++++---------- - po/et.po | 492 +++++++++++- - po/eu.po | 287 ++++--- - po/fa.po | 282 ++++--- - po/fi.po | 287 ++++--- - po/fr.po | 287 ++++--- - po/ga.po | 282 ++++--- - po/gl.po | 941 +++++++++++---------- - po/gu.po | 287 ++++--- - po/he.po | 287 ++++--- - po/hi.po | 287 ++++--- - po/hr.po | 282 ++++--- - po/hu.po | 287 ++++--- - po/hy.po | 282 ++++--- - po/id.po | 282 ++++--- - po/is.po | 282 ++++--- - po/it.po | 287 ++++--- - po/ja.po | 287 ++++--- - po/ka.po | 282 ++++--- - po/kn.po | 287 ++++--- - po/ko.po | 287 ++++--- - po/ku.po | 282 ++++--- - po/lt.po | 285 ++++--- - po/lv.po | 282 ++++--- - po/mai.po | 285 ++++--- - po/mg.po | 282 ++++--- - po/mk.po | 285 ++++--- - po/ml.po | 287 ++++--- - po/mn.po | 282 ++++--- - po/mr.po | 287 ++++--- - po/ms.po | 282 ++++--- - po/nb.po | 943 +++++++++++---------- - po/ne.po | 282 ++++--- - po/nl.po | 285 ++++--- - po/nn.po | 285 ++++--- - po/oc.po | 282 ++++--- - po/or.po | 287 ++++--- - po/pa.po | 287 ++++--- - po/pl.po | 287 ++++--- - po/ps.po | 282 ++++--- - po/pt.po | 287 ++++--- - po/pt_BR.po | 951 +++++++++++---------- - po/ro.po | 287 ++++--- - po/ru.po | 287 ++++--- - po/rw.po | 282 ++++--- - po/si.po | 282 ++++--- - po/sk.po | 285 ++++--- - po/sl.po | 1282 + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/version.sgml | 68 -- + po/am.po | 282 ++++--- + po/ar.po | 285 ++++--- + po/as.po | 287 ++++--- + po/az.po | 282 ++++--- + po/be.po | 283 ++++--- + po/be@latin.po | 286 ++++--- + po/bg.po | 287 ++++--- + po/bn.po | 287 ++++--- + po/bn_IN.po | 287 ++++--- + po/bs.po | 282 ++++--- + po/ca.po | 917 ++++++++++---------- + po/ca@valencia.po | 285 ++++--- + po/cs.po | 287 ++++--- + po/cy.po | 282 ++++--- + po/da.po | 287 ++++--- + po/de.po | 287 ++++--- + po/dz.po | 282 ++++--- + po/el.po | 286 ++++--- + po/en@shaw.po | 966 +++++++++++---------- + po/en_CA.po | 285 ++++--- + po/en_GB.po | 287 ++++--- + po/eo.po | 282 ++++--- + po/es.po | 930 ++++++++++---------- + po/et.po | 492 +++++++++++- + po/eu.po | 287 ++++--- + po/fa.po | 282 ++++--- + po/fi.po | 287 ++++--- + po/fr.po | 287 ++++--- + po/ga.po | 282 ++++--- + po/gl.po | 941 +++++++++++---------- + po/gu.po | 287 ++++--- + po/he.po | 287 ++++--- + po/hi.po | 287 ++++--- + po/hr.po | 282 ++++--- + po/hu.po | 287 ++++--- + po/hy.po | 282 ++++--- + po/id.po | 282 ++++--- + po/is.po | 282 ++++--- + po/it.po | 287 ++++--- + po/ja.po | 287 ++++--- + po/ka.po | 282 ++++--- + po/kn.po | 287 ++++--- + po/ko.po | 287 ++++--- + po/ku.po | 282 ++++--- + po/lt.po | 285 ++++--- + po/lv.po | 282 ++++--- + po/mai.po | 285 ++++--- + po/mg.po | 282 ++++--- + po/mk.po | 285 ++++--- + po/ml.po | 287 ++++--- + po/mn.po | 282 ++++--- + po/mr.po | 287 ++++--- + po/ms.po | 282 ++++--- + po/nb.po | 943 +++++++++++---------- + po/ne.po | 282 ++++--- + po/nl.po | 285 ++++--- + po/nn.po | 285 ++++--- + po/oc.po | 282 ++++--- + po/or.po | 287 ++++--- + po/pa.po | 287 ++++--- + po/pl.po | 287 ++++--- + po/ps.po | 282 ++++--- + po/pt.po | 287 ++++--- + po/pt_BR.po | 951 +++++++++++---------- + po/ro.po | 287 ++++--- + po/ru.po | 287 ++++--- + po/rw.po | 282 ++++--- + po/si.po | 282 ++++--- + po/sk.po | 285 ++++--- + po/sl.po | 1282 +++++++++++++--------------- - po/sq.po | 288 ++++--- - po/sr.po | 287 ++++--- - po/sr@ije.po | 282 ++++--- - po/sr@latin.po | 287 ++++--- - po/sv.po | 1332 + po/sq.po | 288 ++++--- + po/sr.po | 287 ++++--- + po/sr@ije.po | 282 ++++--- + po/sr@latin.po | 287 ++++--- + po/sv.po | 1332 ++++++++++++++--------------- - po/ta.po | 287 ++++--- - po/te.po | 287 ++++--- - po/th.po | 287 ++++--- - po/tl.po | 282 ++++--- - po/tr.po | 287 ++++--- - po/tt.po | 282 ++++--- - po/uk.po | 287 ++++--- - po/vi.po | 285 ++++--- - po/wa.po | 282 ++++--- - po/xh.po | 282 ++++--- - po/yi.po | 282 ++++--- - po/zh_CN.po | 285 ++++--- - po/zh_HK.po | 287 ++++--- - po/zh_TW.po | 287 ++++--- + po/ta.po | 287 ++++--- + po/te.po | 287 ++++--- + po/th.po | 287 ++++--- + po/tl.po | 282 ++++--- + po/tr.po | 287 ++++--- + po/tt.po | 282 ++++--- + po/uk.po | 287 ++++--- + po/vi.po | 285 ++++--- + po/wa.po | 282 ++++--- + po/xh.po | 282 ++++--- + po/yi.po | 282 ++++--- + po/zh_CN.po | 285 ++++--- + po/zh_HK.po | 287 ++++--- + po/zh_TW.po | 287 ++++--- 92 files changed, 16991 insertions(+), 14691 deletions(-) commit 310e2e7291ba716755e538a6fe286a0072b39ef1 Author: Matthias Clasen -Date: Sun Nov 29 22:57:00 2009 -0500 +Date: Sun Nov 29 22:57:00 2009 -0500 More updates @@ -6248,51 +31223,51 @@ Date: Sun Nov 29 22:57:00 2009 -0500 commit 8907bfee863e969bc68de749a45f34d7f7f21699 Author: Matthias Clasen -Date: Sun Nov 29 22:54:16 2009 -0500 +Date: Sun Nov 29 22:54:16 2009 -0500 Fix up GIO docs docs/reference/gio/gio-docs.xml | 31 +++++---- docs/reference/gio/gio-sections.txt | 113 ++++++++++++++++++++++++++++++++ - docs/reference/gio/gio.types | 9 +++ - gio/fen/fen-data.c | 4 - - gio/gappinfo.h | 1 + - gio/gcharsetconverter.c | 31 +++++++++- - gio/gconverterinputstream.c | 13 ++++- - gio/gconverterinputstream.h | 2 +- - gio/gconverteroutputstream.c | 13 ++++- - gio/gconverteroutputstream.h | 2 +- - gio/gdummyfile.c | 6 -- - gio/gioenums.h | 6 +- - gio/glocaldirectorymonitor.c | 7 -- - gio/glocalfile.c | 6 -- - gio/glocalfileinputstream.c | 6 -- - gio/glocalfilemonitor.c | 7 -- - gio/gunionvolumemonitor.c | 9 +-- - gio/gunixvolume.c | 120 + docs/reference/gio/gio.types | 9 +++ + gio/fen/fen-data.c | 4 - + gio/gappinfo.h | 1 + + gio/gcharsetconverter.c | 31 +++++++++- + gio/gconverterinputstream.c | 13 ++++- + gio/gconverterinputstream.h | 2 +- + gio/gconverteroutputstream.c | 13 ++++- + gio/gconverteroutputstream.h | 2 +- + gio/gdummyfile.c | 6 -- + gio/gioenums.h | 6 +- + gio/glocaldirectorymonitor.c | 7 -- + gio/glocalfile.c | 6 -- + gio/glocalfileinputstream.c | 6 -- + gio/glocalfilemonitor.c | 7 -- + gio/gunionvolumemonitor.c | 9 +-- + gio/gunixvolume.c | 120 ++++++++++++++------------------- - gio/gunixvolumemonitor.c | 12 ---- - gio/gwin32mount.c | 2 +- - gio/gwin32volumemonitor.c | 6 +- - gio/win32/gwinhttpfile.c | 4 +- + gio/gunixvolumemonitor.c | 12 ---- + gio/gwin32mount.c | 2 +- + gio/gwin32volumemonitor.c | 6 +- + gio/win32/gwinhttpfile.c | 4 +- gio/win32/gwinhttpfileinputstream.c | 4 +- gio/win32/gwinhttpfileoutputstream.c | 4 +- - gio/win32/gwinhttpvfs.c | 2 +- + gio/win32/gwinhttpvfs.c | 2 +- 25 files changed, 261 insertions(+), 159 deletions(-) commit 80bda52b57440b66752df6aa4078e3a723b3a990 Author: Matthias Clasen -Date: Sun Nov 29 21:19:10 2009 -0500 +Date: Sun Nov 29 21:19:10 2009 -0500 Fix dynamictype test to build - tests/gobject/dynamictype.c | 3 +-- + tests/gobject/dynamictype.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) commit 06c71ba399adc22c4f327876bac50bbd1a6dfcf4 Author: Matthias Clasen -Date: Sun Nov 29 20:55:25 2009 -0500 +Date: Sun Nov 29 20:55:25 2009 -0500 Fix 'make check' in gio @@ -6303,7 +31278,7 @@ Date: Sun Nov 29 20:55:25 2009 -0500 commit a4a69df105e57a37fbb2b14275f262613aff1071 Author: Matthias Clasen -Date: Sun Nov 29 20:48:52 2009 -0500 +Date: Sun Nov 29 20:48:52 2009 -0500 Remove filter-cat from TEST_PROGS @@ -6314,7 +31289,7 @@ Date: Sun Nov 29 20:48:52 2009 -0500 commit 12939c54f93ddc61c02b592ced931fb30d797fe8 Author: Matthias Clasen -Date: Sun Nov 29 20:47:51 2009 -0500 +Date: Sun Nov 29 20:47:51 2009 -0500 Disable a broken test @@ -6322,12 +31297,12 @@ Date: Sun Nov 29 20:47:51 2009 -0500 call g_set_pgrname() more than once. Thats no longer possible (without incurring a warning that wrecks the test). - glib/tests/option-context.c | 6 ++++++ + glib/tests/option-context.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) commit 31be5a93402ca596bb1bc5d872ef437c51ac6d12 Author: David Planella -Date: Sun Nov 29 19:27:45 2009 +0100 +Date: Sun Nov 29 19:27:45 2009 +0100 Updated Catalan translations, with some corrections from Carles Ferrando @@ -6338,7 +31313,7 @@ Date: Sun Nov 29 19:27:45 2009 +0100 commit e7992b7b06df986bd36dd745a4cca2661e77f497 Author: Paolo Borelli -Date: Sun Nov 29 15:14:10 2009 +0100 +Date: Sun Nov 29 15:14:10 2009 +0100 Fix return type of g_converter_[in|out]put_stream. @@ -6353,7 +31328,7 @@ Date: Sun Nov 29 15:14:10 2009 +0100 commit bd2a9f7ebb12fde7ea4dcf38d252bfea519970e4 Author: Jorge González -Date: Sat Nov 28 13:26:38 2009 +0100 +Date: Sat Nov 28 13:26:38 2009 +0100 Updated Spanish translation @@ -6362,7 +31337,7 @@ Date: Sat Nov 28 13:26:38 2009 +0100 commit 35d440535fecaacce228089b91873afc6c5e069a Author: Matthias Clasen -Date: Sat Nov 28 01:59:12 2009 -0500 +Date: Sat Nov 28 01:59:12 2009 -0500 Updates @@ -6371,7 +31346,7 @@ Date: Sat Nov 28 01:59:12 2009 -0500 commit 43149aafe04027bf7f91abb05df64afafc5ed4c4 Author: Matthias Clasen -Date: Sat Nov 28 01:30:27 2009 -0500 +Date: Sat Nov 28 01:30:27 2009 -0500 Bump version to 2.23.0 @@ -6380,7 +31355,7 @@ Date: Sat Nov 28 01:30:27 2009 -0500 commit 92a766c74380f7511b0f0c2ea04059133ff8fd73 Author: Matej Urbančič -Date: Fri Nov 27 13:33:16 2009 +0100 +Date: Fri Nov 27 13:33:16 2009 +0100 Updated Slovenian translation @@ -6390,7 +31365,7 @@ Date: Fri Nov 27 13:33:16 2009 +0100 commit 56653e930feebd36cf36523669f3bcad59ad3dc2 Author: Jorge González -Date: Fri Nov 27 01:37:49 2009 +0100 +Date: Fri Nov 27 01:37:49 2009 +0100 Updated Spanish translation @@ -6400,7 +31375,7 @@ Date: Fri Nov 27 01:37:49 2009 +0100 commit 8586b636c7a0162f7b06e00c6a563eeaf24cab46 Author: Ryan Lortie -Date: Thu Nov 26 12:15:04 2009 -0500 +Date: Thu Nov 26 12:15:04 2009 -0500 Bug 589631 - enclose literals with double quotes @@ -6413,7 +31388,7 @@ Date: Thu Nov 26 12:15:04 2009 -0500 commit 09b1b6414b6aa001733fa7897f48970cb3cf258a Author: Christian Kellner -Date: Fri Oct 9 15:06:44 2009 +0200 +Date: Fri Oct 9 15:06:44 2009 +0200 Add "default location" support to GMount @@ -6429,7 +31404,7 @@ Date: Fri Oct 9 15:06:44 2009 +0200 commit 2b2195bf68bf68837dc9f6b4765d3716694f42b3 Author: Alexander Larsson -Date: Thu Nov 26 16:05:07 2009 +0100 +Date: Thu Nov 26 16:05:07 2009 +0100 Pass in the right device to vfs->local_file_add_info for symlinks @@ -6443,19 +31418,19 @@ Date: Thu Nov 26 16:05:07 2009 +0100 commit 96f41b62836810563c4f69ba6d053e91c638728a Author: Mures Andone -Date: Tue Nov 10 14:59:31 2009 +0200 +Date: Tue Nov 10 14:59:31 2009 +0200 Fixed bug 91 (GIO monitoring not working due to bad assert) https://bugzilla.gnome.org/show_bug.cgi?id=593856 gio/inotify/ginotifydirectorymonitor.c | 10 ++++++++-- - gio/inotify/ginotifyfilemonitor.c | 10 ++++++++-- + gio/inotify/ginotifyfilemonitor.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) commit 97db31fa14d2556a649d1d66a0dfc1792c5908d7 Author: Will Thompson -Date: Fri Nov 20 13:01:17 2009 +0000 +Date: Fri Nov 20 13:01:17 2009 +0000 Apply English pedantry to GAsyncInitable's docs @@ -6471,7 +31446,7 @@ Date: Fri Nov 20 13:01:17 2009 +0000 commit 08d33b81ee4addefa6c5fac6894111d09f90951b Author: Alexander Larsson -Date: Thu Nov 26 13:15:11 2009 +0100 +Date: Thu Nov 26 13:15:11 2009 +0100 Remove unused variable @@ -6480,7 +31455,7 @@ Date: Thu Nov 26 13:15:11 2009 +0100 commit b35fa1994d6607376136716c133dd88433706ee8 Author: Alexander Larsson -Date: Thu Nov 26 12:30:14 2009 +0100 +Date: Thu Nov 26 12:30:14 2009 +0100 Cast iface_init to GInterfaceInitFunc @@ -6488,23 +31463,23 @@ Date: Thu Nov 26 12:30:14 2009 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=508157 - gobject/gtypemodule.h | 2 +- - tests/gobject/dynamictype.c | 3 +-- + gobject/gtypemodule.h | 2 +- + tests/gobject/dynamictype.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) commit 36646f46ab07dec3d5a2ce0c9ba1932587528ca8 Author: Alexander Larsson -Date: Thu Nov 26 11:54:44 2009 +0100 +Date: Thu Nov 26 11:54:44 2009 +0100 Add test for G_IMPLEMENT_INTERFACE_DYNAMIC - tests/gobject/dynamictype.c | 53 + tests/gobject/dynamictype.c | 53 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 49 insertions(+), 4 deletions(-) commit 7d51c96e5e39e8f3b403884f286ef781f0c952d6 Author: Alexander Larsson -Date: Tue Nov 24 09:53:15 2009 +0100 +Date: Tue Nov 24 09:53:15 2009 +0100 Add G_IMPLEMENT_INTERFACE_DYNAMIC @@ -6512,14 +31487,14 @@ Date: Tue Nov 24 09:53:15 2009 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=508157 - docs/reference/gobject/gobject-sections.txt | 1 + - gobject/gtypemodule.h | 27 + docs/reference/gobject/gobject-sections.txt | 1 + + gobject/gtypemodule.h | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) commit b3156508c49f5274805de1d0d9bc5a69f43de1e9 Author: Christian Persch -Date: Sat May 24 21:00:11 2008 +0200 +Date: Sat May 24 21:00:11 2008 +0200 Add TB and PB cases to g_format_size_for_display @@ -6528,7 +31503,7 @@ Date: Sat May 24 21:00:11 2008 +0200 commit 1ffedec41f01b2cac9ecd9664cec1867e5d1ebb0 Author: Tor Lillqvist -Date: Wed Nov 25 12:57:10 2009 +0200 +Date: Wed Nov 25 12:57:10 2009 +0200 Remove fuzzy marker from header, which crashed my msgfmt @@ -6537,7 +31512,7 @@ Date: Wed Nov 25 12:57:10 2009 +0200 commit 3d7edc137e447456b7cd6b9df8b6257454c43a5d Author: Ryan Lortie -Date: Wed Nov 11 22:40:28 2009 -0500 +Date: Wed Nov 11 22:40:28 2009 -0500 Bug 601637 - add GUnixFDList @@ -6547,22 +31522,22 @@ Date: Wed Nov 11 22:40:28 2009 -0500 update docs. - docs/reference/gio/gio-docs.xml | 1 + - docs/reference/gio/gio-sections.txt | 23 ++ - docs/reference/gio/gio.types | 1 + - gio/Makefile.am | 2 + - gio/gunixfdlist.c | 391 + docs/reference/gio/gio-docs.xml | 1 + + docs/reference/gio/gio-sections.txt | 23 ++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 2 + + gio/gunixfdlist.c | 391 +++++++++++++++++++++++++++++++++++ - gio/gunixfdlist.h | 89 ++++++++ - gio/gunixfdmessage.c | 193 +++++++++++------- - gio/gunixfdmessage.h | 7 +- - gio/tests/Makefile.am | 5 +- - gio/tests/unix-fd.c | 197 ++++++++++++++++++ + gio/gunixfdlist.h | 89 ++++++++ + gio/gunixfdmessage.c | 193 +++++++++++------- + gio/gunixfdmessage.h | 7 +- + gio/tests/Makefile.am | 5 +- + gio/tests/unix-fd.c | 197 ++++++++++++++++++ 10 files changed, 835 insertions(+), 74 deletions(-) commit e5a98502be13e9f9561106577ecbc736211ca692 Author: Alexander Larsson -Date: Tue Nov 24 13:31:33 2009 +0100 +Date: Tue Nov 24 13:31:33 2009 +0100 Update gio.symbols with new functions @@ -6572,7 +31547,7 @@ Date: Tue Nov 24 13:31:33 2009 +0100 commit b7c4aa61523adfe79991051edf2d0128fd0e5222 Author: Alexander Larsson -Date: Tue Nov 24 13:31:10 2009 +0100 +Date: Tue Nov 24 13:31:10 2009 +0100 Export g_charset_converter_get_num_fallbacks in header @@ -6581,7 +31556,7 @@ Date: Tue Nov 24 13:31:10 2009 +0100 commit 2af69f4135253573ccc3a14f0cb9555bdba6ac3b Author: Alexander Larsson -Date: Tue Nov 24 13:02:05 2009 +0100 +Date: Tue Nov 24 13:02:05 2009 +0100 Fix GZlibCompressorFormat names @@ -6589,54 +31564,54 @@ Date: Tue Nov 24 13:02:05 2009 +0100 There is a real "raw" format, so rename the default and add a RAW type. - gio/gioenums.h | 8 +++++--- - gio/gzlibcompressor.c | 12 ++++++++++-- + gio/gioenums.h | 8 +++++--- + gio/gzlibcompressor.c | 12 ++++++++++-- gio/gzlibdecompressor.c | 9 +++++++-- gio/tests/filter-cat.c | 4 ++-- 4 files changed, 24 insertions(+), 9 deletions(-) commit 85501f5ffabe59ac38daf4d29990a7d5cd949c31 Author: Ryan Lortie -Date: Wed Nov 11 23:31:12 2009 -0500 +Date: Wed Nov 11 23:31:12 2009 -0500 Bug 591214 - Warnings building gcancellable.o - check for EINTR on read() and write() calls - remove unused 'priv' variable - gio/gcancellable.c | 33 ++++++++++++++++++++++++++------- + gio/gcancellable.c | 33 ++++++++++++++++++++++++++------- 1 files changed, 26 insertions(+), 7 deletions(-) commit 48e2a570439373882cf755567e1d147bc5dd50e5 Author: Ryan Lortie -Date: Fri Nov 20 12:54:35 2009 -0600 +Date: Fri Nov 20 12:54:35 2009 -0600 Bug 598712 - can't detect text file with backspace looks_like_text(): Allow '\b' to appear in text files. - gio/gcontenttype.c | 5 +++-- + gio/gcontenttype.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) commit 230745a350fea524f899c6319a7c529fd82bd377 Author: Alexander Larsson -Date: Wed Nov 18 16:07:16 2009 +0100 +Date: Wed Nov 18 16:07:16 2009 +0100 Add filter-cat test for GConverter streams - gio/tests/Makefile.am | 4 + + gio/tests/Makefile.am | 4 + gio/tests/filter-cat.c | 227 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+), 0 deletions(-) commit 92b9218cbf8cbc594c3a067b2dc09730416df85f Author: Alexander Larsson -Date: Fri Nov 20 12:04:31 2009 +0100 +Date: Fri Nov 20 12:04:31 2009 +0100 Add GZlibCompressor gio/Makefile.am | 2 + - gio/gio.h | 1 + + gio/gio.h | 1 + gio/giotypes.h | 1 + gio/gzlibcompressor.c | 316 +++++++++++++++++++++++++++++++++++++++++++++++++ @@ -6645,14 +31620,14 @@ Date: Fri Nov 20 12:04:31 2009 +0100 commit 38c3eb14e42da8ca2d55918be048cf1729591486 Author: Alexander Larsson -Date: Thu Nov 19 17:20:20 2009 +0100 +Date: Thu Nov 19 17:20:20 2009 +0100 Add GZlibDecompressor for zlib decompression - gio/Makefile.am | 2 + - gio/gio.h | 1 + - gio/gioenums.h | 15 +++ - gio/giotypes.h | 1 + + gio/Makefile.am | 2 + + gio/gio.h | 1 + + gio/gioenums.h | 15 +++ + gio/giotypes.h | 1 + gio/gzlibdecompressor.c | 292 +++++++++++++++++++++++++++++++++++++++++++++++ gio/gzlibdecompressor.h | 50 ++++++++ @@ -6660,76 +31635,76 @@ Date: Thu Nov 19 17:20:20 2009 +0100 commit 8cb1252d92e5cfea3804ef27edc01cac5b044ff3 Author: Alexander Larsson -Date: Thu Nov 19 17:16:29 2009 +0100 +Date: Thu Nov 19 17:16:29 2009 +0100 Add zlib dependency to gio Will be used by compression APIs - configure.in | 11 +++++++++++ - gio-2.0.pc.in | 1 + + configure.in | 11 +++++++++++ + gio-2.0.pc.in | 1 + gio/Makefile.am | 1 + 3 files changed, 13 insertions(+), 0 deletions(-) commit fce2873641ffe20834722ad33894c91b2e4b6c32 Author: Alexander Larsson -Date: Fri Oct 23 19:59:03 2009 +0200 +Date: Fri Oct 23 19:59:03 2009 +0200 Add test for converter streams - gio/tests/Makefile.am | 4 + + gio/tests/Makefile.am | 4 + gio/tests/converter-stream.c | 576 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 580 insertions(+), 0 deletions(-) commit 7f8991596be1f17bd71c367bef630423f0a83c35 Author: Alexander Larsson -Date: Mon Nov 23 15:03:57 2009 +0100 +Date: Mon Nov 23 15:03:57 2009 +0100 Add GConverterOutputStream This allows for conversion when saving - gio/Makefile.am | 2 + + gio/Makefile.am | 2 + gio/gconverteroutputstream.c | 595 ++++++++++++++++++++++++++++++++++++++++++ gio/gconverteroutputstream.h | 80 ++++++ - gio/gio.h | 1 + - gio/giotypes.h | 1 + + gio/gio.h | 1 + + gio/giotypes.h | 1 + 5 files changed, 679 insertions(+), 0 deletions(-) commit afe3324fcac8ea2a6b6007c938d7974aa923c0d3 Author: Alexander Larsson -Date: Mon Nov 23 15:02:50 2009 +0100 +Date: Mon Nov 23 15:02:50 2009 +0100 Add g_output_stream_is_closing Need this to check how we're flushing when closing a converter output stream. - gio/goutputstream.c | 29 ++++++++++++++++++++++++++++- - gio/goutputstream.h | 1 + + gio/goutputstream.c | 29 ++++++++++++++++++++++++++++- + gio/goutputstream.h | 1 + 2 files changed, 29 insertions(+), 1 deletions(-) commit 848e0bf760ea7326420669e90ef6675786dea702 Author: Alexander Larsson -Date: Thu Oct 22 22:50:52 2009 +0200 +Date: Thu Oct 22 22:50:52 2009 +0200 Add GConverterInputStream Read and convert data from an input stream - gio/Makefile.am | 2 + - gio/gconverterinputstream.c | 544 + gio/Makefile.am | 2 + + gio/gconverterinputstream.c | 544 +++++++++++++++++++++++++++++++++++++++++++ - gio/gconverterinputstream.h | 80 +++++++ - gio/gio.h | 1 + - gio/giotypes.h | 1 + + gio/gconverterinputstream.h | 80 +++++++ + gio/gio.h | 1 + + gio/giotypes.h | 1 + 5 files changed, 628 insertions(+), 0 deletions(-) commit 134e9bd84f6311e8b18fe69ce8df030561aa12d9 Author: Alexander Larsson -Date: Mon Nov 23 16:19:08 2009 +0100 +Date: Mon Nov 23 16:19:08 2009 +0100 Add fallback mode to GCharsetConverter @@ -6740,21 +31715,21 @@ Date: Mon Nov 23 16:19:08 2009 +0100 commit 4b8382823e0f03b59d07473f708f1892dcd743dc Author: Alexander Larsson -Date: Wed Oct 21 21:25:36 2009 +0200 +Date: Wed Oct 21 21:25:36 2009 +0200 Add GCharsetConverter - gio/Makefile.am | 2 + + gio/Makefile.am | 2 + gio/gcharsetconverter.c | 373 +++++++++++++++++++++++++++++++++++++++++++++++ gio/gcharsetconverter.h | 52 +++++++ - gio/gio.h | 1 + - gio/giotypes.h | 1 + + gio/gio.h | 1 + + gio/giotypes.h | 1 + 5 files changed, 429 insertions(+), 0 deletions(-) commit 0d86b25f91aeff168474280f4f5e03df779afc6d Author: Alexander Larsson -Date: Wed Nov 18 13:14:13 2009 +0100 +Date: Wed Nov 18 13:14:13 2009 +0100 Add GConverter interface @@ -6766,14 +31741,14 @@ Date: Wed Nov 18 13:14:13 2009 +0100 gio/gconverter.c | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ gio/gconverter.h | 94 ++++++++++++++++++++++ - gio/gio.h | 1 + + gio/gio.h | 1 + gio/gioenums.h | 34 ++++++++ gio/giotypes.h | 1 + 6 files changed, 366 insertions(+), 0 deletions(-) commit 110133135dabfb2ac829abe7bf84d95baf92a61a Author: Alexander Larsson -Date: Tue Oct 20 14:12:31 2009 +0200 +Date: Tue Oct 20 14:12:31 2009 +0200 Add G_IO_ERROR_PARTIAL_INPUT and G_IO_ERROR_INVALID_DATA errors @@ -6784,7 +31759,7 @@ Date: Tue Oct 20 14:12:31 2009 +0200 commit 04d83e8e503a07e7b4279227c8f992ddf7c6ef4e Author: Cody Russell -Date: Mon Nov 23 07:48:14 2009 -0600 +Date: Mon Nov 23 07:48:14 2009 -0600 gtester should fail even if -k is passed @@ -6793,28 +31768,28 @@ Date: Mon Nov 23 07:48:14 2009 -0600 commit 874efeb8ea7b822cfba254421e76b331815782cb Author: Vladimir Melo -Date: Mon Nov 23 08:36:06 2009 -0500 +Date: Mon Nov 23 08:36:06 2009 -0500 Updated Brazilian Portuguese translation. - po/pt_BR.po | 928 + po/pt_BR.po | 928 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 469 insertions(+), 459 deletions(-) commit 56eee6759ba04ad970d2bb356a27de13d79ea575 Author: Ryan Lortie -Date: Fri Nov 20 14:40:58 2009 -0600 +Date: Fri Nov 20 14:40:58 2009 -0600 Remove #include "glocalfile.h" from GFile It might give somebody the wrong idea. =) - gio/gfile.c | 1 - + gio/gfile.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) commit ec79146572aece95c7bc032b486e6a57015ee6e4 Author: Benjamin Otte -Date: Fri Nov 20 16:47:09 2009 +0100 +Date: Fri Nov 20 16:47:09 2009 +0100 Fix thread-safety @@ -6830,16 +31805,16 @@ Date: Fri Nov 20 16:47:09 2009 +0100 commit ba2b2bbca2b747d704ae62e99fc7d216f82111ff Author: Juan A. Suarez Romero -Date: Fri Nov 20 16:46:41 2009 +0100 +Date: Fri Nov 20 16:46:41 2009 +0100 priv variable should only be used in win32 code - gio/gcancellable.c | 44 +++++++++++++++++++++++--------------------- + gio/gcancellable.c | 44 +++++++++++++++++++++++--------------------- 1 files changed, 23 insertions(+), 21 deletions(-) commit 8e2fa44953f1f92afdb198bb3ff8b98bb4cf6699 Author: Ryan Lortie -Date: Thu Nov 19 10:19:01 2009 -0600 +Date: Thu Nov 19 10:19:01 2009 -0600 g_socket_listener_add_any_inet_port is Since 2.24 @@ -6850,7 +31825,7 @@ Date: Thu Nov 19 10:19:01 2009 -0600 commit c005878ae7e429dd51f6be3d9a22b430c8155221 Author: Ryan Lortie -Date: Mon Jun 15 14:07:13 2009 -0400 +Date: Mon Jun 15 14:07:13 2009 -0400 Bug 585566 - GSocketListener API issues @@ -6858,16 +31833,16 @@ Date: Mon Jun 15 14:07:13 2009 -0400 deal with the desired use case. - docs/reference/gio/gio-sections.txt | 1 + - gio/gio.symbols | 1 + - gio/gsocketlistener.c | 225 + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gsocketlistener.c | 225 +++++++++++++++++++++++++++++++++++ - gio/gsocketlistener.h | 3 + + gio/gsocketlistener.h | 3 + 4 files changed, 230 insertions(+), 0 deletions(-) commit 77baa70eda24be0049d09123e4b81b1f03817110 Author: Christian Dywan -Date: Thu Nov 19 09:58:43 2009 -0600 +Date: Thu Nov 19 09:58:43 2009 -0600 Bug 600550 - (...) doesn't treat arguments properly @@ -6879,7 +31854,7 @@ Date: Thu Nov 19 09:58:43 2009 -0600 commit 3257e8ebe470fce6b2eb935589f18d509336a227 Author: Vincent Untz -Date: Wed Nov 18 16:37:47 2009 -0600 +Date: Wed Nov 18 16:37:47 2009 -0600 Bug 600620 - Add g_app_info_get_display_name() @@ -6894,24 +31869,24 @@ Date: Wed Nov 18 16:37:47 2009 -0600 commit 9681d7e75f2d1296a890bfa64b3478ea7025df62 Author: Ryan Lortie -Date: Wed Nov 18 18:43:30 2009 -0600 +Date: Wed Nov 18 18:43:30 2009 -0600 Bug 595138 - GFile not robust with invalid input Improve handling of g_file_query_default_handler() when called on an invalid GFile (ie: one created with an invalid URI). - gio/gfile.c | 2 +- + gio/gfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 5d97ea298672880ee80964c07b9cf31d604c3df9 Author: Ryan Lortie -Date: Tue Nov 17 20:41:48 2009 -0600 +Date: Tue Nov 17 20:41:48 2009 -0600 Bug 600141 - Add -pthread to gmodule pkg-config It is not generally permissible to dlopen() libpthread into a program - that is not already linked with threading support. The most + that is not already linked with threading support. The most common case of this happening is when GIO opens Gvfs (which includes DBus, which links against libpthread). @@ -6922,32 +31897,32 @@ Date: Tue Nov 17 20:41:48 2009 -0600 -pthread, the best fix for the issue is to add -pthread to the gmodule pkg-config. - gmodule-2.0-uninstalled.pc.in | 4 ++-- - gmodule-2.0.pc.in | 4 ++-- - gmodule-export-2.0.pc.in | 4 ++-- + gmodule-2.0-uninstalled.pc.in | 4 ++-- + gmodule-2.0.pc.in | 4 ++-- + gmodule-export-2.0.pc.in | 4 ++-- gmodule-no-export-2.0-uninstalled.pc.in | 4 ++-- - gmodule-no-export-2.0.pc.in | 4 ++-- + gmodule-no-export-2.0.pc.in | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) commit 983a717fa6431d67ce9d765c1714f77ecb0b02fa Author: Ryan Lortie -Date: Thu Nov 12 01:37:27 2009 -0500 +Date: Thu Nov 12 01:37:27 2009 -0500 Bug 535159 - g_file_has_parent - add a g_file_has_parent() function as a wrapper around g_file_get_parent() - docs/reference/gio/gio-sections.txt | 1 + - gio/gfile.c | 43 + docs/reference/gio/gio-sections.txt | 1 + + gio/gfile.c | 43 +++++++++++++++++++++++++++++++++++ - gio/gfile.h | 2 + - gio/gio.symbols | 1 + + gio/gfile.h | 2 + + gio/gio.symbols | 1 + 4 files changed, 47 insertions(+), 0 deletions(-) commit ba0a6e1911ee581f1d651a7a05bab789c760ef3c Author: Javier Jardón -Date: Mon Nov 16 00:29:39 2009 +0100 +Date: Mon Nov 16 00:29:39 2009 +0100 Fix compilation warning: Initialize the variable @@ -6956,16 +31931,16 @@ Date: Mon Nov 16 00:29:39 2009 +0100 commit c6243026ed61698a797ce1b731760e4f0497ad97 Author: Javier Jardón -Date: Mon Nov 16 00:33:07 2009 +0100 +Date: Mon Nov 16 00:33:07 2009 +0100 Fix compilation warning: Remove unused function - gio/xdgmime/xdgmimecache.c | 1 - + gio/xdgmime/xdgmimecache.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) commit 00a331f970dfd49e1f9dc5ed3b42a9dd41d530ce Author: Javier Jardón -Date: Mon Nov 16 00:22:03 2009 +0100 +Date: Mon Nov 16 00:22:03 2009 +0100 Fix compilation warning: cast to (GCompareFunc) @@ -6974,7 +31949,7 @@ Date: Mon Nov 16 00:22:03 2009 +0100 commit 18b3ff33afad10dfac7dfdf3025313490f8313cc Author: Javier Jardón -Date: Sun Nov 15 05:51:45 2009 +0100 +Date: Sun Nov 15 05:51:45 2009 +0100 Don't mention g_utf32_to_utf8() and g_utf8_to_utf32() @@ -6989,31 +31964,31 @@ Date: Sun Nov 15 05:51:45 2009 +0100 commit 96bf69d4cc4077a986c9b2c398356e9d543d88bd Author: Javier Jardón -Date: Sun Nov 15 23:58:23 2009 +0100 +Date: Sun Nov 15 23:58:23 2009 +0100 Suggest the use of G_STRFUNC Suggest G_STRFUNC in the documentation of the deprecated functions G_GNUC_PRETTY_FUNCTION and G_GNUC_FUNCTION - docs/reference/glib/tmpl/macros_misc.sgml | 4 ++-- + docs/reference/glib/tmpl/macros_misc.sgml | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 6b7b7a76020e76370e416d794eceb99937b9ed33 Author: Ryan Lortie -Date: Wed Nov 11 23:48:06 2009 -0500 +Date: Wed Nov 11 23:48:06 2009 -0500 Bug 587300 - g_cancellable_disconnect deadlock add documentation to clarify that a deadlock is the expected case for calling this function from a signal handler - gio/gcancellable.c | 9 ++++++--- + gio/gcancellable.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) commit 3d09b8e09c07ebb3bae4074f946c5da8d643d247 Author: Ryan Lortie -Date: Wed Nov 11 23:21:48 2009 -0500 +Date: Wed Nov 11 23:21:48 2009 -0500 Bug 591216 - Warning building resolver.o @@ -7024,7 +31999,7 @@ Date: Wed Nov 11 23:21:48 2009 -0500 commit 78e8b39b49ce47a80e70319ffaf548cda177a746 Author: Ryan Lortie -Date: Wed Nov 11 22:20:11 2009 -0500 +Date: Wed Nov 11 22:20:11 2009 -0500 GSocket.receive_message: fix bogus allocation math @@ -7033,7 +32008,7 @@ Date: Wed Nov 11 22:20:11 2009 -0500 commit 409cdb8d13225125c12f7b56293b6dd397086c29 Author: Kjartan Maraas -Date: Wed Nov 11 20:09:53 2009 +0100 +Date: Wed Nov 11 20:09:53 2009 +0100 Updated Norwegian bokmål translation. @@ -7043,7 +32018,7 @@ Date: Wed Nov 11 20:09:53 2009 +0100 commit e5b20a3364b831a19b6cf99f67f803da3a6b6e6b Author: Tor Lillqvist -Date: Tue Nov 10 14:19:59 2009 +0200 +Date: Tue Nov 10 14:19:59 2009 +0200 Include all of share/gtk-doc/html to get also the gio docs @@ -7051,12 +32026,12 @@ Date: Tue Nov 10 14:19:59 2009 +0200 directories in the zip files. - glib-zip.in | 9 ++++----- + glib-zip.in | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) commit 6e86c9a6aa977331c6bd47b726aaf34398a5ad37 Author: Tor Lillqvist -Date: Tue Nov 10 01:37:13 2009 +0200 +Date: Tue Nov 10 01:37:13 2009 +0200 Avoid gcc warning about redeclaration of atexit() on MinGW @@ -7065,7 +32040,7 @@ Date: Tue Nov 10 01:37:13 2009 +0200 commit a9c4320e813aa80343ed5826c51be456a5683f5f Author: Daniel Nylander -Date: Sun Nov 8 22:04:51 2009 +0100 +Date: Sun Nov 8 22:04:51 2009 +0100 Updated Swedish translation @@ -7075,7 +32050,7 @@ Date: Sun Nov 8 22:04:51 2009 +0100 commit e9915ee7bdde49a7c6c2c0592b96f60cf31b8383 Author: Fran Diéguez -Date: Sat Nov 7 14:40:58 2009 +0100 +Date: Sat Nov 7 14:40:58 2009 +0100 Updated Galician Translation @@ -7085,7 +32060,7 @@ Date: Sat Nov 7 14:40:58 2009 +0100 commit ee116a6b1c60343aafd5b10e11798adbeed0d555 Author: Jorge González -Date: Fri Nov 6 21:51:28 2009 +0100 +Date: Fri Nov 6 21:51:28 2009 +0100 Updated Spanish translation @@ -7095,7 +32070,7 @@ Date: Fri Nov 6 21:51:28 2009 +0100 commit 6c315c77895e7e64c5dfb08cc223ff442f924e00 Author: Ivar Smolin -Date: Fri Nov 6 18:15:29 2009 +0200 +Date: Fri Nov 6 18:15:29 2009 +0200 Updating Estonian translation @@ -7104,7 +32079,7 @@ Date: Fri Nov 6 18:15:29 2009 +0200 commit fc0b5d735ed06fd09f6f6169965ea427d43c241b Author: Matej Urbančič -Date: Fri Nov 6 14:58:44 2009 +0100 +Date: Fri Nov 6 14:58:44 2009 +0100 Updated Slovenian translation @@ -7114,7 +32089,7 @@ Date: Fri Nov 6 14:58:44 2009 +0100 commit ef6117f78d036b956d3fe91f6a3748f64499f4c1 Author: Stéphane Démurget -Date: Sun Oct 25 11:14:36 2009 +0100 +Date: Sun Oct 25 11:14:36 2009 +0100 Bug 324930 - Nicer message for EPERM on symlink @@ -7130,7 +32105,7 @@ Date: Sun Oct 25 11:14:36 2009 +0100 commit 3c57a6c7ccb38efb8fb3ecf12e9f66f113ffde19 Author: Tor Lillqvist -Date: Wed Nov 4 23:59:18 2009 +0200 +Date: Wed Nov 4 23:59:18 2009 +0200 Don't call WSAEventSelect() on -1 @@ -7143,7 +32118,7 @@ Date: Wed Nov 4 23:59:18 2009 +0200 commit 0d6b1ab42a6a9026743f197f03264afdbac7fb7b Author: Paolo Bonzini -Date: Tue Nov 3 18:38:58 2009 +0200 +Date: Tue Nov 3 18:38:58 2009 +0200 Don't run system("touch conf.glibtest)" in the AM_PATH_GLIB_2_0 macro @@ -7158,7 +32133,7 @@ Date: Tue Nov 3 18:38:58 2009 +0200 commit f6276add355388738f856201c400d1c43cedcaf2 Author: Tor Lillqvist -Date: Tue Nov 3 18:21:19 2009 +0200 +Date: Tue Nov 3 18:21:19 2009 +0200 Improve descriptive comment text @@ -7167,7 +32142,7 @@ Date: Tue Nov 3 18:21:19 2009 +0200 commit 9c292a831fac91dfe17158e3379d6ef4ad351c76 Author: Hib Eris -Date: Tue Nov 3 15:06:29 2009 +0200 +Date: Tue Nov 3 15:06:29 2009 +0200 Fix check for C++ compiler when cross-compiling @@ -7178,7 +32153,7 @@ Date: Tue Nov 3 15:06:29 2009 +0200 commit b64ee1f02098d229ff16df9dfebdc3e3f3d76687 Author: Carlo Bramini -Date: Tue Nov 3 14:26:25 2009 +0200 +Date: Tue Nov 3 14:26:25 2009 +0200 Make g_file_test() behave on Windows more like as on POSIX @@ -7189,7 +32164,7 @@ Date: Tue Nov 3 14:26:25 2009 +0200 commit 22d026d34492b27a531bc60e6edc10eec1aa61be Author: Thomas Thurman -Date: Sat Oct 31 02:49:31 2009 -0400 +Date: Sat Oct 31 02:49:31 2009 -0400 Shavian translation @@ -7200,7 +32175,7 @@ Date: Sat Oct 31 02:49:31 2009 -0400 commit 4288ad76922da01d1f452c6c257e97008b16aaf0 Author: Benjamin Otte -Date: Wed Oct 28 19:18:20 2009 +0100 +Date: Wed Oct 28 19:18:20 2009 +0100 Properly nul-terminate return values from g_convert() @@ -7222,7 +32197,7 @@ Date: Wed Oct 28 19:18:20 2009 +0100 commit 5a633f82dbbce067c56fba0ee372fd341b76368d Author: Benjamin Otte -Date: Tue Oct 27 21:07:13 2009 +0100 +Date: Tue Oct 27 21:07:13 2009 +0100 Clarify documentation about g_convert() nul-terminated returns @@ -7233,16 +32208,16 @@ Date: Tue Oct 27 21:07:13 2009 +0100 commit f3fbf37dd899de5d7bd61d86bed8aada479f564a Author: Matthias Clasen -Date: Sun Oct 25 02:56:13 2009 -0400 +Date: Sun Oct 25 02:56:13 2009 -0400 Avoid a warning - gio/gfile.c | 11 +++++++---- + gio/gfile.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) commit e63262d49d40a36060613fb1d0ed468ca5dddc19 Author: Matthias Clasen -Date: Sun Oct 25 02:55:46 2009 -0400 +Date: Sun Oct 25 02:55:46 2009 -0400 Don't give up too early when collecting mime types @@ -7251,14 +32226,14 @@ Date: Sun Oct 25 02:55:46 2009 -0400 sure that we don't return the same mime type more than once. Bug 541236. - gio/xdgmime/xdgmimecache.c | 67 + gio/xdgmime/xdgmimecache.c | 67 ++++++++++++++++++++++++++++++++------------ - gio/xdgmime/xdgmimeglob.c | 43 +++++++++++++++++++++++++--- + gio/xdgmime/xdgmimeglob.c | 43 +++++++++++++++++++++++++--- 2 files changed, 87 insertions(+), 23 deletions(-) commit 3dab24828edd8ebfd6d6c8bb20c181fc0d5650a1 Author: Sven Herzberg -Date: Fri Oct 23 14:49:38 2009 +0200 +Date: Fri Oct 23 14:49:38 2009 +0200 make sure g_set_prgname() gets called only once @@ -7271,7 +32246,7 @@ Date: Fri Oct 23 14:49:38 2009 +0200 commit d105f431b0b684ed47e1c23ca283e38e522ce545 Author: Tor Lillqvist -Date: Fri Oct 23 00:46:50 2009 +0300 +Date: Fri Oct 23 00:46:50 2009 +0300 Fix GWin32DirectoryMonitor @@ -7280,13 +32255,13 @@ Date: Fri Oct 23 00:46:50 2009 +0300 GTK+ file chooser does the code get exercised in common programs like gtk-demo or GIMP, apparently. Bug #598899. - gio/win32/gwin32directorymonitor.c | 67 + gio/win32/gwin32directorymonitor.c | 67 ++++++++++++++++++++++++++--------- 1 files changed, 50 insertions(+), 17 deletions(-) commit 8eebc189440693922e23298a761189cfbe71f796 Author: Cody Russell -Date: Wed Oct 14 21:24:30 2009 -0500 +Date: Wed Oct 14 21:24:30 2009 -0500 GTypeModule derived class unref does not unload plugin @@ -7299,18 +32274,18 @@ Date: Wed Oct 14 21:24:30 2009 -0500 commit e95a3b0576fc9426441956e4053791e197d4f421 Author: Tomas Bzatek -Date: Tue Oct 13 16:21:42 2009 +0200 +Date: Tue Oct 13 16:21:42 2009 +0200 Documentation fixes - docs/reference/gio/gio-sections.txt | 1 + - gio/gfileattribute.c | 1 + - gio/gfileinfo.h | 5 +++-- + docs/reference/gio/gio-sections.txt | 1 + + gio/gfileattribute.c | 1 + + gio/gfileinfo.h | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) commit 443674faaa0c6c79492732fd56360faeca06e9ab Author: Tor Lillqvist -Date: Mon Oct 12 00:18:48 2009 +0300 +Date: Mon Oct 12 00:18:48 2009 +0300 Construct the gio module directory pathname at run-time on Windows @@ -7319,20 +32294,20 @@ Date: Mon Oct 12 00:18:48 2009 +0300 commit 2a3710872f8bfc1c95dc8044c92c9ce020adad40 Author: Alexander Larsson -Date: Thu Oct 8 11:59:23 2009 +0200 +Date: Thu Oct 8 11:59:23 2009 +0200 xdgmime: sort glob hits with larger weight first Higher weight is more important, so return these first meaning they will be used as the default. - gio/xdgmime/xdgmimecache.c | 2 +- - gio/xdgmime/xdgmimeglob.c | 2 +- + gio/xdgmime/xdgmimecache.c | 2 +- + gio/xdgmime/xdgmimeglob.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit d9b87676fa8f0340a9baa2001ae912192e12d4c6 Author: Ivar Smolin -Date: Thu Oct 8 09:56:25 2009 +0300 +Date: Thu Oct 8 09:56:25 2009 +0300 Updating Estonian translation @@ -7342,7 +32317,7 @@ Date: Thu Oct 8 09:56:25 2009 +0300 commit 3daaa459e332c62972c8792453e0a841157ecf11 Author: Matthias Clasen -Date: Wed Oct 7 10:31:19 2009 -0400 +Date: Wed Oct 7 10:31:19 2009 -0400 Bump version @@ -7351,106 +32326,106 @@ Date: Wed Oct 7 10:31:19 2009 -0400 commit f814174371cbc61404012720c49485bc4d66feba Author: Matthias Clasen -Date: Wed Oct 7 10:29:32 2009 -0400 +Date: Wed Oct 7 10:29:32 2009 -0400 2.22.2 - NEWS | 6 +- + NEWS | 6 +- build/win32/Makefile.am | 9 +- - po/am.po | 2 +- - po/ar.po | 2 +- - po/as.po | 2 +- - po/az.po | 2 +- - po/be.po | 2 +- - po/be@latin.po | 2 +- - po/bg.po | 2 +- - po/bn.po | 2 +- - po/bn_IN.po | 2 +- - po/bs.po | 2 +- - po/ca.po | 2 +- - po/ca@valencia.po | 2 +- - po/cs.po | 2 +- - po/cy.po | 2 +- - po/da.po | 2 +- - po/de.po | 2 +- - po/dz.po | 2 +- - po/el.po | 2 +- - po/en_CA.po | 2 +- - po/en_GB.po | 2 +- - po/eo.po | 2 +- - po/es.po | 2 +- - po/et.po | 2 +- - po/eu.po | 2 +- - po/fa.po | 2 +- - po/fi.po | 2 +- - po/fr.po | 2 +- - po/ga.po | 2 +- - po/gl.po | 2 +- - po/gu.po | 2 +- - po/he.po | 2 +- - po/hi.po | 2 +- - po/hr.po | 2 +- - po/hu.po | 2 +- - po/hy.po | 2 +- - po/id.po | 2 +- - po/is.po | 2 +- - po/it.po | 2 +- - po/ja.po | 2 +- - po/ka.po | 2 +- - po/kn.po | 2 +- - po/ko.po | 2 +- - po/ku.po | 2 +- - po/lt.po | 2 +- - po/lv.po | 2 +- - po/mai.po | 2 +- - po/mg.po | 2 +- - po/mk.po | 2 +- - po/ml.po | 2 +- - po/mn.po | 2 +- - po/mr.po | 2 +- - po/ms.po | 2 +- - po/nb.po | 2 +- - po/ne.po | 2 +- - po/nl.po | 2 +- - po/nn.po | 2 +- - po/oc.po | 2 +- - po/or.po | 2 +- - po/pa.po | 2 +- - po/pl.po | 2 +- - po/ps.po | 2 +- - po/pt.po | 2 +- - po/pt_BR.po | 2 +- - po/ro.po | 2 +- - po/ru.po | 909 + po/am.po | 2 +- + po/ar.po | 2 +- + po/as.po | 2 +- + po/az.po | 2 +- + po/be.po | 2 +- + po/be@latin.po | 2 +- + po/bg.po | 2 +- + po/bn.po | 2 +- + po/bn_IN.po | 2 +- + po/bs.po | 2 +- + po/ca.po | 2 +- + po/ca@valencia.po | 2 +- + po/cs.po | 2 +- + po/cy.po | 2 +- + po/da.po | 2 +- + po/de.po | 2 +- + po/dz.po | 2 +- + po/el.po | 2 +- + po/en_CA.po | 2 +- + po/en_GB.po | 2 +- + po/eo.po | 2 +- + po/es.po | 2 +- + po/et.po | 2 +- + po/eu.po | 2 +- + po/fa.po | 2 +- + po/fi.po | 2 +- + po/fr.po | 2 +- + po/ga.po | 2 +- + po/gl.po | 2 +- + po/gu.po | 2 +- + po/he.po | 2 +- + po/hi.po | 2 +- + po/hr.po | 2 +- + po/hu.po | 2 +- + po/hy.po | 2 +- + po/id.po | 2 +- + po/is.po | 2 +- + po/it.po | 2 +- + po/ja.po | 2 +- + po/ka.po | 2 +- + po/kn.po | 2 +- + po/ko.po | 2 +- + po/ku.po | 2 +- + po/lt.po | 2 +- + po/lv.po | 2 +- + po/mai.po | 2 +- + po/mg.po | 2 +- + po/mk.po | 2 +- + po/ml.po | 2 +- + po/mn.po | 2 +- + po/mr.po | 2 +- + po/ms.po | 2 +- + po/nb.po | 2 +- + po/ne.po | 2 +- + po/nl.po | 2 +- + po/nn.po | 2 +- + po/oc.po | 2 +- + po/or.po | 2 +- + po/pa.po | 2 +- + po/pl.po | 2 +- + po/ps.po | 2 +- + po/pt.po | 2 +- + po/pt_BR.po | 2 +- + po/ro.po | 2 +- + po/ru.po | 909 +++++++++++++++++++++++------------------------ - po/rw.po | 2 +- - po/si.po | 2 +- - po/sk.po | 2 +- - po/sl.po | 2 +- - po/sq.po | 2 +- - po/sr.po | 6 +- - po/sr@ije.po | 2 +- - po/sr@latin.po | 17 +- - po/sv.po | 2 +- - po/ta.po | 2 +- - po/te.po | 2 +- - po/th.po | 2 +- - po/tl.po | 2 +- - po/tr.po | 2 +- - po/tt.po | 2 +- - po/uk.po | 2 +- - po/vi.po | 2 +- - po/wa.po | 2 +- - po/xh.po | 2 +- - po/yi.po | 2 +- - po/zh_CN.po | 2 +- - po/zh_HK.po | 2 +- - po/zh_TW.po | 2 +- + po/rw.po | 2 +- + po/si.po | 2 +- + po/sk.po | 2 +- + po/sl.po | 2 +- + po/sq.po | 2 +- + po/sr.po | 6 +- + po/sr@ije.po | 2 +- + po/sr@latin.po | 17 +- + po/sv.po | 2 +- + po/ta.po | 2 +- + po/te.po | 2 +- + po/th.po | 2 +- + po/tl.po | 2 +- + po/tr.po | 2 +- + po/tt.po | 2 +- + po/uk.po | 2 +- + po/vi.po | 2 +- + po/wa.po | 2 +- + po/xh.po | 2 +- + po/yi.po | 2 +- + po/zh_CN.po | 2 +- + po/zh_HK.po | 2 +- + po/zh_TW.po | 2 +- 90 files changed, 553 insertions(+), 564 deletions(-) commit 3d76112aed79b590b79899e46610ce7b2ecffc53 Author: Matthias Clasen -Date: Wed Oct 7 09:28:19 2009 -0400 +Date: Wed Oct 7 09:28:19 2009 -0400 Updates @@ -7459,7 +32434,7 @@ Date: Wed Oct 7 09:28:19 2009 -0400 commit 855deaa5780bfef3f6e8b3a41d00d6c7e40ca406 Author: Cody Russell -Date: Tue Oct 6 12:27:12 2009 -0400 +Date: Tue Oct 6 12:27:12 2009 -0400 g_object_unref racy condition can lead to crash @@ -7475,7 +32450,7 @@ Date: Tue Oct 6 12:27:12 2009 -0400 commit afa0db59df9b28d9ae8da9539f629165cc8490f3 Author: Leonid Kanter -Date: Tue Oct 6 11:52:48 2009 +0300 +Date: Tue Oct 6 11:52:48 2009 +0300 Updated Russian translation by @@ -7485,7 +32460,7 @@ Date: Tue Oct 6 11:52:48 2009 +0300 commit 68b1ca04433846b68141a72029ed67ae117a7e94 Author: Edward Hervey -Date: Sat Oct 3 12:37:36 2009 +0200 +Date: Sat Oct 3 12:37:36 2009 +0200 gobject/gtype.h: Fix _G_TYPE_CVH macro. Fixes #597194 @@ -7496,7 +32471,7 @@ Date: Sat Oct 3 12:37:36 2009 +0200 commit 1937765f9f9052a870cfd924b18e08aa8901a8f2 Author: Alexander Larsson -Date: Wed Aug 19 17:24:16 2009 +0200 +Date: Wed Aug 19 17:24:16 2009 +0200 Add fast path for construction with no params @@ -7504,9 +32479,9 @@ Date: Wed Aug 19 17:24:16 2009 +0200 faster. Object construction performance improvement: - Non-Threaded Threaded - Simple: 14% 5% - Complex: -1.1% -2.2% + Non-Threaded Threaded + Simple: 14% 5% + Complex: -1.1% -2.2% Other tests stable. @@ -7517,7 +32492,7 @@ Date: Wed Aug 19 17:24:16 2009 +0200 commit ffc625ec9bcc4b2d34921940c07b28d244f2257a Author: Alexander Larsson -Date: Wed Aug 19 17:22:32 2009 +0200 +Date: Wed Aug 19 17:22:32 2009 +0200 Don't freeze/thaw notification during construction if no properties @@ -7525,9 +32500,9 @@ Date: Wed Aug 19 17:22:32 2009 +0200 This is an important optimization for construction of simple objects. Object construction performance improvement: - Non-Threaded Threaded - Simple: 84% 91% - Complex: -1.4% -0.6% + Non-Threaded Threaded + Simple: 84% 91% + Complex: -1.4% -0.6% Other tests stable. @@ -7538,7 +32513,7 @@ Date: Wed Aug 19 17:22:32 2009 +0200 commit 302d13a757c164346883841ce040208906894b71 Author: Alexander Larsson -Date: Fri Oct 2 19:27:48 2009 +0200 +Date: Fri Oct 2 19:27:48 2009 +0200 Add a check that no properties are added after a class is derived @@ -7551,7 +32526,7 @@ Date: Fri Oct 2 19:27:48 2009 +0200 commit 39a1fe5782c15873ab18b8d3d76adfcbd70dc6dd Author: Alexander Larsson -Date: Wed Aug 19 17:21:18 2009 +0200 +Date: Wed Aug 19 17:21:18 2009 +0200 Add GObjectClass flag CLASS_HAS_PROPS_FLAG @@ -7560,23 +32535,23 @@ Date: Wed Aug 19 17:21:18 2009 +0200 https://bugzilla.gnome.org/show_bug.cgi?id=557100 - gobject/gobject.c | 6 ++++++ + gobject/gobject.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) commit 301d52d858b8e7d4b804b893dc2f740aaa0d5aa5 Author: Alexander Larsson -Date: Wed Aug 19 17:17:41 2009 +0200 +Date: Wed Aug 19 17:17:41 2009 +0200 Add flags member for GObjectClass https://bugzilla.gnome.org/show_bug.cgi?id=557100 - gobject/gobject.h | 4 +++- + gobject/gobject.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) commit af017accc55aff3d6f28df0a41724e93fca71ff4 Author: Alexander Larsson -Date: Wed Aug 19 15:48:19 2009 +0200 +Date: Wed Aug 19 15:48:19 2009 +0200 Allocate GObjectNotifyQueue with g_slice instead of abusing g_list @@ -7584,9 +32559,9 @@ Date: Wed Aug 19 15:48:19 2009 +0200 zeroing the memory twice). Object construction performance improvement: - Non-Threaded Threaded - Simple: 11% 1.3% - Complex: 8% 6% + Non-Threaded Threaded + Simple: 11% 1.3% + Complex: 8% 6% Other tests stable. @@ -7597,21 +32572,21 @@ Date: Wed Aug 19 15:48:19 2009 +0200 commit f4d9789fcfc4c9be497414d6c65476adb9d20236 Author: Alexander Larsson -Date: Wed Sep 9 17:08:57 2009 +0200 +Date: Wed Sep 9 17:08:57 2009 +0200 Add gobject performance tests for threaded code This measures how much things like lock contention affects the gobject code. - tests/gobject/Makefile.am | 2 + + tests/gobject/Makefile.am | 2 + tests/gobject/performance-threaded.c | 381 ++++++++++++++++++++++++++++++++++ 2 files changed, 383 insertions(+), 0 deletions(-) commit b1f94af095bde6a9a695ce7b19425a62288ee0ee Author: Alexander Larsson -Date: Thu Aug 20 14:34:51 2009 +0200 +Date: Thu Aug 20 14:34:51 2009 +0200 Add performance tests for GObject primitives @@ -7656,15 +32631,15 @@ Date: Thu Aug 20 14:34:51 2009 +0200 https://bugzilla.gnome.org/show_bug.cgi?id=557100 - tests/gobject/Makefile.am | 2 + - tests/gobject/performance.c | 735 + tests/gobject/Makefile.am | 2 + + tests/gobject/performance.c | 735 ++++++++++++++++++++++++++++++++++++++ tests/gobject/run-performance.sh | 7 + 3 files changed, 744 insertions(+), 0 deletions(-) commit 07ad638adff596ccd4bc2ec003be692059210357 Author: Alexander Larsson -Date: Fri Oct 2 12:54:18 2009 +0200 +Date: Fri Oct 2 12:54:18 2009 +0200 remove xdgmime test @@ -7678,59 +32653,59 @@ Date: Fri Oct 2 12:54:18 2009 +0200 commit c7c0bcef893ca99609b102b42be5f871b9524a92 Author: Alexander Larsson -Date: Fri Oct 2 12:06:25 2009 +0200 +Date: Fri Oct 2 12:06:25 2009 +0200 xdgmime - Correct the range checks for magic matching - gio/xdgmime/xdgmimecache.c | 2 +- + gio/xdgmime/xdgmimecache.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 2624e7d6c6ddc5ad93caa7ce609092b6b54cb6d2 Author: Alexander Larsson -Date: Fri Oct 2 12:06:15 2009 +0200 +Date: Fri Oct 2 12:06:15 2009 +0200 Remove unnecessary includes - gio/xdgmime/xdgmimecache.c | 1 - - gio/xdgmime/xdgmimeglob.c | 1 - + gio/xdgmime/xdgmimecache.c | 1 - + gio/xdgmime/xdgmimeglob.c | 1 - 2 files changed, 0 insertions(+), 2 deletions(-) commit e1643fd76daf66ccffd9e6818e4f4ec8272e2a51 Author: Alexander Larsson -Date: Fri Oct 2 09:49:51 2009 +0200 +Date: Fri Oct 2 09:49:51 2009 +0200 xdgmime - support the new case sensitive flag - gio/xdgmime/xdgmimecache.c | 86 + gio/xdgmime/xdgmimecache.c | 86 +++++++++++++++++++++++++++++++++---------- - gio/xdgmime/xdgmimeglob.c | 88 + gio/xdgmime/xdgmimeglob.c | 88 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 137 insertions(+), 37 deletions(-) commit 7c27df1feeea1d6ab8b927285cecc4ac34db8b06 Author: Alexander Larsson -Date: Fri Oct 2 09:48:35 2009 +0200 +Date: Fri Oct 2 09:48:35 2009 +0200 xdgmime - support cache files with minor version 2 - gio/xdgmime/xdgmimecache.c | 10 ++++++++-- + gio/xdgmime/xdgmimecache.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) commit ce239a010e29c91f683dae354060f6ec6213e148 Author: Alexander Larsson -Date: Fri Oct 2 09:46:33 2009 +0200 +Date: Fri Oct 2 09:46:33 2009 +0200 Read the new glob2 format with case sensitive flags - gio/xdgmime/xdgmime.c | 4 +- + gio/xdgmime/xdgmime.c | 4 +- gio/xdgmime/xdgmimeglob.c | 83 ++++++++++++++++++++++++++++++++------------ - gio/xdgmime/xdgmimeglob.h | 6 ++- + gio/xdgmime/xdgmimeglob.h | 6 ++- 3 files changed, 66 insertions(+), 27 deletions(-) commit 5e4a895bb37271169cb8c055d9ce1e3efe6ca525 Author: Tor Lillqvist -Date: Fri Oct 2 12:43:21 2009 +0300 +Date: Fri Oct 2 12:43:21 2009 +0300 Drop the VS8 project files from tarballs as they are unmaintained @@ -7739,41 +32714,41 @@ Date: Fri Oct 2 12:43:21 2009 +0300 commit e5734fb87563181ee9f1f2827cb49d81e8ea28a7 Author: Pierre A. Joye -Date: Fri Oct 2 12:34:44 2009 +0300 +Date: Fri Oct 2 12:34:44 2009 +0300 Update VS9 project files to fix build From bug #596784 - build/win32/vs9/gio.vcproj | 110 + build/win32/vs9/gio.vcproj | 110 +++++++++++++++++++++++++++- - build/win32/vs9/glib.vcproj | 10 ++- - build/win32/vs9/gmodule.vcproj | 2 +- - build/win32/vs9/gobject.vcproj | 2 +- - build/win32/vs9/gspawn-win32-helper.vcproj | 2 +- - build/win32/vs9/gthread.vcproj | 2 +- - build/win32/vs9/install.vcproj | 4 +- + build/win32/vs9/glib.vcproj | 10 ++- + build/win32/vs9/gmodule.vcproj | 2 +- + build/win32/vs9/gobject.vcproj | 2 +- + build/win32/vs9/gspawn-win32-helper.vcproj | 2 +- + build/win32/vs9/gthread.vcproj | 2 +- + build/win32/vs9/install.vcproj | 4 +- 7 files changed, 122 insertions(+), 10 deletions(-) commit e9fe53980b0ce8480c483774961b93388f3a55fe Author: Matthias Clasen -Date: Tue Sep 29 23:06:45 2009 -0400 +Date: Tue Sep 29 23:06:45 2009 -0400 Fix --runtime-libdir option For stable releases, it needs to take LT_REVISION into account, not hardcode 0. - gio/Makefile.am | 4 ++-- - glib/Makefile.am | 4 ++-- - gmodule/Makefile.am | 4 ++-- - gobject/Makefile.am | 4 ++-- - gthread/Makefile.am | 4 ++-- + gio/Makefile.am | 4 ++-- + glib/Makefile.am | 4 ++-- + gmodule/Makefile.am | 4 ++-- + gobject/Makefile.am | 4 ++-- + gthread/Makefile.am | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) commit eeaf8c51209cbd11573adf6f6ba0d34f85920b1f Author: Matthias Clasen -Date: Tue Sep 29 22:07:04 2009 -0400 +Date: Tue Sep 29 22:07:04 2009 -0400 Bump version @@ -7782,105 +32757,105 @@ Date: Tue Sep 29 22:07:04 2009 -0400 commit fffc3d41bd0968c37fd3edddf35a555fe91151d3 Author: Matthias Clasen -Date: Tue Sep 29 22:05:27 2009 -0400 +Date: Tue Sep 29 22:05:27 2009 -0400 2.22.1 - po/am.po | 58 ++-- - po/ar.po | 61 ++-- - po/as.po | 61 ++-- - po/az.po | 58 ++-- - po/be.po | 59 ++-- + po/am.po | 58 ++-- + po/ar.po | 61 ++-- + po/as.po | 61 ++-- + po/az.po | 58 ++-- + po/be.po | 59 ++-- po/be@latin.po | 61 ++-- - po/bg.po | 61 ++-- - po/bn.po | 932 + po/bg.po | 61 ++-- + po/bn.po | 932 ++++++++++++++++++++++++++-------------------------- - po/bn_IN.po | 61 ++-- - po/bs.po | 58 ++-- - po/ca.po | 61 ++-- + po/bn_IN.po | 61 ++-- + po/bs.po | 58 ++-- + po/ca.po | 61 ++-- po/ca@valencia.po | 61 ++-- - po/cs.po | 61 ++-- - po/cy.po | 59 ++-- - po/da.po | 61 ++-- - po/de.po | 61 ++-- - po/dz.po | 59 ++-- - po/el.po | 61 ++-- - po/en_CA.po | 61 ++-- - po/en_GB.po | 61 ++-- - po/eo.po | 58 ++-- - po/es.po | 61 ++-- - po/et.po | 61 ++-- - po/eu.po | 61 ++-- - po/fa.po | 59 ++-- - po/fi.po | 61 ++-- - po/fr.po | 61 ++-- - po/ga.po | 60 ++-- - po/gl.po | 61 ++-- - po/gu.po | 61 ++-- - po/he.po | 937 + po/cs.po | 61 ++-- + po/cy.po | 59 ++-- + po/da.po | 61 ++-- + po/de.po | 61 ++-- + po/dz.po | 59 ++-- + po/el.po | 61 ++-- + po/en_CA.po | 61 ++-- + po/en_GB.po | 61 ++-- + po/eo.po | 58 ++-- + po/es.po | 61 ++-- + po/et.po | 61 ++-- + po/eu.po | 61 ++-- + po/fa.po | 59 ++-- + po/fi.po | 61 ++-- + po/fr.po | 61 ++-- + po/ga.po | 60 ++-- + po/gl.po | 61 ++-- + po/gu.po | 61 ++-- + po/he.po | 937 ++++++++++++++++++++++++++--------------------------- - po/hi.po | 61 ++-- - po/hr.po | 58 ++-- - po/hu.po | 61 ++-- - po/hy.po | 58 ++-- - po/id.po | 59 ++-- - po/is.po | 58 ++-- - po/it.po | 61 ++-- - po/ja.po | 61 ++-- - po/ka.po | 59 ++-- - po/kn.po | 61 ++-- - po/ko.po | 61 ++-- - po/ku.po | 58 ++-- - po/lt.po | 61 ++-- - po/lv.po | 58 ++-- - po/mai.po | 61 ++-- - po/mg.po | 59 ++-- - po/mk.po | 61 ++-- - po/ml.po | 61 ++-- - po/mn.po | 59 ++-- - po/mr.po | 61 ++-- - po/ms.po | 58 ++-- - po/nb.po | 61 ++-- - po/ne.po | 59 ++-- - po/nl.po | 61 ++-- - po/nn.po | 61 ++-- - po/oc.po | 59 ++-- - po/or.po | 61 ++-- - po/pa.po | 61 ++-- - po/pl.po | 61 ++-- - po/ps.po | 61 ++-- - po/pt.po | 61 ++-- - po/pt_BR.po | 61 ++-- - po/ro.po | 61 ++-- - po/ru.po | 61 ++-- - po/rw.po | 58 ++-- - po/si.po | 59 ++-- - po/sk.po | 60 ++-- - po/sl.po | 61 ++-- - po/sq.po | 61 ++-- - po/sr.po | 61 ++-- - po/sr@ije.po | 58 ++-- + po/hi.po | 61 ++-- + po/hr.po | 58 ++-- + po/hu.po | 61 ++-- + po/hy.po | 58 ++-- + po/id.po | 59 ++-- + po/is.po | 58 ++-- + po/it.po | 61 ++-- + po/ja.po | 61 ++-- + po/ka.po | 59 ++-- + po/kn.po | 61 ++-- + po/ko.po | 61 ++-- + po/ku.po | 58 ++-- + po/lt.po | 61 ++-- + po/lv.po | 58 ++-- + po/mai.po | 61 ++-- + po/mg.po | 59 ++-- + po/mk.po | 61 ++-- + po/ml.po | 61 ++-- + po/mn.po | 59 ++-- + po/mr.po | 61 ++-- + po/ms.po | 58 ++-- + po/nb.po | 61 ++-- + po/ne.po | 59 ++-- + po/nl.po | 61 ++-- + po/nn.po | 61 ++-- + po/oc.po | 59 ++-- + po/or.po | 61 ++-- + po/pa.po | 61 ++-- + po/pl.po | 61 ++-- + po/ps.po | 61 ++-- + po/pt.po | 61 ++-- + po/pt_BR.po | 61 ++-- + po/ro.po | 61 ++-- + po/ru.po | 61 ++-- + po/rw.po | 58 ++-- + po/si.po | 59 ++-- + po/sk.po | 60 ++-- + po/sl.po | 61 ++-- + po/sq.po | 61 ++-- + po/sr.po | 61 ++-- + po/sr@ije.po | 58 ++-- po/sr@latin.po | 61 ++-- - po/sv.po | 61 ++-- - po/ta.po | 61 ++-- - po/te.po | 61 ++-- - po/th.po | 61 ++-- - po/tl.po | 59 ++-- - po/tr.po | 61 ++-- - po/tt.po | 59 ++-- - po/uk.po | 61 ++-- - po/vi.po | 61 ++-- - po/wa.po | 58 ++-- - po/xh.po | 59 ++-- - po/yi.po | 58 ++-- - po/zh_CN.po | 61 ++-- - po/zh_HK.po | 61 ++-- - po/zh_TW.po | 61 ++-- + po/sv.po | 61 ++-- + po/ta.po | 61 ++-- + po/te.po | 61 ++-- + po/th.po | 61 ++-- + po/tl.po | 59 ++-- + po/tr.po | 61 ++-- + po/tt.po | 59 ++-- + po/uk.po | 61 ++-- + po/vi.po | 61 ++-- + po/wa.po | 58 ++-- + po/xh.po | 59 ++-- + po/yi.po | 58 ++-- + po/zh_CN.po | 61 ++-- + po/zh_HK.po | 61 ++-- + po/zh_TW.po | 61 ++-- 88 files changed, 3278 insertions(+), 3765 deletions(-) commit 82c6bf7d8c6abeda6dff80e5b754411398232cc3 Author: Matthias Clasen -Date: Tue Sep 29 21:16:53 2009 -0400 +Date: Tue Sep 29 21:16:53 2009 -0400 Updates @@ -7889,17 +32864,17 @@ Date: Tue Sep 29 21:16:53 2009 -0400 commit 0c88408218050b9a239e90d6585731aeb1a1c181 Author: Miloš Popović -Date: Wed Sep 30 03:05:31 2009 +0000 +Date: Wed Sep 30 03:05:31 2009 +0000 Updated Serbian translation - po/sr.po | 3 --- + po/sr.po | 3 --- po/sr@latin.po | 3 --- 2 files changed, 0 insertions(+), 6 deletions(-) commit b0adce8ab454c2c8e8da47019d510eac405e2452 Author: Miloš Popović -Date: Wed Sep 30 03:04:05 2009 +0000 +Date: Wed Sep 30 03:04:05 2009 +0000 Updated Serbian translation @@ -7908,11 +32883,11 @@ Date: Wed Sep 30 03:04:05 2009 +0000 commit b38f091b99adf4326001d5218d9e52bd1df8d800 Author: Miloš Popović -Date: Wed Sep 30 03:02:15 2009 +0000 +Date: Wed Sep 30 03:02:15 2009 +0000 Updated Serbian translation - po/sr.po | 279 + po/sr.po | 279 +++++++++++++++++++++++++++++--------------------------- po/sr@latin.po | 273 ++++++++++++++++++++++++++++--------------------------- @@ -7920,7 +32895,7 @@ Date: Wed Sep 30 03:02:15 2009 +0000 commit 0c652dc66e09a358c738492e0eb857fef56c6254 Author: Matthias Clasen -Date: Tue Sep 29 20:57:45 2009 -0400 +Date: Tue Sep 29 20:57:45 2009 -0400 Don't mark test files for translation @@ -7932,7 +32907,7 @@ Date: Tue Sep 29 20:57:45 2009 -0400 commit 6555e0171d6f9619b0f49109868fe99162ffbb72 Author: Matthias Clasen -Date: Tue Sep 29 20:52:26 2009 -0400 +Date: Tue Sep 29 20:52:26 2009 -0400 Fix mime_info_cache_dir_add_desktop_entries @@ -7944,7 +32919,7 @@ Date: Tue Sep 29 20:52:26 2009 -0400 commit 2f93bea177a980b8ae750c07f3b269c9bea7ac25 Author: Matthias Clasen -Date: Tue Sep 29 20:45:26 2009 -0400 +Date: Tue Sep 29 20:45:26 2009 -0400 Avoid a C99ism @@ -7956,7 +32931,7 @@ Date: Tue Sep 29 20:45:26 2009 -0400 commit 442dadf3118cf3e2e9617461eb045f61483d58fc Author: Matthias Clasen -Date: Tue Sep 29 20:39:39 2009 -0400 +Date: Tue Sep 29 20:39:39 2009 -0400 Improve docs for g_utf16_to_utf8 @@ -7968,18 +32943,18 @@ Date: Tue Sep 29 20:39:39 2009 -0400 commit 5fdb169b72b749218766e507deab491c5f5b0d9e Author: Matthias Clasen -Date: Tue Sep 29 20:33:39 2009 -0400 +Date: Tue Sep 29 20:33:39 2009 -0400 Clarify docs of g_async_result_get_source_object It returns a new reference. Reported in bug 596748 - gio/gasyncresult.c | 11 ++++++----- + gio/gasyncresult.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) commit 90e1308809805691713edf8f651e80a063f9b66f Author: Alexander Larsson -Date: Tue Sep 29 11:25:13 2009 +0200 +Date: Tue Sep 29 11:25:13 2009 +0200 Avoid critical error in thread check if source is destroyed @@ -7996,7 +32971,7 @@ Date: Tue Sep 29 11:25:13 2009 +0200 commit 10c7b3a17e00283907139a19f1c6054f85a5d3a8 Author: Jamil Ahmed -Date: Tue Sep 29 04:01:37 2009 +0700 +Date: Tue Sep 29 04:01:37 2009 +0700 Updated Bengali translation @@ -8006,7 +32981,7 @@ Date: Tue Sep 29 04:01:37 2009 +0700 commit 6f1ce483eb136159f42b7dde3aa4466ba3e874c1 Author: Alexander Larsson -Date: Mon Sep 28 15:55:44 2009 +0200 +Date: Mon Sep 28 15:55:44 2009 +0200 Always report metadata on the path, not symlink target @@ -8026,7 +33001,7 @@ Date: Mon Sep 28 15:55:44 2009 +0200 commit 70027bf0928e7960c3ff78ce4a92aaad20ee899e Author: Alexander Larsson -Date: Fri Sep 25 09:50:49 2009 +0200 +Date: Fri Sep 25 09:50:49 2009 +0200 Fix up cast in gdb macros @@ -8037,20 +33012,20 @@ Date: Fri Sep 25 09:50:49 2009 +0200 commit e657dee578cc7b70c6a33fcb626e5d5aed4d82f3 Author: Alexander Larsson -Date: Fri Sep 25 09:49:49 2009 +0200 +Date: Fri Sep 25 09:49:49 2009 +0200 Use right soname for gdb autoloaded python files We need to look at LT_REVISION too to get the right filename. This was just hardcoded to zero before which is obviously wrong. - glib/Makefile.am | 2 +- - gobject/Makefile.am | 2 +- + glib/Makefile.am | 2 +- + gobject/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 660035479bc6583abc311cd4d43136fa447a95d6 Author: Yaron Shahrabani -Date: Fri Sep 25 10:39:58 2009 +0300 +Date: Fri Sep 25 10:39:58 2009 +0300 Updated Hebrew translation @@ -8060,7 +33035,7 @@ Date: Fri Sep 25 10:39:58 2009 +0300 commit cc95c60c69af5e25e9c9eae11f68ba2436a0e6b0 Author: Matthias Clasen -Date: Thu Sep 24 10:26:46 2009 -0400 +Date: Thu Sep 24 10:26:46 2009 -0400 Fix location of gdb macros @@ -8068,14 +33043,14 @@ Date: Thu Sep 24 10:26:46 2009 -0400 location of the libraries, so we need to take the runtime-libdir path into account. - configure.in | 4 +++- - glib/Makefile.am | 4 ++-- - gobject/Makefile.am | 4 ++-- + configure.in | 4 +++- + glib/Makefile.am | 4 ++-- + gobject/Makefile.am | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) commit dcee4d4a66112a357626a6e2b1f749a24e41068a Author: Matthias Clasen -Date: Tue Sep 22 17:10:32 2009 -0400 +Date: Tue Sep 22 17:10:32 2009 -0400 Bump version @@ -8084,7 +33059,7 @@ Date: Tue Sep 22 17:10:32 2009 -0400 commit cc4970cf9426ae4c929ccd859585a29fb9d243c8 Author: Josselin Mouette -Date: Wed Sep 23 18:39:45 2009 +0200 +Date: Wed Sep 23 18:39:45 2009 +0200 Fall back to inotify_init if inotify_init1 does not work @@ -8099,7 +33074,7 @@ Date: Wed Sep 23 18:39:45 2009 +0200 commit 1a4763e6ef8e4da2a5118a00ce567e00704979cd Author: Tor Lillqvist -Date: Wed Sep 23 09:33:48 2009 +0300 +Date: Wed Sep 23 09:33:48 2009 +0300 Parse libtoolize --version more carefully @@ -8107,119 +33082,119 @@ Date: Wed Sep 23 09:33:48 2009 +0300 libtoolize (GNU libtool 1.3110 2009-07-01) 2.2.7a Don't get confused by the numbers inside the parens. - autogen.sh | 5 ++++- + autogen.sh | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) commit 4c633ff0b58db039a29801d5039cc2756db90bbb Author: Matthias Clasen -Date: Tue Sep 22 16:57:08 2009 -0400 +Date: Tue Sep 22 16:57:08 2009 -0400 2.22.0 - README.in | 2 +- + README.in | 2 +- docs/reference/glib/tmpl/glib-unused.sgml | 67 -- - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/main.sgml | 7 + - docs/reference/glib/tmpl/testing.sgml | 21 + - docs/reference/glib/tmpl/version.sgml | 68 ++ - glib/Makefile.am | 9 +- - gobject/Makefile.am | 10 +- - po/am.po | 188 ++-- - po/ar.po | 188 ++-- - po/as.po | 219 +++--- - po/az.po | 188 ++-- - po/be.po | 188 ++-- - po/be@latin.po | 188 ++-- - po/bg.po | 915 ++++++++++---------- - po/bn.po | 188 ++-- - po/bn_IN.po | 965 +++++++++++---------- - po/bs.po | 188 ++-- - po/ca.po | 925 ++++++++++---------- - po/ca@valencia.po | 188 ++-- - po/cs.po | 915 ++++++++++---------- - po/cy.po | 188 ++-- - po/da.po | 925 ++++++++++---------- - po/de.po | 188 ++-- - po/dz.po | 188 ++-- - po/el.po | 1332 + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/main.sgml | 7 + + docs/reference/glib/tmpl/testing.sgml | 21 + + docs/reference/glib/tmpl/version.sgml | 68 ++ + glib/Makefile.am | 9 +- + gobject/Makefile.am | 10 +- + po/am.po | 188 ++-- + po/ar.po | 188 ++-- + po/as.po | 219 +++--- + po/az.po | 188 ++-- + po/be.po | 188 ++-- + po/be@latin.po | 188 ++-- + po/bg.po | 915 ++++++++++---------- + po/bn.po | 188 ++-- + po/bn_IN.po | 965 +++++++++++---------- + po/bs.po | 188 ++-- + po/ca.po | 925 ++++++++++---------- + po/ca@valencia.po | 188 ++-- + po/cs.po | 915 ++++++++++---------- + po/cy.po | 188 ++-- + po/da.po | 925 ++++++++++---------- + po/de.po | 188 ++-- + po/dz.po | 188 ++-- + po/el.po | 1332 ++++++++++++++--------------- - po/en_CA.po | 188 ++-- - po/en_GB.po | 925 ++++++++++---------- - po/eo.po | 188 ++-- - po/es.po | 923 ++++++++++---------- - po/et.po | 188 ++-- - po/eu.po | 188 ++-- - po/fa.po | 188 ++-- - po/fi.po | 925 ++++++++++---------- - po/fr.po | 188 ++-- - po/ga.po | 188 ++-- - po/gl.po | 920 ++++++++++---------- - po/gu.po | 947 ++++++++++---------- - po/he.po | 188 ++-- - po/hi.po | 944 ++++++++++---------- - po/hr.po | 188 ++-- - po/hu.po | 188 ++-- - po/hy.po | 188 ++-- - po/id.po | 188 ++-- - po/is.po | 188 ++-- - po/it.po | 188 ++-- - po/ja.po | 188 ++-- - po/ka.po | 188 ++-- - po/kn.po | 968 +++++++++++---------- - po/ko.po | 188 ++-- - po/ku.po | 188 ++-- - po/lt.po | 188 ++-- - po/lv.po | 188 ++-- - po/mai.po | 188 ++-- - po/mg.po | 188 ++-- - po/mk.po | 188 ++-- - po/ml.po | 979 +++++++++++----------- - po/mn.po | 188 ++-- - po/mr.po | 947 ++++++++++---------- - po/ms.po | 188 ++-- - po/nb.po | 917 ++++++++++---------- - po/ne.po | 188 ++-- - po/nl.po | 188 ++-- - po/nn.po | 188 ++-- - po/oc.po | 188 ++-- - po/or.po | 956 +++++++++++---------- - po/pa.po | 943 ++++++++++---------- - po/pl.po | 1339 + po/en_CA.po | 188 ++-- + po/en_GB.po | 925 ++++++++++---------- + po/eo.po | 188 ++-- + po/es.po | 923 ++++++++++---------- + po/et.po | 188 ++-- + po/eu.po | 188 ++-- + po/fa.po | 188 ++-- + po/fi.po | 925 ++++++++++---------- + po/fr.po | 188 ++-- + po/ga.po | 188 ++-- + po/gl.po | 920 ++++++++++---------- + po/gu.po | 947 ++++++++++---------- + po/he.po | 188 ++-- + po/hi.po | 944 ++++++++++---------- + po/hr.po | 188 ++-- + po/hu.po | 188 ++-- + po/hy.po | 188 ++-- + po/id.po | 188 ++-- + po/is.po | 188 ++-- + po/it.po | 188 ++-- + po/ja.po | 188 ++-- + po/ka.po | 188 ++-- + po/kn.po | 968 +++++++++++---------- + po/ko.po | 188 ++-- + po/ku.po | 188 ++-- + po/lt.po | 188 ++-- + po/lv.po | 188 ++-- + po/mai.po | 188 ++-- + po/mg.po | 188 ++-- + po/mk.po | 188 ++-- + po/ml.po | 979 +++++++++++----------- + po/mn.po | 188 ++-- + po/mr.po | 947 ++++++++++---------- + po/ms.po | 188 ++-- + po/nb.po | 917 ++++++++++---------- + po/ne.po | 188 ++-- + po/nl.po | 188 ++-- + po/nn.po | 188 ++-- + po/oc.po | 188 ++-- + po/or.po | 956 +++++++++++---------- + po/pa.po | 943 ++++++++++---------- + po/pl.po | 1339 ++++++++++++++--------------- - po/ps.po | 188 ++-- - po/pt.po | 188 ++-- - po/pt_BR.po | 188 ++-- - po/ro.po | 926 ++++++++++---------- - po/ru.po | 188 ++-- - po/rw.po | 188 ++-- - po/si.po | 188 ++-- - po/sk.po | 188 ++-- - po/sl.po | 1280 + po/ps.po | 188 ++-- + po/pt.po | 188 ++-- + po/pt_BR.po | 188 ++-- + po/ro.po | 926 ++++++++++---------- + po/ru.po | 188 ++-- + po/rw.po | 188 ++-- + po/si.po | 188 ++-- + po/sk.po | 188 ++-- + po/sl.po | 1280 +++++++++++++-------------- - po/sq.po | 188 ++-- - po/sr.po | 931 ++++++++++---------- - po/sr@ije.po | 188 ++-- - po/sr@latin.po | 942 ++++++++++---------- - po/sv.po | 188 ++-- - po/ta.po | 950 ++++++++++---------- - po/te.po | 956 +++++++++++---------- - po/th.po | 188 ++-- - po/tl.po | 188 ++-- - po/tr.po | 188 ++-- - po/tt.po | 188 ++-- - po/uk.po | 917 ++++++++++---------- - po/vi.po | 188 ++-- - po/wa.po | 188 ++-- - po/xh.po | 188 ++-- - po/yi.po | 188 ++-- - po/zh_CN.po | 926 ++++++++++---------- - po/zh_HK.po | 938 ++++++++++---------- - po/zh_TW.po | 923 ++++++++++---------- + po/sq.po | 188 ++-- + po/sr.po | 931 ++++++++++---------- + po/sr@ije.po | 188 ++-- + po/sr@latin.po | 942 ++++++++++---------- + po/sv.po | 188 ++-- + po/ta.po | 950 ++++++++++---------- + po/te.po | 956 +++++++++++---------- + po/th.po | 188 ++-- + po/tl.po | 188 ++-- + po/tr.po | 188 ++-- + po/tt.po | 188 ++-- + po/uk.po | 917 ++++++++++---------- + po/vi.po | 188 ++-- + po/wa.po | 188 ++-- + po/xh.po | 188 ++-- + po/yi.po | 188 ++-- + po/zh_CN.po | 926 ++++++++++---------- + po/zh_HK.po | 938 ++++++++++---------- + po/zh_TW.po | 923 ++++++++++---------- 96 files changed, 19793 insertions(+), 19818 deletions(-) commit 9203da305b1c840ebafe7d95f2e937348be0f333 Author: Matthias Clasen -Date: Tue Sep 22 12:36:50 2009 -0400 +Date: Tue Sep 22 12:36:50 2009 -0400 some doc updates @@ -8228,7 +33203,7 @@ Date: Tue Sep 22 12:36:50 2009 -0400 commit 3413e758eb4fb15559e9da1b38efd59fcca81401 Author: Matthias Clasen -Date: Tue Sep 22 10:37:05 2009 -0400 +Date: Tue Sep 22 10:37:05 2009 -0400 Updates @@ -8237,7 +33212,7 @@ Date: Tue Sep 22 10:37:05 2009 -0400 commit 74326a38658ebb9dbd59c9d8899a0bbb646301e5 Author: Matthias Clasen -Date: Tue Sep 22 09:41:04 2009 -0400 +Date: Tue Sep 22 09:41:04 2009 -0400 Set version to 2.22.0 @@ -8246,7 +33221,7 @@ Date: Tue Sep 22 09:41:04 2009 -0400 commit 01ccc9e3bac498e714087b2be543442aa2eadcaa Author: Matej Urbančič -Date: Tue Sep 22 12:21:02 2009 +0200 +Date: Tue Sep 22 12:21:02 2009 +0200 Updated Slovenian translation @@ -8255,7 +33230,7 @@ Date: Tue Sep 22 12:21:02 2009 +0200 commit 1c46514d5e072f3baee0145798e023610e895ab2 Author: Matej Urbančič -Date: Tue Sep 22 12:15:38 2009 +0200 +Date: Tue Sep 22 12:15:38 2009 +0200 Updated Slovenian translation @@ -8265,7 +33240,7 @@ Date: Tue Sep 22 12:15:38 2009 +0200 commit c755a7fd11ca5f865f6ccd477e0f4db3799161fa Author: Mart Raudsepp -Date: Sun Sep 13 04:42:33 2009 +0300 +Date: Sun Sep 13 04:42:33 2009 +0300 gio: Fix some typos in G*AppInfo documentation @@ -8276,7 +33251,7 @@ Date: Sun Sep 13 04:42:33 2009 +0300 commit 924f1bc528b212aab91adf608ef32e41b67f3298 Author: Mart Raudsepp -Date: Sun Sep 13 00:20:01 2009 +0300 +Date: Sun Sep 13 00:20:01 2009 +0300 Accept -? for glib-mkenums. @@ -8293,7 +33268,7 @@ Date: Sun Sep 13 00:20:01 2009 +0300 commit 6c061da2a232d8c817d9744a234ceee7b87b3dd8 Author: Mart Raudsepp -Date: Sat Sep 12 19:49:01 2009 +0300 +Date: Sat Sep 12 19:49:01 2009 +0300 gio: Fix a Since tag to actually show up in new API of 2.20 indeces @@ -8304,7 +33279,7 @@ Date: Sat Sep 12 19:49:01 2009 +0300 commit 7feb4c3631a0745b3696454630be3aa3365d1067 Author: Nguyễn Thái Ngọc Duy -Date: Tue Sep 22 09:59:13 2009 +0700 +Date: Tue Sep 22 09:59:13 2009 +0700 po/vi.po: fix type "thoạt" @@ -8313,7 +33288,7 @@ Date: Tue Sep 22 09:59:13 2009 +0700 commit a830fbd62c05193982c72a375251b2202986152f Author: Alexander Larsson -Date: Mon Sep 21 15:36:45 2009 +0200 +Date: Mon Sep 21 15:36:45 2009 +0200 Document new gdb macros @@ -8323,7 +33298,7 @@ Date: Mon Sep 21 15:36:45 2009 +0200 commit 42320706c4dd6a4517a402dc5da5c27dfc6a5356 Author: Alexander Larsson -Date: Mon Sep 21 15:21:52 2009 +0200 +Date: Mon Sep 21 15:21:52 2009 +0200 Add gforeach gdb command @@ -8333,7 +33308,7 @@ Date: Mon Sep 21 15:21:52 2009 +0200 commit 2b8943237f137f287b0b0854f80198de54fd26ea Author: Alexander Larsson -Date: Mon Sep 21 12:26:23 2009 +0200 +Date: Mon Sep 21 12:26:23 2009 +0200 Add pretty printer for hashtables @@ -8343,7 +33318,7 @@ Date: Mon Sep 21 12:26:23 2009 +0200 commit 2e8768d9a556afd2b2e6c974dcbcf24fee5ba6ff Author: Alexander Larsson -Date: Mon Sep 21 11:06:39 2009 +0200 +Date: Mon Sep 21 11:06:39 2009 +0200 Add pretty printing for GList and GSList @@ -8353,7 +33328,7 @@ Date: Mon Sep 21 11:06:39 2009 +0200 commit efe9169234e226f594b4254618f35a139338c35f Author: Alexander Larsson -Date: Fri Sep 18 17:15:32 2009 +0200 +Date: Fri Sep 18 17:15:32 2009 +0200 Initial support for gdb python macros @@ -8362,30 +33337,30 @@ Date: Fri Sep 18 17:15:32 2009 +0200 https://bugzilla.gnome.org/show_bug.cgi?id=595619 - glib/Makefile.am | 13 ++- - glib/glib.py | 27 ++++ + glib/Makefile.am | 13 ++- + glib/glib.py | 27 ++++ glib/libglib-gdb.py.in | 10 ++ - gobject/Makefile.am | 12 ++- - gobject/gobject.py | 305 + gobject/Makefile.am | 12 ++- + gobject/gobject.py | 305 ++++++++++++++++++++++++++++++++++++++++++ gobject/libgobject-gdb.py.in | 10 ++ 6 files changed, 375 insertions(+), 2 deletions(-) commit 18af48ba9a347e2041c4986aaaac73fdd5386de3 Author: Chao-Hsiung Liao -Date: Mon Sep 21 20:54:02 2009 +0800 +Date: Mon Sep 21 20:54:02 2009 +0800 Updated Traditional Chinese translation(Hong Kong and Taiwan) - po/zh_HK.po | 945 + po/zh_HK.po | 945 +++++++++++++++++++++++++++++------------------------------ - po/zh_TW.po | 930 + po/zh_TW.po | 930 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 938 insertions(+), 937 deletions(-) commit 652f47fd2a9544e07cd6cbc5ca0d31d21c1ccd34 Author: Petr Kovar -Date: Sun Sep 20 22:26:17 2009 +0200 +Date: Sun Sep 20 22:26:17 2009 +0200 Updated Czech translation @@ -8395,7 +33370,7 @@ Date: Sun Sep 20 22:26:17 2009 +0200 commit 5b30a46da4eadbd620f34e66e7b981f2dfe91a4f Author: Ani -Date: Sun Sep 20 21:04:45 2009 +0530 +Date: Sun Sep 20 21:04:45 2009 +0530 Updated Malayalam Translations @@ -8405,7 +33380,7 @@ Date: Sun Sep 20 21:04:45 2009 +0530 commit 7a010ac2d409fc7ea849034ca7a5bda150ee0fad Author: Gil Forcada -Date: Sat Sep 19 18:04:56 2009 +0200 +Date: Sat Sep 19 18:04:56 2009 +0200 Updated Catalan translation @@ -8415,7 +33390,7 @@ Date: Sat Sep 19 18:04:56 2009 +0200 commit 80f66b114193d3c1b5a5c5d4f34b01cba53208ca Author: Paolo Borelli -Date: Sat Sep 19 10:21:36 2009 +0200 +Date: Sat Sep 19 10:21:36 2009 +0200 Fix build with srcdir != builddir, bug #594597 @@ -8424,7 +33399,7 @@ Date: Sat Sep 19 10:21:36 2009 +0200 commit 8b3853b8a1cc94767c5391808274f931a48f6cbb Author: Matthias Clasen -Date: Fri Sep 18 19:16:11 2009 -0400 +Date: Fri Sep 18 19:16:11 2009 -0400 Reduce false positives in static analysis @@ -8438,30 +33413,30 @@ Date: Fri Sep 18 19:16:11 2009 -0400 commit 53fc10d2695f917db530c9a3f166e45be59d1d3a Author: Matthias Clasen -Date: Wed Sep 9 00:18:23 2009 -0400 +Date: Wed Sep 9 00:18:23 2009 -0400 Fix a lot of clang complaints Mostly dead assignments. - gio/gbufferedoutputstream.c | 9 ++------- - gio/gdatainputstream.c | 7 +------ - gio/gdummyfile.c | 5 +---- - gio/ginputstream.c | 16 +++++----------- - gio/giostream.c | 4 ---- - gio/glocalfile.c | 20 ++++++++------------ - gio/glocalfileinputstream.c | 4 ---- - gio/goutputstream.c | 34 +++++++++++++++------------------- - gio/gunixinputstream.c | 4 ---- - gio/gunixoutputstream.c | 4 ---- - glib/gfileutils.c | 3 +-- - glib/gkeyfile.c | 3 +-- - glib/gregex.c | 6 +----- + gio/gbufferedoutputstream.c | 9 ++------- + gio/gdatainputstream.c | 7 +------ + gio/gdummyfile.c | 5 +---- + gio/ginputstream.c | 16 +++++----------- + gio/giostream.c | 4 ---- + gio/glocalfile.c | 20 ++++++++------------ + gio/glocalfileinputstream.c | 4 ---- + gio/goutputstream.c | 34 +++++++++++++++------------------- + gio/gunixinputstream.c | 4 ---- + gio/gunixoutputstream.c | 4 ---- + glib/gfileutils.c | 3 +-- + glib/gkeyfile.c | 3 +-- + glib/gregex.c | 6 +----- 13 files changed, 35 insertions(+), 84 deletions(-) commit 04d632ccf59ce0491261ff87b3867012cb56d8bf Author: Dumitru Mișu Moldovan -Date: Fri Sep 18 00:17:32 2009 +0300 +Date: Fri Sep 18 00:17:32 2009 +0300 Updated Romanian translation @@ -8471,11 +33446,11 @@ Date: Fri Sep 18 00:17:32 2009 +0300 commit 3bfba7924c94aa3a3bcc14e6eeee4fa691108dd0 Author: Miloš Popović -Date: Thu Sep 17 17:58:52 2009 +0000 +Date: Thu Sep 17 17:58:52 2009 +0000 Updated Serbian translation - po/sr.po | 1381 + po/sr.po | 1381 +++++++++++++++++++++++++++---------------------------- po/sr@latin.po | 1392 +++++++++++++++++++++++++++----------------------------- @@ -8483,7 +33458,7 @@ Date: Thu Sep 17 17:58:52 2009 +0000 commit dd7f660fb7b059d16cea6e33550a14ca2625c813 Author: krishnababu k -Date: Thu Sep 17 21:18:57 2009 +0530 +Date: Thu Sep 17 21:18:57 2009 +0530 Updated Telugu Translation @@ -8493,7 +33468,7 @@ Date: Thu Sep 17 21:18:57 2009 +0530 commit 256662ddbaec90688c1725d504efc1248eacb7e1 Author: ifelix -Date: Thu Sep 17 15:50:19 2009 +0530 +Date: Thu Sep 17 15:50:19 2009 +0530 Updated Tamil Translations @@ -8503,7 +33478,7 @@ Date: Thu Sep 17 15:50:19 2009 +0530 commit 78c548b506db0527335011ce92558bc1a9d5ebf0 Author: Fran Diéguez -Date: Wed Sep 16 16:15:05 2009 +0200 +Date: Wed Sep 16 16:15:05 2009 +0200 UPdated Galician Translation @@ -8513,7 +33488,7 @@ Date: Wed Sep 16 16:15:05 2009 +0200 commit d88b6a3d60f0f84cf192c1b4093a0ae2362d7f02 Author: Runa Bhattacharjee -Date: Tue Sep 15 18:31:49 2009 +0530 +Date: Tue Sep 15 18:31:49 2009 +0530 Updated Bengali India Translations @@ -8523,7 +33498,7 @@ Date: Tue Sep 15 18:31:49 2009 +0530 commit 011592af55d980cfb21c51f5d4bcdd09cce865ec Author: Manoj Kumar Giri -Date: Tue Sep 15 16:22:41 2009 +0530 +Date: Tue Sep 15 16:22:41 2009 +0530 Upadted Oriya Translation @@ -8533,7 +33508,7 @@ Date: Tue Sep 15 16:22:41 2009 +0530 commit ddc85a8b0242407c6234bbe2ebc49b873bf02396 Author: Theppitak Karoonboonyanan -Date: Tue Sep 15 14:29:36 2009 +0700 +Date: Tue Sep 15 14:29:36 2009 +0700 Updated Thai translation. @@ -8542,7 +33517,7 @@ Date: Tue Sep 15 14:29:36 2009 +0700 commit 3a240a7f718a44724008d35123c6f7b98abc896a Author: Amitakhya Phukan -Date: Tue Sep 15 12:48:50 2009 +0530 +Date: Tue Sep 15 12:48:50 2009 +0530 Updating Assamese translations. @@ -8551,7 +33526,7 @@ Date: Tue Sep 15 12:48:50 2009 +0530 commit ef5e66c330cdc3f8d93ba33a0dfe251f98883204 Author: Kjartan Maraas -Date: Mon Sep 14 00:16:51 2009 +0200 +Date: Mon Sep 14 00:16:51 2009 +0200 Update Norwegian bokmål translation. @@ -8561,7 +33536,7 @@ Date: Mon Sep 14 00:16:51 2009 +0200 commit 220bde833af1bba3e535f727173b84a362374399 Author: Aron Xu -Date: Sun Sep 13 15:09:29 2009 +0800 +Date: Sun Sep 13 15:09:29 2009 +0800 Updated Simplified Chinese translation. @@ -8571,7 +33546,7 @@ Date: Sun Sep 13 15:09:29 2009 +0800 commit 7e514b6efaf6daae23c09a1e13ed65d2d8aa8008 Author: A S Alam -Date: Sun Sep 13 08:58:57 2009 +0530 +Date: Sun Sep 13 08:58:57 2009 +0530 Updating Translation for Punjabi @@ -8581,7 +33556,7 @@ Date: Sun Sep 13 08:58:57 2009 +0530 commit e1957bd71c999ba5189a7fe94880647e84fa6357 Author: Ask H. Larsen -Date: Sun Sep 13 03:16:47 2009 +0200 +Date: Sun Sep 13 03:16:47 2009 +0200 Updated Danish translation @@ -8591,7 +33566,7 @@ Date: Sun Sep 13 03:16:47 2009 +0200 commit 6366015decc608a74e2019ccb0d39dbc6e3f06ba Author: Bruce Cowan -Date: Sat Sep 12 20:04:29 2009 +0100 +Date: Sat Sep 12 20:04:29 2009 +0100 Updated British English translation @@ -8601,7 +33576,7 @@ Date: Sat Sep 12 20:04:29 2009 +0100 commit a92f10d712b6278364e02178c873a084bfbf9e19 Author: Tommi Vainikainen -Date: Sat Sep 12 19:10:57 2009 +0300 +Date: Sat Sep 12 19:10:57 2009 +0300 Updated Finnish translation @@ -8611,16 +33586,16 @@ Date: Sat Sep 12 19:10:57 2009 +0300 commit 410305255d0acfa5e105a444cdf8b302b31b94a2 Author: Tor Lillqvist -Date: Sat Sep 12 01:57:46 2009 +0300 +Date: Sat Sep 12 01:57:46 2009 +0300 Remove old crap for fetching the "build" directory from svn - autogen.sh | 17 ----------------- + autogen.sh | 17 ----------------- 1 files changed, 0 insertions(+), 17 deletions(-) commit 866731776651e04178a6cc1e78d244384a890d1a Author: Sjoerd Simons -Date: Wed Sep 2 17:48:09 2009 +0100 +Date: Wed Sep 2 17:48:09 2009 +0100 Fix GNetworkAddress skipping addresses when enumerating @@ -8637,7 +33612,7 @@ Date: Wed Sep 2 17:48:09 2009 +0100 commit cdd04f36cac838f92826cbf415868100a4007741 Author: Richard Hughes -Date: Wed Sep 2 19:15:38 2009 +0100 +Date: Wed Sep 2 19:15:38 2009 +0100 Make the error const for g_simple_async_result_set_from_error @@ -8647,7 +33622,7 @@ Date: Wed Sep 2 19:15:38 2009 +0100 commit 11477609d1f2782fd4bbb3022d2ec46983930c6a Author: James Hunt -Date: Thu Sep 10 17:18:13 2009 +0100 +Date: Thu Sep 10 17:18:13 2009 +0100 g_socket_send_message() fails due to invalid sendmsg(2) params. @@ -8665,7 +33640,7 @@ Date: Thu Sep 10 17:18:13 2009 +0100 commit 29baa5eebdce27d10c6f36ae8ad4fbc77d04f291 Author: Rajesh Ranjan -Date: Fri Sep 11 16:00:29 2009 +0530 +Date: Fri Sep 11 16:00:29 2009 +0530 hindi update by Rajesh Ranjan @@ -8675,7 +33650,7 @@ Date: Fri Sep 11 16:00:29 2009 +0530 commit 9dc9b39284b78b63fad4a713ab6ea4154d4e8ff5 Author: Ani -Date: Fri Sep 11 12:18:50 2009 +0530 +Date: Fri Sep 11 12:18:50 2009 +0530 Updated Malayalam Translations @@ -8685,7 +33660,7 @@ Date: Fri Sep 11 12:18:50 2009 +0530 commit c3bbec5213d1e77253fd2cef67d6838041bb2f1f Author: Maxim V. Dziumanenko -Date: Fri Sep 11 01:48:56 2009 +0300 +Date: Fri Sep 11 01:48:56 2009 +0300 Updated Ukrainian translation @@ -8695,7 +33670,7 @@ Date: Fri Sep 11 01:48:56 2009 +0300 commit 278ac0a45d2b677a0928b1c31b3e20a4c265ffb0 Author: Christian Dywan -Date: Thu Sep 10 16:40:11 2009 +0200 +Date: Thu Sep 10 16:40:11 2009 +0200 Bug 579050 Allow making selected critical and warning messages non-fatal @@ -8715,7 +33690,7 @@ Date: Thu Sep 10 16:40:11 2009 +0200 commit 4b1217b7e0e8d2e7e4187e8b328e10ad72066392 Author: Shankar Prasad -Date: Thu Sep 10 12:26:13 2009 +0530 +Date: Thu Sep 10 12:26:13 2009 +0530 Updated Kannada(kn) translation @@ -8725,7 +33700,7 @@ Date: Thu Sep 10 12:26:13 2009 +0530 commit 664dd256654b5def0bd6cdd5e3918bba78fedd52 Author: Kostas Papadimas -Date: Wed Sep 9 18:38:12 2009 +0300 +Date: Wed Sep 9 18:38:12 2009 +0300 Updated Greek translation. @@ -8735,7 +33710,7 @@ Date: Wed Sep 9 18:38:12 2009 +0300 commit 593cd7a683c267e9e02e3d0b8bc653a253f17df5 Author: Sweta Kothari -Date: Wed Sep 9 16:54:43 2009 +0530 +Date: Wed Sep 9 16:54:43 2009 +0530 Updated Gujarati Translations @@ -8745,7 +33720,7 @@ Date: Wed Sep 9 16:54:43 2009 +0530 commit f393e805874db16334c5c4f4aa7fa1c73964ca34 Author: Dan Winship -Date: Tue Sep 8 11:19:13 2009 -0400 +Date: Tue Sep 8 11:19:13 2009 -0400 Clarify g_ptr_array_set_size() docs re: free_func @@ -8754,7 +33729,7 @@ Date: Tue Sep 8 11:19:13 2009 -0400 commit eadd2ce7fff83f86c4803aa5e2e251f554639bb6 Author: Alexander Shopov -Date: Tue Sep 8 07:41:28 2009 +0300 +Date: Tue Sep 8 07:41:28 2009 +0300 Updated Bulgarian translation @@ -8764,17 +33739,17 @@ Date: Tue Sep 8 07:41:28 2009 +0300 commit bc1dd5cf11dc920ff44d51051e1e695b0b8ea421 Author: Dan Winship -Date: Sun Sep 6 13:54:50 2009 -0400 +Date: Sun Sep 6 13:54:50 2009 -0400 Call element_free_func when shrinking array with g_ptr_array_set_size - glib/garray.c | 8 ++------ + glib/garray.c | 8 ++------ glib/tests/array-test.c | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) commit 9a29f087e76fd01188cff73ce1dfe802bd815b15 Author: Sandeep Shedmake -Date: Mon Sep 7 19:14:52 2009 +0530 +Date: Mon Sep 7 19:14:52 2009 +0530 Updated Marathi Translations @@ -8784,7 +33759,7 @@ Date: Mon Sep 7 19:14:52 2009 +0530 commit 8af494d987b7482865439f882d1375767b57732f Author: Alexander Larsson -Date: Mon Sep 7 12:50:58 2009 +0200 +Date: Mon Sep 7 12:50:58 2009 +0200 Avoid reading uninitialized memory @@ -8795,7 +33770,7 @@ Date: Mon Sep 7 12:50:58 2009 +0200 commit 06de24f430d4b43733dec63ca0b840d129a716e2 Author: Alexander Larsson -Date: Mon Sep 7 10:25:14 2009 +0200 +Date: Mon Sep 7 10:25:14 2009 +0200 Remove warning in g_simple_async_result_complete @@ -8814,25 +33789,25 @@ Date: Mon Sep 7 10:25:14 2009 +0200 commit 034d516160ffacbb805ad28cfdb848134f26c1dc Author: Matthias Clasen -Date: Mon Sep 7 03:28:35 2009 -0400 +Date: Mon Sep 7 03:28:35 2009 -0400 Another dead assignment - gio/gmemoryoutputstream.c | 6 +----- + gio/gmemoryoutputstream.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) commit 6cda9bfb02314fff5e994a80164be16c67d14253 Author: Matthias Clasen -Date: Mon Sep 7 03:14:15 2009 -0400 +Date: Mon Sep 7 03:14:15 2009 -0400 Remove a dead initialization - gio/gthemedicon.c | 2 +- + gio/gthemedicon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 30645bd0a584137585d572b37f39d2904bba0a8f Author: Matthias Clasen -Date: Mon Sep 7 03:12:06 2009 -0400 +Date: Mon Sep 7 03:12:06 2009 -0400 Remove a dead increment @@ -8841,7 +33816,7 @@ Date: Mon Sep 7 03:12:06 2009 -0400 commit 0d1ffbf361503ac1f8236673f400e0f317635930 Author: Matthias Clasen -Date: Mon Sep 7 03:10:01 2009 -0400 +Date: Mon Sep 7 03:10:01 2009 -0400 Remove another dead assignment @@ -8850,29 +33825,29 @@ Date: Mon Sep 7 03:10:01 2009 -0400 commit f2c8572d8490544496934612854a86fecbaf99ba Author: Matthias Clasen -Date: Mon Sep 7 03:07:22 2009 -0400 +Date: Mon Sep 7 03:07:22 2009 -0400 Remmove a dead assignment. Spotted by clang. - gio/gbufferedinputstream.c | 4 +--- + gio/gbufferedinputstream.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) commit 1ec32c403bac36ca9f72e82c23b14045bc323931 Author: Matthias Clasen -Date: Mon Sep 7 03:02:58 2009 -0400 +Date: Mon Sep 7 03:02:58 2009 -0400 Move a assignment to the relevant #ifdef branch Dead code spotted by clang. - gio/gcancellable.c | 3 +-- + gio/gcancellable.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) commit e67c3cf2b0251acfca74d680d9b4c2b7547c61a7 Author: Matthias Clasen -Date: Mon Sep 7 03:01:02 2009 -0400 +Date: Mon Sep 7 03:01:02 2009 -0400 Remove dead code @@ -8881,7 +33856,7 @@ Date: Mon Sep 7 03:01:02 2009 -0400 commit 80fd5ed402bf57a3c5cbd90eecc3f58f3f06bc08 Author: Matthias Clasen -Date: Mon Sep 7 02:50:51 2009 -0400 +Date: Mon Sep 7 02:50:51 2009 -0400 Don't evaluate an uninitialized value @@ -8892,7 +33867,7 @@ Date: Mon Sep 7 02:50:51 2009 -0400 commit 7ea8a2a86326b6f5f0f62a334fdd307d6526f782 Author: Tomasz Dominikowski -Date: Sun Sep 6 14:20:45 2009 +0200 +Date: Sun Sep 6 14:20:45 2009 +0200 Updated Polish translation @@ -8902,7 +33877,7 @@ Date: Sun Sep 6 14:20:45 2009 +0200 commit 93fbae22d4d6fddf69c2b7276f24fcc3cfcf0403 Author: Takayuki KUSANO -Date: Sat Sep 5 22:34:58 2009 +0900 +Date: Sat Sep 5 22:34:58 2009 +0900 Update Japanese translation @@ -8911,7 +33886,7 @@ Date: Sat Sep 5 22:34:58 2009 +0900 commit 6b406dda7b3061bd890878823fbafe2c6ffc019a Author: Jorge González -Date: Sat Sep 5 13:47:41 2009 +0200 +Date: Sat Sep 5 13:47:41 2009 +0200 Updated Spanish translation @@ -8921,7 +33896,7 @@ Date: Sat Sep 5 13:47:41 2009 +0200 commit e77b8278841d89f9e2c82e09b844a472496ab43e Author: Matthias Clasen -Date: Fri Sep 4 21:20:09 2009 -0400 +Date: Fri Sep 4 21:20:09 2009 -0400 Bump version @@ -8930,104 +33905,104 @@ Date: Fri Sep 4 21:20:09 2009 -0400 commit 296d481c7e5de27175e68ff7645975442a449fc5 Author: Matthias Clasen -Date: Fri Sep 4 21:19:02 2009 -0400 +Date: Fri Sep 4 21:19:02 2009 -0400 2.21.6 - po/am.po | 75 ++-- - po/ar.po | 75 ++-- - po/as.po | 957 ++++++++++++++++++++------------------- - po/az.po | 75 ++-- - po/be.po | 77 ++-- + po/am.po | 75 ++-- + po/ar.po | 75 ++-- + po/as.po | 957 ++++++++++++++++++++------------------- + po/az.po | 75 ++-- + po/be.po | 77 ++-- po/be@latin.po | 77 ++-- - po/bg.po | 75 ++-- - po/bn.po | 75 ++-- - po/bn_IN.po | 75 ++-- - po/bs.po | 75 ++-- - po/ca.po | 75 ++-- + po/bg.po | 75 ++-- + po/bn.po | 75 ++-- + po/bn_IN.po | 75 ++-- + po/bs.po | 75 ++-- + po/ca.po | 75 ++-- po/ca@valencia.po | 75 ++-- - po/cs.po | 918 +++++++++++++++++++------------------- - po/cy.po | 75 ++-- - po/da.po | 75 ++-- - po/de.po | 925 +++++++++++++++++++------------------- - po/dz.po | 75 ++-- - po/el.po | 76 ++-- - po/en_CA.po | 75 ++-- - po/en_GB.po | 75 ++-- - po/eo.po | 75 ++-- - po/es.po | 75 ++-- - po/et.po | 464 +++++++++++++++++++- - po/eu.po | 978 ++++++++++++++++++++------------------- - po/fa.po | 75 ++-- - po/fi.po | 75 ++-- - po/fr.po | 920 +++++++++++++++++++------------------- - po/ga.po | 75 ++-- - po/gl.po | 75 ++-- - po/gu.po | 75 ++-- - po/he.po | 75 ++-- - po/hi.po | 75 ++-- - po/hr.po | 75 ++-- - po/hu.po | 134 ++++--- - po/hy.po | 75 ++-- - po/id.po | 75 ++-- - po/is.po | 75 ++-- - po/it.po | 923 +++++++++++++++++++------------------- - po/ja.po | 75 ++-- - po/ka.po | 75 ++-- - po/kn.po | 971 ++++++++++++++++++++------------------- - po/ko.po | 75 ++-- - po/ku.po | 75 ++-- - po/lt.po | 75 ++-- - po/lv.po | 75 ++-- - po/mai.po | 75 ++-- - po/mg.po | 75 ++-- - po/mk.po | 75 ++-- - po/ml.po | 974 ++++++++++++++++++++------------------- - po/mn.po | 75 ++-- - po/mr.po | 950 ++++++++++++++++++++------------------- - po/ms.po | 75 ++-- - po/nb.po | 918 +++++++++++++++++++------------------- - po/ne.po | 75 ++-- - po/nl.po | 75 ++-- - po/nn.po | 75 ++-- - po/oc.po | 74 ++-- - po/or.po | 109 +++-- - po/pa.po | 75 ++-- - po/pl.po | 75 ++-- - po/ps.po | 75 ++-- - po/pt.po | 925 +++++++++++++++++++------------------- - po/pt_BR.po | 925 +++++++++++++++++++------------------- - po/ro.po | 75 ++-- - po/ru.po | 75 ++-- - po/rw.po | 75 ++-- - po/si.po | 75 ++-- - po/sk.po | 75 ++-- - po/sl.po | 75 ++-- - po/sq.po | 76 ++-- - po/sr.po | 75 ++-- - po/sr@ije.po | 75 ++-- + po/cs.po | 918 +++++++++++++++++++------------------- + po/cy.po | 75 ++-- + po/da.po | 75 ++-- + po/de.po | 925 +++++++++++++++++++------------------- + po/dz.po | 75 ++-- + po/el.po | 76 ++-- + po/en_CA.po | 75 ++-- + po/en_GB.po | 75 ++-- + po/eo.po | 75 ++-- + po/es.po | 75 ++-- + po/et.po | 464 +++++++++++++++++++- + po/eu.po | 978 ++++++++++++++++++++------------------- + po/fa.po | 75 ++-- + po/fi.po | 75 ++-- + po/fr.po | 920 +++++++++++++++++++------------------- + po/ga.po | 75 ++-- + po/gl.po | 75 ++-- + po/gu.po | 75 ++-- + po/he.po | 75 ++-- + po/hi.po | 75 ++-- + po/hr.po | 75 ++-- + po/hu.po | 134 ++++--- + po/hy.po | 75 ++-- + po/id.po | 75 ++-- + po/is.po | 75 ++-- + po/it.po | 923 +++++++++++++++++++------------------- + po/ja.po | 75 ++-- + po/ka.po | 75 ++-- + po/kn.po | 971 ++++++++++++++++++++------------------- + po/ko.po | 75 ++-- + po/ku.po | 75 ++-- + po/lt.po | 75 ++-- + po/lv.po | 75 ++-- + po/mai.po | 75 ++-- + po/mg.po | 75 ++-- + po/mk.po | 75 ++-- + po/ml.po | 974 ++++++++++++++++++++------------------- + po/mn.po | 75 ++-- + po/mr.po | 950 ++++++++++++++++++++------------------- + po/ms.po | 75 ++-- + po/nb.po | 918 +++++++++++++++++++------------------- + po/ne.po | 75 ++-- + po/nl.po | 75 ++-- + po/nn.po | 75 ++-- + po/oc.po | 74 ++-- + po/or.po | 109 +++-- + po/pa.po | 75 ++-- + po/pl.po | 75 ++-- + po/ps.po | 75 ++-- + po/pt.po | 925 +++++++++++++++++++------------------- + po/pt_BR.po | 925 +++++++++++++++++++------------------- + po/ro.po | 75 ++-- + po/ru.po | 75 ++-- + po/rw.po | 75 ++-- + po/si.po | 75 ++-- + po/sk.po | 75 ++-- + po/sl.po | 75 ++-- + po/sq.po | 76 ++-- + po/sr.po | 75 ++-- + po/sr@ije.po | 75 ++-- po/sr@latin.po | 75 ++-- - po/sv.po | 1312 + po/sv.po | 1312 ++++++++++++++++++++++++++--------------------------- - po/ta.po | 950 ++++++++++++++++++++------------------- - po/te.po | 959 ++++++++++++++++++++------------------- - po/th.po | 75 ++-- - po/tl.po | 75 ++-- - po/tr.po | 922 +++++++++++++++++++------------------- - po/tt.po | 75 ++-- - po/uk.po | 75 ++-- - po/vi.po | 75 ++-- - po/wa.po | 75 ++-- - po/xh.po | 75 ++-- - po/yi.po | 75 ++-- - po/zh_CN.po | 75 ++-- - po/zh_HK.po | 75 ++-- - po/zh_TW.po | 75 ++-- + po/ta.po | 950 ++++++++++++++++++++------------------- + po/te.po | 959 ++++++++++++++++++++------------------- + po/th.po | 75 ++-- + po/tl.po | 75 ++-- + po/tr.po | 922 +++++++++++++++++++------------------- + po/tt.po | 75 ++-- + po/uk.po | 75 ++-- + po/vi.po | 75 ++-- + po/wa.po | 75 ++-- + po/xh.po | 75 ++-- + po/yi.po | 75 ++-- + po/zh_CN.po | 75 ++-- + po/zh_HK.po | 75 ++-- + po/zh_TW.po | 75 ++-- 88 files changed, 11117 insertions(+), 10197 deletions(-) commit 05c2aeaf33ad1ff3447d57a361abdb238b8f822b Author: Matthias Clasen -Date: Fri Sep 4 20:41:25 2009 -0400 +Date: Fri Sep 4 20:41:25 2009 -0400 Add a Since: tag @@ -9036,7 +34011,7 @@ Date: Fri Sep 4 20:41:25 2009 -0400 commit 2ae69f5124022d93dfc0e39964bbf68eb1f61245 Author: Matthias Clasen -Date: Fri Sep 4 20:26:26 2009 -0400 +Date: Fri Sep 4 20:26:26 2009 -0400 Updates @@ -9045,7 +34020,7 @@ Date: Fri Sep 4 20:26:26 2009 -0400 commit 4114f1214c65f0a142678bf98b1d8e4da43bf665 Author: Benjamin Otte -Date: Thu Sep 3 15:39:57 2009 +0200 +Date: Thu Sep 3 15:39:57 2009 +0200 Bug 594034 - Use g_mkstemp_full() when creating the replacement file @@ -9059,16 +34034,16 @@ Date: Thu Sep 3 15:39:57 2009 +0200 docs/reference/glib/tmpl/glib-unused.sgml | 67 ++++++++++++++++++++++++++++ - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/misc_utils.sgml | 7 +++ - docs/reference/glib/tmpl/version.sgml | 68 + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/misc_utils.sgml | 7 +++ + docs/reference/glib/tmpl/version.sgml | 68 ----------------------------- - gio/glocalfileoutputstream.c | 2 +- + gio/glocalfileoutputstream.c | 2 +- 5 files changed, 77 insertions(+), 72 deletions(-) commit 24bec5c5bd64eb829a433e4c1e8d34dc25879a64 Author: Benjamin Otte -Date: Thu Sep 3 15:36:37 2009 +0200 +Date: Thu Sep 3 15:36:37 2009 +0200 Bug 594034 - Add g_mkstemp_full() @@ -9076,17 +34051,17 @@ Date: Thu Sep 3 15:36:37 2009 +0200 allows more flexibility when creating temporary files. The intended use is gio's code for g_file_replace() (see next patch) - docs/reference/glib/glib-sections.txt | 1 + + docs/reference/glib/glib-sections.txt | 1 + docs/reference/glib/tmpl/fileutils.sgml | 11 +++++++ - glib/gfileutils.c | 44 + glib/gfileutils.c | 44 ++++++++++++++++++++++++------- - glib/gfileutils.h | 3 ++ - glib/glib.symbols | 1 + + glib/gfileutils.h | 3 ++ + glib/glib.symbols | 1 + 5 files changed, 50 insertions(+), 10 deletions(-) commit 16ddefea15ceeded936c53aa1b867eb53d7d97f3 Author: Ivar Smolin -Date: Fri Sep 4 18:58:00 2009 +0300 +Date: Fri Sep 4 18:58:00 2009 +0300 Updating Estonian translation @@ -9096,7 +34071,7 @@ Date: Fri Sep 4 18:58:00 2009 +0300 commit c642965b234cdc9959c79d2fd3019f63a0520fad Author: Christian Kirbach -Date: Fri Sep 4 15:16:04 2009 +0200 +Date: Fri Sep 4 15:16:04 2009 +0200 Updated German translation @@ -9106,7 +34081,7 @@ Date: Fri Sep 4 15:16:04 2009 +0200 commit c77fd0bb04f612e7d16d48379cc3ec835c8d5fa2 Author: Daniel Nylander -Date: Fri Sep 4 06:31:34 2009 +0200 +Date: Fri Sep 4 06:31:34 2009 +0200 Updated Swedish translation @@ -9116,7 +34091,7 @@ Date: Fri Sep 4 06:31:34 2009 +0200 commit 7628e1b4773142fc89f2365069c3e5a59ffb15ab Author: Claude Paroz -Date: Fri Sep 4 00:07:40 2009 +0200 +Date: Fri Sep 4 00:07:40 2009 +0200 Updated French translation @@ -9126,17 +34101,17 @@ Date: Fri Sep 4 00:07:40 2009 +0200 commit 5a66c4bdb76b853b05baf7b01c8e2be49022c8a6 Author: Fábio Nogueira -Date: Wed Sep 2 12:28:59 2009 -0400 +Date: Wed Sep 2 12:28:59 2009 -0400 Updated Brazilian Portuguese translation. - po/pt_BR.po | 933 + po/pt_BR.po | 933 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 472 insertions(+), 461 deletions(-) commit de125e51a04a5ebdc652fb4e611a5bd1ba57c210 Author: Inaki Larranaga Murgoitio -Date: Wed Sep 2 18:19:27 2009 +0200 +Date: Wed Sep 2 18:19:27 2009 +0200 Updated Basque language @@ -9146,7 +34121,7 @@ Date: Wed Sep 2 18:19:27 2009 +0200 commit ff9b29ce5b7d8bd20d4527e2e364b68ebce01c75 Author: Gabor Kelemen -Date: Wed Sep 2 18:05:23 2009 +0200 +Date: Wed Sep 2 18:05:23 2009 +0200 Hungarian translation updated @@ -9156,7 +34131,7 @@ Date: Wed Sep 2 18:05:23 2009 +0200 commit f2320a40f1d356ba7f15e592c03018ba2b42c4bd Author: Duarte Loreto -Date: Tue Sep 1 23:34:41 2009 +0100 +Date: Tue Sep 1 23:34:41 2009 +0100 Updated Portuguese translation @@ -9166,7 +34141,7 @@ Date: Tue Sep 1 23:34:41 2009 +0100 commit f783515323963d2f9011cab5b6b2e767fe790425 Author: Luca Ferretti -Date: Tue Sep 1 23:47:14 2009 +0200 +Date: Tue Sep 1 23:47:14 2009 +0200 Updated Italian translation @@ -9175,19 +34150,19 @@ Date: Tue Sep 1 23:47:14 2009 +0200 commit 3826963e65d8c4c68bcd3e4066505f63ef734b95 Author: Benjamin Otte -Date: Tue Sep 1 21:53:35 2009 +0200 +Date: Tue Sep 1 21:53:35 2009 +0200 Use lchmod instead of stat + chown if available Fallout of the NOFLOOW_SYMLINKS fix from bug 593406 - configure.in | 2 +- + configure.in | 2 +- gio/glocalfileinfo.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) commit 48e0af0157f52ac12b904bd92540432a18b139c7 Author: Benjamin Otte -Date: Tue Sep 1 21:26:08 2009 +0200 +Date: Tue Sep 1 21:26:08 2009 +0200 Bug 593406 - Permissions set to 777 after copying via Nautilus @@ -9199,7 +34174,7 @@ Date: Tue Sep 1 21:26:08 2009 +0200 commit bb7852e34b1845e516290e1b45a960a345ee8a43 Author: Benjamin Otte -Date: Tue Sep 1 20:36:31 2009 +0200 +Date: Tue Sep 1 20:36:31 2009 +0200 Only do the chmod NOFOLLOW_SYMLINK checks with HAVE_SYMLINK @@ -9208,7 +34183,7 @@ Date: Tue Sep 1 20:36:31 2009 +0200 commit 8212aadac79d70153d880fe1f21914a2b491dca3 Author: Dan Winship -Date: Tue Sep 1 09:37:48 2009 -0400 +Date: Tue Sep 1 09:37:48 2009 -0400 g_time_val_from_iso8601: handle timezoneless dates @@ -9217,22 +34192,22 @@ Date: Tue Sep 1 09:37:48 2009 -0400 Based on a patch from Andy Shevchenko http://bugzilla.gnome.org/show_bug.cgi?id=589491 - glib/gtimer.c | 18 +++++++++++++----- + glib/gtimer.c | 18 +++++++++++++----- tests/testglib.c | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) commit fc44bf40a4eff8e122b223e97ee5efcbc548be03 Author: Benjamin Otte -Date: Tue Sep 1 12:48:55 2009 +0200 +Date: Tue Sep 1 12:48:55 2009 +0200 Fix gtk-doc syntax - gio/gcancellable.c | 8 ++++---- + gio/gcancellable.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) commit e695c0932f5d02f3b222f0b7a3de1f8c00ba7b81 Author: Benjamin Otte -Date: Tue Sep 1 11:54:48 2009 +0200 +Date: Tue Sep 1 11:54:48 2009 +0200 Bug 593406 - Permissions set to 777 after copying via Nautilus @@ -9255,7 +34230,7 @@ Date: Tue Sep 1 11:54:48 2009 +0200 commit e967a47117d3b8fdb3e5c786e9069872d8e787c4 Author: Kjartan Maraas -Date: Tue Sep 1 10:52:07 2009 +0200 +Date: Tue Sep 1 10:52:07 2009 +0200 Update Norwegian bokmål translation. @@ -9265,7 +34240,7 @@ Date: Tue Sep 1 10:52:07 2009 +0200 commit c433158e8676424ede4e396b6d4bf22d5210634b Author: Sandeep Shedmake -Date: Mon Aug 31 20:47:13 2009 +0530 +Date: Mon Aug 31 20:47:13 2009 +0530 Updated Marathi Translations @@ -9275,7 +34250,7 @@ Date: Mon Aug 31 20:47:13 2009 +0530 commit c59dbb4ddfb824c022087d15d75d3f5de1c032cc Author: Sandeep Shedmake -Date: Mon Aug 31 20:29:16 2009 +0530 +Date: Mon Aug 31 20:29:16 2009 +0530 Updated Marathi Translations @@ -9285,7 +34260,7 @@ Date: Mon Aug 31 20:29:16 2009 +0530 commit ee8e145472c9b90e89d568710b9672bb20ada524 Author: krishnababu k -Date: Mon Aug 31 19:41:54 2009 +0530 +Date: Mon Aug 31 19:41:54 2009 +0530 Updated Telugu Translations @@ -9295,7 +34270,7 @@ Date: Mon Aug 31 19:41:54 2009 +0530 commit 3a7560b00a8846150be4d9d2113f352ff1ebcc7a Author: Shankar Prasad -Date: Mon Aug 31 13:34:44 2009 +0530 +Date: Mon Aug 31 13:34:44 2009 +0530 Updated Kannada(kn) translation @@ -9305,16 +34280,16 @@ Date: Mon Aug 31 13:34:44 2009 +0530 commit 31924b19806e31f38eff86d4e43248bec989fd3a Author: Rodrigo L. M. Flores -Date: Sun Aug 30 19:41:47 2009 -0300 +Date: Sun Aug 30 19:41:47 2009 -0300 Updated Brazilian Portuguese mailing list address. - po/pt_BR.po | 4 ++-- + po/pt_BR.po | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit f2b8b6911235358d25b79d75f98d81b5062afe33 Author: Petr Kovar -Date: Sat Aug 29 21:05:19 2009 +0200 +Date: Sat Aug 29 21:05:19 2009 +0200 Updated Czech translation @@ -9324,7 +34299,7 @@ Date: Sat Aug 29 21:05:19 2009 +0200 commit c47dca4cfe51b9376c364ae13a444a6529afed8f Author: Matthias Clasen -Date: Thu Aug 27 23:40:16 2009 -0400 +Date: Thu Aug 27 23:40:16 2009 -0400 Re-commit 30b8774f7f3f7f329af6b041b6c86bad14717534 @@ -9335,7 +34310,7 @@ Date: Thu Aug 27 23:40:16 2009 -0400 commit 2889f1b8a322b0657f3c08a4f7e235e4c2c0f348 Author: Matthias Clasen -Date: Thu Aug 27 23:02:08 2009 -0400 +Date: Thu Aug 27 23:02:08 2009 -0400 Use the saved errno value @@ -9346,7 +34321,7 @@ Date: Thu Aug 27 23:02:08 2009 -0400 commit 3ba64e72cf40b81f472aa784498c3a97ef434c94 Author: Matthias Clasen -Date: Thu Aug 27 22:59:05 2009 -0400 +Date: Thu Aug 27 22:59:05 2009 -0400 Read /dev/urandom unbuffered @@ -9357,7 +34332,7 @@ Date: Thu Aug 27 22:59:05 2009 -0400 commit 3a47f48311d44e690c381f816fd1fa71eed20189 Author: Matthias Clasen -Date: Thu Aug 27 22:51:53 2009 -0400 +Date: Thu Aug 27 22:51:53 2009 -0400 Revert "add a "gsettings-backend" extension point to GIO" @@ -9368,7 +34343,7 @@ Date: Thu Aug 27 22:51:53 2009 -0400 commit 30b8774f7f3f7f329af6b041b6c86bad14717534 Author: Ryan Lortie -Date: Thu Aug 27 13:45:48 2009 -0400 +Date: Thu Aug 27 13:45:48 2009 -0400 add a "gsettings-backend" extension point to GIO @@ -9377,7 +34352,7 @@ Date: Thu Aug 27 13:45:48 2009 -0400 commit df981f82a097f9a2f2739ec410fa928168b749f6 Author: Luca Ferretti -Date: Wed Aug 26 22:04:58 2009 +0200 +Date: Wed Aug 26 22:04:58 2009 +0200 Updated Italian translation @@ -9386,7 +34361,7 @@ Date: Wed Aug 26 22:04:58 2009 +0200 commit 71b684b9cfe76d522a306993dba13fbcc52d0d73 Author: Luca Ferretti -Date: Wed Aug 26 15:32:23 2009 +0200 +Date: Wed Aug 26 15:32:23 2009 +0200 Updated Italian translation @@ -9396,7 +34371,7 @@ Date: Wed Aug 26 15:32:23 2009 +0200 commit 884c789ef5e074a2241d1b813847156db1cecdb0 Author: Amitakhya Phukan -Date: Wed Aug 26 17:34:17 2009 +0530 +Date: Wed Aug 26 17:34:17 2009 +0530 Updating Assamese translations @@ -9406,7 +34381,7 @@ Date: Wed Aug 26 17:34:17 2009 +0530 commit 195abb97ff019d0fe7b50a9635830835933be7ae Author: Ani -Date: Wed Aug 26 15:18:57 2009 +0530 +Date: Wed Aug 26 15:18:57 2009 +0530 Updated Malayalam Translations @@ -9416,7 +34391,7 @@ Date: Wed Aug 26 15:18:57 2009 +0530 commit 6c1466a2d21820f2df189a258b0c124e7144ba12 Author: ifelix -Date: Tue Aug 25 14:10:56 2009 +0530 +Date: Tue Aug 25 14:10:56 2009 +0530 Updated Tamil Translations @@ -9426,7 +34401,7 @@ Date: Tue Aug 25 14:10:56 2009 +0530 commit 64b49c9087e8120489a0032d596c8837cbe014f9 Author: Manoj Kumar Giri -Date: Tue Aug 25 12:14:41 2009 +0530 +Date: Tue Aug 25 12:14:41 2009 +0530 Updated Oriya Translation @@ -9436,7 +34411,7 @@ Date: Tue Aug 25 12:14:41 2009 +0530 commit 24c31a79e1af916fe195e52c79ff8be558e4e848 Author: Baris Cicek -Date: Tue Aug 25 00:38:34 2009 +0300 +Date: Tue Aug 25 00:38:34 2009 +0300 Updated Turkish translation. @@ -9446,7 +34421,7 @@ Date: Tue Aug 25 00:38:34 2009 +0300 commit ef5aef582eb33fd29fe5ec427ef5d236656b8046 Author: Luca Ferretti -Date: Mon Aug 24 21:28:11 2009 +0200 +Date: Mon Aug 24 21:28:11 2009 +0200 Fix bump version @@ -9455,7 +34430,7 @@ Date: Mon Aug 24 21:28:11 2009 +0200 commit 83d3242d127ca61d94846341ab491bbe988d2b95 Author: Matthias Clasen -Date: Mon Aug 24 14:15:13 2009 -0400 +Date: Mon Aug 24 14:15:13 2009 -0400 Bump version @@ -9464,115 +34439,115 @@ Date: Mon Aug 24 14:15:13 2009 -0400 commit 106cd06ff38fef0356961e1d2eaffaa022035b13 Author: Matthias Clasen -Date: Mon Aug 24 14:13:49 2009 -0400 +Date: Mon Aug 24 14:13:49 2009 -0400 2.21.5 - po/am.po | 120 +++--- - po/ar.po | 120 +++--- - po/as.po | 120 +++--- - po/az.po | 120 +++--- - po/be.po | 120 +++--- + po/am.po | 120 +++--- + po/ar.po | 120 +++--- + po/as.po | 120 +++--- + po/az.po | 120 +++--- + po/be.po | 120 +++--- po/be@latin.po | 120 +++--- - po/bg.po | 918 +++++++++++++++++----------------- - po/bn.po | 120 +++--- - po/bn_IN.po | 120 +++--- - po/bs.po | 120 +++--- - po/ca.po | 120 +++--- + po/bg.po | 918 +++++++++++++++++----------------- + po/bn.po | 120 +++--- + po/bn_IN.po | 120 +++--- + po/bs.po | 120 +++--- + po/ca.po | 120 +++--- po/ca@valencia.po | 918 +++++++++++++++++----------------- - po/cs.po | 120 +++--- - po/cy.po | 120 +++--- - po/da.po | 923 +++++++++++++++++----------------- - po/de.po | 120 +++--- - po/dz.po | 120 +++--- - po/el.po | 120 +++--- - po/en_CA.po | 120 +++--- - po/en_GB.po | 120 +++--- - po/eo.po | 120 +++--- - po/es.po | 921 +++++++++++++++++----------------- - po/et.po | 463 +++++++++++++++++- - po/eu.po | 988 +++++++++++++++++++------------------ - po/fa.po | 120 +++--- - po/fi.po | 923 +++++++++++++++++----------------- - po/fr.po | 120 +++--- - po/ga.po | 921 +++++++++++++++++----------------- - po/gl.po | 918 +++++++++++++++++----------------- - po/gu.po | 945 ++++++++++++++++++----------------- - po/he.po | 120 +++--- - po/hi.po | 942 ++++++++++++++++++----------------- - po/hr.po | 120 +++--- - po/hu.po | 120 +++--- - po/hy.po | 120 +++--- - po/id.po | 120 +++--- - po/is.po | 120 +++--- - po/it.po | 921 +++++++++++++++++----------------- - po/ja.po | 64 ++-- - po/ka.po | 120 +++--- - po/kn.po | 120 +++--- - po/ko.po | 931 +++++++++++++++++----------------- - po/ku.po | 120 +++--- - po/lt.po | 120 +++--- - po/lv.po | 120 +++--- - po/mai.po | 120 +++--- - po/mg.po | 120 +++--- - po/mk.po | 120 +++--- - po/ml.po | 120 +++--- - po/mn.po | 120 +++--- - po/mr.po | 120 +++--- - po/ms.po | 120 +++--- - po/nb.po | 920 +++++++++++++++++----------------- - po/ne.po | 120 +++--- - po/nl.po | 120 +++--- - po/nn.po | 120 +++--- - po/oc.po | 120 +++--- - po/or.po | 120 +++--- - po/pa.po | 961 ++++++++++++++++++----------------- - po/pl.po | 919 +++++++++++++++++----------------- - po/ps.po | 120 +++--- - po/pt.po | 927 +++++++++++++++++----------------- - po/pt_BR.po | 923 +++++++++++++++++----------------- - po/ro.po | 120 +++--- - po/ru.po | 120 +++--- - po/rw.po | 120 +++--- - po/si.po | 120 +++--- - po/sk.po | 120 +++--- - po/sl.po | 120 +++--- - po/sq.po | 120 +++--- - po/sr.po | 120 +++--- - po/sr@ije.po | 120 +++--- + po/cs.po | 120 +++--- + po/cy.po | 120 +++--- + po/da.po | 923 +++++++++++++++++----------------- + po/de.po | 120 +++--- + po/dz.po | 120 +++--- + po/el.po | 120 +++--- + po/en_CA.po | 120 +++--- + po/en_GB.po | 120 +++--- + po/eo.po | 120 +++--- + po/es.po | 921 +++++++++++++++++----------------- + po/et.po | 463 +++++++++++++++++- + po/eu.po | 988 +++++++++++++++++++------------------ + po/fa.po | 120 +++--- + po/fi.po | 923 +++++++++++++++++----------------- + po/fr.po | 120 +++--- + po/ga.po | 921 +++++++++++++++++----------------- + po/gl.po | 918 +++++++++++++++++----------------- + po/gu.po | 945 ++++++++++++++++++----------------- + po/he.po | 120 +++--- + po/hi.po | 942 ++++++++++++++++++----------------- + po/hr.po | 120 +++--- + po/hu.po | 120 +++--- + po/hy.po | 120 +++--- + po/id.po | 120 +++--- + po/is.po | 120 +++--- + po/it.po | 921 +++++++++++++++++----------------- + po/ja.po | 64 ++-- + po/ka.po | 120 +++--- + po/kn.po | 120 +++--- + po/ko.po | 931 +++++++++++++++++----------------- + po/ku.po | 120 +++--- + po/lt.po | 120 +++--- + po/lv.po | 120 +++--- + po/mai.po | 120 +++--- + po/mg.po | 120 +++--- + po/mk.po | 120 +++--- + po/ml.po | 120 +++--- + po/mn.po | 120 +++--- + po/mr.po | 120 +++--- + po/ms.po | 120 +++--- + po/nb.po | 920 +++++++++++++++++----------------- + po/ne.po | 120 +++--- + po/nl.po | 120 +++--- + po/nn.po | 120 +++--- + po/oc.po | 120 +++--- + po/or.po | 120 +++--- + po/pa.po | 961 ++++++++++++++++++----------------- + po/pl.po | 919 +++++++++++++++++----------------- + po/ps.po | 120 +++--- + po/pt.po | 927 +++++++++++++++++----------------- + po/pt_BR.po | 923 +++++++++++++++++----------------- + po/ro.po | 120 +++--- + po/ru.po | 120 +++--- + po/rw.po | 120 +++--- + po/si.po | 120 +++--- + po/sk.po | 120 +++--- + po/sl.po | 120 +++--- + po/sq.po | 120 +++--- + po/sr.po | 120 +++--- + po/sr@ije.po | 120 +++--- po/sr@latin.po | 120 +++--- - po/sv.po | 1436 + po/sv.po | 1436 ++++++++++++++++++++++++++--------------------------- - po/ta.po | 120 +++--- - po/te.po | 921 +++++++++++++++++----------------- - po/th.po | 120 +++--- - po/tl.po | 120 +++--- - po/tr.po | 120 +++--- - po/tt.po | 120 +++--- - po/uk.po | 120 +++--- - po/vi.po | 120 +++--- - po/wa.po | 120 +++--- - po/xh.po | 120 +++--- - po/yi.po | 120 +++--- - po/zh_CN.po | 120 +++--- - po/zh_HK.po | 936 +++++++++++++++++----------------- - po/zh_TW.po | 921 +++++++++++++++++----------------- + po/ta.po | 120 +++--- + po/te.po | 921 +++++++++++++++++----------------- + po/th.po | 120 +++--- + po/tl.po | 120 +++--- + po/tr.po | 120 +++--- + po/tt.po | 120 +++--- + po/uk.po | 120 +++--- + po/vi.po | 120 +++--- + po/wa.po | 120 +++--- + po/xh.po | 120 +++--- + po/yi.po | 120 +++--- + po/zh_CN.po | 120 +++--- + po/zh_HK.po | 936 +++++++++++++++++----------------- + po/zh_TW.po | 921 +++++++++++++++++----------------- 88 files changed, 14418 insertions(+), 13942 deletions(-) commit eadef0325aefb68ae0747a7dbca7d6fca4130da2 Author: Matthias Clasen -Date: Mon Aug 24 13:34:06 2009 -0400 +Date: Mon Aug 24 13:34:06 2009 -0400 Documentation fixes docs/reference/gio/gio-sections.txt | 5 +++++ docs/reference/glib/glib-sections.txt | 1 + - gio/gfileinfo.c | 2 ++ + gio/gfileinfo.c | 2 ++ 3 files changed, 8 insertions(+), 0 deletions(-) commit d1cbb96428f316b77bd31686c7d9b0b96a40bc6e Author: Matthias Clasen -Date: Mon Aug 24 12:21:08 2009 -0400 +Date: Mon Aug 24 12:21:08 2009 -0400 Updates @@ -9581,7 +34556,7 @@ Date: Mon Aug 24 12:21:08 2009 -0400 commit 002da02df8927e1aa5979347402a6fc378dd172f Author: Carles Ferrando -Date: Mon Aug 24 18:38:33 2009 +0200 +Date: Mon Aug 24 18:38:33 2009 +0200 Minor update to Catalan (Valencian) translation @@ -9591,7 +34566,7 @@ Date: Mon Aug 24 18:38:33 2009 +0200 commit 2e0656063b2c2633ca0caaa9b2e119c3eaee37cf Author: Rajesh Ranjan -Date: Mon Aug 24 16:52:25 2009 +0530 +Date: Mon Aug 24 16:52:25 2009 +0530 hindi updated by Rajesh Ranjan @@ -9601,7 +34576,7 @@ Date: Mon Aug 24 16:52:25 2009 +0530 commit 4a5e71b847729341243df2f2a2cd0a8284f4b099 Author: Sweta Kothari -Date: Mon Aug 24 14:23:56 2009 +0530 +Date: Mon Aug 24 14:23:56 2009 +0530 Updated Gujarati Translations @@ -9611,7 +34586,7 @@ Date: Mon Aug 24 14:23:56 2009 +0530 commit 90f9eb6e40b6d8c37ca51467f915507ed6ceddc2 Author: Duarte Loreto -Date: Sun Aug 23 14:59:14 2009 +0100 +Date: Sun Aug 23 14:59:14 2009 +0100 Updated Portuguese translation @@ -9621,7 +34596,7 @@ Date: Sun Aug 23 14:59:14 2009 +0100 commit feedeb1d12fa490a8685fd00b492fdc054e07883 Author: Changwoo Ryu -Date: Sun Aug 23 00:50:28 2009 +0900 +Date: Sun Aug 23 00:50:28 2009 +0900 Update Korean translation @@ -9631,21 +34606,21 @@ Date: Sun Aug 23 00:50:28 2009 +0900 commit 8ef30758d56b21aa20c23e5c90a78142183003ed Author: Christian Persch -Date: Thu Aug 20 15:13:43 2009 +0200 +Date: Thu Aug 20 15:13:43 2009 +0200 Preserve errno When using errno in g_set_error with _(), preserve errno. Bug #592457. - glib/gconvert.c | 22 +++++++++++++++------- - glib/gdir.c | 13 +++++++++---- - glib/gspawn-win32.c | 9 ++++++--- - glib/gspawn.c | 27 +++++++++++++++++++-------- + glib/gconvert.c | 22 +++++++++++++++------- + glib/gdir.c | 13 +++++++++---- + glib/gspawn-win32.c | 9 ++++++--- + glib/gspawn.c | 27 +++++++++++++++++++-------- 4 files changed, 49 insertions(+), 22 deletions(-) commit feff29aefc75459bc1b39235cb0e842fbf0fa2b4 Author: A S Alam -Date: Sat Aug 22 06:15:29 2009 +0530 +Date: Sat Aug 22 06:15:29 2009 +0530 Update Punjabi after Review @@ -9655,7 +34630,7 @@ Date: Sat Aug 22 06:15:29 2009 +0530 commit a568b054adf4abadfaa1bad293d484771d57f333 Author: Tommi Vainikainen -Date: Fri Aug 21 23:43:53 2009 +0300 +Date: Fri Aug 21 23:43:53 2009 +0300 Updated Finnish translation @@ -9665,7 +34640,7 @@ Date: Fri Aug 21 23:43:53 2009 +0300 commit 956996ddaa82ca5cfeb8e70191ef6b7716186a7c Author: Takayuki KUSANO -Date: Fri Aug 21 00:15:12 2009 +0900 +Date: Fri Aug 21 00:15:12 2009 +0900 Update Japanese translation. @@ -9675,7 +34650,7 @@ Date: Fri Aug 21 00:15:12 2009 +0900 commit 2a880831edc4c22ed5ada05a31ab8a4f24b7d3e1 Author: Tomasz Dominikowski -Date: Thu Aug 20 11:55:03 2009 +0200 +Date: Thu Aug 20 11:55:03 2009 +0200 Updated Polish translation @@ -9685,7 +34660,7 @@ Date: Thu Aug 20 11:55:03 2009 +0200 commit cd5bd15987b573a436e715e59b0c651e50534bc1 Author: Dan Winship -Date: Wed Aug 19 12:12:06 2009 -0400 +Date: Wed Aug 19 12:12:06 2009 -0400 Use MSG_NOSIGNAL in GSocket if it's available @@ -9701,7 +34676,7 @@ Date: Wed Aug 19 12:12:06 2009 -0400 commit 021dd960cf9c02b0ea59cbfa1db603d3f9a467f0 Author: Dan Winship -Date: Wed Aug 19 12:07:53 2009 -0400 +Date: Wed Aug 19 12:07:53 2009 -0400 Re-run res_init() when resolv.conf changes @@ -9711,55 +34686,55 @@ Date: Wed Aug 19 12:07:53 2009 -0400 http://bugzilla.gnome.org/show_bug.cgi?id=584246 gio/gnetworkingprivate.h | 4 ++ - gio/gresolver.c | 68 + gio/gresolver.c | 68 +++++++++++++++++++++++++++++++++++++++++++ - gio/gresolver.h | 9 +++++- - gio/gunixresolver.c | 72 + gio/gresolver.h | 9 +++++- + gio/gunixresolver.c | 72 +++++++++++++++++++++++++++++++-------------- - gio/tests/resolver.c | 3 ++ + gio/tests/resolver.c | 3 ++ 5 files changed, 132 insertions(+), 24 deletions(-) commit 6db03d73a45bc0acae0bb96849733bf0ab7ad454 Author: Benjamin Otte -Date: Tue Aug 11 18:50:28 2009 +0200 +Date: Tue Aug 11 18:50:28 2009 +0200 When creating a pipe for a cancelled cancellable, write to it Includes (untested) fix for win32 that calls SetEvent() in that case. - gio/gcancellable.c | 8 ++++++-- + gio/gcancellable.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) commit faae032ad0579acf756e8848ebedbfda69d5b3be Author: Benjamin Otte -Date: Tue Aug 11 15:12:20 2009 +0200 +Date: Tue Aug 11 15:12:20 2009 +0200 Use g_cancellable_release_fd() Part of: Bug 591388 - number of GCancellables available is too limited - gio/gsocket.c | 10 +++++++++- + gio/gsocket.c | 10 +++++++++- gio/gunixinputstream.c | 3 ++- gio/gunixoutputstream.c | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) commit e2c97292c21dbb57d34d812cf48b331ca5cf0d60 Author: Benjamin Otte -Date: Tue Aug 11 15:04:43 2009 +0200 +Date: Tue Aug 11 15:04:43 2009 +0200 Implement g_cancellable_release_fd() Part of: Bug 591388 - number of GCancellables available is too limited - gio/gcancellable.c | 77 + gio/gcancellable.c | 77 +++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 58 insertions(+), 19 deletions(-) commit 63426886ff4066fefbeaf2e6b08a6c04b39a7890 Author: Benjamin Otte -Date: Tue Aug 11 14:52:56 2009 +0200 +Date: Tue Aug 11 14:52:56 2009 +0200 Add g_cancellable_release_fd() @@ -9769,16 +34744,16 @@ Date: Tue Aug 11 14:52:56 2009 +0200 Part of: Bug 591388 - number of GCancellables available is too limited - docs/reference/gio/gio-sections.txt | 1 + - gio/gcancellable.c | 30 ++++++++++++++++++++++++++++++ - gio/gcancellable.h | 1 + - gio/ginputstream.c | 2 +- - gio/gio.symbols | 1 + + docs/reference/gio/gio-sections.txt | 1 + + gio/gcancellable.c | 30 ++++++++++++++++++++++++++++++ + gio/gcancellable.h | 1 + + gio/ginputstream.c | 2 +- + gio/gio.symbols | 1 + 5 files changed, 34 insertions(+), 1 deletions(-) commit bb8e4f06ab1a0ada2c8835284ec5f853378694e2 Author: Benjamin Otte -Date: Thu Aug 13 20:19:15 2009 +0200 +Date: Thu Aug 13 20:19:15 2009 +0200 Bug 591714 – Figure out failure handling for g_cancellable_make_pollfd() @@ -9787,25 +34762,25 @@ Date: Thu Aug 13 20:19:15 2009 +0200 its error status. Update the code that calls this function accordingly. - gio/gcancellable.c | 38 +++++++++++++++++++++++++------------- - gio/gcancellable.h | 2 +- - gio/gsocket.c | 19 ++++++------------- + gio/gcancellable.c | 38 +++++++++++++++++++++++++------------- + gio/gcancellable.h | 2 +- + gio/gsocket.c | 19 ++++++------------- gio/gunixinputstream.c | 3 +-- gio/gunixoutputstream.c | 3 +-- 5 files changed, 34 insertions(+), 31 deletions(-) commit a0e3b4ae8447f0831397384a54f4be276e84764b Author: Og B. Maciel -Date: Tue Aug 18 23:09:12 2009 -0400 +Date: Tue Aug 18 23:09:12 2009 -0400 Updated Brazilian Portuguese translation. - po/pt_BR.po | 19 +++++++------------ + po/pt_BR.po | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) commit 981d14e85ccf8d1dc721bd44e030728eff9b2501 Author: Benjamin Otte -Date: Thu Aug 6 18:17:32 2009 +0200 +Date: Thu Aug 6 18:17:32 2009 +0200 Improve documentation for g_error_matches() @@ -9814,7 +34789,7 @@ Date: Thu Aug 6 18:17:32 2009 +0200 commit a6ac4e90d5ab6a311aab545745ceb3e375bf65a4 Author: Benjamin Otte -Date: Mon Jul 27 18:48:11 2009 +0200 +Date: Mon Jul 27 18:48:11 2009 +0200 Fix multiple returns in gtk-doc comment @@ -9823,7 +34798,7 @@ Date: Mon Jul 27 18:48:11 2009 +0200 commit 8f6d26e9647db4e5f2336319e1b0ae439f54b75d Author: Dan Winship -Date: Mon Aug 17 13:20:49 2009 -0400 +Date: Mon Aug 17 13:20:49 2009 -0400 g_inet_socket_address_to_native: properly zero out sockaddr_in6 @@ -9832,7 +34807,7 @@ Date: Mon Aug 17 13:20:49 2009 -0400 commit aa5293612f2eb0a6a02fbf74eb56bbf05faba8df Author: Ask H. Larsen -Date: Sun Aug 16 19:10:50 2009 +0200 +Date: Sun Aug 16 19:10:50 2009 +0200 Updated Danish translation @@ -9842,7 +34817,7 @@ Date: Sun Aug 16 19:10:50 2009 +0200 commit 2db41f3df58a3d926da2a4afa7014118db2913e2 Author: Mattias Põldaru -Date: Sat Aug 15 08:21:01 2009 +0300 +Date: Sat Aug 15 08:21:01 2009 +0300 Updating Estonian translation @@ -9851,7 +34826,7 @@ Date: Sat Aug 15 08:21:01 2009 +0300 commit 406c3aa019a6ce51534f170fd5b82108382a4c6f Author: Shixin Zeng -Date: Fri Aug 14 23:21:12 2009 +0300 +Date: Fri Aug 14 23:21:12 2009 +0300 [Win32] Avoid superfluous '/' from g_file_resolve_relative_path() @@ -9862,7 +34837,7 @@ Date: Fri Aug 14 23:21:12 2009 +0300 commit 1b298d6a1bc3b4e5c1c701f26e3981cdae4b89eb Author: Tor Lillqvist -Date: Fri Aug 14 22:59:47 2009 +0300 +Date: Fri Aug 14 22:59:47 2009 +0300 Avoid gcc warning on Windows @@ -9874,7 +34849,7 @@ Date: Fri Aug 14 22:59:47 2009 +0300 commit c24f6e55276fac68b08df34b0d350f65afe994d9 Author: Frédéric Péters -Date: Fri Aug 14 21:00:41 2009 +0200 +Date: Fri Aug 14 21:00:41 2009 +0200 Update GLIB_CHECK_COMPILE_WARNINGS macro to work with Autoconf 2.64 @@ -9885,12 +34860,12 @@ Date: Fri Aug 14 21:00:41 2009 +0200 http://bugzilla.gnome.org/show_bug.cgi?id=591840 - acglib.m4 | 2 +- + acglib.m4 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit eae6bdd397ef94a6f7c1a3e42c750b948a659fd2 Author: Priit Laes -Date: Fri Aug 14 22:09:18 2009 +0300 +Date: Fri Aug 14 22:09:18 2009 +0300 Updating Estonian translation @@ -9900,7 +34875,7 @@ Date: Fri Aug 14 22:09:18 2009 +0300 commit 37dbffe7d8b0f0985f9c4d37d5df604d81ff0bd0 Author: krishnababu k -Date: Fri Aug 14 16:56:09 2009 +0530 +Date: Fri Aug 14 16:56:09 2009 +0530 Updated Telugu Translations @@ -9910,7 +34885,7 @@ Date: Fri Aug 14 16:56:09 2009 +0530 commit 8b117b225e426b73c8fb2abc2ac5e56ed739ac96 Author: Alexander Shopov -Date: Thu Aug 13 07:12:29 2009 +0300 +Date: Thu Aug 13 07:12:29 2009 +0300 Updated Bulgarian translation @@ -9920,7 +34895,7 @@ Date: Thu Aug 13 07:12:29 2009 +0300 commit 4f8dfc6282cc29430775e1ebd2652d67c08b1a6c Author: Henrique P Machado -Date: Tue Aug 11 23:40:09 2009 -0300 +Date: Tue Aug 11 23:40:09 2009 -0300 Updated Brazilian Portuguese translation. @@ -9930,7 +34905,7 @@ Date: Tue Aug 11 23:40:09 2009 -0300 commit d20a188b1250ab3cf211d684429127d99378e886 Author: Alexander Larsson -Date: Tue Aug 11 20:22:51 2009 +0200 +Date: Tue Aug 11 20:22:51 2009 +0200 Only fsync if the existing file is > 0 bytes @@ -9945,7 +34920,7 @@ Date: Tue Aug 11 20:22:51 2009 +0200 commit 79a70dc80056859f10b39c711ee43389e8c32a7f Author: Luca Ferretti -Date: Tue Aug 11 01:27:08 2009 +0200 +Date: Tue Aug 11 01:27:08 2009 +0200 Updated Italian translation @@ -9955,7 +34930,7 @@ Date: Tue Aug 11 01:27:08 2009 +0200 commit c18bcd6e8e385628e55166eabbd93d5c87c82da0 Author: Antón Méixome -Date: Mon Aug 10 16:26:46 2009 +0200 +Date: Mon Aug 10 16:26:46 2009 +0200 Updated Galician translation @@ -9965,7 +34940,7 @@ Date: Mon Aug 10 16:26:46 2009 +0200 commit a465508e2d3d52b919ccbf9f2c5bd90395922904 Author: Craig Loftus -Date: Thu Jul 23 20:24:22 2009 +0100 +Date: Thu Jul 23 20:24:22 2009 +0100 Migrate gbase64 docs from SGML template to inline comments @@ -9975,12 +34950,12 @@ Date: Thu Jul 23 20:24:22 2009 +0100 docs/reference/glib/tmpl/base64.sgml | 105 ---------------------------------- - glib/gbase64.c | 20 +++++++ + glib/gbase64.c | 20 +++++++ 2 files changed, 20 insertions(+), 105 deletions(-) commit 32c84729f5dac30170cf20aa44e6857a44e5349f Author: Inaki Larranaga Murgoitio -Date: Mon Aug 10 13:57:21 2009 +0200 +Date: Mon Aug 10 13:57:21 2009 +0200 Updated Basque language @@ -9990,7 +34965,7 @@ Date: Mon Aug 10 13:57:21 2009 +0200 commit f2d779aa0f5ba676fa8715710cebd2607cb339a3 Author: Antón Méixome -Date: Sun Aug 9 16:35:09 2009 +0200 +Date: Sun Aug 9 16:35:09 2009 +0200 Updated Galician Translation @@ -10000,7 +34975,7 @@ Date: Sun Aug 9 16:35:09 2009 +0200 commit f04a35e43bece5e51061dcef2ebc6dd6204a1c1b Author: Matthias Clasen -Date: Fri Jul 17 20:34:16 2009 -0400 +Date: Fri Jul 17 20:34:16 2009 -0400 Bump version @@ -10009,7 +34984,7 @@ Date: Fri Jul 17 20:34:16 2009 -0400 commit 5827f6674282d627efbb9c68d32577470d722192 Author: Seán de Búrca -Date: Sat Aug 8 01:53:34 2009 -0600 +Date: Sat Aug 8 01:53:34 2009 -0600 Updated Irish translation @@ -10019,7 +34994,7 @@ Date: Sat Aug 8 01:53:34 2009 -0600 commit 93d40918c59981f863d31a10d9f66a2a9b3177ff Author: Philip Withnall -Date: Sat Aug 1 16:46:02 2009 +0100 +Date: Sat Aug 1 16:46:02 2009 +0100 Added clarification to mutex free functions @@ -10030,7 +35005,7 @@ Date: Sat Aug 1 16:46:02 2009 +0100 commit faccd7fdf3edb8416aacc0191fdb6c5b2965ac6d Author: Ivar Smolin -Date: Wed Aug 5 13:29:26 2009 +0300 +Date: Wed Aug 5 13:29:26 2009 +0300 Updating Estonian translation @@ -10040,7 +35015,7 @@ Date: Wed Aug 5 13:29:26 2009 +0300 commit 405823aeea24fb2ce8d47e0c09e46607117fd27f Author: Kjartan Maraas -Date: Mon Aug 3 00:16:54 2009 +0200 +Date: Mon Aug 3 00:16:54 2009 +0200 Updated Norwegian bokmål translation. @@ -10049,7 +35024,7 @@ Date: Mon Aug 3 00:16:54 2009 +0200 commit 882e36106d7a5d04c29af87e4e9f7aa4bc3d5e08 Author: Dan Winship -Date: Thu Jul 30 11:18:35 2009 -0400 +Date: Thu Jul 30 11:18:35 2009 -0400 Fix a bad void return. #588901 @@ -10058,18 +35033,18 @@ Date: Thu Jul 30 11:18:35 2009 -0400 commit f34b1f024feb57e6eb78728d46ff2bbf2ca19453 Author: Dan Winship -Date: Wed Jul 29 22:35:07 2009 -0400 +Date: Wed Jul 29 22:35:07 2009 -0400 Conditionalize portability #includes in g-asyncns.h http://bugzilla.gnome.org/show_bug.cgi?id=589988 - gio/libasyncns/g-asyncns.h | 6 ++++++ + gio/libasyncns/g-asyncns.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) commit 81de534cf73b63add07ff93d851824da80eb4280 Author: Daniel Nylander -Date: Tue Jul 28 01:59:05 2009 +0200 +Date: Tue Jul 28 01:59:05 2009 +0200 Updated Swedish translation @@ -10079,23 +35054,23 @@ Date: Tue Jul 28 01:59:05 2009 +0200 commit 45067ab9e97de0992acd4004d6e4de957d6c28f4 Author: Dan Winship -Date: Thu Jul 23 16:27:01 2009 -0400 +Date: Thu Jul 23 16:27:01 2009 -0400 Fix leaks in GSocketClient and GThreadedResolver Also update gio/tests/send-data.c to test async connection, and free more stuff in several tests to make leaks easier to see. - gio/gsocketclient.c | 3 +++ - gio/gthreadedresolver.c | 6 +++++- - gio/tests/send-data.c | 25 +++++++++++++++++++++---- - gio/tests/socket-client.c | 2 ++ - gio/tests/socket-server.c | 1 + + gio/gsocketclient.c | 3 +++ + gio/gthreadedresolver.c | 6 +++++- + gio/tests/send-data.c | 25 +++++++++++++++++++++---- + gio/tests/socket-client.c | 2 ++ + gio/tests/socket-server.c | 1 + 5 files changed, 32 insertions(+), 5 deletions(-) commit 66ff2542d32c93226a28ad1d0a60e83884b26910 Author: Kjartan Maraas -Date: Wed Jul 22 18:58:57 2009 +0200 +Date: Wed Jul 22 18:58:57 2009 +0200 Updated Norwegian bokmål translation. @@ -10105,7 +35080,7 @@ Date: Wed Jul 22 18:58:57 2009 +0200 commit aac978ec7240cdab768c1d66c0e9a94c714dff43 Author: Tristan Van Berkom -Date: Tue Jul 21 12:58:39 2009 -0400 +Date: Tue Jul 21 12:58:39 2009 -0400 Added clarification to GArray->len documentation @@ -10117,7 +35092,7 @@ Date: Tue Jul 21 12:58:39 2009 -0400 commit 4654a7d593aed9ab0e131abe250e7e488283c24f Author: Lin Ma -Date: Tue Jul 21 10:45:25 2009 +0800 +Date: Tue Jul 21 10:45:25 2009 +0800 Fixed a missing head which will cause crashes for 64bit applications @@ -10130,7 +35105,7 @@ Date: Tue Jul 21 10:45:25 2009 +0800 commit ba6be2035d9bd43b1a873492e189d0bccbd20178 Author: Behdad Esfahbod -Date: Fri Jun 5 23:24:28 2009 -0400 +Date: Fri Jun 5 23:24:28 2009 -0400 [gbsearcharray] Use malloc() instead of realloc(NULL,...) @@ -10139,16 +35114,16 @@ Date: Fri Jun 5 23:24:28 2009 -0400 commit dfda26d1a980e6e096d93ecfec8f59872b80dee4 Author: Benjamin Otte -Date: Mon Jul 20 14:29:32 2009 +0200 +Date: Mon Jul 20 14:29:32 2009 +0200 Propagate the right error - gio/gsocketclient.c | 2 +- + gio/gsocketclient.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 2cf3e2ed275f8502e1a20195290fa18ebe489216 Author: Jorge González -Date: Sun Jul 19 13:15:06 2009 +0200 +Date: Sun Jul 19 13:15:06 2009 +0200 Updated Spanish translation @@ -10158,7 +35133,7 @@ Date: Sun Jul 19 13:15:06 2009 +0200 commit 555aa2d28db4f72373d9cfec4045ea1d0f45bb46 Author: Theppitak Karoonboonyanan -Date: Sun Jul 19 16:33:06 2009 +0700 +Date: Sun Jul 19 16:33:06 2009 +0700 Updated Thai translation. @@ -10168,7 +35143,7 @@ Date: Sun Jul 19 16:33:06 2009 +0700 commit f8d1201248cceab59bb971f4906a73f2b0eb0b96 Author: Chao-Hsiung Liao -Date: Sat Jul 18 21:09:14 2009 +0800 +Date: Sat Jul 18 21:09:14 2009 +0800 Updated Traditional Chinese translation(Hong Kong and Taiwan) @@ -10180,105 +35155,105 @@ Date: Sat Jul 18 21:09:14 2009 +0800 commit 9c278ded7d9a4db91dbe96aeb13b6cbb7841525b Author: Matthias Clasen -Date: Fri Jul 17 20:31:28 2009 -0400 +Date: Fri Jul 17 20:31:28 2009 -0400 2.21.4 - docs/reference/glib/tmpl/trees-binary.sgml | 17 + - po/am.po | 228 ++++- - po/ar.po | 234 +++++- - po/as.po | 234 +++++- - po/az.po | 233 ++++- - po/be.po | 250 +++++- - po/be@latin.po | 250 +++++- - po/bg.po | 234 +++++- - po/bn.po | 232 ++++- - po/bn_IN.po | 234 +++++- - po/bs.po | 233 ++++- - po/ca.po | 237 +++++- - po/ca@valencia.po | 237 +++++- - po/cs.po | 234 +++++- - po/cy.po | 232 ++++- - po/da.po | 237 +++++- - po/de.po | 234 +++++- - po/dz.po | 232 ++++- - po/el.po | 240 +++++- - po/en_CA.po | 234 +++++- - po/en_GB.po | 237 +++++- - po/eo.po | 232 ++++- - po/es.po | 1026 ++++++++++++--------- - po/et.po | 234 +++++- - po/eu.po | 234 +++++- - po/fa.po | 233 ++++- - po/fi.po | 234 +++++- - po/fr.po | 939 ++++++++++--------- - po/ga.po | 229 ++++- - po/gl.po | 234 +++++- - po/gu.po | 234 +++++- - po/he.po | 948 +++++++++---------- - po/hi.po | 234 +++++- - po/hr.po | 229 ++++- - po/hu.po | 234 +++++- - po/hy.po | 229 ++++- - po/id.po | 232 ++++- - po/is.po | 233 ++++- - po/it.po | 234 +++++- - po/ja.po | 234 +++++- - po/ka.po | 230 ++++- - po/kn.po | 234 +++++- - po/ko.po | 234 +++++- - po/ku.po | 228 ++++- - po/lt.po | 234 +++++- - po/lv.po | 232 ++++- - po/mai.po | 233 +++++- - po/mg.po | 229 ++++- - po/mk.po | 234 +++++- - po/ml.po | 234 +++++- - po/mn.po | 233 ++++- - po/mr.po | 234 +++++- - po/ms.po | 233 ++++- - po/nb.po | 1026 ++++++++++++-------- - po/ne.po | 229 ++++- - po/nl.po | 242 +++++- - po/nn.po | 234 +++++- - po/oc.po | 228 ++++- - po/or.po | 234 +++++- - po/pa.po | 234 +++++- - po/pl.po | 234 +++++- - po/ps.po | 230 ++++- - po/pt.po | 237 +++++- - po/pt_BR.po | 234 +++++- - po/ro.po | 234 +++++- - po/ru.po | 234 +++++- - po/rw.po | 245 +++++- - po/si.po | 230 ++++- - po/sk.po | 231 ++++- - po/sl.po | 234 +++++- - po/sq.po | 285 ++++++- - po/sr.po | 233 ++++- - po/sr@ije.po | 235 ++++- - po/sr@latin.po | 233 ++++- - po/sv.po | 1406 + docs/reference/glib/tmpl/trees-binary.sgml | 17 + + po/am.po | 228 ++++- + po/ar.po | 234 +++++- + po/as.po | 234 +++++- + po/az.po | 233 ++++- + po/be.po | 250 +++++- + po/be@latin.po | 250 +++++- + po/bg.po | 234 +++++- + po/bn.po | 232 ++++- + po/bn_IN.po | 234 +++++- + po/bs.po | 233 ++++- + po/ca.po | 237 +++++- + po/ca@valencia.po | 237 +++++- + po/cs.po | 234 +++++- + po/cy.po | 232 ++++- + po/da.po | 237 +++++- + po/de.po | 234 +++++- + po/dz.po | 232 ++++- + po/el.po | 240 +++++- + po/en_CA.po | 234 +++++- + po/en_GB.po | 237 +++++- + po/eo.po | 232 ++++- + po/es.po | 1026 ++++++++++++--------- + po/et.po | 234 +++++- + po/eu.po | 234 +++++- + po/fa.po | 233 ++++- + po/fi.po | 234 +++++- + po/fr.po | 939 ++++++++++--------- + po/ga.po | 229 ++++- + po/gl.po | 234 +++++- + po/gu.po | 234 +++++- + po/he.po | 948 +++++++++---------- + po/hi.po | 234 +++++- + po/hr.po | 229 ++++- + po/hu.po | 234 +++++- + po/hy.po | 229 ++++- + po/id.po | 232 ++++- + po/is.po | 233 ++++- + po/it.po | 234 +++++- + po/ja.po | 234 +++++- + po/ka.po | 230 ++++- + po/kn.po | 234 +++++- + po/ko.po | 234 +++++- + po/ku.po | 228 ++++- + po/lt.po | 234 +++++- + po/lv.po | 232 ++++- + po/mai.po | 233 +++++- + po/mg.po | 229 ++++- + po/mk.po | 234 +++++- + po/ml.po | 234 +++++- + po/mn.po | 233 ++++- + po/mr.po | 234 +++++- + po/ms.po | 233 ++++- + po/nb.po | 1026 ++++++++++++-------- + po/ne.po | 229 ++++- + po/nl.po | 242 +++++- + po/nn.po | 234 +++++- + po/oc.po | 228 ++++- + po/or.po | 234 +++++- + po/pa.po | 234 +++++- + po/pl.po | 234 +++++- + po/ps.po | 230 ++++- + po/pt.po | 237 +++++- + po/pt_BR.po | 234 +++++- + po/ro.po | 234 +++++- + po/ru.po | 234 +++++- + po/rw.po | 245 +++++- + po/si.po | 230 ++++- + po/sk.po | 231 ++++- + po/sl.po | 234 +++++- + po/sq.po | 285 ++++++- + po/sr.po | 233 ++++- + po/sr@ije.po | 235 ++++- + po/sr@latin.po | 233 ++++- + po/sv.po | 1406 ++++++++++++++++------------ - po/ta.po | 234 +++++- - po/te.po | 234 +++++- - po/th.po | 237 +++++- - po/tl.po | 232 ++++- - po/tr.po | 234 +++++- - po/tt.po | 231 ++++- - po/uk.po | 1024 ++++++++++++-------- - po/vi.po | 234 +++++- - po/wa.po | 233 ++++- - po/xh.po | 233 ++++- - po/yi.po | 232 ++++- - po/zh_CN.po | 234 +++++- - po/zh_HK.po | 1041 ++++++++++++--------- - po/zh_TW.po | 1026 ++++++++++++--------- + po/ta.po | 234 +++++- + po/te.po | 234 +++++- + po/th.po | 237 +++++- + po/tl.po | 232 ++++- + po/tr.po | 234 +++++- + po/tt.po | 231 ++++- + po/uk.po | 1024 ++++++++++++-------- + po/vi.po | 234 +++++- + po/wa.po | 233 ++++- + po/xh.po | 233 ++++- + po/yi.po | 232 ++++- + po/zh_CN.po | 234 +++++- + po/zh_HK.po | 1041 ++++++++++++--------- + po/zh_TW.po | 1026 ++++++++++++--------- 89 files changed, 21688 insertions(+), 5524 deletions(-) commit 4e273d4650621ea095dda5a5e3f1bac4ee8299ae Author: Matthias Clasen -Date: Fri Jul 17 19:01:47 2009 -0400 +Date: Fri Jul 17 19:01:47 2009 -0400 Updates @@ -10287,7 +35262,7 @@ Date: Fri Jul 17 19:01:47 2009 -0400 commit e845e09524fb3be058688050e97f976b11a247dc Author: Yair Hershkovitz -Date: Fri Jul 17 22:53:56 2009 +0300 +Date: Fri Jul 17 22:53:56 2009 +0300 Updated Hebrew translation @@ -10297,7 +35272,7 @@ Date: Fri Jul 17 22:53:56 2009 +0300 commit e4bf2ac41d605a2bd3c858790a0fe36b86bcf7d9 Author: Martin Nordholts -Date: Fri Jul 17 16:49:53 2009 +0200 +Date: Fri Jul 17 16:49:53 2009 +0200 Support silent build rules with automake 1.11 @@ -10310,7 +35285,7 @@ Date: Fri Jul 17 16:49:53 2009 +0200 commit ad0c04c6e9e2ef16dce2e29aeba51f9a7ae8477c Author: Claude Paroz -Date: Tue Jul 14 22:39:31 2009 +0200 +Date: Tue Jul 14 22:39:31 2009 +0200 Updated French translation @@ -10320,7 +35295,7 @@ Date: Tue Jul 14 22:39:31 2009 +0200 commit 9bc208835760823f2fac4e406973d6387805416e Author: Claude Paroz -Date: Tue Jul 14 18:54:58 2009 +0200 +Date: Tue Jul 14 18:54:58 2009 +0200 Add missing files in POTFILES.in @@ -10329,7 +35304,7 @@ Date: Tue Jul 14 18:54:58 2009 +0200 commit d439c22e0ff7cec437cdc4037f7621c762ea3181 Author: Kjartan Maraas -Date: Mon Jul 13 11:20:09 2009 +0200 +Date: Mon Jul 13 11:20:09 2009 +0200 Updated Norwegian bokmål translation. @@ -10339,30 +35314,30 @@ Date: Mon Jul 13 11:20:09 2009 +0200 commit e2844da68adb626f20ff9d02d51ca4259f56d55d Author: Chao-Hsiung Liao -Date: Sun Jul 12 15:19:23 2009 +0800 +Date: Sun Jul 12 15:19:23 2009 +0800 Updated Traditional Chinese translation(Hong Kong and Taiwan) - po/zh_HK.po | 917 + po/zh_HK.po | 917 +++++++++++++++++++++++++++++------------------------------ - po/zh_TW.po | 890 + po/zh_TW.po | 890 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 898 insertions(+), 909 deletions(-) commit f7f16dc3a2da52183053c5cc0967f7fa6547f65a Author: Matthias Clasen -Date: Fri Jul 10 22:33:03 2009 -0400 +Date: Fri Jul 10 22:33:03 2009 -0400 Remove outdated paragraph We no longer use PATCH or API keywords. - README.in | 6 +----- + README.in | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) commit 7ba9674d719af6eaa4e7e661be34732215bdfe38 Author: Matthias Clasen -Date: Fri Jul 10 13:13:18 2009 -0400 +Date: Fri Jul 10 13:13:18 2009 -0400 Avoid some compiler warnings. @@ -10371,7 +35346,7 @@ Date: Fri Jul 10 13:13:18 2009 -0400 commit 91925d2cf040730f89935a39c0d7aef3b4eb59dd Author: Matthias Clasen -Date: Fri Jul 10 13:11:28 2009 -0400 +Date: Fri Jul 10 13:11:28 2009 -0400 Another possible error code clash, yay @@ -10380,7 +35355,7 @@ Date: Fri Jul 10 13:11:28 2009 -0400 commit c23536cefeacc72d03ad8a83f315758d751cb127 Author: Matthias Clasen -Date: Fri Jul 10 11:18:31 2009 -0400 +Date: Fri Jul 10 11:18:31 2009 -0400 Improve g_str_equal docs @@ -10391,7 +35366,7 @@ Date: Fri Jul 10 11:18:31 2009 -0400 commit 6f48065958e24927c84f2983f746e39a3212998c Author: Benjamin Otte -Date: Thu Jul 9 15:34:00 2009 +0200 +Date: Thu Jul 9 15:34:00 2009 +0200 Fix a typo in GRegex documentation @@ -10400,7 +35375,7 @@ Date: Thu Jul 9 15:34:00 2009 +0200 commit c6884a7ec9999b6041dcad8ff3f7c7d93c55c0d2 Author: Maxim V. Dziumanenko -Date: Thu Jul 9 10:51:15 2009 +0300 +Date: Thu Jul 9 10:51:15 2009 +0300 Updated Ukrainian translation @@ -10410,7 +35385,7 @@ Date: Thu Jul 9 10:51:15 2009 +0300 commit 4cecb335f4b1d8e39c9402788fb37b7173187dd0 Author: Jorge González -Date: Tue Jul 7 22:34:35 2009 +0200 +Date: Tue Jul 7 22:34:35 2009 +0200 Updated Spanish translation @@ -10420,7 +35395,7 @@ Date: Tue Jul 7 22:34:35 2009 +0200 commit 593ea5f6b08c6fb297c1faffed3ada8fb2d95c66 Author: Ryan Lortie -Date: Tue Jul 7 21:29:46 2009 +0100 +Date: Tue Jul 7 21:29:46 2009 +0100 Ensure GTree is consistent after _destroy() @@ -10431,7 +35406,7 @@ Date: Tue Jul 7 21:29:46 2009 +0100 commit 7d2bb5f1b1ce0289628b12d98369f3fca92cde24 Author: Daniel Nylander -Date: Tue Jul 7 19:46:59 2009 +0200 +Date: Tue Jul 7 19:46:59 2009 +0200 Updated Swedish translation @@ -10441,7 +35416,7 @@ Date: Tue Jul 7 19:46:59 2009 +0200 commit 474ba7dbc37e352d39c0057bd2a31504828dde36 Author: Tor Lillqvist -Date: Tue Jul 7 14:37:45 2009 +0300 +Date: Tue Jul 7 14:37:45 2009 +0300 Make it compile on Windows. @@ -10453,13 +35428,13 @@ Date: Tue Jul 7 14:37:45 2009 +0300 commit 10ba0c2e5c6ed069420ec926c1094331c44fb71e Merge: eff73c9 8792d86 Author: Ryan Lortie -Date: Tue Jul 7 09:45:31 2009 +0100 +Date: Tue Jul 7 09:45:31 2009 +0100 Merge branch 'tree-refcount' commit eff73c95e8bb971ccc134e79c15f73ea5a237d30 Author: Matthias Clasen -Date: Mon Jul 6 00:33:49 2009 -0400 +Date: Mon Jul 6 00:33:49 2009 -0400 Bump version @@ -10468,116 +35443,116 @@ Date: Mon Jul 6 00:33:49 2009 -0400 commit 400959ddbdddaed22cfd7e898a4414730ecb3ec4 Author: Matthias Clasen -Date: Mon Jul 6 00:31:47 2009 -0400 +Date: Mon Jul 6 00:31:47 2009 -0400 2.21.3 - docs/reference/glib/tmpl/conversions.sgml | 9 - - docs/reference/glib/tmpl/gurifuncs.sgml | 9 + - docs/reference/gobject/glib-mkenums.1 | 11 +- - po/am.po | 195 +++-- - po/ar.po | 199 +++-- - po/as.po | 199 +++-- - po/az.po | 195 +++-- - po/be.po | 195 +++-- - po/be@latin.po | 199 +++-- - po/bg.po | 199 +++-- - po/bn.po | 195 +++-- - po/bn_IN.po | 199 +++-- - po/bs.po | 195 +++-- - po/ca.po | 199 +++-- - po/ca@valencia.po | 199 +++-- - po/cs.po | 199 +++-- - po/cy.po | 195 +++-- - po/da.po | 199 +++-- - po/de.po | 199 +++-- - po/dz.po | 195 +++-- - po/el.po | 199 +++-- - po/en_CA.po | 199 +++-- - po/en_GB.po | 199 +++-- - po/eo.po | 195 +++-- - po/es.po | 859 +++++++++++---------- - po/et.po | 447 +++++++++++- - po/eu.po | 199 +++-- - po/fa.po | 195 +++-- - po/fi.po | 199 +++-- - po/fr.po | 199 +++-- - po/ga.po | 195 +++-- - po/gl.po | 199 +++-- - po/gu.po | 199 +++-- - po/he.po | 1182 + docs/reference/glib/tmpl/conversions.sgml | 9 - + docs/reference/glib/tmpl/gurifuncs.sgml | 9 + + docs/reference/gobject/glib-mkenums.1 | 11 +- + po/am.po | 195 +++-- + po/ar.po | 199 +++-- + po/as.po | 199 +++-- + po/az.po | 195 +++-- + po/be.po | 195 +++-- + po/be@latin.po | 199 +++-- + po/bg.po | 199 +++-- + po/bn.po | 195 +++-- + po/bn_IN.po | 199 +++-- + po/bs.po | 195 +++-- + po/ca.po | 199 +++-- + po/ca@valencia.po | 199 +++-- + po/cs.po | 199 +++-- + po/cy.po | 195 +++-- + po/da.po | 199 +++-- + po/de.po | 199 +++-- + po/dz.po | 195 +++-- + po/el.po | 199 +++-- + po/en_CA.po | 199 +++-- + po/en_GB.po | 199 +++-- + po/eo.po | 195 +++-- + po/es.po | 859 +++++++++++---------- + po/et.po | 447 +++++++++++- + po/eu.po | 199 +++-- + po/fa.po | 195 +++-- + po/fi.po | 199 +++-- + po/fr.po | 199 +++-- + po/ga.po | 195 +++-- + po/gl.po | 199 +++-- + po/gu.po | 199 +++-- + po/he.po | 1182 ++++++++++++++--------------- - po/hi.po | 199 +++-- - po/hr.po | 195 +++-- - po/hu.po | 199 +++-- - po/hy.po | 195 +++-- - po/id.po | 195 +++-- - po/is.po | 195 +++-- - po/it.po | 199 +++-- - po/ja.po | 199 +++-- - po/ka.po | 195 +++-- - po/kn.po | 199 +++-- - po/ko.po | 199 +++-- - po/ku.po | 195 +++-- - po/lt.po | 199 +++-- - po/lv.po | 195 +++-- - po/mai.po | 199 +++-- - po/mg.po | 195 +++-- - po/mk.po | 199 +++-- - po/ml.po | 199 +++-- - po/mn.po | 195 +++-- - po/mr.po | 199 +++-- - po/ms.po | 195 +++-- - po/nb.po | 199 +++-- - po/ne.po | 195 +++-- - po/nl.po | 204 +++-- - po/nn.po | 199 +++-- - po/oc.po | 195 +++-- - po/or.po | 199 +++-- - po/pa.po | 199 +++-- - po/pl.po | 199 +++-- - po/ps.po | 195 +++-- - po/pt.po | 199 +++-- - po/pt_BR.po | 199 +++-- - po/ro.po | 199 +++-- - po/ru.po | 199 +++-- - po/rw.po | 195 +++-- - po/si.po | 195 +++-- - po/sk.po | 199 +++-- - po/sl.po | 199 +++-- - po/sq.po | 203 +++-- - po/sr.po | 195 +++-- - po/sr@ije.po | 195 +++-- - po/sr@latin.po | 195 +++-- - po/sv.po | 199 +++-- - po/ta.po | 199 +++-- - po/te.po | 199 +++-- - po/th.po | 199 +++-- - po/tl.po | 195 +++-- - po/tr.po | 199 +++-- - po/tt.po | 195 +++-- - po/uk.po | 199 +++-- - po/vi.po | 199 +++-- - po/wa.po | 195 +++-- - po/xh.po | 195 +++-- - po/yi.po | 195 +++-- - po/zh_CN.po | 199 +++-- - po/zh_HK.po | 199 +++-- - po/zh_TW.po | 199 +++-- + po/hi.po | 199 +++-- + po/hr.po | 195 +++-- + po/hu.po | 199 +++-- + po/hy.po | 195 +++-- + po/id.po | 195 +++-- + po/is.po | 195 +++-- + po/it.po | 199 +++-- + po/ja.po | 199 +++-- + po/ka.po | 195 +++-- + po/kn.po | 199 +++-- + po/ko.po | 199 +++-- + po/ku.po | 195 +++-- + po/lt.po | 199 +++-- + po/lv.po | 195 +++-- + po/mai.po | 199 +++-- + po/mg.po | 195 +++-- + po/mk.po | 199 +++-- + po/ml.po | 199 +++-- + po/mn.po | 195 +++-- + po/mr.po | 199 +++-- + po/ms.po | 195 +++-- + po/nb.po | 199 +++-- + po/ne.po | 195 +++-- + po/nl.po | 204 +++-- + po/nn.po | 199 +++-- + po/oc.po | 195 +++-- + po/or.po | 199 +++-- + po/pa.po | 199 +++-- + po/pl.po | 199 +++-- + po/ps.po | 195 +++-- + po/pt.po | 199 +++-- + po/pt_BR.po | 199 +++-- + po/ro.po | 199 +++-- + po/ru.po | 199 +++-- + po/rw.po | 195 +++-- + po/si.po | 195 +++-- + po/sk.po | 199 +++-- + po/sl.po | 199 +++-- + po/sq.po | 203 +++-- + po/sr.po | 195 +++-- + po/sr@ije.po | 195 +++-- + po/sr@latin.po | 195 +++-- + po/sv.po | 199 +++-- + po/ta.po | 199 +++-- + po/te.po | 199 +++-- + po/th.po | 199 +++-- + po/tl.po | 195 +++-- + po/tr.po | 199 +++-- + po/tt.po | 195 +++-- + po/uk.po | 199 +++-- + po/vi.po | 199 +++-- + po/wa.po | 195 +++-- + po/xh.po | 195 +++-- + po/yi.po | 195 +++-- + po/zh_CN.po | 199 +++-- + po/zh_HK.po | 199 +++-- + po/zh_TW.po | 199 +++-- 91 files changed, 11231 insertions(+), 8078 deletions(-) commit 3d1e8127788d8d406dd7e5d7feaae6d47110f087 Author: Matthias Clasen -Date: Mon Jul 6 00:00:42 2009 -0400 +Date: Mon Jul 6 00:00:42 2009 -0400 Document support_thread_contexts - gio/gfile.h | 1 + + gio/gfile.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit d5a51305196ac44b1c9f9edcb93aa688821f60f2 Author: Matthias Clasen -Date: Sun Jul 5 23:55:00 2009 -0400 +Date: Sun Jul 5 23:55:00 2009 -0400 Minor doc fix @@ -10587,16 +35562,16 @@ Date: Sun Jul 5 23:55:00 2009 -0400 commit 563c55bb7176e3fad5ea39061feb8406e5968ef3 Author: Matthias Clasen -Date: Sun Jul 5 23:38:09 2009 -0400 +Date: Sun Jul 5 23:38:09 2009 -0400 Fix a segfault in g_cancellable_cancel - gio/gcancellable.c | 2 +- + gio/gcancellable.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 66e9b50b2ccf7498a55f0608cca31bc8cfad741d Author: Matthias Clasen -Date: Sun Jul 5 22:55:26 2009 -0400 +Date: Sun Jul 5 22:55:26 2009 -0400 Updates @@ -10605,7 +35580,7 @@ Date: Sun Jul 5 22:55:26 2009 -0400 commit 5694ab7642c9ba6fbb85424e71d1c42c17661dd1 Author: Matthias Clasen -Date: Sun Jul 5 22:49:24 2009 -0400 +Date: Sun Jul 5 22:49:24 2009 -0400 Revert "Move gio tests from gio/tests/ to tests/gio/" @@ -10613,77 +35588,77 @@ Date: Sun Jul 5 22:49:24 2009 -0400 Move GIO tests back to where they belong. - configure.in | 2 +- - gio/Makefile.am | 2 + - gio/tests/.gitignore | 24 + - gio/tests/Makefile.am | 119 ++++ + configure.in | 2 +- + gio/Makefile.am | 2 + + gio/tests/.gitignore | 24 + + gio/tests/Makefile.am | 119 ++++ gio/tests/buffered-input-stream.c | 60 ++ - gio/tests/contexts.c | 190 ++++++ - gio/tests/data-input-stream.c | 336 ++++++++++ + gio/tests/contexts.c | 190 ++++++ + gio/tests/data-input-stream.c | 336 ++++++++++ gio/tests/data-output-stream.c | 289 +++++++++ - gio/tests/desktop-app-info.c | 259 ++++++++ - gio/tests/echo-server.c | 73 +++ - gio/tests/filter-streams.c | 239 ++++++++ - gio/tests/g-file-info.c | 125 ++++ - gio/tests/g-file.c | 538 ++++++++++++++++ - gio/tests/g-icon.c | 245 ++++++++ - gio/tests/httpd.c | 183 ++++++ - gio/tests/live-g-file.c | 1211 + gio/tests/desktop-app-info.c | 259 ++++++++ + gio/tests/echo-server.c | 73 +++ + gio/tests/filter-streams.c | 239 ++++++++ + gio/tests/g-file-info.c | 125 ++++ + gio/tests/g-file.c | 538 ++++++++++++++++ + gio/tests/g-icon.c | 245 ++++++++ + gio/tests/httpd.c | 183 ++++++ + gio/tests/live-g-file.c | 1211 +++++++++++++++++++++++++++++++++++++ - gio/tests/live-g-file.txt | 27 + + gio/tests/live-g-file.txt | 27 + gio/tests/memory-input-stream.c | 78 +++ gio/tests/memory-output-stream.c | 100 +++ - gio/tests/readwrite.c | 293 +++++++++ - gio/tests/resolver.c | 506 ++++++++++++++++ - gio/tests/send-data.c | 163 +++++ + gio/tests/readwrite.c | 293 +++++++++ + gio/tests/resolver.c | 506 ++++++++++++++++ + gio/tests/send-data.c | 163 +++++ gio/tests/simple-async-result.c | 130 ++++ - gio/tests/sleepy-stream.c | 296 +++++++++ - gio/tests/socket-client.c | 298 +++++++++ - gio/tests/socket-server.c | 308 ++++++++++ - gio/tests/srvtarget.c | 158 +++++ - gio/tests/unix-streams.c | 256 ++++++++ - tests/Makefile.am | 2 +- - tests/gio/.gitignore | 24 - - tests/gio/Makefile.am | 119 ---- + gio/tests/sleepy-stream.c | 296 +++++++++ + gio/tests/socket-client.c | 298 +++++++++ + gio/tests/socket-server.c | 308 ++++++++++ + gio/tests/srvtarget.c | 158 +++++ + gio/tests/unix-streams.c | 256 ++++++++ + tests/Makefile.am | 2 +- + tests/gio/.gitignore | 24 - + tests/gio/Makefile.am | 119 ---- tests/gio/buffered-input-stream.c | 60 -- - tests/gio/contexts.c | 190 ------ - tests/gio/data-input-stream.c | 336 ---------- + tests/gio/contexts.c | 190 ------ + tests/gio/data-input-stream.c | 336 ---------- tests/gio/data-output-stream.c | 289 --------- - tests/gio/desktop-app-info.c | 259 -------- - tests/gio/echo-server.c | 73 --- - tests/gio/filter-streams.c | 239 -------- - tests/gio/g-file-info.c | 125 ---- - tests/gio/g-file.c | 538 ---------------- - tests/gio/g-icon.c | 245 -------- - tests/gio/httpd.c | 183 ------ - tests/gio/live-g-file.c | 1211 + tests/gio/desktop-app-info.c | 259 -------- + tests/gio/echo-server.c | 73 --- + tests/gio/filter-streams.c | 239 -------- + tests/gio/g-file-info.c | 125 ---- + tests/gio/g-file.c | 538 ---------------- + tests/gio/g-icon.c | 245 -------- + tests/gio/httpd.c | 183 ------ + tests/gio/live-g-file.c | 1211 ------------------------------------- - tests/gio/live-g-file.txt | 27 - + tests/gio/live-g-file.txt | 27 - tests/gio/memory-input-stream.c | 78 --- tests/gio/memory-output-stream.c | 100 --- - tests/gio/readwrite.c | 293 --------- - tests/gio/resolver.c | 506 ---------------- - tests/gio/send-data.c | 163 ----- + tests/gio/readwrite.c | 293 --------- + tests/gio/resolver.c | 506 ---------------- + tests/gio/send-data.c | 163 ----- tests/gio/simple-async-result.c | 130 ---- - tests/gio/sleepy-stream.c | 296 --------- - tests/gio/socket-client.c | 298 --------- - tests/gio/socket-server.c | 308 ---------- - tests/gio/srvtarget.c | 158 ----- - tests/gio/unix-streams.c | 256 -------- + tests/gio/sleepy-stream.c | 296 --------- + tests/gio/socket-client.c | 298 --------- + tests/gio/socket-server.c | 308 ---------- + tests/gio/srvtarget.c | 158 ----- + tests/gio/unix-streams.c | 256 -------- 55 files changed, 6508 insertions(+), 6506 deletions(-) commit 8de4be69a9013e3bce57c0a004e1eada4155f623 Author: Matthias Clasen -Date: Sun Jul 5 22:35:55 2009 -0400 +Date: Sun Jul 5 22:35:55 2009 -0400 Move comment to the right place - gio/gvfs.h | 2 +- + gio/gvfs.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit aa065346d3230d5facd45ad1e4d50ceae206773f Author: Matthias Clasen -Date: Sun Jul 5 22:26:11 2009 -0400 +Date: Sun Jul 5 22:26:11 2009 -0400 Register ids for new file attributes @@ -10693,7 +35668,7 @@ Date: Sun Jul 5 22:26:11 2009 -0400 commit f043439d7897d3f538dcb2a2d9be9fd7a34ec948 Author: Matthias Clasen -Date: Sun Jul 5 22:24:14 2009 -0400 +Date: Sun Jul 5 22:24:14 2009 -0400 Ignore gfileinfo-priv.h @@ -10702,7 +35677,7 @@ Date: Sun Jul 5 22:24:14 2009 -0400 commit 99a1c47343d09ab0485c2377e5c8c53e847d84dd Author: David Zeuthen -Date: Sun Jul 5 21:59:38 2009 -0400 +Date: Sun Jul 5 21:59:38 2009 -0400 Allow interaction when unmounting mounts @@ -10722,54 +35697,54 @@ Date: Sun Jul 5 21:59:38 2009 -0400 - Make g_drive_stop() resp. g_file_stop_mountable() take a GMountOperation - these ops were recently added and not yet public API so it's fine - to change how they work + to change how they work - Provide a way to poll mountable files, e.g. g_file_poll_mountable() - Add some missing file attributes for mountable files - G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE - - needed for the GDU Nautilus extensions to format a volume + - needed for the GDU Nautilus extensions to format a volume - G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED: - - mimics g_drive_can_start_degraded() + - mimics g_drive_can_start_degraded() - G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL: - - mimics g_drive_can_poll_for_media() + - mimics g_drive_can_poll_for_media() - G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC - - mimics g_drive_is_media_check_automatic() - - docs/reference/gio/Makefile.am | 2 + - docs/reference/gio/gio-docs.xml | 5 +- - docs/reference/gio/gio-sections.txt | 19 +++ - gio/gdrive.c | 124 ++++++++++++++- - gio/gdrive.h | 32 ++++- - gio/gfile.c | 305 + - mimics g_drive_is_media_check_automatic() + + docs/reference/gio/Makefile.am | 2 + + docs/reference/gio/gio-docs.xml | 5 +- + docs/reference/gio/gio-sections.txt | 19 +++ + gio/gdrive.c | 124 ++++++++++++++- + gio/gdrive.h | 32 ++++- + gio/gfile.c | 305 ++++++++++++++++++++++++++++++++++- - gio/gfile.h | 66 ++++++++ - gio/gfileinfo.h | 43 +++++- - gio/gio-marshal.list | 1 + - gio/gio.symbols | 47 ++++-- - gio/gmount.c | 186 +++++++++++++++++++++- - gio/gmount.h | 48 ++++++- - gio/gmountoperation.c | 76 +++++++-- - gio/gmountoperation.h | 6 +- - gio/gvolume.c | 89 ++++++++++ - gio/gvolume.h | 23 +++ + gio/gfile.h | 66 ++++++++ + gio/gfileinfo.h | 43 +++++- + gio/gio-marshal.list | 1 + + gio/gio.symbols | 47 ++++-- + gio/gmount.c | 186 +++++++++++++++++++++- + gio/gmount.h | 48 ++++++- + gio/gmountoperation.c | 76 +++++++-- + gio/gmountoperation.h | 6 +- + gio/gvolume.c | 89 ++++++++++ + gio/gvolume.h | 23 +++ 16 files changed, 1027 insertions(+), 45 deletions(-) commit c85ff0c75004736d5c8798e3b47a47e0fc67ac70 Author: Benjamin Otte -Date: Sun Jul 5 21:34:39 2009 +0200 +Date: Sun Jul 5 21:34:39 2009 +0200 [gio] minor improvements to g_cancellable_cancel() - make this function not crash when cancellable is NULL - avoid locking when the cancellable has already been cancelled - gio/gcancellable.c | 24 ++++++++++++------------ + gio/gcancellable.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) commit 8a2e617e41e3f605ea0206832f0c2f346bfe008e Author: Yaron Shahrabani -Date: Sun Jul 5 18:06:57 2009 +0300 +Date: Sun Jul 5 18:06:57 2009 +0300 Updated Hebrew translation @@ -10779,20 +35754,20 @@ Date: Sun Jul 5 18:06:57 2009 +0300 commit 8792d862db4f61317a45dfe07f7b51e5ccf6741b Author: Ryan Lortie -Date: Sun Jul 5 12:30:54 2009 +0100 +Date: Sun Jul 5 12:30:54 2009 +0100 GTree: switch to GSlice, add refcounts (#587773) docs/reference/glib/glib-sections.txt | 2 + - glib/glib.symbols | 2 + - glib/gtree.c | 88 + glib/glib.symbols | 2 + + glib/gtree.c | 88 +++++++++++++++++++++++++++------ - glib/gtree.h | 2 + + glib/gtree.h | 2 + 4 files changed, 79 insertions(+), 15 deletions(-) commit 18e0bcf02f99a2d4bb35f46369cf4b9237291ef1 Author: Christian Persch -Date: Fri Jul 3 21:20:11 2009 +0200 +Date: Fri Jul 3 21:20:11 2009 +0200 Add @basename@ substitution to glib-mkenums @@ -10803,7 +35778,7 @@ Date: Fri Jul 3 21:20:11 2009 +0200 commit 6d1474e7f1f6e964d8db377fe732b9273cf17a84 Author: Christian Persch -Date: Mon Jun 29 15:28:22 2009 +0200 +Date: Mon Jun 29 15:28:22 2009 +0200 Add @basename@ substitution to glib-mkenums @@ -10822,7 +35797,7 @@ Date: Mon Jun 29 15:28:22 2009 +0200 commit dfd83f419c30d7d97c0e223e428c2e12c58199d3 Author: Mattias Põldaru -Date: Thu Jul 2 05:23:26 2009 +0300 +Date: Thu Jul 2 05:23:26 2009 +0300 Updating Estonian translation @@ -10832,7 +35807,7 @@ Date: Thu Jul 2 05:23:26 2009 +0300 commit 29e6525b1e5b51323681af156a0641d69fc9fa87 Author: Dan Winship -Date: Wed Jul 1 13:52:49 2009 -0400 +Date: Wed Jul 1 13:52:49 2009 -0400 Two "make check" fixes for late changes to the thread-context patch @@ -10841,82 +35816,82 @@ Date: Wed Jul 1 13:52:49 2009 -0400 because it called it from outside any main loop. (And gio's pltcheck was failing because I hadn't added g_main_current_source() to it.) - gio/pltcheck.sh | 2 +- + gio/pltcheck.sh | 2 +- tests/gio/simple-async-result.c | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) commit 2262d76b33094304ece0d0d9cd5920682599a49b Author: Benjamin Otte -Date: Wed Jul 1 19:03:19 2009 +0200 +Date: Wed Jul 1 19:03:19 2009 +0200 Move gio tests from gio/tests/ to tests/gio/ This avoids getting tests built every time when working on libgio and running make in the gio/ directory. - configure.in | 2 +- - gio/Makefile.am | 2 - - gio/tests/.gitignore | 24 - - gio/tests/Makefile.am | 119 ---- + configure.in | 2 +- + gio/Makefile.am | 2 - + gio/tests/.gitignore | 24 - + gio/tests/Makefile.am | 119 ---- gio/tests/buffered-input-stream.c | 60 -- - gio/tests/contexts.c | 190 ------ - gio/tests/data-input-stream.c | 336 ---------- + gio/tests/contexts.c | 190 ------ + gio/tests/data-input-stream.c | 336 ---------- gio/tests/data-output-stream.c | 289 --------- - gio/tests/desktop-app-info.c | 259 -------- - gio/tests/echo-server.c | 73 --- - gio/tests/filter-streams.c | 239 -------- - gio/tests/g-file-info.c | 125 ---- - gio/tests/g-file.c | 538 ---------------- - gio/tests/g-icon.c | 245 -------- - gio/tests/httpd.c | 183 ------ - gio/tests/live-g-file.c | 1211 + gio/tests/desktop-app-info.c | 259 -------- + gio/tests/echo-server.c | 73 --- + gio/tests/filter-streams.c | 239 -------- + gio/tests/g-file-info.c | 125 ---- + gio/tests/g-file.c | 538 ---------------- + gio/tests/g-icon.c | 245 -------- + gio/tests/httpd.c | 183 ------ + gio/tests/live-g-file.c | 1211 ------------------------------------- - gio/tests/live-g-file.txt | 27 - + gio/tests/live-g-file.txt | 27 - gio/tests/memory-input-stream.c | 78 --- gio/tests/memory-output-stream.c | 100 --- - gio/tests/readwrite.c | 293 --------- - gio/tests/resolver.c | 506 ---------------- - gio/tests/send-data.c | 163 ----- + gio/tests/readwrite.c | 293 --------- + gio/tests/resolver.c | 506 ---------------- + gio/tests/send-data.c | 163 ----- gio/tests/simple-async-result.c | 107 ---- - gio/tests/sleepy-stream.c | 296 --------- - gio/tests/socket-client.c | 298 --------- - gio/tests/socket-server.c | 308 ---------- - gio/tests/srvtarget.c | 158 ----- - gio/tests/unix-streams.c | 256 -------- - tests/Makefile.am | 2 +- - tests/gio/.gitignore | 24 + - tests/gio/Makefile.am | 119 ++++ + gio/tests/sleepy-stream.c | 296 --------- + gio/tests/socket-client.c | 298 --------- + gio/tests/socket-server.c | 308 ---------- + gio/tests/srvtarget.c | 158 ----- + gio/tests/unix-streams.c | 256 -------- + tests/Makefile.am | 2 +- + tests/gio/.gitignore | 24 + + tests/gio/Makefile.am | 119 ++++ tests/gio/buffered-input-stream.c | 60 ++ - tests/gio/contexts.c | 190 ++++++ - tests/gio/data-input-stream.c | 336 ++++++++++ + tests/gio/contexts.c | 190 ++++++ + tests/gio/data-input-stream.c | 336 ++++++++++ tests/gio/data-output-stream.c | 289 +++++++++ - tests/gio/desktop-app-info.c | 259 ++++++++ - tests/gio/echo-server.c | 73 +++ - tests/gio/filter-streams.c | 239 ++++++++ - tests/gio/g-file-info.c | 125 ++++ - tests/gio/g-file.c | 538 ++++++++++++++++ - tests/gio/g-icon.c | 245 ++++++++ - tests/gio/httpd.c | 183 ++++++ - tests/gio/live-g-file.c | 1211 + tests/gio/desktop-app-info.c | 259 ++++++++ + tests/gio/echo-server.c | 73 +++ + tests/gio/filter-streams.c | 239 ++++++++ + tests/gio/g-file-info.c | 125 ++++ + tests/gio/g-file.c | 538 ++++++++++++++++ + tests/gio/g-icon.c | 245 ++++++++ + tests/gio/httpd.c | 183 ++++++ + tests/gio/live-g-file.c | 1211 +++++++++++++++++++++++++++++++++++++ - tests/gio/live-g-file.txt | 27 + + tests/gio/live-g-file.txt | 27 + tests/gio/memory-input-stream.c | 78 +++ tests/gio/memory-output-stream.c | 100 +++ - tests/gio/readwrite.c | 293 +++++++++ - tests/gio/resolver.c | 506 ++++++++++++++++ - tests/gio/send-data.c | 163 +++++ + tests/gio/readwrite.c | 293 +++++++++ + tests/gio/resolver.c | 506 ++++++++++++++++ + tests/gio/send-data.c | 163 +++++ tests/gio/simple-async-result.c | 107 ++++ - tests/gio/sleepy-stream.c | 296 +++++++++ - tests/gio/socket-client.c | 298 +++++++++ - tests/gio/socket-server.c | 308 ++++++++++ - tests/gio/srvtarget.c | 158 +++++ - tests/gio/unix-streams.c | 256 ++++++++ + tests/gio/sleepy-stream.c | 296 +++++++++ + tests/gio/socket-client.c | 298 +++++++++ + tests/gio/socket-server.c | 308 ++++++++++ + tests/gio/srvtarget.c | 158 +++++ + tests/gio/unix-streams.c | 256 ++++++++ 55 files changed, 6483 insertions(+), 6485 deletions(-) commit 65cc5d895ae125b09f2403761f434fd78ef05af7 Author: Dan Winship -Date: Tue Jun 16 20:22:58 2009 -0400 +Date: Tue Jun 16 20:22:58 2009 -0400 Support g_main_context_push_thread_default() in gio @@ -10930,36 +35905,36 @@ Date: Tue Jun 16 20:22:58 2009 -0400 http://bugzilla.gnome.org/show_bug.cgi?id=579984 - gio/gdummyfile.c | 2 + - gio/gfile.c | 25 ++++++ - gio/gfile.h | 3 + - gio/gfilemonitor.c | 26 +++++-- - gio/gio.symbols | 1 + - gio/gioscheduler.c | 29 ++++--- - gio/glocalfile.c | 2 + + gio/gdummyfile.c | 2 + + gio/gfile.c | 25 ++++++ + gio/gfile.h | 3 + + gio/gfilemonitor.c | 26 +++++-- + gio/gio.symbols | 1 + + gio/gioscheduler.c | 29 ++++--- + gio/glocalfile.c | 2 + gio/gsimpleasyncresult.c | 62 ++++++++++---- - gio/gsocketclient.c | 2 +- - gio/gsocketinputstream.c | 2 +- - gio/gsocketlistener.c | 2 +- - gio/gsocketoutputstream.c | 2 +- - gio/gtcpconnection.c | 2 +- - gio/gunixinputstream.c | 4 +- - gio/gunixmount.c | 4 +- - gio/gunixoutputstream.c | 4 +- - gio/gunixresolver.c | 207 + gio/gsocketclient.c | 2 +- + gio/gsocketinputstream.c | 2 +- + gio/gsocketlistener.c | 2 +- + gio/gsocketoutputstream.c | 2 +- + gio/gtcpconnection.c | 2 +- + gio/gunixinputstream.c | 4 +- + gio/gunixmount.c | 4 +- + gio/gunixoutputstream.c | 4 +- + gio/gunixresolver.c | 207 ++++++++++++++++++++++++++++++--------------- - gio/gunixvolume.c | 4 +- - gio/gvolumemonitor.c | 7 ++- - gio/gwin32resolver.c | 4 +- - gio/tests/.gitignore | 1 + - gio/tests/Makefile.am | 10 ++- - gio/tests/contexts.c | 190 + gio/gunixvolume.c | 4 +- + gio/gvolumemonitor.c | 7 ++- + gio/gwin32resolver.c | 4 +- + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 10 ++- + gio/tests/contexts.c | 190 +++++++++++++++++++++++++++++++++++++++++ 23 files changed, 474 insertions(+), 121 deletions(-) commit 4363f1932f1be4474a81d5b9cf8a58c91b682868 Author: Dan Winship -Date: Thu Jun 4 21:59:15 2009 -0400 +Date: Thu Jun 4 21:59:15 2009 -0400 Add g_main_context_push_thread_default() etc @@ -10970,15 +35945,15 @@ Date: Thu Jun 4 21:59:15 2009 -0400 docs/reference/glib/glib-sections.txt | 5 + docs/reference/glib/tmpl/main.sgml | 24 ++++++ - glib/glib.symbols | 3 + - glib/gmain.c | 144 + glib/glib.symbols | 3 + + glib/gmain.c | 144 ++++++++++++++++++++++++++++++++- - glib/gmain.h | 5 + + glib/gmain.h | 5 + 5 files changed, 177 insertions(+), 4 deletions(-) commit 90381ecdbd73197ebdfaf58fdeccf267454d53d7 Author: Dan Winship -Date: Fri Jun 19 10:30:14 2009 -0400 +Date: Fri Jun 19 10:30:14 2009 -0400 Use low-level GSource methods in a few more places @@ -10993,16 +35968,16 @@ Date: Fri Jun 19 10:30:14 2009 -0400 commit 28a39fab5ac720daf5927c85c3eba2e23f5ac38c Author: Dan Winship -Date: Tue Jun 16 20:21:29 2009 -0400 +Date: Tue Jun 16 20:21:29 2009 -0400 Remove some unused code - gio/gasynchelper.c | 35 ----------------------------------- + gio/gasynchelper.c | 35 ----------------------------------- 1 files changed, 0 insertions(+), 35 deletions(-) commit 70e8eed6acfa33f74d7772f3ec54997daf102be4 Author: Dan Winship -Date: Tue Jun 23 12:01:34 2009 -0400 +Date: Tue Jun 23 12:01:34 2009 -0400 Fix GResolver for g_simple_async_result_set_op_res_gpointer change @@ -11016,7 +35991,7 @@ Date: Tue Jun 23 12:01:34 2009 -0400 commit d589da7e86947542790aa0137dc12499a4fe1a3b Author: Benjamin Otte -Date: Tue Jun 30 20:33:19 2009 +0200 +Date: Tue Jun 30 20:33:19 2009 +0200 Bug 587434 – regression tests fail @@ -11029,7 +36004,7 @@ Date: Tue Jun 30 20:33:19 2009 +0200 commit 80561f9718873bf02d5c938d92672bc20d99b82d Author: Benjamin Otte -Date: Tue Jun 30 19:08:46 2009 +0200 +Date: Tue Jun 30 19:08:46 2009 +0200 Bug 587434 – regression tests fail @@ -11040,7 +36015,7 @@ Date: Tue Jun 30 19:08:46 2009 +0200 commit 53beca955e016fb9ef4e80d223d059bc5e51dd41 Author: Dan Winship -Date: Tue Jun 23 17:42:01 2009 -0400 +Date: Tue Jun 23 17:42:01 2009 -0400 Add GCancellables to GSocket ops @@ -11055,22 +36030,22 @@ Date: Tue Jun 23 17:42:01 2009 -0400 http://bugzilla.gnome.org/show_bug.cgi?id=586797 - gio/gsocket.c | 74 + gio/gsocket.c | 74 ++++++++++++++++++++++++++++++++------------- - gio/gsocket.h | 8 +++++ - gio/gsocketclient.c | 4 +- + gio/gsocket.h | 8 +++++ + gio/gsocketclient.c | 4 +- gio/gsocketinputstream.c | 27 ++++++---------- - gio/gsocketlistener.c | 32 ++++++++----------- + gio/gsocketlistener.c | 32 ++++++++----------- gio/gsocketoutputstream.c | 27 ++++++---------- - gio/gtcpconnection.c | 21 ++----------- - gio/gunixconnection.c | 8 ++--- + gio/gtcpconnection.c | 21 ++----------- + gio/gunixconnection.c | 8 ++--- gio/tests/socket-client.c | 14 +++++--- gio/tests/socket-server.c | 13 +++++--- 10 files changed, 119 insertions(+), 109 deletions(-) commit fc2b3ee560e29b4ef6e70928b0be75d833d75aec Author: Benjamin Otte -Date: Mon Jun 29 18:32:09 2009 +0200 +Date: Mon Jun 29 18:32:09 2009 +0200 remove unused label @@ -11081,28 +36056,28 @@ Date: Mon Jun 29 18:32:09 2009 +0200 commit afd63c32814869489f812d6738de027ce113957d Author: Benjamin Otte -Date: Mon Jun 29 18:24:08 2009 +0200 +Date: Mon Jun 29 18:24:08 2009 +0200 fix warnings from gcc compilation with my mad CFLAGS - gio/tests/data-input-stream.c | 32 +++++++++++-------- + gio/tests/data-input-stream.c | 32 +++++++++++-------- gio/tests/data-output-stream.c | 66 ++++++++++++++++++++-------------------- - gio/tests/desktop-app-info.c | 4 +- - gio/tests/g-file.c | 16 +++++----- - gio/tests/httpd.c | 2 +- - gio/tests/live-g-file.c | 22 ++++++++----- - gio/tests/readwrite.c | 40 ++++++++++++------------ - gio/tests/resolver.c | 6 ++-- - gio/tests/sleepy-stream.c | 24 ++++++++------- - gio/tests/socket-server.c | 6 ++-- - gio/tests/srvtarget.c | 3 +- - gio/tests/unix-streams.c | 4 +- + gio/tests/desktop-app-info.c | 4 +- + gio/tests/g-file.c | 16 +++++----- + gio/tests/httpd.c | 2 +- + gio/tests/live-g-file.c | 22 ++++++++----- + gio/tests/readwrite.c | 40 ++++++++++++------------ + gio/tests/resolver.c | 6 ++-- + gio/tests/sleepy-stream.c | 24 ++++++++------- + gio/tests/socket-server.c | 6 ++-- + gio/tests/srvtarget.c | 3 +- + gio/tests/unix-streams.c | 4 +- 12 files changed, 119 insertions(+), 106 deletions(-) commit 4b8ad50fc4463d72862d29a8802b5982e66c0fc2 Author: Benjamin Otte -Date: Mon Jun 29 15:28:08 2009 +0200 +Date: Mon Jun 29 15:28:08 2009 +0200 add g_file_attribute_set_*_by_id() and use them @@ -11118,7 +36093,7 @@ Date: Mon Jun 29 15:28:08 2009 +0200 commit bd198e5e45282886ea2bad14e987c7c01b163cb3 Author: Benjamin Otte -Date: Mon Jun 29 14:13:14 2009 +0200 +Date: Mon Jun 29 14:13:14 2009 +0200 export and use _g_file_attribute_matcher_matches_id() @@ -11130,7 +36105,7 @@ Date: Mon Jun 29 14:13:14 2009 +0200 commit ceba40c27d5166a07a0925d2e158ca1809cc1ce3 Author: Benjamin Otte -Date: Mon Jun 29 13:55:22 2009 +0200 +Date: Mon Jun 29 13:55:22 2009 +0200 add private header with attribute ids @@ -11146,7 +36121,7 @@ Date: Mon Jun 29 13:55:22 2009 +0200 commit 2620c23577a73fa454298014680f4de46a69e7bb Author: Benjamin Otte -Date: Mon Jun 29 13:33:50 2009 +0200 +Date: Mon Jun 29 13:33:50 2009 +0200 split lookup_attribute() into two functions @@ -11156,7 +36131,7 @@ Date: Mon Jun 29 13:33:50 2009 +0200 commit 66cebd72925406910f99c0fd826b8307c2a4814c Author: Benjamin Otte -Date: Mon Jun 29 13:21:08 2009 +0200 +Date: Mon Jun 29 13:21:08 2009 +0200 split attribute hash initialization into its own function @@ -11165,7 +36140,7 @@ Date: Mon Jun 29 13:21:08 2009 +0200 commit 49172a71aacdd855918b614f3d61fa5b9248fb85 Author: Christian Dywan -Date: Sun Jun 28 02:45:50 2009 +0200 +Date: Sun Jun 28 02:45:50 2009 +0200 Display '-h' in --help output and accept '-h' and -?' @@ -11182,7 +36157,7 @@ Date: Sun Jun 28 02:45:50 2009 +0200 commit 09c3f6dd4b456adbbda6818e5bb1227af045e8d8 Author: Jani Monoses -Date: Sat Jun 27 11:03:47 2009 +0300 +Date: Sat Jun 27 11:03:47 2009 +0300 Fix C++ warnings in g_error() code @@ -11195,7 +36170,7 @@ Date: Sat Jun 27 11:03:47 2009 +0300 commit 160c39a9af8f7b6a475c1b005a807ccefc2ff7c1 Author: Matthias Clasen -Date: Fri Jun 26 23:18:17 2009 -0400 +Date: Fri Jun 26 23:18:17 2009 -0400 Move some uri functions to a better place @@ -11204,7 +36179,7 @@ Date: Fri Jun 26 23:18:17 2009 -0400 commit 35911ae00f5348ea4a60d66db25d70a1c45c9c43 Author: Matthias Clasen -Date: Fri Jun 26 23:09:35 2009 -0400 +Date: Fri Jun 26 23:09:35 2009 -0400 Fix a typo @@ -11214,7 +36189,7 @@ Date: Fri Jun 26 23:09:35 2009 -0400 commit e7a258692c7ae3d9075d9ae1926c08c7ec771f04 Author: Tom Parker -Date: Fri Jun 26 22:43:31 2009 -0400 +Date: Fri Jun 26 22:43:31 2009 -0400 Add NULL to end of g_filename_complete_get_completions() return value @@ -11228,7 +36203,7 @@ Date: Fri Jun 26 22:43:31 2009 -0400 commit 657d0ad9183fe4410e736d20a17a70fb7d6ad6c0 Author: Ivar Smolin -Date: Fri Jun 26 10:39:25 2009 +0300 +Date: Fri Jun 26 10:39:25 2009 +0300 Updating Estonian translation @@ -11238,7 +36213,7 @@ Date: Fri Jun 26 10:39:25 2009 +0300 commit d884e509db1ab6a6d388313d28b7b07cebb3dfc0 Author: Alexander Larsson -Date: Thu Jun 25 09:18:01 2009 +0200 +Date: Thu Jun 25 09:18:01 2009 +0200 Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo @@ -11250,27 +36225,27 @@ Date: Thu Jun 25 09:18:01 2009 +0200 commit 019e8c808f48e93f81fcb8e9e8d73a43b087cc87 Author: Matthias Clasen -Date: Wed Jun 24 23:07:15 2009 -0400 +Date: Wed Jun 24 23:07:15 2009 -0400 Add a note about g_simple_async_result_set_op_res_pointer change - README.in | 7 +++++++ + README.in | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) commit b0dc7afd2ace91f5dca37af8de7b40ba45993ed0 Author: Richard Hughes -Date: Fri Jun 19 10:16:22 2009 +0100 +Date: Fri Jun 19 10:16:22 2009 +0100 Allow GCancellable to be subclassed by adding a private structure gio/gcancellable.c | 114 +++++++++++++++++++++++++++++++++------------------- - gio/gcancellable.h | 9 ++++ + gio/gcancellable.h | 9 ++++ 2 files changed, 81 insertions(+), 42 deletions(-) commit 0ccd18bc83c5e6eff77940a61cc9b31a88dd1851 Author: David Zeuthen -Date: Mon Jun 22 15:33:41 2009 -0400 +Date: Mon Jun 22 15:33:41 2009 -0400 Bug 586675 – Runtime library location @@ -11279,36 +36254,36 @@ Date: Mon Jun 22 15:33:41 2009 -0400 Signed-off-by: David Zeuthen - configure.in | 11 +++++++++++ - docs/reference/glib/building.sgml | 21 +++++++++++++++++++++ + configure.in | 11 +++++++++++ + docs/reference/glib/building.sgml | 21 +++++++++++++++++++++ docs/reference/glib/tmpl/fileutils.sgml | 17 +++++++++++++++++ - gio/Makefile.am | 9 +++++++++ - glib/Makefile.am | 9 +++++++++ - gmodule/Makefile.am | 9 +++++++++ - gobject/Makefile.am | 9 +++++++++ - gthread/Makefile.am | 8 ++++++++ + gio/Makefile.am | 9 +++++++++ + glib/Makefile.am | 9 +++++++++ + gmodule/Makefile.am | 9 +++++++++ + gobject/Makefile.am | 9 +++++++++ + gthread/Makefile.am | 8 ++++++++ 8 files changed, 93 insertions(+), 0 deletions(-) commit 7662c86611bf44175f18ec6eb66f159040ac73c5 Author: Alexander Larsson -Date: Thu Jun 18 09:05:27 2009 +0200 +Date: Thu Jun 18 09:05:27 2009 +0200 Add extension point for adding metadata for local files This adds a local_file_add_info vfunc to GVfs that vfs implementations can override to add metadata for local files. - gio/glocalfile.c | 75 +++++++++++++++++++++--------- - gio/glocalfileenumerator.c | 2 + - gio/glocalfileinfo.c | 108 + gio/glocalfile.c | 75 +++++++++++++++++++++--------- + gio/glocalfileenumerator.c | 2 + + gio/glocalfileinfo.c | 108 +++++++++++++++++++++++++++++++++++++++----- - gio/glocalfileinfo.h | 3 + - gio/gvfs.h | 26 +++++++++-- + gio/glocalfileinfo.h | 3 + + gio/gvfs.h | 26 +++++++++-- 5 files changed, 175 insertions(+), 39 deletions(-) commit 9a6146f54cdc085a42095b930066853dbb4e0c67 Author: Alexander Larsson -Date: Tue Jun 23 11:30:14 2009 +0200 +Date: Tue Jun 23 11:30:14 2009 +0200 Add g_file_info_set_attribute_status @@ -11321,7 +36296,7 @@ Date: Tue Jun 23 11:30:14 2009 +0200 commit becf4186e6289c0ab5d762f1cdf88517f4adc9f5 Author: Alexander Larsson -Date: Tue Jun 23 11:29:16 2009 +0200 +Date: Tue Jun 23 11:29:16 2009 +0200 Add g_file_info_has_namespace @@ -11335,26 +36310,26 @@ Date: Tue Jun 23 11:29:16 2009 +0200 commit 0ed9201ad2051c33f5d049754bd8a1644d19ab7c Author: Alexander Larsson -Date: Mon Jun 22 19:25:32 2009 +0200 +Date: Mon Jun 22 19:25:32 2009 +0200 Add string vector attribute type to GFileInfo This is needed for the new metadata backend since nautilus has a string-list metadata type, and we want to use this for nautilus. - gio/gfileattribute-priv.h | 4 +++ - gio/gfileattribute.c | 52 + gio/gfileattribute-priv.h | 4 +++ + gio/gfileattribute.c | 52 +++++++++++++++++++++++++++++++++++++++++++++ - gio/gfileinfo.c | 51 + gio/gfileinfo.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ - gio/gfileinfo.h | 5 ++++ - gio/gio.symbols | 2 + - gio/gioenums.h | 4 ++- + gio/gfileinfo.h | 5 ++++ + gio/gio.symbols | 2 + + gio/gioenums.h | 4 ++- 6 files changed, 117 insertions(+), 1 deletions(-) commit c1ab6454feb4447b8ef7ce6a0eb0fb38bae186df Author: Alexander Larsson -Date: Tue Jun 23 15:07:00 2009 +0200 +Date: Tue Jun 23 15:07:00 2009 +0200 Copy namespaces correctly in g_file_copy_attributes @@ -11362,12 +36337,12 @@ Date: Tue Jun 23 15:07:00 2009 +0200 build_attribute_list_for_copy only used ":", so we didn't copy any writable namespaces. - gio/gfile.c | 2 +- + gio/gfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit e9b4f7a3bcfefc266fc575e401f07a2a4c2ce8f6 Author: Jorge Gonzalez -Date: Sun Jun 21 11:13:20 2009 +0200 +Date: Sun Jun 21 11:13:20 2009 +0200 Updated Spanish translation @@ -11377,7 +36352,7 @@ Date: Sun Jun 21 11:13:20 2009 +0200 commit 440bf5bee50a0abca990d69ce12fc2a844bda95c Author: Matthias Clasen -Date: Fri Jun 19 23:44:29 2009 -0400 +Date: Fri Jun 19 23:44:29 2009 -0400 Use pipe2 when available @@ -11390,7 +36365,7 @@ Date: Fri Jun 19 23:44:29 2009 -0400 commit 854a43a3cd5cb8cc97b66d6f8f661e2a7096acda Author: Matthias Clasen -Date: Fri Jun 19 23:18:09 2009 -0400 +Date: Fri Jun 19 23:18:09 2009 -0400 Fix build on mingw @@ -11404,7 +36379,7 @@ Date: Fri Jun 19 23:18:09 2009 -0400 commit 4c791f49e58688d1b8948d083c1780cab9d26e93 Author: Ryan Lortie -Date: Thu Jun 18 15:00:01 2009 -0400 +Date: Thu Jun 18 15:00:01 2009 -0400 GMappedFile: add refcounting, switch to GSlice @@ -11413,15 +36388,15 @@ Date: Thu Jun 18 15:00:01 2009 -0400 - move to GSlice for allocating the GMappedFile struct. docs/reference/glib/glib-sections.txt | 2 + - glib/glib.symbols | 4 ++ - glib/gmappedfile.c | 73 + glib/glib.symbols | 4 ++ + glib/gmappedfile.c | 73 +++++++++++++++++++++++++++------ - glib/gmappedfile.h | 5 ++ + glib/gmappedfile.h | 5 ++ 4 files changed, 71 insertions(+), 13 deletions(-) commit 8cb481fd5ff44c7e82f59948567ad0b417297555 Author: Alexander Larsson -Date: Thu Jun 18 19:43:46 2009 +0200 +Date: Thu Jun 18 19:43:46 2009 +0200 Use io_prio as mainloop prio for async-emulation (#579449) @@ -11441,12 +36416,12 @@ Date: Thu Jun 18 19:43:46 2009 +0200 avoid the starvation problem above and make things easier to understand. - gio/gioscheduler.c | 2 +- + gio/gioscheduler.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 9fba81288424cd7ef45e28565fa878c93a962c17 Author: Benjamin Otte -Date: Thu Jun 18 15:28:41 2009 +0200 +Date: Thu Jun 18 15:28:41 2009 +0200 Revert "clarify documentation" @@ -11458,7 +36433,7 @@ Date: Thu Jun 18 15:28:41 2009 +0200 commit 835c03a5c1c980490543ad5d1fe426a1e5a62af9 Author: Benjamin Otte -Date: Thu Jun 18 15:27:12 2009 +0200 +Date: Thu Jun 18 15:27:12 2009 +0200 syntax fix in documentation @@ -11467,7 +36442,7 @@ Date: Thu Jun 18 15:27:12 2009 +0200 commit cf95d07691ec2202400f340f1c63aca11f0790c1 Author: Benjamin Otte -Date: Tue Jun 16 15:18:11 2009 +0200 +Date: Tue Jun 16 15:18:11 2009 +0200 fix typo in documentation @@ -11476,7 +36451,7 @@ Date: Tue Jun 16 15:18:11 2009 +0200 commit d218cf0f670e4c40acb47ab5b5761ea0c68e0594 Author: Benjamin Otte -Date: Fri Jun 12 17:45:27 2009 +0200 +Date: Fri Jun 12 17:45:27 2009 +0200 clarify documentation @@ -11485,7 +36460,7 @@ Date: Fri Jun 12 17:45:27 2009 +0200 commit f4a64cb068cfe309e968d1db9fae4fade6d87e8a Author: Matthias Clasen -Date: Mon Jun 15 13:27:40 2009 -0400 +Date: Mon Jun 15 13:27:40 2009 -0400 Bump version to 2.21.3 @@ -11494,105 +36469,105 @@ Date: Mon Jun 15 13:27:40 2009 -0400 commit 785787fd6cd4b7c0120ae64ec839cfb0353c4af2 Author: Matthias Clasen -Date: Mon Jun 15 13:25:43 2009 -0400 +Date: Mon Jun 15 13:25:43 2009 -0400 2.21.2 - po/am.po | 180 ++++++----- - po/ar.po | 186 +++++++----- - po/as.po | 182 ++++++----- - po/az.po | 180 ++++++----- - po/be.po | 180 ++++++----- + po/am.po | 180 ++++++----- + po/ar.po | 186 +++++++----- + po/as.po | 182 ++++++----- + po/az.po | 180 ++++++----- + po/be.po | 180 ++++++----- po/be@latin.po | 189 +++++++------ - po/bg.po | 182 ++++++----- - po/bn.po | 180 ++++++----- - po/bn_IN.po | 867 + po/bg.po | 182 ++++++----- + po/bn.po | 180 ++++++----- + po/bn_IN.po | 867 +++++++++++++++++++++++++++-------------------------- - po/bs.po | 180 ++++++----- - po/ca.po | 187 ++++++------ + po/bs.po | 180 ++++++----- + po/ca.po | 187 ++++++------ po/ca@valencia.po | 187 ++++++------ - po/cs.po | 183 +++++++----- - po/cy.po | 180 ++++++----- - po/da.po | 187 ++++++------ - po/de.po | 187 ++++++------ - po/dz.po | 180 ++++++----- - po/el.po | 182 ++++++----- - po/en_CA.po | 187 ++++++------ - po/en_GB.po | 187 ++++++------ - po/eo.po | 180 ++++++----- - po/es.po | 182 ++++++----- - po/et.po | 182 ++++++----- - po/eu.po | 182 ++++++----- - po/fa.po | 180 ++++++----- - po/fi.po | 187 ++++++------ - po/fr.po | 182 ++++++----- - po/ga.po | 191 +++++++------ - po/gl.po | 187 ++++++------ - po/gu.po | 182 ++++++----- - po/he.po | 187 ++++++------ - po/hi.po | 182 ++++++----- - po/hr.po | 181 ++++++----- - po/hu.po | 182 ++++++----- - po/hy.po | 180 ++++++----- - po/id.po | 180 ++++++----- - po/is.po | 180 ++++++----- - po/it.po | 182 ++++++----- - po/ja.po | 182 ++++++----- - po/ka.po | 179 ++++++----- - po/kn.po | 182 ++++++----- - po/ko.po | 185 ++++++------ - po/ku.po | 180 ++++++----- - po/lt.po | 189 +++++++------ - po/lv.po | 180 ++++++----- - po/mai.po | 182 ++++++----- - po/mg.po | 180 ++++++----- - po/mk.po | 189 +++++++------ - po/ml.po | 182 ++++++----- - po/mn.po | 180 ++++++----- - po/mr.po | 182 ++++++----- - po/ms.po | 180 ++++++----- - po/nb.po | 831 + po/cs.po | 183 +++++++----- + po/cy.po | 180 ++++++----- + po/da.po | 187 ++++++------ + po/de.po | 187 ++++++------ + po/dz.po | 180 ++++++----- + po/el.po | 182 ++++++----- + po/en_CA.po | 187 ++++++------ + po/en_GB.po | 187 ++++++------ + po/eo.po | 180 ++++++----- + po/es.po | 182 ++++++----- + po/et.po | 182 ++++++----- + po/eu.po | 182 ++++++----- + po/fa.po | 180 ++++++----- + po/fi.po | 187 ++++++------ + po/fr.po | 182 ++++++----- + po/ga.po | 191 +++++++------ + po/gl.po | 187 ++++++------ + po/gu.po | 182 ++++++----- + po/he.po | 187 ++++++------ + po/hi.po | 182 ++++++----- + po/hr.po | 181 ++++++----- + po/hu.po | 182 ++++++----- + po/hy.po | 180 ++++++----- + po/id.po | 180 ++++++----- + po/is.po | 180 ++++++----- + po/it.po | 182 ++++++----- + po/ja.po | 182 ++++++----- + po/ka.po | 179 ++++++----- + po/kn.po | 182 ++++++----- + po/ko.po | 185 ++++++------ + po/ku.po | 180 ++++++----- + po/lt.po | 189 +++++++------ + po/lv.po | 180 ++++++----- + po/mai.po | 182 ++++++----- + po/mg.po | 180 ++++++----- + po/mk.po | 189 +++++++------ + po/ml.po | 182 ++++++----- + po/mn.po | 180 ++++++----- + po/mr.po | 182 ++++++----- + po/ms.po | 180 ++++++----- + po/nb.po | 831 ++++++++++++++++++++++++++------------------------- - po/ne.po | 180 ++++++----- - po/nl.po | 189 +++++++------ - po/nn.po | 187 ++++++------ - po/oc.po | 185 ++++++------ - po/or.po | 182 ++++++----- - po/pa.po | 182 ++++++----- - po/pl.po | 183 +++++++----- - po/ps.po | 180 ++++++----- - po/pt.po | 187 ++++++------ - po/pt_BR.po | 187 ++++++------ - po/ro.po | 183 +++++++----- - po/ru.po | 189 +++++++------ - po/rw.po | 180 ++++++----- - po/si.po | 180 ++++++----- - po/sk.po | 189 +++++++------ - po/sl.po | 191 +++++++------ - po/sq.po | 191 +++++++------ - po/sr.po | 180 ++++++----- - po/sr@ije.po | 180 ++++++----- + po/ne.po | 180 ++++++----- + po/nl.po | 189 +++++++------ + po/nn.po | 187 ++++++------ + po/oc.po | 185 ++++++------ + po/or.po | 182 ++++++----- + po/pa.po | 182 ++++++----- + po/pl.po | 183 +++++++----- + po/ps.po | 180 ++++++----- + po/pt.po | 187 ++++++------ + po/pt_BR.po | 187 ++++++------ + po/ro.po | 183 +++++++----- + po/ru.po | 189 +++++++------ + po/rw.po | 180 ++++++----- + po/si.po | 180 ++++++----- + po/sk.po | 189 +++++++------ + po/sl.po | 191 +++++++------ + po/sq.po | 191 +++++++------ + po/sr.po | 180 ++++++----- + po/sr@ije.po | 180 ++++++----- po/sr@latin.po | 180 ++++++----- - po/sv.po | 187 ++++++------ - po/ta.po | 182 ++++++----- - po/te.po | 182 ++++++----- - po/th.po | 185 ++++++------ - po/tl.po | 180 ++++++----- - po/tr.po | 185 ++++++------ - po/tt.po | 180 ++++++----- - po/uk.po | 183 +++++++----- - po/vi.po | 181 ++++++----- - po/wa.po | 180 ++++++----- - po/xh.po | 180 ++++++----- - po/yi.po | 180 ++++++----- - po/zh_CN.po | 185 ++++++------ - po/zh_HK.po | 185 ++++++------ - po/zh_TW.po | 185 ++++++------ + po/sv.po | 187 ++++++------ + po/ta.po | 182 ++++++----- + po/te.po | 182 ++++++----- + po/th.po | 185 ++++++------ + po/tl.po | 180 ++++++----- + po/tr.po | 185 ++++++------ + po/tt.po | 180 ++++++----- + po/uk.po | 183 +++++++----- + po/vi.po | 181 ++++++----- + po/wa.po | 180 ++++++----- + po/xh.po | 180 ++++++----- + po/yi.po | 180 ++++++----- + po/zh_CN.po | 185 ++++++------ + po/zh_HK.po | 185 ++++++------ + po/zh_TW.po | 185 ++++++------ 88 files changed, 9416 insertions(+), 8034 deletions(-) commit 0fbeab452072cdf2dc7d1dd0356fa0d9f71fa0ac Author: Matthias Clasen -Date: Mon Jun 15 12:57:21 2009 -0400 +Date: Mon Jun 15 12:57:21 2009 -0400 Add g_setenv @@ -11601,7 +36576,7 @@ Date: Mon Jun 15 12:57:21 2009 -0400 commit 90229908a13c02a024a86e4eaf96a6ba8dac57af Author: Matthias Clasen -Date: Mon Jun 15 12:26:41 2009 -0400 +Date: Mon Jun 15 12:26:41 2009 -0400 Update for 2.21.2 @@ -11610,7 +36585,7 @@ Date: Mon Jun 15 12:26:41 2009 -0400 commit fae755e0568472a2c37e6a9d0ad0fde809749a1f Author: David Zeuthen -Date: Mon Jun 15 10:53:41 2009 -0400 +Date: Mon Jun 15 10:53:41 2009 -0400 Bug 585591 – Starting/stopping drives @@ -11625,27 +36600,27 @@ Date: Mon Jun 15 10:53:41 2009 -0400 3. Connecting/disconnecting iSCSI devices 4. Reacting to the user pressing e.g. the "remove drive" button on - a IBM/Lenovo Ultrabay: http://www.thinkwiki.org/wiki/Ultrabay + a IBM/Lenovo Ultrabay: http://www.thinkwiki.org/wiki/Ultrabay See the bug for the corresponding GVfs and Nautilus changes. - docs/reference/gio/gio-sections.txt | 16 ++ - gio/gdrive.c | 259 + docs/reference/gio/gio-sections.txt | 16 ++ + gio/gdrive.c | 259 ++++++++++++++++++++++++++++++++++- - gio/gdrive.h | 57 ++++++++ - gio/gfile.c | 179 ++++++++++++++++++++++++ - gio/gfile.h | 41 ++++++ - gio/gfileinfo.h | 31 ++++ - gio/gio.symbols | 13 ++ - gio/gioenums.h | 39 ++++++ - gio/gunionvolumemonitor.c | 12 ++ - gio/gvolumemonitor.c | 18 +++ - gio/gvolumemonitor.h | 5 +- + gio/gdrive.h | 57 ++++++++ + gio/gfile.c | 179 ++++++++++++++++++++++++ + gio/gfile.h | 41 ++++++ + gio/gfileinfo.h | 31 ++++ + gio/gio.symbols | 13 ++ + gio/gioenums.h | 39 ++++++ + gio/gunionvolumemonitor.c | 12 ++ + gio/gvolumemonitor.c | 18 +++ + gio/gvolumemonitor.h | 5 +- 11 files changed, 666 insertions(+), 4 deletions(-) commit bb4f7c48f9510c1fd96de067cd8f18cd41b1a1f0 Author: Ondrej Jirman -Date: Sat May 30 08:23:46 2009 +0200 +Date: Sat May 30 08:23:46 2009 +0200 Fix incorrect freeing of thread pool in GThreadedSocketService (#584255) @@ -11655,7 +36630,7 @@ Date: Sat May 30 08:23:46 2009 +0200 commit 31cb0bdcb0f334ad904e088acb3a417452a4d67f Author: Alexander Larsson -Date: Mon Jun 15 15:43:39 2009 +0200 +Date: Mon Jun 15 15:43:39 2009 +0200 Emit changed in g_socket_listener_add_socket, not in add_address @@ -11667,7 +36642,7 @@ Date: Mon Jun 15 15:43:39 2009 +0200 commit a640695f1609805a0fe745d35c2055a984410bb5 Author: Alexander Larsson -Date: Mon Jun 15 15:42:38 2009 +0200 +Date: Mon Jun 15 15:42:38 2009 +0200 Ref the passed in socket in g_socket_listener_add_socket (#585599) @@ -11676,7 +36651,7 @@ Date: Mon Jun 15 15:42:38 2009 +0200 commit 67de6cba508d7f2e0c310527667df2efcf4a543a Author: Alexander Larsson -Date: Mon Jun 15 14:23:57 2009 +0200 +Date: Mon Jun 15 14:23:57 2009 +0200 Add bound address out-argument to g_socket_listener_add_address (#585566) @@ -11689,21 +36664,21 @@ Date: Mon Jun 15 14:23:57 2009 +0200 commit 91bdccff7544ee19d329ec73db02fd5f11c617fd Author: Alexander Larsson -Date: Mon Jun 15 13:18:22 2009 +0200 +Date: Mon Jun 15 13:18:22 2009 +0200 Add g_reload_user_special_dirs_cache (#541276) This is useful for nautilus that changes the xdg-user-dirs files. - glib/glib.symbols | 1 + - glib/gutils.c | 53 + glib/glib.symbols | 1 + + glib/gutils.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - glib/gutils.h | 1 + + glib/gutils.h | 1 + 3 files changed, 55 insertions(+), 0 deletions(-) commit 740ae3aa29cc50f588fb3ac47f6125acbccd20b6 Author: Alexander Larsson -Date: Mon Jun 15 12:25:43 2009 +0200 +Date: Mon Jun 15 12:25:43 2009 +0200 Avoid unnecessary work if mount watching not specified (#585360) @@ -11716,7 +36691,7 @@ Date: Mon Jun 15 12:25:43 2009 +0200 commit 129eb074823101102611690f053ffa246bb7784d Author: Matthias Clasen -Date: Mon Jun 15 01:45:34 2009 -0400 +Date: Mon Jun 15 01:45:34 2009 -0400 Support special icons for xdg user dirs @@ -11729,7 +36704,7 @@ Date: Mon Jun 15 01:45:34 2009 -0400 commit 50a7f530557e35c6dfc543d969c0369d53d45a87 Author: Matthias Clasen -Date: Mon Jun 15 01:12:50 2009 -0400 +Date: Mon Jun 15 01:12:50 2009 -0400 Don't use deprecated GLib api @@ -11740,42 +36715,42 @@ Date: Mon Jun 15 01:12:50 2009 -0400 commit 2553df615d21e68d52f1e0b45ac8b70622d2881e Author: Matthias Clasen -Date: Mon Jun 15 01:09:25 2009 -0400 +Date: Mon Jun 15 01:09:25 2009 -0400 Refer to the correct gcc deprecation options This oversight was pointed out in bug 585520. - docs/reference/glib/tmpl/macros_misc.sgml | 2 +- + docs/reference/glib/tmpl/macros_misc.sgml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 2c5ac901d95f28db1edad2807f842396c594a49e Author: Matthias Clasen -Date: Mon Jun 15 01:03:54 2009 -0400 +Date: Mon Jun 15 01:03:54 2009 -0400 Fix some typos in list documentation This fixes bug 585726. - docs/reference/glib/tmpl/linked_lists_double.sgml | 4 ++-- - docs/reference/glib/tmpl/linked_lists_single.sgml | 2 +- + docs/reference/glib/tmpl/linked_lists_double.sgml | 4 ++-- + docs/reference/glib/tmpl/linked_lists_single.sgml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit b0bba8520acd423785075ba67e6e4b644fce765f Author: Matthias Clasen -Date: Mon Jun 15 00:52:43 2009 -0400 +Date: Mon Jun 15 00:52:43 2009 -0400 Extract strings from g_dngettext too There is one occurrence of this in glib, which we currently miss. See bug 585717. - po/Makefile.in.in | 7 +++++++ + po/Makefile.in.in | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) commit 642e9c75400cc12f0fad26e3f3df5ac6a39e0822 Author: Matthias Clasen -Date: Mon Jun 15 00:45:55 2009 -0400 +Date: Mon Jun 15 00:45:55 2009 -0400 Fix the icon property implementation @@ -11787,7 +36762,7 @@ Date: Mon Jun 15 00:45:55 2009 -0400 commit b533a944ffc83ad90cd8b6fba00f4e0bebcd0741 Author: Matthias Clasen -Date: Mon Jun 15 00:38:34 2009 -0400 +Date: Mon Jun 15 00:38:34 2009 -0400 Trivial formatting fixes @@ -11797,7 +36772,7 @@ Date: Mon Jun 15 00:38:34 2009 -0400 commit ce4aa6253eea2b24c0e4a99f9a1d7f31b9cec979 Author: Matthias Clasen -Date: Sun Jun 14 23:55:12 2009 -0400 +Date: Sun Jun 14 23:55:12 2009 -0400 Include sys/uio.h for struct iovec @@ -11808,19 +36783,19 @@ Date: Sun Jun 14 23:55:12 2009 -0400 commit 8a3a3d797e7ef3b66c917c1c0a2ec47300bbf661 Author: Matthias Clasen -Date: Sun Jun 14 22:26:52 2009 -0400 +Date: Sun Jun 14 22:26:52 2009 -0400 Use inotify_init1 when available To avoid leaking the inotify fd. Fixes bug 585478. - configure.in | 1 + + configure.in | 1 + gio/inotify/inotify-kernel.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) commit 4dbc2074bc857464e64549fac2b7403c4e9566c1 Author: Ryan Lortie -Date: Sun Jun 14 13:58:35 2009 -0400 +Date: Sun Jun 14 13:58:35 2009 -0400 Add GNIO test cases to .gitignore @@ -11829,7 +36804,7 @@ Date: Sun Jun 14 13:58:35 2009 -0400 commit cb1a6092405b2f6d9b82e7c1b757951d695c5fe6 Author: Ryan Lortie -Date: Fri Jun 12 13:01:04 2009 -0400 +Date: Fri Jun 12 13:01:04 2009 -0400 Bug 585575 – g_socket_listener_add_inet_port() @@ -11840,9 +36815,9 @@ Date: Fri Jun 12 13:01:04 2009 -0400 - If the OS supports only IPv6, do that. - If the OS supports only IPv4, do that. - If the OS supports IPv6 and IPv6 "speaks" IPv4 then bind it - and be done. + and be done. - If the OS supports IPv6 and IPv6 doesn't "speak" IPv4 then - create an additional socket for IPv4. + create an additional socket for IPv4. - If binding any socket fails then fail the entire call. Also, remove the ability to call this function with port == 0. This @@ -11856,22 +36831,22 @@ Date: Fri Jun 12 13:01:04 2009 -0400 commit f7d756f5b6c9975452e57ac6f41ff69d9f456739 Author: Ryan Lortie -Date: Fri Jun 12 12:21:07 2009 -0400 +Date: Fri Jun 12 12:21:07 2009 -0400 add g_socket_speaks_ipv4() Partial fix for Bug 585575. - docs/reference/gio/gio-sections.txt | 1 + - gio/gio.symbols | 1 + - gio/gsocket.c | 48 + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gsocket.c | 48 +++++++++++++++++++++++++++++++++++ - gio/gsocket.h | 1 + + gio/gsocket.h | 1 + 4 files changed, 51 insertions(+), 0 deletions(-) commit fd22781b184529c2a838272b76d71b4b498366ba Author: Benjamin Otte -Date: Fri Jun 12 15:57:51 2009 +0200 +Date: Fri Jun 12 15:57:51 2009 +0200 make all APIs that take inet port arguments take a guint16 @@ -11883,7 +36858,7 @@ Date: Fri Jun 12 15:57:51 2009 +0200 commit 3e3e3c29469f03ec7f141b2522accdb7c2acd59d Author: Benjamin Otte -Date: Fri Jun 12 15:57:12 2009 +0200 +Date: Fri Jun 12 15:57:12 2009 +0200 don't make strings const when they are not @@ -11894,7 +36869,7 @@ Date: Fri Jun 12 15:57:12 2009 +0200 commit a402875de1d8956c90a940f8309733040cda5afb Author: Matthias Clasen -Date: Thu Jun 11 12:41:16 2009 -0400 +Date: Thu Jun 11 12:41:16 2009 -0400 Fix an oversight in the previous commit @@ -11906,21 +36881,21 @@ Date: Thu Jun 11 12:41:16 2009 -0400 commit 6224d3d2ecdbc3cacfdb8213de3cf53d6dfc8580 Author: Matthias Clasen -Date: Wed Jun 10 23:50:45 2009 -0400 +Date: Wed Jun 10 23:50:45 2009 -0400 Fix g_string_chunk_insert_len to accept nuls Contrary to what the documentation says, g_string_chunk_insert_len was stopping at the first nul. Also add a test. Fixes bug 585088. - glib/gstring.c | 54 + glib/gstring.c | 54 ++++++++++++++++++++++++-------------------------- - glib/tests/string.c | 23 +++++++++++++++++++++ + glib/tests/string.c | 23 +++++++++++++++++++++ 2 files changed, 49 insertions(+), 28 deletions(-) commit 9e43937d03443d6e8f63ea2c75c0fd54aaa124b3 Author: Matthias Clasen -Date: Wed Jun 10 23:28:32 2009 -0400 +Date: Wed Jun 10 23:28:32 2009 -0400 Include sys/types.h in gunixfdmessage.c @@ -11931,7 +36906,7 @@ Date: Wed Jun 10 23:28:32 2009 -0400 commit d3d81f74c5c227fb17494c0388ede1e83557a7e1 Author: Matthias Clasen -Date: Wed Jun 10 16:20:51 2009 -0400 +Date: Wed Jun 10 16:20:51 2009 -0400 Make setting DISPLAY work @@ -11945,16 +36920,16 @@ Date: Wed Jun 10 16:20:51 2009 -0400 commit 83ae249a2efc6f6445b5655cc16841ee2f9d3f75 Author: Matthias Clasen -Date: Wed Jun 10 16:20:38 2009 -0400 +Date: Wed Jun 10 16:20:38 2009 -0400 Support automake 1.11 - autogen.sh | 10 +++++++--- + autogen.sh | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) commit ff2532aead7a73ca92d0b8a964d143c69e78c6cd Author: Kjartan Maraas -Date: Wed Jun 10 09:43:33 2009 +0200 +Date: Wed Jun 10 09:43:33 2009 +0200 Updated Norwegian bokmål translation. @@ -11964,18 +36939,18 @@ Date: Wed Jun 10 09:43:33 2009 +0200 commit 74a3c71dcfb8f15692efd572670d28cb04caa868 Author: Dan Winship -Date: Tue Jun 9 09:32:43 2009 -0400 +Date: Tue Jun 9 09:32:43 2009 -0400 Revert part of fix for old OS X that broke the compile on current OS X http://bugzilla.gnome.org/show_bug.cgi?id=584574 - gio/libasyncns/g-asyncns.h | 8 +------- + gio/libasyncns/g-asyncns.h | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) commit 059ec81c9e88ee5ec67aafd135714754ea5b9552 Author: Michael Meeks -Date: Tue Jun 9 11:31:42 2009 +0100 +Date: Tue Jun 9 11:31:42 2009 +0100 move start_element emission out into a new (inlined) function, so the alloca'd memory is released on return, rather than slowly blowing @@ -11987,7 +36962,7 @@ Date: Tue Jun 9 11:31:42 2009 +0100 commit ced88fd0de4aedb537552561582875b427081eeb Author: Benjamin Otte -Date: Tue Jun 9 10:54:22 2009 +0200 +Date: Tue Jun 9 10:54:22 2009 +0200 Bug 585189 – g_cancellable_reset() must be called in same thread ... @@ -11998,22 +36973,22 @@ Date: Tue Jun 9 10:54:22 2009 +0200 the cancel function to be finished the same way g_cancellable_disconnect() uses. - gio/gcancellable.c | 8 ++++---- + gio/gcancellable.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) commit 7d4b7063057a9473491141e4d26fbcec17bb83ec Author: Runa Bhattacharjee -Date: Tue Jun 9 11:48:53 2009 +0530 +Date: Tue Jun 9 11:48:53 2009 +0530 Updated Bengali India Translations - po/bn_IN.po | 982 + po/bn_IN.po | 982 +++++++++++++++++++++++++++------------------------------- 1 files changed, 457 insertions(+), 525 deletions(-) commit 139af6f70032cad02b3cd965521c0c0cdb0dc8cf Author: Benjamin Otte -Date: Mon Jun 8 17:29:22 2009 +0200 +Date: Mon Jun 8 17:29:22 2009 +0200 update the overview image of the gio docs @@ -12026,7 +37001,7 @@ Date: Mon Jun 8 17:29:22 2009 +0200 commit 74fd3e734f3b6e7702ee1a859855ef6bd1c28ef9 Author: Benjamin Otte -Date: Mon Jun 8 15:29:57 2009 +0200 +Date: Mon Jun 8 15:29:57 2009 +0200 typo in documentation @@ -12035,7 +37010,7 @@ Date: Mon Jun 8 15:29:57 2009 +0200 commit 29a4a0a44dc09dabe071a989da2500b2bc143cbd Author: Benjamin Otte -Date: Mon Jun 8 15:27:12 2009 +0200 +Date: Mon Jun 8 15:27:12 2009 +0200 only query file info in g_file_copy() when we need it @@ -12048,12 +37023,12 @@ Date: Mon Jun 8 15:27:12 2009 +0200 connection before it returns EBUSY. This patch makes this query only happen when we actually send progress updates. - gio/gfile.c | 34 +++++++++++++++++++--------------- + gio/gfile.c | 34 +++++++++++++++++++--------------- 1 files changed, 19 insertions(+), 15 deletions(-) commit 0bb5739f323396b40bbe6470c505606ea265afa0 Author: Alexander Larsson -Date: Mon Jun 1 22:09:21 2009 +0200 +Date: Mon Jun 1 22:09:21 2009 +0200 Reformat g_themed_icon_get_names return type to make gtk-doc work @@ -12061,12 +37036,12 @@ Date: Mon Jun 1 22:09:21 2009 +0200 so switching to that. - gio/gthemedicon.h | 2 +- + gio/gthemedicon.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit ce6fbd623115c88cfdf0f5ed36b01cca201ba78e Author: Dan Winship -Date: Thu May 28 15:27:04 2009 -0400 +Date: Thu May 28 15:27:04 2009 -0400 Fix multiple bugs in g_srv_target_list_sort() @@ -12092,7 +37067,7 @@ Date: Thu May 28 15:27:04 2009 -0400 commit 1ca91a212503e64a150c78cdb9ce0489efaa7a59 Author: Dan Winship -Date: Sat May 23 21:49:47 2009 -0300 +Date: Sat May 23 21:49:47 2009 -0300 Clarify some GSocket docs @@ -12102,26 +37077,26 @@ Date: Sat May 23 21:49:47 2009 -0300 commit 5b3d62a7a6d4354b1588dd94f477c44bd15f1753 Author: Dan Winship -Date: Mon Apr 27 17:35:04 2009 -0400 +Date: Mon Apr 27 17:35:04 2009 -0400 Misc networking build fixes http://bugzilla.gnome.org/show_bug.cgi?id=580301 http://bugzilla.gnome.org/show_bug.cgi?id=584176 - gio/gnetworkaddress.c | 8 +------- - gio/gnetworkingprivate.h | 8 +++++++- - gio/gresolver.c | 2 +- - gio/gsocket.c | 8 +------- - gio/gsocketcontrolmessage.c | 5 +---- - gio/gunixresolver.c | 1 - - gio/gunixsocketaddress.c | 2 -- - gio/libasyncns/g-asyncns.h | 17 +++++++++++++++++ + gio/gnetworkaddress.c | 8 +------- + gio/gnetworkingprivate.h | 8 +++++++- + gio/gresolver.c | 2 +- + gio/gsocket.c | 8 +------- + gio/gsocketcontrolmessage.c | 5 +---- + gio/gunixresolver.c | 1 - + gio/gunixsocketaddress.c | 2 -- + gio/libasyncns/g-asyncns.h | 17 +++++++++++++++++ 8 files changed, 28 insertions(+), 23 deletions(-) commit 85816117e3da8c8751bb9c12f93580c9910ec8da Author: Tor Lillqvist -Date: Mon Jun 1 14:04:49 2009 +0300 +Date: Mon Jun 1 14:04:49 2009 +0300 Bump _WIN32_WINNT to 0x0501 @@ -12132,34 +37107,34 @@ Date: Mon Jun 1 14:04:49 2009 +0300 commit 4a50bab276cdbde6387c0dd07666de1879e2d6c9 Author: Hans Breuer -Date: Sat May 30 15:33:14 2009 +0200 +Date: Sat May 30 15:33:14 2009 +0200 Define fstat() for msvc build - glib/giowin32.c | 4 ++++ - glib/gkeyfile.c | 4 ++++ - glib/gmappedfile.c | 5 +++++ + glib/giowin32.c | 4 ++++ + glib/gkeyfile.c | 4 ++++ + glib/gmappedfile.c | 5 +++++ 3 files changed, 13 insertions(+), 0 deletions(-) commit 75ef01824803c70f42d412c19d4e61904702e461 Author: Hans Breuer -Date: Sat May 30 15:29:23 2009 +0200 +Date: Sat May 30 15:29:23 2009 +0200 Updated msvc build files - README.win32 | 13 ++++-- - config.h.win32.in | 3 + - gio/makefile.msc | 82 ++++++++++++++++------------------ + README.win32 | 13 ++++-- + config.h.win32.in | 3 + + gio/makefile.msc | 82 ++++++++++++++++------------------ gio/win32/makefile.msc | 35 +++++++++++++++ - glib/makefile.msc.in | 114 + glib/makefile.msc.in | 114 ++++++++++++++++++++++++++---------------------- - glibconfig.h.win32.in | 5 ++ - tests/makefile.msc.in | 39 ++++++++-------- + glibconfig.h.win32.in | 5 ++ + tests/makefile.msc.in | 39 ++++++++-------- 7 files changed, 172 insertions(+), 119 deletions(-) commit 780185449fadcbc5d79d9dea245067c16f475a92 Author: Hans Breuer -Date: Sat May 30 15:24:06 2009 +0200 +Date: Sat May 30 15:24:06 2009 +0200 Version resource template for gio @@ -12168,7 +37143,7 @@ Date: Sat May 30 15:24:06 2009 +0200 commit 73dbe591fb9ae98aab6902cf213132e2ad99c88c Author: Hans Breuer -Date: Sat May 30 15:18:02 2009 +0200 +Date: Sat May 30 15:18:02 2009 +0200 Handle EAI_NODATA==EAI_NONAME in win32 SDK @@ -12177,27 +37152,27 @@ Date: Sat May 30 15:18:02 2009 +0200 commit cbca0ac5d92df015902b3fd8a9086a29b20bc6f9 Author: Hans Breuer -Date: Sat May 30 15:14:01 2009 +0200 +Date: Sat May 30 15:14:01 2009 +0200 Include io.h for write() on win32 - gio/gcancellable.c | 1 + + gio/gcancellable.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit 136793cc5e5e808c82d21664c0ba96c95c8f7075 Author: Hans Breuer -Date: Sat May 30 15:08:29 2009 +0200 +Date: Sat May 30 15:08:29 2009 +0200 Simplified for pre-built package use - build/win32/make.msc | 120 + build/win32/make.msc | 120 ++++++++++++++++++++++++++++++++++------------ build/win32/module.defs | 29 ++++++++---- 2 files changed, 108 insertions(+), 41 deletions(-) commit f4e89ab87702d220babc4d18ec8450e351d3c06e Author: Hans Breuer -Date: Sat May 30 15:02:14 2009 +0200 +Date: Sat May 30 15:02:14 2009 +0200 Replace FIXME with proper SDK version define @@ -12206,7 +37181,7 @@ Date: Sat May 30 15:02:14 2009 +0200 commit 661bb521d126480606e12a15f722069eeddfc306 Author: Matthias Clasen -Date: Thu May 28 23:50:48 2009 -0400 +Date: Thu May 28 23:50:48 2009 -0400 Bump version @@ -12215,109 +37190,109 @@ Date: Thu May 28 23:50:48 2009 -0400 commit 33a2f5a21212a62e96ba8f5691a51d512a8925bd Author: Matthias Clasen -Date: Thu May 28 23:44:48 2009 -0400 +Date: Thu May 28 23:44:48 2009 -0400 Release 2.21.1 docs/reference/glib/tmpl/glib-unused.sgml | 67 --- - docs/reference/glib/tmpl/macros_misc.sgml | 6 +- - docs/reference/glib/tmpl/types.sgml | 2 + - docs/reference/glib/tmpl/version.sgml | 68 +++ - po/am.po | 203 ++++---- - po/ar.po | 203 ++++---- - po/as.po | 203 ++++---- - po/az.po | 203 ++++---- - po/be.po | 207 ++++---- - po/be@latin.po | 206 ++++---- - po/bg.po | 205 ++++---- - po/bn.po | 203 ++++---- - po/bn_IN.po | 203 ++++---- - po/bs.po | 203 ++++---- - po/ca.po | 204 ++++---- - po/ca@valencia.po | 815 + docs/reference/glib/tmpl/macros_misc.sgml | 6 +- + docs/reference/glib/tmpl/types.sgml | 2 + + docs/reference/glib/tmpl/version.sgml | 68 +++ + po/am.po | 203 ++++---- + po/ar.po | 203 ++++---- + po/as.po | 203 ++++---- + po/az.po | 203 ++++---- + po/be.po | 207 ++++---- + po/be@latin.po | 206 ++++---- + po/bg.po | 205 ++++---- + po/bn.po | 203 ++++---- + po/bn_IN.po | 203 ++++---- + po/bs.po | 203 ++++---- + po/ca.po | 204 ++++---- + po/ca@valencia.po | 815 +++++++++++++++-------------- - po/cs.po | 204 ++++---- - po/cy.po | 204 ++++---- - po/da.po | 204 ++++---- - po/de.po | 205 ++++---- - po/dz.po | 203 ++++---- - po/el.po | 204 ++++---- - po/en_CA.po | 203 ++++---- - po/en_GB.po | 203 ++++---- - po/eo.po | 203 ++++---- - po/es.po | 815 + po/cs.po | 204 ++++---- + po/cy.po | 204 ++++---- + po/da.po | 204 ++++---- + po/de.po | 205 ++++---- + po/dz.po | 203 ++++---- + po/el.po | 204 ++++---- + po/en_CA.po | 203 ++++---- + po/en_GB.po | 203 ++++---- + po/eo.po | 203 ++++---- + po/es.po | 815 ++++++++++++++--------------- - po/et.po | 203 ++++---- - po/eu.po | 205 ++++---- - po/fa.po | 203 ++++---- - po/fi.po | 203 ++++---- - po/fr.po | 205 ++++---- - po/ga.po | 203 ++++---- - po/gl.po | 205 ++++---- - po/gu.po | 203 ++++---- - po/he.po | 203 ++++---- - po/hi.po | 203 ++++---- - po/hr.po | 204 ++++---- - po/hu.po | 205 ++++---- - po/hy.po | 203 ++++---- - po/id.po | 205 ++++---- - po/is.po | 203 ++++---- - po/it.po | 205 ++++---- - po/ja.po | 203 ++++---- - po/ka.po | 203 ++++---- - po/kn.po | 203 ++++---- - po/ko.po | 203 ++++---- - po/ku.po | 203 ++++---- - po/lt.po | 204 ++++---- - po/lv.po | 203 ++++---- - po/mai.po | 203 ++++---- - po/mg.po | 205 ++++---- - po/mk.po | 205 ++++---- - po/ml.po | 203 ++++---- - po/mn.po | 203 ++++---- - po/mr.po | 204 ++++---- - po/ms.po | 203 ++++---- - po/nb.po | 204 ++++---- - po/ne.po | 203 ++++---- - po/nl.po | 205 ++++---- - po/nn.po | 203 ++++---- - po/oc.po | 203 ++++---- - po/or.po | 234 +++++---- - po/pa.po | 203 ++++---- - po/pl.po | 205 ++++---- - po/ps.po | 203 ++++---- - po/pt.po | 203 ++++---- - po/pt_BR.po | 205 ++++---- - po/ro.po | 203 ++++---- - po/ru.po | 204 ++++---- - po/rw.po | 203 ++++---- - po/si.po | 203 ++++---- - po/sk.po | 205 ++++---- - po/sl.po | 205 ++++---- - po/sq.po | 204 ++++---- - po/sr.po | 203 ++++---- - po/sr@ije.po | 203 ++++---- - po/sr@latin.po | 203 ++++---- - po/sv.po | 204 ++++---- - po/ta.po | 203 ++++---- - po/te.po | 203 ++++---- - po/th.po | 203 ++++---- - po/tl.po | 204 ++++---- - po/tr.po | 203 ++++---- - po/tt.po | 203 ++++---- - po/uk.po | 204 ++++---- - po/vi.po | 204 ++++---- - po/wa.po | 203 ++++---- - po/xh.po | 204 ++++---- - po/yi.po | 203 ++++---- - po/zh_CN.po | 203 ++++---- - po/zh_HK.po | 203 ++++---- - po/zh_TW.po | 203 ++++---- + po/et.po | 203 ++++---- + po/eu.po | 205 ++++---- + po/fa.po | 203 ++++---- + po/fi.po | 203 ++++---- + po/fr.po | 205 ++++---- + po/ga.po | 203 ++++---- + po/gl.po | 205 ++++---- + po/gu.po | 203 ++++---- + po/he.po | 203 ++++---- + po/hi.po | 203 ++++---- + po/hr.po | 204 ++++---- + po/hu.po | 205 ++++---- + po/hy.po | 203 ++++---- + po/id.po | 205 ++++---- + po/is.po | 203 ++++---- + po/it.po | 205 ++++---- + po/ja.po | 203 ++++---- + po/ka.po | 203 ++++---- + po/kn.po | 203 ++++---- + po/ko.po | 203 ++++---- + po/ku.po | 203 ++++---- + po/lt.po | 204 ++++---- + po/lv.po | 203 ++++---- + po/mai.po | 203 ++++---- + po/mg.po | 205 ++++---- + po/mk.po | 205 ++++---- + po/ml.po | 203 ++++---- + po/mn.po | 203 ++++---- + po/mr.po | 204 ++++---- + po/ms.po | 203 ++++---- + po/nb.po | 204 ++++---- + po/ne.po | 203 ++++---- + po/nl.po | 205 ++++---- + po/nn.po | 203 ++++---- + po/oc.po | 203 ++++---- + po/or.po | 234 +++++---- + po/pa.po | 203 ++++---- + po/pl.po | 205 ++++---- + po/ps.po | 203 ++++---- + po/pt.po | 203 ++++---- + po/pt_BR.po | 205 ++++---- + po/ro.po | 203 ++++---- + po/ru.po | 204 ++++---- + po/rw.po | 203 ++++---- + po/si.po | 203 ++++---- + po/sk.po | 205 ++++---- + po/sl.po | 205 ++++---- + po/sq.po | 204 ++++---- + po/sr.po | 203 ++++---- + po/sr@ije.po | 203 ++++---- + po/sr@latin.po | 203 ++++---- + po/sv.po | 204 ++++---- + po/ta.po | 203 ++++---- + po/te.po | 203 ++++---- + po/th.po | 203 ++++---- + po/tl.po | 204 ++++---- + po/tr.po | 203 ++++---- + po/tt.po | 203 ++++---- + po/uk.po | 204 ++++---- + po/vi.po | 204 ++++---- + po/wa.po | 203 ++++---- + po/xh.po | 204 ++++---- + po/yi.po | 203 ++++---- + po/zh_CN.po | 203 ++++---- + po/zh_HK.po | 203 ++++---- + po/zh_TW.po | 203 ++++---- 92 files changed, 10246 insertions(+), 9069 deletions(-) commit 479c45564a7010dad0742912506e1dff9b61fdd5 Author: Matthias Clasen -Date: Thu May 28 23:06:24 2009 -0400 +Date: Thu May 28 23:06:24 2009 -0400 Update NEWS once more @@ -12326,7 +37301,7 @@ Date: Thu May 28 23:06:24 2009 -0400 commit 62abf79be2f7133d4c14aa89a04ac7261e00b9f0 Author: Matthias Clasen -Date: Thu May 28 14:40:04 2009 -0400 +Date: Thu May 28 14:40:04 2009 -0400 Another pedantic docs fix @@ -12335,27 +37310,27 @@ Date: Thu May 28 14:40:04 2009 -0400 commit d32226da6d4ff565aebd41b5f126d625dc42816b Author: Alexander Larsson -Date: Thu May 28 15:34:07 2009 +0200 +Date: Thu May 28 15:34:07 2009 +0200 Ref the right type in g_socket_control_message_deserialize We were not looking at the right type at all due to a typo. - gio/gsocketcontrolmessage.c | 2 +- + gio/gsocketcontrolmessage.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 390549f6c4968b14ce4a141781f1131f6a09eafe Author: Alexander Larsson -Date: Thu May 28 15:33:52 2009 +0200 +Date: Thu May 28 15:33:52 2009 +0200 Document g_socket_control_message_deserialize - gio/gsocketcontrolmessage.c | 18 +++++++++++++----- + gio/gsocketcontrolmessage.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) commit dbe7408a5c06b4e88cf2605a24b0949adc02446c Author: Shixin Zeng -Date: Thu May 28 12:52:23 2009 +0300 +Date: Thu May 28 12:52:23 2009 +0300 Fix string length bugs in GWinHttpFile (#580347) @@ -12364,26 +37339,26 @@ Date: Thu May 28 12:52:23 2009 +0300 commit a859f883cf939b1010c3783ad34879b2ba897bfe Author: Matthias Clasen -Date: Thu May 28 00:30:21 2009 -0400 +Date: Thu May 28 00:30:21 2009 -0400 Fix make check gio/ginetsocketaddress.c | 2 +- - gio/gnetworkaddress.c | 2 +- - gio/gnetworkservice.c | 2 +- + gio/gnetworkaddress.c | 2 +- + gio/gnetworkservice.c | 2 +- gio/gsocketconnectable.c | 2 +- gio/gsocketcontrolmessage.c | 2 +- gio/gsocketinputstream.c | 5 +++++ gio/gsocketoutputstream.c | 7 +++++++ gio/gthreadedsocketservice.c | 2 +- - gio/gunixfdmessage.c | 2 +- + gio/gunixfdmessage.c | 2 +- gio/gunixsocketaddress.c | 2 +- - gio/pltcheck.sh | 2 +- + gio/pltcheck.sh | 2 +- 11 files changed, 21 insertions(+), 9 deletions(-) commit a39670dade8d68062a9ed2a3695b68945f34c5a5 Author: Matthias Clasen -Date: Thu May 28 00:08:42 2009 -0400 +Date: Thu May 28 00:08:42 2009 -0400 Update for 2.21.1 @@ -12392,7 +37367,7 @@ Date: Thu May 28 00:08:42 2009 -0400 commit 576839adbe9a72903fd435d24dbbb7826c691fcc Author: Matthias Clasen -Date: Wed May 27 22:44:31 2009 -0400 +Date: Wed May 27 22:44:31 2009 -0400 Fix references to nonexisting functions @@ -12401,56 +37376,56 @@ Date: Wed May 27 22:44:31 2009 -0400 commit 06144900ec87effb99c94e2d8369ca270d024bf1 Author: Matthias Clasen -Date: Wed May 27 18:20:08 2009 -0400 +Date: Wed May 27 18:20:08 2009 -0400 Documentation and coding style fixups Lots of pedanic changes. - docs/reference/gio/gio-sections.txt | 18 ++-- - docs/reference/gio/gio.types | 1 + - gio/gasyncinitable.c | 165 ++++++++++++----------- - gio/gfile.c | 155 +++++++++++----------- - gio/ginetaddress.c | 165 ++++++++++++++++++----- - gio/ginetsocketaddress.c | 28 +++-- - gio/ginitable.c | 22 ++-- - gio/ginitable.h | 3 +- - gio/gioenums.h | 48 +++++--- - gio/giostream.c | 132 +++++++++--------- - gio/giotypes.h | 15 +- - gio/gnetworkaddress.c | 44 ++++--- - gio/gnetworkaddress.h | 16 +- - gio/gnetworkservice.c | 32 +++-- - gio/gresolver.c | 6 +- - gio/gresolver.h | 2 +- - gio/gsocket.c | 247 + docs/reference/gio/gio-sections.txt | 18 ++-- + docs/reference/gio/gio.types | 1 + + gio/gasyncinitable.c | 165 ++++++++++++----------- + gio/gfile.c | 155 +++++++++++----------- + gio/ginetaddress.c | 165 ++++++++++++++++++----- + gio/ginetsocketaddress.c | 28 +++-- + gio/ginitable.c | 22 ++-- + gio/ginitable.h | 3 +- + gio/gioenums.h | 48 +++++--- + gio/giostream.c | 132 +++++++++--------- + gio/giotypes.h | 15 +- + gio/gnetworkaddress.c | 44 ++++--- + gio/gnetworkaddress.h | 16 +- + gio/gnetworkservice.c | 32 +++-- + gio/gresolver.c | 6 +- + gio/gresolver.h | 2 +- + gio/gsocket.c | 247 +++++++++++++++++++---------------- - gio/gsocketaddress.c | 17 ++- - gio/gsocketaddressenumerator.c | 34 +++--- - gio/gsocketaddressenumerator.h | 2 +- - gio/gsocketclient.c | 106 ++++++++------- - gio/gsocketclient.h | 16 +- - gio/gsocketconnectable.c | 4 +- - gio/gsocketconnectable.h | 4 +- - gio/gsocketconnection.c | 102 ++++++++------- - gio/gsocketconnection.h | 26 ++-- - gio/gsocketcontrolmessage.c | 39 ++++-- - gio/gsocketlistener.c | 116 ++++++++-------- - gio/gsocketservice.c | 35 +++--- - gio/gsocketservice.h | 2 +- - gio/gsrvtarget.c | 4 +- - gio/gtcpconnection.c | 30 +++-- - gio/gthreadedsocketservice.c | 24 ++-- - gio/gunixconnection.c | 20 ++-- - gio/gunixconnection.h | 2 +- - gio/gunixfdmessage.c | 43 ++++--- - gio/gunixfdmessage.h | 6 +- - gio/gunixsocketaddress.c | 4 +- + gio/gsocketaddress.c | 17 ++- + gio/gsocketaddressenumerator.c | 34 +++--- + gio/gsocketaddressenumerator.h | 2 +- + gio/gsocketclient.c | 106 ++++++++------- + gio/gsocketclient.h | 16 +- + gio/gsocketconnectable.c | 4 +- + gio/gsocketconnectable.h | 4 +- + gio/gsocketconnection.c | 102 ++++++++------- + gio/gsocketconnection.h | 26 ++-- + gio/gsocketcontrolmessage.c | 39 ++++-- + gio/gsocketlistener.c | 116 ++++++++-------- + gio/gsocketservice.c | 35 +++--- + gio/gsocketservice.h | 2 +- + gio/gsrvtarget.c | 4 +- + gio/gtcpconnection.c | 30 +++-- + gio/gthreadedsocketservice.c | 24 ++-- + gio/gunixconnection.c | 20 ++-- + gio/gunixconnection.h | 2 +- + gio/gunixfdmessage.c | 43 ++++--- + gio/gunixfdmessage.h | 6 +- + gio/gunixsocketaddress.c | 4 +- 38 files changed, 964 insertions(+), 771 deletions(-) commit eecbbb0a20a114b4a2c6759aa108940902c8961c Author: Matthias Clasen -Date: Wed May 27 12:07:13 2009 -0400 +Date: Wed May 27 12:07:13 2009 -0400 Fix the an index title @@ -12459,7 +37434,7 @@ Date: Wed May 27 12:07:13 2009 -0400 commit 00151ec0e1ea5c6b8be13c70a8808bc0ff380e3b Author: Matthias Clasen -Date: Wed May 27 12:01:14 2009 -0400 +Date: Wed May 27 12:01:14 2009 -0400 Fix a locking problem in g_main_context_iterate() @@ -12471,7 +37446,7 @@ Date: Wed May 27 12:01:14 2009 -0400 commit 209a662c2fb664bed2bf4e26bbda784ca7c0739d Author: Hans Breuer -Date: Wed May 27 15:12:31 2009 +0300 +Date: Wed May 27 15:12:31 2009 +0300 Correct reference and implement close_fn (#578769) @@ -12480,13 +37455,13 @@ Date: Wed May 27 15:12:31 2009 +0300 GWinHttpFileInputStream::file::vfs. Implement GWinHttpFileInputStream::close_fn. - gio/win32/gwinhttpfile.c | 5 ++++- - gio/win32/gwinhttpfileinputstream.c | 23 ++++++++++++++++++++++- + gio/win32/gwinhttpfile.c | 5 ++++- + gio/win32/gwinhttpfileinputstream.c | 23 ++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) commit 623f99dc3dee7712da4ac209ba445b2199b2963c Author: Alexander Larsson -Date: Wed May 27 11:11:37 2009 +0200 +Date: Wed May 27 11:11:37 2009 +0200 Add required defines on solaris for GSocket to build (#582856) @@ -12499,7 +37474,7 @@ Date: Wed May 27 11:11:37 2009 +0200 commit f99be75ff9d62f8e8e4e8850e34fe1020e58cb8c Author: Alexander Larsson -Date: Mon May 25 15:46:35 2009 +0200 +Date: Mon May 25 15:46:35 2009 +0200 Remove mention of non-existing calls from docs @@ -12508,13 +37483,13 @@ Date: Mon May 25 15:46:35 2009 +0200 GSeekable calls. gio/gfileinputstream.c | 10 ++++------ - gio/gfileiostream.c | 14 +++++++------- + gio/gfileiostream.c | 14 +++++++------- gio/gfileoutputstream.c | 17 ++++++++--------- 3 files changed, 19 insertions(+), 22 deletions(-) commit 3c0feca7f109c68e8c2a278875e576b18966d299 Author: Alexander Larsson -Date: Mon May 25 12:47:12 2009 +0200 +Date: Mon May 25 12:47:12 2009 +0200 Don't end enum with comma (#583663) @@ -12525,41 +37500,41 @@ Date: Mon May 25 12:47:12 2009 +0200 commit c93c98732aefb8472c94e75fea36f4924c7c746c Author: Alexander Larsson -Date: Mon May 25 12:46:03 2009 +0200 +Date: Mon May 25 12:46:03 2009 +0200 Don't return something from a void function (#583408) - gio/gsocketcontrolmessage.c | 2 +- + gio/gsocketcontrolmessage.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit ce171195d99c57e895bb02c7b324c811f958a91f Author: Alexander Larsson -Date: Mon May 25 11:33:56 2009 +0200 +Date: Mon May 25 11:33:56 2009 +0200 Add g_inet_address_get_native_size (#583205) This can be used to get the size of g_inet_address_to_bytes(). - docs/reference/gio/gio-sections.txt | 1 + - gio/ginetaddress.c | 22 +++++++++++++++++++++- - gio/ginetaddress.h | 2 ++ - gio/gio.symbols | 1 + + docs/reference/gio/gio-sections.txt | 1 + + gio/ginetaddress.c | 22 +++++++++++++++++++++- + gio/ginetaddress.h | 2 ++ + gio/gio.symbols | 1 + 4 files changed, 25 insertions(+), 1 deletions(-) commit fb70c6420b63a17bed11b594dd7255df08424fec Author: Miquel Esplà -Date: Mon May 25 00:23:58 2009 +0200 +Date: Mon May 25 00:23:58 2009 +0200 Added Valencian-Catalan translation - po/LINGUAS | 1 + + po/LINGUAS | 1 + po/ca@valencia.po | 1939 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1940 insertions(+), 0 deletions(-) commit bde3e9c3549bc74bdd2061945f2647fdd8aa3b77 Author: Jorge Gonzalez -Date: Sat May 23 20:00:22 2009 +0200 +Date: Sat May 23 20:00:22 2009 +0200 Updated Spanish translation @@ -12568,7 +37543,7 @@ Date: Sat May 23 20:00:22 2009 +0200 commit 37bd225d7b28e12fd78344d07e656cc2ff0d8d75 Author: Christian Persch -Date: Tue May 27 23:45:08 2008 +0200 +Date: Tue May 27 23:45:08 2008 +0200 Fix grammar in error message @@ -12579,7 +37554,7 @@ Date: Tue May 27 23:45:08 2008 +0200 commit 76ebe6c069b7fb1d09e6b95172185b325a3bb28e Author: Christian Persch -Date: Sat May 24 20:51:07 2008 +0200 +Date: Sat May 24 20:51:07 2008 +0200 Plug a mem leak @@ -12590,22 +37565,22 @@ Date: Sat May 24 20:51:07 2008 +0200 commit fc9a888b8cb8b16f093caa5d5faf4057fad1c0ef Author: Christian Persch -Date: Tue Jan 27 20:39:37 2009 +0100 +Date: Tue Jan 27 20:39:37 2009 +0100 Add G_G[U]INTPTR_FORMAT and G_GINTPTR_MODIFIER Add macros for printf formatting for g[u]intptr. Bug 569376. - configure.in | 16 ++++++++++++++++ - docs/reference/glib/glib-sections.txt | 3 +++ + configure.in | 16 ++++++++++++++++ + docs/reference/glib/glib-sections.txt | 3 +++ docs/reference/glib/tmpl/macros_misc.sgml | 26 ++++++++++++++++++++++++++ - docs/reference/glib/tmpl/types.sgml | 12 ++++++++++++ + docs/reference/glib/tmpl/types.sgml | 12 ++++++++++++ 4 files changed, 57 insertions(+), 0 deletions(-) commit d046bfe577f71b45b40d8b0592409c88945bb934 Author: Christian Persch -Date: Tue Jan 27 19:54:27 2009 +0100 +Date: Tue Jan 27 19:54:27 2009 +0100 Document g[u]intptr @@ -12617,7 +37592,7 @@ Date: Tue Jan 27 19:54:27 2009 +0100 commit 54b43229f4d6c3bf456f7b910bc00722a4f956d8 Author: Christian Persch -Date: Mon Apr 20 13:46:09 2009 +0200 +Date: Mon Apr 20 13:46:09 2009 +0200 Use g_error_new_valist instead of a private copy of it @@ -12626,22 +37601,22 @@ Date: Mon Apr 20 13:46:09 2009 +0200 commit 01b79d67ef0294dd633ccb0998a6d9053772da05 Author: Yeti -Date: Mon Apr 20 13:22:17 2009 +0200 +Date: Mon Apr 20 13:22:17 2009 +0200 Make g_error_new_valist public Bug #569024. - docs/reference/glib/glib-sections.txt | 1 + + docs/reference/glib/glib-sections.txt | 1 + docs/reference/glib/tmpl/error_reporting.sgml | 12 ++++++++++++ - glib/gerror.c | 16 +++++++++++++++- - glib/gerror.h | 6 ++++++ - glib/glib.symbols | 1 + + glib/gerror.c | 16 +++++++++++++++- + glib/gerror.h | 6 ++++++ + glib/glib.symbols | 1 + 5 files changed, 35 insertions(+), 1 deletions(-) commit 14d53dcfa8a781a79bd61f50bb73c4a1b3b7857e Author: Alexander Larsson -Date: Wed May 20 16:28:20 2009 +0200 +Date: Wed May 20 16:28:20 2009 +0200 Fix connect on win32 @@ -12654,7 +37629,7 @@ Date: Wed May 20 16:28:20 2009 +0200 commit bb66fdcce32fedb31ddba2a5aaa4cd1c8f0cdc9e Author: Alexander Larsson -Date: Wed May 20 15:59:11 2009 +0200 +Date: Wed May 20 15:59:11 2009 +0200 Fix build on win32 @@ -12663,7 +37638,7 @@ Date: Wed May 20 15:59:11 2009 +0200 commit c897cca601fdf9a91f214a33af33a812680b983e Author: Alexander Larsson -Date: Wed May 20 15:58:28 2009 +0200 +Date: Wed May 20 15:58:28 2009 +0200 Don't add unix specific APIs on win32 @@ -12672,26 +37647,26 @@ Date: Wed May 20 15:58:28 2009 +0200 commit 5a46e4d1406da1a319e421e908aec768760ef139 Author: Alexander Larsson -Date: Wed May 20 14:55:14 2009 +0200 +Date: Wed May 20 14:55:14 2009 +0200 Clarify g_cancellable_push_current docs wrt cancellable being NULL (#575013) - gio/gcancellable.c | 22 +++++++++++----------- + gio/gcancellable.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) commit ab29e09dac547c501892cac8cd64721c3f157f00 Author: Alexander Larsson -Date: Wed May 20 14:46:51 2009 +0200 +Date: Wed May 20 14:46:51 2009 +0200 Don't dereference identifier_type if it is NULL (#579558) - gio/gunixvolume.c | 3 ++- + gio/gunixvolume.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) commit d0d10e847f3ea347d651714050a8bafd5332e2cb Author: Robert Bragg -Date: Wed May 6 09:20:43 2009 +0100 +Date: Wed May 6 09:20:43 2009 +0100 Take a reference on the gio file monitors while signaling pending file changes @@ -12705,12 +37680,12 @@ Date: Wed May 6 09:20:43 2009 +0100 signals the changes. - gio/gfilemonitor.c | 3 +++ + gio/gfilemonitor.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) commit 6a9df8256aaccd717aaa7582c704093d727699fe Author: Alexander Larsson -Date: Wed May 20 14:17:27 2009 +0200 +Date: Wed May 20 14:17:27 2009 +0200 Use G_GSSIZE_FORMAT where needed (#577884) @@ -12719,7 +37694,7 @@ Date: Wed May 20 14:17:27 2009 +0200 commit 7498049a1683db50805b9a9a580b62bb748918f4 Author: Sjoerd Simons -Date: Wed May 20 13:59:50 2009 +0200 +Date: Wed May 20 13:59:50 2009 +0200 Propagate errors from g_network_service_address_enumerator_next_async in its _finish function @@ -12729,18 +37704,18 @@ Date: Wed May 20 13:59:50 2009 +0200 commit 2be66c0458aca37fef8337692fe5b5fe20bc5ccb Author: Jonathon Jongsma -Date: Tue May 19 00:10:57 2009 -0500 +Date: Tue May 19 00:10:57 2009 -0500 Typedef GResolverClass in the standard way It's a bit lame, but some of our C++ wrapping scripts expect objects to be typedefed like: - typedef struct _FooClass FooClass; - struct {} _FooClass; + typedef struct _FooClass FooClass; + struct {} _FooClass; Rather than: - typedef struct {} FooClass; + typedef struct {} FooClass; Functionally they're the same, but the former makes our lives easier in the @@ -12751,7 +37726,7 @@ Date: Tue May 19 00:10:57 2009 -0500 commit cb7a300e3136c9d1ee397a4c740513b8a0f21968 Author: Alexander Larsson -Date: Wed May 20 13:49:47 2009 +0200 +Date: Wed May 20 13:49:47 2009 +0200 Don't return something from void function (#583229) @@ -12762,43 +37737,43 @@ Date: Wed May 20 13:49:47 2009 +0200 commit 1cbdd2495dcc06eb11c3ef9207aae07acb7c4ba7 Author: Christian Persch -Date: Tue May 27 23:44:35 2008 +0200 +Date: Tue May 27 23:44:35 2008 +0200 Preserve errno when using g_set_error with _() and g_strerror() gio/glocalfileoutputstream.c | 2 +- - glib/gspawn.c | 3 ++- + glib/gspawn.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) commit 80cfd099f3c9fa23b2a21c77e3698f1c4ac94b06 Author: Christian Persch -Date: Tue May 19 15:03:14 2009 +0200 +Date: Tue May 19 15:03:14 2009 +0200 Use g_set_error_literal Bug #583206. - gio/gsocket.c | 20 ++++++++++---------- + gio/gsocket.c | 20 ++++++++++---------- gio/gsocketclient.c | 8 ++++---- gio/gunixconnection.c | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) commit c20b8d4d53a4e90f0e822276f6fbd94d52ff3c85 Author: Alexander Larsson -Date: Wed May 20 13:37:55 2009 +0200 +Date: Wed May 20 13:37:55 2009 +0200 Check that close_fn is not %NULL before calling (#578499) Some streams have no close function, so this caused a crash. - gio/ginputstream.c | 13 ++++++++----- - gio/giostream.c | 11 +++++++---- - gio/goutputstream.c | 18 +++++++++++------- + gio/ginputstream.c | 13 ++++++++----- + gio/giostream.c | 11 +++++++---- + gio/goutputstream.c | 18 +++++++++++------- 3 files changed, 26 insertions(+), 16 deletions(-) commit 0a280dadec8394dd198c8cea0bc288d92c9c6ffd Author: Stefan Kost -Date: Tue May 19 14:33:25 2009 +0300 +Date: Tue May 19 14:33:25 2009 +0300 docs: fix typo @@ -12807,20 +37782,20 @@ Date: Tue May 19 14:33:25 2009 +0300 commit 9033b37589fcdf42d10025ea9e4d0dfc2c018bf4 Author: Sjoerd Simons -Date: Wed May 20 12:41:50 2009 +0200 +Date: Wed May 20 12:41:50 2009 +0200 Add helper functions for connecting to service (#583061) - docs/reference/gio/gio-sections.txt | 3 + - gio/gio.symbols | 3 + - gio/gsocketclient.c | 93 + docs/reference/gio/gio-sections.txt | 3 + + gio/gio.symbols | 3 + + gio/gsocketclient.c | 93 +++++++++++++++++++++++++++++++++++ - gio/gsocketclient.h | 15 ++++++ + gio/gsocketclient.h | 15 ++++++ 4 files changed, 114 insertions(+), 0 deletions(-) commit 25800ed4a393f7edbea179aa86907079a58fd097 Author: Dan Winship -Date: Sun May 17 20:44:54 2009 -0400 +Date: Sun May 17 20:44:54 2009 -0400 Ignore SIGPIPE when using GSocket @@ -12831,7 +37806,7 @@ Date: Sun May 17 20:44:54 2009 -0400 commit 2ea22d8f46c21de6fc1eb012f258a3cfcda36752 Author: Alexander Larsson -Date: Wed May 20 12:14:04 2009 +0200 +Date: Wed May 20 12:14:04 2009 +0200 Remove non-existing parameter from docs @@ -12842,7 +37817,7 @@ Date: Wed May 20 12:14:04 2009 +0200 commit 9d36c86f8a0c759625753c4a9a02e0cfbf123a4b Author: Alexander Larsson -Date: Wed May 20 12:10:33 2009 +0200 +Date: Wed May 20 12:10:33 2009 +0200 Add missing symbols to gio.symbols @@ -12851,7 +37826,7 @@ Date: Wed May 20 12:10:33 2009 +0200 commit 9346f461f32375a34d2829d949dce8284c21654f Author: Alexander Larsson -Date: Wed May 20 12:07:30 2009 +0200 +Date: Wed May 20 12:07:30 2009 +0200 Add missing types to gio.types @@ -12860,7 +37835,7 @@ Date: Wed May 20 12:07:30 2009 +0200 commit 5cd86fbda662defa03709a9277b25784d953541e Author: Alexander Larsson -Date: Wed May 20 12:01:29 2009 +0200 +Date: Wed May 20 12:01:29 2009 +0200 Remove protocol names, instead use an enum with common protocols @@ -12874,28 +37849,28 @@ Date: Wed May 20 12:01:29 2009 +0200 So, we drop using names for protocols, intead introducing an enum with a few commonly availible and used protocols. - docs/reference/gio/#gio-unused.txt# | 100 +++++++++++++++++++++++ - docs/reference/gio/aa | 74 +++++++++++++++++ - docs/reference/gio/b | 77 ++++++++++++++++++ - docs/reference/gio/bb | 77 ++++++++++++++++++ - docs/reference/gio/gio-sections.txt | 5 +- - gio/gio.symbols | 4 +- - gio/gioenums.h | 24 ++++++ - gio/gsocket.c | 148 + docs/reference/gio/#gio-unused.txt# | 100 +++++++++++++++++++++++ + docs/reference/gio/aa | 74 +++++++++++++++++ + docs/reference/gio/b | 77 ++++++++++++++++++ + docs/reference/gio/bb | 77 ++++++++++++++++++ + docs/reference/gio/gio-sections.txt | 5 +- + gio/gio.symbols | 4 +- + gio/gioenums.h | 24 ++++++ + gio/gsocket.c | 148 ++++++---------------------------- - gio/gsocket.h | 7 +- - gio/gsocketclient.c | 40 ++++----- - gio/gsocketclient.h | 4 +- - gio/gsocketconnection.c | 2 +- - gio/gsocketlistener.c | 15 ++-- - gio/gsocketlistener.h | 2 +- - gio/gtcpconnection.c | 8 +- - gio/gunixconnection.c | 2 +- + gio/gsocket.h | 7 +- + gio/gsocketclient.c | 40 ++++----- + gio/gsocketclient.h | 4 +- + gio/gsocketconnection.c | 2 +- + gio/gsocketlistener.c | 15 ++-- + gio/gsocketlistener.h | 2 +- + gio/gtcpconnection.c | 8 +- + gio/gunixconnection.c | 2 +- 16 files changed, 417 insertions(+), 172 deletions(-) commit 6d01593b061afb52d22891a371fb29f42d4d62cc Author: Alexander Larsson -Date: Wed May 20 11:30:43 2009 +0200 +Date: Wed May 20 11:30:43 2009 +0200 Clarify "current condition" in g_socket_create_source docs @@ -12904,7 +37879,7 @@ Date: Wed May 20 11:30:43 2009 +0200 commit 80881826447a10b5ae3c08c9a88440eba75bcd05 Author: Alexander Larsson -Date: Wed May 20 11:28:27 2009 +0200 +Date: Wed May 20 11:28:27 2009 +0200 Actually implement max_threads for GThreadedSocketService @@ -12914,21 +37889,21 @@ Date: Wed May 20 11:28:27 2009 +0200 commit 053f9e72b12b9b5ab5571da9f4cd0b9b13f41e62 Author: Alexander Larsson -Date: Wed May 20 11:19:47 2009 +0200 +Date: Wed May 20 11:19:47 2009 +0200 Add support for graceful disconnect to GTcpConnection - docs/reference/gio/gio-sections.txt | 2 + - gio/gio.symbols | 2 + - gio/gtcpconnection.c | 331 + docs/reference/gio/gio-sections.txt | 2 + + gio/gio.symbols | 2 + + gio/gtcpconnection.c | 331 +++++++++++++++++++++++++++++++++++ - gio/gtcpconnection.h | 6 +- - gio/tests/send-data.c | 49 +++++- + gio/gtcpconnection.h | 6 +- + gio/tests/send-data.c | 49 +++++- 5 files changed, 386 insertions(+), 4 deletions(-) commit f061765e54b81a92f4ce901016964ea4c31d77e0 Author: Alexander Larsson -Date: Wed May 20 11:18:34 2009 +0200 +Date: Wed May 20 11:18:34 2009 +0200 Call sync close function directly in async implementation @@ -12940,7 +37915,7 @@ Date: Wed May 20 11:18:34 2009 +0200 commit fdfdec36d0d0044513db25872132bd42d392f748 Author: Alexander Larsson -Date: Tue May 19 13:44:11 2009 +0200 +Date: Tue May 19 13:44:11 2009 +0200 Add send-data, a g_socket_client test case @@ -12951,7 +37926,7 @@ Date: Tue May 19 13:44:11 2009 +0200 commit 18373cfbe85dc8398ae1e66748721400a08b32a8 Author: Alexander Larsson -Date: Tue May 19 12:06:29 2009 +0200 +Date: Tue May 19 12:06:29 2009 +0200 Set the listen backlog before calling listen. @@ -12962,7 +37937,7 @@ Date: Tue May 19 12:06:29 2009 +0200 commit 64383fa3d92b636e8fc977743de1c8f513d08dd2 Author: Alexander Larsson -Date: Tue May 19 11:53:42 2009 +0200 +Date: Tue May 19 11:53:42 2009 +0200 Fix g_unix_socket_address_abstract_names_supported docs @@ -12973,46 +37948,46 @@ Date: Tue May 19 11:53:42 2009 +0200 commit 0ffe7221934623f60e07d3b733d170ce94d26dd5 Author: Alexander Larsson -Date: Tue May 19 11:52:33 2009 +0200 +Date: Tue May 19 11:52:33 2009 +0200 Add g_socket_shutdown - docs/reference/gio/gio-sections.txt | 1 + - gio/gio.symbols | 1 + - gio/gsocket.c | 73 + docs/reference/gio/gio-sections.txt | 1 + + gio/gio.symbols | 1 + + gio/gsocket.c | 73 +++++++++++++++++++++++++++++++++++ - gio/gsocket.h | 4 ++ + gio/gsocket.h | 4 ++ 4 files changed, 79 insertions(+), 0 deletions(-) commit 03441e724a6b6d0b115fa5b2d9fbeefaa1fd2faa Author: Alexander Larsson -Date: Tue May 19 11:27:07 2009 +0200 +Date: Tue May 19 11:27:07 2009 +0200 Document GOutputVector and GInputVector - docs/reference/gio/gio-sections.txt | 2 ++ - gio/giotypes.h | 23 +++++++++++++++++------ + docs/reference/gio/gio-sections.txt | 2 ++ + gio/giotypes.h | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) commit e1a4389cbc549b0db39ec692f2fde5c20579362c Author: Alexander Larsson -Date: Tue May 19 10:57:58 2009 +0200 +Date: Tue May 19 10:57:58 2009 +0200 Rename g_socket_check_pending_error to g_socket_check_connect_result This is only used for connect anyway, and this describes the operation better. - docs/reference/gio/gio-sections.txt | 2 +- - gio/gio.symbols | 2 +- - gio/gsocket.c | 12 ++++++------ - gio/gsocket.h | 2 +- - gio/gsocketclient.c | 2 +- + docs/reference/gio/gio-sections.txt | 2 +- + gio/gio.symbols | 2 +- + gio/gsocket.c | 12 ++++++------ + gio/gsocket.h | 2 +- + gio/gsocketclient.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) commit bcba61c951c0a81326e2065ae81352ae2cbca6bb Author: Alexander Larsson -Date: Tue May 19 10:47:55 2009 +0200 +Date: Tue May 19 10:47:55 2009 +0200 Update docs on listen backlog @@ -13025,7 +38000,7 @@ Date: Tue May 19 10:47:55 2009 +0200 commit 69130db81a0b174bb072f458e8c1b1cd6bc1a0c9 Author: Alexander Larsson -Date: Tue May 19 10:40:27 2009 +0200 +Date: Tue May 19 10:40:27 2009 +0200 Read socket state in g_socket_get_local/remote_address @@ -13035,15 +38010,15 @@ Date: Tue May 19 10:40:27 2009 +0200 bound to which may not have the final port set. - gio/gsocket.c | 88 + gio/gsocket.c | 88 ++++++++++++++------------------------------ - gio/gsocketconnection.c | 2 + - gio/tests/socket-server.c | 1 + + gio/gsocketconnection.c | 2 + + gio/tests/socket-server.c | 1 + 3 files changed, 31 insertions(+), 60 deletions(-) commit f8cd1c530488c0b56634fab049ac775d094e9e58 Author: Alexander Larsson -Date: Tue May 19 10:16:32 2009 +0200 +Date: Tue May 19 10:16:32 2009 +0200 Clean up refereces to @protocol_id in g_socket_new docs @@ -13054,7 +38029,7 @@ Date: Tue May 19 10:16:32 2009 +0200 commit 3756ddb0eea8cef31e9aaad53eb6aa7d24a80fde Author: Alexander Larsson -Date: Mon May 18 23:24:13 2009 +0200 +Date: Mon May 18 23:24:13 2009 +0200 Ignore error when setting SO_REUSEADDR @@ -13067,20 +38042,20 @@ Date: Mon May 18 23:24:13 2009 +0200 commit f24c7fa9cbf2e0caa08a48ef64141d7ea50105aa Author: Alexander Larsson -Date: Mon May 18 21:30:33 2009 +0200 +Date: Mon May 18 21:30:33 2009 +0200 Add support for abstract unix socket addresses - docs/reference/gio/gio-sections.txt | 5 + - gio/gsocketaddress.c | 3 + - gio/gunixsocketaddress.c | 300 + docs/reference/gio/gio-sections.txt | 5 + + gio/gsocketaddress.c | 3 + + gio/gunixsocketaddress.c | 300 ++++++++++++++++++++++++++++------- - gio/gunixsocketaddress.h | 9 +- + gio/gunixsocketaddress.h | 9 +- 4 files changed, 262 insertions(+), 55 deletions(-) commit d8bdc3e5678498996efe618bec32b8ae43ca8b39 Author: Alexander Larsson -Date: Mon May 18 14:10:07 2009 +0200 +Date: Mon May 18 14:10:07 2009 +0200 Add GError to g_socket_address_to_native @@ -13089,16 +38064,16 @@ Date: Mon May 18 14:10:07 2009 +0200 abstract paths for unix domain sockets. gio/ginetsocketaddress.c | 23 +++++++++++++++++++---- - gio/gresolver.c | 2 +- - gio/gsocket.c | 11 +++++++---- - gio/gsocketaddress.c | 13 +++++++++---- - gio/gsocketaddress.h | 6 ++++-- + gio/gresolver.c | 2 +- + gio/gsocket.c | 11 +++++++---- + gio/gsocketaddress.c | 13 +++++++++---- + gio/gsocketaddress.h | 6 ++++-- gio/gunixsocketaddress.c | 9 +++++++-- 6 files changed, 47 insertions(+), 17 deletions(-) commit eefd7cd8db5c7749212e7c9861a84eb3e34be1ee Author: Jorge Gonzalez -Date: Mon May 18 20:19:05 2009 +0200 +Date: Mon May 18 20:19:05 2009 +0200 Updated Spanish translation @@ -13108,49 +38083,49 @@ Date: Mon May 18 20:19:05 2009 +0200 commit 6ea86cc57f1b8b8c7acc4e08ece8baef5f28a53a Author: Alexander Larsson -Date: Mon May 18 13:02:11 2009 +0200 +Date: Mon May 18 13:02:11 2009 +0200 Update the docs for the new network APIs This imports the network APIs into the gio reference docs, and cleans up a bunch of gtk-doc warnings and documentation issues. - docs/reference/gio/gio-docs.xml | 43 +++- - docs/reference/gio/gio-sections.txt | 350 + docs/reference/gio/gio-docs.xml | 43 +++- + docs/reference/gio/gio-sections.txt | 350 ++++++++++++++++++++++++++++- - docs/reference/gio/gio.types | 20 ++- - docs/reference/gio/overview.xml | 28 +++ + docs/reference/gio/gio.types | 20 ++- + docs/reference/gio/overview.xml | 28 +++ docs/reference/glib/tmpl/glib-unused.sgml | 67 ++++++ - docs/reference/glib/tmpl/macros_misc.sgml | 5 +- - docs/reference/glib/tmpl/version.sgml | 68 ------ - gio/gasyncinitable.c | 7 +- - gio/gfile.c | 2 +- - gio/gfile.h | 9 + - gio/gfileenumerator.c | 2 +- - gio/gfileiostream.c | 10 +- - gio/ginetsocketaddress.c | 2 +- - gio/ginitable.c | 9 +- - gio/gioenums.h | 5 +- - gio/giostream.c | 9 +- - gio/giotypes.h | 2 + - gio/gmount.c | 2 +- - gio/gmount.h | 1 + - gio/gsocket.c | 4 +- - gio/gsocket.h | 5 - - gio/gsocketclient.c | 25 +- - gio/gsocketclient.h | 8 +- - gio/gsocketconnection.c | 17 ++- - gio/gsocketconnection.h | 2 +- - gio/gsocketlistener.c | 10 +- - gio/gsocketservice.c | 3 +- - gio/gthemedicon.c | 6 +- - gio/gunixconnection.c | 2 +- - gio/gunixsocketaddress.c | 2 +- + docs/reference/glib/tmpl/macros_misc.sgml | 5 +- + docs/reference/glib/tmpl/version.sgml | 68 ------ + gio/gasyncinitable.c | 7 +- + gio/gfile.c | 2 +- + gio/gfile.h | 9 + + gio/gfileenumerator.c | 2 +- + gio/gfileiostream.c | 10 +- + gio/ginetsocketaddress.c | 2 +- + gio/ginitable.c | 9 +- + gio/gioenums.h | 5 +- + gio/giostream.c | 9 +- + gio/giotypes.h | 2 + + gio/gmount.c | 2 +- + gio/gmount.h | 1 + + gio/gsocket.c | 4 +- + gio/gsocket.h | 5 - + gio/gsocketclient.c | 25 +- + gio/gsocketclient.h | 8 +- + gio/gsocketconnection.c | 17 ++- + gio/gsocketconnection.h | 2 +- + gio/gsocketlistener.c | 10 +- + gio/gsocketservice.c | 3 +- + gio/gthemedicon.c | 6 +- + gio/gunixconnection.c | 2 +- + gio/gunixsocketaddress.c | 2 +- 30 files changed, 575 insertions(+), 150 deletions(-) commit e1afc6e79b9526d68eff0f218ac98a6f0e323513 Author: Alexander Larsson -Date: Mon May 18 11:30:48 2009 +0200 +Date: Mon May 18 11:30:48 2009 +0200 Remove gtk-doc warnings @@ -13158,13 +38133,13 @@ Date: Mon May 18 11:30:48 2009 +0200 just turn it into ordinary comments. - gio/fen/fen-kernel.c | 2 +- + gio/fen/fen-kernel.c | 2 +- gio/inotify/inotify-helper.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 822abda451c9999ac4e1cf3b8d5649ebebbb5ee4 Author: Alexander Larsson -Date: Mon May 18 11:29:11 2009 +0200 +Date: Mon May 18 11:29:11 2009 +0200 Add more internal headers for gtk-doc to ignore @@ -13176,34 +38151,34 @@ Date: Mon May 18 11:29:11 2009 +0200 commit c3f4e0162714f4712edcf51fa1502c8187faf5c0 Author: Alexander Larsson -Date: Mon May 18 11:27:49 2009 +0200 +Date: Mon May 18 11:27:49 2009 +0200 Make all non-static functions start with underscore We don't want to export a lot of non-namespaced internal symbols. - gio/fen/fen-data.c | 158 + gio/fen/fen-data.c | 158 ++++++++++++++++++++-------------------- - gio/fen/fen-data.h | 28 ++++---- - gio/fen/fen-dump.c | 2 +- - gio/fen/fen-helper.c | 76 ++++++++++---------- - gio/fen/fen-helper.h | 6 +- - gio/fen/fen-kernel.c | 22 +++--- - gio/fen/fen-kernel.h | 14 ++-- - gio/fen/fen-missing.c | 10 +- - gio/fen/fen-missing.h | 4 +- - gio/fen/fen-node.c | 38 +++++----- - gio/fen/fen-node.h | 22 +++--- - gio/fen/fen-sub.c | 4 +- - gio/fen/fen-sub.h | 4 +- + gio/fen/fen-data.h | 28 ++++---- + gio/fen/fen-dump.c | 2 +- + gio/fen/fen-helper.c | 76 ++++++++++---------- + gio/fen/fen-helper.h | 6 +- + gio/fen/fen-kernel.c | 22 +++--- + gio/fen/fen-kernel.h | 14 ++-- + gio/fen/fen-missing.c | 10 +- + gio/fen/fen-missing.h | 4 +- + gio/fen/fen-node.c | 38 +++++----- + gio/fen/fen-node.h | 22 +++--- + gio/fen/fen-sub.c | 4 +- + gio/fen/fen-sub.h | 4 +- gio/fen/gfendirectorymonitor.c | 16 ++-- - gio/fen/gfenfilemonitor.c | 16 ++-- + gio/fen/gfenfilemonitor.c | 16 ++-- gio/fen/libfen_la-fen-dump.loT | 7 ++ 16 files changed, 217 insertions(+), 210 deletions(-) commit 66d49b8bdeed9bac71acda847d8cbe0203dd5ba4 Author: Alexander Larsson -Date: Mon May 18 09:28:26 2009 +0200 +Date: Mon May 18 09:28:26 2009 +0200 Remove g_socket_set/get_reuse_address from header @@ -13214,19 +38189,19 @@ Date: Mon May 18 09:28:26 2009 +0200 commit 13cb01176291a8baa171da8dcb9f679b274af450 Author: Alexander Larsson -Date: Mon May 18 08:47:10 2009 +0200 +Date: Mon May 18 08:47:10 2009 +0200 Add max_threads argument to g_threaded_socket_service_new gio/gthreadedsocketservice.c | 4 +++- gio/gthreadedsocketservice.h | 2 +- gio/tests/echo-server.c | 2 +- - gio/tests/httpd.c | 2 +- + gio/tests/httpd.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) commit 5b683af237f1c5dac62c83e11459d46799ba6ecf Author: Paul Pogonyshev -Date: Sun May 17 15:17:57 2009 +0300 +Date: Sun May 17 15:17:57 2009 +0300 Fix error message in set_mtime_atime() @@ -13237,22 +38212,22 @@ Date: Sun May 17 15:17:57 2009 +0300 commit 34e74378c9fc99a3dc75eb9680bb00cb784029bb Author: Alexander Larsson -Date: Fri May 15 21:34:14 2009 +0200 +Date: Fri May 15 21:34:14 2009 +0200 Add test apps for highlevel socket classes echo-server - simple echo server httpd - simple http server - gio/tests/Makefile.am | 10 +++- + gio/tests/Makefile.am | 10 +++- gio/tests/echo-server.c | 73 +++++++++++++++++++ - gio/tests/httpd.c | 183 + gio/tests/httpd.c | 183 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 265 insertions(+), 1 deletions(-) commit 67df7d43e926702290280578cd6b89fee7302d72 Author: Alexander Larsson -Date: Fri May 15 21:27:54 2009 +0200 +Date: Fri May 15 21:27:54 2009 +0200 Add references to highlevel classes in GSocket docs @@ -13261,39 +38236,39 @@ Date: Fri May 15 21:27:54 2009 +0200 commit ce8361217c1c9bd458eab55554a77d24210235cc Author: Alexander Larsson -Date: Fri May 15 21:26:24 2009 +0200 +Date: Fri May 15 21:26:24 2009 +0200 Import all the highlevel socket classes from gnio - gio/Makefile.am | 22 +- - gio/gio-marshal.list | 1 + - gio/gio.h | 8 +- - gio/gio.symbols | 82 ++++ - gio/giotypes.h | 50 +++ - gio/gsocketclient.c | 912 + gio/Makefile.am | 22 +- + gio/gio-marshal.list | 1 + + gio/gio.h | 8 +- + gio/gio.symbols | 82 ++++ + gio/giotypes.h | 50 +++ + gio/gsocketclient.c | 912 ++++++++++++++++++++++++++++++++++++++++++ - gio/gsocketclient.h | 115 ++++++ + gio/gsocketclient.h | 115 ++++++ gio/gsocketconnection.c | 474 ++++++++++++++++++++++ gio/gsocketconnection.h | 91 +++++ gio/gsocketinputstream.c | 259 ++++++++++++ gio/gsocketinputstream.h | 58 +++ - gio/gsocketlistener.c | 815 +++++++++++++++++++++++++++++++++++++ - gio/gsocketlistener.h | 134 ++++++ + gio/gsocketlistener.c | 815 +++++++++++++++++++++++++++++++++++++ + gio/gsocketlistener.h | 134 ++++++ gio/gsocketoutputstream.c | 259 ++++++++++++ gio/gsocketoutputstream.h | 58 +++ - gio/gsocketservice.c | 330 +++++++++++++++ - gio/gsocketservice.h | 88 ++++ - gio/gtcpconnection.c | 67 +++ - gio/gtcpconnection.h | 64 +++ + gio/gsocketservice.c | 330 +++++++++++++++ + gio/gsocketservice.h | 88 ++++ + gio/gtcpconnection.c | 67 +++ + gio/gtcpconnection.h | 64 +++ gio/gthreadedsocketservice.c | 215 ++++++++++ gio/gthreadedsocketservice.h | 81 ++++ - gio/gunixconnection.c | 293 ++++++++++++++ - gio/gunixconnection.h | 77 ++++ + gio/gunixconnection.c | 293 ++++++++++++++ + gio/gunixconnection.h | 77 ++++ 23 files changed, 4550 insertions(+), 3 deletions(-) commit 2597e3adc37ce342972e995444f4417e0aa6fb5d Author: Alexander Larsson -Date: Fri May 15 20:58:27 2009 +0200 +Date: Fri May 15 20:58:27 2009 +0200 Remove unused variable @@ -13302,7 +38277,7 @@ Date: Fri May 15 20:58:27 2009 +0200 commit 4ade78fc3d242b58d57d92944c16ba7ef4614b2c Author: Alexander Larsson -Date: Fri May 15 20:43:02 2009 +0200 +Date: Fri May 15 20:43:02 2009 +0200 Include stdlib.h to avoid warning @@ -13313,16 +38288,16 @@ Date: Fri May 15 20:43:02 2009 +0200 commit d3a2c457cb55730181c04c8d6d1f611ee555c250 Author: Alexander Larsson -Date: Fri May 15 20:42:04 2009 +0200 +Date: Fri May 15 20:42:04 2009 +0200 Forgot to return the allocated data in async_op_wrapper_new - gio/gfileiostream.c | 2 ++ + gio/gfileiostream.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) commit a48fc532519b849498c8b75dde578caf0c270b23 Author: Alexander Larsson -Date: Fri May 15 10:42:28 2009 +0200 +Date: Fri May 15 10:42:28 2009 +0200 Make cancellable pipe fds close-on-exec @@ -13330,26 +38305,26 @@ Date: Fri May 15 10:42:28 2009 +0200 cancellable fds accidentally leak to child processes. - gio/gcancellable.c | 16 ++++++++++++++++ + gio/gcancellable.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) commit 23424e7bcb93abe805394d11e8b32beb7571e87c Author: Alexander Larsson -Date: Fri May 15 10:28:30 2009 +0200 +Date: Fri May 15 10:28:30 2009 +0200 Add padding to new classes - gio/gsocketcontrolmessage.h | 9 +++++++++ - gio/gunixfdmessage.h | 6 ++++++ + gio/gsocketcontrolmessage.h | 9 +++++++++ + gio/gunixfdmessage.h | 6 ++++++ 2 files changed, 15 insertions(+), 0 deletions(-) commit 8f67f47e05a9244d86d9661caa73e5a2fc573e55 Author: Alexander Larsson -Date: Fri May 15 10:08:18 2009 +0200 +Date: Fri May 15 10:08:18 2009 +0200 Add test apps for GSocket API - gio/tests/Makefile.am | 10 ++- + gio/tests/Makefile.am | 10 ++- gio/tests/socket-client.c | 294 +++++++++++++++++++++++++++++++++++++++++++ gio/tests/socket-server.c | 304 @@ -13358,7 +38333,7 @@ Date: Fri May 15 10:08:18 2009 +0200 commit a258ec3b5bf0a0b2ab1cb1dce8ce715c3895bdaa Author: Alexander Larsson -Date: Fri May 15 10:05:55 2009 +0200 +Date: Fri May 15 10:05:55 2009 +0200 Fix deadlock in threaded resolver @@ -13372,7 +38347,7 @@ Date: Fri May 15 10:05:55 2009 +0200 commit f662e7e86bc27102948683c0925815efefb43bbc Author: Alexander Larsson -Date: Fri May 15 09:10:23 2009 +0200 +Date: Fri May 15 09:10:23 2009 +0200 Store protocol by id, add lookup function for name @@ -13387,28 +38362,28 @@ Date: Fri May 15 09:10:23 2009 +0200 to get it. gio/gio.symbols | 4 +- - gio/gsocket.c | 178 + gio/gsocket.c | 178 +++++++++++++++++++++++++++++++++++++++++-------------- - gio/gsocket.h | 6 +- + gio/gsocket.h | 6 +- 3 files changed, 141 insertions(+), 47 deletions(-) commit bd87df9e73272c72a1f45cc606d010e8c4961363 Author: Alexander Larsson -Date: Thu May 14 16:58:47 2009 +0200 +Date: Thu May 14 16:58:47 2009 +0200 Make GSocketSourceFunc return the GSocket This is very useful when you have multiple sockets with sources. - gio/gasynchelper.c | 38 +++++++++++++++++++++++++++++--------- - gio/gasynchelper.h | 14 +++++++++++--- - gio/giotypes.h | 8 +++++--- - gio/gsocket.c | 8 +++++--- + gio/gasynchelper.c | 38 +++++++++++++++++++++++++++++--------- + gio/gasynchelper.h | 14 +++++++++++--- + gio/giotypes.h | 8 +++++--- + gio/gsocket.c | 8 +++++--- 4 files changed, 50 insertions(+), 18 deletions(-) commit 7ffdc91f513d6b91d060df6e3ad3401ef23e968d Author: Alexander Larsson -Date: Thu May 14 16:19:07 2009 +0200 +Date: Thu May 14 16:19:07 2009 +0200 Set optlen before calling getsockopt @@ -13421,7 +38396,7 @@ Date: Thu May 14 16:19:07 2009 +0200 commit 145cec3c93d5ba0c22d35aaf341b3713cadc0e14 Author: Alexander Larsson -Date: Thu May 14 15:26:37 2009 +0200 +Date: Thu May 14 15:26:37 2009 +0200 Import GInitable, GSocket and dependencies from gnio @@ -13437,36 +38412,36 @@ Date: Thu May 14 15:26:37 2009 +0200 file boiler plate were updated to glib style and gio.symbols stuff was added. - configure.in | 16 + - gio/Makefile.am | 10 + - gio/gasyncinitable.c | 383 ++++++ - gio/gasyncinitable.h | 119 ++ - gio/ginitable.c | 251 ++++ - gio/ginitable.h | 95 ++ - gio/gio.h | 4 + - gio/gio.symbols | 81 ++ - gio/gioenums.h | 46 +- - gio/gioerror.c | 6 + - gio/giotypes.h | 59 + - gio/gsocket.c | 2970 + configure.in | 16 + + gio/Makefile.am | 10 + + gio/gasyncinitable.c | 383 ++++++ + gio/gasyncinitable.h | 119 ++ + gio/ginitable.c | 251 ++++ + gio/ginitable.h | 95 ++ + gio/gio.h | 4 + + gio/gio.symbols | 81 ++ + gio/gioenums.h | 46 +- + gio/gioerror.c | 6 + + gio/giotypes.h | 59 + + gio/gsocket.c | 2970 +++++++++++++++++++++++++++++++++++++++++++ - gio/gsocket.h | 172 +++ - gio/gsocketcontrolmessage.c | 200 +++ - gio/gsocketcontrolmessage.h | 96 ++ - gio/gunixfdmessage.c | 259 ++++ - gio/gunixfdmessage.h | 67 + + gio/gsocket.h | 172 +++ + gio/gsocketcontrolmessage.c | 200 +++ + gio/gsocketcontrolmessage.h | 96 ++ + gio/gunixfdmessage.c | 259 ++++ + gio/gunixfdmessage.h | 67 + 17 files changed, 4833 insertions(+), 1 deletions(-) commit 33c00e5c33dfe612e5d8757dd07e4c3acae30acc Author: Alexander Larsson -Date: Thu May 14 10:53:53 2009 +0200 +Date: Thu May 14 10:53:53 2009 +0200 Add g_network_address_parse This is useful if you want to allow users to specify the hostname and optionally a port. - configure.in | 3 + + configure.in | 3 + gio/gio.symbols | 1 + gio/gnetworkaddress.c | 164 +++++++++++++++++++++++++++++++++++++++++++++++++ @@ -13475,7 +38450,7 @@ Date: Thu May 14 10:53:53 2009 +0200 commit 80a484ad2c2495134a87a35f8ac936e8e75c311a Author: Alexander Larsson -Date: Thu May 14 15:32:55 2009 +0200 +Date: Thu May 14 15:32:55 2009 +0200 Add the new GFile ops to gio.symbols @@ -13487,7 +38462,7 @@ Date: Thu May 14 15:32:55 2009 +0200 commit ed0821856533e63bee4f7da54f1a9e6e0b1f12e9 Author: Alexander Larsson -Date: Wed May 13 13:06:58 2009 +0200 +Date: Wed May 13 13:06:58 2009 +0200 Add tests for local GIOStream GFile ops @@ -13498,7 +38473,7 @@ Date: Wed May 13 13:06:58 2009 +0200 commit 14d58d51a325797aee3b53fb4e0ba76ca0adc3f5 Author: Alexander Larsson -Date: Wed May 13 13:03:47 2009 +0200 +Date: Wed May 13 13:03:47 2009 +0200 Local file implementation of GFileIOStream and ops @@ -13507,8 +38482,8 @@ Date: Wed May 13 13:03:47 2009 +0200 Some helpers stuff was added to the local input and output streams so they could be reused. - gio/Makefile.am | 2 + - gio/glocalfile.c | 67 ++++++++++++++++++++++ + gio/Makefile.am | 2 + + gio/glocalfile.c | 67 ++++++++++++++++++++++ gio/glocalfileinputstream.c | 12 ++++ gio/glocalfileinputstream.h | 5 +- gio/glocalfileiostream.c | 114 +++++++++++++++++++++++++++++++++++++ @@ -13520,7 +38495,7 @@ Date: Wed May 13 13:03:47 2009 +0200 commit 7a2d4889b50c5edd3f483c6e037faec1e093ab13 Author: Alexander Larsson -Date: Wed May 13 13:00:26 2009 +0200 +Date: Wed May 13 13:00:26 2009 +0200 Add GIOStream operations to GFile @@ -13528,14 +38503,14 @@ Date: Wed May 13 13:00:26 2009 +0200 g_file_replace_readwrite and async variants, with default implementations using threads. - gio/gfile.c | 666 + gio/gfile.c | 666 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - gio/gfile.h | 83 ++++++++ + gio/gfile.h | 83 ++++++++ 2 files changed, 749 insertions(+), 0 deletions(-) commit bd0b8c60c231c72588d69dfb2018d2e418517f7f Author: Alexander Larsson -Date: Tue May 12 16:59:36 2009 +0200 +Date: Tue May 12 16:59:36 2009 +0200 Add GFileIOStream class @@ -13543,19 +38518,19 @@ Date: Tue May 12 16:59:36 2009 +0200 GIOStreams. The default implementations chain to the Output stream. - gio/Makefile.am | 2 + - gio/gfileiostream.c | 671 + gio/Makefile.am | 2 + + gio/gfileiostream.c | 671 +++++++++++++++++++++++++++++++++++++++++++++++++++ - gio/gfileiostream.h | 118 +++++++++ - gio/gio.h | 1 + - gio/gio.symbols | 10 + - gio/giostream.c | 3 - - gio/giotypes.h | 1 + + gio/gfileiostream.h | 118 +++++++++ + gio/gio.h | 1 + + gio/gio.symbols | 10 + + gio/giostream.c | 3 - + gio/giotypes.h | 1 + 7 files changed, 803 insertions(+), 3 deletions(-) commit 6d0bebb7df1129bb78cdd526e1b44c91b61321dd Author: Alexander Larsson -Date: Tue May 12 19:31:19 2009 +0200 +Date: Tue May 12 19:31:19 2009 +0200 Add comment about lifecycle issues for GIOStreams @@ -13564,14 +38539,14 @@ Date: Tue May 12 19:31:19 2009 +0200 commit 05f544c59191ea7eab076fbb77a2e3648d52e167 Author: Alexander Larsson -Date: Tue May 12 16:30:15 2009 +0200 +Date: Tue May 12 16:30:15 2009 +0200 Import GIOStream from gnio Based on gnio rev 84516a5f544d8d5f3da368a83844e84eca8ef771 gio/Makefile.am | 2 + - gio/gio.h | 1 + + gio/gio.h | 1 + gio/gio.symbols | 15 ++ gio/giostream.c | 607 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -13581,28 +38556,28 @@ Date: Tue May 12 16:30:15 2009 +0200 commit 1ecfae6a71b10cda9b3fa1e8f38bb22db01fb0af Author: Alexander Larsson -Date: Tue May 12 19:53:24 2009 +0200 +Date: Tue May 12 19:53:24 2009 +0200 Remove close in finalize, we do it in dispose This is not needed, and in fact it may be a bad idea to call it from finalize anyway since the object isn't fully alive then. - gio/ginputstream.c | 3 --- + gio/ginputstream.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) commit 2bbb85633f30da2a7b79b518ca7821cde475cb3a Author: Alexander Larsson -Date: Tue May 12 13:57:52 2009 +0200 +Date: Tue May 12 13:57:52 2009 +0200 Remove not actually used member "cancelled" - gio/goutputstream.c | 1 - + gio/goutputstream.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) commit 0030935d041f26e461aca6583927ea0cceb166bb Author: Tor Lillqvist -Date: Tue May 12 14:54:12 2009 +0300 +Date: Tue May 12 14:54:12 2009 +0300 Make glibconfig.h.win32.in match the generated one. @@ -13613,18 +38588,18 @@ Date: Tue May 12 14:54:12 2009 +0300 commit b3e4b761f465a8cb0948bd6381ad832a0a47436a Author: Alexander Larsson -Date: Wed May 6 13:26:17 2009 +0200 +Date: Wed May 6 13:26:17 2009 +0200 Fix gcancellable.c build on non-win32 I forgot to add #ifdef G_OS_WIN32 in one place, sorry. - gio/gcancellable.c | 2 ++ + gio/gcancellable.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) commit e10edefff1308cad307d954b17163538a3c7f20a Author: Alexander Larsson -Date: Wed May 6 13:10:58 2009 +0200 +Date: Wed May 6 13:10:58 2009 +0200 Simplify GCancellable support on win32 @@ -13640,13 +38615,13 @@ Date: Wed May 6 13:10:58 2009 +0200 I tested this with the cancellation support in GSocket from gnio. - gio/gcancellable.c | 56 + gio/gcancellable.c | 56 ++++++++++++++++++++++++--------------------------- 1 files changed, 26 insertions(+), 30 deletions(-) commit 2fff3026efbaf7e480d1a166c7166c44c6643567 Author: Paul Pogonyshev -Date: Mon May 4 22:32:35 2009 +0300 +Date: Mon May 4 22:32:35 2009 +0300 Don't try to ref NULL pointer in g_desktop_app_info_dup() @@ -13657,20 +38632,20 @@ Date: Mon May 4 22:32:35 2009 +0300 commit d89cc0d7cbad8b6904931440e579e291ce81780d Author: Carlos Garnacho -Date: Tue May 5 14:45:18 2009 -0400 +Date: Tue May 5 14:45:18 2009 -0400 Add a GMount::pre-unmount signal This is the per-mount analogon to GVolumeMonitor::mount-pre-unmount. - gio/gmount.c | 16 ++++++++++++++++ - gio/gmount.h | 3 +++ + gio/gmount.c | 16 ++++++++++++++++ + gio/gmount.h | 3 +++ gio/gunixmount.c | 2 ++ 3 files changed, 21 insertions(+), 0 deletions(-) commit 4ecec3b1c2d335b1e26b209fc7e2b77013ece795 Author: Manoj Kumar Giri -Date: Tue May 5 12:34:44 2009 +0530 +Date: Tue May 5 12:34:44 2009 +0530 Updated Oriya Translation. @@ -13680,7 +38655,7 @@ Date: Tue May 5 12:34:44 2009 +0530 commit 757f9281d7aac1254a156136440b4df4fa52e3a1 Author: Matthias Clasen -Date: Sun May 3 18:08:01 2009 -0400 +Date: Sun May 3 18:08:01 2009 -0400 Bump version to 2.21.1 @@ -13689,126 +38664,126 @@ Date: Sun May 3 18:08:01 2009 -0400 commit a28215fa909ef315e596ebd0b41132730aef909d Author: Matthias Clasen -Date: Sun May 3 18:04:31 2009 -0400 +Date: Sun May 3 18:04:31 2009 -0400 Release 2.21.0 - docs/reference/gio/gio-docs.xml | 3 + - docs/reference/glib/glib-docs.sgml | 3 + + docs/reference/gio/gio-docs.xml | 3 + + docs/reference/glib/glib-docs.sgml | 3 + docs/reference/gobject/gobject-docs.sgml | 3 + - gio/gcancellable.c | 58 +- - gio/gresolver.c | 37 +- - gio/gsrvtarget.c | 16 +- - gio/gthreadedresolver.c | 10 +- - gio/gunixresolver.c | 2 +- - po/am.po | 226 +++----- - po/ar.po | 286 +++++----- - po/as.po | 300 +++++----- - po/az.po | 276 ++++------ - po/be.po | 302 +++++------ - po/be@latin.po | 306 +++++------ - po/bg.po | 307 +++++----- - po/bn.po | 271 ++++----- - po/bn_IN.po | 291 +++++----- - po/bs.po | 276 ++++------ - po/ca.po | 915 + gio/gcancellable.c | 58 +- + gio/gresolver.c | 37 +- + gio/gsrvtarget.c | 16 +- + gio/gthreadedresolver.c | 10 +- + gio/gunixresolver.c | 2 +- + po/am.po | 226 +++----- + po/ar.po | 286 +++++----- + po/as.po | 300 +++++----- + po/az.po | 276 ++++------ + po/be.po | 302 +++++------ + po/be@latin.po | 306 +++++------ + po/bg.po | 307 +++++----- + po/bn.po | 271 ++++----- + po/bn_IN.po | 291 +++++----- + po/bs.po | 276 ++++------ + po/ca.po | 915 +++++++++++++++--------------- - po/cs.po | 801 + po/cs.po | 801 +++++++++++++------------- - po/cy.po | 274 ++++----- - po/da.po | 304 +++++----- - po/de.po | 312 +++++------ - po/dz.po | 272 ++++----- - po/el.po | 306 +++++----- - po/en_CA.po | 289 +++++----- - po/en_GB.po | 300 +++++----- - po/eo.po | 270 ++++----- - po/es.po | 806 + po/cy.po | 274 ++++----- + po/da.po | 304 +++++----- + po/de.po | 312 +++++------ + po/dz.po | 272 ++++----- + po/el.po | 306 +++++----- + po/en_CA.po | 289 +++++----- + po/en_GB.po | 300 +++++----- + po/eo.po | 270 ++++----- + po/es.po | 806 +++++++++++++------------- - po/et.po | 402 +++++++++++++- - po/eu.po | 310 +++++------ - po/fa.po | 276 ++++------ - po/fi.po | 304 +++++----- - po/fr.po | 312 +++++------ - po/ga.po | 244 +++----- - po/gl.po | 306 +++++----- - po/gu.po | 296 +++++----- - po/he.po | 300 +++++----- - po/hi.po | 296 +++++----- - po/hr.po | 272 ++++----- - po/hu.po | 305 +++++----- - po/hy.po | 228 +++----- - po/id.po | 280 ++++------ - po/is.po | 273 ++++----- - po/it.po | 309 +++++------ - po/ja.po | 305 +++++----- - po/ka.po | 272 ++++----- - po/kn.po | 302 +++++----- - po/ko.po | 308 +++++------ - po/ku.po | 210 +++----- - po/lt.po | 304 +++++----- - po/lv.po | 276 ++++------ - po/mai.po | 286 +++++----- - po/mg.po | 276 ++++------ - po/mk.po | 281 ++++----- - po/ml.po | 300 +++++----- - po/mn.po | 276 ++++------ - po/mr.po | 298 +++++----- - po/ms.po | 276 ++++------ - po/nb.po | 302 +++++----- - po/ne.po | 274 ++++----- - po/nl.po | 319 +++++------ - po/nn.po | 278 ++++----- - po/oc.po | 209 +++----- - po/or.po | 296 +++++----- - po/pa.po | 296 +++++----- - po/pl.po | 304 +++++----- - po/ps.po | 919 + po/et.po | 402 +++++++++++++- + po/eu.po | 310 +++++------ + po/fa.po | 276 ++++------ + po/fi.po | 304 +++++----- + po/fr.po | 312 +++++------ + po/ga.po | 244 +++----- + po/gl.po | 306 +++++----- + po/gu.po | 296 +++++----- + po/he.po | 300 +++++----- + po/hi.po | 296 +++++----- + po/hr.po | 272 ++++----- + po/hu.po | 305 +++++----- + po/hy.po | 228 +++----- + po/id.po | 280 ++++------ + po/is.po | 273 ++++----- + po/it.po | 309 +++++------ + po/ja.po | 305 +++++----- + po/ka.po | 272 ++++----- + po/kn.po | 302 +++++----- + po/ko.po | 308 +++++------ + po/ku.po | 210 +++----- + po/lt.po | 304 +++++----- + po/lv.po | 276 ++++------ + po/mai.po | 286 +++++----- + po/mg.po | 276 ++++------ + po/mk.po | 281 ++++----- + po/ml.po | 300 +++++----- + po/mn.po | 276 ++++------ + po/mr.po | 298 +++++----- + po/ms.po | 276 ++++------ + po/nb.po | 302 +++++----- + po/ne.po | 274 ++++----- + po/nl.po | 319 +++++------ + po/nn.po | 278 ++++----- + po/oc.po | 209 +++----- + po/or.po | 296 +++++----- + po/pa.po | 296 +++++----- + po/pl.po | 304 +++++----- + po/ps.po | 919 ++++++++++++++---------------- - po/pt.po | 305 +++++----- - po/pt_BR.po | 304 +++++----- - po/ro.po | 307 +++++----- - po/ru.po | 312 +++++------ - po/rw.po | 276 ++++----- - po/si.po | 253 ++++----- - po/sk.po | 279 ++++----- - po/sl.po | 300 +++++----- - po/sq.po | 328 +++++------ - po/sr.po | 271 ++++----- - po/sr@ije.po | 282 ++++------ - po/sr@latin.po | 271 ++++----- - po/sv.po | 304 +++++----- - po/ta.po | 298 +++++----- - po/te.po | 296 +++++----- - po/th.po | 296 +++++----- - po/tl.po | 284 ++++------ - po/tr.po | 304 +++++----- - po/tt.po | 238 +++----- - po/uk.po | 300 +++++------ - po/vi.po | 302 +++++----- - po/wa.po | 255 ++++----- - po/xh.po | 278 ++++------ - po/yi.po | 273 ++++----- - po/zh_CN.po | 296 +++++----- - po/zh_HK.po | 296 +++++----- - po/zh_TW.po | 296 +++++----- + po/pt.po | 305 +++++----- + po/pt_BR.po | 304 +++++----- + po/ro.po | 307 +++++----- + po/ru.po | 312 +++++------ + po/rw.po | 276 ++++----- + po/si.po | 253 ++++----- + po/sk.po | 279 ++++----- + po/sl.po | 300 +++++----- + po/sq.po | 328 +++++------ + po/sr.po | 271 ++++----- + po/sr@ije.po | 282 ++++------ + po/sr@latin.po | 271 ++++----- + po/sv.po | 304 +++++----- + po/ta.po | 298 +++++----- + po/te.po | 296 +++++----- + po/th.po | 296 +++++----- + po/tl.po | 284 ++++------ + po/tr.po | 304 +++++----- + po/tt.po | 238 +++----- + po/uk.po | 300 +++++------ + po/vi.po | 302 +++++----- + po/wa.po | 255 ++++----- + po/xh.po | 278 ++++------ + po/yi.po | 273 ++++----- + po/zh_CN.po | 296 +++++----- + po/zh_HK.po | 296 +++++----- + po/zh_TW.po | 296 +++++----- 95 files changed, 12758 insertions(+), 14748 deletions(-) commit 4e694faa332a6ef4c576176b568a7f74e142103a Author: Paul Pogonyshev -Date: Mon May 4 00:55:35 2009 +0300 +Date: Mon May 4 00:55:35 2009 +0300 Fix g_input_stream_skip_async() documentation Remove mention of inexisting argument. Spotted in relation to bug 581229. - gio/ginputstream.c | 4 ++-- + gio/ginputstream.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit f33a484b4a1a14902dc1789c2e023fbcd4136098 Author: Matthias Clasen -Date: Sun May 3 17:10:16 2009 -0400 +Date: Sun May 3 17:10:16 2009 -0400 Fix up tests forgotten in Michaels commit @@ -13820,16 +38795,16 @@ Date: Sun May 3 17:10:16 2009 -0400 commit 008ae16d75b2f6e908258d883d8b1c98a98bd648 Author: Matthias Clasen -Date: Sun May 3 16:58:22 2009 -0400 +Date: Sun May 3 16:58:22 2009 -0400 Add new functions - docs/reference/gobject/gobject-sections.txt | 6 ++++++ + docs/reference/gobject/gobject-sections.txt | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) commit d1e6e194cc30744e47067378eb338f7d5a0f1e2b Author: Petr Kovar -Date: Sun May 3 18:34:35 2009 +0200 +Date: Sun May 3 18:34:35 2009 +0200 Updated Czech translation @@ -13839,7 +38814,7 @@ Date: Sun May 3 18:34:35 2009 +0200 commit b3fc55cc4e5b578acc0a06e164c29fe43d060b10 Author: Ivar Smolin -Date: Sun May 3 12:03:46 2009 +0300 +Date: Sun May 3 12:03:46 2009 +0300 Updating Estonian translation @@ -13849,16 +38824,16 @@ Date: Sun May 3 12:03:46 2009 +0300 commit 3f06ddd8cdfa7f4ebf09ef24db7dad5270be36df Author: Matthias Clasen -Date: Sat May 2 23:17:29 2009 -0400 +Date: Sat May 2 23:17:29 2009 -0400 Match up parameter names to help gtk-doc - gio/gcancellable.h | 2 +- + gio/gcancellable.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 2e4855ec4b611b9a17c466f4d26a694480f80ad6 Author: Matthias Clasen -Date: Sat May 2 23:02:41 2009 -0400 +Date: Sat May 2 23:02:41 2009 -0400 Add bug references @@ -13867,7 +38842,7 @@ Date: Sat May 2 23:02:41 2009 -0400 commit 2e4b51aeb3bd5fa1fda52946e2d43fc8e7a28b4e Author: Matthias Clasen -Date: Sat May 2 22:59:02 2009 -0400 +Date: Sat May 2 22:59:02 2009 -0400 Plug a memory leak in g_simple_async_result_set_op_res_gpointer @@ -13878,7 +38853,7 @@ Date: Sat May 2 22:59:02 2009 -0400 commit 79ef3d32643519ae9c9710acf0c56b54ff540dc3 Author: Matthias Clasen -Date: Sat May 2 22:44:52 2009 -0400 +Date: Sat May 2 22:44:52 2009 -0400 Correct g_utf8_to_utf16 docs @@ -13889,7 +38864,7 @@ Date: Sat May 2 22:44:52 2009 -0400 commit 2dfce324220bf7e1ea5ca465a74e58cf8146b808 Author: Matthias Clasen -Date: Sat May 2 22:41:19 2009 -0400 +Date: Sat May 2 22:41:19 2009 -0400 Accept NULL as empty string list @@ -13900,18 +38875,18 @@ Date: Sat May 2 22:41:19 2009 -0400 commit a4ac1b0552785dfb2d323eb41c6d3875b214989b Author: Matthias Clasen -Date: Sat May 2 22:36:15 2009 -0400 +Date: Sat May 2 22:36:15 2009 -0400 Fix reference to g_strtoull As pointed out in bug 580546, that function does not exit. - docs/reference/glib/tmpl/macros_misc.sgml | 5 +++-- + docs/reference/glib/tmpl/macros_misc.sgml | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) commit fab0506f5f983dcad8f4c44dbef6fbc1f8fd1b3b Author: Matthias Clasen -Date: Sat May 2 22:30:19 2009 -0400 +Date: Sat May 2 22:30:19 2009 -0400 Update NEWS @@ -13920,7 +38895,7 @@ Date: Sat May 2 22:30:19 2009 -0400 commit ff104337d9e95f6e933f3d77a5a24e462c4713cf Author: Matthias Clasen -Date: Sat May 2 21:58:30 2009 -0400 +Date: Sat May 2 21:58:30 2009 -0400 Bump version to 2.21.0 @@ -13929,7 +38904,7 @@ Date: Sat May 2 21:58:30 2009 -0400 commit dc02797c1e386d72ff24268cc23c19352e8cef6f Author: Jorge Gonzalez -Date: Fri May 1 20:20:01 2009 +0200 +Date: Fri May 1 20:20:01 2009 +0200 Updated Spanish translation @@ -13939,7 +38914,7 @@ Date: Fri May 1 20:20:01 2009 +0200 commit 92ac8d165eae438164cffce01fe92cdcf6488970 Author: Dan Winship -Date: Fri May 1 10:08:52 2009 -0400 +Date: Fri May 1 10:08:52 2009 -0400 Misc warning fixes @@ -13956,40 +38931,40 @@ Date: Fri May 1 10:08:52 2009 -0400 tests/Makefile.am, tests/regex-test.c: remove redundant -DENABLE_REGEX - gio/tests/live-g-file.c | 4 ++-- - gio/xdgmime/xdgmimeglob.c | 1 - - glib/garray.c | 2 +- - glib/gbase64.c | 2 +- - glib/pcre/pcre_ucp_searchfuncs.c | 4 ++++ - glib/pcre/pcre_valid_utf8.c | 1 + + gio/tests/live-g-file.c | 4 ++-- + gio/xdgmime/xdgmimeglob.c | 1 - + glib/garray.c | 2 +- + glib/gbase64.c | 2 +- + glib/pcre/pcre_ucp_searchfuncs.c | 4 ++++ + glib/pcre/pcre_valid_utf8.c | 1 + glib/update-pcre/pcre_ucp_searchfuncs.c | 4 ++++ - glib/update-pcre/pcre_valid_utf8.c | 1 + - tests/Makefile.am | 9 +-------- - tests/regex-test.c | 2 ++ + glib/update-pcre/pcre_valid_utf8.c | 1 + + tests/Makefile.am | 9 +-------- + tests/regex-test.c | 2 ++ 10 files changed, 17 insertions(+), 13 deletions(-) commit 36cb01f447b2401195e3c6b577f490e868363630 Author: Dan Winship -Date: Fri May 1 10:08:23 2009 -0400 +Date: Fri May 1 10:08:23 2009 -0400 Add README and INSTALL to .gitignore since they are autogenerated - .gitignore | 3 +++ + .gitignore | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) commit 83699774fa669abfbc5c5c3dc9265308246bd4f6 Author: Michael Meeks -Date: Fri May 1 15:23:23 2009 +0100 +Date: Fri May 1 15:23:23 2009 +0100 Patch originally committed only to the ChangeLog & tests ... - Bug 572508 – gmarkup speedup ... + Bug 572508 – gmarkup speedup ... - * glib/gmarkup.c: Various optimizations: do less allocations - by - keeping a pool of GStrings, do in-place unescaping, avoid - redundant - utf-8 validation. + * glib/gmarkup.c: Various optimizations: do less allocations + by + keeping a pool of GStrings, do in-place unescaping, avoid + redundant + utf-8 validation. glib/gmarkup.c | 1129 +++++++++++++++++++++++--------------------------------- @@ -13997,7 +38972,7 @@ Date: Fri May 1 15:23:23 2009 +0100 commit d8029ca9bc24bcff7f33c973ef13fae7e6fab904 Author: Alexander Larsson -Date: Thu Apr 30 10:46:37 2009 +0200 +Date: Thu Apr 30 10:46:37 2009 +0200 Ensure g_inet_address_get_type() call is not optimized away @@ -14010,18 +38985,18 @@ Date: Thu Apr 30 10:46:37 2009 +0200 commit 97fe421518139dcb3477209d3d3c3b6744f54153 Author: David King -Date: Wed Apr 29 15:58:35 2009 +0200 +Date: Wed Apr 29 15:58:35 2009 +0200 Fix ginetaddress.c compile on Linux The GType type definition belongs outside the G_OS_WIN32 typedef. - gio/ginetaddress.c | 2 +- + gio/ginetaddress.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 402847c8878a6bf839facdf7a91f096769ebc609 Author: David Zeuthen -Date: Wed Apr 29 11:15:20 2009 -0400 +Date: Wed Apr 29 11:15:20 2009 -0400 Bug 580450 – Reference counting and boxed types for arrays @@ -14030,23 +39005,23 @@ Date: Wed Apr 29 11:15:20 2009 -0400 Signed-off-by: Matthias Clasen - docs/reference/glib/glib-sections.txt | 9 + - docs/reference/glib/tmpl/arrays.sgml | 41 ++++- + docs/reference/glib/glib-sections.txt | 9 + + docs/reference/glib/tmpl/arrays.sgml | 41 ++++- docs/reference/glib/tmpl/arrays_byte.sgml | 23 ++- docs/reference/glib/tmpl/arrays_pointer.sgml | 64 ++++++- - glib/garray.c | 253 + glib/garray.c | 253 ++++++++++++++++++++++++-- - glib/garray.h | 10 + - glib/glib.symbols | 9 + - glib/tests/array-test.c | 172 +++++++++++++++++ - gobject/gboxed.c | 33 ++++ - gobject/gboxed.h | 27 +++ - gobject/gobject.symbols | 3 + + glib/garray.h | 10 + + glib/glib.symbols | 9 + + glib/tests/array-test.c | 172 +++++++++++++++++ + gobject/gboxed.c | 33 ++++ + gobject/gboxed.h | 27 +++ + gobject/gobject.symbols | 3 + 11 files changed, 616 insertions(+), 28 deletions(-) commit d80e12104f139def9bea28a510bf1d7c103e20f9 Author: Alexander Larsson -Date: Wed Apr 29 12:19:57 2009 +0200 +Date: Wed Apr 29 12:19:57 2009 +0200 Ensure we're actually initializing the winsock library @@ -14055,27 +39030,27 @@ Date: Wed Apr 29 12:19:57 2009 +0200 away. If we assign the return value to a volatile location we ensure it is called. - gio/ginetaddress.c | 3 ++- + gio/ginetaddress.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) commit 49dfb50afc9400779c0be02ea3c285780b42c928 Author: David Zeuthen -Date: Sat Apr 25 22:41:07 2009 -0400 +Date: Sat Apr 25 22:41:07 2009 -0400 Bug 580453 – Hash and equal functions for gint64 and gdouble - docs/reference/glib/glib-sections.txt | 4 ++ + docs/reference/glib/glib-sections.txt | 4 ++ docs/reference/glib/tmpl/hash_tables.sgml | 38 ++++++++++++++ - glib/ghash.c | 13 +++-- - glib/ghash.h | 8 +++ - glib/glib.symbols | 4 ++ - glib/gutils.c | 78 + glib/ghash.c | 13 +++-- + glib/ghash.h | 8 +++ + glib/glib.symbols | 4 ++ + glib/gutils.c | 78 +++++++++++++++++++++++++++++ 6 files changed, 139 insertions(+), 6 deletions(-) commit 5a368d469a2441d7d77d78fe104dc3560093ebac Author: Jordi Mas i Hernandez -Date: Sun Apr 26 20:18:38 2009 +0200 +Date: Sun Apr 26 20:18:38 2009 +0200 Minor fixes to Catalan translation @@ -14085,7 +39060,7 @@ Date: Sun Apr 26 20:18:38 2009 +0200 commit 61f130015bbbbc99ce0189cca1c95f7e2e735202 Author: paul -Date: Sun Apr 26 13:16:34 2009 -0400 +Date: Sun Apr 26 13:16:34 2009 -0400 Fix socket-related configure tests on old platforms @@ -14096,7 +39071,7 @@ Date: Sun Apr 26 13:16:34 2009 -0400 commit 7c9caecfebf7d15899fe361324c414fbfc7b1317 Author: Dan Winship -Date: Sun Apr 26 12:18:42 2009 -0400 +Date: Sun Apr 26 12:18:42 2009 -0400 Fix the networking stuff on (current) OS X @@ -14104,13 +39079,13 @@ Date: Sun Apr 26 12:18:42 2009 -0400 slightly differently than Linux does, but explicitly including arpa/nameser_compat.h does the right thing on both. Part of #580301 - gio/ginetaddress.c | 3 +++ + gio/ginetaddress.c | 3 +++ gio/gnetworkingprivate.h | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) commit 9a15da50e4d10794c35e4b638b7ab521be671a6e Author: Dan Winship -Date: Sun Apr 26 09:59:28 2009 -0400 +Date: Sun Apr 26 09:59:28 2009 -0400 Fix ginetaddress.c compile on Solaris @@ -14121,12 +39096,12 @@ Date: Sun Apr 26 09:59:28 2009 -0400 accesses the in6_addr fields directly though, and so only works if you pass the actual in6_addr. #580194. - gio/ginetaddress.c | 20 ++++++++++---------- + gio/ginetaddress.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) commit 491a036d8480f4d710ef601a27a57b559b0a46d7 Author: Johan Bilien -Date: Wed Apr 22 19:09:34 2009 +0100 +Date: Wed Apr 22 19:09:34 2009 +0100 Fix translation from GIO's file attr to xattr attributes @@ -14142,7 +39117,7 @@ Date: Wed Apr 22 19:09:34 2009 +0100 commit a9c33dbd7aeeb715677d619cbddc0d621872cc43 Author: Christian Persch -Date: Wed Apr 22 15:12:37 2009 +0200 +Date: Wed Apr 22 15:12:37 2009 +0200 Use P_ for translatable param spec strings @@ -14150,11 +39125,11 @@ Date: Wed Apr 22 15:12:37 2009 +0200 instead of plain _(). Bug #579830. - gio/gfileicon.c | 4 +- - gio/ginetaddress.c | 48 + gio/gfileicon.c | 4 +- + gio/ginetaddress.c | 48 +++++++++++++++++++++++----------------------- - gio/gsocketaddress.c | 4 +- - gio/gthemedicon.c | 12 +++++----- + gio/gsocketaddress.c | 4 +- + gio/gthemedicon.c | 12 +++++----- gio/gunixinputstream.c | 8 +++--- gio/gunixoutputstream.c | 8 +++--- gio/gunixsocketaddress.c | 4 +- @@ -14162,7 +39137,7 @@ Date: Wed Apr 22 15:12:37 2009 +0200 commit 9a3d18d2a652f9f1567e09bdb1055e6cb462f710 Author: Dan Winship -Date: Mon Dec 29 13:38:28 2008 -0500 +Date: Mon Dec 29 13:38:28 2008 -0500 GResolver wrappers: GNetworkAddress, GNetworkService, GSocketConnectable @@ -14173,32 +39148,32 @@ Date: Mon Dec 29 13:38:28 2008 -0500 interfaces based on hostname and SRV record resolution. Part of #548466. - docs/reference/gio/gio-docs.xml | 3 + - docs/reference/gio/gio-sections.txt | 71 ++++ - docs/reference/gio/gio.types | 4 + - gio/Makefile.am | 8 + - gio/gio.h | 4 + - gio/gio.symbols | 35 ++ - gio/giotypes.h | 4 + - gio/gnetworkaddress.c | 462 ++++++++++++++++++++++++ - gio/gnetworkaddress.h | 65 ++++ - gio/gnetworkservice.c | 658 + docs/reference/gio/gio-docs.xml | 3 + + docs/reference/gio/gio-sections.txt | 71 ++++ + docs/reference/gio/gio.types | 4 + + gio/Makefile.am | 8 + + gio/gio.h | 4 + + gio/gio.symbols | 35 ++ + gio/giotypes.h | 4 + + gio/gnetworkaddress.c | 462 ++++++++++++++++++++++++ + gio/gnetworkaddress.h | 65 ++++ + gio/gnetworkservice.c | 658 +++++++++++++++++++++++++++++++++++ - gio/gnetworkservice.h | 69 ++++ - gio/gresolver.c | 12 + - gio/gsocketaddress.c | 90 +++++- - gio/gsocketaddressenumerator.c | 191 ++++++++++ - gio/gsocketaddressenumerator.h | 89 +++++ - gio/gsocketconnectable.c | 148 ++++++++ - gio/gsocketconnectable.h | 68 ++++ - gio/gsrvtarget.c | 7 +- - gio/tests/.gitignore | 1 + - gio/tests/resolver.c | 141 +++++++- + gio/gnetworkservice.h | 69 ++++ + gio/gresolver.c | 12 + + gio/gsocketaddress.c | 90 +++++- + gio/gsocketaddressenumerator.c | 191 ++++++++++ + gio/gsocketaddressenumerator.h | 89 +++++ + gio/gsocketconnectable.c | 148 ++++++++ + gio/gsocketconnectable.h | 68 ++++ + gio/gsrvtarget.c | 7 +- + gio/tests/.gitignore | 1 + + gio/tests/resolver.c | 141 +++++++- 20 files changed, 2121 insertions(+), 9 deletions(-) commit c94d3f92885456e1dc9e2fb27b709017f29d04ce Author: Dan Winship -Date: Mon Dec 29 12:53:47 2008 -0500 +Date: Mon Dec 29 12:53:47 2008 -0500 Add GResolver, a glib-ish interface to DNS @@ -14206,44 +39181,44 @@ Date: Mon Dec 29 12:53:47 2008 -0500 for resolving hostnames, reverse-resolving IP addresses back to hostnames, and resolving SRV records. Part of #548466. - configure.in | 25 + - docs/reference/gio/Makefile.am | 6 +- - docs/reference/gio/gio-docs.xml | 2 + - docs/reference/gio/gio-sections.txt | 52 ++ - docs/reference/gio/gio.types | 1 + - gio/Makefile.am | 18 +- - gio/ginetaddress.c | 7 +- - gio/gio.h | 2 + - gio/gio.symbols | 57 ++ - gio/gioenums.h | 14 + - gio/giotypes.h | 4 +- - gio/gnetworkingprivate.h | 32 + - gio/gresolver.c | 855 ++++++++++++++++++++ - gio/gresolver.h | 159 ++++ - gio/gsrvtarget.c | 334 ++++++++ - gio/gsrvtarget.h | 52 ++ - gio/gthreadedresolver.c | 617 ++++++++++++++ - gio/gthreadedresolver.h | 50 ++ - gio/gunixresolver.c | 433 ++++++++++ - gio/gunixresolver.h | 53 ++ - gio/gwin32resolver.c | 481 +++++++++++ - gio/gwin32resolver.h | 49 ++ - gio/libasyncns/Makefile.am | 15 + - gio/libasyncns/README | 7 + - gio/libasyncns/asyncns.c | 1498 + configure.in | 25 + + docs/reference/gio/Makefile.am | 6 +- + docs/reference/gio/gio-docs.xml | 2 + + docs/reference/gio/gio-sections.txt | 52 ++ + docs/reference/gio/gio.types | 1 + + gio/Makefile.am | 18 +- + gio/ginetaddress.c | 7 +- + gio/gio.h | 2 + + gio/gio.symbols | 57 ++ + gio/gioenums.h | 14 + + gio/giotypes.h | 4 +- + gio/gnetworkingprivate.h | 32 + + gio/gresolver.c | 855 ++++++++++++++++++++ + gio/gresolver.h | 159 ++++ + gio/gsrvtarget.c | 334 ++++++++ + gio/gsrvtarget.h | 52 ++ + gio/gthreadedresolver.c | 617 ++++++++++++++ + gio/gthreadedresolver.h | 50 ++ + gio/gunixresolver.c | 433 ++++++++++ + gio/gunixresolver.h | 53 ++ + gio/gwin32resolver.c | 481 +++++++++++ + gio/gwin32resolver.h | 49 ++ + gio/libasyncns/Makefile.am | 15 + + gio/libasyncns/README | 7 + + gio/libasyncns/asyncns.c | 1498 +++++++++++++++++++++++++++++++++++ - gio/libasyncns/asyncns.h | 163 ++++ - gio/libasyncns/g-asyncns.h | 28 + - gio/libasyncns/update.sh | 20 + - gio/pltcheck.sh | 2 +- - gio/tests/.gitignore | 1 + - gio/tests/Makefile.am | 8 +- - gio/tests/resolver.c | 377 +++++++++ + gio/libasyncns/asyncns.h | 163 ++++ + gio/libasyncns/g-asyncns.h | 28 + + gio/libasyncns/update.sh | 20 + + gio/pltcheck.sh | 2 +- + gio/tests/.gitignore | 1 + + gio/tests/Makefile.am | 8 +- + gio/tests/resolver.c | 377 +++++++++ 32 files changed, 5412 insertions(+), 10 deletions(-) commit 68fc0556275edf6e63a3242841f2981a42ee11cb Author: Dan Winship -Date: Fri Dec 12 13:13:55 2008 -0500 +Date: Fri Dec 12 13:13:55 2008 -0500 Add network address and socket types @@ -14256,31 +39231,31 @@ Date: Fri Dec 12 13:13:55 2008 -0500 Part of #548466. - configure.in | 28 ++ - docs/reference/gio/gio-docs.xml | 7 + - docs/reference/gio/gio-sections.txt | 91 +++++ - docs/reference/gio/gio.types | 4 + - gio/Makefile.am | 11 +- - gio/ginetaddress.c | 747 + configure.in | 28 ++ + docs/reference/gio/gio-docs.xml | 7 + + docs/reference/gio/gio-sections.txt | 91 +++++ + docs/reference/gio/gio.types | 4 + + gio/Makefile.am | 11 +- + gio/ginetaddress.c | 747 +++++++++++++++++++++++++++++++++++ - gio/ginetaddress.h | 101 +++++ - gio/ginetsocketaddress.c | 306 ++++++++++++++ - gio/ginetsocketaddress.h | 69 ++++ - gio/gio.h | 3 + - gio/gio.symbols | 51 +++ - gio/gioenums.h | 20 + - gio/giotypes.h | 5 + - gio/gnetworkingprivate.h | 53 +++ - gio/gsocketaddress.c | 233 +++++++++++ - gio/gsocketaddress.h | 77 ++++ - gio/gunixsocketaddress.c | 206 ++++++++++ - gio/gunixsocketaddress.h | 61 +++ - glibconfig.h.win32.in | 3 + + gio/ginetaddress.h | 101 +++++ + gio/ginetsocketaddress.c | 306 ++++++++++++++ + gio/ginetsocketaddress.h | 69 ++++ + gio/gio.h | 3 + + gio/gio.symbols | 51 +++ + gio/gioenums.h | 20 + + gio/giotypes.h | 5 + + gio/gnetworkingprivate.h | 53 +++ + gio/gsocketaddress.c | 233 +++++++++++ + gio/gsocketaddress.h | 77 ++++ + gio/gunixsocketaddress.c | 206 ++++++++++ + gio/gunixsocketaddress.h | 61 +++ + glibconfig.h.win32.in | 3 + 19 files changed, 2075 insertions(+), 1 deletions(-) commit 6a3b4fa05ac996566e7b8037edf80d0f06fa2a90 Author: Dan Winship -Date: Mon Dec 29 09:00:17 2008 -0500 +Date: Mon Dec 29 09:00:17 2008 -0500 Add hostname-related utilities in glib/ghostutils.h @@ -14289,23 +39264,23 @@ Date: Mon Dec 29 09:00:17 2008 -0500 recognize IP addresses. Part of #548466. - docs/reference/glib/glib-docs.sgml | 2 + - docs/reference/glib/glib-sections.txt | 13 + + docs/reference/glib/glib-docs.sgml | 2 + + docs/reference/glib/glib-sections.txt | 13 + docs/reference/glib/tmpl/ghostutils.sgml | 64 +++ - glib/Makefile.am | 2 + - glib/ghostutils.c | 758 + glib/Makefile.am | 2 + + glib/ghostutils.c | 758 ++++++++++++++++++++++++++++++ - glib/ghostutils.h | 40 ++ - glib/glib.h | 1 + - glib/glib.symbols | 10 + - glib/tests/.gitignore | 1 + - glib/tests/Makefile.am | 3 + - glib/tests/hostutils.c | 267 +++++++++++ + glib/ghostutils.h | 40 ++ + glib/glib.h | 1 + + glib/glib.symbols | 10 + + glib/tests/.gitignore | 1 + + glib/tests/Makefile.am | 3 + + glib/tests/hostutils.c | 267 +++++++++++ 11 files changed, 1161 insertions(+), 0 deletions(-) commit dda20bccbfc2a560c13532612382712c17717085 Author: Stefan Kost -Date: Tue Apr 21 23:21:28 2009 +0300 +Date: Tue Apr 21 23:21:28 2009 +0300 goption: format section docs according to gtk-doc rules and fixes broken xml @@ -14315,7 +39290,7 @@ Date: Tue Apr 21 23:21:28 2009 +0300 commit 57bd24dc4907e6959f953be0759b946c16c78386 Author: Stefan Kost -Date: Tue Apr 14 11:32:59 2009 +0300 +Date: Tue Apr 14 11:32:59 2009 +0300 goption: document that some option args need to be freed by the callee @@ -14329,32 +39304,32 @@ Date: Tue Apr 14 11:32:59 2009 +0300 commit 2026c232b3437ff0f1222b6b045379ca273393e8 Author: Stefan Kost -Date: Tue Apr 14 11:23:25 2009 +0300 +Date: Tue Apr 14 11:23:25 2009 +0300 goption: move docs from tmpl folder to inline comments docs/reference/glib/tmpl/.gitignore | 1 + docs/reference/glib/tmpl/option.sgml | 603 ---------------------------------- - glib/goption.c | 113 +++++++ - glib/goption.h | 204 ++++++++++++- - glib/gtypes.h | 13 + + glib/goption.c | 113 +++++++ + glib/goption.h | 204 ++++++++++++- + glib/gtypes.h | 13 + 5 files changed, 330 insertions(+), 604 deletions(-) commit 0f48f804b665943a2fd848ab6efbe913003daa82 Author: Alexander Larsson -Date: Mon Apr 20 13:14:32 2009 +0200 +Date: Mon Apr 20 13:14:32 2009 +0200 Use g_cancellable_connect/disconnect Use the new cancellable helper functions to avoid races. (#572844) - gio/gasynchelper.c | 9 ++++----- + gio/gasynchelper.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) commit 0001014c378636e5848f4b3d8f38fc7a84c33b22 Author: Alexander Larsson -Date: Mon Apr 20 13:12:08 2009 +0200 +Date: Mon Apr 20 13:12:08 2009 +0200 Add helpers for connecting/disconnecting to cancelled signal @@ -14363,16 +39338,16 @@ Date: Mon Apr 20 13:12:08 2009 +0200 implementing cancellable operations. This adds helper functions that avoid these races and mentions these races in the docs. (#572844) - docs/reference/gio/gio-sections.txt | 2 + - gio/gcancellable.c | 214 + docs/reference/gio/gio-sections.txt | 2 + + gio/gcancellable.c | 214 ++++++++++++++++++++++++++++------- - gio/gcancellable.h | 6 + - gio/gio.symbols | 2 + + gio/gcancellable.h | 6 + + gio/gio.symbols | 2 + 4 files changed, 183 insertions(+), 41 deletions(-) commit c17d4dd117db554e501a18a41de53734f7f87003 Author: zabeeh khan -Date: Fri Apr 17 11:27:38 2009 +0530 +Date: Fri Apr 17 11:27:38 2009 +0530 Pashto Translation committed as per the request made by Zabeeh Khan on the gnome-i18n list @@ -14383,7 +39358,7 @@ Date: Fri Apr 17 11:27:38 2009 +0530 commit b85834c22369579d1bea86b392594d0b912a5858 Author: Matthias Clasen -Date: Sat Apr 11 18:10:24 2009 -0400 +Date: Sat Apr 11 18:10:24 2009 -0400 Bump version @@ -14392,7 +39367,7 @@ Date: Sat Apr 11 18:10:24 2009 -0400 commit 2c1dc529e8d9b1ab2d8ccb8abb1efed836584616 Author: Matthias Clasen -Date: Thu Apr 9 21:34:49 2009 -0400 +Date: Thu Apr 9 21:34:49 2009 -0400 Add a note about handling non-hal backends @@ -14401,104 +39376,104 @@ Date: Thu Apr 9 21:34:49 2009 -0400 commit 6e11246cc828217fd04a23f16b67db11333523f9 Author: Matthias Clasen -Date: Thu Apr 9 18:47:28 2009 -0400 +Date: Thu Apr 9 18:47:28 2009 -0400 Release GLib 2.20.1 - po/am.po | 154 ++++---- - po/ar.po | 839 ++++++++++++++++++++-------------------- - po/as.po | 871 ++++++++++++++++++++-------------------- - po/az.po | 154 ++++---- - po/be.po | 156 ++++---- + po/am.po | 154 ++++---- + po/ar.po | 839 ++++++++++++++++++++-------------------- + po/as.po | 871 ++++++++++++++++++++-------------------- + po/az.po | 154 ++++---- + po/be.po | 156 ++++---- po/be@latin.po | 156 ++++---- - po/bg.po | 836 +++++++++++++++++++-------------------- - po/bn.po | 154 ++++---- - po/bn_IN.po | 154 ++++---- - po/bs.po | 154 ++++---- - po/ca.po | 836 +++++++++++++++++++-------------------- - po/cs.po | 154 ++++---- - po/cy.po | 154 ++++---- - po/da.po | 837 +++++++++++++++++++-------------------- - po/de.po | 836 +++++++++++++++++++-------------------- - po/dz.po | 154 ++++---- - po/el.po | 863 ++++++++++++++++++++-------------------- - po/en_CA.po | 154 ++++---- - po/en_GB.po | 836 +++++++++++++++++++-------------------- - po/eo.po | 154 ++++---- - po/es.po | 841 ++++++++++++++++++++-------------------- - po/et.po | 154 ++++---- - po/eu.po | 894 +++++++++++++++++++++--------------------- - po/fa.po | 154 ++++---- - po/fi.po | 154 ++++---- - po/fr.po | 836 +++++++++++++++++++-------------------- - po/ga.po | 154 ++++---- - po/gl.po | 836 +++++++++++++++++++-------------------- - po/gu.po | 154 ++++---- - po/he.po | 154 ++++---- - po/hi.po | 154 ++++---- - po/hr.po | 154 ++++---- - po/hu.po | 905 ++++++++++++++++++++++--------------------- - po/hy.po | 154 ++++---- - po/id.po | 154 ++++---- - po/is.po | 154 ++++---- - po/it.po | 839 ++++++++++++++++++++-------------------- - po/ja.po | 836 +++++++++++++++++++-------------------- - po/ka.po | 154 ++++---- - po/kn.po | 880 +++++++++++++++++++++-------------------- - po/ko.po | 154 ++++---- - po/ku.po | 154 ++++---- - po/lt.po | 836 +++++++++++++++++++-------------------- - po/lv.po | 154 ++++---- - po/mai.po | 154 ++++---- - po/mg.po | 154 ++++---- - po/mk.po | 154 ++++---- - po/ml.po | 886 +++++++++++++++++++++--------------------- - po/mn.po | 154 ++++---- - po/mr.po | 154 ++++---- - po/ms.po | 154 ++++---- - po/nb.po | 836 +++++++++++++++++++-------------------- - po/ne.po | 154 ++++---- - po/nl.po | 154 ++++---- - po/nn.po | 154 ++++---- - po/oc.po | 154 ++++---- - po/or.po | 871 ++++++++++++++++++++-------------------- - po/pa.po | 868 +++++++++++++++++++++-------------------- - po/pl.po | 836 +++++++++++++++++++-------------------- - po/ps.po | 154 ++++---- - po/pt.po | 154 ++++---- - po/pt_BR.po | 836 +++++++++++++++++++-------------------- - po/ro.po | 154 ++++---- - po/ru.po | 836 +++++++++++++++++++-------------------- - po/rw.po | 154 ++++---- - po/si.po | 154 ++++---- - po/sk.po | 154 ++++---- - po/sl.po | 1165 + po/bg.po | 836 +++++++++++++++++++-------------------- + po/bn.po | 154 ++++---- + po/bn_IN.po | 154 ++++---- + po/bs.po | 154 ++++---- + po/ca.po | 836 +++++++++++++++++++-------------------- + po/cs.po | 154 ++++---- + po/cy.po | 154 ++++---- + po/da.po | 837 +++++++++++++++++++-------------------- + po/de.po | 836 +++++++++++++++++++-------------------- + po/dz.po | 154 ++++---- + po/el.po | 863 ++++++++++++++++++++-------------------- + po/en_CA.po | 154 ++++---- + po/en_GB.po | 836 +++++++++++++++++++-------------------- + po/eo.po | 154 ++++---- + po/es.po | 841 ++++++++++++++++++++-------------------- + po/et.po | 154 ++++---- + po/eu.po | 894 +++++++++++++++++++++--------------------- + po/fa.po | 154 ++++---- + po/fi.po | 154 ++++---- + po/fr.po | 836 +++++++++++++++++++-------------------- + po/ga.po | 154 ++++---- + po/gl.po | 836 +++++++++++++++++++-------------------- + po/gu.po | 154 ++++---- + po/he.po | 154 ++++---- + po/hi.po | 154 ++++---- + po/hr.po | 154 ++++---- + po/hu.po | 905 ++++++++++++++++++++++--------------------- + po/hy.po | 154 ++++---- + po/id.po | 154 ++++---- + po/is.po | 154 ++++---- + po/it.po | 839 ++++++++++++++++++++-------------------- + po/ja.po | 836 +++++++++++++++++++-------------------- + po/ka.po | 154 ++++---- + po/kn.po | 880 +++++++++++++++++++++-------------------- + po/ko.po | 154 ++++---- + po/ku.po | 154 ++++---- + po/lt.po | 836 +++++++++++++++++++-------------------- + po/lv.po | 154 ++++---- + po/mai.po | 154 ++++---- + po/mg.po | 154 ++++---- + po/mk.po | 154 ++++---- + po/ml.po | 886 +++++++++++++++++++++--------------------- + po/mn.po | 154 ++++---- + po/mr.po | 154 ++++---- + po/ms.po | 154 ++++---- + po/nb.po | 836 +++++++++++++++++++-------------------- + po/ne.po | 154 ++++---- + po/nl.po | 154 ++++---- + po/nn.po | 154 ++++---- + po/oc.po | 154 ++++---- + po/or.po | 871 ++++++++++++++++++++-------------------- + po/pa.po | 868 +++++++++++++++++++++-------------------- + po/pl.po | 836 +++++++++++++++++++-------------------- + po/ps.po | 154 ++++---- + po/pt.po | 154 ++++---- + po/pt_BR.po | 836 +++++++++++++++++++-------------------- + po/ro.po | 154 ++++---- + po/ru.po | 836 +++++++++++++++++++-------------------- + po/rw.po | 154 ++++---- + po/si.po | 154 ++++---- + po/sk.po | 154 ++++---- + po/sl.po | 1165 ++++++++++++++++++++++++++---------------------------- - po/sq.po | 156 ++++---- - po/sr.po | 154 ++++---- - po/sr@ije.po | 154 ++++---- + po/sq.po | 156 ++++---- + po/sr.po | 154 ++++---- + po/sr@ije.po | 154 ++++---- po/sr@latin.po | 154 ++++---- - po/sv.po | 1203 + po/sv.po | 1203 +++++++++++++++++++++++++++---------------------------- - po/ta.po | 888 ++++++++++++++++++++--------------------- - po/te.po | 154 ++++---- - po/th.po | 154 ++++---- - po/tl.po | 154 ++++---- - po/tr.po | 154 ++++---- - po/tt.po | 154 ++++---- - po/uk.po | 154 ++++---- - po/vi.po | 154 ++++---- - po/wa.po | 154 ++++---- - po/xh.po | 154 ++++---- - po/yi.po | 154 ++++---- - po/zh_CN.po | 839 ++++++++++++++++++++-------------------- - po/zh_HK.po | 154 ++++---- - po/zh_TW.po | 154 ++++---- + po/ta.po | 888 ++++++++++++++++++++--------------------- + po/te.po | 154 ++++---- + po/th.po | 154 ++++---- + po/tl.po | 154 ++++---- + po/tr.po | 154 ++++---- + po/tt.po | 154 ++++---- + po/uk.po | 154 ++++---- + po/vi.po | 154 ++++---- + po/wa.po | 154 ++++---- + po/xh.po | 154 ++++---- + po/yi.po | 154 ++++---- + po/zh_CN.po | 839 ++++++++++++++++++++-------------------- + po/zh_HK.po | 154 ++++---- + po/zh_TW.po | 154 ++++---- 87 files changed, 17103 insertions(+), 16510 deletions(-) commit 009689e09b0cd9cc0a322d1361940183330bada6 Author: Matthias Clasen -Date: Thu Apr 9 17:43:59 2009 -0400 +Date: Thu Apr 9 17:43:59 2009 -0400 Update for 2.20.1 @@ -14507,7 +39482,7 @@ Date: Thu Apr 9 17:43:59 2009 -0400 commit e68a35689fbcbab965b6631882381309cb0a20d8 Author: Matthias Clasen -Date: Thu Apr 9 14:56:49 2009 -0400 +Date: Thu Apr 9 14:56:49 2009 -0400 Fix G_DEFINE_TYPE_EXTENDED docs @@ -14520,19 +39495,19 @@ Date: Thu Apr 9 14:56:49 2009 -0400 commit 856632c496d15f3f273d567b521a2b06afc32721 Author: Gian Mario Tagliaretti -Date: Thu Apr 9 14:35:36 2009 -0400 +Date: Thu Apr 9 14:35:36 2009 -0400 Fix a typo in GFile docs Fixed function name in GFile docs from g_set_display_name to g_file_set_display_name so that gtk-doc can link correctly. (#578002) - gio/gfile.c | 2 +- + gio/gfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 950de29d0e9720ce0979a84530130e27a3a59f74 Author: Kenneth Nielsen -Date: Thu Apr 9 13:49:00 2009 +0200 +Date: Thu Apr 9 13:49:00 2009 +0200 Updated Danish translation\n\nUpdated Danish translation by Kenneth Nielsen. @@ -14543,20 +39518,20 @@ Date: Thu Apr 9 13:49:00 2009 +0200 commit efc2cdbfc981754db361f49c30c8ee24ac0c769e Author: Peter Kjellerstedt -Date: Wed Apr 8 10:26:11 2009 -0400 +Date: Wed Apr 8 10:26:11 2009 -0400 Fix parsing of timezones Make g_time_val_from_iso8601 handle timezones with minutes correctly; - also accept comma as a fraction separator. (#578369) + also accept comma as a fraction separator. (#578369) - glib/gtimer.c | 6 +++--- + glib/gtimer.c | 6 +++--- tests/testglib.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) commit d0cf7b38780b0832fc904f75eb387aa61eb2f76e Author: Alexander Larsson -Date: Wed Apr 8 09:12:02 2009 +0200 +Date: Wed Apr 8 09:12:02 2009 +0200 Only mark regular files as backup files @@ -14569,18 +39544,18 @@ Date: Wed Apr 8 09:12:02 2009 +0200 commit 85a795b9bae44b973de1443f98728b21b78c68ae Author: Funda Wang -Date: Sun Apr 5 11:05:47 2009 +0800 +Date: Sun Apr 5 11:05:47 2009 +0800 Updated Simplified Chinese translation from Ray Wang - po/zh_CN.po | 87 + po/zh_CN.po | 87 ++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 50 insertions(+), 37 deletions(-) commit 7fd870830806def730341a328389f8b5df49fab4 Author: Thanos Lefteris -Date: Fri Apr 3 20:12:27 2009 +0100 +Date: Fri Apr 3 20:12:27 2009 +0100 Updated Greek translation @@ -14592,7 +39567,7 @@ Date: Fri Apr 3 20:12:27 2009 +0100 commit e6e82c51a64ca263877f730cc7531454d5430b77 Author: Matthias Clasen -Date: Fri Apr 3 00:35:43 2009 -0400 +Date: Fri Apr 3 00:35:43 2009 -0400 Move hex_digits to rodata @@ -14604,7 +39579,7 @@ Date: Fri Apr 3 00:35:43 2009 -0400 commit 25ff8ee7486c7bdf1612d3554fc1d7d91daedfa6 Author: Matthias Clasen -Date: Fri Apr 3 00:23:54 2009 -0400 +Date: Fri Apr 3 00:23:54 2009 -0400 Don't lie about ext4 filesystems @@ -14618,7 +39593,7 @@ Date: Fri Apr 3 00:23:54 2009 -0400 commit e8a42bb81c46204a86259e44aa9698658487e64a Author: Paolo Borelli -Date: Fri Apr 3 00:04:39 2009 -0400 +Date: Fri Apr 3 00:04:39 2009 -0400 Regex leak on error path @@ -14629,7 +39604,7 @@ Date: Fri Apr 3 00:04:39 2009 -0400 commit 82a5f787d68fd7d6ae973634694cebd43f126552 Author: Matthias Clasen -Date: Thu Apr 2 23:57:59 2009 -0400 +Date: Thu Apr 2 23:57:59 2009 -0400 Update requirements @@ -14637,14 +39612,14 @@ Date: Thu Apr 2 23:57:59 2009 -0400 update-mime-database and update-desktop-database at runtime. (#577128) - INSTALL.in | 32 +++++++++++++++---------- - README.in | 74 + INSTALL.in | 32 +++++++++++++++---------- + README.in | 74 ++++++++++++++++++++++++++++++------------------------------ 2 files changed, 56 insertions(+), 50 deletions(-) commit 20774c566393af28e5123322abb8e35840ff0e5a Author: Matthias Clasen -Date: Thu Apr 2 23:42:29 2009 -0400 +Date: Thu Apr 2 23:42:29 2009 -0400 Add a rule to generate ChangeLog @@ -14652,12 +39627,12 @@ Date: Thu Apr 2 23:42:29 2009 -0400 the help of git-log. The format is somewhat different from traditional ChangeLog, but it contains the relevant information. - Makefile.am | 22 ++++++++++++++++++++-- + Makefile.am | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) commit b7f9a1ac8337c546f9db9b7ee9ff437b256c75d8 Author: Matthias Clasen -Date: Thu Apr 2 23:14:54 2009 -0400 +Date: Thu Apr 2 23:14:54 2009 -0400 Rename ChangeLog to ChangeLog.pre-2-20 @@ -14665,7 +39640,7 @@ Date: Thu Apr 2 23:14:54 2009 -0400 entries there. Also, this makes room for autogenerating a ChangeLog at make dist. - ChangeLog | 914 + ChangeLog | 914 ---------------------------------------------------- ChangeLog.pre-2-20 | 914 ++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -14673,7 +39648,7 @@ Date: Thu Apr 2 23:14:54 2009 -0400 commit b160405aa0a66f3eb771af43b6d0000d076d045b Author: Matthias Clasen -Date: Thu Apr 2 23:13:35 2009 -0400 +Date: Thu Apr 2 23:13:35 2009 -0400 remove generated files @@ -14687,7 +39662,7 @@ Date: Thu Apr 2 23:13:35 2009 -0400 commit 1ce74b0dd34222b201369e5aff53b27182db7b66 Author: Alexander Larsson -Date: Thu Apr 2 19:01:56 2009 +0200 +Date: Thu Apr 2 19:01:56 2009 +0200 On trash, if rename fails with EXDEV, return G_IO_ERROR_NOT_SUPPORTED @@ -14702,7 +39677,7 @@ Date: Thu Apr 2 19:01:56 2009 +0200 commit 20df6b6e888a1aed596c8c60ed7427708a56a453 Author: Tobias Mueller -Date: Wed Apr 1 21:51:00 2009 -0400 +Date: Wed Apr 1 21:51:00 2009 -0400 Mark glib_gettext as string translation function @@ -14710,13 +39685,13 @@ Date: Wed Apr 1 21:51:00 2009 -0400 -Wformat -Wformat-nonliteral. Signed-off-by: Matthias Clasen - glib/glib.symbols | 2 +- - glib/glibintl.h | 2 +- + glib/glib.symbols | 2 +- + glib/glibintl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 86aa49594feac9797ab87b83e198147aff4171fa Author: Hagen Schink -Date: Wed Apr 1 21:30:51 2009 -0400 +Date: Wed Apr 1 21:30:51 2009 -0400 fix a typo in g_io_channel_flush docs @@ -14724,12 +39699,12 @@ Date: Wed Apr 1 21:30:51 2009 -0400 Signed-off-by: Matthias Clasen - glib/giochannel.c | 4 ++-- + glib/giochannel.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 785bed2e18c18842f07ada42af2ec80cf18aca70 Author: Matthias Clasen -Date: Tue Mar 31 19:39:16 2009 -0400 +Date: Tue Mar 31 19:39:16 2009 -0400 Update README files to refer to git @@ -14737,24 +39712,24 @@ Date: Tue Mar 31 19:39:16 2009 -0400 Add a README.commits that is pretty much a copy of the same file in GTK+. Also discontinue ChangeLog files. - ChangeLog | 6 ++++ - HACKING | 8 ++-- - Makefile.am | 1 + - README | 76 + ChangeLog | 6 ++++ + HACKING | 8 ++-- + Makefile.am | 1 + + README | 76 +++++++++++++++++++++++----------------------- - README.commits | 72 + README.commits | 72 +++++++++++++++++++++++++++++++++++++++++++ docs/reference/ChangeLog | 6 ++++ - gio/ChangeLog | 6 ++++ - gmodule/ChangeLog | 6 ++++ - gobject/ChangeLog | 6 ++++ - gthread/ChangeLog | 6 ++++ - po/ChangeLog | 6 ++++ + gio/ChangeLog | 6 ++++ + gmodule/ChangeLog | 6 ++++ + gobject/ChangeLog | 6 ++++ + gthread/ChangeLog | 6 ++++ + po/ChangeLog | 6 ++++ 11 files changed, 157 insertions(+), 42 deletions(-) commit b5ef6da3c31ad1067b88f7edd53c5d48fe7f73c1 Author: Manoj Kumar Giri -Date: Mon Mar 30 08:53:32 2009 +0000 +Date: Mon Mar 30 08:53:32 2009 +0000 Added entries for Oriya language Translation updation. @@ -14765,7 +39740,7 @@ Date: Mon Mar 30 08:53:32 2009 +0000 commit b6a7cd609a1d0012ff07d62e04115830c68972e0 Author: Manoj Kumar Giri -Date: Mon Mar 30 08:52:25 2009 +0000 +Date: Mon Mar 30 08:52:25 2009 +0000 Updated Oriya Translation. @@ -14777,51 +39752,51 @@ Date: Mon Mar 30 08:52:25 2009 +0000 commit a6ebda3d690098e28319dc391fb82a281f9113e8 Author: Matthias Clasen -Date: Sun Mar 29 19:08:57 2009 +0000 +Date: Sun Mar 29 19:08:57 2009 +0000 Copy a va_list when using it multiple times. Reported by Wim Lewis. - * glib/gmessages.c (g_logv): Copy a va_list when using it - multiple times. Reported by Wim Lewis. + * glib/gmessages.c (g_logv): Copy a va_list when using it + multiple times. Reported by Wim Lewis. svn path=/trunk/; revision=8021 - ChangeLog | 8 ++++++++ + ChangeLog | 8 ++++++++ glib/gmessages.c | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) commit dabbea65c61c402ed63fba0c36a419e4d4abdf46 Author: Carlos Garnacho -Date: Thu Mar 26 13:59:02 2009 +0000 +Date: Thu Mar 26 13:59:02 2009 +0000 Bug 575270 – GVolumeMonitor::mount-pre-unmount not being emitted - 2009-03-26 Carlos Garnacho + 2009-03-26 Carlos Garnacho - Bug 575270 – GVolumeMonitor::mount-pre-unmount not being - emitted + Bug 575270 – GVolumeMonitor::mount-pre-unmount not being + emitted - * gunixmount.c (eject_unmount_cb) (eject_unmount_do_cb) - (eject_unmount_do): Emit ::mount-pre-unmount and wait - 500msec before - actually trying to unmount. + * gunixmount.c (eject_unmount_cb) (eject_unmount_do_cb) + (eject_unmount_do): Emit ::mount-pre-unmount and wait + 500msec before + actually trying to unmount. svn path=/trunk/; revision=8020 - gio/ChangeLog | 8 ++++++++ + gio/ChangeLog | 8 ++++++++ gio/gunixmount.c | 52 ++++++++++++++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 18 deletions(-) commit 3476bfe846b663049b393e43d272a06883b3fe7d Author: Gintautas Miliauskas -Date: Thu Mar 26 13:52:46 2009 +0000 +Date: Thu Mar 26 13:52:46 2009 +0000 Updated Lithuanian translation. - 2009-03-26 Gintautas Miliauskas + 2009-03-26 Gintautas Miliauskas * lt.po: Updated Lithuanian translation. diff --git a/INSTALL b/INSTALL index 3426b9a..d3e5d23 100644 --- a/INSTALL +++ b/INSTALL @@ -1,8 +1,8 @@ Simple install procedure ======================== - % gzip -cd glib-2.24.2.tar.gz | tar xvf - # unpack the sources - % cd glib-2.24.2 # change to the toplevel directory + % gzip -cd glib-2.27.5.tar.gz | tar xvf - # unpack the sources + % cd glib-2.27.5 # change to the toplevel directory % ./configure # run the `configure' script % make # build GLIB @@ -79,7 +79,7 @@ in the file: Or online at: - http://developer.gnome.org/doc/API/2.0/glib/glib-building.html + http://library.gnome.org/devel/glib/stable/glib-building.html Installation directories diff --git a/INSTALL.in b/INSTALL.in index 03c0398..617eb92 100644 --- a/INSTALL.in +++ b/INSTALL.in @@ -79,7 +79,7 @@ in the file: Or online at: - http://developer.gnome.org/doc/API/2.0/glib/glib-building.html + http://library.gnome.org/devel/glib/stable/glib-building.html Installation directories diff --git a/Makefile.am b/Makefile.am index 708b16b..c04c144 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in include $(top_srcdir)/Makefile.decl -AUTOMAKE_OPTIONS = 1.7 +ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs DIST_SUBDIRS = $(SUBDIRS) build @@ -41,7 +41,6 @@ EXTRA_DIST += \ Makefile.decl \ mkinstalldirs \ makefile.msc \ - glibconfig.h.win32.in \ msvc_recommended_pragmas.h \ config.h.win32.in \ po/po2tbl.sed.in \ @@ -53,6 +52,7 @@ EXTRA_DIST += \ gthread-2.0.pc.in \ gio-2.0.pc.in \ gio-unix-2.0.pc.in \ + gio-windows-2.0.pc.in \ glib-2.0-uninstalled.pc.in \ gobject-2.0-uninstalled.pc.in \ gmodule-2.0-uninstalled.pc.in \ @@ -67,29 +67,13 @@ BUILT_EXTRA_DIST = \ README \ INSTALL \ ChangeLog \ - glibconfig.h.win32 \ config.h.win32 \ gtk-doc.make -configexecincludedir = $(libdir)/glib-2.0/include -configexecinclude_DATA = glibconfig.h - -uninstall-local: - rm -f $(DESTDIR)$(configexecincludedir)/glibconfig.h - CONFIGURE_DEPENDENCIES = acglib.m4 -BUILT_SOURCES = stamp-gc-h #note: not glibconfig.h -glibconfig.h: stamp-gc-h - @if test -f glibconfig.h; then :; \ - else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi -stamp-gc-h: config.status - cd $(top_builddir) && $(SHELL) ./config.status glibconfig.h - echo timestamp > stamp-gc-h - ChangeLog: - @echo Creating $@ - @if test -d "$(srcdir)/.git"; then \ + $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ (GIT_DIR=$(top_srcdir)/.git ./missing --run git log GLIB_2_20_0^^.. --stat) | fmt --split-only > $@.tmp \ && mv -f $@.tmp $@ \ || ($(RM) $@.tmp; \ @@ -108,6 +92,10 @@ if OS_UNIX pkgconfig_DATA += gio-unix-2.0.pc endif +if OS_WIN32 +pkgconfig_DATA += gio-windows-2.0.pc +endif + $(pkgconfig_DATA): config.status # install mkinstalldirs for glib-gettextize's benefit @@ -117,9 +105,9 @@ gettext_SCRIPTS = mkinstalldirs # build documentation when doing distcheck DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-gtk-doc --enable-man -DISTCLEANFILES = glibconfig-sysdefs.h glibconfig.h stamp-gc-h config.lt +DISTCLEANFILES = config.lt -distclean-local: +distclean-local: lcov-clean if test $(srcdir) = .; then :; else \ rm -f $(BUILT_EXTRA_DIST); \ fi diff --git a/Makefile.decl b/Makefile.decl index cbc0da1..d07e6d2 100644 --- a/Makefile.decl +++ b/Makefile.decl @@ -11,15 +11,20 @@ TEST_PROGS = ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} +test: test-nonrecursive if OS_UNIX - @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} @ for subdir in $(SUBDIRS) . ; do \ test "$$subdir" = "." -o "$$subdir" = "po" || \ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done endif +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +if OS_UNIX + @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} +endif + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -46,8 +51,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -56,6 +65,26 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive diff --git a/Makefile.in b/Makefile.in index f8265b4..a8d8393 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,10 +43,9 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/INSTALL.in \ $(srcdir)/config.h.win32.in \ $(srcdir)/gio-2.0-uninstalled.pc.in $(srcdir)/gio-2.0.pc.in \ $(srcdir)/gio-unix-2.0-uninstalled.pc.in \ - $(srcdir)/gio-unix-2.0.pc.in \ + $(srcdir)/gio-unix-2.0.pc.in $(srcdir)/gio-windows-2.0.pc.in \ $(srcdir)/glib-2.0-uninstalled.pc.in $(srcdir)/glib-2.0.pc.in \ $(srcdir)/glib-gettextize.in $(srcdir)/glib-zip.in \ - $(srcdir)/glibconfig.h.win32.in \ $(srcdir)/gmodule-2.0-uninstalled.pc.in \ $(srcdir)/gmodule-2.0.pc.in $(srcdir)/gmodule-export-2.0.pc.in \ $(srcdir)/gmodule-no-export-2.0-uninstalled.pc.in \ @@ -59,6 +58,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/INSTALL.in \ compile config.guess config.sub depcomp install-sh ltmain.sh \ missing mkinstalldirs @OS_UNIX_TRUE@am__append_1 = gio-unix-2.0.pc +@OS_WIN32_TRUE@am__append_2 = gio-windows-2.0.pc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ @@ -66,7 +66,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -79,9 +79,9 @@ CONFIG_CLEAN_FILES = glib-2.0.pc glib-2.0-uninstalled.pc \ gmodule-no-export-2.0-uninstalled.pc gthread-2.0.pc \ gthread-2.0-uninstalled.pc gobject-2.0.pc \ gobject-2.0-uninstalled.pc gio-2.0.pc gio-unix-2.0.pc \ - gio-2.0-uninstalled.pc gio-unix-2.0-uninstalled.pc glib-zip \ - glib-gettextize INSTALL README config.h.win32 \ - glibconfig.h.win32 + gio-windows-2.0.pc gio-2.0-uninstalled.pc \ + gio-unix-2.0-uninstalled.pc glib-zip glib-gettextize INSTALL \ + README config.h.win32 CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -105,7 +105,6 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gettextdir)" \ - "$(DESTDIR)$(configexecincludedir)" \ "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(bin_SCRIPTS) $(gettext_SCRIPTS) AM_V_GEN = $(am__v_GEN_$(V)) @@ -123,7 +122,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive -DATA = $(configexecinclude_DATA) $(pkgconfig_DATA) +DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -168,6 +167,7 @@ GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -192,11 +192,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -210,13 +213,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -263,6 +269,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -270,6 +278,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -295,6 +304,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -311,6 +322,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -320,11 +332,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -340,11 +354,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -358,7 +378,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -392,17 +411,17 @@ EXTRA_DIST = ChangeLog.pre-2-20 ChangeLog.pre-2-18 ChangeLog.pre-2-16 \ glib-zip.in NEWS.pre-1-3 acglib.m4 sanity_check README.commits \ README.in INSTALL.in README.win32 HACKING MAINTAINERS \ autogen.sh Makefile.decl mkinstalldirs makefile.msc \ - glibconfig.h.win32.in msvc_recommended_pragmas.h \ - config.h.win32.in po/po2tbl.sed.in glib-2.0.pc.in \ - gobject-2.0.pc.in gmodule-2.0.pc.in gmodule-export-2.0.pc.in \ - gmodule-no-export-2.0.pc.in gthread-2.0.pc.in gio-2.0.pc.in \ - gio-unix-2.0.pc.in glib-2.0-uninstalled.pc.in \ + msvc_recommended_pragmas.h config.h.win32.in po/po2tbl.sed.in \ + glib-2.0.pc.in gobject-2.0.pc.in gmodule-2.0.pc.in \ + gmodule-export-2.0.pc.in gmodule-no-export-2.0.pc.in \ + gthread-2.0.pc.in gio-2.0.pc.in gio-unix-2.0.pc.in \ + gio-windows-2.0.pc.in glib-2.0-uninstalled.pc.in \ gobject-2.0-uninstalled.pc.in gmodule-2.0-uninstalled.pc.in \ gthread-2.0-uninstalled.pc.in \ gmodule-no-export-2.0-uninstalled.pc.in \ gio-2.0-uninstalled.pc.in gio-unix-2.0-uninstalled.pc.in TEST_PROGS = -AUTOMAKE_OPTIONS = 1.7 +ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs DIST_SUBDIRS = $(SUBDIRS) build bin_SCRIPTS = glib-gettextize @@ -418,18 +437,14 @@ BUILT_EXTRA_DIST = \ README \ INSTALL \ ChangeLog \ - glibconfig.h.win32 \ config.h.win32 \ gtk-doc.make -configexecincludedir = $(libdir)/glib-2.0/include -configexecinclude_DATA = glibconfig.h CONFIGURE_DEPENDENCIES = acglib.m4 -BUILT_SOURCES = stamp-gc-h #note: not glibconfig.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = glib-2.0.pc gobject-2.0.pc gmodule-2.0.pc \ gmodule-export-2.0.pc gmodule-no-export-2.0.pc gthread-2.0.pc \ - gio-2.0.pc $(am__append_1) + gio-2.0.pc $(am__append_1) $(am__append_2) # install mkinstalldirs for glib-gettextize's benefit gettextdir = $(datadir)/glib-2.0/gettext @@ -437,8 +452,8 @@ gettext_SCRIPTS = mkinstalldirs # build documentation when doing distcheck DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-gtk-doc --enable-man -DISTCLEANFILES = glibconfig-sysdefs.h glibconfig.h stamp-gc-h config.lt -all: $(BUILT_SOURCES) config.h +DISTCLEANFILES = config.lt +all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: @@ -519,6 +534,8 @@ gio-2.0.pc: $(top_builddir)/config.status $(srcdir)/gio-2.0.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ gio-unix-2.0.pc: $(top_builddir)/config.status $(srcdir)/gio-unix-2.0.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ +gio-windows-2.0.pc: $(top_builddir)/config.status $(srcdir)/gio-windows-2.0.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ gio-2.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/gio-2.0-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ gio-unix-2.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/gio-unix-2.0-uninstalled.pc.in @@ -533,8 +550,6 @@ README: $(top_builddir)/config.status $(srcdir)/README.in cd $(top_builddir) && $(SHELL) ./config.status $@ config.h.win32: $(top_builddir)/config.status $(srcdir)/config.h.win32.in cd $(top_builddir) && $(SHELL) ./config.status $@ -glibconfig.h.win32: $(top_builddir)/config.status $(srcdir)/glibconfig.h.win32.in - cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @@ -612,26 +627,6 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt -install-configexecincludeDATA: $(configexecinclude_DATA) - @$(NORMAL_INSTALL) - test -z "$(configexecincludedir)" || $(MKDIR_P) "$(DESTDIR)$(configexecincludedir)" - @list='$(configexecinclude_DATA)'; test -n "$(configexecincludedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configexecincludedir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(configexecincludedir)" || exit $$?; \ - done - -uninstall-configexecincludeDATA: - @$(NORMAL_UNINSTALL) - @list='$(configexecinclude_DATA)'; test -n "$(configexecincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(configexecincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(configexecincludedir)" && rm -f $$files install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @@ -968,16 +963,14 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive +check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gettextdir)" "$(DESTDIR)$(configexecincludedir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gettextdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive +install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -1003,7 +996,6 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am @@ -1032,7 +1024,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-binSCRIPTS install-configexecincludeDATA +install-exec-am: install-binSCRIPTS install-html: install-html-recursive @@ -1072,13 +1064,11 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-binSCRIPTS uninstall-configexecincludeDATA \ - uninstall-gettextSCRIPTS uninstall-local \ +uninstall-am: uninstall-binSCRIPTS uninstall-gettextSCRIPTS \ uninstall-pkgconfigDATA -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - check-am ctags-recursive install install-am install-strip \ - tags-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \ + ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am check-local clean \ @@ -1088,31 +1078,32 @@ uninstall-am: uninstall-binSCRIPTS uninstall-configexecincludeDATA \ distclean-generic distclean-hdr distclean-libtool \ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binSCRIPTS \ - install-configexecincludeDATA install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-gettextSCRIPTS install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-configexecincludeDATA \ - uninstall-gettextSCRIPTS uninstall-local \ - uninstall-pkgconfigDATA + install install-am install-binSCRIPTS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-gettextSCRIPTS install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binSCRIPTS \ + uninstall-gettextSCRIPTS uninstall-pkgconfigDATA ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -1139,8 +1130,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -1149,22 +1144,32 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test - -uninstall-local: - rm -f $(DESTDIR)$(configexecincludedir)/glibconfig.h -glibconfig.h: stamp-gc-h - @if test -f glibconfig.h; then :; \ - else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi -stamp-gc-h: config.status - cd $(top_builddir) && $(SHELL) ./config.status glibconfig.h - echo timestamp > stamp-gc-h +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive ChangeLog: - @echo Creating $@ - @if test -d "$(srcdir)/.git"; then \ + $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ (GIT_DIR=$(top_srcdir)/.git ./missing --run git log GLIB_2_20_0^^.. --stat) | fmt --split-only > $@.tmp \ && mv -f $@.tmp $@ \ || ($(RM) $@.tmp; \ @@ -1178,7 +1183,7 @@ ChangeLog: $(pkgconfig_DATA): config.status -distclean-local: +distclean-local: lcov-clean if test $(srcdir) = .; then :; else \ rm -f $(BUILT_EXTRA_DIST); \ fi diff --git a/NEWS b/NEWS index a23ee89..dc9dd39 100644 --- a/NEWS +++ b/NEWS @@ -1,41 +1,1134 @@ -Overview of Changes from GLib 2.24.1 to GLib 2.24.2 +Overview of Changes from GLib 2.27.4 to 2.27.5 +============================================== + +* Network support: + - Add g_tls_certificate_verify() to verify a certificate + - Add GTlsConnection:use-system-certdb + - Other TLS api additions + +* GIO: + - Add g_io_stream_splice_async()/_finish() to splice two iostreams + - Add g_emblemed_icon_clear_emblems() and make GEmblemedIcon derivable + - Remove GPeriodic; it did not receive the necessary review and + integration work to declare it stable + +* GSequence: + - New methods g_sequence_lookup() and g_sequence_lookup_iter() + +* Bugs fixed: + 617254 Missing g_sequence_lookup + 632544 g_dbus_connection_send_message can not send a locked message... + 633350 g_hostname_to_ascii() ignores non-ascii dots + 634583 Better error reporting for g_variant_parse() + 635007 gsetting enum rule don't work for out-of-srcdir builds + 635626 GDBus message idle can execute while flushes are pending + 636100 Can't read GSettings:backend property + 636305 Typo on g_queue_remove_all() function description + 636311 appinfo: tweak application positioning for content-types + 636351 g_simple_async_result_is_valid lacks a version tag + 636387 gdb autoload files shadow the "dir" builtin + 636673 g_simple_async_report_error_in_idle should allow object... + 637147 Add a "delay-apply" property to GSettings + 637171 emblemedicon: add g_emblemed_icon_clear_emblems() + 637237 gapplication: plug a memory leak + +* Translation updates: + Estonian + Galician + Hebrew + Norwegian bokmål + Simplified Chinese + Spanish + Traditional Chinese + Vietnamese + + +Overview of Changes from GLib 2.27.3 to 2.27.4 +============================================== + +* GIO + - Mounts are treated as hidden if they have a path element + that starts with a dot + - GAppInfo gained API to differentiate between recommended + and fallback mime handlers + - g_cancellable_create_source: creates a GSource that triggers + when the GCancellable is canceled + - GPollableInput/OutputStream: Interfaces for pollable streams + - TLS support has landed, with an extension point that is + implemented in glib-networking + +* GLib + - Mainloop sources can now have 'child sources' + - g_get_runtime_dir: New function to return the XDG_RUNTIME_DIR + +* Bugs fixed: + 530786 GFileMonitor "changed" signal underdocumented + 588189 TLS support for GSocket* + 630357 g_object_new_valist uses uninitialized memory + 630559 typo in public string in gsocks: 'The SOCKSv5 require... + 632445 Documentation refers to removed GNOME 2.0 porting guide + 634239 Child GSources + 634241 Add pollable input/output streams + 634504 allow passing a NULL emblem to g_emblemed_icon_new() + 634613 unsufficient g_get_user_runtime_dir() documentation + 635640 schema should inherit gettext-domain from schemalist + 635768 Protect g_file_monitor_set_rate_limit() against negative... + 635882 Fix the wrong-category schema test + 635187 Wrong type of GVariant received in an action... + +* Updated translations: + Galician + Italian + Norwegian bokmål + Uyghur + + +Overview of Changes from GLib 2.27.2 to 2.27.3 +============================================== + +* The GTimeSpec type that was introduced in the 2.27.2 has been + dropped again in favour of APIs that return microseconds as + 64-bit integer. + Affected functions: + g_source_get_time + g_periodic_unblock + g_get_monotonic_time + g_get_real_time + The similar GTimeVal struct is still around, but its use is + discouraged. + +* GTimer is now using monotonic time unconditionally + +* There are some new functions to facilitate error reporting + in async GIO APIs: + g_simple_async_result_take_error + g_simple_async_result_new_take_error + g_simple_async_report_take_gerror_in_idle + +* There is new convenience API to us GVariant dictionaries: + g_variant_lookup + +* It is now possible to delay sending match rules to the + D-Bus daemon in GDBus: + G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE + +* Support has been added for XDG_RUNTIME_DIR: + g_get_user_runtime_dir + +* Various fixes for Win64/MSVC builds have been committed + +* Bugs fixed: + 620263 Add g_clear_object, g_clear_pointer, g_clear_boxed + 633075 update Project Files and sources for MSVC 2008/C89 + 633381 gsettings Makefile rules should handle empty list... + 633685 Use g_simple_async_result_{new_,}take_error + 633686 Add g_simple_async_report_take_gerror_in_idle + +* Translation updates: + Belarusian + Galician + Hebrew + Punjabi + Spanish + + +Overview of Changes from GLib 2.27.1 to 2.27.2 +============================================== + +* GApplication + - Export actions over DBus and support activating them from remote instances + - Support environment passing + +* GSettings + - The gsettings utility has a list-recursively command + - The gsettings utility has commandline completion for enum values + +* GLib is now linked against librt and uses monotonic time for + timeouts and GPeriod sources. GSource has a new g_source_get_time() + which returns monotonic time, and g_source_get_current_time() has + been deprecated + +* Bugs fixed: + 158725 free linked list with data + 626320 GVariant: Avoid locking in g_variant_get_child_value() if possible + 629247 add gsimpleasyncresult methods to take over a GError + 629274 GNetworkService does not do fallback when there is no SRV record + 631264 gsettings-tool choice/range support + 631482 g_date_time_from_instant: 1000000000000000000 + 632169 docs for manual use of gsettings-data-convert + 632571 Add equivalent to gconftool-2's -R option + 633115 GSettings m4 doesn't fail the build for broken schemas + 633206 Default g_application_local_command_line() doesn't set exit_status... + 633339 support more complex gapplication setups + 633356 Make timeout G_MAXINT mean "no timeout" + +* Translation updates: + Catalan (Valencian) + Indonesian + Japanese + + +Overview of Changes from GLib 2.27.0 to 2.27.1 +============================================== + +* GDateTime now has full week number support. + New API: g_date_time_get_week_numbering_year + +* The GSettings schema compiler will now skip over + broken .xml schema files instead of aborting altogether + +* GSettings now works properly on bigendian systems + +* GSettings has more complete support for ranges + New API: + g_settings_get_range + g_settings_range_check + The gsettings commandline tool supports ranges too. + +* GApplication has been rewritten; see the API docs for details + and examples. The action support is not complete yet. + +* The GLib mainloop has gained 'dispatch to context' functionality, + which can replace manually created idles in many cases. + New API: + g_main_context_invoke + g_main_context_invoke_full + +* The gio-desktop-app-info-lookup extension point has been + removed from GIO. GIO now uses x-scheme-handler mimetypes when + looking for default applications. + +* On win32, make g_get_user_data_dir() return the CSIDL_LOCAL_APPDATA + folder on Windows, and not CSIDL_PERSONAL. This matches what Qt does, + and has been widely requested. Also make g_get_user_config_dir() return + this and not the (roaming) CSIDL_APPDATA folder. + +* A periodic event clock has been added in GIO: GPeriodic. Note that this + API is still experimental and expected to undergo changes before it + will be incorporated into a stable GLib release. Use at your own risk. + +Bug fixes: + 613822 gobject signal connect/disconnect not thread safe + 618737 "dispatch to context" functionality + 620710 g_get_user_data_dir() uses CSIDL_PERSONAL and not CSIDL_APPDATA + 623400 acquire context before dispatching + 627126 gsettings schema files don't get installed on FreeBSD + 627171 g_socket_new_from_fd() doesn't set the right protocol + 628876 Wrong error description + 628937 gracefully handle broken schemas + 629274 GNetworkService doesn't fallback when there is no SRV record + 629289 g_error() used wrong, produces core dump + 629687 leaks class refcount in gsocketcontrolmessage + 629849 GLib-CRITICAL **: g_source_get_context: assertion `!SOURCE_... + 629945 GDBus deadlock in g_bus_get_sync() + 630000 g_date_time_difference + 630077 GDateTime week number support + 630185 Allow NULL strings in g_quark_try_string() + 630797 docs mention non-existent g_object_dispose() + 630968 gschema-compile problems on power g5 + 631263 GSettings needs range/choice APIs + 631264 gsettings-tool choice/range support + 631379 GDBus nonce-tcp test failing + 631410 Port gapplookupgconf.c to using x-scheme-handler/ + 632884 Possible deadlock in g_object_remove_toggle_ref() + +Transation updates: + Basque + Brazilian Portuguese + British English + Bulgarian + Czech + Dutch + Estonian + French + Galician + German + Greek + Hebrew + Hungarian + Japanese + Lithuanian + Polish + Portuguese + Romanian + Simplified Chinese + Slovenian + Spanish + + +Overview of Changes from GLib 2.25.15 to GLib 2.27.0 +==================================================== + +Build: + - massive restructuring to reduce #include abuse + - tweaks to silence some harmless compiler warnings + - rename gschema-compile.c to glib-compile-schemas.c + - Windows fixes + - fix building with zlib < 1.2.4 on win32 + +GDateTime: + - better msgctxt for translating month and weekday names + - API is changed quite a lot, implementation is improved + - GTimeZone is now exposed + +GObject: + - make ordering for overridden interface properties consistent + - ->priv structures are limited to 64k but this was not documented, + and exceeding this limit produced bad results. Add docs and enforce + the limit properly. + - add g_object_class_install_properties() to install multiple + properties in one go + - improve debugging output for GValue containing G_TYPE_STRV + +GIO: + - fix priority sorting of GIO extensions + - add GCredentials support on FreeBSD + - fix support for IPv6 addresses in URI parsing functions + - GSocketClient fixes for when g_socket_connect succeeds immediately + - clarify string encoding for GFile constructors in docs + - new functions g_data_input_stream_read_upto{,async,finish} + - tweak confusing documentation for g_output_stream_write() + +GDBus: + - GDBusMessage can now be locked and copied (like in libdbus) + - GDBusConnection filter function API has changed again + - GDBusServer: ::new-connection now declares if the connection was claimed + - add a partial workaround for GObject bug 627724. + - very many memory leaks fixed + +GVariant: + - check for size == 0 in g_variant_get_bytestring to avoid a crash + when attempting to get_bytestring() from an empty array + - improve gobject-introspection annotations + +GSettings: + - add GSettings Windows registry backend + - some internal tweaks to the backend API + - remove g_settings_list_items + - add g_settings_list_children and _list_keys to replace it + - add schema compiler restrictions for dealing with lists + - don't automatically emit value changed signals on writability + changes + +Other: + - constify the 'parser' vtable param to g_markup_parse_context_push() + - plug many memory leaks in test cases + +Bugs closed: + 50076 Time API to go with date API + 584284 g_data_input_stream_read_until_async different from sync version + 624546 Modification of GDBusMessage in filter function + 626919 Let g_object_class_install_property() return the installed GParamSpec* + 628029 GDateTime missing get_week_of_year method + 628253 Interface properties not listed in a consistent order + 628331 Plug lots of mem leaks in gio test suite + 628345 Plug a mem leak + 628436 Plug a mem leak + 628505 Fix building with zlib < 1.2.4 on win32 + 628839 [PATCH] datetime: Rename shadowing variables + 628904 [PATCH] Add credential support for FreeBSD and fix a socket issue + 628952 incorrect glib_major_version and other variables on cygwin. + 629192 g_strdup_value_contents(): dump GStrv more usefully + 629251 g_socket_client_async_connect_complete: assertion failed + 629259 Failed to connect to "::1" + 629328 g_markup_parse_context_push doesn't respect const structs + 629429 month "May" short and full form same with "GDateTime" msgctxt + 629689 GDBusConnection leaks its GCredentials + 629698 Segfault in g_variant_get_bytestring() + +Updated translations: + Arabic + Armenian + Basque + British English + Czech + Finnish + Galician + German + Hungarian + Indonesian + Japanese + Lithuanian + Norwegian bokmål + Polish + Portuguese + Punjabi + Simplified Chinese + Slovenian + Spanish + Swedish + Swedish + Traditional Chinese + +Overview of Changes from GLib 2.25.14 to GLib 2.25.15 +===================================================== + + * GIO + - Memory leak fixes + - The GZip(De}Compressor can now process header information + - Support for network proxies has been added, with the GProxy + interface and the gio-proxy-resolver extension point. GIO + includes SOCKSv4 and SOCKSv5 implementations, and libproxy + is also going to provide an implementation of this extension + point. + - There are GAction and GActionGroup interfaces now, which will + be used in GApplication in the near future. + + * GObject + - There are now convenience macros for defining boxed and + pointer types + + * GDBus + - Memory leak fixes + - GDBusProxy for well-known names can now auto-restart + the service if the name owner disapperas + - Filter functions are now allowed to modify messages + + * GLib + - GDateTime is a replacement for GDate that supports time + and timezone information. + + * Bugs fixed: + 50076 Time API to go with date API + 449565 Add G_DEFINE_BOXED_TYPE() + 617691 Add GZIP header processing to GZlibCompressor/GZlibDecompressor + 622184 add g_memory_output_stream_steal_data + 624546 Modification of GDBusMessage in filter function + 627088 Build failure in gdbus-peer.c on FreeBSD + 627181 save a memdup + 627182 Plug a mem leak in the gdbus-connection test + 627187 Plug some gdbus mem leaks + 627188 gdbus-non-socket test occasionally fails + 627252 G_OPTION_FLAG_NO_ARG is only for callback options + 627392 gdbus commit 8a3a4596 breaks win32 compile + 627407 FTBFS on !linux UNIX platforms + 627604 String error: 'that' twice in a row + 627969 ABR in g_file_open_tmp + 628084 gdbus-peer fails with assertion + 628193 Miscellaneous string fixes + 628296 abort() in gsocketconnection.c + 628309 Plug a mem leak in GConverterOutputStream + 628317 GEmblemedIcon:equal implementation is buggy + 628323 Fix invalid reads + 628327 Plug a mem leak + 628328 Plug a mem leak + 628329 Don't leak the FD list + 628324 Invalid reads in gdbus-export test + + * Updated translations: + British English + Danish + Galician + Hebrew + Punjabi + Serbian + Spanish + Traditional Chinese + + +Overview of Changes from GLib 2.25.13 to GLib 2.25.14 +===================================================== + +* GDBus + - Make the closure variants of GDBus apis work + - Make error unregistration work + - Use async IO in the IO thread (626748) + +* GIO + - Make g_simple_async_result_is_valid work without source (626208) + - GSocketClient: add a timeout property + - Fix memory leaks in GSocketClient + - Handle async vs. sync correctly in GSocketConnection stream (616458) + - Declare stream base classes as abstract + - Clarify semantics of g_output_stream_write() (627071) + +* Other + - Improve test coverage for GDBus, GRegex, GAsyncResult + - Drop dead code in pcre, xdgmime + - Fix a race condition in gtester (578295) + - Avoid an extra allocation in GAsyncQueue (626704) + - Add test case for non-socket GIOStream (626841) + - More explicit GVariant docs (622770) + - Imroved docs for GAsyncInitable and GSimpleAsyncResult (602417) + +* Translation updates: + - Galician + - Norwegian bokmål + - Punjabi + - Simplified Chinese + - Swedish + + +Overview of Changes from GLib 2.25.12 to GLib 2.25.13 +===================================================== + ++-------------------------------------------------------------------+ +| WARNING: There have been no breaks in API or ABI. Weird, eh? | ++-------------------------------------------------------------------+ + +The primary purpose of this release is to fix a serious problem with +glib 2.25.12: glibconfig.h (as generated on a Fedora amd64 system) was +being distributed in the tarball. It was being used to build some parts +of glib on other systems (eg: 32bit ones). This was causing some very +serious problems. + +There have been many other improvements, however: + + Build and testing: + - vastly improved test coverage + - old tests moved to the gtester framework + - gtester Makefile modified so that the tests only run once + - cleanup of how we handle includes while building glib + + GVariant: + - add a g_return_if_fail (utf8) to g_variant_new_string() + + GDBus: + - perform extra sanity checks when serialising messages + - add API to query and set the byteorder of a GDBusMessage + - improve debug output, add some extra options + - if exiting due to the bus disconnecting us, print an error message + explaining why + - sort property names correctly + - don't bother sending RemoveMatch when we will close the connection + anyway + - use effective uid/gid for credential passing + + GSettings: + - add G_SETTINGS_BIND_INVERT_BOOLEAN for inverting boolean bindings + without mapping functions + - mark all strings in the schema compiler for translation + + Binding: + - improve closure support for bindings + - copy GSettings INVERT_BOOLEAN flag + + Other: + - fix another complicated GCancellable deadlock possibility + +Bugs closed: + 599590 glib build doesn't look for correct pkg-config + 619026 avoid warning in gutils.h when using gcc with -Wconversion + 624739 Please fix POTFILES.in + 625472 Valgrind claims uninitialized bytes used + 625500 g_date_set_time_val documentation doesn't mention local time + 625628 GDBusProxy: wrong property name sorting + 625753 Incorrect flags used in g_dbus_connection_call_sync() + 625827 Expand documentation about error quark naming + 625988 builddir != srcdir issues + 626107 glibconfig.h is being disted + +Updated translations: + French + Galician + Hebrew + Norwegian bokmål + Spanish + + +Overview of Changes from GLib 2.25.11 to GLib 2.25.12 +===================================================== + ++-------------------------------------------------------------------+ +| WARNING: There have been many API changes in GDBus -- sending | +| messages, subscribing to signals, closing connections and | +| registering subtrees are affected. The ABI for GSettingsBackend | +| has also been changed. For both reasons, a new dconf release is | +| required (and will be along soon). | ++-------------------------------------------------------------------+ + +Build: + - cleanup automake setup + - rename configure.in to configure.ac + - various docs fixups + - move glibconfig.h to glib/ + - disable dtrace support on Mac OS (which has incompatible 'dtrace') + +GSettings: + - add support for vendor override files (to change the default values + in a schema) + - change GSettingsBackend vtable + - add g_settings_reset() + - support binding to G_TYPE_STRV properties + +GDBus: + - many bug fixes, including a serialisation fix + - stop handling incoming connections as soon as stop() is called + - proper support for file descriptor passing + - new flags parameter for sending messages + - new flags parameter for subscribing to signals + - always reset the message serial when sending a message unless + G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL is given + - constness fixes for introspection structures + - clean ups to subtree registration API + +Other: + - fix divide by zero bug in g_malloc_n functions + - GIO: don't blindly assume that SOCK_CLOEXEC is supported + - make GObject property notify freezes threadsafe + - GIO: clean up credentials passing + - GApplication: make default-quit not apply if register=FALSE + - GIO: add annotations for gobject-introspection + +Bugs closed: + 166020 use GAtomic for refcounting + 617483 Credentials passing + 622005 [GApplication] no way to modify the "default-quit" property + 623293 vendor override files + 623810 Message serialization bug + 623815 Don't check sender for GDBusProxy objects where name is not set + 624473 GDBusSubtreeIntrospectFunc return type + 624483 GDBusSubtreeEnumerateFunc clarification + 624484 GDBusSubtreeDispatchFunc clarification + 624754 gdbusaddress.c missing sys/wait.h + 624968 div by zero in g_malloc_n family + 624991 GSettings mapping for G_TYPE_STRV + 625383 Add missing GI annotations + +Updated Translations: + Armenian + Galician + German + Hebrew + Kazakh + Romanian + Simplified Chinese + Spanish + +Overview of Changes from GLib 2.25.10 to GLib 2.25.11 +===================================================== + ++-------------------------------------------------------------------+ +| WARNING: There have been minor API changes in GDBus and GVariant. | +| These API changes will not affect many users, but they do require | +| a new version of GTK+ to be installed. | ++-------------------------------------------------------------------+ + +Build: + - add a --disable-Bsymbolic configure flag to disable linking with + -Bsymbolic-functions + - this release sees the complete removal of the old 'g*alias' hacks + - honour the NOCONFIGURE environment variable from autogen.sh + - use proper feature test macros for isnan + - use pkg-config to check for zlib + - add ACLOCAL_AMFLAGS to Makefile.am + +GDBus: + - hide Class and instance structures for all GDBus types except + GDBusProxy. This breaks API by preventing subclassing, but probably + nobody was doing that. + - add new GDBusConnection call to support flushing all pending + outgoing messages + - change the register_object API to add a reference to the + GDBusInterfaceInfo object so the caller need not keep it alive + themselves + - don't rewrite the serial number when sending messages that already + have a serial number + - better error checking for DBUS_SESSION_BUS_ADDRESS environment + variable + - switch to g_parse_debug_string for G_DBUS_DEBUG and add a lot of new + flags + - add support for temporarily freezing a freshly created + GDBusConnection. Do this until after the ::new-connection signal + has finished running on GDBus services. + - never require non-closed connections (the user is incapable of doing + this due to the obvious race) + - remove weird/misleading redundant check on NameOwnerChanged signal + - emit GDBusProxy::g-properties-changed on NameOwnerChanged + +GVariant: + - the 'g_variant_{new,get}_byte_array' APIs have been removed + - g_variant_{new,get,dup}_bytestring has been added, with different + arguments and different behaviour + - g_variant_{new,get,dup}_bytestring_array has been added, doing + essentially the same thing as the 'strv' functions, but with byte + strings instead of utf8 strings + - G_VARIANT_TYPE_BYTESTRING ('ay'), BYTESTRING_ARRAY ('aay') and + STRING_ARRAY ('as') constants have been added + - the undocumented behaviour that g_variant_get_strv() deserialised + arrays of object paths or signature strings has been dropped + - additional varargs support for converting bytestrings or bytestring + arrays with ^ay ^aay ^&ay and ^a&ay + - improved gobject-introspection annotation + - fix a problem with GBuffer calling g_slice_free for the wrong type + - fix leaks in the type inferencing code of the parser + +GSettings: + - improved documentation + - updated schema XML DTD, now xincluded into the docs + - added support for schemas that extend other schemas (using the + 'extends=' attribute). Values of keys in the base schema can be + overridden using . + - added theoretical support for lists (using the 'list-of=' attribute) + - lots of new tests + - add support for flags (implemented similarly to enums) + - add support for generating .enums.xml files to gsettings.m4: + gsettings_ENUM_NAMESPACE = org.example.myapp + gsettings_ENUM_FILES = ../path/to/*.h + will generate org.example.myapp.enums.xml with mappings for all + enums and flags in the specified .h files. + - warn with g_message() if the 'memory' backend is used by default + (ie: because no other GSettings backends are installed) + - fix get_property() for GSettings::schema + - command line tool: fix a bug that prevented non-basic values from + being set due to a premature free + - command line tool: bash completion support + - chain up in _finalize + - add a new g_settings_get_mapped API to read settings that require + post-processing + - retry with the translated or schema default value if the + GSettingsBindGetMapping function fails + - schema compiler: never fail due to empty schema directories (but + warn) + - peek rather than ref/unref the GEnumClass in the mapping function + - schema compiler: compile *.enums.xml before *.gschemas.xml to ensure + that we have all the enums that the schemas may reference + - schema compiler: improve accuracy of line numbers in error reports + - fix crashes in the keyfile backend caused by invalid group names in + the keyfile + +Other: + - always intern GBinding prop names + - base64: remove asserts preventing conversion of empty strings + - document NULL special-cases for GValueArray + - GNode docs improvements + - improve detection of 'system internal' mounts + - fix leaks in the inotify GFileMonitor implementation + - annotate all custom GIO GSources to improve debugging (e.g. using + SystemTap) + +Tests: + - Turn on glibc malloc checking features for make check + - improvements for GSettings tests, plus new tests + - improved tests for GKeyfile + - new tests for GDir, GSList, GSList, GAppLaunchContext, + CharsetConverter, GIcon, ... + - move some tests to GTester (tree tests, uri tests) + - generally, really an awful lot of new tests + - don't try to allocate 2gigs of memory anymore for the array test + + 552363 g_value_array_{insert,prepend,append}'s special cases for NULL + 561248 Improve return value description from g_node_prev/next_sibling() + 570036 Add ACLOCAL_AMFLAGS to Makefile.am + 576833 g_sprintf add a reference to g_strdup_printf + 576854 g_strconcat() documentation should provide a hint about bad l10n + 582227 reference: add other URI functions to 'URI Functions' section + 599223 should provide g_spawn_* variants that take a GAppLaunchContext + 610784 array test failing + 613057 Leak in inotify GFileMonitor implementation + 620536 Annotate all custom GIO GSource using g_source_set_name + 620913 More control with G_DBUS_DEBUG + 622124 implement flags + 622127 GSettings extended key validation + 622128 retry with default value for failed mapping + 622294 More annotations for GVariant + 622565 glib-compile-schemas fails when no schemas + 622600 Fix missing prototype warning + 622813 gsettings mapping & enum buglet + 623142 Ensure ::new-connection runs before processing D-Bus messages + 623143 Never require non-closed connections + 623319 use g_parse_debug_string for dbus debug flags + 623401 process enums first + 623402 schema compiler reports wrong line numbers + 623407 g_keyfile_settings_backend_new crashes with the key "/" + 623473 zlib should be checked with pkg-config + 623537 GDBusProxy has weird checking on NameOwnerChanged + 623538 GDBusProxy::g-properties-changed emission for corner cases + 623692 directory with file at multiple MLS levels may display empty + 623720 gschema.dtd does not contain enum definitions + 623770 quoting of expand_macro in gdesktopappinfo.c + 623772 gdesktopappinfo.c, function child_setup + 623780 g_unix_is_mount_path_system_internal + 623954 g_settings_finalize + 623955 Dubious return values + +Updated translations: + Galician + Hebrew + Norwegian bokmål + Spanish + +Overview of Changes from GLib 2.25.9 to GLib 2.25.10 +==================================================== + ++----------------------------------------------------------------+ +| WARNING: There have been API changes in GDBus. Users of these | +| APIs will need to be adapted. In particular, a new release of | +| dconf is required to go along with this one. There has also | +| been a change in the GSettings backend API used for keyfiles. | ++----------------------------------------------------------------+ + +* GDBus: + - add direction parameter to filter functions (API change) + - allow calling other interfaces with a GDBusProxy + - padding added to class struct fields (ABI change) + - fixes for closures-based functions + +* GVariant: + - new is_floating() call + - add g_value_take_variant() call (required for marshallers) + +* GSettings: + - support for binding GParamSpecEnum properties + - ifelse-style condition support for GLIB_GSETTINGS m4 macro + - remove gsettings-schema-convert tool (now in GConf) + - allow introspection of all installed schemas + - allow introspection of the keys in a schema + - rewrite keyfile backend (API change) + +* GNIO: + - don't implicitly close GSocket until it is destroyed + - windows fixups + +* Other: + - allow GChecksum to take (NULL, 0) for data/length + - GRelation and GCompletion are now deprecated + - introduce G_PARAM_DEPRECATED and G_ENABLE_DIAGNOSTIC + - add working directory to GApplication platform data + - lots of documentation cleanups + - PCRE updated to 8.02 + +* Build: + - the IA__g_* style symbol aliasing has been disabled and replaced with + the -Bsymbolic-functions linker flag on platforms that support it. + Please be on the watch for portability issues and report them to us. + - many test cases have been moved to the GTester framework + - lcov support has been added for tests + - many windows fixes + +* Bugs fixed: + 501057 lcov coverage suite and GLib integration + 551271 deprecate GRelation + 601686 Implement diagnostic mode + 603309 GSocketOutputStream broken on Windows (?) + 616718 GLIB_GSETTINGS macro can't be used conditionally + 616855 GSocketConnection: don't close the socket if it's still reffed + 618866 g_ptr_array_remove_index_fast memory leak + 619878 keyfile backend calls keys_changed with invalid argument + 619879 keyfile backend doesn't make use of expected_type + 621092 Add with_closures() variants for bindings + 621172 Cross compiling fails + 621838 Actually add cwd to platform data + 621945 Filter outgoing messages in GDBusConnection + 621947 add g_value_take_variant + 622038 GSettings: "It is a programmer error" documentation is unclear + 622154 [patch] update documentation for g_application_new + 622281 binding: Add SYNC_CREATE to the flags + 622480 Improve documentation for g_strcmp0() + 622554 g_error called if schema not installed + 622601 Return interned strings from g_settings_list_keys + +* Translation updates: + - Galician + +Overview of Changes from GLib 2.25.8 to GLib 2.25.9 =================================================== ++----------------------------------------------------------------+ +| WARNING: There have been API changes in GDBus, GSettings and | +| GApplication. Users of these APIs will need to be adapted. In | +| particular, a new release of GTK+ is required to go along with | +| this one. | ++----------------------------------------------------------------+ + +* GDBus + - Use Gio's default async implementation + - Fix proxy construction for objects with no properties + - Fix error handling in synchronous initialization + - Do not dispatch calls to unregistered objects + - Add _with_closures alternative functions + - Allow constructing GDBusProxy with well-known names + - Remove GType parameters from GDBusProxy constructors + - Nuke g_bus_watch_proxy API + - Add --xml to gdbus-tool to print raw introspected XML + +* GSettings + - schema file format change: store (default, options) in gvdb + - Add g_settings_sync() + - Add support for enums and ranges + - 'context' support has been replaced by direct use of + GSettingsBackend + +* GApplication + - Switch to using variants for timestamps + - Use GInitable + +* GObject + - Introduce g_object_notify_by_pspec + - Add GBinding + - The GVariant gtype G_TYPE_VARIANT was changed from boxed + to fundamental. We believe there were no existing users + of the boxed type, so this should not cause any applications + to break. + +* Test framework + - Add package and version to the test report XML + - Use optparse to parse gtester-report commandline + - Add subunit support to gtester-report + - Prevent division by zero if no tests + * Bugs fixed: - 578295 gtester has a race condition + 621782 Crash using gbinding 619945 GConverterOutputStream triggers assertion and corrupts data + 621319 more leaked GVariants in GSettings 621168 GKeyFile memory leak on Windows platform - 616216 glib compile from remote directory fails - + 621002 Switch to using variants for timestamps, split out signals + 620953 tiny docs addition + 618904 Lies in gunixmounts documentation + 621702 Correctly initialize GError + 611778 minor cleanup of gtester-report + 621213 GDBusProxy and well-known names + 621034 Rewrite apps test to ensure children are killed + 620954 gapplication gvariant simplifications + 611869 add subunit out feature to gtester-report + 621119 GDBusProxy and objects with no properties + 620990 Use Gio's default async implementation again + 620952 g_application_register_with_data is an ugly API + 621252 GSettings leaks context + 618715 fork() in GSettings test cases is problematic 618715 + 621905 Assume a ref when doing async work + 621266 GSettings "context" clarification + * Translation updates: + Chinese + + +Overview of Changes from GLib 2.25.7 to GLib 2.25.8 +=================================================== + +* Initial support for dtrace and systemtap profiling: + - mainloop sources can be named + - probes for memory allocation with g_malloc and gslice + - gquark name tracking + - type creation + - object life-cyle (creation, finalization, ref, unref) + - signal creation and emission + +* GVariant + - has been fixed to work with the FreeBSD malloc + - added introspection annotations + - new function: g_variant_builder_add_parsed + +* GSettings: + - g_settings_set/get_strv functions have lost their length parameter + - g_settings_set_strv accepts NULL + - added introspection annotiations + +* GPermission: an abstract interface for representing permissions, + with a minimal implementation named GSimplePermission + +* GApplication: a basic application support class, with a D-Bus based + implementation + +* Bugs fixed: + 619585 glib-compile-schemas asserts on FreeBSD + 620384 Annotate GVariant and GSettings _strv() functions + 606044 Add support for dtrace/systemtap static markers + 620350 add g_variant_builder_add_parsed() API + 620349 utf8ify GVariant printer + 620767 Typo in GSettings documentation: "INTLTOOL_NOMERGE_RULE" + 620312 Fix g_settings_[gs]et_strv() API + 620519 GPermission + 620582 GPermission needs a simple implementation + 620496 GSettings schema compiler should reject invalid paths + 620173 missing single header inclusion guards + 620265 g_assertion_message_error should take const GError * + +* Translation updates: + Esperanto + Galician + Hebrew + Indonesian + Norwegian bokmål + Slovenian + Spanish + + +Overview of Changes from GLib 2.25.6 to GLib 2.25.7 +=================================================== + +* NOTE: API/ABI breaks since 2.25.6 release: + - g_dbus_connection_sync{,_sync} takes a new 'reply_type' argument + - GSettingsBackendClass 'list' virtual function changed + + GSettings backends and things using GDBus may need to be rebuilt. + +* GDBus: many build-related fixes + +* GDBus (service): return a DBus error when receiving a method call for + an unknown interface. + +* GSettings: fix 'make install' bug in gsettings.m4 for generated schema + files + +* GSettings: avoid non-portable use of LC_MESSAGES + +* better approach to handling man pages + + +* Bugs fixed: + 619527 please improve docs on g_file_make_symlink + 619391 send-with-reply should have expected result signature + 618616 Use stack-allocated GVariantBuilders + 617004 Build with "--disable-nls" fails under MinGW/Win32 + 619142 Build fixes (GDBus) + +* Updated translations: Estonian - French Galician + Norwegian bokmål + +Overview of Changes from GLib 2.25.5 to GLib 2.25.6 +=================================================== + +* GDBus: introspection improvements +* GDBus: build fixes + +* GSettings: GSettingsBackend ABI changed **** NOTE **** +* GSettings: --uninstall option for schema compiler +* GSettings: new m4 macro with more power +* GSettings: thread support + +* rework of file notification on Solaris +* fixes for gold linker + +* Bugs fixed: + 619038 increase gsettings.m4 power + 619031 method-calls-in-thread test failing + 618839 Typo at translation message + 616864 GSETTINGS_CHECK_RULE doesn't work with multiple files + 618730 gunixcredentialsmessage.c doesn't compile on GNU/kfreebsd + 616314 Make GSettings (partially) threadsafe + +* Updated Translations: Indonesian - Italian - Latvian - Romanian + Galician Spanish -Overview of Changes from GLib 2.24.0 to GLib 2.24.1 +Overview of Changes from GLib 2.25.4 to GLib 2.25.5 +=================================================== + +* GDBus: Fix serialization of empty arrays + +* GDBus: Plug various memory leaks + +* GSettings: Fix problems with GSETTINGS_CHECK_RULE + +* Bugs fixed: + 616731 GSETTINGS_CHECK_RULE doesn't work in non-srcdir builds + 616864 GSETTINGS_CHECK_RULE doesn't work with multiple files + 618615 mem leaks in parse_value_from_blob + 618622 Plug some mem leaks in gdbus + 618650 Plug a mem leak in gdbusauth + 618663 Plug mem leaks in gdbus tests & examples + +* Updated translations: + Spanish + + +Overview of Changes from GLib 2.25.3 to GLib 2.25.4 +=================================================== + +* GDBus D-Bus support has been merged. This provides an API + to replace dbus-glib + +* GVariant no requires strings to be UTF-8. You can use byte + arrays for non-UTF-8 strings. + +* GSettings allows to bind string properties to byte arrays + +* The schema compiler supports range restrictions + +* Bugs fixed: + 618051 socket-server|client.c fail to compile under AIX... + 616102 GSettings ignores and + 616720 Chunked quark allocation + 616877 Several issues with g_socket_receive_message + 616892 gio: Add a boxed type for GFileAttributeMatcher + 616967 Add g_regex_get_compile_flags() and g_regex_get_match_flags() + 617767 g_settings_[gs]et_strv() 'length' argument has missing docs... + 617914 gtester-report: cope with binaries with no test cases + 617937 output_stream_close vs output_stream_close_async semantics + 615494 Connction timeouts produce partially invalid error messages + 617823 glib-compile-schemas problems with an out of source build + 617947 glib-mkenums: add @valuenum@ support + +* Translation updates: + Galicaian + Norwegian bokmål + Shavian + Spanish + + +Overview of Changes from GLib 2.25.2 to GLib 2.25.3 +=================================================== + +* New macro: G_GNUC_DEPRECATED_FOR, a variant of G_GNUC_DEPRECATED + that lets you add replacement information (requires gcc 4.5) + +* Rename AM_GSETTINGS autoconf macro to GLIB_GSETTINGS + +* Rename gschema-compile utility to glib-compile-schemas + +* Add support for timeouts in GSocket + +* Bugs fixed: + 589989 Compilation error on Solaris 9 + 616648 Change AM_GSETTINGS macro to GLIB_GSETTINGS + 587898 I/O timeouts for GSocket + 614541 Add G_TYPE_ERROR boxed type for GError + + +Overview of Changes from GLib 2.25.0 to GLib 2.25.2 =================================================== +* Include a 'gsettings' utility, for commandline access to GSettings + +* Install a AM_GSETTINGS autoconf macro similar to AM_GCONF + +* GSettings can bind the writability of a key explicitly + +* There is now a predefined boxed type for GError + * Bugs fixed: 615379 g_new macros crash if sizeof(struct_type) == 0 - 614185 g_type_class_add_private() documentation is not correct - 614372 g_stat() is funny - 615111 GAsyncInitable's default implementation is broken - Fix race in g_cancellable_cancel() - Fix for g_variant_iter_loop() - Make g_string_append_len() accept NULL lf len == 0 - Fix typo in GMutex error message + 616312 Add m4 rule equivalent to GCONF_SCHEMAS_INSTALL + 616295 mapping bug for uint64 + 616216 glib compile from remote directory fails + 615960 Fix size passed to connect() for abstract sockets + 616432 Crash in gschema-compile + 616331 gsettings-schema-convert uses imaginary types + 616309 gsettings-schema-convert should output gettext-domain + 616384 Add mention of GConfBridge in conversion docs + 616311 gschema-compile outputs in current directory + 616276 simplify gschema-compile test setup + 616156 keys with unnecessary empty options arrays + 616405 gsettings missing g_return_if_fail's + 616245 Use G_DEFINE_INTERFACE macro + 614541 Add G_TYPE_ERROR boxed type for GError + +* Updated translations: + Catalan (Valencian) + Galician + Kannada + Spanish + + +Overview of Changes from GLib 2.24.0 to GLib 2.25.0 +=================================================== + +* The GSettings framework has been merged. This provides the API to + replace GConf. DConf will provide a backend implementation for it. + GConf will also provide a backend implementation to ease the + transition. We provide utilities to assist with schema conversion + and data migration, as well as a porting guide. * Translation updates: - Bengali India + Bengali Catalan - Catalan (Valencian) Danish - Kannada + Gujarati + Marathi Thai Traditional Chinese diff --git a/README b/README index 0275ced..806067a 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ General Information =================== -This is GLib version 2.24.2. GLib is the low-level core +This is GLib version 2.27.5. GLib is the low-level core library that forms the basis for projects such as GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, diff --git a/README.win32 b/README.win32 index 22300b2..25d06ae 100644 --- a/README.win32 +++ b/README.win32 @@ -153,7 +153,7 @@ something that libtool has added. The -0 suffix is added by libtool and is the value of "LT_CURRENT - LT_AGE". The 0 should *not* be thought to be part of the version number of GLib. The LT_CURRENT - LT_AGE value will on purpose be kept as zero as long as binary -compatibility is maintained. For the gory details, see configure.in +compatibility is maintained. For the gory details, see configure.ac and libtool documentation. Building with Visual Studio diff --git a/aclocal.m4 b/aclocal.m4 index 618d37f..1b02945 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, -[m4_warning([this file was generated for autoconf 2.65. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -84,7 +84,8 @@ AC_DEFUN([GTK_DOC_CHECK], # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -93,7 +94,8 @@ AC_DEFUN([GTK_DOC_CHECK], m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -120,7 +122,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -149,6 +151,7 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -165,6 +168,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -201,7 +206,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -221,6 +226,9 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -243,10 +251,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -262,7 +273,6 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -276,23 +286,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -333,6 +326,28 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -485,7 +500,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -495,7 +510,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -594,12 +609,20 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -610,9 +633,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -620,16 +643,38 @@ for var in lt_decl_all_varnames([[ \ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -639,20 +684,11 @@ _LT_OUTPUT_LIBTOOL_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -678,7 +714,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -723,15 +759,13 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -794,15 +828,12 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - _LT_PROG_XSI_SHELLFNS + _LT_PROG_REPLACE_SHELLFNS - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -908,11 +939,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -1017,6 +1050,31 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -1044,7 +1102,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1064,7 +1122,11 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -1072,7 +1134,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1088,203 +1150,142 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1313,7 +1314,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1431,14 +1432,47 @@ need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1465,10 +1499,19 @@ if test -n "$RANLIB"; then esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1493,15 +1536,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1541,7 +1584,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1604,6 +1647,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1668,8 +1716,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1720,7 +1768,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1761,7 +1809,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1770,7 +1824,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1946,16 +2004,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2114,6 +2172,7 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2122,16 +2181,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2144,7 +2210,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2164,7 +2230,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2252,7 +2324,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2283,8 +2355,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2305,36 +2378,83 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2421,6 +2541,19 @@ gnu*) hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2463,8 +2596,10 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) @@ -2522,7 +2657,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -2531,16 +2666,21 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2552,8 +2692,9 @@ linux* | k*bsd*-gnu) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2785,6 +2926,8 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2897,6 +3040,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -3018,6 +3162,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -3026,8 +3175,8 @@ case $host_os in fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3079,16 +3228,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3118,6 +3269,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3126,11 +3281,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3152,7 +3307,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3230,6 +3385,21 @@ tpf*) ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3237,7 +3407,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3294,7 +3468,19 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3307,13 +3493,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3328,6 +3514,67 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + # LT_LIB_M # -------- @@ -3336,7 +3583,7 @@ AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3364,7 +3611,12 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3381,6 +3633,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3448,8 +3701,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3485,6 +3738,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3506,7 +3760,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3518,6 +3772,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3529,7 +3795,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3555,15 +3821,15 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3596,6 +3862,13 @@ else AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3606,6 +3879,8 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3617,7 +3892,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3668,6 +3942,11 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3717,6 +3996,12 @@ m4_if([$1], [CXX], [ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3773,7 +4058,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3806,8 +4091,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3869,7 +4154,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3973,6 +4258,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -4015,6 +4306,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -4057,7 +4355,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4078,7 +4376,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4090,25 +4394,25 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; @@ -4140,7 +4444,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4197,9 +4501,11 @@ case $host_os in _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4218,6 +4524,8 @@ fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4238,6 +4546,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4246,27 +4555,35 @@ m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4328,8 +4645,34 @@ dnl Note also adjust exclude_expsyms for C++ above. ;; esac - _LT_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4347,6 +4690,7 @@ dnl Note also adjust exclude_expsyms for C++ above. fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4362,11 +4706,12 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4402,10 +4747,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4423,6 +4770,11 @@ _LT_EOF fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4438,7 +4790,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4448,15 +4800,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4467,13 +4820,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4489,17 +4846,17 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4513,8 +4870,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4532,8 +4889,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4579,8 +4936,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4620,8 +4977,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4708,9 +5067,9 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4719,14 +5078,19 @@ _LT_EOF else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4758,20 +5122,63 @@ _LT_EOF # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4809,7 +5216,7 @@ _LT_EOF # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4817,7 +5224,7 @@ _LT_EOF hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4832,8 +5239,8 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -4851,16 +5258,16 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4872,7 +5279,14 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4900,19 +5314,34 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4974,17 +5403,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4994,13 +5423,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5013,9 +5442,9 @@ _LT_EOF _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5191,36 +5620,38 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5285,8 +5716,6 @@ _LT_TAGDECL([], [inherit_rpath], [0], to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5297,6 +5726,8 @@ _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5386,37 +5817,22 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5438,6 +5854,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5469,6 +5887,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5486,6 +5905,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5507,8 +5927,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5540,7 +5960,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5649,10 +6069,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5661,14 +6081,19 @@ if test "$_lt_caught_CXX_error" != yes; then else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5698,28 +6123,75 @@ if test "$_lt_caught_CXX_error" != yes; then ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5761,6 +6233,11 @@ if test "$_lt_caught_CXX_error" != yes; then gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5785,11 +6262,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5850,7 +6327,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5860,10 +6337,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5893,7 +6370,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5904,9 +6381,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5917,7 +6394,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5935,7 +6412,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5972,26 +6449,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5999,7 +6476,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -6018,9 +6495,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -6040,13 +6517,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6115,7 +6592,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6150,15 +6627,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6174,17 +6651,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6194,7 +6671,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6230,7 +6707,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6251,7 +6728,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6271,14 +6748,14 @@ if test "$_lt_caught_CXX_error" != yes; then if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6289,7 +6766,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6343,6 +6820,10 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6398,6 +6879,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6412,6 +6894,29 @@ AC_LANG_POP ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6420,6 +6925,7 @@ AC_LANG_POP # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6470,6 +6976,13 @@ public class foo { }; _LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6481,7 +6994,7 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6490,13 +7003,22 @@ if AC_TRY_EVAL(ac_compile); then test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6516,8 +7038,10 @@ if AC_TRY_EVAL(ac_compile); then _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6553,6 +7077,7 @@ else fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6589,7 +7114,7 @@ linux*) solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6633,32 +7158,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6677,6 +7186,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6716,7 +7227,9 @@ if test "$_lt_disable_F77" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6770,38 +7283,24 @@ if test "$_lt_disable_F77" != yes; then GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6820,6 +7319,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6859,7 +7360,9 @@ if test "$_lt_disable_FC" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6915,7 +7418,8 @@ if test "$_lt_disable_FC" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6952,10 +7456,12 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6965,6 +7471,8 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) @@ -6980,7 +7488,8 @@ fi AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG @@ -7015,9 +7524,11 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7030,7 +7541,8 @@ fi GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -7089,6 +7601,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7180,8 +7701,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7220,222 +7741,177 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) -_LT_EOF -esac + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac ]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -7550,7 +8026,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -7558,13 +8034,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -7922,31 +8398,31 @@ m4_define([lt_dict_filter], # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3017 ltversion.m4 +# serial 3293 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3017]) +m4_define([LT_PACKAGE_VERSION], [2.4]) +m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3017' +[macro_version='2.4' +macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -8016,7 +8492,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -8029,8 +8504,16 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # @@ -8058,7 +8541,10 @@ m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi @@ -8071,7 +8557,6 @@ if test -n "$PKG_CONFIG"; then AC_MSG_RESULT([no]) PKG_CONFIG="" fi - fi[]dnl ])# PKG_PROG_PKG_CONFIG @@ -8080,21 +8565,20 @@ fi[]dnl # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) + m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) - # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], @@ -8147,6 +8631,7 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` @@ -8156,7 +8641,7 @@ if test $pkg_failed = yes; then # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - ifelse([$4], , [AC_MSG_ERROR(dnl + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -8164,25 +8649,24 @@ $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) +_PKG_TEXT]) + ]) elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT -To get pkg-config, see .])], - [$4]) +To get pkg-config, see .]) + ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) + $3 fi[]dnl ])# PKG_CHECK_MODULES @@ -8596,18 +9080,6 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, diff --git a/autogen.sh b/autogen.sh index 23e1e53..1730e57 100755 --- a/autogen.sh +++ b/autogen.sh @@ -19,14 +19,14 @@ if libtoolize --version < /dev/null > /dev/null 2>&1 ; then sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \ -e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` case $libtool_version in - 1.4*|1.5*|2.2*) + 2.2*|2.4*) have_libtool=true ;; esac fi if $have_libtool ; then : ; else echo - echo "You must have libtool 1.4 installed to compile $PROJECT." + echo "You must have libtool >= 2.2 installed to compile $PROJECT." echo "Install the appropriate package for your distribution," echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" DIE=1 @@ -51,36 +51,16 @@ fi if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then AUTOMAKE=automake-1.11 ACLOCAL=aclocal-1.11 -else - if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.10 - - if aclocal-1.10 --version < /dev/null > /dev/null 2>&1 ; then - ACLOCAL=aclocal-1.10 - else - if aclocal-1.9 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.9 - ACLOCAL=aclocal-1.9 - else - echo - echo "You must have automake 1.9.x, 1.10.x or 1.11.x installed to compile $PROJECT." - echo "Install the appropriate package for your distribution," - echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" - DIE=1 - fi - fi - else - if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.9 - ACLOCAL=aclocal-1.9 - else - echo - echo "You must have automake 1.9.x, 1.10.x or 1.11.x installed to compile $PROJECT." - echo "Install the appropriate package for your distribution," - echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" - DIE=1 - fi - fi +else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then + AUTOMAKE=automake-1.10 + ACLOCAL=aclocal-1.10 +else + echo + echo "You must have automake 1.10.x or 1.11.x installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" + DIE=1 +fi fi if test "$DIE" -eq 1; then @@ -92,7 +72,12 @@ test $TEST_TYPE $FILE || { exit 1 } -if test -z "$AUTOGEN_SUBDIR_MODE"; then +# NOCONFIGURE is used by gnome-common; support both +if ! test -z "$AUTOGEN_SUBDIR_MODE"; then + NOCONFIGURE=1 +fi + +if test -z "$NOCONFIGURE"; then if test -z "$*"; then echo "I am going to run ./configure with no arguments - if you wish " echo "to pass any to it, please specify them on the $0 command line." @@ -117,7 +102,7 @@ $AUTOMAKE --add-missing || exit $? autoconf || exit $? cd $ORIGDIR || exit $? -if test -z "$AUTOGEN_SUBDIR_MODE"; then +if test -z "$NOCONFIGURE"; then $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? echo diff --git a/build/Makefile.in b/build/Makefile.in index d3fbbfb..9ff92b5 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -42,7 +42,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -99,6 +99,7 @@ am__relativize = \ done; \ reldir="$$dir2" ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -123,11 +124,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -141,13 +145,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -194,6 +201,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -201,6 +210,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -226,6 +236,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -242,6 +254,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -251,11 +264,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -271,11 +286,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -289,7 +310,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ diff --git a/build/win32/Makefile.in b/build/win32/Makefile.in index d75f9ca..f11bcfd 100644 --- a/build/win32/Makefile.in +++ b/build/win32/Makefile.in @@ -41,7 +41,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -98,6 +98,7 @@ am__relativize = \ done; \ reldir="$$dir2" ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -122,11 +123,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -140,13 +144,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -193,6 +200,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -200,6 +209,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -225,6 +235,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -241,6 +253,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -250,11 +263,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -270,11 +285,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -288,7 +309,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ diff --git a/build/win32/dirent/Makefile.in b/build/win32/dirent/Makefile.in index 083d238..4021dd1 100644 --- a/build/win32/dirent/Makefile.in +++ b/build/win32/dirent/Makefile.in @@ -41,7 +41,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -58,6 +58,7 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -82,11 +83,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -100,13 +104,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -153,6 +160,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -160,6 +169,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -185,6 +195,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -201,6 +213,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -210,11 +223,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -230,11 +245,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -248,7 +269,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ diff --git a/build/win32/vs9/Makefile.in b/build/win32/vs9/Makefile.in index ee8e402..2d8687c 100644 --- a/build/win32/vs9/Makefile.in +++ b/build/win32/vs9/Makefile.in @@ -41,7 +41,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -58,6 +58,7 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -82,11 +83,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -100,13 +104,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -153,6 +160,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -160,6 +169,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -185,6 +195,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -201,6 +213,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -210,11 +223,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -230,11 +245,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -248,7 +269,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ diff --git a/build/win32/vs9/README.txt b/build/win32/vs9/README.txt index 43f1334..9a96616 100644 --- a/build/win32/vs9/README.txt +++ b/build/win32/vs9/README.txt @@ -7,12 +7,25 @@ the .in files needed, mainly config.h.win32.in into config.h.win32 and glibconfig.h.win32.in into glibconfig.h.win32. You will also need to expand the .vcprojin files here into .vcproj files. -The only external dependency is proxy-libintl. Fetch the latest -proxy-libintl-dev zipfile from +The required dependencies are zlib and proxy-libintl. Fetch the latest +proxy-libintl-dev and zlib-dev zipfiles from http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ for 32-bit builds, and correspondingly http://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/ for 64-bit -builds. Set up the source tree as follows under some arbitrary top +builds. + +One may optionally use his/her own PCRE installation by selecting the +(BuildType)_ExtPCRE configuration, but please note the PCRE must be built +with VS9 with unicode support using the /MD (release) or /MDd (debug) +runtime option which corresponds to your GLib build flavour (release, debug). +(These are the defaults set by CMAKE, which is used in recent versions of PCRE.) +Not doing so will most probably result in unexpected crashes in +your programs due to the use of different CRTs. If using a static PCRE +build, add PCRE_STATIC to the "preprocessor definitions". +Note that one may still continue to build with the bundled PCRE by selecting +the (BuildType) configuration. + +Set up the source tree as follows under some arbitrary top folder : \glib\ @@ -36,3 +49,4 @@ project files higher in the stack are supposed to look for them, not from a specific GLib source tree. --Tor Lillqvist +--Updated by Chun-wei Fan diff --git a/build/win32/vs9/gio.vcproj b/build/win32/vs9/gio.vcproj index 1d5d291..110687e 100644 --- a/build/win32/vs9/gio.vcproj +++ b/build/win32/vs9/gio.vcproj @@ -159,7 +159,12 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + + + + + @@ -171,10 +176,32 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -195,13 +222,13 @@ - + @@ -214,16 +241,32 @@ + + + + + + + + + + + + + + + + @@ -235,17 +278,39 @@ + + + + + + + + + + + + + + + + + + + + + + #include "libgio.sourcefiles" + + + + + + + + + + + + + + + + + + + + + + + @@ -169,6 +297,7 @@ + @@ -205,6 +334,7 @@ + @@ -239,6 +369,14 @@ /> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/win32/vs9/glib.vcprojin b/build/win32/vs9/glib.vcprojin index fc7e88e..5219948 100644 --- a/build/win32/vs9/glib.vcprojin +++ b/build/win32/vs9/glib.vcprojin @@ -52,6 +52,38 @@ /> + + + + + + + + + + + + + + + + @@ -176,6 +304,14 @@ /> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/win32/vs9/glib.vsprops b/build/win32/vs9/glib.vsprops index af95dc8..ba098d4 100644 --- a/build/win32/vs9/glib.vsprops +++ b/build/win32/vs9/glib.vsprops @@ -24,8 +24,8 @@ if exist ..\..\..\config.h goto DONE_CONFIG_H copy ..\..\..\config.h.win32 ..\..\..\config.h :DONE_CONFIG_H -if exist ..\..\..\glibconfig.h goto DONE_GLIBCONFIG_H -copy ..\..\..\glibconfig.h.win32 ..\..\..\glibconfig.h +if exist ..\..\..\glib\glibconfig.h goto DONE_GLIBCONFIG_H +copy ..\..\..\glib\glibconfig.h.win32 ..\..\..\glib\glibconfig.h :DONE_GLIBCONFIG_H if exist ..\..\..\gmodule\gmoduleconf.h goto DONE_GMODULECONF_H @@ -39,13 +39,14 @@ copy ..\..\..\gmodule\gmoduleconf.h.win32 ..\..\..\gmodule\gmoduleconf.h &# mkdir $(OutDir) mkdir $(OutDir)\bin copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\*.dll $(OutDir)\bin +if exist $(SolutionDir)$(ConfigurationName)_ExtPCRE copy $(SolutionDir)$(ConfigurationName)_ExtPCRE\$(PlatformName)\bin\*.dll $(OutDir)\bin copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\glib-genmarshal.exe $(OutDir)\bin copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\gspawn-win32-helper*.exe $(OutDir)\bin mkdir $(OutDir)\include\glib-2.0\glib copy ..\..\..\msvc_recommended_pragmas.h $(OutDir)\include\glib-2.0 copy ..\..\..\glib\glib.h $(OutDir)\include\glib-2.0 -copy ..\..\..\gmodule\gmodule.h $(OutDir)\include\glib-2.0 + copy ..\..\..\glib\glib-object.h $(OutDir)\include\glib-2.0 copy ..\..\..\glib\galloca.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\garray.h $(OutDir)\include\glib-2.0\glib @@ -61,6 +62,7 @@ copy ..\..\..\glib\gcompletion.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gconvert.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gdataset.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gdate.h $(OutDir)\include\glib-2.0\glib +copy ..\..\..\glib\gdatetime.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gdir.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gerror.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gfileutils.h $(OutDir)\include\glib-2.0\glib @@ -103,6 +105,7 @@ copy ..\..\..\glib\gtestutils.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gthread.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gthreadpool.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gtimer.h $(OutDir)\include\glib-2.0\glib +copy ..\..\..\glib\gtimezone.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gtree.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gtypes.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gunicode.h $(OutDir)\include\glib-2.0\glib @@ -112,7 +115,10 @@ copy ..\..\..\glib\gvariant.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gvarianttype.h $(OutDir)\include\glib-2.0\glib copy ..\..\..\glib\gwin32.h $(OutDir)\include\glib-2.0\glib +copy ..\..\..\gmodule\gmodule.h $(OutDir)\include\glib-2.0 + mkdir $(OutDir)\include\glib-2.0\gobject +copy ..\..\..\gobject\gbinding.h $(OutDir)\include\glib-2.0\gobject copy ..\..\..\gobject\gboxed.h $(OutDir)\include\glib-2.0\gobject copy ..\..\..\gobject\gclosure.h $(OutDir)\include\glib-2.0\gobject copy ..\..\..\gobject\genums.h $(OutDir)\include\glib-2.0\gobject @@ -132,7 +138,11 @@ copy ..\..\..\gobject\gvaluecollector.h $(OutDir)\include\glib-2.0\gobject copy ..\..\..\gobject\gvaluetypes.h $(OutDir)\include\glib-2.0\gobject mkdir $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gaction.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gactiongroup.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gappinfo.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gapplication.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gapplicationcommandline.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gasyncinitable.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gasyncresult.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gbufferedinputstream.h $(OutDir)\include\glib-2.0\gio @@ -145,6 +155,19 @@ copy ..\..\..\gio\gconverterinputstream.h $(OutDir)\include\glib-2.0\gio &# copy ..\..\..\gio\gconverteroutputstream.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gdatainputstream.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gdataoutputstream.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusauthobserver.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gcredentials.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusutils.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbuserror.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusaddress.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusconnection.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusmessage.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusnameowning.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusnamewatching.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusproxy.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusintrospection.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusmethodinvocation.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gdbusserver.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gdrive.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gemblem.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gemblemedicon.h $(OutDir)\include\glib-2.0\gio @@ -182,9 +205,19 @@ copy ..\..\..\gio\gnativevolumemonitor.h $(OutDir)\include\glib-2.0\gio &#x copy ..\..\..\gio\gnetworkaddress.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gnetworkservice.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\goutputstream.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gperiodic.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gpermission.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gproxy.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gproxyaddress.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gproxyaddressenumerator.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gproxyresolver.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gresolver.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gseekable.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gsettings.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gsimpleasyncresult.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gsimpleaction.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gsimpleactiongroup.h $(OutDir)\include\glib-2.0\gio +copy ..\..\..\gio\gsimplepermission.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gsocket.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gsocketaddress.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gsocketaddressenumerator.h $(OutDir)\include\glib-2.0\gio @@ -204,10 +237,15 @@ copy ..\..\..\gio\gvolumemonitor.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gzlibcompressor.h $(OutDir)\include\glib-2.0\gio copy ..\..\..\gio\gzlibdecompressor.h $(OutDir)\include\glib-2.0\gio +mkdir $(OutDir)\include\gio-win32-2.0\gio +copy ..\..\..\gio\gwin32inputstream.h $(OutDir)\include\gio-win32-2.0\gio +copy ..\..\..\gio\gwin32outputstream.h $(OutDir)\include\gio-win32-2.0\gio + mkdir $(OutDir)\lib\glib-2.0\include -copy ..\..\..\glibconfig.h $(OutDir)\lib\glib-2.0\include +copy ..\..\..\glib\glibconfig.h $(OutDir)\lib\glib-2.0\include copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\*-2.0.lib $(OutDir)\lib +if exist $(SolutionDir)$(ConfigurationName)_ExtPCRE copy $(SolutionDir)$(ConfigurationName)_ExtPCRE\$(PlatformName)\bin\*-2.0.lib $(OutDir)\lib " /> + + diff --git a/build/win32/vs9/gmodule.vcproj b/build/win32/vs9/gmodule.vcproj index c8af99c..3ae7e5e 100644 --- a/build/win32/vs9/gmodule.vcproj +++ b/build/win32/vs9/gmodule.vcproj @@ -191,7 +191,7 @@ @@ -211,7 +211,7 @@ diff --git a/build/win32/vs9/gobject.vcproj b/build/win32/vs9/gobject.vcproj index f465d1f..484ad8a 100644 --- a/build/win32/vs9/gobject.vcproj +++ b/build/win32/vs9/gobject.vcproj @@ -153,6 +153,7 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + diff --git a/config.h.in b/config.h.in index a809bed..08c5e6f 100644 --- a/config.h.in +++ b/config.h.in @@ -1,4 +1,4 @@ -/* config.h.in. Generated from configure.in by autoheader. */ +/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -149,6 +149,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CRT_EXTERNS_H +/* Define if dbus-1 is available */ +#undef HAVE_DBUS1 + /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT @@ -164,6 +167,9 @@ /* define for working do while(0) macros */ #undef HAVE_DOWHILE_MACROS +/* Define to 1 if using dtrace probes. */ +#undef HAVE_DTRACE + /* Define to 1 if you have the `endmntent' function. */ #undef HAVE_ENDMNTENT @@ -200,6 +206,9 @@ /* we have the futex(2) system call */ #undef HAVE_FUTEX +/* Whether you have gcov */ +#undef HAVE_GCOV + /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD @@ -294,6 +303,9 @@ /* Define to 1 if you have the `memalign' function. */ #undef HAVE_MEMALIGN +/* Define to 1 if you have the `memmem' function. */ +#undef HAVE_MEMMEM + /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE @@ -309,9 +321,6 @@ /* Have a monotonic clock */ #undef HAVE_MONOTONIC_CLOCK -/* Define to 1 if you have the `nanosleep' function. */ -#undef HAVE_NANOSLEEP - /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H @@ -321,9 +330,6 @@ /* Have non-POSIX function getpwuid_r */ #undef HAVE_NONPOSIX_GETPWUID_R -/* Define to 1 if you have the `nsleep' function. */ -#undef HAVE_NSLEEP - /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT @@ -463,6 +469,9 @@ /* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC +/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +#undef HAVE_STRUCT_TM_TM_GMTOFF + /* Define to 1 if you have the `symlink' function. */ #undef HAVE_SYMLINK diff --git a/config.h.win32 b/config.h.win32 index bcad941..296808b 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -1,6 +1,6 @@ /* config.h.win32.in Merged from two versions generated by configure for gcc and MSVC. */ /* config.h. Generated by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ +/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ @@ -35,13 +35,13 @@ #define GETTEXT_PACKAGE "glib20" /* Define to the GLIB binary age */ -#define GLIB_BINARY_AGE 2402 +#define GLIB_BINARY_AGE 2705 /* Byte contents of gmutex */ /* #undef GLIB_BYTE_CONTENTS_GMUTEX */ /* Define to the GLIB interface age */ -#define GLIB_INTERFACE_AGE 2 +#define GLIB_INTERFACE_AGE 0 /* Define the location where the catalogs will be installed */ #define GLIB_LOCALE_DIR "NONE/share/locale" @@ -50,10 +50,10 @@ #define GLIB_MAJOR_VERSION 2 /* Define to the GLIB micro version */ -#define GLIB_MICRO_VERSION 2 +#define GLIB_MICRO_VERSION 5 /* Define to the GLIB minor version */ -#define GLIB_MINOR_VERSION 24 +#define GLIB_MINOR_VERSION 27 /* The size of gmutex, as computed by sizeof. */ /* #undef GLIB_SIZEOF_GMUTEX */ @@ -165,6 +165,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_CRT_EXTERNS_H */ +/* Define if dbus-1 is available */ +/* #undef HAVE_DBUS1 */ + /* Define to 1 if you have the `dcgettext' function. */ #define HAVE_DCGETTEXT 1 @@ -330,6 +333,9 @@ /* Define to 1 if you have the `memalign' function. */ /* #undef HAVE_MEMALIGN */ +/* Define to 1 if you have the `memmem' function. */ +/* #undef HAVE_MEMMEM */ + /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 @@ -443,8 +449,8 @@ /* #undef HAVE_STDINT_H */ #endif /* _MSC_VER */ -/* Define if exists, doesn't clash with , and - declares uintmax_t. */ +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ #ifndef _MSC_VER #define HAVE_STDINT_H_WITH_UINTMAX 1 #else /* _MSC_VER */ @@ -706,13 +712,13 @@ #define PACKAGE_NAME "glib" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "glib 2.24.2" +#define PACKAGE_STRING "glib 2.27.5" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "glib" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.24.2" +#define PACKAGE_VERSION "2.27.5" /* Maximum POSIX RT priority */ /* #undef POSIX_MAX_PRIORITY */ @@ -789,7 +795,15 @@ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ -/* #undef WORDS_BIGENDIAN */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/config.h.win32.in b/config.h.win32.in index df30e82..a94aa0b 100644 --- a/config.h.win32.in +++ b/config.h.win32.in @@ -1,6 +1,6 @@ /* config.h.win32.in Merged from two versions generated by configure for gcc and MSVC. */ /* config.h. Generated by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ +/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ @@ -165,6 +165,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_CRT_EXTERNS_H */ +/* Define if dbus-1 is available */ +/* #undef HAVE_DBUS1 */ + /* Define to 1 if you have the `dcgettext' function. */ #define HAVE_DCGETTEXT 1 @@ -330,6 +333,9 @@ /* Define to 1 if you have the `memalign' function. */ /* #undef HAVE_MEMALIGN */ +/* Define to 1 if you have the `memmem' function. */ +/* #undef HAVE_MEMMEM */ + /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 @@ -443,8 +449,8 @@ /* #undef HAVE_STDINT_H */ #endif /* _MSC_VER */ -/* Define if exists, doesn't clash with , and - declares uintmax_t. */ +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ #ifndef _MSC_VER #define HAVE_STDINT_H_WITH_UINTMAX 1 #else /* _MSC_VER */ @@ -789,7 +795,15 @@ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ -/* #undef WORDS_BIGENDIAN */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/configure b/configure index c7d1d36..6870c8f 100755 --- a/configure +++ b/configure @@ -1,13 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for glib 2.24.2. +# Generated by GNU Autoconf 2.68 for glib 2.27.5. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +91,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -173,7 +174,15 @@ test x\$exitcode = x0 || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -216,11 +225,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -320,7 +336,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -360,19 +376,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -529,161 +545,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -702,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='glib' PACKAGE_TARNAME='glib' -PACKAGE_VERSION='2.24.2' -PACKAGE_STRING='glib 2.24.2' +PACKAGE_VERSION='2.27.5' +PACKAGE_STRING='glib 2.27.5' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=glib' PACKAGE_URL='' @@ -748,6 +617,26 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +gio_INCLUDES +gmodule_INCLUDES +gobject_INCLUDES +gthread_INCLUDES +glib_INCLUDES +config_h_INCLUDES +GLIB_LINK_FLAGS +HAVE_DBUS1_FALSE +HAVE_DBUS1_TRUE +DBUS1_LIBS +DBUS1_CFLAGS +LTP_GENHTML +LTP +SHTOOL +ABS_TAPSET_DIR +ENABLE_SYSTEMTAP_FALSE +ENABLE_SYSTEMTAP_TRUE +ENABLE_DTRACE_FALSE +ENABLE_DTRACE_TRUE +DTRACE ENABLE_MAN_FALSE ENABLE_MAN_TRUE XMLCATALOG @@ -767,6 +656,7 @@ HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK +GLIB_COMPILE_SCHEMAS GLIB_GENMARSHAL CROSS_COMPILING_FALSE CROSS_COMPILING_TRUE @@ -781,6 +671,7 @@ ENABLE_REGEX_FALSE ENABLE_REGEX_TRUE HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE +GLIB_RT_LIBS G_THREAD_LIBS_EXTRA G_THREAD_LIBS_FOR_GTHREAD G_THREAD_LIBS @@ -832,7 +723,8 @@ OTOOL LIPO NMEDIT DSYMUTIL -lt_ECHO +MANIFEST_TOOL +ac_ct_AR AR LN_S ac_ct_DUMPBIN @@ -864,6 +756,7 @@ MSGFMT USE_NLS CONFIG_STATUS_DEPENDENCIES ZLIB_LIBS +ZLIB_CFLAGS GLIBC21 EGREP GREP @@ -881,6 +774,8 @@ REBUILD INDENT PERL GLIB_EXTRA_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG HAVE_CXX_FALSE HAVE_CXX_TRUE @@ -912,6 +807,15 @@ OS_WIN32_X64_FALSE OS_WIN32_X64_TRUE OS_WIN32_FALSE OS_WIN32_TRUE +LIB_EXE_MACHINE_FLAG +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build CPP am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -929,15 +833,6 @@ CPPFLAGS LDFLAGS CFLAGS CC -LIB_EXE_MACHINE_FLAG -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE @@ -1026,7 +921,6 @@ enable_gc_friendly enable_mem_pools enable_threads enable_rebuilds -enable_visibility with_runtime_libdir enable_largefile with_libiconv @@ -1036,7 +930,9 @@ enable_shared with_pic enable_fast_install with_gnu_ld +with_sysroot enable_libtool_lock +with_gnu_ld enable_included_printf with_gio_module_dir enable_selinux @@ -1051,6 +947,11 @@ enable_gtk_doc_html enable_gtk_doc_pdf enable_man with_xml_catalog +enable_dtrace +enable_systemtap +with_tapset_install_dir +enable_gcov +enable_Bsymbolic ' ac_precious_vars='build_alias host_alias @@ -1061,13 +962,26 @@ LDFLAGS LIBS CPPFLAGS CPP +CPPFLAGS CXX CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS CCC -CXXCPP +CC +LDFLAGS +LIBS PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +ZLIB_CFLAGS +ZLIB_LIBS +CXXCPP PCRE_CFLAGS -PCRE_LIBS' +PCRE_LIBS +DBUS1_CFLAGS +DBUS1_LIBS' # Initialize some variables set by options. @@ -1130,8 +1044,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1176,7 +1091,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1202,7 +1117,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1406,7 +1321,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1422,7 +1337,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1452,8 +1367,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1461,7 +1376,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1471,7 +1386,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1479,13 +1394,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1508,7 +1423,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1522,8 +1437,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1538,9 +1453,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1579,11 +1494,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1609,7 +1524,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures glib 2.24.2 to adapt to many kinds of systems. +\`configure' configures glib 2.27.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1623,7 +1538,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1679,7 +1594,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of glib 2.24.2:";; + short | recursive ) echo "Configuration of glib 2.27.5:";; esac cat <<\_ACEOF @@ -1694,13 +1609,12 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-debug=[no/minimum/yes] - turn on debugging [default=minimum] + turn on debugging [default=yes] --enable-gc-friendly turn on garbage collector friendliness [default=no] --disable-mem-pools disable all glib memory pools --enable-threads turn on basic thread support [default=yes] ([=no] will override --with-threads) --disable-rebuilds disable all source autogeneration rules - --disable-visibility don't use ELF visibility attributes --disable-largefile omit support for large files --enable-iconv-cache=[yes/no/auto] cache iconv descriptors [default=auto] @@ -1719,6 +1633,10 @@ Optional Features: --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] --enable-man regenerate man pages from Docbook [default=no] + --enable-dtrace Enable inclusion of dtrace trace support + --enable-systemtap Enable inclusion of systemtap trace support + --enable-gcov Enable gcov + --disable-Bsymbolic avoid linking with -Bsymbolic Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1730,6 +1648,8 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --with-gio-module-dir=PATH Load gio modules from this directory [LIBDIR/gio/modules] @@ -1741,6 +1661,9 @@ Optional Packages: --with-html-dir=PATH path to installed docs --with-xml-catalog=CATALOG path to xml catalog to use + --with-tapset-install-dir + The absolute path where the systemtap tapsets will + be installed Some influential environment variables: CC C compiler command @@ -1753,10 +1676,19 @@ Some influential environment variables: CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config + ZLIB_LIBS linker flags for ZLIB, overriding pkg-config + CXXCPP C++ preprocessor PCRE_CFLAGS C compiler flags for PCRE, overriding pkg-config PCRE_LIBS linker flags for PCRE, overriding pkg-config + DBUS1_CFLAGS + C compiler flags for DBUS1, overriding pkg-config + DBUS1_LIBS linker flags for DBUS1, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1824,10 +1756,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -glib configure 2.24.2 -generated by GNU Autoconf 2.65 +glib configure 2.27.5 +generated by GNU Autoconf 2.68 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1871,7 +1803,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1897,7 +1829,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1908,7 +1840,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1946,7 +1878,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1992,7 +1924,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -2005,7 +1937,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2060,7 +1992,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2072,10 +2004,10 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2111,7 +2043,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -2134,17 +2066,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## ------------------------------------------------------------------- ## +( $as_echo "## ------------------------------------------------------------------- ## ## Report this to http://bugzilla.gnome.org/enter_bug.cgi?product=glib ## -## ------------------------------------------------------------------- ## -_ASBOX +## ------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2153,7 +2083,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -2194,7 +2124,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -2208,7 +2138,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2226,7 +2156,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -2251,7 +2181,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : @@ -2262,7 +2192,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -2308,11 +2238,65 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -2486,7 +2470,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -2500,7 +2484,7 @@ ac_fn_c_check_member () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2544,69 +2528,15 @@ fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by glib $as_me 2.24.2, which was -generated by GNU Autoconf 2.65. Invocation command line was +It was created by glib $as_me 2.27.5, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2716,11 +2646,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2754,11 +2682,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2771,11 +2697,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2789,11 +2713,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2848,7 +2770,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2863,7 +2790,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2939,7 +2870,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2953,6 +2884,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_config_headers="$ac_config_headers config.h" + # Save this value here, since automake will set cflags later @@ -2962,16 +2895,22 @@ am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -3000,7 +2939,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3087,11 +3026,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -3113,7 +3052,7 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - as_fn_error "ls -t appears to fail. Make sure there is not a broken + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi @@ -3123,7 +3062,7 @@ then # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3177,7 +3116,7 @@ if test "$cross_compiling" != no; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -3217,7 +3156,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -3270,7 +3209,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3321,7 +3260,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -3361,7 +3300,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3369,7 +3308,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -3403,7 +3342,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -3419,7 +3358,7 @@ fi # Define the identity of the package. PACKAGE='glib' - VERSION='2.24.2' + VERSION='2.27.5' # Some tools Automake needs. @@ -3451,10 +3390,6 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -# Specify a configuration file -ac_config_headers="$ac_config_headers config.h" - - # Support silent build rules, requires at least automake-1.11. Enable # by either passing --enable-silent-rules to configure or passing V=0 # to make @@ -3472,11 +3407,11 @@ AM_BACKSLASH='\' GLIB_MAJOR_VERSION=2 -GLIB_MINOR_VERSION=24 -GLIB_MICRO_VERSION=2 -GLIB_INTERFACE_AGE=2 -GLIB_BINARY_AGE=2402 -GLIB_VERSION=2.24.2 +GLIB_MINOR_VERSION=27 +GLIB_MICRO_VERSION=5 +GLIB_INTERFACE_AGE=0 +GLIB_BINARY_AGE=2705 +GLIB_VERSION=2.27.5 @@ -3489,23 +3424,23 @@ GLIB_VERSION=2.24.2 $as_echo "#define GLIB_MAJOR_VERSION 2" >>confdefs.h -$as_echo "#define GLIB_MINOR_VERSION 24" >>confdefs.h +$as_echo "#define GLIB_MINOR_VERSION 27" >>confdefs.h -$as_echo "#define GLIB_MICRO_VERSION 2" >>confdefs.h +$as_echo "#define GLIB_MICRO_VERSION 5" >>confdefs.h -$as_echo "#define GLIB_INTERFACE_AGE 2" >>confdefs.h +$as_echo "#define GLIB_INTERFACE_AGE 0" >>confdefs.h -$as_echo "#define GLIB_BINARY_AGE 2402" >>confdefs.h +$as_echo "#define GLIB_BINARY_AGE 2705" >>confdefs.h # libtool versioning -LT_RELEASE=2.24 -LT_CURRENT=2400 -LT_REVISION=2 -LT_AGE=2400 +LT_RELEASE=2.27 +LT_CURRENT=2705 +LT_REVISION=0 +LT_AGE=2705 LT_CURRENT_MINUS_AGE=0 @@ -3537,226 +3472,36 @@ fi -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the BeOS" >&5 -$as_echo_n "checking for the BeOS... " >&6; } -case $host in - *-*-beos*) - glib_native_beos="yes" - ;; - *) - glib_native_beos="no" - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_native_beos" >&5 -$as_echo "$glib_native_beos" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Win32" >&5 -$as_echo_n "checking for Win32... " >&6; } -LIB_EXE_MACHINE_FLAG=X86 -case "$host" in - *-*-mingw*) - glib_native_win32=yes - glib_pid_type='void *' - glib_cv_stack_grows=no - # Unfortunately the mingw implementations of C99-style snprintf and vsnprintf - # don't seem to be quite good enough, at least not in mingw-runtime-3.14. - # (Sorry, I don't know exactly what is the problem, but it is related to - # floating point formatting and decimal point vs. comma.) - # The simple tests in AC_FUNC_VSNPRINTF_C99 and AC_FUNC_SNPRINTF_C99 aren't - # rigorous enough to notice, though. - # So preset the autoconf cache variables. - ac_cv_func_vsnprintf_c99=no - ac_cv_func_snprintf_c99=no - case "$host" in - x86_64-*-*) - LIB_EXE_MACHINE_FLAG=X64 - ;; - esac - ;; - *) - glib_native_win32=no - glib_pid_type=int - ;; -esac -case $host in - *-*-linux*) - glib_os_linux=yes - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_native_win32" >&5 -$as_echo "$glib_native_win32" >&6; } - - - -glib_have_carbon=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Carbon support" >&5 -$as_echo_n "checking for Mac OS X Carbon support... " >&6; } -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi fi @@ -3777,7 +3522,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3830,7 +3575,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3870,7 +3615,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3929,7 +3674,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3973,7 +3718,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4027,8 +3772,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4142,9 +3887,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -4186,8 +3930,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4244,9 +3988,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -4257,7 +4001,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4297,8 +4041,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4308,7 +4052,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4345,7 +4089,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -4423,7 +4167,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -4517,12 +4261,74 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4645,7 +4451,6 @@ else fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4658,7 +4463,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4688,7 +4493,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4704,11 +4509,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4747,7 +4552,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4763,18 +4568,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4784,6 +4589,136 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the BeOS" >&5 +$as_echo_n "checking for the BeOS... " >&6; } +case $host in + *-*-beos*) + glib_native_beos="yes" + ;; + *) + glib_native_beos="no" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_native_beos" >&5 +$as_echo "$glib_native_beos" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Win32" >&5 +$as_echo_n "checking for Win32... " >&6; } +LIB_EXE_MACHINE_FLAG=X86 +case "$host" in + *-*-mingw*) + glib_native_win32=yes + glib_pid_type='void *' + glib_cv_stack_grows=no + # Unfortunately the mingw implementations of C99-style snprintf and vsnprintf + # don't seem to be quite good enough, at least not in mingw-runtime-3.14. + # (Sorry, I don't know exactly what is the problem, but it is related to + # floating point formatting and decimal point vs. comma.) + # The simple tests in AC_FUNC_VSNPRINTF_C99 and AC_FUNC_SNPRINTF_C99 aren't + # rigorous enough to notice, though. + # So preset the autoconf cache variables. + ac_cv_func_vsnprintf_c99=no + ac_cv_func_snprintf_c99=no + case "$host" in + x86_64-*-*) + LIB_EXE_MACHINE_FLAG=X64 + ;; + esac + ;; + *) + glib_native_win32=no + glib_pid_type=int + ;; +esac +case $host in + *-*-linux*) + glib_os_linux=yes + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_native_win32" >&5 +$as_echo "$glib_native_win32" >&6; } + + + +glib_have_carbon=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Carbon support" >&5 +$as_echo_n "checking for Mac OS X Carbon support... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4794,7 +4729,7 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : glib_have_carbon=yes fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_have_carbon" >&5 $as_echo "$glib_have_carbon" >&6; } @@ -4846,7 +4781,7 @@ if test "$glib_native_win32" = "yes"; then set dummy ${ac_tool_prefix}windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_WINDRES+set}" = set; then : +if ${ac_cv_prog_WINDRES+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$WINDRES"; then @@ -4886,7 +4821,7 @@ if test -z "$ac_cv_prog_WINDRES"; then set dummy windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then : +if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_WINDRES"; then @@ -4934,14 +4869,14 @@ else fi if test "$WINDRES" = no; then - as_fn_error "*** Could not find an implementation of windres in your PATH." "$LINENO" 5 + as_fn_error $? "*** Could not find an implementation of windres in your PATH." "$LINENO" 5 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NM+set}" = set; then : +if ${ac_cv_prog_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -4981,7 +4916,7 @@ if test -z "$ac_cv_prog_NM"; then set dummy nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then : +if ${ac_cv_prog_ac_ct_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then @@ -5029,14 +4964,14 @@ else fi if test "$NM" = no; then - as_fn_error "*** Could not find an implementation of nm in your PATH." "$LINENO" 5 + as_fn_error $? "*** Could not find an implementation of nm in your PATH." "$LINENO" 5 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -5076,7 +5011,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -5127,7 +5062,7 @@ fi set dummy lib.exe; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ms_librarian+set}" = set; then : +if ${ac_cv_prog_ms_librarian+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ms_librarian"; then @@ -5193,7 +5128,7 @@ fi if test "${enable_debug+set}" = set; then : enableval=$enable_debug; else - enable_debug=minimum + enable_debug=yes fi @@ -5225,13 +5160,6 @@ else enable_rebuilds=yes fi -# Check whether --enable-visibility was given. -if test "${enable_visibility+set}" = set; then : - enableval=$enable_visibility; -else - enable_visibility=yes -fi - if test "x$enable_threads" != "xyes"; then enable_threads=no @@ -5285,21 +5213,18 @@ else fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5308,7 +5233,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5318,28 +5243,32 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$CXX" && break + done fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5348,7 +5277,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" + ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5358,17 +5287,21 @@ IFS=$as_save_IFS fi fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_CC" = x; then - CC="" + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="gcc" else case $cross_compiling:$ac_tool_warned in yes:) @@ -5376,23 +5309,38 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CC=$ac_ct_CC + CXX=$ac_ct_CXX fi -else - CC="$ac_cv_prog_CC" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5401,7 +5349,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5411,30 +5359,33 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - fi + test -n "$CXX" && break + done fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else - ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do @@ -5442,109 +5393,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" + ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5554,21 +5403,21 @@ IFS=$as_save_IFS fi fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_CC" && break + test -n "$ac_ct_CXX" && break done - if test "x$ac_ct_CC" = x; then - CC="" + if test "x$ac_ct_CXX" = x; then + CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) @@ -5576,20 +5425,14 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CC=$ac_ct_CC + CXX=$ac_ct_CXX fi fi + fi fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } - # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -5613,9 +5456,9 @@ $as_echo "$ac_try_echo"; } >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5632,33 +5475,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then - GCC=yes + GXX=yes else - GCC= + GXX= fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5670,10 +5513,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes else - CFLAGS="" + CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5685,11 +5528,11 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5701,157 +5544,66 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" else - CFLAGS="-g" + CXXFLAGS="-g" fi else - if test "$GCC" = yes; then - CFLAGS="-O2" + if test "$GXX" = yes; then + CXXFLAGS="-O2" else - CFLAGS= + CXXFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +depcc="$CXX" am_compiler_list= -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none + am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi @@ -5924,7 +5676,7 @@ else # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode + am_cv_CXX_dependencies_compiler_type=$depmode break fi fi @@ -5933,154 +5685,49 @@ else cd .. rm -rf conftest.dir else - am_cv_CC_dependencies_compiler_type=none + am_cv_CXX_dependencies_compiler_type=none fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error +int +main () +{ +class a { int b; } c; + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext +if ac_fn_cxx_try_compile "$LINENO"; then : - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue else - # Passes both tests. -ac_preproc_ok=: -break + CXX= fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$CXX" != ""; then + HAVE_CXX_TRUE= + HAVE_CXX_FALSE='#' else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } + HAVE_CXX_TRUE='#' + HAVE_CXX_FALSE= fi ac_ext=c @@ -6090,18 +5737,21 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6110,7 +5760,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6120,32 +5770,28 @@ IFS=$as_save_IFS fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CXX" && break - done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6154,7 +5800,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" + ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6164,21 +5810,17 @@ IFS=$as_save_IFS fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="gcc" + if test "x$ac_ct_CC" = x; then + CC="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6186,38 +5828,122 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CXX=$ac_ct_CXX + CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6226,7 +5952,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6236,32 +5962,32 @@ IFS=$as_save_IFS fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CXX" && break + test -n "$CC" && break done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6270,7 +5996,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" + ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6280,21 +6006,21 @@ IFS=$as_save_IFS fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_CXX" && break + test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CXX" = x; then - CXX="g++" + if test "x$ac_ct_CC" = x; then + CC="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6302,14 +6028,20 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CXX=$ac_ct_CXX + CC=$ac_ct_CC fi fi - fi fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -6333,9 +6065,9 @@ $as_echo "$ac_try_echo"; } >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6352,33 +6084,33 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then - GXX=yes + GCC=yes else - GXX= + GCC= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6390,10 +6122,10 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes else - CXXFLAGS="" + CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6405,11 +6137,11 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6421,44 +6153,135 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" fi else - if test "$GXX" = yes; then - CXXFLAGS="-O2" + if test "$GCC" = yes; then + CFLAGS="-O2" else - CXXFLAGS= + CFLAGS= fi fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -depcc="$CXX" am_compiler_list= +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -6480,7 +6303,7 @@ else # directory. mkdir sub - am_cv_CXX_dependencies_compiler_type=none + am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi @@ -6553,7 +6376,7 @@ else # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode + am_cv_CC_dependencies_compiler_type=$depmode break fi fi @@ -6562,82 +6385,383 @@ else cd .. rm -rf conftest.dir else - am_cv_CXX_dependencies_compiler_type=none + am_cv_CC_dependencies_compiler_type=none fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -class a { int b; } c; + ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi else - CXX= + eval ac_cv_prog_cc_${ac_cc}_c_o=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$CXX" != ""; then - HAVE_CXX_TRUE= - HAVE_CXX_FALSE='#' -else - HAVE_CXX_TRUE='#' - HAVE_CXX_FALSE= +rm -f core conftest* + fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h +fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi +fi + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6645,12 +6769,13 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6658,26 +6783,28 @@ fi fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6685,19 +6812,20 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_CC" = x; then - CC="" + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6705,23 +6833,100 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CC=$ac_ct_CC + PKG_CONFIG=$ac_pt_PKG_CONFIG fi else - CC="$ac_cv_prog_CC" + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.16 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +if test "x$enable_debug" = "xyes"; then + if test x$cflags_set != xset ; then + case " $CFLAGS " in + *[\ \ ]-g[\ \ ]*) ;; + *) CFLAGS="$CFLAGS -g" ;; + esac + fi + + GLIB_DEBUG_FLAGS="-DG_ENABLE_DEBUG" +else + GLIB_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS" + + if test "x$enable_debug" = "xno"; then + GLIB_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" + fi +fi + +# Ensure MSVC-compatible struct packing convention is used when +# compiling for Win32 with gcc. +# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while +# gcc2 uses "-fnative-struct". +if test x"$glib_native_win32" = xyes; then + if test x"$GCC" = xyes; then + msnative_struct='' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get MSVC-compatible struct packing" >&5 +$as_echo_n "checking how to get MSVC-compatible struct packing... " >&6; } + if test -z "$ac_cv_prog_CC"; then + our_gcc="$CC" + else + our_gcc="$ac_cv_prog_CC" + fi + case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in + 2.) + if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then + msnative_struct='-fnative-struct' + fi + ;; + *) + if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then + msnative_struct='-mms-bitfields' + fi + ;; + esac + if test x"$msnative_struct" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no way" >&5 +$as_echo "no way" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: produced libraries might be incompatible with MSVC-compiled code" >&5 +$as_echo "$as_me: WARNING: produced libraries might be incompatible with MSVC-compiled code" >&2;} + else + CFLAGS="$CFLAGS $msnative_struct" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msnative_struct}" >&5 +$as_echo "${msnative_struct}" >&6; } + fi + fi +fi +GLIB_EXTRA_CFLAGS="${msnative_struct}" + + + + +# define a MAINT-like variable REBUILD which is set if Perl +# and awk are found, so autogenerated sources can be rebuilt +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6730,7 +6935,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" + ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6740,30 +6945,31 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 + test -n "$AWK" && break +done + +for ac_prog in perl5 perl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. else - ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do @@ -6771,11 +6977,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" + ac_cv_prog_PERL="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6783,44 +6985,31 @@ done done IFS=$as_save_IFS -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi fi fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + test -n "$PERL" && break +done + +# We would like indent, but don't require it. +# Extract the first word of "indent", so it can be a program name with args. +set dummy indent; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_INDENT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$INDENT"; then + ac_cv_prog_INDENT="$INDENT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6829,7 +7018,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + ac_cv_prog_INDENT="indent" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6839,41 +7028,48 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +INDENT=$ac_cv_prog_INDENT +if test -n "$INDENT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INDENT" >&5 +$as_echo "$INDENT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CC" && break - done +REBUILD=\# +if test "x$enable_rebuilds" = "xyes" && \ + test -n "$PERL" && \ + $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \ + test -n "$AWK" ; then + REBUILD= fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + + +# Need full path to Perl for glib-mkenums +# +if test "x$PERL" != x ; then + # Extract the first word of "$PERL", so it can be a program name with args. +set dummy $PERL; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_path_PERL_PATH+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $PERL_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL_PATH="$PERL_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" + ac_cv_path_PERL_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6881,2047 +7077,286 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +PERL_PATH=$ac_cv_path_PERL_PATH +if test -n "$PERL_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_PATH" >&5 +$as_echo "$PERL_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_CC" && break -done +fi +if test "x$PERL_PATH" = x ; then + PERL_PATH="/usr/bin/env perl" +fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi -fi +# Need suitable python path for greport -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.4" >&5 +$as_echo_n "checking whether $PYTHON version >= 2.4... " >&6; } + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '2.4'.split('.'))) + [0, 0, 0] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + as_fn_error $? "too old" "$LINENO" 5 +fi + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.4" >&5 +$as_echo_n "checking for a Python interpreter with version >= 2.4... " >&6; } +if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no + for am_cv_pathless_PYTHON in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do + test "$am_cv_pathless_PYTHON" = none && break + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '2.4'.split('.'))) + [0, 0, 0] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 + ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 +$as_echo "$am_cv_pathless_PYTHON" >&6; } + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. +set dummy $am_cv_pathless_PYTHON; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } else - GCC= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : + + + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + + + if test "$PYTHON" = :; then + PYTHON="/usr/bin/env python2.4" + else + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } +if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } + PYTHON_VERSION=$am_cv_python_version -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ + PYTHON_PREFIX='${prefix}' - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + PYTHON_EXEC_PREFIX='${exec_prefix}' -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } +if ${am_cv_python_platform+:} false; then : + $as_echo_n "(cached) " >&6 else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi + am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } + PYTHON_PLATFORM=$am_cv_python_platform + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } +if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc - -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - - - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - if ac_fn_c_try_compile "$LINENO"; then : - break -fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_largefile_CC=' -n32'; break -fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi -fi - - -# -# Find pkg-config -# -# Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test x$PKG_CONFIG = xno ; then - as_fn_error "*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/" "$LINENO" 5 -fi - -if $PKG_CONFIG --atleast-pkgconfig-version 0.16 ; then - : -else - as_fn_error "*** pkg-config too old; version 0.16 or better required." "$LINENO" 5 -fi - -if test "x$enable_debug" = "xyes"; then - if test x$cflags_set != xset ; then - case " $CFLAGS " in - *[\ \ ]-g[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -g" ;; - esac - fi - - GLIB_DEBUG_FLAGS="-DG_ENABLE_DEBUG" -else - GLIB_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS" - - if test "x$enable_debug" = "xno"; then - GLIB_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" - fi -fi - -if test "x$enable_visibility" = "xno"; then - GLIB_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DDISABLE_VISIBILITY" -fi - -# Ensure MSVC-compatible struct packing convention is used when -# compiling for Win32 with gcc. -# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while -# gcc2 uses "-fnative-struct". -if test x"$glib_native_win32" = xyes; then - if test x"$GCC" = xyes; then - msnative_struct='' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get MSVC-compatible struct packing" >&5 -$as_echo_n "checking how to get MSVC-compatible struct packing... " >&6; } - if test -z "$ac_cv_prog_CC"; then - our_gcc="$CC" - else - our_gcc="$ac_cv_prog_CC" - fi - case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in - 2.) - if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then - msnative_struct='-fnative-struct' - fi - ;; - *) - if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then - msnative_struct='-mms-bitfields' - fi - ;; - esac - if test x"$msnative_struct" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no way" >&5 -$as_echo "no way" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: produced libraries might be incompatible with MSVC-compiled code" >&5 -$as_echo "$as_me: WARNING: produced libraries might be incompatible with MSVC-compiled code" >&2;} - else - CFLAGS="$CFLAGS $msnative_struct" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msnative_struct}" >&5 -$as_echo "${msnative_struct}" >&6; } - fi - fi -fi -GLIB_EXTRA_CFLAGS="${msnative_struct}" - - - - -# define a MAINT-like variable REBUILD which is set if Perl -# and awk are found, so autogenerated sources can be rebuilt -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -for ac_prog in perl5 perl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PERL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PERL"; then - ac_cv_prog_PERL="$PERL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_PERL="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PERL=$ac_cv_prog_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PERL" && break -done - -# We would like indent, but don't require it. -# Extract the first word of "indent", so it can be a program name with args. -set dummy indent; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_INDENT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$INDENT"; then - ac_cv_prog_INDENT="$INDENT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_INDENT="indent" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -INDENT=$ac_cv_prog_INDENT -if test -n "$INDENT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INDENT" >&5 -$as_echo "$INDENT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -REBUILD=\# -if test "x$enable_rebuilds" = "xyes" && \ - test -n "$PERL" && \ - $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \ - test -n "$AWK" ; then - REBUILD= -fi - - -# Need full path to Perl for glib-mkenums -# -if test "x$PERL" != x ; then - # Extract the first word of "$PERL", so it can be a program name with args. -set dummy $PERL; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PERL_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $PERL_PATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL_PATH="$PERL_PATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERL_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PERL_PATH=$ac_cv_path_PERL_PATH -if test -n "$PERL_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_PATH" >&5 -$as_echo "$PERL_PATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test "x$PERL_PATH" = x ; then - PERL_PATH="/usr/bin/env perl" -fi - - -# Need suitable python path for greport - - - - - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.4" >&5 -$as_echo_n "checking whether $PYTHON version >= 2.4... " >&6; } - prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '2.4'.split('.'))) + [0, 0, 0] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] -sys.exit(sys.hexversion < minverhex)" - if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 - ($PYTHON -c "$prog") >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - as_fn_error "too old" "$LINENO" 5 -fi - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.4" >&5 -$as_echo_n "checking for a Python interpreter with version >= 2.4... " >&6; } -if test "${am_cv_pathless_PYTHON+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - for am_cv_pathless_PYTHON in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do - test "$am_cv_pathless_PYTHON" = none && break - prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '2.4'.split('.'))) + [0, 0, 0] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] -sys.exit(sys.hexversion < minverhex)" - if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 - ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then : - break -fi - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 -$as_echo "$am_cv_pathless_PYTHON" >&6; } - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. -set dummy $am_cv_pathless_PYTHON; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - - - if test "$PYTHON" = :; then - PYTHON="/usr/bin/env python2.4" - else - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 -$as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if test "${am_cv_python_version+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 -$as_echo "$am_cv_python_version" >&6; } - PYTHON_VERSION=$am_cv_python_version - - - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 -$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if test "${am_cv_python_platform+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 -$as_echo "$am_cv_python_platform" >&6; } - PYTHON_PLATFORM=$am_cv_python_platform - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if test "${am_cv_python_pythondir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; - esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 -$as_echo "$am_cv_python_pythondir" >&6; } - pythondir=$am_cv_python_pythondir - - - - pkgpythondir=\${pythondir}/$PACKAGE - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if test "${am_cv_python_pyexecdir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || - echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; - esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 -$as_echo "$am_cv_python_pyexecdir" >&6; } - pyexecdir=$am_cv_python_pyexecdir - - - - pkgpyexecdir=\${pyexecdir}/$PACKAGE - - - - fi - - - - - - -if test x"$glib_native_win32" = xyes; then - with_libiconv=native -else - -# Check whether --with-libiconv was given. -if test "${with_libiconv+set}" = set; then : - withval=$with_libiconv; -else - with_libiconv=maybe -fi - - - found_iconv=no - case $with_libiconv in - maybe) - # Check in the C library first - ac_fn_c_check_func "$LINENO" "iconv_open" "ac_cv_func_iconv_open" -if test "x$ac_cv_func_iconv_open" = x""yes; then : - with_libiconv=no; found_iconv=yes -fi - - # Check if we have GNU libiconv - if test $found_iconv = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 -$as_echo_n "checking for libiconv_open in -liconv... " >&6; } -if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libiconv_open (); -int -main () -{ -return libiconv_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_iconv_libiconv_open=yes -else - ac_cv_lib_iconv_libiconv_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } -if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then : - with_libiconv=gnu; found_iconv=yes -fi - - fi - # Check if we have a iconv in -liconv, possibly from vendor - if test $found_iconv = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 -$as_echo_n "checking for iconv_open in -liconv... " >&6; } -if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char iconv_open (); -int -main () -{ -return iconv_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_iconv_iconv_open=yes -else - ac_cv_lib_iconv_iconv_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } -if test "x$ac_cv_lib_iconv_iconv_open" = x""yes; then : - with_libiconv=native; found_iconv=yes -fi - - fi - ;; - no) - ac_fn_c_check_func "$LINENO" "iconv_open" "ac_cv_func_iconv_open" -if test "x$ac_cv_func_iconv_open" = x""yes; then : - with_libiconv=no; found_iconv=yes -fi - - ;; - gnu|yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 -$as_echo_n "checking for libiconv_open in -liconv... " >&6; } -if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libiconv_open (); -int -main () -{ -return libiconv_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_iconv_libiconv_open=yes -else - ac_cv_lib_iconv_libiconv_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } -if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then : - with_libiconv=gnu; found_iconv=yes -fi - - ;; - native) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 -$as_echo_n "checking for iconv_open in -liconv... " >&6; } -if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char iconv_open (); -int -main () -{ -return iconv_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_iconv_iconv_open=yes -else - ac_cv_lib_iconv_iconv_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } -if test "x$ac_cv_lib_iconv_iconv_open" = x""yes; then : - with_libiconv=native; found_iconv=yes -fi - - ;; - esac - - if test "x$found_iconv" = "xno" ; then - as_fn_error "*** No iconv() implementation found in C library or libiconv" "$LINENO" 5 - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 -$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } -if test "${ac_cv_gnu_library_2_1+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky GNU user" >/dev/null 2>&1; then : - ac_cv_gnu_library_2_1=yes -else - ac_cv_gnu_library_2_1=no -fi -rm -f conftest* - - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 -$as_echo "$ac_cv_gnu_library_2_1" >&6; } - - GLIBC21="$ac_cv_gnu_library_2_1" - - -# Check whether --enable-iconv-cache was given. -if test "${enable_iconv_cache+set}" = set; then : - enableval=$enable_iconv_cache; -else - enable_iconv_cache=auto -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to cache iconv descriptors" >&5 -$as_echo_n "checking Whether to cache iconv descriptors... " >&6; } -case $enable_iconv_cache in - auto) - if test $ac_cv_gnu_library_2_1 = yes; then - enable_iconv_cache=no - else - enable_iconv_cache=yes - fi - ;; - yes|no) - ;; - *) as_fn_error "Value given to --enable-iconv-cache must be one of yes, no or auto" "$LINENO" 5 - ;; -esac - -if test $enable_iconv_cache = yes; then - -$as_echo "#define NEED_ICONV_CACHE 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_iconv_cache" >&5 -$as_echo "$enable_iconv_cache" >&6; } - - -found_zlib=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } -if test "${ac_cv_lib_z_inflate+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (); -int -main () -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflate=yes -else - ac_cv_lib_z_inflate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = x""yes; then : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : - found_zlib=yes -fi - - -fi - - -if test "x$found_zlib" = "xno" ; then - as_fn_error "*** Working zlib library and headers not found ***" "$LINENO" 5 -fi -ZLIB_LIBS='-lz' - - -ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" -CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/po/LINGUAS' - - - for ac_header in locale.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" -if test "x$ac_cv_header_locale_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LOCALE_H 1 -_ACEOF - -fi - -done - - if test $ac_cv_header_locale_h = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 -$as_echo_n "checking for LC_MESSAGES... " >&6; } -if test "${am_cv_val_LC_MESSAGES+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return LC_MESSAGES - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_val_LC_MESSAGES=yes -else - am_cv_val_LC_MESSAGES=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 -$as_echo "$am_cv_val_LC_MESSAGES" >&6; } - if test $am_cv_val_LC_MESSAGES = yes; then - -$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + if test "x$prefix" = xNONE + then + am_py_prefix=$ac_default_prefix + else + am_py_prefix=$prefix + fi + am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) + am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac - fi - fi - USE_NLS=yes +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } + pythondir=$am_cv_python_pythondir - gt_cv_have_gettext=no - CATOBJEXT=NONE - XGETTEXT=: - INTLLIBS= + pkgpythondir=\${pythondir}/$PACKAGE - ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" -if test "x$ac_cv_header_libintl_h" = x""yes; then : - gt_cv_func_dgettext_libintl="no" - libintl_extra_libs="" - # - # First check in libc - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 -$as_echo_n "checking for ngettext in libc... " >&6; } -if test "${gt_cv_func_ngettext_libc+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } +if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include + if test "x$exec_prefix" = xNONE + then + am_py_exec_prefix=$am_py_prefix + else + am_py_exec_prefix=$exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || + echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) + am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac -int -main () -{ -return !ngettext ("","", 1) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gt_cv_func_ngettext_libc=yes -else - gt_cv_func_ngettext_libc=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } + pyexecdir=$am_cv_python_pyexecdir -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 -$as_echo "$gt_cv_func_ngettext_libc" >&6; } - if test "$gt_cv_func_ngettext_libc" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 -$as_echo_n "checking for dgettext in libc... " >&6; } -if test "${gt_cv_func_dgettext_libc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + pkgpyexecdir=\${pyexecdir}/$PACKAGE -int -main () -{ -return !dgettext ("","") - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gt_cv_func_dgettext_libc=yes -else - gt_cv_func_dgettext_libc=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 -$as_echo "$gt_cv_func_dgettext_libc" >&6; } - fi - if test "$gt_cv_func_ngettext_libc" = "yes" ; then - for ac_func in bind_textdomain_codeset -do : - ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" -if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BIND_TEXTDOMAIN_CODESET 1 -_ACEOF + fi -fi -done - fi - # - # If we don't have everything we want, check in libintl - # - if test "$gt_cv_func_dgettext_libc" != "yes" \ - || test "$gt_cv_func_ngettext_libc" != "yes" \ - || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 -$as_echo_n "checking for bindtextdomain in -lintl... " >&6; } -if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then : - $as_echo_n "(cached) " >&6 + + +if test x"$glib_native_win32" = xyes; then + with_libiconv=native else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char bindtextdomain (); -int -main () -{ -return bindtextdomain (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_bindtextdomain=yes +# Check whether --with-libiconv was given. +if test "${with_libiconv+set}" = set; then : + withval=$with_libiconv; else - ac_cv_lib_intl_bindtextdomain=no + with_libiconv=maybe fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + + found_iconv=no + case $with_libiconv in + maybe) + # Check in the C library first + ac_fn_c_check_func "$LINENO" "iconv_open" "ac_cv_func_iconv_open" +if test "x$ac_cv_func_iconv_open" = xyes; then : + with_libiconv=no; found_iconv=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 -$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } -if test "x$ac_cv_lib_intl_bindtextdomain" = x""yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 -$as_echo_n "checking for ngettext in -lintl... " >&6; } -if test "${ac_cv_lib_intl_ngettext+set}" = set; then : + + # Check if we have GNU libiconv + if test $found_iconv = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 +$as_echo_n "checking for libiconv_open in -liconv... " >&6; } +if ${ac_cv_lib_iconv_libiconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" +LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8931,34 +7366,40 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char ngettext (); +char libiconv_open (); int main () { -return ngettext (); +return libiconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_ngettext=yes + ac_cv_lib_iconv_libiconv_open=yes else - ac_cv_lib_intl_ngettext=no + ac_cv_lib_iconv_libiconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 -$as_echo "$ac_cv_lib_intl_ngettext" >&6; } -if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 -$as_echo_n "checking for dgettext in -lintl... " >&6; } -if test "${ac_cv_lib_intl_dgettext+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 +$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } +if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : + with_libiconv=gnu; found_iconv=yes +fi + + fi + # Check if we have a iconv in -liconv, possibly from vendor + if test $found_iconv = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 +$as_echo_n "checking for iconv_open in -liconv... " >&6; } +if ${ac_cv_lib_iconv_iconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" +LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8968,47 +7409,47 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dgettext (); +char iconv_open (); int main () { -return dgettext (); +return iconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_dgettext=yes + ac_cv_lib_iconv_iconv_open=yes else - ac_cv_lib_intl_dgettext=no + ac_cv_lib_iconv_iconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 -$as_echo "$ac_cv_lib_intl_dgettext" >&6; } -if test "x$ac_cv_lib_intl_dgettext" = x""yes; then : - gt_cv_func_dgettext_libintl=yes -fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 +$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } +if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then : + with_libiconv=native; found_iconv=yes fi + fi + ;; + no) + ac_fn_c_check_func "$LINENO" "iconv_open" "ac_cv_func_iconv_open" +if test "x$ac_cv_func_iconv_open" = xyes; then : + with_libiconv=no; found_iconv=yes fi - - if test "$gt_cv_func_dgettext_libintl" != "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 -$as_echo_n "checking if -liconv is needed to use gettext... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 -$as_echo_n "checking for ngettext in -lintl... " >&6; } -if test "${ac_cv_lib_intl_ngettext+set}" = set; then : + ;; + gnu|yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 +$as_echo_n "checking for libiconv_open in -liconv... " >&6; } +if ${ac_cv_lib_iconv_libiconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl -liconv $LIBS" +LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9018,34 +7459,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char ngettext (); +char libiconv_open (); int main () { -return ngettext (); +return libiconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_ngettext=yes + ac_cv_lib_iconv_libiconv_open=yes else - ac_cv_lib_intl_ngettext=no + ac_cv_lib_iconv_libiconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 -$as_echo "$ac_cv_lib_intl_ngettext" >&6; } -if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 -$as_echo_n "checking for dcgettext in -lintl... " >&6; } -if test "${ac_cv_lib_intl_dcgettext+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 +$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } +if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : + with_libiconv=gnu; found_iconv=yes +fi + + ;; + native) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 +$as_echo_n "checking for iconv_open in -liconv... " >&6; } +if ${ac_cv_lib_iconv_iconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl -liconv $LIBS" +LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9055,728 +7501,991 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dcgettext (); +char iconv_open (); int main () { -return dcgettext (); +return iconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_dcgettext=yes + ac_cv_lib_iconv_iconv_open=yes else - ac_cv_lib_intl_dcgettext=no + ac_cv_lib_iconv_iconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 -$as_echo "$ac_cv_lib_intl_dcgettext" >&6; } -if test "x$ac_cv_lib_intl_dcgettext" = x""yes; then : - gt_cv_func_dgettext_libintl=yes - libintl_extra_libs=-liconv -else - : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 +$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } +if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then : + with_libiconv=native; found_iconv=yes fi -else - : + ;; + esac + + if test "x$found_iconv" = "xno" ; then + as_fn_error $? "*** No iconv() implementation found in C library or libiconv" "$LINENO" 5 + fi fi - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - # - # If we found libintl, then check in it for bind_textdomain_codeset(); - # we'll prefer libc if neither have bind_textdomain_codeset(), - # and both have dgettext and ngettext - # - if test "$gt_cv_func_dgettext_libintl" = "yes" ; then - glib_save_LIBS="$LIBS" - LIBS="$LIBS -lintl $libintl_extra_libs" - unset ac_cv_func_bind_textdomain_codeset - for ac_func in bind_textdomain_codeset -do : - ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" -if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BIND_TEXTDOMAIN_CODESET 1 -_ACEOF + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi fi -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" - LIBS="$glib_save_LIBS" - if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then - gt_cv_func_dgettext_libc=no - else - if test "$gt_cv_func_dgettext_libc" = "yes" \ - && test "$gt_cv_func_ngettext_libc" = "yes"; then - gt_cv_func_dgettext_libintl=no - fi - fi - fi - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - if test "$gt_cv_func_dgettext_libc" = "yes" \ - || test "$gt_cv_func_dgettext_libintl" = "yes"; then - gt_cv_have_gettext=yes - fi + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi - if test "$gt_cv_func_dgettext_libintl" = "yes"; then - INTLLIBS="-lintl $libintl_extra_libs" - fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" - if test "$gt_cv_have_gettext" = "yes"; then -$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MSGFMT+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 +$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } +if ${ac_cv_gnu_library_2_1+:} false; then : $as_echo_n "(cached) " >&6 else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky GNU user" >/dev/null 2>&1; then : + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no fi -MSGFMT="$ac_cv_path_MSGFMT" -if test "$MSGFMT" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -$as_echo "$MSGFMT" >&6; } +rm -f conftest* + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + +# Check whether --enable-iconv-cache was given. +if test "${enable_iconv_cache+set}" = set; then : + enableval=$enable_iconv_cache; else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + enable_iconv_cache=auto fi - if test "$MSGFMT" != "no"; then - glib_save_LIBS="$LIBS" - LIBS="$LIBS $INTLLIBS" - for ac_func in dcgettext -do : - ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" -if test "x$ac_cv_func_dcgettext" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DCGETTEXT 1 -_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to cache iconv descriptors" >&5 +$as_echo_n "checking Whether to cache iconv descriptors... " >&6; } +case $enable_iconv_cache in + auto) + if test $ac_cv_gnu_library_2_1 = yes; then + enable_iconv_cache=no + else + enable_iconv_cache=yes + fi + ;; + yes|no) + ;; + *) as_fn_error $? "Value given to --enable-iconv-cache must be one of yes, no or auto" "$LINENO" 5 + ;; +esac + +if test $enable_iconv_cache = yes; then + +$as_echo "#define NEED_ICONV_CACHE 1" >>confdefs.h fi -done - MSGFMT_OPTS= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 -$as_echo_n "checking if msgfmt accepts -c... " >&6; } - cat >conftest.foo <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_iconv_cache" >&5 +$as_echo "$enable_iconv_cache" >&6; } -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: test 1.0\n" -"PO-Revision-Date: 2007-02-15 12:01+0100\n" -"Last-Translator: test \n" -"Language-Team: C \n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" -_ACEOF -if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 - ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB" >&5 +$as_echo_n "checking for ZLIB... " >&6; } + +if test -n "$ZLIB_CFLAGS"; then + pkg_cv_ZLIB_CFLAGS="$ZLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5 + ($PKG_CONFIG --exists --print-errors "zlib") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -echo "$as_me: failed input was:" >&5 -sed 's/^/| /' conftest.foo >&5 -fi - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GMSGFMT+set}" = set; then : - $as_echo_n "(cached) " >&6 + pkg_cv_ZLIB_CFLAGS=`$PKG_CONFIG --cflags "zlib" 2>/dev/null` else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac + pkg_failed=yes fi -GMSGFMT=$ac_cv_path_GMSGFMT -if test -n "$GMSGFMT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 -$as_echo "$GMSGFMT" >&6; } + else + pkg_failed=untried +fi +if test -n "$ZLIB_LIBS"; then + pkg_cv_ZLIB_LIBS="$ZLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5 + ($PKG_CONFIG --exists --print-errors "zlib") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ZLIB_LIBS=`$PKG_CONFIG --libs "zlib" 2>/dev/null` else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + pkg_failed=yes +fi + else + pkg_failed=untried fi - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XGETTEXT+set}" = set; then : - $as_echo_n "(cached) " >&6 + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac + _pkg_short_errors_supported=no fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test "$XGETTEXT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 -$as_echo "$XGETTEXT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + if test $_pkg_short_errors_supported = yes; then + ZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "zlib" 2>&1` + else + ZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "zlib" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ZLIB_PKG_ERRORS" >&5 + + found_zlib=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + found_zlib=no +else + ZLIB_CFLAGS=$pkg_cv_ZLIB_CFLAGS + ZLIB_LIBS=$pkg_cv_ZLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + found_zlib=yes fi - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "x$found_zlib" = "xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include +#include +#include int main () { -extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - CATOBJEXT=.gmo - DATADIRNAME=share -else - case $host in - *-*-solaris*) - ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" -if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : - CATOBJEXT=.gmo - DATADIRNAME=share +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else - CATOBJEXT=.mo - DATADIRNAME=lib -fi - - ;; - *) - CATOBJEXT=.mo - DATADIRNAME=lib - ;; - esac -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$glib_save_LIBS" - INSTOBJEXT=.mo - else - gt_cv_have_gettext=no - fi - fi - + ac_cv_header_stdc=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : - if test "$gt_cv_have_gettext" = "yes" ; then +else + ac_cv_header_stdc=no +fi +rm -f conftest* -$as_echo "#define ENABLE_NLS 1" >>confdefs.h +fi - fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 -$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } - XGETTEXT=":" - fi - fi +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : - # We need to process the po/ directory. - POSUB=po +else + ac_cv_header_stdc=no +fi +rm -f conftest* - ac_config_commands="$ac_config_commands default-1" +fi +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then +$as_echo "#define STDC_HEADERS 1" >>confdefs.h +fi +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi +done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 +$as_echo_n "checking for inflate in -lz... " >&6; } +if ${ac_cv_lib_z_inflate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inflate (); +int +main () +{ +return inflate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_inflate=yes +else + ac_cv_lib_z_inflate=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 +$as_echo "$ac_cv_lib_z_inflate" >&6; } +if test "x$ac_cv_lib_z_inflate" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + found_zlib=yes +fi +fi - if test "$gt_cv_have_gettext" = "yes"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 -$as_echo_n "checking for catalogs to be installed... " >&6; } - NEW_LINGUAS= - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - NEW_LINGUAS="$NEW_LINGUAS $presentlang" - fi - done - LINGUAS=$NEW_LINGUAS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 -$as_echo "$LINGUAS" >&6; } - fi + if test "x$found_zlib" = "xno" ; then + as_fn_error $? "*** Working zlib library and headers not found ***" "$LINENO" 5 + fi + ZLIB_LIBS='-lz' - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi +fi - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi +ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" +CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/po/LINGUAS' - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES + for ac_header in locale.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 +_ACEOF -if test "$gt_cv_have_gettext" != "yes" ; then - as_fn_error " -*** You must have either have gettext support in your C library, or use the -*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html -" "$LINENO" 5 fi -LIBS="$INTLLIBS $LIBS" - -GETTEXT_PACKAGE=glib20 - +done -cat >>confdefs.h <<_ACEOF -#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" + if test $ac_cv_header_locale_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if ${am_cv_val_LC_MESSAGES+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} _ACEOF - - -glib_save_prefix="$prefix" -glib_save_exec_prefix="$exec_prefix" -glib_save_datarootdir="$datarootdir" -test "x$prefix" = xNONE && prefix=$ac_default_prefix -test "x$exec_prefix" = xNONE && exec_prefix=$prefix -datarootdir=`eval echo "${datarootdir}"` -if test "x$CATOBJEXT" = "x.mo" ; then - localedir=`eval echo "${libdir}/locale"` +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes else - localedir=`eval echo "${datadir}/locale"` + am_cv_val_LC_MESSAGES=no fi -prefix="$glib_save_prefix" -exec_prefix="$glib_save_exec_prefix" -datarootdir="$glib_save_datarootdir" - -cat >>confdefs.h <<_ACEOF -#define GLIB_LOCALE_DIR "$localedir" -_ACEOF - - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h -if test x"$glib_native_win32" != xyes; then - if test x$with_libiconv != xno ; then - case " $INTLLIBS " in - *[\ \ ]-liconv[\ \ ]*) ;; - *) ICONV_LIBS="-liconv" ;; - esac + fi fi -fi + USE_NLS=yes -case $with_libiconv in - gnu) + gt_cv_have_gettext=no -$as_echo "#define USE_LIBICONV_GNU 1" >>confdefs.h + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= - ;; - native) + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes; then : + gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" -$as_echo "#define USE_LIBICONV_NATIVE 1" >>confdefs.h + # + # First check in libc + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 +$as_echo_n "checking for ngettext in libc... " >&6; } +if ${gt_cv_func_ngettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ;; -esac +#include -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +int +main () +{ +return !ngettext ("","", 1) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_ngettext_libc=yes else - enable_static=no + gt_cv_func_ngettext_libc=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 +$as_echo "$gt_cv_func_ngettext_libc" >&6; } + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 +$as_echo_n "checking for dgettext in libc... " >&6; } +if ${gt_cv_func_dgettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return !dgettext ("","") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_dgettext_libc=yes +else + gt_cv_func_dgettext_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 +$as_echo "$gt_cv_func_dgettext_libc" >&6; } + fi + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF +fi +done + fi -enable_win32_dll=yes + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 +$as_echo_n "checking for bindtextdomain in -lintl... " >&6; } +if ${ac_cv_lib_intl_bindtextdomain+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bindtextdomain (); +int +main () +{ +return bindtextdomain (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_bindtextdomain=yes else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ac_cv_lib_intl_bindtextdomain=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 +$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } +if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_ngettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngettext (); +int +main () +{ +return ngettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes +else + ac_cv_lib_intl_ngettext=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 +$as_echo_n "checking for dgettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_dgettext+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dgettext (); +int +main () +{ +return dgettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dgettext=yes +else + ac_cv_lib_intl_dgettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 +$as_echo "$ac_cv_lib_intl_dgettext" >&6; } +if test "x$ac_cv_lib_intl_dgettext" = xyes; then : + gt_cv_func_dgettext_libintl=yes fi +fi fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 +$as_echo_n "checking if -liconv is needed to use gettext... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngettext (); +int +main () +{ +return ngettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ac_cv_lib_intl_ngettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 +$as_echo_n "checking for dcgettext in -lintl... " >&6; } +if ${ac_cv_lib_intl_dcgettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dcgettext (); +int +main () +{ +return dcgettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dcgettext=yes +else + ac_cv_lib_intl_dcgettext=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 +$as_echo "$ac_cv_lib_intl_dcgettext" >&6; } +if test "x$ac_cv_lib_intl_dcgettext" = xyes; then : + gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + : fi - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi else - AS="$ac_cv_prog_AS" + : fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +done + LIBS="$glib_save_LIBS" -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : +if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi done -IFS=$as_save_IFS - -fi + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" + ;; +esac fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + for ac_func in dcgettext +do : + ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" +if test "x$ac_cv_func_dcgettext" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi done - done -IFS=$as_save_IFS -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + MSGFMT_OPTS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 +$as_echo_n "checking if msgfmt accepts -c... " >&6; } + cat >conftest.foo <<_ACEOF +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +_ACEOF +if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 + ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +echo "$as_me: failed input was:" >&5 +sed 's/^/| /' conftest.foo >&5 fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -9784,48 +8493,283 @@ done done IFS=$as_save_IFS + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; esac - OBJDUMP=$ac_ct_OBJDUMP +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + CATOBJEXT=.mo + DATADIRNAME=lib +fi + + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + +fi + + + + if test "$gt_cv_have_gettext" = "yes" ; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + ac_config_commands="$ac_config_commands default-1" + + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 +$as_echo_n "checking for catalogs to be installed... " >&6; } + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 +$as_echo "$LINGUAS" >&6; } + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + + +if test "$gt_cv_have_gettext" != "yes" ; then + as_fn_error $? " +*** You must have either have gettext support in your C library, or use the +*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html +" "$LINENO" 5 +fi + +LIBS="$INTLLIBS $LIBS" + +GETTEXT_PACKAGE=glib20 + + +cat >>confdefs.h <<_ACEOF +#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" +_ACEOF + + +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" + +cat >>confdefs.h <<_ACEOF +#define GLIB_LOCALE_DIR "$localedir" +_ACEOF + + + + +if test x"$glib_native_win32" != xyes; then + if test x$with_libiconv != xno ; then + case " $INTLLIBS " in + *[\ \ ]-liconv[\ \ ]*) ;; + *) ICONV_LIBS="-liconv" ;; + esac fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" fi - ;; + +case $with_libiconv in + gnu) + +$as_echo "#define USE_LIBICONV_GNU 1" >>confdefs.h + + ;; + native) + +$as_echo "#define USE_LIBICONV_NATIVE 1" >>confdefs.h + + ;; esac -test -z "$AS" && AS=as +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac +macro_version='2.4' +macro_revision='1.3293' -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$OBJDUMP" && OBJDUMP=objdump @@ -9833,16 +8777,63 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' -macro_version='2.2.6b' -macro_revision='1.3017' +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac @@ -9856,11 +8847,10 @@ macro_revision='1.3017' -ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -9915,7 +8905,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -9942,7 +8932,7 @@ Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -9994,7 +8984,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -10073,7 +9063,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -10110,10 +9100,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -10140,7 +9130,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then : +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -10193,14 +9183,17 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -10238,13 +9231,13 @@ fi fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -10293,6 +9286,15 @@ esac fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -10307,18 +9309,18 @@ test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then : +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:10315: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:10318: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:10321: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -10342,7 +9344,7 @@ fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then : +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 @@ -10375,6 +9377,11 @@ else lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -10439,8 +9446,8 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -10482,8 +9489,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -10532,9 +9539,83 @@ esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then : +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -10548,6 +9629,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -10570,7 +9656,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -10610,7 +9696,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -10666,7 +9752,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then : +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -10708,16 +9794,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -10747,6 +9835,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -10755,11 +9847,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -10781,7 +9873,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -10848,28 +9940,191 @@ sysv4 | sysv4.3*) siemens) lt_cv_deplibs_check_method=pass_all ;; - pc) - lt_cv_deplibs_check_method=pass_all + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -10878,11 +10133,13 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -10895,7 +10152,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10915,14 +10172,18 @@ $as_echo "no" >&6; } fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_AR"; then +if test -z "$AR"; then ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -10935,7 +10196,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10954,6 +10215,10 @@ else $as_echo "no" >&6; } fi + + test -n "$ac_ct_AR" && break +done + if test "x$ac_ct_AR" = x; then AR="false" else @@ -10965,12 +10230,12 @@ ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi -else - AR="$ac_cv_prog_AR" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +: ${AR=ar} +: ${AR_FLAGS=cru} + + @@ -10980,6 +10245,62 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + if test -n "$ac_tool_prefix"; then @@ -10987,7 +10308,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -11027,7 +10348,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -11086,7 +10407,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -11126,7 +10447,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -11197,6 +10518,18 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + @@ -11243,7 +10576,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else @@ -11304,8 +10637,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -11341,6 +10674,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -11366,8 +10700,8 @@ _LT_EOF test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -11382,6 +10716,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -11393,7 +10739,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -11419,8 +10765,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -11430,8 +10776,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -11468,6 +10814,27 @@ else $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + @@ -11480,10 +10847,38 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } @@ -11520,7 +10915,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 11523 "configure"' > conftest.$ac_ext + echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -11614,7 +11009,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : +if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -11682,19 +11077,16 @@ esac need_locks="$enable_libtool_lock" - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11703,7 +11095,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11713,10 +11105,10 @@ IFS=$as_save_IFS fi fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -11724,17 +11116,17 @@ fi fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11743,7 +11135,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11753,17 +11145,17 @@ IFS=$as_save_IFS fi fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -11771,114 +11163,50 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DSYMUTIL=$ac_ct_DSYMUTIL + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then : +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes fi -done - done -IFS=$as_save_IFS - -fi + rm -f conftest* fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: fi -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi + + case $host_os in + rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then : +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11887,7 +11215,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11897,10 +11225,10 @@ IFS=$as_save_IFS fi fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -11908,17 +11236,17 @@ fi fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11927,7 +11255,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11937,17 +11265,17 @@ IFS=$as_save_IFS fi fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_LIPO" = x; then - LIPO=":" + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -11955,22 +11283,22 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - LIPO=$ac_ct_LIPO + DSYMUTIL=$ac_ct_DSYMUTIL fi else - LIPO="$ac_cv_prog_LIPO" + DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then : +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11979,7 +11307,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11989,10 +11317,10 @@ IFS=$as_save_IFS fi fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -12000,17 +11328,17 @@ fi fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12019,7 +11347,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" + ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12029,17 +11357,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -12047,22 +11375,22 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OTOOL=$ac_ct_OTOOL + NMEDIT=$ac_ct_NMEDIT fi else - OTOOL="$ac_cv_prog_OTOOL" + NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12071,7 +11399,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12081,10 +11409,10 @@ IFS=$as_save_IFS fi fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -12092,17 +11420,17 @@ fi fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12111,7 +11439,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" + ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12121,17 +11449,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" + if test "x$ac_ct_LIPO" = x; then + LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -12139,170 +11467,114 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OTOOL64=$ac_ct_OTOOL64 + LIPO=$ac_ct_LIPO fi else - OTOOL64="$ac_cv_prog_OTOOL64" + LIPO="$ac_cv_prog_LIPO" fi - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF fi - +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12311,7 +11583,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12321,32 +11593,28 @@ IFS=$as_save_IFS fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CXX" && break - done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12355,7 +11623,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" + ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12365,21 +11633,17 @@ IFS=$as_save_IFS fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -12387,115 +11651,77 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CXX=$ac_ct_CXX + OTOOL64=$ac_ct_OTOOL64 fi +else + OTOOL64="$ac_cv_prog_OTOOL64" fi - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12506,309 +11732,442 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi + +done + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi + enable_static=no fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + + + + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac +done + done +IFS=$as_save_IFS - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done +IFS=$as_save_IFS - cd .. - rm -rf conftest.dir +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } else - am_cv_CXX_dependencies_compiler_type=none + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else - # Broken: fails on valid input. -continue + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi else - # Passes both tests. -ac_preproc_ok=: -break + DLLTOOL="$ac_cv_prog_DLLTOOL" fi -rm -f conftest.err conftest.$ac_ext + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - done - ac_cv_prog_CXXCPP=$CXXCPP fi - CXXCPP=$ac_cv_prog_CXXCPP +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } else - # Broken: fails on valid input. -continue + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi else - # Passes both tests. -ac_preproc_ok=: -break + OBJDUMP="$ac_cv_prog_OBJDUMP" fi -rm -f conftest.err conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : + ;; +esac + +test -z "$AS" && AS=as -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -_lt_caught_CXX_error=yes; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -else - _lt_caught_CXX_error=yes -fi + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump -# Set options @@ -12928,6 +12287,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + test -z "$LN_S" && LN_S="ln -s" @@ -12949,7 +12309,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -12977,19 +12337,6 @@ _ACEOF - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -13002,23 +12349,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -13047,7 +12377,7 @@ for cc_temp in $compiler""; do *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -13057,7 +12387,7 @@ file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -13123,7 +12453,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -13252,11 +12582,16 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -13272,15 +12607,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13275: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13279: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -13309,8 +12644,6 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -13358,6 +12691,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -13400,6 +12739,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -13441,7 +12787,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -13462,7 +12808,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -13474,25 +12826,25 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_wl='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' + lt_prog_compiler_wl='-Wl,' ;; esac ;; @@ -13524,7 +12876,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -13581,13 +12933,17 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -13595,7 +12951,7 @@ $as_echo "$lt_prog_compiler_pic" >&6; } if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -13611,15 +12967,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13614: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13618: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -13648,13 +13004,18 @@ fi + + + + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -13667,7 +13028,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -13697,7 +13058,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -13716,16 +13077,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13719: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13723: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -13752,7 +13113,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -13771,16 +13132,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13774: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13778: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -13893,7 +13254,33 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -13911,6 +13298,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -13926,11 +13314,12 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -13966,10 +13355,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -13987,6 +13378,11 @@ _LT_EOF fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -14002,7 +13398,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -14012,15 +13408,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -14031,13 +13428,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -14053,17 +13454,17 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -14077,8 +13478,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -14096,8 +13497,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -14143,8 +13544,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -14184,8 +13585,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -14272,7 +13675,13 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14285,25 +13694,32 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -14312,7 +13728,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14325,30 +13747,42 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -14380,20 +13814,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -14403,7 +13880,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -14411,7 +13892,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -14454,7 +13935,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -14462,7 +13943,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -14477,8 +13958,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -14496,16 +13977,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -14517,7 +13998,46 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -14545,26 +14065,39 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo(void) {} +int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -14626,17 +14159,17 @@ rm -f core conftest.err conftest.$ac_objext \ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -14646,13 +14179,13 @@ rm -f core conftest.err conftest.$ac_objext \ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -14665,9 +14198,9 @@ rm -f core conftest.err conftest.$ac_objext \ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -14855,44 +14388,50 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -15063,16 +14602,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -15085,7 +14631,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -15105,7 +14651,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -15193,7 +14745,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -15224,8 +14776,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -15246,36 +14799,83 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -15362,6 +14962,19 @@ gnu*) hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -15404,8 +15017,10 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) @@ -15463,7 +15078,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -15472,12 +15087,17 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15490,13 +15110,17 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -15508,8 +15132,9 @@ rm -f core conftest.err conftest.$ac_objext \ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15811,6 +15436,11 @@ fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= @@ -15883,7 +15513,7 @@ else # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15917,7 +15547,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -15931,12 +15561,12 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : +if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15970,16 +15600,16 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : +if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16013,12 +15643,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then : +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16052,12 +15682,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then : +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16091,7 +15721,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -16132,7 +15762,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : +if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -16141,7 +15771,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 16144 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16182,7 +15812,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -16191,7 +15827,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -16228,7 +15868,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; } wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : +if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -16237,7 +15877,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 16240 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16278,7 +15918,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -16287,7 +15933,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -16444,6 +16094,145 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -16470,6 +16259,8 @@ module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -16525,6 +16316,7 @@ $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -16542,6 +16334,7 @@ $RM -r conftest* fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -16552,7 +16345,7 @@ $RM -r conftest* *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then @@ -16615,7 +16408,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -16652,10 +16445,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -16681,8 +16474,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -16714,7 +16507,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -16824,7 +16617,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -16837,26 +16636,33 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -16865,7 +16671,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -16878,30 +16690,42 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -16931,28 +16755,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; darwin* | rhapsody*) @@ -16960,7 +16831,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec_CXX='' + fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -16968,7 +16843,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -17021,6 +16896,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi gnu*) ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -17045,11 +16925,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -17110,7 +16990,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -17120,10 +17000,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -17153,7 +17033,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -17164,9 +17044,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -17177,7 +17057,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -17195,7 +17075,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -17232,26 +17112,26 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5]* | *pgcpp\ [1-5]*) + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -17259,7 +17139,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -17278,9 +17158,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -17300,13 +17180,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -17375,7 +17255,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi @@ -17410,15 +17290,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -17434,17 +17314,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -17454,7 +17334,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -17490,7 +17370,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -17511,7 +17391,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -17531,14 +17411,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -17549,7 +17429,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -17603,6 +17483,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -17664,6 +17548,13 @@ private: }; _LT_EOF + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -17677,7 +17568,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -17686,13 +17577,22 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -17712,8 +17612,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -17749,6 +17651,7 @@ else fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -17784,7 +17687,7 @@ linux*) solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -17849,9 +17752,7 @@ fi lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } - + # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' @@ -17900,6 +17801,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -17949,6 +17855,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; dgux*) case $cc_basename in ec++*) @@ -18005,7 +17916,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -18038,8 +17949,8 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -18101,7 +18012,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -18166,10 +18077,17 @@ case $host_os in lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_prog_compiler_pic_CXX" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -18177,7 +18095,7 @@ $as_echo "$lt_prog_compiler_pic_CXX" >&6; } if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no @@ -18193,15 +18111,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18196: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18200: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -18227,13 +18145,15 @@ fi + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no @@ -18246,7 +18166,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -18273,7 +18193,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -18292,16 +18212,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18295: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18299: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -18325,7 +18245,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -18344,16 +18264,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18347: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18351: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -18404,27 +18324,35 @@ fi $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -18456,44 +18384,50 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 -$as_echo "$archive_cmds_need_lc_CXX" >&6; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi @@ -18650,7 +18584,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -18681,8 +18615,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -18703,36 +18638,82 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -18818,6 +18799,19 @@ gnu*) hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -18860,8 +18854,10 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) @@ -18919,7 +18915,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -18928,12 +18924,17 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -18946,13 +18947,17 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -18964,8 +18969,9 @@ rm -f core conftest.err conftest.$ac_objext \ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -19216,6 +19222,8 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= @@ -19263,6 +19271,7 @@ fi fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -19302,16 +19311,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu : ${CONFIG_LT=./config.lt} { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 $as_echo "$as_me: creating $CONFIG_LT" >&6;} -cat >"$CONFIG_LT" <<_LTEOF +as_write_fail=0 +cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF +export SHELL +_ASEOF +cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -19391,6 +19399,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -19436,20 +19445,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -19645,7 +19653,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" "$LINENO" 5 + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -19686,8 +19694,15 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - exec 6>&1 +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x "$CONFIG_LT" + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false exec 5>>config.log { echo @@ -19711,10 +19726,10 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -glib config.lt 2.24.2 -configured by $0, generated by GNU Autoconf 2.65. +glib config.lt 2.27.5 +configured by $0, generated by GNU Autoconf 2.68. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -19730,10 +19745,10 @@ do --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; - -*) as_fn_error "unrecognized option: $1 + -*) as_fn_error $? "unrecognized option: $1 Try \`$0 --help' for more information." "$LINENO" 5 ;; - *) as_fn_error "unrecognized argument: $1 + *) as_fn_error $? "unrecognized argument: $1 Try \`$0 --help' for more information." "$LINENO" 5 ;; esac shift @@ -19754,186 +19769,212 @@ cat >>"$CONFIG_LT" <<_LTEOF sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' -predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' -postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ GREP \ EGREP \ FGREP \ @@ -19945,8 +19986,12 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -19956,14 +20001,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -19979,7 +20024,6 @@ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -19987,6 +20031,7 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -19997,10 +20042,11 @@ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ +reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -20012,7 +20058,6 @@ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ -fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -20022,9 +20067,9 @@ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -20046,11 +20091,13 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -20059,10 +20106,11 @@ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -20070,12 +20118,6 @@ prelink_cmds_CXX; do esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -20123,7 +20165,8 @@ $as_echo "$as_me: creating $ofile" >&6;} # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -20155,21 +20198,21 @@ available_tags="CXX " # ### BEGIN LIBTOOL CONFIG +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. -AS=$AS +AS=$lt_AS # DLL creation program. -DLLTOOL=$DLLTOOL +DLLTOOL=$lt_DLLTOOL # Object dumper program. -OBJDUMP=$OBJDUMP - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision +OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared @@ -20180,6 +20223,12 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + # The host system. host_alias=$host_alias host=$host @@ -20229,20 +20278,36 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -20251,6 +20316,9 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -20269,14 +20337,14 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name of the directory that contains temporary libtool files. -objdir=$objdir +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO +# The name of the directory that contains temporary libtool files. +objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -20284,6 +20352,9 @@ MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -20340,6 +20411,9 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -20379,6 +20453,10 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -20391,12 +20469,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -20483,9 +20561,6 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -20501,6 +20576,9 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -20525,234 +20603,191 @@ compiler_lib_search_path=$lt_compiler_lib_search_path _LT_EOF - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi _LT_EOF ;; esac - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) +ltmain="$ac_aux_dir/ltmain.sh" + - mv -f "$cfgfile" "$ofile" || + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -20764,6 +20799,10 @@ _LT_EOF # The linker used to build libraries. LD=$lt_LD_CXX +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -20776,12 +20815,12 @@ with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -20868,9 +20907,6 @@ inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path_CXX - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -20886,6 +20922,9 @@ include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX @@ -20918,15 +20957,13 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec 5>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec 5>>config.log - $lt_cl_success || as_fn_exit 1 -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec 5>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec 5>>config.log +$lt_cl_success || as_fn_exit 1 @@ -20941,7 +20978,7 @@ CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES" if test "$glib_native_win32" = "yes"; then if test x$enable_static = xyes -a x$enable_shared = xyes; then - as_fn_error "Can not build both shared and static at the same time on Windows." "$LINENO" 5 + as_fn_error $? "Can not build both shared and static at the same time on Windows." "$LINENO" 5 fi if test x$enable_static = xyes; then glib_win32_static_compilation=yes @@ -20967,8 +21004,8 @@ $as_echo_n "checking for extra flags to get ANSI library prototypes... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20984,8 +21021,8 @@ else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21063,7 +21100,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21178,13 +21215,13 @@ fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = x""yes; then : +if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = x""yes; then : +if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h @@ -21194,11 +21231,22 @@ fi done +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then : +if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21231,7 +21279,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then : +if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21250,7 +21298,7 @@ else #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); +void *alloca (size_t); # endif # endif # endif @@ -21294,7 +21342,7 @@ $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if test "${ac_cv_os_cray+set}" = set; then : +if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21321,8 +21369,7 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -21336,7 +21383,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then : +if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -21388,8 +21435,7 @@ for ac_func in mmap posix_memalign memalign valloc fsync pipe2 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -21401,8 +21447,7 @@ for ac_func in atexit on_exit timegm gmtime_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -21417,7 +21462,7 @@ done # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } -if test "${ac_cv_sizeof_char+set}" = set; then : +if ${ac_cv_sizeof_char+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : @@ -21426,9 +21471,8 @@ else if test "$ac_cv_type_char" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (char) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_char=0 fi @@ -21451,7 +21495,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } -if test "${ac_cv_sizeof_short+set}" = set; then : +if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : @@ -21460,9 +21504,8 @@ else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (short) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi @@ -21485,7 +21528,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : +if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : @@ -21494,9 +21537,8 @@ else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi @@ -21519,7 +21561,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -21528,9 +21570,8 @@ else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi @@ -21553,7 +21594,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } -if test "${ac_cv_sizeof_void_p+set}" = set; then : +if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : @@ -21562,9 +21603,8 @@ else if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (void *) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi @@ -21587,7 +21627,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } -if test "${ac_cv_sizeof_long_long+set}" = set; then : +if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : @@ -21596,9 +21636,8 @@ else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long long) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 fi @@ -21621,7 +21660,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 $as_echo_n "checking size of __int64... " >&6; } -if test "${ac_cv_sizeof___int64+set}" = set; then : +if ${ac_cv_sizeof___int64+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : @@ -21630,9 +21669,8 @@ else if test "$ac_cv_type___int64" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (__int64) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (__int64) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof___int64=0 fi @@ -21653,7 +21691,7 @@ _ACEOF if test x$ac_cv_sizeof_long = x8 || test x$ac_cv_sizeof_long_long = x8 || test x$ac_cv_sizeof___int64 = x8 ; then : else - as_fn_error " + as_fn_error $? " *** GLib requires a 64 bit type. You might want to consider *** using the GNU C compiler. " "$LINENO" 5 @@ -21663,7 +21701,7 @@ if test x$glib_native_win32 != xyes && test x$ac_cv_sizeof_long_long = x8; then # long long is a 64 bit integer. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for format to printf and scanf a guint64" >&5 $as_echo_n "checking for format to printf and scanf a guint64... " >&6; } - if test "${glib_cv_long_long_format+set}" = set; then : + if ${glib_cv_long_long_format+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21728,7 +21766,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21847,15 +21885,15 @@ CFLAGS=$glib_save_CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for growing stack pointer" >&5 $as_echo_n "checking for growing stack pointer... " >&6; } -if test "${glib_cv_stack_grows+set}" = set; then : +if ${glib_cv_stack_grows+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21884,7 +21922,7 @@ $as_echo "$glib_cv_stack_grows" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __inline" >&5 $as_echo_n "checking for __inline... " >&6; } -if test "${glib_cv_has__inline+set}" = set; then : +if ${glib_cv_has__inline+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21914,7 +21952,7 @@ $as_echo "#define G_HAVE___INLINE 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __inline__" >&5 $as_echo_n "checking for __inline__... " >&6; } -if test "${glib_cv_has__inline__+set}" = set; then : +if ${glib_cv_has__inline__+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21944,7 +21982,7 @@ $as_echo "#define G_HAVE___INLINE__ 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${glib_cv_hasinline+set}" = set; then : +if ${glib_cv_hasinline+:} false; then : $as_echo_n "(cached) " >&6 else @@ -22016,7 +22054,7 @@ $as_echo "$g_can_inline" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working do while(0) macros" >&5 $as_echo_n "checking for working do while(0) macros... " >&6; } -if test "${g_cv_support_dowhile_macros+set}" = set; then : +if ${g_cv_support_dowhile_macros+:} false; then : $as_echo_n "(cached) " >&6 else @@ -22257,7 +22295,7 @@ fi # check for bytesex stuff { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown @@ -22475,7 +22513,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) - as_fn_error "unknown endianness + as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac @@ -22530,8 +22568,7 @@ for ac_header in dirent.h float.h limits.h pwd.h grp.h sys/param.h sys/poll.h sy do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -22544,8 +22581,7 @@ for ac_header in sys/time.h sys/times.h sys/wait.h unistd.h values.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -22558,8 +22594,7 @@ for ac_header in sys/select.h sys/types.h stdint.h inttypes.h sched.h malloc.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -22572,8 +22607,7 @@ for ac_header in sys/vfs.h sys/mount.h sys/vmount.h sys/statfs.h sys/statvfs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -22586,8 +22620,7 @@ for ac_header in mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h sys/sysctl.h fs do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -22599,7 +22632,7 @@ done for ac_header in sys/uio.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_uio_h" = x""yes; then : +if test "x$ac_cv_header_sys_uio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_UIO_H 1 _ACEOF @@ -22611,7 +22644,7 @@ done # check for structure fields ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimensec" "ac_cv_member_struct_stat_st_mtimensec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_mtimensec" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_MTIMENSEC 1 @@ -22620,7 +22653,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim.tv_nsec" "ac_cv_member_struct_stat_st_mtim_tv_nsec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_mtim_tv_nsec" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_mtim_tv_nsec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 @@ -22629,7 +22662,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_atimensec" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 @@ -22638,7 +22671,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 @@ -22647,7 +22680,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimensec" "ac_cv_member_struct_stat_st_ctimensec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_ctimensec" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_ctimensec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_CTIMENSEC 1 @@ -22656,7 +22689,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim.tv_nsec" "ac_cv_member_struct_stat_st_ctim_tv_nsec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_ctim_tv_nsec" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_ctim_tv_nsec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1 @@ -22678,7 +22711,7 @@ ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_s #include #endif " -if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -22699,7 +22732,7 @@ ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_st #include #endif " -if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -22720,7 +22753,7 @@ ac_fn_c_check_member "$LINENO" "struct statfs" "f_fstypename" "ac_cv_member_stru #include #endif " -if test "x$ac_cv_member_struct_statfs_f_fstypename" = x""yes; then : +if test "x$ac_cv_member_struct_statfs_f_fstypename" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_FSTYPENAME 1 @@ -22741,7 +22774,7 @@ ac_fn_c_check_member "$LINENO" "struct statfs" "f_bavail" "ac_cv_member_struct_s #include #endif " -if test "x$ac_cv_member_struct_statfs_f_bavail" = x""yes; then : +if test "x$ac_cv_member_struct_statfs_f_bavail" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_BAVAIL 1 @@ -22753,7 +22786,7 @@ fi # struct statvfs.f_basetype is available on Solaris but not for Linux. ac_fn_c_check_member "$LINENO" "struct statvfs" "f_basetype" "ac_cv_member_struct_statvfs_f_basetype" "#include " -if test "x$ac_cv_member_struct_statvfs_f_basetype" = x""yes; then : +if test "x$ac_cv_member_struct_statvfs_f_basetype" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_BASETYPE 1 @@ -22762,12 +22795,22 @@ _ACEOF fi +ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "$ac_includes_default" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TM_TM_GMTOFF 1 +_ACEOF + + +fi + # Checks for libcharset { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then : +if ${am_cv_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22801,7 +22844,7 @@ $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 $as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } -if test "${ac_cv_gnu_library_2_1+set}" = set; then : +if ${ac_cv_gnu_library_2_1+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22836,8 +22879,7 @@ for ac_header in stddef.h stdlib.h string.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -22849,7 +22891,7 @@ done for ac_func in setlocale do : ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" -if test "x$ac_cv_func_setlocale" = x""yes; then : +if test "x$ac_cv_func_setlocale" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETLOCALE 1 _ACEOF @@ -22865,7 +22907,7 @@ done # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } -if test "${ac_cv_sizeof_size_t+set}" = set; then : +if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : @@ -22874,9 +22916,8 @@ else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (size_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi @@ -22913,7 +22954,7 @@ case $ac_cv_sizeof_size_t in $ac_cv_sizeof__int64) glib_size_type='__int64' ;; - *) as_fn_error "No type matching size_t in size" "$LINENO" 5 + *) as_fn_error $? "No type matching size_t in size" "$LINENO" 5 ;; esac @@ -23007,12 +23048,11 @@ fi $as_echo "unsigned $glib_size_type" >&6; } # Check for some functions -for ac_func in lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk +for ac_func in lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk memmem do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23024,8 +23064,7 @@ for ac_func in chown lchmod lchown fchmod fchown link statvfs statfs utimes getg do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23037,8 +23076,7 @@ for ac_func in getmntent_r setmntent endmntent hasmntopt getmntinfo do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23047,23 +23085,10 @@ fi done # Check for high-resolution sleep functions -for ac_func in nanosleep nsleep -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - for ac_func in splice do : ac_fn_c_check_func "$LINENO" "splice" "ac_cv_func_splice" -if test "x$ac_cv_func_splice" = x""yes; then : +if test "x$ac_cv_func_splice" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SPLICE 1 _ACEOF @@ -23075,7 +23100,7 @@ done for ac_header in crt_externs.h do : ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default" -if test "x$ac_cv_header_crt_externs_h" = x""yes; then : +if test "x$ac_cv_header_crt_externs_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CRT_EXTERNS_H 1 _ACEOF @@ -23087,7 +23112,7 @@ done for ac_func in _NSGetEnviron do : ac_fn_c_check_func "$LINENO" "_NSGetEnviron" "ac_cv_func__NSGetEnviron" -if test "x$ac_cv_func__NSGetEnviron" = x""yes; then : +if test "x$ac_cv_func__NSGetEnviron" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__NSGETENVIRON 1 _ACEOF @@ -23098,7 +23123,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C99 vsnprintf" >&5 $as_echo_n "checking for C99 vsnprintf... " >&6; } -if test "${ac_cv_func_vsnprintf_c99+set}" = set; then : +if ${ac_cv_func_vsnprintf_c99+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -23163,7 +23188,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports positional parameters" >&5 $as_echo_n "checking whether printf supports positional parameters... " >&6; } -if test "${ac_cv_func_printf_unix98+set}" = set; then : +if ${ac_cv_func_printf_unix98+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -23218,7 +23243,7 @@ fi glib_failed=false { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of AF_INET" >&5 $as_echo_n "checking value of AF_INET... " >&6; } -if test "${glib_cv_value_AF_INET+set}" = set; then : +if ${glib_cv_value_AF_INET+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "AF_INET" "glib_cv_value_AF_INET" "$glib_inet_includes"; then : @@ -23234,7 +23259,7 @@ $as_echo "$glib_cv_value_AF_INET" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of AF_INET6" >&5 $as_echo_n "checking value of AF_INET6... " >&6; } -if test "${glib_cv_value_AF_INET6+set}" = set; then : +if ${glib_cv_value_AF_INET6+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "AF_INET6" "glib_cv_value_AF_INET6" "$glib_inet_includes"; then : @@ -23251,7 +23276,7 @@ $as_echo "$glib_cv_value_AF_INET6" >&6; } # winsock defines this even though it doesn't support it { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of AF_UNIX" >&5 $as_echo_n "checking value of AF_UNIX... " >&6; } -if test "${glib_cv_value_AF_UNIX+set}" = set; then : +if ${glib_cv_value_AF_UNIX+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "AF_UNIX" "glib_cv_value_AF_UNIX" "$glib_inet_includes"; then : @@ -23266,13 +23291,13 @@ fi $as_echo "$glib_cv_value_AF_UNIX" >&6; } if $glib_failed ; then - as_fn_error "Could not determine values for AF_INET* constants" "$LINENO" 5 + as_fn_error $? "Could not determine values for AF_INET* constants" "$LINENO" 5 fi glib_failed=false { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of MSG_PEEK" >&5 $as_echo_n "checking value of MSG_PEEK... " >&6; } -if test "${glib_cv_value_MSG_PEEK+set}" = set; then : +if ${glib_cv_value_MSG_PEEK+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "MSG_PEEK" "glib_cv_value_MSG_PEEK" "$glib_inet_includes"; then : @@ -23288,7 +23313,7 @@ $as_echo "$glib_cv_value_MSG_PEEK" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of MSG_OOB" >&5 $as_echo_n "checking value of MSG_OOB... " >&6; } -if test "${glib_cv_value_MSG_OOB+set}" = set; then : +if ${glib_cv_value_MSG_OOB+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "MSG_OOB" "glib_cv_value_MSG_OOB" "$glib_inet_includes"; then : @@ -23304,7 +23329,7 @@ $as_echo "$glib_cv_value_MSG_OOB" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of MSG_DONTROUTE" >&5 $as_echo_n "checking value of MSG_DONTROUTE... " >&6; } -if test "${glib_cv_value_MSG_DONTROUTE+set}" = set; then : +if ${glib_cv_value_MSG_DONTROUTE+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "MSG_DONTROUTE" "glib_cv_value_MSG_DONTROUTE" "$glib_inet_includes"; then : @@ -23319,15 +23344,14 @@ fi $as_echo "$glib_cv_value_MSG_DONTROUTE" >&6; } if $glib_failed ; then - as_fn_error "Could not determine values for MSG_* constants" "$LINENO" 5 + as_fn_error $? "Could not determine values for MSG_* constants" "$LINENO" 5 fi for ac_func in getprotobyname_r endservent do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23339,8 +23363,7 @@ for ac_header in netdb.h wspiapi.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -23356,8 +23379,7 @@ if test $glib_native_win32 = no; then do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23369,8 +23391,7 @@ done do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -23439,7 +23460,7 @@ if ac_fn_c_try_link "$LINENO"; then : $as_echo "in -lbind" >&6; } LIBASYNCNS_LIBADD="-lbind" else - as_fn_error "not found" "$LINENO" 5 + as_fn_error $? "not found" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -23538,7 +23559,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 $as_echo "unknown" >&6; } - as_fn_error "unable to determine number of arguments to statfs()" "$LINENO" 5 + as_fn_error $? "unable to determine number of arguments to statfs()" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -23572,7 +23593,7 @@ fi if test "x$enable_included_printf" = "xno" && test "x$need_included_printf" = "xyes" ; then - as_fn_error " + as_fn_error $? " *** Your C library's printf doesn't appear to have the features that *** GLib needs, but you specified --enable-included-printf=no." "$LINENO" 5 fi @@ -23603,7 +23624,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed" >&5 $as_echo_n "checking for signed... " >&6; } -if test "${bh_cv_c_signed+set}" = set; then : +if ${bh_cv_c_signed+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23635,7 +23656,7 @@ $as_echo "#define signed /**/" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long" >&5 $as_echo_n "checking for long long... " >&6; } -if test "${ac_cv_type_long_long+set}" = set; then : +if ${ac_cv_type_long_long+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23669,7 +23690,7 @@ $as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 $as_echo_n "checking for long double... " >&6; } -if test "${gt_cv_c_long_double+set}" = set; then : +if ${gt_cv_c_long_double+:} false; then : $as_echo_n "(cached) " >&6 else if test "$GCC" = yes; then @@ -23710,7 +23731,7 @@ $as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 $as_echo_n "checking for wchar_t... " >&6; } -if test "${gt_cv_c_wchar_t+set}" = set; then : +if ${gt_cv_c_wchar_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23743,7 +23764,7 @@ $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 $as_echo_n "checking for wint_t... " >&6; } -if test "${gt_cv_c_wint_t+set}" = set; then : +if ${gt_cv_c_wint_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23774,7 +23795,7 @@ $as_echo "#define HAVE_WINT_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -23785,7 +23806,7 @@ _ACEOF fi ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 @@ -23797,7 +23818,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 $as_echo_n "checking for inttypes.h... " >&6; } -if test "${jm_ac_cv_header_inttypes_h+set}" = set; then : +if ${jm_ac_cv_header_inttypes_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23832,7 +23853,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 $as_echo_n "checking for stdint.h... " >&6; } -if test "${jm_ac_cv_header_stdint_h+set}" = set; then : +if ${jm_ac_cv_header_stdint_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23887,8 +23908,7 @@ for ac_func in snprintf wcslen do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23898,7 +23918,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C99 snprintf" >&5 $as_echo_n "checking for C99 snprintf... " >&6; } -if test "${ac_cv_func_snprintf_c99+set}" = set; then : +if ${ac_cv_func_snprintf_c99+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -23965,14 +23985,14 @@ fi if test "$ac_cv_func_memmove" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bcopy can handle overlapping copies" >&5 $as_echo_n "checking whether bcopy can handle overlapping copies... " >&6; } -if test "${glib_cv_working_bcopy+set}" = set; then : +if ${glib_cv_working_bcopy+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24007,7 +24027,7 @@ fi $as_echo "$glib_cv_working_bcopy" >&6; } if test "x${glib_cv_working_bcopy+set}" != "xset" ; then - as_fn_error "glib_cv_working_bcopy must be set in cache file when cross-compiling." "$LINENO" 5 + as_fn_error $? "glib_cv_working_bcopy must be set in cache file when cross-compiling." "$LINENO" 5 fi if test "$glib_cv_working_bcopy" = "yes"; then @@ -24165,7 +24185,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realloc (NULL,) will work" >&5 $as_echo_n "checking whether realloc (NULL,) will work... " >&6; } -if test "${glib_cv_sane_realloc+set}" = set; then : +if ${glib_cv_sane_realloc+:} false; then : $as_echo_n "(cached) " >&6 else @@ -24200,7 +24220,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo (CODESET)" >&5 $as_echo_n "checking for nl_langinfo (CODESET)... " >&6; } -if test "${glib_cv_langinfo_codeset+set}" = set; then : +if ${glib_cv_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else @@ -24232,7 +24252,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a compliant posix_memalign() implementation" >&5 $as_echo_n "checking for a compliant posix_memalign() implementation... " >&6; } -if test "${glib_cv_compliant_posix_memalign+set}" = set; then : +if ${glib_cv_compliant_posix_memalign+:} false; then : $as_echo_n "(cached) " >&6 else @@ -24295,7 +24315,7 @@ fi # Check for strlcpy { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenBSD strlcpy/strlcat" >&5 $as_echo_n "checking for OpenBSD strlcpy/strlcat... " >&6; } -if test "${glib_cv_have_strlcpy+set}" = set; then : +if ${glib_cv_have_strlcpy+:} false; then : $as_echo_n "(cached) " >&6 else @@ -24314,196 +24334,617 @@ int main() { return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_cv_have_strlcpy=yes +if ac_fn_c_try_run "$LINENO"; then : + glib_cv_have_strlcpy=yes +else + glib_cv_have_strlcpy=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_have_strlcpy" >&5 +$as_echo "$glib_cv_have_strlcpy" >&6; } +if test "$glib_cv_have_strlcpy" = "yes"; then + +$as_echo "#define HAVE_STRLCPY 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an implementation of va_copy()" >&5 +$as_echo_n "checking for an implementation of va_copy()... " >&6; } +if ${glib_cv_va_copy+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + va_copy (args2, args1); + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + glib_cv_va_copy=yes +else + glib_cv_va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_va_copy" >&5 +$as_echo "$glib_cv_va_copy" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an implementation of __va_copy()" >&5 +$as_echo_n "checking for an implementation of __va_copy()... " >&6; } +if ${glib_cv___va_copy+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + __va_copy (args2, args1); + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + glib_cv___va_copy=yes +else + glib_cv___va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv___va_copy" >&5 +$as_echo "$glib_cv___va_copy" >&6; } + +if test "x$glib_cv_va_copy" = "xyes"; then + g_va_copy_func=va_copy +else if test "x$glib_cv___va_copy" = "xyes"; then + g_va_copy_func=__va_copy +fi +fi + +if test -n "$g_va_copy_func"; then + +cat >>confdefs.h <<_ACEOF +#define G_VA_COPY $g_va_copy_func +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_lists can be copied by value" >&5 +$as_echo_n "checking whether va_lists can be copied by value... " >&6; } +if ${glib_cv_va_val_copy+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + glib_cv_va_val_copy=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + args2 = args1; + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + glib_cv_va_val_copy=yes +else + glib_cv_va_val_copy=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_va_val_copy" >&5 +$as_echo "$glib_cv_va_val_copy" >&6; } + +if test "x$glib_cv_va_val_copy" = "xno"; then + +$as_echo "#define G_VA_COPY_AS_ARRAY 1" >>confdefs.h + +fi + +G_MODULE_LIBS= +G_MODULE_LIBS_EXTRA= +G_MODULE_PLUGIN_LIBS= +if test x"$glib_native_win32" = xyes; then + G_MODULE_LDFLAGS= +else + export SED + G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` +fi +G_MODULE_NEED_USCORE=0 +G_MODULE_BROKEN_RTLD_GLOBAL=0 +G_MODULE_HAVE_DLERROR=0 +if test -z "$G_MODULE_IMPL"; then + case "$host" in + *-*-mingw*|*-*-cygwin*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 ;; + esac +fi +if test -z "$G_MODULE_IMPL"; then + case "$host" in + *-*-aix*) G_MODULE_IMPL=G_MODULE_IMPL_AR ;; + esac +fi +if test -z "$G_MODULE_IMPL"; then + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + ac_fn_c_check_func "$LINENO" "dlsym" "ac_cv_func_dlsym" +if test "x$ac_cv_func_dlsym" = xyes; then : + G_MODULE_IMPL=G_MODULE_IMPL_DL +fi + +fi + +fi +if test -z "$G_MODULE_IMPL" && test "x$glib_native_beos" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for load_image in -lroot" >&5 +$as_echo_n "checking for load_image in -lroot... " >&6; } +if ${ac_cv_lib_root_load_image+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lroot $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char load_image (); +int +main () +{ +return load_image (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_root_load_image=yes else - glib_cv_have_strlcpy=no + ac_cv_lib_root_load_image=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_root_load_image" >&5 +$as_echo "$ac_cv_lib_root_load_image" >&6; } +if test "x$ac_cv_lib_root_load_image" = xyes; then : + G_MODULE_LIBS="-lbe -lroot -lglib-2.0 " + G_MODULE_LIBS_EXTRA="-L\$(top_builddir_full)/.libs" + G_MODULE_PLUGIN_LIBS="-L\$(top_builddir_full)/gmodule/.libs -lgmodule" + G_MODULE_IMPL=G_MODULE_IMPL_BEOS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_have_strlcpy" >&5 -$as_echo "$glib_cv_have_strlcpy" >&6; } -if test "$glib_cv_have_strlcpy" = "yes"; then - -$as_echo "#define HAVE_STRLCPY 1" >>confdefs.h fi +if test -z "$G_MODULE_IMPL"; then + ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule" +if test "x$ac_cv_func_NSLinkModule" = xyes; then : + G_MODULE_IMPL=G_MODULE_IMPL_DYLD + G_MODULE_NEED_USCORE=1 +fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an implementation of va_copy()" >&5 -$as_echo_n "checking for an implementation of va_copy()... " >&6; } -if test "${glib_cv_va_copy+set}" = set; then : +fi +if test -z "$G_MODULE_IMPL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include - void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - va_copy (args2, args1); - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - } + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} _ACEOF if ac_fn_c_try_link "$LINENO"; then : - glib_cv_va_copy=yes + ac_cv_lib_dl_dlopen=yes else - glib_cv_va_copy=no + ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_va_copy" >&5 -$as_echo "$glib_cv_va_copy" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an implementation of __va_copy()" >&5 -$as_echo_n "checking for an implementation of __va_copy()... " >&6; } -if test "${glib_cv___va_copy+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 +$as_echo_n "checking for dlsym in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlsym+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include - void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - __va_copy (args2, args1); - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - } + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlsym (); +int +main () +{ +return dlsym (); + ; + return 0; +} _ACEOF if ac_fn_c_try_link "$LINENO"; then : - glib_cv___va_copy=yes + ac_cv_lib_dl_dlsym=yes else - glib_cv___va_copy=no + ac_cv_lib_dl_dlsym=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv___va_copy" >&5 -$as_echo "$glib_cv___va_copy" >&6; } - -if test "x$glib_cv_va_copy" = "xyes"; then - g_va_copy_func=va_copy -else if test "x$glib_cv___va_copy" = "xyes"; then - g_va_copy_func=__va_copy +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 +$as_echo "$ac_cv_lib_dl_dlsym" >&6; } +if test "x$ac_cv_lib_dl_dlsym" = xyes; then : + G_MODULE_LIBS=-ldl + G_MODULE_IMPL=G_MODULE_IMPL_DL fi + fi -if test -n "$g_va_copy_func"; then +fi +if test -z "$G_MODULE_IMPL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define G_VA_COPY $g_va_copy_func +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} _ACEOF - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + G_MODULE_LIBS=-ldld + G_MODULE_IMPL=G_MODULE_IMPL_DLD fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_lists can be copied by value" >&5 -$as_echo_n "checking whether va_lists can be copied by value... " >&6; } -if test "${glib_cv_va_val_copy+set}" = set; then : +fi +if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then + LIBS_orig="$LIBS" + LDFLAGS_orig="$LDFLAGS" + LIBS="$G_MODULE_LIBS $LIBS" + LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS" + echo "void glib_plugin_test(void) { }" > plugin.c + ${SHELL} ./libtool --mode=compile ${CC} -shared \ + -export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_GLOBAL brokenness" >&5 +$as_echo_n "checking for RTLD_GLOBAL brokenness... " >&6; } +if ${glib_cv_rtldglobal_broken+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - glib_cv_va_val_copy=yes + if test "$cross_compiling" = yes; then : + glib_cv_rtldglobal_broken=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include - void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - args2 = args1; - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - } + +#include +#ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +#endif +#ifndef RTLD_LAZY +# define RTLD_LAZY 0 +#endif +int glib_plugin_test; +int main () { + void *handle, *global, *local; + global = &glib_plugin_test; + handle = dlopen ("./.libs/plugin.o", RTLD_GLOBAL | RTLD_LAZY); + if (!handle) return 0; + local = dlsym (handle, "glib_plugin_test"); + return global == local; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + glib_cv_rtldglobal_broken=no +else + glib_cv_rtldglobal_broken=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f plugin.c plugin.o plugin.lo .libs/plugin.o + rmdir .libs 2>/dev/null + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_rtldglobal_broken" >&5 +$as_echo "$glib_cv_rtldglobal_broken" >&6; } + if test "x$glib_cv_rtldglobal_broken" = "xyes"; then + G_MODULE_BROKEN_RTLD_GLOBAL=1 + else + G_MODULE_BROKEN_RTLD_GLOBAL=0 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for preceeding underscore in symbols" >&5 +$as_echo_n "checking for preceeding underscore in symbols... " >&6; } +if ${glib_cv_uscore+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int glib_underscore_test (void) { return 42; } + int main() { + void *f1 = (void*)0, *f2 = (void*)0, *handle; + handle = dlopen ((void*)0, 0); + if (handle) { + f1 = dlsym (handle, "glib_underscore_test"); + f2 = dlsym (handle, "_glib_underscore_test"); + } return (!f2 || f1); + } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - glib_cv_va_val_copy=yes + glib_cv_uscore=yes else - glib_cv_va_val_copy=no + glib_cv_uscore=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + rm -f plugin.c plugin.$ac_objext plugin.lo fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_va_val_copy" >&5 -$as_echo "$glib_cv_va_val_copy" >&6; } - -if test "x$glib_cv_va_val_copy" = "xno"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_uscore" >&5 +$as_echo "$glib_cv_uscore" >&6; } + if test "x${glib_cv_uscore+set}" != "xset" ; then + as_fn_error $? "glib_cv_uscore must be set in cache file when cross-compiling." "$LINENO" 5 +fi -$as_echo "#define G_VA_COPY_AS_ARRAY 1" >>confdefs.h + if test "x$glib_cv_uscore" = "xyes"; then + G_MODULE_NEED_USCORE=1 + else + G_MODULE_NEED_USCORE=0 + fi + LDFLAGS="$LDFLAGS_orig" + ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" +if test "x$ac_cv_func_dlerror" = xyes; then : + G_MODULE_HAVE_DLERROR=1 +else + G_MODULE_HAVE_DLERROR=0 fi -G_MODULE_LIBS= -G_MODULE_LIBS_EXTRA= -G_MODULE_PLUGIN_LIBS= -if test x"$glib_native_win32" = xyes; then - G_MODULE_LDFLAGS= -else - export SED - G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` + LIBS="$LIBS_orig" fi -G_MODULE_NEED_USCORE=0 -G_MODULE_BROKEN_RTLD_GLOBAL=0 -G_MODULE_HAVE_DLERROR=0 if test -z "$G_MODULE_IMPL"; then - case "$host" in - *-*-mingw*|*-*-cygwin*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 ;; - esac + G_MODULE_IMPL=0 + G_MODULE_SUPPORTED=false +else + G_MODULE_SUPPORTED=true fi -if test -z "$G_MODULE_IMPL"; then - case "$host" in - *-*-aix*) G_MODULE_IMPL=G_MODULE_IMPL_AR ;; - esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the suffix of module shared libraries" >&5 +$as_echo_n "checking for the suffix of module shared libraries... " >&6; } +export SED +shrext_cmds=`./libtool --config | grep '^shrext_cmds='` +eval $shrext_cmds +module=yes eval std_shrext=$shrext_cmds +# chop the initial dot +glib_gmodule_suffix=`echo $std_shrext | sed 's/^\.//'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: .$glib_gmodule_suffix" >&5 +$as_echo ".$glib_gmodule_suffix" >&6; } +# any reason it may fail? +if test "x$glib_gmodule_suffix" = x; then + as_fn_error $? "Cannot determine shared library suffix from libtool" "$LINENO" 5 fi -if test -z "$G_MODULE_IMPL"; then - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : - ac_fn_c_check_func "$LINENO" "dlsym" "ac_cv_func_dlsym" -if test "x$ac_cv_func_dlsym" = x""yes; then : - G_MODULE_IMPL=G_MODULE_IMPL_DL + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gspawn implementation" >&5 +$as_echo_n "checking for gspawn implementation... " >&6; } +case "$host" in + *-*-mingw*) + GSPAWN=gspawn-win32.lo + ;; + *) + GSPAWN=gspawn.lo + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSPAWN" >&5 +$as_echo "$GSPAWN" >&6; } + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIOChannel implementation" >&5 +$as_echo_n "checking for GIOChannel implementation... " >&6; } +case "$host" in + *-*-mingw*) + GIO=giowin32.lo + ;; + *) + GIO=giounix.lo + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO" >&5 +$as_echo "$GIO" >&6; } + + + + +# Check whether --with-gio-module-dir was given. +if test "${with_gio_module_dir+set}" = set; then : + withval=$with_gio_module_dir; +else + with_gio_module_dir='${libdir}/gio/modules' fi +GIO_MODULE_DIR=$with_gio_module_dir + + +# Check whether --enable-selinux was given. +if test "${enable_selinux+set}" = set; then : + enableval=$enable_selinux; fi +msg_selinux=no +SELINUX_LIBS= +if test "x$enable_selinux" != "xno"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_selinux_enabled in -lselinux" >&5 +$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; } +if ${ac_cv_lib_selinux_is_selinux_enabled+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lselinux $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char is_selinux_enabled (); +int +main () +{ +return is_selinux_enabled (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_selinux_is_selinux_enabled=yes +else + ac_cv_lib_selinux_is_selinux_enabled=no fi -if test -z "$G_MODULE_IMPL" && test "x$glib_native_beos" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for load_image in -lroot" >&5 -$as_echo_n "checking for load_image in -lroot... " >&6; } -if test "${ac_cv_lib_root_load_image+set}" = set; then : +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 +$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } +if test "x$ac_cv_lib_selinux_is_selinux_enabled" = xyes; then : + for ac_header in selinux/selinux.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default" +if test "x$ac_cv_header_selinux_selinux_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SELINUX_SELINUX_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgetfilecon_raw in -lselinux" >&5 +$as_echo_n "checking for lgetfilecon_raw in -lselinux... " >&6; } +if ${ac_cv_lib_selinux_lgetfilecon_raw+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lroot $LIBS" +LIBS="-lselinux $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24513,87 +24954,131 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char load_image (); +char lgetfilecon_raw (); int main () { -return load_image (); +return lgetfilecon_raw (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_root_load_image=yes + ac_cv_lib_selinux_lgetfilecon_raw=yes else - ac_cv_lib_root_load_image=no + ac_cv_lib_selinux_lgetfilecon_raw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_root_load_image" >&5 -$as_echo "$ac_cv_lib_root_load_image" >&6; } -if test "x$ac_cv_lib_root_load_image" = x""yes; then : - G_MODULE_LIBS="-lbe -lroot -lglib-2.0 " - G_MODULE_LIBS_EXTRA="-L\$(top_builddir_full)/.libs" - G_MODULE_PLUGIN_LIBS="-L\$(top_builddir_full)/gmodule/.libs -lgmodule" - G_MODULE_IMPL=G_MODULE_IMPL_BEOS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_lgetfilecon_raw" >&5 +$as_echo "$ac_cv_lib_selinux_lgetfilecon_raw" >&6; } +if test "x$ac_cv_lib_selinux_lgetfilecon_raw" = xyes; then : + +$as_echo "#define HAVE_SELINUX 1" >>confdefs.h + + SELINUX_LIBS="-lselinux" + msg_selinux=yes +fi + + +fi + +done + + +fi + +fi + + +inotify_support=no +for ac_header in sys/inotify.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inotify_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_INOTIFY_H 1 +_ACEOF + + inotify_support=yes + for ac_func in inotify_init1 +do : + ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1" +if test "x$ac_cv_func_inotify_init1" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INOTIFY_INIT1 1 +_ACEOF + +fi +done + + +fi + +done + + + if test "$inotify_support" = "yes"; then + HAVE_INOTIFY_TRUE= + HAVE_INOTIFY_FALSE='#' +else + HAVE_INOTIFY_TRUE='#' + HAVE_INOTIFY_FALSE= fi -fi -if test -z "$G_MODULE_IMPL"; then - ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule" -if test "x$ac_cv_func_NSLinkModule" = x""yes; then : - G_MODULE_IMPL=G_MODULE_IMPL_DYLD - G_MODULE_NEED_USCORE=1 -fi -fi -if test -z "$G_MODULE_IMPL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" +fen_support=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +#include +#ifndef PORT_SOURCE_FILE +#error "Please upgrade to Nevada 72 or above to suppoert FEN" #endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} +int main() { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes +if ac_fn_c_try_compile "$LINENO"; then : + + fen_support=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "$fen_support" = "yes"; then + HAVE_FEN_TRUE= + HAVE_FEN_FALSE='#' else - ac_cv_lib_dl_dlopen=no + HAVE_FEN_TRUE='#' + HAVE_FEN_FALSE= fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + + +should_disable_fam=no + +# Check whether --enable-fam was given. +if test "${enable_fam+set}" = set; then : + enableval=$enable_fam; + if test "x$enable_fam" = "xno"; then + should_disable_fam=yes + echo "Not building FAM support" + fi + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 -$as_echo_n "checking for dlsym in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlsym+set}" = set; then : + +fam_support=no +FAM_LIBS= +if test "x$should_disable_fam" = "xno"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAMOpen in -lfam" >&5 +$as_echo_n "checking for FAMOpen in -lfam... " >&6; } +if ${ac_cv_lib_fam_FAMOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" +LIBS="-lfam $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24603,42 +25088,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dlsym (); +char FAMOpen (); int main () { -return dlsym (); +return FAMOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlsym=yes + ac_cv_lib_fam_FAMOpen=yes else - ac_cv_lib_dl_dlsym=no + ac_cv_lib_fam_FAMOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 -$as_echo "$ac_cv_lib_dl_dlsym" >&6; } -if test "x$ac_cv_lib_dl_dlsym" = x""yes; then : - G_MODULE_LIBS=-ldl - G_MODULE_IMPL=G_MODULE_IMPL_DL -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fam_FAMOpen" >&5 +$as_echo "$ac_cv_lib_fam_FAMOpen" >&6; } +if test "x$ac_cv_lib_fam_FAMOpen" = xyes; then : + for ac_header in fam.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fam.h" "ac_cv_header_fam_h" "$ac_includes_default" +if test "x$ac_cv_header_fam_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FAM_H 1 +_ACEOF -fi +$as_echo "#define HAVE_FAM /**/" >>confdefs.h -fi -if test -z "$G_MODULE_IMPL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAMNoExists in -lfam" >&5 +$as_echo_n "checking for FAMNoExists in -lfam... " >&6; } +if ${ac_cv_lib_fam_FAMNoExists+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" +LIBS="-lfam $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24648,239 +25135,76 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char shl_load (); +char FAMNoExists (); int main () { -return shl_load (); +return FAMNoExists (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : - G_MODULE_LIBS=-ldld - G_MODULE_IMPL=G_MODULE_IMPL_DLD -fi - -fi -if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then - LIBS_orig="$LIBS" - LDFLAGS_orig="$LDFLAGS" - LIBS="$G_MODULE_LIBS $LIBS" - LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS" - echo "void glib_plugin_test(void) { }" > plugin.c - ${SHELL} ./libtool --mode=compile ${CC} -shared \ - -export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_GLOBAL brokenness" >&5 -$as_echo_n "checking for RTLD_GLOBAL brokenness... " >&6; } -if test "${glib_cv_rtldglobal_broken+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - glib_cv_rtldglobal_broken=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifndef RTLD_GLOBAL -# define RTLD_GLOBAL 0 -#endif -#ifndef RTLD_LAZY -# define RTLD_LAZY 0 -#endif -int glib_plugin_test; -int main () { - void *handle, *global, *local; - global = &glib_plugin_test; - handle = dlopen ("./.libs/plugin.o", RTLD_GLOBAL | RTLD_LAZY); - if (!handle) return 0; - local = dlsym (handle, "glib_plugin_test"); - return global == local; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_cv_rtldglobal_broken=no -else - glib_cv_rtldglobal_broken=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - rm -f plugin.c plugin.o plugin.lo .libs/plugin.o - rmdir .libs 2>/dev/null - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_rtldglobal_broken" >&5 -$as_echo "$glib_cv_rtldglobal_broken" >&6; } - if test "x$glib_cv_rtldglobal_broken" = "xyes"; then - G_MODULE_BROKEN_RTLD_GLOBAL=1 - else - G_MODULE_BROKEN_RTLD_GLOBAL=0 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for preceeding underscore in symbols" >&5 -$as_echo_n "checking for preceeding underscore in symbols... " >&6; } -if test "${glib_cv_uscore+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - int glib_underscore_test (void) { return 42; } - int main() { - void *f1 = (void*)0, *f2 = (void*)0, *handle; - handle = dlopen ((void*)0, 0); - if (handle) { - f1 = dlsym (handle, "glib_underscore_test"); - f2 = dlsym (handle, "_glib_underscore_test"); - } return (!f2 || f1); - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_cv_uscore=yes -else - glib_cv_uscore=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - rm -f plugin.c plugin.$ac_objext plugin.lo - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_uscore" >&5 -$as_echo "$glib_cv_uscore" >&6; } - if test "x${glib_cv_uscore+set}" != "xset" ; then - as_fn_error "glib_cv_uscore must be set in cache file when cross-compiling." "$LINENO" 5 -fi - - if test "x$glib_cv_uscore" = "xyes"; then - G_MODULE_NEED_USCORE=1 - else - G_MODULE_NEED_USCORE=0 - fi - - LDFLAGS="$LDFLAGS_orig" - ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" -if test "x$ac_cv_func_dlerror" = x""yes; then : - G_MODULE_HAVE_DLERROR=1 -else - G_MODULE_HAVE_DLERROR=0 -fi - - LIBS="$LIBS_orig" -fi -if test -z "$G_MODULE_IMPL"; then - G_MODULE_IMPL=0 - G_MODULE_SUPPORTED=false -else - G_MODULE_SUPPORTED=true -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the suffix of module shared libraries" >&5 -$as_echo_n "checking for the suffix of module shared libraries... " >&6; } -export SED -shrext_cmds=`./libtool --config | grep '^shrext_cmds='` -eval $shrext_cmds -module=yes eval std_shrext=$shrext_cmds -# chop the initial dot -glib_gmodule_suffix=`echo $std_shrext | sed 's/^\.//'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: .$glib_gmodule_suffix" >&5 -$as_echo ".$glib_gmodule_suffix" >&6; } -# any reason it may fail? -if test "x$glib_gmodule_suffix" = x; then - as_fn_error "Cannot determine shared library suffix from libtool" "$LINENO" 5 + ac_cv_lib_fam_FAMNoExists=yes +else + ac_cv_lib_fam_FAMNoExists=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fam_FAMNoExists" >&5 +$as_echo "$ac_cv_lib_fam_FAMNoExists" >&6; } +if test "x$ac_cv_lib_fam_FAMNoExists" = xyes; then : +$as_echo "#define HAVE_FAM_NO_EXISTS /**/" >>confdefs.h +fi + FAM_LIBS="-lfam" + fam_support=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** FAM support will not be built (header files not found) ***" >&5 +$as_echo "$as_me: WARNING: *** FAM support will not be built (header files not found) ***" >&2;} +fi +done +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** FAM support will not be built (FAM library not found) ***" >&5 +$as_echo "$as_me: WARNING: *** FAM support will not be built (FAM library not found) ***" >&2;} +fi - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gspawn implementation" >&5 -$as_echo_n "checking for gspawn implementation... " >&6; } -case "$host" in - *-*-mingw*) - GSPAWN=gspawn-win32.lo - ;; - *) - GSPAWN=gspawn.lo - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSPAWN" >&5 -$as_echo "$GSPAWN" >&6; } - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIOChannel implementation" >&5 -$as_echo_n "checking for GIOChannel implementation... " >&6; } -case "$host" in - *-*-mingw*) - GIO=giowin32.lo - ;; - *) - GIO=giounix.lo - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO" >&5 -$as_echo "$GIO" >&6; } - - - - -# Check whether --with-gio-module-dir was given. -if test "${with_gio_module_dir+set}" = set; then : - withval=$with_gio_module_dir; +fi + if test "$fam_support" = "yes"; then + HAVE_FAM_TRUE= + HAVE_FAM_FALSE='#' else - with_gio_module_dir='${libdir}/gio/modules' + HAVE_FAM_TRUE='#' + HAVE_FAM_FALSE= fi -GIO_MODULE_DIR=$with_gio_module_dir -# Check whether --enable-selinux was given. -if test "${enable_selinux+set}" = set; then : - enableval=$enable_selinux; +# Check whether --enable-xattr was given. +if test "${enable_xattr+set}" = set; then : + enableval=$enable_xattr; fi -msg_selinux=no -SELINUX_LIBS= -if test "x$enable_selinux" != "xno"; then +msg_xattr=no +XATTR_LIBS= +if test "x$enable_xattr" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_selinux_enabled in -lselinux" >&5 -$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; } -if test "${ac_cv_lib_selinux_is_selinux_enabled+set}" = set; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getxattr in -lc" >&5 +$as_echo_n "checking for getxattr in -lc... " >&6; } +if ${ac_cv_lib_c_getxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lselinux $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24890,41 +25214,54 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char is_selinux_enabled (); +char getxattr (); int main () { -return is_selinux_enabled (); +return getxattr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_selinux_is_selinux_enabled=yes + ac_cv_lib_c_getxattr=yes else - ac_cv_lib_selinux_is_selinux_enabled=no + ac_cv_lib_c_getxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 -$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } -if test "x$ac_cv_lib_selinux_is_selinux_enabled" = x""yes; then : - for ac_header in selinux/selinux.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getxattr" >&5 +$as_echo "$ac_cv_lib_c_getxattr" >&6; } +if test "x$ac_cv_lib_c_getxattr" = xyes; then : + for ac_header in sys/xattr.h do : - ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default" -if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_xattr_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SELINUX_SELINUX_H 1 +#define HAVE_SYS_XATTR_H 1 _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgetfilecon_raw in -lselinux" >&5 -$as_echo_n "checking for lgetfilecon_raw in -lselinux... " >&6; } -if test "${ac_cv_lib_selinux_lgetfilecon_raw+set}" = set; then : + +$as_echo "#define HAVE_XATTR 1" >>confdefs.h + + msg_xattr=yes +fi + +done + + +fi + + + if test "x$msg_xattr" != "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getxattr in -lattr" >&5 +$as_echo_n "checking for getxattr in -lattr... " >&6; } +if ${ac_cv_lib_attr_getxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lselinux $LIBS" +LIBS="-lattr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24934,2152 +25271,2204 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char lgetfilecon_raw (); +char getxattr (); int main () { -return lgetfilecon_raw (); +return getxattr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_selinux_lgetfilecon_raw=yes + ac_cv_lib_attr_getxattr=yes else - ac_cv_lib_selinux_lgetfilecon_raw=no + ac_cv_lib_attr_getxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_lgetfilecon_raw" >&5 -$as_echo "$ac_cv_lib_selinux_lgetfilecon_raw" >&6; } -if test "x$ac_cv_lib_selinux_lgetfilecon_raw" = x""yes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_getxattr" >&5 +$as_echo "$ac_cv_lib_attr_getxattr" >&6; } +if test "x$ac_cv_lib_attr_getxattr" = xyes; then : + for ac_header in attr/xattr.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default" +if test "x$ac_cv_header_attr_xattr_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ATTR_XATTR_H 1 +_ACEOF -$as_echo "#define HAVE_SELINUX 1" >>confdefs.h +$as_echo "#define HAVE_XATTR 1" >>confdefs.h - SELINUX_LIBS="-lselinux" - msg_selinux=yes + XATTR_LIBS="-lattr" + msg_xattr=yes +fi + +done + + +fi + + fi + + if test "x$msg_xattr" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR_NOFOLLOW" >&5 +$as_echo_n "checking for XATTR_NOFOLLOW... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_XATTR_H + #include + #elif HAVE_ATTR_XATTR_H + #include + #endif + +int +main () +{ +ssize_t len = getxattr("", "", NULL, 0, 0, XATTR_NOFOLLOW); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_XATTR_NOFOLLOW 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for platform-dependent source" >&5 +$as_echo_n "checking for platform-dependent source... " >&6; } +case "$host" in + *-*-cygwin*|*-*-mingw*) + PLATFORMDEP=gwin32.lo + ;; + *) + PLATFORMDEP= + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORMDEP" >&5 +$as_echo "$PLATFORMDEP" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compile timeloop" >&5 +$as_echo_n "checking whether to compile timeloop... " >&6; } +case "$host" in + *-*-cygwin*|*-*-mingw*|*-*-minix) + enable_timeloop=no + ;; + *) + enable_timeloop=yes + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_timeloop" >&5 +$as_echo "$enable_timeloop" >&6; } + if test x$enable_timeloop = xyes; then + ENABLE_TIMELOOP_TRUE= + ENABLE_TIMELOOP_FALSE='#' +else + ENABLE_TIMELOOP_TRUE='#' + ENABLE_TIMELOOP_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for some Win32 platform" >&5 +$as_echo_n "checking if building for some Win32 platform... " >&6; } +case "$host" in + *-*-mingw*|*-*-cygwin*) + platform_win32=yes + ;; + *) + platform_win32=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $platform_win32" >&5 +$as_echo "$platform_win32" >&6; } + if test x$platform_win32 = xyes; then + PLATFORM_WIN32_TRUE= + PLATFORM_WIN32_FALSE='#' +else + PLATFORM_WIN32_TRUE='#' + PLATFORM_WIN32_FALSE= fi -fi - -done +# Check whether --with-threads was given. +if test "${with_threads+set}" = set; then : + withval=$with_threads; if test "x$with_threads" = x; then + want_threads=yes + else + want_threads=$with_threads + fi +else + want_threads=yes fi +if test "x$enable_threads" = "xno"; then + want_threads=no fi -inotify_support=no -for ac_header in sys/inotify.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_inotify_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_INOTIFY_H 1 -_ACEOF +THREAD_NO_IMPLEMENTATION="You do not have any known thread system on your + computer. GLib will not have a default thread implementation." - inotify_support=yes - for ac_func in inotify_init1 -do : - ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1" -if test "x$ac_cv_func_inotify_init1" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INOTIFY_INIT1 1 -_ACEOF +FLAG_DOES_NOT_WORK="I can't find the MACRO to enable thread safety on your + platform (normally it's "_REENTRANT"). I'll not use any flag on + compilation now, but then your programs might not work. + Please provide information on how it is done on your system." -fi -done +LIBS_NOT_FOUND_1="I can't find the libraries for the thread implementation + " +LIBS_NOT_FOUND_2=". Please choose another thread implementation or + provide information on your thread implementation. + You can also run 'configure --disable-threads' + to compile without thread support." -fi +FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)' + functions will not be MT-safe during their first call because + there is no working 'getpwuid_r' on your system." -done +FUNC_NO_LOCALTIME_R="the 'g_date_set_time' function will not be MT-safe + because there is no 'localtime_r' on your system." +POSIX_NO_YIELD="I can not find a yield functions for your platform. A rather + crude surrogate will be used. If you happen to know a + yield function for your system, please inform the GLib + developers." - if test "$inotify_support" = "yes"; then - HAVE_INOTIFY_TRUE= - HAVE_INOTIFY_FALSE='#' -else - HAVE_INOTIFY_TRUE='#' - HAVE_INOTIFY_FALSE= -fi +POSIX_NO_PRIORITIES="I can not find the minimal and maximal priorities for + threads on your system. Thus threads can only have the default + priority. If you happen to know these main/max + priorities, please inform the GLib developers." +AIX_COMPILE_INFO="AIX's C compiler needs to be called by a different name, when + linking threaded applications. As GLib cannot do that + automatically, you will get an linkg error everytime you are + not using the right compiler. In that case you have to relink + with the right compiler. Ususally just '_r' is appended + to the compiler name." -fen_support=no -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifndef PORT_SOURCE_FILE -#error "Please upgrade to Nevada 72 or above to suppoert FEN" -#endif -int main() { return 0; } +# have_threads=no means no thread support +# have_threads=none means no default thread implementation + +have_threads=no +if test "x$want_threads" = xyes || test "x$want_threads" = xposix \ + || test "x$want_threads" = xdce; then + # -D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE is for DG/UX + # -U_OSF_SOURCE is for Digital UNIX 4.0d + GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE" + glib_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" + if test "x$have_threads" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; + ; + return 0; +} _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - - fen_support=yes - + have_threads=posix fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test "$fen_support" = "yes"; then - HAVE_FEN_TRUE= - HAVE_FEN_FALSE='#' -else - HAVE_FEN_TRUE='#' - HAVE_FEN_FALSE= -fi - - - -should_disable_fam=no - -# Check whether --enable-fam was given. -if test "${enable_fam+set}" = set; then : - enableval=$enable_fam; - if test "x$enable_fam" = "xno"; then - should_disable_fam=yes - echo "Not building FAM support" - fi - - -fi - -fam_support=no -FAM_LIBS= -if test "x$should_disable_fam" = "xno"; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAMOpen in -lfam" >&5 -$as_echo_n "checking for FAMOpen in -lfam... " >&6; } -if test "${ac_cv_lib_fam_FAMOpen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfam $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + fi + if test "x$have_threads" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char FAMOpen (); +#include int main () { -return FAMOpen (); +pthread_mutex_t m; + pthread_mutex_init (&m, pthread_mutexattr_default); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fam_FAMOpen=yes -else - ac_cv_lib_fam_FAMOpen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if ac_fn_c_try_compile "$LINENO"; then : + have_threads=dce fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fam_FAMOpen" >&5 -$as_echo "$ac_cv_lib_fam_FAMOpen" >&6; } -if test "x$ac_cv_lib_fam_FAMOpen" = x""yes; then : - for ac_header in fam.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "fam.h" "ac_cv_header_fam_h" "$ac_includes_default" -if test "x$ac_cv_header_fam_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FAM_H 1 -_ACEOF - -$as_echo "#define HAVE_FAM /**/" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FAMNoExists in -lfam" >&5 -$as_echo_n "checking for FAMNoExists in -lfam... " >&6; } -if test "${ac_cv_lib_fam_FAMNoExists+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfam $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + # Tru64Unix requires -pthread to find pthread.h. See #103020 + CPPFLAGS="$CPPFLAGS -pthread" + if test "x$have_threads" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char FAMNoExists (); +#include int main () { -return FAMNoExists (); +pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; ; return 0; } _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_threads=posix +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + CPPFLAGS="$glib_save_CPPFLAGS" +fi +if test "x$want_threads" = xyes || test "x$want_threads" = xwin32; then + case $host in + *-*-mingw*) + have_threads=win32 + ;; + esac +fi +if test "x$want_threads" = xnone; then + have_threads=none +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread implementation" >&5 +$as_echo_n "checking for thread implementation... " >&6; } + +if test "x$have_threads" = xno && test "x$want_threads" != xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none available" >&5 +$as_echo "none available" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $THREAD_NO_IMPLEMENTATION" >&5 +$as_echo "$as_me: WARNING: $THREAD_NO_IMPLEMENTATION" >&2;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_threads" >&5 +$as_echo "$have_threads" >&6; } +fi + + + +G_THREAD_LIBS= +G_THREAD_LIBS_EXTRA= +G_THREAD_CFLAGS= + + + + + +if test x"$have_threads" != xno; then + + if test x"$have_threads" = xposix; then + # First we test for posix, whether -pthread or -pthreads do the trick as + # both CPPFLAG and LIBS. + # One of them does for most gcc versions and some other platforms/compilers + # too and could be considered as the canonical way to go. + case $host in + *-*-cygwin*|*-*-darwin*) + # skip cygwin and darwin -pthread or -pthreads test + ;; + *-solaris*) + # These compiler/linker flags work with both Sun Studio and gcc + # Sun Studio expands -mt to -D_REENTRANT and -lthread + # gcc expands -pthreads to -D_REENTRANT -D_PTHREADS -lpthread + G_THREAD_CFLAGS="-D_REENTRANT -D_PTHREADS" + G_THREAD_LIBS="-lpthread -lthread" + ;; + *) + for flag in pthread pthreads mt; do + glib_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -$flag" + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int check_me = 0; +void* func(void* data) {check_me = 42; return &check_me;} +int main() + { pthread_t t; + void *ret; + pthread_create (&t, 0, func, 0); + pthread_join (t, &ret); + return (check_me != 42 || ret != &check_me); +} +_ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fam_FAMNoExists=yes + glib_flag_works=yes else - ac_cv_lib_fam_FAMNoExists=no + glib_flag_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fam_FAMNoExists" >&5 -$as_echo "$ac_cv_lib_fam_FAMNoExists" >&6; } -if test "x$ac_cv_lib_fam_FAMNoExists" = x""yes; then : - -$as_echo "#define HAVE_FAM_NO_EXISTS /**/" >>confdefs.h - -fi - - FAM_LIBS="-lfam" - fam_support=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** FAM support will not be built (header files not found) ***" >&5 -$as_echo "$as_me: WARNING: *** FAM support will not be built (header files not found) ***" >&2;} -fi - -done + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int check_me = 0; +void* func(void* data) {check_me = 42; return &check_me;} +int main() + { pthread_t t; + void *ret; + pthread_create (&t, 0, func, 0); + pthread_join (t, &ret); + return (check_me != 42 || ret != &check_me); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + glib_flag_works=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** FAM support will not be built (FAM library not found) ***" >&5 -$as_echo "$as_me: WARNING: *** FAM support will not be built (FAM library not found) ***" >&2;} + glib_flag_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + CFLAGS="$glib_save_CFLAGS" + if test $glib_flag_works = yes ; then + G_THREAD_CFLAGS=-$flag + G_THREAD_LIBS=-$flag + break; + fi + done + ;; + esac + fi -fi - if test "$fam_support" = "yes"; then - HAVE_FAM_TRUE= - HAVE_FAM_FALSE='#' -else - HAVE_FAM_TRUE='#' - HAVE_FAM_FALSE= -fi + if test x"$G_THREAD_CFLAGS" = x; then + # The canonical -pthread[s] does not work. Try something different. + case $host in + *-aix*) + if test x"$GCC" = xyes; then + # GCC 3.0 and above needs -pthread. + # Should be coverd by the case above. + # GCC 2.x and below needs -mthreads + G_THREAD_CFLAGS="-mthreads" + G_THREAD_LIBS=$G_THREAD_CFLAGS + else + # We are probably using the aix compiler. Normaly a + # program would have to be compiled with the _r variant + # of the corresponding compiler, but we as GLib cannot + # do that: but the good news is that for compiling the + # only difference is the added -D_THREAD_SAFE compile + # option. This is according to the "C for AIX User's + # Guide". + G_THREAD_CFLAGS="-D_THREAD_SAFE" + fi + ;; + *-dg-dgux*) # DG/UX + G_THREAD_CFLAGS="-D_REENTRANT -D_POSIX4A_DRAFT10_SOURCE" + ;; + *-osf*) + # So we are using dce threads. posix threads are already + # catched above. + G_THREAD_CFLAGS="-threads" + G_THREAD_LIBS=$G_THREAD_CFLAGS + ;; + *-sysv5uw7*) # UnixWare 7 + # We are not using gcc with -pthread. Catched above. + G_THREAD_CFLAGS="-Kthread" + G_THREAD_LIBS=$G_THREAD_CFLAGS + ;; + *-mingw*) + # No flag needed when using MSVCRT.DLL + G_THREAD_CFLAGS="" + ;; + *) + G_THREAD_CFLAGS="-D_REENTRANT" # good default guess otherwise + ;; + esac -# Check whether --enable-xattr was given. -if test "${enable_xattr+set}" = set; then : - enableval=$enable_xattr; -fi + fi -msg_xattr=no -XATTR_LIBS= -if test "x$enable_xattr" != "xno"; then + # if we are not finding the localtime_r function, then we probably are + # not using the proper multithread flag + glib_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS" + # First we test, whether localtime_r is declared in time.h + # directly. Then we test whether a macro localtime_r exists, in + # which case localtime_r in the test program is replaced and thus + # if we still find localtime_r in the output, it is not defined as + # a macro. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getxattr in -lc" >&5 -$as_echo_n "checking for getxattr in -lc... " >&6; } -if test "${ac_cv_lib_c_getxattr+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getxattr (); -int -main () -{ -return getxattr (); - ; - return 0; -} +#include _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_getxattr=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]" >/dev/null 2>&1; then : + else - ac_cv_lib_c_getxattr=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getxattr" >&5 -$as_echo "$ac_cv_lib_c_getxattr" >&6; } -if test "x$ac_cv_lib_c_getxattr" = x""yes; then : - for ac_header in sys/xattr.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_xattr_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_XATTR_H 1 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + localtime_r(a,b) _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FLAG_DOES_NOT_WORK" >&5 +$as_echo "$as_me: WARNING: $FLAG_DOES_NOT_WORK" >&2;} +fi +rm -f conftest* -$as_echo "#define HAVE_XATTR 1" >>confdefs.h - - msg_xattr=yes fi +rm -f conftest* -done + CPPFLAGS="$glib_save_CPPFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread related cflags" >&5 +$as_echo_n "checking thread related cflags... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $G_THREAD_CFLAGS" >&5 +$as_echo "$G_THREAD_CFLAGS" >&6; } + CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS" fi - if test "x$msg_xattr" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getxattr in -lattr" >&5 -$as_echo_n "checking for getxattr in -lattr... " >&6; } -if test "${ac_cv_lib_attr_getxattr+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lattr $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +mutex_has_default=no +case $have_threads in + posix|dce) + glib_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" + if test x"$G_THREAD_LIBS" = x; then + case $host in + *-aix*) + # We are not using gcc (would have set G_THREAD_LIBS) and thus + # probably using the aix compiler. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $AIX_COMPILE_INFO" >&5 +$as_echo "$as_me: WARNING: $AIX_COMPILE_INFO" >&2;} + ;; + *) + G_THREAD_LIBS=error + glib_save_LIBS="$LIBS" + for thread_lib in "" pthread pthread32 pthreads thread dce; do + if test x"$thread_lib" = x; then + add_thread_lib="" + IN="" + else + add_thread_lib="-l$thread_lib" + IN=" in -l$thread_lib" + fi + if test x"$have_threads" = xposix; then + defattr=0 + else + defattr=pthread_attr_default + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getxattr (); -int -main () -{ -return getxattr (); - ; - return 0; + LIBS="$add_thread_lib $glib_save_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create/pthread_join$IN" >&5 +$as_echo_n "checking for pthread_create/pthread_join$IN... " >&6; } + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int check_me = 0; +void* func(void* data) {check_me = 42; return &check_me;} +int main() + { pthread_t t; + void *ret; + pthread_create (&t, $defattr, func, 0); + pthread_join (t, &ret); + return (check_me != 42 || ret != &check_me); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_attr_getxattr=yes + glib_result=yes else - ac_cv_lib_attr_getxattr=no + glib_result=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_getxattr" >&5 -$as_echo "$ac_cv_lib_attr_getxattr" >&6; } -if test "x$ac_cv_lib_attr_getxattr" = x""yes; then : - for ac_header in attr/xattr.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default" -if test "x$ac_cv_header_attr_xattr_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ATTR_XATTR_H 1 -_ACEOF - -$as_echo "#define HAVE_XATTR 1" >>confdefs.h - - XATTR_LIBS="-lattr" - msg_xattr=yes -fi - -done - - -fi - - fi - - if test "x$msg_xattr" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR_NOFOLLOW" >&5 -$as_echo_n "checking for XATTR_NOFOLLOW... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #ifdef HAVE_SYS_TYPES_H - #include - #endif - #ifdef HAVE_SYS_XATTR_H - #include - #elif HAVE_ATTR_XATTR_H - #include - #endif - -int -main () -{ -ssize_t len = getxattr("", "", NULL, 0, 0, XATTR_NOFOLLOW); - ; - return 0; +#include +int check_me = 0; +void* func(void* data) {check_me = 42; return &check_me;} +int main() + { pthread_t t; + void *ret; + pthread_create (&t, $defattr, func, 0); + pthread_join (t, &ret); + return (check_me != 42 || ret != &check_me); } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define HAVE_XATTR_NOFOLLOW 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - +if ac_fn_c_try_run "$LINENO"; then : + glib_result=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - + glib_result=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_result" >&5 +$as_echo "$glib_result" >&6; } + if test "$glib_result" = "yes" ; then + G_THREAD_LIBS="$add_thread_lib" + break + fi + done + if test "x$G_THREAD_LIBS" = xerror; then + as_fn_error $? "$LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2" "$LINENO" 5 + fi + LIBS="$glib_save_LIBS" + ;; + esac + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for platform-dependent source" >&5 -$as_echo_n "checking for platform-dependent source... " >&6; } -case "$host" in - *-*-cygwin*|*-*-mingw*) - PLATFORMDEP=gwin32.lo - ;; - *) - PLATFORMDEP= - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORMDEP" >&5 -$as_echo "$PLATFORMDEP" >&6; } + glib_save_LIBS="$LIBS" + for thread_lib in "" rt rte; do + if test x"$thread_lib" = x; then + add_thread_lib="" + IN="" + else + add_thread_lib="-l$thread_lib" + IN=" in -l$thread_lib" + fi + LIBS="$add_thread_lib $glib_save_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_get_priority_min$IN" >&5 +$as_echo_n "checking for sched_get_priority_min$IN... " >&6; } + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compile timeloop" >&5 -$as_echo_n "checking whether to compile timeloop... " >&6; } -case "$host" in - *-*-cygwin*|*-*-mingw*|*-*-minix) - enable_timeloop=no - ;; - *) - enable_timeloop=yes - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_timeloop" >&5 -$as_echo "$enable_timeloop" >&6; } - if test x$enable_timeloop = xyes; then - ENABLE_TIMELOOP_TRUE= - ENABLE_TIMELOOP_FALSE='#' +#include +#include +int main() { + errno = 0; + return sched_get_priority_min(SCHED_OTHER)==-1 + && errno != 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + glib_result=yes else - ENABLE_TIMELOOP_TRUE='#' - ENABLE_TIMELOOP_FALSE= + glib_result=no fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for some Win32 platform" >&5 -$as_echo_n "checking if building for some Win32 platform... " >&6; } -case "$host" in - *-*-mingw*|*-*-cygwin*) - platform_win32=yes - ;; - *) - platform_win32=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $platform_win32" >&5 -$as_echo "$platform_win32" >&6; } - if test x$platform_win32 = xyes; then - PLATFORM_WIN32_TRUE= - PLATFORM_WIN32_FALSE='#' +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext else - PLATFORM_WIN32_TRUE='#' - PLATFORM_WIN32_FALSE= -fi - - - + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Check whether --with-threads was given. -if test "${with_threads+set}" = set; then : - withval=$with_threads; if test "x$with_threads" = x; then - want_threads=yes - else - want_threads=$with_threads - fi +#include +#include +int main() { + errno = 0; + return sched_get_priority_min(SCHED_OTHER)==-1 + && errno != 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + glib_result=yes else - want_threads=yes + glib_result=no fi - -if test "x$enable_threads" = "xno"; then - want_threads=no +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_result" >&5 +$as_echo "$glib_result" >&6; } -THREAD_NO_IMPLEMENTATION="You do not have any known thread system on your - computer. GLib will not have a default thread implementation." - -FLAG_DOES_NOT_WORK="I can't find the MACRO to enable thread safety on your - platform (normally it's "_REENTRANT"). I'll not use any flag on - compilation now, but then your programs might not work. - Please provide information on how it is done on your system." - -LIBS_NOT_FOUND_1="I can't find the libraries for the thread implementation - " - -LIBS_NOT_FOUND_2=". Please choose another thread implementation or - provide information on your thread implementation. - You can also run 'configure --disable-threads' - to compile without thread support." + if test "$glib_result" = "yes" ; then + G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib" + posix_priority_min="sched_get_priority_min(SCHED_OTHER)" + posix_priority_max="sched_get_priority_max(SCHED_OTHER)" + break + fi + done + LIBS="$glib_save_LIBS" + mutex_has_default=yes + mutex_default_type='pthread_mutex_t' + mutex_default_init='PTHREAD_MUTEX_INITIALIZER' + mutex_header_file='pthread.h' + if test "x$have_threads" = "xposix"; then + g_threads_impl="POSIX" + else + g_threads_impl="DCE" + have_threads="posix" + fi -FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)' - functions will not be MT-safe during their first call because - there is no working 'getpwuid_r' on your system." + CPPFLAGS="$glib_save_CPPFLAGS" + ;; + win32) + g_threads_impl="WIN32" + ;; + none|no) + g_threads_impl="NONE" + ;; + *) + g_threads_impl="NONE" + G_THREAD_LIBS=error + ;; +esac -FUNC_NO_LOCALTIME_R="the 'g_date_set_time' function will not be MT-safe - because there is no 'localtime_r' on your system." +if test "x$G_THREAD_LIBS" = xerror; then + as_fn_error $? "$LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2" "$LINENO" 5 +fi -POSIX_NO_YIELD="I can not find a yield functions for your platform. A rather - crude surrogate will be used. If you happen to know a - yield function for your system, please inform the GLib - developers." +case $host in + *-*-beos*) + G_THREAD_LIBS="-lbe -lroot -lglib-2.0 " + G_THREAD_LIBS_EXTRA="-L\$(top_builddir_full)/.libs" + ;; + *) + ;; +esac -POSIX_NO_PRIORITIES="I can not find the minimal and maximal priorities for - threads on your system. Thus threads can only have the default - priority. If you happen to know these main/max - priorities, please inform the GLib developers." +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking thread related libraries" >&5 +$as_echo_n "checking thread related libraries... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $G_THREAD_LIBS" >&5 +$as_echo "$G_THREAD_LIBS" >&6; } -AIX_COMPILE_INFO="AIX's C compiler needs to be called by a different name, when - linking threaded applications. As GLib cannot do that - automatically, you will get an linkg error everytime you are - not using the right compiler. In that case you have to relink - with the right compiler. Ususally just '_r' is appended - to the compiler name." +if test x"$have_threads" != xno; then + glib_save_LIBS="$LIBS" + # we are not doing the following for now, as this might require glib + # to always be linked with the thread libs on some platforms. + # LIBS="$LIBS $G_THREAD_LIBS" + for ac_func in localtime_r gmtime_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -# have_threads=no means no thread support -# have_threads=none means no default thread implementation +fi +done -have_threads=no -if test "x$want_threads" = xyes || test "x$want_threads" = xposix \ - || test "x$want_threads" = xdce; then - # -D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE is for DG/UX - # -U_OSF_SOURCE is for Digital UNIX 4.0d - GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE" - glib_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" - if test "x$have_threads" = xno; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$ac_cv_header_pwd_h" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix getpwuid_r" >&5 +$as_echo_n "checking for posix getpwuid_r... " >&6; } +if ${ac_cv_func_posix_getpwuid_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -int -main () -{ -pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; - ; - return 0; + +#include +#include +int main () { + char buffer[10000]; + struct passwd pwd, *pwptr = &pwd; + int error; + errno = 0; + error = getpwuid_r (0, &pwd, buffer, + sizeof (buffer), &pwptr); + return (error < 0 && errno == ENOSYS) + || error == ENOSYS; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_threads=posix +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_posix_getpwuid_r=yes +else + ac_cv_func_posix_getpwuid_r=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "x$have_threads" = xno; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -pthread_mutex_t m; - pthread_mutex_init (&m, pthread_mutexattr_default); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_threads=dce +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # Tru64Unix requires -pthread to find pthread.h. See #103020 - CPPFLAGS="$CPPFLAGS -pthread" - if test "x$have_threads" = xno; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_posix_getpwuid_r" >&5 +$as_echo "$ac_cv_func_posix_getpwuid_r" >&6; } + if test "x${ac_cv_func_posix_getpwuid_r+set}" != "xset" ; then + as_fn_error $? "ac_cv_func_posix_getpwuid_r must be set in cache file when cross-compiling." "$LINENO" 5 +fi + + if test "$ac_cv_func_posix_getpwuid_r" = yes; then + +$as_echo "#define HAVE_POSIX_GETPWUID_R 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nonposix getpwuid_r" >&5 +$as_echo_n "checking for nonposix getpwuid_r... " >&6; } +if ${ac_cv_func_nonposix_getpwuid_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main () { -pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; +char buffer[10000]; + struct passwd pwd; + getpwuid_r (0, &pwd, buffer, + sizeof (buffer)); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_threads=posix -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - CPPFLAGS="$glib_save_CPPFLAGS" -fi -if test "x$want_threads" = xyes || test "x$want_threads" = xwin32; then - case $host in - *-*-mingw*) - have_threads=win32 - ;; - esac +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_nonposix_getpwuid_r=yes +else + ac_cv_func_nonposix_getpwuid_r=no fi -if test "x$want_threads" = xnone; then - have_threads=none +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread implementation" >&5 -$as_echo_n "checking for thread implementation... " >&6; } - -if test "x$have_threads" = xno && test "x$want_threads" != xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none available" >&5 -$as_echo "none available" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $THREAD_NO_IMPLEMENTATION" >&5 -$as_echo "$as_me: WARNING: $THREAD_NO_IMPLEMENTATION" >&2;} -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_threads" >&5 -$as_echo "$have_threads" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_nonposix_getpwuid_r" >&5 +$as_echo "$ac_cv_func_nonposix_getpwuid_r" >&6; } + if test "x${ac_cv_func_nonposix_getpwuid_r+set}" != "xset" ; then + as_fn_error $? "ac_cv_func_nonposix_getpwuid_r must be set in cache file when cross-compiling." "$LINENO" 5 fi + if test "$ac_cv_func_nonposix_getpwuid_r" = yes; then +$as_echo "#define HAVE_NONPOSIX_GETPWUID_R 1" >>confdefs.h -G_THREAD_LIBS= -G_THREAD_LIBS_EXTRA= -G_THREAD_CFLAGS= - + fi + fi + fi + if test "$ac_cv_header_grp_h" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix getgrgid_r" >&5 +$as_echo_n "checking for posix getgrgid_r... " >&6; } +if ${ac_cv_func_posix_getgrgid_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int main () { + char buffer[10000]; + struct group grp, *grpptr = &grp; + int error; + errno = 0; + error = getgrgid_r (0, &grp, buffer, + sizeof (buffer), &grpptr); + return (error < 0 && errno == ENOSYS) + || error == ENOSYS; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_posix_getgrgid_r=yes +else + ac_cv_func_posix_getgrgid_r=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_posix_getgrgid_r" >&5 +$as_echo "$ac_cv_func_posix_getgrgid_r" >&6; } + if test "x${ac_cv_func_posix_getgrgid_r+set}" != "xset" ; then + as_fn_error $? "ac_cv_func_posix_getgrgid_r must be set in cache file when cross-compiling." "$LINENO" 5 +fi + if test "$ac_cv_func_posix_getgrgid_r" = yes; then -if test x"$have_threads" != xno; then +$as_echo "#define HAVE_POSIX_GETGRGID_R 1" >>confdefs.h - if test x"$have_threads" = xposix; then - # First we test for posix, whether -pthread or -pthreads do the trick as - # both CPPFLAG and LIBS. - # One of them does for most gcc versions and some other platforms/compilers - # too and could be considered as the canonical way to go. - case $host in - *-*-cygwin*|*-*-darwin*) - # skip cygwin and darwin -pthread or -pthreads test - ;; - *-solaris*) - # These compiler/linker flags work with both Sun Studio and gcc - # Sun Studio expands -mt to -D_REENTRANT and -lthread - # gcc expands -pthreads to -D_REENTRANT -D_PTHREADS -lpthread - G_THREAD_CFLAGS="-D_REENTRANT -D_PTHREADS" - G_THREAD_LIBS="-lpthread -lthread" - ;; - *) - for flag in pthread pthreads mt; do - glib_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -$flag" - if test "$cross_compiling" = yes; then : + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nonposix getgrgid_r" >&5 +$as_echo_n "checking for nonposix getgrgid_r... " >&6; } +if ${ac_cv_func_nonposix_getgrgid_r+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include -int check_me = 0; -void* func(void* data) {check_me = 42; return &check_me;} -int main() - { pthread_t t; - void *ret; - pthread_create (&t, 0, func, 0); - pthread_join (t, &ret); - return (check_me != 42 || ret != &check_me); +#include +int +main () +{ +char buffer[10000]; + struct group grp; + getgrgid_r (0, &grp, buffer, + sizeof (buffer)); + ; + return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - glib_flag_works=yes + ac_cv_func_nonposix_getgrgid_r=yes else - glib_flag_works=no + ac_cv_func_nonposix_getgrgid_r=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int check_me = 0; -void* func(void* data) {check_me = 42; return &check_me;} -int main() - { pthread_t t; - void *ret; - pthread_create (&t, 0, func, 0); - pthread_join (t, &ret); - return (check_me != 42 || ret != &check_me); -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_flag_works=yes -else - glib_flag_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_nonposix_getgrgid_r" >&5 +$as_echo "$ac_cv_func_nonposix_getgrgid_r" >&6; } + if test "x${ac_cv_func_nonposix_getgrgid_r+set}" != "xset" ; then + as_fn_error $? "ac_cv_func_nonposix_getgrgid_r must be set in cache file when cross-compiling." "$LINENO" 5 fi - CFLAGS="$glib_save_CFLAGS" - if test $glib_flag_works = yes ; then - G_THREAD_CFLAGS=-$flag - G_THREAD_LIBS=-$flag - break; - fi - done - ;; - esac - fi - - if test x"$G_THREAD_CFLAGS" = x; then + if test "$ac_cv_func_nonposix_getgrgid_r" = yes; then - # The canonical -pthread[s] does not work. Try something different. +$as_echo "#define HAVE_NONPOSIX_GETGRGID_R 1" >>confdefs.h - case $host in - *-aix*) - if test x"$GCC" = xyes; then - # GCC 3.0 and above needs -pthread. - # Should be coverd by the case above. - # GCC 2.x and below needs -mthreads - G_THREAD_CFLAGS="-mthreads" - G_THREAD_LIBS=$G_THREAD_CFLAGS - else - # We are probably using the aix compiler. Normaly a - # program would have to be compiled with the _r variant - # of the corresponding compiler, but we as GLib cannot - # do that: but the good news is that for compiling the - # only difference is the added -D_THREAD_SAFE compile - # option. This is according to the "C for AIX User's - # Guide". - G_THREAD_CFLAGS="-D_THREAD_SAFE" + fi fi - ;; - *-dg-dgux*) # DG/UX - G_THREAD_CFLAGS="-D_REENTRANT -D_POSIX4A_DRAFT10_SOURCE" - ;; - *-osf*) - # So we are using dce threads. posix threads are already - # catched above. - G_THREAD_CFLAGS="-threads" - G_THREAD_LIBS=$G_THREAD_CFLAGS - ;; - *-sysv5uw7*) # UnixWare 7 - # We are not using gcc with -pthread. Catched above. - G_THREAD_CFLAGS="-Kthread" - G_THREAD_LIBS=$G_THREAD_CFLAGS - ;; - *-mingw*) - # No flag needed when using MSVCRT.DLL - G_THREAD_CFLAGS="" - ;; - *) - G_THREAD_CFLAGS="-D_REENTRANT" # good default guess otherwise - ;; - esac + fi + LIBS="$G_THREAD_LIBS $LIBS" + if test x"$have_threads" = xposix; then + glib_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } +if ${glib_cv_sizeof_system_thread+:} false; then : + $as_echo_n "(cached) " >&6 +else + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if ac_fn_c_compute_int "$LINENO" "(long) (sizeof (pthread_t))" "glib_cv_sizeof_system_thread" "#include +"; then : - fi +else + as_fn_error $? "cannot compute sizeof (pthread_t), 77" "$LINENO" 5 +fi - # if we are not finding the localtime_r function, then we probably are - # not using the proper multithread flag - glib_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS" - # First we test, whether localtime_r is declared in time.h - # directly. Then we test whether a macro localtime_r exists, in - # which case localtime_r in the test program is replaced and thus - # if we still find localtime_r in the output, it is not defined as - # a macro. +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_system_thread" >&5 +$as_echo "$glib_cv_sizeof_system_thread" >&6; } +cat >>confdefs.h <<_ACEOF +#define GLIB_SIZEOF_SYSTEM_THREAD $glib_cv_sizeof_system_thread +_ACEOF - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + # This is not AC_CHECK_FUNC to also work with function + # name mangling in header files. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_setstacksize" >&5 +$as_echo_n "checking for pthread_attr_setstacksize... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +int +main () +{ +pthread_attr_t t; pthread_attr_setstacksize(&t,0) + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]" >/dev/null 2>&1; then : +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for minimal/maximal thread priority" >&5 +$as_echo_n "checking for minimal/maximal thread priority... " >&6; } + if test x"$posix_priority_min" = x; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - localtime_r(a,b) +#include + PX_PRIO_MIN _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FLAG_DOES_NOT_WORK" >&5 -$as_echo "$as_me: WARNING: $FLAG_DOES_NOT_WORK" >&2;} -fi -rm -f conftest* + $EGREP "PX_PRIO_MIN" >/dev/null 2>&1; then : + +else + posix_priority_min=PX_PRIO_MIN + posix_priority_max=PX_PRIO_MAX fi rm -f conftest* + fi + if test x"$posix_priority_min" = x; then + # AIX + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + PTHREAD_PRIO_MIN +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "PTHREAD_PRIO_MIN" >/dev/null 2>&1; then : - CPPFLAGS="$glib_save_CPPFLAGS" +else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread related cflags" >&5 -$as_echo_n "checking thread related cflags... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $G_THREAD_CFLAGS" >&5 -$as_echo "$G_THREAD_CFLAGS" >&6; } - CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS" + posix_priority_min=PTHREAD_PRIO_MIN + posix_priority_max=PTHREAD_PRIO_MAX fi +rm -f conftest* + fi + if test x"$posix_priority_min" = x; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + PRI_OTHER_MIN +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "PRI_OTHER_MIN" >/dev/null 2>&1; then : -mutex_has_default=no -case $have_threads in - posix|dce) - glib_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" - if test x"$G_THREAD_LIBS" = x; then - case $host in - *-aix*) - # We are not using gcc (would have set G_THREAD_LIBS) and thus - # probably using the aix compiler. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $AIX_COMPILE_INFO" >&5 -$as_echo "$as_me: WARNING: $AIX_COMPILE_INFO" >&2;} - ;; - *) - G_THREAD_LIBS=error - glib_save_LIBS="$LIBS" - for thread_lib in "" pthread pthread32 pthreads thread dce; do - if test x"$thread_lib" = x; then - add_thread_lib="" - IN="" - else - add_thread_lib="-l$thread_lib" - IN=" in -l$thread_lib" - fi - if test x"$have_threads" = xposix; then - defattr=0 - else - defattr=pthread_attr_default - fi - - LIBS="$add_thread_lib $glib_save_LIBS" +else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create/pthread_join$IN" >&5 -$as_echo_n "checking for pthread_create/pthread_join$IN... " >&6; } - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + posix_priority_min=PRI_OTHER_MIN + posix_priority_max=PRI_OTHER_MAX +fi +rm -f conftest* + fi + if test x"$posix_priority_min" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5 +$as_echo "none found" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $POSIX_NO_PRIORITIES" >&5 +$as_echo "$as_me: WARNING: $POSIX_NO_PRIORITIES" >&2;} + posix_priority_min=-1 + posix_priority_max=-1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $posix_priority_min/$posix_priority_max" >&5 +$as_echo "$posix_priority_min/$posix_priority_max" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setschedparam" >&5 +$as_echo_n "checking for pthread_setschedparam... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include -int check_me = 0; -void* func(void* data) {check_me = 42; return &check_me;} -int main() - { pthread_t t; - void *ret; - pthread_create (&t, $defattr, func, 0); - pthread_join (t, &ret); - return (check_me != 42 || ret != &check_me); +int +main () +{ +pthread_t t; pthread_setschedparam(t, 0, NULL) + ; + return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - glib_result=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define POSIX_MIN_PRIORITY $posix_priority_min +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define POSIX_MAX_PRIORITY $posix_priority_max +_ACEOF + else - glib_result=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $POSIX_NO_PRIORITIES" >&5 +$as_echo "$as_me: WARNING: $POSIX_NO_PRIORITIES" >&2;} fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + fi + posix_yield_func=none + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix yield function" >&5 +$as_echo_n "checking for posix yield function... " >&6; } + for yield_func in sched_yield pthread_yield_np pthread_yield \ + thr_yield; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -int check_me = 0; -void* func(void* data) {check_me = 42; return &check_me;} -int main() - { pthread_t t; - void *ret; - pthread_create (&t, $defattr, func, 0); - pthread_join (t, &ret); - return (check_me != 42 || ret != &check_me); +int +main () +{ +$yield_func() + ; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_result=yes -else - glib_result=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + posix_yield_func="$yield_func" + break fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_result" >&5 -$as_echo "$glib_result" >&6; } - - if test "$glib_result" = "yes" ; then - G_THREAD_LIBS="$add_thread_lib" - break - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext done - if test "x$G_THREAD_LIBS" = xerror; then - as_fn_error "$LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2" "$LINENO" 5 + if test x"$posix_yield_func" = xnone; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5 +$as_echo "none found" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $POSIX_NO_YIELD" >&5 +$as_echo "$as_me: WARNING: $POSIX_NO_YIELD" >&2;} + posix_yield_func="g_usleep(1000)" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $posix_yield_func" >&5 +$as_echo "$posix_yield_func" >&6; } + posix_yield_func="$posix_yield_func()" fi - LIBS="$glib_save_LIBS" - ;; - esac - fi - glib_save_LIBS="$LIBS" - for thread_lib in "" rt rte; do - if test x"$thread_lib" = x; then - add_thread_lib="" - IN="" - else - add_thread_lib="-l$thread_lib" - IN=" in -l$thread_lib" - fi - LIBS="$add_thread_lib $glib_save_LIBS" +cat >>confdefs.h <<_ACEOF +#define POSIX_YIELD_FUNC $posix_yield_func +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_get_priority_min$IN" >&5 -$as_echo_n "checking for sched_get_priority_min$IN... " >&6; } - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CPPFLAGS="$glib_save_CPPFLAGS" -#include -#include -int main() { - errno = 0; - return sched_get_priority_min(SCHED_OTHER)==-1 - && errno != 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - glib_result=yes + elif test x"$have_threads" = xwin32; then + # It's a pointer to a private struct + { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct _GThreadData *" >&5 +$as_echo_n "checking size of struct _GThreadData *... " >&6; } +if ${glib_cv_sizeof_system_thread+:} false; then : + $as_echo_n "(cached) " >&6 else - glib_result=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if ac_fn_c_compute_int "$LINENO" "(long) (sizeof (struct _GThreadData *))" "glib_cv_sizeof_system_thread" "$ac_includes_default"; then : + else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + as_fn_error $? "cannot compute sizeof (struct _GThreadData *), 77" "$LINENO" 5 +fi -#include -#include -int main() { - errno = 0; - return sched_get_priority_min(SCHED_OTHER)==-1 - && errno != 0; -} + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_system_thread" >&5 +$as_echo "$glib_cv_sizeof_system_thread" >&6; } +cat >>confdefs.h <<_ACEOF +#define GLIB_SIZEOF_SYSTEM_THREAD $glib_cv_sizeof_system_thread _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_result=yes -else - glib_result=no + + + fi + + LIBS="$glib_save_LIBS" + + # now spit out all the warnings. + if test "$ac_cv_func_posix_getpwuid_r" != "yes" && + test "$ac_cv_func_nonposix_getpwuid_r" != "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FUNC_NO_GETPWUID_R" >&5 +$as_echo "$as_me: WARNING: $FUNC_NO_GETPWUID_R" >&2;} + fi + if test "$ac_cv_func_localtime_r" != "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FUNC_NO_LOCALTIME_R" >&5 +$as_echo "$as_me: WARNING: $FUNC_NO_LOCALTIME_R" >&2;} + fi fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + +if test x"$glib_cv_sizeof_system_thread" = x; then + # use a pointer as a fallback. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${glib_cv_sizeof_system_thread+:} false; then : + $as_echo_n "(cached) " >&6 +else + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if ac_fn_c_compute_int "$LINENO" "(long) (sizeof (void *))" "glib_cv_sizeof_system_thread" "$ac_includes_default"; then : + +else + as_fn_error $? "cannot compute sizeof (void *), 77" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_result" >&5 -$as_echo "$glib_result" >&6; } - if test "$glib_result" = "yes" ; then - G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib" - posix_priority_min="sched_get_priority_min(SCHED_OTHER)" - posix_priority_max="sched_get_priority_max(SCHED_OTHER)" - break - fi - done - LIBS="$glib_save_LIBS" - mutex_has_default=yes - mutex_default_type='pthread_mutex_t' - mutex_default_init='PTHREAD_MUTEX_INITIALIZER' - mutex_header_file='pthread.h' - if test "x$have_threads" = "xposix"; then - g_threads_impl="POSIX" - else - g_threads_impl="DCE" - have_threads="posix" - fi - CPPFLAGS="$glib_save_CPPFLAGS" - ;; - win32) - g_threads_impl="WIN32" - ;; - none|no) - g_threads_impl="NONE" - ;; - *) - g_threads_impl="NONE" - G_THREAD_LIBS=error - ;; -esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_system_thread" >&5 +$as_echo "$glib_cv_sizeof_system_thread" >&6; } +cat >>confdefs.h <<_ACEOF +#define GLIB_SIZEOF_SYSTEM_THREAD $glib_cv_sizeof_system_thread +_ACEOF + -if test "x$G_THREAD_LIBS" = xerror; then - as_fn_error "$LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2" "$LINENO" 5 fi +# +# Hack to deal with: +# +# a) GCC < 3.3 for Linux doesn't include -lpthread when +# building shared libraries with linux. +# b) FreeBSD doesn't do this either. +# case $host in - *-*-beos*) - G_THREAD_LIBS="-lbe -lroot -lglib-2.0 " - G_THREAD_LIBS_EXTRA="-L\$(top_builddir_full)/.libs" + *-*-freebsd*|*-*-linux*) + G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`" ;; *) + G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking thread related libraries" >&5 -$as_echo_n "checking thread related libraries... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $G_THREAD_LIBS" >&5 -$as_echo "$G_THREAD_LIBS" >&6; } + if test "$have_threads" != "none"; then + HAVE_THREADS_TRUE= + HAVE_THREADS_FALSE='#' +else + HAVE_THREADS_TRUE='#' + HAVE_THREADS_FALSE= +fi -if test x"$have_threads" != xno; then - glib_save_LIBS="$LIBS" - # we are not doing the following for now, as this might require glib - # to always be linked with the thread libs on some platforms. - # LIBS="$LIBS $G_THREAD_LIBS" - for ac_func in localtime_r gmtime_r -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define G_THREAD_SOURCE "gthread-$have_threads.c" _ACEOF -fi -done - - if test "$ac_cv_header_pwd_h" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix getpwuid_r" >&5 -$as_echo_n "checking for posix getpwuid_r... " >&6; } -if test "${ac_cv_func_posix_getpwuid_r+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int main () { - char buffer[10000]; - struct passwd pwd, *pwptr = &pwd; - int error; - errno = 0; - error = getpwuid_r (0, &pwd, buffer, - sizeof (buffer), &pwptr); - return (error < 0 && errno == ENOSYS) - || error == ENOSYS; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_posix_getpwuid_r=yes -else - ac_cv_func_posix_getpwuid_r=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_posix_getpwuid_r" >&5 -$as_echo "$ac_cv_func_posix_getpwuid_r" >&6; } - if test "x${ac_cv_func_posix_getpwuid_r+set}" != "xset" ; then - as_fn_error "ac_cv_func_posix_getpwuid_r must be set in cache file when cross-compiling." "$LINENO" 5 -fi - if test "$ac_cv_func_posix_getpwuid_r" = yes; then -$as_echo "#define HAVE_POSIX_GETPWUID_R 1" >>confdefs.h - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nonposix getpwuid_r" >&5 -$as_echo_n "checking for nonposix getpwuid_r... " >&6; } -if test "${ac_cv_func_nonposix_getpwuid_r+set}" = set; then : +if test $mutex_has_default = yes ; then + glib_save_CPPFLAGS="$CPPFLAGS" + glib_save_LIBS="$LIBS" + LIBS="$G_THREAD_LIBS $LIBS" + CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of $mutex_default_type" >&5 +$as_echo_n "checking size of $mutex_default_type... " >&6; } +if ${glib_cv_sizeof_gmutex+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -char buffer[10000]; - struct passwd pwd; - getpwuid_r (0, &pwd, buffer, - sizeof (buffer)); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_func_nonposix_getpwuid_r=yes + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if ac_fn_c_compute_int "$LINENO" "(long) (sizeof ($mutex_default_type))" "glib_cv_sizeof_gmutex" "#include <$mutex_header_file> +"; then : + else - ac_cv_func_nonposix_getpwuid_r=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_nonposix_getpwuid_r" >&5 -$as_echo "$ac_cv_func_nonposix_getpwuid_r" >&6; } - if test "x${ac_cv_func_nonposix_getpwuid_r+set}" != "xset" ; then - as_fn_error "ac_cv_func_nonposix_getpwuid_r must be set in cache file when cross-compiling." "$LINENO" 5 + as_fn_error $? "cannot compute sizeof ($mutex_default_type), 77" "$LINENO" 5 fi - if test "$ac_cv_func_nonposix_getpwuid_r" = yes; then -$as_echo "#define HAVE_NONPOSIX_GETPWUID_R 1" >>confdefs.h - fi - fi - fi - if test "$ac_cv_header_grp_h" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix getgrgid_r" >&5 -$as_echo_n "checking for posix getgrgid_r... " >&6; } -if test "${ac_cv_func_posix_getgrgid_r+set}" = set; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_gmutex" >&5 +$as_echo "$glib_cv_sizeof_gmutex" >&6; } +cat >>confdefs.h <<_ACEOF +#define GLIB_SIZEOF_GMUTEX $glib_cv_sizeof_gmutex +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking byte contents of $mutex_default_init" >&5 +$as_echo_n "checking byte contents of $mutex_default_init... " >&6; } +if ${glib_cv_byte_contents_gmutex+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } + glib_cv_byte_contents_gmutex=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include -#include -int main () { - char buffer[10000]; - struct group grp, *grpptr = &grp; - int error; - errno = 0; - error = getgrgid_r (0, &grp, buffer, - sizeof (buffer), &grpptr); - return (error < 0 && errno == ENOSYS) - || error == ENOSYS; +#include +#include <$mutex_header_file> +main() +{ + static $mutex_default_type tv = $mutex_default_init; + char *p = (char*) &tv; + int i; + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + for (i = 0; i < $glib_cv_sizeof_gmutex; i++) + fprintf(f, "%s%d", i?",":"", *(p++)); + fprintf(f, "\n"); + exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_posix_getgrgid_r=yes + glib_cv_byte_contents_gmutex=`cat conftestval` else - ac_cv_func_posix_getgrgid_r=no + glib_cv_byte_contents_gmutex=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_posix_getgrgid_r" >&5 -$as_echo "$ac_cv_func_posix_getgrgid_r" >&6; } - if test "x${ac_cv_func_posix_getgrgid_r+set}" != "xset" ; then - as_fn_error "ac_cv_func_posix_getgrgid_r must be set in cache file when cross-compiling." "$LINENO" 5 -fi - - if test "$ac_cv_func_posix_getgrgid_r" = yes; then - -$as_echo "#define HAVE_POSIX_GETGRGID_R 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_byte_contents_gmutex" >&5 +$as_echo "$glib_cv_byte_contents_gmutex" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nonposix getgrgid_r" >&5 -$as_echo_n "checking for nonposix getgrgid_r... " >&6; } -if test "${ac_cv_func_nonposix_getgrgid_r+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -char buffer[10000]; - struct group grp; - getgrgid_r (0, &grp, buffer, - sizeof (buffer)); - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define GLIB_BYTE_CONTENTS_GMUTEX $glib_cv_byte_contents_gmutex _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_func_nonposix_getgrgid_r=yes -else - ac_cv_func_nonposix_getgrgid_r=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_nonposix_getgrgid_r" >&5 -$as_echo "$ac_cv_func_nonposix_getgrgid_r" >&6; } - if test "x${ac_cv_func_nonposix_getgrgid_r+set}" != "xset" ; then - as_fn_error "ac_cv_func_nonposix_getgrgid_r must be set in cache file when cross-compiling." "$LINENO" 5 -fi - if test "$ac_cv_func_nonposix_getgrgid_r" = yes; then - -$as_echo "#define HAVE_NONPOSIX_GETGRGID_R 1" >>confdefs.h - fi - fi + if test x"$glib_cv_byte_contents_gmutex" = xno; then + mutex_has_default=no fi - LIBS="$G_THREAD_LIBS $LIBS" - if test x"$have_threads" = xposix; then - glib_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 -$as_echo_n "checking size of pthread_t... " >&6; } -if test "${glib_cv_sizeof_system_thread+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if ac_fn_c_compute_int "$LINENO" "(long) (sizeof (pthread_t))" "glib_cv_sizeof_system_thread" "#include -"; then : - -else - as_fn_error "cannot compute sizeof (pthread_t), 77" "$LINENO" 5 + CPPFLAGS="$glib_save_CPPFLAGS" + LIBS="$glib_save_LIBS" fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_system_thread" >&5 -$as_echo "$glib_cv_sizeof_system_thread" >&6; } -cat >>confdefs.h <<_ACEOF -#define GLIB_SIZEOF_SYSTEM_THREAD $glib_cv_sizeof_system_thread +for ac_func in clock_gettime +do : + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_GETTIME 1 _ACEOF +else - # This is not AC_CHECK_FUNC to also work with function - # name mangling in header files. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_setstacksize" >&5 -$as_echo_n "checking for pthread_attr_setstacksize... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); int main () { -pthread_attr_t t; pthread_attr_setstacksize(&t,0) +return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h - + ac_cv_lib_rt_clock_gettime=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for minimal/maximal thread priority" >&5 -$as_echo_n "checking for minimal/maximal thread priority... " >&6; } - if test x"$posix_priority_min" = x; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - PX_PRIO_MIN -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "PX_PRIO_MIN" >/dev/null 2>&1; then : - -else - - posix_priority_min=PX_PRIO_MIN - posix_priority_max=PX_PRIO_MAX +LIBS=$ac_check_lib_save_LIBS fi -rm -f conftest* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : - fi - if test x"$posix_priority_min" = x; then - # AIX - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - PTHREAD_PRIO_MIN -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "PTHREAD_PRIO_MIN" >/dev/null 2>&1; then : + $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h -else + G_THREAD_LIBS="$G_THREAD_LIBS -lrt" + G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS_FOR_GTHREAD -lrt" + GLIB_RT_LIBS="-lrt" - posix_priority_min=PTHREAD_PRIO_MIN - posix_priority_max=PTHREAD_PRIO_MAX fi -rm -f conftest* - - fi - if test x"$posix_priority_min" = x; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - PRI_OTHER_MIN -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "PRI_OTHER_MIN" >/dev/null 2>&1; then : -else - posix_priority_min=PRI_OTHER_MIN - posix_priority_max=PRI_OTHER_MAX fi -rm -f conftest* +done - fi - if test x"$posix_priority_min" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5 -$as_echo "none found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $POSIX_NO_PRIORITIES" >&5 -$as_echo "$as_me: WARNING: $POSIX_NO_PRIORITIES" >&2;} - posix_priority_min=-1 - posix_priority_max=-1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $posix_priority_min/$posix_priority_max" >&5 -$as_echo "$posix_priority_min/$posix_priority_max" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setschedparam" >&5 -$as_echo_n "checking for pthread_setschedparam... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for monotonic clocks" >&5 +$as_echo_n "checking for monotonic clocks... " >&6; } +if ${glib_cv_monotonic_clock+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -int -main () -{ -pthread_t t; pthread_setschedparam(t, 0, NULL) - ; - return 0; + +#include +#include +int main() { +#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)) + #error No monotonic clock +#endif + return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define POSIX_MIN_PRIORITY $posix_priority_min _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glib_cv_monotonic_clock=yes +else + glib_cv_monotonic_clock=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_monotonic_clock" >&5 +$as_echo "$glib_cv_monotonic_clock" >&6; } +if test "$glib_cv_monotonic_clock" = "yes"; then +$as_echo "#define HAVE_MONOTONIC_CLOCK 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define POSIX_MAX_PRIORITY $posix_priority_max -_ACEOF - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $POSIX_NO_PRIORITIES" >&5 -$as_echo "$as_me: WARNING: $POSIX_NO_PRIORITIES" >&2;} fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - posix_yield_func=none - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix yield function" >&5 -$as_echo_n "checking for posix yield function... " >&6; } - for yield_func in sched_yield pthread_yield_np pthread_yield \ - thr_yield; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use assembler code for atomic operations" >&5 +$as_echo_n "checking whether to use assembler code for atomic operations... " >&6; } + +glib_cv_gcc_has_builtin_atomic_operations=no +if test x"$GCC" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC supports build-in atomic intrinsics" >&5 +$as_echo_n "checking whether GCC supports build-in atomic intrinsics... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + int main () { -$yield_func() +int i; + __sync_synchronize (); + __sync_bool_compare_and_swap (&i, 0, 1); + __sync_fetch_and_add (&i, 1); + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - posix_yield_func="$yield_func" - break + glib_cv_gcc_has_builtin_atomic_operations=yes +else + glib_cv_gcc_has_builtin_atomic_operations=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - done - if test x"$posix_yield_func" = xnone; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5 -$as_echo "none found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $POSIX_NO_YIELD" >&5 -$as_echo "$as_me: WARNING: $POSIX_NO_YIELD" >&2;} - posix_yield_func="g_usleep(1000)" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $posix_yield_func" >&5 -$as_echo "$posix_yield_func" >&6; } - posix_yield_func="$posix_yield_func()" - fi - -cat >>confdefs.h <<_ACEOF -#define POSIX_YIELD_FUNC $posix_yield_func -_ACEOF - - CPPFLAGS="$glib_save_CPPFLAGS" - - elif test x"$have_threads" = xwin32; then - # It's a pointer to a private struct - { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct _GThreadData *" >&5 -$as_echo_n "checking size of struct _GThreadData *... " >&6; } -if test "${glib_cv_sizeof_system_thread+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if ac_fn_c_compute_int "$LINENO" "(long) (sizeof (struct _GThreadData *))" "glib_cv_sizeof_system_thread" "$ac_includes_default"; then : - -else - as_fn_error "cannot compute sizeof (struct _GThreadData *), 77" "$LINENO" 5 -fi - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_gcc_has_builtin_atomic_operations" >&5 +$as_echo "$glib_cv_gcc_has_builtin_atomic_operations" >&6; } + if test $glib_cv_gcc_has_builtin_atomic_operations = yes; then + glib_memory_barrier_needed=yes + else + case $host_cpu in + i386) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + glib_memory_barrier_needed=no + ;; + i?86) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: i486" >&5 +$as_echo "i486" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_system_thread" >&5 -$as_echo "$glib_cv_sizeof_system_thread" >&6; } cat >>confdefs.h <<_ACEOF -#define GLIB_SIZEOF_SYSTEM_THREAD $glib_cv_sizeof_system_thread +#define G_ATOMIC_I486 1 _ACEOF + glib_memory_barrier_needed=no + ;; + sparc*) + SPARCV9_WARNING="Try to rerun configure with CFLAGS='-mcpu=v9', + when you are using a sparc with v9 instruction set (most + sparcs nowadays). This will make the code for atomic + operations much faster. The resulting code will not run + on very old sparcs though." - fi - - LIBS="$glib_save_LIBS" - - # now spit out all the warnings. - if test "$ac_cv_func_posix_getpwuid_r" != "yes" && - test "$ac_cv_func_nonposix_getpwuid_r" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FUNC_NO_GETPWUID_R" >&5 -$as_echo "$as_me: WARNING: $FUNC_NO_GETPWUID_R" >&2;} - fi - if test "$ac_cv_func_localtime_r" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FUNC_NO_LOCALTIME_R" >&5 -$as_echo "$as_me: WARNING: $FUNC_NO_LOCALTIME_R" >&2;} - fi -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if test x"$glib_cv_sizeof_system_thread" = x; then - # use a pointer as a fallback. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if test "${glib_cv_sizeof_system_thread+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if ac_fn_c_compute_int "$LINENO" "(long) (sizeof (void *))" "glib_cv_sizeof_system_thread" "$ac_includes_default"; then : + main () + { + int tmp1, tmp2, tmp3; + __asm__ __volatile__("casx [%2], %0, %1" + : "=&r" (tmp1), "=&r" (tmp2) : "r" (&tmp3)); + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: sparcv9" >&5 +$as_echo "sparcv9" >&6; } + +cat >>confdefs.h <<_ACEOF +#define G_ATOMIC_SPARCV9 1 +_ACEOF else - as_fn_error "cannot compute sizeof (void *), 77" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $SPARCV9_WARNING" >&5 +$as_echo "$as_me: WARNING: $SPARCV9_WARNING" >&2;} fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + glib_memory_barrier_needed=yes + ;; + alpha*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: alpha" >&5 +$as_echo "alpha" >&6; } +cat >>confdefs.h <<_ACEOF +#define G_ATOMIC_ALPHA 1 +_ACEOF + glib_memory_barrier_needed=yes + ;; + x86_64) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: x86_64" >&5 +$as_echo "x86_64" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_system_thread" >&5 -$as_echo "$glib_cv_sizeof_system_thread" >&6; } cat >>confdefs.h <<_ACEOF -#define GLIB_SIZEOF_SYSTEM_THREAD $glib_cv_sizeof_system_thread +#define G_ATOMIC_X86_64 1 _ACEOF + glib_memory_barrier_needed=no + ;; + powerpc*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: powerpc" >&5 +$as_echo "powerpc" >&6; } -fi +cat >>confdefs.h <<_ACEOF +#define G_ATOMIC_POWERPC 1 +_ACEOF -# -# Hack to deal with: -# -# a) GCC < 3.3 for Linux doesn't include -lpthread when -# building shared libraries with linux. -# b) FreeBSD doesn't do this either. -# -case $host in - *-*-freebsd*|*-*-linux*) - G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`" - ;; - *) - G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" - ;; -esac + glib_memory_barrier_needed=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether asm supports numbered local labels" >&5 +$as_echo_n "checking whether asm supports numbered local labels... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "$have_threads" != "none"; then - HAVE_THREADS_TRUE= - HAVE_THREADS_FALSE='#' -else - HAVE_THREADS_TRUE='#' - HAVE_THREADS_FALSE= -fi +int +main () +{ + __asm__ __volatile__ ("1: nop\n" + " bne- 1b") -cat >>confdefs.h <<_ACEOF -#define G_THREAD_SOURCE "gthread-$have_threads.c" + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : +cat >>confdefs.h <<_ACEOF +#define ASM_NUMERIC_LABELS 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } - - -if test $mutex_has_default = yes ; then - glib_save_CPPFLAGS="$CPPFLAGS" - glib_save_LIBS="$LIBS" - LIBS="$G_THREAD_LIBS $LIBS" - CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of $mutex_default_type" >&5 -$as_echo_n "checking size of $mutex_default_type... " >&6; } -if test "${glib_cv_sizeof_gmutex+set}" = set; then : - $as_echo_n "(cached) " >&6 else - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if ac_fn_c_compute_int "$LINENO" "(long) (sizeof ($mutex_default_type))" "glib_cv_sizeof_gmutex" "#include <$mutex_header_file> -"; then : -else - as_fn_error "cannot compute sizeof ($mutex_default_type), 77" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + ia64) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ia64" >&5 +$as_echo "ia64" >&6; } +cat >>confdefs.h <<_ACEOF +#define G_ATOMIC_IA64 1 +_ACEOF + glib_memory_barrier_needed=yes + ;; + s390|s390x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: s390" >&5 +$as_echo "s390" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_sizeof_gmutex" >&5 -$as_echo "$glib_cv_sizeof_gmutex" >&6; } cat >>confdefs.h <<_ACEOF -#define GLIB_SIZEOF_GMUTEX $glib_cv_sizeof_gmutex +#define G_ATOMIC_S390 1 _ACEOF + glib_memory_barrier_needed=no + ;; + arm*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: arm" >&5 +$as_echo "arm" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking byte contents of $mutex_default_init" >&5 -$as_echo_n "checking byte contents of $mutex_default_init... " >&6; } -if test "${glib_cv_byte_contents_gmutex+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - glib_cv_byte_contents_gmutex=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$mutex_header_file> -main() -{ - static $mutex_default_type tv = $mutex_default_init; - char *p = (char*) &tv; - int i; - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - for (i = 0; i < $glib_cv_sizeof_gmutex; i++) - fprintf(f, "%s%d", i?",":"", *(p++)); - fprintf(f, "\n"); - exit(0); -} +cat >>confdefs.h <<_ACEOF +#define G_ATOMIC_ARM 1 _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_cv_byte_contents_gmutex=`cat conftestval` -else - glib_cv_byte_contents_gmutex=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_byte_contents_gmutex" >&5 -$as_echo "$glib_cv_byte_contents_gmutex" >&6; } + glib_memory_barrier_needed=no + ;; + crisv32*|etraxfs*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: crisv32" >&5 +$as_echo "crisv32" >&6; } cat >>confdefs.h <<_ACEOF -#define GLIB_BYTE_CONTENTS_GMUTEX $glib_cv_byte_contents_gmutex +#define G_ATOMIC_CRISV32 1 _ACEOF + glib_memory_barrier_needed=no + ;; + cris*|etrax*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cris" >&5 +$as_echo "cris" >&6; } - if test x"$glib_cv_byte_contents_gmutex" = xno; then - mutex_has_default=no - fi - CPPFLAGS="$glib_save_CPPFLAGS" - LIBS="$glib_save_LIBS" -fi - -for ac_func in clock_gettime -do : - ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" -if test "x$ac_cv_func_clock_gettime" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_GETTIME 1 +cat >>confdefs.h <<_ACEOF +#define G_ATOMIC_CRIS 1 _ACEOF + glib_memory_barrier_needed=no + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + glib_memory_barrier_needed=yes + ;; + esac + fi else + if test $glib_native_win32 = yes; then + # For Windows but not using gcc. No barriers needed then either. + glib_memory_barrier_needed=no + fi +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 -$as_echo_n "checking for clock_gettime in -lrt... " >&6; } -if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test $glib_cv_gcc_has_builtin_atomic_operations = yes; then + HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE= + HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE='#' else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $LIBS" + HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE='#' + HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for futex(2) system call" >&5 +$as_echo_n "checking for futex(2) system call... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); +#include +#include +#include + int -main () +main (void) { -return clock_gettime (); - ; + /* it's not like this actually runs or anything... */ + syscall (SYS_futex, NULL, FUTEX_WAKE, FUTEX_WAIT); return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_rt_clock_gettime=yes -else - ac_cv_lib_rt_clock_gettime=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 -$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } -if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then : +if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } - G_THREAD_LIBS="$G_THREAD_LIBS -lrt" - G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS_FOR_GTHREAD -lrt" +$as_echo "#define HAVE_FUTEX test \"\$have_futex\" = \"yes\"" >>confdefs.h -fi +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for monotonic clocks" >&5 -$as_echo_n "checking for monotonic clocks... " >&6; } -if test "${glib_cv_monotonic_clock+set}" = set; then : +glib_poll_includes=" +#include +#include +" + +if test $ac_cv_header_sys_types_h = yes && + test $ac_cv_header_sys_poll_h = yes ; then + glib_failed=false + { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLIN" >&5 +$as_echo_n "checking value of POLLIN... " >&6; } +if ${glib_cv_value_POLLIN+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -int main() { -#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)) - #error No monotonic clock -#endif - return 0; -} + if ac_fn_c_compute_int "$LINENO" "POLLIN" "glib_cv_value_POLLIN" "$glib_poll_includes"; then : -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - glib_cv_monotonic_clock=yes else - glib_cv_monotonic_clock=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + glib_failed=true fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_monotonic_clock" >&5 -$as_echo "$glib_cv_monotonic_clock" >&6; } -if test "$glib_cv_monotonic_clock" = "yes"; then -$as_echo "#define HAVE_MONOTONIC_CLOCK 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLIN" >&5 +$as_echo "$glib_cv_value_POLLIN" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLOUT" >&5 +$as_echo_n "checking value of POLLOUT... " >&6; } +if ${glib_cv_value_POLLOUT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "POLLOUT" "glib_cv_value_POLLOUT" "$glib_poll_includes"; then : +else + glib_failed=true +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use assembler code for atomic operations" >&5 -$as_echo_n "checking whether to use assembler code for atomic operations... " >&6; } -glib_cv_gcc_has_builtin_atomic_operations=no -if test x"$GCC" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC supports build-in atomic intrinsics" >&5 -$as_echo_n "checking whether GCC supports build-in atomic intrinsics... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLOUT" >&5 +$as_echo "$glib_cv_value_POLLOUT" >&6; } -int -main () -{ -int i; - __sync_synchronize (); - __sync_bool_compare_and_swap (&i, 0, 1); - __sync_fetch_and_add (&i, 1); + { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLPRI" >&5 +$as_echo_n "checking value of POLLPRI... " >&6; } +if ${glib_cv_value_POLLPRI+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "POLLPRI" "glib_cv_value_POLLPRI" "$glib_poll_includes"; then : - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - glib_cv_gcc_has_builtin_atomic_operations=yes else - glib_cv_gcc_has_builtin_atomic_operations=no + glib_failed=true fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_gcc_has_builtin_atomic_operations" >&5 -$as_echo "$glib_cv_gcc_has_builtin_atomic_operations" >&6; } - if test $glib_cv_gcc_has_builtin_atomic_operations = yes; then - glib_memory_barrier_needed=yes - else - case $host_cpu in - i386) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - glib_memory_barrier_needed=no - ;; - i?86) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: i486" >&5 -$as_echo "i486" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_I486 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLPRI" >&5 +$as_echo "$glib_cv_value_POLLPRI" >&6; } - glib_memory_barrier_needed=no - ;; - sparc*) - SPARCV9_WARNING="Try to rerun configure with CFLAGS='-mcpu=v9', - when you are using a sparc with v9 instruction set (most - sparcs nowadays). This will make the code for atomic - operations much faster. The resulting code will not run - on very old sparcs though." + { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLERR" >&5 +$as_echo_n "checking value of POLLERR... " >&6; } +if ${glib_cv_value_POLLERR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "POLLERR" "glib_cv_value_POLLERR" "$glib_poll_includes"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else + glib_failed=true +fi - main () - { - int tmp1, tmp2, tmp3; - __asm__ __volatile__("casx [%2], %0, %1" - : "=&r" (tmp1), "=&r" (tmp2) : "r" (&tmp3)); - } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: sparcv9" >&5 -$as_echo "sparcv9" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_SPARCV9 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLERR" >&5 +$as_echo "$glib_cv_value_POLLERR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLHUP" >&5 +$as_echo_n "checking value of POLLHUP... " >&6; } +if ${glib_cv_value_POLLHUP+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $SPARCV9_WARNING" >&5 -$as_echo "$as_me: WARNING: $SPARCV9_WARNING" >&2;} + if ac_fn_c_compute_int "$LINENO" "POLLHUP" "glib_cv_value_POLLHUP" "$glib_poll_includes"; then : + +else + glib_failed=true fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - glib_memory_barrier_needed=yes - ;; - alpha*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: alpha" >&5 -$as_echo "alpha" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_ALPHA 1 -_ACEOF - glib_memory_barrier_needed=yes - ;; - x86_64) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: x86_64" >&5 -$as_echo "x86_64" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLHUP" >&5 +$as_echo "$glib_cv_value_POLLHUP" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_X86_64 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLNVAL" >&5 +$as_echo_n "checking value of POLLNVAL... " >&6; } +if ${glib_cv_value_POLLNVAL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "POLLNVAL" "glib_cv_value_POLLNVAL" "$glib_poll_includes"; then : - glib_memory_barrier_needed=no - ;; - powerpc*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: powerpc" >&5 -$as_echo "powerpc" >&6; } +else + glib_failed=true +fi -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_POWERPC 1 -_ACEOF - glib_memory_barrier_needed=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether asm supports numbered local labels" >&5 -$as_echo_n "checking whether asm supports numbered local labels... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLNVAL" >&5 +$as_echo "$glib_cv_value_POLLNVAL" >&6; } -int -main () -{ + if $glib_failed ; then + as_fn_error $? "Could not determine values for POLL* constants" "$LINENO" 5 + fi +else + glib_cv_value_POLLIN=1 + glib_cv_value_POLLOUT=4 + glib_cv_value_POLLPRI=2 + glib_cv_value_POLLERR=8 + glib_cv_value_POLLHUP=16 + glib_cv_value_POLLNVAL=32 +fi - __asm__ __volatile__ ("1: nop\n" - " bne- 1b") +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll" >&5 +$as_echo_n "checking for broken poll... " >&6; } +if test "$cross_compiling" = yes; then : + broken_poll="no (cross compiling)" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ; - return 0; -} + #include + #include + #include + #ifdef HAVE_SYS_POLL_H + #include + #endif + int main(void) { + struct pollfd fds[1]; + int fd; + fd = open("/dev/null", 1); + fds[0].fd = fd; + fds[0].events = POLLIN; + fds[0].revents = 0; + if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) { + exit(1); /* Does not work for devices -- fail */ + } + exit(0); + } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_run "$LINENO"; then : + broken_poll=no +else + broken_poll=yes +$as_echo "#define BROKEN_POLL 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define ASM_NUMERIC_LABELS 1 -_ACEOF +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $broken_poll" >&5 +$as_echo "$broken_poll" >&6; } +PCRE_REQUIRED_VERSION=7.2 + +# Check if we should compile GRegex +# Check whether --enable-regex was given. +if test "${enable_regex+set}" = set; then : + enableval=$enable_regex; case "${enableval}" in + yes) enable_regex=true ;; + no) enable_regex=false ;; + *) as_fn_error $? "bad value ${enableval} for --enable-regex" "$LINENO" 5 ;; +esac else + enable_regex=true +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if $enable_regex; then + ENABLE_REGEX_TRUE= + ENABLE_REGEX_FALSE='#' +else + ENABLE_REGEX_TRUE='#' + ENABLE_REGEX_FALSE= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - ia64) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ia64" >&5 -$as_echo "ia64" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_IA64 1 -_ACEOF - glib_memory_barrier_needed=yes - ;; - s390|s390x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: s390" >&5 -$as_echo "s390" >&6; } +if test x$enable_regex = xtrue; then -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_S390 1 -_ACEOF +$as_echo "#define ENABLE_REGEX /**/" >>confdefs.h - glib_memory_barrier_needed=no - ;; - arm*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: arm" >&5 -$as_echo "arm" >&6; } + # Check if we should use the internal or the system-supplied pcre -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_ARM 1 -_ACEOF +# Check whether --with-pcre was given. +if test "${with_pcre+set}" = set; then : + withval=$with_pcre; +fi - glib_memory_barrier_needed=no - ;; - crisv32*|etraxfs*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: crisv32" >&5 -$as_echo "crisv32" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_CRISV32 1 -_ACEOF + if test "x$with_pcre" = xsystem; then + USE_SYSTEM_PCRE_TRUE= + USE_SYSTEM_PCRE_FALSE='#' +else + USE_SYSTEM_PCRE_TRUE='#' + USE_SYSTEM_PCRE_FALSE= +fi - glib_memory_barrier_needed=no - ;; - cris*|etrax*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cris" >&5 -$as_echo "cris" >&6; } -cat >>confdefs.h <<_ACEOF -#define G_ATOMIC_CRIS 1 -_ACEOF + if test "x$with_pcre" = xsystem; then - glib_memory_barrier_needed=no - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - glib_memory_barrier_needed=yes - ;; - esac - fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCRE" >&5 +$as_echo_n "checking for PCRE... " >&6; } + +if test -n "$PCRE_CFLAGS"; then + pkg_cv_PCRE_CFLAGS="$PCRE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre >= \$PCRE_REQUIRED_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcre >= $PCRE_REQUIRED_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCRE_CFLAGS=`$PKG_CONFIG --cflags "libpcre >= $PCRE_REQUIRED_VERSION" 2>/dev/null` else - if test $glib_native_win32 = yes; then - # For Windows but not using gcc. No barriers needed then either. - glib_memory_barrier_needed=no - fi + pkg_failed=yes fi - - if test $glib_cv_gcc_has_builtin_atomic_operations = yes; then - HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE= - HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE='#' + else + pkg_failed=untried +fi +if test -n "$PCRE_LIBS"; then + pkg_cv_PCRE_LIBS="$PCRE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre >= \$PCRE_REQUIRED_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcre >= $PCRE_REQUIRED_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCRE_LIBS=`$PKG_CONFIG --libs "libpcre >= $PCRE_REQUIRED_VERSION" 2>/dev/null` else - HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE='#' - HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE= + pkg_failed=yes +fi + else + pkg_failed=untried fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for futex(2) system call" >&5 -$as_echo_n "checking for futex(2) system call... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -int -main (void) -{ - /* it's not like this actually runs or anything... */ - syscall (SYS_futex, NULL, FUTEX_WAKE, FUTEX_WAIT); - return 0; -} +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PCRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpcre >= $PCRE_REQUIRED_VERSION" 2>&1` + else + PCRE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpcre >= $PCRE_REQUIRED_VERSION" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PCRE_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + as_fn_error $? "Package requirements (libpcre >= $PCRE_REQUIRED_VERSION) were not met: -$as_echo "#define HAVE_FUTEX test \"\$have_futex\" = \"yes\"" >>confdefs.h +$PCRE_PKG_ERRORS +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. -else +Alternatively, you may set the environment variables PCRE_CFLAGS +and PCRE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +Alternatively, you may set the environment variables PCRE_CFLAGS +and PCRE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } -glib_poll_includes=" -#include -#include -" +else + PCRE_CFLAGS=$pkg_cv_PCRE_CFLAGS + PCRE_LIBS=$pkg_cv_PCRE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -if test $ac_cv_header_sys_types_h = yes && - test $ac_cv_header_sys_poll_h = yes ; then - glib_failed=false - { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLIN" >&5 -$as_echo_n "checking value of POLLIN... " >&6; } -if test "${glib_cv_value_POLLIN+set}" = set; then : +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Unicode support in PCRE" >&5 +$as_echo_n "checking for Unicode support in PCRE... " >&6; } +if ${glib_cv_pcre_has_unicode+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "POLLIN" "glib_cv_value_POLLIN" "$glib_poll_includes"; then : + glib_save_CFLAGS="$CFLAGS" + glib_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS" + if test "$cross_compiling" = yes; then : + glib_cv_pcre_has_unicode=yes else - glib_failed=true + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int main () { + int support; + pcre_config (PCRE_CONFIG_UTF8, &support); + if (!support) + return 1; + pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &support); + if (!support) + return 1; + return 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + glib_cv_pcre_has_unicode=yes +else + glib_cv_pcre_has_unicode=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + CFLAGS="$glib_save_CFLAGS" + LIBS="$glib_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLIN" >&5 -$as_echo "$glib_cv_value_POLLIN" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_pcre_has_unicode" >&5 +$as_echo "$glib_cv_pcre_has_unicode" >&6; } + if test "$glib_cv_pcre_has_unicode" = "no"; then + as_fn_error $? "*** The system-supplied PCRE does not support Unicode properties or UTF-8." "$LINENO" 5 + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLOUT" >&5 -$as_echo_n "checking value of POLLOUT... " >&6; } -if test "${glib_cv_value_POLLOUT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "POLLOUT" "glib_cv_value_POLLOUT" "$glib_poll_includes"; then : + +$as_echo "#define USE_SYSTEM_PCRE /**/" >>confdefs.h + + PCRE_REQUIRES=libpcre + + else + # If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE + if test x"$GCC" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler understands -Wno-pointer-sign" >&5 +$as_echo_n "checking whether compiler understands -Wno-pointer-sign... " >&6; } + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wno-pointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - glib_failed=true -fi - - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLOUT" >&5 -$as_echo "$glib_cv_value_POLLOUT" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLPRI" >&5 -$as_echo_n "checking value of POLLPRI... " >&6; } -if test "${glib_cv_value_POLLPRI+set}" = set; then : - $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "POLLPRI" "glib_cv_value_POLLPRI" "$glib_poll_includes"; then : - + if false]; then + USE_SYSTEM_PCRE_TRUE= + USE_SYSTEM_PCRE_FALSE='#' else - glib_failed=true + USE_SYSTEM_PCRE_TRUE='#' + USE_SYSTEM_PCRE_FALSE= fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLPRI" >&5 -$as_echo "$glib_cv_value_POLLPRI" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLERR" >&5 -$as_echo_n "checking value of POLLERR... " >&6; } -if test "${glib_cv_value_POLLERR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "POLLERR" "glib_cv_value_POLLERR" "$glib_poll_includes"; then : -else - glib_failed=true -fi +case $host in + *-*-cygwin*) + G_LIBS_EXTRA="-luser32 -lkernel32" + ;; + *-*-mingw*) + G_LIBS_EXTRA="-lws2_32 -lole32" + ;; + *) + G_LIBS_EXTRA="" + ;; +esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLERR" >&5 -$as_echo "$glib_cv_value_POLLERR" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLHUP" >&5 -$as_echo_n "checking value of POLLHUP... " >&6; } -if test "${glib_cv_value_POLLHUP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "POLLHUP" "glib_cv_value_POLLHUP" "$glib_poll_includes"; then : -else - glib_failed=true -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EILSEQ" >&5 +$as_echo_n "checking for EILSEQ... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLHUP" >&5 -$as_echo "$glib_cv_value_POLLHUP" >&6; } +int +main () +{ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking value of POLLNVAL" >&5 -$as_echo_n "checking value of POLLNVAL... " >&6; } -if test "${glib_cv_value_POLLNVAL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "POLLNVAL" "glib_cv_value_POLLNVAL" "$glib_poll_includes"; then : +int error = EILSEQ; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_eilseq=yes else - glib_failed=true + have_eilseq=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_eilseq" >&5 +$as_echo "$have_eilseq" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_value_POLLNVAL" >&5 -$as_echo "$glib_cv_value_POLLNVAL" >&6; } - - if $glib_failed ; then - as_fn_error "Could not determine values for POLL* constants" "$LINENO" 5 - fi + if test $cross_compiling = yes; then + CROSS_COMPILING_TRUE= + CROSS_COMPILING_FALSE='#' else - glib_cv_value_POLLIN=1 - glib_cv_value_POLLOUT=4 - glib_cv_value_POLLPRI=2 - glib_cv_value_POLLERR=8 - glib_cv_value_POLLHUP=16 - glib_cv_value_POLLNVAL=32 + CROSS_COMPILING_TRUE='#' + CROSS_COMPILING_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll" >&5 -$as_echo_n "checking for broken poll... " >&6; } -if test "$cross_compiling" = yes; then : - broken_poll="no (cross compiling)" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include - #include - #include - #ifdef HAVE_SYS_POLL_H - #include - #endif - int main(void) { - struct pollfd fds[1]; - int fd; - fd = open("/dev/null", 1); - fds[0].fd = fd; - fds[0].events = POLLIN; - fds[0].revents = 0; - if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) { - exit(1); /* Does not work for devices -- fail */ - } - exit(0); - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - broken_poll=no +if test $cross_compiling = yes; then + # Extract the first word of "glib-genmarshal", so it can be a program name with args. +set dummy glib-genmarshal; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_GENMARSHAL+:} false; then : + $as_echo_n "(cached) " >&6 else - broken_poll=yes - -$as_echo "#define BROKEN_POLL 1" >>confdefs.h + case $GLIB_GENMARSHAL in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GLIB_GENMARSHAL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + test -z "$ac_cv_path_GLIB_GENMARSHAL" && ac_cv_path_GLIB_GENMARSHAL="no" + ;; +esac fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +GLIB_GENMARSHAL=$ac_cv_path_GLIB_GENMARSHAL +if test -n "$GLIB_GENMARSHAL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 +$as_echo "$GLIB_GENMARSHAL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $broken_poll" >&5 -$as_echo "$broken_poll" >&6; } -PCRE_REQUIRED_VERSION=7.2 + if test x$GLIB_GENMARSHAL = xno; then + as_fn_error $? "Could not find a glib-genmarshal in your PATH" "$LINENO" 5 + fi -# Check if we should compile GRegex -# Check whether --enable-regex was given. -if test "${enable_regex+set}" = set; then : - enableval=$enable_regex; case "${enableval}" in - yes) enable_regex=true ;; - no) enable_regex=false ;; - *) as_fn_error "bad value ${enableval} for --enable-regex" "$LINENO" 5 ;; + # Extract the first word of "glib-compile-schemas", so it can be a program name with args. +set dummy glib-compile-schemas; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_COMPILE_SCHEMAS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GLIB_COMPILE_SCHEMAS in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_COMPILE_SCHEMAS="$GLIB_COMPILE_SCHEMAS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GLIB_COMPILE_SCHEMAS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GLIB_COMPILE_SCHEMAS" && ac_cv_path_GLIB_COMPILE_SCHEMAS="no" + ;; esac +fi +GLIB_COMPILE_SCHEMAS=$ac_cv_path_GLIB_COMPILE_SCHEMAS +if test -n "$GLIB_COMPILE_SCHEMAS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_COMPILE_SCHEMAS" >&5 +$as_echo "$GLIB_COMPILE_SCHEMAS" >&6; } else - enable_regex=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if $enable_regex; then - ENABLE_REGEX_TRUE= - ENABLE_REGEX_FALSE='#' -else - ENABLE_REGEX_TRUE='#' - ENABLE_REGEX_FALSE= + if test x$GLIB_COMPILE_SCHEMAS = xno; then + as_fn_error $? "Could not find a glib-compile-schemas in your PATH" "$LINENO" 5 + fi fi -if test x$enable_regex = xtrue; then -$as_echo "#define ENABLE_REGEX /**/" >>confdefs.h - # Check if we should use the internal or the system-supplied pcre + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_CHECK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_CHECK in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# Check whether --with-pcre was given. -if test "${with_pcre+set}" = set; then : - withval=$with_pcre; + ;; +esac fi - - - if test "x$with_pcre" = xsystem; then - USE_SYSTEM_PCRE_TRUE= - USE_SYSTEM_PCRE_FALSE='#' +GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } else - USE_SYSTEM_PCRE_TRUE='#' - USE_SYSTEM_PCRE_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if test "x$with_pcre" = xsystem; then - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else - case $PKG_CONFIG in + case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -27089,7 +27478,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27100,29 +27489,30 @@ IFS=$as_save_IFS ;; esac fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +$as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else - case $ac_pt_PKG_CONFIG in + case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -27132,7 +27522,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27143,286 +27533,135 @@ IFS=$as_save_IFS ;; esac fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +$as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi - -fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCRE" >&5 -$as_echo_n "checking for PCRE... " >&6; } - -if test -n "$PCRE_CFLAGS"; then - pkg_cv_PCRE_CFLAGS="$PCRE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre >= \$PCRE_REQUIRED_VERSION\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpcre >= $PCRE_REQUIRED_VERSION") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PCRE_CFLAGS=`$PKG_CONFIG --cflags "libpcre >= $PCRE_REQUIRED_VERSION" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PCRE_LIBS"; then - pkg_cv_PCRE_LIBS="$PCRE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre >= \$PCRE_REQUIRED_VERSION\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpcre >= $PCRE_REQUIRED_VERSION") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PCRE_LIBS=`$PKG_CONFIG --libs "libpcre >= $PCRE_REQUIRED_VERSION" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - -if test $pkg_failed = yes; then -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; else - _pkg_short_errors_supported=no + with_html_dir='${datadir}/gtk-doc/html' fi - if test $_pkg_short_errors_supported = yes; then - PCRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpcre >= $PCRE_REQUIRED_VERSION" 2>&1` - else - PCRE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpcre >= $PCRE_REQUIRED_VERSION" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PCRE_PKG_ERRORS" >&5 - - as_fn_error "Package requirements (libpcre >= $PCRE_REQUIRED_VERSION) were not met: - -$PCRE_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. -Alternatively, you may set the environment variables PCRE_CFLAGS -and PCRE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 -elif test $pkg_failed = untried; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables PCRE_CFLAGS -and PCRE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + HTML_DIR="$with_html_dir" -To get pkg-config, see . -See \`config.log' for more details." "$LINENO" 5; } -else - PCRE_CFLAGS=$pkg_cv_PCRE_CFLAGS - PCRE_LIBS=$pkg_cv_PCRE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - : -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Unicode support in PCRE" >&5 -$as_echo_n "checking for Unicode support in PCRE... " >&6; } -if test "${glib_cv_pcre_has_unicode+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - glib_save_CFLAGS="$CFLAGS" - glib_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS" - if test "$cross_compiling" = yes; then : - glib_cv_pcre_has_unicode=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - int main () { - int support; - pcre_config (PCRE_CONFIG_UTF8, &support); - if (!support) - return 1; - pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &support); - if (!support) - return 1; - return 0; - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - glib_cv_pcre_has_unicode=yes + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; else - glib_cv_pcre_has_unicode=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$glib_save_CFLAGS" - LIBS="$glib_save_LIBS" - + enable_gtk_doc=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_pcre_has_unicode" >&5 -$as_echo "$glib_cv_pcre_has_unicode" >&6; } - if test "$glib_cv_pcre_has_unicode" = "no"; then - as_fn_error "*** The system-supplied PCRE does not support Unicode properties or UTF-8." "$LINENO" 5 - fi - - - -$as_echo "#define USE_SYSTEM_PCRE /**/" >>confdefs.h - - PCRE_REQUIRES=libpcre - - else - # If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE - if test x"$GCC" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler understands -Wno-pointer-sign" >&5 -$as_echo_n "checking whether compiler understands -Wno-pointer-sign... " >&6; } - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wno-pointer-sign" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test x$enable_gtk_doc = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.15\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.15") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + as_fn_error $? "You need to have gtk-doc >= 1.15 installed to build $PACKAGE_NAME" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$save_CFLAGS" - fi fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +$as_echo "$enable_gtk_doc" >&6; } + + # Check whether --enable-gtk-doc-html was given. +if test "${enable_gtk_doc_html+set}" = set; then : + enableval=$enable_gtk_doc_html; else - if false]; then - USE_SYSTEM_PCRE_TRUE= - USE_SYSTEM_PCRE_FALSE='#' -else - USE_SYSTEM_PCRE_TRUE='#' - USE_SYSTEM_PCRE_FALSE= + enable_gtk_doc_html=yes fi + # Check whether --enable-gtk-doc-pdf was given. +if test "${enable_gtk_doc_pdf+set}" = set; then : + enableval=$enable_gtk_doc_pdf; +else + enable_gtk_doc_pdf=no fi -case $host in - *-*-cygwin*) - G_LIBS_EXTRA="-luser32 -lkernel32" - ;; - *-*-mingw*) - G_LIBS_EXTRA="-lws2_32 -lole32" - ;; - *) - G_LIBS_EXTRA="" - ;; -esac - + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EILSEQ" >&5 -$as_echo_n "checking for EILSEQ... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi -#include + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi -int -main () -{ + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi -int error = EILSEQ; + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_eilseq=yes + if test -n "$GTKDOC_REBASE"; then + GTK_DOC_USE_REBASE_TRUE= + GTK_DOC_USE_REBASE_FALSE='#' else - have_eilseq=no + GTK_DOC_USE_REBASE_TRUE='#' + GTK_DOC_USE_REBASE_FALSE= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_eilseq" >&5 -$as_echo "$have_eilseq" >&6; } - if test $cross_compiling = yes; then - CROSS_COMPILING_TRUE= - CROSS_COMPILING_FALSE='#' + +# Check whether --enable-man was given. +if test "${enable_man+set}" = set; then : + enableval=$enable_man; enable_man=yes else - CROSS_COMPILING_TRUE='#' - CROSS_COMPILING_FALSE= + enable_man=no fi -if test $cross_compiling = yes; then - # Extract the first word of "glib-genmarshal", so it can be a program name with args. -set dummy glib-genmarshal; ac_word=$2 +if test "${enable_man}" != no; then +# Extract the first word of "xsltproc", so it can be a program name with args. +set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GLIB_GENMARSHAL+set}" = set; then : +if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else - case $GLIB_GENMARSHAL in + case $XSLTPROC in [\\/]* | ?:[\\/]*) - ac_cv_path_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" # Let the user override the test with a path. + ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -27432,7 +27671,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GLIB_GENMARSHAL="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27440,38 +27679,58 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_GLIB_GENMARSHAL" && ac_cv_path_GLIB_GENMARSHAL="no" ;; esac fi -GLIB_GENMARSHAL=$ac_cv_path_GLIB_GENMARSHAL -if test -n "$GLIB_GENMARSHAL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 -$as_echo "$GLIB_GENMARSHAL" >&6; } +XSLTPROC=$ac_cv_path_XSLTPROC +if test -n "$XSLTPROC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test x$GLIB_GENMARSHAL = xno; then - as_fn_error "Could not find a glib-genmarshal in your PATH" "$LINENO" 5 + if test -z "$XSLTPROC"; then + enable_man=no fi -fi + # check for the presence of the XML catalog + +# Check whether --with-xml-catalog was given. +if test "${with_xml_catalog+set}" = set; then : + withval=$with_xml_catalog; +else + with_xml_catalog=/etc/xml/catalog +fi + jh_found_xmlcatalog=true + XML_CATALOG_FILE="$with_xml_catalog" - # Extract the first word of "gtkdoc-check", so it can be a program name with args. -set dummy gtkdoc-check; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML catalog ($XML_CATALOG_FILE)" >&5 +$as_echo_n "checking for XML catalog ($XML_CATALOG_FILE)... " >&6; } + if test -f "$XML_CATALOG_FILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + else + jh_found_xmlcatalog=false + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + fi + + # check for the xmlcatalog program + # Extract the first word of "xmlcatalog", so it can be a program name with args. +set dummy xmlcatalog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GTKDOC_CHECK+set}" = set; then : +if ${ac_cv_path_XMLCATALOG+:} false; then : $as_echo_n "(cached) " >&6 else - case $GTKDOC_CHECK in + case $XMLCATALOG in [\\/]* | ?:[\\/]*) - ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. + ac_cv_path_XMLCATALOG="$XMLCATALOG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -27481,7 +27740,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_XMLCATALOG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27489,85 +27748,111 @@ done done IFS=$as_save_IFS + test -z "$ac_cv_path_XMLCATALOG" && ac_cv_path_XMLCATALOG="no" ;; esac fi -GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK -if test -n "$GTKDOC_CHECK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 -$as_echo "$GTKDOC_CHECK" >&6; } +XMLCATALOG=$ac_cv_path_XMLCATALOG +if test -n "$XMLCATALOG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLCATALOG" >&5 +$as_echo "$XMLCATALOG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - for ac_prog in gtkdoc-rebase -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GTKDOC_REBASE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $GTKDOC_REBASE in - [\\/]* | ?:[\\/]*) - ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test "x$XMLCATALOG" = xno; then + jh_found_xmlcatalog=false + fi + + if $jh_found_xmlcatalog; then + : + else + : + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML DTD V4.1.2 in XML catalog" >&5 +$as_echo_n "checking for DocBook XML DTD V4.1.2 in XML catalog... " >&6; } + if $jh_found_xmlcatalog && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"-//OASIS//DTD DocBook XML V4.1.2//EN\" >&2"; } >&5 + ($XMLCATALOG --noout "$XML_CATALOG_FILE" "-//OASIS//DTD DocBook XML V4.1.2//EN" >&2) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + enable_man=no + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XSL Stylesheets in XML catalog" >&5 +$as_echo_n "checking for DocBook XSL Stylesheets in XML catalog... " >&6; } + if $jh_found_xmlcatalog && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl\" >&2"; } >&5 + ($XMLCATALOG --noout "$XML_CATALOG_FILE" "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" >&2) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + enable_man=no fi -done - done -IFS=$as_save_IFS - ;; -esac fi -GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE -if test -n "$GTKDOC_REBASE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 -$as_echo "$GTKDOC_REBASE" >&6; } + + if test x$enable_man != xno; then + ENABLE_MAN_TRUE= + ENABLE_MAN_FALSE='#' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ENABLE_MAN_TRUE='#' + ENABLE_MAN_FALSE= fi - test -n "$GTKDOC_REBASE" && break -done -test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" - # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. -set dummy gtkdoc-mkpdf; ac_word=$2 +# Check whether --enable-dtrace was given. +if test "${enable_dtrace+set}" = set; then : + enableval=$enable_dtrace; +fi + +have_dtrace=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include dtrace tracing support" >&5 +$as_echo_n "checking whether to include dtrace tracing support... " >&6; } +if test "x$enable_dtrace" != xno; then + if test x$glib_have_carbon = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (not yet compatible with MacOS dtrace)" >&5 +$as_echo "no (not yet compatible with MacOS dtrace)" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + for ac_prog in dtrace +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GTKDOC_MKPDF+set}" = set; then : +if ${ac_cv_prog_DTRACE+:} false; then : $as_echo_n "(cached) " >&6 -else - case $GTKDOC_MKPDF in - [\\/]* | ?:[\\/]*) - ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else + if test -n "$DTRACE"; then + ac_cv_prog_DTRACE="$DTRACE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_DTRACE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27575,148 +27860,125 @@ done done IFS=$as_save_IFS - ;; -esac fi -GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF -if test -n "$GTKDOC_MKPDF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 -$as_echo "$GTKDOC_MKPDF" >&6; } +fi +DTRACE=$ac_cv_prog_DTRACE +if test -n "$DTRACE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 +$as_echo "$DTRACE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$DTRACE" && break +done - -# Check whether --with-html-dir was given. -if test "${with_html_dir+set}" = set; then : - withval=$with_html_dir; + if test -z "$DTRACE"; then + if test "x$enable_dtrace" = xyes; then + as_fn_error $? "dtrace not found" "$LINENO" 5 + fi + else + ac_fn_c_check_header_mongrel "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sdt_h" = xyes; then : + have_dtrace=yes else - with_html_dir='${datadir}/gtk-doc/html' + if test "x$enable_dtrace" = xyes; then + as_fn_error $? "dtrace support needs sys/sdt.h header" "$LINENO" 5 + fi fi - HTML_DIR="$with_html_dir" - - # Check whether --enable-gtk-doc was given. -if test "${enable_gtk_doc+set}" = set; then : - enableval=$enable_gtk_doc; + fi + fi else - enable_gtk_doc=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +if test "x$have_dtrace" = xyes; then +$as_echo "#define HAVE_DTRACE 1" >>confdefs.h - if test x$enable_gtk_doc = xyes; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.11\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.11") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - : +fi + if test x$have_dtrace = xyes ; then + ENABLE_DTRACE_TRUE= + ENABLE_DTRACE_FALSE='#' else - as_fn_error "You need to have gtk-doc >= 1.11 installed to build $PACKAGE_NAME" "$LINENO" 5 + ENABLE_DTRACE_TRUE='#' + ENABLE_DTRACE_FALSE= fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 -$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 -$as_echo "$enable_gtk_doc" >&6; } - # Check whether --enable-gtk-doc-html was given. -if test "${enable_gtk_doc_html+set}" = set; then : - enableval=$enable_gtk_doc_html; -else - enable_gtk_doc_html=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include systemtap tracing support" >&5 +$as_echo_n "checking whether to include systemtap tracing support... " >&6; } +# Check whether --enable-systemtap was given. +if test "${enable_systemtap+set}" = set; then : + enableval=$enable_systemtap; fi - # Check whether --enable-gtk-doc-pdf was given. -if test "${enable_gtk_doc_pdf+set}" = set; then : - enableval=$enable_gtk_doc_pdf; -else - enable_gtk_doc_pdf=no +have_systemtap=no +if test "x$enable_systemtap" != xno -a "x$have_dtrace" = xyes; then + have_systemtap=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${have_systemtap}" >&5 +$as_echo "${have_systemtap}" >&6; } - - if test -z "$GTKDOC_MKPDF"; then - enable_gtk_doc_pdf=no - fi - - - if test x$enable_gtk_doc = xyes; then - ENABLE_GTK_DOC_TRUE= - ENABLE_GTK_DOC_FALSE='#' + if test x$have_systemtap = xyes; then + ENABLE_SYSTEMTAP_TRUE= + ENABLE_SYSTEMTAP_FALSE='#' else - ENABLE_GTK_DOC_TRUE='#' - ENABLE_GTK_DOC_FALSE= + ENABLE_SYSTEMTAP_TRUE='#' + ENABLE_SYSTEMTAP_FALSE= fi - if test x$enable_gtk_doc_html = xyes; then - GTK_DOC_BUILD_HTML_TRUE= - GTK_DOC_BUILD_HTML_FALSE='#' -else - GTK_DOC_BUILD_HTML_TRUE='#' - GTK_DOC_BUILD_HTML_FALSE= -fi - if test x$enable_gtk_doc_pdf = xyes; then - GTK_DOC_BUILD_PDF_TRUE= - GTK_DOC_BUILD_PDF_FALSE='#' -else - GTK_DOC_BUILD_PDF_TRUE='#' - GTK_DOC_BUILD_PDF_FALSE= -fi - if test -n "$LIBTOOL"; then - GTK_DOC_USE_LIBTOOL_TRUE= - GTK_DOC_USE_LIBTOOL_FALSE='#' +# Check whether --with-tapset-install-dir was given. +if test "${with_tapset_install_dir+set}" = set; then : + withval=$with_tapset_install_dir; if test "x${withval}" = x; then + ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset" + else + ABS_TAPSET_DIR="${withval}" + fi else - GTK_DOC_USE_LIBTOOL_TRUE='#' - GTK_DOC_USE_LIBTOOL_FALSE= + ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset" fi - if test -n "$GTKDOC_REBASE"; then - GTK_DOC_USE_REBASE_TRUE= - GTK_DOC_USE_REBASE_FALSE='#' -else - GTK_DOC_USE_REBASE_TRUE='#' - GTK_DOC_USE_REBASE_FALSE= -fi -# Check whether --enable-man was given. -if test "${enable_man+set}" = set; then : - enableval=$enable_man; enable_man=yes +# Check whether --enable-gcov was given. +if test "${enable_gcov+set}" = set; then : + enableval=$enable_gcov; use_gcov=$enableval else - enable_man=no + use_gcov=no fi -if test "${enable_man}" != no; then -# Extract the first word of "xsltproc", so it can be a program name with args. -set dummy xsltproc; ac_word=$2 +if test "x$use_gcov" = "xyes"; then + if test "$GCC" != "yes"; then + as_fn_error $? "GCC is required for --enable-gcov" "$LINENO" 5 + fi + + # Extract the first word of "shtool", so it can be a program name with args. +set dummy shtool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XSLTPROC+set}" = set; then : +if ${ac_cv_prog_SHTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$SHTOOL"; then + ac_cv_prog_SHTOOL="$SHTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_SHTOOL="shtool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27724,68 +27986,83 @@ done done IFS=$as_save_IFS - ;; -esac fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } +fi +SHTOOL=$ac_cv_prog_SHTOOL +if test -n "$SHTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHTOOL" >&5 +$as_echo "$SHTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test -z "$XSLTPROC"; then - enable_man=no - fi + case `$SHTOOL path $CC` in + *ccache*) gcc_ccache=yes;; + *) gcc_ccache=no;; + esac + if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then + as_fn_error $? "ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1." "$LINENO" 5 + fi - # check for the presence of the XML catalog + ltp_version_list="1.6 1.7 1.8" + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LTP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LTP"; then + ac_cv_prog_LTP="$LTP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LTP="lcov" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# Check whether --with-xml-catalog was given. -if test "${with_xml_catalog+set}" = set; then : - withval=$with_xml_catalog; +fi +fi +LTP=$ac_cv_prog_LTP +if test -n "$LTP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP" >&5 +$as_echo "$LTP" >&6; } else - with_xml_catalog=/etc/xml/catalog + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - jh_found_xmlcatalog=true - XML_CATALOG_FILE="$with_xml_catalog" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML catalog ($XML_CATALOG_FILE)" >&5 -$as_echo_n "checking for XML catalog ($XML_CATALOG_FILE)... " >&6; } - if test -f "$XML_CATALOG_FILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - else - jh_found_xmlcatalog=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - fi - # check for the xmlcatalog program - # Extract the first word of "xmlcatalog", so it can be a program name with args. -set dummy xmlcatalog; ac_word=$2 + # Extract the first word of "genhtml", so it can be a program name with args. +set dummy genhtml; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XMLCATALOG+set}" = set; then : +if ${ac_cv_prog_LTP_GENHTML+:} false; then : $as_echo_n "(cached) " >&6 else - case $XMLCATALOG in - [\\/]* | ?:[\\/]*) - ac_cv_path_XMLCATALOG="$XMLCATALOG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$LTP_GENHTML"; then + ac_cv_prog_LTP_GENHTML="$LTP_GENHTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XMLCATALOG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_LTP_GENHTML="genhtml" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27793,80 +28070,236 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_XMLCATALOG" && ac_cv_path_XMLCATALOG="no" - ;; -esac fi -XMLCATALOG=$ac_cv_path_XMLCATALOG -if test -n "$XMLCATALOG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLCATALOG" >&5 -$as_echo "$XMLCATALOG" >&6; } +fi +LTP_GENHTML=$ac_cv_prog_LTP_GENHTML +if test -n "$LTP_GENHTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP_GENHTML" >&5 +$as_echo "$LTP_GENHTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test "$LTP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ltp version" >&5 +$as_echo_n "checking for ltp version... " >&6; } +if ${glib_cv_ltp_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + + glib_cv_ltp_version=invalid + ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'` + for ltp_check_version in $ltp_version_list; do + if test "$ltp_version" = "$ltp_check_version"; then + glib_cv_ltp_version="$ltp_check_version (ok)" + fi + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_ltp_version" >&5 +$as_echo "$glib_cv_ltp_version" >&6; } + else + ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list" + as_fn_error $? "$ltp_msg" "$LINENO" 5 + fi + + case $glib_cv_ltp_version in + ""|invalid) + ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)." + as_fn_error $? "$ltp_msg" "$LINENO" 5 + LTP="exit 0;" + ;; + esac + + if test -z "$LTP_GENHTML"; then + as_fn_error $? "Could not find genhtml from the LTP package" "$LINENO" 5 + fi + + +$as_echo "#define HAVE_GCOV 1" >>confdefs.h + + + + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'` + + + CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -lgcov" +fi + + +ac_config_commands="$ac_config_commands glib/glibconfig.h" + + +# Check for libdbus1 - Optional - is only used in the GDBus test cases +# +# 1.2.14 required for dbus_message_set_serial + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS1" >&5 +$as_echo_n "checking for DBUS1... " >&6; } + +if test -n "$DBUS1_CFLAGS"; then + pkg_cv_DBUS1_CFLAGS="$DBUS1_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.2.14\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.14") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS1_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.2.14" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DBUS1_LIBS"; then + pkg_cv_DBUS1_LIBS="$DBUS1_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.2.14\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.14") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS1_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.2.14" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DBUS1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 1.2.14" 2>&1` + else + DBUS1_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 1.2.14" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DBUS1_PKG_ERRORS" >&5 + + have_dbus1=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_dbus1=no +else + DBUS1_CFLAGS=$pkg_cv_DBUS1_CFLAGS + DBUS1_LIBS=$pkg_cv_DBUS1_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_DBUS1 1" >>confdefs.h + have_dbus1=yes +fi + + + if test "x$have_dbus1" = "xyes"; then + HAVE_DBUS1_TRUE= + HAVE_DBUS1_FALSE='#' +else + HAVE_DBUS1_TRUE='#' + HAVE_DBUS1_FALSE= +fi + + + +# Check whether --enable-Bsymbolic was given. +if test "${enable_Bsymbolic+set}" = set; then : + enableval=$enable_Bsymbolic; +else + SAVED_LDFLAGS="${LDFLAGS}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Bsymbolic-functions linker flag" >&5 +$as_echo_n "checking for -Bsymbolic-functions linker flag... " >&6; } + LDFLAGS=-Wl,-Bsymbolic-functions + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int main (void) { return 0; } + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + enable_Bsymbolic=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + enable_Bsymbolic=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="${SAVED_LDFLAGS}" fi - if test "x$XMLCATALOG" = xno; then - jh_found_xmlcatalog=false - fi +if test "x${enable_Bsymbolic}" == "xyes"; then + GLIB_LINK_FLAGS=-Wl,-Bsymbolic-functions +fi - if $jh_found_xmlcatalog; then - : - else - : - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML DTD V4.1.2 in XML catalog" >&5 -$as_echo_n "checking for DocBook XML DTD V4.1.2 in XML catalog... " >&6; } - if $jh_found_xmlcatalog && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"-//OASIS//DTD DocBook XML V4.1.2//EN\" >&2"; } >&5 - ($XMLCATALOG --noout "$XML_CATALOG_FILE" "-//OASIS//DTD DocBook XML V4.1.2//EN" >&2) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - enable_man=no - fi +# +# Define variables corresponding to the correct include paths to use for +# in-tree building. +# +# for config.h: +config_h_INCLUDES='-I$(top_builddir)' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XSL Stylesheets in XML catalog" >&5 -$as_echo_n "checking for DocBook XSL Stylesheets in XML catalog... " >&6; } - if $jh_found_xmlcatalog && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl\" >&2"; } >&5 - ($XMLCATALOG --noout "$XML_CATALOG_FILE" "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" >&2) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - enable_man=no - fi -fi +# glib: +# config.h +# $(top_builddir)/glib: for glibconfig.h +# $(top_srcdir)/glib: for glib.h +# $(top_srcdir): for everything +glib_INCLUDES='$(config_h_INCLUDES) -I$(top_builddir)/glib -I$(top_srcdir)/glib -I$(top_srcdir)' + + +# gthread: +# same as glib +gthread_INCLUDES='$(glib_INCLUDES)' - if test x$enable_man != xno; then - ENABLE_MAN_TRUE= - ENABLE_MAN_FALSE='#' -else - ENABLE_MAN_TRUE='#' - ENABLE_MAN_FALSE= -fi +# gobject: +# same as gthread +gobject_INCLUDES='$(gthread_INCLUDES)' -ac_config_commands="$ac_config_commands glibconfig.h" +# gmodule: +# glib includes +# $(top_srcdir)/gmodule: for gmodule.h +gmodule_INCLUDES='$(glib_INCLUDES) -I$(top_srcdir)/gmodule' -ac_config_files="$ac_config_files glib-2.0.pc glib-2.0-uninstalled.pc gmodule-2.0.pc gmodule-export-2.0.pc gmodule-no-export-2.0.pc gmodule-2.0-uninstalled.pc gmodule-no-export-2.0-uninstalled.pc gthread-2.0.pc gthread-2.0-uninstalled.pc gobject-2.0.pc gobject-2.0-uninstalled.pc gio-2.0.pc gio-unix-2.0.pc gio-2.0-uninstalled.pc gio-unix-2.0-uninstalled.pc glib-zip glib-gettextize Makefile build/Makefile build/win32/Makefile build/win32/dirent/Makefile build/win32/vs9/Makefile glib/Makefile glib/libcharset/Makefile glib/gnulib/Makefile glib/pcre/Makefile glib/update-pcre/Makefile glib/tests/Makefile gmodule/Makefile gmodule/gmoduleconf.h gobject/Makefile gobject/glib-mkenums gobject/tests/Makefile gthread/Makefile gthread/tests/Makefile gio/Makefile gio/xdgmime/Makefile gio/inotify/Makefile gio/libasyncns/Makefile gio/fen/Makefile gio/fam/Makefile gio/win32/Makefile gio/tests/Makefile po/Makefile.in docs/Makefile docs/reference/Makefile docs/reference/glib/Makefile docs/reference/glib/version.xml docs/reference/gobject/Makefile docs/reference/gobject/version.xml docs/reference/gio/Makefile docs/reference/gio/version.xml tests/Makefile tests/gobject/Makefile tests/refcount/Makefile m4macros/Makefile" +# gio: +# same as gmodule +gio_INCLUDES='$(gmodule_INCLUDES)' + + + +ac_config_files="$ac_config_files glib-2.0.pc glib-2.0-uninstalled.pc gmodule-2.0.pc gmodule-export-2.0.pc gmodule-no-export-2.0.pc gmodule-2.0-uninstalled.pc gmodule-no-export-2.0-uninstalled.pc gthread-2.0.pc gthread-2.0-uninstalled.pc gobject-2.0.pc gobject-2.0-uninstalled.pc gio-2.0.pc gio-unix-2.0.pc gio-windows-2.0.pc gio-2.0-uninstalled.pc gio-unix-2.0-uninstalled.pc glib-zip glib-gettextize Makefile build/Makefile build/win32/Makefile build/win32/dirent/Makefile build/win32/vs9/Makefile glib/Makefile glib/glib.stp glib/libcharset/Makefile glib/gnulib/Makefile glib/pcre/Makefile glib/update-pcre/Makefile glib/tests/Makefile gmodule/Makefile gmodule/gmoduleconf.h gobject/Makefile gobject/gobject.stp gobject/glib-mkenums gobject/tests/Makefile gthread/Makefile gthread/tests/Makefile gio/Makefile gio/xdgmime/Makefile gio/inotify/Makefile gio/libasyncns/Makefile gio/fen/Makefile gio/fam/Makefile gio/win32/Makefile gio/tests/Makefile po/Makefile.in docs/Makefile docs/reference/Makefile docs/reference/glib/Makefile docs/reference/glib/version.xml docs/reference/gobject/Makefile docs/reference/gobject/version.xml docs/reference/gio/Makefile docs/reference/gio/version.xml tests/Makefile tests/gobject/Makefile tests/refcount/Makefile m4macros/Makefile" ac_config_commands="$ac_config_commands chmod-scripts" @@ -27876,7 +28309,7 @@ ac_config_commands="$ac_config_commands chmod-scripts" # and automake generated makefiles know about these generated files. # They are only needed to distcheck the package if false; then - ac_config_files="$ac_config_files INSTALL README config.h.win32 glibconfig.h.win32 glib/makefile.msc glib/glib.rc gmodule/makefile.msc gmodule/gmodule.rc gobject/makefile.msc gobject/gobject.rc gthread/makefile.msc gthread/gthread.rc gio/gio.rc tests/makefile.msc" + ac_config_files="$ac_config_files INSTALL README config.h.win32 glib/glibconfig.h.win32 glib/makefile.msc glib/glib.rc gmodule/makefile.msc gmodule/gmodule.rc gobject/makefile.msc gobject/gobject.rc gthread/makefile.msc gthread/gthread.rc gio/gio.rc tests/makefile.msc" fi @@ -27944,10 +28377,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -27963,6 +28407,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -27986,152 +28431,156 @@ else fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then - as_fn_error "conditional \"OS_WIN32\" was never defined. + as_fn_error $? "conditional \"OS_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_WIN32_X64_TRUE}" && test -z "${OS_WIN32_X64_FALSE}"; then - as_fn_error "conditional \"OS_WIN32_X64\" was never defined. + as_fn_error $? "conditional \"OS_WIN32_X64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_UNIX_TRUE}" && test -z "${OS_UNIX_FALSE}"; then - as_fn_error "conditional \"OS_UNIX\" was never defined. + as_fn_error $? "conditional \"OS_UNIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then - as_fn_error "conditional \"OS_LINUX\" was never defined. + as_fn_error $? "conditional \"OS_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_CARBON_TRUE}" && test -z "${OS_CARBON_FALSE}"; then - as_fn_error "conditional \"OS_CARBON\" was never defined. + as_fn_error $? "conditional \"OS_CARBON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MS_LIB_AVAILABLE_TRUE}" && test -z "${MS_LIB_AVAILABLE_FALSE}"; then - as_fn_error "conditional \"MS_LIB_AVAILABLE\" was never defined. + as_fn_error $? "conditional \"MS_LIB_AVAILABLE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GLIB_RUNTIME_LIBDIR_TRUE}" && test -z "${HAVE_GLIB_RUNTIME_LIBDIR_FALSE}"; then - as_fn_error "conditional \"HAVE_GLIB_RUNTIME_LIBDIR\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"HAVE_GLIB_RUNTIME_LIBDIR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then - as_fn_error "conditional \"HAVE_CXX\" was never defined. + as_fn_error $? "conditional \"HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_WIN32_AND_DLL_COMPILATION_TRUE}" && test -z "${OS_WIN32_AND_DLL_COMPILATION_FALSE}"; then - as_fn_error "conditional \"OS_WIN32_AND_DLL_COMPILATION\" was never defined. + as_fn_error $? "conditional \"OS_WIN32_AND_DLL_COMPILATION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GNUC_VISIBILITY_TRUE}" && test -z "${HAVE_GNUC_VISIBILITY_FALSE}"; then - as_fn_error "conditional \"HAVE_GNUC_VISIBILITY\" was never defined. + as_fn_error $? "conditional \"HAVE_GNUC_VISIBILITY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SUNSTUDIO_VISIBILITY_TRUE}" && test -z "${HAVE_SUNSTUDIO_VISIBILITY_FALSE}"; then - as_fn_error "conditional \"HAVE_SUNSTUDIO_VISIBILITY\" was never defined. + as_fn_error $? "conditional \"HAVE_SUNSTUDIO_VISIBILITY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GOOD_PRINTF_TRUE}" && test -z "${HAVE_GOOD_PRINTF_FALSE}"; then - as_fn_error "conditional \"HAVE_GOOD_PRINTF\" was never defined. + as_fn_error $? "conditional \"HAVE_GOOD_PRINTF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_INOTIFY_TRUE}" && test -z "${HAVE_INOTIFY_FALSE}"; then - as_fn_error "conditional \"HAVE_INOTIFY\" was never defined. + as_fn_error $? "conditional \"HAVE_INOTIFY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FEN_TRUE}" && test -z "${HAVE_FEN_FALSE}"; then - as_fn_error "conditional \"HAVE_FEN\" was never defined. + as_fn_error $? "conditional \"HAVE_FEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FAM_TRUE}" && test -z "${HAVE_FAM_FALSE}"; then - as_fn_error "conditional \"HAVE_FAM\" was never defined. + as_fn_error $? "conditional \"HAVE_FAM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_TIMELOOP_TRUE}" && test -z "${ENABLE_TIMELOOP_FALSE}"; then - as_fn_error "conditional \"ENABLE_TIMELOOP\" was never defined. + as_fn_error $? "conditional \"ENABLE_TIMELOOP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then - as_fn_error "conditional \"PLATFORM_WIN32\" was never defined. + as_fn_error $? "conditional \"PLATFORM_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_THREADS_TRUE}" && test -z "${HAVE_THREADS_FALSE}"; then - as_fn_error "conditional \"HAVE_THREADS\" was never defined. + as_fn_error $? "conditional \"HAVE_THREADS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE}" && test -z "${HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE}"; then - as_fn_error "conditional \"HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS\" was never defined. + as_fn_error $? "conditional \"HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_REGEX_TRUE}" && test -z "${ENABLE_REGEX_FALSE}"; then - as_fn_error "conditional \"ENABLE_REGEX\" was never defined. + as_fn_error $? "conditional \"ENABLE_REGEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_SYSTEM_PCRE_TRUE}" && test -z "${USE_SYSTEM_PCRE_FALSE}"; then - as_fn_error "conditional \"USE_SYSTEM_PCRE\" was never defined. + as_fn_error $? "conditional \"USE_SYSTEM_PCRE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_SYSTEM_PCRE_TRUE}" && test -z "${USE_SYSTEM_PCRE_FALSE}"; then - as_fn_error "conditional \"USE_SYSTEM_PCRE\" was never defined. + as_fn_error $? "conditional \"USE_SYSTEM_PCRE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then - as_fn_error "conditional \"CROSS_COMPILING\" was never defined. + as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then - as_fn_error "conditional \"ENABLE_GTK_DOC\" was never defined. + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then - as_fn_error "conditional \"GTK_DOC_BUILD_HTML\" was never defined. + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then - as_fn_error "conditional \"GTK_DOC_BUILD_PDF\" was never defined. + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then - as_fn_error "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then - as_fn_error "conditional \"GTK_DOC_USE_REBASE\" was never defined. + as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_MAN_TRUE}" && test -z "${ENABLE_MAN_FALSE}"; then - as_fn_error "conditional \"ENABLE_MAN\" was never defined. + as_fn_error $? "conditional \"ENABLE_MAN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_DTRACE_TRUE}" && test -z "${ENABLE_DTRACE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_DTRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_SYSTEMTAP_TRUE}" && test -z "${ENABLE_SYSTEMTAP_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SYSTEMTAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_DBUS1_TRUE}" && test -z "${HAVE_DBUS1_FALSE}"; then + as_fn_error $? "conditional \"HAVE_DBUS1\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -28232,6 +28681,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -28277,19 +28727,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -28485,7 +28935,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -28538,8 +28988,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by glib $as_me 2.24.2, which was -generated by GNU Autoconf 2.65. Invocation command line was +This file was extended by glib $as_me 2.27.5, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -28604,11 +29054,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -glib config.status 2.24.2 -configured by $0, generated by GNU Autoconf 2.65, +glib config.status 2.27.5 +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -28626,11 +29076,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -28652,6 +29107,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -28664,7 +29120,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -28673,7 +29129,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -28728,186 +29184,212 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' -predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' -postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ GREP \ EGREP \ FGREP \ @@ -28919,8 +29401,12 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -28930,14 +29416,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -28953,7 +29439,6 @@ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -28961,6 +29446,7 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -28971,10 +29457,11 @@ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ +reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -28986,7 +29473,6 @@ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ -fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -28996,9 +29482,9 @@ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -29020,11 +29506,13 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -29033,10 +29521,11 @@ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -29044,12 +29533,6 @@ prelink_cmds_CXX; do esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -29424,7 +29907,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "glibconfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS glibconfig.h" ;; + "glib/glibconfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS glib/glibconfig.h" ;; "glib-2.0.pc") CONFIG_FILES="$CONFIG_FILES glib-2.0.pc" ;; "glib-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES glib-2.0-uninstalled.pc" ;; "gmodule-2.0.pc") CONFIG_FILES="$CONFIG_FILES gmodule-2.0.pc" ;; @@ -29438,6 +29921,7 @@ do "gobject-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES gobject-2.0-uninstalled.pc" ;; "gio-2.0.pc") CONFIG_FILES="$CONFIG_FILES gio-2.0.pc" ;; "gio-unix-2.0.pc") CONFIG_FILES="$CONFIG_FILES gio-unix-2.0.pc" ;; + "gio-windows-2.0.pc") CONFIG_FILES="$CONFIG_FILES gio-windows-2.0.pc" ;; "gio-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES gio-2.0-uninstalled.pc" ;; "gio-unix-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES gio-unix-2.0-uninstalled.pc" ;; "glib-zip") CONFIG_FILES="$CONFIG_FILES glib-zip" ;; @@ -29448,6 +29932,7 @@ do "build/win32/dirent/Makefile") CONFIG_FILES="$CONFIG_FILES build/win32/dirent/Makefile" ;; "build/win32/vs9/Makefile") CONFIG_FILES="$CONFIG_FILES build/win32/vs9/Makefile" ;; "glib/Makefile") CONFIG_FILES="$CONFIG_FILES glib/Makefile" ;; + "glib/glib.stp") CONFIG_FILES="$CONFIG_FILES glib/glib.stp" ;; "glib/libcharset/Makefile") CONFIG_FILES="$CONFIG_FILES glib/libcharset/Makefile" ;; "glib/gnulib/Makefile") CONFIG_FILES="$CONFIG_FILES glib/gnulib/Makefile" ;; "glib/pcre/Makefile") CONFIG_FILES="$CONFIG_FILES glib/pcre/Makefile" ;; @@ -29456,6 +29941,7 @@ do "gmodule/Makefile") CONFIG_FILES="$CONFIG_FILES gmodule/Makefile" ;; "gmodule/gmoduleconf.h") CONFIG_FILES="$CONFIG_FILES gmodule/gmoduleconf.h" ;; "gobject/Makefile") CONFIG_FILES="$CONFIG_FILES gobject/Makefile" ;; + "gobject/gobject.stp") CONFIG_FILES="$CONFIG_FILES gobject/gobject.stp" ;; "gobject/glib-mkenums") CONFIG_FILES="$CONFIG_FILES gobject/glib-mkenums" ;; "gobject/tests/Makefile") CONFIG_FILES="$CONFIG_FILES gobject/tests/Makefile" ;; "gthread/Makefile") CONFIG_FILES="$CONFIG_FILES gthread/Makefile" ;; @@ -29485,7 +29971,7 @@ do "INSTALL") CONFIG_FILES="$CONFIG_FILES INSTALL" ;; "README") CONFIG_FILES="$CONFIG_FILES README" ;; "config.h.win32") CONFIG_FILES="$CONFIG_FILES config.h.win32" ;; - "glibconfig.h.win32") CONFIG_FILES="$CONFIG_FILES glibconfig.h.win32" ;; + "glib/glibconfig.h.win32") CONFIG_FILES="$CONFIG_FILES glib/glibconfig.h.win32" ;; "glib/makefile.msc") CONFIG_FILES="$CONFIG_FILES glib/makefile.msc" ;; "glib/glib.rc") CONFIG_FILES="$CONFIG_FILES glib/glib.rc" ;; "gmodule/makefile.msc") CONFIG_FILES="$CONFIG_FILES gmodule/makefile.msc" ;; @@ -29497,7 +29983,7 @@ do "gio/gio.rc") CONFIG_FILES="$CONFIG_FILES gio/gio.rc" ;; "tests/makefile.msc") CONFIG_FILES="$CONFIG_FILES tests/makefile.msc" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -29520,9 +30006,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -29530,12 +30017,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -29552,12 +30040,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -29566,18 +30054,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -29585,7 +30073,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -29633,7 +30121,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -29665,21 +30153,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -29691,7 +30187,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -29703,11 +30199,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -29792,7 +30288,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -29805,7 +30301,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -29824,7 +30320,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -29833,7 +30329,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -29859,8 +30355,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -29996,23 +30492,24 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -30021,21 +30518,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -30199,7 +30696,8 @@ $as_echo X"$file" | # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -30231,21 +30729,21 @@ available_tags="CXX " # ### BEGIN LIBTOOL CONFIG +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. -AS=$AS +AS=$lt_AS # DLL creation program. -DLLTOOL=$DLLTOOL +DLLTOOL=$lt_DLLTOOL # Object dumper program. -OBJDUMP=$OBJDUMP - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision +OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared @@ -30256,6 +30754,12 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + # The host system. host_alias=$host_alias host=$host @@ -30305,20 +30809,36 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -30327,6 +30847,9 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -30345,14 +30868,14 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name of the directory that contains temporary libtool files. -objdir=$objdir +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO +# The name of the directory that contains temporary libtool files. +objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -30360,6 +30883,9 @@ MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -30416,6 +30942,9 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -30455,6 +30984,10 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -30467,12 +31000,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -30559,9 +31092,6 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -30577,6 +31107,9 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -30623,212 +31156,169 @@ ltmain="$ac_aux_dir/ltmain.sh" # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac - - - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -30840,6 +31330,10 @@ _LT_EOF # The linker used to build libraries. LD=$lt_LD_CXX +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -30852,12 +31346,12 @@ with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -30944,9 +31438,6 @@ inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path_CXX - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -30962,6 +31453,9 @@ include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX @@ -30986,12 +31480,12 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_CXX _LT_EOF ;; - "glibconfig.h":C) - outfile=glibconfig.h-tmp + "glib/glibconfig.h":C) + outfile=glib/glibconfig.h-tmp cat > $outfile <<\_______EOF /* glibconfig.h * - * This is a generated file. Please modify 'configure.in' + * This is a generated file. Please modify 'configure.ac' */ #ifndef __G_LIBCONFIG_H__ @@ -31356,12 +31850,12 @@ G_END_DECLS _______EOF - if cmp -s $outfile glibconfig.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: glibconfig.h is unchanged" >&5 -$as_echo "$as_me: glibconfig.h is unchanged" >&6;} + if cmp -s $outfile glib/glibconfig.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: glib/glibconfig.h is unchanged" >&5 +$as_echo "$as_me: glib/glibconfig.h is unchanged" >&6;} rm -f $outfile else - mv $outfile glibconfig.h + mv $outfile glib/glibconfig.h fi ;; "chmod-scripts":C) chmod 0755 glib-zip @@ -31377,7 +31871,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -31398,7 +31892,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/configure.in b/configure.ac similarity index 93% rename from configure.in rename to configure.ac index a8d3068..791a0c2 100644 --- a/configure.in +++ b/configure.ac @@ -1,12 +1,11 @@ # Process this file with autoconf to produce a configure script. -# require autoconf 2.54 -AC_PREREQ(2.54) +AC_PREREQ([2.62]) dnl *********************************** dnl *** include special GLib macros *** dnl *********************************** -m4_define(glib_configure_in) +m4_define(glib_configure_ac) # # The following version number definitions apply to GLib, GModule, GObject, @@ -22,9 +21,9 @@ m4_define(glib_configure_in) # set glib_binary_age _and_ glib_interface_age to 0. # m4_define([glib_major_version], [2]) -m4_define([glib_minor_version], [24]) -m4_define([glib_micro_version], [2]) -m4_define([glib_interface_age], [2]) +m4_define([glib_minor_version], [27]) +m4_define([glib_micro_version], [5]) +m4_define([glib_interface_age], [0]) m4_define([glib_binary_age], [m4_eval(100 * glib_minor_version + glib_micro_version)]) m4_define([glib_version], @@ -48,15 +47,13 @@ m4_define([glib_debug_default], AC_INIT(glib, [glib_version], [http://bugzilla.gnome.org/enter_bug.cgi?product=glib]) +AC_CONFIG_HEADER([config.h]) AC_CONFIG_SRCDIR([glib/glib.h]) # Save this value here, since automake will set cflags later cflags_set=${CFLAGS+set} -AM_INIT_AUTOMAKE([no-define]) - -# Specify a configuration file -AM_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE([1.10 no-define]) # Support silent build rules, requires at least automake-1.11. Enable # by either passing --enable-silent-rules to configure or passing V=0 @@ -103,6 +100,10 @@ AC_SUBST(LT_CURRENT_MINUS_AGE) dnl Initialize maintainer mode AM_MAINTAINER_MODE +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP + AC_CANONICAL_HOST AC_MSG_CHECKING([for the BeOS]) @@ -223,10 +224,6 @@ AC_ARG_ENABLE(rebuilds, [AC_HELP_STRING([--disable-rebuilds], [disable all source autogeneration rules])],, [enable_rebuilds=yes]) -AC_ARG_ENABLE(visibility, - [AC_HELP_STRING([--disable-visibility], - [don't use ELF visibility attributes])],, - [enable_visibility=yes]) if test "x$enable_threads" != "xyes"; then enable_threads=no @@ -262,10 +259,6 @@ AC_SUBST(GLIB_RUNTIME_LIBDIR) AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR) AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"]) -dnl Checks for programs. -AC_PROG_CC -AC_PROG_CPP - dnl Check for a working C++ compiler, but do not bail out, if none is found. AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], [gcc]) AC_LANG_SAVE @@ -280,19 +273,7 @@ AC_PROG_INSTALL AC_SYS_LARGEFILE -# -# Find pkg-config -# -AC_PATH_PROG(PKG_CONFIG, [pkg-config], [no]) -if test x$PKG_CONFIG = xno ; then - AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/]) -fi - -if $PKG_CONFIG --atleast-pkgconfig-version 0.16 ; then - : -else - AC_MSG_ERROR([*** pkg-config too old; version 0.16 or better required.]) -fi +PKG_PROG_PKG_CONFIG(0.16) if test "x$enable_debug" = "xyes"; then if test x$cflags_set != xset ; then @@ -311,10 +292,6 @@ else fi fi -if test "x$enable_visibility" = "xno"; then - GLIB_DEBUG_FLAGS="$GLIB_DEBUG_FLAGS -DDISABLE_VISIBILITY" -fi - # Ensure MSVC-compatible struct packing convention is used when # compiling for Win32 with gcc. # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while @@ -460,14 +437,16 @@ AC_MSG_RESULT($enable_iconv_cache) dnl dnl zlib support dnl -found_zlib=no -AC_CHECK_LIB(z, inflate, [AC_CHECK_HEADER(zlib.h, found_zlib=yes)]) - +PKG_CHECK_MODULES([ZLIB], [zlib], [found_zlib=yes], [found_zlib=no]) if test "x$found_zlib" = "xno" ; then - AC_MSG_ERROR([*** Working zlib library and headers not found ***]) + AC_CHECK_LIB(z, inflate, [AC_CHECK_HEADER(zlib.h, found_zlib=yes)]) + if test "x$found_zlib" = "xno" ; then + AC_MSG_ERROR([*** Working zlib library and headers not found ***]) + fi + ZLIB_LIBS='-lz' + AC_SUBST(ZLIB_LIBS) fi -ZLIB_LIBS='-lz' -AC_SUBST(ZLIB_LIBS) + dnl dnl gettext support dnl @@ -516,9 +495,8 @@ case $with_libiconv in esac dnl Initialize libtool -AM_DISABLE_STATIC -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL +LT_PREREQ([2.2]) +LT_INIT([disable-static win32-dll]) dnl when using libtool 2.x create libtool early, because it's used in configure m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) @@ -896,6 +874,7 @@ AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct statfs.f #endif]) # struct statvfs.f_basetype is available on Solaris but not for Linux. AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [#include ]) +AC_CHECK_MEMBERS([struct tm.tm_gmtoff]) # Checks for libcharset AM_LANGINFO_CODESET @@ -964,11 +943,10 @@ fi AC_MSG_RESULT(unsigned $glib_size_type) # Check for some functions -AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk) +AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk memmem) AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link statvfs statfs utimes getgrgid getpwuid) AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getmntinfo) # Check for high-resolution sleep functions -AC_CHECK_FUNCS(nanosleep nsleep) AC_CHECK_FUNCS(splice) AC_CHECK_HEADERS(crt_externs.h) @@ -2397,8 +2375,10 @@ AC_CHECK_FUNCS(clock_gettime, [], [ AC_DEFINE(HAVE_CLOCK_GETTIME, 1) G_THREAD_LIBS="$G_THREAD_LIBS -lrt" G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS_FOR_GTHREAD -lrt" + GLIB_RT_LIBS="-lrt" ]) ]) +AC_SUBST(GLIB_RT_LIBS) AC_CACHE_CHECK(for monotonic clocks, glib_cv_monotonic_clock,AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ @@ -2732,7 +2712,8 @@ int error = EILSEQ; AC_MSG_RESULT($have_eilseq) dnl ****************************************************************** -dnl *** Look for glib-genmarshal in PATH if we are cross-compiling *** +dnl *** If we are cross-compiling, look for glib-genmarshal and *** +dnl *** glib-compile-schemas in PATH *** dnl ****************************************************************** AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) @@ -2742,13 +2723,18 @@ if test $cross_compiling = yes; then if test x$GLIB_GENMARSHAL = xno; then AC_MSG_ERROR(Could not find a glib-genmarshal in your PATH) fi + + AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas, no) + if test x$GLIB_COMPILE_SCHEMAS = xno; then + AC_MSG_ERROR(Could not find a glib-compile-schemas in your PATH) + fi fi dnl ************************** dnl *** Checks for gtk-doc *** dnl ************************** -GTK_DOC_CHECK([1.11]) +GTK_DOC_CHECK([1.15]) AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man], @@ -2773,19 +2759,145 @@ fi AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) +dnl +dnl Tracing +dnl + +AC_ARG_ENABLE([dtrace], + [AS_HELP_STRING([--enable-dtrace], + [Enable inclusion of dtrace trace support])]) +have_dtrace=no +AC_MSG_CHECKING([whether to include dtrace tracing support]) +if test "x$enable_dtrace" != xno; then + if test x$glib_have_carbon = xyes; then + AC_MSG_RESULT([no (not yet compatible with MacOS dtrace)]) + else + AC_MSG_RESULT([yes]) + AC_CHECK_PROGS(DTRACE, dtrace) + if test -z "$DTRACE"; then + if test "x$enable_dtrace" = xyes; then + AC_MSG_ERROR([dtrace not found]) + fi + else + AC_CHECK_HEADER([sys/sdt.h],have_dtrace=yes, + [if test "x$enable_dtrace" = xyes; then + AC_MSG_ERROR([dtrace support needs sys/sdt.h header]) + fi]) + fi + fi +else + AC_MSG_RESULT([no]) +fi +if test "x$have_dtrace" = xyes; then + AC_DEFINE([HAVE_DTRACE], [1], [Define to 1 if using dtrace probes.]) +fi +AM_CONDITIONAL([ENABLE_DTRACE], [test x$have_dtrace = xyes ]) + +AC_MSG_CHECKING([whether to include systemtap tracing support]) +AC_ARG_ENABLE([systemtap], + [AS_HELP_STRING([--enable-systemtap], + [Enable inclusion of systemtap trace support])]) +have_systemtap=no +if test "x$enable_systemtap" != xno -a "x$have_dtrace" = xyes; then + have_systemtap=yes +fi +AC_MSG_RESULT(${have_systemtap}) + +AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$have_systemtap = xyes]) + +AC_ARG_WITH([tapset-install-dir], + [AS_HELP_STRING([--with-tapset-install-dir], + [The absolute path where the systemtap tapsets will be installed])], + [if test "x${withval}" = x; then + ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset" + else + ABS_TAPSET_DIR="${withval}" + fi], + [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"]) +AC_SUBST(ABS_TAPSET_DIR) + +dnl ************************************ +dnl *** Enable lcov coverage reports *** +dnl ************************************ + +AC_ARG_ENABLE(gcov, + AS_HELP_STRING([--enable-gcov], + [Enable gcov]), + [use_gcov=$enableval], [use_gcov=no]) + +if test "x$use_gcov" = "xyes"; then + dnl we need gcc: + if test "$GCC" != "yes"; then + AC_MSG_ERROR([GCC is required for --enable-gcov]) + fi + + dnl Check if ccache is being used + AC_CHECK_PROG(SHTOOL, shtool, shtool) + case `$SHTOOL path $CC` in + *ccache*[)] gcc_ccache=yes;; + *[)] gcc_ccache=no;; + esac + + if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then + AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) + fi + + ltp_version_list="1.6 1.7 1.8" + AC_CHECK_PROG(LTP, lcov, lcov) + AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml) + + if test "$LTP"; then + AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [ + glib_cv_ltp_version=invalid + ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'` + for ltp_check_version in $ltp_version_list; do + if test "$ltp_version" = "$ltp_check_version"; then + glib_cv_ltp_version="$ltp_check_version (ok)" + fi + done + ]) + else + ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list" + AC_MSG_ERROR([$ltp_msg]) + fi + + case $glib_cv_ltp_version in + ""|invalid[)] + ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)." + AC_MSG_ERROR([$ltp_msg]) + LTP="exit 0;" + ;; + esac + + if test -z "$LTP_GENHTML"; then + AC_MSG_ERROR([Could not find genhtml from the LTP package]) + fi + + AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov]) + + dnl Remove all optimization flags from CFLAGS + changequote({,}) + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'` + changequote([,]) + + dnl Add the special gcc flags + CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -lgcov" +fi + dnl ****************************** dnl *** output the whole stuff *** dnl ****************************** dnl this section will only be run if config.status is invoked with no -dnl arguments, or with "glibconfig.h" as an argument. -AC_CONFIG_COMMANDS([glibconfig.h], +dnl arguments, or with "glib/glibconfig.h" as an argument. +AC_CONFIG_COMMANDS([glib/glibconfig.h], [ - outfile=glibconfig.h-tmp + outfile=glib/glibconfig.h-tmp cat > $outfile <<\_______EOF /* glibconfig.h * - * This is a generated file. Please modify 'configure.in' + * This is a generated file. Please modify 'configure.ac' */ #ifndef __G_LIBCONFIG_H__ @@ -3150,11 +3262,11 @@ G_END_DECLS _______EOF - if cmp -s $outfile glibconfig.h; then - AC_MSG_NOTICE([glibconfig.h is unchanged]) + if cmp -s $outfile glib/glibconfig.h; then + AC_MSG_NOTICE([glib/glibconfig.h is unchanged]) rm -f $outfile else - mv $outfile glibconfig.h + mv $outfile glib/glibconfig.h fi ],[ @@ -3496,6 +3608,80 @@ if test x$glib_win32_static_compilation = xyes; then fi ]) +# Check for libdbus1 - Optional - is only used in the GDBus test cases +# +# 1.2.14 required for dbus_message_set_serial +PKG_CHECK_MODULES(DBUS1, + dbus-1 >= 1.2.14, + [AC_DEFINE(HAVE_DBUS1, 1, [Define if dbus-1 is available]) have_dbus1=yes], + have_dbus1=no) +AC_SUBST(DBUS1_CFLAGS) +AC_SUBST(DBUS1_LIBS) +AM_CONDITIONAL(HAVE_DBUS1, [test "x$have_dbus1" = "xyes"]) + +dnl +dnl Check for -Bsymbolic-functions linker flag used to avoid +dnl intra-library PLT jumps, if available. +dnl + +AC_ARG_ENABLE(Bsymbolic, + [AC_HELP_STRING([--disable-Bsymbolic], + [avoid linking with -Bsymbolic])],, + [SAVED_LDFLAGS="${LDFLAGS}" + AC_MSG_CHECKING([for -Bsymbolic-functions linker flag]) + LDFLAGS=-Wl,-Bsymbolic-functions + AC_TRY_LINK([], [int main (void) { return 0; }], + AC_MSG_RESULT(yes) + enable_Bsymbolic=yes, + AC_MSG_RESULT(no) + enable_Bsymbolic=no) + LDFLAGS="${SAVED_LDFLAGS}"]) + +if test "x${enable_Bsymbolic}" == "xyes"; then + GLIB_LINK_FLAGS=-Wl,-Bsymbolic-functions +fi + +AC_SUBST(GLIB_LINK_FLAGS) + +# +# Define variables corresponding to the correct include paths to use for +# in-tree building. +# + +# for config.h: +config_h_INCLUDES='-I$(top_builddir)' +AC_SUBST(config_h_INCLUDES) + +# glib: +# config.h +# $(top_builddir)/glib: for glibconfig.h +# $(top_srcdir)/glib: for glib.h +# $(top_srcdir): for everything +glib_INCLUDES='$(config_h_INCLUDES) -I$(top_builddir)/glib -I$(top_srcdir)/glib -I$(top_srcdir)' +AC_SUBST(glib_INCLUDES) + +# gthread: +# same as glib +gthread_INCLUDES='$(glib_INCLUDES)' +AC_SUBST(gthread_INCLUDES) + +# gobject: +# same as gthread +gobject_INCLUDES='$(gthread_INCLUDES)' +AC_SUBST(gobject_INCLUDES) + +# gmodule: +# glib includes +# $(top_srcdir)/gmodule: for gmodule.h +gmodule_INCLUDES='$(glib_INCLUDES) -I$(top_srcdir)/gmodule' +AC_SUBST(gmodule_INCLUDES) + +# gio: +# same as gmodule +gio_INCLUDES='$(gmodule_INCLUDES)' +AC_SUBST(gio_INCLUDES) + + AC_CONFIG_FILES([ glib-2.0.pc glib-2.0-uninstalled.pc @@ -3510,6 +3696,7 @@ gobject-2.0.pc gobject-2.0-uninstalled.pc gio-2.0.pc gio-unix-2.0.pc +gio-windows-2.0.pc gio-2.0-uninstalled.pc gio-unix-2.0-uninstalled.pc glib-zip @@ -3520,6 +3707,7 @@ build/win32/Makefile build/win32/dirent/Makefile build/win32/vs9/Makefile glib/Makefile +glib/glib.stp glib/libcharset/Makefile glib/gnulib/Makefile glib/pcre/Makefile @@ -3528,6 +3716,7 @@ glib/tests/Makefile gmodule/Makefile gmodule/gmoduleconf.h gobject/Makefile +gobject/gobject.stp gobject/glib-mkenums gobject/tests/Makefile gthread/Makefile @@ -3568,7 +3757,7 @@ if false; then INSTALL README config.h.win32 - glibconfig.h.win32 + glib/glibconfig.h.win32 glib/makefile.msc glib/glib.rc gmodule/makefile.msc diff --git a/debian/rules b/debian/rules old mode 100755 new mode 100644 diff --git a/docs/Makefile.in b/docs/Makefile.in index 8570187..2bf99e6 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -101,6 +101,7 @@ am__relativize = \ done; \ reldir="$$dir2" ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -125,11 +126,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -143,13 +147,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -196,6 +203,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -203,6 +212,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -228,6 +238,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -244,6 +256,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -253,11 +266,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -273,11 +288,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -291,7 +312,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -672,13 +692,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -705,8 +728,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -715,9 +742,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ diff --git a/docs/reference/Makefile.in b/docs/reference/Makefile.in index 4d008f1..a241291 100644 --- a/docs/reference/Makefile.in +++ b/docs/reference/Makefile.in @@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -101,6 +101,7 @@ am__relativize = \ done; \ reldir="$$dir2" ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -125,11 +126,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -143,13 +147,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -196,6 +203,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -203,6 +212,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -228,6 +238,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -244,6 +256,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -253,11 +266,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -273,11 +288,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -291,7 +312,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -672,13 +692,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -705,8 +728,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -715,9 +742,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am index 2c51c7e..a690ece 100644 --- a/docs/reference/gio/Makefile.am +++ b/docs/reference/gio/Makefile.am @@ -18,6 +18,8 @@ CFILE_GLOB=$(top_srcdir)/gio/*.c # Headers to ignore IGNORE_HFILES= \ + gvdb \ + tests \ asyncns.h \ fam-helper.h \ fen-data.h \ @@ -26,17 +28,31 @@ IGNORE_HFILES= \ fen-node.h \ gasynchelper.h \ gcontenttypeprivate.h \ + gdbusauth.h \ + gdbusauthmechanism.h \ + gdbusauthmechanismanon.h \ + gdbusauthmechanismexternal.h \ + gdbusauthmechanismsha1.h \ + gdbusprivate.h \ + gdbus-sessionbus.h \ + gdbus-tests.h \ + gdummyproxyresolver.h \ + testenums.h \ + gapplicationimpl.h \ + gdelayedsettingsbackend.h \ + gregistrysettingsbackend.h \ gdummyfile.h \ gfamdirectorymonitor.h \ gfamfilemonitor.h \ + gfendirectorymonitor.h \ + gfenfilemonitor.h \ gfileattribute-priv.h \ gfileinfo-priv.h \ ginotifydirectorymonitor.h \ ginotifyfilemonitor.h \ gio-marshal.h \ gio.h \ - gioalias.h \ - gioalias.h \ + gkeyfilesettingsbackend.h \ gioenumtypes.h \ giomodule-priv.h \ glocaldirectorymonitor.h \ @@ -44,20 +60,44 @@ IGNORE_HFILES= \ glocalfileenumerator.h \ glocalfileinfo.h \ glocalfileinputstream.h \ + glocalfileiostream.h \ glocalfilemonitor.h \ glocalfileoutputstream.h \ glocalvfs.h \ + gmemorysettingsbackend.h \ + gmountprivate.h \ gnativevolumemonitor.h \ gnetworkingprivate.h \ + gnullsettingsbackend.h \ gpollfilemonitor.h \ + gproxyconnection.h \ + gsettingsbackendinternal.h \ + gsettingsschema.h \ + gsettings-mapping.h \ + gsocketinputstream.h \ + gsocketoutputstream.h \ gthreadedresolver.h \ gunionvolumemonitor.h \ gunixdrive.h \ + gunixmount.h \ + gunixvolumemonitor.h \ gunixresolver.h \ gunixvolume.h \ + gvdb-builder.h \ + gvdb-format.h \ + gvdb-render.h \ gvolumeprivate.h \ gwin32appinfo.h \ + gwin32mount.h \ + gwin32directorymonitor.h \ + gwin32inputstream.h \ + gwin32outputstream.h \ + gwin32volumemonitor.h \ gwin32resolver.h \ + gwinhttpfile.h \ + gwinhttpfileinputstream.h \ + gwinhttpfileoutputstream.h \ + gwinhttpvfs.h \ inotify-diag.h \ inotify-helper.h \ inotify-kernel.h \ @@ -80,15 +120,7 @@ IGNORE_HFILES= \ # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. INCLUDES = \ - -I$(srcdir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gobject \ - -I$(top_srcdir)/gio \ - -I$(top_builddir) \ - -I$(top_builddir)/glib \ - -I$(top_builddir)/gobject \ - -I$(top_builddir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) GTKDOC_LIBS = \ @@ -109,11 +141,22 @@ HTML_IMAGES = \ content_files = \ version.xml \ overview.xml \ - migrating.xml + migrating-posix.xml \ + migrating-gnome-vfs.xml \ + migrating-gconf.xml \ + migrating-gdbus.xml \ + gio-querymodules.xml \ + glib-compile-schemas.xml\ + gsettings.xml \ + gdbus.xml \ + $(NULL) expand_content_files = \ overview.xml \ - migrating.xml + migrating-posix.xml \ + migrating-gnome-vfs.xml \ + migrating-gconf.xml \ + migrating-gdbus.xml extra_files = \ version.xml.in \ @@ -123,3 +166,38 @@ include $(top_srcdir)/gtk-doc.make EXTRA_DIST += \ version.xml.in + +man_MANS = \ + gio-querymodules.1 \ + glib-compile-schemas.1 \ + gsettings.1 \ + gdbus.1 + +if ENABLE_MAN + +.xml.1: + @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< + +dist-local-check-mans-enabled: + if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +else + +$(man_MANS): + echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. + echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +dist-local-check-mans-enabled: + echo "*** --enable-man must be used in order to make dist" + false + +endif + +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) + +EXTRA_DIST += $(man_MANS) + +dist-hook-local: dist-local-check-mans-enabled gio-docs-clean all-local + +gio-docs-clean: clean + cd $(srcdir) && rm -rf xml html diff --git a/docs/reference/gio/Makefile.in b/docs/reference/gio/Makefile.in index 72e30e8..4c9cdc3 100644 --- a/docs/reference/gio/Makefile.in +++ b/docs/reference/gio/Makefile.in @@ -51,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -66,8 +66,34 @@ am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ SOURCES = DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -92,11 +118,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -110,13 +139,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -163,6 +195,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -170,6 +204,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -195,6 +230,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -211,6 +248,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -220,11 +258,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -240,11 +280,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -258,7 +304,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -285,7 +330,7 @@ GTESTER = $(top_builddir)/glib/gtester # for the GLIB package GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \ - version.xml.in + version.xml.in $(man_MANS) TEST_PROGS = NULL = @@ -305,6 +350,8 @@ CFILE_GLOB = $(top_srcdir)/gio/*.c # Headers to ignore IGNORE_HFILES = \ + gvdb \ + tests \ asyncns.h \ fam-helper.h \ fen-data.h \ @@ -313,17 +360,31 @@ IGNORE_HFILES = \ fen-node.h \ gasynchelper.h \ gcontenttypeprivate.h \ + gdbusauth.h \ + gdbusauthmechanism.h \ + gdbusauthmechanismanon.h \ + gdbusauthmechanismexternal.h \ + gdbusauthmechanismsha1.h \ + gdbusprivate.h \ + gdbus-sessionbus.h \ + gdbus-tests.h \ + gdummyproxyresolver.h \ + testenums.h \ + gapplicationimpl.h \ + gdelayedsettingsbackend.h \ + gregistrysettingsbackend.h \ gdummyfile.h \ gfamdirectorymonitor.h \ gfamfilemonitor.h \ + gfendirectorymonitor.h \ + gfenfilemonitor.h \ gfileattribute-priv.h \ gfileinfo-priv.h \ ginotifydirectorymonitor.h \ ginotifyfilemonitor.h \ gio-marshal.h \ gio.h \ - gioalias.h \ - gioalias.h \ + gkeyfilesettingsbackend.h \ gioenumtypes.h \ giomodule-priv.h \ glocaldirectorymonitor.h \ @@ -331,20 +392,44 @@ IGNORE_HFILES = \ glocalfileenumerator.h \ glocalfileinfo.h \ glocalfileinputstream.h \ + glocalfileiostream.h \ glocalfilemonitor.h \ glocalfileoutputstream.h \ glocalvfs.h \ + gmemorysettingsbackend.h \ + gmountprivate.h \ gnativevolumemonitor.h \ gnetworkingprivate.h \ + gnullsettingsbackend.h \ gpollfilemonitor.h \ + gproxyconnection.h \ + gsettingsbackendinternal.h \ + gsettingsschema.h \ + gsettings-mapping.h \ + gsocketinputstream.h \ + gsocketoutputstream.h \ gthreadedresolver.h \ gunionvolumemonitor.h \ gunixdrive.h \ + gunixmount.h \ + gunixvolumemonitor.h \ gunixresolver.h \ gunixvolume.h \ + gvdb-builder.h \ + gvdb-format.h \ + gvdb-render.h \ gvolumeprivate.h \ gwin32appinfo.h \ + gwin32mount.h \ + gwin32directorymonitor.h \ + gwin32inputstream.h \ + gwin32outputstream.h \ + gwin32volumemonitor.h \ gwin32resolver.h \ + gwinhttpfile.h \ + gwinhttpfileinputstream.h \ + gwinhttpfileoutputstream.h \ + gwinhttpvfs.h \ inotify-diag.h \ inotify-helper.h \ inotify-kernel.h \ @@ -368,15 +453,7 @@ IGNORE_HFILES = \ # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. INCLUDES = \ - -I$(srcdir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gobject \ - -I$(top_srcdir)/gio \ - -I$(top_builddir) \ - -I$(top_builddir)/glib \ - -I$(top_builddir)/gobject \ - -I$(top_builddir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) GTKDOC_LIBS = \ @@ -399,11 +476,22 @@ HTML_IMAGES = \ content_files = \ version.xml \ overview.xml \ - migrating.xml + migrating-posix.xml \ + migrating-gnome-vfs.xml \ + migrating-gconf.xml \ + migrating-gdbus.xml \ + gio-querymodules.xml \ + glib-compile-schemas.xml\ + gsettings.xml \ + gdbus.xml \ + $(NULL) expand_content_files = \ overview.xml \ - migrating.xml + migrating-posix.xml \ + migrating-gnome-vfs.xml \ + migrating-gconf.xml \ + migrating-gdbus.xml extra_files = \ version.xml.in \ @@ -445,9 +533,17 @@ CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp +man_MANS = \ + gio-querymodules.1 \ + glib-compile-schemas.1 \ + gsettings.1 \ + gdbus.1 + +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) all: all-am .SUFFIXES: +.SUFFIXES: .1 .xml $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.decl $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -486,6 +582,44 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list=''; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } tags: TAGS TAGS: @@ -494,6 +628,19 @@ CTAGS: distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -529,8 +676,11 @@ distdir: $(DISTFILES) check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am -all-am: Makefile all-local +all-am: Makefile $(MANS) all-local installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -557,6 +707,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am @@ -577,7 +728,7 @@ info: info-am info-am: -install-data-am: install-data-local +install-data-am: install-data-local install-man install-dvi: install-dvi-am @@ -593,7 +744,7 @@ install-info: install-info-am install-info-am: -install-man: +install-man: install-man1 install-pdf: install-pdf-am @@ -622,7 +773,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-local +uninstall-am: uninstall-local uninstall-man + +uninstall-man: uninstall-man1 .MAKE: check-am install-am install-strip @@ -633,24 +786,27 @@ uninstall-am: uninstall-local install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-local + uninstall-local uninstall-man uninstall-man1 ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -677,8 +833,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -687,9 +847,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: @@ -703,8 +883,11 @@ $(REPORT_FILES): sgml-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) - @cd $(srcdir) && \ - gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ @@ -737,8 +920,11 @@ $(srcdir)/tmpl/*.sgml: sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) - @cd $(srcdir) && \ - gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @@ -848,6 +1034,25 @@ dist-hook: dist-check-gtkdoc dist-hook-local .PHONY : dist-hook-local docs +@ENABLE_MAN_TRUE@.xml.1: +@ENABLE_MAN_TRUE@ @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< + +@ENABLE_MAN_TRUE@dist-local-check-mans-enabled: +@ENABLE_MAN_TRUE@ if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +@ENABLE_MAN_FALSE@$(man_MANS): +@ENABLE_MAN_FALSE@ echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. +@ENABLE_MAN_FALSE@ echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +@ENABLE_MAN_FALSE@dist-local-check-mans-enabled: +@ENABLE_MAN_FALSE@ echo "*** --enable-man must be used in order to make dist" +@ENABLE_MAN_FALSE@ false + +dist-hook-local: dist-local-check-mans-enabled gio-docs-clean all-local + +gio-docs-clean: clean + cd $(srcdir) && rm -rf xml html + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/docs/reference/gio/gdbus.1 b/docs/reference/gio/gdbus.1 new file mode 100644 index 0000000..a9da8c4 --- /dev/null +++ b/docs/reference/gio/gdbus.1 @@ -0,0 +1,249 @@ +'\" t +.\" Title: gdbus +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands +.\" Language: English +.\" +.TH "GDBUS" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gdbus \- Introspect and call remote objects +.SH "SYNOPSIS" +.HP \w'\fBgdbus\fR\ 'u +\fBgdbus\fR introspect [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-dest\ \fIbus_name\fR \-\-object\-path\ \fI/path/to/object\fR \-\-xml +.HP \w'\fBgdbus\fR\ 'u +\fBgdbus\fR monitor [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-dest\ \fIbus_name\fR [\-\-object\-path\ \fI/path/to/object\fR] +.HP \w'\fBgdbus\fR\ 'u +\fBgdbus\fR call [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-dest\ \fIbus_name\fR \-\-object\-path\ \fI/path/to/object\fR \-\-method\ \fIorg\&.project\&.InterfaceName\&.MethodName\fR ARG1 ARG2... +.HP \w'\fBgdbus\fR\ 'u +\fBgdbus\fR help +.SH "DESCRIPTION" +.PP + +\fBgdbus\fR +offers a simple commandline utility for introspecting and calling methods on remote objects\&. +.SS "Commands" +.PP +\fBintrospect\fR +.RS 4 +Prints out interfaces and property values for a remote object\&. For this to work, the owner of the object needs to implement the +org\&.freedesktop\&.DBus\&.Introspectable +interface\&. +.RE +.PP +\fBmonitor\fR +.RS 4 +Monitors one or all objects owned by the owner of +\fIbus_name\fR\&. +.RE +.PP +\fBcall\fR +.RS 4 +Invokes a method on a remote object\&. Each argument to pass to the method must be specified as a serialized +\fBGVariant\fR +except that strings do not need explicit quotes\&. The return values are printed out as serialized +\fBGVariant\fR +values\&. +.RE +.PP +\fBhelp\fR +.RS 4 +Prints help and exit\&. +.RE +.SH "BASH COMPLETION" +.PP + +\fBgdbus\fR +ships with a bash completion script to complete commands, destinations, bus names, object paths and interface/method names\&. +.SH "EXAMPLES" + + This shows how to introspect an object \- note that the value of each + property is displayed: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ gdbus introspect \-\-system \e + \-\-dest org\&.freedesktop\&.NetworkManager \e + \-\-object\-path /org/freedesktop/NetworkManager/Devices/0 +node /org/freedesktop/NetworkManager/Devices/0 { + interface org\&.freedesktop\&.DBus\&.Introspectable { + methods: + Introspect(out s data); + }; + interface org\&.freedesktop\&.DBus\&.Properties { + methods: + Get(in s interface, + in s propname, + out v value); + Set(in s interface, + in s propname, + in v value); + GetAll(in s interface, + out a{sv} props); + }; + interface org\&.freedesktop\&.NetworkManager\&.Device\&.Wired { + signals: + PropertiesChanged(a{sv} arg_0); + properties: + readonly b Carrier = false; + readonly u Speed = 0; + readonly s HwAddress = \*(Aq00:1D:72:88:BE:97\*(Aq; + }; + interface org\&.freedesktop\&.NetworkManager\&.Device { + methods: + Disconnect(); + signals: + StateChanged(u arg_0, + u arg_1, + u arg_2); + properties: + readonly u DeviceType = 1; + readonly b Managed = true; + readwrite o Ip6Config = \*(Aq/\*(Aq; + readwrite o Dhcp4Config = \*(Aq/\*(Aq; + readwrite o Ip4Config = \*(Aq/\*(Aq; + readonly u State = 2; + readwrite u Ip4Address = 0; + readonly u Capabilities = 3; + readonly s Driver = \*(Aqe1000e\*(Aq; + readwrite s Interface = \*(Aqeth0\*(Aq; + readonly s Udi = \*(Aq/sys/devices/pci0000:00/0000:00:19\&.0/net/eth0\*(Aq; + }; +}; +.fi +.if n \{\ +.RE +.\} +.PP +In a similar fashion, the +\fBintrospect\fR +command can be used to learn details about the +Notify +method: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[\&.\&.\&.] + interface org\&.freedesktop\&.Notifications { + methods: + GetServerInformation(out s return_name, + out s return_vendor, + out s return_version, + out s return_spec_version); + GetCapabilities(out as return_caps); + CloseNotification(in u id); + Notify(in s app_name, + in u id, + in s icon, + in s summary, + in s body, + in as actions, + in a{sv} hints, + in i timeout, + out u return_id); + }; +[\&.\&.\&.] +.fi +.if n \{\ +.RE +.\} +.PP +With this information, it\*(Aqs easy to use the +\fBcall\fR +command to display a notification +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ gdbus call \-\-session \e + \-\-dest org\&.freedesktop\&.Notifications \e + \-\-object\-path /org/freedesktop/Notifications \e + \-\-method org\&.freedesktop\&.Notifications\&.Notify \e + my_app_name \e + 42 \e + gtk\-dialog\-info \e + "The Summary" \e + "Here\*(Aqs the body of the notification" \e + [] \e + {} \e + 5000 +(uint32 12,) +.fi +.if n \{\ +.RE +.\} +.PP +Monitoring all objects on a service: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ gdbus monitor \-\-system \-\-dest org\&.freedesktop\&.ConsoleKit +Monitoring signals from all objects owned by org\&.freedesktop\&.ConsoleKit +The name org\&.freedesktop\&.ConsoleKit is owned by :1\&.15 +/org/freedesktop/ConsoleKit/Session2: org\&.freedesktop\&.ConsoleKit\&.Session\&.ActiveChanged (false,) +/org/freedesktop/ConsoleKit/Seat1: org\&.freedesktop\&.ConsoleKit\&.Seat\&.ActiveSessionChanged (\*(Aq\*(Aq,) +/org/freedesktop/ConsoleKit/Session2: org\&.freedesktop\&.ConsoleKit\&.Session\&.ActiveChanged (true,) +/org/freedesktop/ConsoleKit/Seat1: org\&.freedesktop\&.ConsoleKit\&.Seat\&.ActiveSessionChanged (\*(Aq/org/freedesktop/ConsoleKit/Session2\*(Aq,) +.fi +.if n \{\ +.RE +.\} +.PP +Monitoring a single object on a service: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ gdbus monitor \-\-system \-\-dest org\&.freedesktop\&.NetworkManager \-\-object\-path /org/freedesktop/NetworkManager/AccessPoint/4141 +Monitoring signals on object /org/freedesktop/NetworkManager/AccessPoint/4141 owned by org\&.freedesktop\&.NetworkManager +The name org\&.freedesktop\&.NetworkManager is owned by :1\&.5 +/org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: },) +/org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: },) +/org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: },) +/org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: },) +.fi +.if n \{\ +.RE +.\} +.SH "AUTHOR" +.PP +Written by David Zeuthen +zeuthen@gmail\&.com +with a lot of help from many others\&. +.SH "BUGS" +.PP +Please send bug reports to either the distribution bug tracker or the upstream bug tracker at +\m[blue]\fB\%https://bugzilla.gnome.org/enter_bug.cgi?product=glib\fR\m[]\&. +.SH "SEE ALSO" +.PP + +\fBdbus-send\fR(1) diff --git a/docs/reference/gio/gdbus.xml b/docs/reference/gio/gdbus.xml new file mode 100644 index 0000000..280b478 --- /dev/null +++ b/docs/reference/gio/gdbus.xml @@ -0,0 +1,267 @@ + + + + gdbus + 1 + User Commands + + + + gdbus + Introspect and call remote objects + + + + + gdbus + introspect + + --system + --session + --address address + + --dest bus_name + --object-path /path/to/object + --xml + + + gdbus + monitor + + --system + --session + --address address + + --dest bus_name + + --object-path /path/to/object + + + + gdbus + call + + --system + --session + --address address + + --dest bus_name + --object-path /path/to/object + --method org.project.InterfaceName.MethodName + ARG1 + ARG2 + + + gdbus + help + + + + + Description + + gdbus offers a simple commandline utility for + introspecting and calling methods on remote objects. + + + Commands + + + + + Prints out interfaces and property values for a remote object. + For this to work, the owner of the object needs to implement the + org.freedesktop.DBus.Introspectable interface. + + + + + + Monitors one or all objects owned by the owner of + bus_name. + + + + + + Invokes a method on a remote object. Each argument to pass to the + method must be specified as a serialized + GVariant except that strings do + not need explicit quotes. The return values are printed out as + serialized GVariant + values. + + + + + + Prints help and exit. + + + + + + + + Bash Completion + + gdbus ships with a bash completion script to + complete commands, destinations, bus names, object paths and + interface/method names. + + + + + Examples + This shows how to introspect an object - note that the value of each + property is displayed: + +$ gdbus introspect --system \ + --dest org.freedesktop.NetworkManager \ + --object-path /org/freedesktop/NetworkManager/Devices/0 +node /org/freedesktop/NetworkManager/Devices/0 { + interface org.freedesktop.DBus.Introspectable { + methods: + Introspect(out s data); + }; + interface org.freedesktop.DBus.Properties { + methods: + Get(in s interface, + in s propname, + out v value); + Set(in s interface, + in s propname, + in v value); + GetAll(in s interface, + out a{sv} props); + }; + interface org.freedesktop.NetworkManager.Device.Wired { + signals: + PropertiesChanged(a{sv} arg_0); + properties: + readonly b Carrier = false; + readonly u Speed = 0; + readonly s HwAddress = '00:1D:72:88:BE:97'; + }; + interface org.freedesktop.NetworkManager.Device { + methods: + Disconnect(); + signals: + StateChanged(u arg_0, + u arg_1, + u arg_2); + properties: + readonly u DeviceType = 1; + readonly b Managed = true; + readwrite o Ip6Config = '/'; + readwrite o Dhcp4Config = '/'; + readwrite o Ip4Config = '/'; + readonly u State = 2; + readwrite u Ip4Address = 0; + readonly u Capabilities = 3; + readonly s Driver = 'e1000e'; + readwrite s Interface = 'eth0'; + readonly s Udi = '/sys/devices/pci0000:00/0000:00:19.0/net/eth0'; + }; +}; + + + In a similar fashion, the command can be + used to learn details about the Notify method: + + +[...] + interface org.freedesktop.Notifications { + methods: + GetServerInformation(out s return_name, + out s return_vendor, + out s return_version, + out s return_spec_version); + GetCapabilities(out as return_caps); + CloseNotification(in u id); + Notify(in s app_name, + in u id, + in s icon, + in s summary, + in s body, + in as actions, + in a{sv} hints, + in i timeout, + out u return_id); + }; +[...] + + + With this information, it's easy to use the + command to display a notification + + +$ gdbus call --session \ + --dest org.freedesktop.Notifications \ + --object-path /org/freedesktop/Notifications \ + --method org.freedesktop.Notifications.Notify \ + my_app_name \ + 42 \ + gtk-dialog-info \ + "The Summary" \ + "Here's the body of the notification" \ + [] \ + {} \ + 5000 +(uint32 12,) + + + Monitoring all objects on a service: + + +$ gdbus monitor --system --dest org.freedesktop.ConsoleKit +Monitoring signals from all objects owned by org.freedesktop.ConsoleKit +The name org.freedesktop.ConsoleKit is owned by :1.15 +/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (false,) +/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('',) +/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (true,) +/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('/org/freedesktop/ConsoleKit/Session2',) + + + Monitoring a single object on a service: + + +$ gdbus monitor --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager/AccessPoint/4141 +Monitoring signals on object /org/freedesktop/NetworkManager/AccessPoint/4141 owned by org.freedesktop.NetworkManager +The name org.freedesktop.NetworkManager is owned by :1.5 +/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5c>},) +/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},) +/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5e>},) +/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},) + + + + + + AUTHOR + + Written by David Zeuthen zeuthen@gmail.com with + a lot of help from many others. + + + + + BUGS + + Please send bug reports to either the distribution bug tracker + or the upstream bug tracker at + . + + + + + SEE ALSO + + + dbus-send1 + + + + + + diff --git a/docs/reference/gio/gio-docs.xml b/docs/reference/gio/gio-docs.xml index c7561d4..ad1aee5 100644 --- a/docs/reference/gio/gio-docs.xml +++ b/docs/reference/gio/gio-docs.xml @@ -20,24 +20,28 @@ API Reference - File Operations - + File Operations + - - - - + + + + - File System Monitoring + File System Monitoring + + File-related Utilities + + Asynchronous I/O - - + + - + Data conversion @@ -48,7 +52,7 @@ Streaming I/O - + @@ -68,37 +72,39 @@ + + File types and applications - - + + - Volumes and Drives + Volumes and Drives - + - - + + - Icons - - - - - - + Icons + + + + + + - Failable Initialization - - + Failable Initialization + + - Lowlevel platform-independent network support + Lowlevel network support @@ -107,36 +113,99 @@ + + + + + + + Highlevel network functionallity + + + + + + + + + + + TLS (SSL) support + + + + + + DNS resolution + - - Highlevel network functionallity - - - - - + + Lowlevel D-Bus Support + + + + + + + + + - - Utilities - + + Highlevel D-Bus Support + + + + + + Settings + + + + + Permissions + + + + + Application support + + + + + + - Extending GIO + Extending GIO - - + + + + + GIO Tools + + + + - + + Migrating to GIO + + + + + Object Hierarchy @@ -167,4 +236,15 @@ Index of new symbols in 2.24 + + Index of new symbols in 2.26 + + + + Index of new symbols in 2.28 + + + + + diff --git a/docs/reference/gio/gio-querymodules.1 b/docs/reference/gio/gio-querymodules.1 new file mode 100644 index 0000000..47380ac --- /dev/null +++ b/docs/reference/gio/gio-querymodules.1 @@ -0,0 +1,44 @@ +'\" t +.\" Title: gio-querymodules +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands +.\" Language: English +.\" +.TH "GIO\-QUERYMODULES" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gio-querymodules \- GIO module cache creation +.SH "SYNOPSIS" +.HP \w'\fBgio\-querymodules\fR\ 'u +\fBgio\-querymodules\fR {directory...} +.SH "DESCRIPTION" +.PP +\fBgio\-querymodules\fR +creates a +giomodule\&.cache +file in the listed directories\&. This file lists the implemented extension points for each module that has been found\&. It is used by GIO at runtime to avoid opening all modules just to find out which extension points they are implementing\&. +.PP +GIO modules are usually installed in the +gio/modules +subdirectory of libdir\&. diff --git a/docs/reference/gio/gio-querymodules.xml b/docs/reference/gio/gio-querymodules.xml new file mode 100644 index 0000000..7fecd3e --- /dev/null +++ b/docs/reference/gio/gio-querymodules.xml @@ -0,0 +1,33 @@ + + + + gio-querymodules + 1 + User Commands + + + + gio-querymodules + GIO module cache creation + + + + + gio-querymodules + directory + + + +Description +gio-querymodules creates a +giomodule.cache file in the listed directories. +This file lists the implemented extension points for each module +that has been found. It is used by GIO at runtime to avoid opening +all modules just to find out which extension points they are implementing. + + +GIO modules are usually installed in the gio/modules +subdirectory of libdir. + + + diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt index 9849a04..2facc21 100644 --- a/docs/reference/gio/gio-sections.txt +++ b/docs/reference/gio/gio-sections.txt @@ -299,6 +299,8 @@ G_FILE_ATTRIBUTE_FILESYSTEM_READONLY G_FILE_ATTRIBUTE_GVFS_BACKEND G_FILE_ATTRIBUTE_SELINUX_CONTEXT G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT +G_FILE_ATTRIBUTE_TRASH_DELETION_DATE +G_FILE_ATTRIBUTE_TRASH_ORIG_PATH G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION g_file_info_new @@ -376,6 +378,7 @@ G_TYPE_FILE_INFO G_FILE_INFO_CLASS G_IS_FILE_INFO_CLASS G_FILE_INFO_GET_CLASS +g_file_attribute_matcher_get_type g_file_info_get_type
@@ -503,6 +506,7 @@ g_emblemed_icon_new g_emblemed_icon_get_icon g_emblemed_icon_get_emblems g_emblemed_icon_add_emblem +g_emblemed_icon_clear_emblems GEmblemedIconClass G_EMBLEMED_ICON @@ -668,6 +672,9 @@ g_data_input_stream_read_uint64 g_data_input_stream_read_line g_data_input_stream_read_line_async g_data_input_stream_read_line_finish +g_data_input_stream_read_upto +g_data_input_stream_read_upto_async +g_data_input_stream_read_upto_finish g_data_input_stream_read_until g_data_input_stream_read_until_async g_data_input_stream_read_until_finish @@ -820,6 +827,7 @@ g_memory_output_stream_new g_memory_output_stream_get_data g_memory_output_stream_get_size g_memory_output_stream_get_data_size +g_memory_output_stream_steal_data GMemoryOutputStreamClass G_MEMORY_OUTPUT_STREAM @@ -885,9 +893,12 @@ GUnixOutputStreamPrivate
giostream GIOStream +GIOStreamSpliceFlags GIOStream g_io_stream_get_input_stream g_io_stream_get_output_stream +g_io_stream_splice_async +g_io_stream_splice_finish g_io_stream_close g_io_stream_close_async g_io_stream_close_finish @@ -1100,6 +1111,8 @@ g_cancellable_set_error_if_cancelled g_cancellable_get_fd g_cancellable_make_pollfd g_cancellable_release_fd +g_cancellable_source_new +GCancellableSourceFunc g_cancellable_get_current g_cancellable_pop_current g_cancellable_push_current @@ -1116,6 +1129,7 @@ G_CANCELLABLE_CLASS G_IS_CANCELLABLE_CLASS G_CANCELLABLE_GET_CLASS +GCancellablePrivate g_cancellable_get_type
@@ -1144,6 +1158,7 @@ GSimpleAsyncThreadFunc g_simple_async_result_new g_simple_async_result_new_error g_simple_async_result_new_from_error +g_simple_async_result_new_take_error g_simple_async_result_set_op_res_gpointer g_simple_async_result_get_op_res_gpointer g_simple_async_result_set_op_res_gssize @@ -1157,11 +1172,13 @@ g_simple_async_result_complete g_simple_async_result_complete_in_idle g_simple_async_result_run_in_thread g_simple_async_result_set_from_error +g_simple_async_result_take_error g_simple_async_result_propagate_error g_simple_async_result_set_error g_simple_async_result_set_error_va g_simple_async_report_error_in_idle g_simple_async_report_gerror_in_idle +g_simple_async_report_take_gerror_in_idle GSimpleAsyncResultClass G_SIMPLE_ASYNC_RESULT @@ -1191,6 +1208,7 @@ g_io_scheduler_job_send_to_mainloop_async G_IO_ERROR GIOErrorEnum g_io_error_from_errno +g_io_error_from_win32_error g_io_error_quark @@ -1238,6 +1256,7 @@ g_app_info_delete g_app_info_reset_type_associations g_app_info_set_as_default_for_type g_app_info_set_as_default_for_extension +g_app_info_set_as_last_used_for_type g_app_info_add_supports_type g_app_info_can_remove_supports_type g_app_info_remove_supports_type @@ -1245,6 +1264,8 @@ g_app_info_get_all g_app_info_get_all_for_type g_app_info_get_default_for_type g_app_info_get_default_for_uri_scheme +g_app_info_get_fallback_for_type +g_app_info_get_recommended_for_type g_app_info_launch_default_for_uri g_app_launch_context_get_display g_app_launch_context_get_startup_notify_id @@ -1325,7 +1346,6 @@ g_filename_completer_get_type
gunixmounts Unix Mounts -GUnixMount GUnixMountPoint GUnixMountEntry GUnixMountMonitor @@ -1360,28 +1380,14 @@ g_unix_mount_monitor_new g_unix_mount_monitor_set_rate_limit g_unix_is_mount_path_system_internal -GUnixMountClass GUnixMountMonitorClass G_UNIX_MOUNT_MONITOR G_IS_UNIX_MOUNT_MONITOR G_TYPE_UNIX_MOUNT_MONITOR G_UNIX_MOUNT_MONITOR_CLASS G_IS_UNIX_MOUNT_MONITOR_CLASS -G_IS_UNIX_MOUNT -G_IS_UNIX_MOUNT_CLASS -G_UNIX_MOUNT -G_UNIX_MOUNT_CLASS -G_TYPE_UNIX_MOUNT g_unix_mount_monitor_get_type -G_IS_UNIX_VOLUME_MONITOR -G_IS_UNIX_VOLUME_MONITOR_CLASS -G_TYPE_UNIX_VOLUME_MONITOR -G_UNIX_VOLUME_MONITOR -G_UNIX_VOLUME_MONITOR_CLASS -GUnixVolume -GUnixVolumeMonitor -GUnixVolumeMonitorClass
@@ -1394,9 +1400,6 @@ g_desktop_app_info_new g_desktop_app_info_get_filename g_desktop_app_info_get_is_hidden g_desktop_app_info_set_desktop_env -GDesktopAppInfoLookup -G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME -g_desktop_app_info_lookup_get_default_for_uri_scheme GDesktopAppInfoClass G_TYPE_DESKTOP_APP_INFO @@ -1405,14 +1408,8 @@ G_DESKTOP_APP_INFO_CLASS G_IS_DESKTOP_APP_INFO G_IS_DESKTOP_APP_INFO_CLASS G_DESKTOP_APP_INFO_GET_CLASS -GDesktopAppInfoLookupIface -G_DESKTOP_APP_INFO_LOOKUP -G_TYPE_DESKTOP_APP_INFO_LOOKUP -G_DESKTOP_APP_INFO_LOOKUP_GET_IFACE -G_IS_DESKTOP_APP_INFO_LOOKUP g_desktop_app_info_get_type -g_desktop_app_info_lookup_get_type
@@ -1468,12 +1465,15 @@ g_unix_fd_list_steal_fds g_unix_fd_list_append GUnixFDListClass -g_unix_fd_list_get_type G_UNIX_FD_LIST G_UNIX_FD_LIST_CLASS G_IS_UNIX_FD_LIST G_IS_UNIX_FD_LIST_CLASS G_UNIX_FD_LIST_GET_CLASS +G_TYPE_UNIX_FD_LIST + +GUnixFDListPrivate +g_unix_fd_list_get_type
@@ -1556,9 +1556,12 @@ g_inet_socket_address_get_type gunixsocketaddress GUnixSocketAddress GUnixSocketAddress +GUnixSocketAddressType g_unix_socket_address_new g_unix_socket_address_new_abstract +g_unix_socket_address_new_with_type g_unix_socket_address_get_is_abstract +g_unix_socket_address_get_address_type g_unix_socket_address_get_path g_unix_socket_address_get_path_len g_unix_socket_address_abstract_names_supported @@ -1592,9 +1595,11 @@ g_resolver_lookup_service g_resolver_lookup_service_async g_resolver_lookup_service_finish g_resolver_free_targets + G_RESOLVER_ERROR GResolverError + GResolverClass G_IS_RESOLVER @@ -1603,7 +1608,9 @@ G_RESOLVER G_RESOLVER_CLASS G_RESOLVER_GET_CLASS G_TYPE_RESOLVER + +GResolverPrivate g_resolver_get_type g_resolver_error_quark
@@ -1632,11 +1639,14 @@ g_srv_target_get_type GSocketConnectable GSocketConnectableIface g_socket_connectable_enumerate +g_socket_connectable_proxy_enumerate GSocketAddressEnumerator g_socket_address_enumerator_next g_socket_address_enumerator_next_async g_socket_address_enumerator_next_finish + +GProxyAddressEnumerator G_IS_SOCKET_CONNECTABLE G_SOCKET_CONNECTABLE @@ -1649,7 +1659,16 @@ G_SOCKET_ADDRESS_ENUMERATOR G_SOCKET_ADDRESS_ENUMERATOR_CLASS G_SOCKET_ADDRESS_ENUMERATOR_GET_CLASS G_TYPE_SOCKET_ADDRESS_ENUMERATOR - +GProxyAddressEnumeratorClass +G_IS_PROXY_ADDRESS_ENUMERATOR +G_IS_PROXY_ADDRESS_ENUMERATOR_CLASS +G_PROXY_ADDRESS_ENUMERATOR +G_PROXY_ADDRESS_ENUMERATOR_CLASS +G_PROXY_ADDRESS_ENUMERATOR_GET_CLASS +G_TYPE_PROXY_ADDRESS_ENUMERATOR + +GProxyAddressEnumeratorPrivate +g_proxy_address_enumerator_get_type g_socket_address_enumerator_get_type g_socket_connectable_get_type @@ -1661,7 +1680,9 @@ GNetworkAddress g_network_address_new g_network_address_get_hostname g_network_address_get_port +g_network_address_get_scheme g_network_address_parse +g_network_address_parse_uri GNetworkAddressClass GNetworkAddressPrivate @@ -1683,6 +1704,8 @@ g_network_service_new g_network_service_get_service g_network_service_get_protocol g_network_service_get_domain +g_network_service_get_scheme +g_network_service_set_scheme GNetworkServiceClass GNetworkServicePrivate @@ -1716,9 +1739,11 @@ g_socket_check_connect_result g_socket_receive g_socket_receive_from g_socket_receive_message +g_socket_receive_with_blocking g_socket_send g_socket_send_to g_socket_send_message +g_socket_send_with_blocking g_socket_close g_socket_is_closed g_socket_shutdown @@ -1732,6 +1757,8 @@ g_socket_get_blocking g_socket_set_blocking g_socket_get_keepalive g_socket_set_keepalive +g_socket_get_timeout +g_socket_set_timeout g_socket_get_family g_socket_get_fd g_socket_get_local_address @@ -1739,6 +1766,7 @@ g_socket_get_protocol g_socket_get_remote_address g_socket_get_socket_type g_socket_speaks_ipv4 +g_socket_get_credentials GSocketClass G_IS_SOCKET @@ -1756,6 +1784,7 @@ GSocketPrivate gsocketclient GSocketClient GSocketClient +g_socket_client_add_application_proxy g_socket_client_new g_socket_client_connect g_socket_client_connect_async @@ -1766,14 +1795,25 @@ g_socket_client_connect_to_host_finish g_socket_client_connect_to_service g_socket_client_connect_to_service_async g_socket_client_connect_to_service_finish +g_socket_client_connect_to_uri +g_socket_client_connect_to_uri_async +g_socket_client_connect_to_uri_finish g_socket_client_set_family g_socket_client_set_local_address g_socket_client_set_protocol g_socket_client_set_socket_type +g_socket_client_set_timeout +g_socket_client_set_enable_proxy +g_socket_client_set_tls +g_socket_client_set_tls_validation_flags g_socket_client_get_family g_socket_client_get_local_address g_socket_client_get_protocol g_socket_client_get_socket_type +g_socket_client_get_timeout +g_socket_client_get_enable_proxy +g_socket_client_get_tls +g_socket_client_get_tls_validation_flags GSocketClientClass G_IS_SOCKET_CLIENT @@ -1795,14 +1835,6 @@ g_socket_connection_get_local_address g_socket_connection_get_remote_address g_socket_connection_get_socket -GTcpConnection -g_tcp_connection_set_graceful_disconnect -g_tcp_connection_get_graceful_disconnect - -GUnixConnection -g_unix_connection_receive_fd -g_unix_connection_send_fd - g_socket_connection_factory_create_connection g_socket_connection_factory_lookup_type g_socket_connection_factory_register_type @@ -1814,13 +1846,20 @@ G_SOCKET_CONNECTION G_SOCKET_CONNECTION_CLASS G_SOCKET_CONNECTION_GET_CLASS G_TYPE_SOCKET_CONNECTION -GTcpConnectionClass -G_IS_TCP_CONNECTION -G_IS_TCP_CONNECTION_CLASS -G_TCP_CONNECTION -G_TCP_CONNECTION_CLASS -G_TCP_CONNECTION_GET_CLASS -G_TYPE_TCP_CONNECTION + +GSocketConnectionPrivate +g_socket_connection_get_type + + +
+gunixconnection +GUnixConnection +GUnixConnection +g_unix_connection_receive_fd +g_unix_connection_send_fd +g_unix_connection_receive_credentials +g_unix_connection_send_credentials + GUnixConnectionClass G_IS_UNIX_CONNECTION G_IS_UNIX_CONNECTION_CLASS @@ -1829,15 +1868,49 @@ G_UNIX_CONNECTION G_UNIX_CONNECTION_CLASS G_UNIX_CONNECTION_GET_CLASS -GSocketConnectionPrivate -g_socket_connection_get_type -GTcpConnectionPrivate -g_tcp_connection_get_type GUnixConnectionPrivate g_unix_connection_get_type
+gtcpconnection +GTcpConnection +GTcpConnection +g_tcp_connection_set_graceful_disconnect +g_tcp_connection_get_graceful_disconnect + +GTcpConnectionClass +G_IS_TCP_CONNECTION +G_IS_TCP_CONNECTION_CLASS +G_TYPE_TCP_CONNECTION +G_TCP_CONNECTION +G_TCP_CONNECTION_CLASS +G_TCP_CONNECTION_GET_CLASS + +GTcpConnectionPrivate +g_tcp_connection_get_type +
+ +
+gtcpwrapperconnection +GTcpWrapperConnection +GTcpWrapperConnection +g_tcp_wrapper_connection_new +g_tcp_wrapper_connection_get_base_io_stream + +GTcpWrapperConnectionClass +G_IS_TCP_WRAPPER_CONNECTION +G_IS_TCP_WRAPPER_CONNECTION_CLASS +G_TYPE_TCP_WRAPPER_CONNECTION +G_TCP_WRAPPER_CONNECTION +G_TCP_WRAPPER_CONNECTION_CLASS +G_TCP_WRAPPER_CONNECTION_GET_CLASS + +GTcpWrapperConnectionPrivate +g_tcp_wrapper_connection_get_type +
+ +
gsocketcontrolmessage GSocketControlMessage GSocketControlMessage @@ -1883,7 +1956,6 @@ G_IS_SOCKET_LISTENER_CLASS G_SOCKET_LISTENER G_SOCKET_LISTENER_CLASS G_SOCKET_LISTENER_GET_CLASS -G_TYPE_SOCKET_INPUT_STREAM G_TYPE_SOCKET_LISTENER GSocketListenerPrivate @@ -1957,6 +2029,7 @@ g_unix_fd_message_get_type GConverter GConverterIface GConverterResult +GConverterFlags g_converter_convert g_converter_reset @@ -2032,6 +2105,8 @@ g_converter_output_stream_get_type GZlibCompressor GZlibCompressorFormat g_zlib_compressor_new +g_zlib_compressor_get_file_info +g_zlib_compressor_set_file_info GZlibCompressorClass G_TYPE_ZLIB_COMPRESSOR @@ -2049,6 +2124,7 @@ g_zlib_compressor_get_type GZlibDecompressor GZlibDecompressor g_zlib_decompressor_new +g_zlib_decompressor_get_file_info GZlibDecompressorClass G_TYPE_ZLIB_DECOMPRESSOR @@ -2075,3 +2151,953 @@ G_FILE_DESCRIPTOR_BASED_GET_IFACE G_IS_FILE_DESCRIPTOR_BASED G_TYPE_FILE_DESCRIPTOR_BASED
+ +
+gsettingsbackend +GSettingsBackend +GSettingsBackend +GSettingsBackendClass +G_SETTINGS_BACKEND_EXTENSION_POINT_NAME +g_settings_backend_changed +g_settings_backend_path_changed +g_settings_backend_keys_changed +g_settings_backend_path_writable_changed +g_settings_backend_writable_changed +g_settings_backend_changed_tree +g_settings_backend_flatten_tree +g_keyfile_settings_backend_new + + +G_IS_SETTINGS_BACKEND +G_IS_SETTINGS_BACKEND_CLASS +G_SETTINGS_BACKEND +G_SETTINGS_BACKEND_CLASS +G_SETTINGS_BACKEND_GET_CLASS +G_TYPE_SETTINGS_BACKEND + + +g_settings_backend_get_type +GSettingsBackendPrivate +
+ +
+gsettings +GSettings +GSettings +g_settings_new +g_settings_new_with_path +g_settings_new_with_backend +g_settings_new_with_backend_and_path +g_settings_sync +g_settings_get_value +g_settings_set_value +g_settings_is_writable +g_settings_delay +g_settings_apply +g_settings_revert +g_settings_get_has_unapplied +g_settings_get_child +g_settings_reset + + +g_settings_list_schemas +g_settings_list_relocatable_schemas +g_settings_list_keys +g_settings_list_children +g_settings_get_range +g_settings_range_check + + +g_settings_get +g_settings_set +g_settings_get_boolean +g_settings_set_boolean +g_settings_get_int +g_settings_set_int +g_settings_get_double +g_settings_set_double +g_settings_get_string +g_settings_set_string +g_settings_get_strv +g_settings_set_strv +g_settings_get_enum +g_settings_set_enum +g_settings_get_flags +g_settings_set_flags + + +GSettingsGetMapping +g_settings_get_mapped + + +GSettingsBindFlags +g_settings_bind +g_settings_bind_with_mapping +g_settings_bind_writable +g_settings_unbind +GSettingsBindSetMapping +GSettingsBindGetMapping + + +GSettingsClass +G_IS_SETTINGS +G_IS_SETTINGS_CLASS +G_SETTINGS +G_SETTINGS_CLASS +G_SETTINGS_GET_CLASS +G_TYPE_SETTINGS + + +GSettingsPrivate +g_settings_get_type +
+ +
+gunixcredentialsmessage +GUnixCredentialsMessage +GUnixCredentialsMessage +GUnixCredentialsMessageClass +g_unix_credentials_message_new +g_unix_credentials_message_new_with_credentials +g_unix_credentials_message_get_credentials +g_unix_credentials_message_is_supported + +G_IS_UNIX_CREDENTIALS_MESSAGE +G_IS_UNIX_CREDENTIALS_MESSAGE_CLASS +G_TYPE_UNIX_CREDENTIALS_MESSAGE +G_UNIX_CREDENTIALS_MESSAGE +G_UNIX_CREDENTIALS_MESSAGE_CLASS +G_UNIX_CREDENTIALS_MESSAGE_GET_CLASS + +GUnixCredentialsMessagePrivate +g_unix_credentials_message_get_type +
+ +
+gcredentials +GCredentials +GCredentials +GCredentialsType +g_credentials_new +g_credentials_to_string +g_credentials_get_native +g_credentials_set_native +g_credentials_is_same_user +g_credentials_get_unix_user +g_credentials_set_unix_user + +G_CREDENTIALS +G_IS_CREDENTIALS +G_TYPE_CREDENTIALS +G_CREDENTIALS_CLASS +G_IS_CREDENTIALS_CLASS +G_CREDENTIALS_GET_CLASS + +GCredentialsPrivate +g_credentials_get_type +
+ +
+gdbusaddress +g_dbus_is_address +g_dbus_is_supported_address +g_dbus_address_get_stream +g_dbus_address_get_stream_finish +g_dbus_address_get_stream_sync +g_dbus_address_get_for_bus_sync +
+ +
+gdbusutils +g_dbus_generate_guid +g_dbus_is_guid +g_dbus_is_name +g_dbus_is_unique_name +g_dbus_is_member_name +g_dbus_is_interface_name +
+ +
+gdbusauthobserver +GDBusAuthObserver +GDBusAuthObserver +g_dbus_auth_observer_new +g_dbus_auth_observer_authorize_authenticated_peer + +G_DBUS_AUTH_OBSERVER +G_IS_DBUS_AUTH_OBSERVER +G_TYPE_DBUS_AUTH_OBSERVER + +g_dbus_auth_observer_get_type +
+ +
+gdbusserver +GDBusServer +GDBusServer +GDBusServerFlags +g_dbus_server_new_sync +g_dbus_server_start +g_dbus_server_stop +g_dbus_server_is_active +g_dbus_server_get_guid +g_dbus_server_get_flags +g_dbus_server_get_client_address + +G_DBUS_SERVER +G_IS_DBUS_SERVER +G_TYPE_DBUS_SERVER + +g_dbus_server_get_type +
+ +
+gdbusmessage +GDBusMessage +GDBusMessage +GDBusMessageType +GDBusMessageFlags +GDBusMessageHeaderField +GDBusMessageByteOrder +g_dbus_message_new +g_dbus_message_new_signal +g_dbus_message_new_method_call +g_dbus_message_new_method_reply +g_dbus_message_new_method_error +g_dbus_message_new_method_error_valist +g_dbus_message_new_method_error_literal +g_dbus_message_print +g_dbus_message_get_locked +g_dbus_message_lock +g_dbus_message_copy +g_dbus_message_get_byte_order +g_dbus_message_set_byte_order +g_dbus_message_get_message_type +g_dbus_message_set_message_type +g_dbus_message_get_serial +g_dbus_message_set_serial +g_dbus_message_get_flags +g_dbus_message_set_flags +g_dbus_message_get_body +g_dbus_message_set_body +g_dbus_message_get_unix_fd_list +g_dbus_message_set_unix_fd_list +g_dbus_message_get_num_unix_fds +g_dbus_message_set_num_unix_fds +g_dbus_message_get_header_fields +g_dbus_message_get_header +g_dbus_message_set_header +g_dbus_message_get_destination +g_dbus_message_set_destination +g_dbus_message_get_error_name +g_dbus_message_set_error_name +g_dbus_message_get_interface +g_dbus_message_set_interface +g_dbus_message_get_member +g_dbus_message_set_member +g_dbus_message_get_path +g_dbus_message_set_path +g_dbus_message_get_reply_serial +g_dbus_message_set_reply_serial +g_dbus_message_get_sender +g_dbus_message_set_sender +g_dbus_message_get_signature +g_dbus_message_set_signature +g_dbus_message_get_arg0 +g_dbus_message_to_blob +g_dbus_message_bytes_needed +g_dbus_message_new_from_blob +g_dbus_message_to_gerror + +G_DBUS_MESSAGE +G_IS_DBUS_MESSAGE +G_TYPE_DBUS_MESSAGE + +g_dbus_message_get_type +
+ +
+gdbusconnection +GDBusConnection +GBusType +g_bus_get +g_bus_get_finish +g_bus_get_sync +GDBusConnection +GDBusConnectionFlags +g_dbus_connection_new +g_dbus_connection_new_finish +g_dbus_connection_new_sync +g_dbus_connection_new_for_address +g_dbus_connection_new_for_address_finish +g_dbus_connection_new_for_address_sync +g_dbus_connection_start_message_processing +g_dbus_connection_close +g_dbus_connection_close_finish +g_dbus_connection_close_sync +g_dbus_connection_is_closed +g_dbus_connection_flush +g_dbus_connection_flush_finish +g_dbus_connection_flush_sync +g_dbus_connection_get_exit_on_close +g_dbus_connection_set_exit_on_close +g_dbus_connection_get_stream +g_dbus_connection_get_guid +g_dbus_connection_get_unique_name +GDBusCapabilityFlags +g_dbus_connection_get_capabilities +g_dbus_connection_get_peer_credentials +GDBusCallFlags +g_dbus_connection_call +g_dbus_connection_call_finish +g_dbus_connection_call_sync +g_dbus_connection_emit_signal +GDBusSignalFlags +GDBusSignalCallback +g_dbus_connection_signal_subscribe +g_dbus_connection_signal_unsubscribe +GDBusSendMessageFlags +g_dbus_connection_send_message +g_dbus_connection_send_message_with_reply +g_dbus_connection_send_message_with_reply_finish +g_dbus_connection_send_message_with_reply_sync +GDBusMessageFilterFunction +g_dbus_connection_add_filter +g_dbus_connection_remove_filter +GDBusInterfaceVTable +GDBusInterfaceMethodCallFunc +GDBusInterfaceGetPropertyFunc +GDBusInterfaceSetPropertyFunc +g_dbus_connection_register_object +g_dbus_connection_unregister_object +GDBusSubtreeVTable +GDBusSubtreeEnumerateFunc +GDBusSubtreeIntrospectFunc +GDBusSubtreeDispatchFunc +GDBusSubtreeFlags +g_dbus_connection_register_subtree +g_dbus_connection_unregister_subtree + +G_DBUS_CONNECTION +G_IS_DBUS_CONNECTION +G_TYPE_DBUS_CONNECTION + +g_dbus_connection_get_type +
+ +
+gdbusmethodinvocation +GDBusMethodInvocation +GDBusMethodInvocation +g_dbus_method_invocation_get_sender +g_dbus_method_invocation_get_object_path +g_dbus_method_invocation_get_interface_name +g_dbus_method_invocation_get_method_name +g_dbus_method_invocation_get_method_info +g_dbus_method_invocation_get_connection +g_dbus_method_invocation_get_message +g_dbus_method_invocation_get_parameters +g_dbus_method_invocation_get_user_data +g_dbus_method_invocation_return_value +g_dbus_method_invocation_return_error +g_dbus_method_invocation_return_error_valist +g_dbus_method_invocation_return_error_literal +g_dbus_method_invocation_return_gerror +g_dbus_method_invocation_return_dbus_error + +G_DBUS_METHOD_INVOCATION +G_IS_DBUS_METHOD_INVOCATION +G_TYPE_DBUS_METHOD_INVOCATION + +g_dbus_method_invocation_get_type +
+ +
+gdbusnameowning +GBusAcquiredCallback +GBusNameAcquiredCallback +GBusNameLostCallback +GBusNameOwnerFlags +g_bus_own_name +g_bus_own_name_on_connection +g_bus_unown_name +g_bus_own_name_with_closures +g_bus_own_name_on_connection_with_closures +
+ +
+gdbusnamewatching +GBusNameAppearedCallback +GBusNameVanishedCallback +GBusNameWatcherFlags +g_bus_watch_name +g_bus_watch_name_on_connection +g_bus_unwatch_name +g_bus_watch_name_with_closures +g_bus_watch_name_on_connection_with_closures +
+ +
+gdbuserror +GDBusError +G_DBUS_ERROR +g_dbus_error_is_remote_error +g_dbus_error_get_remote_error +g_dbus_error_strip_remote_error +GDBusErrorEntry +g_dbus_error_register_error_domain +g_dbus_error_register_error +g_dbus_error_unregister_error +g_dbus_error_new_for_dbus_error +g_dbus_error_set_dbus_error +g_dbus_error_set_dbus_error_valist +g_dbus_error_encode_gerror + +g_dbus_error_quark +
+ +
+gdbusproxy +GDBusProxy +GDBusProxyFlags +GDBusProxy +GDBusProxyClass +g_dbus_proxy_new +g_dbus_proxy_new_finish +g_dbus_proxy_new_sync +g_dbus_proxy_new_for_bus +g_dbus_proxy_new_for_bus_finish +g_dbus_proxy_new_for_bus_sync +g_dbus_proxy_get_flags +g_dbus_proxy_get_connection +g_dbus_proxy_get_name +g_dbus_proxy_get_name_owner +g_dbus_proxy_get_object_path +g_dbus_proxy_get_interface_name +g_dbus_proxy_get_default_timeout +g_dbus_proxy_set_default_timeout +g_dbus_proxy_get_cached_property +g_dbus_proxy_set_cached_property +g_dbus_proxy_get_cached_property_names +g_dbus_proxy_set_interface_info +g_dbus_proxy_get_interface_info +g_dbus_proxy_call +g_dbus_proxy_call_finish +g_dbus_proxy_call_sync + +G_DBUS_PROXY +G_IS_DBUS_PROXY +G_TYPE_DBUS_PROXY +G_DBUS_PROXY_CLASS +G_IS_DBUS_PROXY_CLASS +G_DBUS_PROXY_GET_CLASS + +GDBusProxyPrivate +g_dbus_proxy_get_type +
+ +
+gdbusintrospection +GDBusAnnotationInfo +GDBusArgInfo +GDBusMethodInfo +GDBusSignalInfo +GDBusPropertyInfoFlags +GDBusPropertyInfo +GDBusInterfaceInfo +GDBusNodeInfo +g_dbus_annotation_info_lookup +g_dbus_interface_info_lookup_method +g_dbus_interface_info_lookup_signal +g_dbus_interface_info_lookup_property +g_dbus_interface_info_generate_xml +g_dbus_node_info_new_for_xml +g_dbus_node_info_lookup_interface +g_dbus_node_info_generate_xml +G_TYPE_DBUS_NODE_INFO +G_TYPE_DBUS_INTERFACE_INFO +G_TYPE_DBUS_METHOD_INFO +G_TYPE_DBUS_SIGNAL_INFO +G_TYPE_DBUS_PROPERTY_INFO +G_TYPE_DBUS_ARG_INFO +G_TYPE_DBUS_ANNOTATION_INFO +g_dbus_node_info_ref +g_dbus_interface_info_ref +g_dbus_method_info_ref +g_dbus_signal_info_ref +g_dbus_property_info_ref +g_dbus_arg_info_ref +g_dbus_annotation_info_ref +g_dbus_node_info_unref +g_dbus_interface_info_unref +g_dbus_method_info_unref +g_dbus_signal_info_unref +g_dbus_property_info_unref +g_dbus_arg_info_unref +g_dbus_annotation_info_unref + +g_dbus_annotation_info_get_type +g_dbus_arg_info_get_type +g_dbus_interface_info_get_type +g_dbus_method_info_get_type +g_dbus_node_info_get_type +g_dbus_property_info_get_type +g_dbus_signal_info_get_type +
+ +
+gpermission +GPermission +g_permission_get_allowed +g_permission_get_can_acquire +g_permission_get_can_release + +g_permission_acquire +g_permission_acquire_async +g_permission_acquire_finish +g_permission_release +g_permission_release_async +g_permission_release_finish + +g_permission_impl_update + +G_PERMISSION +G_PERMISSION_CLASS +G_PERMISSION_GET_CLASS +G_IS_PERMISSION +G_IS_PERMISSION_CLASS +GPermissionClass +G_TYPE_PERMISSION + +g_permission_get_type +GPermissionPrivate +
+ +
+gsimplepermission +GSimplePermission +g_simple_permission_new + + +G_SIMPLE_PERMISSION +G_IS_SIMPLE_PERMISSION +G_TYPE_SIMPLE_PERMISSION + + +g_simple_permission_get_type +
+ +
+gapplication +GApplication +GApplicationClass + +GApplicationFlags +g_application_id_is_valid +g_application_new + +g_application_get_application_id +g_application_set_application_id + +g_application_get_inactivity_timeout +g_application_set_inactivity_timeout + +g_application_get_flags +g_application_set_flags + +g_application_set_action_group + +g_application_get_is_registered +g_application_get_is_remote +g_application_register + +g_application_hold +g_application_release + +g_application_activate +g_application_open + +g_application_run + +G_TYPE_APPLICATION +G_APPLICATION +G_APPLICATION_CLASS +G_IS_APPLICATION +G_IS_APPLICATION_CLASS +G_APPLICATION_GET_CLASS + +GApplicationPrivate +g_application_get_type +
+ +
+gapplicationcommandline +GApplicationCommandLine +GApplicationCommandLineClass + +g_application_command_line_get_arguments +g_application_command_line_get_cwd +g_application_command_line_get_environ +g_application_command_line_getenv +g_application_command_line_get_is_remote +g_application_command_line_get_platform_data + +g_application_command_line_set_exit_status +g_application_command_line_get_exit_status + +g_application_command_line_print +g_application_command_line_printerr + +G_TYPE_APPLICATION_COMMAND_LINE +G_APPLICATION_COMMAND_LINE +G_APPLICATION_COMMAND_LINE_CLASS +G_IS_APPLICATION_COMMAND_LINE +G_IS_APPLICATION_COMMAND_LINE_CLASS +G_APPLICATION_COMMAND_LINE_GET_CLASS + +GApplicationCommandLinePrivate +g_application_command_line_get_type +
+ + +
+gactiongroup +GActionGroup +GActionGroup + + +g_action_group_has_action +g_action_group_list_actions + + +g_action_group_get_action_enabled +g_action_group_get_action_parameter_type +g_action_group_get_action_state_type +g_action_group_get_action_state_hint + + +g_action_group_get_action_state +g_action_group_change_action_state + + +g_action_group_activate_action + + +g_action_group_action_added +g_action_group_action_removed +g_action_group_action_enabled_changed +g_action_group_action_state_changed + + +g_action_group_get_type +GActionGroupPrivate +G_TYPE_ACTION_GROUP +G_IS_ACTION_GROUP +G_ACTION_GROUP_GET_IFACE +G_ACTION_GROUP +
+ +
+gaction +GAction +GAction + + + +g_action_get_name +g_action_get_parameter_type +g_action_get_state_type +g_action_get_state_hint + + +g_action_get_enabled +g_action_get_state +g_action_set_state + + +g_action_activate + + +g_action_get_type +G_TYPE_ACTION +G_IS_ACTION +G_ACTION_GET_IFACE +G_ACTION +
+ +
+gsimpleaction +GSimpleAction +GSimpleAction +GSimpleActionClass + + +g_simple_action_new +g_simple_action_new_stateful + + +g_simple_action_set_enabled + + +GSimpleActionPrivate +g_simple_action_get_type +G_TYPE_SIMPLE_ACTION +G_IS_SIMPLE_ACTION +G_SIMPLE_ACTION_CLASS +G_SIMPLE_ACTION_GET_CLASS +G_IS_SIMPLE_ACTION_CLASS +G_SIMPLE_ACTION +
+ +
+gsimpleactiongroup +GSimpleActionGroup +GSimpleActionGroup + + +g_simple_action_group_new + + +g_simple_action_group_lookup +g_simple_action_group_insert +g_simple_action_group_remove + + +GSimpleActionGroupClass +GSimpleActionGroupPrivate +g_simple_action_group_get_type +G_TYPE_SIMPLE_ACTION_GROUP +G_IS_SIMPLE_ACTION_GROUP +G_SIMPLE_ACTION_GROUP_CLASS +G_SIMPLE_ACTION_GROUP_GET_CLASS +G_IS_SIMPLE_ACTION_GROUP_CLASS +G_SIMPLE_ACTION_GROUP +
+ +
+gproxyresolver +GProxyResolver +GProxyResolver +GProxyResolverInterface +G_PROXY_RESOLVER_EXTENSION_POINT_NAME +g_proxy_resolver_get_default +g_proxy_resolver_is_supported +g_proxy_resolver_lookup +g_proxy_resolver_lookup_async +g_proxy_resolver_lookup_finish + +G_PROXY_RESOLVER +G_IS_PROXY_RESOLVER +G_TYPE_PROXY_RESOLVER +G_PROXY_RESOLVER_GET_IFACE + +g_proxy_resolver_get_type +
+ +
+gproxyaddress +GProxyAddress +GProxyAddress +GProxyAddressClass +g_proxy_address_get_destination_hostname +g_proxy_address_get_destination_port +g_proxy_address_get_password +g_proxy_address_get_protocol +g_proxy_address_get_username +g_proxy_address_new + +G_PROXY_ADDRESS +G_PROXY_ADDRESS_CLASS +G_PROXY_ADDRESS_GET_CLASS +G_IS_PROXY_ADDRESS +G_IS_PROXY_ADDRESS_CLASS +G_TYPE_PROXY_ADDRESS + +GProxyAddressPrivate +g_proxy_address_get_type +
+ +
+gproxy +GProxy +GProxy +GProxyInterface +G_PROXY_EXTENSION_POINT_NAME +g_proxy_connect +g_proxy_connect_async +g_proxy_connect_finish +g_proxy_get_default_for_protocol +g_proxy_supports_hostname + +G_PROXY +G_PROXY_GET_IFACE +G_IS_PROXY +G_TYPE_PROXY + +g_proxy_get_type +
+ +
+gpollableinputstream +GPollableInputStream +GPollableInputStream +GPollableInputStreamInterface + +g_pollable_input_stream_can_poll +g_pollable_input_stream_is_readable +g_pollable_input_stream_create_source +g_pollable_input_stream_read_nonblocking + +GPollableSourceFunc +g_pollable_source_new + +G_POLLABLE_INPUT_STREAM +G_POLLABLE_INPUT_STREAM_GET_INTERFACE +G_IS_POLLABLE_INPUT_STREAM +G_TYPE_POLLABLE_INPUT_STREAM + +g_pollable_input_stream_get_type +
+ +
+gpollableoutputstream +GPollableOutputStream +GPollableOutputStream +GPollableOutputStreamInterface + +g_pollable_output_stream_can_poll +g_pollable_output_stream_is_writable +g_pollable_output_stream_create_source +g_pollable_output_stream_write_nonblocking + +G_POLLABLE_OUTPUT_STREAM +G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE +G_IS_POLLABLE_OUTPUT_STREAM +G_TYPE_POLLABLE_OUTPUT_STREAM + +g_pollable_output_stream_get_type +
+ +
+gtls +G_TLS_ERROR +GTlsError + +GTlsAuthenticationMode +GTlsCertificateFlags +
+ +
+gtlsbackend +GTlsBackend +G_TLS_BACKEND_EXTENSION_POINT_NAME +GTlsBackend +GTlsBackendInterface +g_tls_backend_get_default +g_tls_backend_supports_tls +g_tls_backend_get_certificate_type +g_tls_backend_get_client_connection_type +g_tls_backend_get_server_connection_type + +G_IS_TLS_BACKEND +G_TLS_BACKEND +G_TLS_BACKEND_GET_INTERFACE +G_TYPE_TLS_BACKEND +g_tls_error_quark + +g_tls_backend_get_type +
+ +
+gtlscertificate +GTlsCertificate +GTlsCertificate +g_tls_certificate_new_from_pem +g_tls_certificate_new_from_file +g_tls_certificate_new_from_files +g_tls_certificate_list_new_from_file +g_tls_certificate_get_issuer +g_tls_certificate_verify + +GTlsCertificateClass +GTlsCertificatePrivate +G_IS_TLS_CERTIFICATE +G_IS_TLS_CERTIFICATE_CLASS +G_TLS_CERTIFICATE +G_TLS_CERTIFICATE_CLASS +G_TLS_CERTIFICATE_GET_CLASS +G_TYPE_TLS_CERTIFICATE + +g_tls_certificate_get_type +
+ +
+gtlsconnection +GTlsConnection +GTlsConnection +g_tls_connection_set_certificate +g_tls_connection_get_certificate +g_tls_connection_get_peer_certificate +g_tls_connection_get_peer_certificate_errors +g_tls_connection_set_require_close_notify +g_tls_connection_get_require_close_notify +GTlsRehandshakeMode +g_tls_connection_set_rehandshake_mode +g_tls_connection_get_rehandshake_mode +g_tls_connection_set_use_system_certdb +g_tls_connection_get_use_system_certdb + +g_tls_connection_handshake +g_tls_connection_handshake_async +g_tls_connection_handshake_finish + +g_tls_connection_emit_accept_certificate + +GTlsConnectionClass +GTlsConnectionPrivate +G_IS_TLS_CONNECTION +G_IS_TLS_CONNECTION_CLASS +G_TLS_CONNECTION +G_TLS_CONNECTION_CLASS +G_TLS_CONNECTION_GET_CLASS +G_TYPE_TLS_CONNECTION + +g_tls_connection_get_type +
+ +
+gtlsclientconnection +GTlsClientConnection +GTlsClientConnection +GTlsClientConnectionInterface +g_tls_client_connection_new +g_tls_client_connection_set_server_identity +g_tls_client_connection_get_server_identity +g_tls_client_connection_set_validation_flags +g_tls_client_connection_get_validation_flags +g_tls_client_connection_set_use_ssl3 +g_tls_client_connection_get_use_ssl3 +g_tls_client_connection_get_accepted_cas + +G_IS_TLS_CLIENT_CONNECTION +G_TLS_CLIENT_CONNECTION +G_TLS_CLIENT_CONNECTION_GET_INTERFACE +G_TYPE_TLS_CLIENT_CONNECTION + +g_tls_client_connection_get_type +
+ +
+gtlsserverconnection +GTlsServerConnection +GTlsServerConnection +GTlsServerConnectionInterface +g_tls_server_connection_new + +G_IS_TLS_SERVER_CONNECTION +G_TLS_SERVER_CONNECTION +G_TLS_SERVER_CONNECTION_GET_INTERFACE +G_TYPE_TLS_SERVER_CONNECTION + +g_tls_server_connection_get_type +
diff --git a/docs/reference/gio/gio.types b/docs/reference/gio/gio.types index bb59b84..d631517 100644 --- a/docs/reference/gio/gio.types +++ b/docs/reference/gio/gio.types @@ -1,6 +1,11 @@ +g_action_get_type +g_simple_action_get_type +g_action_group_get_type +g_simple_action_group_get_type g_app_info_create_flags_get_type g_app_info_get_type g_app_launch_context_get_type +g_application_get_type g_ask_password_flags_get_type g_async_initable_get_type g_async_result_get_type @@ -18,12 +23,12 @@ g_data_output_stream_get_type g_data_stream_byte_order_get_type g_data_stream_newline_type_get_type g_desktop_app_info_get_type -g_desktop_app_info_lookup_get_type g_drive_get_type g_emblem_get_type g_emblem_origin_get_type g_emblemed_icon_get_type g_file_attribute_info_flags_get_type +g_file_attribute_matcher_get_type g_file_attribute_status_get_type g_file_attribute_type_get_type g_file_copy_flags_get_type @@ -69,10 +74,20 @@ g_network_service_get_type g_output_stream_get_type g_output_stream_splice_flags_get_type g_password_save_get_type +g_permission_get_type +g_pollable_input_stream_get_type +g_pollable_output_stream_get_type +g_proxy_address_enumerator_get_type +g_proxy_address_get_type +g_proxy_get_type +g_proxy_resolver_get_type g_resolver_error_get_type g_resolver_get_type g_seekable_get_type +g_settings_get_type +g_settings_backend_get_type g_simple_async_result_get_type +g_simple_permission_get_type g_socket_address_enumerator_get_type g_socket_address_get_type g_socket_client_get_type @@ -88,8 +103,14 @@ g_socket_service_get_type g_socket_type_get_type g_srv_target_get_type g_tcp_connection_get_type +g_tcp_wrapper_connection_get_type g_themed_icon_get_type g_threaded_socket_service_get_type +g_tls_backend_get_type +g_tls_certificate_get_type +g_tls_client_connection_get_type +g_tls_connection_get_type +g_tls_server_connection_get_type g_unix_connection_get_type g_unix_fd_list_get_type g_unix_fd_message_get_type @@ -97,9 +118,21 @@ g_unix_input_stream_get_type g_unix_mount_monitor_get_type g_unix_output_stream_get_type g_unix_socket_address_get_type +g_unix_socket_address_type_get_type g_vfs_get_type g_volume_get_type g_volume_monitor_get_type g_zlib_compressor_get_type g_zlib_compressor_format_get_type g_zlib_decompressor_get_type +g_dbus_message_get_type +g_dbus_connection_get_type +g_bus_type_get_type +g_bus_name_owner_flags_get_type +g_dbus_error_get_type +g_dbus_proxy_get_type +g_dbus_method_invocation_get_type +g_dbus_server_get_type +g_dbus_auth_observer_get_type +g_credentials_get_type +g_unix_credentials_message_get_type diff --git a/docs/reference/gio/glib-compile-schemas.1 b/docs/reference/gio/glib-compile-schemas.1 new file mode 100644 index 0000000..950c59c --- /dev/null +++ b/docs/reference/gio/glib-compile-schemas.1 @@ -0,0 +1,85 @@ +'\" t +.\" Title: glib-compile-schemas +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands +.\" Language: English +.\" +.TH "GLIB\-COMPILE\-SCHEM" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +glib-compile-schemas \- GSettings schema compiler +.SH "SYNOPSIS" +.HP \w'\fBglib\-compile\-schemas\fR\ 'u +\fBglib\-compile\-schemas\fR [option...] {directory} +.SH "DESCRIPTION" +.PP +\fBglib\-compile\-schemas\fR +compiles all the GSettings XML schema files in +\fIdirectory\fR +into a binary file with the name +gschemas\&.compiled +that can be used by +\fBGSettings\fR\&. The XML schema files must have the filename extension +\&.gschema\&.xml\&. For a detailed description of the XML file format, see the +\fBGSettings\fR +documentation\&. +.PP +At runtime, GSettings looks for schemas in the +glib\-2\&.0/schemas +subdirectories of all directories specified in the +\fBXDG_DATA_DIRS\fR +environment variable\&. The usual location to install schema files is +/usr/share/glib\-2\&.0/schemas\&. +.PP +In addition to schema files, glib\-compile\-schemas reads \*(Aqvendor override\*(Aq files, which are key files that can override default values for keys in the schemas\&. The group names in the key files are the schema id, and the values are written in serialized GVariant form\&. +.SS "Options" +.PP +\fB\-h\fR, \fB\-\-help\fR +.RS 4 +Print help and exit +.RE +.PP +\fB\-\-targetdir=\fR\fB\fITARGETDIR\fR\fR +.RS 4 +Store +gschemas\&.compiled +in +\fITARGETDIR\fR +instead of +\fIdirectory\fR\&. +.RE +.PP +\fB\-\-dry\-run\fR +.RS 4 +Don\*(Aqt write +gschemas\&.compiled\&. This option can be used to check +\&.gschema\&.xml +sources for errors\&. +.RE +.PP +\fB\-\-allow\-any\-name\fR +.RS 4 +Do not enforce restrictions on key names\&. Note that this option is purely to facility the transition from GConf, and will be removed at some time in the future\&. +.RE +.SH "SEE ALSO" diff --git a/docs/reference/gio/glib-compile-schemas.xml b/docs/reference/gio/glib-compile-schemas.xml new file mode 100644 index 0000000..9ac5c3e --- /dev/null +++ b/docs/reference/gio/glib-compile-schemas.xml @@ -0,0 +1,85 @@ + + + + glib-compile-schemas + 1 + User Commands + + + + glib-compile-schemas + GSettings schema compiler + + + + + glib-compile-schemas + option + directory + + + +Description +glib-compile-schemas compiles all the GSettings XML +schema files in directory into a binary file +with the name gschemas.compiled that can be used +by GSettings. The XML schema +files must have the filename extension .gschema.xml. +For a detailed description of the XML file format, see the +GSettings documentation. + + +At runtime, GSettings looks for schemas in the +glib-2.0/schemas subdirectories of all directories +specified in the XDG_DATA_DIRS environment variable. The +usual location to install schema files is +/usr/share/glib-2.0/schemas. + + +In addition to schema files, glib-compile-schemas reads 'vendor override' +files, which are key files that can override default values for keys in +the schemas. The group names in the key files are the schema id, and the +values are written in serialized GVariant form. + + +Options + + + +, + +Print help and exit + + + + + + +Store gschemas.compiled in TARGETDIR instead of directory. + + + + + + +Don't write gschemas.compiled. This option can be used +to check .gschema.xml sources for errors. + + + + + + +Do not enforce restrictions on key names. Note that this option is purely +to facility the transition from GConf, and will be removed at some time +in the future. + + + + + + +See also + + + diff --git a/docs/reference/gio/gsettings.1 b/docs/reference/gio/gsettings.1 new file mode 100644 index 0000000..e52973f --- /dev/null +++ b/docs/reference/gio/gsettings.1 @@ -0,0 +1,105 @@ +'\" t +.\" Title: gsettings +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands +.\" Language: English +.\" +.TH "GSETTINGS" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gsettings \- GSettings configuration tool +.SH "SYNOPSIS" +.HP \w'\fBgsettings\fR\ 'u +\fBgsettings\fR get [option...] {\fIschema\fR} {\fIkey\fR} +.HP \w'\fBgsettings\fR\ 'u +\fBgsettings\fR monitor [option...] {\fIschema\fR} {\fIkey\fR} +.HP \w'\fBgsettings\fR\ 'u +\fBgsettings\fR writable [option...] {\fIschema\fR} {\fIkey\fR} +.HP \w'\fBgsettings\fR\ 'u +\fBgsettings\fR set [option...] {\fIschema\fR} {\fIkey\fR} {\fIvalue\fR} +.HP \w'\fBgsettings\fR\ 'u +\fBgsettings\fR help +.SH "DESCRIPTION" +.PP +\fBgsettings\fR +offers a simple commandline interface to +\fBGSettings\fR\&. It lets you get, set or monitor an individual key for changes\&. +.PP +The +\fIschema\fR +and +\fIkey\fR +arguments are required to specify the schema id and the name of the key to operate on\&. +.PP +When setting a key, you also need specify a +\fIvalue\fR +The format for the value is that of a serialized +\fBGVariant\fR, so e\&.g\&. a string must include explicit quotes: "\*(Aqfoo\*(Aq"\&. This format is also used when printing out values\&. +.SS "Commands" +.PP +\fBget\fR +.RS 4 +Get the value of +\fIkey\fR\&. The value is printed out as a serialised +\fBGVariant\fR\&. +.RE +.PP +\fBmonitor\fR +.RS 4 +Monitor +\fIkey\fR +for changes and print the changed values\&. Monitoring will continue until the process is terminated\&. +.RE +.PP +\fBwritable\fR +.RS 4 +Find out whether +\fIkey\fR +is writable\&. +.RE +.PP +\fBset\fR +.RS 4 +Set the value of +\fIkey\fR +to +\fIvalue\fR\&. The value is specified as a serialised +\fBGVariant\fR\&. +.RE +.PP +\fBhelp\fR +.RS 4 +Print help and exit +.RE +.SS "Options" +.PP +\fB\-h\fR, \fB\-\-help\fR +.RS 4 +Print help for the command and exit +.RE +.PP +\fB\-p \fR\fB\fIpath\fR\fR, \fB\-\-path=\fR\fB\fIpath\fR\fR +.RS 4 +The path for the schema\&. This option is only needed if the schema does not have a fixed path\&. +.RE diff --git a/docs/reference/gio/gsettings.xml b/docs/reference/gio/gsettings.xml new file mode 100644 index 0000000..c021b70 --- /dev/null +++ b/docs/reference/gio/gsettings.xml @@ -0,0 +1,137 @@ + + + + gsettings + 1 + User Commands + + + + gsettings + GSettings configuration tool + + + + + gsettings + get + option + schema + key + + + gsettings + monitor + option + schema + key + + + gsettings + writable + option + schema + key + + + gsettings + set + option + schema + key + value + + + gsettings + help + + + +Description +gsettings offers a simple commandline +interface to GSettings. +It lets you get, set or monitor an individual key for changes. + + +The schema and key +arguments are required to specify the schema id and the name of the key +to operate on. + + +When setting a key, you also need specify a value +The format for the value is that of a serialized +GVariant, +so e.g. a string +must include explicit quotes: "'foo'". This format is also used when printing +out values. + + +Commands + + + + + +Get the value of key. The value is printed out +as a serialised +GVariant. + + + + + + +Monitor key for changes and print the changed +values. Monitoring will continue until the process is terminated. + + + + + + +Find out whether key is writable. + + + + + + +Set the value of key to value. +The value is specified as a serialised +GVariant. + + + + + + +Print help and exit + + + + + + + +Options + + +, + +Print help for the command and exit + + + + +, + +The path for the schema. This option is only needed if the schema +does not have a fixed path. + + + + + + + + diff --git a/docs/reference/gio/html/GAction.html b/docs/reference/gio/html/GAction.html new file mode 100644 index 0000000..498748f --- /dev/null +++ b/docs/reference/gio/html/GAction.html @@ -0,0 +1,472 @@ + + + + +GAction + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GAction

+

GAction — An action

+
+
+

Synopsis

+
                    GAction;
+
+const gchar *       g_action_get_name                   (GAction *action);
+const GVariantType * g_action_get_parameter_type        (GAction *action);
+const GVariantType * g_action_get_state_type            (GAction *action);
+GVariant *          g_action_get_state_hint             (GAction *action);
+
+gboolean            g_action_get_enabled                (GAction *action);
+GVariant *          g_action_get_state                  (GAction *action);
+void                g_action_set_state                  (GAction *action,
+                                                         GVariant *value);
+
+void                g_action_activate                   (GAction *action,
+                                                         GVariant *parameter);
+
+
+
+

Object Hierarchy

+
+  GInterface
+   +----GAction
+
+
+
+

Prerequisites

+

+GAction requires + GObject.

+
+
+

Known Implementations

+

+GAction is implemented by + GSimpleAction.

+
+
+

Properties

+
+  "enabled"                  gboolean              : Read
+  "name"                     gchar*                : Read
+  "parameter-type"           GVariantType*         : Read
+  "state"                    GVariant              : Read / Write / Construct
+  "state-type"               GVariantType*         : Read
+
+
+
+

Description

+

+GAction represents a single named action. +

+

+The main interface to an action is that it can be activated with +g_action_activate(). This results in the 'activate' signal being +emitted. An activation has a GVariant parameter (which may be +NULL). The correct type for the parameter is determined by a static +parameter type (which is given at construction time). +

+

+An action may optionally have a state, in which case the state may be +set with g_action_set_state(). This call takes a GVariant. The +correct type for the state is determined by a static state type +(which is given at construction time). +

+

+The state may have a hint associated with it, specifying its valid +range. +

+

+GAction is merely the interface to the concept of an action, as +described above. Various implementations of actions exist, including +GSimpleAction and GtkAction. +

+

+In all cases, the implementing class is responsible for storing the +name of the action, the parameter type, the enabled state, the +optional state type and the state and emitting the appropriate +signals when these change. The implementor responsible for filtering +calls to g_action_activate() and g_action_set_state() for type safety +and for the state being enabled. +

+

+Probably the only useful thing to do with a GAction is to put it +inside of a GSimpleActionGroup. +

+
+
+

Details

+
+

GAction

+
typedef struct _GAction GAction;
+

+

+
+
+
+

g_action_get_name ()

+
const gchar *       g_action_get_name                   (GAction *action);
+

+Queries the name of action. +

+
++ + + + + + + + + + +

action :

a GAction +

Returns :

the name of the action + +
+

Since 2.28

+
+
+
+

g_action_get_parameter_type ()

+
const GVariantType * g_action_get_parameter_type        (GAction *action);
+

+Queries the type of the parameter that must be given when activating +action. +

+

+When activating the action using g_action_activate(), the GVariant +given to that function must be of the type returned by this function. +

+

+In the case that this function returns NULL, you must not give any +GVariant, but NULL instead. +

+
++ + + + + + + + + + +

action :

a GAction +

Returns :

the parameter type. [allow-none] +
+

Since 2.28

+
+
+
+

g_action_get_state_type ()

+
const GVariantType * g_action_get_state_type            (GAction *action);
+

+Queries the type of the state of action. +

+

+If the action is stateful (ie: was created with +g_action_new_stateful()) then this function returns the GVariantType +of the state. This is the type of the initial value given as the +state. All calls to g_action_set_state() must give a GVariant of +this type and g_action_get_state() will return a GVariant of the +same type. +

+

+If the action is not stateful (ie: created with g_action_new()) then +this function will return NULL. In that case, g_action_get_state() +will return NULL and you must not call g_action_set_state(). +

+
++ + + + + + + + + + +

action :

a GAction +

Returns :

the state type, if the action is stateful. [allow-none] +
+

Since 2.28

+
+
+
+

g_action_get_state_hint ()

+
GVariant *          g_action_get_state_hint             (GAction *action);
+

+Requests a hint about the valid range of values for the state of +action. +

+

+If NULL is returned it either means that the action is not stateful +or that there is no hint about the valid range of values for the +state of the action. +

+

+If a GVariant array is returned then each item in the array is a +possible value for the state. If a GVariant pair (ie: two-tuple) is +returned then the tuple specifies the inclusive lower and upper bound +of valid values for the state. +

+

+In any case, the information is merely a hint. It may be possible to +have a state value outside of the hinted range and setting a value +within the range may fail. +

+

+The return value (if non-NULL) should be freed with +g_variant_unref() when it is no longer required. +

+
++ + + + + + + + + + +

action :

a GAction +

Returns :

the state range hint. [transfer full] +
+

Since 2.28

+
+
+
+

g_action_get_enabled ()

+
gboolean            g_action_get_enabled                (GAction *action);
+

+Checks if action is currently enabled. +

+

+An action must be enabled in order to be activated or in order to +have its state changed from outside callers. +

+
++ + + + + + + + + + +

action :

a GAction +

Returns :

whether the action is enabled + +
+

Since 2.28

+
+
+
+

g_action_get_state ()

+
GVariant *          g_action_get_state                  (GAction *action);
+

+Queries the current state of action. +

+

+If the action is not stateful then NULL will be returned. If the +action is stateful then the type of the return value is the type +given by g_action_get_state_type(). +

+

+The return value (if non-NULL) should be freed with +g_variant_unref() when it is no longer required. +

+
++ + + + + + + + + + +

action :

a GAction +

Returns :

the current state of the action. [transfer full] +
+

Since 2.28

+
+
+
+

g_action_set_state ()

+
void                g_action_set_state                  (GAction *action,
+                                                         GVariant *value);
+

+Request for the state of action to be changed to value. +

+

+The action must be stateful and value must be of the correct type. +See g_action_get_state_type(). +

+

+This call merely requests a change. The action may refuse to change +its state or may change its state to something other than value. +See g_action_get_state_hint(). +

+

+If the value GVariant is floating, it is consumed. +

+
++ + + + + + + + + + +

action :

a GAction +

value :

the new state +
+

Since 2.28

+
+
+
+

g_action_activate ()

+
void                g_action_activate                   (GAction *action,
+                                                         GVariant *parameter);
+

+Activates the action. +

+

+parameter must be the correct type of parameter for the action (ie: +the parameter type given at construction time). If the parameter +type was NULL then parameter must also be NULL. +

+
++ + + + + + + + + + +

action :

a GAction +

parameter :

the parameter to the activation. [allow-none] +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "enabled" property

+
  "enabled"                  gboolean              : Read
+

+If action is currently enabled. +

+

+If the action is disabled then calls to g_action_activate() and +g_action_set_state() have no effect. +

+

Default value: TRUE

+

Since 2.28

+
+
+
+

The "name" property

+
  "name"                     gchar*                : Read
+

+The name of the action. This is mostly meaningful for identifying +the action once it has been added to a GActionGroup. +

+

Default value: NULL

+

Since 2.28

+
+
+
+

The "parameter-type" property

+
  "parameter-type"           GVariantType*         : Read
+

+The type of the parameter that must be given when activating the +action. +

+

Since 2.28

+
+
+
+

The "state" property

+
  "state"                    GVariant              : Read / Write / Construct
+

+The state of the action, or NULL if the action is stateless. +

+

Since 2.28

+
+
+
+

The "state-type" property

+
  "state-type"               GVariantType*         : Read
+

+The GVariantType of the state that the action has, or NULL if the +action is stateless. +

+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GActionGroup.html b/docs/reference/gio/html/GActionGroup.html new file mode 100644 index 0000000..5e9b148 --- /dev/null +++ b/docs/reference/gio/html/GActionGroup.html @@ -0,0 +1,779 @@ + + + + +GActionGroup + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GActionGroup

+

GActionGroup — A group of actions

+
+
+

Synopsis

+
                    GActionGroup;
+
+gboolean            g_action_group_has_action           (GActionGroup *action_group,
+                                                         const gchar *action_name);
+gchar **            g_action_group_list_actions         (GActionGroup *action_group);
+
+gboolean            g_action_group_get_action_enabled   (GActionGroup *action_group,
+                                                         const gchar *action_name);
+const GVariantType * g_action_group_get_action_parameter_type
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name);
+const GVariantType * g_action_group_get_action_state_type
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name);
+GVariant *          g_action_group_get_action_state_hint
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name);
+
+GVariant *          g_action_group_get_action_state     (GActionGroup *action_group,
+                                                         const gchar *action_name);
+void                g_action_group_change_action_state  (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         GVariant *value);
+
+void                g_action_group_activate_action      (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         GVariant *parameter);
+
+void                g_action_group_action_added         (GActionGroup *action_group,
+                                                         const gchar *action_name);
+void                g_action_group_action_removed       (GActionGroup *action_group,
+                                                         const gchar *action_name);
+void                g_action_group_action_enabled_changed
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         gboolean enabled);
+void                g_action_group_action_state_changed (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         GVariant *state);
+
+
+
+

Object Hierarchy

+
+  GInterface
+   +----GActionGroup
+
+
+
+

Prerequisites

+

+GActionGroup requires + GObject.

+
+
+

Known Implementations

+

+GActionGroup is implemented by + GApplication and GSimpleActionGroup.

+
+
+

Signals

+
+  "action-added"                                   : Run Last / Has Details
+  "action-enabled-changed"                         : Run Last / Has Details
+  "action-removed"                                 : Run Last / Has Details
+  "action-state-changed"                           : Run Last / Has Details
+
+
+
+

Description

+

+GActionGroup represents a group of actions. +

+

+Each action in the group has a unique name (which is a string). All +method calls, except g_action_group_list_actions() take the name of +an action as an argument. +

+

+The GActionGroup API is meant to be the 'public' API to the action +group. The calls here are exactly the interaction that 'external +forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have +with actions. 'Internal' APIs (ie: ones meant only to be accessed by +the action group implementation) are found on subclasses. This is +why you will find -- for example -- g_action_group_get_enabled() but +not an equivalent set() call. +

+

+Signals are emitted on the action group in response to state changes +on individual actions. +

+
+
+

Details

+
+

GActionGroup

+
typedef struct _GActionGroup GActionGroup;
+

+

+
+
+
+

g_action_group_has_action ()

+
gboolean            g_action_group_has_action           (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Checks if the named action exists within action_group. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to check for +

Returns :

whether the named action exists + +
+

Since 2.28

+
+
+
+

g_action_group_list_actions ()

+
gchar **            g_action_group_list_actions         (GActionGroup *action_group);
+

+Lists the actions contained within action_group. +

+

+The caller is responsible for freeing the list with g_strfreev() when +it is no longer required. +

+
++ + + + + + + + + + +

action_group :

a GActionGroup +

Returns :

a NULL-terminated array of the names of the +actions in the groupb. [transfer full] +
+

Since 2.28

+
+
+
+

g_action_group_get_action_enabled ()

+
gboolean            g_action_group_get_action_enabled   (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Checks if the named action within action_group is currently enabled. +

+

+An action must be enabled in order to be activated or in order to +have its state changed from outside callers. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to query +

Returns :

whether or not the action is currently enabled + +
+

Since 2.28

+
+
+
+

g_action_group_get_action_parameter_type ()

+
const GVariantType * g_action_group_get_action_parameter_type
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Queries the type of the parameter that must be given when activating +the named action within action_group. +

+

+When activating the action using g_action_group_activate(), the +GVariant given to that function must be of the type returned by this +function. +

+

+In the case that this function returns NULL, you must not give any +GVariant, but NULL instead. +

+

+The parameter type of a particular action will never change but it is +possible for an action to be removed and for a new action to be added +with the same name but a different parameter type. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to query +

Returns :

the parameter type + +
+

Since 2.28

+
+
+
+

g_action_group_get_action_state_type ()

+
const GVariantType * g_action_group_get_action_state_type
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Queries the type of the state of the named action within +action_group. +

+

+If the action is stateful then this function returns the +GVariantType of the state. All calls to g_action_group_set_state() +must give a GVariant of this type and g_action_group_get_state() +will return a GVariant of the same type. +

+

+If the action is not stateful then this function will return NULL. +In that case, g_action_group_get_state() will return NULL and you +must not call g_action_group_set_state(). +

+

+The state type of a particular action will never change but it is +possible for an action to be removed and for a new action to be added +with the same name but a different state type. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to query +

Returns :

the state type, if the action is stateful. [transfer full] +
+

Since 2.28

+
+
+
+

g_action_group_get_action_state_hint ()

+
GVariant *          g_action_group_get_action_state_hint
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Requests a hint about the valid range of values for the state of the +named action within action_group. +

+

+If NULL is returned it either means that the action is not stateful +or that there is no hint about the valid range of values for the +state of the action. +

+

+If a GVariant array is returned then each item in the array is a +possible value for the state. If a GVariant pair (ie: two-tuple) is +returned then the tuple specifies the inclusive lower and upper bound +of valid values for the state. +

+

+In any case, the information is merely a hint. It may be possible to +have a state value outside of the hinted range and setting a value +within the range may fail. +

+

+The return value (if non-NULL) should be freed with +g_variant_unref() when it is no longer required. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to query +

Returns :

the state range hint. [transfer full] +
+

Since 2.28

+
+
+
+

g_action_group_get_action_state ()

+
GVariant *          g_action_group_get_action_state     (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Queries the current state of the named action within action_group. +

+

+If the action is not stateful then NULL will be returned. If the +action is stateful then the type of the return value is the type +given by g_action_group_get_state_type(). +

+

+The return value (if non-NULL) should be freed with +g_variant_unref() when it is no longer required. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to query +

Returns :

the current state of the action. [allow-none] +
+

Since 2.28

+
+
+
+

g_action_group_change_action_state ()

+
void                g_action_group_change_action_state  (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         GVariant *value);
+

+Request for the state of the named action within action_group to be +changed to value. +

+

+The action must be stateful and value must be of the correct type. +See g_action_group_get_state_type(). +

+

+This call merely requests a change. The action may refuse to change +its state or may change its state to something other than value. +See g_action_group_get_state_hint(). +

+

+If the value GVariant is floating, it is consumed. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to request the change on +

value :

the new state +
+

Since 2.28

+
+
+
+

g_action_group_activate_action ()

+
void                g_action_group_activate_action      (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         GVariant *parameter);
+

+Activate the named action within action_group. +

+

+If the action is expecting a parameter, then the correct type of +parameter must be given as parameter. If the action is expecting no +parameters then parameter must be NULL. See +g_action_group_get_parameter_type(). +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of the action to activate +

parameter :

parameters to the activation. [allow-none] +
+

Since 2.28

+
+
+
+

g_action_group_action_added ()

+
void                g_action_group_action_added         (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Emits the "action-added" signal on action_group. +

+

+This function should only be called by GActionGroup implementations. +

+
++ + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of an action in the group +
+

Since 2.28

+
+
+
+

g_action_group_action_removed ()

+
void                g_action_group_action_removed       (GActionGroup *action_group,
+                                                         const gchar *action_name);
+

+Emits the "action-removed" signal on action_group. +

+

+This function should only be called by GActionGroup implementations. +

+
++ + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of an action in the group +
+

Since 2.28

+
+
+
+

g_action_group_action_enabled_changed ()

+
void                g_action_group_action_enabled_changed
+                                                        (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         gboolean enabled);
+

+Emits the "action-enabled-changed" signal on action_group. +

+

+This function should only be called by GActionGroup implementations. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of an action in the group +

enabled :

whether or not the action is now enabled +
+

Since 2.28

+
+
+
+

g_action_group_action_state_changed ()

+
void                g_action_group_action_state_changed (GActionGroup *action_group,
+                                                         const gchar *action_name,
+                                                         GVariant *state);
+

+Emits the "action-state-changed" signal on action_group. +

+

+This function should only be called by GActionGroup implementations. +

+
++ + + + + + + + + + + + + + +

action_group :

a GActionGroup +

action_name :

the name of an action in the group +

state :

the new state of the named action +
+

Since 2.28

+
+
+
+

Signal Details

+
+

The "action-added" signal

+
void                user_function                      (GActionGroup *action_group,
+                                                        gchar        *action_name,
+                                                        gpointer      user_data)         : Run Last / Has Details
+

+Signals that a new action was just added to the group. This signal +is emitted after the action has been added and is now visible. +

+
++ + + + + + + + + + + + + + +

action_group :

the GActionGroup that changed +

action_name :

the name of the action in action_group +

user_data :

user data set when the signal handler was connected.
+

Since 2.28

+
+
+
+

The "action-enabled-changed" signal

+
void                user_function                      (GActionGroup *action_group,
+                                                        gchar        *action_name,
+                                                        gboolean      enabled,
+                                                        gpointer      user_data)         : Run Last / Has Details
+

+Signals that the enabled status of the named action has changed. +

+
++ + + + + + + + + + + + + + + + + + +

action_group :

the GActionGroup that changed +

action_name :

the name of the action in action_group +

enabled :

whether the action is enabled or not +

user_data :

user data set when the signal handler was connected.
+

Since 2.28

+
+
+
+

The "action-removed" signal

+
void                user_function                      (GActionGroup *action_group,
+                                                        gchar        *action_name,
+                                                        gpointer      user_data)         : Run Last / Has Details
+

+Signals that an action is just about to be removed from the group. +This signal is emitted before the action is removed, so the action +is still visible and can be queried from the signal handler. +

+
++ + + + + + + + + + + + + + +

action_group :

the GActionGroup that changed +

action_name :

the name of the action in action_group +

user_data :

user data set when the signal handler was connected.
+

Since 2.28

+
+
+
+

The "action-state-changed" signal

+
void                user_function                      (GActionGroup *action_group,
+                                                        gchar        *action_name,
+                                                        GVariant      value,
+                                                        gpointer      user_data)         : Run Last / Has Details
+

+Signals that the state of the named action has changed. +

+
++ + + + + + + + + + + + + + + + + + +

action_group :

the GActionGroup that changed +

action_name :

the name of the action in action_group +

value :

the new value of the state +

user_data :

user data set when the signal handler was connected.
+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GAppInfo.html b/docs/reference/gio/html/GAppInfo.html index 7e5c96c..11e6c84 100644 --- a/docs/reference/gio/html/GAppInfo.html +++ b/docs/reference/gio/html/GAppInfo.html @@ -3,12 +3,12 @@ GAppInfo - + - - + + @@ -53,9 +53,9 @@ enum GAppInfo * g_app_info_create_from_commandline (const char *commandline, const char *application_name, GAppInfoCreateFlags flags, - GError **error); + GError **error); GAppInfo * g_app_info_dup (GAppInfo *appinfo); -gboolean g_app_info_equal (GAppInfo *appinfo1, +gboolean g_app_info_equal (GAppInfo *appinfo1, GAppInfo *appinfo2); const char * g_app_info_get_id (GAppInfo *appinfo); const char * g_app_info_get_name (GAppInfo *appinfo); @@ -64,50 +64,56 @@ const char * char * g_app_info_get_executable (GAppInfo *appinfo); const char * g_app_info_get_commandline (GAppInfo *appinfo); GIcon * g_app_info_get_icon (GAppInfo *appinfo); -gboolean g_app_info_launch (GAppInfo *appinfo, - GList *files, +gboolean g_app_info_launch (GAppInfo *appinfo, + GList *files, GAppLaunchContext *launch_context, - GError **error); -gboolean g_app_info_supports_files (GAppInfo *appinfo); -gboolean g_app_info_supports_uris (GAppInfo *appinfo); -gboolean g_app_info_launch_uris (GAppInfo *appinfo, - GList *uris, + GError **error); +gboolean g_app_info_supports_files (GAppInfo *appinfo); +gboolean g_app_info_supports_uris (GAppInfo *appinfo); +gboolean g_app_info_launch_uris (GAppInfo *appinfo, + GList *uris, GAppLaunchContext *launch_context, - GError **error); -gboolean g_app_info_should_show (GAppInfo *appinfo); -gboolean g_app_info_can_delete (GAppInfo *appinfo); -gboolean g_app_info_delete (GAppInfo *appinfo); + GError **error); +gboolean g_app_info_should_show (GAppInfo *appinfo); +gboolean g_app_info_can_delete (GAppInfo *appinfo); +gboolean g_app_info_delete (GAppInfo *appinfo); void g_app_info_reset_type_associations (const char *content_type); -gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo, +gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo, const char *content_type, - GError **error); -gboolean g_app_info_set_as_default_for_extension + GError **error); +gboolean g_app_info_set_as_default_for_extension (GAppInfo *appinfo, const char *extension, - GError **error); -gboolean g_app_info_add_supports_type (GAppInfo *appinfo, + GError **error); +gboolean g_app_info_set_as_last_used_for_type + (GAppInfo *appinfo, + const char *content_type, + GError **error); +gboolean g_app_info_add_supports_type (GAppInfo *appinfo, const char *content_type, - GError **error); -gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo); -gboolean g_app_info_remove_supports_type (GAppInfo *appinfo, + GError **error); +gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo); +gboolean g_app_info_remove_supports_type (GAppInfo *appinfo, const char *content_type, - GError **error); -GList * g_app_info_get_all (void); -GList * g_app_info_get_all_for_type (const char *content_type); + GError **error); +GList * g_app_info_get_all (void); +GList * g_app_info_get_all_for_type (const char *content_type); GAppInfo * g_app_info_get_default_for_type (const char *content_type, - gboolean must_support_uris); + gboolean must_support_uris); GAppInfo * g_app_info_get_default_for_uri_scheme (const char *uri_scheme); -gboolean g_app_info_launch_default_for_uri (const char *uri, +GList * g_app_info_get_fallback_for_type (const gchar *content_type); +GList * g_app_info_get_recommended_for_type (const gchar *content_type); +gboolean g_app_info_launch_default_for_uri (const char *uri, GAppLaunchContext *launch_context, - GError **error); + GError **error); char * g_app_launch_context_get_display (GAppLaunchContext *context, GAppInfo *info, - GList *files); + GList *files); char * g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context, GAppInfo *info, - GList *files); + GList *files); void g_app_launch_context_launch_failed (GAppLaunchContext *context, const char *startup_notify_id); GAppLaunchContext * g_app_launch_context_new (void); @@ -120,7 +126,7 @@ const char * - GObject + GObject +----GAppLaunchContext @@ -128,7 +134,7 @@ const char *

Prerequisites

GAppInfo requires - GObject.

+ GObject.

Known Implementations

@@ -139,7 +145,7 @@ GAppInfo is implemented by

Description

-GAppInfo and GAppLaunchContext are used for describing and launching +GAppInfo and GAppLaunchContext are used for describing and launching applications installed on the system.

@@ -202,9 +208,10 @@ managers) may have different ideas of what a given URI means.

enum GAppInfoCreateFlags

typedef enum {
-  G_APP_INFO_CREATE_NONE           = 0,         /*< nick=none >*/
-  G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0),  /*< nick=needs-terminal >*/
-  G_APP_INFO_CREATE_SUPPORTS_URIS  = (1 << 1)   /*< nick=supports-uris >*/
+  G_APP_INFO_CREATE_NONE                           = 0,         /*< nick=none >*/
+  G_APP_INFO_CREATE_NEEDS_TERMINAL                 = (1 << 0),  /*< nick=needs-terminal >*/
+  G_APP_INFO_CREATE_SUPPORTS_URIS                  = (1 << 1),  /*< nick=supports-uris >*/
+  G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION  = (1 << 2)   /*< nick=supports-startup-notification >*/
 } GAppInfoCreateFlags;
 

@@ -228,6 +235,11 @@ Flags used when creating a Application supports URI arguments. + +

G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION

+Application supports startup notification. Since 2.26 + +
@@ -286,6 +298,9 @@ it (with file arguments). gboolean (* do_delete) (GAppInfo *appinfo); const char * (* get_commandline) (GAppInfo *appinfo); const char * (* get_display_name) (GAppInfo *appinfo); + gboolean (* set_as_last_used_for_type) (GAppInfo *appinfo, + const char *content_type, + GError **error); } GAppInfoIface;

@@ -295,7 +310,7 @@ Application Information interface, for operating system portability. -

GTypeInterface g_iface;

+

GTypeInterface g_iface;

The parent interface. @@ -406,6 +421,11 @@ Application Information interface, for operating system portability. Gets the display name for the GAppInfo. Since 2.24 + +

set_as_last_used_for_type ()

+ + +
@@ -418,10 +438,6 @@ Integrating the launch with the launching application. This is used to handle for instance startup notification and launching the new application on the same screen as the launching window.

-
-- -

@@ -429,7 +445,7 @@ on the same screen as the launching window.
GAppInfo *          g_app_info_create_from_commandline  (const char *commandline,
                                                          const char *application_name,
                                                          GAppInfoCreateFlags flags,
-                                                         GError **error);
+ GError **error);

Creates a new GAppInfo from the given information.

@@ -443,7 +459,7 @@ Creates a new

application_name :

-the application name, or
NULL to use commandline + the application name, or NULL to use commandline. [allow-none] @@ -453,12 +469,12 @@ Creates a new

error :

-a
GError location to store the error occuring, NULL to ignore. +a GError location to store the error occuring, NULL to ignore.

Returns :

- new GAppInfo for given command. + new GAppInfo for given command. [transfer full] @@ -481,7 +497,7 @@ Creates a duplicate of a <

Returns :

- a duplicate of appinfo. + a duplicate of appinfo. [transfer full] @@ -490,7 +506,7 @@ Creates a duplicate of a
<

g_app_info_equal ()

-
gboolean            g_app_info_equal                    (GAppInfo *appinfo1,
+
gboolean            g_app_info_equal                    (GAppInfo *appinfo1,
                                                          GAppInfo *appinfo2);

Checks if two GAppInfos are equal. @@ -500,7 +516,7 @@ Checks if two

appinfo1 :

-the first GAppInfo. +the first GAppInfo. @@ -510,7 +526,7 @@ Checks if two

Returns :

-
TRUE if appinfo1 is equal to appinfo2. FALSE otherwise. + TRUE if appinfo1 is equal to appinfo2. FALSE otherwise. @@ -527,7 +543,7 @@ platform dependent. For instance, on Unix this is the desktop file id from the xdg menu specification.

-Note that the returned ID may be NULL, depending on how +Note that the returned ID may be NULL, depending on how the appinfo has been constructed.

@@ -614,7 +630,7 @@ Gets a human-readable description of an installed application. @@ -663,7 +679,7 @@ started. @@ -688,7 +704,7 @@ Gets the icon for the application. - @@ -697,18 +713,18 @@ Gets the icon for the application.

g_app_info_launch ()

-
gboolean            g_app_info_launch                   (GAppInfo *appinfo,
-                                                         GList *files,
+
gboolean            g_app_info_launch                   (GAppInfo *appinfo,
+                                                         GList *files,
                                                          GAppLaunchContext *launch_context,
-                                                         GError **error);
+ GError **error);

-Launches the application. Passes files to the launched application +Launches the application. Passes files to the launched application as arguments, using the optional launch_context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly.

-To lauch the application without arguments pass a NULL files list. +To launch the application without arguments pass a NULL files list.

Note that even if the launch is successful the application launched @@ -721,6 +737,16 @@ unsupported uris with strange formats like mailto:), so if you have a textual uri you want to pass in as argument, consider using g_app_info_launch_uris() instead.

+

+On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE +environment variable with the path of the launched desktop file and +GIO_LAUNCHED_DESKTOP_FILE_PID to the process +id of the launched process. This can be used to ignore +GIO_LAUNCHED_DESKTOP_FILE, should it be inherited +by further processes. The DISPLAY and +DESKTOP_STARTUP_ID environment variables are also +set, based on information provided in launch_context. +

Returns :

a string containing a description of the -application appinfo, or NULL if none. +application appinfo, or NULL if none.

Returns :

a string containing the appinfo's commandline, - or NULL if this information is not available + or NULL if this information is not available

Returns :

the default GIcon for appinfo. + the default GIcon for appinfo. [transfer none]
@@ -731,22 +757,22 @@ a textual uri you want to pass in as argument, consider using - - - - @@ -755,7 +781,7 @@ a textual uri you want to pass in as argument, consider using

g_app_info_supports_files ()

-
gboolean            g_app_info_supports_files           (GAppInfo *appinfo);
+
gboolean            g_app_info_supports_files           (GAppInfo *appinfo);

Checks if the application accepts files as arguments.

@@ -769,7 +795,7 @@ Checks if the application accepts files as arguments.
- @@ -778,7 +804,7 @@ Checks if the application accepts files as arguments.

g_app_info_supports_uris ()

-
gboolean            g_app_info_supports_uris            (GAppInfo *appinfo);
+
gboolean            g_app_info_supports_uris            (GAppInfo *appinfo);

Checks if the application supports reading files and directories from URIs.

@@ -792,7 +818,7 @@ Checks if the application supports reading files and directories from URIs.
- @@ -801,18 +827,18 @@ Checks if the application supports reading files and directories from URIs.

g_app_info_launch_uris ()

-
gboolean            g_app_info_launch_uris              (GAppInfo *appinfo,
-                                                         GList *uris,
+
gboolean            g_app_info_launch_uris              (GAppInfo *appinfo,
+                                                         GList *uris,
                                                          GAppLaunchContext *launch_context,
-                                                         GError **error);
+ GError **error);

-Launches the application. Passes uris to the launched application +Launches the application. Passes uris to the launched application as arguments, using the optional launch_context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly.

-To lauch the application without arguments pass a NULL uris list. +To lauch the application without arguments pass a NULL uris list.

Note that even if the launch is successful the application launched @@ -829,22 +855,22 @@ no way to detect this.

- - - - @@ -853,7 +879,7 @@ no way to detect this.

g_app_info_should_show ()

-
gboolean            g_app_info_should_show              (GAppInfo *appinfo);
+
gboolean            g_app_info_should_show              (GAppInfo *appinfo);

Checks if the application info should be shown in menus that list available applications. @@ -868,7 +894,7 @@ list available applications.

- @@ -877,7 +903,7 @@ list available applications.

g_app_info_can_delete ()

-
gboolean            g_app_info_can_delete               (GAppInfo *appinfo);
+
gboolean            g_app_info_can_delete               (GAppInfo *appinfo);

Obtains the information whether the GAppInfo can be deleted. See g_app_info_delete(). @@ -892,7 +918,7 @@ See Returns :

-
@@ -903,7 +929,7 @@ See

g_app_info_delete ()

-
gboolean            g_app_info_delete                   (GAppInfo *appinfo);
+
gboolean            g_app_info_delete                   (GAppInfo *appinfo);

Tries to delete a GAppInfo.

@@ -912,6 +938,9 @@ On some platforms, there may be a difference between user-defined GAppInfos which can be deleted, and system-wide ones which cannot. See g_app_info_can_delete().

+

+Virtual: do_delete +

files :

a GList of GFile objects + a GList of GFile objects. [element-type GFile]

launch_context :

a GAppLaunchContext or NULL + a GAppLaunchContext or NULL. [allow-none]

error :

a GError +a GError

Returns :

TRUE on successful launch, FALSE otherwise. + TRUE on successful launch, FALSE otherwise.

Returns :

TRUE if the appinfo supports files. + TRUE if the appinfo supports files.

Returns :

TRUE if the appinfo supports URIs. + TRUE if the appinfo supports URIs.

uris :

a GList containing URIs to launch. + a GList containing URIs to launch. [element-type char*]

launch_context :

a GAppLaunchContext or NULL + a GAppLaunchContext or NULL. [allow-none]

error :

a GError +a GError

Returns :

TRUE on successful launch, FALSE otherwise. + TRUE on successful launch, FALSE otherwise.

Returns :

TRUE if the appinfo should be shown, FALSE otherwise. + TRUE if the appinfo should be shown, FALSE otherwise.
TRUE if appinfo can be deleted + TRUE if appinfo can be deleted
@@ -922,7 +951,7 @@ cannot. See Returns :

-
@@ -953,9 +982,9 @@ Removes all changes to the type associations done by

g_app_info_set_as_default_for_type ()

-
gboolean            g_app_info_set_as_default_for_type  (GAppInfo *appinfo,
+
gboolean            g_app_info_set_as_default_for_type  (GAppInfo *appinfo,
                                                          const char *content_type,
-                                                         GError **error);
+ GError **error);

Sets the application as the default handler for a given type.

@@ -974,12 +1003,12 @@ Sets the application as the default handler for a given type.
- - @@ -988,10 +1017,10 @@ Sets the application as the default handler for a given type.

g_app_info_set_as_default_for_extension ()

-
gboolean            g_app_info_set_as_default_for_extension
+
gboolean            g_app_info_set_as_default_for_extension
                                                         (GAppInfo *appinfo,
                                                          const char *extension,
-                                                         GError **error);
+ GError **error);

Sets the application as the default handler for the given file extension.

@@ -1010,12 +1039,51 @@ Sets the application as the default handler for the given file extension.
- + + + + + + +
TRUE if appinfo has been deleted + TRUE if appinfo has been deleted

error :

a GError. +a GError.

Returns :

TRUE on success, FALSE on error. + TRUE on success, FALSE on error.

error :

a GError. +a GError. +

Returns :

TRUE on success, FALSE on error. +
+
+
+
+

g_app_info_set_as_last_used_for_type ()

+
gboolean            g_app_info_set_as_last_used_for_type
+                                                        (GAppInfo *appinfo,
+                                                         const char *content_type,
+                                                         GError **error);
+

+Sets the application as the last used application for a given type. +This will make the application appear as first in the list returned by +g_app_info_get_recommended_for_type, regardless of the default application +for that content type. +

+
++ + + + + + + + + + + + - @@ -1024,9 +1092,9 @@ Sets the application as the default handler for the given file extension.

g_app_info_add_supports_type ()

-
gboolean            g_app_info_add_supports_type        (GAppInfo *appinfo,
+
gboolean            g_app_info_add_supports_type        (GAppInfo *appinfo,
                                                          const char *content_type,
-                                                         GError **error);
+ GError **error);

Adds a content type to the application information to indicate the application is capable of opening files with the given content type. @@ -1046,12 +1114,12 @@ application is capable of opening files with the given content type.

- - @@ -1060,7 +1128,7 @@ application is capable of opening files with the given content type.

g_app_info_can_remove_supports_type ()

-
gboolean            g_app_info_can_remove_supports_type (GAppInfo *appinfo);
+
gboolean            g_app_info_can_remove_supports_type (GAppInfo *appinfo);

Checks if a supported content type can be removed from an application.

@@ -1074,8 +1142,8 @@ Checks if a supported content type can be removed from an application.
- @@ -1084,9 +1152,9 @@ Checks if a supported content type can be removed from an application.

g_app_info_remove_supports_type ()

-
gboolean            g_app_info_remove_supports_type     (GAppInfo *appinfo,
+
gboolean            g_app_info_remove_supports_type     (GAppInfo *appinfo,
                                                          const char *content_type,
-                                                         GError **error);
+ GError **error);

Removes a supported type from an application, if possible.

@@ -1105,12 +1173,12 @@ Removes a supported type from an application, if possible.
- - @@ -1119,7 +1187,7 @@ Removes a supported type from an application, if possible.

g_app_info_get_all ()

-
GList *             g_app_info_get_all                  (void);
+
GList *             g_app_info_get_all                  (void);

Gets a list of all of the applications currently registered on this system. @@ -1136,7 +1204,7 @@ the Hidden key set.

-

appinfo :

a GAppInfo. +

content_type :

the content type. +

error :

a GError.

Returns :

TRUE on success, FALSE on error. + TRUE on success, FALSE on error.

error :

a GError. +a GError.

Returns :

TRUE on success, FALSE on error. + TRUE on success, FALSE on error.

Returns :

TRUE if it is possible to remove supported - content types from a given appinfo, FALSE if not. + TRUE if it is possible to remove supported + content types from a given appinfo, FALSE if not.

error :

a GError. +a GError.

Returns :

TRUE on success, FALSE on error. + TRUE on success, FALSE on error.

Returns :

a newly allocated GList of references to GAppInfos. + a newly allocated GList of references to GAppInfos. [element-type GAppInfo][transfer full GAppInfo]
@@ -1144,9 +1212,9 @@ the Hidden key set.

g_app_info_get_all_for_type ()

-
GList *             g_app_info_get_all_for_type         (const char *content_type);
+
GList *             g_app_info_get_all_for_type         (const char *content_type);

-Gets a list of all GAppInfos for a given content type. +Gets a list of all GAppInfos for a given content type.

@@ -1158,8 +1226,8 @@ Gets a list of all - @@ -1169,7 +1237,7 @@ Gets a list of all

g_app_info_get_default_for_type ()

GAppInfo *          g_app_info_get_default_for_type     (const char *content_type,
-                                                         gboolean must_support_uris);
+ gboolean must_support_uris);

Gets the GAppInfo that corresponds to a given content type.

@@ -1183,13 +1251,13 @@ Gets the must_support_uris :

-
- @@ -1216,20 +1284,77 @@ of the URI, up to but not including the ':', e.g. "http", - + + +

Returns :

GList of GAppInfos for given content_type - or NULL on error. + GList of GAppInfos + for given content_type or NULL on error. [element-type GAppInfo][transfer full GAppInfo]
if TRUE, the GAppInfo is expected to +if TRUE, the GAppInfo is expected to support URIs

Returns :

GAppInfo for given content_type or NULL on error. + GAppInfo for given content_type or NULL on error.

Returns :

GAppInfo for given uri_scheme or NULL on error. + GAppInfo for given uri_scheme or NULL on error. +
+
+
+
+

g_app_info_get_fallback_for_type ()

+
GList *             g_app_info_get_fallback_for_type    (const gchar *content_type);
+

+Gets a list of fallback GAppInfos for a given content type, i.e. +those applications which claim to support the given content type +by MIME type subclassing and not directly. +

+
++ + + + + + + + + + +

content_type :

the content type to find a GAppInfo for +

Returns :

GList of GAppInfos + for given content_type or NULL on error. [element-type GAppInfo][transfer full GAppInfo] +
+

Since 2.28

+
+
+
+

g_app_info_get_recommended_for_type ()

+
GList *             g_app_info_get_recommended_for_type (const gchar *content_type);
+

+Gets a list of recommended GAppInfos for a given content type, i.e. +those applications which claim to support the given content type exactly, +and not by MIME type subclassing. +Note that the first application of the list is the last used one, i.e. +the last one for which g_app_info_set_as_last_used_for_type has been +called. +

+
++ + + + + + + +

content_type :

the content type to find a GAppInfo for +

Returns :

GList of GAppInfos + for given content_type or NULL on error. [element-type GAppInfo][transfer full GAppInfo]
+

Since 2.28


g_app_info_launch_default_for_uri ()

-
gboolean            g_app_info_launch_default_for_uri   (const char *uri,
+
gboolean            g_app_info_launch_default_for_uri   (const char *uri,
                                                          GAppLaunchContext *launch_context,
-                                                         GError **error);
+ GError **error);

-Utility function that launches the default application +Utility function that launches the default application registered to handle the specified uri. Synchronous I/O is done on the uri to detect the type of the file if required. @@ -1249,12 +1374,12 @@ required.

error :

-a GError. +a GError.

Returns :

- TRUE on success, FALSE on error. + TRUE on success, FALSE on error. @@ -1265,11 +1390,11 @@ required.

g_app_launch_context_get_display ()

char *              g_app_launch_context_get_display    (GAppLaunchContext *context,
                                                          GAppInfo *info,
-                                                         GList *files);
+ GList *files);

-Gets the display string for the display. This is used to ensure new -applications are started on the same display as the launching -application. +Gets the display string for the context. This is used to ensure new +applications are started on the same display as the launching +application, by setting the DISPLAY environment variable.

@@ -1286,7 +1411,7 @@ application. - @@ -1303,10 +1428,11 @@ application.
char *              g_app_launch_context_get_startup_notify_id
                                                         (GAppLaunchContext *context,
                                                          GAppInfo *info,
-                                                         GList *files);
+ GList *files);

Initiates startup notification for the application and returns the -DESKTOP_STARTUP_ID for the launched operation, if supported. +DESKTOP_STARTUP_ID for the launched operation, +if supported.

Startup notification IDs are defined in the @@ -1327,12 +1453,12 @@ FreeDesktop.Org Startup Notifications standard.

- - @@ -1370,7 +1496,7 @@ the application startup notification started in GAppLaunchContext * g_app_launch_context_new (void);

Creates a new application launch context. This is not normally used, -instead you instantiate a subclass of this, such as GdkAppLaunchContext. +instead you instantiate a subclass of this, such as GdkAppLaunchContext.

files :

a GList of GFile objects + a GList of GFile objects. [element-type GFile]

files :

a GList of of GFile objects + a GList of of GFile objects. [element-type GFile]

Returns :

a startup notification ID for the application, or NULL if + a startup notification ID for the application, or NULL if not supported.
@@ -1385,6 +1511,6 @@ instead you instantiate a subclass of this, such as GdkAppLau + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GApplication.html b/docs/reference/gio/html/GApplication.html new file mode 100644 index 0000000..60bd07a --- /dev/null +++ b/docs/reference/gio/html/GApplication.html @@ -0,0 +1,1455 @@ + + + + +GApplication + + + + + + + + + +
+ + + + + + + + + +
+
+
+ + +
+

GApplication

+

GApplication — Core application class

+
+
+

Synopsis

+
                    GApplication;
+                    GApplicationClass;
+
+enum                GApplicationFlags;
+gboolean            g_application_id_is_valid           (const gchar *application_id);
+GApplication *      g_application_new                   (const gchar *application_id,
+                                                         GApplicationFlags flags);
+
+const gchar *       g_application_get_application_id    (GApplication *application);
+void                g_application_set_application_id    (GApplication *application,
+                                                         const gchar *application_id);
+
+guint               g_application_get_inactivity_timeout
+                                                        (GApplication *application);
+void                g_application_set_inactivity_timeout
+                                                        (GApplication *application,
+                                                         guint inactivity_timeout);
+
+GApplicationFlags   g_application_get_flags             (GApplication *application);
+void                g_application_set_flags             (GApplication *application,
+                                                         GApplicationFlags flags);
+
+void                g_application_set_action_group      (GApplication *application,
+                                                         GActionGroup *action_group);
+
+gboolean            g_application_get_is_registered     (GApplication *application);
+gboolean            g_application_get_is_remote         (GApplication *application);
+gboolean            g_application_register              (GApplication *application,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+
+void                g_application_hold                  (GApplication *application);
+void                g_application_release               (GApplication *application);
+
+void                g_application_activate              (GApplication *application);
+void                g_application_open                  (GApplication *application,
+                                                         GFile **files,
+                                                         gint n_files,
+                                                         const gchar *hint);
+
+int                 g_application_run                   (GApplication *application,
+                                                         int argc,
+                                                         char **argv);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GApplication
+
+
+
+

Implemented Interfaces

+

+GApplication implements + GActionGroup.

+
+
+

Properties

+
+  "action-group"             GActionGroup*         : Write
+  "application-id"           gchar*                : Read / Write / Construct
+  "flags"                    GApplicationFlags     : Read / Write
+  "inactivity-timeout"       guint                 : Read / Write
+  "is-registered"            gboolean              : Read
+  "is-remote"                gboolean              : Read
+
+
+
+

Signals

+
+  "activate"                                       : Run Last
+  "command-line"                                   : Run Last
+  "open"                                           : Run Last
+  "startup"                                        : Run Last
+
+
+
+

Description

+

+A GApplication is the foundation of an application, unique for a +given application identifier. The GApplication class wraps some +low-level platform-specific services and is intended to act as the +foundation for higher-level application classes such as +GtkApplication or MxApplication. In general, you should not use +this class outside of a higher level framework. +

+

+One of the core features that GApplication provides is process +uniqueness, in the context of a "session". The session concept is +platform-dependent, but corresponds roughly to a graphical desktop +login. When your application is launched again, its arguments +are passed through platform communication to the already running +program. The already running instance of the program is called the +primary instance. +

+

+Before using GApplication, you must choose an "application identifier". +The expected form of an application identifier is very close to that of +of a DBus bus name. +Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator". +For details on valid application identifiers, see +g_application_id_is_valid(). +

+

+GApplication provides convenient life cycle management by maintaining +a use count for the primary application instance. +The use count can be changed using g_application_hold() and +g_application_release(). If it drops to zero, the application exits. +

+

+GApplication also implements the GActionGroup interface and lets you +easily export actions by adding them with g_application_set_action_group(). +When invoking an action by calling g_action_group_activate_action() on +the application, it is always invoked in the primary instance. +

+

+There is a number of different entry points into a GApplication: +

+
    +
  • via 'Activate' (i.e. just starting the application)
  • +
  • via 'Open' (i.e. opening some files)
  • +
  • via activating an action
  • +
+

+The "startup" signal lets you handle the application +initialization for all of these in a single place. +

+

+

+
+

Example 13. Opening files with a GApplication

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void
+activate (GApplication *application)
+{
+  g_print ("activated\n");
+
+  /* Note: when doing a longer-lasting action here that returns
+   * to the mainloop, you should use g_application_hold() and
+   * g_application_release() to keep the application alive until
+   * the action is completed.
+   */
+}
+
+static void
+open (GApplication  *application,
+      GFile        **files,
+      gint           n_files,
+      const gchar   *hint)
+{
+  gint i;
+
+  for (i = 0; i < n_files; i++)
+    {
+      gchar *uri = g_file_get_uri (files[i]);
+      g_print ("open %s\n", uri);
+      g_free (uri);
+    }
+
+  /* Note: when doing a longer-lasting action here that returns
+   * to the mainloop, you should use g_application_hold() and
+   * g_application_release() to keep the application alive until
+   * the action is completed.
+   */
+}
+
+int
+main (int argc, char **argv)
+{
+  GApplication *app;
+  int status;
+
+  app = g_application_new ("org.gtk.TestApplication",
+                           G_APPLICATION_HANDLES_OPEN);
+  g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
+  g_signal_connect (app, "open", G_CALLBACK (open), NULL);
+  g_application_set_inactivity_timeout (app, 10000);
+
+  status = g_application_run (app, argc, argv);
+
+  g_object_unref (app);
+
+  return status;
+}
+
+ +
+


+

+

+

+
+

Example 14. A GApplication with actions

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void
+activate (GApplication *application)
+{
+  g_print ("activated\n");
+}
+
+static void
+activate_action (GAction  *action,
+                 GVariant *parameter,
+                 gpointer  data)
+{
+  g_print ("action %s activated\n", g_action_get_name (action));
+}
+
+static void
+activate_toggle_action (GAction  *action,
+                        GVariant *parameter,
+                        gpointer  data)
+{
+  GVariant *state;
+  gboolean b;
+
+  g_print ("action %s activated\n", g_action_get_name (action));
+
+  state = g_action_get_state (action);
+  b = g_variant_get_boolean (state);
+  g_variant_unref (state);
+  g_action_set_state (action, g_variant_new_boolean (!b));
+  g_print ("state change %d -> %d\n", b, !b);
+}
+
+static void
+add_actions (GApplication *app)
+{
+  GSimpleActionGroup *actions;
+  GSimpleAction *action;
+
+  actions = g_simple_action_group_new ();
+
+  action = g_simple_action_new ("simple-action", NULL);
+  g_signal_connect (action, "activate", G_CALLBACK (activate_action), app);
+  g_simple_action_group_insert (actions, G_ACTION (action));
+  g_object_unref (action);
+
+  action = g_simple_action_new_stateful ("toggle-action", NULL,
+                                         g_variant_new_boolean (FALSE));
+  g_signal_connect (action, "activate", G_CALLBACK (activate_toggle_action), app);
+  g_simple_action_group_insert (actions, G_ACTION (action));
+  g_object_unref (action);
+
+  g_application_set_action_group (app, G_ACTION_GROUP (actions));
+  g_object_unref (actions);
+}
+
+int
+main (int argc, char **argv)
+{
+  GApplication *app;
+  int status;
+
+  app = g_application_new ("org.gtk.TestApplication", 0);
+  g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
+  g_application_set_inactivity_timeout (app, 10000);
+
+  add_actions (app);
+
+  if (argc > 1 && strcmp (argv[1], "--simple-action") == 0)
+    {
+      g_application_register (app, NULL, NULL);
+      g_action_group_activate_action (G_ACTION_GROUP (app), "simple-action", NULL);
+      exit (0);
+    }
+  else if (argc > 1 && strcmp (argv[1], "--toggle-action") == 0)
+    {
+      g_application_register (app, NULL, NULL);
+      g_action_group_activate_action (G_ACTION_GROUP (app), "toggle-action", NULL);
+      exit (0);
+    }
+
+  status = g_application_run (app, argc, argv);
+
+  g_object_unref (app);
+
+  return status;
+}
+
+ +
+


+

+
+
+

Details

+
+

GApplication

+
typedef struct _GApplication GApplication;
+

+The GApplication structure contains private +data and should only be accessed using the provided API +

+

Since 2.26

+
+
+
+

GApplicationClass

+
typedef struct {
+  /* signals */
+  void                      (* startup)             (GApplication              *application);
+
+  void                      (* activate)            (GApplication              *application);
+
+  void                      (* open)                (GApplication              *application,
+                                                     GFile                    **files,
+                                                     gint                       n_files,
+                                                     const gchar               *hint);
+
+  int                       (* command_line)        (GApplication              *application,
+                                                     GApplicationCommandLine   *command_line);
+
+  /* vfuncs */
+  gboolean                  (* local_command_line)  (GApplication              *application,
+                                                     gchar                   ***arguments,
+                                                     int                       *exit_status);
+
+  void                      (* before_emit)         (GApplication              *application,
+                                                     GVariant                  *platform_data);
+  void                      (* after_emit)          (GApplication              *application,
+                                                     GVariant                  *platform_data);
+  void                      (* add_platform_data)   (GApplication              *application,
+                                                     GVariantBuilder           *builder);
+  void                      (* quit_mainloop)       (GApplication              *application);
+  void                      (* run_mainloop)        (GApplication              *application);
+} GApplicationClass;
+
+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

startup ()

invoked on the primary instance immediately after registration +

activate ()

invoked on the primary instance when an activation occurs +

open ()

invoked on the primary instance when there are files to open +

command_line ()

invoked on the primary instance when a command-line is + not handled locally +

local_command_line ()

invoked (locally) when the process has been invoked + via commandline execution. The virtual function has the chance to + inspect (and possibly replace) the list of command line arguments. + See g_application_run() for more information. +

before_emit ()

invoked on the primary instance before 'activate', 'open' or any action invocation +

after_emit ()

invoked on the primary instance after 'activate', 'open' or any action invocation +

add_platform_data ()

invoked (locally) to add 'platform data' to be sent to the primary instance when + activating, opening or invoking actions +

quit_mainloop ()

invoked on the primary instance when the use count of the application drops to zero (and + after any inactivity timeout, if requested) +

run_mainloop ()

invoked on the primary instance from g_application_run() if the use-count is non-zero +
+

Since 2.26

+
+
+
+

enum GApplicationFlags

+
typedef enum
+{
+  G_APPLICATION_FLAGS_NONE,
+  G_APPLICATION_IS_SERVICE  =          (1 << 0),
+  G_APPLICATION_IS_LAUNCHER =          (1 << 1),
+
+  G_APPLICATION_HANDLES_OPEN =         (1 << 2),
+  G_APPLICATION_HANDLES_COMMAND_LINE = (1 << 3),
+  G_APPLICATION_SEND_ENVIRONMENT    =  (1 << 4)
+} GApplicationFlags;
+
+

+Flags used to define the behaviour of a GApplication. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

G_APPLICATION_FLAGS_NONE

Default +

G_APPLICATION_IS_SERVICE

Run as a service. In this mode, registration + fails if the service is already running, and the application will + stay around for a while when the use count falls to zero. +

G_APPLICATION_IS_LAUNCHER

Don't try to become the primary instance. +

G_APPLICATION_HANDLES_OPEN

This application handles opening files (in the + primary instance) +

G_APPLICATION_HANDLES_COMMAND_LINE

This application handles command line + arguments (in the primary instance) +

G_APPLICATION_SEND_ENVIRONMENT

Send the environment of the + launching process to the primary instance +
+

Since 2.26

+
+
+
+

g_application_id_is_valid ()

+
gboolean            g_application_id_is_valid           (const gchar *application_id);
+

+Checks if application_id is a valid application identifier. +

+

+A valid ID is required for calls to g_application_new() and +g_application_set_application_id(). +

+

+For convenience, the restrictions on application identifiers are +reproduced here: +

+
    +
  • Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-" and must not begin with a digit.
  • +
  • Application identifiers must contain at least one '.' (period) character (and thus at least two elements).
  • +
  • Application identifiers must not begin with a '.' (period) character.
  • +
  • Application identifiers must not contain consecutive '.' (period) characters.
  • +
  • Application identifiers must not exceed 255 characters.
  • +
+

+

+
++ + + + + + + + + + +

application_id :

a potential application identifier +

Returns :

+TRUE if application_id is valid +
+
+
+
+

g_application_new ()

+
GApplication *      g_application_new                   (const gchar *application_id,
+                                                         GApplicationFlags flags);
+

+Creates a new GApplication instance. +

+

+This function calls g_type_init() for you. +

+

+The application id must be valid. See g_application_id_is_valid(). +

+
++ + + + + + + + + + + + + + +

application_id :

the application id +

flags :

the application flags +

Returns :

a new GApplication instance +
+
+
+
+

g_application_get_application_id ()

+
const gchar *       g_application_get_application_id    (GApplication *application);
+

+Gets the unique identifier for application. +

+
++ + + + + + + + + + +

application :

a GApplication +

Returns :

the identifier for application, owned by application +
+

Since 2.28

+
+
+
+

g_application_set_application_id ()

+
void                g_application_set_application_id    (GApplication *application,
+                                                         const gchar *application_id);
+

+Sets the unique identifier for application. +

+

+The application id can only be modified if application has not yet +been registered. +

+

+The application id must be valid. See g_application_id_is_valid(). +

+
++ + + + + + + + + + +

application :

a GApplication +

application_id :

the identifier for application +
+

Since 2.28

+
+
+
+

g_application_get_inactivity_timeout ()

+
guint               g_application_get_inactivity_timeout
+                                                        (GApplication *application);
+

+Gets the current inactivity timeout for the application. +

+

+This is the amount of time (in milliseconds) after the last call to +g_application_release() before the application stops running. +

+
++ + + + + + + + + + +

application :

a GApplication +

Returns :

the timeout, in milliseconds + +
+

Since 2.28

+
+
+
+

g_application_set_inactivity_timeout ()

+
void                g_application_set_inactivity_timeout
+                                                        (GApplication *application,
+                                                         guint inactivity_timeout);
+

+Sets the current inactivity timeout for the application. +

+

+This is the amount of time (in milliseconds) after the last call to +g_application_release() before the application stops running. +

+

+This call has no side effects of its own. The value set here is only +used for next time g_application_release() drops the use count to +zero. Any timeouts currently in progress are not impacted. +

+
++ + + + + + + + + + +

application :

a GApplication +

inactivity_timeout :

the timeout, in milliseconds +
+

Since 2.28

+
+
+
+

g_application_get_flags ()

+
GApplicationFlags   g_application_get_flags             (GApplication *application);
+

+Gets the flags for application. +

+

+See GApplicationFlags. +

+
++ + + + + + + + + + +

application :

a GApplication +

Returns :

the flags for application +
+

Since 2.28

+
+
+
+

g_application_set_flags ()

+
void                g_application_set_flags             (GApplication *application,
+                                                         GApplicationFlags flags);
+

+Sets the flags for application. +

+

+The flags can only be modified if application has not yet been +registered. +

+

+See GApplicationFlags. +

+
++ + + + + + + + + + +

application :

a GApplication +

flags :

the flags for application +
+

Since 2.28

+
+
+
+

g_application_set_action_group ()

+
void                g_application_set_action_group      (GApplication *application,
+                                                         GActionGroup *action_group);
+

+Sets or unsets the group of actions associated with the application. +

+

+These actions are the actions that can be remotely invoked. +

+

+It is an error to call this function after the application has been +registered. +

+
++ + + + + + + + + + +

application :

a GApplication +

action_group :

a GActionGroup, or NULL. [allow-none] +
+

Since 2.28

+
+
+
+

g_application_get_is_registered ()

+
gboolean            g_application_get_is_registered     (GApplication *application);
+

+Checks if application is registered. +

+

+An application is registered if g_application_register() has been +successfully called. +

+
++ + + + + + + + + + +

application :

a GApplication +

Returns :

+TRUE if application is registered +
+

Since 2.28

+
+
+
+

g_application_get_is_remote ()

+
gboolean            g_application_get_is_remote         (GApplication *application);
+

+Checks if application is remote. +

+

+If application is remote then it means that another instance of +application already exists (the 'primary' instance). Calls to +perform actions on application will result in the actions being +performed by the primary instance. +

+

+The value of this property can not be accessed before +g_application_register() has been called. See +g_application_get_is_registered(). +

+
++ + + + + + + + + + +

application :

a GApplication +

Returns :

+TRUE if application is remote +
+

Since 2.28

+
+
+
+

g_application_register ()

+
gboolean            g_application_register              (GApplication *application,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Attempts registration of the application. +

+

+This is the point at which the application discovers if it is the +primary instance or merely acting as a remote for an already-existing +primary instance. +

+

+If the application has already been registered then TRUE is +returned with no work performed. +

+

+The "startup" signal is emitted if registration succeeds +and application is the primary instance. +

+

+In the event of an error (such as cancellable being cancelled, or a +failure to connect to the session bus), FALSE is returned and error +is set appropriately. +

+

+Note: the return value of this function is not an indicator that this +instance is or is not the primary instance of the application. See +g_application_get_is_remote() for that. +

+
++ + + + + + + + + + + + + + + + + + +

application :

a GApplication +

cancellable :

a GCancellable, or NULL +

error :

a pointer to a NULL GError, or NULL +

Returns :

+TRUE if registration succeeded +
+

Since 2.28

+
+
+
+

g_application_hold ()

+
void                g_application_hold                  (GApplication *application);
+

+Increases the use count of application. +

+

+Use this function to indicate that the application has a reason to +continue to run. For example, g_application_hold() is called by GTK+ +when a toplevel window is on the screen. +

+

+To cancel the hold, call g_application_release(). +

+
++ + + + +

application :

a GApplication +
+
+
+
+

g_application_release ()

+
void                g_application_release               (GApplication *application);
+

+Decrease the use count of application. +

+

+When the use count reaches zero, the application will stop running. +

+

+Never call this function except to cancel the effect of a previous +call to g_application_hold(). +

+
++ + + + +

application :

a GApplication +
+
+
+
+

g_application_activate ()

+
void                g_application_activate              (GApplication *application);
+

+Activates the application. +

+

+In essence, this results in the GApplication::activate() signal being +emitted in the primary instance. +

+

+The application must be registered before calling this function. +

+
++ + + + +

application :

a GApplication +
+

Since 2.28

+
+
+
+

g_application_open ()

+
void                g_application_open                  (GApplication *application,
+                                                         GFile **files,
+                                                         gint n_files,
+                                                         const gchar *hint);
+

+Opens the given files. +

+

+In essence, this results in the "open" signal being emitted +in the primary instance. +

+

+n_files must be greater than zero. +

+

+hint is simply passed through to the ::open signal. It is +intended to be used by applications that have multiple modes for +opening files (eg: "view" vs "edit", etc). Unless you have a need +for this functionality, you should use "". +

+

+The application must be registered before calling this function +and it must have the G_APPLICATION_HANDLES_OPEN flag set. +

+
++ + + + + + + + + + + + + + + + + + +

application :

a GApplication +

files :

an array of GFiles to open. [array length=n_files] +

n_files :

the length of the files array +

hint :

a hint (or ""), but never NULL +
+

Since 2.28

+
+
+
+

g_application_run ()

+
int                 g_application_run                   (GApplication *application,
+                                                         int argc,
+                                                         char **argv);
+

+Runs the application. +

+

+This function is intended to be run from main() and its return value +is intended to be returned by main(). +

+

+First, the local_command_line() virtual function is invoked. This +function always runs on the local instance. If that function returns +FALSE then the application is registered and the "command-line" +signal is emitted in the primary instance (which may or may not be +this instance). +

+

+If the application has the G_APPLICATION_HANDLES_COMMAND_LINE +flag set then the default implementation of local_command_line() +always returns FALSE immediately, resulting in the commandline +always being handled in the primary instance. +

+

+Otherwise, the default implementation of local_command_line() tries +to do a couple of things that are probably reasonable for most +applications. First, g_application_register() is called to attempt +to register the application. If that works, then the command line +arguments are inspected. If no commandline arguments are given, then +g_application_activate() is called. If commandline arguments are +given and the G_APPLICATION_HANDLES_OPEN flag is set then they +are assumed to be filenames and g_application_open() is called. +

+

+If you are interested in doing more complicated local handling of the +commandline then you should implement your own GApplication subclass +and override local_command_line(). See +Example 16, “Complicated commandline handling” for an example. +

+

+If, after the above is done, the use count of the application is zero +then the exit status is returned immediately. If the use count is +non-zero then the mainloop is run until the use count falls to zero, +at which point 0 is returned. +

+

+If the G_APPLICATION_IS_SERVICE flag is set, then the exiting at +use count of zero is delayed for a while (ie: the instance stays +around to provide its service to others). +

+
++ + + + + + + + + + + + + + + + + + +

application :

a GApplication +

argc :

the argc from main() +

argv :

the argv from main(). [array length=argc] +

Returns :

the exit status +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "action-group" property

+
  "action-group"             GActionGroup*         : Write
+

The group of actions that the application exports.

+
+
+
+

The "application-id" property

+
  "application-id"           gchar*                : Read / Write / Construct
+

The unique identifier for the application.

+

Default value: NULL

+
+
+
+

The "flags" property

+
  "flags"                    GApplicationFlags     : Read / Write
+

Flags specifying the behaviour of the application.

+
+
+
+

The "inactivity-timeout" property

+
  "inactivity-timeout"       guint                 : Read / Write
+

Iime (ms) to stay alive after becoming idle.

+

Default value: 0

+
+
+
+

The "is-registered" property

+
  "is-registered"            gboolean              : Read
+

If g_application_register() has been called.

+

Default value: FALSE

+
+
+
+

The "is-remote" property

+
  "is-remote"                gboolean              : Read
+

If this application instance is remote.

+

Default value: FALSE

+
+
+
+

Signal Details

+
+

The "activate" signal

+
void                user_function                      (GApplication *application,
+                                                        gpointer      user_data)        : Run Last
+

+The ::activate signal is emitted on the primary instance when an +activation occurs. See g_application_activate(). +

+
++ + + + + + + + + + +

application :

the application +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "command-line" signal

+
gint                user_function                      (GApplication            *application,
+                                                        GApplicationCommandLine *command_line,
+                                                        gpointer                 user_data)         : Run Last
+

+The ::command-line signal is emitted on the primary instance when +a commandline is not handled locally. See g_application_run() for +more information. +

+
++ + + + + + + + + + + + + + +

application :

the application +

command_line :

a GApplicationCommandLine representing the + passed commandline +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "open" signal

+
void                user_function                      (GApplication *application,
+                                                        gpointer      files,
+                                                        gint          n_files,
+                                                        gchar        *hint,
+                                                        gpointer      user_data)        : Run Last
+

+The ::open signal is emitted on the primary instance when there are +files to open. See g_application_open() for more information. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

application :

the application +

files :

an array of GFiles. [array length=n_files][element-type GFile] +

n_files :

the length of files +

hint :

a hint provided by the calling instance +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "startup" signal

+
void                user_function                      (GApplication *application,
+                                                        gpointer      user_data)        : Run Last
+

+The ::startup signal is emitted on the primary instance immediately +after registration. See g_activation_register(). +

+
++ + + + + + + + + + +

application :

the application +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GApplicationCommandLine.html b/docs/reference/gio/html/GApplicationCommandLine.html new file mode 100644 index 0000000..2fe8d7f --- /dev/null +++ b/docs/reference/gio/html/GApplicationCommandLine.html @@ -0,0 +1,784 @@ + + + + +GApplicationCommandLine + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GApplicationCommandLine

+

GApplicationCommandLine — A command-line invocation of an application

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GApplicationCommandLine
+
+
+
+

Description

+

+GApplicationCommandLine represents a command-line invocation of +an application. It is created by GApplication and emitted +in the "command-line" signal and virtual function. +

+

+The class contains the list of arguments that the program was invoked +with. It is also possible to query if the commandline invocation was +local (ie: the current process is running in direct response to the +invocation) or remote (ie: some other process forwarded the +commandline to this process). +

+

+The exit status of the originally-invoked process may be set and +messages can be printed to stdout or stderr of that process. The +lifecycle of the originally-invoked process is tied to the lifecycle +of this object (ie: the process exits when the last reference is +dropped). +

+

+

+
+

Example 15. Handling commandline arguments with GApplication

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int
+command_line (GApplication            *application,
+              GApplicationCommandLine *cmdline)
+{
+  gchar **argv;
+  gint argc;
+  gint i;
+
+  argv = g_application_command_line_get_arguments (cmdline, &argc);
+
+  g_application_command_line_print (cmdline,
+                                    "This text is written back\n"
+                                    "to stdout of the caller\n");
+
+  for (i = 0; i < argc; i++)
+    g_print ("argument %d: %s\n", i, argv[i]);
+
+  g_strfreev (argv);
+
+  return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+  GApplication *app;
+  int status;
+
+  app = g_application_new ("org.gtk.TestApplication",
+                           G_APPLICATION_HANDLES_COMMAND_LINE);
+  g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL);
+  g_application_set_inactivity_timeout (app, 10000);
+
+  status = g_application_run (app, argc, argv);
+
+  g_object_unref (app);
+
+  return status;
+}
+
+ +
+


+

+

+

+
+

Example 16. Complicated commandline handling

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int
+command_line (GApplication            *application,
+              GApplicationCommandLine *cmdline)
+{
+  gchar **argv;
+  gint argc;
+  gint i;
+
+  argv = g_application_command_line_get_arguments (cmdline, &argc);
+
+  for (i = 0; i < argc; i++)
+    g_print ("handling argument %s remotely\n", argv[i]);
+
+  g_strfreev (argv);
+
+  return 0;
+}
+
+static gboolean
+test_local_cmdline (GApplication   *application,
+                    gchar        ***arguments,
+                    gint           *exit_status)
+{
+  gint i, j;
+  gchar **argv;
+
+  argv = *arguments;
+
+  for (i = 0; argv[i]; i++)
+    {
+      if (g_str_has_prefix (argv[i], "--local-"))
+        {
+          g_print ("handling argument %s locally\n", argv[i]);
+          for (j = i + 1; argv[j]; j++)
+            {
+              argv[j - 1] = argv[j];
+              argv[j] = NULL;
+            }
+        }
+    }
+
+  *exit_status = 0;
+
+  return FALSE;
+}
+
+typedef GApplication TestApplication;
+typedef GApplicationClass TestApplicationClass;
+
+G_DEFINE_TYPE (TestApplication, test_application, G_TYPE_APPLICATION)
+
+static void
+test_application_finalize (GObject *object)
+{
+  G_OBJECT_CLASS (test_application_parent_class)->finalize (object);
+}
+
+static void
+test_application_init (TestApplication *app)
+{
+}
+
+static void
+test_application_class_init (TestApplicationClass *class)
+{
+  G_OBJECT_CLASS (class)->finalize = test_application_finalize;
+  G_APPLICATION_CLASS (class)->local_command_line = test_local_cmdline;
+}
+
+GApplication *
+test_application_new (const gchar       *application_id,
+                      GApplicationFlags  flags)
+{
+  g_return_val_if_fail (g_application_id_is_valid (application_id), NULL);
+
+  g_type_init ();
+
+  return g_object_new (test_application_get_type (),
+                       "application-id", application_id,
+                       "flags", flags,
+                       NULL);
+}
+
+int
+main (int argc, char **argv)
+{
+  GApplication *app;
+  int status;
+
+  app = test_application_new ("org.gtk.TestApplication", 0);
+  g_application_set_inactivity_timeout (app, 10000);
+  g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL);
+
+  status = g_application_run (app, argc, argv);
+
+  g_object_unref (app);
+
+  return status;
+}
+
+ +
+


+

+
+
+

Details

+
+

GApplicationCommandLine

+
typedef struct _GApplicationCommandLine GApplicationCommandLine;
+

+The GApplicationCommandLine structure contains private +data and should only be accessed using the provided API +

+

Since 2.26

+
+
+
+

GApplicationCommandLineClass

+
typedef struct {
+} GApplicationCommandLineClass;
+
+

+The GApplicationCommandLineClass structure contains +private data only +

+

Since 2.26

+
+
+
+

g_application_command_line_get_arguments ()

+
gchar **            g_application_command_line_get_arguments
+                                                        (GApplicationCommandLine *cmdline,
+                                                         int *argc);
+

+Gets the list of arguments that was passed on the command line. +

+

+The strings in the array may contain non-utf8 data. +

+

+The return value is NULL-terminated and should be freed using +g_strfreev(). +

+
++ + + + + + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

argc :

the length of the arguments array, or NULL. [out] +

Returns :

the string array +containing the arguments (the argv). [array length=argc][transfer full length=argc] +
+

Since 2.28

+
+
+
+

g_application_command_line_get_cwd ()

+
const gchar *       g_application_command_line_get_cwd  (GApplicationCommandLine *cmdline);
+

+Gets the working directory of the command line invocation. The +string may contain non-utf8 data. +

+

+It is possible that the remote application did not send a working +directory, so this may be NULL. +

+

+The return value should not be modified or freed and is valid for as +long as cmdline exists. +

+
++ + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

Returns :

the current directory, or NULL + +
+

Since 2.28

+
+
+
+

g_application_command_line_getenv ()

+
const gchar *       g_application_command_line_getenv   (GApplicationCommandLine *cmdline,
+                                                         const gchar *name);
+

+Gets the value of a particular environment variable of the command +line invocation, as would be returned by g_getenv(). The strings may +contain non-utf8 data. +

+

+The remote application usually does not send an environment. Use +G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag +set it is possible that the environment is still not available (due +to invocation messages from other applications). +

+

+The return value should not be modified or freed and is valid for as +long as cmdline exists. +

+
++ + + + + + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

name :

the environment variable to get +

Returns :

the value of the variable, or NULL if unset or unsent + +
+

Since 2.28

+
+
+
+

g_application_command_line_get_is_remote ()

+
gboolean            g_application_command_line_get_is_remote
+                                                        (GApplicationCommandLine *cmdline);
+

+Determines if cmdline represents a remote invocation. +

+
++ + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

Returns :

TRUE if the invocation was remote + +
+

Since 2.28

+
+
+
+

g_application_command_line_get_platform_data ()

+
GVariant *          g_application_command_line_get_platform_data
+                                                        (GApplicationCommandLine *cmdline);
+

+Gets the platform data associated with the invocation of cmdline. +

+

+This is a GVariant dictionary containing information about the +context in which the invocation occured. It typically contains +information like the current working directory and the startup +notification ID. +

+

+For local invocation, it will be NULL. +

+
++ + + + + + + + + + +

cmdline :

+GApplicationCommandLine +

Returns :

the platform data, or NULL + +
+

Since 2.28

+
+
+
+

g_application_command_line_set_exit_status ()

+
void                g_application_command_line_set_exit_status
+                                                        (GApplicationCommandLine *cmdline,
+                                                         int exit_status);
+

+Sets the exit status that will be used when the invoking process +exits. +

+

+The return value of the "command-line" signal is +passed to this function when the handler returns. This is the usual +way of setting the exit status. +

+

+In the event that you want the remote invocation to continue running +and want to decide on the exit status in the future, you can use this +call. For the case of a remote invocation, the remote process will +typically exit when the last reference is dropped on cmdline. The +exit status of the remote process will be equal to the last value +that was set with this function. +

+

+In the case that the commandline invocation is local, the situation +is slightly more complicated. If the commandline invocation results +in the mainloop running (ie: because the use-count of the application +increased to a non-zero value) then the application is considered to +have been 'successful' in a certain sense, and the exit status is +always zero. If the application use count is zero, though, the exit +status of the local GApplicationCommandLine is used. +

+
++ + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

exit_status :

the exit status +
+

Since 2.28

+
+
+
+

g_application_command_line_get_exit_status ()

+
int                 g_application_command_line_get_exit_status
+                                                        (GApplicationCommandLine *cmdline);
+

+Gets the exit status of cmdline. See +g_application_command_line_set_exit_status() for more information. +

+
++ + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

Returns :

the exit status + +
+

Since 2.28

+
+
+
+

g_application_command_line_print ()

+
void                g_application_command_line_print    (GApplicationCommandLine *cmdline,
+                                                         const gchar *format,
+                                                         ...);
+

+Formats a message and prints it using the stdout print handler in the +invoking process. +

+

+If cmdline is a local invocation then this is exactly equivalent to +g_print(). If cmdline is remote then this is equivalent to calling +g_print() in the invoking process. +

+
++ + + + + + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

format :

a printf-style format string +

... :

arguments, as per format +
+

Since 2.28

+
+
+
+

g_application_command_line_printerr ()

+
void                g_application_command_line_printerr (GApplicationCommandLine *cmdline,
+                                                         const gchar *format,
+                                                         ...);
+

+Formats a message and prints it using the stderr print handler in the +invoking process. +

+

+If cmdline is a local invocation then this is exactly equivalent to +g_printerr(). If cmdline is remote then this is equivalent to +calling g_printerr() in the invoking process. +

+
++ + + + + + + + + + + + + + +

cmdline :

a GApplicationCommandLine +

format :

a printf-style format string +

... :

arguments, as per format +
+

Since 2.28

+
+
+
+

See Also

+GApplication +
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GAsyncInitable.html b/docs/reference/gio/html/GAsyncInitable.html index 4c2770a..b356e7b 100644 --- a/docs/reference/gio/html/GAsyncInitable.html +++ b/docs/reference/gio/html/GAsyncInitable.html @@ -3,12 +3,12 @@ GAsyncInitable - + - - + + @@ -28,6 +28,8 @@ Object Hierarchy  |  Prerequisites +  |  + Known Implementations
@@ -50,34 +52,34 @@ int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_async_initable_init_finish (GAsyncInitable *initable, + gpointer user_data); +gboolean g_async_initable_init_finish (GAsyncInitable *initable, GAsyncResult *res, - GError **error); -void g_async_initable_new_async (GType object_type, + GError **error); +void g_async_initable_new_async (GType object_type, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data, - const gchar *first_property_name, + gpointer user_data, + const gchar *first_property_name, ...); -GObject * g_async_initable_new_finish (GAsyncInitable *initable, +GObject * g_async_initable_new_finish (GAsyncInitable *initable, GAsyncResult *res, - GError **error); -void g_async_initable_new_valist_async (GType object_type, - const gchar *first_property_name, + GError **error); +void g_async_initable_new_valist_async (GType object_type, + const gchar *first_property_name, va_list var_args, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -void g_async_initable_newv_async (GType object_type, - guint n_parameters, - GParameter *parameters, + gpointer user_data); +void g_async_initable_newv_async (GType object_type, + guint n_parameters, + GParameter *parameters, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);
@@ -91,7 +93,13 @@

Prerequisites

GAsyncInitable requires - GObject.

+ GObject.

+
+
+

Known Implementations

+

+GAsyncInitable is implemented by + GDBusConnection and GDBusProxy.

Description

@@ -108,8 +116,202 @@ Users of objects implementing this are not intended to use the interface method directly; instead it will be used automatically in various ways. For C applications you generally just call g_async_initable_new_async() directly, or indirectly via a foo_thing_new_async() wrapper. This will call -g_async_initable_init_async() under the cover, calling back with NULL and -a set GError on failure. +g_async_initable_init_async() under the cover, calling back with NULL and +a set GError on failure. +

+

+A typical implementation might look something like this: +

+

+

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
enum {
+   NOT_INITIALIZED,
+   INITIALIZING,
+   INITIALIZED
+};
+
+static void
+_foo_ready_cb (Foo *self)
+{
+  GList *l;
+
+  self->priv->state = INITIALIZED;
+
+  for (l = self->priv->init_results; l != NULL; l = l->next)
+    {
+      GSimpleAsyncResult *simple = l->data;
+
+      if (!self->priv->success)
+        g_simple_async_result_set_error (simple, ...);
+
+      g_simple_async_result_complete (simple);
+      g_object_unref (simple);
+    }
+
+  g_list_free (self->priv->init_results);
+  self->priv->init_results = NULL;
+}
+
+static void
+foo_init_async (GAsyncInitable       *initable,
+                int                   io_priority,
+                GCancellable         *cancellable,
+                GAsyncReadyCallback   callback,
+                gpointer              user_data)
+{
+  Foo *self = FOO (initable);
+  GSimpleAsyncResult *simple;
+
+  simple = g_simple_async_result_new (G_OBJECT (initable)
+                                      callback,
+                                      user_data,
+                                      foo_init_async);
+
+  switch (self->priv->state)
+    {
+      case NOT_INITIALIZED:
+        _foo_get_ready (self);
+        self->priv->init_results = g_list_append (self->priv->init_results,
+                                                  simple);
+        self->priv->state = INITIALIZING;
+        break;
+      case INITIALIZING:
+        self->priv->init_results = g_list_append (self->priv->init_results,
+                                                  simple);
+        break;
+      case INITIALIZED:
+        if (!self->priv->success)
+          g_simple_async_result_set_error (simple, ...);
+
+        g_simple_async_result_complete_in_idle (simple);
+        g_object_unref (simple);
+        break;
+    }
+}
+
+static gboolean
+foo_init_finish (GAsyncInitable       *initable,
+                 GAsyncResult         *result,
+                 GError              **error)
+{
+  g_return_val_if_fail (g_simple_async_result_is_valid (result,
+      G_OBJECT (initable), foo_init_async), FALSE);
+
+  if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
+          error))
+    return FALSE;
+
+  return TRUE;
+}
+
+static void
+foo_async_initable_iface_init (gpointer g_iface,
+                               gpointer data)
+{
+  GAsyncInitableIface *iface = g_iface;
+
+  iface->init_async = foo_init_async;
+  iface->init_finish = foo_init_finish;
+}
+
+ +

@@ -148,7 +350,7 @@ initialization may fail. -

GTypeInterface g_iface;

+

GTypeInterface g_iface;

The parent interface. @@ -173,7 +375,7 @@ initialization may fail. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Starts asynchronous initialization of the object implementing the interface. This must be done before any real use of the object after @@ -187,9 +389,9 @@ initialization.

Implementations may also support cancellation. If cancellable is not -NULL, then initialization can be cancelled by triggering the cancellable +NULL, then initialization can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error -G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL, and +G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL, and the object doesn't support cancellable initialization, the error G_IO_ERROR_NOT_SUPPORTED will be returned.

@@ -228,7 +430,7 @@ any interface methods.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore. @@ -248,9 +450,9 @@ any interface methods.

g_async_initable_init_finish ()

-
gboolean            g_async_initable_init_finish        (GAsyncInitable *initable,
+
gboolean            g_async_initable_init_finish        (GAsyncInitable *initable,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes asynchronous initialization and returns the result. See g_async_initable_init_async(). @@ -270,14 +472,14 @@ See

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- TRUE if successful. If an error has occurred, this function -will return FALSE and set error appropriately if present. + TRUE if successful. If an error has occurred, this function +will return FALSE and set error appropriately if present. @@ -288,16 +490,16 @@ will return

g_async_initable_new_async ()

-
void                g_async_initable_new_async          (GType object_type,
+
void                g_async_initable_new_async          (GType object_type,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data,
-                                                         const gchar *first_property_name,
+                                                         gpointer user_data,
+                                                         const gchar *first_property_name,
                                                          ...);

Helper function for constructing GAsyncInitiable object. This is -similar to g_object_new() but also initializes the object asynchronously. +similar to g_object_new() but also initializes the object asynchronously.

When the initialization is finished, callback will be called. You can @@ -309,7 +511,7 @@ for any errors.

object_type :

-a GType supporting GAsyncInitable. +a GType supporting GAsyncInitable. @@ -320,7 +522,7 @@ for any errors.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore. @@ -336,14 +538,14 @@ for any errors.

first_property_name :

-the name of the first property, or NULL if no +the name of the first property, or NULL if no properties

... :

the value of the first property, followed by other property - value pairs, and ended by NULL. + value pairs, and ended by NULL. @@ -353,12 +555,12 @@ for any errors.

g_async_initable_new_finish ()

-
GObject *           g_async_initable_new_finish         (GAsyncInitable *initable,
+
GObject *           g_async_initable_new_finish         (GAsyncInitable *initable,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes the async construction for the various g_async_initable_new calls, -returning the created object or NULL on error. +returning the created object or NULL on error.

@@ -375,15 +577,14 @@ returning the created object or error :

-
- @@ -393,16 +594,16 @@ returning the created object or

g_async_initable_new_valist_async ()

-
void                g_async_initable_new_valist_async   (GType object_type,
-                                                         const gchar *first_property_name,
+
void                g_async_initable_new_valist_async   (GType object_type,
+                                                         const gchar *first_property_name,
                                                          va_list var_args,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Helper function for constructing GAsyncInitiable object. This is -similar to g_object_new_valist() but also initializes the object +similar to g_object_new_valist() but also initializes the object asynchronously.

@@ -415,13 +616,13 @@ for any errors.

- @@ -437,7 +638,7 @@ the value, and other property value pairs, and ended by cancellable :

-
@@ -458,16 +659,16 @@ the value, and other property value pairs, and ended by

g_async_initable_newv_async ()

-
void                g_async_initable_newv_async         (GType object_type,
-                                                         guint n_parameters,
-                                                         GParameter *parameters,
+
void                g_async_initable_newv_async         (GType object_type,
+                                                         guint n_parameters,
+                                                         GParameter *parameters,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Helper function for constructing GAsyncInitiable object. This is -similar to g_object_newv() but also initializes the object asynchronously. +similar to g_object_newv() but also initializes the object asynchronously.

When the initialization is finished, callback will be called. You can @@ -479,7 +680,7 @@ for any errors.

- @@ -500,7 +701,7 @@ for any errors. - @@ -526,6 +727,6 @@ for any errors. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GAsyncResult.html b/docs/reference/gio/html/GAsyncResult.html index bc923b0..68efd57 100644 --- a/docs/reference/gio/html/GAsyncResult.html +++ b/docs/reference/gio/html/GAsyncResult.html @@ -3,12 +3,12 @@ GAsyncResult - + - + @@ -48,11 +48,11 @@ GAsyncResult; GAsyncResultIface; -void (*GAsyncReadyCallback) (GObject *source_object, +void (*GAsyncReadyCallback) (GObject *source_object, GAsyncResult *res, - gpointer user_data); -gpointerg_async_result_get_user_data (GAsyncResult *res); -GObject * g_async_result_get_source_object (GAsyncResult *res); + gpointer user_data); +gpointerg_async_result_get_user_data (GAsyncResult *res); +GObject * g_async_result_get_source_object (GAsyncResult *res);
@@ -66,7 +66,7 @@

Prerequisites

GAsyncResult requires - GObject.

+ GObject.

Known Implementations

@@ -153,7 +153,7 @@ Example of a typical asynchronous operation flow: GAsyncReadyCallback *cb, gpointer u); -gboolean _theoretical_frobnitz_finish (Theoretical *t, +gboolean _theoretical_frobnitz_finish (Theoretical *t, GAsyncResult *res, GError **e); @@ -162,14 +162,14 @@ Example of a typical asynchronous operation flow: GAsyncResult *res, gpointer user_data) { - gboolean success = FALSE; + gboolean success = FALSE; - success = _theoretical_frobnitz_finish (source_object, res, NULL); + success = _theoretical_frobnitz_finish (source_object, res, NULL); if (success) - g_printf ("Hurray!\n"); + g_printf ("Hurray!\n"); else - g_printf ("Uh oh!\n"); + g_printf ("Uh oh!\n"); /* ... */ @@ -180,9 +180,9 @@ Example of a typical asynchronous operation flow: /* ... */ _theoretical_frobnitz_async (theoretical_data, - NULL, + NULL, frobnitz_result_func, - NULL); + NULL); /* ... */ } @@ -200,10 +200,10 @@ the result is a GThread has been initialized, but +These are run in a separate thread, if GThread has been initialized, but otherwise they are sent to the Main Event Loop and processed in an idle function. So, if you truly need asynchronous operations, make sure to -initialize GThread. +initialize GThread.

@@ -235,7 +235,7 @@ Interface definition for
- + @@ -255,9 +255,9 @@ Interface definition for

GAsyncReadyCallback ()

-
void                (*GAsyncReadyCallback)              (GObject *source_object,
+
void                (*GAsyncReadyCallback)              (GObject *source_object,
                                                          GAsyncResult *res,
-                                                         gpointer user_data);
+ gpointer user_data);

Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. @@ -286,7 +286,7 @@ operation within GIO has been completed.


g_async_result_get_user_data ()

-
gpointer            g_async_result_get_user_data        (GAsyncResult *res);
+
gpointer            g_async_result_get_user_data        (GAsyncResult *res);

Gets the user data from a GAsyncResult.

@@ -300,7 +300,7 @@ Gets the user data from a Returns :

-
@@ -309,7 +309,7 @@ Gets the user data from a

g_async_result_get_source_object ()

-
GObject *           g_async_result_get_source_object    (GAsyncResult *res);
+
GObject *           g_async_result_get_source_object    (GAsyncResult *res);

Gets the source object from a GAsyncResult.

@@ -324,7 +324,7 @@ Gets the source object from a Returns :

@@ -338,6 +338,6 @@ Gets the source object from a
- Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GBufferedInputStream.html b/docs/reference/gio/html/GBufferedInputStream.html index fbce634..2948769 100644 --- a/docs/reference/gio/html/GBufferedInputStream.html +++ b/docs/reference/gio/html/GBufferedInputStream.html @@ -3,12 +3,12 @@ GBufferedInputStream - + - + @@ -47,42 +47,42 @@
GBufferedInputStream; GInputStream* g_buffered_input_stream_new (GInputStream *base_stream); GInputStream* g_buffered_input_stream_new_sized (GInputStream *base_stream, - gsize size); -gsizeg_buffered_input_stream_get_buffer_size + gsize size); +gsizeg_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream); voidg_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream, - gsize size); -gsizeg_buffered_input_stream_get_available + gsize size); +gsizeg_buffered_input_stream_get_available (GBufferedInputStream *stream); const void* g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream, - gsize *count); -gsizeg_buffered_input_stream_peek (GBufferedInputStream *stream, + gsize *count); +gsizeg_buffered_input_stream_peek (GBufferedInputStream *stream, void *buffer, - gsize offset, - gsize count); -gssizeg_buffered_input_stream_fill (GBufferedInputStream *stream, - gssize count, + gsize offset, + gsize count); +gssizeg_buffered_input_stream_fill (GBufferedInputStream *stream, + gssize count, GCancellable *cancellable, - GError **error); + GError **error); voidg_buffered_input_stream_fill_async (GBufferedInputStream *stream, - gssize count, + gssize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gssizeg_buffered_input_stream_fill_finish (GBufferedInputStream *stream, + gpointer user_data); +gssizeg_buffered_input_stream_fill_finish (GBufferedInputStream *stream, GAsyncResult *result, - GError **error); + GError **error); intg_buffered_input_stream_read_byte (GBufferedInputStream *stream, GCancellable *cancellable, - GError **error); + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GFilterInputStream
                +----GBufferedInputStream
@@ -92,28 +92,28 @@ const void*         
 

Properties

-  "buffer-size"              guint                 : Read / Write / Construct
+  "buffer-size"              guint                 : Read / Write / Construct
 

Description

-Buffered input stream implements GFilterInputStream and provides -for buffered reads. +Buffered input stream implements GFilterInputStream and provides +for buffered reads.

By default, GBufferedInputStream's buffer size is set at 4 kilobytes.

-To create a buffered input stream, use g_buffered_input_stream_new(), -or g_buffered_input_stream_new_sized() to specify the buffer's size at +To create a buffered input stream, use g_buffered_input_stream_new(), +or g_buffered_input_stream_new_sized() to specify the buffer's size at construction.

-To get the size of a buffer within a buffered input stream, use -g_buffered_input_stream_get_buffer_size(). To change the size of a +To get the size of a buffer within a buffered input stream, use +g_buffered_input_stream_get_buffer_size(). To change the size of a buffered input stream's buffer, use -g_buffered_input_stream_set_buffer_size(). Note that the buffer's size +g_buffered_input_stream_set_buffer_size(). Note that the buffer's size cannot be reduced below the size of the data within the buffer.

@@ -131,7 +131,7 @@ Implements

g_buffered_input_stream_new ()

GInputStream*       g_buffered_input_stream_new         (GInputStream *base_stream);

-Creates a new GInputStream from the given base_stream, with +Creates a new GInputStream from the given base_stream, with a buffer set to the default size (4 kilobytes).

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a newly created GObject, or NULL on error. Free with - g_object_unref(). - + a newly created GObject, or NULL on error. Free with + g_object_unref(). [transfer full]

object_type :

a GType supporting GAsyncInitable. +a GType supporting GAsyncInitable.

first_property_name :

the name of the first property, followed by -the value, and other property value pairs, and ended by NULL. +the value, and other property value pairs, and ended by NULL.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

object_type :

a GType supporting GAsyncInitable. +a GType supporting GAsyncInitable.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.
the user data for res. + the user data for res. [transfer full]
a new reference to the source object for the res, - or NULL if there is none. + or NULL if there is none. [transfer full]
@@ -139,7 +139,7 @@ a buffer set to the default size (4 kilobytes). - @@ -154,9 +154,9 @@ a buffer set to the default size (4 kilobytes).

g_buffered_input_stream_new_sized ()

GInputStream*       g_buffered_input_stream_new_sized   (GInputStream *base_stream,
-                                                         gsize size);
+ gsize size);

-Creates a new GBufferedInputStream from the given base_stream, +Creates a new GBufferedInputStream from the given base_stream, with a buffer set to size.

base_stream :

a GInputStream. +a GInputStream
@@ -164,12 +164,12 @@ with a buffer set to size. - - @@ -183,7 +183,7 @@ with a buffer set to size.

g_buffered_input_stream_get_buffer_size ()

-
gsize               g_buffered_input_stream_get_buffer_size
+
gsize               g_buffered_input_stream_get_buffer_size
                                                         (GBufferedInputStream *stream);

Gets the size of the input buffer. @@ -193,8 +193,7 @@ Gets the size of the input buffer.

- @@ -210,10 +209,10 @@ Gets the size of the input buffer.

g_buffered_input_stream_set_buffer_size ()

void                g_buffered_input_stream_set_buffer_size
                                                         (GBufferedInputStream *stream,
-                                                         gsize size);
+ gsize size);

-Sets the size of the internal buffer of stream to size, or to the -size of the contents of the buffer. The buffer can never be resized +Sets the size of the internal buffer of stream to size, or to the +size of the contents of the buffer. The buffer can never be resized smaller than its current contents.

base_stream :

a GInputStream. +a GInputStream

size :

a gsize. +a gsize

stream :

-GBufferedInputStream. +a GBufferedInputStream
@@ -221,13 +220,12 @@ smaller than its current contents. - - @@ -236,7 +234,7 @@ smaller than its current contents.

g_buffered_input_stream_get_available ()

-
gsize               g_buffered_input_stream_get_available
+
gsize               g_buffered_input_stream_get_available
                                                         (GBufferedInputStream *stream);

Gets the size of the available data within the stream. @@ -247,12 +245,12 @@ Gets the size of the available data within the stream.

- @@ -262,7 +260,7 @@ Gets the size of the available data within the stream.

g_buffered_input_stream_peek_buffer ()

const void*         g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream,
-                                                         gsize *count);
+ gsize *count);

Returns the buffer with the currently available bytes. The returned buffer must not be modified and will become invalid when reading from @@ -273,12 +271,12 @@ the stream or filling the buffer.

- - @@ -292,12 +290,12 @@ the stream or filling the buffer.

g_buffered_input_stream_peek ()

-
gsize               g_buffered_input_stream_peek        (GBufferedInputStream *stream,
+
gsize               g_buffered_input_stream_peek        (GBufferedInputStream *stream,
                                                          void *buffer,
-                                                         gsize offset,
-                                                         gsize count);
+ gsize offset, + gsize count);

-Peeks in the buffer, copying data of size count into buffer, +Peeks in the buffer, copying data of size count into buffer, offset offset bytes.

stream :

-GBufferedInputStream. +a GBufferedInputStream

size :

a gsize. +a gsize

stream :

-GBufferedInputStream. +GBufferedInputStream

Returns :

size of the available stream. + size of the available stream.

stream :

a GBufferedInputStream. +a GBufferedInputStream

count :

a gsize to get the number of bytes available in the buffer. +a gsize to get the number of bytes available in the buffer
@@ -305,27 +303,27 @@ offset offset bytes. - - - - - @@ -334,17 +332,17 @@ offset offset bytes.

g_buffered_input_stream_fill ()

-
gssize              g_buffered_input_stream_fill        (GBufferedInputStream *stream,
-                                                         gssize count,
+
gssize              g_buffered_input_stream_fill        (GBufferedInputStream *stream,
+                                                         gssize count,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

-Tries to read count bytes from the stream into the buffer. +Tries to read count bytes from the stream into the buffer. Will block during this read.

If count is zero, returns zero and does nothing. A value of count -larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. +larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error.

On success, the number of bytes read into the buffer is returned. @@ -357,7 +355,7 @@ If count is -1 then the attempted read s bytes that are required to fill the buffer.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the @@ -367,7 +365,7 @@ partial result will be returned, without an error. On error -1 is returned and error is set accordingly.

-For the asynchronous, non-blocking, version of this function, see +For the asynchronous, non-blocking, version of this function, see g_buffered_input_stream_fill_async().

stream :

a GBufferedInputStream. +a GBufferedInputStream

buffer :

a pointer to an allocated chunk of memory. +a pointer to an allocated chunk of memory

offset :

a gsize. +a gsize

count :

a gsize. +a gsize

Returns :

a gsize of the number of bytes peeked, or -1 on error. + a gsize of the number of bytes peeked, or -1 on error.
@@ -375,28 +373,27 @@ For the asynchronous, non-blocking, version of this function, see - - - - - @@ -407,11 +404,11 @@ For the asynchronous, non-blocking, version of this function, see

g_buffered_input_stream_fill_async ()

void                g_buffered_input_stream_fill_async  (GBufferedInputStream *stream,
-                                                         gssize count,
+                                                         gssize count,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Reads data into stream's buffer asynchronously, up to count size. io_priority can be used to prioritize reads. For the synchronous @@ -426,19 +423,18 @@ of bytes that are required to fill the buffer.

- - - @@ -448,12 +444,12 @@ of bytes that are required to fill the buffer. - - @@ -462,9 +458,9 @@ of bytes that are required to fill the buffer.

g_buffered_input_stream_fill_finish ()

-
gssize              g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
+
gssize              g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous read.

@@ -473,22 +469,22 @@ Finishes an asynchronous read.
- - - - @@ -499,7 +495,7 @@ Finishes an asynchronous read.

g_buffered_input_stream_read_byte ()

int                 g_buffered_input_stream_read_byte   (GBufferedInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to read a single byte from the stream or the buffer. Will block during this read. @@ -509,7 +505,7 @@ On success, the byte read from the stream is returned. On end of stream -1 is returned but it's not an exceptional error and error is not set.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the @@ -523,18 +519,17 @@ On error -1 is returned and error is set

- - - @@ -550,7 +545,7 @@ On error -1 is returned and error is set

Property Details

The "buffer-size" property

-
  "buffer-size"              guint                 : Read / Write / Construct
+
  "buffer-size"              guint                 : Read / Write / Construct

The size of the backend buffer.

Allowed values: >= 1

Default value: 4096

@@ -563,6 +558,6 @@ On error -1 is returned and error is set
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GBufferedOutputStream.html b/docs/reference/gio/html/GBufferedOutputStream.html index 212341d..3f03db4 100644 --- a/docs/reference/gio/html/GBufferedOutputStream.html +++ b/docs/reference/gio/html/GBufferedOutputStream.html @@ -3,12 +3,12 @@ GBufferedOutputStream - + - + @@ -47,23 +47,23 @@ GBufferedOutputStream; GOutputStream* g_buffered_output_stream_new (GOutputStream *base_stream); GOutputStream* g_buffered_output_stream_new_sized (GOutputStream *base_stream, - gsize size); -gsizeg_buffered_output_stream_get_buffer_size + gsize size); +gsizeg_buffered_output_stream_get_buffer_size (GBufferedOutputStream *stream); voidg_buffered_output_stream_set_buffer_size (GBufferedOutputStream *stream, - gsize size); -gbooleang_buffered_output_stream_get_auto_grow + gsize size); +gbooleang_buffered_output_stream_get_auto_grow (GBufferedOutputStream *stream); voidg_buffered_output_stream_set_auto_grow (GBufferedOutputStream *stream, - gboolean auto_grow); + gboolean auto_grow);

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GFilterOutputStream
                +----GBufferedOutputStream
@@ -72,8 +72,8 @@
 

Properties

-  "auto-grow"                gboolean              : Read / Write
-  "buffer-size"              guint                 : Read / Write / Construct
+  "auto-grow"                gboolean              : Read / Write
+  "buffer-size"              guint                 : Read / Write / Construct
 
@@ -106,10 +106,6 @@ size cannot be reduced below the size of the data within the buffer.

An implementation of GFilterOutputStream with a sized buffer.

-

stream :

-GBufferedInputStream. +a GBufferedInputStream

count :

the number of bytes that will be read from the stream. +the number of bytes that will be read from the stream

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore

error :

location to store the error occuring, or NULL to ignore. +location to store the error occuring, or NULL to ignore

Returns :

the number of bytes read into stream's buffer, up to count, + the number of bytes read into stream's buffer, up to count, or -1 on error.

stream :

-GBufferedInputStream. +a GBufferedInputStream

count :

the number of bytes that will be read from the stream. +the number of bytes that will be read from the stream

io_priority :

the I/O priority - of the request. +the I/O priority + of the request

callback :

a GAsyncReadyCallback. +a GAsyncReadyCallback

user_data :

a gpointer. +a gpointer

stream :

a GBufferedInputStream. +a GBufferedInputStream

result :

a GAsyncResult. +a GAsyncResult

error :

a GError. +a GError

Returns :

a gssize of the read stream, or -1 on an error. + a gssize of the read stream, or -1 on an error.

stream :

-GBufferedInputStream. +a GBufferedInputStream

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore

error :

location to store the error occuring, or NULL to ignore. +location to store the error occuring, or NULL to ignore
-- -

@@ -138,7 +134,7 @@ Creates a new buffered output stream for a base stream.

g_buffered_output_stream_new_sized ()

GOutputStream*      g_buffered_output_stream_new_sized  (GOutputStream *base_stream,
-                                                         gsize size);
+ gsize size);

Creates a new buffered output stream with a given buffer size.

@@ -152,7 +148,7 @@ Creates a new buffered output stream with a given buffer size.

size :

-a gsize. +a gsize. @@ -166,7 +162,7 @@ Creates a new buffered output stream with a given buffer size.

g_buffered_output_stream_get_buffer_size ()

-
gsize               g_buffered_output_stream_get_buffer_size
+
gsize               g_buffered_output_stream_get_buffer_size
                                                         (GBufferedOutputStream *stream);

Gets the size of the buffer in the stream. @@ -192,7 +188,7 @@ Gets the size of the buffer in the stream

g_buffered_output_stream_set_buffer_size ()

void                g_buffered_output_stream_set_buffer_size
                                                         (GBufferedOutputStream *stream,
-                                                         gsize size);
+ gsize size);

Sets the size of the internal buffer to size.

@@ -206,7 +202,7 @@ Sets the size of the internal buffer to size<

size :

-a gsize. +a gsize. @@ -215,7 +211,7 @@ Sets the size of the internal buffer to size<

g_buffered_output_stream_get_auto_grow ()

-
gboolean            g_buffered_output_stream_get_auto_grow
+
gboolean            g_buffered_output_stream_get_auto_grow
                                                         (GBufferedOutputStream *stream);

Checks if the buffer automatically grows as data is added. @@ -230,8 +226,8 @@ Checks if the buffer automatically grows as data is added.

Returns :

- TRUE if the stream's buffer automatically grows, -FALSE otherwise. + TRUE if the stream's buffer automatically grows, +FALSE otherwise. @@ -242,7 +238,7 @@ Checks if the buffer automatically grows as data is added.

g_buffered_output_stream_set_auto_grow ()

void                g_buffered_output_stream_set_auto_grow
                                                         (GBufferedOutputStream *stream,
-                                                         gboolean auto_grow);
+ gboolean auto_grow);

Sets whether or not the stream's buffer should automatically grow. If auto_grow is true, then each write will just make the buffer @@ -259,7 +255,7 @@ the data to the underlying stream.

auto_grow :

-a gboolean. +a gboolean. @@ -270,14 +266,14 @@ the data to the underlying stream.

Property Details

The "auto-grow" property

-
  "auto-grow"                gboolean              : Read / Write
+
  "auto-grow"                gboolean              : Read / Write

Whether the buffer should automatically grow.

Default value: FALSE


The "buffer-size" property

-
  "buffer-size"              guint                 : Read / Write / Construct
+
  "buffer-size"              guint                 : Read / Write / Construct

The size of the backend buffer.

Allowed values: >= 1

Default value: 4096

@@ -290,6 +286,6 @@ the data to the underlying stream.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GCancellable.html b/docs/reference/gio/html/GCancellable.html index 8e21d8c..7e662d7 100644 --- a/docs/reference/gio/html/GCancellable.html +++ b/docs/reference/gio/html/GCancellable.html @@ -3,12 +3,12 @@ GCancellable - + - + @@ -46,31 +46,34 @@ GCancellable; GCancellable * g_cancellable_new (void); -gboolean g_cancellable_is_cancelled (GCancellable *cancellable); -gboolean g_cancellable_set_error_if_cancelled +gboolean g_cancellable_is_cancelled (GCancellable *cancellable); +gboolean g_cancellable_set_error_if_cancelled (GCancellable *cancellable, - GError **error); + GError **error); int g_cancellable_get_fd (GCancellable *cancellable); -gboolean g_cancellable_make_pollfd (GCancellable *cancellable, - GPollFD *pollfd); +gboolean g_cancellable_make_pollfd (GCancellable *cancellable, + GPollFD *pollfd); void g_cancellable_release_fd (GCancellable *cancellable); +GSource * g_cancellable_source_new (GCancellable *cancellable); +gboolean (*GCancellableSourceFunc) (GCancellable *cancellable, + gpointer user_data); GCancellable * g_cancellable_get_current (void); void g_cancellable_pop_current (GCancellable *cancellable); void g_cancellable_push_current (GCancellable *cancellable); void g_cancellable_reset (GCancellable *cancellable); -gulong g_cancellable_connect (GCancellable *cancellable, - GCallback callback, - gpointer data, - GDestroyNotify data_destroy_func); +gulong g_cancellable_connect (GCancellable *cancellable, + GCallback callback, + gpointer data, + GDestroyNotify data_destroy_func); void g_cancellable_disconnect (GCancellable *cancellable, - gulong handler_id); + gulong handler_id); void g_cancellable_cancel (GCancellable *cancellable);

Object Hierarchy

-  GObject
+  GObject
    +----GCancellable
 
@@ -125,7 +128,7 @@ operations, but not in multiple concurrent operations.

g_cancellable_is_cancelled ()

-
gboolean            g_cancellable_is_cancelled          (GCancellable *cancellable);
+
gboolean            g_cancellable_is_cancelled          (GCancellable *cancellable);

Checks if a cancellable job has been cancelled.

@@ -139,8 +142,8 @@ Checks if a cancellable job has been cancelled.

Returns :

- TRUE if cancellable is cancelled, -FALSE if called with NULL or if item is not cancelled. + TRUE if cancellable is cancelled, +FALSE if called with NULL or if item is not cancelled. @@ -149,9 +152,9 @@ FALSE if called with

g_cancellable_set_error_if_cancelled ()

-
gboolean            g_cancellable_set_error_if_cancelled
+
gboolean            g_cancellable_set_error_if_cancelled
                                                         (GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

If the cancellable is cancelled, sets the error to notify that the operation was cancelled. @@ -167,12 +170,12 @@ that the operation was cancelled.

error :

-GError to append error state to. +GError to append error state to.

Returns :

- TRUE if cancellable was cancelled, FALSE if it was not. + TRUE if cancellable was cancelled, FALSE if it was not. @@ -220,21 +223,21 @@ is not supported, or on errors.

g_cancellable_make_pollfd ()

-
gboolean            g_cancellable_make_pollfd           (GCancellable *cancellable,
-                                                         GPollFD *pollfd);
+
gboolean            g_cancellable_make_pollfd           (GCancellable *cancellable,
+                                                         GPollFD *pollfd);

-Creates a GPollFD corresponding to cancellable; this can be passed -to g_poll() and used to poll for cancellation. This is useful both +Creates a GPollFD corresponding to cancellable; this can be passed +to g_poll() and used to poll for cancellation. This is useful both for unix systems without a native poll and for portability to windows.

-When this function returns TRUE, you should use +When this function returns TRUE, you should use g_cancellable_release_fd() to free up resources allocated for the -pollfd. After a FALSE return, do not call g_cancellable_release_fd(). +pollfd. After a FALSE return, do not call g_cancellable_release_fd().

-If this function returns FALSE, either no cancellable was given or +If this function returns FALSE, either no cancellable was given or resource limits prevent this function from allocating the necessary structures for polling. (On Linux, you will likely have reached the maximum number of file descriptors.) The suggested way to handle @@ -250,17 +253,17 @@ with cancellable :

-a GCancellable or NULL +a GCancellable or NULL

pollfd :

-a pointer to a GPollFD +a pointer to a GPollFD

Returns :

- TRUE if pollfd was successfully initialized, FALSE on + TRUE if pollfd was successfully initialized, FALSE on failure to prepare the cancellable. @@ -296,6 +299,70 @@ descriptors when many GCancellabl

Since 2.22


+
+

g_cancellable_source_new ()

+
GSource *           g_cancellable_source_new            (GCancellable *cancellable);
+

+Creates a source that triggers if cancellable is cancelled and +calls its callback of type GCancellableSourceFunc. This is +primarily useful for attaching to another (non-cancellable) source +with g_source_add_child_source() to add cancellability to it. +

+

+For convenience, you can call this with a NULL GCancellable, +in which case the source will never trigger. +

+
++ + + + + + + + + + +

cancellable :

a GCancellable, or NULL +

Returns :

the new GSource. + +
+

Since 2.28

+
+
+
+

GCancellableSourceFunc ()

+
gboolean            (*GCancellableSourceFunc)           (GCancellable *cancellable,
+                                                         gpointer user_data);
+

+This is the function type of the callback used for the GSource +returned by g_cancellable_source_new(). +

+
++ + + + + + + + + + + + + + +

cancellable :

the GCancellable +

user_data :

data passed in by the user. +

Returns :

it should return FALSE if the source should be removed. + +
+

Since 2.28

+
+

g_cancellable_get_current ()

GCancellable *      g_cancellable_get_current           (void);
@@ -306,8 +373,8 @@ Gets the top cancellable from the stack.

Returns :

- a GCancellable from the top of the stack, or NULL -if the stack is empty. + a GCancellable from the top of the stack, or NULL +if the stack is empty. [transfer none]
@@ -373,10 +440,10 @@ Resets cancellable to its uncancelled st

g_cancellable_connect ()

-
gulong              g_cancellable_connect               (GCancellable *cancellable,
-                                                         GCallback callback,
-                                                         gpointer data,
-                                                         GDestroyNotify data_destroy_func);
+
gulong              g_cancellable_connect               (GCancellable *cancellable,
+                                                         GCallback callback,
+                                                         gpointer data,
+                                                         GDestroyNotify data_destroy_func);

Convenience function to connect to the "cancelled" signal. Also handles the race condition that may happen @@ -405,7 +472,7 @@ See

data_destroy_func :

-Free function for data or NULL. +Free function for data or NULL. @@ -433,10 +500,10 @@ See "cancelled" signal handler will therefore result in a @@ -449,7 +516,7 @@ signal handler is removed. See cancellable
is NULL or handler_id is 0 this function does +If cancellable is NULL or handler_id is 0 this function does nothing.

@@ -457,7 +524,7 @@ nothing. - @@ -506,7 +573,7 @@ the application returns to the main loop.

The "cancelled" signal

void                user_function                      (GCancellable *cancellable,
-                                                        gpointer      user_data)        : Run Last
+ gpointer user_data) : Run Last

Emitted when the operation has been cancelled.

@@ -521,7 +588,7 @@ Note that disconnecting from this signal (or any signal) in a multi-threaded program is prone to race conditions. For instance it is possible that a signal handler may be invoked even after a call to -g_signal_handler_disconnect() for that handler has already +g_signal_handler_disconnect() for that handler has already returned.

@@ -574,8 +641,8 @@ An example of how to us this: id = 0; if (cancellable) id = g_cancellable_connect (cancellable, - G_CALLBACK (cancelled_handler) - data, NULL); + G_CALLBACK (cancelled_handler) + data, NULL); /* cancellable operation here... */ @@ -615,6 +682,6 @@ cancellable signal should not do something that can block.

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GCharsetConverter.html b/docs/reference/gio/html/GCharsetConverter.html index 2d40a11..e660bc7 100644 --- a/docs/reference/gio/html/GCharsetConverter.html +++ b/docs/reference/gio/html/GCharsetConverter.html @@ -3,12 +3,12 @@ GCharsetConverter - + - + @@ -47,22 +47,22 @@ #include <gio/gio.h> GCharsetConverter; -GCharsetConverter * g_charset_converter_new (const gchar *to_charset, - const gchar *from_charset, - GError **error); +GCharsetConverter * g_charset_converter_new (const gchar *to_charset, + const gchar *from_charset, + GError **error); voidg_charset_converter_set_use_fallback (GCharsetConverter *converter, - gboolean use_fallback); -gbooleang_charset_converter_get_use_fallback + gboolean use_fallback); +gbooleang_charset_converter_get_use_fallback (GCharsetConverter *converter); -guintg_charset_converter_get_num_fallbacks +guintg_charset_converter_get_num_fallbacks (GCharsetConverter *converter);

Object Hierarchy

-  GObject
+  GObject
    +----GCharsetConverter
 
@@ -75,9 +75,9 @@ GCharsetConverter implements

Properties

-  "from-charset"             gchar*                : Read / Write / Construct Only
-  "to-charset"               gchar*                : Read / Write / Construct Only
-  "use-fallback"             gboolean              : Read / Write / Construct
+  "from-charset"             gchar*                : Read / Write / Construct Only
+  "to-charset"               gchar*                : Read / Write / Construct Only
+  "use-fallback"             gboolean              : Read / Write / Construct
 
@@ -99,9 +99,9 @@ Conversions between character sets.

g_charset_converter_new ()

-
GCharsetConverter * g_charset_converter_new             (const gchar *to_charset,
-                                                         const gchar *from_charset,
-                                                         GError **error);
+
GCharsetConverter * g_charset_converter_new             (const gchar *to_charset,
+                                                         const gchar *from_charset,
+                                                         GError **error);

Creates a new GCharsetConverter.

@@ -121,12 +121,12 @@ Creates a new error :

- @@ -139,7 +139,7 @@ Creates a new

g_charset_converter_set_use_fallback ()

void                g_charset_converter_set_use_fallback
                                                         (GCharsetConverter *converter,
-                                                         gboolean use_fallback);
+ gboolean use_fallback);

Sets the "use-fallback" property.

@@ -154,7 +154,7 @@ Sets the use_fallback :

@@ -164,7 +164,7 @@ Sets the

g_charset_converter_get_use_fallback ()

-
gboolean            g_charset_converter_get_use_fallback
+
gboolean            g_charset_converter_get_use_fallback
                                                         (GCharsetConverter *converter);

Gets the "use-fallback" property. @@ -179,7 +179,7 @@ Gets the Returns :

-
@@ -190,7 +190,7 @@ Gets the

g_charset_converter_get_num_fallbacks ()

-
guint               g_charset_converter_get_num_fallbacks
+
guint               g_charset_converter_get_num_fallbacks
                                                         (GCharsetConverter *converter);

Gets the number of fallbacks that converter has applied so far. @@ -218,21 +218,21 @@ Gets the number of fallbacks that converter

Property Details

The "from-charset" property

-
  "from-charset"             gchar*                : Read / Write / Construct Only
+
  "from-charset"             gchar*                : Read / Write / Construct Only

The character encoding to convert from.

Default value: NULL


The "to-charset" property

-
  "to-charset"               gchar*                : Read / Write / Construct Only
+
  "to-charset"               gchar*                : Read / Write / Construct Only

The character encoding to convert to.

Default value: NULL


The "use-fallback" property

-
  "use-fallback"             gboolean              : Read / Write / Construct
+
  "use-fallback"             gboolean              : Read / Write / Construct

Use fallback (of form \<hexval>) for invalid bytes.

Default value: FALSE

@@ -240,6 +240,6 @@ Gets the number of fallbacks that converter + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GConverter.html b/docs/reference/gio/html/GConverter.html index 8395f87..6551402 100644 --- a/docs/reference/gio/html/GConverter.html +++ b/docs/reference/gio/html/GConverter.html @@ -3,12 +3,12 @@ GConverter - + - + @@ -49,15 +49,16 @@ GConverter; GConverterIface; enum GConverterResult; +enum GConverterFlags; GConverterResult g_converter_convert (GConverter *converter, const void *inbuf, - gsize inbuf_size, + gsize inbuf_size, void *outbuf, - gsize outbuf_size, - GConverterFlags flags, - gsize *bytes_read, - gsize *bytes_written, - GError **error); + gsize outbuf_size, + GConverterFlags flags, + gsize *bytes_read, + gsize *bytes_written, + GError **error); void g_converter_reset (GConverter *converter);
@@ -72,7 +73,7 @@ enum

Prerequisites

GConverter requires - GObject.

+ GObject.

Known Implementations

@@ -132,7 +133,7 @@ and may fail at any place.
- + @@ -191,17 +192,51 @@ Results returned from Since 2.24


+
+

enum GConverterFlags

+
typedef enum {
+  G_CONVERTER_NO_FLAGS     = 0,         /*< nick=none >*/
+  G_CONVERTER_INPUT_AT_END = (1 << 0),  /*< nick=input-at-end >*/
+  G_CONVERTER_FLUSH        = (1 << 1)   /*< nick=flush >*/
+} GConverterFlags;
+
+

+Flags used when calling a g_converter_convert(). +

+

cancellable :

A GCancellable or NULL. +A GCancellable or NULL.
-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

a new GCharsetConverter or NULL on error. + a new GCharsetConverter or NULL on error.
-TRUE to use fallbacks +TRUE to use fallbacks
TRUE if fallbacks are used by converter + TRUE if fallbacks are used by converter

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.
++ + + + + + + + + + + + + + +

G_CONVERTER_NO_FLAGS

No flags. +

G_CONVERTER_INPUT_AT_END

At end of input data +

G_CONVERTER_FLUSH

Flush data +
+

Since 2.24

+
+

g_converter_convert ()

GConverterResult    g_converter_convert                 (GConverter *converter,
                                                          const void *inbuf,
-                                                         gsize inbuf_size,
+                                                         gsize inbuf_size,
                                                          void *outbuf,
-                                                         gsize outbuf_size,
-                                                         GConverterFlags flags,
-                                                         gsize *bytes_read,
-                                                         gsize *bytes_written,
-                                                         GError **error);
+ gsize outbuf_size, + GConverterFlags flags, + gsize *bytes_read, + gsize *bytes_written, + GError **error);

This is the main operation used when converting data. It is to be called multiple times in a loop, and each time it will do some work, i.e. @@ -221,11 +256,11 @@ next call.

A full conversion loop involves calling this method repeatedly, each time giving it new input and space output space. When there is no more input -data after the data in inbuf, the flag G_CONVERTER_INPUT_AT_END must be set. +data after the data in inbuf, the flag G_CONVERTER_INPUT_AT_END must be set. The loop will be (unless some error happens) returning G_CONVERTER_CONVERTED each time until all data is consumed and all output is produced, then G_CONVERTER_FINISHED is returned instead. Note, that G_CONVERTER_FINISHED -may be returned even if G_CONVERTER_INPUT_AT_END is not set, for instance +may be returned even if G_CONVERTER_INPUT_AT_END is not set, for instance in a decompression converter where the end of data is detectable from the data (and there might even be other data after the end of the compressed data).

@@ -249,7 +284,7 @@ call the function again with a larger outbuf<

G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough input to fully determine what the conversion should produce, -and the G_CONVERTER_INPUT_AT_END flag is not set. This happens for +and the G_CONVERTER_INPUT_AT_END flag is not set. This happens for example with an incomplete multibyte sequence when converting text, or when a regexp matches up to the end of the input (and may match further input). It may also happen when inbuf_size is zero and @@ -259,7 +294,7 @@ there is no more data to produce. When this happens the application should read more input and then call the function again. If further input shows that there is no more data call the function again with the same data but with -the G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion +the G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion to finish as e.g. in the regexp match case (or, to fail again with G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the input is actually partial). @@ -272,7 +307,7 @@ free the object or call

-If the flag G_CONVERTER_FLUSH is set then conversion is modified +If the flag G_CONVERTER_FLUSH is set then conversion is modified to try to write out all internal state to the output. The application has to call the function multiple times with the flag set, and when the availible input has been consumed and all internal state has @@ -343,7 +378,7 @@ to produce as much output as possible and then return an error

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore @@ -383,6 +418,6 @@ state that would produce output then that output is lost.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GCredentials.html b/docs/reference/gio/html/GCredentials.html new file mode 100644 index 0000000..bf056fb --- /dev/null +++ b/docs/reference/gio/html/GCredentials.html @@ -0,0 +1,398 @@ + + + + +GCredentials + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GCredentials

+

GCredentials — An object containing credentials

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GCredentials;
+enum                GCredentialsType;
+GCredentials *      g_credentials_new                   (void);
+gchar *             g_credentials_to_string             (GCredentials *credentials);
+gpointer            g_credentials_get_native            (GCredentials *credentials,
+                                                         GCredentialsType native_type);
+void                g_credentials_set_native            (GCredentials *credentials,
+                                                         GCredentialsType native_type,
+                                                         gpointer native);
+gboolean            g_credentials_is_same_user          (GCredentials *credentials,
+                                                         GCredentials *other_credentials,
+                                                         GError **error);
+uid_t               g_credentials_get_unix_user         (GCredentials *credentials,
+                                                         GError **error);
+gboolean            g_credentials_set_unix_user         (GCredentials *credentials,
+                                                         uid_t uid,
+                                                         GError **error);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GCredentials
+
+
+
+

Description

+

+The GCredentials type is a reference-counted wrapper for native +credentials. This information is typically used for identifying, +authenticating and authorizing other processes. +

+

+Some operating systems supports looking up the credentials of the +remote peer of a communication endpoint - see e.g. +g_socket_get_credentials(). +

+

+Some operating systems supports securely sending and receiving +credentials over a Unix Domain Socket, see +GUnixCredentialsMessage, g_unix_connection_send_credentials() and +g_unix_connection_receive_credentials() for details. +

+

+On Linux, the native credential type is a struct ucred +- see the +unix(7) +man page for details. This corresponds to +G_CREDENTIALS_TYPE_LINUX_UCRED. +

+

+On FreeBSD, the native credential type is a struct cmsgcred. +This corresponds to G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED. +

+
+
+

Details

+
+

GCredentials

+
typedef struct _GCredentials GCredentials;
+

+The GCredentials structure contains only private data and +should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

enum GCredentialsType

+
typedef enum
+{
+  G_CREDENTIALS_TYPE_INVALID,
+  G_CREDENTIALS_TYPE_LINUX_UCRED,
+  G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED
+} GCredentialsType;
+
+

+Enumeration describing different kinds of native credential types. +

+
++ + + + + + + + + + + + + + +

G_CREDENTIALS_TYPE_INVALID

Indicates an invalid native credential type. +

G_CREDENTIALS_TYPE_LINUX_UCRED

The native credentials type is a struct ucred. +

G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED

The native credentials type is a struct cmsgcred. +
+

Since 2.26

+
+
+
+

g_credentials_new ()

+
GCredentials *      g_credentials_new                   (void);
+

+Creates a new GCredentials object with credentials matching the +the current process. +

+
++ + + + +

Returns :

A GCredentials. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_credentials_to_string ()

+
gchar *             g_credentials_to_string             (GCredentials *credentials);
+

+Creates a human-readable textual representation of credentials +that can be used in logging and debug messages. The format of the +returned string may change in future GLib release. +

+
++ + + + + + + + + + +

credentials :

A GCredentials object. +

Returns :

A string that should be freed with g_free(). + +
+

Since 2.26

+
+
+
+

g_credentials_get_native ()

+
gpointer            g_credentials_get_native            (GCredentials *credentials,
+                                                         GCredentialsType native_type);
+

+Gets a pointer to native credentials of type native_type from +credentials. +

+

+It is a programming error (which will cause an warning to be +logged) to use this method if there is no GCredentials support for +the OS or if native_type isn't supported by the OS. +

+
++ + + + + + + + + + + + + + +

credentials :

A GCredentials. +

native_type :

The type of native credentials to get. +

Returns :

The pointer to native credentials or NULL if the +operation there is no GCredentials support for the OS or if +native_type isn't supported by the OS. Do not free the returned +data, it is owned by credentials. + +
+

Since 2.26

+
+
+
+

g_credentials_set_native ()

+
void                g_credentials_set_native            (GCredentials *credentials,
+                                                         GCredentialsType native_type,
+                                                         gpointer native);
+

+Copies the native credentials of type native_type from native +into credentials. +

+

+It is a programming error (which will cause an warning to be +logged) to use this method if there is no GCredentials support for +the OS or if native_type isn't supported by the OS. +

+
++ + + + + + + + + + + + + + +

credentials :

A GCredentials. +

native_type :

The type of native credentials to set. +

native :

A pointer to native credentials. +
+

Since 2.26

+
+
+
+

g_credentials_is_same_user ()

+
gboolean            g_credentials_is_same_user          (GCredentials *credentials,
+                                                         GCredentials *other_credentials,
+                                                         GError **error);
+

+Checks if credentials and other_credentials is the same user. +

+

+This operation can fail if GCredentials is not supported on the +the OS. +

+
++ + + + + + + + + + + + + + + + + + +

credentials :

A GCredentials. +

other_credentials :

A GCredentials. +

error :

Return location for error or NULL. +

Returns :

TRUE if credentials and other_credentials has the same +user, FALSE otherwise or if error is set. + +
+

Since 2.26

+
+
+
+

g_credentials_get_unix_user ()

+
uid_t               g_credentials_get_unix_user         (GCredentials *credentials,
+                                                         GError **error);
+

+Tries to get the UNIX user identifier from credentials. This +method is only available on UNIX platforms. +

+

+This operation can fail if GCredentials is not supported on the +OS or if the native credentials type does not contain information +about the UNIX user. +

+
++ + + + + + + + + + + + + + +

credentials :

A GCredentials +

error :

Return location for error or NULL. +

Returns :

The UNIX user identifier or -1 if error is set. + +
+

Since 2.26

+
+
+
+

g_credentials_set_unix_user ()

+
gboolean            g_credentials_set_unix_user         (GCredentials *credentials,
+                                                         uid_t uid,
+                                                         GError **error);
+

+Tries to set the UNIX user identifier on credentials. This method +is only available on UNIX platforms. +

+

+This operation can fail if GCredentials is not supported on the +OS or if the native credentials type does not contain information +about the UNIX user. +

+
++ + + + + + + + + + + + + + + + + + +

credentials :

A GCredentials. +

uid :

The UNIX user identifier to set. +

error :

Return location for error or NULL. +

Returns :

TRUE if uid was set, FALSE if error is set. + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDBusAuthObserver.html b/docs/reference/gio/html/GDBusAuthObserver.html new file mode 100644 index 0000000..3a3eed9 --- /dev/null +++ b/docs/reference/gio/html/GDBusAuthObserver.html @@ -0,0 +1,254 @@ + + + + +GDBusAuthObserver + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusAuthObserver

+

GDBusAuthObserver — Object used for authenticating connections

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GDBusAuthObserver;
+GDBusAuthObserver * g_dbus_auth_observer_new            (void);
+gboolean            g_dbus_auth_observer_authorize_authenticated_peer
+                                                        (GDBusAuthObserver *observer,
+                                                         GIOStream *stream,
+                                                         GCredentials *credentials);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GDBusAuthObserver
+
+
+
+

Signals

+
+  "authorize-authenticated-peer"                   : Run Last
+
+
+
+

Description

+

+The GDBusAuthObserver type provides a mechanism for participating +in how a GDBusServer (or a GDBusConnection) authenticates remote +peers. Simply instantiate a GDBusAuthObserver and connect to the +signals you are interested in. Note that new signals may be added +in the future +

+

+For example, if you only want to allow D-Bus connections from +processes owned by the same uid as the server, you would use a +signal handler like the following: +

+
+

Example 7. Controlling Authentication

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
static gboolean
+on_authorize_authenticated_peer (GDBusAuthObserver *observer,
+                                 GIOStream         *stream,
+                                 GCredentials      *credentials,
+                                 gpointer           user_data)
+{
+  gboolean authorized;
+
+  authorized = FALSE;
+  if (credentials != NULL)
+    {
+      GCredentials *own_credentials;
+      own_credentials = g_credentials_new ();
+      if (g_credentials_is_same_user (credentials, own_credentials, NULL))
+        authorized = TRUE;
+      g_object_unref (own_credentials);
+    }
+
+  return authorized;
+}
+
+ +
+


+

+
+
+

Details

+
+

GDBusAuthObserver

+
typedef struct _GDBusAuthObserver GDBusAuthObserver;
+

+The GDBusAuthObserver structure contains only private data and +should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

g_dbus_auth_observer_new ()

+
GDBusAuthObserver * g_dbus_auth_observer_new            (void);
+

+Creates a new GDBusAuthObserver object. +

+
++ + + + +

Returns :

A GDBusAuthObserver. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_auth_observer_authorize_authenticated_peer ()

+
gboolean            g_dbus_auth_observer_authorize_authenticated_peer
+                                                        (GDBusAuthObserver *observer,
+                                                         GIOStream *stream,
+                                                         GCredentials *credentials);
+

+Emits the "authorize-authenticated-peer" signal on observer. +

+
++ + + + + + + + + + + + + + + + + + +

observer :

A GDBusAuthObserver. +

stream :

A GIOStream for the GDBusConnection. +

credentials :

Credentials received from the peer or NULL. +

Returns :

TRUE if the peer is authorized, FALSE if not. + +
+

Since 2.26

+
+
+
+

Signal Details

+
+

The "authorize-authenticated-peer" signal

+
gboolean            user_function                      (GDBusAuthObserver *observer,
+                                                        GIOStream         *stream,
+                                                        GCredentials      *credentials,
+                                                        gpointer           user_data)        : Run Last
+

+Emitted to check if a peer that is successfully authenticated +is authorized. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

observer :

The GDBusAuthObserver emitting the signal. +

stream :

A GIOStream for the GDBusConnection. +

credentials :

Credentials received from the peer or NULL. +

user_data :

user data set when the signal handler was connected.

Returns :

TRUE if the peer is authorized, FALSE if not. +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDBusConnection.html b/docs/reference/gio/html/GDBusConnection.html new file mode 100644 index 0000000..fa83c88 --- /dev/null +++ b/docs/reference/gio/html/GDBusConnection.html @@ -0,0 +1,6219 @@ + + + + +GDBusConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusConnection

+

GDBusConnection — D-Bus Connections

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+enum                GBusType;
+void                g_bus_get                           (GBusType bus_type,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GDBusConnection *   g_bus_get_finish                    (GAsyncResult *res,
+                                                         GError **error);
+GDBusConnection *   g_bus_get_sync                      (GBusType bus_type,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+                    GDBusConnection;
+enum                GDBusConnectionFlags;
+void                g_dbus_connection_new               (GIOStream *stream,
+                                                         const gchar *guid,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GDBusConnection *   g_dbus_connection_new_finish        (GAsyncResult *res,
+                                                         GError **error);
+GDBusConnection *   g_dbus_connection_new_sync          (GIOStream *stream,
+                                                         const gchar *guid,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_dbus_connection_new_for_address   (const gchar *address,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GDBusConnection *   g_dbus_connection_new_for_address_finish
+                                                        (GAsyncResult *res,
+                                                         GError **error);
+GDBusConnection *   g_dbus_connection_new_for_address_sync
+                                                        (const gchar *address,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_dbus_connection_start_message_processing
+                                                        (GDBusConnection *connection);
+void                g_dbus_connection_close             (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+gboolean            g_dbus_connection_close_finish      (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+gboolean            g_dbus_connection_close_sync        (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+gboolean            g_dbus_connection_is_closed         (GDBusConnection *connection);
+void                g_dbus_connection_flush             (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+gboolean            g_dbus_connection_flush_finish      (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+gboolean            g_dbus_connection_flush_sync        (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+gboolean            g_dbus_connection_get_exit_on_close (GDBusConnection *connection);
+void                g_dbus_connection_set_exit_on_close (GDBusConnection *connection,
+                                                         gboolean exit_on_close);
+GIOStream *         g_dbus_connection_get_stream        (GDBusConnection *connection);
+const gchar *       g_dbus_connection_get_guid          (GDBusConnection *connection);
+const gchar *       g_dbus_connection_get_unique_name   (GDBusConnection *connection);
+enum                GDBusCapabilityFlags;
+GDBusCapabilityFlags  g_dbus_connection_get_capabilities
+                                                        (GDBusConnection *connection);
+GCredentials *      g_dbus_connection_get_peer_credentials
+                                                        (GDBusConnection *connection);
+enum                GDBusCallFlags;
+void                g_dbus_connection_call              (GDBusConnection *connection,
+                                                         const gchar *bus_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         const GVariantType *reply_type,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GVariant *          g_dbus_connection_call_finish       (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+GVariant *          g_dbus_connection_call_sync         (GDBusConnection *connection,
+                                                         const gchar *bus_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         const GVariantType *reply_type,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+gboolean            g_dbus_connection_emit_signal       (GDBusConnection *connection,
+                                                         const gchar *destination_bus_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *signal_name,
+                                                         GVariant *parameters,
+                                                         GError **error);
+enum                GDBusSignalFlags;
+void                (*GDBusSignalCallback)              (GDBusConnection *connection,
+                                                         const gchar *sender_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *signal_name,
+                                                         GVariant *parameters,
+                                                         gpointer user_data);
+guint               g_dbus_connection_signal_subscribe  (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *interface_name,
+                                                         const gchar *member,
+                                                         const gchar *object_path,
+                                                         const gchar *arg0,
+                                                         GDBusSignalFlags flags,
+                                                         GDBusSignalCallback callback,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+void                g_dbus_connection_signal_unsubscribe
+                                                        (GDBusConnection *connection,
+                                                         guint subscription_id);
+enum                GDBusSendMessageFlags;
+gboolean            g_dbus_connection_send_message      (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         GDBusSendMessageFlags flags,
+                                                         volatile guint32 *out_serial,
+                                                         GError **error);
+void                g_dbus_connection_send_message_with_reply
+                                                        (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         GDBusSendMessageFlags flags,
+                                                         gint timeout_msec,
+                                                         volatile guint32 *out_serial,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GDBusMessage *      g_dbus_connection_send_message_with_reply_finish
+                                                        (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+GDBusMessage *      g_dbus_connection_send_message_with_reply_sync
+                                                        (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         GDBusSendMessageFlags flags,
+                                                         gint timeout_msec,
+                                                         volatile guint32 *out_serial,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+GDBusMessage *      (*GDBusMessageFilterFunction)       (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         gboolean incoming,
+                                                         gpointer user_data);
+guint               g_dbus_connection_add_filter        (GDBusConnection *connection,
+                                                         GDBusMessageFilterFunction filter_function,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+void                g_dbus_connection_remove_filter     (GDBusConnection *connection,
+                                                         guint filter_id);
+                    GDBusInterfaceVTable;
+void                (*GDBusInterfaceMethodCallFunc)     (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         GDBusMethodInvocation *invocation,
+                                                         gpointer user_data);
+GVariant *          (*GDBusInterfaceGetPropertyFunc)    (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *property_name,
+                                                         GError **error,
+                                                         gpointer user_data);
+gboolean            (*GDBusInterfaceSetPropertyFunc)    (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *property_name,
+                                                         GVariant *value,
+                                                         GError **error,
+                                                         gpointer user_data);
+guint               g_dbus_connection_register_object   (GDBusConnection *connection,
+                                                         const gchar *object_path,
+                                                         GDBusInterfaceInfo *interface_info,
+                                                         const GDBusInterfaceVTable *vtable,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func,
+                                                         GError **error);
+gboolean            g_dbus_connection_unregister_object (GDBusConnection *connection,
+                                                         guint registration_id);
+                    GDBusSubtreeVTable;
+gchar **            (*GDBusSubtreeEnumerateFunc)        (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         gpointer user_data);
+GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc)     (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *node,
+                                                         gpointer user_data);
+const GDBusInterfaceVTable * (*GDBusSubtreeDispatchFunc)
+                                                        (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *node,
+                                                         gpointer *out_user_data,
+                                                         gpointer user_data);
+enum                GDBusSubtreeFlags;
+guint               g_dbus_connection_register_subtree  (GDBusConnection *connection,
+                                                         const gchar *object_path,
+                                                         const GDBusSubtreeVTable *vtable,
+                                                         GDBusSubtreeFlags flags,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func,
+                                                         GError **error);
+gboolean            g_dbus_connection_unregister_subtree
+                                                        (GDBusConnection *connection,
+                                                         guint registration_id);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GDBusConnection
+
+
+
+

Implemented Interfaces

+

+GDBusConnection implements + GInitable and GAsyncInitable.

+
+
+

Properties

+
+  "address"                  gchar*                : Write / Construct Only
+  "authentication-observer"  GDBusAuthObserver*    : Write / Construct Only
+  "capabilities"             GDBusCapabilityFlags  : Read
+  "closed"                   gboolean              : Read
+  "exit-on-close"            gboolean              : Read / Write
+  "flags"                    GDBusConnectionFlags  : Write / Construct Only
+  "guid"                     gchar*                : Read / Write / Construct Only
+  "stream"                   GIOStream*            : Read / Write / Construct Only
+  "unique-name"              gchar*                : Read
+
+
+
+

Signals

+
+  "closed"                                         : Run Last
+
+
+
+

Description

+

+The GDBusConnection type is used for D-Bus connections to remote +peers such as a message buses. It is a low-level API that offers a +lot of flexibility. For instance, it lets you establish a connection +over any transport that can by represented as an GIOStream. +

+

+This class is rarely used directly in D-Bus clients. If you are writing +an D-Bus client, it is often easier to use the g_bus_own_name(), +g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs. +

+

+

+
+

Example 2. D-Bus server example

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
#include <gio/gio.h>
+#include <stdlib.h>
+
+#ifdef G_OS_UNIX
+#include <gio/gunixfdlist.h>
+/* For STDOUT_FILENO */
+#include <unistd.h>
+#endif
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusNodeInfo *introspection_data = NULL;
+
+/* Introspection data for the service we are exporting */
+static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.gtk.GDBus.TestInterface'>"
+  "    <annotation name='org.gtk.GDBus.Annotation' value='OnInterface'/>"
+  "    <annotation name='org.gtk.GDBus.Annotation' value='AlsoOnInterface'/>"
+  "    <method name='HelloWorld'>"
+  "      <annotation name='org.gtk.GDBus.Annotation' value='OnMethod'/>"
+  "      <arg type='s' name='greeting' direction='in'/>"
+  "      <arg type='s' name='response' direction='out'/>"
+  "    </method>"
+  "    <method name='EmitSignal'>"
+  "      <arg type='d' name='speed_in_mph' direction='in'>"
+  "        <annotation name='org.gtk.GDBus.Annotation' value='OnArg'/>"
+  "      </arg>"
+  "    </method>"
+  "    <method name='GimmeStdout'/>"
+  "    <signal name='VelocityChanged'>"
+  "      <annotation name='org.gtk.GDBus.Annotation' value='Onsignal'/>"
+  "      <arg type='d' name='speed_in_mph'/>"
+  "      <arg type='s' name='speed_as_string'>"
+  "        <annotation name='org.gtk.GDBus.Annotation' value='OnArg_NonFirst'/>"
+  "      </arg>"
+  "    </signal>"
+  "    <property type='s' name='FluxCapicitorName' access='read'>"
+  "      <annotation name='org.gtk.GDBus.Annotation' value='OnProperty'>"
+  "        <annotation name='org.gtk.GDBus.Annotation' value='OnAnnotation_YesThisIsCrazy'/>"
+  "      </annotation>"
+  "    </property>"
+  "    <property type='s' name='Title' access='readwrite'/>"
+  "    <property type='s' name='ReadingAlwaysThrowsError' access='read'/>"
+  "    <property type='s' name='WritingAlwaysThrowsError' access='readwrite'/>"
+  "    <property type='s' name='OnlyWritable' access='write'/>"
+  "    <property type='s' name='Foo' access='read'/>"
+  "    <property type='s' name='Bar' access='read'/>"
+  "  </interface>"
+  "</node>";
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+handle_method_call (GDBusConnection       *connection,
+                    const gchar           *sender,
+                    const gchar           *object_path,
+                    const gchar           *interface_name,
+                    const gchar           *method_name,
+                    GVariant              *parameters,
+                    GDBusMethodInvocation *invocation,
+                    gpointer               user_data)
+{
+  if (g_strcmp0 (method_name, "HelloWorld") == 0)
+    {
+      const gchar *greeting;
+
+      g_variant_get (parameters, "(&s)", &greeting);
+
+      if (g_strcmp0 (greeting, "Return Unregistered") == 0)
+        {
+          g_dbus_method_invocation_return_error (invocation,
+                                                 G_IO_ERROR,
+                                                 G_IO_ERROR_FAILED_HANDLED,
+                                                 "As requested, here's a GError not registered (G_IO_ERROR_FAILED_HANDLED)");
+        }
+      else if (g_strcmp0 (greeting, "Return Registered") == 0)
+        {
+          g_dbus_method_invocation_return_error (invocation,
+                                                 G_DBUS_ERROR,
+                                                 G_DBUS_ERROR_MATCH_RULE_NOT_FOUND,
+                                                 "As requested, here's a GError that is registered (G_DBUS_ERROR_MATCH_RULE_NOT_FOUND)");
+        }
+      else if (g_strcmp0 (greeting, "Return Raw") == 0)
+        {
+          g_dbus_method_invocation_return_dbus_error (invocation,
+                                                      "org.gtk.GDBus.SomeErrorName",
+                                                      "As requested, here's a raw D-Bus error");
+        }
+      else
+        {
+          gchar *response;
+          response = g_strdup_printf ("You greeted me with '%s'. Thanks!", greeting);
+          g_dbus_method_invocation_return_value (invocation,
+                                                 g_variant_new ("(s)", response));
+          g_free (response);
+        }
+    }
+  else if (g_strcmp0 (method_name, "EmitSignal") == 0)
+    {
+      GError *local_error;
+      gdouble speed_in_mph;
+      gchar *speed_as_string;
+
+      g_variant_get (parameters, "(d)", &speed_in_mph);
+      speed_as_string = g_strdup_printf ("%g mph!", speed_in_mph);
+
+      local_error = NULL;
+      g_dbus_connection_emit_signal (connection,
+                                     NULL,
+                                     object_path,
+                                     interface_name,
+                                     "VelocityChanged",
+                                     g_variant_new ("(ds)",
+                                                    speed_in_mph,
+                                                    speed_as_string),
+                                     &local_error);
+      g_assert_no_error (local_error);
+      g_free (speed_as_string);
+
+      g_dbus_method_invocation_return_value (invocation, NULL);
+    }
+  else if (g_strcmp0 (method_name, "GimmeStdout") == 0)
+    {
+#ifdef G_OS_UNIX
+      if (g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING)
+        {
+          GDBusMessage *reply;
+          GUnixFDList *fd_list;
+          GError *error;
+
+          fd_list = g_unix_fd_list_new ();
+          error = NULL;
+          g_unix_fd_list_append (fd_list, STDOUT_FILENO, &error);
+          g_assert_no_error (error);
+
+          reply = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
+          g_dbus_message_set_unix_fd_list (reply, fd_list);
+
+          error = NULL;
+          g_dbus_connection_send_message (connection,
+                                          reply,
+                                          G_DBUS_SEND_MESSAGE_FLAGS_NONE,
+                                          NULL, /* out_serial */
+                                          &error);
+          g_assert_no_error (error);
+
+          g_object_unref (invocation);
+          g_object_unref (fd_list);
+          g_object_unref (reply);
+        }
+      else
+        {
+          g_dbus_method_invocation_return_dbus_error (invocation,
+                                                      "org.gtk.GDBus.Failed",
+                                                      "Your message bus daemon does not support file descriptor passing (need D-Bus >= 1.3.0)");
+        }
+#else
+      g_dbus_method_invocation_return_dbus_error (invocation,
+                                                  "org.gtk.GDBus.NotOnUnix",
+                                                  "Your OS does not support file descriptor passing");
+#endif
+    }
+}
+
+static gchar *_global_title = NULL;
+
+static gboolean swap_a_and_b = FALSE;
+
+static GVariant *
+handle_get_property (GDBusConnection  *connection,
+                     const gchar      *sender,
+                     const gchar      *object_path,
+                     const gchar      *interface_name,
+                     const gchar      *property_name,
+                     GError          **error,
+                     gpointer          user_data)
+{
+  GVariant *ret;
+
+  ret = NULL;
+  if (g_strcmp0 (property_name, "FluxCapicitorName") == 0)
+    {
+      ret = g_variant_new_string ("DeLorean");
+    }
+  else if (g_strcmp0 (property_name, "Title") == 0)
+    {
+      if (_global_title == NULL)
+        _global_title = g_strdup ("Back To C!");
+      ret = g_variant_new_string (_global_title);
+    }
+  else if (g_strcmp0 (property_name, "ReadingAlwaysThrowsError") == 0)
+    {
+      g_set_error (error,
+                   G_IO_ERROR,
+                   G_IO_ERROR_FAILED,
+                   "Hello %s. I thought I said reading this property "
+                   "always results in an error. kthxbye",
+                   sender);
+    }
+  else if (g_strcmp0 (property_name, "WritingAlwaysThrowsError") == 0)
+    {
+      ret = g_variant_new_string ("There's no home like home");
+    }
+  else if (g_strcmp0 (property_name, "Foo") == 0)
+    {
+      ret = g_variant_new_string (swap_a_and_b ? "Tock" : "Tick");
+    }
+  else if (g_strcmp0 (property_name, "Bar") == 0)
+    {
+      ret = g_variant_new_string (swap_a_and_b ? "Tick" : "Tock");
+    }
+
+  return ret;
+}
+
+static gboolean
+handle_set_property (GDBusConnection  *connection,
+                     const gchar      *sender,
+                     const gchar      *object_path,
+                     const gchar      *interface_name,
+                     const gchar      *property_name,
+                     GVariant         *value,
+                     GError          **error,
+                     gpointer          user_data)
+{
+  if (g_strcmp0 (property_name, "Title") == 0)
+    {
+      if (g_strcmp0 (_global_title, g_variant_get_string (value, NULL)) != 0)
+        {
+          GVariantBuilder *builder;
+          GError *local_error;
+
+          g_free (_global_title);
+          _global_title = g_variant_dup_string (value, NULL);
+
+          local_error = NULL;
+          builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
+          g_variant_builder_add (builder,
+                                 "{sv}",
+                                 "Title",
+                                 g_variant_new_string (_global_title));
+          g_dbus_connection_emit_signal (connection,
+                                         NULL,
+                                         object_path,
+                                         "org.freedesktop.DBus.Properties",
+                                         "PropertiesChanged",
+                                         g_variant_new ("(sa{sv}as)",
+                                                        interface_name,
+                                                        builder,
+                                                        NULL),
+                                         &local_error);
+          g_assert_no_error (local_error);
+        }
+    }
+  else if (g_strcmp0 (property_name, "ReadingAlwaysThrowsError") == 0)
+    {
+      /* do nothing - they can't read it after all! */
+    }
+  else if (g_strcmp0 (property_name, "WritingAlwaysThrowsError") == 0)
+    {
+      g_set_error (error,
+                   G_IO_ERROR,
+                   G_IO_ERROR_FAILED,
+                   "Hello AGAIN %s. I thought I said writing this property "
+                   "always results in an error. kthxbye",
+                   sender);
+    }
+
+  return *error == NULL;
+}
+
+
+/* for now */
+static const GDBusInterfaceVTable interface_vtable =
+{
+  handle_method_call,
+  handle_get_property,
+  handle_set_property
+};
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static gboolean
+on_timeout_cb (gpointer user_data)
+{
+  GDBusConnection *connection = G_DBUS_CONNECTION (user_data);
+  GVariantBuilder *builder;
+  GVariantBuilder *invalidated_builder;
+  GError *error;
+
+  swap_a_and_b = !swap_a_and_b;
+
+  error = NULL;
+  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
+  invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+  g_variant_builder_add (builder,
+                         "{sv}",
+                         "Foo",
+                         g_variant_new_string (swap_a_and_b ? "Tock" : "Tick"));
+  g_variant_builder_add (builder,
+                         "{sv}",
+                         "Bar",
+                         g_variant_new_string (swap_a_and_b ? "Tick" : "Tock"));
+  g_dbus_connection_emit_signal (connection,
+                                 NULL,
+                                 "/org/gtk/GDBus/TestObject",
+                                 "org.freedesktop.DBus.Properties",
+                                 "PropertiesChanged",
+                                 g_variant_new ("(sa{sv}as)",
+                                                "org.gtk.GDBus.TestInterface",
+                                                builder,
+                                                invalidated_builder),
+                                 &error);
+  g_assert_no_error (error);
+
+
+  return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+  guint registration_id;
+
+  registration_id = g_dbus_connection_register_object (connection,
+                                                       "/org/gtk/GDBus/TestObject",
+                                                       introspection_data->interfaces[0],
+                                                       &interface_vtable,
+                                                       NULL,  /* user_data */
+                                                       NULL,  /* user_data_free_func */
+                                                       NULL); /* GError** */
+  g_assert (registration_id > 0);
+
+  /* swap value of properties Foo and Bar every two seconds */
+  g_timeout_add_seconds (2,
+                         on_timeout_cb,
+                         connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+  exit (1);
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint owner_id;
+  GMainLoop *loop;
+
+  g_type_init ();
+
+  /* We are lazy here - we don't want to manually provide
+   * the introspection data structures - so we just build
+   * them from XML.
+   */
+  introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+  g_assert (introspection_data != NULL);
+
+  owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+                             "org.gtk.GDBus.TestServer",
+                             G_BUS_NAME_OWNER_FLAGS_NONE,
+                             on_bus_acquired,
+                             on_name_acquired,
+                             on_name_lost,
+                             NULL,
+                             NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unown_name (owner_id);
+
+  g_dbus_node_info_unref (introspection_data);
+
+  return 0;
+}
+
+ +
+


+

+

+

+
+

Example 3. D-Bus subtree example

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusNodeInfo *introspection_data = NULL;
+static GDBusInterfaceInfo *manager_interface_info = NULL;
+static GDBusInterfaceInfo *block_interface_info = NULL;
+static GDBusInterfaceInfo *partition_interface_info = NULL;
+
+/* Introspection data for the service we are exporting */
+static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.gtk.GDBus.Example.Manager'>"
+  "    <method name='Hello'>"
+  "      <arg type='s' name='greeting' direction='in'/>"
+  "      <arg type='s' name='response' direction='out'/>"
+  "    </method>"
+  "  </interface>"
+  "  <interface name='org.gtk.GDBus.Example.Block'>"
+  "    <method name='Hello'>"
+  "      <arg type='s' name='greeting' direction='in'/>"
+  "      <arg type='s' name='response' direction='out'/>"
+  "    </method>"
+  "    <property type='i' name='Major' access='read'/>"
+  "    <property type='i' name='Minor' access='read'/>"
+  "    <property type='s' name='Notes' access='readwrite'/>"
+  "  </interface>"
+  "  <interface name='org.gtk.GDBus.Example.Partition'>"
+  "    <method name='Hello'>"
+  "      <arg type='s' name='greeting' direction='in'/>"
+  "      <arg type='s' name='response' direction='out'/>"
+  "    </method>"
+  "    <property type='i' name='PartitionNumber' access='read'/>"
+  "    <property type='s' name='Notes' access='readwrite'/>"
+  "  </interface>"
+  "</node>";
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+manager_method_call (GDBusConnection       *connection,
+                     const gchar           *sender,
+                     const gchar           *object_path,
+                     const gchar           *interface_name,
+                     const gchar           *method_name,
+                     GVariant              *parameters,
+                     GDBusMethodInvocation *invocation,
+                     gpointer               user_data)
+{
+  const gchar *greeting;
+  gchar *response;
+
+  g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.Example.Manager");
+  g_assert_cmpstr (method_name, ==, "Hello");
+
+  g_variant_get (parameters, "(&s)", &greeting);
+
+  response = g_strdup_printf ("Method %s.%s with user_data `%s' on object path %s called with arg '%s'",
+                              interface_name,
+                              method_name,
+                              (const gchar *) user_data,
+                              object_path,
+                              greeting);
+  g_dbus_method_invocation_return_value (invocation,
+                                         g_variant_new ("(s)", response));
+  g_free (response);
+}
+
+const GDBusInterfaceVTable manager_vtable =
+{
+  manager_method_call,
+  NULL,                 /* get_property */
+  NULL                  /* set_property */
+};
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+block_method_call (GDBusConnection       *connection,
+                   const gchar           *sender,
+                   const gchar           *object_path,
+                   const gchar           *interface_name,
+                   const gchar           *method_name,
+                   GVariant              *parameters,
+                   GDBusMethodInvocation *invocation,
+                   gpointer               user_data)
+{
+  g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.Example.Block");
+
+  if (g_strcmp0 (method_name, "Hello") == 0)
+    {
+      const gchar *greeting;
+      gchar *response;
+
+      g_variant_get (parameters, "(&s)", &greeting);
+
+      response = g_strdup_printf ("Method %s.%s with user_data `%s' on object path %s called with arg '%s'",
+                                  interface_name,
+                                  method_name,
+                                  (const gchar *) user_data,
+                                  object_path,
+                                  greeting);
+      g_dbus_method_invocation_return_value (invocation,
+                                             g_variant_new ("(s)", response));
+      g_free (response);
+    }
+  else if (g_strcmp0 (method_name, "DoStuff") == 0)
+    {
+      g_dbus_method_invocation_return_dbus_error (invocation,
+                                                  "org.gtk.GDBus.TestSubtree.Error.Failed",
+                                                  "This method intentionally always fails");
+    }
+  else
+    {
+      g_assert_not_reached ();
+    }
+}
+
+static GVariant *
+block_get_property (GDBusConnection  *connection,
+                    const gchar      *sender,
+                    const gchar      *object_path,
+                    const gchar      *interface_name,
+                    const gchar      *property_name,
+                    GError          **error,
+                    gpointer          user_data)
+{
+  GVariant *ret;
+  const gchar *node;
+  gint major;
+  gint minor;
+
+  node = strrchr (object_path, '/') + 1;
+  if (g_str_has_prefix (node, "sda"))
+    major = 8;
+  else
+    major = 9;
+  if (strlen (node) == 4)
+    minor = node[3] - '0';
+  else
+    minor = 0;
+
+  ret = NULL;
+  if (g_strcmp0 (property_name, "Major") == 0)
+    {
+      ret = g_variant_new_int32 (major);
+    }
+  else if (g_strcmp0 (property_name, "Minor") == 0)
+    {
+      ret = g_variant_new_int32 (minor);
+    }
+  else if (g_strcmp0 (property_name, "Notes") == 0)
+    {
+      g_set_error (error,
+                   G_IO_ERROR,
+                   G_IO_ERROR_FAILED,
+                   "Hello %s. I thought I said reading this property "
+                   "always results in an error. kthxbye",
+                   sender);
+    }
+  else
+    {
+      g_assert_not_reached ();
+    }
+
+  return ret;
+}
+
+static gboolean
+block_set_property (GDBusConnection  *connection,
+                    const gchar      *sender,
+                    const gchar      *object_path,
+                    const gchar      *interface_name,
+                    const gchar      *property_name,
+                    GVariant         *value,
+                    GError          **error,
+                    gpointer          user_data)
+{
+  /* TODO */
+  g_assert_not_reached ();
+}
+
+const GDBusInterfaceVTable block_vtable =
+{
+  block_method_call,
+  block_get_property,
+  block_set_property,
+};
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+partition_method_call (GDBusConnection       *connection,
+                       const gchar           *sender,
+                       const gchar           *object_path,
+                       const gchar           *interface_name,
+                       const gchar           *method_name,
+                       GVariant              *parameters,
+                       GDBusMethodInvocation *invocation,
+                       gpointer               user_data)
+{
+  const gchar *greeting;
+  gchar *response;
+
+  g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.Example.Partition");
+  g_assert_cmpstr (method_name, ==, "Hello");
+
+  g_variant_get (parameters, "(&s)", &greeting);
+
+  response = g_strdup_printf ("Method %s.%s with user_data `%s' on object path %s called with arg '%s'",
+                              interface_name,
+                              method_name,
+                              (const gchar *) user_data,
+                              object_path,
+                              greeting);
+  g_dbus_method_invocation_return_value (invocation,
+                                         g_variant_new ("(s)", response));
+  g_free (response);
+}
+
+const GDBusInterfaceVTable partition_vtable =
+{
+  partition_method_call,
+  //partition_get_property,
+  //partition_set_property
+};
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static gchar **
+subtree_enumerate (GDBusConnection       *connection,
+                   const gchar           *sender,
+                   const gchar           *object_path,
+                   gpointer               user_data)
+{
+  gchar **nodes;
+  GPtrArray *p;
+
+  p = g_ptr_array_new ();
+  g_ptr_array_add (p, g_strdup ("sda"));
+  g_ptr_array_add (p, g_strdup ("sda1"));
+  g_ptr_array_add (p, g_strdup ("sda2"));
+  g_ptr_array_add (p, g_strdup ("sda3"));
+  g_ptr_array_add (p, g_strdup ("sdb"));
+  g_ptr_array_add (p, g_strdup ("sdb1"));
+  g_ptr_array_add (p, g_strdup ("sdc"));
+  g_ptr_array_add (p, g_strdup ("sdc1"));
+  g_ptr_array_add (p, NULL);
+  nodes = (gchar **) g_ptr_array_free (p, FALSE);
+
+  return nodes;
+}
+
+static GDBusInterfaceInfo **
+subtree_introspect (GDBusConnection       *connection,
+                    const gchar           *sender,
+                    const gchar           *object_path,
+                    const gchar           *node,
+                    gpointer               user_data)
+{
+  GPtrArray *p;
+
+  p = g_ptr_array_new ();
+  if (node == NULL)
+    {
+      g_ptr_array_add (p, g_dbus_interface_info_ref (manager_interface_info));
+    }
+  else
+    {
+      g_ptr_array_add (p, g_dbus_interface_info_ref (block_interface_info));
+      if (strlen (node) == 4)
+        g_ptr_array_add (p,
+                         g_dbus_interface_info_ref (partition_interface_info));
+    }
+
+  g_ptr_array_add (p, NULL);
+
+  return (GDBusInterfaceInfo **) g_ptr_array_free (p, FALSE);
+}
+
+static const GDBusInterfaceVTable *
+subtree_dispatch (GDBusConnection             *connection,
+                  const gchar                 *sender,
+                  const gchar                 *object_path,
+                  const gchar                 *interface_name,
+                  const gchar                 *node,
+                  gpointer                    *out_user_data,
+                  gpointer                     user_data)
+{
+  const GDBusInterfaceVTable *vtable_to_return;
+  gpointer user_data_to_return;
+
+  if (g_strcmp0 (interface_name, "org.gtk.GDBus.Example.Manager") == 0)
+    {
+      user_data_to_return = "The Root";
+      vtable_to_return = &manager_vtable;
+    }
+  else
+    {
+      if (strlen (node) == 4)
+        user_data_to_return = "A partition";
+      else
+        user_data_to_return = "A block device";
+
+      if (g_strcmp0 (interface_name, "org.gtk.GDBus.Example.Block") == 0)
+        vtable_to_return = &block_vtable;
+      else if (g_strcmp0 (interface_name, "org.gtk.GDBus.Example.Partition") == 0)
+        vtable_to_return = &partition_vtable;
+      else
+        g_assert_not_reached ();
+    }
+
+  *out_user_data = user_data_to_return;
+
+  return vtable_to_return;
+}
+
+const GDBusSubtreeVTable subtree_vtable =
+{
+  subtree_enumerate,
+  subtree_introspect,
+  subtree_dispatch
+};
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+  guint registration_id;
+
+  registration_id = g_dbus_connection_register_subtree (connection,
+                                                        "/org/gtk/GDBus/TestSubtree/Devices",
+                                                        &subtree_vtable,
+                                                        G_DBUS_SUBTREE_FLAGS_NONE,
+                                                        NULL,  /* user_data */
+                                                        NULL,  /* user_data_free_func */
+                                                        NULL); /* GError** */
+  g_assert (registration_id > 0);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+  exit (1);
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint owner_id;
+  GMainLoop *loop;
+
+  g_type_init ();
+
+  /* We are lazy here - we don't want to manually provide
+   * the introspection data structures - so we just build
+   * them from XML.
+   */
+  introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+  g_assert (introspection_data != NULL);
+
+  manager_interface_info = g_dbus_node_info_lookup_interface (introspection_data, "org.gtk.GDBus.Example.Manager");
+  block_interface_info = g_dbus_node_info_lookup_interface (introspection_data, "org.gtk.GDBus.Example.Block");
+  partition_interface_info = g_dbus_node_info_lookup_interface (introspection_data, "org.gtk.GDBus.Example.Partition");
+  g_assert (manager_interface_info != NULL);
+  g_assert (block_interface_info != NULL);
+  g_assert (partition_interface_info != NULL);
+
+  owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+                             "org.gtk.GDBus.TestSubtree",
+                             G_BUS_NAME_OWNER_FLAGS_NONE,
+                             on_bus_acquired,
+                             on_name_acquired,
+                             on_name_lost,
+                             NULL,
+                             NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unown_name (owner_id);
+
+  g_dbus_node_info_unref (introspection_data);
+
+  return 0;
+}
+
+ +
+


+

+

+

+
+

Example 4. D-Bus UNIX File Descriptor example

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
#include <string.h>
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <time.h>
+
+#include <gio/gio.h>
+#include <gio/gunixfdlist.h>
+
+/* see gdbus-example-server.c for the server implementation */
+static gint
+get_server_stdout (GDBusConnection  *connection,
+                   const gchar      *name_owner,
+                   GError          **error)
+{
+  GDBusMessage *method_call_message;
+  GDBusMessage *method_reply_message;
+  GUnixFDList *fd_list;
+  gint fd;
+
+  fd = -1;
+  method_call_message = NULL;
+  method_reply_message = NULL;
+
+  method_call_message = g_dbus_message_new_method_call (name_owner,
+                                                        "/org/gtk/GDBus/TestObject",
+                                                        "org.gtk.GDBus.TestInterface",
+                                                        "GimmeStdout");
+  method_reply_message = g_dbus_connection_send_message_with_reply_sync (connection,
+                                                                         method_call_message,
+                                                                         G_DBUS_SEND_MESSAGE_FLAGS_NONE,
+                                                                         -1,
+                                                                         NULL, /* out_serial */
+                                                                         NULL, /* cancellable */
+                                                                         error);
+  if (method_reply_message == NULL)
+      goto out;
+
+  if (g_dbus_message_get_message_type (method_reply_message) == G_DBUS_MESSAGE_TYPE_ERROR)
+    {
+      g_dbus_message_to_gerror (method_reply_message, error);
+      goto out;
+    }
+
+  fd_list = g_dbus_message_get_unix_fd_list (method_reply_message);
+  fd = g_unix_fd_list_get (fd_list, 0, error);
+
+ out:
+  g_object_unref (method_call_message);
+  g_object_unref (method_reply_message);
+
+  return fd;
+}
+
+static void
+on_name_appeared (GDBusConnection *connection,
+                  const gchar     *name,
+                  const gchar     *name_owner,
+                  gpointer         user_data)
+{
+  gint fd;
+  GError *error;
+
+  error = NULL;
+  fd = get_server_stdout (connection, name_owner, &error);
+  if (fd == -1)
+    {
+      g_printerr ("Error invoking GimmeStdout(): %s\n",
+                  error->message);
+      g_error_free (error);
+      exit (1);
+    }
+  else
+    {
+      gchar now_buf[256];
+      time_t now;
+      gssize len;
+      gchar *str;
+
+      now = time (NULL);
+      strftime (now_buf,
+                sizeof now_buf,
+                "%c",
+                localtime (&now));
+
+      str = g_strdup_printf ("On %s, gdbus-example-unix-fd-client with pid %d was here!\n",
+                             now_buf,
+                             (gint) getpid ());
+      len = strlen (str);
+      g_warn_if_fail (write (fd, str, len) == len);
+      close (fd);
+
+      g_print ("Wrote the following on server's stdout:\n%s", str);
+
+      g_free (str);
+      exit (0);
+    }
+}
+
+static void
+on_name_vanished (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+  g_printerr ("Failed to get name owner for %s\n"
+              "Is ./gdbus-example-server running?\n",
+              name);
+  exit (1);
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint watcher_id;
+  GMainLoop *loop;
+
+  g_type_init ();
+
+  watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
+                                 "org.gtk.GDBus.TestServer",
+                                 G_BUS_NAME_WATCHER_FLAGS_NONE,
+                                 on_name_appeared,
+                                 on_name_vanished,
+                                 NULL,
+                                 NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unwatch_name (watcher_id);
+  return 0;
+}
+
+ +
+


+

+

+

+
+

Example 5. Exporting a GObject

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
#include <gio/gio.h>
+#include <stdlib.h>
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+/* The object we want to export */
+typedef struct _MyObjectClass MyObjectClass;
+typedef struct _MyObject MyObject;
+
+struct _MyObjectClass
+{
+  GObjectClass parent_class;
+};
+
+struct _MyObject
+{
+  GObject parent_instance;
+
+  gint count;
+  gchar *name;
+};
+
+enum
+{
+  PROP_0,
+  PROP_COUNT,
+  PROP_NAME
+};
+
+G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT);
+
+static void
+my_object_finalize (GObject *object)
+{
+  MyObject *myobj = (MyObject*)object;
+
+  g_free (myobj->name);
+
+  G_OBJECT_CLASS (my_object_parent_class)->finalize (object);
+}
+
+static void
+my_object_init (MyObject *object)
+{
+  object->count = 0;
+  object->name = NULL;
+}
+
+static void
+my_object_get_property (GObject    *object,
+                        guint       prop_id,
+                        GValue     *value,
+                        GParamSpec *pspec)
+{
+  MyObject *myobj = (MyObject*)object;
+
+  switch (prop_id)
+    {
+    case PROP_COUNT:
+      g_value_set_int (value, myobj->count);
+      break;
+
+    case PROP_NAME:
+      g_value_set_string (value, myobj->name);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+my_object_set_property (GObject      *object,
+                        guint         prop_id,
+                        const GValue *value,
+                        GParamSpec   *pspec)
+{
+  MyObject *myobj = (MyObject*)object;
+
+  switch (prop_id)
+    {
+    case PROP_COUNT:
+      myobj->count = g_value_get_int (value);
+      break;
+
+    case PROP_NAME:
+      g_free (myobj->name);
+      myobj->name = g_value_dup_string (value);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+my_object_class_init (MyObjectClass *class)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+  gobject_class->finalize = my_object_finalize;
+  gobject_class->set_property = my_object_set_property;
+  gobject_class->get_property = my_object_get_property;
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_COUNT,
+                                   g_param_spec_int ("count",
+                                                     "Count",
+                                                     "Count",
+                                                     0, 99999, 0,
+                                                     G_PARAM_READWRITE));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_NAME,
+                                   g_param_spec_string ("name",
+                                                        "Name",
+                                                        "Name",
+                                                        NULL,
+                                                        G_PARAM_READWRITE));
+}
+
+/* A method that we want to export */
+void
+my_object_change_count (MyObject *myobj,
+                        gint      change)
+{
+  myobj->count = 2 * myobj->count + change;
+
+  g_object_notify (G_OBJECT (myobj), "count");
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusNodeInfo *introspection_data = NULL;
+
+/* Introspection data for the service we are exporting */
+static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.myorg.MyObject'>"
+  "    <method name='ChangeCount'>"
+  "      <arg type='i' name='change' direction='in'/>"
+  "    </method>"
+  "    <property type='i' name='Count' access='read'/>"
+  "    <property type='s' name='Name' access='readwrite'/>"
+  "  </interface>"
+  "</node>";
+
+
+static void
+handle_method_call (GDBusConnection       *connection,
+                    const gchar           *sender,
+                    const gchar           *object_path,
+                    const gchar           *interface_name,
+                    const gchar           *method_name,
+                    GVariant              *parameters,
+                    GDBusMethodInvocation *invocation,
+                    gpointer               user_data)
+{
+  MyObject *myobj = user_data;
+
+  if (g_strcmp0 (method_name, "ChangeCount") == 0)
+    {
+      gint change;
+      g_variant_get (parameters, "(i)", &change);
+
+      my_object_change_count (myobj, change);
+
+      g_dbus_method_invocation_return_value (invocation, NULL);
+    }
+}
+
+static GVariant *
+handle_get_property (GDBusConnection  *connection,
+                     const gchar      *sender,
+                     const gchar      *object_path,
+                     const gchar      *interface_name,
+                     const gchar      *property_name,
+                     GError          **error,
+                     gpointer          user_data)
+{
+  GVariant *ret;
+  MyObject *myobj = user_data;
+
+  ret = NULL;
+  if (g_strcmp0 (property_name, "Count") == 0)
+    {
+      ret = g_variant_new_int32 (myobj->count);
+    }
+  else if (g_strcmp0 (property_name, "Name") == 0)
+    {
+      ret = g_variant_new_string (myobj->name ? myobj->name : "");
+    }
+
+  return ret;
+}
+
+static gboolean
+handle_set_property (GDBusConnection  *connection,
+                     const gchar      *sender,
+                     const gchar      *object_path,
+                     const gchar      *interface_name,
+                     const gchar      *property_name,
+                     GVariant         *value,
+                     GError          **error,
+                     gpointer          user_data)
+{
+  MyObject *myobj = user_data;
+
+  if (g_strcmp0 (property_name, "Count") == 0)
+    {
+      g_object_set (myobj, "count", g_variant_get_int32 (value), NULL);
+    }
+  else if (g_strcmp0 (property_name, "Name") == 0)
+    {
+      g_object_set (myobj, "name", g_variant_get_string (value, NULL), NULL);
+    }
+
+  return TRUE;
+}
+
+
+/* for now */
+static const GDBusInterfaceVTable interface_vtable =
+{
+  handle_method_call,
+  handle_get_property,
+  handle_set_property
+};
+
+static void
+send_property_change (GObject         *obj,
+                      GParamSpec      *pspec,
+                      GDBusConnection *connection)
+{
+  GVariantBuilder *builder;
+  GVariantBuilder *invalidated_builder;
+  MyObject *myobj = (MyObject *)obj;
+
+  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
+  invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+
+  if (g_strcmp0 (pspec->name, "count") == 0)
+    g_variant_builder_add (builder,
+                           "{sv}",
+                           "Count", g_variant_new_int32 (myobj->count));
+  else if (g_strcmp0 (pspec->name, "name") == 0)
+    g_variant_builder_add (builder,
+                           "{sv}",
+                           "Name", g_variant_new_string (myobj->name ? myobj->name : ""));
+
+  g_dbus_connection_emit_signal (connection,
+                                 NULL,
+                                 "/org/myorg/MyObject",
+                                 "org.freedesktop.DBus.Properties",
+                                 "PropertiesChanged",
+                                 g_variant_new ("(sa{sv}as)",
+                                                "org.myorg.MyObject",
+                                                builder,
+                                                invalidated_builder),
+                                 NULL);
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+  MyObject *myobj = user_data;
+  guint registration_id;
+
+  g_signal_connect (myobj, "notify",
+                    G_CALLBACK (send_property_change), connection);
+  registration_id = g_dbus_connection_register_object (connection,
+                                                       "/org/myorg/MyObject",
+                                                       introspection_data->interfaces[0],
+                                                       &interface_vtable,
+                                                       myobj,
+                                                       NULL,  /* user_data_free_func */
+                                                       NULL); /* GError** */
+  g_assert (registration_id > 0);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+  exit (1);
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint owner_id;
+  GMainLoop *loop;
+  MyObject *myobj;
+
+  g_type_init ();
+
+  /* We are lazy here - we don't want to manually provide
+   * the introspection data structures - so we just build
+   * them from XML.
+   */
+  introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+  g_assert (introspection_data != NULL);
+
+  myobj = g_object_new (my_object_get_type (), NULL);
+
+  owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+                             "org.myorg.MyObject",
+                             G_BUS_NAME_OWNER_FLAGS_NONE,
+                             on_bus_acquired,
+                             on_name_acquired,
+                             on_name_lost,
+                             myobj,
+                             NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unown_name (owner_id);
+
+  g_dbus_node_info_unref (introspection_data);
+
+  g_object_unref (myobj);
+
+  return 0;
+}
+
+ +
+


+

+
+
+

Details

+
+

enum GBusType

+
typedef enum
+{
+  G_BUS_TYPE_STARTER = -1,
+  G_BUS_TYPE_NONE = 0,
+  G_BUS_TYPE_SYSTEM  = 1,
+  G_BUS_TYPE_SESSION = 2
+} GBusType;
+
+

+An enumeration for well-known message buses. +

+
++ + + + + + + + + + + + + + + + + + +

G_BUS_TYPE_STARTER

An alias for the message bus that activated the process, if any. +

G_BUS_TYPE_NONE

Not a message bus. +

G_BUS_TYPE_SYSTEM

The system-wide message bus. +

G_BUS_TYPE_SESSION

The login session message bus. +
+

Since 2.26

+
+
+
+

g_bus_get ()

+
void                g_bus_get                           (GBusType bus_type,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously connects to the message bus specified by bus_type. +

+

+When the operation is finished, callback will be invoked. You can +then call g_bus_get_finish() to get the result of the operation. +

+

+This is a asynchronous failable function. See g_bus_get_sync() for +the synchronous version. +

+
++ + + + + + + + + + + + + + + + + + +

bus_type :

A GBusType. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_bus_get_finish ()

+
GDBusConnection *   g_bus_get_finish                    (GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_bus_get(). +

+

+The returned object is a singleton, that is, shared with other +callers of g_bus_get() and g_bus_get_sync() for bus_type. In the +event that you need a private message bus connection, use +g_dbus_address_get_for_bus() and +g_dbus_connection_new_for_address(). +

+

+Note that the returned GDBusConnection object will (usually) have +the "exit-on-close" property set to TRUE. +

+
++ + + + + + + + + + + + + + +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_bus_get(). +

error :

Return location for error or NULL. +

Returns :

A GDBusConnection or NULL if error is set. Free with g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

g_bus_get_sync ()

+
GDBusConnection *   g_bus_get_sync                      (GBusType bus_type,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously connects to the message bus specified by bus_type. +Note that the returned object may shared with other callers, +e.g. if two separate parts of a process calls this function with +the same bus_type, they will share the same object. +

+

+This is a synchronous failable function. See g_bus_get() and +g_bus_get_finish() for the asynchronous version. +

+

+The returned object is a singleton, that is, shared with other +callers of g_bus_get() and g_bus_get_sync() for bus_type. In the +event that you need a private message bus connection, use +g_dbus_address_get_for_bus_sync() and +g_dbus_connection_new_for_address(). +

+

+Note that the returned GDBusConnection object will (usually) have +the "exit-on-close" property set to TRUE. +

+
++ + + + + + + + + + + + + + + + + + +

bus_type :

A GBusType. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A GDBusConnection or NULL if error is set. Free with g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

GDBusConnection

+
typedef struct _GDBusConnection GDBusConnection;
+

+The GDBusConnection structure contains only private data and +should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

enum GDBusConnectionFlags

+
typedef enum {
+  G_DBUS_CONNECTION_FLAGS_NONE = 0,
+  G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT = (1<<0),
+  G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER = (1<<1),
+  G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<2),
+  G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION = (1<<3),
+  G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING = (1<<4)
+} GDBusConnectionFlags;
+
+

+Flags used when creating a new GDBusConnection. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

G_DBUS_CONNECTION_FLAGS_NONE

No flags set. +

G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT

Perform authentication against server. +

G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER

Perform authentication against client. +

G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS

When +authenticating as a server, allow the anonymous authentication +method. +

G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION

Pass this flag if connecting to a peer that is a +message bus. This means that the Hello() method will be invoked as part of the connection setup. +

G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING

If set, processing of D-Bus messages is +delayed until g_dbus_connection_start_message_processing() is called. +
+

Since 2.26

+
+
+
+

g_dbus_connection_new ()

+
void                g_dbus_connection_new               (GIOStream *stream,
+                                                         const gchar *guid,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously sets up a D-Bus connection for exchanging D-Bus messages +with the end represented by stream. +

+

+If observer is not NULL it may be used to control the +authentication process. +

+

+When the operation is finished, callback will be invoked. You can +then call g_dbus_connection_new_finish() to get the result of the +operation. +

+

+This is a asynchronous failable constructor. See +g_dbus_connection_new_sync() for the synchronous +version. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream :

A GIOStream. +

guid :

The GUID to use if a authenticating as a server or NULL. +

flags :

Flags describing how to make the connection. +

observer :

A GDBusAuthObserver or NULL. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_connection_new_finish ()

+
GDBusConnection *   g_dbus_connection_new_finish        (GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_connection_new(). +

+
++ + + + + + + + + + + + + + +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_connection_new(). +

error :

Return location for error or NULL. +

Returns :

A GDBusConnection or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_new_sync ()

+
GDBusConnection *   g_dbus_connection_new_sync          (GIOStream *stream,
+                                                         const gchar *guid,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously sets up a D-Bus connection for exchanging D-Bus messages +with the end represented by stream. +

+

+If observer is not NULL it may be used to control the +authentication process. +

+

+This is a synchronous failable constructor. See +g_dbus_connection_new() for the asynchronous version. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream :

A GIOStream. +

guid :

The GUID to use if a authenticating as a server or NULL. +

flags :

Flags describing how to make the connection. +

observer :

A GDBusAuthObserver or NULL. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A GDBusConnection or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_new_for_address ()

+
void                g_dbus_connection_new_for_address   (const gchar *address,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously connects and sets up a D-Bus client connection for +exchanging D-Bus messages with an endpoint specified by address +which must be in the D-Bus address format. +

+

+This constructor can only be used to initiate client-side +connections - use g_dbus_connection_new() if you need to act as the +server. In particular, flags cannot contain the +G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or +G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags. +

+

+When the operation is finished, callback will be invoked. You can +then call g_dbus_connection_new_finish() to get the result of the +operation. +

+

+If observer is not NULL it may be used to control the +authentication process. +

+

+This is a asynchronous failable constructor. See +g_dbus_connection_new_for_address_sync() for the synchronous +version. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

address :

A D-Bus address. +

flags :

Flags describing how to make the connection. +

observer :

A GDBusAuthObserver or NULL. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_connection_new_for_address_finish ()

+
GDBusConnection *   g_dbus_connection_new_for_address_finish
+                                                        (GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_connection_new_for_address(). +

+
++ + + + + + + + + + + + + + +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_connection_new(). +

error :

Return location for error or NULL. +

Returns :

A GDBusConnection or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_new_for_address_sync ()

+
GDBusConnection *   g_dbus_connection_new_for_address_sync
+                                                        (const gchar *address,
+                                                         GDBusConnectionFlags flags,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously connects and sets up a D-Bus client connection for +exchanging D-Bus messages with an endpoint specified by address +which must be in the D-Bus address format. +

+

+This constructor can only be used to initiate client-side +connections - use g_dbus_connection_new_sync() if you need to act +as the server. In particular, flags cannot contain the +G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or +G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags. +

+

+This is a synchronous failable constructor. See +g_dbus_connection_new_for_address() for the asynchronous version. +

+

+If observer is not NULL it may be used to control the +authentication process. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

address :

A D-Bus address. +

flags :

Flags describing how to make the connection. +

observer :

A GDBusAuthObserver or NULL. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A GDBusConnection or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_start_message_processing ()

+
void                g_dbus_connection_start_message_processing
+                                                        (GDBusConnection *connection);
+

+If connection was created with +G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method +starts processing messages. Does nothing on if connection wasn't +created with this flag or if the method has already been called. +

+
++ + + + +

connection :

A GDBusConnection. +
+

Since 2.26

+
+
+
+

g_dbus_connection_close ()

+
void                g_dbus_connection_close             (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Closes connection. Note that this never causes the process to +exit (this might only happen if the other end of a shared message +bus connection disconnects, see "exit-on-close"). +

+

+Once the connection is closed, operations such as sending a message +will return with the error G_IO_ERROR_CLOSED. Closing a connection +will not automatically flush the connection so queued messages may +be lost. Use g_dbus_connection_flush() if you need such guarantees. +

+

+If connection is already closed, this method fails with +G_IO_ERROR_CLOSED. +

+

+When connection has been closed, the "closed" +signal is emitted in the thread-default main +loop of the thread that connection was constructed in. +

+

+This is an asynchronous method. When the operation is finished, +callback will be invoked in the thread-default main +loop of the thread you are calling this method from. You can +then call g_dbus_connection_close_finish() to get the result of the +operation. See g_dbus_connection_close_sync() for the synchronous +version. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't +care about the result. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_connection_close_finish ()

+
gboolean            g_dbus_connection_close_finish      (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_connection_close(). +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_connection_close(). +

error :

Return location for error or NULL. +

Returns :

TRUE if the operation succeeded, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_close_sync ()

+
gboolean            g_dbus_connection_close_sync        (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously closees connection. The calling thread is blocked +until this is done. See g_dbus_connection_close() for the +asynchronous version of this method and more details about what it +does. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

TRUE if the operation succeeded, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_is_closed ()

+
gboolean            g_dbus_connection_is_closed         (GDBusConnection *connection);
+

+Gets whether connection is closed. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

Returns :

TRUE if the connection is closed, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_flush ()

+
void                g_dbus_connection_flush             (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously flushes connection, that is, writes all queued +outgoing message to the transport and then flushes the transport +(using g_output_stream_flush_async()). This is useful in programs +that wants to emit a D-Bus signal and then exit +immediately. Without flushing the connection, there is no guarantee +that the message has been sent to the networking buffers in the OS +kernel. +

+

+This is an asynchronous method. When the operation is finished, +callback will be invoked in the thread-default main +loop of the thread you are calling this method from. You can +then call g_dbus_connection_flush_finish() to get the result of the +operation. See g_dbus_connection_flush_sync() for the synchronous +version. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't +care about the result. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_connection_flush_finish ()

+
gboolean            g_dbus_connection_flush_finish      (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_connection_flush(). +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_connection_flush(). +

error :

Return location for error or NULL. +

Returns :

TRUE if the operation succeeded, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_flush_sync ()

+
gboolean            g_dbus_connection_flush_sync        (GDBusConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously flushes connection. The calling thread is blocked +until this is done. See g_dbus_connection_flush() for the +asynchronous version of this method and more details about what it +does. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

TRUE if the operation succeeded, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_get_exit_on_close ()

+
gboolean            g_dbus_connection_get_exit_on_close (GDBusConnection *connection);
+

+Gets whether the process is terminated when connection is +closed by the remote peer. See +"exit-on-close" for more details. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

Returns :

Whether the process is terminated when connection is +closed by the remote peer. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_set_exit_on_close ()

+
void                g_dbus_connection_set_exit_on_close (GDBusConnection *connection,
+                                                         gboolean exit_on_close);
+

+Sets whether the process should be terminated when connection is +closed by the remote peer. See "exit-on-close" for +more details. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

exit_on_close :

Whether the process should be terminated +when connection is closed by the remote peer. +
+

Since 2.26

+
+
+
+

g_dbus_connection_get_stream ()

+
GIOStream *         g_dbus_connection_get_stream        (GDBusConnection *connection);
+

+Gets the underlying stream used for IO. +

+
++ + + + + + + + + + +

connection :

a GDBusConnection +

Returns :

the stream used for IO. [transfer none] +
+

Since 2.26

+
+
+
+

g_dbus_connection_get_guid ()

+
const gchar *       g_dbus_connection_get_guid          (GDBusConnection *connection);
+

+The GUID of the peer performing the role of server when +authenticating. See "guid" for more details. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

Returns :

The GUID. Do not free this string, it is owned by +connection. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_get_unique_name ()

+
const gchar *       g_dbus_connection_get_unique_name   (GDBusConnection *connection);
+

+Gets the unique name of connection as assigned by the message +bus. This can also be used to figure out if connection is a +message bus connection. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

Returns :

The unique name or NULL if connection is not a message +bus connection. Do not free this string, it is owned by +connection. + +
+

Since 2.26

+
+
+
+

enum GDBusCapabilityFlags

+
typedef enum {
+  G_DBUS_CAPABILITY_FLAGS_NONE = 0,
+  G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING = (1<<0)
+} GDBusCapabilityFlags;
+
+

+Capabilities negotiated with the remote peer. +

+
++ + + + + + + + + + +

G_DBUS_CAPABILITY_FLAGS_NONE

No flags set. +

G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING

The connection +supports exchanging UNIX file descriptors with the remote peer. +
+

Since 2.26

+
+
+
+

g_dbus_connection_get_capabilities ()

+
GDBusCapabilityFlags  g_dbus_connection_get_capabilities
+                                                        (GDBusConnection *connection);
+

+Gets the capabilities negotiated with the remote peer +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

Returns :

Zero or more flags from the GDBusCapabilityFlags enumeration. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_get_peer_credentials ()

+
GCredentials *      g_dbus_connection_get_peer_credentials
+                                                        (GDBusConnection *connection);
+

+Gets the credentials of the authenticated peer. This will always +return NULL unless connection acted as a server +(e.g. G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed) +when set up and the client passed credentials as part of the +authentication process. +

+

+In a message bus setup, the message bus is always the server and +each application is a client. So this method will always return +NULL for message bus clients. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

Returns :

A GCredentials or NULL if not available. Do not free +this object, it is owned by connection. [transfer none] +
+

Since 2.26

+
+
+
+

enum GDBusCallFlags

+
typedef enum {
+  G_DBUS_CALL_FLAGS_NONE = 0,
+  G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0)
+} GDBusCallFlags;
+
+

+Flags used in g_dbus_connection_call() and similar APIs. +

+
++ + + + + + + + + + +

G_DBUS_CALL_FLAGS_NONE

No flags set. +

G_DBUS_CALL_FLAGS_NO_AUTO_START

The bus must not launch +an owner for the destination name in response to this method +invocation. +
+

Since 2.26

+
+
+
+

g_dbus_connection_call ()

+
void                g_dbus_connection_call              (GDBusConnection *connection,
+                                                         const gchar *bus_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         const GVariantType *reply_type,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously invokes the method_name method on the +interface_name D-Bus interface on the remote object at +object_path owned by bus_name. +

+

+If connection is closed then the operation will fail with +G_IO_ERROR_CLOSED. If cancellable is canceled, the operation will +fail with G_IO_ERROR_CANCELLED. If parameters contains a value +not compatible with the D-Bus protocol, the operation fails with +G_IO_ERROR_INVALID_ARGUMENT. +

+

+If reply_type is non-NULL then the reply will be checked for having this type and an +error will be raised if it does not match. Said another way, if you give a reply_type +then any non-NULL return value will be of this type. +

+

+If the parameters GVariant is floating, it is consumed. This allows +convenient 'inline' use of g_variant_new(), e.g.: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
g_dbus_connection_call (connection,
+                        "org.freedesktop.StringThings",
+                        "/org/freedesktop/StringThings",
+                        "org.freedesktop.StringThings",
+                        "TwoStrings",
+                        g_variant_new ("(ss)",
+                                       "Thing One",
+                                       "Thing Two"),
+                        NULL,
+                        G_DBUS_CALL_FLAGS_NONE,
+                        -1,
+                        NULL,
+                        (GAsyncReadyCallback) two_strings_done,
+                        NULL);
+
+ +

+

+

+This is an asynchronous method. When the operation is finished, callback will be invoked +in the thread-default main loop +of the thread you are calling this method from. You can then call +g_dbus_connection_call_finish() to get the result of the operation. +See g_dbus_connection_call_sync() for the synchronous version of this +function. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

bus_name :

A unique or well-known bus name or NULL if connection is not a message bus connection. +

object_path :

Path of remote object. +

interface_name :

D-Bus interface to invoke method on. +

method_name :

The name of the method to invoke. +

parameters :

A GVariant tuple with parameters for the method or NULL if not passing parameters. +

reply_type :

The expected type of the reply, or NULL. +

flags :

Flags from the GDBusCallFlags enumeration. +

timeout_msec :

The timeout in milliseconds, -1 to use the default + timeout or G_MAXINT for no timeout. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't +care about the result of the method invocation. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_connection_call_finish ()

+
GVariant *          g_dbus_connection_call_finish       (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_connection_call(). +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_connection_call(). +

error :

Return location for error or NULL. +

Returns :

NULL if error is set. Otherwise a GVariant tuple with +return values. Free with g_variant_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_call_sync ()

+
GVariant *          g_dbus_connection_call_sync         (GDBusConnection *connection,
+                                                         const gchar *bus_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         const GVariantType *reply_type,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously invokes the method_name method on the +interface_name D-Bus interface on the remote object at +object_path owned by bus_name. +

+

+If connection is closed then the operation will fail with +G_IO_ERROR_CLOSED. If cancellable is canceled, the +operation will fail with G_IO_ERROR_CANCELLED. If parameters +contains a value not compatible with the D-Bus protocol, the operation +fails with G_IO_ERROR_INVALID_ARGUMENT. +

+

+If reply_type is non-NULL then the reply will be checked for having +this type and an error will be raised if it does not match. Said +another way, if you give a reply_type then any non-NULL return +value will be of this type. +

+

+If the parameters GVariant is floating, it is consumed. +This allows convenient 'inline' use of g_variant_new(), e.g.: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
g_dbus_connection_call_sync (connection,
+                             "org.freedesktop.StringThings",
+                             "/org/freedesktop/StringThings",
+                             "org.freedesktop.StringThings",
+                             "TwoStrings",
+                             g_variant_new ("(ss)",
+                                            "Thing One",
+                                            "Thing Two"),
+                             NULL,
+                             G_DBUS_CALL_FLAGS_NONE,
+                             -1,
+                             NULL,
+                             &error);
+
+ +

+

+

+The calling thread is blocked until a reply is received. See +g_dbus_connection_call() for the asynchronous version of +this method. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

bus_name :

A unique or well-known bus name. +

object_path :

Path of remote object. +

interface_name :

D-Bus interface to invoke method on. +

method_name :

The name of the method to invoke. +

parameters :

A GVariant tuple with parameters for the method or NULL if not passing parameters. +

reply_type :

The expected type of the reply, or NULL. +

flags :

Flags from the GDBusCallFlags enumeration. +

timeout_msec :

The timeout in milliseconds, -1 to use the default + timeout or G_MAXINT for no timeout. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

NULL if error is set. Otherwise a GVariant tuple with +return values. Free with g_variant_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_emit_signal ()

+
gboolean            g_dbus_connection_emit_signal       (GDBusConnection *connection,
+                                                         const gchar *destination_bus_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *signal_name,
+                                                         GVariant *parameters,
+                                                         GError **error);
+

+Emits a signal. +

+

+If the parameters GVariant is floating, it is consumed. +

+

+This can only fail if parameters is not compatible with the D-Bus protocol. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

destination_bus_name :

The unique bus name for the destination for the signal or NULL to emit to all listeners. +

object_path :

Path of remote object. +

interface_name :

D-Bus interface to emit a signal on. +

signal_name :

The name of the signal to emit. +

parameters :

A GVariant tuple with parameters for the signal or NULL if not passing parameters. +

error :

Return location for error or NULL. +

Returns :

TRUE unless error is set. + +
+

Since 2.26

+
+
+
+

enum GDBusSignalFlags

+
typedef enum /*< flags >*/
+{
+  G_DBUS_SIGNAL_FLAGS_NONE = 0,
+  G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE = (1<<0)
+} GDBusSignalFlags;
+
+

+Flags used when subscribing to signals via g_dbus_connection_signal_subscribe(). +

+
++ + + + + + + + + + +

G_DBUS_SIGNAL_FLAGS_NONE

No flags set. +

G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE

Don't actually send the AddMatch +DBus call for this signal subscription. This gives you more control +over which match rules you add (but you must add them manually). +
+

Since 2.26

+
+
+
+

GDBusSignalCallback ()

+
void                (*GDBusSignalCallback)              (GDBusConnection *connection,
+                                                         const gchar *sender_name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *signal_name,
+                                                         GVariant *parameters,
+                                                         gpointer user_data);
+

+Signature for callback function used in g_dbus_connection_signal_subscribe(). +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender_name :

The unique bus name of the sender of the signal. +

object_path :

The object path that the signal was emitted on. +

interface_name :

The name of the interface. +

signal_name :

The name of the signal. +

parameters :

A GVariant tuple with parameters for the signal. +

user_data :

User data passed when subscribing to the signal. +
+

Since 2.26

+
+
+
+

g_dbus_connection_signal_subscribe ()

+
guint               g_dbus_connection_signal_subscribe  (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *interface_name,
+                                                         const gchar *member,
+                                                         const gchar *object_path,
+                                                         const gchar *arg0,
+                                                         GDBusSignalFlags flags,
+                                                         GDBusSignalCallback callback,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+

+Subscribes to signals on connection and invokes callback with a +whenever the signal is received. Note that callback +will be invoked in the thread-default main +loop of the thread you are calling this method from. +

+

+If connection is not a message bus connection, sender must be +NULL. +

+

+If sender is a well-known name note that callback is invoked with +the unique name for the owner of sender, not the well-known name +as one would expect. This is because the message bus rewrites the +name. As such, to avoid certain race conditions, users should be +tracking the name owner of the well-known name and use that when +processing the received signal. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

Sender name to match on (unique or well-known name) or NULL to listen from all senders. +

interface_name :

D-Bus interface name to match on or NULL to match on all interfaces. +

member :

D-Bus signal name to match on or NULL to match on all signals. +

object_path :

Object path to match on or NULL to match on all object paths. +

arg0 :

Contents of first string argument to match on or NULL to match on all kinds of arguments. +

flags :

Flags describing how to subscribe to the signal (currently unused). +

callback :

Callback to invoke when there is a signal matching the requested data. +

user_data :

User data to pass to callback. +

user_data_free_func :

Function to free user_data with when subscription is removed or NULL. +

Returns :

A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_signal_unsubscribe ()

+
void                g_dbus_connection_signal_unsubscribe
+                                                        (GDBusConnection *connection,
+                                                         guint subscription_id);
+

+Unsubscribes from signals. +

+
++ + + + + + + + + + +

connection :

A GDBusConnection. +

subscription_id :

A subscription id obtained from g_dbus_connection_signal_subscribe(). +
+

Since 2.26

+
+
+
+

enum GDBusSendMessageFlags

+
typedef enum
+{
+  G_DBUS_SEND_MESSAGE_FLAGS_NONE = 0,
+  G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL = (1<<0)
+} GDBusSendMessageFlags;
+
+

+Flags used when sending GDBusMessages on a GDBusConnection. +

+
++ + + + + + + + + + +

G_DBUS_SEND_MESSAGE_FLAGS_NONE

No flags set. +

G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL

Do not automatically +assign a serial number from the GDBusConnection object when +sending a message. +
+

Since 2.26

+
+
+
+

g_dbus_connection_send_message ()

+
gboolean            g_dbus_connection_send_message      (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         GDBusSendMessageFlags flags,
+                                                         volatile guint32 *out_serial,
+                                                         GError **error);
+

+Asynchronously sends message to the peer represented by connection. +

+

+Unless flags contain the +G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number +will be assigned by connection and set on message via +g_dbus_message_set_serial(). If out_serial is not NULL, then the +serial number used will be written to this location prior to +submitting the message to the underlying transport. +

+

+If connection is closed then the operation will fail with +G_IO_ERROR_CLOSED. If message is not well-formed, +the operation fails with G_IO_ERROR_INVALID_ARGUMENT. +

+

+See Example 2, “D-Bus server example” and Example 4, “D-Bus UNIX File Descriptor example” for an example of how to use this +low-level API to send and receive UNIX file descriptors. +

+

+Note that message must be unlocked, unless flags contain the +G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

message :

A GDBusMessage +

flags :

Flags affecting how the message is sent. +

out_serial :

Return location for serial number assigned to message when sending it or NULL. +

error :

Return location for error or NULL. +

Returns :

TRUE if the message was well-formed and queued for +transmission, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_send_message_with_reply ()

+
void                g_dbus_connection_send_message_with_reply
+                                                        (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         GDBusSendMessageFlags flags,
+                                                         gint timeout_msec,
+                                                         volatile guint32 *out_serial,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously sends message to the peer represented by connection. +

+

+Unless flags contain the +G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number +will be assigned by connection and set on message via +g_dbus_message_set_serial(). If out_serial is not NULL, then the +serial number used will be written to this location prior to +submitting the message to the underlying transport. +

+

+If connection is closed then the operation will fail with +G_IO_ERROR_CLOSED. If cancellable is canceled, the operation will +fail with G_IO_ERROR_CANCELLED. If message is not well-formed, +the operation fails with G_IO_ERROR_INVALID_ARGUMENT. +

+

+This is an asynchronous method. When the operation is finished, callback will be invoked +in the thread-default main loop +of the thread you are calling this method from. You can then call +g_dbus_connection_send_message_with_reply_finish() to get the result of the operation. +See g_dbus_connection_send_message_with_reply_sync() for the synchronous version. +

+

+Note that message must be unlocked, unless flags contain the +G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. +

+

+See Example 2, “D-Bus server example” and Example 4, “D-Bus UNIX File Descriptor example” for an example of how to use this +low-level API to send and receive UNIX file descriptors. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

message :

A GDBusMessage. +

flags :

Flags affecting how the message is sent. +

timeout_msec :

The timeout in milliseconds, -1 to use the default + timeout or G_MAXINT for no timeout. +

out_serial :

Return location for serial number assigned to message when sending it or NULL. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't +care about the result. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_connection_send_message_with_reply_finish ()

+
GDBusMessage *      g_dbus_connection_send_message_with_reply_finish
+                                                        (GDBusConnection *connection,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_connection_send_message_with_reply(). +

+

+Note that error is only set if a local in-process error +occured. That is to say that the returned GDBusMessage object may +be of type G_DBUS_MESSAGE_TYPE_ERROR. Use +g_dbus_message_to_gerror() to transcode this to a GError. +

+

+See Example 2, “D-Bus server example” and Example 4, “D-Bus UNIX File Descriptor example” for an example of how to use this +low-level API to send and receive UNIX file descriptors. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

a GDBusConnection +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply(). +

error :

Return location for error or NULL. +

Returns :

A locked GDBusMessage or NULL if error is set. [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_connection_send_message_with_reply_sync ()

+
GDBusMessage *      g_dbus_connection_send_message_with_reply_sync
+                                                        (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         GDBusSendMessageFlags flags,
+                                                         gint timeout_msec,
+                                                         volatile guint32 *out_serial,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously sends message to the peer represented by connection +and blocks the calling thread until a reply is received or the +timeout is reached. See g_dbus_connection_send_message_with_reply() +for the asynchronous version of this method. +

+

+Unless flags contain the +G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number +will be assigned by connection and set on message via +g_dbus_message_set_serial(). If out_serial is not NULL, then the +serial number used will be written to this location prior to +submitting the message to the underlying transport. +

+

+If connection is closed then the operation will fail with +G_IO_ERROR_CLOSED. If cancellable is canceled, the operation will +fail with G_IO_ERROR_CANCELLED. If message is not well-formed, +the operation fails with G_IO_ERROR_INVALID_ARGUMENT. +

+

+Note that error is only set if a local in-process error +occured. That is to say that the returned GDBusMessage object may +be of type G_DBUS_MESSAGE_TYPE_ERROR. Use +g_dbus_message_to_gerror() to transcode this to a GError. +

+

+See Example 2, “D-Bus server example” and Example 4, “D-Bus UNIX File Descriptor example” for an example of how to use this +low-level API to send and receive UNIX file descriptors. +

+

+Note that message must be unlocked, unless flags contain the +G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

message :

A GDBusMessage. +

flags :

Flags affecting how the message is sent. +

timeout_msec :

The timeout in milliseconds, -1 to use the default + timeout or G_MAXINT for no timeout. +

out_serial :

Return location for serial number assigned to message when sending it or NULL. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A locked GDBusMessage that is the reply to message or NULL if error is set. [transfer full] +
+

Since 2.26

+
+
+
+

GDBusMessageFilterFunction ()

+
GDBusMessage *      (*GDBusMessageFilterFunction)       (GDBusConnection *connection,
+                                                         GDBusMessage *message,
+                                                         gboolean incoming,
+                                                         gpointer user_data);
+

+Signature for function used in g_dbus_connection_add_filter(). +

+

+A filter function is passed a GDBusMessage and expected to return +a GDBusMessage too. Passive filter functions that don't modify the +message can simply return the message object: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
static GDBusMessage *
+passive_filter (GDBusConnection *connection
+                GDBusMessage    *message,
+                gboolean         incoming,
+                gpointer         user_data)
+{
+  /* inspect @message */
+  return message;
+}
+
+ +

+Filter functions that wants to drop a message can simply return NULL: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
static GDBusMessage *
+drop_filter (GDBusConnection *connection
+             GDBusMessage    *message,
+             gboolean         incoming,
+             gpointer         user_data)
+{
+  if (should_drop_message)
+    {
+      g_object_unref (message);
+      message = NULL;
+    }
+  return message;
+}
+
+ +

+Finally, a filter function may modify a message by copying it: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
static GDBusMessage *
+modifying_filter (GDBusConnection *connection
+                  GDBusMessage    *message,
+                  gboolean         incoming,
+                  gpointer         user_data)
+{
+  GDBusMessage *copy;
+  GError *error;
+
+  error = NULL;
+  copy = g_dbus_message_copy (message, &error);
+  /* handle @error being is set */
+  g_object_unref (message);
+
+  /* modify @copy */
+
+  return copy;
+}
+
+ +

+If the returned GDBusMessage is different from message and cannot +be sent on connection (it could use features, such as file +descriptors, not compatible with connection), then a warning is +logged to standard error. Applications can +check this ahead of time using g_dbus_message_to_blob() passing a +GDBusCapabilityFlags value obtained from connection. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. [transfer none] +

message :

A locked GDBusMessage that the filter function takes ownership of. [transfer full] +

incoming :

+TRUE if it is a message received from the other peer, FALSE if it is +a message to be sent to the other peer. +

user_data :

User data passed when adding the filter. +

Returns :

A GDBusMessage that will be freed with +g_object_unref() or NULL to drop the message. Passive filter +functions can simply return the passed message object. [transfer full][allow-none] +
+

Since 2.26

+
+
+
+

g_dbus_connection_add_filter ()

+
guint               g_dbus_connection_add_filter        (GDBusConnection *connection,
+                                                         GDBusMessageFilterFunction filter_function,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+

+Adds a message filter. Filters are handlers that are run on all +incoming and outgoing messages, prior to standard dispatch. Filters +are run in the order that they were added. The same handler can be +added as a filter more than once, in which case it will be run more +than once. Filters added during a filter callback won't be run on +the message being processed. Filter functions are allowed to modify +and even drop messages - see the GDBusMessageFilterResult +enumeration for details. +

+

+Note that filters are run in a dedicated message handling thread so +they can't block and, generally, can't do anything but signal a +worker thread. Also note that filters are rarely needed - use API +such as g_dbus_connection_send_message_with_reply(), +g_dbus_connection_signal_subscribe() or +g_dbus_connection_call() instead. +

+

+If a filter consumes an incoming message the message is not +dispatched anywhere else - not even the standard dispatch machinery +(that API such as g_dbus_connection_signal_subscribe() and +g_dbus_connection_send_message_with_reply() relies on) will see the +message. Similary, if a filter consumes an outgoing message, the +message will not be sent to the other peer. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

filter_function :

A filter function. +

user_data :

User data to pass to filter_function. +

user_data_free_func :

Function to free user_data with when filter +is removed or NULL. +

Returns :

A filter identifier that can be used with +g_dbus_connection_remove_filter(). + +
+

Since 2.26

+
+
+
+

g_dbus_connection_remove_filter ()

+
void                g_dbus_connection_remove_filter     (GDBusConnection *connection,
+                                                         guint filter_id);
+

+Removes a filter. +

+
++ + + + + + + + + + +

connection :

a GDBusConnection +

filter_id :

an identifier obtained from g_dbus_connection_add_filter() +
+

Since 2.26

+
+
+
+

GDBusInterfaceVTable

+
typedef struct {
+  GDBusInterfaceMethodCallFunc  method_call;
+  GDBusInterfaceGetPropertyFunc get_property;
+  GDBusInterfaceSetPropertyFunc set_property;
+} GDBusInterfaceVTable;
+
+

+Virtual table for handling properties and method calls for a D-Bus +interface. +

+

+If you want to handle getting/setting D-Bus properties asynchronously, simply +register an object with the org.freedesktop.DBus.Properties +D-Bus interface using g_dbus_connection_register_object(). +

+
++ + + + + + + + + + + + + + +

GDBusInterfaceMethodCallFunc method_call;

Function for handling incoming method calls. +

GDBusInterfaceGetPropertyFunc get_property;

Function for getting a property. +

GDBusInterfaceSetPropertyFunc set_property;

Function for setting a property. +
+

Since 2.26

+
+
+
+

GDBusInterfaceMethodCallFunc ()

+
void                (*GDBusInterfaceMethodCallFunc)     (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         GDBusMethodInvocation *invocation,
+                                                         gpointer user_data);
+

+The type of the method_call function in GDBusInterfaceVTable. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

The unique bus name of the remote caller. +

object_path :

The object path that the method was invoked on. +

interface_name :

The D-Bus interface name the method was invoked on. +

method_name :

The name of the method that was invoked. +

parameters :

A GVariant tuple with parameters. +

invocation :

A GDBusMethodInvocation object that can be used to return a value or error. +

user_data :

The user_data gpointer passed to g_dbus_connection_register_object(). +
+

Since 2.26

+
+
+
+

GDBusInterfaceGetPropertyFunc ()

+
GVariant *          (*GDBusInterfaceGetPropertyFunc)    (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *property_name,
+                                                         GError **error,
+                                                         gpointer user_data);
+

+The type of the get_property function in GDBusInterfaceVTable. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

The unique bus name of the remote caller. +

object_path :

The object path that the method was invoked on. +

interface_name :

The D-Bus interface name for the property. +

property_name :

The name of the property to get the value of. +

error :

Return location for error. +

user_data :

The user_data gpointer passed to g_dbus_connection_register_object(). +

Returns :

A GVariant with the value for property_name or NULL if + error is set. If the returned GVariant is floating, it is + consumed - otherwise its reference count is decreased by one. + +
+

Since 2.26

+
+
+
+

GDBusInterfaceSetPropertyFunc ()

+
gboolean            (*GDBusInterfaceSetPropertyFunc)    (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *property_name,
+                                                         GVariant *value,
+                                                         GError **error,
+                                                         gpointer user_data);
+

+The type of the set_property function in GDBusInterfaceVTable. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

The unique bus name of the remote caller. +

object_path :

The object path that the method was invoked on. +

interface_name :

The D-Bus interface name for the property. +

property_name :

The name of the property to get the value of. +

value :

The value to set the property to. +

error :

Return location for error. +

user_data :

The user_data gpointer passed to g_dbus_connection_register_object(). +

Returns :

TRUE if the property was set to value, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_connection_register_object ()

+
guint               g_dbus_connection_register_object   (GDBusConnection *connection,
+                                                         const gchar *object_path,
+                                                         GDBusInterfaceInfo *interface_info,
+                                                         const GDBusInterfaceVTable *vtable,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func,
+                                                         GError **error);
+

+Registers callbacks for exported objects at object_path with the +D-Bus interface that is described in interface_info. +

+

+Calls to functions in vtable (and user_data_free_func) will +happen in the thread-default main +loop of the thread you are calling this method from. +

+

+Note that all GVariant values passed to functions in vtable will match +the signature given in interface_info - if a remote caller passes +incorrect values, the org.freedesktop.DBus.Error.InvalidArgs +is returned to the remote caller. +

+

+Additionally, if the remote caller attempts to invoke methods or +access properties not mentioned in interface_info the +org.freedesktop.DBus.Error.UnknownMethod resp. +org.freedesktop.DBus.Error.InvalidArgs errors +are returned to the caller. +

+

+It is considered a programming error if the +GDBusInterfaceGetPropertyFunc function in vtable returns a +GVariant of incorrect type. +

+

+If an existing callback is already registered at object_path and +interface_name, then error is set to G_IO_ERROR_EXISTS. +

+

+GDBus automatically implements the standard D-Bus interfaces +org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable +and org.freedesktop.Peer, so you don't have to implement those for +the objects you export. You can implement +org.freedesktop.DBus.Properties yourself, e.g. to handle getting +and setting of properties asynchronously. +

+

+Note that the reference count on interface_info will be +incremented by 1 (unless allocated statically, e.g. if the +reference count is -1, see g_dbus_interface_info_ref()) for as long +as the object is exported. Also note that vtable will be copied. +

+

+See Example 2, “D-Bus server example” for an example of how to use this method. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

object_path :

The object path to register at. +

interface_info :

Introspection data for the interface. +

vtable :

A GDBusInterfaceVTable to call into or NULL. +

user_data :

Data to pass to functions in vtable. +

user_data_free_func :

Function to call when the object path is unregistered. +

error :

Return location for error or NULL. +

Returns :

0 if error is set, otherwise a registration id (never 0) +that can be used with g_dbus_connection_unregister_object() . + +
+

Since 2.26

+
+
+
+

g_dbus_connection_unregister_object ()

+
gboolean            g_dbus_connection_unregister_object (GDBusConnection *connection,
+                                                         guint registration_id);
+

+Unregisters an object. +

+
++ + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

registration_id :

A registration id obtained from g_dbus_connection_register_object(). +

Returns :

TRUE if the object was unregistered, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

GDBusSubtreeVTable

+
typedef struct {
+  GDBusSubtreeEnumerateFunc  enumerate;
+  GDBusSubtreeIntrospectFunc introspect;
+  GDBusSubtreeDispatchFunc   dispatch;
+} GDBusSubtreeVTable;
+
+

+Virtual table for handling subtrees registered with g_dbus_connection_register_subtree(). +

+
++ + + + + + + + + + + + + + +

GDBusSubtreeEnumerateFunc enumerate;

Function for enumerating child nodes. +

GDBusSubtreeIntrospectFunc introspect;

Function for introspecting a child node. +

GDBusSubtreeDispatchFunc dispatch;

Function for dispatching a remote call on a child node. +
+

Since 2.26

+
+
+
+

GDBusSubtreeEnumerateFunc ()

+
gchar **            (*GDBusSubtreeEnumerateFunc)        (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         gpointer user_data);
+

+The type of the enumerate function in GDBusSubtreeVTable. +

+

+This function is called when generating introspection data and also +when preparing to dispatch incoming messages in the event that the +G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not +specified (ie: to verify that the object path is valid). +

+

+Hierarchies are not supported; the items that you return should not +contain the '/' character. +

+

+The return value will be freed with g_strfreev(). +

+
++ + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

The unique bus name of the remote caller. +

object_path :

The object path that was registered with g_dbus_connection_register_subtree(). +

user_data :

The user_data gpointer passed to g_dbus_connection_register_subtree(). +

Returns :

A newly allocated array of strings for node names that are children of object_path. + +
+

Since 2.26

+
+
+
+

GDBusSubtreeIntrospectFunc ()

+
GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc)     (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *node,
+                                                         gpointer user_data);
+

+The type of the introspect function in GDBusSubtreeVTable. +

+

+Subtrees are flat. node, if non-NULL, is always exactly one +segment of the object path (ie: it never contains a slash). +

+

+This function should return NULL to indicate that there is no object +at this node. +

+

+If this function returns non-NULL, the return value is expected to +be a NULL-terminated array of pointers to GDBusInterfaceInfo +structures describing the interfaces implemented by node. This +array will have g_dbus_interface_info_unref() called on each item +before being freed with g_free(). +

+

+The difference between returning NULL and an array containing zero +items is that the standard DBus interfaces will returned to the +remote introspector in the empty array case, but not in the NULL +case. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

The unique bus name of the remote caller. +

object_path :

The object path that was registered with g_dbus_connection_register_subtree(). +

node :

A node that is a child of object_path (relative to object_path) or NULL for the root of the subtree. +

user_data :

The user_data gpointer passed to g_dbus_connection_register_subtree(). +

Returns :

A NULL-terminated array of pointers to GDBusInterfaceInfo, or NULL. + +
+

Since 2.26

+
+
+
+

GDBusSubtreeDispatchFunc ()

+
const GDBusInterfaceVTable * (*GDBusSubtreeDispatchFunc)
+                                                        (GDBusConnection *connection,
+                                                         const gchar *sender,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         const gchar *node,
+                                                         gpointer *out_user_data,
+                                                         gpointer user_data);
+

+The type of the dispatch function in GDBusSubtreeVTable. +

+

+Subtrees are flat. node, if non-NULL, is always exactly one +segment of the object path (ie: it never contains a slash). +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

sender :

The unique bus name of the remote caller. +

object_path :

The object path that was registered with g_dbus_connection_register_subtree(). +

interface_name :

The D-Bus interface name that the method call or property access is for. +

node :

A node that is a child of object_path (relative to object_path) or NULL for the root of the subtree. +

out_user_data :

Return location for user data to pass to functions in the returned GDBusInterfaceVTable (never NULL). +

user_data :

The user_data gpointer passed to g_dbus_connection_register_subtree(). +

Returns :

A GDBusInterfaceVTable or NULL if you don't want to handle the methods. + +
+

Since 2.26

+
+
+
+

enum GDBusSubtreeFlags

+
typedef enum
+{
+  G_DBUS_SUBTREE_FLAGS_NONE = 0,
+  G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES = (1<<0)
+} GDBusSubtreeFlags;
+
+

+Flags passed to g_dbus_connection_register_subtree(). +

+
++ + + + + + + + + + +

G_DBUS_SUBTREE_FLAGS_NONE

No flags set. +

G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES

Method calls to objects not in the enumerated range + will still be dispatched. This is useful if you want + to dynamically spawn objects in the subtree. +
+

Since 2.26

+
+
+
+

g_dbus_connection_register_subtree ()

+
guint               g_dbus_connection_register_subtree  (GDBusConnection *connection,
+                                                         const gchar *object_path,
+                                                         const GDBusSubtreeVTable *vtable,
+                                                         GDBusSubtreeFlags flags,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func,
+                                                         GError **error);
+

+Registers a whole subtree of “dynamic” objects. +

+

+The enumerate and introspection functions in vtable are used to +convey, to remote callers, what nodes exist in the subtree rooted +by object_path. +

+

+When handling remote calls into any node in the subtree, first the +enumerate function is used to check if the node exists. If the node exists +or the G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set +the introspection function is used to check if the node supports the +requested method. If so, the dispatch function is used to determine +where to dispatch the call. The collected GDBusInterfaceVTable and +gpointer will be used to call into the interface vtable for processing +the request. +

+

+All calls into user-provided code will be invoked in the thread-default main +loop of the thread you are calling this method from. +

+

+If an existing subtree is already registered at object_path or +then error is set to G_IO_ERROR_EXISTS. +

+

+Note that it is valid to register regular objects (using +g_dbus_connection_register_object()) in a subtree registered with +g_dbus_connection_register_subtree() - if so, the subtree handler +is tried as the last resort. One way to think about a subtree +handler is to consider it a “fallback handler” +for object paths not registered via g_dbus_connection_register_object() +or other bindings. +

+

+Note that vtable will be copied so you cannot change it after +registration. +

+

+See Example 3, “D-Bus subtree example” for an example of how to use this method. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

object_path :

The object path to register the subtree at. +

vtable :

A GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree. +

flags :

Flags used to fine tune the behavior of the subtree. +

user_data :

Data to pass to functions in vtable. +

user_data_free_func :

Function to call when the subtree is unregistered. +

error :

Return location for error or NULL. +

Returns :

0 if error is set, otherwise a subtree registration id (never 0) +that can be used with g_dbus_connection_unregister_subtree() . + +
+

Since 2.26

+
+
+
+

g_dbus_connection_unregister_subtree ()

+
gboolean            g_dbus_connection_unregister_subtree
+                                                        (GDBusConnection *connection,
+                                                         guint registration_id);
+

+Unregisters a subtree. +

+
++ + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

registration_id :

A subtree registration id obtained from g_dbus_connection_register_subtree(). +

Returns :

TRUE if the subtree was unregistered, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "address" property

+
  "address"                  gchar*                : Write / Construct Only
+

+A D-Bus address specifying potential endpoints that can be used +when establishing the connection. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "authentication-observer" property

+
  "authentication-observer"  GDBusAuthObserver*    : Write / Construct Only
+

+A GDBusAuthObserver object to assist in the authentication process or NULL. +

+

Since 2.26

+
+
+
+

The "capabilities" property

+
  "capabilities"             GDBusCapabilityFlags  : Read
+

+Flags from the GDBusCapabilityFlags enumeration +representing connection features negotiated with the other peer. +

+

Since 2.26

+
+
+
+

The "closed" property

+
  "closed"                   gboolean              : Read
+

+A boolean specifying whether the connection has been closed. +

+

Default value: FALSE

+

Since 2.26

+
+
+
+

The "exit-on-close" property

+
  "exit-on-close"            gboolean              : Read / Write
+

+A boolean specifying whether the process will be terminated (by +calling raise(SIGTERM)) if the connection +is closed by the remote peer. +

+

Default value: FALSE

+

Since 2.26

+
+
+
+

The "flags" property

+
  "flags"                    GDBusConnectionFlags  : Write / Construct Only
+

+Flags from the GDBusConnectionFlags enumeration. +

+

Since 2.26

+
+
+
+

The "guid" property

+
  "guid"                     gchar*                : Read / Write / Construct Only
+

+The GUID of the peer performing the role of server when +authenticating. +

+

+If you are constructing a GDBusConnection and pass +G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the +"flags" property then you MUST also set this +property to a valid guid. +

+

+If you are constructing a GDBusConnection and pass +G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the +"flags" property you will be able to read the GUID +of the other peer here after the connection has been successfully +initialized. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "stream" property

+
  "stream"                   GIOStream*            : Read / Write / Construct Only
+

+The underlying GIOStream used for I/O. +

+

Since 2.26

+
+
+
+

The "unique-name" property

+
  "unique-name"              gchar*                : Read
+

+The unique name as assigned by the message bus or NULL if the +connection is not open or not a message bus connection. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

Signal Details

+
+

The "closed" signal

+
void                user_function                      (GDBusConnection *connection,
+                                                        gboolean         remote_peer_vanished,
+                                                        GError          *error,
+                                                        gpointer         user_data)                 : Run Last
+

+Emitted when the connection is closed. +

+

+The cause of this event can be +

+
    +
  • + If g_dbus_connection_close() is called. In this case + remote_peer_vanished is set to FALSE and error is NULL. +

  • +
  • + If the remote peer closes the connection. In this case + remote_peer_vanished is set to TRUE and error is set. +

  • +
  • + If the remote peer sends invalid or malformed data. In this + case remote_peer_vanished is set to FALSE and error + is set. +

  • +
+

+

+

+Upon receiving this signal, you should give up your reference to +connection. You are guaranteed that this signal is emitted only +once. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

The GDBusConnection emitting the signal. +

remote_peer_vanished :

+TRUE if connection is closed because the +remote peer closed its end of the connection. +

error :

A GError with more details about the event or NULL. +

user_data :

user data set when the signal handler was connected.
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDBusMessage.html b/docs/reference/gio/html/GDBusMessage.html new file mode 100644 index 0000000..e5a07e3 --- /dev/null +++ b/docs/reference/gio/html/GDBusMessage.html @@ -0,0 +1,1827 @@ + + + + +GDBusMessage + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusMessage

+

GDBusMessage — D-Bus Message

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GDBusMessage;
+enum                GDBusMessageType;
+enum                GDBusMessageFlags;
+enum                GDBusMessageHeaderField;
+enum                GDBusMessageByteOrder;
+GDBusMessage *      g_dbus_message_new                  (void);
+GDBusMessage *      g_dbus_message_new_signal           (const gchar *path,
+                                                         const gchar *interface_,
+                                                         const gchar *signal);
+GDBusMessage *      g_dbus_message_new_method_call      (const gchar *name,
+                                                         const gchar *path,
+                                                         const gchar *interface_,
+                                                         const gchar *method);
+GDBusMessage *      g_dbus_message_new_method_reply     (GDBusMessage *method_call_message);
+GDBusMessage *      g_dbus_message_new_method_error     (GDBusMessage *method_call_message,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message_format,
+                                                         ...);
+GDBusMessage *      g_dbus_message_new_method_error_valist
+                                                        (GDBusMessage *method_call_message,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message_format,
+                                                         va_list var_args);
+GDBusMessage *      g_dbus_message_new_method_error_literal
+                                                        (GDBusMessage *method_call_message,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message);
+gchar *             g_dbus_message_print                (GDBusMessage *message,
+                                                         guint indent);
+gboolean            g_dbus_message_get_locked           (GDBusMessage *message);
+void                g_dbus_message_lock                 (GDBusMessage *message);
+GDBusMessage *      g_dbus_message_copy                 (GDBusMessage *message,
+                                                         GError **error);
+GDBusMessageByteOrder  g_dbus_message_get_byte_order    (GDBusMessage *message);
+void                g_dbus_message_set_byte_order       (GDBusMessage *message,
+                                                         GDBusMessageByteOrder byte_order);
+GDBusMessageType    g_dbus_message_get_message_type     (GDBusMessage *message);
+void                g_dbus_message_set_message_type     (GDBusMessage *message,
+                                                         GDBusMessageType type);
+guint32             g_dbus_message_get_serial           (GDBusMessage *message);
+void                g_dbus_message_set_serial           (GDBusMessage *message,
+                                                         guint32 serial);
+GDBusMessageFlags   g_dbus_message_get_flags            (GDBusMessage *message);
+void                g_dbus_message_set_flags            (GDBusMessage *message,
+                                                         GDBusMessageFlags flags);
+GVariant *          g_dbus_message_get_body             (GDBusMessage *message);
+void                g_dbus_message_set_body             (GDBusMessage *message,
+                                                         GVariant *body);
+GUnixFDList *       g_dbus_message_get_unix_fd_list     (GDBusMessage *message);
+void                g_dbus_message_set_unix_fd_list     (GDBusMessage *message,
+                                                         GUnixFDList *fd_list);
+guint32             g_dbus_message_get_num_unix_fds     (GDBusMessage *message);
+void                g_dbus_message_set_num_unix_fds     (GDBusMessage *message,
+                                                         guint32 value);
+guchar *            g_dbus_message_get_header_fields    (GDBusMessage *message);
+GVariant *          g_dbus_message_get_header           (GDBusMessage *message,
+                                                         GDBusMessageHeaderField header_field);
+void                g_dbus_message_set_header           (GDBusMessage *message,
+                                                         GDBusMessageHeaderField header_field,
+                                                         GVariant *value);
+const gchar *       g_dbus_message_get_destination      (GDBusMessage *message);
+void                g_dbus_message_set_destination      (GDBusMessage *message,
+                                                         const gchar *value);
+const gchar *       g_dbus_message_get_error_name       (GDBusMessage *message);
+void                g_dbus_message_set_error_name       (GDBusMessage *message,
+                                                         const gchar *value);
+const gchar *       g_dbus_message_get_interface        (GDBusMessage *message);
+void                g_dbus_message_set_interface        (GDBusMessage *message,
+                                                         const gchar *value);
+const gchar *       g_dbus_message_get_member           (GDBusMessage *message);
+void                g_dbus_message_set_member           (GDBusMessage *message,
+                                                         const gchar *value);
+const gchar *       g_dbus_message_get_path             (GDBusMessage *message);
+void                g_dbus_message_set_path             (GDBusMessage *message,
+                                                         const gchar *value);
+guint32             g_dbus_message_get_reply_serial     (GDBusMessage *message);
+void                g_dbus_message_set_reply_serial     (GDBusMessage *message,
+                                                         guint32 value);
+const gchar *       g_dbus_message_get_sender           (GDBusMessage *message);
+void                g_dbus_message_set_sender           (GDBusMessage *message,
+                                                         const gchar *value);
+const gchar *       g_dbus_message_get_signature        (GDBusMessage *message);
+void                g_dbus_message_set_signature        (GDBusMessage *message,
+                                                         const gchar *value);
+const gchar *       g_dbus_message_get_arg0             (GDBusMessage *message);
+guchar *            g_dbus_message_to_blob              (GDBusMessage *message,
+                                                         gsize *out_size,
+                                                         GDBusCapabilityFlags capabilities,
+                                                         GError **error);
+gssize              g_dbus_message_bytes_needed         (guchar *blob,
+                                                         gsize blob_len,
+                                                         GError **error);
+GDBusMessage *      g_dbus_message_new_from_blob        (guchar *blob,
+                                                         gsize blob_len,
+                                                         GDBusCapabilityFlags capabilities,
+                                                         GError **error);
+gboolean            g_dbus_message_to_gerror            (GDBusMessage *message,
+                                                         GError **error);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GDBusMessage
+
+
+
+

Properties

+
+  "locked"                   gboolean              : Read
+
+
+
+

Description

+

+A type for representing D-Bus messages that can be sent or received +on a GDBusConnection. +

+
+
+

Details

+
+

GDBusMessage

+
typedef struct _GDBusMessage GDBusMessage;
+

+The GDBusMessage structure contains only private data and should +only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

enum GDBusMessageType

+
typedef enum {
+  G_DBUS_MESSAGE_TYPE_INVALID,
+  G_DBUS_MESSAGE_TYPE_METHOD_CALL,
+  G_DBUS_MESSAGE_TYPE_METHOD_RETURN,
+  G_DBUS_MESSAGE_TYPE_ERROR,
+  G_DBUS_MESSAGE_TYPE_SIGNAL
+} GDBusMessageType;
+
+

+Message types used in GDBusMessage. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

G_DBUS_MESSAGE_TYPE_INVALID

Message is of invalid type. +

G_DBUS_MESSAGE_TYPE_METHOD_CALL

Method call. +

G_DBUS_MESSAGE_TYPE_METHOD_RETURN

Method reply. +

G_DBUS_MESSAGE_TYPE_ERROR

Error reply. +

G_DBUS_MESSAGE_TYPE_SIGNAL

Signal emission. +
+

Since 2.26

+
+
+
+

enum GDBusMessageFlags

+
typedef enum {
+  G_DBUS_MESSAGE_FLAGS_NONE = 0,
+  G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED = (1<<0),
+  G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1)
+} GDBusMessageFlags;
+
+

+Message flags used in GDBusMessage. +

+
++ + + + + + + + + + + + + + +

G_DBUS_MESSAGE_FLAGS_NONE

No flags set. +

G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED

A reply is not expected. +

G_DBUS_MESSAGE_FLAGS_NO_AUTO_START

The bus must not launch an +owner for the destination name in response to this message. +
+

Since 2.26

+
+
+
+

enum GDBusMessageHeaderField

+
typedef enum {
+  G_DBUS_MESSAGE_HEADER_FIELD_INVALID,
+  G_DBUS_MESSAGE_HEADER_FIELD_PATH,
+  G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE,
+  G_DBUS_MESSAGE_HEADER_FIELD_MEMBER,
+  G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME,
+  G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL,
+  G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION,
+  G_DBUS_MESSAGE_HEADER_FIELD_SENDER,
+  G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE,
+  G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS
+} GDBusMessageHeaderField;
+
+

+Header fields used in GDBusMessage. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

G_DBUS_MESSAGE_HEADER_FIELD_INVALID

Not a valid header field. +

G_DBUS_MESSAGE_HEADER_FIELD_PATH

The object path. +

G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE

The interface name. +

G_DBUS_MESSAGE_HEADER_FIELD_MEMBER

The method or signal name. +

G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME

The name of the error that occurred. +

G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL

The serial number the message is a reply to. +

G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION

The name the message is intended for. +

G_DBUS_MESSAGE_HEADER_FIELD_SENDER

Unique name of the sender of the message (filled in by the bus). +

G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE

The signature of the message body. +

G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS

The number of UNIX file descriptors that accompany the message. +
+

Since 2.26

+
+
+
+

enum GDBusMessageByteOrder

+
typedef enum
+{
+  G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN    = 'B',
+  G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN = 'l'
+} GDBusMessageByteOrder;
+
+

+Enumeration used to describe the byte order of a D-Bus message. +

+
++ + + + + + + + + + +

G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN

The byte order is big endian. +

G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN

The byte order is little endian. +
+

Since 2.26

+
+
+
+

g_dbus_message_new ()

+
GDBusMessage *      g_dbus_message_new                  (void);
+

+Creates a new empty GDBusMessage. +

+
++ + + + +

Returns :

A GDBusMessage. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_new_signal ()

+
GDBusMessage *      g_dbus_message_new_signal           (const gchar *path,
+                                                         const gchar *interface_,
+                                                         const gchar *signal);
+

+Creates a new GDBusMessage for a signal emission. +

+
++ + + + + + + + + + + + + + + + + + +

path :

A valid object path. +

interface_ :

A valid D-Bus interface name. +

signal :

A valid signal name. +

Returns :

A GDBusMessage. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_new_method_call ()

+
GDBusMessage *      g_dbus_message_new_method_call      (const gchar *name,
+                                                         const gchar *path,
+                                                         const gchar *interface_,
+                                                         const gchar *method);
+

+Creates a new GDBusMessage for a method call. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

name :

A valid D-Bus name or NULL. +

path :

A valid object path. +

interface_ :

A valid D-Bus interface name or NULL. +

method :

A valid method name. +

Returns :

A GDBusMessage. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_new_method_reply ()

+
GDBusMessage *      g_dbus_message_new_method_reply     (GDBusMessage *method_call_message);
+

+Creates a new GDBusMessage that is a reply to method_call_message. +

+
++ + + + + + + + + + +

method_call_message :

A message of type G_DBUS_MESSAGE_TYPE_METHOD_CALL to +create a reply message to. +

Returns :

GDBusMessage. Free with g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_message_new_method_error ()

+
GDBusMessage *      g_dbus_message_new_method_error     (GDBusMessage *method_call_message,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message_format,
+                                                         ...);
+

+Creates a new GDBusMessage that is an error reply to method_call_message. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

method_call_message :

A message of type G_DBUS_MESSAGE_TYPE_METHOD_CALL to +create a reply message to. +

error_name :

A valid D-Bus error name. +

error_message_format :

The D-Bus error message in a printf() format. +

... :

Arguments for error_message_format. +

Returns :

A GDBusMessage. Free with g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_message_new_method_error_valist ()

+
GDBusMessage *      g_dbus_message_new_method_error_valist
+                                                        (GDBusMessage *method_call_message,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message_format,
+                                                         va_list var_args);
+

+Like g_dbus_message_new_method_error() but intended for language bindings. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

method_call_message :

A message of type G_DBUS_MESSAGE_TYPE_METHOD_CALL to +create a reply message to. +

error_name :

A valid D-Bus error name. +

error_message_format :

The D-Bus error message in a printf() format. +

var_args :

Arguments for error_message_format. +

Returns :

A GDBusMessage. Free with g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_message_new_method_error_literal ()

+
GDBusMessage *      g_dbus_message_new_method_error_literal
+                                                        (GDBusMessage *method_call_message,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message);
+

+Creates a new GDBusMessage that is an error reply to method_call_message. +

+
++ + + + + + + + + + + + + + + + + + +

method_call_message :

A message of type G_DBUS_MESSAGE_TYPE_METHOD_CALL to +create a reply message to. +

error_name :

A valid D-Bus error name. +

error_message :

The D-Bus error message. +

Returns :

A GDBusMessage. Free with g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_message_print ()

+
gchar *             g_dbus_message_print                (GDBusMessage *message,
+                                                         guint indent);
+

+Produces a human-readable multi-line description of message. +

+

+The contents of the description has no ABI guarantees, the contents +and formatting is subject to change at any time. Typical output +looks something like this: +

+
+Type:    method-call
+Flags:   none
+Version: 0
+Serial:  4
+Headers:
+  path -> objectpath '/org/gtk/GDBus/TestObject'
+  interface -> 'org.gtk.GDBus.TestInterface'
+  member -> 'GimmeStdout'
+  destination -> ':1.146'
+Body: ()
+UNIX File Descriptors:
+  (none)
+
+

+or +

+
+Type:    method-return
+Flags:   no-reply-expected
+Version: 0
+Serial:  477
+Headers:
+  reply-serial -> uint32 4
+  destination -> ':1.159'
+  sender -> ':1.146'
+  num-unix-fds -> uint32 1
+Body: ()
+UNIX File Descriptors:
+  fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
+
+

+

+
++ + + + + + + + + + + + + + +

message :

A GDBusMessage. +

indent :

Indentation level. +

Returns :

A string that should be freed with g_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_get_locked ()

+
gboolean            g_dbus_message_get_locked           (GDBusMessage *message);
+

+Checks whether message is locked. To monitor changes to this +value, conncet to the "notify" signal to listen for changes +on the "locked" property. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

TRUE if message is locked, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_message_lock ()

+
void                g_dbus_message_lock                 (GDBusMessage *message);
+

+If message is locked, does nothing. Otherwise locks the message. +

+
++ + + + +

message :

A GDBusMessage. +
+

Since 2.26

+
+
+
+

g_dbus_message_copy ()

+
GDBusMessage *      g_dbus_message_copy                 (GDBusMessage *message,
+                                                         GError **error);
+

+Copies message. The copy is a deep copy and the returned +GDBusMessage is completely identical except that it is guaranteed +to not be locked. +

+

+This operation can fail if e.g. message contains file descriptors +and the per-process or system-wide open files limit is reached. +

+
++ + + + + + + + + + + + + + +

message :

A GDBusMessage. +

error :

Return location for error or NULL. +

Returns :

A new GDBusMessage or NULL if error is set. Free with +g_object_unref(). [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_message_get_byte_order ()

+
GDBusMessageByteOrder  g_dbus_message_get_byte_order    (GDBusMessage *message);
+

+Gets the byte order of message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The byte order. +
+
+
+
+

g_dbus_message_set_byte_order ()

+
void                g_dbus_message_set_byte_order       (GDBusMessage *message,
+                                                         GDBusMessageByteOrder byte_order);
+

+Sets the byte order of message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

byte_order :

The byte order. +
+
+
+
+

g_dbus_message_get_message_type ()

+
GDBusMessageType    g_dbus_message_get_message_type     (GDBusMessage *message);
+

+Gets the type of message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

A 8-bit unsigned integer (typically a value from the GDBusMessageType enumeration). + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_message_type ()

+
void                g_dbus_message_set_message_type     (GDBusMessage *message,
+                                                         GDBusMessageType type);
+

+Sets message to be of type. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

type :

A 8-bit unsigned integer (typically a value from the GDBusMessageType enumeration). +
+

Since 2.26

+
+
+
+

g_dbus_message_get_serial ()

+
guint32             g_dbus_message_get_serial           (GDBusMessage *message);
+

+Gets the serial for message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

A guint32. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_serial ()

+
void                g_dbus_message_set_serial           (GDBusMessage *message,
+                                                         guint32 serial);
+

+Sets the serial for message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

serial :

A guint32. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_flags ()

+
GDBusMessageFlags   g_dbus_message_get_flags            (GDBusMessage *message);
+

+Gets the flags for message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

Flags that are set (typically values from the GDBusMessageFlags enumeration bitwise ORed together). + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_flags ()

+
void                g_dbus_message_set_flags            (GDBusMessage *message,
+                                                         GDBusMessageFlags flags);
+

+Sets the flags to set on message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

flags :

Flags for message that are set (typically values from the GDBusMessageFlags +enumeration bitwise ORed together). +
+

Since 2.26

+
+
+
+

g_dbus_message_get_body ()

+
GVariant *          g_dbus_message_get_body             (GDBusMessage *message);
+

+Gets the body of a message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

A GVariant or NULL if the body is empty. Do not free, it is owned by message. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_body ()

+
void                g_dbus_message_set_body             (GDBusMessage *message,
+                                                         GVariant *body);
+

+Sets the body message. As a side-effect the +G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the +type string of body (or cleared if body is NULL). +

+

+If body is floating, message assumes ownership of body. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

body :

Either NULL or a GVariant that is a tuple. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_unix_fd_list ()

+
GUnixFDList *       g_dbus_message_get_unix_fd_list     (GDBusMessage *message);
+

+Gets the UNIX file descriptors associated with message, if any. +

+

+This method is only available on UNIX. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

A GUnixFDList or NULL if no file descriptors are +associated. Do not free, this object is owned by message. [transfer none] +
+

Since 2.26

+
+
+
+

g_dbus_message_set_unix_fd_list ()

+
void                g_dbus_message_set_unix_fd_list     (GDBusMessage *message,
+                                                         GUnixFDList *fd_list);
+

+Sets the UNIX file descriptors associated with message. As a +side-effect the G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header +field is set to the number of fds in fd_list (or cleared if +fd_list is NULL). +

+

+This method is only available on UNIX. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

fd_list :

A GUnixFDList or NULL. [allow-none] +
+

Since 2.26

+
+
+
+

g_dbus_message_get_num_unix_fds ()

+
guint32             g_dbus_message_get_num_unix_fds     (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_num_unix_fds ()

+
void                g_dbus_message_set_num_unix_fds     (GDBusMessage *message,
+                                                         guint32 value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_header_fields ()

+
guchar *            g_dbus_message_get_header_fields    (GDBusMessage *message);
+

+Gets an array of all header fields on message that are set. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

An array of header fields terminated by +G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element is a +guchar. Free with g_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_get_header ()

+
GVariant *          g_dbus_message_get_header           (GDBusMessage *message,
+                                                         GDBusMessageHeaderField header_field);
+

+Gets a header field on message. +

+
++ + + + + + + + + + + + + + +

message :

A GDBusMessage. +

header_field :

A 8-bit unsigned integer (typically a value from the GDBusMessageHeaderField enumeration) +

Returns :

A GVariant with the value if the header was found, NULL +otherwise. Do not free, it is owned by message. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_header ()

+
void                g_dbus_message_set_header           (GDBusMessage *message,
+                                                         GDBusMessageHeaderField header_field,
+                                                         GVariant *value);
+

+Sets a header field on message. +

+

+If value is floating, message assumes ownership of value. +

+
++ + + + + + + + + + + + + + +

message :

A GDBusMessage. +

header_field :

A 8-bit unsigned integer (typically a value from the GDBusMessageHeaderField enumeration) +

value :

A GVariant to set the header field or NULL to clear the header field. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_destination ()

+
const gchar *       g_dbus_message_get_destination      (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_destination ()

+
void                g_dbus_message_set_destination      (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_error_name ()

+
const gchar *       g_dbus_message_get_error_name       (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_error_name ()

+
void                g_dbus_message_set_error_name       (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_interface ()

+
const gchar *       g_dbus_message_get_interface        (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_interface ()

+
void                g_dbus_message_set_interface        (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_member ()

+
const gchar *       g_dbus_message_get_member           (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_member ()

+
void                g_dbus_message_set_member           (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_path ()

+
const gchar *       g_dbus_message_get_path             (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_path ()

+
void                g_dbus_message_set_path             (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_reply_serial ()

+
guint32             g_dbus_message_get_reply_serial     (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_reply_serial ()

+
void                g_dbus_message_set_reply_serial     (GDBusMessage *message,
+                                                         guint32 value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_sender ()

+
const gchar *       g_dbus_message_get_sender           (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_sender ()

+
void                g_dbus_message_set_sender           (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_signature ()

+
const gchar *       g_dbus_message_get_signature        (GDBusMessage *message);
+

+Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The value. + +
+

Since 2.26

+
+
+
+

g_dbus_message_set_signature ()

+
void                g_dbus_message_set_signature        (GDBusMessage *message,
+                                                         const gchar *value);
+

+Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

value :

The value to set. +
+

Since 2.26

+
+
+
+

g_dbus_message_get_arg0 ()

+
const gchar *       g_dbus_message_get_arg0             (GDBusMessage *message);
+

+Convenience to get the first item in the body of message. +

+
++ + + + + + + + + + +

message :

A GDBusMessage. +

Returns :

The string item or NULL if the first item in the body of +message is not a string. + +
+

Since 2.26

+
+
+
+

g_dbus_message_to_blob ()

+
guchar *            g_dbus_message_to_blob              (GDBusMessage *message,
+                                                         gsize *out_size,
+                                                         GDBusCapabilityFlags capabilities,
+                                                         GError **error);
+

+Serializes message to a blob. The byte order returned by +g_dbus_message_get_byte_order() will be used. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

message :

A GDBusMessage. +

out_size :

Return location for size of generated blob. +

capabilities :

A GDBusCapabilityFlags describing what protocol features are supported. +

error :

Return location for error. +

Returns :

A pointer to a valid binary D-Bus message of out_size bytes +generated by message or NULL if error is set. Free with g_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_bytes_needed ()

+
gssize              g_dbus_message_bytes_needed         (guchar *blob,
+                                                         gsize blob_len,
+                                                         GError **error);
+

+Utility function to calculate how many bytes are needed to +completely deserialize the D-Bus message stored at blob. +

+
++ + + + + + + + + + + + + + + + + + +

blob :

A blob represent a binary D-Bus message. +

blob_len :

The length of blob (must be at least 16). +

error :

Return location for error or NULL. +

Returns :

Number of bytes needed or -1 if error is set (e.g. if +blob contains invalid data or not enough data is available to +determine the size). + +
+

Since 2.26

+
+
+
+

g_dbus_message_new_from_blob ()

+
GDBusMessage *      g_dbus_message_new_from_blob        (guchar *blob,
+                                                         gsize blob_len,
+                                                         GDBusCapabilityFlags capabilities,
+                                                         GError **error);
+

+Creates a new GDBusMessage from the data stored at blob. The byte +order that the message was in can be retrieved using +g_dbus_message_get_byte_order(). +

+
++ + + + + + + + + + + + + + + + + + + + + + +

blob :

A blob represent a binary D-Bus message. +

blob_len :

The length of blob. +

capabilities :

A GDBusCapabilityFlags describing what protocol features are supported. +

error :

Return location for error or NULL. +

Returns :

A new GDBusMessage or NULL if error is set. Free with +g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_message_to_gerror ()

+
gboolean            g_dbus_message_to_gerror            (GDBusMessage *message,
+                                                         GError **error);
+

+If message is not of type G_DBUS_MESSAGE_TYPE_ERROR does +nothing and returns FALSE. +

+

+Otherwise this method encodes the error in message as a GError +using g_dbus_error_set_dbus_error() using the information in the +G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of message as +well as the first string item in message's body. +

+
++ + + + + + + + + + + + + + +

message :

A GDBusMessage. +

error :

The GError to set. +

Returns :

TRUE if error was set, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "locked" property

+
  "locked"                   gboolean              : Read
+

Whether the message is locked.

+

Default value: FALSE

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDBusMethodInvocation.html b/docs/reference/gio/html/GDBusMethodInvocation.html new file mode 100644 index 0000000..5c47972 --- /dev/null +++ b/docs/reference/gio/html/GDBusMethodInvocation.html @@ -0,0 +1,616 @@ + + + + +GDBusMethodInvocation + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusMethodInvocation

+

GDBusMethodInvocation — Object for handling remote calls

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GDBusMethodInvocation;
+const gchar *       g_dbus_method_invocation_get_sender (GDBusMethodInvocation *invocation);
+const gchar *       g_dbus_method_invocation_get_object_path
+                                                        (GDBusMethodInvocation *invocation);
+const gchar *       g_dbus_method_invocation_get_interface_name
+                                                        (GDBusMethodInvocation *invocation);
+const gchar *       g_dbus_method_invocation_get_method_name
+                                                        (GDBusMethodInvocation *invocation);
+const GDBusMethodInfo * g_dbus_method_invocation_get_method_info
+                                                        (GDBusMethodInvocation *invocation);
+GDBusConnection *   g_dbus_method_invocation_get_connection
+                                                        (GDBusMethodInvocation *invocation);
+GDBusMessage *      g_dbus_method_invocation_get_message
+                                                        (GDBusMethodInvocation *invocation);
+GVariant *          g_dbus_method_invocation_get_parameters
+                                                        (GDBusMethodInvocation *invocation);
+gpointer            g_dbus_method_invocation_get_user_data
+                                                        (GDBusMethodInvocation *invocation);
+void                g_dbus_method_invocation_return_value
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GVariant *parameters);
+void                g_dbus_method_invocation_return_error
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GQuark domain,
+                                                         gint code,
+                                                         const gchar *format,
+                                                         ...);
+void                g_dbus_method_invocation_return_error_valist
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GQuark domain,
+                                                         gint code,
+                                                         const gchar *format,
+                                                         va_list var_args);
+void                g_dbus_method_invocation_return_error_literal
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GQuark domain,
+                                                         gint code,
+                                                         const gchar *message);
+void                g_dbus_method_invocation_return_gerror
+                                                        (GDBusMethodInvocation *invocation,
+                                                         const GError *error);
+void                g_dbus_method_invocation_return_dbus_error
+                                                        (GDBusMethodInvocation *invocation,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GDBusMethodInvocation
+
+
+
+

Description

+

+Instances of the GDBusMethodInvocation class are used when +handling D-Bus method calls. It provides a way to asynchronously +return results and errors. +

+

+The normal way to obtain a GDBusMethodInvocation object is to receive +it as an argument to the handle_method_call() function in a +GDBusInterfaceVTable that was passed to g_dbus_connection_register_object(). +

+
+
+

Details

+
+

GDBusMethodInvocation

+
typedef struct _GDBusMethodInvocation GDBusMethodInvocation;
+

+The GDBusMethodInvocation structure contains only private data and +should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_sender ()

+
const gchar *       g_dbus_method_invocation_get_sender (GDBusMethodInvocation *invocation);
+

+Gets the bus name that invoked the method. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A string. Do not free, it is owned by invocation. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_object_path ()

+
const gchar *       g_dbus_method_invocation_get_object_path
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the object path the method was invoked on. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A string. Do not free, it is owned by invocation. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_interface_name ()

+
const gchar *       g_dbus_method_invocation_get_interface_name
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the name of the D-Bus interface the method was invoked on. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A string. Do not free, it is owned by invocation. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_method_name ()

+
const gchar *       g_dbus_method_invocation_get_method_name
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the name of the method that was invoked. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A string. Do not free, it is owned by invocation. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_method_info ()

+
const GDBusMethodInfo * g_dbus_method_invocation_get_method_info
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets information about the method call, if any. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A GDBusMethodInfo or NULL. Do not free, it is owned by invocation. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_connection ()

+
GDBusConnection *   g_dbus_method_invocation_get_connection
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the GDBusConnection the method was invoked on. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A GDBusConnection. Do not free, it is owned by invocation. [transfer none] +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_message ()

+
GDBusMessage *      g_dbus_method_invocation_get_message
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the GDBusMessage for the method invocation. This is useful if +you need to use low-level protocol features, such as UNIX file +descriptor passing, that cannot be properly expressed in the +GVariant API. +

+

+See Example 2, “D-Bus server example” and Example 4, “D-Bus UNIX File Descriptor example” for an example of how to use this +low-level API to send and receive UNIX file descriptors. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

GDBusMessage. Do not free, it is owned by invocation. [transfer none] +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_parameters ()

+
GVariant *          g_dbus_method_invocation_get_parameters
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the parameters of the method invocation. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A GVariant. Do not free, it is owned by invocation. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_get_user_data ()

+
gpointer            g_dbus_method_invocation_get_user_data
+                                                        (GDBusMethodInvocation *invocation);
+

+Gets the user_data gpointer passed to g_dbus_connection_register_object(). +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

Returns :

A gpointer. + +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_return_value ()

+
void                g_dbus_method_invocation_return_value
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GVariant *parameters);
+

+Finishes handling a D-Bus method call by returning parameters. +If the parameters GVariant is floating, it is consumed. +

+

+It is an error if parameters is not of the right format. +

+

+This method will free invocation, you cannot use it afterwards. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

parameters :

A GVariant tuple with out parameters for the method or NULL if not passing any parameters. +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_return_error ()

+
void                g_dbus_method_invocation_return_error
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GQuark domain,
+                                                         gint code,
+                                                         const gchar *format,
+                                                         ...);
+

+Finishes handling a D-Bus method call by returning an error. +

+

+See g_dbus_error_encode_gerror() for details about what error name +will be returned on the wire. In a nutshell, if the given error is +registered using g_dbus_error_register_error() the name given +during registration is used. Otherwise, a name of the form +org.gtk.GDBus.UnmappedGError.Quark... is +used. This provides transparent mapping of GError between +applications using GDBus. +

+

+If you are writing an application intended to be portable, +always register errors with g_dbus_error_register_error() +or use g_dbus_method_invocation_return_dbus_error(). +

+

+This method will free invocation, you cannot use it afterwards. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

domain :

A GQuark for the GError error domain. +

code :

The error code. +

format :

printf()-style format. +

... :

Parameters for format. +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_return_error_valist ()

+
void                g_dbus_method_invocation_return_error_valist
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GQuark domain,
+                                                         gint code,
+                                                         const gchar *format,
+                                                         va_list var_args);
+

+Like g_dbus_method_invocation_return_error() but intended for +language bindings. +

+

+This method will free invocation, you cannot use it afterwards. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

domain :

A GQuark for the GError error domain. +

code :

The error code. +

format :

printf()-style format. +

var_args :

+va_list of parameters for format. +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_return_error_literal ()

+
void                g_dbus_method_invocation_return_error_literal
+                                                        (GDBusMethodInvocation *invocation,
+                                                         GQuark domain,
+                                                         gint code,
+                                                         const gchar *message);
+

+Like g_dbus_method_invocation_return_error() but without printf()-style formatting. +

+

+This method will free invocation, you cannot use it afterwards. +

+
++ + + + + + + + + + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

domain :

A GQuark for the GError error domain. +

code :

The error code. +

message :

The error message. +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_return_gerror ()

+
void                g_dbus_method_invocation_return_gerror
+                                                        (GDBusMethodInvocation *invocation,
+                                                         const GError *error);
+

+Like g_dbus_method_invocation_return_error() but takes a GError +instead of the error domain, error code and message. +

+

+This method will free invocation, you cannot use it afterwards. +

+
++ + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

error :

A GError. +
+

Since 2.26

+
+
+
+

g_dbus_method_invocation_return_dbus_error ()

+
void                g_dbus_method_invocation_return_dbus_error
+                                                        (GDBusMethodInvocation *invocation,
+                                                         const gchar *error_name,
+                                                         const gchar *error_message);
+

+Finishes handling a D-Bus method call by returning an error. +

+

+This method will free invocation, you cannot use it afterwards. +

+
++ + + + + + + + + + + + + + +

invocation :

A GDBusMethodInvocation. +

error_name :

A valid D-Bus error name. +

error_message :

A valid D-Bus error message. +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDBusProxy.html b/docs/reference/gio/html/GDBusProxy.html new file mode 100644 index 0000000..ce1d838 --- /dev/null +++ b/docs/reference/gio/html/GDBusProxy.html @@ -0,0 +1,2051 @@ + + + + +GDBusProxy + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusProxy

+

GDBusProxy — Client-side proxies

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+enum                GDBusProxyFlags;
+                    GDBusProxy;
+                    GDBusProxyClass;
+void                g_dbus_proxy_new                    (GDBusConnection *connection,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GDBusProxy *        g_dbus_proxy_new_finish             (GAsyncResult *res,
+                                                         GError **error);
+GDBusProxy *        g_dbus_proxy_new_sync               (GDBusConnection *connection,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_dbus_proxy_new_for_bus            (GBusType bus_type,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GDBusProxy *        g_dbus_proxy_new_for_bus_finish     (GAsyncResult *res,
+                                                         GError **error);
+GDBusProxy *        g_dbus_proxy_new_for_bus_sync       (GBusType bus_type,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+GDBusProxyFlags     g_dbus_proxy_get_flags              (GDBusProxy *proxy);
+GDBusConnection *   g_dbus_proxy_get_connection         (GDBusProxy *proxy);
+const gchar *       g_dbus_proxy_get_name               (GDBusProxy *proxy);
+gchar *             g_dbus_proxy_get_name_owner         (GDBusProxy *proxy);
+const gchar *       g_dbus_proxy_get_object_path        (GDBusProxy *proxy);
+const gchar *       g_dbus_proxy_get_interface_name     (GDBusProxy *proxy);
+gint                g_dbus_proxy_get_default_timeout    (GDBusProxy *proxy);
+void                g_dbus_proxy_set_default_timeout    (GDBusProxy *proxy,
+                                                         gint timeout_msec);
+GVariant *          g_dbus_proxy_get_cached_property    (GDBusProxy *proxy,
+                                                         const gchar *property_name);
+void                g_dbus_proxy_set_cached_property    (GDBusProxy *proxy,
+                                                         const gchar *property_name,
+                                                         GVariant *value);
+gchar **            g_dbus_proxy_get_cached_property_names
+                                                        (GDBusProxy *proxy);
+void                g_dbus_proxy_set_interface_info     (GDBusProxy *proxy,
+                                                         GDBusInterfaceInfo *info);
+GDBusInterfaceInfo * g_dbus_proxy_get_interface_info    (GDBusProxy *proxy);
+void                g_dbus_proxy_call                   (GDBusProxy *proxy,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GVariant *          g_dbus_proxy_call_finish            (GDBusProxy *proxy,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+GVariant *          g_dbus_proxy_call_sync              (GDBusProxy *proxy,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GDBusProxy
+
+
+
+

Implemented Interfaces

+

+GDBusProxy implements + GInitable and GAsyncInitable.

+
+
+

Properties

+
+  "g-bus-type"               GBusType              : Write / Construct Only
+  "g-connection"             GDBusConnection*      : Read / Write / Construct Only
+  "g-default-timeout"        gint                  : Read / Write / Construct
+  "g-flags"                  GDBusProxyFlags       : Read / Write / Construct Only
+  "g-interface-info"         GDBusInterfaceInfo*   : Read / Write
+  "g-interface-name"         gchar*                : Read / Write / Construct Only
+  "g-name"                   gchar*                : Read / Write / Construct Only
+  "g-name-owner"             gchar*                : Read
+  "g-object-path"            gchar*                : Read / Write / Construct Only
+
+
+
+

Signals

+
+  "g-properties-changed"                           : Run Last
+  "g-signal"                                       : Run Last
+
+
+
+

Description

+

+GDBusProxy is a base class used for proxies to access a D-Bus +interface on a remote object. A GDBusProxy can be constructed for +both well-known and unique names. +

+

+By default, GDBusProxy will cache all properties (and listen to +changes) of the remote object, and proxy all signals that gets +emitted. This behaviour can be changed by passing suitable +GDBusProxyFlags when the proxy is created. If the proxy is for a +well-known name, the property cache is flushed when the name owner +vanishes and reloaded when a name owner appears. +

+

+If a GDBusProxy is used for a well-known name, the owner of the +name is tracked and can be read from +"g-name-owner". Connect to the "notify" signal to +get notified of changes. Additionally, only signals and property +changes emitted from the current name owner are considered and +calls are always sent to the current name owner. This avoids a +number of race conditions when the name is lost by one owner and +claimed by another. However, if no name owner currently exists, +then calls will be sent to the well-known name which may result in +the message bus launching an owner (unless +G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set). +

+

+The generic "g-properties-changed" and "g-signal" +signals are not very convenient to work with. Therefore, the recommended +way of working with proxies is to subclass GDBusProxy, and have +more natural properties and signals in your derived class. +

+

+See Example 18, “GDBusProxy subclass example” for an example. +

+

+

+
+

Example 10. GDBusProxy for a well-known-name

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
#include <gio/gio.h>
+
+static gchar *opt_name         = NULL;
+static gchar *opt_object_path  = NULL;
+static gchar *opt_interface    = NULL;
+static gboolean opt_system_bus = FALSE;
+static gboolean opt_no_auto_start = FALSE;
+static gboolean opt_no_properties = FALSE;
+
+static GOptionEntry opt_entries[] =
+{
+  { "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name of the remote object to watch", NULL },
+  { "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_object_path, "Object path of the remote object", NULL },
+  { "interface", 'i', 0, G_OPTION_ARG_STRING, &opt_interface, "D-Bus interface of remote object", NULL },
+  { "system-bus", 's', 0, G_OPTION_ARG_NONE, &opt_system_bus, "Use the system-bus instead of the session-bus", NULL },
+  { "no-auto-start", 'a', 0, G_OPTION_ARG_NONE, &opt_no_auto_start, "Don't instruct the bus to launch an owner for the name", NULL},
+  { "no-properties", 'p', 0, G_OPTION_ARG_NONE, &opt_no_properties, "Do not load properties", NULL},
+  { NULL}
+};
+
+static GMainLoop *loop = NULL;
+
+static void
+print_properties (GDBusProxy *proxy)
+{
+  gchar **property_names;
+  guint n;
+
+  g_print ("    properties:\n");
+
+  property_names = g_dbus_proxy_get_cached_property_names (proxy);
+  for (n = 0; property_names != NULL && property_names[n] != NULL; n++)
+    {
+      const gchar *key = property_names[n];
+      GVariant *value;
+      gchar *value_str;
+      value = g_dbus_proxy_get_cached_property (proxy, key);
+      value_str = g_variant_print (value, TRUE);
+      g_print ("      %s -> %s\n", key, value_str);
+      g_variant_unref (value);
+      g_free (value_str);
+    }
+  g_strfreev (property_names);
+}
+
+static void
+on_properties_changed (GDBusProxy          *proxy,
+                       GVariant            *changed_properties,
+                       const gchar* const  *invalidated_properties,
+                       gpointer             user_data)
+{
+  /* Note that we are guaranteed that changed_properties and
+   * invalidated_properties are never NULL
+   */
+
+  if (g_variant_n_children (changed_properties) > 0)
+    {
+      GVariantIter *iter;
+      const gchar *key;
+      GVariant *value;
+
+      g_print (" *** Properties Changed:\n");
+      g_variant_get (changed_properties,
+                     "a{sv}",
+                     &iter);
+      while (g_variant_iter_loop (iter, "{&sv}", &key, &value))
+        {
+          gchar *value_str;
+          value_str = g_variant_print (value, TRUE);
+          g_print ("      %s -> %s\n", key, value_str);
+          g_free (value_str);
+        }
+      g_variant_iter_free (iter);
+    }
+
+  if (g_strv_length ((GStrv) invalidated_properties) > 0)
+    {
+      guint n;
+      g_print (" *** Properties Invalidated:\n");
+      for (n = 0; invalidated_properties[n] != NULL; n++)
+        {
+          const gchar *key = invalidated_properties[n];
+          g_print ("      %s\n", key);
+        }
+    }
+}
+
+static void
+on_signal (GDBusProxy *proxy,
+           gchar      *sender_name,
+           gchar      *signal_name,
+           GVariant   *parameters,
+           gpointer    user_data)
+{
+  gchar *parameters_str;
+
+  parameters_str = g_variant_print (parameters, TRUE);
+  g_print (" *** Received Signal: %s: %s\n",
+           signal_name,
+           parameters_str);
+  g_free (parameters_str);
+}
+
+static void
+print_proxy (GDBusProxy *proxy)
+{
+  gchar *name_owner;
+
+  name_owner = g_dbus_proxy_get_name_owner (proxy);
+  if (name_owner != NULL)
+    {
+      g_print ("+++ Proxy object points to remote object owned by %s\n"
+               "    bus:          %s\n"
+               "    name:         %s\n"
+               "    object path:  %s\n"
+               "    interface:    %s\n",
+               name_owner,
+               opt_system_bus ? "System Bus" : "Session Bus",
+               opt_name,
+               opt_object_path,
+               opt_interface);
+      print_properties (proxy);
+    }
+  else
+    {
+      g_print ("--- Proxy object is inert - there is no name owner for the name\n"
+               "    bus:          %s\n"
+               "    name:         %s\n"
+               "    object path:  %s\n"
+               "    interface:    %s\n",
+               opt_system_bus ? "System Bus" : "Session Bus",
+               opt_name,
+               opt_object_path,
+               opt_interface);
+    }
+  g_free (name_owner);
+}
+
+static void
+on_name_owner_notify (GObject    *object,
+                      GParamSpec *pspec,
+                      gpointer    user_data)
+{
+  GDBusProxy *proxy = G_DBUS_PROXY (object);
+  print_proxy (proxy);
+}
+
+int
+main (int argc, char *argv[])
+{
+  GOptionContext *opt_context;
+  GError *error;
+  GDBusProxyFlags flags;
+  GDBusProxy *proxy;
+
+  g_type_init ();
+
+  loop = NULL;
+  proxy = NULL;
+
+  opt_context = g_option_context_new ("g_bus_watch_proxy() example");
+  g_option_context_set_summary (opt_context,
+                                "Example: to watch the object of gdbus-example-server, use:\n"
+                                "\n"
+                                "  ./gdbus-example-watch-proxy -n org.gtk.GDBus.TestServer  \\\n"
+                                "                              -o /org/gtk/GDBus/TestObject \\\n"
+                                "                              -i org.gtk.GDBus.TestInterface");
+  g_option_context_add_main_entries (opt_context, opt_entries, NULL);
+  error = NULL;
+  if (!g_option_context_parse (opt_context, &argc, &argv, &error))
+    {
+      g_printerr ("Error parsing options: %s\n", error->message);
+      goto out;
+    }
+  if (opt_name == NULL || opt_object_path == NULL || opt_interface == NULL)
+    {
+      g_printerr ("Incorrect usage, try --help.\n");
+      goto out;
+    }
+
+  flags = G_DBUS_PROXY_FLAGS_NONE;
+  if (opt_no_properties)
+    flags |= G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES;
+  if (opt_no_auto_start)
+    flags |= G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
+
+  loop = g_main_loop_new (NULL, FALSE);
+
+  error = NULL;
+  proxy = g_dbus_proxy_new_for_bus_sync (opt_system_bus ? G_BUS_TYPE_SYSTEM : G_BUS_TYPE_SESSION,
+                                         flags,
+                                         NULL, /* GDBusInterfaceInfo */
+                                         opt_name,
+                                         opt_object_path,
+                                         opt_interface,
+                                         NULL, /* GCancellable */
+                                         &error);
+  if (proxy == NULL)
+    {
+      g_printerr ("Error creating proxy: %s\n", error->message);
+      g_error_free (error);
+      goto out;
+    }
+
+  g_signal_connect (proxy,
+                    "g-properties-changed",
+                    G_CALLBACK (on_properties_changed),
+                    NULL);
+  g_signal_connect (proxy,
+                    "g-signal",
+                    G_CALLBACK (on_signal),
+                    NULL);
+  g_signal_connect (proxy,
+                    "notify::g-name-owner",
+                    G_CALLBACK (on_name_owner_notify),
+                    NULL);
+  print_proxy (proxy);
+
+  g_main_loop_run (loop);
+
+ out:
+  if (proxy != NULL)
+    g_object_unref (proxy);
+  if (loop != NULL)
+    g_main_loop_unref (loop);
+  g_option_context_free (opt_context);
+  g_free (opt_name);
+  g_free (opt_object_path);
+  g_free (opt_interface);
+
+  return 0;
+}
+
+ +
+


+

+
+
+

Details

+
+

enum GDBusProxyFlags

+
typedef enum
+{
+  G_DBUS_PROXY_FLAGS_NONE = 0,
+  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES = (1<<0),
+  G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS = (1<<1),
+  G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START = (1<<2)
+} GDBusProxyFlags;
+
+

+Flags used when constructing an instance of a GDBusProxy derived class. +

+
++ + + + + + + + + + + + + + + + + + +

G_DBUS_PROXY_FLAGS_NONE

No flags set. +

G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES

Don't load properties. +

G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS

Don't connect to signals on the remote object. +

G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START

If not set and the proxy if for a well-known name, +then request the bus to launch an owner for the name if no-one owns the name. This flag can +only be used in proxies for well-known names. +
+

Since 2.26

+
+
+
+

GDBusProxy

+
typedef struct _GDBusProxy GDBusProxy;
+

+The GDBusProxy structure contains only private data and +should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

GDBusProxyClass

+
typedef struct {
+  /* Signals */
+  void (*g_properties_changed) (GDBusProxy          *proxy,
+                                GVariant            *changed_properties,
+                                const gchar* const  *invalidated_properties);
+  void (*g_signal)             (GDBusProxy          *proxy,
+                                const gchar         *sender_name,
+                                const gchar         *signal_name,
+                                GVariant            *parameters);
+} GDBusProxyClass;
+
+

+Class structure for GDBusProxy. +

+
++ + + + + + + + + + +

g_properties_changed ()

Signal class handler for the "g-properties-changed" signal. +

g_signal ()

Signal class handler for the "g-signal" signal. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_new ()

+
void                g_dbus_proxy_new                    (GDBusConnection *connection,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Creates a proxy for accessing interface_name on the remote object +at object_path owned by name at connection and asynchronously +loads D-Bus properties unless the +G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to +the "g-properties-changed" signal to get notified about +property changes. +

+

+If the G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up +match rules for signals. Connect to the "g-signal" signal +to handle signals from the remote object. +

+

+If name is a well-known name and the +G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name +owner currently exists, the message bus will be requested to launch +a name owner for the name. +

+

+This is a failable asynchronous constructor - when the proxy is +ready, callback will be invoked and you can use +g_dbus_proxy_new_finish() to get the result. +

+

+See g_dbus_proxy_new_sync() and for a synchronous version of this constructor. +

+

+See Example 10, “GDBusProxy for a well-known-name” for an example of how GDBusProxy can be used. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

flags :

Flags used when constructing the proxy. +

info :

A GDBusInterfaceInfo specifying the minimal interface that proxy conforms to or NULL. +

name :

A bus name (well-known or unique) or NULL if connection is not a message bus connection. +

object_path :

An object path. +

interface_name :

A D-Bus interface name. +

cancellable :

A GCancellable or NULL. +

callback :

Callback function to invoke when the proxy is ready. +

user_data :

User data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_new_finish ()

+
GDBusProxy *        g_dbus_proxy_new_finish             (GAsyncResult *res,
+                                                         GError **error);
+

+Finishes creating a GDBusProxy. +

+
++ + + + + + + + + + + + + + +

res :

A GAsyncResult obtained from the GAsyncReadyCallback function passed to g_dbus_proxy_new(). +

error :

Return location for error or NULL. +

Returns :

A GDBusProxy or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_new_sync ()

+
GDBusProxy *        g_dbus_proxy_new_sync               (GDBusConnection *connection,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Creates a proxy for accessing interface_name on the remote object +at object_path owned by name at connection and synchronously +loads D-Bus properties unless the +G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. +

+

+If the G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up +match rules for signals. Connect to the "g-signal" signal +to handle signals from the remote object. +

+

+If name is a well-known name and the +G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name +owner currently exists, the message bus will be requested to launch +a name owner for the name. +

+

+This is a synchronous failable constructor. See g_dbus_proxy_new() +and g_dbus_proxy_new_finish() for the asynchronous version. +

+

+See Example 10, “GDBusProxy for a well-known-name” for an example of how GDBusProxy can be used. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

flags :

Flags used when constructing the proxy. +

info :

A GDBusInterfaceInfo specifying the minimal interface that proxy conforms to or NULL. [allow-none] +

name :

A bus name (well-known or unique) or NULL if connection is not a message bus connection. [allow-none] +

object_path :

An object path. +

interface_name :

A D-Bus interface name. +

cancellable :

A GCancellable or NULL. [allow-none] +

error :

Return location for error or NULL. [allow-none] +

Returns :

A GDBusProxy or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_new_for_bus ()

+
void                g_dbus_proxy_new_for_bus            (GBusType bus_type,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Like g_dbus_proxy_new() but takes a GBusType instead of a GDBusConnection. +

+

+See Example 10, “GDBusProxy for a well-known-name” for an example of how GDBusProxy can be used. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bus_type :

A GBusType. +

flags :

Flags used when constructing the proxy. +

info :

A GDBusInterfaceInfo specifying the minimal interface that proxy conforms to or NULL. +

name :

A bus name (well-known or unique). +

object_path :

An object path. +

interface_name :

A D-Bus interface name. +

cancellable :

A GCancellable or NULL. +

callback :

Callback function to invoke when the proxy is ready. +

user_data :

User data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_new_for_bus_finish ()

+
GDBusProxy *        g_dbus_proxy_new_for_bus_finish     (GAsyncResult *res,
+                                                         GError **error);
+

+Finishes creating a GDBusProxy. +

+
++ + + + + + + + + + + + + + +

res :

A GAsyncResult obtained from the GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus(). +

error :

Return location for error or NULL. +

Returns :

A GDBusProxy or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_new_for_bus_sync ()

+
GDBusProxy *        g_dbus_proxy_new_for_bus_sync       (GBusType bus_type,
+                                                         GDBusProxyFlags flags,
+                                                         GDBusInterfaceInfo *info,
+                                                         const gchar *name,
+                                                         const gchar *object_path,
+                                                         const gchar *interface_name,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Like g_dbus_proxy_new_sync() but takes a GBusType instead of a GDBusConnection. +

+

+See Example 10, “GDBusProxy for a well-known-name” for an example of how GDBusProxy can be used. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bus_type :

A GBusType. +

flags :

Flags used when constructing the proxy. +

info :

A GDBusInterfaceInfo specifying the minimal interface that proxy conforms to or NULL. +

name :

A bus name (well-known or unique). +

object_path :

An object path. +

interface_name :

A D-Bus interface name. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A GDBusProxy or NULL if error is set. Free with g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_flags ()

+
GDBusProxyFlags     g_dbus_proxy_get_flags              (GDBusProxy *proxy);
+

+Gets the flags that proxy was constructed with. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

Flags from the GDBusProxyFlags enumeration. + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_connection ()

+
GDBusConnection *   g_dbus_proxy_get_connection         (GDBusProxy *proxy);
+

+Gets the connection proxy is for. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

A GDBusConnection owned by proxy. Do not free. [transfer none] +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_name ()

+
const gchar *       g_dbus_proxy_get_name               (GDBusProxy *proxy);
+

+Gets the name that proxy was constructed for. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

A string owned by proxy. Do not free. + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_name_owner ()

+
gchar *             g_dbus_proxy_get_name_owner         (GDBusProxy *proxy);
+

+The unique name that owns the name that proxy is for or NULL if +no-one currently owns that name. You may connect to the +"notify" signal to track changes to the +"g-name-owner" property. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

The name owner or NULL if no name owner exists. Free with g_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_object_path ()

+
const gchar *       g_dbus_proxy_get_object_path        (GDBusProxy *proxy);
+

+Gets the object path proxy is for. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

A string owned by proxy. Do not free. + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_interface_name ()

+
const gchar *       g_dbus_proxy_get_interface_name     (GDBusProxy *proxy);
+

+Gets the D-Bus interface name proxy is for. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

A string owned by proxy. Do not free. + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_default_timeout ()

+
gint                g_dbus_proxy_get_default_timeout    (GDBusProxy *proxy);
+

+Gets the timeout to use if -1 (specifying default timeout) is +passed as timeout_msec in the g_dbus_proxy_call() and +g_dbus_proxy_call_sync() functions. +

+

+See the "g-default-timeout" property for more details. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

Timeout to use for proxy. + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_set_default_timeout ()

+
void                g_dbus_proxy_set_default_timeout    (GDBusProxy *proxy,
+                                                         gint timeout_msec);
+

+Sets the timeout to use if -1 (specifying default timeout) is +passed as timeout_msec in the g_dbus_proxy_call() and +g_dbus_proxy_call_sync() functions. +

+

+See the "g-default-timeout" property for more details. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

timeout_msec :

Timeout in milliseconds. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_cached_property ()

+
GVariant *          g_dbus_proxy_get_cached_property    (GDBusProxy *proxy,
+                                                         const gchar *property_name);
+

+Looks up the value for a property from the cache. This call does no +blocking IO. +

+

+If proxy has an expected interface (see +"g-interface-info"), then property_name (for existence) +is checked against it. +

+
++ + + + + + + + + + + + + + +

proxy :

A GDBusProxy. +

property_name :

Property name. +

Returns :

A reference to the GVariant instance that holds the value +for property_name or NULL if the value is not in the cache. The +returned reference must be freed with g_variant_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_set_cached_property ()

+
void                g_dbus_proxy_set_cached_property    (GDBusProxy *proxy,
+                                                         const gchar *property_name,
+                                                         GVariant *value);
+

+If value is not NULL, sets the cached value for the property with +name property_name to the value in value. +

+

+If value is NULL, then the cached value is removed from the +property cache. +

+

+If proxy has an expected interface (see +"g-interface-info"), then property_name (for existence) +and value (for the type) is checked against it. +

+

+If the value GVariant is floating, it is consumed. This allows +convenient 'inline' use of g_variant_new(), e.g. +

+
+ + + + + + + +
1
+2
+3
+4
+5
g_dbus_proxy_set_cached_property (proxy,
+                                  "SomeProperty",
+                                  g_variant_new ("(si)",
+                                                "A String",
+                                                42));
+
+ +

+

+

+Normally you will not need to use this method since proxy is +tracking changes using the +org.freedesktop.DBus.Properties.PropertiesChanged +D-Bus signal. However, for performance reasons an object may decide +to not use this signal for some properties and instead use a +proprietary out-of-band mechanism to transmit changes. +

+

+As a concrete example, consider an object with a property +ChatroomParticipants which is an array of +strings. Instead of transmitting the same (long) array every time +the property changes, it is more efficient to only transmit the +delta using e.g. signals ChatroomParticipantJoined(String +name) and ChatroomParticipantParted(String +name). +

+
++ + + + + + + + + + + + + + +

proxy :

A GDBusProxy +

property_name :

Property name. +

value :

Value for the property or NULL to remove it from the cache. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_cached_property_names ()

+
gchar **            g_dbus_proxy_get_cached_property_names
+                                                        (GDBusProxy *proxy);
+

+Gets the names of all cached properties on proxy. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy. +

Returns :

A NULL-terminated array of strings or NULL if proxy has +no cached properties. Free the returned array with g_strfreev(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_set_interface_info ()

+
void                g_dbus_proxy_set_interface_info     (GDBusProxy *proxy,
+                                                         GDBusInterfaceInfo *info);
+

+Ensure that interactions with proxy conform to the given +interface. For example, when completing a method call, if the type +signature of the message isn't what's expected, the given GError +is set. Signals that have a type signature mismatch are simply +dropped. +

+

+See the "g-interface-info" property for more details. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy +

info :

Minimum interface this proxy conforms to or NULL to unset. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_get_interface_info ()

+
GDBusInterfaceInfo * g_dbus_proxy_get_interface_info    (GDBusProxy *proxy);
+

+Returns the GDBusInterfaceInfo, if any, specifying the minimal +interface that proxy conforms to. +

+

+See the "g-interface-info" property for more details. +

+
++ + + + + + + + + + +

proxy :

A GDBusProxy +

Returns :

A GDBusInterfaceInfo or NULL. Do not unref the returned +object, it is owned by proxy. + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_call ()

+
void                g_dbus_proxy_call                   (GDBusProxy *proxy,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously invokes the method_name method on proxy. +

+

+If method_name contains any dots, then name is split into interface and +method name parts. This allows using proxy for invoking methods on +other interfaces. +

+

+If the GDBusConnection associated with proxy is closed then +the operation will fail with G_IO_ERROR_CLOSED. If +cancellable is canceled, the operation will fail with +G_IO_ERROR_CANCELLED. If parameters contains a value not +compatible with the D-Bus protocol, the operation fails with +G_IO_ERROR_INVALID_ARGUMENT. +

+

+If the parameters GVariant is floating, it is consumed. This allows +convenient 'inline' use of g_variant_new(), e.g.: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
g_dbus_proxy_call (proxy,
+                   "TwoStrings",
+                   g_variant_new ("(ss)",
+                                  "Thing One",
+                                  "Thing Two"),
+                   G_DBUS_CALL_FLAGS_NONE,
+                   -1,
+                   NULL,
+                   (GAsyncReadyCallback) two_strings_done,
+                   &data);
+
+ +

+

+

+This is an asynchronous method. When the operation is finished, +callback will be invoked in the +thread-default +main loop of the thread you are calling this method from. +You can then call g_dbus_proxy_call_finish() to get the result of +the operation. See g_dbus_proxy_call_sync() for the synchronous +version of this method. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy :

A GDBusProxy. +

method_name :

Name of method to invoke. +

parameters :

A GVariant tuple with parameters for the signal or NULL if not passing parameters. +

flags :

Flags from the GDBusCallFlags enumeration. +

timeout_msec :

The timeout in milliseconds (with G_MAXINT meaning + "infinite") or -1 to use the proxy default timeout. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't +care about the result of the method invocation. +

user_data :

The data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_proxy_call_finish ()

+
GVariant *          g_dbus_proxy_call_finish            (GDBusProxy *proxy,
+                                                         GAsyncResult *res,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_proxy_call(). +

+
++ + + + + + + + + + + + + + + + + + +

proxy :

A GDBusProxy. +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_proxy_call(). +

error :

Return location for error or NULL. +

Returns :

NULL if error is set. Otherwise a GVariant tuple with +return values. Free with g_variant_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_proxy_call_sync ()

+
GVariant *          g_dbus_proxy_call_sync              (GDBusProxy *proxy,
+                                                         const gchar *method_name,
+                                                         GVariant *parameters,
+                                                         GDBusCallFlags flags,
+                                                         gint timeout_msec,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously invokes the method_name method on proxy. +

+

+If method_name contains any dots, then name is split into interface and +method name parts. This allows using proxy for invoking methods on +other interfaces. +

+

+If the GDBusConnection associated with proxy is disconnected then +the operation will fail with G_IO_ERROR_CLOSED. If +cancellable is canceled, the operation will fail with +G_IO_ERROR_CANCELLED. If parameters contains a value not +compatible with the D-Bus protocol, the operation fails with +G_IO_ERROR_INVALID_ARGUMENT. +

+

+If the parameters GVariant is floating, it is consumed. This allows +convenient 'inline' use of g_variant_new(), e.g.: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
g_dbus_proxy_call_sync (proxy,
+                        "TwoStrings",
+                        g_variant_new ("(ss)",
+                                       "Thing One",
+                                       "Thing Two"),
+                        G_DBUS_CALL_FLAGS_NONE,
+                        -1,
+                        NULL,
+                        &error);
+
+ +

+

+

+The calling thread is blocked until a reply is received. See +g_dbus_proxy_call() for the asynchronous version of this +method. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy :

A GDBusProxy. +

method_name :

Name of method to invoke. +

parameters :

A GVariant tuple with parameters for the signal or NULL if not passing parameters. +

flags :

Flags from the GDBusCallFlags enumeration. +

timeout_msec :

The timeout in milliseconds (with G_MAXINT meaning + "infinite") or -1 to use the proxy default timeout. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

NULL if error is set. Otherwise a GVariant tuple with +return values. Free with g_variant_unref(). + +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "g-bus-type" property

+
  "g-bus-type"               GBusType              : Write / Construct Only
+

+If this property is not G_BUS_TYPE_NONE, then +"g-connection" must be NULL and will be set to the +GDBusConnection obtained by calling g_bus_get() with the value +of this property. +

+

Default value: G_BUS_TYPE_NONE

+

Since 2.26

+
+
+
+

The "g-connection" property

+
  "g-connection"             GDBusConnection*      : Read / Write / Construct Only
+

+The GDBusConnection the proxy is for. +

+

Since 2.26

+
+
+
+

The "g-default-timeout" property

+
  "g-default-timeout"        gint                  : Read / Write / Construct
+

+The timeout to use if -1 (specifying default timeout) is passed +as timeout_msec in the g_dbus_proxy_call() and +g_dbus_proxy_call_sync() functions. +

+

+This allows applications to set a proxy-wide timeout for all +remote method invocations on the proxy. If this property is -1, +the default timeout (typically 25 seconds) is used. If set to +G_MAXINT, then no timeout is used. +

+

Allowed values: >= G_MAXULONG

+

Default value: -1

+

Since 2.26

+
+
+
+

The "g-flags" property

+
  "g-flags"                  GDBusProxyFlags       : Read / Write / Construct Only
+

+Flags from the GDBusProxyFlags enumeration. +

+

Since 2.26

+
+
+
+

The "g-interface-info" property

+
  "g-interface-info"         GDBusInterfaceInfo*   : Read / Write
+

+Ensure that interactions with this proxy conform to the given +interface. For example, when completing a method call, if the +type signature of the message isn't what's expected, the given +GError is set. Signals that have a type signature mismatch are +simply dropped. +

+

Since 2.26

+
+
+
+

The "g-interface-name" property

+
  "g-interface-name"         gchar*                : Read / Write / Construct Only
+

+The D-Bus interface name the proxy is for. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "g-name" property

+
  "g-name"                   gchar*                : Read / Write / Construct Only
+

+The well-known or unique name that the proxy is for. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "g-name-owner" property

+
  "g-name-owner"             gchar*                : Read
+

+The unique name that owns "name" or NULL if no-one +currently owns that name. You may connect to "notify" signal to +track changes to this property. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "g-object-path" property

+
  "g-object-path"            gchar*                : Read / Write / Construct Only
+

+The object path the proxy is for. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

Signal Details

+
+

The "g-properties-changed" signal

+
void                user_function                      (GDBusProxy *proxy,
+                                                        GVariant    changed_properties,
+                                                        GStrv      *invalidated_properties,
+                                                        gpointer    user_data)                   : Run Last
+

+Emitted when one or more D-Bus properties on proxy changes. The +local cache has already been updated when this signal fires. Note +that both changed_properties and invalidated_properties are +guaranteed to never be NULL (either may be empty though). +

+

+This signal corresponds to the +PropertiesChanged D-Bus signal on the +org.freedesktop.DBus.Properties interface. +

+
++ + + + + + + + + + + + + + + + + + +

proxy :

The GDBusProxy emitting the signal. +

changed_properties :

A GVariant containing the properties that changed +

invalidated_properties :

A NULL terminated array of properties that was invalidated +

user_data :

user data set when the signal handler was connected.
+

Since 2.26

+
+
+
+

The "g-signal" signal

+
void                user_function                      (GDBusProxy *proxy,
+                                                        gchar      *sender_name,
+                                                        gchar      *signal_name,
+                                                        GVariant    parameters,
+                                                        gpointer    user_data)        : Run Last
+

+Emitted when a signal from the remote object and interface that proxy is for, has been received. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

proxy :

The GDBusProxy emitting the signal. +

sender_name :

The sender of the signal or NULL if the connection is not a bus connection. +

signal_name :

The name of the signal. +

parameters :

A GVariant tuple with parameters for the signal. +

user_data :

user data set when the signal handler was connected.
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDBusServer.html b/docs/reference/gio/html/GDBusServer.html new file mode 100644 index 0000000..84ca4bc --- /dev/null +++ b/docs/reference/gio/html/GDBusServer.html @@ -0,0 +1,1124 @@ + + + + +GDBusServer + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusServer

+

GDBusServer — Helper for accepting connections

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GDBusServer;
+enum                GDBusServerFlags;
+GDBusServer *       g_dbus_server_new_sync              (const gchar *address,
+                                                         GDBusServerFlags flags,
+                                                         const gchar *guid,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_dbus_server_start                 (GDBusServer *server);
+void                g_dbus_server_stop                  (GDBusServer *server);
+gboolean            g_dbus_server_is_active             (GDBusServer *server);
+const gchar *       g_dbus_server_get_guid              (GDBusServer *server);
+GDBusServerFlags    g_dbus_server_get_flags             (GDBusServer *server);
+const gchar *       g_dbus_server_get_client_address    (GDBusServer *server);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GDBusServer
+
+
+
+

Implemented Interfaces

+

+GDBusServer implements + GInitable.

+
+
+

Properties

+
+  "active"                   gboolean              : Read
+  "address"                  gchar*                : Read / Write / Construct Only
+  "authentication-observer"  GDBusAuthObserver*    : Read / Write / Construct Only
+  "client-address"           gchar*                : Read
+  "flags"                    GDBusServerFlags      : Read / Write / Construct Only
+  "guid"                     gchar*                : Read / Write / Construct Only
+
+
+
+

Signals

+
+  "new-connection"                                 : Run Last
+
+
+
+

Description

+

+GDBusServer is a helper for listening to and accepting D-Bus +connections. +

+

+

+
+

Example 6. D-Bus peer-to-peer example

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
/*
+
+Usage examples (modulo addresses / credentials).
+
+UNIX domain socket transport:
+
+ Server:
+   $ ./gdbus-example-peer --server --address unix:abstract=myaddr
+   Server is listening at: unix:abstract=myaddr
+   Client connected.
+   Peer credentials: GCredentials:unix-user=500,unix-group=500,unix-process=13378
+   Negotiated capabilities: unix-fd-passing=1
+   Client said: Hey, it's 1273093080 already!
+
+ Client:
+   $ ./gdbus-example-peer --address unix:abstract=myaddr
+   Connected.
+   Negotiated capabilities: unix-fd-passing=1
+   Server said: You said 'Hey, it's 1273093080 already!'. KTHXBYE!
+
+Nonce-secured TCP transport on the same host:
+
+ Server:
+   $ ./gdbus-example-peer --server --address nonce-tcp:
+   Server is listening at: nonce-tcp:host=localhost,port=43077,noncefile=/tmp/gdbus-nonce-file-X1ZNCV
+   Client connected.
+   Peer credentials: (no credentials received)
+   Negotiated capabilities: unix-fd-passing=0
+   Client said: Hey, it's 1273093206 already!
+
+ Client:
+   $ ./gdbus-example-peer -address nonce-tcp:host=localhost,port=43077,noncefile=/tmp/gdbus-nonce-file-X1ZNCV
+   Connected.
+   Negotiated capabilities: unix-fd-passing=0
+   Server said: You said 'Hey, it's 1273093206 already!'. KTHXBYE!
+
+TCP transport on two different hosts with a shared home directory:
+
+ Server:
+   host1 $ ./gdbus-example-peer --server --address tcp:host=0.0.0.0
+   Server is listening at: tcp:host=0.0.0.0,port=46314
+   Client connected.
+   Peer credentials: (no credentials received)
+   Negotiated capabilities: unix-fd-passing=0
+   Client said: Hey, it's 1273093337 already!
+
+ Client:
+   host2 $ ./gdbus-example-peer -a tcp:host=host1,port=46314
+   Connected.
+   Negotiated capabilities: unix-fd-passing=0
+   Server said: You said 'Hey, it's 1273093337 already!'. KTHXBYE!
+
+TCP transport on two different hosts without authentication:
+
+ Server:
+   host1 $ ./gdbus-example-peer --server --address tcp:host=0.0.0.0 --allow-anonymous
+   Server is listening at: tcp:host=0.0.0.0,port=59556
+   Client connected.
+   Peer credentials: (no credentials received)
+   Negotiated capabilities: unix-fd-passing=0
+   Client said: Hey, it's 1273093652 already!
+
+ Client:
+   host2 $ ./gdbus-example-peer -a tcp:host=host1,port=59556
+   Connected.
+   Negotiated capabilities: unix-fd-passing=0
+   Server said: You said 'Hey, it's 1273093652 already!'. KTHXBYE!
+
+ */
+
+#include <gio/gio.h>
+#include <stdlib.h>
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusNodeInfo *introspection_data = NULL;
+
+/* Introspection data for the service we are exporting */
+static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.gtk.GDBus.TestPeerInterface'>"
+  "    <method name='HelloWorld'>"
+  "      <arg type='s' name='greeting' direction='in'/>"
+  "      <arg type='s' name='response' direction='out'/>"
+  "    </method>"
+  "  </interface>"
+  "</node>";
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+handle_method_call (GDBusConnection       *connection,
+                    const gchar           *sender,
+                    const gchar           *object_path,
+                    const gchar           *interface_name,
+                    const gchar           *method_name,
+                    GVariant              *parameters,
+                    GDBusMethodInvocation *invocation,
+                    gpointer               user_data)
+{
+  if (g_strcmp0 (method_name, "HelloWorld") == 0)
+    {
+      const gchar *greeting;
+      gchar *response;
+
+      g_variant_get (parameters, "(&s)", &greeting);
+      response = g_strdup_printf ("You said '%s'. KTHXBYE!", greeting);
+      g_dbus_method_invocation_return_value (invocation,
+                                             g_variant_new ("(s)", response));
+      g_free (response);
+      g_print ("Client said: %s\n", greeting);
+    }
+}
+
+static const GDBusInterfaceVTable interface_vtable =
+{
+  handle_method_call,
+  NULL,
+  NULL,
+};
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static gboolean
+on_new_connection (GDBusServer *server,
+                   GDBusConnection *connection,
+                   gpointer user_data)
+{
+  guint registration_id;
+  GCredentials *credentials;
+  gchar *s;
+
+  credentials = g_dbus_connection_get_peer_credentials (connection);
+  if (credentials == NULL)
+    s = g_strdup ("(no credentials received)");
+  else
+    s = g_credentials_to_string (credentials);
+
+
+  g_print ("Client connected.\n"
+           "Peer credentials: %s\n"
+           "Negotiated capabilities: unix-fd-passing=%d\n",
+           s,
+           g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
+
+  g_object_ref (connection);
+  registration_id = g_dbus_connection_register_object (connection,
+                                                       "/org/gtk/GDBus/TestObject",
+                                                       introspection_data->interfaces[0],
+                                                       &interface_vtable,
+                                                       NULL,  /* user_data */
+                                                       NULL,  /* user_data_free_func */
+                                                       NULL); /* GError** */
+  g_assert (registration_id > 0);
+
+  return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+int
+main (int argc, char *argv[])
+{
+  gint ret;
+  gboolean opt_server;
+  gchar *opt_address;
+  GOptionContext *opt_context;
+  gboolean opt_allow_anonymous;
+  GError *error;
+  GOptionEntry opt_entries[] =
+    {
+      { "server", 's', 0, G_OPTION_ARG_NONE, &opt_server, "Start a server instead of a client", NULL },
+      { "address", 'a', 0, G_OPTION_ARG_STRING, &opt_address, "D-Bus address to use", NULL },
+      { "allow-anonymous", 'n', 0, G_OPTION_ARG_NONE, &opt_allow_anonymous, "Allow anonymous authentication", NULL },
+      { NULL}
+    };
+
+  ret = 1;
+
+  g_type_init ();
+
+  opt_address = NULL;
+  opt_server = FALSE;
+  opt_allow_anonymous = FALSE;
+
+  opt_context = g_option_context_new ("peer-to-peer example");
+  error = NULL;
+  g_option_context_add_main_entries (opt_context, opt_entries, NULL);
+  if (!g_option_context_parse (opt_context, &argc, &argv, &error))
+    {
+      g_printerr ("Error parsing options: %s\n", error->message);
+      g_error_free (error);
+      goto out;
+    }
+  if (opt_address == NULL)
+    {
+      g_printerr ("Incorrect usage, try --help.\n");
+      goto out;
+    }
+  if (!opt_server && opt_allow_anonymous)
+    {
+      g_printerr ("The --allow-anonymous option only makes sense when used with --server.\n");
+      goto out;
+    }
+
+  /* We are lazy here - we don't want to manually provide
+   * the introspection data structures - so we just build
+   * them from XML.
+   */
+  introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+  g_assert (introspection_data != NULL);
+
+  if (opt_server)
+    {
+      GDBusServer *server;
+      gchar *guid;
+      GMainLoop *loop;
+      GDBusServerFlags server_flags;
+
+      guid = g_dbus_generate_guid ();
+
+      server_flags = G_DBUS_SERVER_FLAGS_NONE;
+      if (opt_allow_anonymous)
+        server_flags |= G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
+
+      error = NULL;
+      server = g_dbus_server_new_sync (opt_address,
+                                       server_flags,
+                                       guid,
+                                       NULL, /* GDBusAuthObserver */
+                                       NULL, /* GCancellable */
+                                       &error);
+      g_dbus_server_start (server);
+      g_free (guid);
+
+      if (server == NULL)
+        {
+          g_printerr ("Error creating server at address %s: %s\n", opt_address, error->message);
+          g_error_free (error);
+          goto out;
+        }
+      g_print ("Server is listening at: %s\n", g_dbus_server_get_client_address (server));
+      g_signal_connect (server,
+                        "new-connection",
+                        G_CALLBACK (on_new_connection),
+                        NULL);
+
+      loop = g_main_loop_new (NULL, FALSE);
+      g_main_loop_run (loop);
+
+      g_object_unref (server);
+      g_main_loop_unref (loop);
+    }
+  else
+    {
+      GDBusConnection *connection;
+      const gchar *greeting_response;
+      GVariant *value;
+      gchar *greeting;
+
+      error = NULL;
+      connection = g_dbus_connection_new_for_address_sync (opt_address,
+                                                           G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
+                                                           NULL, /* GDBusAuthObserver */
+                                                           NULL, /* GCancellable */
+                                                           &error);
+      if (connection == NULL)
+        {
+          g_printerr ("Error connecting to D-Bus address %s: %s\n", opt_address, error->message);
+          g_error_free (error);
+          goto out;
+        }
+
+      g_print ("Connected.\n"
+               "Negotiated capabilities: unix-fd-passing=%d\n",
+               g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
+
+      greeting = g_strdup_printf ("Hey, it's %" G_GUINT64_FORMAT " already!", (guint64) time (NULL));
+      value = g_dbus_connection_call_sync (connection,
+                                           NULL, /* bus_name */
+                                           "/org/gtk/GDBus/TestObject",
+                                           "org.gtk.GDBus.TestPeerInterface",
+                                           "HelloWorld",
+                                           g_variant_new ("(s)", greeting),
+                                           G_VARIANT_TYPE ("(s)"),
+                                           G_DBUS_CALL_FLAGS_NONE,
+                                           -1,
+                                           NULL,
+                                           &error);
+      if (value == NULL)
+        {
+          g_printerr ("Error invoking HelloWorld(): %s\n", error->message);
+          g_error_free (error);
+          goto out;
+        }
+      g_variant_get (value, "(&s)", &greeting_response);
+      g_print ("Server said: %s\n", greeting_response);
+      g_variant_unref (value);
+
+      g_object_unref (connection);
+    }
+  g_dbus_node_info_unref (introspection_data);
+
+  ret = 0;
+
+ out:
+  return ret;
+}
+
+ +
+


+

+
+
+

Details

+
+

GDBusServer

+
typedef struct _GDBusServer GDBusServer;
+

+The GDBusServer structure contains only private data and +should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

enum GDBusServerFlags

+
typedef enum
+{
+  G_DBUS_SERVER_FLAGS_NONE = 0,
+  G_DBUS_SERVER_FLAGS_RUN_IN_THREAD = (1<<0),
+  G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<1)
+} GDBusServerFlags;
+
+

+Flags used when creating a GDBusServer. +

+
++ + + + + + + + + + + + + + +

G_DBUS_SERVER_FLAGS_NONE

No flags set. +

G_DBUS_SERVER_FLAGS_RUN_IN_THREAD

All "new-connection" +signals will run in separated dedicated threads (see signal for +details). +

G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS

Allow the anonymous +authentication method. +
+

Since 2.26

+
+
+
+

g_dbus_server_new_sync ()

+
GDBusServer *       g_dbus_server_new_sync              (const gchar *address,
+                                                         GDBusServerFlags flags,
+                                                         const gchar *guid,
+                                                         GDBusAuthObserver *observer,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Creates a new D-Bus server that listens on the first address in +address that works. +

+

+Once constructed, you can use g_dbus_server_get_client_address() to +get a D-Bus address string that clients can use to connect. +

+

+Connect to the "new-connection" signal to handle +incoming connections. +

+

+The returned GDBusServer isn't active - you have to start it with +g_dbus_server_start(). +

+

+See Example 6, “D-Bus peer-to-peer example” for how GDBusServer can +be used. +

+

+This is a synchronous failable constructor. See +g_dbus_server_new() for the asynchronous version. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

address :

A D-Bus address. +

flags :

Flags from the GDBusServerFlags enumeration. +

guid :

A D-Bus GUID. +

observer :

A GDBusAuthObserver or NULL. +

cancellable :

A GCancellable or NULL. +

error :

Return location for server or NULL. +

Returns :

A GDBusServer or NULL if error is set. Free with +g_object_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_server_start ()

+
void                g_dbus_server_start                 (GDBusServer *server);
+

+Starts server. +

+
++ + + + +

server :

A GDBusServer. +
+

Since 2.26

+
+
+
+

g_dbus_server_stop ()

+
void                g_dbus_server_stop                  (GDBusServer *server);
+

+Stops server. +

+
++ + + + +

server :

A GDBusServer. +
+

Since 2.26

+
+
+
+

g_dbus_server_is_active ()

+
gboolean            g_dbus_server_is_active             (GDBusServer *server);
+

+Gets whether server is active. +

+
++ + + + + + + + + + +

server :

A GDBusServer. +

Returns :

TRUE if server is active, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_server_get_guid ()

+
const gchar *       g_dbus_server_get_guid              (GDBusServer *server);
+

+Gets the GUID for server. +

+
++ + + + + + + + + + +

server :

A GDBusServer. +

Returns :

A D-Bus GUID. Do not free this string, it is owned by server. + +
+

Since 2.26

+
+
+
+

g_dbus_server_get_flags ()

+
GDBusServerFlags    g_dbus_server_get_flags             (GDBusServer *server);
+

+Gets the flags for server. +

+
++ + + + + + + + + + +

server :

A GDBusServer. +

Returns :

A set of flags from the GDBusServerFlags enumeration. + +
+

Since 2.26

+
+
+
+

g_dbus_server_get_client_address ()

+
const gchar *       g_dbus_server_get_client_address    (GDBusServer *server);
+

+Gets a D-Bus address string that can be used by clients to connect +to server. +

+
++ + + + + + + + + + +

server :

A GDBusServer. +

Returns :

A D-Bus address string. Do not free, the string is owned +by server. + +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "active" property

+
  "active"                   gboolean              : Read
+

+Whether the server is currently active. +

+

Default value: FALSE

+

Since 2.26

+
+
+
+

The "address" property

+
  "address"                  gchar*                : Read / Write / Construct Only
+

+The D-Bus address to listen on. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "authentication-observer" property

+
  "authentication-observer"  GDBusAuthObserver*    : Read / Write / Construct Only
+

+A GDBusAuthObserver object to assist in the authentication process or NULL. +

+

Since 2.26

+
+
+
+

The "client-address" property

+
  "client-address"           gchar*                : Read
+

+The D-Bus address that clients can use. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

The "flags" property

+
  "flags"                    GDBusServerFlags      : Read / Write / Construct Only
+

+Flags from the GDBusServerFlags enumeration. +

+

Since 2.26

+
+
+
+

The "guid" property

+
  "guid"                     gchar*                : Read / Write / Construct Only
+

+The guid of the server. +

+

Default value: NULL

+

Since 2.26

+
+
+
+

Signal Details

+
+

The "new-connection" signal

+
gboolean            user_function                      (GDBusServer     *server,
+                                                        GDBusConnection *connection,
+                                                        gpointer         user_data)       : Run Last
+

+Emitted when a new authenticated connection has been made. Use +g_dbus_connection_get_peer_credentials() to figure out what +identity (if any), was authenticated. +

+

+If you want to accept the connection, take a reference to the +connection object and return TRUE. When you are done with the +connection call g_dbus_connection_close() and give up your +reference. Note that the other peer may disconnect at any time - +a typical thing to do when accepting a connection is to listen to +the "closed" signal. +

+

+If "flags" contains G_DBUS_SERVER_FLAGS_RUN_IN_THREAD +then the signal is emitted in a new thread dedicated to the +connection. Otherwise the signal is emitted in the thread-default main +loop of the thread that server was constructed in. +

+

+You are guaranteed that signal handlers for this signal runs +before incoming messages on connection are processed. This means +that it's suitable to call g_dbus_connection_register_object() or +similar from the signal handler. +

+
++ + + + + + + + + + + + + + + + + + +

server :

The GDBusServer emitting the signal. +

connection :

A GDBusConnection for the new connection. +

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to claim connection, FALSE to let other handlers +run. +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GDataInputStream.html b/docs/reference/gio/html/GDataInputStream.html index 3625f33..cf74bd2 100644 --- a/docs/reference/gio/html/GDataInputStream.html +++ b/docs/reference/gio/html/GDataInputStream.html @@ -3,12 +3,12 @@ GDataInputStream - + - + @@ -57,64 +57,82 @@ enum GDataStreamNewlineType type
); GDataStreamNewlineType g_data_input_stream_get_newline_type (GDataInputStream *stream); -guchar g_data_input_stream_read_byte (GDataInputStream *stream, +guchar g_data_input_stream_read_byte (GDataInputStream *stream, GCancellable *cancellable, - GError **error); -gint16 g_data_input_stream_read_int16 (GDataInputStream *stream, + GError **error); +gint16 g_data_input_stream_read_int16 (GDataInputStream *stream, GCancellable *cancellable, - GError **error); -guint16 g_data_input_stream_read_uint16 (GDataInputStream *stream, + GError **error); +guint16 g_data_input_stream_read_uint16 (GDataInputStream *stream, GCancellable *cancellable, - GError **error); -gint32 g_data_input_stream_read_int32 (GDataInputStream *stream, + GError **error); +gint32 g_data_input_stream_read_int32 (GDataInputStream *stream, GCancellable *cancellable, - GError **error); -guint32 g_data_input_stream_read_uint32 (GDataInputStream *stream, + GError **error); +guint32 g_data_input_stream_read_uint32 (GDataInputStream *stream, GCancellable *cancellable, - GError **error); -gint64 g_data_input_stream_read_int64 (GDataInputStream *stream, + GError **error); +gint64 g_data_input_stream_read_int64 (GDataInputStream *stream, GCancellable *cancellable, - GError **error); -guint64 g_data_input_stream_read_uint64 (GDataInputStream *stream, + GError **error); +guint64 g_data_input_stream_read_uint64 (GDataInputStream *stream, GCancellable *cancellable, - GError **error); + GError **error); char * g_data_input_stream_read_line (GDataInputStream *stream, - gsize *length, + gsize *length, GCancellable *cancellable, - GError **error); + GError **error); void g_data_input_stream_read_line_async (GDataInputStream *stream, - gint io_priority, + gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); char * g_data_input_stream_read_line_finish (GDataInputStream *stream, GAsyncResult *result, - gsize *length, - GError **error); + gsize *length, + GError **error); +char * g_data_input_stream_read_upto (GDataInputStream *stream, + const gchar *stop_chars, + gssize stop_chars_len, + gsize *length, + GCancellable *cancellable, + GError **error); +void g_data_input_stream_read_upto_async (GDataInputStream *stream, + const gchar *stop_chars, + gssize stop_chars_len, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +char * g_data_input_stream_read_upto_finish + (GDataInputStream *stream, + GAsyncResult *result, + gsize *length, + GError **error); char * g_data_input_stream_read_until (GDataInputStream *stream, - const gchar *stop_chars, - gsize *length, + const gchar *stop_chars, + gsize *length, GCancellable *cancellable, - GError **error); + GError **error); void g_data_input_stream_read_until_async (GDataInputStream *stream, - const gchar *stop_chars, - gint io_priority, + const gchar *stop_chars, + gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); char * g_data_input_stream_read_until_finish (GDataInputStream *stream, GAsyncResult *result, - gsize *length, - GError **error); + gsize *length, + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GFilterInputStream
                +----GBufferedInputStream
@@ -144,10 +162,6 @@ reading structured data directly from a binary input stream.
 An implementation of GBufferedInputStream that allows for high-level
 data manipulation of arbitrary data (including binary operations).
 

-
-- -

@@ -351,9 +365,9 @@ Gets the current newline type for the stream<

g_data_input_stream_read_byte ()

-
guchar              g_data_input_stream_read_byte       (GDataInputStream *stream,
+
guchar              g_data_input_stream_read_byte       (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads an unsigned 8-bit/1-byte value from stream.

@@ -367,13 +381,13 @@ Reads an unsigned 8-bit/1-byte value from stream

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting. @@ -388,15 +402,15 @@ if an error occurred.

g_data_input_stream_read_int16 ()

-
gint16              g_data_input_stream_read_int16      (GDataInputStream *stream,
+
gint16              g_data_input_stream_read_int16      (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads a 16-bit/2-byte value from stream.

In order to get the correct byte order for this read operation, -see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). +see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().

@@ -408,13 +422,13 @@ see g_data_stream_get_byte_order() and - @@ -429,15 +443,15 @@ an error occurred.

g_data_input_stream_read_uint16 ()

-
guint16             g_data_input_stream_read_uint16     (GDataInputStream *stream,
+
guint16             g_data_input_stream_read_uint16     (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads an unsigned 16-bit/2-byte value from stream.

In order to get the correct byte order for this read operation, -see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). +see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.
@@ -449,13 +463,13 @@ see g_data_stream_get_byte_order() and - @@ -470,18 +484,18 @@ an error occurred.

g_data_input_stream_read_int32 ()

-
gint32              g_data_input_stream_read_int32      (GDataInputStream *stream,
+
gint32              g_data_input_stream_read_int32      (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads a signed 32-bit/4-byte value from stream.

In order to get the correct byte order for this read operation, -see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). +see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -495,13 +509,13 @@ was cancelled, the error cancellable :

-
@@ -516,18 +530,18 @@ an error occurred.

g_data_input_stream_read_uint32 ()

-
guint32             g_data_input_stream_read_uint32     (GDataInputStream *stream,
+
guint32             g_data_input_stream_read_uint32     (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads an unsigned 32-bit/4-byte value from stream.

In order to get the correct byte order for this read operation, -see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). +see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -541,13 +555,13 @@ was cancelled, the error cancellable :

-
@@ -562,18 +576,18 @@ an error occurred.

g_data_input_stream_read_int64 ()

-
gint64              g_data_input_stream_read_int64      (GDataInputStream *stream,
+
gint64              g_data_input_stream_read_int64      (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads a 64-bit/8-byte value from stream.

In order to get the correct byte order for this read operation, -see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). +see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -587,13 +601,13 @@ was cancelled, the error cancellable :

-
@@ -608,18 +622,18 @@ an error occurred.

g_data_input_stream_read_uint64 ()

-
guint64             g_data_input_stream_read_uint64     (GDataInputStream *stream,
+
guint64             g_data_input_stream_read_uint64     (GDataInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads an unsigned 64-bit/8-byte value from stream.

In order to get the correct byte order for this read operation, -see g_data_stream_get_byte_order(). +see g_data_input_stream_get_byte_order().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -633,13 +647,13 @@ was cancelled, the error cancellable :

-
@@ -655,14 +669,14 @@ an error occurred.

g_data_input_stream_read_line ()

char *              g_data_input_stream_read_line       (GDataInputStream *stream,
-                                                         gsize *length,
+                                                         gsize *length,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads a line from the data input stream.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -676,26 +690,26 @@ was cancelled, the error length :

-
- @@ -705,10 +719,10 @@ was cancelled, the error

g_data_input_stream_read_line_async ()

void                g_data_input_stream_read_line_async (GDataInputStream *stream,
-                                                         gint io_priority,
+                                                         gint io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

The asynchronous version of g_data_input_stream_read_line(). It is an error to have two outstanding calls to this function. @@ -734,7 +748,7 @@ the result of the operation.

- @@ -757,8 +771,8 @@ the result of the operation.
char *              g_data_input_stream_read_line_finish
                                                         (GDataInputStream *stream,
                                                          GAsyncResult *result,
-                                                         gsize *length,
-                                                         GError **error);
+ gsize *length, + GError **error);

Finish an asynchronous call started by g_data_input_stream_read_line_async(). @@ -778,21 +792,21 @@ Finish an asynchronous call started by

- @@ -801,13 +815,209 @@ Finish an asynchronous call started by

Since 2.20


+
+

g_data_input_stream_read_upto ()

+
char *              g_data_input_stream_read_upto       (GDataInputStream *stream,
+                                                         const gchar *stop_chars,
+                                                         gssize stop_chars_len,
+                                                         gsize *length,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Reads a string from the data input stream, up to the first +occurrence of any of the stop characters. +

+

+In contrast to g_data_input_stream_read_until(), this function +does not consume the stop character. You have +to use g_data_input_stream_read_byte() to get it before calling +g_data_input_stream_read_upto() again. +

+

+Note that stop_chars may contain '\0' if stop_chars_len is +specified. +

+

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.
a gsize to get the length of the data read in. +a gsize to get the length of the data read in.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.

Returns :

a string with the line that was read in (without the newlines). - Set length to a gsize to get the length of the read line. - On an error, it will return NULL and error will be set. If there's no - content to read, it will still return NULL, but error won't be set. + Set length to a gsize to get the length of the read line. + On an error, it will return NULL and error will be set. If there's no + content to read, it will still return NULL, but error won't be set.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

length :

a gsize to get the length of the data read in. +a gsize to get the length of the data read in.

error :

-GError for error reporting. +GError for error reporting.

Returns :

a string with the line that was read in (without the newlines). - Set length to a gsize to get the length of the read line. - On an error, it will return NULL and error will be set. If there's no - content to read, it will still return NULL, but error won't be set. + Set length to a gsize to get the length of the read line. + On an error, it will return NULL and error will be set. If there's no + content to read, it will still return NULL, but error won't be set.
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream :

a GDataInputStream +

stop_chars :

characters to terminate the read +

stop_chars_len :

length of stop_chars. May be -1 if stop_chars is + nul-terminated +

length :

a gsize to get the length of the data read in +

cancellable :

optional GCancellable object, NULL to ignore +

error :

+GError for error reporting +

Returns :

a string with the data that was read before encountering + any of the stop characters. Set length to a gsize to get the length + of the string. This function will return NULL on an error + +
+

Since 2.24

+
+
+
+

g_data_input_stream_read_upto_async ()

+
void                g_data_input_stream_read_upto_async (GDataInputStream *stream,
+                                                         const gchar *stop_chars,
+                                                         gssize stop_chars_len,
+                                                         gint io_priority,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+The asynchronous version of g_data_input_stream_read_upto(). +It is an error to have two outstanding calls to this function. +

+

+In contrast to g_data_input_stream_read_until(), this function +does not consume the stop character. You have +to use g_data_input_stream_read_byte() to get it before calling +g_data_input_stream_read_upto() again. +

+

+Note that stop_chars may contain '\0' if stop_chars_len is +specified. +

+

+When the operation is finished, callback will be called. You +can then call g_data_input_stream_read_upto_finish() to get +the result of the operation. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream :

a GDataInputStream +

stop_chars :

characters to terminate the read +

stop_chars_len :

length of stop_chars. May be -1 if stop_chars is + nul-terminated +

io_priority :

the I/O priority + of the request. +

cancellable :

optional GCancellable object, NULL to ignore +

callback :

callback to call when the request is satisfied +

user_data :

the data to pass to callback function +
+

Since 2.24

+
+
+
+

g_data_input_stream_read_upto_finish ()

+
char *              g_data_input_stream_read_upto_finish
+                                                        (GDataInputStream *stream,
+                                                         GAsyncResult *result,
+                                                         gsize *length,
+                                                         GError **error);
+

+Finish an asynchronous call started by +g_data_input_stream_read_upto_async(). +

+

+Note that this function does not consume the +stop character. You have to use g_data_input_stream_read_byte() to +get it before calling g_data_input_stream_read_upto_async() again. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

stream :

a GDataInputStream +

result :

the GAsyncResult that was provided to the callback +

length :

a gsize to get the length of the data read in +

error :

+GError for error reporting +

Returns :

a string with the data that was read before encountering + any of the stop characters. Set length to a gsize to get the length + of the string. This function will return NULL on an error. + +
+

Since 2.24

+
+

g_data_input_stream_read_until ()

char *              g_data_input_stream_read_until      (GDataInputStream *stream,
-                                                         const gchar *stop_chars,
-                                                         gsize *length,
+                                                         const gchar *stop_chars,
+                                                         gsize *length,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Reads a string from the data input stream, up to the first occurrence of any of the stop characters. @@ -816,6 +1026,13 @@ occurrence of any of the stop characters. Note that, in contrast to g_data_input_stream_read_until_async(), this function consumes the stop character that it finds.

+

+Don't use this function in new code. Its functionality is +inconsistent with g_data_input_stream_read_until_async(). Both +functions will be marked as deprecated in a future release. Use +g_data_input_stream_read_upto() instead, but note that that function +does not consume the stop character. +

@@ -831,25 +1048,25 @@ this function consumes the stop character that it finds. - - @@ -860,11 +1077,11 @@ this function consumes the stop character that it finds.

g_data_input_stream_read_until_async ()

void                g_data_input_stream_read_until_async
                                                         (GDataInputStream *stream,
-                                                         const gchar *stop_chars,
-                                                         gint io_priority,
+                                                         const gchar *stop_chars,
+                                                         gint io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

The asynchronous version of g_data_input_stream_read_until(). It is an error to have two outstanding calls to this function. @@ -879,6 +1096,12 @@ When the operation is finished, callback can then call g_data_input_stream_read_until_finish() to get the result of the operation.

+

+Don't use this function in new code. Its functionality is +inconsistent with g_data_input_stream_read_until(). Both functions +will be marked as deprecated in a future release. Use +g_data_input_stream_read_upto_async() instead. +

length :

a gsize to get the length of the data read in. +a gsize to get the length of the data read in.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting. +GError for error reporting.

Returns :

a string with the data that was read before encountering - any of the stop characters. Set length to a gsize to get the length - of the string. This function will return NULL on an error. + any of the stop characters. Set length to a gsize to get the length + of the string. This function will return NULL on an error.
@@ -900,7 +1123,7 @@ the result of the operation. - @@ -923,8 +1146,8 @@ the result of the operation.
char *              g_data_input_stream_read_until_finish
                                                         (GDataInputStream *stream,
                                                          GAsyncResult *result,
-                                                         gsize *length,
-                                                         GError **error);
+ gsize *length, + GError **error);

Finish an asynchronous call started by g_data_input_stream_read_until_async(). @@ -944,20 +1167,20 @@ Finish an asynchronous call started by

- @@ -988,6 +1211,6 @@ Finish an asynchronous call started by + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GDataOutputStream.html b/docs/reference/gio/html/GDataOutputStream.html index 3821784..f85431d 100644 --- a/docs/reference/gio/html/GDataOutputStream.html +++ b/docs/reference/gio/html/GDataOutputStream.html @@ -3,12 +3,12 @@ GDataOutputStream - + - + @@ -50,44 +50,44 @@ GDataStreamByteOrder order); GDataStreamByteOrderg_data_output_stream_get_byte_order (GDataOutputStream *stream); -gbooleang_data_output_stream_put_byte (GDataOutputStream *stream, - guchar data, +gbooleang_data_output_stream_put_byte (GDataOutputStream *stream, + guchar data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_int16 (GDataOutputStream *stream, - gint16 data, + GError **error); +gbooleang_data_output_stream_put_int16 (GDataOutputStream *stream, + gint16 data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_uint16 (GDataOutputStream *stream, - guint16 data, + GError **error); +gbooleang_data_output_stream_put_uint16 (GDataOutputStream *stream, + guint16 data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_int32 (GDataOutputStream *stream, - gint32 data, + GError **error); +gbooleang_data_output_stream_put_int32 (GDataOutputStream *stream, + gint32 data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_uint32 (GDataOutputStream *stream, - guint32 data, + GError **error); +gbooleang_data_output_stream_put_uint32 (GDataOutputStream *stream, + guint32 data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_int64 (GDataOutputStream *stream, - gint64 data, + GError **error); +gbooleang_data_output_stream_put_int64 (GDataOutputStream *stream, + gint64 data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_uint64 (GDataOutputStream *stream, - guint64 data, + GError **error); +gbooleang_data_output_stream_put_uint64 (GDataOutputStream *stream, + guint64 data, GCancellable *cancellable, - GError **error); -gbooleang_data_output_stream_put_string (GDataOutputStream *stream, + GError **error); +gbooleang_data_output_stream_put_string (GDataOutputStream *stream, const char *str, GCancellable *cancellable, - GError **error); + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GFilterOutputStream
                +----GDataOutputStream
@@ -115,10 +115,6 @@ writing data directly to an output stream.
 An implementation of GBufferedOutputStream that allows for high-level
 data manipulation of arbitrary data (including binary operations).
 

-

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

length :

a gsize to get the length of the data read in. +a gsize to get the length of the data read in.

error :

-GError for error reporting. +GError for error reporting.

Returns :

a string with the data that was read before encountering - any of the stop characters. Set length to a gsize to get the length - of the string. This function will return NULL on an error. + any of the stop characters. Set length to a gsize to get the length + of the string. This function will return NULL on an error.
-- -

@@ -194,10 +190,10 @@ Gets the byte order for the stream.

g_data_output_stream_put_byte ()

-
gboolean            g_data_output_stream_put_byte       (GDataOutputStream *stream,
-                                                         guchar data,
+
gboolean            g_data_output_stream_put_byte       (GDataOutputStream *stream,
+                                                         guchar data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts a byte into the output stream.

@@ -211,22 +207,22 @@ Puts a byte into the output stream.

data :

-a guchar. +a guchar.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -235,10 +231,10 @@ Puts a byte into the output stream.

g_data_output_stream_put_int16 ()

-
gboolean            g_data_output_stream_put_int16      (GDataOutputStream *stream,
-                                                         gint16 data,
+
gboolean            g_data_output_stream_put_int16      (GDataOutputStream *stream,
+                                                         gint16 data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts a signed 16-bit integer into the output stream.

@@ -252,22 +248,22 @@ Puts a signed 16-bit integer into the output stream.

data :

-a gint16. +a gint16.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -276,10 +272,10 @@ Puts a signed 16-bit integer into the output stream.

g_data_output_stream_put_uint16 ()

-
gboolean            g_data_output_stream_put_uint16     (GDataOutputStream *stream,
-                                                         guint16 data,
+
gboolean            g_data_output_stream_put_uint16     (GDataOutputStream *stream,
+                                                         guint16 data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts an unsigned 16-bit integer into the output stream.

@@ -293,22 +289,22 @@ Puts an unsigned 16-bit integer into the output stream.

data :

-a guint16. +a guint16.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -317,10 +313,10 @@ Puts an unsigned 16-bit integer into the output stream.

g_data_output_stream_put_int32 ()

-
gboolean            g_data_output_stream_put_int32      (GDataOutputStream *stream,
-                                                         gint32 data,
+
gboolean            g_data_output_stream_put_int32      (GDataOutputStream *stream,
+                                                         gint32 data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts a signed 32-bit integer into the output stream.

@@ -334,22 +330,22 @@ Puts a signed 32-bit integer into the output stream.

data :

-a gint32. +a gint32.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -358,10 +354,10 @@ Puts a signed 32-bit integer into the output stream.

g_data_output_stream_put_uint32 ()

-
gboolean            g_data_output_stream_put_uint32     (GDataOutputStream *stream,
-                                                         guint32 data,
+
gboolean            g_data_output_stream_put_uint32     (GDataOutputStream *stream,
+                                                         guint32 data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts an unsigned 32-bit integer into the stream.

@@ -375,22 +371,22 @@ Puts an unsigned 32-bit integer into the stream.

data :

-a guint32. +a guint32.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -399,10 +395,10 @@ Puts an unsigned 32-bit integer into the stream.

g_data_output_stream_put_int64 ()

-
gboolean            g_data_output_stream_put_int64      (GDataOutputStream *stream,
-                                                         gint64 data,
+
gboolean            g_data_output_stream_put_int64      (GDataOutputStream *stream,
+                                                         gint64 data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts a signed 64-bit integer into the stream.

@@ -416,22 +412,22 @@ Puts a signed 64-bit integer into the stream.

data :

-a gint64. +a gint64.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -440,10 +436,10 @@ Puts a signed 64-bit integer into the stream.

g_data_output_stream_put_uint64 ()

-
gboolean            g_data_output_stream_put_uint64     (GDataOutputStream *stream,
-                                                         guint64 data,
+
gboolean            g_data_output_stream_put_uint64     (GDataOutputStream *stream,
+                                                         guint64 data,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts an unsigned 64-bit integer into the stream.

@@ -457,22 +453,22 @@ Puts an unsigned 64-bit integer into the stream.

data :

-a guint64. +a guint64.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if data was successfully added to the stream. + TRUE if data was successfully added to the stream. @@ -481,10 +477,10 @@ Puts an unsigned 64-bit integer into the stream.

g_data_output_stream_put_string ()

-
gboolean            g_data_output_stream_put_string     (GDataOutputStream *stream,
+
gboolean            g_data_output_stream_put_string     (GDataOutputStream *stream,
                                                          const char *str,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Puts a string into the output stream.

@@ -503,17 +499,17 @@ Puts a string into the output stream.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

- TRUE if string was successfully added to the stream. + TRUE if string was successfully added to the stream. @@ -539,6 +535,6 @@ multi-byte entities (such as integers) to the stream.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GDrive.html b/docs/reference/gio/html/GDrive.html index 4ffc5ff..43dcc07 100644 --- a/docs/reference/gio/html/GDrive.html +++ b/docs/reference/gio/html/GDrive.html @@ -3,12 +3,12 @@ GDrive - + - + @@ -52,59 +52,59 @@ enum GDriveStartStopType; char * g_drive_get_name (GDrive *drive); GIcon * g_drive_get_icon (GDrive *drive); -gboolean g_drive_has_volumes (GDrive *drive); -GList * g_drive_get_volumes (GDrive *drive); -gboolean g_drive_can_eject (GDrive *drive); +gboolean g_drive_has_volumes (GDrive *drive); +GList * g_drive_get_volumes (GDrive *drive); +gboolean g_drive_can_eject (GDrive *drive); GDriveStartStopType g_drive_get_start_stop_type (GDrive *drive); -gboolean g_drive_can_start (GDrive *drive); -gboolean g_drive_can_start_degraded (GDrive *drive); -gboolean g_drive_can_stop (GDrive *drive); -gboolean g_drive_can_poll_for_media (GDrive *drive); +gboolean g_drive_can_start (GDrive *drive); +gboolean g_drive_can_start_degraded (GDrive *drive); +gboolean g_drive_can_stop (GDrive *drive); +gboolean g_drive_can_poll_for_media (GDrive *drive); void g_drive_poll_for_media (GDrive *drive, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_drive_poll_for_media_finish (GDrive *drive, + gpointer user_data); +gboolean g_drive_poll_for_media_finish (GDrive *drive, GAsyncResult *result, - GError **error); -gboolean g_drive_has_media (GDrive *drive); -gboolean g_drive_is_media_check_automatic (GDrive *drive); -gboolean g_drive_is_media_removable (GDrive *drive); + GError **error); +gboolean g_drive_has_media (GDrive *drive); +gboolean g_drive_is_media_check_automatic (GDrive *drive); +gboolean g_drive_is_media_removable (GDrive *drive); void g_drive_eject (GDrive *drive, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_drive_eject_finish (GDrive *drive, + gpointer user_data); +gboolean g_drive_eject_finish (GDrive *drive, GAsyncResult *result, - GError **error); + GError **error); void g_drive_eject_with_operation (GDrive *drive, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_drive_eject_with_operation_finish (GDrive *drive, + gpointer user_data); +gboolean g_drive_eject_with_operation_finish (GDrive *drive, GAsyncResult *result, - GError **error); + GError **error); void g_drive_start (GDrive *drive, GDriveStartFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_drive_start_finish (GDrive *drive, + gpointer user_data); +gboolean g_drive_start_finish (GDrive *drive, GAsyncResult *result, - GError **error); + GError **error); void g_drive_stop (GDrive *drive, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_drive_stop_finish (GDrive *drive, + gpointer user_data); +gboolean g_drive_stop_finish (GDrive *drive, GAsyncResult *result, - GError **error); + GError **error); char ** g_drive_enumerate_identifiers (GDrive *drive); char * g_drive_get_identifier (GDrive *drive, const char *kind); @@ -121,7 +121,7 @@ enum

Prerequisites

GDrive requires - GObject.

+ GObject.

Signals

@@ -262,7 +262,7 @@ Interface for creating -

GTypeInterface g_iface;

+

GTypeInterface g_iface;

The parent interface. @@ -293,37 +293,37 @@ Interface for creating

has_volumes ()

-Returns TRUE if the GDrive has mountable volumes. +Returns TRUE if the GDrive has mountable volumes.

get_volumes ()

-Returns a list GList of GVolume for the GDrive. +Returns a list GList of GVolume for the GDrive.

is_media_removable ()

-Returns TRUE if the GDrive supports removal and insertion of media. +Returns TRUE if the GDrive supports removal and insertion of media.

has_media ()

-Returns TRUE if the GDrive has media inserted. +Returns TRUE if the GDrive has media inserted.

is_media_check_automatic ()

-Returns TRUE if the GDrive is capabable of automatically detecting media changes. +Returns TRUE if the GDrive is capabable of automatically detecting media changes.

can_eject ()

-Returns TRUE if the GDrive can eject media. +Returns TRUE if the GDrive can eject media.

can_poll_for_media ()

-Returns TRUE if the GDrive is capable of manually polling for media change. +Returns TRUE if the GDrive is capable of manually polling for media change. @@ -348,7 +348,7 @@ Interface for creating

get_identifier ()

-Returns the identifier of the given kind, or NULL if +Returns the identifier of the given kind, or NULL if the GDrive doesn't have one. @@ -365,12 +365,12 @@ Interface for creating

can_start ()

-Returns TRUE if a GDrive can be started. Since 2.22. +Returns TRUE if a GDrive can be started. Since 2.22.

can_start_degraded ()

-Returns TRUE if a GDrive can be started degraded. Since 2.22. +Returns TRUE if a GDrive can be started degraded. Since 2.22. @@ -385,7 +385,7 @@ Interface for creating

can_stop ()

-Returns TRUE if a GDrive can be stopped. Since 2.22. +Returns TRUE if a GDrive can be stopped. Since 2.22. @@ -532,7 +532,7 @@ Gets the icon for drive.

Returns :

GIcon for the drive. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). [transfer full] @@ -541,7 +541,7 @@ Gets the icon for drive.

g_drive_has_volumes ()

-
gboolean            g_drive_has_volumes                 (GDrive *drive);
+
gboolean            g_drive_has_volumes                 (GDrive *drive);

Check if drive has any mountable volumes.

@@ -555,7 +555,7 @@ Check if drive has any mountable volumes

Returns :

- TRUE if the drive contains volumes, FALSE otherwise. + TRUE if the drive contains volumes, FALSE otherwise. @@ -564,13 +564,13 @@ Check if drive has any mountable volumes

g_drive_get_volumes ()

-
GList *             g_drive_get_volumes                 (GDrive *drive);
+
GList *             g_drive_get_volumes                 (GDrive *drive);

Get a list of mountable volumes for drive.

-The returned list should be freed with g_list_free(), after -its elements have been unreffed with g_object_unref(). +The returned list should be freed with g_list_free(), after +its elements have been unreffed with g_object_unref().

@@ -582,7 +582,7 @@ its elements have been unreffed with Returns :

-
@@ -591,7 +591,7 @@ its elements have been unreffed with

g_drive_can_eject ()

-
gboolean            g_drive_can_eject                   (GDrive *drive);
+
gboolean            g_drive_can_eject                   (GDrive *drive);

Checks if a drive can be ejected.

@@ -605,7 +605,7 @@ Checks if a drive can be ejected. - @@ -639,7 +639,7 @@ Gets a hint about how a drive can be started/stopped.

g_drive_can_start ()

-
gboolean            g_drive_can_start                   (GDrive *drive);
+
gboolean            g_drive_can_start                   (GDrive *drive);

Checks if a drive can be started.

@@ -653,7 +653,7 @@ Checks if a drive can be started.
- @@ -664,7 +664,7 @@ Checks if a drive can be started.

g_drive_can_start_degraded ()

-
gboolean            g_drive_can_start_degraded          (GDrive *drive);
+
gboolean            g_drive_can_start_degraded          (GDrive *drive);

Checks if a drive can be started degraded.

@@ -678,7 +678,7 @@ Checks if a drive can be started degraded.
- @@ -689,7 +689,7 @@ Checks if a drive can be started degraded.

g_drive_can_stop ()

-
gboolean            g_drive_can_stop                    (GDrive *drive);
+
gboolean            g_drive_can_stop                    (GDrive *drive);

Checks if a drive can be stopped.

@@ -703,7 +703,7 @@ Checks if a drive can be stopped.
- @@ -714,7 +714,7 @@ Checks if a drive can be stopped.

g_drive_can_poll_for_media ()

-
gboolean            g_drive_can_poll_for_media          (GDrive *drive);
+
gboolean            g_drive_can_poll_for_media          (GDrive *drive);

Checks if a drive can be polled for media changes.

@@ -728,8 +728,8 @@ Checks if a drive can be polled for media changes.
- @@ -741,7 +741,7 @@ Checks if a drive can be polled for media changes.
void                g_drive_poll_for_media              (GDrive *drive,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Asynchronously polls drive to see if media has been inserted or removed.

@@ -760,12 +760,12 @@ result of the operation. - - @@ -779,9 +779,9 @@ result of the operation.

g_drive_poll_for_media_finish ()

-
gboolean            g_drive_poll_for_media_finish       (GDrive *drive,
+
gboolean            g_drive_poll_for_media_finish       (GDrive *drive,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an operation started with g_drive_poll_for_media() on a drive.

@@ -800,13 +800,13 @@ Finishes an operation started with error :

-
- @@ -815,7 +815,7 @@ Finishes an operation started with

g_drive_has_media ()

-
gboolean            g_drive_has_media                   (GDrive *drive);
+
gboolean            g_drive_has_media                   (GDrive *drive);

Checks if the drive has media. Note that the OS may not be polling the drive for media changes; see g_drive_is_media_check_automatic() @@ -831,7 +831,7 @@ for more details.

- @@ -840,7 +840,7 @@ for more details.

g_drive_is_media_check_automatic ()

-
gboolean            g_drive_is_media_check_automatic    (GDrive *drive);
+
gboolean            g_drive_is_media_check_automatic    (GDrive *drive);

Checks if drive is capabable of automatically detecting media changes.

@@ -854,8 +854,8 @@ Checks if drive is capabable of automati
- @@ -864,7 +864,7 @@ Checks if drive is capabable of automati

g_drive_is_media_removable ()

-
gboolean            g_drive_is_media_removable          (GDrive *drive);
+
gboolean            g_drive_is_media_removable          (GDrive *drive);

Checks if the drive supports removable media.

@@ -878,7 +878,7 @@ Checks if the drive supports removable m
- @@ -891,7 +891,7 @@ Checks if the drive supports removable m GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Warning

g_drive_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_drive_eject_with_operation() instead.

@@ -919,12 +919,12 @@ result of the operation.
- - @@ -938,9 +938,9 @@ result of the operation.

g_drive_eject_finish ()

-
gboolean            g_drive_eject_finish                (GDrive *drive,
+
gboolean            g_drive_eject_finish                (GDrive *drive,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Warning

g_drive_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_drive_eject_with_operation_finish() instead.

@@ -963,13 +963,13 @@ Finishes ejecting a drive.
- - @@ -984,7 +984,7 @@ Finishes ejecting a drive. GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Ejects a drive. This is an asynchronous operation, and is finished by calling g_drive_eject_with_operation_finish() with the drive @@ -1005,17 +1005,17 @@ and mount_operation :

- - - @@ -1030,12 +1030,12 @@ and

g_drive_eject_with_operation_finish ()

-
gboolean            g_drive_eject_with_operation_finish (GDrive *drive,
+
gboolean            g_drive_eject_with_operation_finish (GDrive *drive,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes ejecting a drive. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

GList containing any GVolume objects on the given drive. + GList containing any GVolume objects on the given drive. [element-type GVolume][transfer full GVolume]

Returns :

TRUE if the drive can be ejected, FALSE otherwise. + TRUE if the drive can be ejected, FALSE otherwise.

Returns :

TRUE if the drive can be started, FALSE otherwise. + TRUE if the drive can be started, FALSE otherwise.

Returns :

TRUE if the drive can be started degraded, FALSE otherwise. + TRUE if the drive can be started degraded, FALSE otherwise.

Returns :

TRUE if the drive can be stopped, FALSE otherwise. + TRUE if the drive can be stopped, FALSE otherwise.

Returns :

TRUE if the drive can be polled for media changes, - FALSE otherwise. + TRUE if the drive can be polled for media changes, + FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
a GError, or NULL +a GError, or NULL

Returns :

TRUE if the drive has been poll_for_mediaed successfully, - FALSE otherwise. + TRUE if the drive has been poll_for_mediaed successfully, + FALSE otherwise.

Returns :

TRUE if drive has media, FALSE otherwise. + TRUE if drive has media, FALSE otherwise.

Returns :

TRUE if the drive is capabable of automatically detecting - media changes, FALSE otherwise. + TRUE if the drive is capabable of automatically detecting + media changes, FALSE otherwise.

Returns :

TRUE if drive supports removable media, FALSE otherwise. + TRUE if drive supports removable media, FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the drive has been ejected successfully, - FALSE otherwise. + TRUE if the drive has been ejected successfully, + FALSE otherwise.
a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -1052,13 +1052,13 @@ Finishes ejecting a drive. If any errors occurred during the operation, - - @@ -1074,7 +1074,7 @@ Finishes ejecting a drive. If any errors occurred during the operation, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously starts a drive.

@@ -1098,17 +1098,17 @@ result of the operation. - - - @@ -1123,9 +1123,9 @@ result of the operation.

g_drive_start_finish ()

-
gboolean            g_drive_start_finish                (GDrive *drive,
+
gboolean            g_drive_start_finish                (GDrive *drive,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes starting a drive.

@@ -1144,13 +1144,13 @@ Finishes starting a drive.
- - @@ -1166,7 +1166,7 @@ Finishes starting a drive. GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously stops a drive.

@@ -1190,17 +1190,17 @@ result of the operation. - - - @@ -1215,9 +1215,9 @@ result of the operation.

g_drive_stop_finish ()

-
gboolean            g_drive_stop_finish                 (GDrive *drive,
+
gboolean            g_drive_stop_finish                 (GDrive *drive,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes stopping a drive.

@@ -1236,13 +1236,13 @@ Finishes stopping a drive.
- - @@ -1269,8 +1269,8 @@ themselves. - @@ -1300,7 +1300,7 @@ Gets the identifier of the given kind for drive @@ -1313,7 +1313,7 @@ Gets the identifier of the given kind for drive

The "changed" signal

void                user_function                      (GDrive  *drive,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the drive's state has changed.

@@ -1336,7 +1336,7 @@ Emitted when the drive's state has changed.

The "disconnected" signal

void                user_function                      (GDrive  *drive,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

This signal is emitted when the GDrive have been disconnected. If the recipient is holding references to the @@ -1362,7 +1362,7 @@ finalized.

The "eject-button" signal

void                user_function                      (GDrive  *drive,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the physical eject button (if any) of a drive has been pressed. @@ -1386,7 +1386,7 @@ been pressed.

The "stop-button" signal

void                user_function                      (GDrive  *drive,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the physical stop button (if any) of a drive has been pressed. @@ -1411,6 +1411,6 @@ been pressed.

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GEmblem.html b/docs/reference/gio/html/GEmblem.html index 63061f4..6ea0310 100644 --- a/docs/reference/gio/html/GEmblem.html +++ b/docs/reference/gio/html/GEmblem.html @@ -3,12 +3,12 @@ GEmblem - + - + @@ -58,7 +58,7 @@ enum

Object Hierarchy

-  GObject
+  GObject
    +----GEmblem
 
@@ -71,7 +71,7 @@ GEmblem implements

Properties

-  "icon"                     GObject*              : Read / Write / Construct Only
+  "icon"                     GObject*              : Read / Write / Construct Only
   "origin"                   GEmblemOrigin         : Read / Write / Construct Only
 
@@ -211,8 +211,7 @@ Gives back the icon from emblem.
@@ -249,7 +248,7 @@ Gets the origin of the emblem.

Property Details

The "icon" property

-
  "icon"                     GObject*              : Read / Write / Construct Only
+
  "icon"                     GObject*              : Read / Write / Construct Only

The actual icon of the emblem.


@@ -267,6 +266,6 @@ Gets the origin of the emblem. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GEmblemedIcon.html b/docs/reference/gio/html/GEmblemedIcon.html index 5389177..4380a63 100644 --- a/docs/reference/gio/html/GEmblemedIcon.html +++ b/docs/reference/gio/html/GEmblemedIcon.html @@ -3,12 +3,12 @@ GEmblemedIcon - + - + @@ -28,6 +28,8 @@ Object Hierarchy  |  Implemented Interfaces +  |  + Properties

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the drive was successfully ejected. FALSE otherwise. + TRUE if the drive was successfully ejected. FALSE otherwise.

mount_operation :

a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the drive has been started successfully, - FALSE otherwise. + TRUE if the drive has been started successfully, + FALSE otherwise.

mount_operation :

a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the drive has been stopped successfully, - FALSE otherwise. + TRUE if the drive has been stopped successfully, + FALSE otherwise.

Returns :

a NULL-terminated array of strings containing - kinds of identifiers. Use g_strfreev() to free. + a NULL-terminated array of strings containing + kinds of identifiers. Use g_strfreev() to free. [transfer full]

Returns :

a newly allocated string containing the - requested identfier, or NULL if the GDrive + requested identfier, or NULL if the GDrive doesn't have this kind of identifier.

Returns :

a GIcon. The returned object belongs to the emblem - and should not be modified or freed. - + and should not be modified or freed. [transfer full]

Object Hierarchy

-  GObject
+  GObject
    +----GEmblemedIcon
 
@@ -66,6 +69,12 @@ GEmblemedIcon implements GIcon.

+
+

Properties

+
+  "gicon"                    GIcon*                : Read / Write / Construct Only
+
+

Description

@@ -105,13 +114,12 @@ Creates a new emblemed icon for icon wit

emblem :

-a GEmblem + a GEmblem, or NULL. [allow-none]

Returns :

- a new GIcon - + a new GIcon. [transfer full] @@ -135,8 +143,7 @@ Gets the main icon for emblemed.

Returns :

- a GIcon that is owned by emblemed - + a GIcon that is owned by emblemed. [transfer none] @@ -146,7 +153,7 @@ Gets the main icon for emblemed.

g_emblemed_icon_get_emblems ()

-
GList *             g_emblemed_icon_get_emblems         (GEmblemedIcon *emblemed);
+
GList *             g_emblemed_icon_get_emblems         (GEmblemedIcon *emblemed);

Gets the list of emblems for the icon.

@@ -160,8 +167,8 @@ Gets the list of emblems for the icon.

Returns :

- a GList of GEmblem s that is owned by emblemed - + a GList of GEmblem s that +is owned by emblemed. [element-type utf8][transfer none utf8] @@ -174,7 +181,7 @@ Gets the list of emblems for the icon.
void                g_emblemed_icon_add_emblem          (GEmblemedIcon *emblemed,
                                                          GEmblem *emblem);

-Adds emblem to the GList of GEmblem s. +Adds emblem to the GList of GEmblem s.

@@ -193,6 +200,31 @@ Adds emblem to the Since 2.18

+
+
+

g_emblemed_icon_clear_emblems ()

+
void                g_emblemed_icon_clear_emblems       (GEmblemedIcon *emblemed);
+

+Removes all the emblems from icon. +

+
++ + + + +

emblemed :

a GEmblemedIcon +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "gicon" property

+
  "gicon"                    GIcon*                : Read / Write / Construct Only
+

The GIcon to attach emblems to.

+

See Also

@@ -201,6 +233,6 @@ Adds emblem to the
- Generated by GTK-Doc V1.14
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GFile.html b/docs/reference/gio/html/GFile.html index 52c5063..aad47a0 100644 --- a/docs/reference/gio/html/GFile.html +++ b/docs/reference/gio/html/GFile.html @@ -3,12 +3,12 @@ GFile - + - + @@ -51,112 +51,112 @@ enum GFileCopyFlags; enum GFileMonitorFlags; enum GFilesystemPreviewType; -void (*GFileProgressCallback) (goffset current_num_bytes, - goffset total_num_bytes, - gpointer user_data); -gboolean (*GFileReadMoreCallback) (const char *file_contents, - goffset file_size, - gpointer callback_data); +void (*GFileProgressCallback) (goffset current_num_bytes, + goffset total_num_bytes, + gpointer user_data); +gboolean (*GFileReadMoreCallback) (const char *file_contents, + goffset file_size, + gpointer callback_data); GFile * g_file_new_for_path (const char *path); GFile * g_file_new_for_uri (const char *uri); GFile * g_file_new_for_commandline_arg (const char *arg); GFile * g_file_parse_name (const char *parse_name); GFile * g_file_dup (GFile *file); -guint g_file_hash (gconstpointer file); -gboolean g_file_equal (GFile *file1, +guint g_file_hash (gconstpointer file); +gboolean g_file_equal (GFile *file1, GFile *file2); char * g_file_get_basename (GFile *file); char * g_file_get_path (GFile *file); char * g_file_get_uri (GFile *file); char * g_file_get_parse_name (GFile *file); GFile * g_file_get_parent (GFile *file); -gboolean g_file_has_parent (GFile *file, +gboolean g_file_has_parent (GFile *file, GFile *parent); GFile * g_file_get_child (GFile *file, const char *name); GFile * g_file_get_child_for_display_name (GFile *file, const char *display_name, - GError **error); -gboolean g_file_has_prefix (GFile *file, + GError **error); +gboolean g_file_has_prefix (GFile *file, GFile *prefix); char * g_file_get_relative_path (GFile *parent, GFile *descendant); GFile * g_file_resolve_relative_path (GFile *file, const char *relative_path); -gboolean g_file_is_native (GFile *file); -gboolean g_file_has_uri_scheme (GFile *file, +gboolean g_file_is_native (GFile *file); +gboolean g_file_has_uri_scheme (GFile *file, const char *uri_scheme); char * g_file_get_uri_scheme (GFile *file); GFileInputStream * g_file_read (GFile *file, GCancellable *cancellable, - GError **error); + GError **error); void g_file_read_async (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileInputStream * g_file_read_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GFileOutputStream * g_file_append_to (GFile *file, GFileCreateFlags flags, GCancellable *cancellable, - GError **error); + GError **error); GFileOutputStream * g_file_create (GFile *file, GFileCreateFlags flags, GCancellable *cancellable, - GError **error); + GError **error); GFileOutputStream * g_file_replace (GFile *file, const char *etag, - gboolean make_backup, + gboolean make_backup, GFileCreateFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_append_to_async (GFile *file, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileOutputStream * g_file_append_to_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); void g_file_create_async (GFile *file, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileOutputStream * g_file_create_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); void g_file_replace_async (GFile *file, const char *etag, - gboolean make_backup, + gboolean make_backup, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileOutputStream * g_file_replace_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GFileInfo * g_file_query_info (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_query_info_async (GFile *file, const char *attributes, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileInfo * g_file_query_info_finish (GFile *file, GAsyncResult *res, - GError **error); -gboolean g_file_query_exists (GFile *file, + GError **error); +gboolean g_file_query_exists (GFile *file, GCancellable *cancellable); GFileType g_file_query_file_type (GFile *file, GFileQueryInfoFlags flags, @@ -164,357 +164,357 @@ enum GFileInfo * g_file_query_filesystem_info (GFile *file, const char *attributes, GCancellable *cancellable, - GError **error); + GError **error); void g_file_query_filesystem_info_async (GFile *file, const char *attributes, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileInfo * g_file_query_filesystem_info_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GAppInfo * g_file_query_default_handler (GFile *file, GCancellable *cancellable, - GError **error); + GError **error); GMount * g_file_find_enclosing_mount (GFile *file, GCancellable *cancellable, - GError **error); + GError **error); void g_file_find_enclosing_mount_async (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GMount * g_file_find_enclosing_mount_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GFileEnumerator * g_file_enumerate_children (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_enumerate_children_async (GFile *file, const char *attributes, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileEnumerator * g_file_enumerate_children_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GFile * g_file_set_display_name (GFile *file, const char *display_name, GCancellable *cancellable, - GError **error); + GError **error); void g_file_set_display_name_async (GFile *file, const char *display_name, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFile * g_file_set_display_name_finish (GFile *file, GAsyncResult *res, - GError **error); -gboolean g_file_delete (GFile *file, + GError **error); +gboolean g_file_delete (GFile *file, GCancellable *cancellable, - GError **error); -gboolean g_file_trash (GFile *file, + GError **error); +gboolean g_file_trash (GFile *file, GCancellable *cancellable, - GError **error); -gboolean g_file_copy (GFile *source, + GError **error); +gboolean g_file_copy (GFile *source, GFile *destination, GFileCopyFlags flags, GCancellable *cancellable, GFileProgressCallback progress_callback, - gpointer progress_callback_data, - GError **error); + gpointer progress_callback_data, + GError **error); void g_file_copy_async (GFile *source, GFile *destination, GFileCopyFlags flags, int io_priority, GCancellable *cancellable, GFileProgressCallback progress_callback, - gpointer progress_callback_data, + gpointer progress_callback_data, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_copy_finish (GFile *file, + gpointer user_data); +gboolean g_file_copy_finish (GFile *file, GAsyncResult *res, - GError **error); -gboolean g_file_move (GFile *source, + GError **error); +gboolean g_file_move (GFile *source, GFile *destination, GFileCopyFlags flags, GCancellable *cancellable, GFileProgressCallback progress_callback, - gpointer progress_callback_data, - GError **error); -gboolean g_file_make_directory (GFile *file, + gpointer progress_callback_data, + GError **error); +gboolean g_file_make_directory (GFile *file, GCancellable *cancellable, - GError **error); -gboolean g_file_make_directory_with_parents (GFile *file, + GError **error); +gboolean g_file_make_directory_with_parents (GFile *file, GCancellable *cancellable, - GError **error); -gboolean g_file_make_symbolic_link (GFile *file, + GError **error); +gboolean g_file_make_symbolic_link (GFile *file, const char *symlink_value, GCancellable *cancellable, - GError **error); + GError **error); GFileAttributeInfoList * g_file_query_settable_attributes (GFile *file, GCancellable *cancellable, - GError **error); + GError **error); GFileAttributeInfoList * g_file_query_writable_namespaces (GFile *file, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attribute (GFile *file, + GError **error); +gboolean g_file_set_attribute (GFile *file, const char *attribute, GFileAttributeType type, - gpointer value_p, + gpointer value_p, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attributes_from_info (GFile *file, + GError **error); +gboolean g_file_set_attributes_from_info (GFile *file, GFileInfo *info, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_set_attributes_async (GFile *file, GFileInfo *info, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_set_attributes_finish (GFile *file, + gpointer user_data); +gboolean g_file_set_attributes_finish (GFile *file, GAsyncResult *result, GFileInfo **info, - GError **error); -gboolean g_file_set_attribute_string (GFile *file, + GError **error); +gboolean g_file_set_attribute_string (GFile *file, const char *attribute, const char *value, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attribute_byte_string (GFile *file, + GError **error); +gboolean g_file_set_attribute_byte_string (GFile *file, const char *attribute, const char *value, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attribute_uint32 (GFile *file, + GError **error); +gboolean g_file_set_attribute_uint32 (GFile *file, const char *attribute, - guint32 value, + guint32 value, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attribute_int32 (GFile *file, + GError **error); +gboolean g_file_set_attribute_int32 (GFile *file, const char *attribute, - gint32 value, + gint32 value, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attribute_uint64 (GFile *file, + GError **error); +gboolean g_file_set_attribute_uint64 (GFile *file, const char *attribute, - guint64 value, + guint64 value, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_set_attribute_int64 (GFile *file, + GError **error); +gboolean g_file_set_attribute_int64 (GFile *file, const char *attribute, - gint64 value, + gint64 value, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_mount_mountable (GFile *file, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFile * g_file_mount_mountable_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_unmount_mountable (GFile *file, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_unmount_mountable_finish (GFile *file, + gpointer user_data); +gboolean g_file_unmount_mountable_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_unmount_mountable_with_operation (GFile *file, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_unmount_mountable_with_operation_finish + gpointer user_data); +gboolean g_file_unmount_mountable_with_operation_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_eject_mountable (GFile *file, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_eject_mountable_finish (GFile *file, + gpointer user_data); +gboolean g_file_eject_mountable_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_eject_mountable_with_operation (GFile *file, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_eject_mountable_with_operation_finish + gpointer user_data); +gboolean g_file_eject_mountable_with_operation_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_start_mountable (GFile *file, GDriveStartFlags flags, GMountOperation *start_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_start_mountable_finish (GFile *file, + gpointer user_data); +gboolean g_file_start_mountable_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_stop_mountable (GFile *file, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_stop_mountable_finish (GFile *file, + gpointer user_data); +gboolean g_file_stop_mountable_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_poll_mountable (GFile *file, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_poll_mountable_finish (GFile *file, + gpointer user_data); +gboolean g_file_poll_mountable_finish (GFile *file, GAsyncResult *result, - GError **error); + GError **error); void g_file_mount_enclosing_volume (GFile *location, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_mount_enclosing_volume_finish + gpointer user_data); +gboolean g_file_mount_enclosing_volume_finish (GFile *location, GAsyncResult *result, - GError **error); + GError **error); GFileMonitor* g_file_monitor_directory (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, - GError **error); + GError **error); GFileMonitor* g_file_monitor_file (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, - GError **error); + GError **error); GFileMonitor* g_file_monitor (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_file_load_contents (GFile *file, + GError **error); +gboolean g_file_load_contents (GFile *file, GCancellable *cancellable, char **contents, - gsize *length, + gsize *length, char **etag_out, - GError **error); + GError **error); void g_file_load_contents_async (GFile *file, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_load_contents_finish (GFile *file, + gpointer user_data); +gboolean g_file_load_contents_finish (GFile *file, GAsyncResult *res, char **contents, - gsize *length, + gsize *length, char **etag_out, - GError **error); + GError **error); void g_file_load_partial_contents_async (GFile *file, GCancellable *cancellable, GFileReadMoreCallback read_more_callback, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_load_partial_contents_finish (GFile *file, + gpointer user_data); +gboolean g_file_load_partial_contents_finish (GFile *file, GAsyncResult *res, char **contents, - gsize *length, + gsize *length, char **etag_out, - GError **error); -gboolean g_file_replace_contents (GFile *file, + GError **error); +gboolean g_file_replace_contents (GFile *file, const char *contents, - gsize length, + gsize length, const char *etag, - gboolean make_backup, + gboolean make_backup, GFileCreateFlags flags, char **new_etag, GCancellable *cancellable, - GError **error); + GError **error); void g_file_replace_contents_async (GFile *file, const char *contents, - gsize length, + gsize length, const char *etag, - gboolean make_backup, + gboolean make_backup, GFileCreateFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_replace_contents_finish (GFile *file, + gpointer user_data); +gboolean g_file_replace_contents_finish (GFile *file, GAsyncResult *res, char **new_etag, - GError **error); -gboolean g_file_copy_attributes (GFile *source, + GError **error); +gboolean g_file_copy_attributes (GFile *source, GFile *destination, GFileCopyFlags flags, GCancellable *cancellable, - GError **error); + GError **error); GFileIOStream * g_file_create_readwrite (GFile *file, GFileCreateFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_create_readwrite_async (GFile *file, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileIOStream * g_file_create_readwrite_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GFileIOStream * g_file_open_readwrite (GFile *file, GCancellable *cancellable, - GError **error); + GError **error); void g_file_open_readwrite_async (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileIOStream * g_file_open_readwrite_finish (GFile *file, GAsyncResult *res, - GError **error); + GError **error); GFileIOStream * g_file_replace_readwrite (GFile *file, const char *etag, - gboolean make_backup, + gboolean make_backup, GFileCreateFlags flags, GCancellable *cancellable, - GError **error); + GError **error); void g_file_replace_readwrite_async (GFile *file, const char *etag, - gboolean make_backup, + gboolean make_backup, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileIOStream * g_file_replace_readwrite_finish (GFile *file, GAsyncResult *res, - GError **error); -gboolean g_file_supports_thread_contexts (GFile *file); + GError **error); +gboolean g_file_supports_thread_contexts (GFile *file);
@@ -528,7 +528,7 @@ enum

Prerequisites

GFile requires - GObject.

+ GObject.

Description

@@ -1024,7 +1024,7 @@ An interface for writing VFS file handles. -

GTypeInterface g_iface;

+

GTypeInterface g_iface;

The parent interface. @@ -1494,7 +1494,7 @@ An interface for writing VFS file handles. -

gboolean supports_thread_contexts;

+

gboolean supports_thread_contexts;

a boolean that indicates whether the GFile implementation supports thread-default contexts. Since 2.22. @@ -1589,7 +1589,7 @@ Flags used when an operation may create a file. Replace the destination as if it didn't exist before. Don't try to keep any old permissions, replace instead of following links. This - is generally useful if you're doing a "copy over" + is generally useful if you're doing a "copy over" rather than a "save new version of" replace operation. You can think of it as "unlink destination" before writing to it, although the implementation may not @@ -1731,9 +1731,9 @@ previewed in a file manager. Returned as the value of the key

GFileProgressCallback ()

-
void                (*GFileProgressCallback)            (goffset current_num_bytes,
-                                                         goffset total_num_bytes,
-                                                         gpointer user_data);
+
void                (*GFileProgressCallback)            (goffset current_num_bytes,
+                                                         goffset total_num_bytes,
+                                                         gpointer user_data);

When doing file operations that may take a while, such as moving a file or copying a file, a progress callback is used to pass how @@ -1763,14 +1763,14 @@ far along that operation is to the application.


GFileReadMoreCallback ()

-
gboolean            (*GFileReadMoreCallback)            (const char *file_contents,
-                                                         goffset file_size,
-                                                         gpointer callback_data);
+
gboolean            (*GFileReadMoreCallback)            (const char *file_contents,
+                                                         goffset file_size,
+                                                         gpointer callback_data);

When loading the partial contents of a file with g_file_load_partial_contents_async(), it may become necessary to determine if any more data from the file should be loaded. -A GFileReadMoreCallback function facilitates this by returning TRUE if more data -should be read, or FALSE otherwise. +A GFileReadMoreCallback function facilitates this by returning TRUE if more data +should be read, or FALSE otherwise.

@@ -1792,7 +1792,7 @@ should be read, or Returns :

-
@@ -1812,12 +1812,13 @@ operation if path is malformed. - - @@ -1838,12 +1839,12 @@ not supported. - - @@ -1870,7 +1871,7 @@ I/O operation if arg points to a malform - @@ -1895,7 +1896,7 @@ operation if the parse_name cannot be pa - @@ -1923,7 +1924,7 @@ This call does no blocking i/o. - @@ -1932,20 +1933,23 @@ This call does no blocking i/o.

g_file_hash ()

-
guint               g_file_hash                         (gconstpointer file);
+
guint               g_file_hash                         (gconstpointer file);

Creates a hash value for a GFile.

This call does no blocking i/o.

+

+Virtual: hash +

TRUE if more data should be read back. FALSE otherwise. + TRUE if more data should be read back. FALSE otherwise.

path :

a string containing a relative or absolute path. +a string containing a relative or absolute path. The string + must be encoded in the glib filename encoding.

Returns :

a new GFile for the given path. + a new GFile for the given path. [transfer full]

uri :

a string containing a URI. +a UTF8 string containing a URI.

Returns :

a GFile for the given uri. + a GFile for the given uri. [transfer full]

Returns :

a new GFile. + a new GFile. [transfer full]

Returns :

a new GFile. + a new GFile. [transfer full]

Returns :

a new GFile that is a duplicate of the given GFile. + a new GFile that is a duplicate of the given GFile. [transfer full]
@@ -1953,7 +1957,7 @@ This call does no blocking i/o. @@ -1962,7 +1966,7 @@ This call does no blocking i/o.

g_file_equal ()

-
gboolean            g_file_equal                        (GFile *file1,
+
gboolean            g_file_equal                        (GFile *file1,
                                                          GFile *file2);

Checks equality of two given GFiles. Note that two @@ -1988,8 +1992,8 @@ This call does no blocking i/o.

- @@ -2027,9 +2031,9 @@ This call does no blocking i/o. - @@ -2055,9 +2059,9 @@ This call does no blocking i/o. - @@ -2084,7 +2088,7 @@ This call does no blocking i/o. @@ -2124,7 +2128,7 @@ This call does no blocking i/o. @@ -2137,7 +2141,7 @@ This call does no blocking i/o.

Gets the parent directory for the file. If the file represents the root directory of the -file system, then NULL will be returned. +file system, then NULL will be returned.

This call does no blocking i/o. @@ -2153,8 +2157,8 @@ This call does no blocking i/o.

@@ -2163,14 +2167,14 @@ This call does no blocking i/o.

g_file_has_parent ()

-
gboolean            g_file_has_parent                   (GFile *file,
+
gboolean            g_file_has_parent                   (GFile *file,
                                                          GFile *parent);

Checks if file has a parent, and optionally, if it is parent.

-If parent is NULL then this function returns TRUE if file has any -parent at all. If parent is non-NULL then TRUE is only returned +If parent is NULL then this function returns TRUE if file has any +parent at all. If parent is non-NULL then TRUE is only returned if file is a child of parent.

file :

-gconstpointer to a GFile. +gconstpointer to a GFile.
0 if file is not a valid GFile, otherwise an integer that can be used as hash value for the GFile. This function is intended for easily hashing a GFile to - add to a GHashTable or similar data structure. + add to a GHashTable or similar data structure.

Returns :

TRUE if file1 and file2 are equal. - FALSE if either is not a GFile. + TRUE if file1 and file2 are equal. + FALSE if either is not a GFile.

Returns :

string containing the GFile's base name, or NULL + string containing the GFile's base name, or NULL if given GFile is invalid. The returned string should be - freed with g_free() when no longer needed. + freed with g_free() when no longer needed.

Returns :

string containing the GFile's path, or NULL if + string containing the GFile's path, or NULL if no such path exists. The returned string should be - freed with g_free() when no longer needed. + freed with g_free() when no longer needed.

Returns :

a string containing the GFile's URI. - The returned string should be freed with g_free() when no longer needed. + The returned string should be freed with g_free() when no longer needed.

Returns :

a string containing the GFile's parse name. The returned - string should be freed with g_free() when no longer needed. + string should be freed with g_free() when no longer needed.

Returns :

a GFile structure to the parent of the given - GFile or NULL if there is no parent. - Free the returned object with g_object_unref(). + GFile or NULL if there is no parent. + Free the returned object with g_object_unref(). [transfer full]
@@ -2183,13 +2187,13 @@ if file is a child of parent :

-
- @@ -2229,7 +2233,7 @@ This call does no blocking i/o. @@ -2240,10 +2244,10 @@ This call does no blocking i/o.

g_file_get_child_for_display_name ()

GFile *             g_file_get_child_for_display_name   (GFile *file,
                                                          const char *display_name,
-                                                         GError **error);
+ GError **error);

Gets the child of file for a given display_name (i.e. a UTF8 -version of the name). If this function fails, it returns NULL and error will be +version of the name). If this function fails, it returns NULL and error will be set. This is very useful when constructing a GFile for a new file and the user entered the filename in the user interface, for instance when you select a directory and type a filename in the file selector. @@ -2267,14 +2271,14 @@ This call does no blocking i/o.

@@ -2283,7 +2287,7 @@ This call does no blocking i/o.

g_file_has_prefix ()

-
gboolean            g_file_has_prefix                   (GFile *file,
+
gboolean            g_file_has_prefix                   (GFile *file,
                                                          GFile *prefix);

Checks whether file has the prefix specified by prefix. In other word, @@ -2293,10 +2297,13 @@ considered a prefix of /foobar, only of /foo/bar.

This call does no i/o, as it works purely on names. As such it can -sometimes return FALSE even if file is inside a prefix (from a +sometimes return FALSE even if file is inside a prefix (from a filesystem point of view), because the prefix of file is an alias of prefix.

+

+Virtual: prefix_matches +

the parent to check for, or NULL +the parent to check for, or NULL

Returns :

TRUE if file is a child of parent (or any parent in the - case that parent is NULL). + TRUE if file is a child of parent (or any parent in the + case that parent is NULL).

Returns :

a GFile to a child specified by name. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). [transfer full]

error :

-GError. +GError.

Returns :

a GFile to the specified child, or - NULL if the display name couldn't be converted. - Free the returned object with g_object_unref(). + NULL if the display name couldn't be converted. + Free the returned object with g_object_unref(). [transfer full]
@@ -2312,8 +2319,8 @@ of prefix. - @@ -2346,8 +2353,8 @@ This call does no blocking i/o. @@ -2379,9 +2386,9 @@ This call does no blocking i/o. - @@ -2390,7 +2397,7 @@ This call does no blocking i/o.

g_file_is_native ()

-
gboolean            g_file_is_native                    (GFile *file);
+
gboolean            g_file_is_native                    (GFile *file);

Checks to see if a file is native to the platform.

@@ -2402,7 +2409,7 @@ as it might be on a locally mounted remote filesystem.

On some systems non-native files may be available using the native filesystem via a userspace filesystem (FUSE), in -these cases this call will return FALSE, but g_file_get_path() +these cases this call will return FALSE, but g_file_get_path() will still return a native path.

@@ -2418,7 +2425,7 @@ This call does no blocking i/o.

- @@ -2427,7 +2434,7 @@ This call does no blocking i/o.

g_file_has_uri_scheme ()

-
gboolean            g_file_has_uri_scheme               (GFile *file,
+
gboolean            g_file_has_uri_scheme               (GFile *file,
                                                          const char *uri_scheme);

Checks to see if a GFile has a given URI scheme. @@ -2450,8 +2457,8 @@ This call does no blocking i/o.

- @@ -2486,7 +2493,7 @@ This call does no blocking i/o. @@ -2498,13 +2505,13 @@ This call does no blocking i/o.

g_file_read ()

GFileInputStream *  g_file_read                         (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Opens a file for reading. The result is a GFileInputStream that can be used to read the contents of the file.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -2513,6 +2520,9 @@ If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.

+

+Virtual: read_fn +

Returns :

TRUE if the files's parent, grandparent, etc is prefix. - FALSE otherwise. + TRUE if the files's parent, grandparent, etc is prefix. + FALSE otherwise.

Returns :

string with the relative path from descendant - to parent, or NULL if descendant doesn't have parent as prefix. - The returned string should be freed with g_free() when no longer needed. + to parent, or NULL if descendant doesn't have parent as prefix. + The returned string should be freed with g_free() when no longer needed.

Returns :

GFile to the resolved path. NULL if relative_path - is NULL or if file is invalid. - Free the returned object with g_object_unref(). + GFile to the resolved path. NULL if relative_path + is NULL or if file is invalid. + Free the returned object with g_object_unref(). [transfer full]

Returns :

TRUE if file is native. + TRUE if file is native.

Returns :

TRUE if GFile's backend supports the - given URI scheme, FALSE if URI scheme is NULL, + TRUE if GFile's backend supports the + given URI scheme, FALSE if URI scheme is NULL, not supported, or GFile is invalid.

Returns :

a string containing the URI scheme for the given - GFile. The returned string should be freed with g_free() + GFile. The returned string should be freed with g_free() when no longer needed.
@@ -2524,18 +2534,18 @@ Other errors are possible too, and depend on what kind of filesystem the file is - - - @@ -2548,7 +2558,7 @@ Other errors are possible too, and depend on what kind of filesystem the file is int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously opens file for reading.

@@ -2576,17 +2586,17 @@ When the operation is finished, callback
- - - @@ -2597,7 +2607,7 @@ When the operation is finished, callback

g_file_read_finish ()

GFileInputStream *  g_file_read_finish                  (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file read operation started with g_file_read_async(). @@ -2617,13 +2627,13 @@ Finishes an asynchronous file read operation started with

- - @@ -2635,7 +2645,7 @@ Finishes an asynchronous file read operation started with
GFileOutputStream * g_file_append_to                    (GFile *file,
                                                          GFileCreateFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Gets an output stream for appending data to the file. If the file doesn't already exist it is created. @@ -2647,7 +2657,7 @@ will be made readable only to the current user, to the level that is supported on the target filesystem.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -2673,18 +2683,18 @@ filesystem the file is on.
- - - @@ -2696,7 +2706,7 @@ filesystem the file is on.
GFileOutputStream * g_file_create                       (GFile *file,
                                                          GFileCreateFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Creates a new file and returns an output stream for writing to it. The file must not already exist. @@ -2708,7 +2718,7 @@ will be made readable only to the current user, to the level that is supported on the target filesystem.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -2736,19 +2746,19 @@ filesystem the file is on.
- - @@ -2759,10 +2769,10 @@ filesystem the file is on.

g_file_replace ()

GFileOutputStream * g_file_replace                      (GFile *file,
                                                          const char *etag,
-                                                         gboolean make_backup,
+                                                         gboolean make_backup,
                                                          GFileCreateFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Returns an output stream for overwriting the file, possibly creating a backup copy of the file first. If the file doesn't exist, @@ -2782,12 +2792,12 @@ will be made readable only to the current user, to the level that is supported on the target filesystem.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

-If you pass in a non-NULL etag value, then this value is +If you pass in a non-NULL etag value, then this value is compared to the current entity tag of the file, and if they differ an G_IO_ERROR_WRONG_ETAG error is returned. This generally means that the file has been changed since you last read it. You can get @@ -2797,10 +2807,10 @@ a new file you can use make_backup is TRUE, this function will attempt to make a backup +If make_backup is TRUE, this function will attempt to make a backup of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you want to replace anyway, try again with -make_backup set to FALSE. +make_backup set to FALSE.

If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned, @@ -2822,14 +2832,14 @@ filesystem the file is on.

- @@ -2839,18 +2849,18 @@ filesystem the file is on. - - - @@ -2864,7 +2874,7 @@ filesystem the file is on. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously opens file for appending.

@@ -2897,17 +2907,17 @@ When the operation is finished, callback - - - @@ -2918,7 +2928,7 @@ When the operation is finished, callback

g_file_append_to_finish ()

GFileOutputStream * g_file_append_to_finish             (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file append operation started with g_file_append_to_async(). @@ -2939,13 +2949,13 @@ Finishes an asynchronous file append operation started with

- - @@ -2959,7 +2969,7 @@ Finishes an asynchronous file append operation started with int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist. @@ -2993,17 +3003,17 @@ When the operation is finished, callback

- - - @@ -3014,7 +3024,7 @@ When the operation is finished, callback

g_file_create_finish ()

GFileOutputStream * g_file_create_finish                (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file create operation started with g_file_create_async(). @@ -3034,13 +3044,13 @@ Finishes an asynchronous file create operation started with

- - @@ -3051,12 +3061,12 @@ Finishes an asynchronous file create operation started with

g_file_replace_async ()

void                g_file_replace_async                (GFile *file,
                                                          const char *etag,
-                                                         gboolean make_backup,
+                                                         gboolean make_backup,
                                                          GFileCreateFlags flags,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first. @@ -3079,14 +3089,14 @@ When the operation is finished, callback

- @@ -3102,17 +3112,17 @@ When the operation is finished, callback - - - @@ -3123,7 +3133,7 @@ When the operation is finished, callback

g_file_replace_finish ()

GFileOutputStream * g_file_replace_finish               (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file replace operation started with g_file_replace_async(). @@ -3143,13 +3153,13 @@ Finishes an asynchronous file replace operation started with

- - @@ -3162,23 +3172,23 @@ Finishes an asynchronous file replace operation started with const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); + GError **error);

Gets the requested information about specified file. The result is a GFileInfo object that contains key-value attributes (such as the type or size of the file).

-The attribute value is a string that specifies the file attributes that +The attributes value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular -requested attribute from a file - it just won't be set. attribute should -be a comma-separated list of attribute or attribute wildcards. The wildcard "*" +requested attribute from a file - it just won't be set. attributes should +be a comma-separated list of attributes or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". The standard attributes are available as defines, like G_FILE_ATTRIBUTE_STANDARD_NAME.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -3214,18 +3224,18 @@ Other errors are possible too, and depend on what kind of filesystem the file is - - - @@ -3240,7 +3250,7 @@ Other errors are possible too, and depend on what kind of filesystem the file is int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously gets the requested information about specified file. The result is a GFileInfo object that contains key-value attributes (such as type or size @@ -3280,17 +3290,17 @@ When the operation is finished, callback

- - - @@ -3301,7 +3311,7 @@ When the operation is finished, callback

g_file_query_info_finish ()

GFileInfo *         g_file_query_info_finish            (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file info query. See g_file_query_info_async(). @@ -3321,13 +3331,13 @@ See error :

- - @@ -3336,7 +3346,7 @@ See

g_file_query_exists ()

-
gboolean            g_file_query_exists                 (GFile *file,
+
gboolean            g_file_query_exists                 (GFile *file,
                                                          GCancellable *cancellable);

Utility function to check if a particular file exists. This is @@ -3375,12 +3385,12 @@ errors that can happen due to races when you execute the operation.

- - @@ -3415,7 +3425,7 @@ directory, or symlink. - @@ -3435,7 +3445,7 @@ directory, or symlink.
GFileInfo *         g_file_query_filesystem_info        (GFile *file,
                                                          const char *attributes,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Similar to g_file_query_info(), but obtains information about the filesystem the file is on, rather than the file itself. @@ -3443,10 +3453,10 @@ For instance the amount of space available and the type of the filesystem.

-The attribute value is a string that specifies the file attributes that +The attributes value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular -requested attribute from a file - it just won't be set. attribute should -be a comma-separated list of attribute or attribute wildcards. The wildcard "*" +requested attribute from a file - it just won't be set. attributes should +be a comma-separated list of attributes or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "fs:*" means all attributes in the fs namespace. The standard namespace for filesystem attributes is "fs". Common attributes of interest are G_FILE_ATTRIBUTE_FILESYSTEM_SIZE @@ -3454,7 +3464,7 @@ Common attributes of interest are G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -3477,18 +3487,18 @@ Other errors are possible too, and depend on what kind of filesystem the file is - - - @@ -3502,7 +3512,7 @@ Other errors are possible too, and depend on what kind of filesystem the file is int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously gets the requested information about the filesystem that the specified file is on. The result is a GFileInfo object @@ -3539,17 +3549,17 @@ operation.

- - - @@ -3560,7 +3570,7 @@ operation.

g_file_query_filesystem_info_finish ()

GFileInfo *         g_file_query_filesystem_info_finish (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous filesystem info query. See g_file_query_filesystem_info_async(). @@ -3580,13 +3590,13 @@ Finishes an asynchronous filesystem info query. See

- - @@ -3597,13 +3607,13 @@ Finishes an asynchronous filesystem info query. See

g_file_query_default_handler ()

GAppInfo *          g_file_query_default_handler        (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Returns the GAppInfo that is registered as the default application to handle the file specified by file.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -3617,18 +3627,18 @@ was cancelled, the error cancellable :

-
- - @@ -3639,17 +3649,17 @@ When you are done with it, release it with

g_file_find_enclosing_mount ()

GMount *            g_file_find_enclosing_mount         (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Gets a GMount for the GFile.

If the GFileIface for file does not have a mount (e.g. possibly a -remote share), error will be set to G_IO_ERROR_NOT_FOUND and NULL +remote share), error will be set to G_IO_ERROR_NOT_FOUND and NULL will be returned.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -3663,18 +3673,18 @@ was cancelled, the error cancellable :

-
- - @@ -3687,7 +3697,7 @@ was cancelled, the error int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously gets the mount for the file.

@@ -3715,17 +3725,17 @@ When the operation is finished, callback - - - @@ -3736,7 +3746,7 @@ When the operation is finished, callback

g_file_find_enclosing_mount_finish ()

GMount *            g_file_find_enclosing_mount_finish  (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous find mount request. See g_file_find_enclosing_mount_async(). @@ -3756,13 +3766,13 @@ See error :

- - @@ -3775,23 +3785,23 @@ See const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, - GError **error); + GError **error);

Gets the requested information about the files in a directory. The result is a GFileEnumerator object that will give out GFileInfo objects for all the files in the directory.

-The attribute value is a string that specifies the file attributes that +The attributes value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular -requested attribute from a file - it just won't be set. attribute should -be a comma-separated list of attribute or attribute wildcards. The wildcard "*" +requested attribute from a file - it just won't be set. attributes should +be a comma-separated list of attributes or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". The standard attributes are available as defines, like G_FILE_ATTRIBUTE_STANDARD_NAME.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -3820,19 +3830,19 @@ Other errors are possible too. - - @@ -3847,7 +3857,7 @@ Other errors are possible too. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously gets the requested information about the files in a directory. The result is a GFileEnumerator object that will give out GFileInfo objects for @@ -3887,17 +3897,18 @@ When the operation is finished, callback

- - - @@ -3908,7 +3919,7 @@ When the operation is finished, callback

g_file_enumerate_children_finish ()

GFileEnumerator *   g_file_enumerate_children_finish    (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an async enumerate children operation. See g_file_enumerate_children_async(). @@ -3928,13 +3939,13 @@ See error :

- - @@ -3946,7 +3957,7 @@ See GFile * g_file_set_display_name (GFile *file, const char *display_name, GCancellable *cancellable, - GError **error); + GError **error);

Renames file to the specified display name.

@@ -3963,7 +3974,7 @@ widget, and then the result after editing should be passed to

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -3982,19 +3993,19 @@ was cancelled, the error cancellable :

-
- - @@ -4008,7 +4019,7 @@ was cancelled, the error int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously sets the display name for a given GFile.

@@ -4041,17 +4052,17 @@ When the operation is finished, callback - - - @@ -4062,7 +4073,7 @@ When the operation is finished, callback

g_file_set_display_name_finish ()

GFile *             g_file_set_display_name_finish      (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes setting a display name started with g_file_set_display_name_async(). @@ -4082,13 +4093,13 @@ Finishes setting a display name started with

- - @@ -4097,17 +4108,20 @@ Finishes setting a display name started with

g_file_delete ()

-
gboolean            g_file_delete                       (GFile *file,
+
gboolean            g_file_delete                       (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Deletes a file. If the file is a directory, it will only be deleted if it is empty.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation -was cancelled, the error G_IO_ERROR_CANCELLED will be returned. +was cancelled, the error G_IO_ERROR_CANCELLED will be returned. +

+

+Virtual: delete_file

cancellable :

a GCancellable + a GCancellable. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

GFileInputStream or NULL on error. - Free the returned object with g_object_unref(). + GFileInputStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileInputStream or NULL on error. - Free the returned object with g_object_unref(). + a GFileInputStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileOutputStream, or NULL on error. - Free the returned object with g_object_unref(). + a GFileOutputStream, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileOutputStream for the newly created file, or - NULL on error. - Free the returned object with g_object_unref(). + NULL on error. + Free the returned object with g_object_unref(). [transfer full]

etag :

an optional entity tag for the - current GFile, or NULL to ignore. + an optional entity tag for the + current GFile, or NULL to ignore. [allow-none]

make_backup :

-TRUE if a backup should be created. +TRUE if a backup should be created.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileOutputStream or NULL on error. - Free the returned object with g_object_unref(). + a GFileOutputStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a valid GFileOutputStream or NULL on error. - Free the returned object with g_object_unref(). + a valid GFileOutputStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileOutputStream or NULL on error. - Free the returned object with g_object_unref(). + a GFileOutputStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

etag :

an entity tag for the - current GFile, or NULL to ignore. + an entity tag for the + current GFile, or NULL to ignore. [allow-none]

make_backup :

-TRUE if a backup should be created. +TRUE if a backup should be created.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileOutputStream, or NULL on error. - Free the returned object with g_object_unref(). + a GFileOutputStream, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError. +a GError.

Returns :

a GFileInfo for the given file, or NULL on error. - Free the returned object with g_object_unref(). + a GFileInfo for the given file, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]
a GError. +a GError.

Returns :

GFileInfo for given file or NULL on error. - Free the returned object with g_object_unref(). + GFileInfo for given file or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

Returns :

TRUE if the file exists (and can be detected without error), FALSE otherwise (or if cancelled). + TRUE if the file exists (and can be detected without error), FALSE otherwise (or if cancelled).

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError. +a GError.

Returns :

a GFileInfo or NULL if there was an error. - Free the returned object with g_object_unref(). + a GFileInfo or NULL if there was an error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError. +a GError.

Returns :

GFileInfo for given file or NULL on error. - Free the returned object with g_object_unref(). + GFileInfo for given file or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError, or NULL +a GError, or NULL

Returns :

a GAppInfo if the handle was found, NULL if there were errors. -When you are done with it, release it with g_object_unref() + a GAppInfo if the handle was found, NULL if there were errors. +When you are done with it, release it with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError. +a GError.

Returns :

a GMount where the file is located or NULL on error. - Free the returned object with g_object_unref(). + a GMount where the file is located or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]
a GError +a GError

Returns :

GMount for given file or NULL on error. - Free the returned object with g_object_unref(). + GMount for given file or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-GError for error reporting. +GError for error reporting.

Returns :

A GFileEnumerator if successful, NULL on error. - Free the returned object with g_object_unref(). + A GFileEnumerator if successful, NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the + request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]
a GError. +a GError.

Returns :

a GFileEnumerator or NULL if an error occurred. - Free the returned object with g_object_unref(). + a GFileEnumerator or NULL if an error occurred. + Free the returned object with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFile specifying what file was renamed to, or NULL + a GFile specifying what file was renamed to, or NULL if there was an error. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFile or NULL on error. - Free the returned object with g_object_unref(). + a GFile or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
@@ -4119,17 +4133,17 @@ was cancelled, the error cancellable :

-
- - @@ -4138,9 +4152,9 @@ was cancelled, the error

g_file_trash ()

-
gboolean            g_file_trash                        (GFile *file,
+
gboolean            g_file_trash                        (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sends file to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. @@ -4148,7 +4162,7 @@ Not all file systems support trashing, so this call can return the G_IO_ERROR_NOT_SUPPORTED error.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4163,17 +4177,17 @@ was cancelled, the error cancellable :

-
- - @@ -4182,13 +4196,13 @@ was cancelled, the error

g_file_copy ()

-
gboolean            g_file_copy                         (GFile *source,
+
gboolean            g_file_copy                         (GFile *source,
                                                          GFile *destination,
                                                          GFileCopyFlags flags,
                                                          GCancellable *cancellable,
                                                          GFileProgressCallback progress_callback,
-                                                         gpointer progress_callback_data,
-                                                         GError **error);
+ gpointer progress_callback_data, + GError **error);

Copies the file source to the location specified by destination. Can not handle recursive copies of directories. @@ -4203,12 +4217,12 @@ will be copied as symlinks, otherwise the target of the source symlink will be copied.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

-If progress_callback is not NULL, then the operation can be monitored by +If progress_callback is not NULL, then the operation can be monitored by setting this to a GFileProgressCallback function. progress_callback_data will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes @@ -4256,28 +4270,28 @@ file), see

- - - - @@ -4292,15 +4306,15 @@ file), see int io_priority, GCancellable *cancellable, GFileProgressCallback progress_callback, - gpointer progress_callback_data, + gpointer progress_callback_data, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Copies the file source to the location specified by destination asynchronously. For details of the behaviour, see g_file_copy().

-If progress_callback is not NULL, then that function that will be called +If progress_callback is not NULL, then that function that will be called just like in g_file_copy(), however the callback will run in the main loop, not in the thread that is doing the I/O operation.

@@ -4334,7 +4348,7 @@ When the operation is finished, callback - @@ -4363,9 +4377,9 @@ When the operation is finished, callback

g_file_copy_finish ()

-
gboolean            g_file_copy_finish                  (GFile *file,
+
gboolean            g_file_copy_finish                  (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes copying the file started with g_file_copy_async(). @@ -4385,12 +4399,12 @@ Finishes copying the file started with

- - @@ -4399,13 +4413,13 @@ Finishes copying the file started with

g_file_move ()

-
gboolean            g_file_move                         (GFile *source,
+
gboolean            g_file_move                         (GFile *source,
                                                          GFile *destination,
                                                          GFileCopyFlags flags,
                                                          GCancellable *cancellable,
                                                          GFileProgressCallback progress_callback,
-                                                         gpointer progress_callback_data,
-                                                         GError **error);
+ gpointer progress_callback_data, + GError **error);

Tries to move the file or directory source to the location specified by destination. If native move operations are supported then this is used, otherwise a copy + delete @@ -4422,12 +4436,12 @@ will be copied as symlinks, otherwise the target of the source symlink will be copied.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

-If progress_callback is not NULL, then the operation can be monitored by +If progress_callback is not NULL, then the operation can be monitored by setting this to a GFileProgressCallback function. progress_callback_data will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes @@ -4473,29 +4487,28 @@ may be returned (if the native move operation isn't available).

- - - - @@ -4504,9 +4517,9 @@ may be returned (if the native move operation isn't available).

g_file_make_directory ()

-
gboolean            g_file_make_directory               (GFile *file,
+
gboolean            g_file_make_directory               (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Creates a directory. Note that this will only create a child directory of the immediate parent directory of the path or URI given by the GFile. To @@ -4521,7 +4534,7 @@ For a local G (current) ownership and permissions of the current process.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4535,17 +4548,17 @@ was cancelled, the error cancellable :

-
- - @@ -4554,9 +4567,9 @@ was cancelled, the error

g_file_make_directory_with_parents ()

-
gboolean            g_file_make_directory_with_parents  (GFile *file,
+
gboolean            g_file_make_directory_with_parents  (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Creates a directory and any parent directories that may not exist similar to 'mkdir -p'. If the file system does not support creating directories, this @@ -4567,7 +4580,7 @@ For a local G (current) ownership and permissions of the current process.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4581,17 +4594,17 @@ was cancelled, the error cancellable :

-
- - @@ -4603,15 +4616,16 @@ otherwise.

g_file_make_symbolic_link ()

-
gboolean            g_file_make_symbolic_link           (GFile *file,
+
gboolean            g_file_make_symbolic_link           (GFile *file,
                                                          const char *symlink_value,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

-Creates a symbolic link. +Creates a symbolic link named file which contains the string +symlink_value.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4620,27 +4634,27 @@ was cancelled, the error file :

-
- - - - @@ -4652,7 +4666,7 @@ was cancelled, the error GFileAttributeInfoList * g_file_query_settable_attributes (GFile *file, GCancellable *cancellable, - GError **error); + GError **error);

Obtain the list of settable attributes for the file.

@@ -4663,7 +4677,7 @@ succeed though, you might get an access failure, or some specific file may not support a specific attribute.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4677,12 +4691,12 @@ was cancelled, the error cancellable :

-
- @@ -4700,14 +4714,14 @@ When you are done with it, release it with GFileAttributeInfoList * g_file_query_writable_namespaces (GFile *file, GCancellable *cancellable, - GError **error); + GError **error);

Obtain the list of attribute namespaces where new attributes can be created by a user. An example of this is extended attributes (in the "xattr" namespace).

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4721,12 +4735,12 @@ was cancelled, the error cancellable :

-
- @@ -4741,18 +4755,18 @@ When you are done with it, release it with

g_file_set_attribute ()

-
gboolean            g_file_set_attribute                (GFile *file,
+
gboolean            g_file_set_attribute                (GFile *file,
                                                          const char *attribute,
                                                          GFileAttributeType type,
-                                                         gpointer value_p,
+                                                         gpointer value_p,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets an attribute in the file with attribute name attribute to value.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4786,17 +4800,17 @@ was cancelled, the error cancellable :

-
- - @@ -4805,11 +4819,11 @@ was cancelled, the error

g_file_set_attributes_from_info ()

-
gboolean            g_file_set_attributes_from_info     (GFile *file,
+
gboolean            g_file_set_attributes_from_info     (GFile *file,
                                                          GFileInfo *info,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to set all attributes in the GFileInfo on the target values, not stopping on the first error. @@ -4822,7 +4836,7 @@ the "status" field in the attribute value to further errors.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -4847,17 +4861,17 @@ was cancelled, the error cancellable :

-
- - @@ -4872,7 +4886,7 @@ was cancelled, the error int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously sets the attributes of file with info.

@@ -4910,17 +4924,17 @@ When the operation is finished, callback - - - @@ -4929,10 +4943,10 @@ When the operation is finished, callback

g_file_set_attributes_finish ()

-
gboolean            g_file_set_attributes_finish        (GFile *file,
+
gboolean            g_file_set_attributes_finish        (GFile *file,
                                                          GAsyncResult *result,
                                                          GFileInfo **info,
-                                                         GError **error);
+ GError **error);

Finishes setting an attribute started in g_file_set_attributes_async().

@@ -4951,17 +4965,17 @@ Finishes setting an attribute started in info :

-
- - @@ -4970,18 +4984,18 @@ Finishes setting an attribute started in

g_file_set_attribute_string ()

-
gboolean            g_file_set_attribute_string         (GFile *file,
+
gboolean            g_file_set_attribute_string         (GFile *file,
                                                          const char *attribute,
                                                          const char *value,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets attribute of type G_FILE_ATTRIBUTE_TYPE_STRING to value. If attribute is of a different type, this operation will fail.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5011,17 +5025,17 @@ was cancelled, the error cancellable :

-
- - @@ -5030,19 +5044,19 @@ was cancelled, the error

g_file_set_attribute_byte_string ()

-
gboolean            g_file_set_attribute_byte_string    (GFile *file,
+
gboolean            g_file_set_attribute_byte_string    (GFile *file,
                                                          const char *attribute,
                                                          const char *value,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets attribute of type G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to value. If attribute is of a different type, this operation will fail, -returning FALSE. +returning FALSE.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5071,18 +5085,18 @@ was cancelled, the error cancellable :

-
- - @@ -5091,18 +5105,18 @@ in the file,

g_file_set_attribute_uint32 ()

-
gboolean            g_file_set_attribute_uint32         (GFile *file,
+
gboolean            g_file_set_attribute_uint32         (GFile *file,
                                                          const char *attribute,
-                                                         guint32 value,
+                                                         guint32 value,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets attribute of type G_FILE_ATTRIBUTE_TYPE_UINT32 to value. If attribute is of a different type, this operation will fail.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5121,7 +5135,7 @@ was cancelled, the error value :

-
@@ -5131,18 +5145,18 @@ was cancelled, the error cancellable :

-
- - @@ -5151,18 +5165,18 @@ in the file,

g_file_set_attribute_int32 ()

-
gboolean            g_file_set_attribute_int32          (GFile *file,
+
gboolean            g_file_set_attribute_int32          (GFile *file,
                                                          const char *attribute,
-                                                         gint32 value,
+                                                         gint32 value,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets attribute of type G_FILE_ATTRIBUTE_TYPE_INT32 to value. If attribute is of a different type, this operation will fail.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5181,7 +5195,7 @@ was cancelled, the error value :

-
@@ -5191,18 +5205,18 @@ was cancelled, the error cancellable :

-
- - @@ -5211,18 +5225,18 @@ in the file,

g_file_set_attribute_uint64 ()

-
gboolean            g_file_set_attribute_uint64         (GFile *file,
+
gboolean            g_file_set_attribute_uint64         (GFile *file,
                                                          const char *attribute,
-                                                         guint64 value,
+                                                         guint64 value,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets attribute of type G_FILE_ATTRIBUTE_TYPE_UINT64 to value. If attribute is of a different type, this operation will fail.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5241,7 +5255,7 @@ was cancelled, the error value :

-
@@ -5251,18 +5265,18 @@ was cancelled, the error cancellable :

-
- - @@ -5271,18 +5285,18 @@ in the file,

g_file_set_attribute_int64 ()

-
gboolean            g_file_set_attribute_int64          (GFile *file,
+
gboolean            g_file_set_attribute_int64          (GFile *file,
                                                          const char *attribute,
-                                                         gint64 value,
+                                                         gint64 value,
                                                          GFileQueryInfoFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Sets attribute of type G_FILE_ATTRIBUTE_TYPE_INT64 to value. If attribute is of a different type, this operation will fail.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5301,7 +5315,7 @@ was cancelled, the error value :

-
@@ -5311,17 +5325,17 @@ was cancelled, the error cancellable :

-
- - @@ -5335,14 +5349,14 @@ was cancelled, the error GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Mounts a file of type G_FILE_TYPE_MOUNTABLE. Using mount_operation, you can request callbacks when, for instance, passwords are needed during authentication.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5365,22 +5379,22 @@ When the operation is finished, callback - - - - @@ -5391,7 +5405,7 @@ When the operation is finished, callback

g_file_mount_mountable_finish ()

GFile *             g_file_mount_mountable_finish       (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes a mount operation. See g_file_mount_mountable() for details.

@@ -5414,13 +5428,13 @@ with error :

-
- @@ -5433,7 +5447,7 @@ with GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Warning

g_file_unmount_mountable has been deprecated since version 2.22 and should not be used in newly-written code. Use g_file_unmount_mountable_with_operation() instead.

@@ -5442,7 +5456,7 @@ with cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5465,17 +5479,17 @@ When the operation is finished, callback
- - - @@ -5484,9 +5498,9 @@ When the operation is finished, callback

g_file_unmount_mountable_finish ()

-
gboolean            g_file_unmount_mountable_finish     (GFile *file,
+
gboolean            g_file_unmount_mountable_finish     (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Warning

g_file_unmount_mountable_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_file_unmount_mountable_with_operation_finish() instead.

@@ -5513,12 +5527,12 @@ with error :

-
- @@ -5535,12 +5549,12 @@ otherwise. GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Unmounts a file of type G_FILE_TYPE_MOUNTABLE.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5563,22 +5577,22 @@ When the operation is finished, callback - - - - @@ -5588,10 +5602,10 @@ When the operation is finished, callback

g_file_unmount_mountable_with_operation_finish ()

-
gboolean            g_file_unmount_mountable_with_operation_finish
+
gboolean            g_file_unmount_mountable_with_operation_finish
                                                         (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.

@@ -5614,12 +5628,12 @@ with
- - @@ -5635,7 +5649,7 @@ otherwise. GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Warning

g_file_eject_mountable has been deprecated since version 2.22 and should not be used in newly-written code. Use g_file_eject_mountable_with_operation() instead.

@@ -5647,7 +5661,7 @@ When this operation has completed, callbackg_file_eject_mountable_finish().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5666,17 +5680,17 @@ was cancelled, the error cancellable :

-
- - @@ -5685,9 +5699,9 @@ was cancelled, the error

g_file_eject_mountable_finish ()

-
gboolean            g_file_eject_mountable_finish       (GFile *file,
+
gboolean            g_file_eject_mountable_finish       (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Warning

g_file_eject_mountable_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_file_eject_mountable_with_operation_finish() instead.

@@ -5711,12 +5725,12 @@ Finishes an asynchronous eject operation started by
- - @@ -5733,7 +5747,7 @@ otherwise. GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Starts an asynchronous eject on a mountable. When this operation has completed, callback will be called with @@ -5741,7 +5755,7 @@ When this operation has completed, callbackg_file_eject_mountable_with_operation_finish().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5760,22 +5774,22 @@ was cancelled, the error mount_operation :

-
- - - @@ -5785,10 +5799,10 @@ was cancelled, the error

g_file_eject_mountable_with_operation_finish ()

-
gboolean            g_file_eject_mountable_with_operation_finish
+
gboolean            g_file_eject_mountable_with_operation_finish
                                                         (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous eject operation started by g_file_eject_mountable_with_operation(). @@ -5808,12 +5822,12 @@ Finishes an asynchronous eject operation started by

- - @@ -5830,14 +5844,14 @@ otherwise. GMountOperation *start_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Starts a file of type G_FILE_TYPE_MOUNTABLE. Using start_operation, you can request callbacks when, for instance, passwords are needed during authentication.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5860,17 +5874,17 @@ When the operation is finished, callback
- - - @@ -5885,9 +5899,9 @@ When the operation is finished, callback

g_file_start_mountable_finish ()

-
gboolean            g_file_start_mountable_finish       (GFile *file,
+
gboolean            g_file_start_mountable_finish       (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes a start operation. See g_file_start_mountable() for details.

@@ -5910,12 +5924,12 @@ with error :

-
- @@ -5932,12 +5946,12 @@ otherwise. GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Stops a file of type G_FILE_TYPE_MOUNTABLE.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -5960,17 +5974,17 @@ When the operation is finished, callback
- - - @@ -5985,9 +5999,9 @@ When the operation is finished, callback

g_file_stop_mountable_finish ()

-
gboolean            g_file_stop_mountable_finish        (GFile *file,
+
gboolean            g_file_stop_mountable_finish        (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an stop operation, see g_file_stop_mountable() for details.

@@ -6010,12 +6024,12 @@ with error :

-
- @@ -6030,12 +6044,12 @@ otherwise.
void                g_file_poll_mountable               (GFile *file,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Polls a file of type G_FILE_TYPE_MOUNTABLE.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6053,12 +6067,12 @@ When the operation is finished, callback
- - @@ -6073,9 +6087,9 @@ When the operation is finished, callback

g_file_poll_mountable_finish ()

-
gboolean            g_file_poll_mountable_finish        (GFile *file,
+
gboolean            g_file_poll_mountable_finish        (GFile *file,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes a poll operation. See g_file_poll_mountable() for details.

@@ -6098,12 +6112,12 @@ with error :

-
- @@ -6120,7 +6134,7 @@ otherwise. GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Starts a mount_operation, mounting the volume that contains the file location.

@@ -6130,7 +6144,7 @@ When this operation has completed, callbackg_file_mount_enclosing_volume_finish().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6149,17 +6163,17 @@ was cancelled, the error mount_operation :

-
- - @@ -6173,10 +6187,10 @@ was cancelled, the error

g_file_mount_enclosing_volume_finish ()

-
gboolean            g_file_mount_enclosing_volume_finish
+
gboolean            g_file_mount_enclosing_volume_finish
                                                         (GFile *location,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes a mount operation started by g_file_mount_enclosing_volume().

@@ -6195,13 +6209,13 @@ Finishes a mount operation started by error :

-
- @@ -6214,15 +6228,18 @@ appropriately if present.
GFileMonitor*       g_file_monitor_directory            (GFile *file,
                                                          GFileMonitorFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation -was cancelled, the error G_IO_ERROR_CANCELLED will be returned. +was cancelled, the error G_IO_ERROR_CANCELLED will be returned. +

+

+Virtual: monitor_dir

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the file was deleted. FALSE otherwise. + TRUE if the file was deleted. FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE on successful trash, FALSE otherwise. + TRUE on successful trash, FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

progress_callback :

function to callback with progress information + function to callback with progress information. [scope call]

progress_callback_data :

user data to pass to progress_callback + user data to pass to progress_callback. [closure]

error :

-GError to set on error, or NULL +GError to set on error, or NULL

Returns :

TRUE on success, FALSE otherwise. + TRUE on success, FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError, or NULL +a GError, or NULL

Returns :

a TRUE on success, FALSE on error. + a TRUE on success, FALSE on error.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

progress_callback :

-GFileProgressCallback function for updates. + GFileProgressCallback function for updates. [scope call]

progress_callback_data :

gpointer to user data for the callback function. + gpointer to user data for the callback function. [closure]

error :

-GError for returning error conditions, or NULL +GError for returning error conditions, or NULL

Returns :

TRUE on successful move, FALSE otherwise. + TRUE on successful move, FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE on successful creation, FALSE otherwise. + TRUE on successful creation, FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if all directories have been successfully created, FALSE + TRUE if all directories have been successfully created, FALSE otherwise. input GFile. +a GFile with the name of the symlink to create

symlink_value :

a string with the value of the new symlink. +a string with the path for the target of the new symlink

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError. +a GError.

Returns :

TRUE on the creation of a new symlink, FALSE otherwise. + TRUE on the creation of a new symlink, FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was set, FALSE otherwise. + TRUE if the attribute was set, FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if there was any error, FALSE otherwise. + TRUE if there was any error, FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback. + a GAsyncReadyCallback. [scope async]

user_data :

a gpointer. + a gpointer. [closure]
a GFileInfo. + a GFileInfo. [out][transfer full]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attributes were set correctly, FALSE otherwise. + TRUE if the attributes were set correctly, FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was successfully set, FALSE otherwise. + TRUE if the attribute was successfully set, FALSE otherwise.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was successfully set to value -in the file, FALSE otherwise. + TRUE if the attribute was successfully set to value +in the file, FALSE otherwise.
a guint32 containing the attribute's new value. +a guint32 containing the attribute's new value.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was successfully set to value -in the file, FALSE otherwise. + TRUE if the attribute was successfully set to value +in the file, FALSE otherwise.
a gint32 containing the attribute's new value. +a gint32 containing the attribute's new value.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was successfully set to value -in the file, FALSE otherwise. + TRUE if the attribute was successfully set to value +in the file, FALSE otherwise.
a guint64 containing the attribute's new value. +a guint64 containing the attribute's new value.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was successfully set to value -in the file, FALSE otherwise. + TRUE if the attribute was successfully set to value +in the file, FALSE otherwise.
a guint64 containing the attribute's new value. +a guint64 containing the attribute's new value.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the attribute was successfully set, FALSE otherwise. + TRUE if the attribute was successfully set, FALSE otherwise.

mount_operation :

a GMountOperation, or NULL to avoid user interaction. +a GMountOperation, or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. + a GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]
a GError, or NULL +a GError, or NULL

Returns :

a GFile or NULL on error. - Free the returned object with g_object_unref(). + a GFile or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. + a GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]
a GError, or NULL +a GError, or NULL

Returns :

TRUE if the operation finished successfully. FALSE + TRUE if the operation finished successfully. FALSE otherwise.

mount_operation :

a GMountOperation, or NULL to avoid user interaction. +a GMountOperation, or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. + a GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the operation finished successfully. FALSE + TRUE if the operation finished successfully. FALSE otherwise. optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. + a GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the file was ejected successfully. FALSE + TRUE if the file was ejected successfully. FALSE otherwise. a GMountOperation, or NULL to avoid user interaction. +a GMountOperation, or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. + a GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the file was ejected successfully. FALSE + TRUE if the file was ejected successfully. FALSE otherwise.

start_operation :

a GMountOperation, or NULL to avoid user interaction. +a GMountOperation, or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. +a GAsyncReadyCallback to call when the request is satisfied, or NULL.
a GError, or NULL +a GError, or NULL

Returns :

TRUE if the operation finished successfully. FALSE + TRUE if the operation finished successfully. FALSE otherwise.

mount_operation :

a GMountOperation, or NULL to avoid user interaction. +a GMountOperation, or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. +a GAsyncReadyCallback to call when the request is satisfied, or NULL.
a GError, or NULL +a GError, or NULL

Returns :

TRUE if the operation finished successfully. FALSE + TRUE if the operation finished successfully. FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. +a GAsyncReadyCallback to call when the request is satisfied, or NULL.
a GError, or NULL +a GError, or NULL

Returns :

TRUE if the operation finished successfully. FALSE + TRUE if the operation finished successfully. FALSE otherwise. a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback to call when the request is satisfied, or NULL. +a GAsyncReadyCallback to call when the request is satisfied, or NULL.
a GError, or NULL +a GError, or NULL

Returns :

TRUE if successful. If an error -has occurred, this function will return FALSE and set error + TRUE if successful. If an error +has occurred, this function will return FALSE and set error appropriately if present.
@@ -6239,18 +6256,18 @@ was cancelled, the error cancellable :

-
- - @@ -6262,13 +6279,13 @@ was cancelled, the error GFileMonitor* g_file_monitor_file (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, - GError **error); + GError **error);

Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6287,18 +6304,18 @@ was cancelled, the error cancellable :

-
- - @@ -6310,13 +6327,13 @@ was cancelled, the error GFileMonitor* g_file_monitor (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, - GError **error); + GError **error);

Obtains a file or directory monitor for the given file, depending on the type of the file.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6335,19 +6352,18 @@ was cancelled, the error cancellable :

-
- - @@ -6357,20 +6373,20 @@ was cancelled, the error

g_file_load_contents ()

-
gboolean            g_file_load_contents                (GFile *file,
+
gboolean            g_file_load_contents                (GFile *file,
                                                          GCancellable *cancellable,
                                                          char **contents,
-                                                         gsize *length,
+                                                         gsize *length,
                                                          char **etag_out,
-                                                         GError **error);
+ GError **error);

Loads the content of the file into memory. The data is always zero-terminated, but this is not included in the resultant length. -The returned content should be freed with g_free() when no longer +The returned content should be freed with g_free() when no longer needed.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6384,35 +6400,35 @@ was cancelled, the error cancellable :

-
- - - - - @@ -6424,7 +6440,7 @@ was cancelled, the error void g_file_load_contents_async (GFile *file, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Starts an asynchronous load of the file's contents.

@@ -6439,7 +6455,7 @@ with user data. To finish the operation, the callback.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6453,7 +6469,7 @@ was cancelled, the error cancellable :

-
@@ -6472,17 +6488,17 @@ was cancelled, the error

g_file_load_contents_finish ()

-
gboolean            g_file_load_contents_finish         (GFile *file,
+
gboolean            g_file_load_contents_finish         (GFile *file,
                                                          GAsyncResult *res,
                                                          char **contents,
-                                                         gsize *length,
+                                                         gsize *length,
                                                          char **etag_out,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous load of the file's contents. The contents are placed in contents, and length is set to the size of the contents string. The content should be freed with -g_free() when no longer needed. If etag_out is present, it will be +g_free() when no longer needed. If etag_out is present, it will be set to the new entity tag for the file.

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL. +a GError, or NULL.

Returns :

a GFileMonitor for the given file, or NULL on error. - Free the returned object with g_object_unref(). + a GFileMonitor for the given file, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL. +a GError, or NULL.

Returns :

a GFileMonitor for the given file, or NULL on error. - Free the returned object with g_object_unref(). + a GFileMonitor for the given file, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileMonitor for the given file, or NULL on error. - Free the returned object with g_object_unref(). - + a GFileMonitor for the given file, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

contents :

a location to place the contents of the file. + a location to place the contents of the file. [out][transfer full]

length :

a location to place the length of the contents of the file, - or NULL if the length is not needed + a location to place the length of the contents of the file, + or NULL if the length is not needed. [out][allow-none]

etag_out :

a location to place the current entity tag for the file, - or NULL if the entity tag is not needed + a location to place the current entity tag for the file, + or NULL if the entity tag is not needed. [out][allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the file's contents were successfully loaded. -FALSE if there were errors. + TRUE if the file's contents were successfully loaded. +FALSE if there were errors.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
@@ -6500,29 +6516,29 @@ set to the new entity tag for the file. - - - - - @@ -6536,7 +6552,7 @@ present, it will be set appropriately. GCancellable *cancellable, GFileReadMoreCallback read_more_callback, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Reads the partial contents of a file. A GFileReadMoreCallback should be used to stop reading from the file when appropriate, else this function @@ -6548,7 +6564,7 @@ Users of this function should be aware that user_dat both the read_more_callback and the callback.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6562,7 +6578,7 @@ was cancelled, the error cancellable :

-
@@ -6586,17 +6602,17 @@ was cancelled, the error

g_file_load_partial_contents_finish ()

-
gboolean            g_file_load_partial_contents_finish (GFile *file,
+
gboolean            g_file_load_partial_contents_finish (GFile *file,
                                                          GAsyncResult *res,
                                                          char **contents,
-                                                         gsize *length,
+                                                         gsize *length,
                                                          char **etag_out,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous partial load operation that was started with g_file_load_partial_contents_async(). The data is always zero-terminated, but this is not included in the resultant length. -The returned content should be freed with g_free() when no longer +The returned content should be freed with g_free() when no longer needed.

contents :

a location to place the contents of the file. + a location to place the contents of the file. [out][transfer full]

length :

a location to place the length of the contents of the file, - or NULL if the length is not needed + a location to place the length of the contents of the file, + or NULL if the length is not needed. [out][allow-none]

etag_out :

a location to place the current entity tag for the file, - or NULL if the entity tag is not needed + a location to place the current entity tag for the file, + or NULL if the entity tag is not needed. [out][allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the load was successful. If FALSE and error is + TRUE if the load was successful. If FALSE and error is present, it will be set appropriately.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
@@ -6614,29 +6630,29 @@ needed. - - - - - @@ -6646,26 +6662,26 @@ present, it will be set appropriately.

g_file_replace_contents ()

-
gboolean            g_file_replace_contents             (GFile *file,
+
gboolean            g_file_replace_contents             (GFile *file,
                                                          const char *contents,
-                                                         gsize length,
+                                                         gsize length,
                                                          const char *etag,
-                                                         gboolean make_backup,
+                                                         gboolean make_backup,
                                                          GFileCreateFlags flags,
                                                          char **new_etag,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Replaces the contents of file with contents of length bytes. -If etag is specified (not NULL) any existing file must have that etag, or +If etag is specified (not NULL) any existing file must have that etag, or the error G_IO_ERROR_WRONG_ETAG will be returned.

-If make_backup is TRUE, this function will attempt to make a backup of file. +If make_backup is TRUE, this function will attempt to make a backup of file.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6693,14 +6709,14 @@ next time it is saved over.
- @@ -6710,25 +6726,25 @@ next time it is saved over. - - - - @@ -6740,13 +6756,13 @@ appropriately if present.

g_file_replace_contents_async ()

void                g_file_replace_contents_async       (GFile *file,
                                                          const char *contents,
-                                                         gsize length,
+                                                         gsize length,
                                                          const char *etag,
-                                                         gboolean make_backup,
+                                                         gboolean make_backup,
                                                          GFileCreateFlags flags,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Starts an asynchronous replacement of file with the given contents of length bytes. etag will replace the document's @@ -6758,12 +6774,12 @@ When this operation has completed, callbackg_file_replace_contents_finish().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

-If make_backup is TRUE, this function will attempt to +If make_backup is TRUE, this function will attempt to make a backup of file.

contents :

a location to place the contents of the file. + a location to place the contents of the file. [out][transfer full]

length :

a location to place the length of the contents of the file, - or NULL if the length is not needed + a location to place the length of the contents of the file, + or NULL if the length is not needed. [out][allow-none]

etag_out :

a location to place the current entity tag for the file, - or NULL if the entity tag is not needed + a location to place the current entity tag for the file, + or NULL if the entity tag is not needed. [out][allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if the load was successful. If FALSE and error is + TRUE if the load was successful. If FALSE and error is present, it will be set appropriately.

etag :

the old entity tag - for the document, or NULL + the old entity tag + for the document, or NULL. [allow-none]

make_backup :

-TRUE if a backup should be created. +TRUE if a backup should be created.

new_etag :

a location to a new entity tag - for the document. This should be freed with g_free() when no longer - needed, or NULL + a location to a new entity tag + for the document. This should be freed with g_free() when no longer + needed, or NULL. [allow-none][out]

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE if successful. If an error -has occurred, this function will return FALSE and set error + TRUE if successful. If an error +has occurred, this function will return FALSE and set error appropriately if present.
@@ -6786,13 +6802,13 @@ make a backup of file. - @@ -6802,7 +6818,7 @@ make a backup of file. - @@ -6821,10 +6837,10 @@ make a backup of file.

g_file_replace_contents_finish ()

-
gboolean            g_file_replace_contents_finish      (GFile *file,
+
gboolean            g_file_replace_contents_finish      (GFile *file,
                                                          GAsyncResult *res,
                                                          char **new_etag,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous replace of the given file. See g_file_replace_contents_async(). Sets new_etag to the new entity @@ -6845,19 +6861,19 @@ tag for the document, if present.

- - - @@ -6866,11 +6882,11 @@ tag for the document, if present.

g_file_copy_attributes ()

-
gboolean            g_file_copy_attributes              (GFile *source,
+
gboolean            g_file_copy_attributes              (GFile *source,
                                                          GFile *destination,
                                                          GFileCopyFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Copies the file attributes from source to destination.

@@ -6902,17 +6918,17 @@ is useful when implementing move by copy + delete source.
- - - @@ -6924,7 +6940,7 @@ is useful when implementing move by copy + delete source.
GFileIOStream *     g_file_create_readwrite             (GFile *file,
                                                          GFileCreateFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Creates a new file and returns a stream for reading and writing to it. The file must not already exist. @@ -6936,7 +6952,7 @@ will be made readable only to the current user, to the level that is supported on the target filesystem.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -6967,19 +6983,18 @@ rather than just opening for reading or writing.
- - - @@ -6994,7 +7009,7 @@ rather than just opening for reading or writing. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist. @@ -7028,17 +7043,17 @@ call cancellable :

-
- - @@ -7050,7 +7065,7 @@ call

g_file_create_readwrite_finish ()

GFileIOStream *     g_file_create_readwrite_finish      (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file create operation started with g_file_create_readwrite_async(). @@ -7070,14 +7085,13 @@ Finishes an asynchronous file create operation started with

- - @@ -7089,13 +7103,13 @@ Finishes an asynchronous file create operation started with

g_file_open_readwrite ()

GFileIOStream *     g_file_open_readwrite               (GFile *file,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Opens an existing file for reading and writing. The result is a GFileIOStream that can be used to read and write the contents of the file.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -7118,19 +7132,18 @@ just opening for reading or writing.
- - - @@ -7144,7 +7157,7 @@ just opening for reading or writing. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously opens file for reading and writing.

@@ -7172,17 +7185,17 @@ When the operation is finished, callback
- - - @@ -7194,7 +7207,7 @@ When the operation is finished, callback

g_file_open_readwrite_finish ()

GFileIOStream *     g_file_open_readwrite_finish        (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file read operation started with g_file_open_readwrite_async(). @@ -7214,14 +7227,13 @@ Finishes an asynchronous file read operation started with

- - @@ -7233,10 +7245,10 @@ Finishes an asynchronous file read operation started with

g_file_replace_readwrite ()

GFileIOStream *     g_file_replace_readwrite            (GFile *file,
                                                          const char *etag,
-                                                         gboolean make_backup,
+                                                         gboolean make_backup,
                                                          GFileCreateFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Returns an output stream for overwriting the file in readwrite mode, possibly creating a backup copy of the file first. If the file doesn't @@ -7261,14 +7273,14 @@ rather than just opening for reading or writing.

- @@ -7278,19 +7290,18 @@ rather than just opening for reading or writing. - - - @@ -7302,12 +7313,12 @@ rather than just opening for reading or writing.

g_file_replace_readwrite_async ()

void                g_file_replace_readwrite_async      (GFile *file,
                                                          const char *etag,
-                                                         gboolean make_backup,
+                                                         gboolean make_backup,
                                                          GFileCreateFlags flags,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first. @@ -7330,14 +7341,14 @@ call etag :

-
@@ -7353,17 +7364,17 @@ call cancellable :

-
- - @@ -7375,7 +7386,7 @@ call

g_file_replace_readwrite_finish ()

GFileIOStream *     g_file_replace_readwrite_finish     (GFile *file,
                                                          GAsyncResult *res,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous file replace operation started with g_file_replace_readwrite_async(). @@ -7395,14 +7406,13 @@ Finishes an asynchronous file replace operation started with

- - @@ -7412,10 +7422,10 @@ Finishes an asynchronous file replace operation started with

g_file_supports_thread_contexts ()

-
gboolean            g_file_supports_thread_contexts     (GFile *file);
+
gboolean            g_file_supports_thread_contexts     (GFile *file);

Checks if file supports thread-default -contexts. If this returns FALSE, you cannot perform +contexts. If this returns FALSE, you cannot perform asynchronous operations on file in a thread that has a thread-default context.

@@ -7445,6 +7455,6 @@ thread-default context.
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileDescriptorBased.html b/docs/reference/gio/html/GFileDescriptorBased.html index 704b758..0506e11 100644 --- a/docs/reference/gio/html/GFileDescriptorBased.html +++ b/docs/reference/gio/html/GFileDescriptorBased.html @@ -3,12 +3,12 @@ GFileDescriptorBased - + - + @@ -42,7 +42,7 @@

Synopsis

-#include <gio/gio.h>
+#include <gio/gfiledescriptorbased.h>
 
                     GFileDescriptorBased;
 int                 g_file_descriptor_based_get_fd      (GFileDescriptorBased *fd_based);
@@ -59,7 +59,7 @@
 

Prerequisites

GFileDescriptorBased requires - GObject.

+ GObject.

Description

@@ -67,6 +67,11 @@ GFileDescriptorBased requires GFileDescriptorBased is implemented by streams (implementations of GInputStream or GOutputStream) that are based on file descriptors.

+

+Note that <gio/gfiledescriptorbased.h> belongs to +the UNIX-specific GIO interfaces, thus you have to use the +gio-unix-2.0.pc pkg-config file when using it. +

Details

@@ -110,6 +115,6 @@ Gets the underlying file descriptor.
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileEnumerator.html b/docs/reference/gio/html/GFileEnumerator.html index 4bd320f..ba2ec04 100644 --- a/docs/reference/gio/html/GFileEnumerator.html +++ b/docs/reference/gio/html/GFileEnumerator.html @@ -3,12 +3,12 @@ GFileEnumerator - + - + @@ -47,38 +47,38 @@ GFileEnumerator; GFileInfo * g_file_enumerator_next_file (GFileEnumerator *enumerator, GCancellable *cancellable, - GError **error); -gboolean g_file_enumerator_close (GFileEnumerator *enumerator, + GError **error); +gboolean g_file_enumerator_close (GFileEnumerator *enumerator, GCancellable *cancellable, - GError **error); + GError **error); void g_file_enumerator_next_files_async (GFileEnumerator *enumerator, int num_files, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -GList * g_file_enumerator_next_files_finish (GFileEnumerator *enumerator, + gpointer user_data); +GList * g_file_enumerator_next_files_finish (GFileEnumerator *enumerator, GAsyncResult *result, - GError **error); + GError **error); void g_file_enumerator_close_async (GFileEnumerator *enumerator, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator, + gpointer user_data); +gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator, GAsyncResult *result, - GError **error); -gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator); -gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator); + GError **error); +gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator); +gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator); void g_file_enumerator_set_pending (GFileEnumerator *enumerator, - gboolean pending); + gboolean pending); GFile * g_file_enumerator_get_container (GFileEnumerator *enumerator);

Object Hierarchy

-  GObject
+  GObject
    +----GFileEnumerator
 
@@ -107,7 +107,7 @@ synchronous will only return the next file in the enumerator. To close a GFileEnumerator, use g_file_enumerator_close(), or its asynchronous version, g_file_enumerator_close_async(). Once a GFileEnumerator is closed, no further actions may be performed -on it, and it should be freed with g_object_unref(). +on it, and it should be freed with g_object_unref().

@@ -118,17 +118,13 @@ on it, and it should be freed with

etag :

a new entity tag for the file, or NULL + a new entity tag for the file, or NULL. [allow-none]

make_backup :

-TRUE if a backup should be created. +TRUE if a backup should be created.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

new_etag :

a location of a new entity tag - for the document. This should be freed with g_free() when it is no - longer needed, or NULL + a location of a new entity tag + for the document. This should be freed with g_free() when it is no + longer needed, or NULL. [out][allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

TRUE on success, FALSE on failure. + TRUE on success, FALSE on failure.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

TRUE if the attributes were copied successfully, FALSE otherwise. + TRUE if the attributes were copied successfully, FALSE otherwise.

cancellable :

optional GCancellable object, NULL to ignore + optional GCancellable object, NULL to ignore. [allow-none]

error :

return location for a GError, or NULL +return location for a GError, or NULL

Returns :

a GFileIOStream for the newly created file, or NULL on error. - Free the returned object with g_object_unref(). - + a GFileIOStream for the newly created file, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
optional GCancellable object, NULL to ignore + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileIOStream or NULL on error. - Free the returned object with g_object_unref(). - + a GFileIOStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

a GCancellable + a GCancellable. [allow-none]

error :

a GError, or NULL +a GError, or NULL

Returns :

GFileIOStream or NULL on error. - Free the returned object with g_object_unref(). - + GFileIOStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileIOStream or NULL on error. - Free the returned object with g_object_unref(). - + a GFileIOStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

etag :

an optional entity tag for the - current GFile, or NULL to ignore + an optional entity tag for the + current GFile, or NULL to ignore. [allow-none]

make_backup :

-TRUE if a backup should be created +TRUE if a backup should be created

cancellable :

optional GCancellable object, NULL to ignore + optional GCancellable object, NULL to ignore. [allow-none]

error :

return location for a GError, or NULL +return location for a GError, or NULL

Returns :

a GFileIOStream or NULL on error. - Free the returned object with g_object_unref(). - + a GFileIOStream or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
an entity tag for the - current GFile, or NULL to ignore. + an entity tag for the + current GFile, or NULL to ignore. [allow-none]

make_backup :

-TRUE if a backup should be created. +TRUE if a backup should be created.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, or NULL +a GError, or NULL

Returns :

a GFileIOStream, or NULL on error. - Free the returned object with g_object_unref(). - + a GFileIOStream, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]
-- -

g_file_enumerator_next_file ()

GFileInfo *         g_file_enumerator_next_file         (GFileEnumerator *enumerator,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Returns information for the next file in the enumerated object. Will block until the information is available. The GFileInfo @@ -136,8 +132,8 @@ returned from this function will contain attributes that match the attribute string that was passed when the GFileEnumerator was created.

-On error, returns NULL and sets error to the error. If the -enumerator is at the end, NULL will be returned and error will +On error, returns NULL and sets error to the error. If the +enumerator is at the end, NULL will be returned and error will be unset.

@@ -150,18 +146,18 @@ be unset. - - - @@ -170,9 +166,9 @@ be unset.

g_file_enumerator_close ()

-
gboolean            g_file_enumerator_close             (GFileEnumerator *enumerator,
+
gboolean            g_file_enumerator_close             (GFileEnumerator *enumerator,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Releases all resources used by this enumerator, making the enumerator return G_IO_ERROR_CLOSED on all calls. @@ -192,17 +188,17 @@ sure resources are released as early as possible.

- - - @@ -216,7 +212,7 @@ sure resources are released as early as possible. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Request information for a number of files from the enumerator asynchronously. When all i/o for the operation is finished the callback will be called with @@ -236,7 +232,7 @@ result in Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default -priority is G_PRIORITY_DEFAULT. +priority is G_PRIORITY_DEFAULT.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

A GFileInfo or NULL on error or end of enumerator. - Free the returned object with g_object_unref() when no longer needed. + A GFileInfo or NULL on error or end of enumerator. + Free the returned object with g_object_unref() when no longer needed. [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

TRUE on success or FALSE on error. + TRUE on success or FALSE on error.
@@ -259,7 +255,7 @@ priority is cancellable :

-
@@ -278,9 +274,9 @@ priority is

g_file_enumerator_next_files_finish ()

-
GList *             g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
+
GList *             g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes the asynchronous operation started with g_file_enumerator_next_files_async().

@@ -299,15 +295,15 @@ Finishes the asynchronous operation started with error :

-
- @@ -320,12 +316,12 @@ ignore. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously closes the file enumerator.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned in g_file_enumerator_close_finish(). @@ -346,7 +342,7 @@ was cancelled, the error cancellable :

-
@@ -365,20 +361,20 @@ was cancelled, the error

g_file_enumerator_close_finish ()

-
gboolean            g_file_enumerator_close_finish      (GFileEnumerator *enumerator,
+
gboolean            g_file_enumerator_close_finish      (GFileEnumerator *enumerator,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes closing a file enumerator, started from g_file_enumerator_close_async().

If the file enumerator was already closed when g_file_enumerator_close_async() was called, then this function will report G_IO_ERROR_CLOSED in error, and -return FALSE. If the file enumerator had pending operation when the close +return FALSE. If the file enumerator had pending operation when the close operation was started, then this function will report G_IO_ERROR_PENDING, and -return FALSE. If cancellable was not NULL, then the operation may have been +return FALSE. If cancellable was not NULL, then the operation may have been cancelled by triggering the cancellable object from another thread. If the operation -was cancelled, the error G_IO_ERROR_CANCELLED will be set, and FALSE will be +was cancelled, the error G_IO_ERROR_CANCELLED will be set, and FALSE will be returned.

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a GList of GFileInfos. You must free the list with - g_list_free() and unref the infos with g_object_unref() when you're - done with them. + a GList of GFileInfos. You must free the list with + g_list_free() and unref the infos with g_object_unref() when you're + done with them. [transfer full][element-type Gio.FileInfo]
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
@@ -396,13 +392,13 @@ returned. - - @@ -411,7 +407,7 @@ ignore.

g_file_enumerator_is_closed ()

-
gboolean            g_file_enumerator_is_closed         (GFileEnumerator *enumerator);
+
gboolean            g_file_enumerator_is_closed         (GFileEnumerator *enumerator);

Checks if the file enumerator has been closed.

@@ -425,7 +421,7 @@ Checks if the file enumerator has been closed.
- @@ -434,7 +430,7 @@ Checks if the file enumerator has been closed.

g_file_enumerator_has_pending ()

-
gboolean            g_file_enumerator_has_pending       (GFileEnumerator *enumerator);
+
gboolean            g_file_enumerator_has_pending       (GFileEnumerator *enumerator);

Checks if the file enumerator has pending operations.

@@ -448,7 +444,7 @@ Checks if the file enumerator has pending operations.
- @@ -458,7 +454,7 @@ Checks if the file enumerator has pending operations.

g_file_enumerator_set_pending ()

void                g_file_enumerator_set_pending       (GFileEnumerator *enumerator,
-                                                         gboolean pending);
+ gboolean pending);

Sets the file enumerator as having pending operations.

@@ -495,8 +491,7 @@ Get the GFile
- @@ -515,6 +510,6 @@ Get the GFile + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileIOStream.html b/docs/reference/gio/html/GFileIOStream.html index 77e78a9..ed6dcf7 100644 --- a/docs/reference/gio/html/GFileIOStream.html +++ b/docs/reference/gio/html/GFileIOStream.html @@ -3,12 +3,12 @@ GFileIOStream - + - + @@ -49,22 +49,22 @@ GFileInfo * g_file_io_stream_query_info (GFileIOStream *stream, const char *attributes, GCancellable *cancellable, - GError **error); + GError **error); void g_file_io_stream_query_info_async (GFileIOStream *stream, const char *attributes, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileInfo * g_file_io_stream_query_info_finish (GFileIOStream *stream, GAsyncResult *result, - GError **error); + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GIOStream
          +----GFileIOStream
 
@@ -150,7 +150,7 @@ and closed, as the etag can change while writing.
GFileInfo *         g_file_io_stream_query_info         (GFileIOStream *stream,
                                                          const char *attributes,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Queries a file io stream for the given attributes. This function blocks while querying the stream. For the asynchronous @@ -164,12 +164,12 @@ Can fail if the stream was already closed (with erro G_IO_ERROR_CLOSED), the stream has pending operations (with error being set to G_IO_ERROR_PENDING), or if querying info is not supported for the stream's interface (with error being set to G_IO_ERROR_NOT_SUPPORTED). I -all cases of failure, NULL will be returned. +all cases of failure, NULL will be returned.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation -was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will +was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will be returned.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the close operation has finished successfully. + TRUE if the close operation has finished successfully.

Returns :

TRUE if the enumerator is closed. + TRUE if the enumerator is closed.

Returns :

TRUE if the enumerator has pending operations. + TRUE if the enumerator has pending operations.

Returns :

the GFile which is being enumerated. - + the GFile which is being enumerated. [transfer full]
@@ -187,18 +187,17 @@ be returned. - - - @@ -213,7 +212,7 @@ be returned. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously queries the stream for a GFileInfo. When completed, callback will be called with a GAsyncResult which can be used to @@ -244,17 +243,17 @@ For the synchronous version of this function, see

- - - @@ -266,7 +265,7 @@ For the synchronous version of this function, see

g_file_io_stream_query_info_finish ()

GFileInfo *         g_file_io_stream_query_info_finish  (GFileIOStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finalizes the asynchronous query started by g_file_io_stream_query_info_async(). @@ -286,13 +285,12 @@ by

- - @@ -307,6 +305,6 @@ by + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileIcon.html b/docs/reference/gio/html/GFileIcon.html index fffc386..8d8b4c7 100644 --- a/docs/reference/gio/html/GFileIcon.html +++ b/docs/reference/gio/html/GFileIcon.html @@ -3,12 +3,12 @@ GFileIcon - + - + @@ -54,7 +54,7 @@

Object Hierarchy

-  GObject
+  GObject
    +----GFileIcon
 
@@ -103,7 +103,7 @@ Creates a new icon for a file.
- @@ -126,7 +126,7 @@ Gets the GFil - @@ -150,6 +150,6 @@ The file containing the icon. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileInfo.html b/docs/reference/gio/html/GFileInfo.html index f35d008..89ad1e3 100644 --- a/docs/reference/gio/html/GFileInfo.html +++ b/docs/reference/gio/html/GFileInfo.html @@ -3,12 +3,12 @@ GFileInfo - + - + @@ -116,15 +116,17 @@ enum G_FILE_ATTRIBUTE_GVFS_BACKEND #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT +#define G_FILE_ATTRIBUTE_TRASH_DELETION_DATE +#define G_FILE_ATTRIBUTE_TRASH_ORIG_PATH #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION GFileInfo * g_file_info_new (void); GFileInfo * g_file_info_dup (GFileInfo *other); void g_file_info_copy_into (GFileInfo *src_info, GFileInfo *dest_info); -gboolean g_file_info_has_attribute (GFileInfo *info, +gboolean g_file_info_has_attribute (GFileInfo *info, const char *attribute); -gboolean g_file_info_has_namespace (GFileInfo *info, +gboolean g_file_info_has_namespace (GFileInfo *info, const char *name_space); char ** g_file_info_list_attributes (GFileInfo *info, const char *name_space); @@ -134,10 +136,10 @@ enum const char *attribute); char * g_file_info_get_attribute_as_string (GFileInfo *info, const char *attribute); -gboolean g_file_info_get_attribute_data (GFileInfo *info, +gboolean g_file_info_get_attribute_data (GFileInfo *info, const char *attribute, GFileAttributeType *type, - gpointer *value_pp, + gpointer *value_pp, GFileAttributeStatus *status); GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info, const char *attribute); @@ -148,23 +150,23 @@ const char * char * g_file_info_get_attribute_byte_string (GFileInfo *info, const char *attribute); -gboolean g_file_info_get_attribute_boolean (GFileInfo *info, +gboolean g_file_info_get_attribute_boolean (GFileInfo *info, const char *attribute); -guint32 g_file_info_get_attribute_uint32 (GFileInfo *info, +guint32 g_file_info_get_attribute_uint32 (GFileInfo *info, const char *attribute); -gint32 g_file_info_get_attribute_int32 (GFileInfo *info, +gint32 g_file_info_get_attribute_int32 (GFileInfo *info, const char *attribute); -guint64 g_file_info_get_attribute_uint64 (GFileInfo *info, +guint64 g_file_info_get_attribute_uint64 (GFileInfo *info, const char *attribute); -gint64 g_file_info_get_attribute_int64 (GFileInfo *info, +gint64 g_file_info_get_attribute_int64 (GFileInfo *info, const char *attribute); -GObject * g_file_info_get_attribute_object (GFileInfo *info, +GObject * g_file_info_get_attribute_object (GFileInfo *info, const char *attribute); void g_file_info_set_attribute (GFileInfo *info, const char *attribute, GFileAttributeType type, - gpointer value_p); -gboolean g_file_info_set_attribute_status (GFileInfo *info, + gpointer value_p); +gboolean g_file_info_set_attribute_status (GFileInfo *info, const char *attribute, GFileAttributeStatus status); void g_file_info_set_attribute_string (GFileInfo *info, @@ -179,47 +181,47 @@ const char * const char *attr_value); void g_file_info_set_attribute_boolean (GFileInfo *info, const char *attribute, - gboolean attr_value); + gboolean attr_value); void g_file_info_set_attribute_uint32 (GFileInfo *info, const char *attribute, - guint32 attr_value); + guint32 attr_value); void g_file_info_set_attribute_int32 (GFileInfo *info, const char *attribute, - gint32 attr_value); + gint32 attr_value); void g_file_info_set_attribute_uint64 (GFileInfo *info, const char *attribute, - guint64 attr_value); + guint64 attr_value); void g_file_info_set_attribute_int64 (GFileInfo *info, const char *attribute, - gint64 attr_value); + gint64 attr_value); void g_file_info_set_attribute_object (GFileInfo *info, const char *attribute, - GObject *attr_value); + GObject *attr_value); void g_file_info_clear_status (GFileInfo *info); GFileType g_file_info_get_file_type (GFileInfo *info); -gboolean g_file_info_get_is_hidden (GFileInfo *info); -gboolean g_file_info_get_is_backup (GFileInfo *info); -gboolean g_file_info_get_is_symlink (GFileInfo *info); +gboolean g_file_info_get_is_hidden (GFileInfo *info); +gboolean g_file_info_get_is_backup (GFileInfo *info); +gboolean g_file_info_get_is_symlink (GFileInfo *info); const char * g_file_info_get_name (GFileInfo *info); const char * g_file_info_get_display_name (GFileInfo *info); const char * g_file_info_get_edit_name (GFileInfo *info); GIcon * g_file_info_get_icon (GFileInfo *info); const char * g_file_info_get_content_type (GFileInfo *info); -goffset g_file_info_get_size (GFileInfo *info); +goffset g_file_info_get_size (GFileInfo *info); void g_file_info_get_modification_time (GFileInfo *info, - GTimeVal *result); + GTimeVal *result); const char * g_file_info_get_symlink_target (GFileInfo *info); const char * g_file_info_get_etag (GFileInfo *info); -gint32 g_file_info_get_sort_order (GFileInfo *info); +gint32 g_file_info_get_sort_order (GFileInfo *info); void g_file_info_set_attribute_mask (GFileInfo *info, GFileAttributeMatcher *mask); void g_file_info_unset_attribute_mask (GFileInfo *info); void g_file_info_set_file_type (GFileInfo *info, GFileType type); void g_file_info_set_is_hidden (GFileInfo *info, - gboolean is_hidden); + gboolean is_hidden); void g_file_info_set_is_symlink (GFileInfo *info, - gboolean is_symlink); + gboolean is_symlink); void g_file_info_set_name (GFileInfo *info, const char *name); void g_file_info_set_display_name (GFileInfo *info, @@ -231,22 +233,22 @@ const char * void g_file_info_set_content_type (GFileInfo *info, const char *content_type); void g_file_info_set_size (GFileInfo *info, - goffset size); + goffset size); void g_file_info_set_modification_time (GFileInfo *info, - GTimeVal *mtime); + GTimeVal *mtime); void g_file_info_set_symlink_target (GFileInfo *info, const char *symlink_target); void g_file_info_set_sort_order (GFileInfo *info, - gint32 sort_order); + gint32 sort_order); GFileAttributeMatcher * g_file_attribute_matcher_new (const char *attributes); GFileAttributeMatcher * g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher); void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher); -gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher, +gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher, const char *attribute); -gboolean g_file_attribute_matcher_matches_only +gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher, const char *attribute); -gboolean g_file_attribute_matcher_enumerate_namespace +gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher, const char *ns); const char * g_file_attribute_matcher_enumerate_next @@ -256,7 +258,7 @@ const char *

Object Hierarchy

-  GObject
+  GObject
    +----GFileInfo
 
@@ -621,7 +623,7 @@ to copy).

A key in the "access" namespace for getting read privileges. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -This attribute will be TRUE if the user is able to read the file. +This attribute will be TRUE if the user is able to read the file.


@@ -632,7 +634,7 @@ This attribute will be GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -This attribute will be TRUE if the user is able to write to the file. +This attribute will be TRUE if the user is able to write to the file.


@@ -643,7 +645,7 @@ This attribute will be GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -This attribute will be TRUE if the user is able to execute the file. +This attribute will be TRUE if the user is able to execute the file.


@@ -654,7 +656,7 @@ This attribute will be GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -This attribute will be TRUE if the user is able to delete the file. +This attribute will be TRUE if the user is able to delete the file.


@@ -665,7 +667,7 @@ This attribute will be GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -This attribute will be TRUE if the user is able to move the file to +This attribute will be TRUE if the user is able to move the file to the trash.

@@ -677,7 +679,7 @@ the trash.

A key in the "access" namespace for checking renaming privileges. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -This attribute will be TRUE if the user is able to rename the file. +This attribute will be TRUE if the user is able to rename the file.


@@ -1019,7 +1021,7 @@ Corresponding

A key in the "unix" namespace for checking if the file represents a -UNIX mount point. This attribute is TRUE if the file is a UNIX mount +UNIX mount point. This attribute is TRUE if the file is a UNIX mount point. This attribute is only available for UNIX file systems. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

@@ -1031,7 +1033,7 @@ Corresponding

A key in the "dos" namespace for checking if the file's archive flag -is set. This attribute is TRUE if the archive flag is set. This attribute +is set. This attribute is TRUE if the archive flag is set. This attribute is only available for DOS file systems. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

@@ -1043,7 +1045,7 @@ is TRUE if the backup flag is set. This attribute +is set. This attribute is TRUE if the backup flag is set. This attribute is only available for DOS file systems. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

@@ -1098,7 +1100,7 @@ image. Corresponding TRUE if thumbnailing failed. Corresponding +This attribute is TRUE if thumbnailing failed. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

@@ -1155,7 +1157,7 @@ Corresponding

A key in the "filesystem" namespace for checking if the file system -is read only. Is set to TRUE if the file system is read only. +is read only. Is set to TRUE if the file system is read only. Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

@@ -1194,6 +1196,32 @@ Corresponding
+
+

G_FILE_ATTRIBUTE_TRASH_DELETION_DATE

+
#define G_FILE_ATTRIBUTE_TRASH_DELETION_DATE "trash::deletion-date"  /* string */
+
+

+A key in the "trash" namespace. When requested against +items in "trash:///", will return the date and time when the file +was trashed. The format of the returned string is YYYY-MM-DDThh:mm:ss. +Corresponding GFileAttributeType is G_FILE_ATTRIBUTE_TYPE_STRING. +

+

Since 2.24.

+
+
+
+

G_FILE_ATTRIBUTE_TRASH_ORIG_PATH

+
#define G_FILE_ATTRIBUTE_TRASH_ORIG_PATH "trash::orig-path"     /* string */
+
+

+A key in the "trash" namespace. When requested against +items in "trash:///", will return the original path to the file before it +was trashed. Corresponding GFileAttributeType is +G_FILE_ATTRIBUTE_TYPE_STRING. +

+

Since 2.24.

+
+

G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW

#define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview"        /* uint32 (GFilesystemPreviewType) */
@@ -1255,7 +1283,7 @@ Duplicates a file info structure.
 
 
- @@ -1288,7 +1316,7 @@ Copies all of the GFileAttributes from

g_file_info_has_attribute ()

-
gboolean            g_file_info_has_attribute           (GFileInfo *info,
+
gboolean            g_file_info_has_attribute           (GFileInfo *info,
                                                          const char *attribute);

Checks if a file info structure has an attribute named attribute. @@ -1308,8 +1336,8 @@ Checks if a file info structure has an attribute named

- @@ -1318,7 +1346,7 @@ Checks if a file info structure has an attribute named

g_file_info_has_namespace ()

-
gboolean            g_file_info_has_namespace           (GFileInfo *info,
+
gboolean            g_file_info_has_namespace           (GFileInfo *info,
                                                          const char *name_space);

Checks if a file info structure has an attribute in the @@ -1339,8 +1367,8 @@ specified name_space.

- @@ -1373,7 +1401,7 @@ Lists the file info structure's attributes. @@ -1459,7 +1487,7 @@ utf8. @@ -1468,10 +1496,10 @@ utf8.

g_file_info_get_attribute_data ()

-
gboolean            g_file_info_get_attribute_data      (GFileInfo *info,
+
gboolean            g_file_info_get_attribute_data      (GFileInfo *info,
                                                          const char *attribute,
                                                          GFileAttributeType *type,
-                                                         gpointer *value_pp,
+                                                         gpointer *value_pp,
                                                          GFileAttributeStatus *status);

Gets the attribute type, value and status for an attribute key. @@ -1491,23 +1519,23 @@ Gets the attribute type, value and status for an attribute key.

- - - - @@ -1551,7 +1579,7 @@ Gets the attribute status for an attribute key. const char *attribute);

Gets the value of a string attribute. If the attribute does -not contain a string, NULL will be returned. +not contain a string, NULL will be returned.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

a GFileInfo for the stream, or NULL on error. - + a GFileInfo for the stream, or NULL on error. [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

A GFileInfo for the finished query. - + A GFileInfo for the finished query. [transfer full]

Returns :

a GIcon for the given file, or NULL on error. + a GIcon for the given file, or NULL on error. [transfer full]

Returns :

a GFile, or NULL. + a GFile, or NULL. [transfer none]

Returns :

a duplicate GFileInfo of other. + a duplicate GFileInfo of other. [transfer full]

Returns :

TRUE if Ginfo has an attribute named attribute, - FALSE otherwise. + TRUE if Ginfo has an attribute named attribute, + FALSE otherwise.

Returns :

TRUE if Ginfo has an attribute in name_space, - FALSE otherwise. + TRUE if Ginfo has an attribute in name_space, + FALSE otherwise.

Returns :

a null-terminated array of strings of all of the possible attribute types for the given name_space, or -NULL on error. +NULL on error. [array zero-terminated=1][transfer full zero-terminated=1]

Returns :

a UTF-8 string associated with the given attribute. - When you're done with the string it must be freed with g_free(). + When you're done with the string it must be freed with g_free().

type :

return location for the attribute type, or NULL + return location for the attribute type, or NULL. [out][allow-none]

value_pp :

return location for the attribute value, or NULL + return location for the attribute value, or NULL. [out][allow-none]

status :

return location for the attribute status, or NULL + return location for the attribute status, or NULL. [out][allow-none]

Returns :

TRUE if info has an attribute named attribute, - FALSE otherwise. + TRUE if info has an attribute named attribute, + FALSE otherwise. [transfer none]
@@ -1569,7 +1597,7 @@ not contain a string, Returns :

@@ -1582,7 +1610,7 @@ not contain a string, const char *attribute);

Gets the value of a stringv attribute. If the attribute does -not contain a stringv, NULL will be returned. +not contain a stringv, NULL will be returned.

the contents of the attribute value as a string, or -NULL otherwise. +NULL otherwise.
@@ -1600,8 +1628,7 @@ not contain a stringv, Returns :

@@ -1616,7 +1643,7 @@ not contain a stringv, const char *attribute);

Gets the value of a byte string attribute. If the attribute does -not contain a byte string, NULL will be returned. +not contain a byte string, NULL will be returned.

the contents of the attribute value as a stringv, or -NULL otherwise. Do not free. - +NULL otherwise. Do not free. [transfer none]
@@ -1634,7 +1661,7 @@ not contain a byte string, Returns :

@@ -1643,11 +1670,11 @@ not contain a byte string,

g_file_info_get_attribute_boolean ()

-
gboolean            g_file_info_get_attribute_boolean   (GFileInfo *info,
+
gboolean            g_file_info_get_attribute_boolean   (GFileInfo *info,
                                                          const char *attribute);

Gets the value of a boolean attribute. If the attribute does not -contain a boolean value, FALSE will be returned. +contain a boolean value, FALSE will be returned.

the contents of the attribute value as a byte string, or -NULL otherwise. +NULL otherwise.
@@ -1673,7 +1700,7 @@ contain a boolean value,

g_file_info_get_attribute_uint32 ()

-
guint32             g_file_info_get_attribute_uint32    (GFileInfo *info,
+
guint32             g_file_info_get_attribute_uint32    (GFileInfo *info,
                                                          const char *attribute);

Gets an unsigned 32-bit integer contained within the attribute. If the @@ -1704,7 +1731,7 @@ attribute does not contain an unsigned 32-bit integer, or is invalid,


g_file_info_get_attribute_int32 ()

-
gint32              g_file_info_get_attribute_int32     (GFileInfo *info,
+
gint32              g_file_info_get_attribute_int32     (GFileInfo *info,
                                                          const char *attribute);

Gets a signed 32-bit integer contained within the attribute. If the @@ -1735,7 +1762,7 @@ attribute does not contain a signed 32-bit integer, or is invalid,


g_file_info_get_attribute_uint64 ()

-
guint64             g_file_info_get_attribute_uint64    (GFileInfo *info,
+
guint64             g_file_info_get_attribute_uint64    (GFileInfo *info,
                                                          const char *attribute);

Gets a unsigned 64-bit integer contained within the attribute. If the @@ -1766,7 +1793,7 @@ attribute does not contain an unsigned 64-bit integer, or is invalid,


g_file_info_get_attribute_int64 ()

-
gint64              g_file_info_get_attribute_int64     (GFileInfo *info,
+
gint64              g_file_info_get_attribute_int64     (GFileInfo *info,
                                                          const char *attribute);

Gets a signed 64-bit integer contained within the attribute. If the @@ -1797,11 +1824,11 @@ attribute does not contain an signed 64-bit integer, or is invalid,


g_file_info_get_attribute_object ()

-
GObject *           g_file_info_get_attribute_object    (GFileInfo *info,
+
GObject *           g_file_info_get_attribute_object    (GFileInfo *info,
                                                          const char *attribute);

-Gets the value of a GObject attribute. If the attribute does -not contain a GObject, NULL will be returned. +Gets the value of a GObject attribute. If the attribute does +not contain a GObject, NULL will be returned.

@@ -1818,8 +1845,8 @@ not contain a Returns :

-
@@ -1831,7 +1858,7 @@ not contain a void g_file_info_set_attribute (GFileInfo *info, const char *attribute, GFileAttributeType type, - gpointer value_p); + gpointer value_p);

Sets the attribute to contain the given value, if possible.

@@ -1864,7 +1891,7 @@ Sets the attribute to contain the given

g_file_info_set_attribute_status ()

-
gboolean            g_file_info_set_attribute_status    (GFileInfo *info,
+
gboolean            g_file_info_set_attribute_status    (GFileInfo *info,
                                                          const char *attribute,
                                                          GFileAttributeStatus status);

@@ -1873,7 +1900,7 @@ needed by external code that implement info for this to work. Otherwise FALSE +The attribute must exist in info for this to work. Otherwise FALSE is returned and info is unchanged.

a GObject associated with the given attribute, or -NULL otherwise. + a GObject associated with the given attribute, or +NULL otherwise. [transfer none]
@@ -1896,7 +1923,7 @@ is returned and info is unchanged. - @@ -1963,7 +1990,7 @@ Sinze: 2.22 - @@ -2006,7 +2033,7 @@ if possible.

g_file_info_set_attribute_boolean ()

void                g_file_info_set_attribute_boolean   (GFileInfo *info,
                                                          const char *attribute,
-                                                         gboolean attr_value);
+ gboolean attr_value);

Sets the attribute to contain the given attr_value, if possible. @@ -2037,7 +2064,7 @@ if possible.

g_file_info_set_attribute_uint32 ()

void                g_file_info_set_attribute_uint32    (GFileInfo *info,
                                                          const char *attribute,
-                                                         guint32 attr_value);
+ guint32 attr_value);

Sets the attribute to contain the given attr_value, if possible. @@ -2068,7 +2095,7 @@ if possible.

g_file_info_set_attribute_int32 ()

void                g_file_info_set_attribute_int32     (GFileInfo *info,
                                                          const char *attribute,
-                                                         gint32 attr_value);
+ gint32 attr_value);

Sets the attribute to contain the given attr_value, if possible. @@ -2099,7 +2126,7 @@ if possible.

g_file_info_set_attribute_uint64 ()

void                g_file_info_set_attribute_uint64    (GFileInfo *info,
                                                          const char *attribute,
-                                                         guint64 attr_value);
+ guint64 attr_value);

Sets the attribute to contain the given attr_value, if possible. @@ -2130,7 +2157,7 @@ if possible.

g_file_info_set_attribute_int64 ()

void                g_file_info_set_attribute_int64     (GFileInfo *info,
                                                          const char *attribute,
-                                                         gint64 attr_value);
+ gint64 attr_value);

Sets the attribute to contain the given attr_value, if possible. @@ -2161,7 +2188,7 @@ if possible.

g_file_info_set_attribute_object ()

void                g_file_info_set_attribute_object    (GFileInfo *info,
                                                          const char *attribute,
-                                                         GObject *attr_value);
+ GObject *attr_value);

Sets the attribute to contain the given attr_value, if possible. @@ -2181,7 +2208,7 @@ if possible.

- @@ -2230,7 +2257,7 @@ This is different from the file's content type, see

g_file_info_get_is_hidden ()

-
gboolean            g_file_info_get_is_hidden           (GFileInfo *info);
+
gboolean            g_file_info_get_is_hidden           (GFileInfo *info);

Checks if a file is hidden.

@@ -2244,7 +2271,7 @@ Checks if a file is hidden.
- @@ -2253,7 +2280,7 @@ Checks if a file is hidden.

g_file_info_get_is_backup ()

-
gboolean            g_file_info_get_is_backup           (GFileInfo *info);
+
gboolean            g_file_info_get_is_backup           (GFileInfo *info);

Checks if a file is a backup file.

@@ -2267,7 +2294,7 @@ Checks if a file is a backup file.
- @@ -2276,7 +2303,7 @@ Checks if a file is a backup file.

g_file_info_get_is_symlink ()

-
gboolean            g_file_info_get_is_symlink          (GFileInfo *info);
+
gboolean            g_file_info_get_is_symlink          (GFileInfo *info);

Checks if a file is a symlink.

@@ -2290,7 +2317,7 @@ Checks if a file is a symlink.
- @@ -2382,7 +2409,7 @@ Gets the icon for a file. - @@ -2414,7 +2441,7 @@ Gets the file's content type.

g_file_info_get_size ()

-
goffset             g_file_info_get_size                (GFileInfo *info);
+
goffset             g_file_info_get_size                (GFileInfo *info);

Gets the file's size.

@@ -2428,7 +2455,7 @@ Gets the file's size.
- @@ -2438,7 +2465,7 @@ Gets the file's size.

g_file_info_get_modification_time ()

void                g_file_info_get_modification_time   (GFileInfo *info,
-                                                         GTimeVal *result);
+ GTimeVal *result);

Gets the modification time of the current info and sets it in result. @@ -2453,7 +2480,7 @@ in result.

- @@ -2509,7 +2536,7 @@ Gets the entity tag for a given

g_file_info_get_sort_order ()

-
gint32              g_file_info_get_sort_order          (GFileInfo *info);
+
gint32              g_file_info_get_sort_order          (GFileInfo *info);

Gets the value of the sort_order attribute from the GFileInfo. See G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. @@ -2524,7 +2551,7 @@ See Returns :

-
@@ -2601,7 +2628,7 @@ See

g_file_info_set_is_hidden ()

void                g_file_info_set_is_hidden           (GFileInfo *info,
-                                                         gboolean is_hidden);
+ gboolean is_hidden);

Sets the "is_hidden" attribute in a GFileInfo according to is_symlink. See G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN. @@ -2616,7 +2643,7 @@ See is_hidden :

-
@@ -2626,7 +2653,7 @@ See

g_file_info_set_is_symlink ()

void                g_file_info_set_is_symlink          (GFileInfo *info,
-                                                         gboolean is_symlink);
+ gboolean is_symlink);

Sets the "is_symlink" attribute in a GFileInfo according to is_symlink. See G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK. @@ -2641,7 +2668,7 @@ See is_symlink :

-
@@ -2776,7 +2803,7 @@ See

g_file_info_set_size ()

void                g_file_info_set_size                (GFileInfo *info,
-                                                         goffset size);
+ goffset size);

Sets the G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info to the given size. @@ -2791,7 +2818,7 @@ to the given size.

- @@ -2801,7 +2828,7 @@ to the given size.

g_file_info_set_modification_time ()

void                g_file_info_set_modification_time   (GFileInfo *info,
-                                                         GTimeVal *mtime);
+ GTimeVal *mtime);

Sets the G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file info to the given time value. @@ -2816,7 +2843,7 @@ info to the given time value.

- @@ -2851,7 +2878,7 @@ to the given symlink target.

g_file_info_set_sort_order ()

void                g_file_info_set_sort_order          (GFileInfo *info,
-                                                         gint32 sort_order);
+ gint32 sort_order);

Sets the sort order attribute in the file info structure. See G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. @@ -2894,7 +2921,7 @@ The wildcard "*" may be used to match all keys and namespaces, or Examples of strings to use:

-

Table 3. File Attribute Matcher strings and results

+

Table 3. File Attribute Matcher strings and results

Returns :

TRUE if the status was changed, FALSE if the key was not set. + TRUE if the status was changed, FALSE if the key was not set.

attr_value :

a NULL terminated string array +a NULL terminated string array

attr_value :

a GObject. +a GObject.

Returns :

TRUE if the file is a hidden file, FALSE otherwise. + TRUE if the file is a hidden file, FALSE otherwise.

Returns :

TRUE if file is a backup file, FALSE otherwise. + TRUE if file is a backup file, FALSE otherwise.

Returns :

TRUE if the given info is a symlink. + TRUE if the given info is a symlink.

Returns :

GIcon for the given info. + GIcon for the given info. [transfer none]

Returns :

a goffset containing the file's size. + a goffset containing the file's size.

result :

a GTimeVal. +a GTimeVal.
a gint32 containing the value of the "standard::sort_order" attribute. + a gint32 containing the value of the "standard::sort_order" attribute.
a gboolean. +a gboolean.
a gboolean. +a gboolean.

size :

a goffset containing the file's size. +a goffset containing the file's size.

mtime :

a GTimeVal. +a GTimeVal.
@@ -2982,12 +3009,12 @@ the matcher is automatically freed.

g_file_attribute_matcher_matches ()

-
gboolean            g_file_attribute_matcher_matches    (GFileAttributeMatcher *matcher,
+
gboolean            g_file_attribute_matcher_matches    (GFileAttributeMatcher *matcher,
                                                          const char *attribute);

Checks if an attribute will be matched by an attribute matcher. If the matcher was created with the "*" matching string, this function -will always return TRUE. +will always return TRUE.

@@ -3004,7 +3031,7 @@ will always return Returns :

-
@@ -3013,12 +3040,12 @@ will always return

g_file_attribute_matcher_matches_only ()

-
gboolean            g_file_attribute_matcher_matches_only
+
gboolean            g_file_attribute_matcher_matches_only
                                                         (GFileAttributeMatcher *matcher,
                                                          const char *attribute);

Checks if a attribute matcher only matches a given attribute. Always -returns FALSE if "*" was used when creating the matcher. +returns FALSE if "*" was used when creating the matcher.

TRUE if attribute matches matcher. FALSE otherwise. + TRUE if attribute matches matcher. FALSE otherwise.
@@ -3035,7 +3062,7 @@ returns Returns :

-
@@ -3044,12 +3071,12 @@ returns

g_file_attribute_matcher_enumerate_namespace ()

-
gboolean            g_file_attribute_matcher_enumerate_namespace
+
gboolean            g_file_attribute_matcher_enumerate_namespace
                                                         (GFileAttributeMatcher *matcher,
                                                          const char *ns);

Checks if the matcher will match all of the keys in a given namespace. -This will always return TRUE if a wildcard character is in use (e.g. if +This will always return TRUE if a wildcard character is in use (e.g. if matcher was created with "standard::*" and ns is "standard", or if matcher was created using "*" and namespace is anything.)

@@ -3071,8 +3098,8 @@ TODO: this is awkwardly worded.
- @@ -3096,7 +3123,7 @@ Gets the next matched attribute from a Returns :

-
@@ -3111,6 +3138,6 @@ no more attribute exist. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileInputStream.html b/docs/reference/gio/html/GFileInputStream.html index fbc16d3..3a1a224 100644 --- a/docs/reference/gio/html/GFileInputStream.html +++ b/docs/reference/gio/html/GFileInputStream.html @@ -3,12 +3,12 @@ GFileInputStream - + - + @@ -48,24 +48,24 @@ GFileInfo * g_file_input_stream_query_info (GFileInputStream *stream, const char *attributes, GCancellable *cancellable, - GError **error); + GError **error); void g_file_input_stream_query_info_async (GFileInputStream *stream, const char *attributes, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileInfo * g_file_input_stream_query_info_finish (GFileInputStream *stream, GAsyncResult *result, - GError **error); + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GFileInputStream
 
@@ -110,7 +110,7 @@ a few file-specific operations and seeking.
GFileInfo *         g_file_input_stream_query_info      (GFileInputStream *stream,
                                                          const char *attributes,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Queries a file input stream the given attributes. This function blocks while querying the stream. For the asynchronous (non-blocking) version @@ -133,18 +133,18 @@ any other operations on the stream will fail with cancellable :

-
- - @@ -159,7 +159,7 @@ ignore. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Queries the stream information asynchronously. When the operation is finished callback will be called. @@ -171,7 +171,7 @@ For the synchronous version of this function, see g_file_input_stream_query_info().

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be set

@@ -196,17 +196,17 @@ was cancelled, the error cancellable :

-
- - @@ -218,7 +218,7 @@ was cancelled, the error GFileInfo * g_file_input_stream_query_info_finish (GFileInputStream *stream, GAsyncResult *result, - GError **error); + GError **error);

Finishes an asynchronous info query operation.

@@ -237,13 +237,13 @@ Finishes an asynchronous info query operation.
- - @@ -257,6 +257,6 @@ Finishes an asynchronous info query operation. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileMonitor.html b/docs/reference/gio/html/GFileMonitor.html index 0a4efa3..560eb92 100644 --- a/docs/reference/gio/html/GFileMonitor.html +++ b/docs/reference/gio/html/GFileMonitor.html @@ -3,12 +3,12 @@ GFileMonitor - + - - + + @@ -18,7 +18,7 @@ - + - @@ -196,7 +196,7 @@ Cancels a file monitor.

g_file_monitor_is_cancelled ()

-
gboolean            g_file_monitor_is_cancelled         (GFileMonitor *monitor);
+
gboolean            g_file_monitor_is_cancelled         (GFileMonitor *monitor);

Returns whether the monitor is canceled.

@@ -210,7 +210,7 @@ Returns whether the monitor is canceled.
- @@ -220,7 +220,7 @@ Returns whether the monitor is canceled.

g_file_monitor_set_rate_limit ()

void                g_file_monitor_set_rate_limit       (GFileMonitor *monitor,
-                                                         int limit_msecs);
+ gint limit_msecs);

Sets the rate limit to which the monitor will report consecutive change events to the same file. @@ -235,8 +235,8 @@ consecutive change events to the same file.

- @@ -289,14 +289,14 @@ context).

Property Details

The "cancelled" property

-
  "cancelled"                gboolean              : Read
+
  "cancelled"                gboolean              : Read

Whether the monitor has been cancelled.

Default value: FALSE


The "rate-limit" property

-
  "rate-limit"               gint                  : Read / Write
+
  "rate-limit"               gint                  : Read / Write

The limit of the monitor to watch for changes, in milliseconds.

Allowed values: >= 0

Default value: 800

@@ -310,9 +310,17 @@ context). GFile *file, GFile *other_file, GFileMonitorEvent event_type, - gpointer user_data) : Run Last + gpointer user_data) : Run Last

-Emitted when a file has been changed. +Emitted when file has been changed. +

+

+If using G_FILE_MONITOR_SEND_MOVED flag and event_type is +G_FILE_MONITOR_SEND_MOVED, file will be set to a GFile containing the +old path, and other_file will be set to a GFile containing the new path. +

+

+In all the other cases, other_file will be set to NULL.

TRUE if the matcher only matches attribute. FALSE otherwise. + TRUE if the matcher only matches attribute. FALSE otherwise.

Returns :

TRUE if the matcher matches all of the entries -in the given ns, FALSE otherwise. + TRUE if the matcher matches all of the entries +in the given ns, FALSE otherwise.
a string containing the next attribute or NULL if + a string containing the next attribute or NULL if no more attribute exist.
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a GFileInfo, or NULL on error. + a GFileInfo, or NULL on error. [transfer full]
optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError location to store the error occuring, - or NULL to ignore. +a GError location to store the error occuring, + or NULL to ignore.

Returns :

GFileInfo. + GFileInfo. [transfer full]
Up Home GIO Reference ManualNextNext
Top @@ -48,10 +48,10 @@ enum GFileMonitorEvent; GFileMonitor; -gboolean g_file_monitor_cancel (GFileMonitor *monitor); -gboolean g_file_monitor_is_cancelled (GFileMonitor *monitor); +gboolean g_file_monitor_cancel (GFileMonitor *monitor); +gboolean g_file_monitor_is_cancelled (GFileMonitor *monitor); void g_file_monitor_set_rate_limit (GFileMonitor *monitor, - int limit_msecs); + gint limit_msecs); void g_file_monitor_emit_event (GFileMonitor *monitor, GFile *child, GFile *other_file, @@ -61,15 +61,15 @@ enum

Object Hierarchy

-  GObject
+  GObject
    +----GFileMonitor
 

Properties

-  "cancelled"                gboolean              : Read
-  "rate-limit"               gint                  : Read / Write
+  "cancelled"                gboolean              : Read
+  "rate-limit"               gint                  : Read / Write
 
@@ -173,7 +173,7 @@ Watches for changes to a file.

g_file_monitor_cancel ()

-
gboolean            g_file_monitor_cancel               (GFileMonitor *monitor);
+
gboolean            g_file_monitor_cancel               (GFileMonitor *monitor);

Cancels a file monitor.

@@ -187,7 +187,7 @@ Cancels a file monitor.

Returns :

TRUE if monitor was cancelled. + TRUE if monitor was cancelled.

Returns :

TRUE if monitor is canceled. FALSE otherwise. + TRUE if monitor is canceled. FALSE otherwise.

limit_msecs :

a integer with the limit in milliseconds to -poll for changes. +a non-negative integer with the limit in milliseconds + to poll for changes
@@ -329,7 +337,7 @@ Emitted when a file has been changed. - @@ -348,6 +356,6 @@ Emitted when a file has been changed. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFileOutputStream.html b/docs/reference/gio/html/GFileOutputStream.html index ffc732c..205403d 100644 --- a/docs/reference/gio/html/GFileOutputStream.html +++ b/docs/reference/gio/html/GFileOutputStream.html @@ -3,12 +3,12 @@ GFileOutputStream - + - + @@ -48,25 +48,25 @@ GFileInfo * g_file_output_stream_query_info (GFileOutputStream *stream, const char *attributes, GCancellable *cancellable, - GError **error); + GError **error); void g_file_output_stream_query_info_async (GFileOutputStream *stream, const char *attributes, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GFileInfo * g_file_output_stream_query_info_finish (GFileOutputStream *stream, GAsyncResult *result, - GError **error); + GError **error); char * g_file_output_stream_get_etag (GFileOutputStream *stream);

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GFileOutputStream
 
@@ -117,7 +117,7 @@ a few file-specific operations and seeking and truncating.
GFileInfo *         g_file_output_stream_query_info     (GFileOutputStream *stream,
                                                          const char *attributes,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Queries a file output stream for the given attributes. This function blocks while querying the stream. For the asynchronous @@ -131,12 +131,12 @@ Can fail if the stream was already closed (with erro G_IO_ERROR_CLOSED), the stream has pending operations (with error being set to G_IO_ERROR_PENDING), or if querying info is not supported for the stream's interface (with error being set to G_IO_ERROR_NOT_SUPPORTED). In -all cases of failure, NULL will be returned. +all cases of failure, NULL will be returned.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation -was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will +was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will be returned.

other_file :

a GFile. +a GFile or NULL.
@@ -154,17 +154,17 @@ be returned. - - - @@ -179,7 +179,7 @@ be returned. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously queries the stream for a GFileInfo. When completed, callback will be called with a GAsyncResult which can be used to @@ -210,7 +210,7 @@ For the synchronous version of this function, see

- @@ -232,7 +232,7 @@ For the synchronous version of this function, see
GFileInfo *         g_file_output_stream_query_info_finish
                                                         (GFileOutputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finalizes the asynchronous query started by g_file_output_stream_query_info_async(). @@ -252,12 +252,12 @@ by error :

-
- @@ -296,6 +296,6 @@ and closed, as the etag can change while writing. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFilenameCompleter.html b/docs/reference/gio/html/GFilenameCompleter.html index 0143ee0..b8ee3b2 100644 --- a/docs/reference/gio/html/GFilenameCompleter.html +++ b/docs/reference/gio/html/GFilenameCompleter.html @@ -3,12 +3,12 @@ GFilenameCompleter - + - - - - + + + + @@ -18,7 +18,7 @@ - + - @@ -159,7 +159,7 @@ Gets an array of completion strings for a given initial text. @@ -169,9 +169,9 @@ This array must be freed by

g_filename_completer_set_dirs_only ()

void                g_filename_completer_set_dirs_only  (GFilenameCompleter *completer,
-                                                         gboolean dirs_only);
+ gboolean dirs_only);

-If dirs_only is TRUE, completer will only +If dirs_only is TRUE, completer will only complete directory names, and not file names.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

a GFileInfo for the stream, or NULL on error. + a GFileInfo for the stream, or NULL on error. [transfer full]

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
a GError, NULL to ignore. +a GError, NULL to ignore.

Returns :

A GFileInfo for the finished query. + A GFileInfo for the finished query. [transfer full]
Up Home GIO Reference ManualNextNext
Top @@ -53,13 +53,13 @@ (GFilenameCompleter *completer, const char *initial_text); void g_filename_completer_set_dirs_only (GFilenameCompleter *completer, - gboolean dirs_only); + gboolean dirs_only);

Object Hierarchy

-  GObject
+  GObject
    +----GFilenameCompleter
 
@@ -126,8 +126,8 @@ Obtains a completion for initial_text fr

Returns :

a completed string, or NULL if no completion exists. - This string is not owned by GIO, so remember to g_free() it + a completed string, or NULL if no completion exists. + This string is not owned by GIO, so remember to g_free() it when finished.

Returns :

array of strings with possible completions for initial_text. -This array must be freed by g_strfreev() when finished. +This array must be freed by g_strfreev() when finished. [array zero-terminated=1][transfer full zero-terminated=1]
@@ -184,7 +184,7 @@ complete directory names, and not file names. - @@ -196,7 +196,7 @@ complete directory names, and not file names.

The "got-completion-data" signal

void                user_function                      (GFilenameCompleter *arg0,
-                                                        gpointer            user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the file name completion information comes available.

@@ -212,6 +212,6 @@ Emitted when the file name completion information comes available.
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFilterInputStream.html b/docs/reference/gio/html/GFilterInputStream.html index 31bd52d..821b4d1 100644 --- a/docs/reference/gio/html/GFilterInputStream.html +++ b/docs/reference/gio/html/GFilterInputStream.html @@ -3,12 +3,12 @@ GFilterInputStream - + - + @@ -47,17 +47,17 @@ GFilterInputStream; GInputStream * g_filter_input_stream_get_base_stream (GFilterInputStream *stream); -gboolean g_filter_input_stream_get_close_base_stream +gboolean g_filter_input_stream_get_close_base_stream (GFilterInputStream *stream); void g_filter_input_stream_set_close_base_stream (GFilterInputStream *stream, - gboolean close_base); + gboolean close_base);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GFilterInputStream
                +----GBufferedInputStream
@@ -68,11 +68,17 @@
 

Properties

   "base-stream"              GInputStream*         : Read / Write / Construct Only
-  "close-base-stream"        gboolean              : Read / Write / Construct Only
+  "close-base-stream"        gboolean              : Read / Write / Construct Only
 

Description

+

+Base class for input stream implementations that perform some +kind of filtering operation on a base stream. Typical examples +of filtering operations are character set conversion, compression +and byte order flipping. +

Details

@@ -101,7 +107,7 @@ Gets the base stream for the filter stream.
- @@ -110,7 +116,7 @@ Gets the base stream for the filter stream.

g_filter_input_stream_get_close_base_stream ()

-
gboolean            g_filter_input_stream_get_close_base_stream
+
gboolean            g_filter_input_stream_get_close_base_stream
                                                         (GFilterInputStream *stream);

Returns whether the base stream will be closed when stream is @@ -126,7 +132,7 @@ closed.

- @@ -137,7 +143,7 @@ closed.

g_filter_input_stream_set_close_base_stream ()

void                g_filter_input_stream_set_close_base_stream
                                                         (GFilterInputStream *stream,
-                                                         gboolean close_base);
+ gboolean close_base);

Sets whether the base stream will be closed when stream is closed.

@@ -152,7 +158,7 @@ Sets whether the base stream will be closed when str
@@ -169,7 +175,7 @@ Sets whether the base stream will be closed when str

The "close-base-stream" property

-
  "close-base-stream"        gboolean              : Read / Write / Construct Only
+
  "close-base-stream"        gboolean              : Read / Write / Construct Only

If the base stream should be closed when the filter stream is closed.

Default value: TRUE

@@ -177,6 +183,6 @@ Sets whether the base stream will be closed when str + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GFilterOutputStream.html b/docs/reference/gio/html/GFilterOutputStream.html index 394d7c7..b1818f7 100644 --- a/docs/reference/gio/html/GFilterOutputStream.html +++ b/docs/reference/gio/html/GFilterOutputStream.html @@ -3,12 +3,12 @@ GFilterOutputStream - + - + @@ -47,17 +47,17 @@ GFilterOutputStream; GOutputStream * g_filter_output_stream_get_base_stream (GFilterOutputStream *stream); -gboolean g_filter_output_stream_get_close_base_stream +gboolean g_filter_output_stream_get_close_base_stream (GFilterOutputStream *stream); void g_filter_output_stream_set_close_base_stream (GFilterOutputStream *stream, - gboolean close_base); + gboolean close_base);

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GFilterOutputStream
                +----GBufferedOutputStream
@@ -69,11 +69,17 @@
 

Properties

   "base-stream"              GOutputStream*        : Read / Write / Construct Only
-  "close-base-stream"        gboolean              : Read / Write / Construct Only
+  "close-base-stream"        gboolean              : Read / Write / Construct Only
 

Description

+

+Base class for output stream implementations that perform some +kind of filtering operation on a base stream. Typical examples +of filtering operations are character set conversion, compression +and byte order flipping. +

Details

@@ -102,7 +108,7 @@ Gets the base stream for the filter stream.
- @@ -111,7 +117,7 @@ Gets the base stream for the filter stream.

g_filter_output_stream_get_close_base_stream ()

-
gboolean            g_filter_output_stream_get_close_base_stream
+
gboolean            g_filter_output_stream_get_close_base_stream
                                                         (GFilterOutputStream *stream);

Returns whether the base stream will be closed when stream is @@ -127,7 +133,7 @@ closed.

- @@ -138,7 +144,7 @@ closed.

g_filter_output_stream_set_close_base_stream ()

void                g_filter_output_stream_set_close_base_stream
                                                         (GFilterOutputStream *stream,
-                                                         gboolean close_base);
+ gboolean close_base);

Sets whether the base stream will be closed when stream is closed.

@@ -153,7 +159,7 @@ Sets whether the base stream will be closed when str
@@ -170,7 +176,7 @@ Sets whether the base stream will be closed when str

The "close-base-stream" property

-
  "close-base-stream"        gboolean              : Read / Write / Construct Only
+
  "close-base-stream"        gboolean              : Read / Write / Construct Only

If the base stream should be closed when the filter stream is closed.

Default value: TRUE

@@ -178,6 +184,6 @@ Sets whether the base stream will be closed when str + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GIOModule.html b/docs/reference/gio/html/GIOModule.html index 23f65a2..53e0a0c 100644 --- a/docs/reference/gio/html/GIOModule.html +++ b/docs/reference/gio/html/GIOModule.html @@ -3,12 +3,12 @@ GIOModule - + - + @@ -45,8 +45,8 @@ #include <gio/gio.h> GIOModule; -GIOModule * g_io_module_new (const gchar *filename); -GList * g_io_modules_load_all_in_directory (const gchar *dirname); +GIOModule * g_io_module_new (const gchar *filename); +GList * g_io_modules_load_all_in_directory (const gchar *dirname); void g_io_modules_scan_all_in_directory (const char *dirname); void g_io_module_load (GIOModule *module); void g_io_module_unload (GIOModule *module); @@ -56,8 +56,8 @@

Object Hierarchy

-  GObject
-   +----GTypeModule
+  GObject
+   +----GTypeModule
          +----GIOModule
 
@@ -65,7 +65,7 @@

Implemented Interfaces

GIOModule implements - GTypePlugin.

+ GTypePlugin.

Description

@@ -87,7 +87,7 @@ Opaque module base class for extending GIO.

g_io_module_new ()

-
GIOModule *         g_io_module_new                     (const gchar *filename);
+
GIOModule *         g_io_module_new                     (const gchar *filename);

Creates a new GIOModule that will load the specific shared library when in use. @@ -103,7 +103,7 @@ shared library when in use.

@@ -112,7 +112,7 @@ or

g_io_modules_load_all_in_directory ()

-
GList *             g_io_modules_load_all_in_directory  (const gchar *dirname);
+
GList *             g_io_modules_load_all_in_directory  (const gchar *dirname);

Loads all the modules in the specified directory.

@@ -131,11 +131,12 @@ which allows delayed/lazy loading of modules.
- @@ -158,7 +159,7 @@ an extension point it implementes is used with e.g.

If you need to guarantee that all types are loaded in all the modules, -use g_io_modules_scan_all_in_directory(). +use g_io_modules_load_all_in_directory().

dirs_only :

a gboolean. +a gboolean.

Returns :

a GInputStream. + a GInputStream. [transfer none]

Returns :

TRUE if the base stream will be closed. + TRUE if the base stream will be closed.

close_base :

-TRUE to close the base stream. +TRUE to close the base stream.

Returns :

a GOutputStream. + a GOutputStream. [transfer none]

Returns :

TRUE if the base stream will be closed. + TRUE if the base stream will be closed.

close_base :

-TRUE to close the base stream. +TRUE to close the base stream.

Returns :

a GIOModule from given filename, -or NULL on error. +or NULL on error.

Returns :

a list of GIOModules loaded from the directory, + a list of GIOModules loaded + from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call - g_type_module_unuse() on all the modules. Free the list - with g_list_free(). + g_type_module_unuse() on all the modules. Free the list + with g_list_free(). [element-type GIOModule][transfer full GIOModule]
@@ -243,10 +244,9 @@ lazy loading. -

Returns :

A NULL-terminated array of strings, listing the supported + A NULL-terminated array of strings, listing the supported extension points of the module. The array must be suitable for - freeing with g_strfreev(). - + freeing with g_strfreev(). [transfer full]
@@ -256,6 +256,6 @@ lazy loading.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GIOStream.html b/docs/reference/gio/html/GIOStream.html index d083a74..a868346 100644 --- a/docs/reference/gio/html/GIOStream.html +++ b/docs/reference/gio/html/GIOStream.html @@ -3,12 +3,12 @@ GIOStream - + - + @@ -44,40 +44,51 @@
 #include <gio/gio.h>
 
+enum                GIOStreamSpliceFlags;
                     GIOStream;
 GInputStream *      g_io_stream_get_input_stream        (GIOStream *stream);
 GOutputStream *     g_io_stream_get_output_stream       (GIOStream *stream);
-gboolean            g_io_stream_close                   (GIOStream *stream,
+void                g_io_stream_splice_async            (GIOStream *stream1,
+                                                         GIOStream *stream2,
+                                                         GIOStreamSpliceFlags flags,
+                                                         int io_priority,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+gboolean            g_io_stream_splice_finish           (GAsyncResult *result,
+                                                         GError **error);
+gboolean            g_io_stream_close                   (GIOStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+                                                         GError **error);
 void                g_io_stream_close_async             (GIOStream *stream,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gboolean            g_io_stream_close_finish            (GIOStream *stream,
+                                                         gpointer user_data);
+gboolean            g_io_stream_close_finish            (GIOStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
-gboolean            g_io_stream_is_closed               (GIOStream *stream);
-gboolean            g_io_stream_has_pending             (GIOStream *stream);
-gboolean            g_io_stream_set_pending             (GIOStream *stream,
-                                                         GError **error);
+                                                         GError **error);
+gboolean            g_io_stream_is_closed               (GIOStream *stream);
+gboolean            g_io_stream_has_pending             (GIOStream *stream);
+gboolean            g_io_stream_set_pending             (GIOStream *stream,
+                                                         GError **error);
 void                g_io_stream_clear_pending           (GIOStream *stream);
 

Object Hierarchy

-  GObject
+  GObject
    +----GIOStream
          +----GFileIOStream
          +----GSocketConnection
+         +----GTlsConnection
 

Properties

-  "closed"                   gboolean              : Read / Write
+  "closed"                   gboolean              : Read / Write
   "input-stream"             GInputStream*         : Read
   "output-stream"            GOutputStream*        : Read
 
@@ -117,6 +128,49 @@ is actually shut down.

Details

+
+

enum GIOStreamSpliceFlags

+
typedef enum {
+  G_IO_STREAM_SPLICE_NONE          = 0,
+  G_IO_STREAM_SPLICE_CLOSE_STREAM1 = (1 << 0),
+  G_IO_STREAM_SPLICE_CLOSE_STREAM2 = (1 << 1),
+  G_IO_STREAM_SPLICE_WAIT_FOR_BOTH = (1 << 2)
+} GIOStreamSpliceFlags;
+
+

+GIOStreamSpliceFlags determine how streams should be spliced. +

+
++ + + + + + + + + + + + + + + + + + +

G_IO_STREAM_SPLICE_NONE

Do not close either stream. +

G_IO_STREAM_SPLICE_CLOSE_STREAM1

Close the first stream after + the splice. +

G_IO_STREAM_SPLICE_CLOSE_STREAM2

Close the second stream after + the splice. +

G_IO_STREAM_SPLICE_WAIT_FOR_BOTH

Wait for both splice operations to finish + before calling the callback. +
+

Since 2.28

+
+

GIOStream

typedef struct _GIOStream GIOStream;
@@ -142,8 +196,8 @@ for reading.

Returns :

- a GInputStream, owned by the GIOStream. Do not free. - + a GInputStream, owned by the GIOStream. +Do not free. [transfer none] @@ -168,8 +222,8 @@ writing.

Returns :

- a GOutputStream, owned by the GIOStream. Do not free. - + a GOutputStream, owned by the GIOStream. +Do not free. [transfer none] @@ -177,11 +231,105 @@ writing.

Since 2.22


+
+

g_io_stream_splice_async ()

+
void                g_io_stream_splice_async            (GIOStream *stream1,
+                                                         GIOStream *stream2,
+                                                         GIOStreamSpliceFlags flags,
+                                                         int io_priority,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asyncronously splice the output stream of stream1 to the input stream of +stream2, and splice the output stream of stream2 to the input stream of +stream1. +

+

+When the operation is finished callback will be called. +You can then call g_io_stream_splice_finish() to get the +result of the operation. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream1 :

a GIOStream. +

stream2 :

a GIOStream. +

flags :

a set of GIOStreamSpliceFlags. +

io_priority :

the io priority of the request. +

cancellable :

optional GCancellable object, NULL to ignore. [allow-none] +

callback :

a GAsyncReadyCallback. [scope async] +

user_data :

user data passed to callback. [closure] +
+

Since 2.28

+
+
+
+

g_io_stream_splice_finish ()

+
gboolean            g_io_stream_splice_finish           (GAsyncResult *result,
+                                                         GError **error);
+

+Finishes an asynchronous io stream splice operation. +

+
++ + + + + + + + + + + + + + +

result :

a GAsyncResult. +

error :

a GError location to store the error occuring, or NULL to +ignore. +

Returns :

TRUE on success, FALSE otherwise. + +
+

Since 2.28

+
+

g_io_stream_close ()

-
gboolean            g_io_stream_close                   (GIOStream *stream,
+
gboolean            g_io_stream_close                   (GIOStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Closes the stream, releasing resources related to it. This will also closes the individual input and output streams, if they are not already @@ -234,17 +382,17 @@ individual input/output streams.

cancellable :

-optional GCancellable object, NULL to ignore + optional GCancellable object, NULL to ignore. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

- TRUE on success, FALSE on failure + TRUE on success, FALSE on failure @@ -259,7 +407,7 @@ individual input/output streams. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished callback will be @@ -289,17 +437,17 @@ classes. However, if you override one you must override all.

cancellable :

-optional cancellable object + optional cancellable object. [allow-none]

callback :

-callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

-the data to pass to callback function + the data to pass to callback function. [closure] @@ -309,9 +457,9 @@ classes. However, if you override one you must override all.

g_io_stream_close_finish ()

-
gboolean            g_io_stream_close_finish            (GIOStream *stream,
+
gboolean            g_io_stream_close_finish            (GIOStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Closes a stream.

@@ -330,13 +478,13 @@ Closes a stream.

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore

Returns :

- TRUE if stream was successfully closed, FALSE otherwise. + TRUE if stream was successfully closed, FALSE otherwise. @@ -347,7 +495,7 @@ Closes a stream.

g_io_stream_is_closed ()

-
gboolean            g_io_stream_is_closed               (GIOStream *stream);
+
gboolean            g_io_stream_is_closed               (GIOStream *stream);

Checks if a stream is closed.

@@ -361,7 +509,7 @@ Checks if a stream is closed.

Returns :

- TRUE if the stream is closed. + TRUE if the stream is closed. @@ -372,7 +520,7 @@ Checks if a stream is closed.

g_io_stream_has_pending ()

-
gboolean            g_io_stream_has_pending             (GIOStream *stream);
+
gboolean            g_io_stream_has_pending             (GIOStream *stream);

Checks if a stream has pending actions.

@@ -386,7 +534,7 @@ Checks if a stream has pending actions.

Returns :

- TRUE if stream has pending actions. + TRUE if stream has pending actions. @@ -397,11 +545,11 @@ Checks if a stream has pending actions.

g_io_stream_set_pending ()

-
gboolean            g_io_stream_set_pending             (GIOStream *stream,
-                                                         GError **error);
+
gboolean            g_io_stream_set_pending             (GIOStream *stream,
+                                                         GError **error);

Sets stream to have actions pending. If the pending flag is -already set or stream is closed, it will return FALSE and set +already set or stream is closed, it will return FALSE and set error.

@@ -414,13 +562,13 @@ already set or stream is closed, it will - - @@ -450,7 +598,7 @@ Clears the pending flag on stream.

Property Details

The "closed" property

-
  "closed"                   gboolean              : Read / Write
+
  "closed"                   gboolean              : Read / Write

Is the stream closed.

Default value: FALSE

@@ -474,6 +622,6 @@ Clears the pending flag on stream. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GIcon.html b/docs/reference/gio/html/GIcon.html index fc4b16d..3296021 100644 --- a/docs/reference/gio/html/GIcon.html +++ b/docs/reference/gio/html/GIcon.html @@ -3,12 +3,12 @@ GIcon - + - + @@ -50,12 +50,12 @@ GIcon; GIconIface; -guintg_icon_hash (gconstpointer icon); -gbooleang_icon_equal (GIcon *icon1, +guintg_icon_hash (gconstpointer icon); +gbooleang_icon_equal (GIcon *icon1, GIcon *icon2); -gchar * g_icon_to_string (GIcon *icon); -GIcon * g_icon_new_for_string (const gchar *str, - GError **error); +gchar * g_icon_to_string (GIcon *icon); +GIcon * g_icon_new_for_string (const gchar *str, + GError **error);
@@ -69,7 +69,7 @@

Prerequisites

GIcon requires - GObject.

+ GObject.

Known Derived Interfaces

@@ -107,7 +107,7 @@ For serializing a GIcon -implementations you need to ensure that each GType is registered +implementations you need to ensure that each GType is registered with the type system prior to calling g_icon_new_for_string().

@@ -149,7 +149,7 @@ examples of how to implement this interface. - + @@ -172,7 +172,7 @@ serialized (Since 2.20). - @@ -183,23 +183,26 @@ serialized (Since 2.20).

g_icon_hash ()

-
guint               g_icon_hash                         (gconstpointer icon);
+
guint               g_icon_hash                         (gconstpointer icon);

Gets a hash for an icon.

+

+Virtual: hash +

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore

Returns :

TRUE if pending was previously unset and is now set. + TRUE if pending was previously unset and is now set.

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.

from_tokens ()

Constructs a GIcon from tokens. Set the GError if +Constructs a GIcon from tokens. Set the GError if the tokens are malformed. Don't implement if the GIcon can't be serialized (Since 2.20).
- @@ -208,7 +211,7 @@ use in a

g_icon_equal ()

-
gboolean            g_icon_equal                        (GIcon *icon1,
+
gboolean            g_icon_equal                        (GIcon *icon1,
                                                          GIcon *icon2);

Checks if two icons are equal. @@ -228,7 +231,7 @@ Checks if two icons are equal.

- @@ -237,7 +240,7 @@ Checks if two icons are equal.

g_icon_to_string ()

-
gchar *             g_icon_to_string                    (GIcon *icon);
+
gchar *             g_icon_to_string                    (GIcon *icon);

Generates a textual representation of icon that can be used for serialization such as when passing icon to a different process or @@ -265,6 +268,9 @@ in the following two cases

+

+Virtual: to_tokens +

icon :

-gconstpointer to an icon object. +gconstpointer to an icon object.

Returns :

a guint containing a hash for the icon, suitable for -use in a GHashTable or similar data structure. + a guint containing a hash for the icon, suitable for +use in a GHashTable or similar data structure.

Returns :

TRUE if icon1 is equal to icon2. FALSE otherwise. + TRUE if icon1 is equal to icon2. FALSE otherwise.
@@ -275,8 +281,8 @@ in the following two cases - @@ -287,15 +293,15 @@ be serialized. Use

g_icon_new_for_string ()

-
GIcon *             g_icon_new_for_string               (const gchar *str,
-                                                         GError **error);
+
GIcon *             g_icon_new_for_string               (const gchar *str,
+                                                         GError **error);

Generate a GIcon instance from str. This function can fail if str is not valid - see g_icon_to_string() for discussion.

If your application or library provides one or more GIcon -implementations you need to ensure that each GType is registered +implementations you need to ensure that each GType is registered with the type system prior to calling g_icon_new_for_string().

Returns :

An allocated NUL-terminated UTF8 string or NULL if icon can't -be serialized. Use g_free() to free. + An allocated NUL-terminated UTF8 string or NULL if icon can't +be serialized. Use g_free() to free.
@@ -313,7 +319,7 @@ with the type system prior to calling Returns :

-
@@ -326,6 +332,6 @@ with the type system prior to calling
- Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GInetAddress.html b/docs/reference/gio/html/GInetAddress.html index 5d7b0c1..831cbf8 100644 --- a/docs/reference/gio/html/GInetAddress.html +++ b/docs/reference/gio/html/GInetAddress.html @@ -3,12 +3,12 @@ GInetAddress - + - + - + @@ -42,49 +42,49 @@

Synopsis

                    GInetAddress;
-GInetAddress *      g_inet_address_new_from_string      (const gchar *string);
-GInetAddress *      g_inet_address_new_from_bytes       (const guint8 *bytes,
+GInetAddress *      g_inet_address_new_from_string      (const gchar *string);
+GInetAddress *      g_inet_address_new_from_bytes       (const guint8 *bytes,
                                                          GSocketFamily family);
 GInetAddress *      g_inet_address_new_any              (GSocketFamily family);
 GInetAddress *      g_inet_address_new_loopback         (GSocketFamily family);
-const guint8 *      g_inet_address_to_bytes             (GInetAddress *address);
-gsize               g_inet_address_get_native_size      (GInetAddress *address);
-gchar *             g_inet_address_to_string            (GInetAddress *address);
+const guint8 *      g_inet_address_to_bytes             (GInetAddress *address);
+gsize               g_inet_address_get_native_size      (GInetAddress *address);
+gchar *             g_inet_address_to_string            (GInetAddress *address);
 GSocketFamily       g_inet_address_get_family           (GInetAddress *address);
-gboolean            g_inet_address_get_is_any           (GInetAddress *address);
-gboolean            g_inet_address_get_is_loopback      (GInetAddress *address);
-gboolean            g_inet_address_get_is_link_local    (GInetAddress *address);
-gboolean            g_inet_address_get_is_site_local    (GInetAddress *address);
-gboolean            g_inet_address_get_is_multicast     (GInetAddress *address);
-gboolean            g_inet_address_get_is_mc_link_local (GInetAddress *address);
-gboolean            g_inet_address_get_is_mc_node_local (GInetAddress *address);
-gboolean            g_inet_address_get_is_mc_site_local (GInetAddress *address);
-gboolean            g_inet_address_get_is_mc_org_local  (GInetAddress *address);
-gboolean            g_inet_address_get_is_mc_global     (GInetAddress *address);
+gboolean            g_inet_address_get_is_any           (GInetAddress *address);
+gboolean            g_inet_address_get_is_loopback      (GInetAddress *address);
+gboolean            g_inet_address_get_is_link_local    (GInetAddress *address);
+gboolean            g_inet_address_get_is_site_local    (GInetAddress *address);
+gboolean            g_inet_address_get_is_multicast     (GInetAddress *address);
+gboolean            g_inet_address_get_is_mc_link_local (GInetAddress *address);
+gboolean            g_inet_address_get_is_mc_node_local (GInetAddress *address);
+gboolean            g_inet_address_get_is_mc_site_local (GInetAddress *address);
+gboolean            g_inet_address_get_is_mc_org_local  (GInetAddress *address);
+gboolean            g_inet_address_get_is_mc_global     (GInetAddress *address);
 

Object Hierarchy

-  GObject
+  GObject
    +----GInetAddress
 

Properties

-  "bytes"                    gpointer              : Read / Write / Construct Only
+  "bytes"                    gpointer              : Read / Write / Construct Only
   "family"                   GSocketFamily         : Read / Write / Construct Only
-  "is-any"                   gboolean              : Read
-  "is-link-local"            gboolean              : Read
-  "is-loopback"              gboolean              : Read
-  "is-mc-global"             gboolean              : Read
-  "is-mc-link-local"         gboolean              : Read
-  "is-mc-node-local"         gboolean              : Read
-  "is-mc-org-local"          gboolean              : Read
-  "is-mc-site-local"         gboolean              : Read
-  "is-multicast"             gboolean              : Read
-  "is-site-local"            gboolean              : Read
+  "is-any"                   gboolean              : Read
+  "is-link-local"            gboolean              : Read
+  "is-loopback"              gboolean              : Read
+  "is-mc-global"             gboolean              : Read
+  "is-mc-link-local"         gboolean              : Read
+  "is-mc-node-local"         gboolean              : Read
+  "is-mc-org-local"          gboolean              : Read
+  "is-mc-site-local"         gboolean              : Read
+  "is-multicast"             gboolean              : Read
+  "is-site-local"            gboolean              : Read
 
@@ -115,7 +115,7 @@ An IPv4 or IPv6 internet address.

g_inet_address_new_from_string ()

-
GInetAddress *      g_inet_address_new_from_string      (const gchar *string);
+
GInetAddress *      g_inet_address_new_from_string      (const gchar *string);

Parses string as an IP address and creates a new GInetAddress.

@@ -129,7 +129,7 @@ Parses string as an IP address and creat
- @@ -141,7 +141,7 @@ Parses string as an IP address and creat

g_inet_address_new_from_bytes ()

-
GInetAddress *      g_inet_address_new_from_bytes       (const guint8 *bytes,
+
GInetAddress *      g_inet_address_new_from_bytes       (const guint8 *bytes,
                                                          GSocketFamily family);

Creates a new GInetAddress from the given family and bytes. @@ -227,7 +227,7 @@ for family.


g_inet_address_to_bytes ()

-
const guint8 *      g_inet_address_to_bytes             (GInetAddress *address);
+
const guint8 *      g_inet_address_to_bytes             (GInetAddress *address);

Gets the raw binary address data from address.

@@ -254,7 +254,7 @@ array can be gotten with

g_inet_address_get_native_size ()

-
gsize               g_inet_address_get_native_size      (GInetAddress *address);
+
gsize               g_inet_address_get_native_size      (GInetAddress *address);

Gets the size of the native raw binary address for address. This is the size of the data that you get from g_inet_address_to_bytes(). @@ -280,7 +280,7 @@ is the size of the data that you get from

g_inet_address_to_string ()

-
gchar *             g_inet_address_to_string            (GInetAddress *address);
+
gchar *             g_inet_address_to_string            (GInetAddress *address);

Converts address to string form.

@@ -331,7 +331,7 @@ Gets address's family

g_inet_address_get_is_any ()

-
gboolean            g_inet_address_get_is_any           (GInetAddress *address);
+
gboolean            g_inet_address_get_is_any           (GInetAddress *address);

Tests whether address is the "any" address for its family.

@@ -345,7 +345,7 @@ Tests whether address is the "any" addre
- @@ -356,7 +356,7 @@ Tests whether address is the "any" addre

g_inet_address_get_is_loopback ()

-
gboolean            g_inet_address_get_is_loopback      (GInetAddress *address);
+
gboolean            g_inet_address_get_is_loopback      (GInetAddress *address);

Tests whether address is the loopback address for its family.

@@ -370,7 +370,7 @@ Tests whether address is the loopback ad
- @@ -381,7 +381,7 @@ Tests whether address is the loopback ad

g_inet_address_get_is_link_local ()

-
gboolean            g_inet_address_get_is_link_local    (GInetAddress *address);
+
gboolean            g_inet_address_get_is_link_local    (GInetAddress *address);

Tests whether address is a link-local address (that is, if it identifies a host on a local network that is not connected to the @@ -397,7 +397,7 @@ Internet).

- @@ -408,7 +408,7 @@ Internet).

g_inet_address_get_is_site_local ()

-
gboolean            g_inet_address_get_is_site_local    (GInetAddress *address);
+
gboolean            g_inet_address_get_is_site_local    (GInetAddress *address);

Tests whether address is a site-local address such as 10.0.0.1 (that is, the address identifies a host on a local network that can @@ -425,7 +425,7 @@ outgoing Internet connectivity via a NAT or firewall).

- @@ -436,7 +436,7 @@ outgoing Internet connectivity via a NAT or firewall).

g_inet_address_get_is_multicast ()

-
gboolean            g_inet_address_get_is_multicast     (GInetAddress *address);
+
gboolean            g_inet_address_get_is_multicast     (GInetAddress *address);

Tests whether address is a multicast address.

@@ -450,7 +450,7 @@ Tests whether address is a multicast add
- @@ -461,7 +461,7 @@ Tests whether address is a multicast add

g_inet_address_get_is_mc_link_local ()

-
gboolean            g_inet_address_get_is_mc_link_local (GInetAddress *address);
+
gboolean            g_inet_address_get_is_mc_link_local (GInetAddress *address);

Tests whether address is a link-local multicast address.

@@ -475,7 +475,7 @@ Tests whether address is a link-local mu
- @@ -486,7 +486,7 @@ Tests whether address is a link-local mu

g_inet_address_get_is_mc_node_local ()

-
gboolean            g_inet_address_get_is_mc_node_local (GInetAddress *address);
+
gboolean            g_inet_address_get_is_mc_node_local (GInetAddress *address);

Tests whether address is a node-local multicast address.

@@ -500,7 +500,7 @@ Tests whether address is a node-local mu
- @@ -511,7 +511,7 @@ Tests whether address is a node-local mu

g_inet_address_get_is_mc_site_local ()

-
gboolean            g_inet_address_get_is_mc_site_local (GInetAddress *address);
+
gboolean            g_inet_address_get_is_mc_site_local (GInetAddress *address);

Tests whether address is a site-local multicast address.

@@ -525,7 +525,7 @@ Tests whether address is a site-local mu
- @@ -536,7 +536,7 @@ Tests whether address is a site-local mu

g_inet_address_get_is_mc_org_local ()

-
gboolean            g_inet_address_get_is_mc_org_local  (GInetAddress *address);
+
gboolean            g_inet_address_get_is_mc_org_local  (GInetAddress *address);

Tests whether address is an organization-local multicast address.

@@ -550,7 +550,7 @@ Tests whether address is an organization
- @@ -561,7 +561,7 @@ Tests whether address is an organization

g_inet_address_get_is_mc_global ()

-
gboolean            g_inet_address_get_is_mc_global     (GInetAddress *address);
+
gboolean            g_inet_address_get_is_mc_global     (GInetAddress *address);

Tests whether address is a global multicast address.

@@ -575,7 +575,7 @@ Tests whether address is a global multic
- @@ -588,7 +588,7 @@ Tests whether address is a global multic

Property Details

The "bytes" property

-
  "bytes"                    gpointer              : Read / Write / Construct Only
+
  "bytes"                    gpointer              : Read / Write / Construct Only

The raw address data.


@@ -601,7 +601,7 @@ Tests whether address is a global multic

The "is-any" property

-
  "is-any"                   gboolean              : Read
+
  "is-any"                   gboolean              : Read

Whether this is the "any" address for its family. See g_inet_address_get_is_any(). @@ -612,7 +612,7 @@ See

The "is-link-local" property

-
  "is-link-local"            gboolean              : Read
+
  "is-link-local"            gboolean              : Read

Whether this is a link-local address. See g_inet_address_get_is_link_local(). @@ -623,7 +623,7 @@ See

The "is-loopback" property

-
  "is-loopback"              gboolean              : Read
+
  "is-loopback"              gboolean              : Read

Whether this is the loopback address for its family. See g_inet_address_get_is_loopback(). @@ -634,7 +634,7 @@ See

The "is-mc-global" property

-
  "is-mc-global"             gboolean              : Read
+
  "is-mc-global"             gboolean              : Read

Whether this is a global multicast address. See g_inet_address_get_is_mc_global(). @@ -645,7 +645,7 @@ See

The "is-mc-link-local" property

-
  "is-mc-link-local"         gboolean              : Read
+
  "is-mc-link-local"         gboolean              : Read

Whether this is a link-local multicast address. See g_inet_address_get_is_mc_link_local(). @@ -656,7 +656,7 @@ See

The "is-mc-node-local" property

-
  "is-mc-node-local"         gboolean              : Read
+
  "is-mc-node-local"         gboolean              : Read

Whether this is a node-local multicast address. See g_inet_address_get_is_mc_node_local(). @@ -667,7 +667,7 @@ See

The "is-mc-org-local" property

-
  "is-mc-org-local"          gboolean              : Read
+
  "is-mc-org-local"          gboolean              : Read

Whether this is an organization-local multicast address. See g_inet_address_get_is_mc_org_local(). @@ -678,7 +678,7 @@ See

The "is-mc-site-local" property

-
  "is-mc-site-local"         gboolean              : Read
+
  "is-mc-site-local"         gboolean              : Read

Whether this is a site-local multicast address. See g_inet_address_get_is_mc_site_local(). @@ -689,7 +689,7 @@ See

Object Hierarchy

-  GObject
+  GObject
    +----GSocketAddress
          +----GInetSocketAddress
+               +----GProxyAddress
 
@@ -68,7 +69,7 @@ GInetSocketAddress implements

Properties

   "address"                  GInetAddress*         : Read / Write / Construct Only
-  "port"                     guint                 : Read / Write / Construct Only
+  "port"                     guint                 : Read / Write / Construct Only
 
@@ -92,7 +93,7 @@ sockaddr_in or struct sockaddr_in6.

g_inet_socket_address_new ()

GSocketAddress *    g_inet_socket_address_new           (GInetAddress *address,
-                                                         guint16 port);
+ guint16 port);

Creates a new GInetSocketAddress for address and port.

@@ -137,8 +138,7 @@ Gets address's Returns :

@@ -148,7 +148,7 @@ Gets address's

g_inet_socket_address_get_port ()

-
guint16             g_inet_socket_address_get_port      (GInetSocketAddress *address);
+
guint16             g_inet_socket_address_get_port      (GInetSocketAddress *address);

Gets address's port.

@@ -181,7 +181,7 @@ Gets address's port.

The "port" property

-
  "port"                     guint                 : Read / Write / Construct Only
+
  "port"                     guint                 : Read / Write / Construct Only

The port.

Allowed values: <= 65535

Default value: 0

@@ -190,6 +190,6 @@ Gets address's port.
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GInitable.html b/docs/reference/gio/html/GInitable.html index 13ae1dd..0a487ac 100644 --- a/docs/reference/gio/html/GInitable.html +++ b/docs/reference/gio/html/GInitable.html @@ -3,12 +3,12 @@ GInitable - + - + @@ -48,24 +48,24 @@ GInitable; GInitableIface; -gbooleang_initable_init (GInitable *initable, +gbooleang_initable_init (GInitable *initable, GCancellable *cancellable, - GError **error); -gpointerg_initable_new (GType object_type, + GError **error); +gpointerg_initable_new (GType object_type, GCancellable *cancellable, - GError **error, - const gchar *first_property_name, + GError **error, + const gchar *first_property_name, ...); -GObject* g_initable_new_valist (GType object_type, - const gchar *first_property_name, +GObject* g_initable_new_valist (GType object_type, + const gchar *first_property_name, va_list var_args, GCancellable *cancellable, - GError **error); -gpointerg_initable_newv (GType object_type, - guint n_parameters, - GParameter *parameters, + GError **error); +gpointerg_initable_newv (GType object_type, + guint n_parameters, + GParameter *parameters, GCancellable *cancellable, - GError **error); + GError **error);
@@ -79,13 +79,13 @@

Prerequisites

GInitable requires - GObject.

+ GObject.

Known Implementations

GInitable is implemented by - GCharsetConverter and GSocket.

+ GCharsetConverter, GDBusConnection, GDBusProxy, GDBusServer and GSocket.

Description

@@ -102,8 +102,8 @@ Users of objects implementing this are not intended to use the interface method directly, instead it will be used automatically in various ways. For C applications you generally just call g_initable_new() directly, or indirectly via a foo_thing_new() wrapper. -This will call g_initable_init() under the cover, returning NULL and -setting a GError on failure. +This will call g_initable_init() under the cover, returning NULL and +setting a GError on failure.

For bindings in languages where the native constructor supports @@ -143,7 +143,7 @@ may fail.

- + @@ -159,18 +159,18 @@ may fail.

g_initable_init ()

-
gboolean            g_initable_init                     (GInitable *initable,
+
gboolean            g_initable_init                     (GInitable *initable,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Initializes the object implementing the interface. This must be done before any real use of the object after initial construction.

-Implementations may also support cancellation. If cancellable is not NULL, +Implementations may also support cancellation. If cancellable is not NULL, then initialization can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error -G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL and +G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL and the object doesn't support cancellable initialization the error G_IO_ERROR_NOT_SUPPORTED will be returned.

@@ -196,19 +196,19 @@ pattern in the GObject constructor function.
- - - @@ -219,51 +219,50 @@ ignore.

g_initable_new ()

-
gpointer            g_initable_new                      (GType object_type,
+
gpointer            g_initable_new                      (GType object_type,
                                                          GCancellable *cancellable,
-                                                         GError **error,
-                                                         const gchar *first_property_name,
+                                                         GError **error,
+                                                         const gchar *first_property_name,
                                                          ...);

Helper function for constructing GInitiable object. This is -similar to g_object_new() but also initializes the object -and returns NULL, setting an error on failure. +similar to g_object_new() but also initializes the object +and returns NULL, setting an error on failure.

An object implementing the GIcon interface or NULL if + An object implementing the GIcon interface or NULL if error is set.

Returns :

a new GInetAddress corresponding to string, or NULL if + a new GInetAddress corresponding to string, or NULL if string could not be parsed.

Returns :

TRUE if address is the "any" address for its family. + TRUE if address is the "any" address for its family.

Returns :

TRUE if address is the loopback address for its family. + TRUE if address is the loopback address for its family.

Returns :

TRUE if address is a link-local address. + TRUE if address is a link-local address.

Returns :

TRUE if address is a site-local address. + TRUE if address is a site-local address.

Returns :

TRUE if address is a multicast address. + TRUE if address is a multicast address.

Returns :

TRUE if address is a link-local multicast address. + TRUE if address is a link-local multicast address.

Returns :

TRUE if address is a node-local multicast address. + TRUE if address is a node-local multicast address.

Returns :

TRUE if address is a site-local multicast address. + TRUE if address is a site-local multicast address.

Returns :

TRUE if address is an organization-local multicast address. + TRUE if address is an organization-local multicast address.

Returns :

TRUE if address is a global multicast address. + TRUE if address is a global multicast address.
the GInetAddress for address, which must be -g_object_ref()'d if it will be stored - +g_object_ref()'d if it will be stored. [transfer full]

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if successful. If an error has occurred, this function will - return FALSE and set error appropriately if present. + TRUE if successful. If an error has occurred, this function will + return FALSE and set error appropriately if present.
- - - - - @@ -273,28 +272,28 @@ and returns

g_initable_new_valist ()

-
GObject*            g_initable_new_valist               (GType object_type,
-                                                         const gchar *first_property_name,
+
GObject*            g_initable_new_valist               (GType object_type,
+                                                         const gchar *first_property_name,
                                                          va_list var_args,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Helper function for constructing GInitiable object. This is -similar to g_object_new_valist() but also initializes the object -and returns NULL, setting an error on failure. +similar to g_object_new_valist() but also initializes the object +and returns NULL, setting an error on failure.

object_type :

a GType supporting GInitable. +a GType supporting GInitable.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

first_property_name :

the name of the first property, or NULL if no +the name of the first property, or NULL if no properties

... :

the value if the first property, followed by and other property - value pairs, and ended by NULL. + value pairs, and ended by NULL.

Returns :

a newly allocated GObject, or NULL on error - + a newly allocated GObject, or NULL on error. [transfer full]
- @@ -304,19 +303,18 @@ the value, and other property value pairs, and ended by cancellable :

-
- - @@ -326,22 +324,22 @@ the value, and other property value pairs, and ended by

g_initable_newv ()

-
gpointer            g_initable_newv                     (GType object_type,
-                                                         guint n_parameters,
-                                                         GParameter *parameters,
+
gpointer            g_initable_newv                     (GType object_type,
+                                                         guint n_parameters,
+                                                         GParameter *parameters,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Helper function for constructing GInitiable object. This is -similar to g_object_newv() but also initializes the object -and returns NULL, setting an error on failure. +similar to g_object_newv() but also initializes the object +and returns NULL, setting an error on failure.

object_type :

a GType supporting GInitable. +a GType supporting GInitable.

first_property_name :

the name of the first property, followed by -the value, and other property value pairs, and ended by NULL. +the value, and other property value pairs, and ended by NULL.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a newly allocated GObject, or NULL on error - + a newly allocated GObject, or NULL on error. [transfer full]
- @@ -356,19 +354,18 @@ and returns cancellable :

-
- - @@ -383,6 +380,6 @@ and returns
- Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GInputStream.html b/docs/reference/gio/html/GInputStream.html index c7f775f..647afc9 100644 --- a/docs/reference/gio/html/GInputStream.html +++ b/docs/reference/gio/html/GInputStream.html @@ -3,12 +3,12 @@ GInputStream - + - + @@ -26,6 +26,8 @@
Description  |  Object Hierarchy +  |  + Known Derived Interfaces

object_type :

a GType supporting GInitable. +a GType supporting GInitable.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a newly allocated GObject, or NULL on error - + a newly allocated GObject, or NULL on error. [transfer full]
@@ -43,62 +45,62 @@ #include <gio/gio.h> GInputStream; -gssize g_input_stream_read (GInputStream *stream, +gssize g_input_stream_read (GInputStream *stream, void *buffer, - gsize count, + gsize count, GCancellable *cancellable, - GError **error); -gboolean g_input_stream_read_all (GInputStream *stream, + GError **error); +gboolean g_input_stream_read_all (GInputStream *stream, void *buffer, - gsize count, - gsize *bytes_read, + gsize count, + gsize *bytes_read, GCancellable *cancellable, - GError **error); -gssize g_input_stream_skip (GInputStream *stream, - gsize count, + GError **error); +gssize g_input_stream_skip (GInputStream *stream, + gsize count, GCancellable *cancellable, - GError **error); -gboolean g_input_stream_close (GInputStream *stream, + GError **error); +gboolean g_input_stream_close (GInputStream *stream, GCancellable *cancellable, - GError **error); + GError **error); void g_input_stream_read_async (GInputStream *stream, void *buffer, - gsize count, + gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gssize g_input_stream_read_finish (GInputStream *stream, + gpointer user_data); +gssize g_input_stream_read_finish (GInputStream *stream, GAsyncResult *result, - GError **error); + GError **error); void g_input_stream_skip_async (GInputStream *stream, - gsize count, + gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gssize g_input_stream_skip_finish (GInputStream *stream, + gpointer user_data); +gssize g_input_stream_skip_finish (GInputStream *stream, GAsyncResult *result, - GError **error); + GError **error); void g_input_stream_close_async (GInputStream *stream, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_input_stream_close_finish (GInputStream *stream, + gpointer user_data); +gboolean g_input_stream_close_finish (GInputStream *stream, GAsyncResult *result, - GError **error); -gboolean g_input_stream_is_closed (GInputStream *stream); -gboolean g_input_stream_has_pending (GInputStream *stream); -gboolean g_input_stream_set_pending (GInputStream *stream, - GError **error); + GError **error); +gboolean g_input_stream_is_closed (GInputStream *stream); +gboolean g_input_stream_has_pending (GInputStream *stream); +gboolean g_input_stream_set_pending (GInputStream *stream, + GError **error); void g_input_stream_clear_pending (GInputStream *stream);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GFilterInputStream
          +----GFileInputStream
@@ -106,6 +108,12 @@
          +----GUnixInputStream
 
+
+

Known Derived Interfaces

+

+GInputStream is required by + GPollableInputStream.

+

Description

@@ -133,18 +141,18 @@ Base class for streaming input operations.


g_input_stream_read ()

-
gssize              g_input_stream_read                 (GInputStream *stream,
+
gssize              g_input_stream_read                 (GInputStream *stream,
                                                          void *buffer,
-                                                         gsize count,
+                                                         gsize count,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to read count bytes from the stream into the buffer starting at buffer. Will block during this read.

If count is zero returns zero and does nothing. A value of count -larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. +larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error.

On success, the number of bytes read into the buffer is returned. @@ -182,12 +190,12 @@ On error -1 is returned and error is set

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore @@ -201,12 +209,12 @@ On error -1 is returned and error is set

g_input_stream_read_all ()

-
gboolean            g_input_stream_read_all             (GInputStream *stream,
+
gboolean            g_input_stream_read_all             (GInputStream *stream,
                                                          void *buffer,
-                                                         gsize count,
-                                                         gsize *bytes_read,
+                                                         gsize count,
+                                                         gsize *bytes_read,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to read count bytes from the stream into the buffer starting at buffer. Will block during this read. @@ -217,11 +225,11 @@ read as many bytes as requested, only stopping on an error or end of stream.

On a successful read of count bytes, or if we reached the end of the -stream, TRUE is returned, and bytes_read is set to the number of bytes +stream, TRUE is returned, and bytes_read is set to the number of bytes read into buffer.

-If there is an error during the operation FALSE is returned and error +If there is an error during the operation FALSE is returned and error is set to indicate the error status, bytes_read is updated to contain the number of bytes read into buffer before the error occurred.

@@ -245,22 +253,22 @@ the number of bytes read into buffer bef

bytes_read :

-location to store the number of bytes that was read from the stream + location to store the number of bytes that was read from the stream. [out]

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

- TRUE on success, FALSE if there was an error + TRUE on success, FALSE if there was an error @@ -269,10 +277,10 @@ the number of bytes read into buffer bef

g_input_stream_skip ()

-
gssize              g_input_stream_skip                 (GInputStream *stream,
-                                                         gsize count,
+
gssize              g_input_stream_skip                 (GInputStream *stream,
+                                                         gsize count,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to skip count bytes from the stream. Will block during the operation.

@@ -286,7 +294,7 @@ This function is optional for inherited classes, as the default implementation emulates it using read.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the @@ -307,12 +315,12 @@ partial result will be returned, without an error.

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore @@ -326,9 +334,9 @@ partial result will be returned, without an error.

g_input_stream_close ()

-
gboolean            g_input_stream_close                (GInputStream *stream,
+
gboolean            g_input_stream_close                (GInputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Closes the stream, releasing resources related to it.

@@ -369,17 +377,17 @@ can use a faster close that doesn't block to e.g. check errors.

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

- TRUE on success, FALSE on failure + TRUE on success, FALSE on failure @@ -390,11 +398,11 @@ can use a faster close that doesn't block to e.g. check errors.

g_input_stream_read_async ()

void                g_input_stream_read_async           (GInputStream *stream,
                                                          void *buffer,
-                                                         gsize count,
+                                                         gsize count,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Request an asynchronous read of count bytes from the stream into the buffer starting at buffer. When the operation is finished callback will be called. @@ -406,7 +414,7 @@ During an async request no other sync and async calls are allowed on G_IO_ERROR_PENDING errors.

-A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. +A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error.

On success, the number of bytes read into the buffer will be passed to the @@ -418,7 +426,7 @@ as many bytes as requested. Zero is returned on end of file

Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default -priority is G_PRIORITY_DEFAULT. +priority is G_PRIORITY_DEFAULT.

The asyncronous methods have a default fallback that uses threads to implement @@ -451,17 +459,17 @@ of the request.

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

-callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

-the data to pass to callback function + the data to pass to callback function. [closure] @@ -470,9 +478,9 @@ of the request.

g_input_stream_read_finish ()

-
gssize              g_input_stream_read_finish          (GInputStream *stream,
+
gssize              g_input_stream_read_finish          (GInputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous stream read operation.

@@ -491,7 +499,7 @@ Finishes an asynchronous stream read operation.

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore. @@ -507,40 +515,40 @@ ignore.

g_input_stream_skip_async ()

void                g_input_stream_skip_async           (GInputStream *stream,
-                                                         gsize count,
+                                                         gsize count,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Request an asynchronous skip of count bytes from the stream. -When the operation is finished callback will be called. -You can then call g_input_stream_skip_finish() to get the result of the -operation. +When the operation is finished callback will be called. +You can then call g_input_stream_skip_finish() to get the result +of the operation.

-During an async request no other sync and async calls are allowed, and will -result in G_IO_ERROR_PENDING errors. +During an async request no other sync and async calls are allowed, +and will result in G_IO_ERROR_PENDING errors.

-A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. +A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error.

-On success, the number of bytes skipped will be passed to the -callback. It is not an error if this is not the same as the requested size, as it +On success, the number of bytes skipped will be passed to the callback. +It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file, but generally we try to skip as many bytes as requested. Zero is returned on end of file (or if count is zero), but never otherwise.

-Any outstanding i/o request with higher priority (lower numerical value) will -be executed before an outstanding request with lower priority. Default -priority is G_PRIORITY_DEFAULT. +Any outstanding i/o request with higher priority (lower numerical value) +will be executed before an outstanding request with lower priority. +Default priority is G_PRIORITY_DEFAULT.

-The asyncronous methods have a default fallback that uses threads to implement -asynchronicity, so they are optional for inheriting classes. However, if you -override one you must override all. +The asynchronous methods have a default fallback that uses threads to +implement asynchronicity, so they are optional for inheriting classes. +However, if you override one, you must override all.

@@ -557,23 +565,23 @@ override one you must override all. - - - - @@ -582,9 +590,9 @@ of the request.

g_input_stream_skip_finish ()

-
gssize              g_input_stream_skip_finish          (GInputStream *stream,
+
gssize              g_input_stream_skip_finish          (GInputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes a stream skip operation.

@@ -603,7 +611,7 @@ Finishes a stream skip operation.
- @@ -622,7 +630,7 @@ ignore. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Requests an asynchronous closes of the stream, releasing resources related to it. When the operation is finished callback will be called. @@ -653,17 +661,17 @@ of the request.

- - - @@ -672,9 +680,9 @@ of the request.

g_input_stream_close_finish ()

-
gboolean            g_input_stream_close_finish         (GInputStream *stream,
+
gboolean            g_input_stream_close_finish         (GInputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes closing a stream asynchronously, started from g_input_stream_close_async().

@@ -693,13 +701,13 @@ Finishes closing a stream asynchronously, started from error :

-
- @@ -708,7 +716,7 @@ ignore.

g_input_stream_is_closed ()

-
gboolean            g_input_stream_is_closed            (GInputStream *stream);
+
gboolean            g_input_stream_is_closed            (GInputStream *stream);

Checks if an input stream is closed.

@@ -722,7 +730,7 @@ Checks if an input stream is closed.
- @@ -731,7 +739,7 @@ Checks if an input stream is closed.

g_input_stream_has_pending ()

-
gboolean            g_input_stream_has_pending          (GInputStream *stream);
+
gboolean            g_input_stream_has_pending          (GInputStream *stream);

Checks if an input stream has pending actions.

@@ -745,7 +753,7 @@ Checks if an input stream has pending actions.
- @@ -754,11 +762,11 @@ Checks if an input stream has pending actions.

g_input_stream_set_pending ()

-
gboolean            g_input_stream_set_pending          (GInputStream *stream,
-                                                         GError **error);
+
gboolean            g_input_stream_set_pending          (GInputStream *stream,
+                                                         GError **error);

Sets stream to have actions pending. If the pending flag is -already set or stream is closed, it will return FALSE and set +already set or stream is closed, it will return FALSE and set error.

io_priority :

the I/O priority -of the request. +the I/O priority +of the request.

cancellable :

optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

cancellable :

optional cancellable object + optional cancellable object. [allow-none]

callback :

callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

the data to pass to callback function + the data to pass to callback function. [closure]
a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the stream was closed successfully. + TRUE if the stream was closed successfully.

Returns :

TRUE if the stream is closed. + TRUE if the stream is closed.

Returns :

TRUE if stream has pending actions. + TRUE if stream has pending actions.
@@ -771,13 +779,13 @@ already set or stream is closed, it will - - @@ -803,6 +811,6 @@ Clears the pending flag on stream. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GLoadableIcon.html b/docs/reference/gio/html/GLoadableIcon.html index e4f6360..edc5011 100644 --- a/docs/reference/gio/html/GLoadableIcon.html +++ b/docs/reference/gio/html/GLoadableIcon.html @@ -3,12 +3,12 @@ GLoadableIcon - + - + @@ -52,16 +52,16 @@ int size, char **type, GCancellable *cancellable, - GError **error); + GError **error); voidg_loadable_icon_load_async (GLoadableIcon *icon, int size, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GInputStream * g_loadable_icon_load_finish (GLoadableIcon *icon, GAsyncResult *res, char **type, - GError **error); + GError **error);
@@ -75,7 +75,7 @@

Prerequisites

GLoadableIcon requires - GIcon and GObject.

+ GIcon and GObject.

Known Implementations

@@ -131,7 +131,7 @@ Interface for icons that can be loaded as a stream.
- + @@ -160,7 +160,7 @@ Interface for icons that can be loaded as a stream. int size, char **type, GCancellable *cancellable, - GError **error); + GError **error);

Loads a loadable icon. For the asynchronous version of this function, see g_loadable_icon_load_async(). @@ -180,23 +180,23 @@ see type :

- - - - @@ -209,7 +209,7 @@ ignore. int size, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Loads an icon asynchronously. To finish this function, see g_loadable_icon_load_finish(). For the synchronous, blocking @@ -230,7 +230,7 @@ version of this function, see cancellable :

- @@ -252,7 +252,7 @@ version of this function, see GInputStream * g_loadable_icon_load_finish (GLoadableIcon *icon, GAsyncResult *res, char **type, - GError **error); + GError **error);

Finishes an asynchronous icon load started in g_loadable_icon_load_async().

@@ -271,18 +271,18 @@ Finishes an asynchronous icon load started in type :

-
- - @@ -296,6 +296,6 @@ ignore. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GMemoryInputStream.html b/docs/reference/gio/html/GMemoryInputStream.html index ccb0cb3..78d8cc6 100644 --- a/docs/reference/gio/html/GMemoryInputStream.html +++ b/docs/reference/gio/html/GMemoryInputStream.html @@ -3,12 +3,12 @@ GMemoryInputStream - + - + @@ -47,18 +47,18 @@ GMemoryInputStream; GInputStream * g_memory_input_stream_new (void); GInputStream * g_memory_input_stream_new_from_data (const void *data, - gssize len, - GDestroyNotify destroy); + gssize len, + GDestroyNotify destroy); voidg_memory_input_stream_add_data (GMemoryInputStream *stream, const void *data, - gssize len, - GDestroyNotify destroy); + gssize len, + GDestroyNotify destroy);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GMemoryInputStream
 
@@ -105,8 +105,8 @@ Creates a new empty

g_memory_input_stream_new_from_data ()

GInputStream *      g_memory_input_stream_new_from_data (const void *data,
-                                                         gssize len,
-                                                         GDestroyNotify destroy);
+ gssize len, + GDestroyNotify destroy);

Creates a new GMemoryInputStream with data in memory of a given size.

@@ -125,7 +125,7 @@ Creates a new destroy :

-
@@ -141,8 +141,8 @@ Creates a new

g_memory_input_stream_add_data ()

void                g_memory_input_stream_add_data      (GMemoryInputStream *stream,
                                                          const void *data,
-                                                         gssize len,
-                                                         GDestroyNotify destroy);
+ gssize len, + GDestroyNotify destroy);

Appends data to data that can be read from the input stream

@@ -166,7 +166,7 @@ Appends data to data that can be read fr - @@ -180,6 +180,6 @@ Appends data to data that can be read fr + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GMemoryOutputStream.html b/docs/reference/gio/html/GMemoryOutputStream.html index 6e9d38a..48f45d9 100644 --- a/docs/reference/gio/html/GMemoryOutputStream.html +++ b/docs/reference/gio/html/GMemoryOutputStream.html @@ -3,12 +3,12 @@ GMemoryOutputStream - + - + @@ -46,23 +46,24 @@
 #include <gio/gio.h>
 
-gpointer            (*GReallocFunc)                     (gpointer data,
-                                                         gsize size);
+gpointer            (*GReallocFunc)                     (gpointer data,
+                                                         gsize size);
                     GMemoryOutputStream;
-GOutputStream *     g_memory_output_stream_new          (gpointer data,
-                                                         gsize size,
+GOutputStream *     g_memory_output_stream_new          (gpointer data,
+                                                         gsize size,
                                                          GReallocFunc realloc_function,
-                                                         GDestroyNotify destroy_function);
-gpointer            g_memory_output_stream_get_data     (GMemoryOutputStream *ostream);
-gsize               g_memory_output_stream_get_size     (GMemoryOutputStream *ostream);
-gsize               g_memory_output_stream_get_data_size
+                                                         GDestroyNotify destroy_function);
+gpointer            g_memory_output_stream_get_data     (GMemoryOutputStream *ostream);
+gsize               g_memory_output_stream_get_size     (GMemoryOutputStream *ostream);
+gsize               g_memory_output_stream_get_data_size
                                                         (GMemoryOutputStream *ostream);
+gpointer            g_memory_output_stream_steal_data   (GMemoryOutputStream *ostream);
 

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GMemoryOutputStream
 
@@ -76,11 +77,11 @@ GMemoryOutputStream implements

Properties

-  "data"                     gpointer              : Read / Write / Construct Only
-  "data-size"                gulong                : Read
-  "destroy-function"         gpointer              : Read / Write / Construct Only
-  "realloc-function"         gpointer              : Read / Write / Construct Only
-  "size"                     gulong                : Read / Write / Construct Only
+  "data"                     gpointer              : Read / Write / Construct Only
+  "data-size"                gulong                : Read
+  "destroy-function"         gpointer              : Read / Write / Construct Only
+  "realloc-function"         gpointer              : Read / Write / Construct Only
+  "size"                     gulong                : Read / Write / Construct Only
 
@@ -94,8 +95,8 @@ memory chunks as output for GIO streaming output operations.

Details

GReallocFunc ()

-
gpointer            (*GReallocFunc)                     (gpointer data,
-                                                         gsize size);
+
gpointer            (*GReallocFunc)                     (gpointer data,
+                                                         gsize size);

Changes the size of the memory block pointed to by data to size bytes. @@ -135,18 +136,18 @@ Implements

g_memory_output_stream_new ()

-
GOutputStream *     g_memory_output_stream_new          (gpointer data,
-                                                         gsize size,
+
GOutputStream *     g_memory_output_stream_new          (gpointer data,
+                                                         gsize size,
                                                          GReallocFunc realloc_function,
-                                                         GDestroyNotify destroy_function);
+ GDestroyNotify destroy_function);

Creates a new GMemoryOutputStream.

-If data is non-NULL, the stream will use that for its internal storage. -If realloc_fn is non-NULL, it will be used for resizing the internal +If data is non-NULL, the stream will use that for its internal storage. +If realloc_fn is non-NULL, it will be used for resizing the internal storage when necessary. To construct a fixed-size output stream, -pass NULL as realloc_fn. +pass NULL as realloc_fn.

@@ -164,14 +165,14 @@ pass 8 9
+stream3 = g_memory_output_stream_new (data, 200, NULL, free);

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if pending was previously unset and is now set. + TRUE if pending was previously unset and is now set.

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.
a location to store the type of the loaded icon, NULL to ignore. +a location to store the type of the loaded icon, NULL to ignore.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a GInputStream to read the icon from. + a GInputStream to read the icon from. [transfer full]
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
a location to store the type of the loaded icon, NULL to ignore. +a location to store the type of the loaded icon, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a GInputStream to read the icon from. + a GInputStream to read the icon from. [transfer full]
function that is called to free data, or NULL +function that is called to free data, or NULL

destroy :

function that is called to free data, or NULL +function that is called to free data, or NULL
/* a stream that can grow */
-stream = g_memory_output_stream_new (NULL, 0, realloc, free);
+stream = g_memory_output_stream_new (NULL, 0, realloc, free);
 
 /* another stream that can grow */
-stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
+stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
 
 /* a fixed-size stream */
 data = malloc (200);
-stream3 = g_memory_output_stream_new (data, 200, NULL, free);
@@ -184,7 +185,7 @@ pass

data :

-pointer to a chunk of memory to use, or
NULL +pointer to a chunk of memory to use, or NULL @@ -194,14 +195,14 @@ pass

realloc_function :

-a function with realloc() semantics (like
g_realloc()) - to be called when data needs to be grown, or NULL +a function with realloc() semantics (like g_realloc()) + to be called when data needs to be grown, or NULL

destroy_function :

a function to be called on data when the stream is - finalized, or NULL + finalized, or NULL @@ -215,7 +216,7 @@ pass

g_memory_output_stream_get_data ()

-
gpointer            g_memory_output_stream_get_data     (GMemoryOutputStream *ostream);
+
gpointer            g_memory_output_stream_get_data     (GMemoryOutputStream *ostream);

Gets any loaded data from the ostream.

@@ -242,7 +243,7 @@ write or truncate operation on the stream.

g_memory_output_stream_get_size ()

-
gsize               g_memory_output_stream_get_size     (GMemoryOutputStream *ostream);
+
gsize               g_memory_output_stream_get_size     (GMemoryOutputStream *ostream);

Gets the size of the currently allocated data area (availible from g_memory_output_stream_get_data()). If the stream isn't @@ -277,7 +278,7 @@ If you want the number of bytes currently written to the stream, use


g_memory_output_stream_get_data_size ()

-
gsize               g_memory_output_stream_get_data_size
+
gsize               g_memory_output_stream_get_data_size
                                                         (GMemoryOutputStream *ostream);

Returns the number of bytes from the start up @@ -302,12 +303,42 @@ that has not been truncated away.

Since 2.18

+
+
+

g_memory_output_stream_steal_data ()

+
gpointer            g_memory_output_stream_steal_data   (GMemoryOutputStream *ostream);
+

+Gets any loaded data from the ostream. Ownership of the data +is transferred to the caller; when no longer needed it must be +freed using the free function set in ostream's +"destroy-function" property. +

+

+ostream must be closed before calling this function. +

+
++ + + + + + + + + + +

ostream :

a GMemoryOutputStream +

Returns :

the stream's data. [transfer full] +
+

Since 2.26

+

Property Details

The "data" property

-
  "data"                     gpointer              : Read / Write / Construct Only
+
  "data"                     gpointer              : Read / Write / Construct Only

Pointer to buffer where data will be written.

@@ -316,7 +347,7 @@ Pointer to buffer where data will be written.

The "data-size" property

-
  "data-size"                gulong                : Read
+
  "data-size"                gulong                : Read

Size of data written to the buffer.

@@ -325,7 +356,7 @@ Size of data written to the buffer.

The "destroy-function" property

-
  "destroy-function"         gpointer              : Read / Write / Construct Only
+
  "destroy-function"         gpointer              : Read / Write / Construct Only

Function called with the buffer as argument when the stream is destroyed.

@@ -334,7 +365,7 @@ Function called with the buffer as argument when the stream is destroyed.

The "realloc-function" property

-
  "realloc-function"         gpointer              : Read / Write / Construct Only
+
  "realloc-function"         gpointer              : Read / Write / Construct Only

Function with realloc semantics called to enlarge the buffer.

@@ -343,7 +374,7 @@ Function with realloc semantics called to enlarge the buffer.

The "size" property

-
  "size"                     gulong                : Read / Write / Construct Only
+
  "size"                     gulong                : Read / Write / Construct Only

Current size of the data buffer.

@@ -357,6 +388,6 @@ Current size of the data buffer.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GMount.html b/docs/reference/gio/html/GMount.html index f4db8b2..d3742b3 100644 --- a/docs/reference/gio/html/GMount.html +++ b/docs/reference/gio/html/GMount.html @@ -3,12 +3,12 @@ GMount - + - + @@ -44,9 +44,7 @@

Synopsis

-#include <gio/gio.h
-@see also: GVolume>
-#include <GUnixMount>
+#include <gio/gio.h>
 
                     GMount;
                     GMountIface;
@@ -57,67 +55,67 @@
 GFile *             g_mount_get_root                    (GMount *mount);
 GVolume *           g_mount_get_volume                  (GMount *mount);
 GFile *             g_mount_get_default_location        (GMount *mount);
-gboolean            g_mount_can_unmount                 (GMount *mount);
+gboolean            g_mount_can_unmount                 (GMount *mount);
 enum                GMountMountFlags;
 enum                GMountUnmountFlags;
 void                g_mount_unmount                     (GMount *mount,
                                                          GMountUnmountFlags flags,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gboolean            g_mount_unmount_finish              (GMount *mount,
+                                                         gpointer user_data);
+gboolean            g_mount_unmount_finish              (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+                                                         GError **error);
 void                g_mount_unmount_with_operation      (GMount *mount,
                                                          GMountUnmountFlags flags,
                                                          GMountOperation *mount_operation,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gboolean            g_mount_unmount_with_operation_finish
+                                                         gpointer user_data);
+gboolean            g_mount_unmount_with_operation_finish
                                                         (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+                                                         GError **error);
 void                g_mount_remount                     (GMount *mount,
                                                          GMountMountFlags flags,
                                                          GMountOperation *mount_operation,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gboolean            g_mount_remount_finish              (GMount *mount,
+                                                         gpointer user_data);
+gboolean            g_mount_remount_finish              (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
-gboolean            g_mount_can_eject                   (GMount *mount);
+                                                         GError **error);
+gboolean            g_mount_can_eject                   (GMount *mount);
 void                g_mount_eject                       (GMount *mount,
                                                          GMountUnmountFlags flags,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gboolean            g_mount_eject_finish                (GMount *mount,
+                                                         gpointer user_data);
+gboolean            g_mount_eject_finish                (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+                                                         GError **error);
 void                g_mount_eject_with_operation        (GMount *mount,
                                                          GMountUnmountFlags flags,
                                                          GMountOperation *mount_operation,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gboolean            g_mount_eject_with_operation_finish (GMount *mount,
+                                                         gpointer user_data);
+gboolean            g_mount_eject_with_operation_finish (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+                                                         GError **error);
 void                g_mount_guess_content_type          (GMount *mount,
-                                                         gboolean force_rescan,
+                                                         gboolean force_rescan,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-gchar **            g_mount_guess_content_type_finish   (GMount *mount,
+                                                         gpointer user_data);
+gchar **            g_mount_guess_content_type_finish   (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
-gchar **            g_mount_guess_content_type_sync     (GMount *mount,
-                                                         gboolean force_rescan,
+                                                         GError **error);
+gchar **            g_mount_guess_content_type_sync     (GMount *mount,
+                                                         gboolean force_rescan,
                                                          GCancellable *cancellable,
-                                                         GError **error);
-gboolean            g_mount_is_shadowed                 (GMount *mount);
+                                                         GError **error);
+gboolean            g_mount_is_shadowed                 (GMount *mount);
 void                g_mount_shadow                      (GMount *mount);
 void                g_mount_unshadow                    (GMount *mount);
 
@@ -133,7 +131,7 @@ enum

Prerequisites

GMount requires - GObject.

+ GObject.

Signals

@@ -147,7 +145,7 @@ GMount requires

Description

The GMount interface represents user-visible mounts. Note, when -porting from GnomeVFS, GMount is the moral equivalent of GnomeVFSVolume. +porting from GnomeVFS, GMount is the moral equivalent of GnomeVFSVolume.

GMount is a "mounted" filesystem that you can access. Mounted is in @@ -273,7 +271,7 @@ Interface for implementing operations for mounts. -

GTypeInterface g_iface;

+

GTypeInterface g_iface;

The parent interface. @@ -304,17 +302,17 @@ Interface for implementing operations for mounts.

get_uuid ()

-Gets the UUID for the GMount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns NULL if there is no UUID available. +Gets the UUID for the GMount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns NULL if there is no UUID available.

get_volume ()

-Gets a GVolume the mount is located on. Returns NULL if the GMount is not associated with a GVolume. +Gets a GVolume the mount is located on. Returns NULL if the GMount is not associated with a GVolume.

get_drive ()

-Gets a GDrive the volume of the mount is located on. Returns NULL if the GMount is not associated with a GDrive or a GVolume. This is convenience method for getting the GVolume and using that to get the GDrive. +Gets a GDrive the volume of the mount is located on. Returns NULL if the GMount is not associated with a GDrive or a GVolume. This is convenience method for getting the GVolume and using that to get the GDrive. @@ -425,7 +423,7 @@ Gets the name of mount.

Returns :

the name for the given mount. - The returned string should be freed with g_free() + The returned string should be freed with g_free() when no longer needed. @@ -439,7 +437,7 @@ Gets the name of mount.

Gets the UUID for the mount. The reference is typically based on the file system UUID for the mount in question and should be -considered an opaque string. Returns NULL if there is no UUID +considered an opaque string. Returns NULL if there is no UUID available.

@@ -452,8 +450,8 @@ available. - @@ -479,7 +477,7 @@ Gets the icon for mount. @@ -506,9 +504,9 @@ using that object to get the < - @@ -533,7 +531,7 @@ Gets the root directory on mount. @@ -556,9 +554,9 @@ Gets the volume for the mount. - @@ -585,7 +583,7 @@ the home directory, or the root of the volume). @@ -594,7 +592,7 @@ the home directory, or the root of the volume).

g_mount_can_unmount ()

-
gboolean            g_mount_can_unmount                 (GMount *mount);
+
gboolean            g_mount_can_unmount                 (GMount *mount);

Checks if mount can be mounted.

@@ -608,7 +606,7 @@ Checks if mount can be mounted.
- @@ -668,7 +666,7 @@ Flags used when an unmounting a mount. GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Warning

g_mount_unmount has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_unmount_with_operation() instead.

@@ -693,12 +691,12 @@ and cancellable :

-
- @@ -712,16 +710,16 @@ and

g_mount_unmount_finish ()

-
gboolean            g_mount_unmount_finish              (GMount *mount,
+
gboolean            g_mount_unmount_finish              (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Warning

g_mount_unmount_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_unmount_with_operation_finish() instead.

Finishes unmounting a mount. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

Returns :

the UUID for mount or NULL if no UUID can be computed. - The returned string should be freed with g_free() + the UUID for mount or NULL if no UUID can be computed. + The returned string should be freed with g_free() when no longer needed.

Returns :

a GIcon. The returned object should be unreffed with - g_object_unref() when no longer needed. + g_object_unref() when no longer needed. [transfer full]

Returns :

a GDrive or NULL if mount is not associated with a volume or a drive. + a GDrive or NULL if mount is not associated with a volume or a drive. The returned object should be unreffed with - g_object_unref() when no longer needed. + g_object_unref() when no longer needed. [transfer full]

Returns :

a GFile. The returned object should be unreffed with - g_object_unref() when no longer needed. + g_object_unref() when no longer needed. [transfer full]

Returns :

a GVolume or NULL if mount is not associated with a volume. + a GVolume or NULL if mount is not associated with a volume. The returned object should be unreffed with - g_object_unref() when no longer needed. + g_object_unref() when no longer needed. [transfer full]

Returns :

a GFile. The returned object should be unreffed with - g_object_unref() when no longer needed. + g_object_unref() when no longer needed. [transfer full]

Returns :

TRUE if the mount can be unmounted. + TRUE if the mount can be unmounted.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -738,13 +736,13 @@ Finishes unmounting a mount. If any errors occurred during the operation, - - @@ -759,7 +757,7 @@ Finishes unmounting a mount. If any errors occurred during the operation, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_with_operation_finish() with the mount @@ -780,17 +778,17 @@ and mount_operation :

- - - @@ -805,13 +803,13 @@ and

g_mount_unmount_with_operation_finish ()

-
gboolean            g_mount_unmount_with_operation_finish
+
gboolean            g_mount_unmount_with_operation_finish
                                                         (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes unmounting a mount. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the mount was successfully unmounted. FALSE otherwise. + TRUE if the mount was successfully unmounted. FALSE otherwise.
a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -828,13 +826,13 @@ Finishes unmounting a mount. If any errors occurred during the operation, - - @@ -850,7 +848,7 @@ Finishes unmounting a mount. If any errors occurred during the operation, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Remounts a mount. This is an asynchronous operation, and is finished by calling g_mount_remount_finish() with the mount @@ -878,17 +876,17 @@ unmounted.

- - - @@ -902,12 +900,12 @@ unmounted.

g_mount_remount_finish ()

-
gboolean            g_mount_remount_finish              (GMount *mount,
+
gboolean            g_mount_remount_finish              (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes remounting a mount. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the mount was successfully unmounted. FALSE otherwise. + TRUE if the mount was successfully unmounted. FALSE otherwise.

mount_operation :

a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -924,13 +922,13 @@ Finishes remounting a mount. If any errors occurred during the operation, - - @@ -939,7 +937,7 @@ Finishes remounting a mount. If any errors occurred during the operation,

g_mount_can_eject ()

-
gboolean            g_mount_can_eject                   (GMount *mount);
+
gboolean            g_mount_can_eject                   (GMount *mount);

Checks if mount can be eject.

@@ -953,7 +951,7 @@ Checks if mount can be eject.
- @@ -966,7 +964,7 @@ Checks if mount can be eject. GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Warning

g_mount_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_eject_with_operation() instead.

@@ -991,12 +989,12 @@ and cancellable :

-
- @@ -1010,16 +1008,16 @@ and

g_mount_eject_finish ()

-
gboolean            g_mount_eject_finish                (GMount *mount,
+
gboolean            g_mount_eject_finish                (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Warning

g_mount_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_eject_with_operation_finish() instead.

Finishes ejecting a mount. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the mount was successfully remounted. FALSE otherwise. + TRUE if the mount was successfully remounted. FALSE otherwise.

Returns :

TRUE if the mount can be ejected. + TRUE if the mount can be ejected.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -1036,13 +1034,13 @@ Finishes ejecting a mount. If any errors occurred during the operation, - - @@ -1057,7 +1055,7 @@ Finishes ejecting a mount. If any errors occurred during the operation, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_with_operation_finish() with the mount @@ -1078,17 +1076,17 @@ and mount_operation :

- - - @@ -1103,12 +1101,12 @@ and

g_mount_eject_with_operation_finish ()

-
gboolean            g_mount_eject_with_operation_finish (GMount *mount,
+
gboolean            g_mount_eject_with_operation_finish (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes ejecting a mount. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the mount was successfully ejected. FALSE otherwise. + TRUE if the mount was successfully ejected. FALSE otherwise.
a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -1125,13 +1123,13 @@ Finishes ejecting a mount. If any errors occurred during the operation, - - @@ -1143,10 +1141,10 @@ Finishes ejecting a mount. If any errors occurred during the operation,

g_mount_guess_content_type ()

void                g_mount_guess_content_type          (GMount *mount,
-                                                         gboolean force_rescan,
+                                                         gboolean force_rescan,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically @@ -1176,7 +1174,7 @@ is finished by calling cancellable :

-
@@ -1196,13 +1194,13 @@ is finished by calling

g_mount_guess_content_type_finish ()

-
gchar **            g_mount_guess_content_type_finish   (GMount *mount,
+
gchar **            g_mount_guess_content_type_finish   (GMount *mount,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes guessing content types of mount. If any errors occured during the operation, error will be set to contain the errors and -FALSE will be returned. In particular, you may get an +FALSE will be returned. In particular, you may get an G_IO_ERROR_NOT_SUPPORTED if the mount does not support content guessing.

@@ -1221,15 +1219,14 @@ guessing. - - @@ -1239,10 +1236,10 @@ guessing.

g_mount_guess_content_type_sync ()

-
gchar **            g_mount_guess_content_type_sync     (GMount *mount,
-                                                         gboolean force_rescan,
+
gchar **            g_mount_guess_content_type_sync     (GMount *mount,
+                                                         gboolean force_rescan,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically @@ -1270,20 +1267,19 @@ see cancellable :

-
- - @@ -1293,7 +1289,7 @@ see

g_mount_is_shadowed ()

-
gboolean            g_mount_is_shadowed                 (GMount *mount);
+
gboolean            g_mount_is_shadowed                 (GMount *mount);

Determines if mount is shadowed. Applications or libraries should avoid displaying mount in the user interface if it is shadowed. @@ -1332,7 +1328,7 @@ activation root on a

- @@ -1386,7 +1382,7 @@ will need to emit the

The "changed" signal

void                user_function                      (GMount  *mount,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the mount has been changed.

@@ -1409,7 +1405,7 @@ Emitted when the mount has been changed.

The "pre-unmount" signal

void                user_function                      (GMount  *mount,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

This signal is emitted when the GMount is about to be unmounted. @@ -1434,7 +1430,7 @@ unmounted.

The "unmounted" signal

void                user_function                      (GMount  *mount,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

This signal is emitted when the GMount have been unmounted. If the recipient is holding references to the @@ -1457,9 +1453,13 @@ finalized.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the mount was successfully ejected. FALSE otherwise. + TRUE if the mount was successfully ejected. FALSE otherwise.
optional GCancellable object, NULL to ignore +optional GCancellable object, NULL to ignore

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore

Returns :

a NULL-terminated array of content types or NULL on error. - Caller should free this array with g_strfreev() when done with it. - + a NULL-terminated array of content types or NULL on error. + Caller should free this array with g_strfreev() when done with it. [transfer full][element-type utf8]
optional GCancellable object, NULL to ignore +optional GCancellable object, NULL to ignore

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore

Returns :

a NULL-terminated array of content types or NULL on error. - Caller should free this array with g_strfreev() when done with it. - + a NULL-terminated array of content types or NULL on error. + Caller should free this array with g_strfreev() when done with it. [transfer full][element-type utf8]

Returns :

TRUE if mount is shadowed. + TRUE if mount is shadowed.
+
+

See Also

+GVolume, GUnixMount +
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GMountOperation.html b/docs/reference/gio/html/GMountOperation.html index f703db7..c06fe56 100644 --- a/docs/reference/gio/html/GMountOperation.html +++ b/docs/reference/gio/html/GMountOperation.html @@ -3,12 +3,12 @@ GMountOperation - + - + @@ -57,9 +57,9 @@ const char * char * g_mount_operation_get_password (GMountOperation *op); void g_mount_operation_set_password (GMountOperation *op, const char *password); -gboolean g_mount_operation_get_anonymous (GMountOperation *op); +gboolean g_mount_operation_get_anonymous (GMountOperation *op); void g_mount_operation_set_anonymous (GMountOperation *op, - gboolean anonymous); + gboolean anonymous); const char * g_mount_operation_get_domain (GMountOperation *op); void g_mount_operation_set_domain (GMountOperation *op, const char *domain); @@ -76,19 +76,19 @@ const char *

Object Hierarchy

-  GObject
+  GObject
    +----GMountOperation
 

Properties

-  "anonymous"                gboolean              : Read / Write
-  "choice"                   gint                  : Read / Write
-  "domain"                   gchar*                : Read / Write
-  "password"                 gchar*                : Read / Write
+  "anonymous"                gboolean              : Read / Write
+  "choice"                   gint                  : Read / Write
+  "domain"                   gchar*                : Read / Write
+  "password"                 gchar*                : Read / Write
   "password-save"            GPasswordSave         : Read / Write
-  "username"                 gchar*                : Read / Write
+  "username"                 gchar*                : Read / Write
 
@@ -118,8 +118,8 @@ objects – for example it is also used in GtkMountOperation. If no user interaction is desired (for example -when automounting filesystems at login time), usually NULL can be +GtkMountOperation. If no user interaction is desired (for example +when automounting filesystems at login time), usually NULL can be passed, see each method taking a GMountOperation for details.

@@ -367,7 +367,7 @@ Sets the mount operation's password to password

g_mount_operation_get_anonymous ()

-
gboolean            g_mount_operation_get_anonymous     (GMountOperation *op);
+
gboolean            g_mount_operation_get_anonymous     (GMountOperation *op);

Check to see whether the mount operation is being used for an anonymous user. @@ -382,7 +382,7 @@ for an anonymous user.

Returns :

- TRUE if mount operation is anonymous. + TRUE if mount operation is anonymous. @@ -392,9 +392,9 @@ for an anonymous user.

g_mount_operation_set_anonymous ()

void                g_mount_operation_set_anonymous     (GMountOperation *op,
-                                                         gboolean anonymous);
+ gboolean anonymous);

-Sets the mount operation to use an anonymous user if anonymous is TRUE. +Sets the mount operation to use an anonymous user if anonymous is TRUE.

@@ -583,7 +583,7 @@ Emits the

Property Details

The "anonymous" property

-
  "anonymous"                gboolean              : Read / Write
+
  "anonymous"                gboolean              : Read / Write

Whether to use an anonymous user when authenticating.

@@ -592,7 +592,7 @@ Whether to use an anonymous user when authenticating.

The "choice" property

-
  "choice"                   gint                  : Read / Write
+
  "choice"                   gint                  : Read / Write

The index of the user's choice when a question is asked during the mount operation. See the "ask-question" signal. @@ -603,7 +603,7 @@ mount operation. See the

The "domain" property

-
  "domain"                   gchar*                : Read / Write
+
  "domain"                   gchar*                : Read / Write

The domain to use for the mount operation.

@@ -612,7 +612,7 @@ The domain to use for the mount operation.

The "password" property

-
  "password"                 gchar*                : Read / Write
+
  "password"                 gchar*                : Read / Write

The password that is used for authentication when carrying out the mount operation. @@ -631,7 +631,7 @@ Determines if and how the password information should be saved.


The "username" property

-
  "username"                 gchar*                : Read / Write
+
  "username"                 gchar*                : Read / Write

The user name that is used for authentication when carrying out the mount operation. @@ -644,7 +644,7 @@ the mount operation.

The "aborted" signal

void                user_function                      (GMountOperation *arg0,
-                                                        gpointer         user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress. @@ -666,18 +666,18 @@ by dismissing open password dialogs.

The "ask-password" signal

void                user_function                      (GMountOperation  *op,
-                                                        gchar            *message,
-                                                        gchar            *default_user,
-                                                        gchar            *default_domain,
+                                                        gchar            *message,
+                                                        gchar            *default_user,
+                                                        gchar            *default_domain,
                                                         GAskPasswordFlags flags,
-                                                        gpointer          user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mount operation asks the user for a password.

If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the -primary text in a GtkMessageDialog. +primary text in a GtkMessageDialog.

@@ -718,9 +718,9 @@ primary text in a GtkMessageDialog.

The "ask-question" signal

void                user_function                      (GMountOperation *op,
-                                                        gchar           *message,
-                                                        GStrv           *choices,
-                                                        gpointer         user_data)      : Run Last
+ gchar *message, + GStrv *choices, + gpointer user_data) : Run Last

Emitted when asking the user a question and gives a list of choices for the user to choose from. @@ -728,7 +728,7 @@ choices for the user to choose from.

If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the -primary text in a GtkMessageDialog. +primary text in a GtkMessageDialog.

@@ -760,7 +760,7 @@ primary text in a GtkMessageDialog.

The "reply" signal

void                user_function                      (GMountOperation      *op,
                                                         GMountOperationResult result,
-                                                        gpointer              user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the user has replied to the mount operation.

@@ -788,10 +788,10 @@ Emitted when the user has replied to the mount operation.

The "show-processes" signal

void                user_function                      (GMountOperation *op,
-                                                        gchar           *message,
-                                                        GArray          *processes,
-                                                        GStrv           *choices,
-                                                        gpointer         user_data)      : Run Last
+ gchar *message, + GArray *processes, + GStrv *choices, + gpointer user_data) : Run Last

Emitted when one or more processes are blocking an operation e.g. unmounting/ejecting a GMount or stopping a GDrive. @@ -806,7 +806,7 @@ the user made).

If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the -primary text in a GtkMessageDialog. +primary text in a GtkMessageDialog.

@@ -823,7 +823,7 @@ primary text in a GtkMessageDialog. - @@ -843,6 +843,6 @@ primary text in a GtkMessageDialog. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GNetworkAddress.html b/docs/reference/gio/html/GNetworkAddress.html index 5d71034..903d08d 100644 --- a/docs/reference/gio/html/GNetworkAddress.html +++ b/docs/reference/gio/html/GNetworkAddress.html @@ -3,12 +3,12 @@ GNetworkAddress - + - + @@ -47,19 +47,23 @@ #include <gio/gio.h> GNetworkAddress; -GSocketConnectable * g_network_address_new (const gchar *hostname, - guint16 port); -const gchar * g_network_address_get_hostname (GNetworkAddress *addr); -guint16g_network_address_get_port (GNetworkAddress *addr); -GSocketConnectable * g_network_address_parse (const gchar *host_and_port, - guint16 default_port, - GError **error); +GSocketConnectable * g_network_address_new (const gchar *hostname, + guint16 port); +const gchar * g_network_address_get_hostname (GNetworkAddress *addr); +guint16g_network_address_get_port (GNetworkAddress *addr); +const gchar * g_network_address_get_scheme (GNetworkAddress *addr); +GSocketConnectable * g_network_address_parse (const gchar *host_and_port, + guint16 default_port, + GError **error); +GSocketConnectable * g_network_address_parse_uri (const gchar *uri, + guint16 default_port, + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GNetworkAddress
 
@@ -72,8 +76,9 @@ GNetworkAddress implements

Properties

-  "hostname"                 gchar*                : Read / Write / Construct Only
-  "port"                     guint                 : Read / Write / Construct Only
+  "hostname"                 gchar*                : Read / Write / Construct Only
+  "port"                     guint                 : Read / Write / Construct Only
+  "scheme"                   gchar*                : Read / Write / Construct Only
 
@@ -101,8 +106,8 @@ that host.

g_network_address_new ()

-
GSocketConnectable * g_network_address_new              (const gchar *hostname,
-                                                         guint16 port);
+
GSocketConnectable * g_network_address_new              (const gchar *hostname,
+                                                         guint16 port);

Creates a new GSocketConnectable for connecting to the given hostname and port. @@ -122,8 +127,7 @@ Creates a new Returns :

-
@@ -133,7 +137,7 @@ Creates a new

g_network_address_get_hostname ()

-
const gchar *       g_network_address_get_hostname      (GNetworkAddress *addr);
+
const gchar *       g_network_address_get_hostname      (GNetworkAddress *addr);

Gets addr's hostname. This might be either UTF-8 or ASCII-encoded, depending on what addr was created with. @@ -159,7 +163,7 @@ depending on what addr was created with.


g_network_address_get_port ()

-
guint16             g_network_address_get_port          (GNetworkAddress *addr);
+
guint16             g_network_address_get_port          (GNetworkAddress *addr);

Gets addr's port number

@@ -182,18 +186,43 @@ Gets addr's port number

Since 2.22


+
+

g_network_address_get_scheme ()

+
const gchar *       g_network_address_get_scheme        (GNetworkAddress *addr);
+

+Gets addr's scheme +

+

processes :

an array of GPid for processes blocking the operation. +an array of GPid for processes blocking the operation.
the new GNetworkAddress - + the new GNetworkAddress. [transfer full]
++ + + + + + + + + + +

addr :

a GNetworkAddress +

Returns :

addr's scheme (NULL if not built from URI) + +
+

Since 2.26

+
+

g_network_address_parse ()

-
GSocketConnectable * g_network_address_parse            (const gchar *host_and_port,
-                                                         guint16 default_port,
-                                                         GError **error);
+
GSocketConnectable * g_network_address_parse            (const gchar *host_and_port,
+                                                         guint16 default_port,
+                                                         GError **error);

Creates a new GSocketConnectable for connecting to the given -hostname and port. May fail and return NULL in case +hostname and port. May fail and return NULL in case parsing host_and_port fails.

-host_and_port may be in any of a number of recognised formats: an IPv6 +host_and_port may be in any of a number of recognised formats; an IPv6 address, an IPv4 address, or a domain name (in which case a DNS lookup is performed). Quoting with [] is supported for all address types. A port override may be specified in the usual way with a @@ -224,40 +253,88 @@ and default_port is expected to be provi

error :

-a pointer to a GError, or NULL +a pointer to a GError, or NULL

Returns :

- the new GNetworkAddress, or NULL on error - + the new GNetworkAddress, or NULL on error. [transfer full]

Since 2.22

+
+
+

g_network_address_parse_uri ()

+
GSocketConnectable * g_network_address_parse_uri        (const gchar *uri,
+                                                         guint16 default_port,
+                                                         GError **error);
+

+Creates a new GSocketConnectable for connecting to the given +uri. May fail and return NULL in case parsing uri fails. +

+

+Using this rather than g_network_address_new() or +g_network_address_parse_host() allows GSocketClient to determine +when to use application-specific proxy protocols. +

+
++ + + + + + + + + + + + + + + + + + +

uri :

the hostname and optionally a port +

default_port :

The default port if none is found in the URI +

error :

a pointer to a GError, or NULL +

Returns :

the new GNetworkAddress, or NULL on error. [transfer full] +
+

Since 2.26

+

Property Details

The "hostname" property

-
  "hostname"                 gchar*                : Read / Write / Construct Only
+
  "hostname"                 gchar*                : Read / Write / Construct Only

Hostname to resolve.

Default value: NULL


The "port" property

-
  "port"                     guint                 : Read / Write / Construct Only
+
  "port"                     guint                 : Read / Write / Construct Only

Network port.

Allowed values: <= 65535

Default value: 0

+
+
+

The "scheme" property

+
  "scheme"                   gchar*                : Read / Write / Construct Only
+

URI Scheme.

+

Default value: NULL

+
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GNetworkService.html b/docs/reference/gio/html/GNetworkService.html index 7628858..fb330e2 100644 --- a/docs/reference/gio/html/GNetworkService.html +++ b/docs/reference/gio/html/GNetworkService.html @@ -3,12 +3,12 @@ GNetworkService - + - + @@ -47,18 +47,21 @@ #include <gio/gio.h> GNetworkService; -GSocketConnectable * g_network_service_new (const gchar *service, - const gchar *protocol, - const gchar *domain); -const gchar * g_network_service_get_service (GNetworkService *srv); -const gchar * g_network_service_get_protocol (GNetworkService *srv); -const gchar * g_network_service_get_domain (GNetworkService *srv); +GSocketConnectable * g_network_service_new (const gchar *service, + const gchar *protocol, + const gchar *domain); +const gchar * g_network_service_get_service (GNetworkService *srv); +const gchar * g_network_service_get_protocol (GNetworkService *srv); +const gchar * g_network_service_get_domain (GNetworkService *srv); +const gchar * g_network_service_get_scheme (GNetworkService *srv); +void g_network_service_set_scheme (GNetworkService *srv, + const gchar *scheme);

Object Hierarchy

-  GObject
+  GObject
    +----GNetworkService
 
@@ -71,9 +74,10 @@ GNetworkService implements

Properties

-  "domain"                   gchar*                : Read / Write / Construct Only
-  "protocol"                 gchar*                : Read / Write / Construct Only
-  "service"                  gchar*                : Read / Write / Construct Only
+  "domain"                   gchar*                : Read / Write / Construct Only
+  "protocol"                 gchar*                : Read / Write / Construct Only
+  "scheme"                   gchar*                : Read / Write
+  "service"                  gchar*                : Read / Write / Construct Only
 
@@ -104,9 +108,9 @@ that service.

g_network_service_new ()

-
GSocketConnectable * g_network_service_new              (const gchar *service,
-                                                         const gchar *protocol,
-                                                         const gchar *domain);
+
GSocketConnectable * g_network_service_new              (const gchar *service,
+                                                         const gchar *protocol,
+                                                         const gchar *domain);

Creates a new GNetworkService representing the given service, protocol, and domain. This will initially be unresolved; use the @@ -132,8 +136,7 @@ Creates a new Returns :

- a new GNetworkService - + a new GNetworkService. [transfer full] @@ -143,7 +146,7 @@ Creates a new

g_network_service_get_service ()

-
const gchar *       g_network_service_get_service       (GNetworkService *srv);
+
const gchar *       g_network_service_get_service       (GNetworkService *srv);

Gets srv's service name (eg, "ldap").

@@ -168,7 +171,7 @@ Gets srv's service name (eg, "ldap").

g_network_service_get_protocol ()

-
const gchar *       g_network_service_get_protocol      (GNetworkService *srv);
+
const gchar *       g_network_service_get_protocol      (GNetworkService *srv);

Gets srv's protocol name (eg, "tcp").

@@ -193,7 +196,7 @@ Gets srv's protocol name (eg, "tcp").

g_network_service_get_domain ()

-
const gchar *       g_network_service_get_domain        (GNetworkService *srv);
+
const gchar *       g_network_service_get_domain        (GNetworkService *srv);

Gets the domain that srv serves. This might be either UTF-8 or ASCII-encoded, depending on what srv was created with. @@ -216,26 +219,85 @@ ASCII-encoded, depending on what srv was

Since 2.22

+
+
+

g_network_service_get_scheme ()

+
const gchar *       g_network_service_get_scheme        (GNetworkService *srv);
+

+Get's the URI scheme used to resolve proxies. By default, the service name +is used as scheme. +

+
++ + + + + + + + + + +

srv :

a GNetworkService +

Returns :

srv's scheme name + +
+

Since 2.26

+
+
+
+

g_network_service_set_scheme ()

+
void                g_network_service_set_scheme        (GNetworkService *srv,
+                                                         const gchar *scheme);
+

+Set's the URI scheme used to resolve proxies. By default, the service name +is used as scheme. +

+
++ + + + + + + + + + +

srv :

a GNetworkService +

scheme :

a URI scheme +
+

Since 2.26

+

Property Details

The "domain" property

-
  "domain"                   gchar*                : Read / Write / Construct Only
+
  "domain"                   gchar*                : Read / Write / Construct Only

Network domain, eg, "example.com".

Default value: NULL


The "protocol" property

-
  "protocol"                 gchar*                : Read / Write / Construct Only
+
  "protocol"                 gchar*                : Read / Write / Construct Only

Network protocol, eg "tcp".

Default value: NULL


+
+

The "scheme" property

+
  "scheme"                   gchar*                : Read / Write
+

Network scheme (default is to use service).

+

Default value: NULL

+
+

The "service" property

-
  "service"                  gchar*                : Read / Write / Construct Only
+
  "service"                  gchar*                : Read / Write / Construct Only

Service name, eg "ldap".

Default value: NULL

@@ -243,6 +305,6 @@ ASCII-encoded, depending on what srv was
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GOutputStream.html b/docs/reference/gio/html/GOutputStream.html index eeb0f16..48d70f6 100644 --- a/docs/reference/gio/html/GOutputStream.html +++ b/docs/reference/gio/html/GOutputStream.html @@ -3,12 +3,12 @@ GOutputStream - + - + @@ -26,6 +26,8 @@ Description  |  Object Hierarchy +  |  + Known Derived Interfaces
@@ -44,76 +46,76 @@ enum GOutputStreamSpliceFlags; GOutputStream; -gssize g_output_stream_write (GOutputStream *stream, +gssize g_output_stream_write (GOutputStream *stream, const void *buffer, - gsize count, + gsize count, GCancellable *cancellable, - GError **error); -gboolean g_output_stream_write_all (GOutputStream *stream, + GError **error); +gboolean g_output_stream_write_all (GOutputStream *stream, const void *buffer, - gsize count, - gsize *bytes_written, + gsize count, + gsize *bytes_written, GCancellable *cancellable, - GError **error); -gssize g_output_stream_splice (GOutputStream *stream, + GError **error); +gssize g_output_stream_splice (GOutputStream *stream, GInputStream *source, GOutputStreamSpliceFlags flags, GCancellable *cancellable, - GError **error); -gboolean g_output_stream_flush (GOutputStream *stream, + GError **error); +gboolean g_output_stream_flush (GOutputStream *stream, GCancellable *cancellable, - GError **error); -gboolean g_output_stream_close (GOutputStream *stream, + GError **error); +gboolean g_output_stream_close (GOutputStream *stream, GCancellable *cancellable, - GError **error); + GError **error); void g_output_stream_write_async (GOutputStream *stream, const void *buffer, - gsize count, + gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gssize g_output_stream_write_finish (GOutputStream *stream, + gpointer user_data); +gssize g_output_stream_write_finish (GOutputStream *stream, GAsyncResult *result, - GError **error); + GError **error); void g_output_stream_splice_async (GOutputStream *stream, GInputStream *source, GOutputStreamSpliceFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gssize g_output_stream_splice_finish (GOutputStream *stream, + gpointer user_data); +gssize g_output_stream_splice_finish (GOutputStream *stream, GAsyncResult *result, - GError **error); + GError **error); void g_output_stream_flush_async (GOutputStream *stream, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_output_stream_flush_finish (GOutputStream *stream, + gpointer user_data); +gboolean g_output_stream_flush_finish (GOutputStream *stream, GAsyncResult *result, - GError **error); + GError **error); void g_output_stream_close_async (GOutputStream *stream, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_output_stream_close_finish (GOutputStream *stream, + gpointer user_data); +gboolean g_output_stream_close_finish (GOutputStream *stream, GAsyncResult *result, - GError **error); -gboolean g_output_stream_is_closing (GOutputStream *stream); -gboolean g_output_stream_is_closed (GOutputStream *stream); -gboolean g_output_stream_has_pending (GOutputStream *stream); -gboolean g_output_stream_set_pending (GOutputStream *stream, - GError **error); + GError **error); +gboolean g_output_stream_is_closing (GOutputStream *stream); +gboolean g_output_stream_is_closed (GOutputStream *stream); +gboolean g_output_stream_has_pending (GOutputStream *stream); +gboolean g_output_stream_set_pending (GOutputStream *stream, + GError **error); void g_output_stream_clear_pending (GOutputStream *stream);

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GFilterOutputStream
          +----GFileOutputStream
@@ -121,6 +123,12 @@ enum                GUnixOutputStream
 
+
+

Known Derived Interfaces

+

+GOutputStream is required by + GPollableOutputStream.

+

Description

@@ -188,30 +196,31 @@ asynchronous versions.


g_output_stream_write ()

-
gssize              g_output_stream_write               (GOutputStream *stream,
+
gssize              g_output_stream_write               (GOutputStream *stream,
                                                          const void *buffer,
-                                                         gsize count,
+                                                         gsize count,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to write count bytes from buffer into the stream. Will block during the operation.

-If count is zero returns zero and does nothing. A value of count -larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error. +If count is 0, returns 0 and does nothing. A value of count +larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error.

On success, the number of bytes written to the stream is returned. It is not an error if this is not the same as the requested size, as it -can happen e.g. on a partial i/o error, or if there is not enough -storage in the stream. All writes either block until at least one byte -is written, so zero is never returned (unless count is zero). +can happen e.g. on a partial I/O error, or if there is not enough +storage in the stream. All writes block until at least one byte +is written or an error occurs; 0 is never returned (unless +count is 0).

If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation -was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an +was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error.

@@ -228,7 +237,7 @@ On error -1 is returned and error is set

buffer :

-the buffer containing the data to write. + the buffer containing the data to write. [array length=count][element-type guint8] @@ -238,12 +247,12 @@ On error -1 is returned and error is set

cancellable :

-optional cancellable object + optional cancellable object. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore @@ -257,12 +266,12 @@ On error -1 is returned and error is set

g_output_stream_write_all ()

-
gboolean            g_output_stream_write_all           (GOutputStream *stream,
+
gboolean            g_output_stream_write_all           (GOutputStream *stream,
                                                          const void *buffer,
-                                                         gsize count,
-                                                         gsize *bytes_written,
+                                                         gsize count,
+                                                         gsize *bytes_written,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to write count bytes from buffer into the stream. Will block during the operation. @@ -272,7 +281,7 @@ This function is similar to count bytes, TRUE is returned, and bytes_written +On a successful write of count bytes, TRUE is returned, and bytes_written is set to count.

@@ -290,7 +299,7 @@ the number of bytes written into the stream before the error occurred.

buffer :

-the buffer containing the data to write. + the buffer containing the data to write. [array length=count][element-type guint8] @@ -300,23 +309,23 @@ the number of bytes written into the stream before the error occurred.

bytes_written :

-location to store the number of bytes that was - written to the stream + location to store the number of bytes that was + written to the stream. [out]

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

- TRUE on success, FALSE if there was an error + TRUE on success, FALSE if there was an error @@ -325,11 +334,11 @@ the number of bytes written into the stream before the error occurred.

g_output_stream_splice ()

-
gssize              g_output_stream_splice              (GOutputStream *stream,
+
gssize              g_output_stream_splice              (GOutputStream *stream,
                                                          GInputStream *source,
                                                          GOutputStreamSpliceFlags flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Splices an input stream into an output stream.

@@ -353,18 +362,18 @@ Splices an input stream into an output stream.

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- a gssize containing the size of the data spliced, or + a gssize containing the size of the data spliced, or -1 if an error occurred. @@ -374,9 +383,9 @@ ignore.

g_output_stream_flush ()

-
gboolean            g_output_stream_flush               (GOutputStream *stream,
+
gboolean            g_output_stream_flush               (GOutputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Flushed any outstanding buffers in the stream. Will block during the operation. Closing the stream will implicitly cause a flush. @@ -385,7 +394,7 @@ the operation. Closing the stream will implicitly cause a flush. This function is optional for inherited classes.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -399,17 +408,17 @@ was cancelled, the error cancellable :

-optional cancellable object + optional cancellable object. [allow-none]

error :

-location to store the error occuring, or
NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

- TRUE on success, FALSE on error + TRUE on success, FALSE on error @@ -418,9 +427,9 @@ was cancelled, the error

g_output_stream_close ()

-
gboolean            g_output_stream_close               (GOutputStream *stream,
+
gboolean            g_output_stream_close               (GOutputStream *stream,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Closes the stream, releasing resources related to it.

@@ -468,17 +477,17 @@ data will reach the target.

cancellable :

-optional cancellable object + optional cancellable object. [allow-none]

error :

-location to store the error occuring, or NULL to ignore +location to store the error occuring, or NULL to ignore

Returns :

- TRUE on success, FALSE on failure + TRUE on success, FALSE on failure @@ -489,11 +498,11 @@ data will reach the target.

g_output_stream_write_async ()

void                g_output_stream_write_async         (GOutputStream *stream,
                                                          const void *buffer,
-                                                         gsize count,
+                                                         gsize count,
                                                          int io_priority,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Request an asynchronous write of count bytes from buffer into the stream. When the operation is finished callback will be called. @@ -505,7 +514,7 @@ During an async request no other sync and async calls are allowed, and will result in G_IO_ERROR_PENDING errors.

-A value of count larger than G_MAXSSIZE will cause a +A value of count larger than G_MAXSSIZE will cause a G_IO_ERROR_INVALID_ARGUMENT error.

@@ -515,9 +524,14 @@ requested size, as it can happen e.g. on a partial I/O error, but generally we try to write as many bytes as requested.

+You are guaranteed that this method will never fail with +G_IO_ERROR_WOULD_BLOCK - if stream can't accept more data, the +method will just wait until this changes. +

+

Any outstanding I/O request with higher priority (lower numerical value) will be executed before an outstanding request with lower -priority. Default priority is G_PRIORITY_DEFAULT. +priority. Default priority is G_PRIORITY_DEFAULT.

The asyncronous methods have a default fallback that uses threads @@ -538,7 +552,7 @@ For the synchronous, blocking version of this function, see

buffer :

-the buffer containing the data to write. + the buffer containing the data to write. [array length=count][element-type guint8] @@ -553,17 +567,17 @@ For the synchronous, blocking version of this function, see

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

-callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

-the data to pass to callback function + the data to pass to callback function. [closure] @@ -572,9 +586,9 @@ For the synchronous, blocking version of this function, see

g_output_stream_write_finish ()

-
gssize              g_output_stream_write_finish        (GOutputStream *stream,
+
gssize              g_output_stream_write_finish        (GOutputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes a stream write operation.

@@ -593,13 +607,13 @@ Finishes a stream write operation.

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- a gssize containing the number of bytes written to the stream. + a gssize containing the number of bytes written to the stream. @@ -614,7 +628,7 @@ ignore. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Splices a stream asynchronously. When the operation is finished callback will be called. @@ -650,17 +664,17 @@ For the synchronous, blocking version of this function, see

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

-a GAsyncReadyCallback. + a GAsyncReadyCallback. [scope async]

user_data :

-user data passed to callback. + user data passed to callback. [closure] @@ -669,9 +683,9 @@ For the synchronous, blocking version of this function, see

g_output_stream_splice_finish ()

-
gssize              g_output_stream_splice_finish       (GOutputStream *stream,
+
gssize              g_output_stream_splice_finish       (GOutputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an asynchronous stream splice operation.

@@ -690,13 +704,13 @@ Finishes an asynchronous stream splice operation.

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- a gssize of the number of bytes spliced. + a gssize of the number of bytes spliced. @@ -709,7 +723,7 @@ ignore. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Flushes a stream asynchronously. For behaviour details see g_output_stream_flush(). @@ -734,17 +748,17 @@ result of the operation.

cancellable :

-optional GCancellable object, NULL to ignore. + optional GCancellable object, NULL to ignore. [allow-none]

callback :

-a GAsyncReadyCallback to call when the request is satisfied + a GAsyncReadyCallback to call when the request is satisfied. [scope async]

user_data :

-the data to pass to callback function + the data to pass to callback function. [closure] @@ -753,9 +767,9 @@ result of the operation.

g_output_stream_flush_finish ()

-
gboolean            g_output_stream_flush_finish        (GOutputStream *stream,
+
gboolean            g_output_stream_flush_finish        (GOutputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes flushing an output stream.

@@ -774,13 +788,13 @@ Finishes flushing an output stream.

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- TRUE if flush operation suceeded, FALSE otherwise. + TRUE if flush operation suceeded, FALSE otherwise. @@ -793,7 +807,7 @@ ignore. int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished callback will be @@ -823,17 +837,17 @@ classes. However, if you override one you must override all.

cancellable :

-optional cancellable object + optional cancellable object. [allow-none]

callback :

-callback to call when the request is satisfied + callback to call when the request is satisfied. [scope async]

user_data :

-the data to pass to callback function + the data to pass to callback function. [closure] @@ -842,9 +856,9 @@ classes. However, if you override one you must override all.

g_output_stream_close_finish ()

-
gboolean            g_output_stream_close_finish        (GOutputStream *stream,
+
gboolean            g_output_stream_close_finish        (GOutputStream *stream,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Closes an output stream.

@@ -863,13 +877,13 @@ Closes an output stream.

error :

-a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- TRUE if stream was successfully closed, FALSE otherwise. + TRUE if stream was successfully closed, FALSE otherwise. @@ -878,7 +892,7 @@ ignore.

g_output_stream_is_closing ()

-
gboolean            g_output_stream_is_closing          (GOutputStream *stream);
+
gboolean            g_output_stream_is_closing          (GOutputStream *stream);

Checks if an output stream is being closed. This can be used inside e.g. a flush implementation to see if the @@ -895,7 +909,7 @@ the closing operation.

Returns :

- TRUE if stream is being closed. FALSE otherwise. + TRUE if stream is being closed. FALSE otherwise. @@ -906,7 +920,7 @@ the closing operation.

g_output_stream_is_closed ()

-
gboolean            g_output_stream_is_closed           (GOutputStream *stream);
+
gboolean            g_output_stream_is_closed           (GOutputStream *stream);

Checks if an output stream has already been closed.

@@ -920,7 +934,7 @@ Checks if an output stream has already been closed.

Returns :

- TRUE if stream is closed. FALSE otherwise. + TRUE if stream is closed. FALSE otherwise. @@ -929,7 +943,7 @@ Checks if an output stream has already been closed.

g_output_stream_has_pending ()

-
gboolean            g_output_stream_has_pending         (GOutputStream *stream);
+
gboolean            g_output_stream_has_pending         (GOutputStream *stream);

Checks if an ouput stream has pending actions.

@@ -943,7 +957,7 @@ Checks if an ouput stream has pending actions.

Returns :

- TRUE if stream has pending actions. + TRUE if stream has pending actions. @@ -952,11 +966,11 @@ Checks if an ouput stream has pending actions.

g_output_stream_set_pending ()

-
gboolean            g_output_stream_set_pending         (GOutputStream *stream,
-                                                         GError **error);
+
gboolean            g_output_stream_set_pending         (GOutputStream *stream,
+                                                         GError **error);

Sets stream to have actions pending. If the pending flag is -already set or stream is closed, it will return FALSE and set +already set or stream is closed, it will return FALSE and set error.

@@ -969,13 +983,13 @@ already set or stream is closed, it will - - @@ -1001,6 +1015,6 @@ Clears the pending flag on stream. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GPermission.html b/docs/reference/gio/html/GPermission.html new file mode 100644 index 0000000..f16089e --- /dev/null +++ b/docs/reference/gio/html/GPermission.html @@ -0,0 +1,560 @@ + + + + +GPermission + + + + + + + + + +

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if pending was previously unset and is now set. + TRUE if pending was previously unset and is now set.
+ + + + + + + + + +
+
+
+ + +
+

GPermission

+

GPermission — An object representing the permission to perform + a certain action

+
+
+

Synopsis

+
                    GPermission;
+gboolean            g_permission_get_allowed            (GPermission *permission);
+gboolean            g_permission_get_can_acquire        (GPermission *permission);
+gboolean            g_permission_get_can_release        (GPermission *permission);
+
+gboolean            g_permission_acquire                (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_permission_acquire_async          (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+gboolean            g_permission_acquire_finish         (GPermission *permission,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+gboolean            g_permission_release                (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_permission_release_async          (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+gboolean            g_permission_release_finish         (GPermission *permission,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+
+void                g_permission_impl_update            (GPermission *permission,
+                                                         gboolean allowed,
+                                                         gboolean can_acquire,
+                                                         gboolean can_release);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GPermission
+         +----GSimplePermission
+
+
+
+

Properties

+
+  "allowed"                  gboolean              : Read
+  "can-acquire"              gboolean              : Read
+  "can-release"              gboolean              : Read
+
+
+
+

Description

+

+A GPermission represents the status of the caller's permission to +perform a certain action. +

+

+You can query if the action is currently allowed and if it is +possible to acquire the permission so that the action will be allowed +in the future. +

+

+There is also an API to actually acquire the permission and one to +release it. +

+

+As an example, a GPermission might represent the ability for the +user to write to a GSettings object. This GPermission object could +then be used to decide if it is appropriate to show a "Click here to +unlock" button in a dialog and to provide the mechanism to invoke +when that button is clicked. +

+
+
+

Details

+
+

GPermission

+
typedef struct _GPermission GPermission;
+

+GPermission is an opaque data structure and can only be accessed +using the following functions. +

+
+
+
+

g_permission_get_allowed ()

+
gboolean            g_permission_get_allowed            (GPermission *permission);
+

+Gets the value of the 'allowed' property. This property is TRUE if +the caller currently has permission to perform the action that +permission represents the permission to perform. +

+
++ + + + + + + + + + +

permission :

a GPermission instance +

Returns :

the value of the 'allowed' property +
+

Since 2.26

+
+
+
+

g_permission_get_can_acquire ()

+
gboolean            g_permission_get_can_acquire        (GPermission *permission);
+

+Gets the value of the 'can-acquire' property. This property is TRUE +if it is generally possible to acquire the permission by calling +g_permission_acquire(). +

+
++ + + + + + + + + + +

permission :

a GPermission instance +

Returns :

the value of the 'can-acquire' property +
+

Since 2.26

+
+
+
+

g_permission_get_can_release ()

+
gboolean            g_permission_get_can_release        (GPermission *permission);
+

+Gets the value of the 'can-release' property. This property is TRUE +if it is generally possible to release the permission by calling +g_permission_release(). +

+
++ + + + + + + + + + +

permission :

a GPermission instance +

Returns :

the value of the 'can-release' property +
+

Since 2.26

+
+
+
+

g_permission_acquire ()

+
gboolean            g_permission_acquire                (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Attempts to acquire the permission represented by permission. +

+

+The precise method by which this happens depends on the permission +and the underlying authentication mechanism. A simple example is +that a dialog may appear asking the user to enter their password. +

+

+You should check with g_permission_get_can_acquire() before calling +this function. +

+

+If the permission is acquired then TRUE is returned. Otherwise, +FALSE is returned and error is set appropriately. +

+

+This call is blocking, likely for a very long time (in the case that +user interaction is required). See g_permission_acquire_async() for +the non-blocking version. +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

cancellable :

a GCancellable, or NULL +

error :

a pointer to a NULL GError, or NULL +

Returns :

+TRUE if the permission was successfully acquired +
+

Since 2.26

+
+
+
+

g_permission_acquire_async ()

+
void                g_permission_acquire_async          (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Attempts to acquire the permission represented by permission. +

+

+This is the first half of the asynchronous version of +g_permission_acquire(). +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

cancellable :

a GCancellable, or NULL +

callback :

the GAsyncReadyCallback to call when done +

user_data :

the user data to pass to callback +
+

Since 2.26

+
+
+
+

g_permission_acquire_finish ()

+
gboolean            g_permission_acquire_finish         (GPermission *permission,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+

+Collects the result of attempting to acquire the permission +represented by permission. +

+

+This is the second half of the asynchronous version of +g_permission_acquire(). +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

result :

the GAsyncResult given to the GAsyncReadyCallback +

error :

a pointer to a NULL GError, or NULL +

Returns :

+TRUE if the permission was successfully acquired +
+

Since 2.26

+
+
+
+

g_permission_release ()

+
gboolean            g_permission_release                (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Attempts to release the permission represented by permission. +

+

+The precise method by which this happens depends on the permission +and the underlying authentication mechanism. In most cases the +permission will be dropped immediately without further action. +

+

+You should check with g_permission_get_can_release() before calling +this function. +

+

+If the permission is released then TRUE is returned. Otherwise, +FALSE is returned and error is set appropriately. +

+

+This call is blocking, likely for a very long time (in the case that +user interaction is required). See g_permission_release_async() for +the non-blocking version. +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

cancellable :

a GCancellable, or NULL +

error :

a pointer to a NULL GError, or NULL +

Returns :

+TRUE if the permission was successfully released +
+

Since 2.26

+
+
+
+

g_permission_release_async ()

+
void                g_permission_release_async          (GPermission *permission,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Attempts to release the permission represented by permission. +

+

+This is the first half of the asynchronous version of +g_permission_release(). +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

cancellable :

a GCancellable, or NULL +

callback :

the GAsyncReadyCallback to call when done +

user_data :

the user data to pass to callback +
+

Since 2.26

+
+
+
+

g_permission_release_finish ()

+
gboolean            g_permission_release_finish         (GPermission *permission,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+

+Collects the result of attempting to release the permission +represented by permission. +

+

+This is the second half of the asynchronous version of +g_permission_release(). +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

result :

the GAsyncResult given to the GAsyncReadyCallback +

error :

a pointer to a NULL GError, or NULL +

Returns :

+TRUE if the permission was successfully released +
+

Since 2.26

+
+
+
+

g_permission_impl_update ()

+
void                g_permission_impl_update            (GPermission *permission,
+                                                         gboolean allowed,
+                                                         gboolean can_acquire,
+                                                         gboolean can_release);
+

+This function is called by the GPermission implementation to update +the properties of the permission. You should never call this +function except from a GPermission implementation. +

+

+GObject notify signals are generated, as appropriate. +

+
++ + + + + + + + + + + + + + + + + + +

permission :

a GPermission instance +

allowed :

the new value for the 'allowed' property +

can_acquire :

the new value for the 'can-acquire' property +

can_release :

the new value for the 'can-release' property +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "allowed" property

+
  "allowed"                  gboolean              : Read
+

+TRUE if the caller currently has permission to perform the action that +permission represents the permission to perform. +

+

Default value: FALSE

+
+
+
+

The "can-acquire" property

+
  "can-acquire"              gboolean              : Read
+

+TRUE if it is generally possible to acquire the permission by calling +g_permission_acquire(). +

+

Default value: FALSE

+
+
+
+

The "can-release" property

+
  "can-release"              gboolean              : Read
+

+TRUE if it is generally possible to release the permission by calling +g_permission_release(). +

+

Default value: FALSE

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GPollableInputStream.html b/docs/reference/gio/html/GPollableInputStream.html new file mode 100644 index 0000000..22d0421 --- /dev/null +++ b/docs/reference/gio/html/GPollableInputStream.html @@ -0,0 +1,414 @@ + + + + +GPollableInputStream + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GPollableInputStream

+

GPollableInputStream — Interface for pollable input streams

+
+ +
+

Object Hierarchy

+
+  GInterface
+   +----GPollableInputStream
+
+
+
+

Prerequisites

+

+GPollableInputStream requires + GInputStream.

+
+
+

Known Implementations

+

+GPollableInputStream is implemented by + GUnixInputStream.

+
+
+

Description

+

+GPollableInputStream is implemented by GInputStreams that +can be polled for readiness to read. This can be used when +interfacing with a non-GIO API that expects +UNIX-file-descriptor-style asynchronous I/O rather than GIO-style. +

+
+
+

Details

+
+

GPollableInputStream

+
typedef struct _GPollableInputStream GPollableInputStream;
+

+An interface for a GInputStream that can be polled for readability. +

+

Since 2.28

+
+
+
+

GPollableInputStreamInterface

+
typedef struct {
+  GTypeInterface g_iface;
+
+  /* Virtual Table */
+  gboolean     (*can_poll)         (GPollableInputStream  *stream);
+
+  gboolean     (*is_readable)      (GPollableInputStream  *stream);
+  GSource *    (*create_source)    (GPollableInputStream  *stream,
+				    GCancellable          *cancellable);
+  gssize       (*read_nonblocking) (GPollableInputStream  *stream,
+				    void                  *buffer,
+				    gsize                  size,
+				    GError               **error);
+} GPollableInputStreamInterface;
+
+

+The interface for pollable input streams. +

+

+The default implementation of can_poll always returns TRUE. +

+

+The default implementation of read_nonblocking calls +g_pollable_input_stream_is_readable(), and then calls +g_input_stream_read() if it returns TRUE. This means you only need +to override it if it is possible that your is_readable +implementation may return TRUE when the stream is not actually +readable. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface g_iface;

The parent interface. +

can_poll ()

Checks if the GPollableInputStream instance is actually pollable +

is_readable ()

Checks if the stream is readable +

create_source ()

Creates a GSource to poll the stream +

read_nonblocking ()

Does a non-blocking read or returns + G_IO_ERROR_WOULD_BLOCK +
+

Since 2.28

+
+
+
+

g_pollable_input_stream_can_poll ()

+
gboolean            g_pollable_input_stream_can_poll    (GPollableInputStream *stream);
+

+Checks if stream is actually pollable. Some classes may implement +GPollableInputStream but have only certain instances of that class +be pollable. If this method returns FALSE, then the behavior of +other GPollableInputStream methods is undefined. +

+

+For any given stream, the value returned by this method is constant; +a stream cannot switch from pollable to non-pollable or vice versa. +

+
++ + + + + + + + + + +

stream :

a GPollableInputStream. +

Returns :

TRUE if stream is pollable, FALSE if not. + +
+

Since 2.28

+
+
+
+

g_pollable_input_stream_is_readable ()

+
gboolean            g_pollable_input_stream_is_readable (GPollableInputStream *stream);
+

+Checks if stream can be read. +

+

+Note that some stream types may not be able to implement this 100% +reliably, and it is possible that a call to g_input_stream_read() +after this returns TRUE would still block. To guarantee +non-blocking behavior, you should always use +g_pollable_input_stream_read_nonblocking(), which will return a +G_IO_ERROR_WOULD_BLOCK error rather than blocking. +

+
++ + + + + + + + + + +

stream :

a GPollableInputStream. +

Returns :

TRUE if stream is readable, FALSE if not. If an error + has occurred on stream, this will result in + g_pollable_input_stream_is_readable() returning TRUE, and the + next attempt to read will return the error. + +
+

Since 2.28

+
+
+
+

g_pollable_input_stream_create_source ()

+
GSource *           g_pollable_input_stream_create_source
+                                                        (GPollableInputStream *stream,
+                                                         GCancellable *cancellable);
+

+Creates a GSource that triggers when stream can be read, or +cancellable is triggered or an error occurs. The callback on the +source is of the GPollableSourceFunc type. +

+

+As with g_pollable_input_stream_is_readable(), it is possible that +the stream may not actually be readable even after the source +triggers, so you should use g_pollable_input_stream_read_nonblocking() +rather than g_input_stream_read() from the callback. +

+
++ + + + + + + + + + + + + + +

stream :

a GPollableInputStream. +

cancellable :

a GCancellable, or NULL +

Returns :

a new GSource + +
+

Since 2.28

+
+
+
+

g_pollable_input_stream_read_nonblocking ()

+
gssize              g_pollable_input_stream_read_nonblocking
+                                                        (GPollableInputStream *stream,
+                                                         void *buffer,
+                                                         gsize size,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Attempts to read up to size bytes from stream into buffer, as +with g_input_stream_read(). If stream is not currently readable, +this will immediately return G_IO_ERROR_WOULD_BLOCK, and you can +use g_pollable_input_stream_create_source() to create a GSource +that will be triggered when stream is readable. +

+

+Note that since this method never blocks, you cannot actually +use cancellable to cancel it. However, it will return an error +if cancellable has already been cancelled when you call, which +may happen if you call this method after a source triggers due +to having been cancelled. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

stream :

a GPollableInputStream +

buffer :

a buffer to read data into (which should be at least size + bytes long). +

size :

the number of bytes you want to read +

cancellable :

a GCancellable, or NULL +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the number of bytes read, or -1 on error (including + G_IO_ERROR_WOULD_BLOCK). +
+
+
+
+

GPollableSourceFunc ()

+
gboolean            (*GPollableSourceFunc)              (GObject *pollable_stream,
+                                                         gpointer user_data);
+

+This is the function type of the callback used for the GSource +returned by g_pollable_input_stream_create_source() and +g_pollable_output_stream_create_source(). +

+
++ + + + + + + + + + + + + + +

pollable_stream :

the GPollableInputStream or GPollableOutputStream +

user_data :

data passed in by the user. +

Returns :

it should return FALSE if the source should be removed. + +
+

Since 2.28

+
+
+
+

g_pollable_source_new ()

+
GSource *           g_pollable_source_new               (GObject *pollable_stream);
+

+Utility method for GPollableInputStream and GPollableOutputStream +implementations. Creates a new GSource that expects a callback of +type GPollableSourceFunc. The new source does not actually do +anything on its own; use g_source_add_child_source() to add other +sources to it to cause it to trigger. +

+
++ + + + + + + + + + +

pollable_stream :

the stream associated with the new source +

Returns :

the new GSource. + +
+

Since 2.28

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GPollableOutputStream.html b/docs/reference/gio/html/GPollableOutputStream.html new file mode 100644 index 0000000..8ae64ca --- /dev/null +++ b/docs/reference/gio/html/GPollableOutputStream.html @@ -0,0 +1,349 @@ + + + + +GPollableOutputStream + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GPollableOutputStream

+

GPollableOutputStream — Interface for pollable output streams

+
+ +
+

Object Hierarchy

+
+  GInterface
+   +----GPollableOutputStream
+
+
+
+

Prerequisites

+

+GPollableOutputStream requires + GOutputStream.

+
+
+

Known Implementations

+

+GPollableOutputStream is implemented by + GUnixOutputStream.

+
+
+

Description

+

+GPollableOutputStream is implemented by GOutputStreams that +can be polled for readiness to write. This can be used when +interfacing with a non-GIO API that expects +UNIX-file-descriptor-style asynchronous I/O rather than GIO-style. +

+
+
+

Details

+
+

GPollableOutputStream

+
typedef struct _GPollableOutputStream GPollableOutputStream;
+

+An interface for a GOutputStream that can be polled for readability. +

+

Since 2.28

+
+
+
+

GPollableOutputStreamInterface

+
typedef struct {
+  GTypeInterface g_iface;
+
+  /* Virtual Table */
+  gboolean     (*can_poll)          (GPollableOutputStream  *stream);
+
+  gboolean     (*is_writable)       (GPollableOutputStream  *stream);
+  GSource *    (*create_source)     (GPollableOutputStream  *stream,
+				     GCancellable           *cancellable);
+  gssize       (*write_nonblocking) (GPollableOutputStream  *stream,
+				     const void             *buffer,
+				     gsize                   size,
+				     GError                **error);
+} GPollableOutputStreamInterface;
+
+

+The interface for pollable output streams. +

+

+The default implementation of can_poll always returns TRUE. +

+

+The default implementation of write_nonblocking calls +g_pollable_output_stream_is_writable(), and then calls +g_output_stream_write() if it returns TRUE. This means you only +need to override it if it is possible that your is_writable +implementation may return TRUE when the stream is not actually +writable. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface g_iface;

The parent interface. +

can_poll ()

Checks if the GPollableOutputStream instance is actually pollable +

is_writable ()

Checks if the stream is writable +

create_source ()

Creates a GSource to poll the stream +

write_nonblocking ()

Does a non-blocking write or returns + G_IO_ERROR_WOULD_BLOCK +
+

Since 2.28

+
+
+
+

g_pollable_output_stream_can_poll ()

+
gboolean            g_pollable_output_stream_can_poll   (GPollableOutputStream *stream);
+

+Checks if stream is actually pollable. Some classes may implement +GPollableOutputStream but have only certain instances of that +class be pollable. If this method returns FALSE, then the behavior +of other GPollableOutputStream methods is undefined. +

+

+For any given stream, the value returned by this method is constant; +a stream cannot switch from pollable to non-pollable or vice versa. +

+
++ + + + + + + + + + +

stream :

a GPollableOutputStream. +

Returns :

TRUE if stream is pollable, FALSE if not. + +
+

Since 2.28

+
+
+
+

g_pollable_output_stream_is_writable ()

+
gboolean            g_pollable_output_stream_is_writable
+                                                        (GPollableOutputStream *stream);
+

+Checks if stream can be written. +

+

+Note that some stream types may not be able to implement this 100% +reliably, and it is possible that a call to g_output_stream_write() +after this returns TRUE would still block. To guarantee +non-blocking behavior, you should always use +g_pollable_output_stream_write_nonblocking(), which will return a +G_IO_ERROR_WOULD_BLOCK error rather than blocking. +

+
++ + + + + + + + + + +

stream :

a GPollableOutputStream. +

Returns :

TRUE if stream is writable, FALSE if not. If an error + has occurred on stream, this will result in + g_pollable_output_stream_is_writable() returning TRUE, and the + next attempt to write will return the error. + +
+

Since 2.28

+
+
+
+

g_pollable_output_stream_create_source ()

+
GSource *           g_pollable_output_stream_create_source
+                                                        (GPollableOutputStream *stream,
+                                                         GCancellable *cancellable);
+

+Creates a GSource that triggers when stream can be written, or +cancellable is triggered or an error occurs. The callback on the +source is of the GPollableSourceFunc type. +

+

+As with g_pollable_output_stream_is_writable(), it is possible that +the stream may not actually be writable even after the source +triggers, so you should use g_pollable_output_stream_write_nonblocking() +rather than g_output_stream_write() from the callback. +

+
++ + + + + + + + + + + + + + +

stream :

a GPollableOutputStream. +

cancellable :

a GCancellable, or NULL +

Returns :

a new GSource + +
+

Since 2.28

+
+
+
+

g_pollable_output_stream_write_nonblocking ()

+
gssize              g_pollable_output_stream_write_nonblocking
+                                                        (GPollableOutputStream *stream,
+                                                         const void *buffer,
+                                                         gsize size,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Attempts to write up to size bytes from buffer to stream, as +with g_output_stream_write(). If stream is not currently writable, +this will immediately return G_IO_ERROR_WOULD_BLOCK, and you can +use g_pollable_output_stream_create_source() to create a GSource +that will be triggered when stream is writable. +

+

+Note that since this method never blocks, you cannot actually +use cancellable to cancel it. However, it will return an error +if cancellable has already been cancelled when you call, which +may happen if you call this method after a source triggers due +to having been cancelled. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

stream :

a GPollableOutputStream +

buffer :

a buffer to write data from +

size :

the number of bytes you want to write +

cancellable :

a GCancellable, or NULL +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the number of bytes written, or -1 on error (including + G_IO_ERROR_WOULD_BLOCK). +
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GProxy.html b/docs/reference/gio/html/GProxy.html new file mode 100644 index 0000000..a5157f0 --- /dev/null +++ b/docs/reference/gio/html/GProxy.html @@ -0,0 +1,375 @@ + + + + +GProxy + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GProxy

+

GProxy — Interface for proxy handling

+
+
+

Synopsis

+
                    GProxy;
+                    GProxyInterface;
+#define             G_PROXY_EXTENSION_POINT_NAME
+GIOStream *         g_proxy_connect                     (GProxy *proxy,
+                                                         GIOStream *connection,
+                                                         GProxyAddress *proxy_address,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_proxy_connect_async               (GProxy *proxy,
+                                                         GIOStream *connection,
+                                                         GProxyAddress *proxy_address,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GIOStream *         g_proxy_connect_finish              (GProxy *proxy,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+GProxy *            g_proxy_get_default_for_protocol    (const gchar *protocol);
+gboolean            g_proxy_supports_hostname           (GProxy *proxy);
+
+
+
+

Object Hierarchy

+
+  GInterface
+   +----GProxy
+
+
+
+

Prerequisites

+

+GProxy requires + GObject.

+
+
+

Description

+

+A GProxy handles connecting to a remote host via a given type of +proxy server. It is implemented by the 'gio-proxy' extension point. +The extensions are named after their proxy protocol name. As an +example, a SOCKS5 proxy implementation can be retrieved with the +name 'socks5' using the function +g_io_extension_point_get_extension_by_name(). +

+
+
+

Details

+
+

GProxy

+
typedef struct _GProxy GProxy;
+

+Interface that handles proxy connection and payload. +

+

Since 2.26

+
+
+
+

GProxyInterface

+
typedef struct {
+  GTypeInterface g_iface;
+
+  /* Virtual Table */
+
+  GIOStream * (* connect)           (GProxy               *proxy,
+				     GIOStream            *connection,
+				     GProxyAddress        *proxy_address,
+				     GCancellable         *cancellable,
+				     GError              **error);
+
+  void        (* connect_async)     (GProxy               *proxy,
+				     GIOStream            *connection,
+				     GProxyAddress	  *proxy_address,
+				     GCancellable         *cancellable,
+				     GAsyncReadyCallback   callback,
+				     gpointer              user_data);
+
+  GIOStream * (* connect_finish)    (GProxy               *proxy,
+				     GAsyncResult         *result,
+				     GError              **error);
+
+  gboolean    (* supports_hostname) (GProxy             *proxy);
+} GProxyInterface;
+
+

+Provides an interface for handling proxy connection and payload. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface g_iface;

The parent interface. +

connect ()

Connect to proxy server and wrap (if required) the connection + to handle payload. +

connect_async ()

Same has connect() but asynchronous. +

connect_finish ()

Returns the result of connect_async() +

supports_hostname ()

+
+

Since 2.26

+
+
+
+

G_PROXY_EXTENSION_POINT_NAME

+
#define G_PROXY_EXTENSION_POINT_NAME "gio-proxy"
+
+

+Extension point for proxy functionality. +See Extending GIO. +

+

Since 2.26

+
+
+
+

g_proxy_connect ()

+
GIOStream *         g_proxy_connect                     (GProxy *proxy,
+                                                         GIOStream *connection,
+                                                         GProxyAddress *proxy_address,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Given connection to communicate with a proxy (eg, a +GSocketConnection that is connected to the proxy server), this +does the necessary handshake to connect to proxy_address, and if +required, wraps the GIOStream to handle proxy payload. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy :

a GProxy +

connection :

a GIOStream +

proxy_address :

a GProxyAddress +

cancellable :

a GCancellable +

error :

return GError +

Returns :

a GIOStream that will replace connection. This might + be the same as connection, in which case a reference + will be added. [transfer full] +
+

Since 2.26

+
+
+
+

g_proxy_connect_async ()

+
void                g_proxy_connect_async               (GProxy *proxy,
+                                                         GIOStream *connection,
+                                                         GProxyAddress *proxy_address,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronous version of g_proxy_connect(). +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy :

a GProxy +

connection :

a GIOStream +

proxy_address :

a GProxyAddress +

cancellable :

a GCancellable +

callback :

a GAsyncReadyCallback +

user_data :

callback data +
+

Since 2.26

+
+
+
+

g_proxy_connect_finish ()

+
GIOStream *         g_proxy_connect_finish              (GProxy *proxy,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+

+See g_proxy_connect(). +

+
++ + + + + + + + + + + + + + + + + + +

proxy :

a GProxy +

result :

a GAsyncRetult +

error :

return GError +

Returns :

a GIOStream. [transfer full] +
+

Since 2.26

+
+
+
+

g_proxy_get_default_for_protocol ()

+
GProxy *            g_proxy_get_default_for_protocol    (const gchar *protocol);
+

+Lookup "gio-proxy" extension point for a proxy implementation that supports +specified protocol. +

+
++ + + + + + + + + + +

protocol :

the proxy protocol name (e.g. http, socks, etc) +

Returns :

return a GProxy or NULL if protocol is not supported. + +
+

Since 2.26

+
+
+
+

g_proxy_supports_hostname ()

+
gboolean            g_proxy_supports_hostname           (GProxy *proxy);
+

+Some proxy protocols expect to be passed a hostname, which they +will resolve to an IP address themselves. Others, like SOCKS4, do +not allow this. This function will return FALSE if proxy is +implementing such a protocol. When FALSE is returned, the caller +should resolve the destination hostname first, and then pass a +GProxyAddress containing the stringified IP address to +g_proxy_connect() or g_proxy_connect_async(). +

+
++ + + + + + + + + + +

proxy :

a GProxy +

Returns :

TRUE if hostname resolution is supported. + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GProxyAddress.html b/docs/reference/gio/html/GProxyAddress.html new file mode 100644 index 0000000..c33aec9 --- /dev/null +++ b/docs/reference/gio/html/GProxyAddress.html @@ -0,0 +1,348 @@ + + + + +GProxyAddress + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GProxyAddress

+

GProxyAddress — An internet address with proxy information

+
+
+

Synopsis

+
                    GProxyAddress;
+                    GProxyAddressClass;
+const gchar *       g_proxy_address_get_destination_hostname
+                                                        (GProxyAddress *proxy);
+guint16             g_proxy_address_get_destination_port
+                                                        (GProxyAddress *proxy);
+const gchar *       g_proxy_address_get_password        (GProxyAddress *proxy);
+const gchar *       g_proxy_address_get_protocol        (GProxyAddress *proxy);
+const gchar *       g_proxy_address_get_username        (GProxyAddress *proxy);
+GSocketAddress *    g_proxy_address_new                 (GInetAddress *inetaddr,
+                                                         guint16 port,
+                                                         const gchar *protocol,
+                                                         const gchar *dest_hostname,
+                                                         guint16 dest_port,
+                                                         const gchar *username,
+                                                         const gchar *password);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GSocketAddress
+         +----GInetSocketAddress
+               +----GProxyAddress
+
+
+
+

Implemented Interfaces

+

+GProxyAddress implements + GSocketConnectable.

+
+
+

Properties

+
+  "destination-hostname"     gchar*                : Read / Write / Construct Only
+  "destination-port"         guint                 : Read / Write / Construct Only
+  "password"                 gchar*                : Read / Write / Construct Only
+  "protocol"                 gchar*                : Read / Write / Construct Only
+  "username"                 gchar*                : Read / Write / Construct Only
+
+
+
+

Description

+

+Support for proxied GInetSocketAddress. +

+
+
+

Details

+
+

GProxyAddress

+
typedef struct _GProxyAddress GProxyAddress;
+

+A GInetSocketAddress representing a connection via a proxy server +

+

Since 2.26

+
+
+
+

GProxyAddressClass

+
typedef struct {
+  GInetSocketAddressClass parent_class;
+} GProxyAddressClass;
+
+

+

+
+
+
+

g_proxy_address_get_destination_hostname ()

+
const gchar *       g_proxy_address_get_destination_hostname
+                                                        (GProxyAddress *proxy);
+

+Gets proxy's destination hostname. +

+
++ + + + + + + + + + +

proxy :

a GProxyAddress +

Returns :

the proxy's destination hostname + +
+

Since 2.26

+
+
+
+

g_proxy_address_get_destination_port ()

+
guint16             g_proxy_address_get_destination_port
+                                                        (GProxyAddress *proxy);
+

+Gets proxy's destination port. +

+
++ + + + + + + + + + +

proxy :

a GProxyAddress +

Returns :

the proxy's destination port + +
+

Since 2.26

+
+
+
+

g_proxy_address_get_password ()

+
const gchar *       g_proxy_address_get_password        (GProxyAddress *proxy);
+

+Gets proxy's password. +

+
++ + + + + + + + + + +

proxy :

a GProxyAddress +

Returns :

the proxy's password + +
+

Since 2.26

+
+
+
+

g_proxy_address_get_protocol ()

+
const gchar *       g_proxy_address_get_protocol        (GProxyAddress *proxy);
+

+Gets proxy's protocol. +

+
++ + + + + + + + + + +

proxy :

a GProxyAddress +

Returns :

the proxy's protocol + +
+

Since 2.26

+
+
+
+

g_proxy_address_get_username ()

+
const gchar *       g_proxy_address_get_username        (GProxyAddress *proxy);
+

+Gets proxy's username. +

+
++ + + + + + + + + + +

proxy :

a GProxyAddress +

Returns :

the proxy's username + +
+

Since 2.26

+
+
+
+

g_proxy_address_new ()

+
GSocketAddress *    g_proxy_address_new                 (GInetAddress *inetaddr,
+                                                         guint16 port,
+                                                         const gchar *protocol,
+                                                         const gchar *dest_hostname,
+                                                         guint16 dest_port,
+                                                         const gchar *username,
+                                                         const gchar *password);
+

+Creates a new GProxyAddress for inetaddr with protocol that should +tunnel through dest_hostname and dest_port. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

inetaddr :

The proxy server GInetAddress. +

port :

The proxy server port. +

protocol :

The proxy protocol to support, in lower case (e.g. socks, http). +

dest_hostname :

The destination hostname the the proxy should tunnel to. +

dest_port :

The destination port to tunnel to. +

username :

The username to authenticate to the proxy server (or NULL). +

password :

The password to authenticate to the proxy server (or NULL). +

Returns :

a new GProxyAddress + +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "destination-hostname" property

+
  "destination-hostname"     gchar*                : Read / Write / Construct Only
+

The proxy destination hostname.

+

Default value: NULL

+
+
+
+

The "destination-port" property

+
  "destination-port"         guint                 : Read / Write / Construct Only
+

The proxy destination port.

+

Allowed values: <= 65535

+

Default value: 0

+
+
+
+

The "password" property

+
  "password"                 gchar*                : Read / Write / Construct Only
+

The proxy password.

+

Default value: NULL

+
+
+
+

The "protocol" property

+
  "protocol"                 gchar*                : Read / Write / Construct Only
+

The proxy protocol.

+

Default value: NULL

+
+
+
+

The "username" property

+
  "username"                 gchar*                : Read / Write / Construct Only
+

The proxy username.

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GProxyResolver.html b/docs/reference/gio/html/GProxyResolver.html new file mode 100644 index 0000000..a71a7d6 --- /dev/null +++ b/docs/reference/gio/html/GProxyResolver.html @@ -0,0 +1,327 @@ + + + + +GProxyResolver + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GProxyResolver

+

GProxyResolver — Asynchronous and cancellable network proxy resolver

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GProxyResolver;
+                    GProxyResolverInterface;
+#define             G_PROXY_RESOLVER_EXTENSION_POINT_NAME
+GProxyResolver *    g_proxy_resolver_get_default        (void);
+gboolean            g_proxy_resolver_is_supported       (GProxyResolver *resolver);
+gchar **            g_proxy_resolver_lookup             (GProxyResolver *resolver,
+                                                         const gchar *uri,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+void                g_proxy_resolver_lookup_async       (GProxyResolver *resolver,
+                                                         const gchar *uri,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+gchar **            g_proxy_resolver_lookup_finish      (GProxyResolver *resolver,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+
+
+
+

Object Hierarchy

+
+  GInterface
+   +----GProxyResolver
+
+
+
+

Prerequisites

+

+GProxyResolver requires + GObject.

+
+
+

Description

+

+GProxyResolver provides synchronous and asynchronous network proxy +resolution. GProxyResolver is used within GClientSocket through +the method g_socket_connectable_proxy_enumerate(). +

+
+
+

Details

+
+

GProxyResolver

+
typedef struct _GProxyResolver GProxyResolver;
+

+Interface that can be used to resolve proxy address. +

+

Since 2.26

+
+
+
+

GProxyResolverInterface

+
typedef struct {
+  GTypeInterface g_iface;
+
+  /* Virtual Table */
+  gboolean (* is_supported)  (GProxyResolver       *resolver);
+
+  gchar ** (* lookup)        (GProxyResolver       *resolver,
+			      const gchar          *uri,
+			      GCancellable         *cancellable,
+			      GError              **error);
+
+  void     (* lookup_async)  (GProxyResolver       *resolver,
+			      const gchar          *uri,
+			      GCancellable         *cancellable,
+			      GAsyncReadyCallback   callback,
+			      gpointer              user_data);
+
+  gchar ** (* lookup_finish) (GProxyResolver       *resolver,
+			      GAsyncResult         *result,
+			      GError              **error);
+} GProxyResolverInterface;
+
+

+

+
+
+
+

G_PROXY_RESOLVER_EXTENSION_POINT_NAME

+
#define G_PROXY_RESOLVER_EXTENSION_POINT_NAME "gio-proxy-resolver"
+
+

+Extension point for proxy resolving functionality. +See Extending GIO. +

+
+
+
+

g_proxy_resolver_get_default ()

+
GProxyResolver *    g_proxy_resolver_get_default        (void);
+

+Gets the default GProxyResolver for the system. +

+
++ + + + +

Returns :

the default GProxyResolver. [transfer none] +
+

Since 2.26

+
+
+
+

g_proxy_resolver_is_supported ()

+
gboolean            g_proxy_resolver_is_supported       (GProxyResolver *resolver);
+

+Checks if resolver can be used on this system. (This is used +internally; g_proxy_resolver_get_default() will only return a proxy +resolver that returns TRUE for this method.) +

+
++ + + + + + + + + + +

resolver :

a GProxyResolver +

Returns :

TRUE if resolver is supported. + +
+

Since 2.26

+
+
+
+

g_proxy_resolver_lookup ()

+
gchar **            g_proxy_resolver_lookup             (GProxyResolver *resolver,
+                                                         const gchar *uri,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Looks into the system proxy configuration to determine what proxy, +if any, to use to connect to uri. The returned proxy URIs are of the +form <protocol>://[user[:password]@]host:port +or direct://, where <protocol> could be +http, rtsp, socks or other proxying protocol. +

+

+If you don't know what network protocol is being used on the +socket, you should use none as the URI protocol. +In this case, the resolver might still return a generic proxy type +(such as SOCKS), but would not return protocol-specific proxy types +(such as http). +

+

+direct:// is used when no proxy is needed. +Direct connection should not be attempted unless it is part of the +returned array of proxies. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

resolver :

a GProxyResolver +

uri :

a URI representing the destination to connect to +

cancellable :

a GCancellable, or NULL +

error :

return location for a GError, or NULL +

Returns :

A NULL-terminated array of proxy URIs. Must be freed with + g_strfreev(). [transfer full][element-type utf8] +
+

Since 2.26

+
+
+
+

g_proxy_resolver_lookup_async ()

+
void                g_proxy_resolver_lookup_async       (GProxyResolver *resolver,
+                                                         const gchar *uri,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more +details. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

resolver :

a GProxyResolver +

uri :

a URI representing the destination to connect to +

cancellable :

a GCancellable, or NULL +

callback :

callback to call after resolution completes +

user_data :

data for callback +
+

Since 2.26

+
+
+
+

g_proxy_resolver_lookup_finish ()

+
gchar **            g_proxy_resolver_lookup_finish      (GProxyResolver *resolver,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+

+Call this function to obtain the array of proxy URIs when +g_proxy_resolver_lookup_async() is complete. See +g_proxy_resolver_lookup() for more details. +

+
++ + + + + + + + + + + + + + + + + + +

resolver :

a GProxyResolver +

result :

the result passed to your GAsyncReadyCallback +

error :

return location for a GError, or NULL +

Returns :

A NULL-terminated array of proxy URIs. Must be freed with + g_strfreev(). [transfer full][element-type utf8] +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GResolver.html b/docs/reference/gio/html/GResolver.html index aecdd6a..ee5f87f 100644 --- a/docs/reference/gio/html/GResolver.html +++ b/docs/reference/gio/html/GResolver.html @@ -3,12 +3,12 @@ GResolver - + - - + + @@ -18,7 +18,7 @@ Up Home GIO Reference Manual -Next +Next Top @@ -47,48 +47,48 @@ GResolver; GResolver * g_resolver_get_default (void); void g_resolver_set_default (GResolver *resolver); -GList * g_resolver_lookup_by_name (GResolver *resolver, - const gchar *hostname, +GList * g_resolver_lookup_by_name (GResolver *resolver, + const gchar *hostname, GCancellable *cancellable, - GError **error); + GError **error); void g_resolver_lookup_by_name_async (GResolver *resolver, - const gchar *hostname, + const gchar *hostname, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -GList * g_resolver_lookup_by_name_finish (GResolver *resolver, + gpointer user_data); +GList * g_resolver_lookup_by_name_finish (GResolver *resolver, GAsyncResult *result, - GError **error); -void g_resolver_free_addresses (GList *addresses); -gchar * g_resolver_lookup_by_address (GResolver *resolver, + GError **error); +void g_resolver_free_addresses (GList *addresses); +gchar * g_resolver_lookup_by_address (GResolver *resolver, GInetAddress *address, GCancellable *cancellable, - GError **error); + GError **error); void g_resolver_lookup_by_address_async (GResolver *resolver, GInetAddress *address, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gchar * g_resolver_lookup_by_address_finish (GResolver *resolver, + gpointer user_data); +gchar * g_resolver_lookup_by_address_finish (GResolver *resolver, GAsyncResult *result, - GError **error); -GList * g_resolver_lookup_service (GResolver *resolver, - const gchar *service, - const gchar *protocol, - const gchar *domain, + GError **error); +GList * g_resolver_lookup_service (GResolver *resolver, + const gchar *service, + const gchar *protocol, + const gchar *domain, GCancellable *cancellable, - GError **error); + GError **error); void g_resolver_lookup_service_async (GResolver *resolver, - const gchar *service, - const gchar *protocol, - const gchar *domain, + const gchar *service, + const gchar *protocol, + const gchar *domain, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -GList * g_resolver_lookup_service_finish (GResolver *resolver, + gpointer user_data); +GList * g_resolver_lookup_service_finish (GResolver *resolver, GAsyncResult *result, - GError **error); -void g_resolver_free_targets (GList *targets); + GError **error); +void g_resolver_free_targets (GList *targets); #define G_RESOLVER_ERROR enum GResolverError; @@ -97,7 +97,7 @@ enum

Object Hierarchy

-  GObject
+  GObject
    +----GResolver
 
@@ -145,8 +145,7 @@ resolutions.

Returns :

- the default GResolver. - + the default GResolver. [transfer full]
@@ -181,10 +180,10 @@ itself as the default resolver for all later code to use.

g_resolver_lookup_by_name ()

-
GList *             g_resolver_lookup_by_name           (GResolver *resolver,
-                                                         const gchar *hostname,
+
GList *             g_resolver_lookup_by_name           (GResolver *resolver,
+                                                         const gchar *hostname,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Synchronously resolves hostname to determine its associated IP address(es). hostname may be an ASCII-only or UTF-8 hostname, or @@ -192,18 +191,18 @@ the textual form of an IP address (in which case this just becomes a wrapper around g_inet_address_new_from_string()).

-On success, g_resolver_lookup_by_name() will return a GList of +On success, g_resolver_lookup_by_name() will return a GList of GInetAddress, sorted in order of preference. (That is, you should attempt to connect to the first address first, then the second if the first fails, etc.)

-If the DNS resolution fails, error (if non-NULL) will be set to a +If the DNS resolution fails, error (if non-NULL) will be set to a value from GResolverError.

-If cancellable is non-NULL, it can be used to cancel the -operation, in which case error (if non-NULL) will be set to +If cancellable is non-NULL, it can be used to cancel the +operation, in which case error (if non-NULL) will be set to G_IO_ERROR_CANCELLED.

@@ -226,20 +225,20 @@ address, it may be easier to create a cancellable :

-a GCancellable, or NULL +a GCancellable, or NULL

error :

-return location for a GError, or NULL +return location for a GError, or NULL

Returns :

- a GList of GInetAddress, or NULL on error. You + a GList +of GInetAddress, or NULL on error. You must unref each of the addresses and free the list when you are -done with it. (You can use g_resolver_free_addresses() to do this.) - +done with it. (You can use g_resolver_free_addresses() to do this.). [element-type GInetAddress][transfer full GInetAddress] @@ -250,10 +249,10 @@ done with it. (You can use

g_resolver_lookup_by_name_async ()

void                g_resolver_lookup_by_name_async     (GResolver *resolver,
-                                                         const gchar *hostname,
+                                                         const gchar *hostname,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Begins asynchronously resolving hostname to determine its associated IP address(es), and eventually calls callback, which @@ -275,7 +274,7 @@ See cancellable :

-a GCancellable, or NULL +a GCancellable, or NULL @@ -295,15 +294,15 @@ See

g_resolver_lookup_by_name_finish ()

-
GList *             g_resolver_lookup_by_name_finish    (GResolver *resolver,
+
GList *             g_resolver_lookup_by_name_finish    (GResolver *resolver,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Retrieves the result of a call to g_resolver_lookup_by_name_async().

-If the DNS resolution failed, error (if non-NULL) will be set to +If the DNS resolution failed, error (if non-NULL) will be set to a value from GResolverError. If the operation was cancelled, error will be set to G_IO_ERROR_CANCELLED.

@@ -322,14 +321,14 @@ a value from error :

-return location for a
GError, or NULL +return location for a GError, or NULL

Returns :

- a GList of GInetAddress, or NULL on error. See -g_resolver_lookup_by_name() for more details. - + a GList +of GInetAddress, or NULL on error. See g_resolver_lookup_by_name() +for more details. [element-type GInetAddress][transfer full GInetAddress] @@ -339,7 +338,7 @@ a value from

g_resolver_free_addresses ()

-
void                g_resolver_free_addresses           (GList *addresses);
+
void                g_resolver_free_addresses           (GList *addresses);

Frees addresses (which should be the return value from g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()). @@ -350,7 +349,7 @@ by hand.)

addresses :

-a GList of GInetAddress +a GList of GInetAddress
@@ -359,21 +358,21 @@ by hand.)

g_resolver_lookup_by_address ()

-
gchar *             g_resolver_lookup_by_address        (GResolver *resolver,
+
gchar *             g_resolver_lookup_by_address        (GResolver *resolver,
                                                          GInetAddress *address,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Synchronously reverse-resolves address to determine its associated hostname.

-If the DNS resolution fails, error (if non-NULL) will be set to +If the DNS resolution fails, error (if non-NULL) will be set to a value from GResolverError.

-If cancellable is non-NULL, it can be used to cancel the -operation, in which case error (if non-NULL) will be set to +If cancellable is non-NULL, it can be used to cancel the +operation, in which case error (if non-NULL) will be set to G_IO_ERROR_CANCELLED.

@@ -391,18 +390,18 @@ operation, in which case error (if non-< - - @@ -417,7 +416,7 @@ operation, in which case error (if non-< GInetAddress *address, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Begins asynchronously reverse-resolving address to determine its associated hostname, and eventually calls callback, which must @@ -438,7 +437,7 @@ call

- @@ -458,15 +457,15 @@ call

g_resolver_lookup_by_address_finish ()

-
gchar *             g_resolver_lookup_by_address_finish (GResolver *resolver,
+
gchar *             g_resolver_lookup_by_address_finish (GResolver *resolver,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Retrieves the result of a previous call to g_resolver_lookup_by_address_async().

-If the DNS resolution failed, error (if non-NULL) will be set to +If the DNS resolution failed, error (if non-NULL) will be set to a value from GResolverError. If the operation was cancelled, error will be set to G_IO_ERROR_CANCELLED.

@@ -485,13 +484,13 @@ a value from error :

-
@@ -502,12 +501,12 @@ form), or

g_resolver_lookup_service ()

-
GList *             g_resolver_lookup_service           (GResolver *resolver,
-                                                         const gchar *service,
-                                                         const gchar *protocol,
-                                                         const gchar *domain,
+
GList *             g_resolver_lookup_service           (GResolver *resolver,
+                                                         const gchar *service,
+                                                         const gchar *protocol,
+                                                         const gchar *domain,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Synchronously performs a DNS SRV lookup for the given service and protocol in the given domain and returns an array of GSrvTarget. @@ -517,18 +516,18 @@ include the leading underscore that appears in the actual DNS entry.

-On success, g_resolver_lookup_service() will return a GList of +On success, g_resolver_lookup_service() will return a GList of GSrvTarget, sorted in order of preference. (That is, you should attempt to connect to the first target first, then the second if the first fails, etc.)

-If the DNS resolution fails, error (if non-NULL) will be set to +If the DNS resolution fails, error (if non-NULL) will be set to a value from GResolverError.

-If cancellable is non-NULL, it can be used to cancel the -operation, in which case error (if non-NULL) will be set to +If cancellable is non-NULL, it can be used to cancel the +operation, in which case error (if non-NULL) will be set to G_IO_ERROR_CANCELLED.

@@ -561,20 +560,19 @@ interface.

- - - @@ -585,12 +583,12 @@ free each of the targets and the list when you are done with it.

g_resolver_lookup_service_async ()

void                g_resolver_lookup_service_async     (GResolver *resolver,
-                                                         const gchar *service,
-                                                         const gchar *protocol,
-                                                         const gchar *domain,
+                                                         const gchar *service,
+                                                         const gchar *protocol,
+                                                         const gchar *domain,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

Begins asynchronously performing a DNS SRV lookup for the given service and protocol in the given domain, and eventually calls @@ -623,7 +621,7 @@ details.

- @@ -643,15 +641,15 @@ details.

g_resolver_lookup_service_finish ()

-
GList *             g_resolver_lookup_service_finish    (GResolver *resolver,
+
GList *             g_resolver_lookup_service_finish    (GResolver *resolver,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Retrieves the result of a previous call to g_resolver_lookup_service_async().

-If the DNS resolution failed, error (if non-NULL) will be set to +If the DNS resolution failed, error (if non-NULL) will be set to a value from GResolverError. If the operation was cancelled, error will be set to G_IO_ERROR_CANCELLED.

@@ -670,14 +668,13 @@ a value from error :

-
- @@ -687,7 +684,7 @@ a value from

g_resolver_free_targets ()

-
void                g_resolver_free_targets             (GList *targets);
+
void                g_resolver_free_targets             (GList *targets);

Frees targets (which should be the return value from g_resolver_lookup_service() or g_resolver_lookup_service_finish()). @@ -698,7 +695,7 @@ results by hand.)

-

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL

error :

return location for a GError, or NULL +return location for a GError, or NULL

Returns :

a hostname (either ASCII-only, or in ASCII-encoded - form), or NULL on error. + form), or NULL on error.

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL
return location for a GError, or NULL +return location for a GError, or NULL

Returns :

a hostname (either ASCII-only, or in ASCII-encoded -form), or NULL on error. +form), or NULL on error.

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL

error :

return location for a GError, or NULL +return location for a GError, or NULL

Returns :

a GList of GSrvTarget, or NULL on error. You must -free each of the targets and the list when you are done with it. -(You can use g_resolver_free_targets() to do this.) - + a GList of GSrvTarget, +or NULL on error. You must free each of the targets and the list when you are +done with it. (You can use g_resolver_free_targets() to do this.). [element-type GSrvTarget][transfer full GSrvTarget]

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL
return location for a GError, or NULL +return location for a GError, or NULL

Returns :

a GList of GSrvTarget, or NULL on error. See -g_resolver_lookup_service() for more details. - + a GList of GSrvTarget, +or NULL on error. See g_resolver_lookup_service() for more details. [element-type GSrvTarget][transfer full GSrvTarget]

targets :

a GList of GSrvTarget +a GList of GSrvTarget
@@ -711,7 +708,7 @@ results by hand.)

Error domain for GResolver. Errors in this domain will be from the -GResolverError enumeration. See GError for more information on +GResolverError enumeration. See GError for more information on error domains.

@@ -725,7 +722,7 @@ error domains. } GResolverError;

-An error code used with G_RESOLVER_ERROR in a GError returned +An error code used with G_RESOLVER_ERROR in a GError returned from a GResolver routine.

@@ -758,7 +755,7 @@ from a

The "reload" signal

void                user_function                      (GResolver *resolver,
-                                                        gpointer   user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the resolver notices that the system resolver configuration has changed. @@ -782,6 +779,6 @@ configuration has changed.

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GSeekable.html b/docs/reference/gio/html/GSeekable.html index ced9013..3bbf6e4 100644 --- a/docs/reference/gio/html/GSeekable.html +++ b/docs/reference/gio/html/GSeekable.html @@ -3,12 +3,12 @@ GSeekable - + - + @@ -48,18 +48,18 @@ GSeekable; GSeekableIface; -goffsetg_seekable_tell (GSeekable *seekable); -gbooleang_seekable_can_seek (GSeekable *seekable); -gbooleang_seekable_seek (GSeekable *seekable, - goffset offset, - GSeekType type, +goffsetg_seekable_tell (GSeekable *seekable); +gbooleang_seekable_can_seek (GSeekable *seekable); +gbooleang_seekable_seek (GSeekable *seekable, + goffset offset, + GSeekType type, GCancellable *cancellable, - GError **error); -gbooleang_seekable_can_truncate (GSeekable *seekable); -gbooleang_seekable_truncate (GSeekable *seekable, - goffset offset, + GError **error); +gbooleang_seekable_can_truncate (GSeekable *seekable); +gbooleang_seekable_truncate (GSeekable *seekable, + goffset offset, GCancellable *cancellable, - GError **error); + GError **error);
@@ -73,7 +73,7 @@

Prerequisites

GSeekable requires - GObject.

+ GObject.

Known Implementations

@@ -130,7 +130,7 @@ Provides an interface for implementing seekable functionality on I/O Streams.
- + @@ -165,7 +165,7 @@ Provides an interface for implementing seekable functionality on I/O Streams.

g_seekable_tell ()

-
goffset             g_seekable_tell                     (GSeekable *seekable);
+
goffset             g_seekable_tell                     (GSeekable *seekable);

Tells the current position within the stream.

@@ -188,7 +188,7 @@ Tells the current position within the stream.

g_seekable_can_seek ()

-
gboolean            g_seekable_can_seek                 (GSeekable *seekable);
+
gboolean            g_seekable_can_seek                 (GSeekable *seekable);

Tests if the stream supports the GSeekableIface.

@@ -202,7 +202,7 @@ Tests if the stream supports the Returns :

-
@@ -211,16 +211,16 @@ Tests if the stream supports the

g_seekable_seek ()

-
gboolean            g_seekable_seek                     (GSeekable *seekable,
-                                                         goffset offset,
-                                                         GSeekType type,
+
gboolean            g_seekable_seek                     (GSeekable *seekable,
+                                                         goffset offset,
+                                                         GSeekType type,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Seeks in the stream by the given offset, modified by type.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -234,29 +234,29 @@ was cancelled, the error offset :

-
- - - - @@ -266,7 +266,7 @@ ignore.

g_seekable_can_truncate ()

-
gboolean            g_seekable_can_truncate             (GSeekable *seekable);
+
gboolean            g_seekable_can_truncate             (GSeekable *seekable);

Tests if the stream can be truncated.

@@ -280,7 +280,7 @@ Tests if the stream can be truncated.
- @@ -289,20 +289,23 @@ Tests if the stream can be truncated.

g_seekable_truncate ()

-
gboolean            g_seekable_truncate                 (GSeekable *seekable,
-                                                         goffset offset,
+
gboolean            g_seekable_truncate                 (GSeekable *seekable,
+                                                         goffset offset,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Truncates a stream with a given offset.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error.

+

+Virtual: truncate_fn +

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.
TRUE if seekable can be seeked. FALSE otherwise. + TRUE if seekable can be seeked. FALSE otherwise.
a goffset. +a goffset.

type :

a GSeekType. +a GSeekType.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if successful. If an error - has occurred, this function will return FALSE and set error + TRUE if successful. If an error + has occurred, this function will return FALSE and set error appropriately if present.

Returns :

TRUE if the stream can be truncated, FALSE otherwise. + TRUE if the stream can be truncated, FALSE otherwise.
@@ -313,24 +316,24 @@ partial result will be returned, without an error. - - - - @@ -345,6 +348,6 @@ ignore. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GSettings.html b/docs/reference/gio/html/GSettings.html new file mode 100644 index 0000000..7c93891 --- /dev/null +++ b/docs/reference/gio/html/GSettings.html @@ -0,0 +1,2659 @@ + + + + +GSettings + + + + + + + + + +

offset :

a goffset. +a goffset.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if successful. If an error - has occurred, this function will return FALSE and set error + TRUE if successful. If an error + has occurred, this function will return FALSE and set error appropriately if present.
+ + + + + + + + + +
+
+
+ + +
+

GSettings

+

GSettings — High-level API for application settings

+
+
+

Synopsis

+
                    GSettings;
+GSettings *         g_settings_new                      (const gchar *schema);
+GSettings *         g_settings_new_with_path            (const gchar *schema,
+                                                         const gchar *path);
+GSettings *         g_settings_new_with_backend         (const gchar *schema,
+                                                         GSettingsBackend *backend);
+GSettings *         g_settings_new_with_backend_and_path
+                                                        (const gchar *schema,
+                                                         GSettingsBackend *backend,
+                                                         const gchar *path);
+void                g_settings_sync                     (void);
+GVariant *          g_settings_get_value                (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_value                (GSettings *settings,
+                                                         const gchar *key,
+                                                         GVariant *value);
+gboolean            g_settings_is_writable              (GSettings *settings,
+                                                         const gchar *name);
+void                g_settings_delay                    (GSettings *settings);
+void                g_settings_apply                    (GSettings *settings);
+void                g_settings_revert                   (GSettings *settings);
+gboolean            g_settings_get_has_unapplied        (GSettings *settings);
+GSettings *         g_settings_get_child                (GSettings *settings,
+                                                         const gchar *name);
+void                g_settings_reset                    (GSettings *settings,
+                                                         const gchar *key);
+
+gchar **            g_settings_list_keys                (GSettings *settings);
+gchar **            g_settings_list_children            (GSettings *settings);
+GVariant *          g_settings_get_range                (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_range_check              (GSettings *settings,
+                                                         const gchar *key,
+                                                         GVariant *value);
+
+void                g_settings_get                      (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *format,
+                                                         ...);
+gboolean            g_settings_set                      (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *format,
+                                                         ...);
+gboolean            g_settings_get_boolean              (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_boolean              (GSettings *settings,
+                                                         const gchar *key,
+                                                         gboolean value);
+gint                g_settings_get_int                  (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_int                  (GSettings *settings,
+                                                         const gchar *key,
+                                                         gint value);
+gdouble             g_settings_get_double               (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_double               (GSettings *settings,
+                                                         const gchar *key,
+                                                         gdouble value);
+gchar *             g_settings_get_string               (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_string               (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *value);
+gchar **            g_settings_get_strv                 (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_strv                 (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *const *value);
+gint                g_settings_get_enum                 (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_enum                 (GSettings *settings,
+                                                         const gchar *key,
+                                                         gint value);
+guint               g_settings_get_flags                (GSettings *settings,
+                                                         const gchar *key);
+gboolean            g_settings_set_flags                (GSettings *settings,
+                                                         const gchar *key,
+                                                         guint value);
+
+gboolean            (*GSettingsGetMapping)              (GVariant *value,
+                                                         gpointer *result,
+                                                         gpointer user_data);
+gpointer            g_settings_get_mapped               (GSettings *settings,
+                                                         const gchar *key,
+                                                         GSettingsGetMapping mapping,
+                                                         gpointer user_data);
+
+enum                GSettingsBindFlags;
+void                g_settings_bind                     (GSettings *settings,
+                                                         const gchar *key,
+                                                         gpointer object,
+                                                         const gchar *property,
+                                                         GSettingsBindFlags flags);
+void                g_settings_bind_with_mapping        (GSettings *settings,
+                                                         const gchar *key,
+                                                         gpointer object,
+                                                         const gchar *property,
+                                                         GSettingsBindFlags flags,
+                                                         GSettingsBindGetMapping get_mapping,
+                                                         GSettingsBindSetMapping set_mapping,
+                                                         gpointer user_data,
+                                                         GDestroyNotify destroy);
+void                g_settings_bind_writable            (GSettings *settings,
+                                                         const gchar *key,
+                                                         gpointer object,
+                                                         const gchar *property,
+                                                         gboolean inverted);
+void                g_settings_unbind                   (gpointer object,
+                                                         const gchar *property);
+GVariant *          (*GSettingsBindSetMapping)          (const GValue *value,
+                                                         const GVariantType *expected_type,
+                                                         gpointer user_data);
+gboolean            (*GSettingsBindGetMapping)          (GValue *value,
+                                                         GVariant *variant,
+                                                         gpointer user_data);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GSettings
+
+
+
+

Properties

+
+  "backend"                  GSettingsBackend*     : Read / Write / Construct Only
+  "delay-apply"              gboolean              : Read
+  "has-unapplied"            gboolean              : Read
+  "path"                     gchar*                : Read / Write / Construct Only
+  "schema"                   gchar*                : Read / Write / Construct Only
+
+
+
+

Signals

+
+  "change-event"                                   : Run Last
+  "changed"                                        : Run Last / Has Details
+  "writable-change-event"                          : Run Last
+  "writable-changed"                               : Run Last / Has Details
+
+
+
+

Description

+

+The GSettings class provides a convenient API for storing and retrieving +application settings. +

+

+When creating a GSettings instance, you have to specify a schema +that describes the keys in your settings and their types and default +values, as well as some other information. +

+

+Normally, a schema has as fixed path that determines where the settings +are stored in the conceptual global tree of settings. However, schemas +can also be 'relocatable', i.e. not equipped with a fixed path. This is +useful e.g. when the schema describes an 'account', and you want to be +able to store a arbitrary number of accounts. +

+

+Unlike other configuration systems (like GConf), GSettings does not +restrict keys to basic types like strings and numbers. GSettings stores +values as GVariant, and allows any GVariantType for keys. Key names +are restricted to lowercase characters, numbers and '-'. Furthermore, +the names must begin with a lowercase character, must not end +with a '-', and must not contain consecutive dashes. Key names can +be up to 32 characters long. +

+

+Similar to GConf, the default values in GSettings schemas can be +localized, but the localized values are stored in gettext catalogs +and looked up with the domain that is specified in the +gettext-domain attribute of the +<schemalist> or <schema> +elements and the category that is specified in the l10n attribute of the +<key> element. +

+

+GSettings uses schemas in a compact binary form that is created +by the glib-compile-schemas +utility. The input is a schema description in an XML format that can be +described by the following DTD: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
<!ELEMENT schemalist (schema|enum)* >
+<!ATTLIST schemalist gettext-domain #IMPLIED >
+
+<!ELEMENT schema (key|child)* >
+<!ATTLIST schema id             CDATA #REQUIRED
+                 path           CDATA #IMPLIED
+                 gettext-domain CDATA #IMPLIED >
+
+<!-- enumerated and flags types -->
+<!-- each value element maps a nick to a numeric value -->
+<!ELEMENT enum (value*) >
+<!ATTLIST enum id CDATA #REQUIRED >
+
+<!ELEMENT flags (value*) >
+<!ATTLIST flags id CDATA #REQUIRED >
+
+<!ELEMENT value EMPTY >
+<!-- nick must be at least 2 characters long -->
+<!-- value must be parsable as a 32-bit integer -->
+<!ELEMENT value nick  #REQUIRED
+                value #REQUIRED >
+
+<!ELEMENT key (default|summary?|description?|range?|choices?|aliases?) >
+<!-- name can only contain lowercase letters, numbers and '-' -->
+<!-- type must be a GVariant type string -->
+<!-- enum must be the id of an enum type that has been defined earlier -->
+<!-- flags must be the id of a flags type that has been defined earlier -->
+<!-- exactly one of type, enum or flags must be given -->
+<!ATTLIST key name  CDATA #REQUIRED
+              type  CDATA #IMPLIED
+              enum  CDATA #IMPLIED
+              flags CDATA #IMPLIED >
+
+<!-- the default value is specified a a serialized GVariant,
+     i.e. you have to include the quotes when specifying a string -->
+<!ELEMENT default (#PCDATA) >
+<!-- the presence of the l10n attribute marks a default value for
+     translation, its value is the gettext category to use -->
+<!-- if context is present, it specifies msgctxt to use -->
+<!ATTLIST default l10n    (messages|time) #IMPLIED
+                  context CDATA           #IMPLIED >
+
+<!ELEMENT summary (#PCDATA) >
+<!ELEMENT description (#PCDATA) >
+
+<!-- range is only allowed for keys with numeric type -->
+<!ELEMENT range EMPTY >
+<!-- min and max must be parseable as values of the key type and min < max -->
+<!ATTLIST range min CDATA #REQUIRED
+                max CDATA #REQUIRED >
+
+<!-- choices is only allowed for keys with string or string array type -->
+<!ELEMENT choices (choice+) >
+<!-- each choice element specifies one possible value -->
+<!ELEMENT choice EMPTY >
+<!ATTLIST choice value CDATA #REQUIRED >
+
+<!-- aliases is only allowed for keys with enumerated type or with choices -->
+<!ELEMENT aliases (alias+) >
+<!-- each alias element specifies an alias for one of the possible values -->
+<!ELEMENT alias EMPTY >
+<!ATTLIST alias value CDATA #REQUIRED >
+
+<!ELEMENT child EMPTY >
+<!ATTLIST child name   CDATA #REQUIRED
+                schema CDATA #REQUIRED >
+
+ +

+

+

+At runtime, schemas are identified by their id (as specified +in the id attribute of the +<schema> element). The +convention for schema ids is to use a dotted name, similar in +style to a DBus bus name, e.g. "org.gnome.font-rendering". +

+

+In addition to GVariant types, keys can have types that have enumerated +types. These can be described by a <choice>, +<enum> or <flags> element, see +Example 12, “Ranges, choices and enumerated types”. The underlying type of +such a key is string, but you can use g_settings_get_enum(), +g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags() +access the numeric values corresponding to the string value of enum +and flags keys. +

+

+

+
+

Example 11. Default values

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
<schemalist>
+  <schema id="org.gtk.test" path="/tests/" gettext-domain="test">
+
+    <key name="greeting" type="s">
+      <default l10n="messages">"Hello, earthlings"</default>
+      <summary>A greeting</summary>
+      <description>
+        Greeting of the invading martians
+      </description>
+    </key>
+
+    <key name="box" type="(ii)">
+      <default>(20,30)</default>
+    </key>
+
+  </schema>
+</schemalist>
+
+ +
+


+

+

+

+
+

Example 12. Ranges, choices and enumerated types

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
<schemalist>
+
+  <enum id="myenum">
+    <value nick="first" value="1"/>
+    <value nick="second" value="2"/>
+  </enum>
+
+  <enum id="myflags">
+    <value nick="flag1" value="1"/>
+    <value nick="flag2" value="2"/>
+    <value nick="flag3" value="4"/>
+  </enum>
+
+  <schema id="org.gtk.test">
+
+    <key name="key-with-range" type="i">
+      <range min="1" max="100"/>
+      <default>10</default>
+    </key>
+
+    <key name="key-with-choices" type="s">
+      <choices>
+        <choice value='Elisabeth'/>
+        <choice value='Annabeth'/>
+        <choice value='Joe'/>
+      </choices>
+      <aliases>
+        <alias value='Anna' target='Annabeth'/>
+        <alias value='Beth' target='Elisabeth'/>
+      </aliases>
+      <default>'Joe'</default>
+    </key>
+
+    <key name='enumerated-key' enum='myenum'>
+      <default>'first'</default>
+    </key>
+
+    <key name='flags-key' flags='myflags'>
+      <default>["flag1",flag2"]</default>
+    </key>
+  </schema>
+</schemalist>
+
+ +
+


+

+
+

Vendor overrides

+

+ Default values are defined in the schemas that get installed by + an application. Sometimes, it is necessary for a vendor or distributor + to adjust these defaults. Since patching the XML source for the schema + is inconvenient and error-prone, + glib-compile-schemas reads + so-called 'vendor override' files. These are keyfiles in the same + directory as the XML schema sources which can override default values. + The schema id serves as the group name in the key file, and the values + are expected in serialized GVariant form, as in the following example: +

+
+ + + + + + + +
1
+2
+3
[org.gtk.Example]
+key1='string'
+key2=1.5
+
+ +

+

+
+
+
+

Binding

+

+ A very convenient feature of GSettings lets you bind GObject properties + directly to settings, using g_settings_bind(). Once a GObject property + has been bound to a setting, changes on either side are automatically + propagated to the other side. GSettings handles details like + mapping between GObject and GVariant types, and preventing infinite + cycles. +

+

+ This makes it very easy to hook up a preferences dialog to the + underlying settings. To make this even more convenient, GSettings + looks for a boolean property with the name "sensitivity" and + automatically binds it to the writability of the bound setting. + If this 'magic' gets in the way, it can be suppressed with the + G_SETTINGS_BIND_NO_SENSITIVITY flag. +

+
+
+
+

Details

+
+

GSettings

+
typedef struct _GSettings GSettings;
+

+

+
+
+
+

g_settings_new ()

+
GSettings *         g_settings_new                      (const gchar *schema);
+

+Creates a new GSettings object with a given schema. +

+

+Signals on the newly created GSettings object will be dispatched +via the thread-default GMainContext in effect at the time of the +call to g_settings_new(). The new GSettings will hold a reference +on the context. See g_main_context_push_thread_default(). +

+
++ + + + + + + + + + +

schema :

the name of the schema +

Returns :

a new GSettings object +
+

Since 2.26

+
+
+
+

g_settings_new_with_path ()

+
GSettings *         g_settings_new_with_path            (const gchar *schema,
+                                                         const gchar *path);
+

+Creates a new GSettings object with a given schema and path. +

+

+You only need to do this if you want to directly create a settings +object with a schema that doesn't have a specified path of its own. +That's quite rare. +

+

+It is a programmer error to call this function for a schema that +has an explicitly specified path. +

+
++ + + + + + + + + + + + + + +

schema :

the name of the schema +

path :

the path to use +

Returns :

a new GSettings object +
+

Since 2.26

+
+
+
+

g_settings_new_with_backend ()

+
GSettings *         g_settings_new_with_backend         (const gchar *schema,
+                                                         GSettingsBackend *backend);
+

+Creates a new GSettings object with a given schema and backend. +

+

+Creating settings objects with an different backend allows accessing settings +from a database other than the usual one. For example, it may make +sense to pass a backend corresponding to the "defaults" settings database on +the system to get a settings object that modifies the system default +settings instead of the settings for this user. +

+
++ + + + + + + + + + + + + + +

schema :

the name of the schema +

backend :

the GSettingsBackend to use +

Returns :

a new GSettings object +
+

Since 2.26

+
+
+
+

g_settings_new_with_backend_and_path ()

+
GSettings *         g_settings_new_with_backend_and_path
+                                                        (const gchar *schema,
+                                                         GSettingsBackend *backend,
+                                                         const gchar *path);
+

+Creates a new GSettings object with a given schema, backend and +path. +

+

+This is a mix of g_settings_new_with_backend() and +g_settings_new_with_path(). +

+
++ + + + + + + + + + + + + + + + + + +

schema :

the name of the schema +

backend :

the GSettingsBackend to use +

path :

the path to use +

Returns :

a new GSettings object +
+

Since 2.26

+
+
+
+

g_settings_sync ()

+
void                g_settings_sync                     (void);
+

+Ensures that all pending operations for the given are complete for +the default backend. +

+

+Writes made to a GSettings are handled asynchronously. For this +reason, it is very unlikely that the changes have it to disk by the +time g_settings_set() returns. +

+

+This call will block until all of the writes have made it to the +backend. Since the mainloop is not running, no change notifications +will be dispatched during this call (but some may be queued by the +time the call is done). +

+
+
+
+

g_settings_get_value ()

+
GVariant *          g_settings_get_value                (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored in settings for key. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

a new GVariant +
+

Since 2.26

+
+
+
+

g_settings_set_value ()

+
gboolean            g_settings_set_value                (GSettings *settings,
+                                                         const gchar *key,
+                                                         GVariant *value);
+

+Sets key in settings to value. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or for value to have the incorrect type, per +the schema. +

+

+If value is floating then this function consumes the reference. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

value :

a GVariant of the correct type +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_is_writable ()

+
gboolean            g_settings_is_writable              (GSettings *settings,
+                                                         const gchar *name);
+

+Finds out if a key can be written or not +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

name :

the name of a key +

Returns :

+TRUE if the key name is writable +
+

Since 2.26

+
+
+
+

g_settings_delay ()

+
void                g_settings_delay                    (GSettings *settings);
+

+Changes the GSettings object into 'delay-apply' mode. In this +mode, changes to settings are not immediately propagated to the +backend, but kept locally until g_settings_apply() is called. +

+
++ + + + +

settings :

a GSettings object +
+

Since 2.26

+
+
+
+

g_settings_apply ()

+
void                g_settings_apply                    (GSettings *settings);
+

+Applies any changes that have been made to the settings. This +function does nothing unless settings is in 'delay-apply' mode; +see g_settings_delay(). In the normal case settings are always +applied immediately. +

+
++ + + + +

settings :

a GSettings instance +
+
+
+
+

g_settings_revert ()

+
void                g_settings_revert                   (GSettings *settings);
+

+Reverts all non-applied changes to the settings. This function +does nothing unless settings is in 'delay-apply' mode; see +g_settings_delay(). In the normal case settings are always applied +immediately. +

+

+Change notifications will be emitted for affected keys. +

+
++ + + + +

settings :

a GSettings instance +
+
+
+
+

g_settings_get_has_unapplied ()

+
gboolean            g_settings_get_has_unapplied        (GSettings *settings);
+

+Returns whether the GSettings object has any unapplied +changes. This can only be the case if it is in 'delayed-apply' mode. +

+
++ + + + + + + + + + +

settings :

a GSettings object +

Returns :

+TRUE if settings has unapplied changes +
+

Since 2.26

+
+
+
+

g_settings_get_child ()

+
GSettings *         g_settings_get_child                (GSettings *settings,
+                                                         const gchar *name);
+

+Creates a 'child' settings object which has a base path of +base-path/name", where +base-path is the base path of settings. +

+

+The schema for the child settings object must have been declared +in the schema of settings using a <child> element. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

name :

the name of the 'child' schema +

Returns :

a 'child' settings object. [transfer full] +
+

Since 2.26

+
+
+
+

g_settings_reset ()

+
void                g_settings_reset                    (GSettings *settings,
+                                                         const gchar *key);
+

+Resets key to its default value. +

+

+This call resets the key, as much as possible, to its default value. +That might the value specified in the schema or the one set by the +administrator. +

+
++ + + + + + + + + + +

settings :

a GSettings object +

key :

the name of a key +
+
+
+
+

g_settings_list_keys ()

+
gchar **            g_settings_list_keys                (GSettings *settings);
+

+Introspects the list of keys on settings. +

+

+You should probably not be calling this function from "normal" code +(since you should already know what keys are in your schema). This +function is intended for introspection reasons. +

+

+You should free the return value with g_strfreev() when you are done +with it. +

+
++ + + + + + + + + + +

settings :

a GSettings object +

Returns :

a list of the keys on settings. [transfer full][element-type utf8] +
+
+
+
+

g_settings_list_children ()

+
gchar **            g_settings_list_children            (GSettings *settings);
+

+Gets the list of children on settings. +

+

+The list is exactly the list of strings for which it is not an error +to call g_settings_get_child(). +

+

+For GSettings objects that are lists, this value can change at any +time and you should connect to the "children-changed" signal to watch +for those changes. Note that there is a race condition here: you may +request a child after listing it only for it to have been destroyed +in the meantime. For this reason, g_settings_get_child() may return +NULL even for a child that was listed by this function. +

+

+For GSettings objects that are not lists, you should probably not be +calling this function from "normal" code (since you should already +know what children are in your schema). This function may still be +useful there for introspection reasons, however. +

+

+You should free the return value with g_strfreev() when you are done +with it. +

+
++ + + + + + + + + + +

settings :

a GSettings object +

Returns :

a list of the children on settings. [transfer full][element-type utf8] +
+
+
+
+

g_settings_get_range ()

+
GVariant *          g_settings_get_range                (GSettings *settings,
+                                                         const gchar *key);
+

+Queries the range of a key. +

+

+This function will return a GVariant that fully describes the range +of values that are valid for key. +

+

+The type of GVariant returned is (sv). The +string describes the type of range restriction in effect. The type +and meaning of the value contained in the variant depends on the +string. +

+

+If the string is 'type' then the variant contains +an empty array. The element type of that empty array is the expected +type of value and all values of that type are valid. +

+

+If the string is 'enum' then the variant contains +an array enumerating the possible values. Each item in the array is +a possible valid value and no other values are valid. +

+

+If the string is 'flags' then the variant contains +an array. Each item in the array is a value that may appear zero or +one times in an array to be used as the value for this key. For +example, if the variant contained the array ['x', +'y'] then the valid values for the key would be +[], ['x'], +['y'], ['x', 'y'] and +['y', 'x']. +

+

+Finally, if the string is 'range' then the variant +contains a pair of like-typed values -- the minimum and maximum +permissible values for this key. +

+

+This information should not be used by normal programs. It is +considered to be a hint for introspection purposes. Normal programs +should already know what is permitted by their own schema. The +format may change in any way in the future -- but particularly, new +forms may be added to the possibilities described above. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings. +

+

+You should free the returned value with g_variant_unref() when it is +no longer needed. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings +

key :

the key to query the range of +

Returns :

a GVariant describing the range +
+

Since 2.28

+
+
+
+

g_settings_range_check ()

+
gboolean            g_settings_range_check              (GSettings *settings,
+                                                         const gchar *key,
+                                                         GVariant *value);
+

+Checks if the given value is of the correct type and within the +permitted range for key. +

+

+This API is not intended to be used by normal programs -- they should +already know what is permitted by their own schemas. This API is +meant to be used by programs such as editors or commandline tools. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings +

key :

the key to check +

value :

the value to check +

Returns :

+TRUE if value is valid for key +
+

Since 2.28

+
+
+
+

g_settings_get ()

+
void                g_settings_get                      (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *format,
+                                                         ...);
+

+Gets the value that is stored at key in settings. +

+

+A convenience function that combines g_settings_get_value() with +g_variant_get(). +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or for the GVariantType of format to mismatch +the type given in the schema. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

format :

a GVariant format string +

... :

arguments as per format +
+

Since 2.26

+
+
+
+

g_settings_set ()

+
gboolean            g_settings_set                      (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *format,
+                                                         ...);
+

+Sets key in settings to value. +

+

+A convenience function that combines g_settings_set_value() with +g_variant_new(). +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or for the GVariantType of format to mismatch +the type given in the schema. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

format :

a GVariant format string +

... :

arguments as per format +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_get_boolean ()

+
gboolean            g_settings_get_boolean              (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored at key in settings. +

+

+A convenience variant of g_settings_get() for booleans. +

+

+It is a programmer error to give a key that isn't specified as +having a boolean type in the schema for settings. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

a boolean +
+

Since 2.26

+
+
+
+

g_settings_set_boolean ()

+
gboolean            g_settings_set_boolean              (GSettings *settings,
+                                                         const gchar *key,
+                                                         gboolean value);
+

+Sets key in settings to value. +

+

+A convenience variant of g_settings_set() for booleans. +

+

+It is a programmer error to give a key that isn't specified as +having a boolean type in the schema for settings. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

value :

the value to set it to +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_get_int ()

+
gint                g_settings_get_int                  (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored at key in settings. +

+

+A convenience variant of g_settings_get() for 32-bit integers. +

+

+It is a programmer error to give a key that isn't specified as +having a int32 type in the schema for settings. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

an integer +
+

Since 2.26

+
+
+
+

g_settings_set_int ()

+
gboolean            g_settings_set_int                  (GSettings *settings,
+                                                         const gchar *key,
+                                                         gint value);
+

+Sets key in settings to value. +

+

+A convenience variant of g_settings_set() for 32-bit integers. +

+

+It is a programmer error to give a key that isn't specified as +having a int32 type in the schema for settings. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

value :

the value to set it to +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_get_double ()

+
gdouble             g_settings_get_double               (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored at key in settings. +

+

+A convenience variant of g_settings_get() for doubles. +

+

+It is a programmer error to give a key that isn't specified as +having a 'double' type in the schema for settings. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

a double +
+

Since 2.26

+
+
+
+

g_settings_set_double ()

+
gboolean            g_settings_set_double               (GSettings *settings,
+                                                         const gchar *key,
+                                                         gdouble value);
+

+Sets key in settings to value. +

+

+A convenience variant of g_settings_set() for doubles. +

+

+It is a programmer error to give a key that isn't specified as +having a 'double' type in the schema for settings. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

value :

the value to set it to +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_get_string ()

+
gchar *             g_settings_get_string               (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored at key in settings. +

+

+A convenience variant of g_settings_get() for strings. +

+

+It is a programmer error to give a key that isn't specified as +having a string type in the schema for settings. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

a newly-allocated string +
+

Since 2.26

+
+
+
+

g_settings_set_string ()

+
gboolean            g_settings_set_string               (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *value);
+

+Sets key in settings to value. +

+

+A convenience variant of g_settings_set() for strings. +

+

+It is a programmer error to give a key that isn't specified as +having a string type in the schema for settings. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

value :

the value to set it to +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_get_strv ()

+
gchar **            g_settings_get_strv                 (GSettings *settings,
+                                                         const gchar *key);
+

+A convenience variant of g_settings_get() for string arrays. +

+

+It is a programmer error to give a key that isn't specified as +having an array of strings type in the schema for settings. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

a newly-allocated, NULL-terminated array of strings +
+

Since 2.26

+
+
+
+

g_settings_set_strv ()

+
gboolean            g_settings_set_strv                 (GSettings *settings,
+                                                         const gchar *key,
+                                                         const gchar *const *value);
+

+Sets key in settings to value. +

+

+A convenience variant of g_settings_set() for string arrays. If +value is NULL, then key is set to be the empty array. +

+

+It is a programmer error to give a key that isn't specified as +having an array of strings type in the schema for settings. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the name of the key to set +

value :

the value to set it to, or NULL. [allow-none][array zero-terminated=1] +

Returns :

+TRUE if setting the key succeeded, + FALSE if the key was not writable +
+

Since 2.26

+
+
+
+

g_settings_get_enum ()

+
gint                g_settings_get_enum                 (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored in settings for key and converts it +to the enum value that it represents. +

+

+In order to use this function the type of the value must be a string +and it must be marked in the schema file as an enumerated type. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or is not marked as an enumerated type. +

+

+If the value stored in the configuration database is not a valid +value for the enumerated type then this function will return the +default value. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

the enum value +
+

Since 2.26

+
+
+
+

g_settings_set_enum ()

+
gboolean            g_settings_set_enum                 (GSettings *settings,
+                                                         const gchar *key,
+                                                         gint value);
+

+Looks up the enumerated type nick for value and writes it to key, +within settings. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or is not marked as an enumerated type, or for +value not to be a valid value for the named type. +

+

+After performing the write, accessing key directly with +g_settings_get_string() will return the 'nick' associated with +value. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

a key, within settings +

value :

an enumerated value +

Returns :

+TRUE, if the set succeeds +
+
+
+
+

g_settings_get_flags ()

+
guint               g_settings_get_flags                (GSettings *settings,
+                                                         const gchar *key);
+

+Gets the value that is stored in settings for key and converts it +to the flags value that it represents. +

+

+In order to use this function the type of the value must be an array +of strings and it must be marked in the schema file as an flags type. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or is not marked as a flags type. +

+

+If the value stored in the configuration database is not a valid +value for the flags type then this function will return the default +value. +

+
++ + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

Returns :

the flags value +
+

Since 2.26

+
+
+
+

g_settings_set_flags ()

+
gboolean            g_settings_set_flags                (GSettings *settings,
+                                                         const gchar *key,
+                                                         guint value);
+

+Looks up the flags type nicks for the bits specified by value, puts +them in an array of strings and writes the array to key, withing +settings. +

+

+It is a programmer error to give a key that isn't contained in the +schema for settings or is not marked as a flags type, or for value +to contain any bits that are not value for the named type. +

+

+After performing the write, accessing key directly with +g_settings_get_strv() will return an array of 'nicks'; one for each +bit in value. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

a key, within settings +

value :

a flags value +

Returns :

+TRUE, if the set succeeds +
+
+
+
+

GSettingsGetMapping ()

+
gboolean            (*GSettingsGetMapping)              (GVariant *value,
+                                                         gpointer *result,
+                                                         gpointer user_data);
+

+The type of the function that is used to convert from a value stored +in a GSettings to a value that is useful to the application. +

+

+If the value is successfully mapped, the result should be stored at +result and TRUE returned. If mapping fails (for example, if value +is not in the right format) then FALSE should be returned. +

+

+If value is NULL then it means that the mapping function is being +given a "last chance" to successfully return a valid value. TRUE +must be returned in this case. +

+
++ + + + + + + + + + + + + + + + + + +

value :

the GVariant to map, or NULL +

result :

the result of the mapping +

user_data :

the user data that was passed to g_settings_get_mapped() +

Returns :

+TRUE if the conversion succeeded, FALSE in case of an error +
+
+
+
+

g_settings_get_mapped ()

+
gpointer            g_settings_get_mapped               (GSettings *settings,
+                                                         const gchar *key,
+                                                         GSettingsGetMapping mapping,
+                                                         gpointer user_data);
+

+Gets the value that is stored at key in settings, subject to +application-level validation/mapping. +

+

+You should use this function when the application needs to perform +some processing on the value of the key (for example, parsing). The +mapping function performs that processing. If the function +indicates that the processing was unsuccessful (due to a parse error, +for example) then the mapping is tried again with another value. +

+

+This allows a robust 'fall back to defaults' behaviour to be +implemented somewhat automatically. +

+

+The first value that is tried is the user's setting for the key. If +the mapping function fails to map this value, other values may be +tried in an unspecified order (system or site defaults, translated +schema default values, untranslated schema default values, etc). +

+

+If the mapping function fails for all possible values, one additional +attempt is made: the mapping function is called with a NULL value. +If the mapping function still indicates failure at this point then +the application will be aborted. +

+

+The result parameter for the mapping function is pointed to a +gpointer which is initially set to NULL. The same pointer is given +to each invocation of mapping. The final value of that gpointer is +what is returned by this function. NULL is valid; it is returned +just as any other value would be. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to get the value for +

mapping :

the function to map the value in the settings database to + the value used by the application +

user_data :

user data for mapping +

Returns :

the result, which may be NULL. [transfer full] +
+
+
+
+

enum GSettingsBindFlags

+
typedef enum
+{
+  G_SETTINGS_BIND_DEFAULT,
+  G_SETTINGS_BIND_GET            = (1<<0),
+  G_SETTINGS_BIND_SET            = (1<<1),
+  G_SETTINGS_BIND_NO_SENSITIVITY = (1<<2),
+  G_SETTINGS_BIND_GET_NO_CHANGES = (1<<3),
+  G_SETTINGS_BIND_INVERT_BOOLEAN = (1<<4)
+} GSettingsBindFlags;
+
+

+Flags used when creating a binding. These flags determine in which +direction the binding works. The default is to synchronize in both +directions. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

G_SETTINGS_BIND_DEFAULT

Equivalent to G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET +

G_SETTINGS_BIND_GET

Update the GObject property when the setting changes. + It is an error to use this flag if the property is not writable. +

G_SETTINGS_BIND_SET

Update the setting when the GObject property changes. + It is an error to use this flag if the property is not readable. +

G_SETTINGS_BIND_NO_SENSITIVITY

Do not try to bind a "sensitivity" property to the writability of the setting +

G_SETTINGS_BIND_GET_NO_CHANGES

When set in addition to G_SETTINGS_BIND_GET, set the GObject property + value initially from the setting, but do not listen for changes of the setting +

G_SETTINGS_BIND_INVERT_BOOLEAN

When passed to g_settings_bind(), uses a pair of mapping functions that invert + the boolean value when mapping between the setting and the property. The setting and property must both + be booleans. You can not pass this flag to g_settings_bind_with_mapping(). +
+
+
+
+

g_settings_bind ()

+
void                g_settings_bind                     (GSettings *settings,
+                                                         const gchar *key,
+                                                         gpointer object,
+                                                         const gchar *property,
+                                                         GSettingsBindFlags flags);
+

+Create a binding between the key in the settings object +and the property property of object. +

+

+The binding uses the default GIO mapping functions to map +between the settings and property values. These functions +handle booleans, numeric types and string types in a +straightforward way. Use g_settings_bind_with_mapping() if +you need a custom mapping, or map between types that are not +supported by the default mapping functions. +

+

+Unless the flags include G_SETTINGS_BIND_NO_SENSITIVITY, this +function also establishes a binding between the writability of +key and the "sensitive" property of object (if object has +a boolean property by that name). See g_settings_bind_writable() +for more details about writable bindings. +

+

+Note that the lifecycle of the binding is tied to the object, +and that you can have only one binding per object property. +If you bind the same property twice on the same object, the second +binding overrides the first one. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to bind +

object :

a GObject. [type GObject.Object] +

property :

the name of the property to bind +

flags :

flags for the binding +
+

Since 2.26

+
+
+
+

g_settings_bind_with_mapping ()

+
void                g_settings_bind_with_mapping        (GSettings *settings,
+                                                         const gchar *key,
+                                                         gpointer object,
+                                                         const gchar *property,
+                                                         GSettingsBindFlags flags,
+                                                         GSettingsBindGetMapping get_mapping,
+                                                         GSettingsBindSetMapping set_mapping,
+                                                         gpointer user_data,
+                                                         GDestroyNotify destroy);
+

+Create a binding between the key in the settings object +and the property property of object. +

+

+The binding uses the provided mapping functions to map between +settings and property values. +

+

+Note that the lifecycle of the binding is tied to the object, +and that you can have only one binding per object property. +If you bind the same property twice on the same object, the second +binding overrides the first one. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to bind +

object :

a GObject. [type GObject.Object] +

property :

the name of the property to bind +

flags :

flags for the binding +

get_mapping :

a function that gets called to convert values + from settings to object, or NULL to use the default GIO mapping +

set_mapping :

a function that gets called to convert values + from object to settings, or NULL to use the default GIO mapping +

user_data :

data that gets passed to get_mapping and set_mapping +

destroy :

+GDestroyNotify function for user_data +
+

Since 2.26

+
+
+
+

g_settings_bind_writable ()

+
void                g_settings_bind_writable            (GSettings *settings,
+                                                         const gchar *key,
+                                                         gpointer object,
+                                                         const gchar *property,
+                                                         gboolean inverted);
+

+Create a binding between the writability of key in the +settings object and the property property of object. +The property must be boolean; "sensitive" or "visible" +properties of widgets are the most likely candidates. +

+

+Writable bindings are always uni-directional; changes of the +writability of the setting will be propagated to the object +property, not the other way. +

+

+When the inverted argument is TRUE, the binding inverts the +value as it passes from the setting to the object, i.e. property +will be set to TRUE if the key is not +writable. +

+

+Note that the lifecycle of the binding is tied to the object, +and that you can have only one binding per object property. +If you bind the same property twice on the same object, the second +binding overrides the first one. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

settings :

a GSettings object +

key :

the key to bind +

object :

a GObject. [type GObject.Object] +

property :

the name of a boolean property to bind +

inverted :

whether to 'invert' the value +
+

Since 2.26

+
+
+
+

g_settings_unbind ()

+
void                g_settings_unbind                   (gpointer object,
+                                                         const gchar *property);
+

+Removes an existing binding for property on object. +

+

+Note that bindings are automatically removed when the +object is finalized, so it is rarely necessary to call this +function. +

+
++ + + + + + + + + + +

object :

the object +

property :

the property whose binding is removed +
+

Since 2.26

+
+
+
+

GSettingsBindSetMapping ()

+
GVariant *          (*GSettingsBindSetMapping)          (const GValue *value,
+                                                         const GVariantType *expected_type,
+                                                         gpointer user_data);
+

+The type for the function that is used to convert an object property +value to a GVariant for storing it in GSettings. +

+
++ + + + + + + + + + + + + + + + + + +

value :

a GValue containing the property value to map +

expected_type :

the GVariantType to create +

user_data :

user data that was specified when the binding was created +

Returns :

a new GVariant holding the data from value, + or NULL in case of an error +
+
+
+
+

GSettingsBindGetMapping ()

+
gboolean            (*GSettingsBindGetMapping)          (GValue *value,
+                                                         GVariant *variant,
+                                                         gpointer user_data);
+

+The type for the function that is used to convert from GSettings to +an object property. The value is already initialized to hold values +of the appropriate type. +

+
++ + + + + + + + + + + + + + + + + + +

value :

return location for the property value +

variant :

the GVariant +

user_data :

user data that was specified when the binding was created +

Returns :

+TRUE if the conversion succeeded, FALSE in case of an error +
+
+
+
+

Property Details

+
+

The "backend" property

+
  "backend"                  GSettingsBackend*     : Read / Write / Construct Only
+

The GSettingsBackend for this settings object.

+
+
+
+

The "delay-apply" property

+
  "delay-apply"              gboolean              : Read
+

+Whether the GSettings object is in 'delay-apply' mode. See +g_settings_delay() for details. +

+

Default value: FALSE

+

Since 2.28

+
+
+
+

The "has-unapplied" property

+
  "has-unapplied"            gboolean              : Read
+

+If this property is TRUE, the GSettings object has outstanding +changes that will be applied when g_settings_apply() is called. +

+

Default value: FALSE

+
+
+
+

The "path" property

+
  "path"                     gchar*                : Read / Write / Construct Only
+

+The path within the backend where the settings are stored. +

+

Default value: NULL

+
+
+
+

The "schema" property

+
  "schema"                   gchar*                : Read / Write / Construct Only
+

+The name of the schema that describes the types of keys +for this GSettings object. +

+

Default value: NULL

+
+
+
+

Signal Details

+
+

The "change-event" signal

+
gboolean            user_function                      (GSettings *settings,
+                                                        gpointer   keys,
+                                                        gint       n_keys,
+                                                        gpointer   user_data)      : Run Last
+

+The "change-event" signal is emitted once per change event that +affects this settings object. You should connect to this signal +only if you are interested in viewing groups of changes before they +are split out into multiple emissions of the "changed" signal. +For most use cases it is more appropriate to use the "changed" signal. +

+

+In the event that the change event applies to one or more specified +keys, keys will be an array of GQuark of length n_keys. In the +event that the change event applies to the GSettings object as a +whole (ie: potentially every key has been changed) then keys will +be NULL and n_keys will be 0. +

+

+The default handler for this signal invokes the "changed" signal +for each affected key. If any other connected handler returns +TRUE then this default functionality will be supressed. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

settings :

the object on which the signal was emitted +

keys :

an array of GQuarks for the changed keys, or NULL +

n_keys :

the length of the keys array, or 0 +

returns :

+TRUE to stop other handlers from being invoked for the + event. FALSE to propagate the event further. +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "changed" signal

+
void                user_function                      (GSettings *settings,
+                                                        gchar     *key,
+                                                        gpointer   user_data)      : Run Last / Has Details
+

+The "changed" signal is emitted when a key has potentially changed. +You should call one of the g_settings_get() calls to check the new +value. +

+

+This signal supports detailed connections. You can connect to the +detailed signal "changed::x" in order to only receive callbacks +when key "x" changes. +

+
++ + + + + + + + + + + + + + +

settings :

the object on which the signal was emitted +

key :

the name of the key that changed +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "writable-change-event" signal

+
gboolean            user_function                      (GSettings *settings,
+                                                        guint      key,
+                                                        gpointer   user_data)      : Run Last
+

+The "writable-change-event" signal is emitted once per writability +change event that affects this settings object. You should connect +to this signal if you are interested in viewing groups of changes +before they are split out into multiple emissions of the +"writable-changed" signal. For most use cases it is more +appropriate to use the "writable-changed" signal. +

+

+In the event that the writability change applies only to a single +key, key will be set to the GQuark for that key. In the event +that the writability change affects the entire settings object, +key will be 0. +

+

+The default handler for this signal invokes the "writable-changed" +and "changed" signals for each affected key. This is done because +changes in writability might also imply changes in value (if for +example, a new mandatory setting is introduced). If any other +connected handler returns TRUE then this default functionality +will be supressed. +

+
++ + + + + + + + + + + + + + + + + + +

settings :

the object on which the signal was emitted +

key :

the quark of the key, or 0 +

returns :

+TRUE to stop other handlers from being invoked for the + event. FALSE to propagate the event further. +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "writable-changed" signal

+
void                user_function                      (GSettings *settings,
+                                                        gchar     *key,
+                                                        gpointer   user_data)      : Run Last / Has Details
+

+The "writable-changed" signal is emitted when the writability of a +key has potentially changed. You should call +g_settings_is_writable() in order to determine the new status. +

+

+This signal supports detailed connections. You can connect to the +detailed signal "writable-changed::x" in order to only receive +callbacks when the writability of "x" changes. +

+
++ + + + + + + + + + + + + + +

settings :

the object on which the signal was emitted +

key :

the key +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GSettingsBackend.html b/docs/reference/gio/html/GSettingsBackend.html new file mode 100644 index 0000000..22c49d7 --- /dev/null +++ b/docs/reference/gio/html/GSettingsBackend.html @@ -0,0 +1,609 @@ + + + + +GSettingsBackend + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GSettingsBackend

+

GSettingsBackend — Interface for settings backend implementations

+
+
+

Synopsis

+
+#include <gio/gsettingsbackend.h>
+
+                    GSettingsBackend;
+                    GSettingsBackendClass;
+#define             G_SETTINGS_BACKEND_EXTENSION_POINT_NAME
+void                g_settings_backend_changed          (GSettingsBackend *backend,
+                                                         const gchar *key,
+                                                         gpointer origin_tag);
+void                g_settings_backend_path_changed     (GSettingsBackend *backend,
+                                                         const gchar *path,
+                                                         gpointer origin_tag);
+void                g_settings_backend_keys_changed     (GSettingsBackend *backend,
+                                                         const gchar *path,
+                                                         gchar const * const *items,
+                                                         gpointer origin_tag);
+void                g_settings_backend_path_writable_changed
+                                                        (GSettingsBackend *backend,
+                                                         const gchar *path);
+void                g_settings_backend_writable_changed (GSettingsBackend *backend,
+                                                         const gchar *key);
+void                g_settings_backend_changed_tree     (GSettingsBackend *backend,
+                                                         GTree *tree,
+                                                         gpointer origin_tag);
+void                g_settings_backend_flatten_tree     (GTree *tree,
+                                                         gchar **path,
+                                                         const gchar ***keys,
+                                                         GVariant ***values);
+GSettingsBackend *  g_keyfile_settings_backend_new      (const gchar *filename,
+                                                         const gchar *root_path,
+                                                         const gchar *root_group);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GSettingsBackend
+
+
+
+

Description

+

+The GSettingsBackend interface defines a generic interface for +non-strictly-typed data that is stored in a hierarchy. To implement +an alternative storage backend for GSettings, you need to implement +the GSettingsBackend interface and then make it implement the +extension point G_SETTINGS_BACKEND_EXTENSION_POINT_NAME. +

+

+The interface defines methods for reading and writing values, a +method for determining if writing of certain values will fail +(lockdown) and a change notification mechanism. +

+

+The semantics of the interface are very precisely defined and +implementations must carefully adhere to the expectations of +callers that are documented on each of the interface methods. +

+

+Some of the GSettingsBackend functions accept or return a GTree. +These trees always have strings as keys and GVariant as values. +g_settings_backend_create_tree() is a convenience function to create +suitable trees. +

+

+

+
+

Note

+

+The GSettingsBackend API is exported to allow third-party +implementations, but does not carry the same stability guarantees +as the public GIO API. For this reason, you have to define the +C preprocessor symbol G_SETTINGS_ENABLE_BACKEND before including +gio/gsettingsbackend.h +

+
+

+

+
+
+

Details

+
+

GSettingsBackend

+
typedef struct _GSettingsBackend GSettingsBackend;
+

+An implementation of a settings storage repository. +

+
+
+
+

GSettingsBackendClass

+
typedef struct {
+  GObjectClass parent_class;
+
+  GVariant *    (*read)             (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     const GVariantType  *expected_type,
+                                     gboolean             default_value);
+
+  gboolean      (*get_writable)     (GSettingsBackend    *backend,
+                                     const gchar         *key);
+
+  gboolean      (*write)            (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     GVariant            *value,
+                                     gpointer             origin_tag);
+  gboolean      (*write_tree)       (GSettingsBackend    *backend,
+                                     GTree               *tree,
+                                     gpointer             origin_tag);
+  void          (*reset)            (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     gpointer             origin_tag);
+
+  void          (*subscribe)        (GSettingsBackend    *backend,
+                                     const gchar         *name);
+  void          (*unsubscribe)      (GSettingsBackend    *backend,
+                                     const gchar         *name);
+  void          (*sync)             (GSettingsBackend    *backend);
+
+  GPermission * (*get_permission)   (GSettingsBackend    *backend,
+                                     const gchar         *path);
+
+  gpointer padding[24];
+} GSettingsBackendClass;
+
+

+

+
+
+
+

G_SETTINGS_BACKEND_EXTENSION_POINT_NAME

+
#define G_SETTINGS_BACKEND_EXTENSION_POINT_NAME "gsettings-backend"
+
+

+Extension point for GSettingsBackend functionality. +

+
+
+
+

g_settings_backend_changed ()

+
void                g_settings_backend_changed          (GSettingsBackend *backend,
+                                                         const gchar *key,
+                                                         gpointer origin_tag);
+

+Signals that a single key has possibly changed. Backend +implementations should call this if a key has possibly changed its +value. +

+

+key must be a valid key (ie starting with a slash, not containing +'//', and not ending with a slash). +

+

+The implementation must call this function during any call to +g_settings_backend_write(), before the call returns (except in the +case that no keys are actually changed and it cares to detect this +fact). It may not rely on the existence of a mainloop for +dispatching the signal later. +

+

+The implementation may call this function at any other time it likes +in response to other events (such as changes occuring outside of the +program). These calls may originate from a mainloop or may originate +in response to any other action (including from calls to +g_settings_backend_write()). +

+

+In the case that this call is in response to a call to +g_settings_backend_write() then origin_tag must be set to the same +value that was passed to that call. +

+
++ + + + + + + + + + + + + + +

backend :

a GSettingsBackend implementation +

key :

the name of the key +

origin_tag :

the origin tag +
+

Since 2.26

+
+
+
+

g_settings_backend_path_changed ()

+
void                g_settings_backend_path_changed     (GSettingsBackend *backend,
+                                                         const gchar *path,
+                                                         gpointer origin_tag);
+

+Signals that all keys below a given path may have possibly changed. +Backend implementations should call this if an entire path of keys +have possibly changed their values. +

+

+path must be a valid path (ie starting and ending with a slash and +not containing '//'). +

+

+The meaning of this signal is that any of the key which has a name +starting with path may have changed. +

+

+The same rules for when notifications must occur apply as per +g_settings_backend_changed(). This call might be an appropriate +reasponse to a 'reset' call but implementations are also free to +explicitly list the keys that were affected by that call if they can +easily do so. +

+

+For efficiency reasons, the implementation should strive for path to +be as long as possible (ie: the longest common prefix of all of the +keys that were changed) but this is not strictly required. As an +example, if this function is called with the path of "/" then every +single key in the application will be notified of a possible change. +

+
++ + + + + + + + + + + + + + +

backend :

a GSettingsBackend implementation +

path :

the path containing the changes +

origin_tag :

the origin tag +
+

Since 2.26

+
+
+
+

g_settings_backend_keys_changed ()

+
void                g_settings_backend_keys_changed     (GSettingsBackend *backend,
+                                                         const gchar *path,
+                                                         gchar const * const *items,
+                                                         gpointer origin_tag);
+

+Signals that a list of keys have possibly changed. Backend +implementations should call this if keys have possibly changed their +values. +

+

+path must be a valid path (ie starting and ending with a slash and +not containing '//'). Each string in items must form a valid key +name when path is prefixed to it (ie: each item must not start or +end with '/' and must not contain '//'). +

+

+The meaning of this signal is that any of the key names resulting +from the contatenation of path with each item in items may have +changed. +

+

+The same rules for when notifications must occur apply as per +g_settings_backend_changed(). These two calls can be used +interchangeably if exactly one item has changed (although in that +case g_settings_backend_changed() is definitely preferred). +

+

+For efficiency reasons, the implementation should strive for path to +be as long as possible (ie: the longest common prefix of all of the +keys that were changed) but this is not strictly required. +

+
++ + + + + + + + + + + + + + + + + + +

backend :

a GSettingsBackend implementation +

path :

the path containing the changes +

items :

the NULL-terminated list of changed keys +

origin_tag :

the origin tag +
+

Since 2.26

+
+
+
+

g_settings_backend_path_writable_changed ()

+
void                g_settings_backend_path_writable_changed
+                                                        (GSettingsBackend *backend,
+                                                         const gchar *path);
+

+Signals that the writability of all keys below a given path may have +changed. +

+

+Since GSettings performs no locking operations for itself, this call +will always be made in response to external events. +

+
++ + + + + + + + + + +

backend :

a GSettingsBackend implementation +

path :

the name of the path +
+

Since 2.26

+
+
+
+

g_settings_backend_writable_changed ()

+
void                g_settings_backend_writable_changed (GSettingsBackend *backend,
+                                                         const gchar *key);
+

+Signals that the writability of a single key has possibly changed. +

+

+Since GSettings performs no locking operations for itself, this call +will always be made in response to external events. +

+
++ + + + + + + + + + +

backend :

a GSettingsBackend implementation +

key :

the name of the key +
+

Since 2.26

+
+
+
+

g_settings_backend_changed_tree ()

+
void                g_settings_backend_changed_tree     (GSettingsBackend *backend,
+                                                         GTree *tree,
+                                                         gpointer origin_tag);
+

+This call is a convenience wrapper. It gets the list of changes from +tree, computes the longest common prefix and calls +g_settings_backend_changed(). +

+
++ + + + + + + + + + + + + + +

backend :

a GSettingsBackend implementation +

tree :

a GTree containing the changes +

origin_tag :

the origin tag +
+

Since 2.26

+
+
+
+

g_settings_backend_flatten_tree ()

+
void                g_settings_backend_flatten_tree     (GTree *tree,
+                                                         gchar **path,
+                                                         const gchar ***keys,
+                                                         GVariant ***values);
+

+Calculate the longest common prefix of all keys in a tree and write +out an array of the key names relative to that prefix and, +optionally, the value to store at each of those keys. +

+

+You must free the value returned in path, keys and values using +g_free(). You should not attempt to free or unref the contents of +keys or values. +

+
++ + + + + + + + + + + + + + + + + + +

tree :

a GTree containing the changes +

path :

the location to save the path +

keys :

the location to save the relative keys +

values :

the location to save the values, or NULL +
+

Since 2.26

+
+
+
+

g_keyfile_settings_backend_new ()

+
GSettingsBackend *  g_keyfile_settings_backend_new      (const gchar *filename,
+                                                         const gchar *root_path,
+                                                         const gchar *root_group);
+

+Creates a keyfile-backed GSettingsBackend. +

+

+The filename of the keyfile to use is given by filename. +

+

+All settings read to or written from the backend must fall under the +path given in root_path (which must start and end with a slash and +not contain two consecutive slashes). root_path may be "/". +

+

+If root_group is non-NULL then it specifies the name of the keyfile +group used for keys that are written directly below root_path. For +example, if root_path is "/apps/example/" and root_group is +"toplevel", then settings the key "/apps/example/enabled" to a value +of TRUE will cause the following to appear in the keyfile: +

+

+

+
+ + + + + + + +
1
+2
[toplevel]
+enabled=true
+
+ +

+

+

+If root_group is NULL then it is not permitted to store keys +directly below the root_path. +

+

+For keys not stored directly below root_path (ie: in a sub-path), +the name of the subpath (with the final slash stripped) is used as +the name of the keyfile group. To continue the example, if +"/apps/example/profiles/default/font-size" were set to +12 then the following would appear in the keyfile: +

+

+

+
+ + + + + + + +
1
+2
[profiles/default]
+font-size=12
+
+ +

+

+

+The backend will refuse writes (and return writability as being +FALSE) for keys outside of root_path and, in the event that +root_group is NULL, also for keys directly under root_path. +Writes will also be refused if the backend detects that it has the +inability to rewrite the keyfile (ie: the containing directory is not +writable). +

+

+There is no checking done for your key namespace clashing with the +syntax of the key file format. For example, if you have '[' or ']' +characters in your path names or '=' in your key names you may be in +trouble. +

+
++ + + + + + + + + + + + + + + + + + +

filename :

the filename of the keyfile +

root_path :

the path under which all settings keys appear +

root_group :

the group name corresponding to + root_path, or NULL. [allow-none] +

Returns :

a keyfile-backed GSettingsBackend. [transfer full] +
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GSimpleAction.html b/docs/reference/gio/html/GSimpleAction.html new file mode 100644 index 0000000..fbc0692 --- /dev/null +++ b/docs/reference/gio/html/GSimpleAction.html @@ -0,0 +1,345 @@ + + + + +GSimpleAction + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GSimpleAction

+

GSimpleAction — A simple GSimpleAction

+
+
+

Synopsis

+
                    GSimpleAction;
+                    GSimpleActionClass;
+
+GSimpleAction *     g_simple_action_new                 (const gchar *name,
+                                                         const GVariantType *parameter_type);
+GSimpleAction *     g_simple_action_new_stateful        (const gchar *name,
+                                                         const GVariantType *parameter_type,
+                                                         GVariant *state);
+
+void                g_simple_action_set_enabled         (GSimpleAction *simple,
+                                                         gboolean enabled);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GSimpleAction
+
+
+
+

Implemented Interfaces

+

+GSimpleAction implements + GAction.

+
+
+

Properties

+
+  "enabled"                  gboolean              : Read / Write / Construct
+  "name"                     gchar*                : Read / Write / Construct Only
+  "parameter-type"           GVariantType*         : Read / Write / Construct Only
+  "state"                    GVariant              : Read / Write / Construct
+  "state-type"               GVariantType*         : Read
+
+
+
+

Signals

+
+  "activate"                                       : Run Last
+
+
+
+

Description

+

+A GSimpleAction is the obvious simple implementation of the GSimpleAction +interface. This is the easiest way to create an action for purposes of +adding it to a GSimpleActionGroup. +

+

+See also GtkAction. +

+
+
+

Details

+
+

GSimpleAction

+
typedef struct _GSimpleAction GSimpleAction;
+

+The GSimpleAction structure contains private +data and should only be accessed using the provided API +

+

Since 2.26

+
+
+
+

GSimpleActionClass

+
typedef struct {
+  GObjectClass parent_class;
+
+  /* signals */
+  void  (* activate)  (GSimpleAction *simple,
+                       GVariant      *parameter);
+} GSimpleActionClass;
+
+
++ + + + + + + + + + +

GObjectClass parent_class;

+

activate ()

the class closure for the activate signal +
+

Since 2.26

+
+
+
+

g_simple_action_new ()

+
GSimpleAction *     g_simple_action_new                 (const gchar *name,
+                                                         const GVariantType *parameter_type);
+

+Creates a new action. +

+

+The created action is stateless. See g_simple_action_new_stateful(). +

+
++ + + + + + + + + + + + + + +

name :

the name of the action +

parameter_type :

the type of parameter to the activate function. [allow-none] +

Returns :

a new GSimpleAction + +
+

Since 2.28

+
+
+
+

g_simple_action_new_stateful ()

+
GSimpleAction *     g_simple_action_new_stateful        (const gchar *name,
+                                                         const GVariantType *parameter_type,
+                                                         GVariant *state);
+

+Creates a new stateful action. +

+

+state is the initial state of the action. All future state values +must have the same GVariantType as the initial state. +

+

+If the state GVariant is floating, it is consumed. +

+
++ + + + + + + + + + + + + + + + + + +

name :

the name of the action +

parameter_type :

the type of the parameter to the activate function. [allow-none] +

state :

the initial state of the action +

Returns :

a new GSimpleAction + +
+

Since 2.28

+
+
+
+

g_simple_action_set_enabled ()

+
void                g_simple_action_set_enabled         (GSimpleAction *simple,
+                                                         gboolean enabled);
+

+Sets the action as enabled or not. +

+

+An action must be enabled in order to be activated or in order to +have its state changed from outside callers. +

+
++ + + + + + + + + + +

simple :

a GSimpleAction +

enabled :

whether the action is enabled +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "enabled" property

+
  "enabled"                  gboolean              : Read / Write / Construct
+

+If action is currently enabled. +

+

+If the action is disabled then calls to g_simple_action_activate() and +g_simple_action_set_state() have no effect. +

+

Default value: TRUE

+

Since 2.28

+
+
+
+

The "name" property

+
  "name"                     gchar*                : Read / Write / Construct Only
+

+The name of the action. This is mostly meaningful for identifying +the action once it has been added to a GSimpleActionGroup. +

+

Default value: NULL

+

Since 2.28

+
+
+
+

The "parameter-type" property

+
  "parameter-type"           GVariantType*         : Read / Write / Construct Only
+

+The type of the parameter that must be given when activating the +action. +

+

Since 2.28

+
+
+
+

The "state" property

+
  "state"                    GVariant              : Read / Write / Construct
+

+The state of the action, or NULL if the action is stateless. +

+

Since 2.28

+
+
+
+

The "state-type" property

+
  "state-type"               GVariantType*         : Read
+

+The GVariantType of the state that the action has, or NULL if the +action is stateless. +

+

Since 2.28

+
+
+
+

Signal Details

+
+

The "activate" signal

+
void                user_function                      (GSimpleAction *simple,
+                                                        GVariant       parameter,
+                                                        gpointer       user_data)      : Run Last
+

+Indicates that the action was just activated. +

+

+parameter will always be of the expected type. In the event that +an incorrect type was given, no signal will be emitted. +

+
++ + + + + + + + + + + + + + +

simple :

the GSimpleAction +

parameter :

the parameter to the activation. [allow-none] +

user_data :

user data set when the signal handler was connected.
+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GSimpleActionGroup.html b/docs/reference/gio/html/GSimpleActionGroup.html new file mode 100644 index 0000000..6049627 --- /dev/null +++ b/docs/reference/gio/html/GSimpleActionGroup.html @@ -0,0 +1,203 @@ + + + + +GSimpleActionGroup + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GSimpleActionGroup

+

GSimpleActionGroup — A simple GActionGroup implementation

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GSimpleActionGroup
+
+
+
+

Implemented Interfaces

+

+GSimpleActionGroup implements + GActionGroup.

+
+
+

Description

+

+GSimpleActionGroup is a hash table filled with GAction objects, +implementing the GActionGroup interface. +

+
+
+

Details

+
+

GSimpleActionGroup

+
typedef struct _GSimpleActionGroup GSimpleActionGroup;
+

+The GSimpleActionGroup structure contains private data and should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

g_simple_action_group_new ()

+
GSimpleActionGroup * g_simple_action_group_new          (void);
+

+Creates a new, empty, GSimpleActionGroup. +

+
++ + + + +

Returns :

a new GSimpleActionGroup + +
+

Since 2.28

+
+
+
+

g_simple_action_group_lookup ()

+
GAction *           g_simple_action_group_lookup        (GSimpleActionGroup *simple,
+                                                         const gchar *action_name);
+

+Looks up the action with the name action_name in the group. +

+

+If no such action exists, returns NULL. +

+
++ + + + + + + + + + + + + + +

simple :

a GSimpleActionGroup +

action_name :

the name of an action +

Returns :

a GAction, or NULL. [transfer none] +
+

Since 2.28

+
+
+
+

g_simple_action_group_insert ()

+
void                g_simple_action_group_insert        (GSimpleActionGroup *simple,
+                                                         GAction *action);
+

+Adds an action to the action group. +

+

+If the action group already contains an action with the same name as +action then the old action is dropped from the group. +

+

+The action group takes its own reference on action. +

+
++ + + + + + + + + + +

simple :

a GSimpleActionGroup +

action :

a GAction +
+

Since 2.28

+
+
+
+

g_simple_action_group_remove ()

+
void                g_simple_action_group_remove        (GSimpleActionGroup *simple,
+                                                         const gchar *action_name);
+

+Removes the named action from the action group. +

+

+If no action of this name is in the group then nothing happens. +

+
++ + + + + + + + + + +

simple :

a GSimpleActionGroup +

action_name :

the name of the action +
+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GSimpleAsyncResult.html b/docs/reference/gio/html/GSimpleAsyncResult.html index 8934874..8b278cb 100644 --- a/docs/reference/gio/html/GSimpleAsyncResult.html +++ b/docs/reference/gio/html/GSimpleAsyncResult.html @@ -3,12 +3,12 @@ GSimpleAsyncResult - + - + @@ -46,48 +46,53 @@ GSimpleAsyncResult; void (*GSimpleAsyncThreadFunc) (GSimpleAsyncResult *res, - GObject *object, + GObject *object, GCancellable *cancellable); -GSimpleAsyncResult * g_simple_async_result_new (GObject *source_object, +GSimpleAsyncResult * g_simple_async_result_new (GObject *source_object, GAsyncReadyCallback callback, - gpointer user_data, - gpointer source_tag); -GSimpleAsyncResult * g_simple_async_result_new_error (GObject *source_object, + gpointer user_data, + gpointer source_tag); +GSimpleAsyncResult * g_simple_async_result_new_error (GObject *source_object, GAsyncReadyCallback callback, - gpointer user_data, - GQuark domain, - gint code, + gpointer user_data, + GQuark domain, + gint code, const char *format, ...); GSimpleAsyncResult * g_simple_async_result_new_from_error - (GObject *source_object, + (GObject *source_object, GAsyncReadyCallback callback, - gpointer user_data, - GError *error); + gpointer user_data, + const GError *error); +GSimpleAsyncResult * g_simple_async_result_new_take_error + (GObject *source_object, + GAsyncReadyCallback callback, + gpointer user_data, + GError *error); void g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple, - gpointer op_res, - GDestroyNotify destroy_op_res); -gpointer g_simple_async_result_get_op_res_gpointer + gpointer op_res, + GDestroyNotify destroy_op_res); +gpointer g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple); void g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple, - gssize op_res); -gssize g_simple_async_result_get_op_res_gssize + gssize op_res); +gssize g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple); void g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple, - gboolean op_res); -gboolean g_simple_async_result_get_op_res_gboolean + gboolean op_res); +gboolean g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple); -gpointer g_simple_async_result_get_source_tag +gpointer g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple); -gboolean g_simple_async_result_is_valid (GAsyncResult *result, - GObject *source, - gpointer source_tag); +gboolean g_simple_async_result_is_valid (GAsyncResult *result, + GObject *source, + gpointer source_tag); void g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple, - gboolean handle_cancellation); + gboolean handle_cancellation); void g_simple_async_result_complete (GSimpleAsyncResult *simple); void g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple); @@ -97,38 +102,45 @@ GCancellable *cancellable); void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple, - const GError *error); -gboolean g_simple_async_result_propagate_error + const GError *error); +void g_simple_async_result_take_error (GSimpleAsyncResult *simple, + GError *error); +gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple, - GError **dest); + GError **dest); void g_simple_async_result_set_error (GSimpleAsyncResult *simple, - GQuark domain, - gint code, + GQuark domain, + gint code, const char *format, ...); void g_simple_async_result_set_error_va (GSimpleAsyncResult *simple, - GQuark domain, - gint code, + GQuark domain, + gint code, const char *format, va_list args); -void g_simple_async_report_error_in_idle (GObject *object, +void g_simple_async_report_error_in_idle (GObject *object, GAsyncReadyCallback callback, - gpointer user_data, - GQuark domain, - gint code, + gpointer user_data, + GQuark domain, + gint code, const char *format, ...); void g_simple_async_report_gerror_in_idle - (GObject *object, + (GObject *object, + GAsyncReadyCallback callback, + gpointer user_data, + const GError *error); +void g_simple_async_report_take_gerror_in_idle + (GObject *object, GAsyncReadyCallback callback, - gpointer user_data, - GError *error); + gpointer user_data, + GError *error);

Object Hierarchy

-  GObject
+  GObject
    +----GSimpleAsyncResult
 
@@ -152,7 +164,7 @@ reporting, operation cancellation and the final state of an operation, completely transparent to the application. Results can be returned as a pointer e.g. for functions that return data that is collected asynchronously, a boolean value for checking the success or failure -of an operation, or a gssize for operations which return the number +of an operation, or a gssize for operations which return the number of bytes modified by the operation; all of the simple return cases are covered.

@@ -171,9 +183,10 @@ together correctly.

To create a new GSimpleAsyncResult, call g_simple_async_result_new(). -If the result needs to be created for a GError, use -g_simple_async_result_new_from_error(). If a GError is not available -(e.g. the asynchronous operation's doesn't take a GError argument), +If the result needs to be created for a GError, use +g_simple_async_result_new_from_error() or +g_simple_async_result_new_take_error(). If a GError is not available +(e.g. the asynchronous operation's doesn't take a GError argument), but the result still needs to be created for an error condition, use g_simple_async_result_new_error() (or g_simple_async_result_set_error_va() if your application or binding requires passing a variable argument list @@ -183,13 +196,13 @@ directly), and the error can then be propagated through the use of

An asynchronous operation can be made to ignore a cancellation event by calling g_simple_async_result_set_handle_cancellation() with a -GSimpleAsyncResult for the operation and FALSE. This is useful for +GSimpleAsyncResult for the operation and FALSE. This is useful for operations that are dangerous to cancel, such as close (which would cause a leak if cancelled before being run).

-GSimpleAsyncResult can integrate into GLib's event loop, GMainLoop, -or it can use GThreads if available. +GSimpleAsyncResult can integrate into GLib's event loop, GMainLoop, +or it can use GThreads if available. g_simple_async_result_complete() will finish an I/O task directly from the point where it is called. g_simple_async_result_complete_in_idle() will finish it from an idle handler in the thread-default main @@ -213,6 +226,214 @@ Likewise, to get the result of an asynchronous function, provided, getting the operation's result as a gpointer, gboolean, and gssize, respectively.

+

+For the details of the requirements implementations must respect, see +GAsyncResult. A typical implementation of an asynchronous operation +using GSimpleAsyncResult looks something like this: +

+

+

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
static void
+baked_cb (Cake    *cake,
+          gpointer user_data)
+{
+  /* In this example, this callback is not given a reference to the cake, so
+   * the GSimpleAsyncResult has to take a reference to it.
+   */
+  GSimpleAsyncResult *result = user_data;
+
+  if (cake == NULL)
+    g_simple_async_result_set_error (result,
+                                     BAKER_ERRORS,
+                                     BAKER_ERROR_NO_FLOUR,
+                                     "Go to the supermarket");
+  else
+    g_simple_async_result_set_op_res_gpointer (result,
+                                               g_object_ref (cake),
+                                               g_object_unref);
+
+
+  /* In this example, we assume that baked_cb is called as a callback from
+   * the mainloop, so it's safe to complete the operation synchronously here.
+   * If, however, _baker_prepare_cake () might call its callback without
+   * first returning to the mainloop — inadvisable, but some APIs do so —
+   * we would need to use g_simple_async_result_complete_in_idle().
+   */
+  g_simple_async_result_complete (result);
+  g_object_unref (result);
+}
+
+void
+baker_bake_cake_async (Baker              *self,
+                       guint               radius,
+                       GAsyncReadyCallback callback,
+                       gpointer            user_data)
+{
+  GSimpleAsyncResult *simple;
+  Cake               *cake;
+
+  if (radius < 3)
+    {
+      g_simple_async_report_error_in_idle (G_OBJECT (self),
+                                           callback,
+                                           user_data,
+                                           BAKER_ERRORS,
+                                           BAKER_ERROR_TOO_SMALL,
+                                           "%ucm radius cakes are silly",
+                                           radius);
+      return;
+    }
+
+  simple = g_simple_async_result_new (G_OBJECT (self),
+                                      callback,
+                                      user_data,
+                                      baker_bake_cake_async);
+  cake = _baker_get_cached_cake (self, radius);
+
+  if (cake != NULL)
+    {
+      g_simple_async_result_set_op_res_gpointer (simple,
+                                                 g_object_ref (cake),
+                                                 g_object_unref);
+      g_simple_async_result_complete_in_idle (simple);
+      g_object_unref (simple);
+      /* Drop the reference returned by _baker_get_cached_cake(); the
+       * GSimpleAsyncResult has taken its own reference.
+       */
+      g_object_unref (cake);
+      return;
+    }
+
+  _baker_prepare_cake (self, radius, baked_cb, simple);
+}
+
+Cake *
+baker_bake_cake_finish (Baker        *self,
+                        GAsyncResult *result,
+                        GError      **error)
+{
+  GSimpleAsyncResult *simple;
+  Cake               *cake;
+
+  g_return_val_if_fail (g_simple_async_result_is_valid (result,
+                                                        G_OBJECT (self),
+                                                        baker_bake_cake_async),
+                        NULL);
+
+  simple = (GSimpleAsyncResult *) result;
+
+  if (g_simple_async_result_propagate_error (simple, error))
+    return NULL;
+
+  cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
+  return g_object_ref (cake);
+}
+
+ +

+

Details

@@ -227,7 +448,7 @@ A simple implementation of

GSimpleAsyncThreadFunc ()

void                (*GSimpleAsyncThreadFunc)           (GSimpleAsyncResult *res,
-                                                         GObject *object,
+                                                         GObject *object,
                                                          GCancellable *cancellable);

Simple thread function that runs an asynchronous operation and @@ -243,12 +464,12 @@ checks for cancellation.

object :

-a GObject. +a GObject.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore. @@ -257,10 +478,10 @@ checks for cancellation.

g_simple_async_result_new ()

-
GSimpleAsyncResult * g_simple_async_result_new          (GObject *source_object,
+
GSimpleAsyncResult * g_simple_async_result_new          (GObject *source_object,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data,
-                                                         gpointer source_tag);
+ gpointer user_data, + gpointer source_tag);

Creates a GSimpleAsyncResult.

@@ -269,8 +490,7 @@ Creates a source_object :

-a
GObject the asynchronous function was called with, -or NULL. + a GObject, or NULL. [allow-none] @@ -299,11 +519,11 @@ or

g_simple_async_result_new_error ()

-
GSimpleAsyncResult * g_simple_async_result_new_error    (GObject *source_object,
+
GSimpleAsyncResult * g_simple_async_result_new_error    (GObject *source_object,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data,
-                                                         GQuark domain,
-                                                         gint code,
+                                                         gpointer user_data,
+                                                         GQuark domain,
+                                                         gint code,
                                                          const char *format,
                                                          ...);

@@ -314,7 +534,7 @@ Creates a new source_object :

-a GObject, or NULL. + a GObject, or NULL. [allow-none] @@ -329,7 +549,7 @@ Creates a new domain :

-a
GQuark. +a GQuark. @@ -359,10 +579,10 @@ Creates a new

g_simple_async_result_new_from_error ()

GSimpleAsyncResult * g_simple_async_result_new_from_error
-                                                        (GObject *source_object,
+                                                        (GObject *source_object,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data,
-                                                         GError *error);
+ gpointer user_data, + const GError *error);

Creates a GSimpleAsyncResult from an error condition.

@@ -371,7 +591,7 @@ Creates a source_object :

-a
GObject, or NULL. + a GObject, or NULL. [allow-none] @@ -386,7 +606,7 @@ Creates a error :

-a
GError location. +a GError @@ -398,12 +618,57 @@ Creates a +

g_simple_async_result_new_take_error ()

+
GSimpleAsyncResult * g_simple_async_result_new_take_error
+                                                        (GObject *source_object,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data,
+                                                         GError *error);
+

+Creates a GSimpleAsyncResult from an error condition, and takes over the +caller's ownership of error, so the caller does not need to free it anymore. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

source_object :

a GObject, or NULL. [allow-none] +

callback :

a GAsyncReadyCallback +

user_data :

user data passed to callback. [allow-none] +

error :

a GError +

Returns :

a GSimpleAsyncResult + +
+

Since 2.28

+
+

g_simple_async_result_set_op_res_gpointer ()

void                g_simple_async_result_set_op_res_gpointer
                                                         (GSimpleAsyncResult *simple,
-                                                         gpointer op_res,
-                                                         GDestroyNotify destroy_op_res);
+ gpointer op_res, + GDestroyNotify destroy_op_res);

Sets the operation result within the asynchronous result to a pointer.

@@ -422,7 +687,7 @@ Sets the operation result within the asynchronous result to a pointer.

destroy_op_res :

-a GDestroyNotify function. +a GDestroyNotify function. @@ -431,7 +696,7 @@ Sets the operation result within the asynchronous result to a pointer.

g_simple_async_result_get_op_res_gpointer ()

-
gpointer            g_simple_async_result_get_op_res_gpointer
+
gpointer            g_simple_async_result_get_op_res_gpointer
                                                         (GSimpleAsyncResult *simple);

Gets a pointer result as returned by the asynchronous function. @@ -457,7 +722,7 @@ Gets a pointer result as returned by the asynchronous function.

g_simple_async_result_set_op_res_gssize ()

void                g_simple_async_result_set_op_res_gssize
                                                         (GSimpleAsyncResult *simple,
-                                                         gssize op_res);
+ gssize op_res);

Sets the operation result within the asynchronous result to the given op_res. @@ -472,7 +737,7 @@ the given op_res.

op_res :

-a gssize. +a gssize. @@ -481,7 +746,7 @@ the given op_res.

g_simple_async_result_get_op_res_gssize ()

-
gssize              g_simple_async_result_get_op_res_gssize
+
gssize              g_simple_async_result_get_op_res_gssize
                                                         (GSimpleAsyncResult *simple);

Gets a gssize from the asynchronous result. @@ -507,7 +772,7 @@ Gets a gssize from the asynchronous result.

g_simple_async_result_set_op_res_gboolean ()

void                g_simple_async_result_set_op_res_gboolean
                                                         (GSimpleAsyncResult *simple,
-                                                         gboolean op_res);
+ gboolean op_res);

Sets the operation result to a boolean within the asynchronous result.

@@ -521,7 +786,7 @@ Sets the operation result to a boolean within the asynchronous result.

op_res :

-a gboolean. +a gboolean. @@ -530,7 +795,7 @@ Sets the operation result to a boolean within the asynchronous result.

g_simple_async_result_get_op_res_gboolean ()

-
gboolean            g_simple_async_result_get_op_res_gboolean
+
gboolean            g_simple_async_result_get_op_res_gboolean
                                                         (GSimpleAsyncResult *simple);

Gets the operation result boolean from within the asynchronous result. @@ -545,8 +810,8 @@ Gets the operation result boolean from within the asynchronous result.

Returns :

- TRUE if the operation's result was TRUE, FALSE - if the operation's result was FALSE. + TRUE if the operation's result was TRUE, FALSE + if the operation's result was FALSE. @@ -555,7 +820,7 @@ Gets the operation result boolean from within the asynchronous result.

g_simple_async_result_get_source_tag ()

-
gpointer            g_simple_async_result_get_source_tag
+
gpointer            g_simple_async_result_get_source_tag
                                                         (GSimpleAsyncResult *simple);

Gets the source tag for the GSimpleAsyncResult. @@ -570,7 +835,7 @@ Gets the source tag for the

Returns :

- a gpointer to the source object for the GSimpleAsyncResult. + a gpointer to the source object for the GSimpleAsyncResult. @@ -579,9 +844,9 @@ Gets the source tag for the

g_simple_async_result_is_valid ()

-
gboolean            g_simple_async_result_is_valid      (GAsyncResult *result,
-                                                         GObject *source,
-                                                         gpointer source_tag);
+
gboolean            g_simple_async_result_is_valid      (GAsyncResult *result,
+                                                         GObject *source,
+                                                         gpointer source_tag);

Ensures that the data passed to the _finish function of an async operation is consistent. Three checks are performed. @@ -590,10 +855,12 @@ operation is consistent. Three checks are performed. First, result is checked to ensure that it is really a GSimpleAsyncResult. Second, source is checked to ensure that it matches the source object of result. Third, source_tag is -checked to ensure that it is equal to the source_tag argument given -to g_simple_async_result_new() (which, by convention, is a pointer -to the _async function corresponding to the _finish function from -which this function is called). +checked to ensure that it is either NULL (as it is when the result was +created by g_simple_async_report_error_in_idle() or +g_simple_async_report_gerror_in_idle()) or equal to the +source_tag argument given to g_simple_async_result_new() (which, by +convention, is a pointer to the _async function corresponding to the +_finish function from which this function is called).

@@ -605,7 +872,7 @@ which this function is called). - @@ -615,18 +882,20 @@ which this function is called). -

source :

the GObject passed to the _finish function. +the GObject passed to the _finish function.

Returns :

TRUE if all checks passed or FALSE if any failed. + TRUE if all checks passed or FALSE if any failed. +
+

Since 2.20


g_simple_async_result_set_handle_cancellation ()

void                g_simple_async_result_set_handle_cancellation
                                                         (GSimpleAsyncResult *simple,
-                                                         gboolean handle_cancellation);
+ gboolean handle_cancellation);

Sets whether to handle cancellation within the asynchronous operation.

@@ -640,7 +909,7 @@ Sets whether to handle cancellation within the asynchronous operation.

handle_cancellation :

-a gboolean. +a gboolean. @@ -656,6 +925,10 @@ the thread where the asynchronous result was to be delivered, as it invokes the callback directly. If you are in a different thread use g_simple_async_result_complete_in_idle().

+

+Calling this function takes a reference to simple for as long as +is needed to complete the call. +

@@ -723,7 +996,7 @@ is needed to run the job and report its completion. - @@ -734,9 +1007,9 @@ is needed to run the job and report its completion.

g_simple_async_result_set_from_error ()

void                g_simple_async_result_set_from_error
                                                         (GSimpleAsyncResult *simple,
-                                                         const GError *error);
+ const GError *error);

-Sets the result from a GError. +Sets the result from a GError.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.
@@ -749,18 +1022,44 @@ Sets the result from a error :

+ + +
-GError. +GError. +
+
+
+
+

g_simple_async_result_take_error ()

+
void                g_simple_async_result_take_error    (GSimpleAsyncResult *simple,
+                                                         GError *error);
+

+Sets the result from error, and takes over the caller's ownership +of error, so the caller does not need to free it any more. +

+
++ + + + + + + +

simple :

a GSimpleAsyncResult +

error :

a GError
+

Since 2.28


g_simple_async_result_propagate_error ()

-
gboolean            g_simple_async_result_propagate_error
+
gboolean            g_simple_async_result_propagate_error
                                                         (GSimpleAsyncResult *simple,
-                                                         GError **dest);
+ GError **dest);

Propagates an error from within the simple asynchronous result to a given destination. @@ -780,7 +1079,7 @@ a given destination.

Returns :

- TRUE if the error was propagated to dest. FALSE otherwise. + TRUE if the error was propagated to dest. FALSE otherwise. @@ -790,12 +1089,12 @@ a given destination.

g_simple_async_result_set_error ()

void                g_simple_async_result_set_error     (GSimpleAsyncResult *simple,
-                                                         GQuark domain,
-                                                         gint code,
+                                                         GQuark domain,
+                                                         gint code,
                                                          const char *format,
                                                          ...);

-Sets an error within the asynchronous result without a GError. +Sets an error within the asynchronous result without a GError.

@@ -807,7 +1106,7 @@ Sets an error within the asynchronous result without a domain :

-
@@ -832,12 +1131,12 @@ Sets an error within the asynchronous result without a

g_simple_async_result_set_error_va ()

void                g_simple_async_result_set_error_va  (GSimpleAsyncResult *simple,
-                                                         GQuark domain,
-                                                         gint code,
+                                                         GQuark domain,
+                                                         gint code,
                                                          const char *format,
                                                          va_list args);

-Sets an error within the asynchronous result without a GError. +Sets an error within the asynchronous result without a GError. Unless writing a binding, see g_simple_async_result_set_error().

a GQuark (usually G_IO_ERROR). +a GQuark (usually G_IO_ERROR).
@@ -850,7 +1149,7 @@ Unless writing a binding, see domain :

-
@@ -874,11 +1173,11 @@ Unless writing a binding, see

g_simple_async_report_error_in_idle ()

-
void                g_simple_async_report_error_in_idle (GObject *object,
+
void                g_simple_async_report_error_in_idle (GObject *object,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data,
-                                                         GQuark domain,
-                                                         gint code,
+                                                         gpointer user_data,
+                                                         GQuark domain,
+                                                         gint code,
                                                          const char *format,
                                                          ...);

@@ -891,7 +1190,7 @@ information.

- @@ -906,7 +1205,7 @@ information. - @@ -931,13 +1230,13 @@ information.

g_simple_async_report_gerror_in_idle ()

void                g_simple_async_report_gerror_in_idle
-                                                        (GObject *object,
+                                                        (GObject *object,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data,
-                                                         GError *error);
+ gpointer user_data, + const GError *error);

Reports an error in an idle function. Similar to -g_simple_async_report_error_in_idle(), but takes a GError rather +g_simple_async_report_error_in_idle(), but takes a GError rather than building a new one.

a GQuark (usually G_IO_ERROR). +a GQuark (usually G_IO_ERROR).

object :

a GObject. + a GObject, or NULL. [allow-none]

domain :

a GQuark containing the error domain (usually G_IO_ERROR). +a GQuark containing the error domain (usually G_IO_ERROR).
@@ -945,7 +1244,46 @@ than building a new one. - + + + + + + + + + + + + + + +

object :

a GObject. + a GObject, or NULL. [allow-none] +

callback :

a GAsyncReadyCallback. +

user_data :

user data passed to callback. +

error :

the GError to report +
+
+
+
+

g_simple_async_report_take_gerror_in_idle ()

+
void                g_simple_async_report_take_gerror_in_idle
+                                                        (GObject *object,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data,
+                                                         GError *error);
+

+Reports an error in an idle function. Similar to +g_simple_async_report_gerror_in_idle(), but takes over the caller's +ownership of error, so the caller does not have to free it any more. +

+
++ + + + @@ -960,11 +1298,12 @@ than building a new one. -

object :

a GObject, or NULL. [allow-none]

error :

the GError to report +the GError to report
+

Since 2.28

@@ -974,6 +1313,6 @@ than building a new one.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSimplePermission.html b/docs/reference/gio/html/GSimplePermission.html new file mode 100644 index 0000000..7783e7b --- /dev/null +++ b/docs/reference/gio/html/GSimplePermission.html @@ -0,0 +1,107 @@ + + + + +GSimplePermission + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GSimplePermission

+

GSimplePermission — A GPermission that doesn't change value

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GPermission
+         +----GSimplePermission
+
+
+
+

Description

+

+GSimplePermission is a trivial implementation of GPermission that +represents a permission that is either always or never allowed. The +value is given at constuction and doesn't change. +

+

+Calling request or release will result in errors. +

+
+
+

Details

+
+

GSimplePermission

+
typedef struct _GSimplePermission GSimplePermission;
+

+GSimplePermission is an opaque data structure. There are no methods +except for those defined by GPermission. +

+
+
+
+

g_simple_permission_new ()

+
GPermission *       g_simple_permission_new             (gboolean allowed);
+

+Creates a new GPermission instance that represents an action that is +either always or never allowed. +

+
++ + + + + + + + + + +

allowed :

+TRUE if the action is allowed +

Returns :

the GSimplePermission, as a GPermission +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GSocket.html b/docs/reference/gio/html/GSocket.html index bbb0e90..2343990 100644 --- a/docs/reference/gio/html/GSocket.html +++ b/docs/reference/gio/html/GSocket.html @@ -3,12 +3,12 @@ GSocket - + - - + + - + @@ -47,9 +47,9 @@ #include <gio/gio.h> GSocket; -gboolean (*GSocketSourceFunc) (GSocket *socket, - GIOCondition condition, - gpointer user_data); +gboolean (*GSocketSourceFunc) (GSocket *socket, + GIOCondition condition, + gpointer user_data); enum GSocketType; enum GSocketProtocol; enum GSocketMsgFlags; @@ -58,105 +58,122 @@ enum GSocket * g_socket_new (GSocketFamily family, GSocketType type, GSocketProtocol protocol, - GError **error); -GSocket * g_socket_new_from_fd (gint fd, - GError **error); -gboolean g_socket_bind (GSocket *socket, + GError **error); +GSocket * g_socket_new_from_fd (gint fd, + GError **error); +gboolean g_socket_bind (GSocket *socket, GSocketAddress *address, - gboolean allow_reuse, - GError **error); -gboolean g_socket_listen (GSocket *socket, - GError **error); + gboolean allow_reuse, + GError **error); +gboolean g_socket_listen (GSocket *socket, + GError **error); GSocket * g_socket_accept (GSocket *socket, GCancellable *cancellable, - GError **error); -gboolean g_socket_connect (GSocket *socket, + GError **error); +gboolean g_socket_connect (GSocket *socket, GSocketAddress *address, GCancellable *cancellable, - GError **error); -gboolean g_socket_check_connect_result (GSocket *socket, - GError **error); -gssize g_socket_receive (GSocket *socket, - gchar *buffer, - gsize size, + GError **error); +gboolean g_socket_check_connect_result (GSocket *socket, + GError **error); +gssize g_socket_receive (GSocket *socket, + gchar *buffer, + gsize size, GCancellable *cancellable, - GError **error); -gssize g_socket_receive_from (GSocket *socket, + GError **error); +gssize g_socket_receive_from (GSocket *socket, GSocketAddress **address, - gchar *buffer, - gsize size, + gchar *buffer, + gsize size, GCancellable *cancellable, - GError **error); -gssize g_socket_receive_message (GSocket *socket, + GError **error); +gssize g_socket_receive_message (GSocket *socket, GSocketAddress **address, GInputVector *vectors, - gint num_vectors, + gint num_vectors, GSocketControlMessage ***messages, - gint *num_messages, - gint *flags, + gint *num_messages, + gint *flags, GCancellable *cancellable, - GError **error); -gssize g_socket_send (GSocket *socket, - const gchar *buffer, - gsize size, + GError **error); +gssize g_socket_receive_with_blocking (GSocket *socket, + gchar *buffer, + gsize size, + gboolean blocking, GCancellable *cancellable, - GError **error); -gssize g_socket_send_to (GSocket *socket, + GError **error); +gssize g_socket_send (GSocket *socket, + const gchar *buffer, + gsize size, + GCancellable *cancellable, + GError **error); +gssize g_socket_send_to (GSocket *socket, GSocketAddress *address, - const gchar *buffer, - gsize size, + const gchar *buffer, + gsize size, GCancellable *cancellable, - GError **error); -gssize g_socket_send_message (GSocket *socket, + GError **error); +gssize g_socket_send_message (GSocket *socket, GSocketAddress *address, GOutputVector *vectors, - gint num_vectors, + gint num_vectors, GSocketControlMessage **messages, - gint num_messages, - gint flags, + gint num_messages, + gint flags, + GCancellable *cancellable, + GError **error); +gssize g_socket_send_with_blocking (GSocket *socket, + const gchar *buffer, + gsize size, + gboolean blocking, GCancellable *cancellable, - GError **error); -gboolean g_socket_close (GSocket *socket, - GError **error); -gboolean g_socket_is_closed (GSocket *socket); -gboolean g_socket_shutdown (GSocket *socket, - gboolean shutdown_read, - gboolean shutdown_write, - GError **error); -gboolean g_socket_is_connected (GSocket *socket); -GSource * g_socket_create_source (GSocket *socket, - GIOCondition condition, + GError **error); +gboolean g_socket_close (GSocket *socket, + GError **error); +gboolean g_socket_is_closed (GSocket *socket); +gboolean g_socket_shutdown (GSocket *socket, + gboolean shutdown_read, + gboolean shutdown_write, + GError **error); +gboolean g_socket_is_connected (GSocket *socket); +GSource * g_socket_create_source (GSocket *socket, + GIOCondition condition, GCancellable *cancellable); -GIOCondition g_socket_condition_check (GSocket *socket, - GIOCondition condition); -gboolean g_socket_condition_wait (GSocket *socket, - GIOCondition condition, +GIOCondition g_socket_condition_check (GSocket *socket, + GIOCondition condition); +gboolean g_socket_condition_wait (GSocket *socket, + GIOCondition condition, GCancellable *cancellable, - GError **error); + GError **error); void g_socket_set_listen_backlog (GSocket *socket, - gint backlog); -gint g_socket_get_listen_backlog (GSocket *socket); -gboolean g_socket_get_blocking (GSocket *socket); + gint backlog); +gint g_socket_get_listen_backlog (GSocket *socket); +gboolean g_socket_get_blocking (GSocket *socket); void g_socket_set_blocking (GSocket *socket, - gboolean blocking); -gboolean g_socket_get_keepalive (GSocket *socket); + gboolean blocking); +gboolean g_socket_get_keepalive (GSocket *socket); void g_socket_set_keepalive (GSocket *socket, - gboolean keepalive); + gboolean keepalive); +guint g_socket_get_timeout (GSocket *socket); +void g_socket_set_timeout (GSocket *socket, + guint timeout); GSocketFamily g_socket_get_family (GSocket *socket); int g_socket_get_fd (GSocket *socket); GSocketAddress * g_socket_get_local_address (GSocket *socket, - GError **error); + GError **error); GSocketProtocol g_socket_get_protocol (GSocket *socket); GSocketAddress * g_socket_get_remote_address (GSocket *socket, - GError **error); + GError **error); GSocketType g_socket_get_socket_type (GSocket *socket); -gboolean g_socket_speaks_ipv4 (GSocket *socket); +gboolean g_socket_speaks_ipv4 (GSocket *socket); +GCredentials * g_socket_get_credentials (GSocket *socket, + GError **error);

Object Hierarchy

-  GObject
+  GObject
    +----GSocket
 
@@ -169,14 +186,15 @@ GSocket implements

Properties

-  "blocking"                 gboolean              : Read / Write
+  "blocking"                 gboolean              : Read / Write
   "family"                   GSocketFamily         : Read / Write / Construct Only
-  "fd"                       gint                  : Read / Write / Construct Only
-  "keepalive"                gboolean              : Read / Write
-  "listen-backlog"           gint                  : Read / Write
+  "fd"                       gint                  : Read / Write / Construct Only
+  "keepalive"                gboolean              : Read / Write
+  "listen-backlog"           gint                  : Read / Write
   "local-address"            GSocketAddress*       : Read
   "protocol"                 GSocketProtocol       : Read / Write / Construct Only
   "remote-address"           GSocketAddress*       : Read
+  "timeout"                  guint                 : Read / Write
   "type"                     GSocketType           : Read / Write / Construct Only
 
@@ -196,10 +214,10 @@ direct use of GSocket implements the GInitable interface, so if it is manually constructed -by e.g. g_object_new() you must call g_initable_init() and check the +by e.g. g_object_new() you must call g_initable_init() and check the results before using the object. This is done automatically in g_socket_new() and g_socket_new_from_fd(), so these functions can return -NULL. +NULL.

Sockets operate in two general modes, blocking or non-blocking. When @@ -208,7 +226,7 @@ is finished or there is an error. In non-blocking mode all calls that would block return immediately with a G_IO_ERROR_WOULD_BLOCK error. To know when a call would successfully run you can call g_socket_condition_check(), or g_socket_condition_wait(). You can also use g_socket_create_source() and -attach it to a GMainContext to get callbacks when I/O is possible. +attach it to a GMainContext to get callbacks when I/O is possible. Note that all sockets are always set to non blocking mode in the system, and blocking mode is emulated in GSocket.

@@ -251,11 +269,11 @@ A lowlevel network socket object.

GSocketSourceFunc ()

-
gboolean            (*GSocketSourceFunc)                (GSocket *socket,
-                                                         GIOCondition condition,
-                                                         gpointer user_data);
+
gboolean            (*GSocketSourceFunc)                (GSocket *socket,
+                                                         GIOCondition condition,
+                                                         gpointer user_data);

-This is the function type of the callback used for the GSource +This is the function type of the callback used for the GSource returned by g_socket_create_source().

@@ -278,7 +296,7 @@ returned by Returns :

-
@@ -448,12 +466,12 @@ first buffer, switching to the next as needed. - + - + @@ -479,12 +497,12 @@ one buffer. - + - + @@ -498,7 +516,7 @@ one buffer.
GSocket *           g_socket_new                        (GSocketFamily family,
                                                          GSocketType type,
                                                          GSocketProtocol protocol,
-                                                         GError **error);
+ GError **error);

Creates a new GSocket with the defined family, type and protocol. If protocol is 0 (G_SOCKET_PROTOCOL_DEFAULT) the default protocol type @@ -537,13 +555,13 @@ know the protocol number used for it.

- @@ -554,8 +572,8 @@ know the protocol number used for it.

g_socket_new_from_fd ()

-
GSocket *           g_socket_new_from_fd                (gint fd,
-                                                         GError **error);
+
GSocket *           g_socket_new_from_fd                (gint fd,
+                                                         GError **error);

Creates a new GSocket from a native file descriptor or winsock SOCKET handle. @@ -577,13 +595,13 @@ mode of the error :

- @@ -594,10 +612,10 @@ mode of the

g_socket_bind ()

-
gboolean            g_socket_bind                       (GSocket *socket,
+
gboolean            g_socket_bind                       (GSocket *socket,
                                                          GSocketAddress *address,
-                                                         gboolean allow_reuse,
-                                                         GError **error);
+ gboolean allow_reuse, + GError **error);

When a socket is created it is attached to an address family, but it doesn't have an address in this family. g_socket_bind() assigns the @@ -610,9 +628,9 @@ In certain situations, you may also want to bind a socket that will be used to initiate connections, though this is not normally required.

-allow_reuse should be TRUE for server sockets (sockets that you will -eventually call g_socket_accept() on), and FALSE for client sockets. -(Specifically, if it is TRUE, then g_socket_bind() will set the +allow_reuse should be TRUE for server sockets (sockets that you will +eventually call g_socket_accept() on), and FALSE for client sockets. +(Specifically, if it is TRUE, then g_socket_bind() will set the SO_REUSEADDR flag on the socket, allowing it to bind address even if that address was previously used by another socket that has not yet been fully cleaned-up by the kernel. Failing to set this flag on a server @@ -640,12 +658,12 @@ the server program is stopped and then immediately restarted.)

- @@ -656,8 +674,8 @@ the server program is stopped and then immediately restarted.)

g_socket_listen ()

-
gboolean            g_socket_listen                     (GSocket *socket,
-                                                         GError **error);
+
gboolean            g_socket_listen                     (GSocket *socket,
+                                                         GError **error);

Marks the socket as a server socket, i.e. a socket that is used to accept incoming requests using g_socket_accept(). @@ -681,12 +699,12 @@ To set the maximum amount of outstanding clients, use

- @@ -699,7 +717,7 @@ To set the maximum amount of outstanding clients, use

g_socket_accept ()

GSocket *           g_socket_accept                     (GSocket *socket,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Accept incoming connections on a connection-based socket. This removes the first outstanding connection request from the listening socket and @@ -712,7 +730,7 @@ must be listening for incoming connections (G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled. -To be notified of an incoming connection, wait for the G_IO_IN condition. +To be notified of an incoming connection, wait for the G_IO_IN condition.

it should return FALSE if the source should be removed. + it should return FALSE if the source should be removed.

gpointer buffer;

gpointer buffer;

Pointer to a buffer where data will be written.

gsize size;

gsize size;

the available size in buffer.

gconstpointer buffer;

gconstpointer buffer;

Pointer to a buffer of data to read.

gsize size;

gsize size;

the size of buffer.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

a GSocket or NULL on error. - Free the returned object with g_object_unref(). + a GSocket or NULL on error. + Free the returned object with g_object_unref().
-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

a GSocket or NULL on error. - Free the returned object with g_object_unref(). + a GSocket or NULL on error. + Free the returned object with g_object_unref().

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

TRUE on success, FALSE on error. + TRUE on success, FALSE on error.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

TRUE on success, FALSE on error. + TRUE on success, FALSE on error.
@@ -724,20 +742,19 @@ To be notified of an incoming connection, wait for the cancellable :

-
- @@ -747,10 +764,10 @@ To be notified of an incoming connection, wait for the

g_socket_connect ()

-
gboolean            g_socket_connect                    (GSocket *socket,
+
gboolean            g_socket_connect                    (GSocket *socket,
                                                          GSocketAddress *address,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Connect the socket to the specified remote address.

@@ -787,18 +804,18 @@ checked with - - @@ -809,8 +826,8 @@ checked with

g_socket_check_connect_result ()

-
gboolean            g_socket_check_connect_result       (GSocket *socket,
-                                                         GError **error);
+
gboolean            g_socket_check_connect_result       (GSocket *socket,
+                                                         GError **error);

Checks and resets the pending connect error for the socket. This is used to check for errors when g_socket_connect() is @@ -827,12 +844,12 @@ used in non-blocking mode.

- @@ -843,15 +860,15 @@ used in non-blocking mode.

g_socket_receive ()

-
gssize              g_socket_receive                    (GSocket *socket,
-                                                         gchar *buffer,
-                                                         gsize size,
+
gssize              g_socket_receive                    (GSocket *socket,
+                                                         gchar *buffer,
+                                                         gsize size,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Receive data (up to size bytes) from a socket. This is mainly used by connection-oriented sockets; it is identical to g_socket_receive_from() -with address set to NULL. +with address set to NULL.

For G_SOCKET_TYPE_DATAGRAM and G_SOCKET_TYPE_SEQPACKET sockets, @@ -871,7 +888,7 @@ If the socket is in blocking mode the call will block until there is some data to receive or there is an error. If there is no data available and the socket is in non-blocking mode, a G_IO_ERROR_WOULD_BLOCK error will be returned. To be notified when data is available, wait for the -G_IO_IN condition. +G_IO_IN condition.

On error -1 is returned and error is set accordingly. @@ -897,13 +914,13 @@ On error -1 is returned and error is set

- @@ -919,17 +936,17 @@ On error -1 is returned and error is set

g_socket_receive_from ()

-
gssize              g_socket_receive_from               (GSocket *socket,
+
gssize              g_socket_receive_from               (GSocket *socket,
                                                          GSocketAddress **address,
-                                                         gchar *buffer,
-                                                         gsize size,
+                                                         gchar *buffer,
+                                                         gsize size,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Receive data (up to size bytes) from a socket.

-If address is non-NULL then address will be set equal to the +If address is non-NULL then address will be set equal to the source address of the received packet. address is owned by the caller.

@@ -946,7 +963,7 @@ See address :

-
@@ -962,13 +979,13 @@ See cancellable :

-
@@ -984,22 +1001,22 @@ See

g_socket_receive_message ()

-
gssize              g_socket_receive_message            (GSocket *socket,
+
gssize              g_socket_receive_message            (GSocket *socket,
                                                          GSocketAddress **address,
                                                          GInputVector *vectors,
-                                                         gint num_vectors,
+                                                         gint num_vectors,
                                                          GSocketControlMessage ***messages,
-                                                         gint *num_messages,
-                                                         gint *flags,
+                                                         gint *num_messages,
+                                                         gint *flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Receive data from a socket. This is the most complicated and fully-featured version of this call. For easier use, see g_socket_receive() and g_socket_receive_from().

-If address is non-NULL then address will be set equal to the +If address is non-NULL then address will be set equal to the source address of the received packet. address is owned by the caller.

@@ -1008,31 +1025,32 @@ source address of the received packet. num_vectors must be the length of this array. These structs describe the buffers that received data will be scattered into. If num_vectors is -1, then vectors is assumed to be terminated -by a GInputVector with a NULL buffer pointer. +by a GInputVector with a NULL buffer pointer.

As a special case, if num_vectors is 0 (in which case, vectors -may of course be NULL), then a single byte is received and +may of course be NULL), then a single byte is received and discarded. This is to facilitate the common practice of sending a single '\0' byte for the purposes of transferring ancillary data.

-messages, if non-NULL, will be set to point to a newly-allocated -array of GSocketControlMessage instances. These correspond to the -control messages received from the kernel, one -GSocketControlMessage per message from the kernel. This array is -NULL-terminated and must be freed by the caller using g_free(). If -messages is NULL, any control messages received will be -discarded. +messages, if non-NULL, will be set to point to a newly-allocated +array of GSocketControlMessage instances or NULL if no such +messages was received. These correspond to the control messages +received from the kernel, one GSocketControlMessage per message +from the kernel. This array is NULL-terminated and must be freed +by the caller using g_free() after calling g_object_unref() on each +element. If messages is NULL, any control messages received will +be discarded.

-num_messages, if non-NULL, will be set to the number of control +num_messages, if non-NULL, will be set to the number of control messages received.

-If both messages and num_messages are non-NULL, then +If both messages and num_messages are non-NULL, then num_messages gives the number of GSocketControlMessage instances -in messages (ie: not including the NULL terminator). +in messages (ie: not including the NULL terminator).

flags is an in/out parameter. The commonly available arguments @@ -1055,7 +1073,7 @@ If the socket is in blocking mode the call will block until there is some data to receive or there is an error. If there is no data available and the socket is in non-blocking mode, a G_IO_ERROR_WOULD_BLOCK error will be returned. To be notified when -data is available, wait for the G_IO_IN condition. +data is available, wait for the G_IO_IN condition.

On error -1 is returned and error is set accordingly. @@ -1070,7 +1088,7 @@ On error -1 is returned and error is set

- @@ -1085,14 +1103,14 @@ On error -1 is returned and error is set - @@ -1102,12 +1120,12 @@ On error -1 is returned and error is set - - @@ -1121,26 +1139,85 @@ On error -1 is returned and error is set

Since 2.22


+
+

g_socket_receive_with_blocking ()

+
gssize              g_socket_receive_with_blocking      (GSocket *socket,
+                                                         gchar *buffer,
+                                                         gsize size,
+                                                         gboolean blocking,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+This behaves exactly the same as g_socket_receive(), except that +the choice of blocking or non-blocking behavior is determined by +the blocking argument rather than by socket's properties. +

+
a GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

a new GSocket, or NULL on error. - Free the returned object with g_object_unref(). - + a new GSocket, or NULL on error. + Free the returned object with g_object_unref(). [transfer full]

cancellable :

a GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

TRUE if connected, FALSE on error. + TRUE if connected, FALSE on error.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

TRUE if no error, FALSE otherwise, setting error to the error + TRUE if no error, FALSE otherwise, setting error to the error

cancellable :

a GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.
a pointer to a GSocketAddress pointer, or NULL +a pointer to a GSocketAddress pointer, or NULL
a GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

address :

a pointer to a GSocketAddress pointer, or NULL +a pointer to a GSocketAddress pointer, or NULL

messages :

a pointer which will be filled with an array of - GSocketControlMessages, or NULL +a pointer which may be filled with an array of + GSocketControlMessages, or NULL

num_messages :

a pointer which will be filled with the number of - elements in messages, or NULL + elements in messages, or NULL

cancellable :

a GCancellable or NULL +a GCancellable or NULL

error :

a GError pointer, or NULL +a GError pointer, or NULL
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

socket :

a GSocket +

buffer :

a buffer to read data into (which should be at least size + bytes long). +

size :

the number of bytes you want to read from the socket +

blocking :

whether to do blocking or non-blocking I/O +

cancellable :

a GCancellable or NULL +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

Number of bytes read, or -1 on error + +
+

Since 2.26

+
+

g_socket_send ()

-
gssize              g_socket_send                       (GSocket *socket,
-                                                         const gchar *buffer,
-                                                         gsize size,
+
gssize              g_socket_send                       (GSocket *socket,
+                                                         const gchar *buffer,
+                                                         gsize size,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to send size bytes from buffer on the socket. This is mainly used by connection-oriented sockets; it is identical to -g_socket_send_to() with address set to NULL. +g_socket_send_to() with address set to NULL.

If the socket is in blocking mode the call will block until there is space for the data in the socket queue. If there is no space available and the socket is in non-blocking mode a G_IO_ERROR_WOULD_BLOCK error will be returned. To be notified when space is available, wait for the -G_IO_OUT condition. Note though that you may still receive +G_IO_OUT condition. Note though that you may still receive G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously -notified of a G_IO_OUT condition. (On Windows in particular, this is +notified of a G_IO_OUT condition. (On Windows in particular, this is very common due to the way the underlying APIs work.)

@@ -1166,13 +1243,13 @@ On error -1 is returned and error is set

cancellable :

-a GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore. @@ -1189,15 +1266,15 @@ on error

g_socket_send_to ()

-
gssize              g_socket_send_to                    (GSocket *socket,
+
gssize              g_socket_send_to                    (GSocket *socket,
                                                          GSocketAddress *address,
-                                                         const gchar *buffer,
-                                                         gsize size,
+                                                         const gchar *buffer,
+                                                         gsize size,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Tries to send size bytes from buffer to address. If address is -NULL then the message is sent to the default receiver (set by +NULL then the message is sent to the default receiver (set by g_socket_connect()).

@@ -1213,7 +1290,7 @@ See <

address :

-a GSocketAddress, or NULL +a GSocketAddress, or NULL @@ -1228,13 +1305,13 @@ See <

cancellable :

-a
GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore. @@ -1251,39 +1328,39 @@ on error

g_socket_send_message ()

-
gssize              g_socket_send_message               (GSocket *socket,
+
gssize              g_socket_send_message               (GSocket *socket,
                                                          GSocketAddress *address,
                                                          GOutputVector *vectors,
-                                                         gint num_vectors,
+                                                         gint num_vectors,
                                                          GSocketControlMessage **messages,
-                                                         gint num_messages,
-                                                         gint flags,
+                                                         gint num_messages,
+                                                         gint flags,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Send data to address on socket. This is the most complicated and fully-featured version of this call. For easier use, see g_socket_send() and g_socket_send_to().

-If address is NULL then the message is sent to the default receiver +If address is NULL then the message is sent to the default receiver (set by g_socket_connect()).

vectors must point to an array of GOutputVector structs and num_vectors must be the length of this array. (If num_vectors is -1, then vectors is assumed to be terminated by a GOutputVector with a -NULL buffer pointer.) The GOutputVector structs describe the buffers +NULL buffer pointer.) The GOutputVector structs describe the buffers that the sent data will be gathered from. Using multiple GOutputVectors is more memory-efficient than manually copying data from multiple sources into a single buffer, and more network-efficient than making multiple calls to g_socket_send().

-messages, if non-NULL, is taken to point to an array of num_messages +messages, if non-NULL, is taken to point to an array of num_messages GSocketControlMessage instances. These correspond to the control messages to be sent on the socket. -If num_messages is -1 then messages is treated as a NULL-terminated +If num_messages is -1 then messages is treated as a NULL-terminated array.

@@ -1297,9 +1374,9 @@ If the socket is in blocking mode the call will block until there is space for the data in the socket queue. If there is no space available and the socket is in non-blocking mode a G_IO_ERROR_WOULD_BLOCK error will be returned. To be notified when space is available, wait for the -G_IO_OUT condition. Note though that you may still receive +G_IO_OUT condition. Note though that you may still receive G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously -notified of a G_IO_OUT condition. (On Windows in particular, this is +notified of a G_IO_OUT condition. (On Windows in particular, this is very common due to the way the underlying APIs work.)

@@ -1315,7 +1392,7 @@ On error -1 is returned and error is set

address :

-a GSocketAddress, or NULL +a GSocketAddress, or NULL @@ -1331,7 +1408,7 @@ On error -1 is returned and error is set

messages :

a pointer to an array of GSocketControlMessages, or - NULL. + NULL. @@ -1346,13 +1423,13 @@ On error -1 is returned and error is set

cancellable :

-a GCancellable or NULL +a GCancellable or NULL

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore. @@ -1367,10 +1444,69 @@ on error

Since 2.22


+
+

g_socket_send_with_blocking ()

+
gssize              g_socket_send_with_blocking         (GSocket *socket,
+                                                         const gchar *buffer,
+                                                         gsize size,
+                                                         gboolean blocking,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+This behaves exactly the same as g_socket_send(), except that +the choice of blocking or non-blocking behavior is determined by +the blocking argument rather than by socket's properties. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

socket :

a GSocket +

buffer :

the buffer containing the data to send. +

size :

the number of bytes to send +

blocking :

whether to do blocking or non-blocking I/O +

cancellable :

a GCancellable or NULL +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

Number of bytes written (which may be less than size), or -1 +on error + +
+

Since 2.26

+
+

g_socket_close ()

-
gboolean            g_socket_close                      (GSocket *socket,
-                                                         GError **error);
+
gboolean            g_socket_close                      (GSocket *socket,
+                                                         GError **error);

Closes the socket, shutting down any active connection.

@@ -1392,7 +1528,7 @@ resources are released as early as possible.

Beware that due to the way that TCP works, it is possible for recently-sent data to be lost if either you close a socket while the -G_IO_IN condition is set, or else if the remote connection tries to +G_IO_IN condition is set, or else if the remote connection tries to send something to you after you close the socket but before it has finished reading all of the data you sent. There is no easy generic way to avoid this problem; the easiest fix is to design the network @@ -1401,8 +1537,8 @@ Another solution is for the server to half-close the connection by calling g_socket_shutdown() with only the shutdown_write flag set, and then wait for the client to notice this and close its side of the connection, after which the server can safely call g_socket_close(). -(This is what GTcpConnection does if you call -g_tcp_connection_set_graceful_disconnect(). But of course, this +(This is what GTcpConnection does if you call +g_tcp_connection_set_graceful_disconnect(). But of course, this only works if the client will close its connection after the server does.)

@@ -1417,12 +1553,12 @@ does.)

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- TRUE on success, FALSE on error + TRUE on success, FALSE on error @@ -1433,7 +1569,7 @@ does.)

g_socket_is_closed ()

-
gboolean            g_socket_is_closed                  (GSocket *socket);
+
gboolean            g_socket_is_closed                  (GSocket *socket);

Checks whether a socket is closed.

@@ -1447,7 +1583,7 @@ Checks whether a socket is closed.

Returns :

- TRUE if socket is closed, FALSE otherwise + TRUE if socket is closed, FALSE otherwise @@ -1458,23 +1594,23 @@ Checks whether a socket is closed.

g_socket_shutdown ()

-
gboolean            g_socket_shutdown                   (GSocket *socket,
-                                                         gboolean shutdown_read,
-                                                         gboolean shutdown_write,
-                                                         GError **error);
+
gboolean            g_socket_shutdown                   (GSocket *socket,
+                                                         gboolean shutdown_read,
+                                                         gboolean shutdown_write,
+                                                         GError **error);

Shut down part of a full-duplex connection.

-If shutdown_read is TRUE then the recieving side of the connection +If shutdown_read is TRUE then the recieving side of the connection is shut down, and further reading is disallowed.

-If shutdown_write is TRUE then the sending side of the connection +If shutdown_write is TRUE then the sending side of the connection is shut down, and further writing is disallowed.

-It is allowed for both shutdown_read and shutdown_write to be TRUE. +It is allowed for both shutdown_read and shutdown_write to be TRUE.

One example where this is used is graceful disconnect for TCP connections @@ -1502,12 +1638,12 @@ the connection, thus ensuring that the other side saw all sent data.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- TRUE on success, FALSE on error + TRUE on success, FALSE on error @@ -1518,7 +1654,7 @@ the connection, thus ensuring that the other side saw all sent data.

g_socket_is_connected ()

-
gboolean            g_socket_is_connected               (GSocket *socket);
+
gboolean            g_socket_is_connected               (GSocket *socket);

Check whether the socket is connected. This is only useful for connection-oriented sockets. @@ -1533,7 +1669,7 @@ connection-oriented sockets.

Returns :

- TRUE if socket is connected, FALSE otherwise. + TRUE if socket is connected, FALSE otherwise. @@ -1544,27 +1680,34 @@ connection-oriented sockets.

g_socket_create_source ()

-
GSource *           g_socket_create_source              (GSocket *socket,
-                                                         GIOCondition condition,
+
GSource *           g_socket_create_source              (GSocket *socket,
+                                                         GIOCondition condition,
                                                          GCancellable *cancellable);

-Creates a GSource that can be attached to a GMainContext to monitor +Creates a GSource that can be attached to a GMainContext to monitor for the availibility of the specified condition on the socket.

The callback on the source is of the GSocketSourceFunc type.

-It is meaningless to specify G_IO_ERR or G_IO_HUP in condition; +It is meaningless to specify G_IO_ERR or G_IO_HUP in condition; these conditions will always be reported output if they are true.

-cancellable if not NULL can be used to cancel the source, which will +cancellable if not NULL can be used to cancel the source, which will cause the source to trigger, reporting the current condition (which is likely 0 unless cancellation happened at the same time as a condition change). You can check for this in the callback using g_cancellable_is_cancelled().

+

+If socket has a timeout set, and it is reached before condition +occurs, the source will then trigger anyway, reporting G_IO_IN or +G_IO_OUT depending on condition. However, socket will have been +marked as having had a timeout, and so the next GSocket I/O method +you call will then fail with a G_IO_ERROR_TIMED_OUT. +

@@ -1575,18 +1718,17 @@ condition change). You can check for this in the callback using - - - @@ -1596,8 +1738,8 @@ condition change). You can check for this in the callback using

g_socket_condition_check ()

-
GIOCondition        g_socket_condition_check            (GSocket *socket,
-                                                         GIOCondition condition);
+
GIOCondition        g_socket_condition_check            (GSocket *socket,
+                                                         GIOCondition condition);

Checks on the readiness of socket to perform operations. The operations specified in condition are checked for and masked @@ -1605,7 +1747,16 @@ against the currently-satisfied conditions on socket is returned.

-It is meaningless to specify G_IO_ERR or G_IO_HUP in condition; +Note that on Windows, it is possible for an operation to return +G_IO_ERROR_WOULD_BLOCK even immediately after +g_socket_condition_check() has claimed that the socket is ready for +writing. Rather than calling g_socket_condition_check() and then +writing to the socket if it succeeds, it is generally better to +simply try writing to the socket right away, and try again later if +the initial attempt returns G_IO_ERROR_WOULD_BLOCK. +

+

+It is meaningless to specify G_IO_ERR or G_IO_HUP in condition; these conditions will always be set in the output if they are true.

@@ -1621,7 +1772,7 @@ This call never blocks.

- @@ -1637,17 +1788,20 @@ This call never blocks.

g_socket_condition_wait ()

-
gboolean            g_socket_condition_wait             (GSocket *socket,
-                                                         GIOCondition condition,
+
gboolean            g_socket_condition_wait             (GSocket *socket,
+                                                         GIOCondition condition,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Waits for condition to become true on socket. When the condition -is met, TRUE is returned. +is met, TRUE is returned.

-If cancellable is cancelled before the condition is met then FALSE -is returned and error, if non-NULL, is set to G_IO_ERROR_CANCELLED. +If cancellable is cancelled before the condition is met, or if the +socket has a timeout set and it is reached before the condition is +met, then FALSE is returned and error, if non-NULL, is set to +the appropriate value (G_IO_ERROR_CANCELLED or +G_IO_ERROR_TIMED_OUT).

condition :

a GIOCondition mask to monitor +a GIOCondition mask to monitor

cancellable :

a GCancellable or NULL +a GCancellable or NULL

Returns :

a newly allocated GSource, free with g_source_unref(). - + a newly allocated GSource, free with g_source_unref(). [transfer full]

condition :

a GIOCondition mask to check +a GIOCondition mask to check
@@ -1659,22 +1813,22 @@ is returned and error, if non-condition :

-
- - - @@ -1686,7 +1840,7 @@ is returned and error, if non-

g_socket_set_listen_backlog ()

void                g_socket_set_listen_backlog         (GSocket *socket,
-                                                         gint backlog);
+ gint backlog);

Sets the maximum number of outstanding connections allowed when listening on this socket. If more clients than this are @@ -1717,7 +1871,7 @@ effect if called after that.


g_socket_get_listen_backlog ()

-
gint                g_socket_get_listen_backlog         (GSocket *socket);
+
gint                g_socket_get_listen_backlog         (GSocket *socket);

Gets the listen backlog setting of the socket. For details on this, see g_socket_set_listen_backlog(). @@ -1743,7 +1897,7 @@ see

g_socket_get_blocking ()

-
gboolean            g_socket_get_blocking               (GSocket *socket);
+
gboolean            g_socket_get_blocking               (GSocket *socket);

Gets the blocking mode of the socket. For details on blocking I/O, see g_socket_set_blocking(). @@ -1758,7 +1912,7 @@ see Returns :

-
@@ -1770,7 +1924,7 @@ see

g_socket_set_blocking ()

void                g_socket_set_blocking               (GSocket *socket,
-                                                         gboolean blocking);
+ gboolean blocking);

Sets the blocking mode of the socket. In blocking mode all operations block until they succeed or there is an error. In @@ -1802,7 +1956,7 @@ is a GSocket level feature.


g_socket_get_keepalive ()

-
gboolean            g_socket_get_keepalive              (GSocket *socket);
+
gboolean            g_socket_get_keepalive              (GSocket *socket);

Gets the keepalive mode of the socket. For details on this, see g_socket_set_keepalive(). @@ -1817,7 +1971,7 @@ see Returns :

-
@@ -1829,7 +1983,7 @@ see

g_socket_set_keepalive ()

void                g_socket_set_keepalive              (GSocket *socket,
-                                                         gboolean keepalive);
+ gboolean keepalive);

Sets or unsets the SO_KEEPALIVE flag on the underlying socket. When this flag is set on a socket, the system will attempt to verify that the @@ -1867,6 +2021,80 @@ garbage-collected if clients crash or become unreachable.

Since 2.22


+
+

g_socket_get_timeout ()

+
guint               g_socket_get_timeout                (GSocket *socket);
+

+Gets the timeout setting of the socket. For details on this, see +g_socket_set_timeout(). +

+
a GIOCondition mask to wait for +a GIOCondition mask to wait for

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL

error :

a GError pointer, or NULL +a GError pointer, or NULL

Returns :

TRUE if the condition was met, FALSE otherwise + TRUE if the condition was met, FALSE otherwise
TRUE if blocking I/O is used, FALSE otherwise. + TRUE if blocking I/O is used, FALSE otherwise.
TRUE if keepalive is active, FALSE otherwise. + TRUE if keepalive is active, FALSE otherwise.
++ + + + + + + + + + +

socket :

a GSocket. +

Returns :

the timeout in seconds + +
+

Since 2.26

+
+
+
+

g_socket_set_timeout ()

+
void                g_socket_set_timeout                (GSocket *socket,
+                                                         guint timeout);
+

+Sets the time in seconds after which I/O operations on socket will +time out if they have not yet completed. +

+

+On a blocking socket, this means that any blocking GSocket +operation will time out after timeout seconds of inactivity, +returning G_IO_ERROR_TIMED_OUT. +

+

+On a non-blocking socket, calls to g_socket_condition_wait() will +also fail with G_IO_ERROR_TIMED_OUT after the given time. Sources +created with g_socket_create_source() will trigger after +timeout seconds of inactivity, with the requested condition +set, at which point calling g_socket_receive(), g_socket_send(), +g_socket_check_connect_result(), etc, will fail with +G_IO_ERROR_TIMED_OUT. +

+

+If timeout is 0 (the default), operations will never time out +on their own. +

+

+Note that if an I/O operation is interrupted by a signal, this may +cause the timeout to be reset. +

+
++ + + + + + + + + + +

socket :

a GSocket. +

timeout :

the timeout for socket, in seconds, or 0 for none +
+

Since 2.26

+
+

g_socket_get_family ()

GSocketFamily       g_socket_get_family                 (GSocket *socket);
@@ -1924,7 +2152,7 @@ on the socket.

g_socket_get_local_address ()

GSocketAddress *    g_socket_get_local_address          (GSocket *socket,
-                                                         GError **error);
+ GError **error);

Try to get the local address of a bound socket. This is only useful if the socket has been bound to a local address, @@ -1941,14 +2169,13 @@ either explicitly or implicitly when connecting.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- a GSocketAddress or NULL on error. - Free the returned object with g_object_unref(). - + a GSocketAddress or NULL on error. + Free the returned object with g_object_unref(). [transfer full] @@ -1985,7 +2212,7 @@ In case the protocol is unknown, -1 is returned.

g_socket_get_remote_address ()

GSocketAddress *    g_socket_get_remote_address         (GSocket *socket,
-                                                         GError **error);
+ GError **error);

Try to get the remove address of a connected socket. This is only useful for connection oriented sockets that have been connected. @@ -2001,14 +2228,13 @@ useful for connection oriented sockets that have been connected.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- a GSocketAddress or NULL on error. - Free the returned object with g_object_unref(). - + a GSocketAddress or NULL on error. + Free the returned object with g_object_unref(). [transfer full] @@ -2043,7 +2269,7 @@ Gets the socket type of the socket.

g_socket_speaks_ipv4 ()

-
gboolean            g_socket_speaks_ipv4                (GSocket *socket);
+
gboolean            g_socket_speaks_ipv4                (GSocket *socket);

Checks if a socket is capable of speaking IPv4.

@@ -2067,7 +2293,7 @@ of speaking IPv4.

Returns :

- TRUE if this socket can be used with IPv4. + TRUE if this socket can be used with IPv4. @@ -2075,12 +2301,57 @@ of speaking IPv4.

Since 2.22

+
+
+

g_socket_get_credentials ()

+
GCredentials *      g_socket_get_credentials            (GSocket *socket,
+                                                         GError **error);
+

+Returns the credentials of the foreign process connected to this +socket, if any (e.g. it is only supported for G_SOCKET_FAMILY_UNIX +sockets). +

+

+If this operation isn't supported on the OS, the method fails with +the G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented +by reading the SO_PEERCRED option on the underlying socket. +

+

+Other ways to obtain credentials from a foreign peer includes the +GUnixCredentialsMessage type and +g_unix_connection_send_credentials() / +g_unix_connection_receive_credentials() functions. +

+
++ + + + + + + + + + + + + + +

socket :

a GSocket. +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

NULL if error is set, otherwise a GCredentials object +that must be freed with g_object_unref(). [transfer full] +
+

Since 2.26

+

Property Details

The "blocking" property

-
  "blocking"                 gboolean              : Read / Write
+
  "blocking"                 gboolean              : Read / Write

Whether or not I/O on this socket is blocking.

Default value: TRUE

@@ -2094,21 +2365,21 @@ of speaking IPv4.

The "fd" property

-
  "fd"                       gint                  : Read / Write / Construct Only
+
  "fd"                       gint                  : Read / Write / Construct Only

The sockets file descriptor.

Default value: -1


The "keepalive" property

-
  "keepalive"                gboolean              : Read / Write
+
  "keepalive"                gboolean              : Read / Write

Keep connection alive by sending periodic pings.

Default value: FALSE


The "listen-backlog" property

-
  "listen-backlog"           gint                  : Read / Write
+
  "listen-backlog"           gint                  : Read / Write

Outstanding connections in the listen queue.

Allowed values: [0,128]

Default value: 10

@@ -2133,6 +2404,16 @@ of speaking IPv4.

The remote address the socket is connected to.


+
+

The "timeout" property

+
  "timeout"                  guint                 : Read / Write
+

+The timeout in seconds on socket I/O +

+

Default value: 0

+

Since 2.26

+
+

The "type" property

  "type"                     GSocketType           : Read / Write / Construct Only
@@ -2147,6 +2428,6 @@ of speaking IPv4.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSocketAddress.html b/docs/reference/gio/html/GSocketAddress.html index d043d25..8b9ffe3 100644 --- a/docs/reference/gio/html/GSocketAddress.html +++ b/docs/reference/gio/html/GSocketAddress.html @@ -3,12 +3,12 @@ GSocketAddress - + - + - + @@ -46,20 +46,20 @@ socket communication

Synopsis

                    GSocketAddress;
 enum                GSocketFamily;
-GSocketAddress *    g_socket_address_new_from_native    (gpointer native,
-                                                         gsize len);
+GSocketAddress *    g_socket_address_new_from_native    (gpointer native,
+                                                         gsize len);
 GSocketFamily       g_socket_address_get_family         (GSocketAddress *address);
-gboolean            g_socket_address_to_native          (GSocketAddress *address,
-                                                         gpointer dest,
-                                                         gsize destlen,
-                                                         GError **error);
-gssize              g_socket_address_get_native_size    (GSocketAddress *address);
+gboolean            g_socket_address_to_native          (GSocketAddress *address,
+                                                         gpointer dest,
+                                                         gsize destlen,
+                                                         GError **error);
+gssize              g_socket_address_get_native_size    (GSocketAddress *address);
 

Object Hierarchy

-  GObject
+  GObject
    +----GSocketAddress
          +----GInetSocketAddress
          +----GUnixSocketAddress
@@ -143,8 +143,8 @@ if available.)
 

g_socket_address_new_from_native ()

-
GSocketAddress *    g_socket_address_new_from_native    (gpointer native,
-                                                         gsize len);
+
GSocketAddress *    g_socket_address_new_from_native    (gpointer native,
+                                                         gsize len);

Creates a GSocketAddress subclass corresponding to the native struct sockaddr native. @@ -165,7 +165,7 @@ Creates a

Returns :

a new GSocketAddress if native could successfully be converted, -otherwise NULL. +otherwise NULL. @@ -201,10 +201,10 @@ Gets the socket family type of address.

g_socket_address_to_native ()

-
gboolean            g_socket_address_to_native          (GSocketAddress *address,
-                                                         gpointer dest,
-                                                         gsize destlen,
-                                                         GError **error);
+
gboolean            g_socket_address_to_native          (GSocketAddress *address,
+                                                         gpointer dest,
+                                                         gsize destlen,
+                                                         GError **error);

Converts a GSocketAddress to a native struct sockaddr, which can be passed to low-level functions like @@ -238,12 +238,12 @@ then a

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- TRUE if dest was filled in, FALSE on error + TRUE if dest was filled in, FALSE on error @@ -254,7 +254,7 @@ then a

g_socket_address_get_native_size ()

-
gssize              g_socket_address_get_native_size    (GSocketAddress *address);
+
gssize              g_socket_address_get_native_size    (GSocketAddress *address);

Gets the size of address's native struct sockaddr. You can use this to allocate memory to pass to @@ -292,6 +292,6 @@ You can use this to allocate memory to pass to

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSocketClient.html b/docs/reference/gio/html/GSocketClient.html index ff57c37..5977ee0 100644 --- a/docs/reference/gio/html/GSocketClient.html +++ b/docs/reference/gio/html/GSocketClient.html @@ -3,12 +3,12 @@ GSocketClient - + - + @@ -45,51 +45,70 @@ #include <gio/gio.h> GSocketClient; +void g_socket_client_add_application_proxy + (GSocketClient *client, + const gchar *protocol); GSocketClient * g_socket_client_new (void); GSocketConnection * g_socket_client_connect (GSocketClient *client, GSocketConnectable *connectable, GCancellable *cancellable, - GError **error); + GError **error); void g_socket_client_connect_async (GSocketClient *client, GSocketConnectable *connectable, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GSocketConnection * g_socket_client_connect_finish (GSocketClient *client, GAsyncResult *result, - GError **error); + GError **error); GSocketConnection * g_socket_client_connect_to_host (GSocketClient *client, - const gchar *host_and_port, - guint16 default_port, + const gchar *host_and_port, + guint16 default_port, GCancellable *cancellable, - GError **error); + GError **error); void g_socket_client_connect_to_host_async (GSocketClient *client, - const gchar *host_and_port, - guint16 default_port, + const gchar *host_and_port, + guint16 default_port, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GSocketConnection * g_socket_client_connect_to_host_finish (GSocketClient *client, GAsyncResult *result, - GError **error); + GError **error); GSocketConnection * g_socket_client_connect_to_service (GSocketClient *client, - const gchar *domain, - const gchar *service, + const gchar *domain, + const gchar *service, GCancellable *cancellable, - GError **error); + GError **error); void g_socket_client_connect_to_service_async (GSocketClient *client, - const gchar *domain, - const gchar *service, + const gchar *domain, + const gchar *service, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data); GSocketConnection * g_socket_client_connect_to_service_finish (GSocketClient *client, GAsyncResult *result, - GError **error); + GError **error); +GSocketConnection * g_socket_client_connect_to_uri (GSocketClient *client, + const gchar *uri, + guint16 default_port, + GCancellable *cancellable, + GError **error); +void g_socket_client_connect_to_uri_async + (GSocketClient *client, + const gchar *uri, + guint16 default_port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSocketConnection * g_socket_client_connect_to_uri_finish + (GSocketClient *client, + GAsyncResult *result, + GError **error); void g_socket_client_set_family (GSocketClient *client, GSocketFamily family); void g_socket_client_set_local_address (GSocketClient *client, @@ -98,25 +117,43 @@ GSocketProtocol protocol); void g_socket_client_set_socket_type (GSocketClient *client, GSocketType type); +void g_socket_client_set_timeout (GSocketClient *client, + guint timeout); +void g_socket_client_set_enable_proxy (GSocketClient *client, + gboolean enable); +void g_socket_client_set_tls (GSocketClient *client, + gboolean tls); +void g_socket_client_set_tls_validation_flags + (GSocketClient *client, + GTlsCertificateFlags flags); GSocketFamily g_socket_client_get_family (GSocketClient *client); GSocketAddress * g_socket_client_get_local_address (GSocketClient *client); GSocketProtocol g_socket_client_get_protocol (GSocketClient *client); GSocketType g_socket_client_get_socket_type (GSocketClient *client); +guint g_socket_client_get_timeout (GSocketClient *client); +gboolean g_socket_client_get_enable_proxy (GSocketClient *client); +gboolean g_socket_client_get_tls (GSocketClient *client); +GTlsCertificateFlags g_socket_client_get_tls_validation_flags + (GSocketClient *client);

Object Hierarchy

-  GObject
+  GObject
    +----GSocketClient
 

Properties

+  "enable-proxy"             gboolean              : Read / Write / Construct
   "family"                   GSocketFamily         : Read / Write / Construct
   "local-address"            GSocketAddress*       : Read / Write / Construct
   "protocol"                 GSocketProtocol       : Read / Write / Construct
+  "timeout"                  guint                 : Read / Write / Construct
+  "tls"                      gboolean              : Read / Write / Construct
+  "tls-validation-flags"     GTlsCertificateFlags  : Read / Write / Construct
   "type"                     GSocketType           : Read / Write / Construct
 
@@ -134,7 +171,7 @@ subclass on success.

The type of the GSocketConnection object returned depends on the type of the underlying socket that is in use. For instance, for a TCP/IP connection -it will be a GTcpConnection. +it will be a GTcpConnection.

@@ -148,6 +185,46 @@ A helper class for network servers to listen for and accept connections.

Since 2.22


+
+

g_socket_client_add_application_proxy ()

+
void                g_socket_client_add_application_proxy
+                                                        (GSocketClient *client,
+                                                         const gchar *protocol);
+

+Enable proxy protocols to be handled by the application. When the +indicated proxy protocol is returned by the GProxyResolver, +GSocketClient will consider this protocol as supported but will +not try find a GProxy instance to handle handshaking. The +application must check for this case by calling +g_socket_connection_get_remote_address() on the returned +GSocketConnection, and seeing if it's a GProxyAddress of the +appropriate type, to determine whether or not it needs to handle +the proxy handshaking itself. +

+

+This should be used for proxy protocols that are dialects of +another protocol such as HTTP proxy. It also allows cohabitation of +proxy protocols that are reused between protocols. A good example +is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also +be use as generic socket proxy through the HTTP CONNECT method. +

+
++ + + + + + + + + + +

client :

a GSocketClient +

protocol :

The proxy protocol +
+
+

g_socket_client_new ()

GSocketClient *     g_socket_client_new                 (void);
@@ -159,7 +236,7 @@ Creates a new

Returns :

a
GSocketClient. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). @@ -172,7 +249,7 @@ Creates a new GSocketConnection * g_socket_client_connect (GSocketClient *client, GSocketConnectable *connectable, GCancellable *cancellable, - GError **error); + GError **error);

Tries to resolve the connectable and make a network connection to it..

@@ -184,7 +261,7 @@ reference to it when finished with it.

The type of the GSocketConnection object returned depends on the type of the underlying socket that is used. For instance, for a TCP/IP connection -it will be a GTcpConnection. +it will be a GTcpConnection.

The socket created will be the same family as the the address that the @@ -212,19 +289,18 @@ socket will be bound to this address before connecting.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- a GSocketConnection on success, NULL on error. - + a GSocketConnection on success, NULL on error. [transfer full] @@ -238,7 +314,7 @@ socket will be bound to this address before connecting. GSocketConnectable *connectable, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

This is the asynchronous version of g_socket_client_connect().

@@ -262,7 +338,7 @@ the result of the operation.

cancellable :

-a GCancellable, or NULL +a GCancellable, or NULL @@ -284,7 +360,7 @@ the result of the operation.

g_socket_client_connect_finish ()

GSocketConnection * g_socket_client_connect_finish      (GSocketClient *client,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an async connect operation. See g_socket_client_connect_async()

@@ -303,14 +379,13 @@ Finishes an async connect operation. See error :

-a
GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

- a GSocketConnection on success, NULL on error. - + a GSocketConnection on success, NULL on error. [transfer full] @@ -321,10 +396,10 @@ ignore.

g_socket_client_connect_to_host ()

GSocketConnection * g_socket_client_connect_to_host     (GSocketClient *client,
-                                                         const gchar *host_and_port,
-                                                         guint16 default_port,
+                                                         const gchar *host_and_port,
+                                                         guint16 default_port,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

This is a helper function for g_socket_client_connect().

@@ -332,7 +407,7 @@ This is a helper function for host_and_port
may be in any of a number of recognised formats: an IPv6 +host_and_port may be in any of a number of recognised formats; an IPv6 address, an IPv4 address, or a domain name (in which case a DNS lookup is performed). Quoting with [] is supported for all address types. A port override may be specified in the usual way with a @@ -361,7 +436,7 @@ reference to it when finished with it.

In the event of any failure (DNS error, service not found, no hosts -connectable) NULL is returned and error (if non-NULL) is set +connectable) NULL is returned and error (if non-NULL) is set accordingly.

@@ -369,7 +444,7 @@ accordingly. - @@ -384,18 +459,17 @@ accordingly. - - - @@ -407,11 +481,11 @@ accordingly.

g_socket_client_connect_to_host_async ()

void                g_socket_client_connect_to_host_async
                                                         (GSocketClient *client,
-                                                         const gchar *host_and_port,
-                                                         guint16 default_port,
+                                                         const gchar *host_and_port,
+                                                         guint16 default_port,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

This is the asynchronous version of g_socket_client_connect_to_host().

@@ -440,7 +514,7 @@ the result of the operation. - @@ -463,7 +537,7 @@ the result of the operation.
GSocketConnection * g_socket_client_connect_to_host_finish
                                                         (GSocketClient *client,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an async connect operation. See g_socket_client_connect_to_host_async()

@@ -482,14 +556,13 @@ Finishes an async connect operation. See error :

-
- @@ -500,10 +573,10 @@ ignore.

g_socket_client_connect_to_service ()

GSocketConnection * g_socket_client_connect_to_service  (GSocketClient *client,
-                                                         const gchar *domain,
-                                                         const gchar *service,
+                                                         const gchar *domain,
+                                                         const gchar *service,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Attempts to create a TCP connection to a service.

@@ -520,7 +593,7 @@ reference to it when finished with it.

In the event of any failure (DNS error, service not found, no hosts -connectable) NULL is returned and error (if non-NULL) is set +connectable) NULL is returned and error (if non-NULL) is set accordingly.

client :

a SocketClient +a GSocketClient

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL

error :

a pointer to a GError, or NULL +a pointer to a GError, or NULL

Returns :

a GSocketConnection on success, NULL on error. - + a GSocketConnection on success, NULL on error. [transfer full]

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL
a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a GSocketConnection on success, NULL on error. - + a GSocketConnection on success, NULL on error. [transfer full]
@@ -543,17 +616,17 @@ accordingly. - - - @@ -564,11 +637,11 @@ accordingly.

g_socket_client_connect_to_service_async ()

void                g_socket_client_connect_to_service_async
                                                         (GSocketClient *client,
-                                                         const gchar *domain,
-                                                         const gchar *service,
+                                                         const gchar *domain,
+                                                         const gchar *service,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+ gpointer user_data);

This is the asynchronous version of g_socket_client_connect_to_service(). @@ -593,7 +666,7 @@ This is the asynchronous version of

- @@ -616,7 +689,7 @@ This is the asynchronous version of
GSocketConnection * g_socket_client_connect_to_service_finish
                                                         (GSocketClient *client,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes an async connect operation. See g_socket_client_connect_to_service_async()

@@ -635,14 +708,13 @@ Finishes an async connect operation. See error :

-
- @@ -650,6 +722,172 @@ ignore.

Since 2.22


+
+

g_socket_client_connect_to_uri ()

+
GSocketConnection * g_socket_client_connect_to_uri      (GSocketClient *client,
+                                                         const gchar *uri,
+                                                         guint16 default_port,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+This is a helper function for g_socket_client_connect(). +

+

+Attempts to create a TCP connection with a network URI. +

+

+uri may be any valid URI containing an "authority" (hostname/port) +component. If a port is not specified in the URI, default_port +will be used. TLS will be negotiated if "tls" is TRUE. +(GSocketClient does not know to automatically assume TLS for +certain URI schemes.) +

+

+Using this rather than g_socket_client_connect() or +g_socket_client_connect_to_host() allows GSocketClient to +determine when to use application-specific proxy protocols. +

+

+Upon a successful connection, a new GSocketConnection is constructed +and returned. The caller owns this new object and must drop their +reference to it when finished with it. +

+

+In the event of any failure (DNS error, service not found, no hosts +connectable) NULL is returned and error (if non-NULL) is set +accordingly. +

+

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL

error :

a pointer to a GError, or NULL +a pointer to a GError, or NULL

Returns :

a GSocketConnection if successful, or NULL on error + a GSocketConnection if successful, or NULL on error. [transfer full]

cancellable :

a GCancellable, or NULL +a GCancellable, or NULL
a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

a GSocketConnection on success, NULL on error. - + a GSocketConnection on success, NULL on error. [transfer full]
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

client :

a GSocketClient +

uri :

A network URI +

default_port :

the default port to connect to +

cancellable :

a GCancellable, or NULL +

error :

a pointer to a GError, or NULL +

Returns :

a GSocketConnection on success, NULL on error. [transfer full] +
+

Since 2.26

+
+
+
+

g_socket_client_connect_to_uri_async ()

+
void                g_socket_client_connect_to_uri_async
+                                                        (GSocketClient *client,
+                                                         const gchar *uri,
+                                                         guint16 default_port,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+This is the asynchronous version of g_socket_client_connect_to_uri(). +

+

+When the operation is finished callback will be +called. You can then call g_socket_client_connect_to_uri_finish() to get +the result of the operation. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

client :

a GSocketClient +

uri :

a network uri +

default_port :

the default port to connect to +

cancellable :

a GCancellable, or NULL +

callback :

a GAsyncReadyCallback +

user_data :

user data for the callback +
+

Since 2.26

+
+
+
+

g_socket_client_connect_to_uri_finish ()

+
GSocketConnection * g_socket_client_connect_to_uri_finish
+                                                        (GSocketClient *client,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+

+Finishes an async connect operation. See g_socket_client_connect_to_uri_async() +

+
++ + + + + + + + + + + + + + + + + + +

client :

a GSocketClient. +

result :

a GAsyncResult. +

error :

a GError location to store the error occuring, or NULL to +ignore. +

Returns :

a GSocketConnection on success, NULL on error. [transfer full] +
+

Since 2.26

+
+

g_socket_client_set_family ()

void                g_socket_client_set_family          (GSocketClient *client,
@@ -690,7 +928,7 @@ be an ipv6 mapped to ipv4 address.
 

Sets the local address of the socket client. The sockets created by this object will bound to the -specified address (if not NULL) before connecting. +specified address (if not NULL) before connecting.

This is useful if you want to ensure the the local @@ -707,7 +945,7 @@ a specific interface.

address :

-a GSocketAddress, or NULL +a GSocketAddress, or NULL @@ -777,6 +1015,127 @@ as GSocketClient is used for connection oriented services.

Since 2.22


+
+

g_socket_client_set_timeout ()

+
void                g_socket_client_set_timeout         (GSocketClient *client,
+                                                         guint timeout);
+

+Sets the I/O timeout for sockets created by client. timeout is a +time in seconds, or 0 for no timeout (the default). +

+

+The timeout value affects the initial connection attempt as well, +so setting this may cause calls to g_socket_client_connect(), etc, +to fail with G_IO_ERROR_TIMED_OUT. +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

timeout :

the timeout +
+

Since 2.26

+
+
+
+

g_socket_client_set_enable_proxy ()

+
void                g_socket_client_set_enable_proxy    (GSocketClient *client,
+                                                         gboolean enable);
+

+Sets whether or not client attempts to make connections via a +proxy server. When enabled (the default), GSocketClient will use a +GProxyResolver to determine if a proxy protocol such as SOCKS is +needed, and automatically do the necessary proxy negotiation. +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

enable :

whether to enable proxies +
+

Since 2.26

+
+
+
+

g_socket_client_set_tls ()

+
void                g_socket_client_set_tls             (GSocketClient *client,
+                                                         gboolean tls);
+

+Sets whether client creates TLS (aka SSL) connections. If tls is +TRUE, client will wrap its connections in a GTlsClientConnection +and perform a TLS handshake when connecting. +

+

+Note that since GSocketClient must return a GSocketConnection, +but GTlsClientConnection is not a GSocketConnection, this +actually wraps the resulting GTlsClientConnection in a +GTcpWrapperConnection when returning it. You can use +g_tcp_wrapper_connection_get_base_io_stream() on the return value +to extract the GTlsClientConnection. +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

tls :

whether to use TLS +
+

Since 2.28

+
+
+
+

g_socket_client_set_tls_validation_flags ()

+
void                g_socket_client_set_tls_validation_flags
+                                                        (GSocketClient *client,
+                                                         GTlsCertificateFlags flags);
+

+Sets the TLS validation flags used when creating TLS connections +via client. The default value is G_TLS_CERTIFICATE_VALIDATE_ALL. +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

flags :

the validation flags +
+

Since 2.28

+
+

g_socket_client_get_family ()

GSocketFamily       g_socket_client_get_family          (GSocketClient *client);
@@ -824,8 +1183,7 @@ See

Returns :

- a GSocketAddres or
NULL. don't free - + a GSocketAddres or NULL. don't free. [transfer none] @@ -888,9 +1246,122 @@ See

Since 2.22

+
+
+

g_socket_client_get_timeout ()

+
guint               g_socket_client_get_timeout         (GSocketClient *client);
+

+Gets the I/O timeout time for sockets created by client. +

+

+See g_socket_client_set_timeout() for details. +

+
++ + + + + + + + + + +

client :

a GSocketClient +

Returns :

the timeout in seconds + +
+

Since 2.26

+
+
+
+

g_socket_client_get_enable_proxy ()

+
gboolean            g_socket_client_get_enable_proxy    (GSocketClient *client);
+

+Gets the proxy enable state; see g_socket_client_set_enable_proxy() +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

Returns :

whether proxying is enabled + +
+

Since 2.26

+
+
+
+

g_socket_client_get_tls ()

+
gboolean            g_socket_client_get_tls             (GSocketClient *client);
+

+Gets whether client creates TLS connections. See +g_socket_client_set_tls() for details. +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

Returns :

whether client uses TLS + +
+

Since 2.28

+
+
+
+

g_socket_client_get_tls_validation_flags ()

+
GTlsCertificateFlags  g_socket_client_get_tls_validation_flags
+                                                        (GSocketClient *client);
+

+Gets the TLS validation flags used creating TLS connections via +client. +

+
++ + + + + + + + + + +

client :

a GSocketClient. +

Returns :

the TLS validation flags + +
+

Since 2.28

+

Property Details

+
+

The "enable-proxy" property

+
  "enable-proxy"             gboolean              : Read / Write / Construct
+

Enable proxy support.

+

Default value: TRUE

+
+

The "family" property

  "family"                   GSocketFamily         : Read / Write / Construct
@@ -911,6 +1382,27 @@ See Default value: G_SOCKET_PROTOCOL_DEFAULT


+
+

The "timeout" property

+
  "timeout"                  guint                 : Read / Write / Construct
+

The I/O timeout for sockets, or 0 for none.

+

Default value: 0

+
+
+
+

The "tls" property

+
  "tls"                      gboolean              : Read / Write / Construct
+

Whether to create TLS connections.

+

Default value: FALSE

+
+
+
+

The "tls-validation-flags" property

+
  "tls-validation-flags"     GTlsCertificateFlags  : Read / Write / Construct
+

TLS validation flags to use.

+

Default value: G_TLS_CERTIFICATE_UNKNOWN_CA|G_TLS_CERTIFICATE_BAD_IDENTITY|G_TLS_CERTIFICATE_NOT_ACTIVATED|G_TLS_CERTIFICATE_EXPIRED|G_TLS_CERTIFICATE_REVOKED|G_TLS_CERTIFICATE_INSECURE|G_TLS_CERTIFICATE_GENERIC_ERROR

+
+

The "type" property

  "type"                     GSocketType           : Read / Write / Construct
@@ -925,6 +1417,6 @@ See + Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSocketConnectable.html b/docs/reference/gio/html/GSocketConnectable.html index 0ea4bdb..b6d3464 100644 --- a/docs/reference/gio/html/GSocketConnectable.html +++ b/docs/reference/gio/html/GSocketConnectable.html @@ -3,18 +3,18 @@ GSocketConnectable - + - + - + - + @@ -30,6 +30,8 @@ Prerequisites  |  Known Implementations +  |  + Properties
@@ -43,24 +45,28 @@
@@ -70,21 +76,34 @@ +----GSocketConnectable
-  GObject
+  GObject
    +----GSocketAddressEnumerator
+         +----GProxyAddressEnumerator
+
+
+  GObject
+   +----GSocketAddressEnumerator
+         +----GProxyAddressEnumerator
 

Prerequisites

GSocketConnectable requires - GObject.

+ GObject.

+
+

Properties

+
+  "connectable"              GSocketConnectable*   : Read / Write / Construct Only
+  "uri"                      gchar*                : Read / Write / Construct Only
+

Description

@@ -160,15 +179,15 @@ in the sample code below. GCancellable *cancellable, GError **error) { - MyConnection *conn = NULL; + MyConnection *conn = NULL; GSocketConnectable *addr; GSocketAddressEnumerator *enumerator; GSocketAddress *sockaddr; - GError *conn_error = NULL; + GError *conn_error = NULL; addr = g_network_address_new ("www.gnome.org", 80); enumerator = g_socket_connectable_enumerate (addr); - g_object_unref (addr); + g_object_unref (addr); /* Try each sockaddr until we succeed. Record the first * connection error, but not any further ones (since they'll probably @@ -176,10 +195,10 @@ in the sample code below. */ while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error)) { - conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error); - g_object_unref (sockaddr); + conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error); + g_object_unref (sockaddr); } - g_object_unref (enumerator); + g_object_unref (enumerator); if (conn) { @@ -188,7 +207,7 @@ in the sample code below. /* We couldn't connect to the first address, but we succeeded * in connecting to a later address. */ - g_error_free (conn_error); + g_error_free (conn_error); } return conn; } @@ -198,13 +217,13 @@ in the sample code below. * cancelled us. */ if (conn_error) - g_error_free (conn_error); - return NULL; + g_error_free (conn_error); + return NULL; } else { g_error_propagate (error, conn_error); - return NULL; + return NULL; } } @@ -232,17 +251,20 @@ Interface for objects that contain or generate GSocketAddressEnumerator +and GProxyAddressEnumerator

- + @@ -251,6 +273,11 @@ Provides an interface for returning a GSocketAddressEnumerator + + + +

GTypeInterface g_iface;

GTypeInterface g_iface;

The parent interface.

proxy_enumerate ()

Creates a GProxyAddressEnumerator +
@@ -272,8 +299,7 @@ Creates a Returns :

- a new
GSocketAddressEnumerator. - + a new GSocketAddressEnumerator. [transfer full] @@ -281,6 +307,38 @@ Creates a Since 2.22


+
+

g_socket_connectable_proxy_enumerate ()

+
GSocketAddressEnumerator * g_socket_connectable_proxy_enumerate
+                                                        (GSocketConnectable *connectable);
+

+Creates a GSocketAddressEnumerator for connectable that will +return GProxyAddresses for addresses that you must connect +to via a proxy. +

+

+If connectable does not implement +g_socket_connectable_proxy_enumerate(), this will fall back to +calling g_socket_connectable_enumerate(). +

+
++ + + + + + + + + + +

connectable :

a GSocketConnectable +

Returns :

a new GSocketAddressEnumerator. [transfer full] +
+

Since 2.26

+
+

GSocketAddressEnumerator

typedef struct _GSocketAddressEnumerator GSocketAddressEnumerator;
@@ -294,7 +352,7 @@ Enumerator type for objects that contain or generate

g_socket_address_enumerator_next ()

GSocketAddress *    g_socket_address_enumerator_next    (GSocketAddressEnumerator *enumerator,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Retrieves the next GSocketAddress from enumerator. Note that this may block for some amount of time. (Eg, a GNetworkAddress may need @@ -321,19 +379,19 @@ ignored.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

error :

-a GError. +a GError.

Returns :

- a GSocketAddress (owned by the caller), or NULL on + a GSocketAddress (owned by the caller), or NULL on error (in which case *error will be set) or if there are no - more addresses. + more addresses. [transfer full] @@ -346,7 +404,7 @@ ignored. (GSocketAddressEnumerator *enumerator, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Asynchronously retrieves the next GSocketAddress from enumerator and then calls callback, which must call @@ -362,7 +420,7 @@ and then calls callback, which must call

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore. @@ -384,7 +442,7 @@ and then calls callback, which must call
GSocketAddress *    g_socket_address_enumerator_next_finish
                                                         (GSocketAddressEnumerator *enumerator,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Retrieves the result of a completed call to g_socket_address_enumerator_next_async(). See @@ -406,23 +464,48 @@ error handling.

error :

-a GError +a GError

Returns :

- a GSocketAddress (owned by the caller), or NULL on + a GSocketAddress (owned by the caller), or NULL on error (in which case *error will be set) or if there are no - more addresses. + more addresses. [transfer full]
+
+
+

GProxyAddressEnumerator

+
typedef struct _GProxyAddressEnumerator GProxyAddressEnumerator;
+

+A subclass of GSocketAddressEnumerator that takes another address +enumerator and wraps its results in GProxyAddresses as +directed by the default GProxyResolver. +

+
+
+
+

Property Details

+
+

The "connectable" property

+
  "connectable"              GSocketConnectable*   : Read / Write / Construct Only
+

The connectable being enumerated.

+
+
+
+

The "uri" property

+
  "uri"                      gchar*                : Read / Write / Construct Only
+

The destination URI, use none:// for generic socket.

+

Default value: NULL

+
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSocketConnection.html b/docs/reference/gio/html/GSocketConnection.html index e62e24d..90d015f 100644 --- a/docs/reference/gio/html/GSocketConnection.html +++ b/docs/reference/gio/html/GSocketConnection.html @@ -3,12 +3,12 @@ GSocketConnection - + - - + + @@ -18,7 +18,7 @@ Up Home GIO Reference Manual -Next +Next Top @@ -41,74 +41,45 @@

Object Hierarchy

-  GObject
+  GObject
    +----GIOStream
          +----GSocketConnection
-               +----GTcpConnection
-               +----GUnixConnection
-
-
-  GObject
-   +----GIOStream
-         +----GSocketConnection
-               +----GTcpConnection
-
-
-  GObject
-   +----GIOStream
-         +----GSocketConnection
-               +----GUnixConnection
+               +----GTcpConnection
+               +----GUnixConnection
 

Properties

   "socket"                   GSocket*              : Read / Write / Construct Only
-  "graceful-disconnect"      gboolean              : Read / Write
 
@@ -121,7 +92,7 @@ or by The type of the GSocketConnection object returned from these calls depends on the type of the underlying socket that is in use. For -instance, for a TCP/IP connection it will be a GTcpConnection. +instance, for a TCP/IP connection it will be a GTcpConnection.

Chosing what type of object to construct is done with the socket @@ -145,7 +116,7 @@ A socket connection GIOStream object for connection-oriented sockets.

g_socket_connection_get_local_address ()

GSocketAddress *    g_socket_connection_get_local_address
                                                         (GSocketConnection *connection,
-                                                         GError **error);
+ GError **error);

Try to get the local address of a socket connection.

@@ -160,14 +131,13 @@ Try to get the local address of a socket connection.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- a GSocketAddress or NULL on error. - Free the returned object with g_object_unref(). - + a GSocketAddress or NULL on error. + Free the returned object with g_object_unref(). [transfer full] @@ -179,7 +149,7 @@ Try to get the local address of a socket connection.

g_socket_connection_get_remote_address ()

GSocketAddress *    g_socket_connection_get_remote_address
                                                         (GSocketConnection *connection,
-                                                         GError **error);
+ GError **error);

Try to get the remote address of a socket connection.

@@ -194,14 +164,13 @@ Try to get the remote address of a socket connection.

error :

-GError for error reporting, or NULL to ignore. +GError for error reporting, or NULL to ignore.

Returns :

- a GSocketAddress or NULL on error. - Free the returned object with g_object_unref(). - + a GSocketAddress or NULL on error. + Free the returned object with g_object_unref(). [transfer full] @@ -227,182 +196,7 @@ not supported by the Returns :

- a
GSocketAddress or NULL on error. - - - - -
-

Since 2.22

-
-
-
-

GTcpConnection

-
typedef struct _GTcpConnection GTcpConnection;
-

-A GSocketConnection for TCP/IP connections. -

-

Since 2.22

-
-
-
-

g_tcp_connection_set_graceful_disconnect ()

-
void                g_tcp_connection_set_graceful_disconnect
-                                                        (GTcpConnection *connection,
-                                                         gboolean graceful_disconnect);
-

-This enabled graceful disconnects on close. A graceful disconnect -means that we signal the recieving end that the connection is terminated -and wait for it to close the connection before closing the connection. -

-

-A graceful disconnect means that we can be sure that we successfully sent -all the outstanding data to the other end, or get an error reported. -However, it also means we have to wait for all the data to reach the -other side and for it to acknowledge this by closing the socket, which may -take a while. For this reason it is disabled by default. -

-
-- - - - - - - - - - -

connection :

a GTcpConnection -

graceful_disconnect :

Whether to do graceful disconnects or not -
-

Since 2.22

-
-
-
-

g_tcp_connection_get_graceful_disconnect ()

-
gboolean            g_tcp_connection_get_graceful_disconnect
-                                                        (GTcpConnection *connection);
-

-Checks if graceful disconnects are used. See -g_tcp_connection_set_graceful_disconnect(). -

-
-- - - - - - - - - - -

connection :

a GTcpConnection -

Returns :

TRUE if graceful disconnect is used on close, FALSE otherwise - -
-

Since 2.22

-
-
-
-

GUnixConnection

-
typedef struct _GUnixConnection GUnixConnection;
-

-

-
-
-
-

g_unix_connection_receive_fd ()

-
gint                g_unix_connection_receive_fd        (GUnixConnection *connection,
-                                                         GCancellable *cancellable,
-                                                         GError **error);
-

-Receives a file descriptor from the sending end of the connection. -The sending end has to call g_unix_connection_send_fd() for this -to work. -

-

-As well as reading the fd this also reads a single byte from the -stream, as this is required for fd passing to work on some -implementations. -

-
-- - - - - - - - - - - - - - - - - - -

connection :

a GUnixConnection -

cancellable :

optional GCancellable object, NULL to ignore -

error :

-GError for error reporting, or NULL to ignore -

Returns :

a file descriptor on success, -1 on error. - -
-

Since 2.22

-
-
-
-

g_unix_connection_send_fd ()

-
gboolean            g_unix_connection_send_fd           (GUnixConnection *connection,
-                                                         gint fd,
-                                                         GCancellable *cancellable,
-                                                         GError **error);
-

-Passes a file descriptor to the recieving side of the -connection. The recieving end has to call g_unix_connection_receive_fd() -to accept the file descriptor. -

-

-As well as sending the fd this also writes a single byte to the -stream, as this is required for fd passing to work on some -implementations. -

-
-- - - - - - - - - - - - - - - - - - - - @@ -428,8 +222,7 @@ Creates a Returns :

-
@@ -439,12 +232,12 @@ Creates a

g_socket_connection_factory_lookup_type ()

-
GType               g_socket_connection_factory_lookup_type
+
GType               g_socket_connection_factory_lookup_type
                                                         (GSocketFamily family,
                                                          GSocketType type,
-                                                         gint protocol_id);
+ gint protocol_id);

-Looks up the GType to be used when creating socket connections on +Looks up the GType to be used when creating socket connections on sockets with the specified family,type and protocol_id.

@@ -470,7 +263,7 @@ If no type is registered, the

- @@ -482,12 +275,12 @@ If no type is registered, the

g_socket_connection_factory_register_type ()

void                g_socket_connection_factory_register_type
-                                                        (GType g_type,
+                                                        (GType g_type,
                                                          GSocketFamily family,
                                                          GSocketType type,
-                                                         gint protocol);
+ gint protocol);

-Looks up the GType to be used when creating socket connections on +Looks up the GType to be used when creating socket connections on sockets with the specified family,type and protocol.

@@ -498,7 +291,7 @@ If no type is registered, the

- @@ -528,13 +321,6 @@ If no type is registered, the "socket" GSocket* : Read / Write / Construct Only

The underlying GSocket.

-
-
-

The "graceful-disconnect" property

-
  "graceful-disconnect"      gboolean              : Read / Write
-

Whether or not close does a graceful disconnect.

-

Default value: FALSE

-

See Also

@@ -543,6 +329,6 @@ If no type is registered, the + Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSocketControlMessage.html b/docs/reference/gio/html/GSocketControlMessage.html index 2a3056f..1ee3bb7 100644 --- a/docs/reference/gio/html/GSocketControlMessage.html +++ b/docs/reference/gio/html/GSocketControlMessage.html @@ -3,12 +3,12 @@ GSocketControlMessage - + - + - + @@ -43,22 +43,23 @@ GSocketControlMessage * g_socket_control_message_deserialize (int level, int type, - gsize size, - gpointer data); + gsize size, + gpointer data); intg_socket_control_message_get_level (GSocketControlMessage *message); intg_socket_control_message_get_msg_type (GSocketControlMessage *message); -gsizeg_socket_control_message_get_size (GSocketControlMessage *message); +gsizeg_socket_control_message_get_size (GSocketControlMessage *message); voidg_socket_control_message_serialize (GSocketControlMessage *message, - gpointer data); + gpointer data);

Object Hierarchy

-  GObject
+  GObject
    +----GSocketControlMessage
          +----GUnixFDMessage
+         +----GUnixCredentialsMessage
 
@@ -106,8 +107,8 @@ received over GSocketControlMessage * g_socket_control_message_deserialize (int level, int type, - gsize size, - gpointer data); + gsize size, + gpointer data);

Tries to deserialize a socket control message of a given level and type. This will ask all known (to GType) subclasses @@ -115,7 +116,7 @@ of GSocketControlMessage.

-If there is no implementation for this kind of control message, NULL +If there is no implementation for this kind of control message, NULL will be returned.

connection :

a GUnixConnection -

fd :

a file descriptor -

cancellable :

optional GCancellable object, NULL to ignore. -

error :

-GError for error reporting, or NULL to ignore. -

Returns :

a TRUE on success, NULL on error. - + a GSocketAddress or NULL on error. [transfer none]
a GSocketConnection - + a GSocketConnection. [transfer full]

Returns :

a GType + a GType

g_type :

a GType, inheriting from G_TYPE_SOCKET_CONNECTION +a GType, inheriting from G_TYPE_SOCKET_CONNECTION
@@ -143,8 +144,7 @@ will be returned. - @@ -207,7 +207,7 @@ For instance, for UNIX fd passing this would be SCM_RIGHTS.

g_socket_control_message_get_size ()

-
gsize               g_socket_control_message_get_size   (GSocketControlMessage *message);
+
gsize               g_socket_control_message_get_size   (GSocketControlMessage *message);

Returns the space required for the control message, not including headers or alignment. @@ -234,7 +234,7 @@ headers or alignment.

g_socket_control_message_serialize ()

void                g_socket_control_message_serialize  (GSocketControlMessage *message,
-                                                         gpointer data);
+ gpointer data);

Converts the data in the message to bytes placed in the message. @@ -269,6 +269,6 @@ object.

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GSocketListener.html b/docs/reference/gio/html/GSocketListener.html index 193000e..b0f72bf 100644 --- a/docs/reference/gio/html/GSocketListener.html +++ b/docs/reference/gio/html/GSocketListener.html @@ -3,18 +3,18 @@ GSocketListener - + - + - +

Returns :

the deserialized message or NULL - + the deserialized message or NULL. [transfer full]
- + @@ -43,50 +43,50 @@

Synopsis

                    GSocketListener;
 GSocketListener *   g_socket_listener_new               (void);
-gboolean            g_socket_listener_add_socket        (GSocketListener *listener,
+gboolean            g_socket_listener_add_socket        (GSocketListener *listener,
                                                          GSocket *socket,
-                                                         GObject *source_object,
-                                                         GError **error);
-gboolean            g_socket_listener_add_address       (GSocketListener *listener,
+                                                         GObject *source_object,
+                                                         GError **error);
+gboolean            g_socket_listener_add_address       (GSocketListener *listener,
                                                          GSocketAddress *address,
                                                          GSocketType type,
                                                          GSocketProtocol protocol,
-                                                         GObject *source_object,
+                                                         GObject *source_object,
                                                          GSocketAddress **effective_address,
-                                                         GError **error);
-gboolean            g_socket_listener_add_inet_port     (GSocketListener *listener,
-                                                         guint16 port,
-                                                         GObject *source_object,
-                                                         GError **error);
-guint16             g_socket_listener_add_any_inet_port (GSocketListener *listener,
-                                                         GObject *source_object,
-                                                         GError **error);
+                                                         GError **error);
+gboolean            g_socket_listener_add_inet_port     (GSocketListener *listener,
+                                                         guint16 port,
+                                                         GObject *source_object,
+                                                         GError **error);
+guint16             g_socket_listener_add_any_inet_port (GSocketListener *listener,
+                                                         GObject *source_object,
+                                                         GError **error);
 GSocketConnection * g_socket_listener_accept            (GSocketListener *listener,
-                                                         GObject **source_object,
+                                                         GObject **source_object,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+                                                         GError **error);
 void                g_socket_listener_accept_async      (GSocketListener *listener,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+                                                         gpointer user_data);
 GSocketConnection * g_socket_listener_accept_finish     (GSocketListener *listener,
                                                          GAsyncResult *result,
-                                                         GObject **source_object,
-                                                         GError **error);
+                                                         GObject **source_object,
+                                                         GError **error);
 GSocket *           g_socket_listener_accept_socket     (GSocketListener *listener,
-                                                         GObject **source_object,
+                                                         GObject **source_object,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+                                                         GError **error);
 void                g_socket_listener_accept_socket_async
                                                         (GSocketListener *listener,
                                                          GCancellable *cancellable,
                                                          GAsyncReadyCallback callback,
-                                                         gpointer user_data);
+                                                         gpointer user_data);
 GSocket *           g_socket_listener_accept_socket_finish
                                                         (GSocketListener *listener,
                                                          GAsyncResult *result,
-                                                         GObject **source_object,
-                                                         GError **error);
+                                                         GObject **source_object,
+                                                         GError **error);
 void                g_socket_listener_close             (GSocketListener *listener);
 void                g_socket_listener_set_backlog       (GSocketListener *listener,
                                                          int listen_backlog);
@@ -95,7 +95,7 @@
 

Object Hierarchy

-  GObject
+  GObject
    +----GSocketListener
          +----GSocketService
 
@@ -103,7 +103,7 @@

Properties

-  "listen-backlog"           gint                  : Read / Write / Construct
+  "listen-backlog"           gint                  : Read / Write / Construct
 
@@ -150,10 +150,10 @@ or

g_socket_listener_add_socket ()

-
gboolean            g_socket_listener_add_socket        (GSocketListener *listener,
+
gboolean            g_socket_listener_add_socket        (GSocketListener *listener,
                                                          GSocket *socket,
-                                                         GObject *source_object,
-                                                         GError **error);
+ GObject *source_object, + GError **error);

Adds socket to the set of sockets that we try to accept new clients from. The socket must be bound to a local @@ -180,18 +180,18 @@ different things depending on what address is connected to.

- - @@ -202,13 +202,13 @@ different things depending on what address is connected to.

g_socket_listener_add_address ()

-
gboolean            g_socket_listener_add_address       (GSocketListener *listener,
+
gboolean            g_socket_listener_add_address       (GSocketListener *listener,
                                                          GSocketAddress *address,
                                                          GSocketType type,
                                                          GSocketProtocol protocol,
-                                                         GObject *source_object,
+                                                         GObject *source_object,
                                                          GSocketAddress **effective_address,
-                                                         GError **error);
+ GError **error);

Creates a socket of type type and protocol protocol, binds it to address and adds it to the set of sockets we're accepting @@ -227,7 +227,7 @@ useful if you're listening on multiple addresses and do different things depending on what address is connected to.

-If successful and effective_address is non-NULL then it will +If successful and effective_address is non-NULL then it will be set to the address that the binding actually occured at. This is helpful for determining the port number that was used for when requesting a binding to port 0 (ie: "any port"). This address, if @@ -258,23 +258,23 @@ requested, belongs to the caller and must be freed.

- - - @@ -285,10 +285,10 @@ requested, belongs to the caller and must be freed.

g_socket_listener_add_inet_port ()

-
gboolean            g_socket_listener_add_inet_port     (GSocketListener *listener,
-                                                         guint16 port,
-                                                         GObject *source_object,
-                                                         GError **error);
+
gboolean            g_socket_listener_add_inet_port     (GSocketListener *listener,
+                                                         guint16 port,
+                                                         GObject *source_object,
+                                                         GError **error);

Helper function for g_socket_listener_add_address() that creates a TCP/IP socket listening on IPv4 and IPv6 (if @@ -315,18 +315,18 @@ different things depending on what address is connected to.

- - @@ -337,9 +337,9 @@ different things depending on what address is connected to.

g_socket_listener_add_any_inet_port ()

-
guint16             g_socket_listener_add_any_inet_port (GSocketListener *listener,
-                                                         GObject *source_object,
-                                                         GError **error);
+
guint16             g_socket_listener_add_any_inet_port (GSocketListener *listener,
+                                                         GObject *source_object,
+                                                         GError **error);

Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each are available). @@ -364,12 +364,12 @@ different things depending on what address is connected to.

- - @@ -387,21 +387,21 @@ ignore.

g_socket_listener_accept ()

GSocketConnection * g_socket_listener_accept            (GSocketListener *listener,
-                                                         GObject **source_object,
+                                                         GObject **source_object,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Blocks waiting for a client to connect to any of the sockets added to the listener. Returns a GSocketConnection for the socket that was accepted.

-If source_object is not NULL it will be filled out with the source +If source_object is not NULL it will be filled out with the source object specified when the corresponding socket or address was added to the listener.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -415,24 +415,23 @@ was cancelled, the error source_object :

-
- - @@ -445,7 +444,7 @@ was cancelled, the error void g_socket_listener_accept_async (GSocketListener *listener, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

This is the asynchronous version of g_socket_listener_accept().

@@ -464,7 +463,7 @@ to get the result of the operation. - @@ -486,8 +485,8 @@ to get the result of the operation.

g_socket_listener_accept_finish ()

GSocketConnection * g_socket_listener_accept_finish     (GSocketListener *listener,
                                                          GAsyncResult *result,
-                                                         GObject **source_object,
-                                                         GError **error);
+ GObject **source_object, + GError **error);

Finishes an async accept operation. See g_socket_listener_accept_async()

@@ -506,19 +505,18 @@ Finishes an async accept operation. See source_object :

-
- - @@ -529,9 +527,9 @@ ignore.

g_socket_listener_accept_socket ()

GSocket *           g_socket_listener_accept_socket     (GSocketListener *listener,
-                                                         GObject **source_object,
+                                                         GObject **source_object,
                                                          GCancellable *cancellable,
-                                                         GError **error);
+ GError **error);

Blocks waiting for a client to connect to any of the sockets added to the listener. Returns the GSocket that was accepted. @@ -542,12 +540,12 @@ which is often the case, then you should use source_object is not NULL it will be filled out with the source +If source_object is not NULL it will be filled out with the source object specified when the corresponding socket or address was added to the listener.

-If cancellable is not NULL, then the operation can be cancelled by +If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

@@ -561,24 +559,23 @@ was cancelled, the error source_object :

-
- - @@ -592,7 +589,7 @@ was cancelled, the error GSocketListener *listener, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

This is the asynchronous version of g_socket_listener_accept_socket().

@@ -611,7 +608,7 @@ to get the result of the operation. - @@ -634,8 +631,8 @@ to get the result of the operation.
GSocket *           g_socket_listener_accept_socket_finish
                                                         (GSocketListener *listener,
                                                          GAsyncResult *result,
-                                                         GObject **source_object,
-                                                         GError **error);
+ GObject **source_object, + GError **error);

Finishes an async accept operation. See g_socket_listener_accept_socket_async()

@@ -654,19 +651,18 @@ Finishes an async accept operation. See source_object :

-
- - @@ -723,7 +719,7 @@ See

Property Details

The "listen-backlog" property

-
  "listen-backlog"           gint                  : Read / Write / Construct
+
  "listen-backlog"           gint                  : Read / Write / Construct

outstanding connections in the listen queue.

Allowed values: [0,2000]

Default value: 10

@@ -736,6 +732,6 @@ See
- Generated by GTK-Doc V1.14
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GSocketService.html b/docs/reference/gio/html/GSocketService.html index 927eeaa..49e59ac 100644 --- a/docs/reference/gio/html/GSocketService.html +++ b/docs/reference/gio/html/GSocketService.html @@ -3,12 +3,12 @@ GSocketService - + - + @@ -45,13 +45,13 @@ GSocketService * g_socket_service_new (void); voidg_socket_service_start (GSocketService *service); voidg_socket_service_stop (GSocketService *service); -gbooleang_socket_service_is_active (GSocketService *service); +gbooleang_socket_service_is_active (GSocketService *service);

Object Hierarchy

-  GObject
+  GObject
    +----GSocketListener
          +----GSocketService
                +----GThreadedSocketService
@@ -174,7 +174,7 @@ handling an incomming client request.
 

g_socket_service_is_active ()

-
gboolean            g_socket_service_is_active          (GSocketService *service);
+
gboolean            g_socket_service_is_active          (GSocketService *service);

Check whether the service is active or not. An active service will accept new clients that connect, while @@ -191,7 +191,7 @@ up until the service is started.

- @@ -204,10 +204,10 @@ up until the service is started.

Signal Details

The "incoming" signal

-
gboolean            user_function                      (GSocketService    *service,
+
gboolean            user_function                      (GSocketService    *service,
                                                         GSocketConnection *connection,
-                                                        GObject           *source_object,
-                                                        gpointer           user_data)          : Run Last
+ GObject *source_object, + gpointer user_data) : Run Last

The ::incoming signal is emitted when a new incoming connection to service needs to be handled. The handler must initiate the @@ -238,7 +238,7 @@ asynchronous operations must be used.

- @@ -253,6 +253,6 @@ asynchronous operations must be used. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GTcpConnection.html b/docs/reference/gio/html/GTcpConnection.html new file mode 100644 index 0000000..8066026 --- /dev/null +++ b/docs/reference/gio/html/GTcpConnection.html @@ -0,0 +1,166 @@ + + + + +GTcpConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTcpConnection

+

GTcpConnection — A TCP GSocketConnection

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GIOStream
+         +----GSocketConnection
+               +----GTcpConnection
+                     +----GTcpWrapperConnection
+
+
+
+

Properties

+
+  "graceful-disconnect"      gboolean              : Read / Write
+
+
+
+

Description

+

+This is the subclass of GSocketConnection that is created +for TCP/IP sockets. +

+
+
+

Details

+
+

GTcpConnection

+
typedef struct _GTcpConnection GTcpConnection;
+

+A GSocketConnection for UNIX domain socket connections. +

+

Since 2.22

+
+
+
+

g_tcp_connection_set_graceful_disconnect ()

+
void                g_tcp_connection_set_graceful_disconnect
+                                                        (GTcpConnection *connection,
+                                                         gboolean graceful_disconnect);
+

+This enabled graceful disconnects on close. A graceful disconnect +means that we signal the recieving end that the connection is terminated +and wait for it to close the connection before closing the connection. +

+

+A graceful disconnect means that we can be sure that we successfully sent +all the outstanding data to the other end, or get an error reported. +However, it also means we have to wait for all the data to reach the +other side and for it to acknowledge this by closing the socket, which may +take a while. For this reason it is disabled by default. +

+
++ + + + + + + + + + +

connection :

a GTcpConnection +

graceful_disconnect :

Whether to do graceful disconnects or not +
+

Since 2.22

+
+
+
+

g_tcp_connection_get_graceful_disconnect ()

+
gboolean            g_tcp_connection_get_graceful_disconnect
+                                                        (GTcpConnection *connection);
+

+Checks if graceful disconnects are used. See +g_tcp_connection_set_graceful_disconnect(). +

+
++ + + + + + + + + + +

connection :

a GTcpConnection +

Returns :

TRUE if graceful disconnect is used on close, FALSE otherwise + +
+

Since 2.22

+
+
+
+

Property Details

+
+

The "graceful-disconnect" property

+
  "graceful-disconnect"      gboolean              : Read / Write
+

Whether or not close does a graceful disconnect.

+

Default value: FALSE

+
+
+
+

See Also

+GSocketConnection. +
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GTcpWrapperConnection.html b/docs/reference/gio/html/GTcpWrapperConnection.html new file mode 100644 index 0000000..7b0b22d --- /dev/null +++ b/docs/reference/gio/html/GTcpWrapperConnection.html @@ -0,0 +1,158 @@ + + + + +GTcpWrapperConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTcpWrapperConnection

+

GTcpWrapperConnection — wrapper for non-GSocketConnection-based, GSocket-based GIOStreams

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GIOStream
+         +----GSocketConnection
+               +----GTcpConnection
+                     +----GTcpWrapperConnection
+
+
+
+

Properties

+
+  "base-io-stream"           GIOStream*            : Read / Write / Construct Only
+
+
+
+

Description

+

+A GTcpWrapperConnection can be used to wrap a GIOStream that is +based on a GSocket, but which is not actually a +GSocketConnection. This is used by GSocketClient so that it can +always return a GSocketConnection, even when the connection it has +actually created is not directly a GSocketConnection. +

+
+
+

Details

+
+

GTcpWrapperConnection

+
typedef struct _GTcpWrapperConnection GTcpWrapperConnection;
+

+

+
+
+
+

g_tcp_wrapper_connection_new ()

+
GSocketConnection * g_tcp_wrapper_connection_new        (GIOStream *base_io_stream,
+                                                         GSocket *socket);
+

+Wraps base_io_stream and socket together as a GSocketConnection. +

+
++ + + + + + + + + + + + + + +

base_io_stream :

the GIOStream to wrap +

socket :

the GSocket associated with base_io_stream +

Returns :

the new GSocketConnection. + +
+

Since 2.28

+
+
+
+

g_tcp_wrapper_connection_get_base_io_stream ()

+
GIOStream *         g_tcp_wrapper_connection_get_base_io_stream
+                                                        (GTcpWrapperConnection *conn);
+

+Get's conn's base GIOStream +

+
++ + + + + + + + + + +

conn :

a GTcpWrapperConnection +

Returns :

conn's base GIOStream. [transfer none] +
+
+
+
+

Property Details

+
+

The "base-io-stream" property

+
  "base-io-stream"           GIOStream*            : Read / Write / Construct Only
+

The wrapped GIOStream.

+
+
+
+

See Also

+GSocketConnection. +
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GThemedIcon.html b/docs/reference/gio/html/GThemedIcon.html index a7ea58c..6b773b9 100644 --- a/docs/reference/gio/html/GThemedIcon.html +++ b/docs/reference/gio/html/GThemedIcon.html @@ -3,12 +3,12 @@ GThemedIcon - + - + @@ -56,13 +56,13 @@ const char *iconname); void g_themed_icon_append_name (GThemedIcon *icon, const char *iconname); -const gchar* const * g_themed_icon_get_names (GThemedIcon *icon); +const gchar* const * g_themed_icon_get_names (GThemedIcon *icon);

Object Hierarchy

-  GObject
+  GObject
    +----GThemedIcon
 
@@ -75,9 +75,9 @@ GThemedIcon implements

Properties

-  "name"                     gchar*                : Write / Construct Only
-  "names"                    GStrv*                : Read / Write / Construct Only
-  "use-default-fallbacks"    gboolean              : Read / Write / Construct Only
+  "name"                     gchar*                : Write / Construct Only
+  "names"                    GStrv*                : Read / Write / Construct Only
+  "use-default-fallbacks"    gboolean              : Read / Write / Construct Only
 
@@ -87,7 +87,7 @@ GThemedIcon implements GThemedIcon contains a list of all of the icons present in an icon theme, so that icons can be looked up quickly. GThemedIcon does not provide actual pixmaps for icons, just the icon names. -Ideally something like gtk_icon_theme_choose_icon() should be used to +Ideally something like gtk_icon_theme_choose_icon() should be used to resolve the list of names so that fallback icons work nicely with themes that inherit other themes.

@@ -118,7 +118,7 @@ Creates a new themed icon for iconname.

Returns :

- a new GThemedIcon. + a new GThemedIcon. [transfer full] @@ -143,12 +143,12 @@ Creates a new themed icon for iconnames.

len :

the length of the iconnames array, or -1 if iconnames is - NULL-terminated + NULL-terminated

Returns :

- a new GThemedIcon + a new GThemedIcon. [transfer full] @@ -205,7 +205,7 @@ In the following example, icon1 and

Returns :

- a new GThemedIcon. + a new GThemedIcon. [transfer full] @@ -285,7 +285,7 @@ to

g_themed_icon_get_names ()

-
const gchar* const * g_themed_icon_get_names            (GThemedIcon *icon);
+
const gchar* const * g_themed_icon_get_names            (GThemedIcon *icon);

Gets the names of icons from within icon.

@@ -299,7 +299,7 @@ Gets the names of icons from within icon

Returns :

- a list of icon names. + a list of icon names. [transfer none] @@ -310,7 +310,7 @@ Gets the names of icons from within icon

Property Details

The "name" property

-
  "name"                     gchar*                : Write / Construct Only
+
  "name"                     gchar*                : Write / Construct Only

The icon name.

@@ -319,15 +319,15 @@ The icon name.

The "names" property

-
  "names"                    GStrv*                : Read / Write / Construct Only
+
  "names"                    GStrv*                : Read / Write / Construct Only

-A NULL-terminated array of icon names. +A NULL-terminated array of icon names.


The "use-default-fallbacks" property

-
  "use-default-fallbacks"    gboolean              : Read / Write / Construct Only
+
  "use-default-fallbacks"    gboolean              : Read / Write / Construct Only

Whether to use the default fallbacks found by shortening the icon name at '-' characters. If the "names" array has more than one element, @@ -353,7 +353,7 @@ would become "gnome-dev-cdrom", "gnome-dev", "gnome", - NULL + NULL }; @@ -372,6 +372,6 @@ would become

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GThreadedSocketService.html b/docs/reference/gio/html/GThreadedSocketService.html index 19c6eb6..ecb4a5b 100644 --- a/docs/reference/gio/html/GThreadedSocketService.html +++ b/docs/reference/gio/html/GThreadedSocketService.html @@ -3,12 +3,12 @@ GThreadedSocketService - + - - + + @@ -18,7 +18,7 @@ Up Home GIO Reference Manual -Next +Next Top @@ -50,7 +50,7 @@

Object Hierarchy

-  GObject
+  GObject
    +----GSocketListener
          +----GSocketService
                +----GThreadedSocketService
@@ -59,7 +59,7 @@
 

Properties

-  "max-threads"              gint                  : Read / Write / Construct Only
+  "max-threads"              gint                  : Read / Write / Construct Only
 
@@ -134,7 +134,7 @@ must be added with g_socket_service_add_listeners()

Property Details

The "max-threads" property

-
  "max-threads"              gint                  : Read / Write / Construct Only
+
  "max-threads"              gint                  : Read / Write / Construct Only

The max number of threads handling clients for this service.

Allowed values: >= G_MAXULONG

Default value: 10

@@ -144,10 +144,10 @@ must be added with g_socket_service_add_listeners()

Signal Details

The "run" signal

-
gboolean            user_function                      (GThreadedSocketService *service,
+
gboolean            user_function                      (GThreadedSocketService *service,
                                                         GSocketConnection      *connection,
-                                                        GObject                *source_object,
-                                                        gpointer                user_data)          : Run Last
+ GObject *source_object, + gpointer user_data) : Run Last

The ::run signal is emitted in a worker thread in response to an incoming connection. This thread is dedicated to handling @@ -178,7 +178,7 @@ not return until the connection is closed.

Returns :

- TRUE to stope further signal handlers from being called + TRUE to stope further signal handlers from being called @@ -192,6 +192,6 @@ not return until the connection is closed.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GTlsBackend.html b/docs/reference/gio/html/GTlsBackend.html new file mode 100644 index 0000000..e0cfece --- /dev/null +++ b/docs/reference/gio/html/GTlsBackend.html @@ -0,0 +1,274 @@ + + + + +GTlsBackend + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTlsBackend

+

GTlsBackend — TLS backend implementation

+
+ +
+

Object Hierarchy

+
+  GInterface
+   +----GTlsBackend
+
+
+
+

Prerequisites

+

+GTlsBackend requires + GObject.

+
+
+

Description

+
+
+

Details

+
+

G_TLS_BACKEND_EXTENSION_POINT_NAME

+
#define G_TLS_BACKEND_EXTENSION_POINT_NAME "gio-tls-backend"
+
+

+Extension point for TLS functionality via GTlsBackend. +See Extending GIO. +

+
+
+
+

GTlsBackend

+
typedef struct _GTlsBackend GTlsBackend;
+

+Type implemented by TLS GIOModules to provide access to additional +TLS-related types. +

+

Since 2.28

+
+
+
+

GTlsBackendInterface

+
typedef struct {
+  GTypeInterface g_iface;
+
+  /* methods */
+  gboolean ( *supports_tls)               (GTlsBackend *backend);
+  GType    ( *get_certificate_type)       (void);
+  GType    ( *get_client_connection_type) (void);
+  GType    ( *get_server_connection_type) (void);
+} GTlsBackendInterface;
+
+

+Provides an interface for describing TLS-related types. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface g_iface;

The parent interface. +

supports_tls ()

+

get_certificate_type ()

returns the GTlsCertificate implementation type +

get_client_connection_type ()

returns the GTlsClientConnection implementation type +

get_server_connection_type ()

returns the GTlsServerConnection implementation type +
+

Since 2.28

+
+
+
+

g_tls_backend_get_default ()

+
GTlsBackend *       g_tls_backend_get_default           (void);
+

+Gets the default GTlsBackend for the system. +

+
++ + + + +

Returns :

a GTlsBackend + +
+

Since 2.28

+
+
+
+

g_tls_backend_supports_tls ()

+
gboolean            g_tls_backend_supports_tls          (GTlsBackend *backend);
+

+Checks if TLS is supported; if this returns FALSE for the default +GTlsBackend, it means no "real" TLS backend is available. +

+
++ + + + + + + + + + +

backend :

the GTlsBackend +

Returns :

whether or not TLS is supported + +
+

Since 2.28

+
+
+
+

g_tls_backend_get_certificate_type ()

+
GType               g_tls_backend_get_certificate_type  (GTlsBackend *backend);
+

+Gets the GType of backend's GTlsCertificate implementation. +

+
++ + + + + + + + + + +

backend :

the GTlsBackend +

Returns :

the GType of backend's GTlsCertificate + implementation. + +
+

Since 2.28

+
+
+
+

g_tls_backend_get_client_connection_type ()

+
GType               g_tls_backend_get_client_connection_type
+                                                        (GTlsBackend *backend);
+

+Gets the GType of backend's GTlsClientConnection implementation. +

+
++ + + + + + + + + + +

backend :

the GTlsBackend +

Returns :

the GType of backend's GTlsClientConnection + implementation. + +
+

Since 2.28

+
+
+
+

g_tls_backend_get_server_connection_type ()

+
GType               g_tls_backend_get_server_connection_type
+                                                        (GTlsBackend *backend);
+

+Gets the GType of backend's GTlsServerConnection implementation. +

+
++ + + + + + + + + + +

backend :

the GTlsBackend +

Returns :

the GType of backend's GTlsServerConnection + implementation. + +
+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GTlsCertificate.html b/docs/reference/gio/html/GTlsCertificate.html new file mode 100644 index 0000000..c71728b --- /dev/null +++ b/docs/reference/gio/html/GTlsCertificate.html @@ -0,0 +1,413 @@ + + + + +GTlsCertificate + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTlsCertificate

+

GTlsCertificate — TLS certificate

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GTlsCertificate
+
+
+
+

Properties

+
+  "certificate"              GByteArray*           : Read / Write / Construct Only
+  "certificate-pem"          gchar*                : Read / Write / Construct Only
+  "issuer"                   GTlsCertificate*      : Read / Write / Construct Only
+  "private-key"              GByteArray*           : Write / Construct Only
+  "private-key-pem"          gchar*                : Write / Construct Only
+
+
+
+

Description

+

+A certificate used for TLS authentication and encryption. +This can represent either a public key only (eg, the certificate +received by a client from a server), or the combination of +a public key and a private key (which is needed when acting as a +GTlsServerConnection). +

+
+
+

Details

+
+

GTlsCertificate

+
typedef struct _GTlsCertificate GTlsCertificate;
+

+Abstract base class for TLS certificate types. +

+

Since 2.28

+
+
+
+

g_tls_certificate_new_from_pem ()

+
GTlsCertificate *   g_tls_certificate_new_from_pem      (const gchar *data,
+                                                         gssize length,
+                                                         GError **error);
+

+Creates a new GTlsCertificate from the PEM-encoded data in data. +If data includes both a certificate and a private key, then the +returned certificate will include the private key data as well. +

+

+If data includes multiple certificates, only the first one will be +parsed. +

+
++ + + + + + + + + + + + + + + + + + +

data :

PEM-encoded certificate data +

length :

the length of data, or -1 if it's 0-terminated. +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the new certificate, or NULL if data is invalid + +
+

Since 2.28

+
+
+
+

g_tls_certificate_new_from_file ()

+
GTlsCertificate *   g_tls_certificate_new_from_file     (const gchar *file,
+                                                         GError **error);
+

+Creates a GTlsCertificate from the PEM-encoded data in file. If +file cannot be read or parsed, the function will return NULL and +set error. Otherwise, this behaves like g_tls_certificate_new(). +

+
++ + + + + + + + + + + + + + +

file :

file containing a PEM-encoded certificate to import +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the new certificate, or NULL on error + +
+

Since 2.28

+
+
+
+

g_tls_certificate_new_from_files ()

+
GTlsCertificate *   g_tls_certificate_new_from_files    (const gchar *cert_file,
+                                                         const gchar *key_file,
+                                                         GError **error);
+

+Creates a GTlsCertificate from the PEM-encoded data in cert_file +and key_file. If either file cannot be read or parsed, the +function will return NULL and set error. Otherwise, this behaves +like g_tls_certificate_new(). +

+
++ + + + + + + + + + + + + + + + + + +

cert_file :

file containing a PEM-encoded certificate to import +

key_file :

file containing a PEM-encoded private key to import +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the new certificate, or NULL on error + +
+

Since 2.28

+
+
+
+

g_tls_certificate_list_new_from_file ()

+
GList *             g_tls_certificate_list_new_from_file
+                                                        (const gchar *file,
+                                                         GError **error);
+

+Creates one or more GTlsCertificates from the PEM-encoded +data in file. If file cannot be read or parsed, the function will +return NULL and set error. If file does not contain any +PEM-encoded certificates, this will return an empty list and not +set error. +

+
++ + + + + + + + + + + + + + +

file :

file containing PEM-encoded certificates to import +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

a +GList containing GTlsCertificate objects. You must free the list +and its contents when you are done with it. [element-type Gio.TlsCertificate][transfer full Gio.TlsCertificate] +
+

Since 2.28

+
+
+
+

g_tls_certificate_get_issuer ()

+
GTlsCertificate *   g_tls_certificate_get_issuer        (GTlsCertificate *cert);
+

+Gets the GTlsCertificate representing cert's issuer, if known +

+
++ + + + + + + + + + +

cert :

a GTlsCertificate +

Returns :

The certificate of cert's issuer, +or NULL if cert is self-signed or signed with an unknown +certificate. [transfer none] +
+

Since 2.28

+
+
+
+

g_tls_certificate_verify ()

+
GTlsCertificateFlags  g_tls_certificate_verify          (GTlsCertificate *cert,
+                                                         GSocketConnectable *identity,
+                                                         GTlsCertificate *trusted_ca);
+

+This verifies cert and returns a set of GTlsCertificateFlags +indicating any problems found with it. This can be used to verify a +certificate outside the context of making a connection, or to +check a certificate against a CA that is not part of the system +CA database. +

+

+If identity is not NULL, cert's name(s) will be compared against +it, and G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return +value if it does not match. If identity is NULL, that bit will +never be set in the return value. +

+

+If trusted_ca is not NULL, then cert (or one of the certificates +in its chain) must be signed by it, or else +G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If +trusted_ca is NULL, that bit will never be set in the return +value. +

+

+(All other GTlsCertificateFlags values will always be set or unset +as appropriate.) +

+
++ + + + + + + + + + + + + + + + + + +

cert :

a GTlsCertificate +

identity :

the expected peer identity. [allow-none] +

trusted_ca :

the certificate of a trusted authority. [allow-none] +

Returns :

the appropriate GTlsCertificateFlags + +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "certificate" property

+
  "certificate"              GByteArray*           : Read / Write / Construct Only
+

+The DER (binary) encoded representation of the certificate's +public key. This property and the +"certificate-pem" property represent the same +data, just in different forms. +

+

Since 2.28

+
+
+
+

The "certificate-pem" property

+
  "certificate-pem"          gchar*                : Read / Write / Construct Only
+

+The PEM (ASCII) encoded representation of the certificate's +public key. This property and the "certificate" +property represent the same data, just in different forms. +

+

Default value: NULL

+

Since 2.28

+
+
+
+

The "issuer" property

+
  "issuer"                   GTlsCertificate*      : Read / Write / Construct Only
+

+A GTlsCertificate representing the entity that issued this +certificate. If NULL, this means that the certificate is either +self-signed, or else the certificate of the issuer is not +available. +

+

Since 2.28

+
+
+
+

The "private-key" property

+
  "private-key"              GByteArray*           : Write / Construct Only
+

+The DER (binary) encoded representation of the certificate's +private key. This property (or the +"private-key-pem" property) can be set when +constructing a key (eg, from a file), but cannot be read. +

+

Since 2.28

+
+
+
+

The "private-key-pem" property

+
  "private-key-pem"          gchar*                : Write / Construct Only
+

+The PEM (ASCII) encoded representation of the certificate's +private key. This property (or the "private-key" +property) can be set when constructing a key (eg, from a file), +but cannot be read. +

+

Default value: NULL

+

Since 2.28

+
+
+
+

See Also

+GTlsConnection +
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GTlsClientConnection.html b/docs/reference/gio/html/GTlsClientConnection.html new file mode 100644 index 0000000..300b049 --- /dev/null +++ b/docs/reference/gio/html/GTlsClientConnection.html @@ -0,0 +1,432 @@ + + + + +GTlsClientConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTlsClientConnection

+

GTlsClientConnection — TLS client-side connection

+
+ +
+

Object Hierarchy

+
+  GInterface
+   +----GTlsClientConnection
+
+
+
+

Prerequisites

+

+GTlsClientConnection requires + GTlsConnection.

+
+
+

Properties

+
+  "accepted-cas"             GStrv*                : Read
+  "server-identity"          GSocketConnectable*   : Read / Write / Construct
+  "use-ssl3"                 gboolean              : Read / Write / Construct
+  "validation-flags"         GTlsCertificateFlags  : Read / Write / Construct
+
+
+
+

Description

+

+GTlsClientConnection is the client-side subclass of +GTlsConnection, representing a client-side TLS connection. +

+
+
+

Details

+
+

GTlsClientConnection

+
typedef struct _GTlsClientConnection GTlsClientConnection;
+

+TLS client-side connection; the client-side implementation of a +GTlsConnection +

+

Since 2.28

+
+
+
+

GTlsClientConnectionInterface

+
typedef struct {
+  GTypeInterface g_iface;
+} GTlsClientConnectionInterface;
+
+

+

+
+
+
+

g_tls_client_connection_new ()

+
GIOStream *         g_tls_client_connection_new         (GIOStream *base_io_stream,
+                                                         GSocketConnectable *server_identity,
+                                                         GError **error);
+

+Creates a new GTlsClientConnection wrapping base_io_stream (which +must have pollable input and output streams) which is assumed to +communicate with the server identified by server_identity. +

+
++ + + + + + + + + + + + + + + + + + +

base_io_stream :

the GIOStream to wrap +

server_identity :

the expected identity of the server. [allow-none] +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the new GTlsClientConnection, or NULL on error + +
+

Since 2.28

+
+
+
+

g_tls_client_connection_set_server_identity ()

+
void                g_tls_client_connection_set_server_identity
+                                                        (GTlsClientConnection *conn,
+                                                         GSocketConnectable *identity);
+

+Sets conn's expected server identity, which is used both to tell +servers on virtual hosts which certificate to present, and also +to let conn know what name to look for in the certificate when +performing G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled. +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

identity :

a GSocketConnectable describing the expected server identity +
+

Since 2.28

+
+
+
+

g_tls_client_connection_get_server_identity ()

+
GSocketConnectable * g_tls_client_connection_get_server_identity
+                                                        (GTlsClientConnection *conn);
+

+Gets conn's expected server identity +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

Returns :

a GSocketConnectable describing the +expected server identity, or NULL if the expected identity is not +known. + +
+

Since 2.28

+
+
+
+

g_tls_client_connection_set_validation_flags ()

+
void                g_tls_client_connection_set_validation_flags
+                                                        (GTlsClientConnection *conn,
+                                                         GTlsCertificateFlags flags);
+

+Sets conn's validation flags, to override the default set of +checks performed when validating a server certificate. By default, +G_TLS_CERTIFICATE_VALIDATE_ALL is used. +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

flags :

the GTlsCertificateFlags to use +
+

Since 2.28

+
+
+
+

g_tls_client_connection_get_validation_flags ()

+
GTlsCertificateFlags  g_tls_client_connection_get_validation_flags
+                                                        (GTlsClientConnection *conn);
+

+Gets conn's validation flags +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

Returns :

the validation flags + +
+

Since 2.28

+
+
+
+

g_tls_client_connection_set_use_ssl3 ()

+
void                g_tls_client_connection_set_use_ssl3
+                                                        (GTlsClientConnection *conn,
+                                                         gboolean use_ssl3);
+

+If use_ssl3 is TRUE, this forces conn to use SSL 3.0 rather than +trying to properly negotiate the right version of TLS or SSL to use. +This can be used when talking to servers that do not implement the +fallbacks correctly and which will therefore fail to handshake with +a "modern" TLS handshake attempt. +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

use_ssl3 :

whether to use SSL 3.0 +
+

Since 2.28

+
+
+
+

g_tls_client_connection_get_use_ssl3 ()

+
gboolean            g_tls_client_connection_get_use_ssl3
+                                                        (GTlsClientConnection *conn);
+

+Gets whether conn will use SSL 3.0 rather than the +highest-supported version of TLS; see +g_tls_client_connection_set_use_ssl3(). +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

Returns :

whether conn will use SSL 3.0 + +
+

Since 2.28

+
+
+
+

g_tls_client_connection_get_accepted_cas ()

+
char **             g_tls_client_connection_get_accepted_cas
+                                                        (GTlsClientConnection *conn);
+

+Gets the list of distinguished names of the Certificate Authorities +that the server will accept certificates from. This will be set +during the TLS handshake if the server requests a certificate. +Otherwise, it will be NULL. +

+
++ + + + + + + + + + +

conn :

the GTlsClientConnection +

Returns :

the list +of CA names, which you must free (eg, with g_strfreev()). [transfer full][array zero-terminated=1] +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "accepted-cas" property

+
  "accepted-cas"             GStrv*                : Read
+

+A list of the distinguished names of the Certificate Authorities +that the server will accept client certificates signed by. If the +server requests a client certificate during the handshake, then +this property will be set after the handshake completes. +

+

Since 2.28

+
+
+
+

The "server-identity" property

+
  "server-identity"          GSocketConnectable*   : Read / Write / Construct
+

+A GSocketConnectable describing the identity of the server that +is expected on the other end of the connection. +

+

+If the G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in +"validation-flags", this object will be used +to determine the expected identify of the remote end of the +connection; if "server-identity" is not set, +or does not match the identity presented by the server, then the +G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail. +

+

+In addition to its use in verifying the server certificate, +this is also used to give a hint to the server about what +certificate we expect, which is useful for servers that serve +virtual hosts. +

+

Since 2.28

+
+
+
+

The "use-ssl3" property

+
  "use-ssl3"                 gboolean              : Read / Write / Construct
+

+If TRUE, tells the connection to use SSL 3.0 rather than trying +to negotiate the best version of TLS or SSL to use. This can be +used when talking to servers that don't implement version +negotiation correctly and therefore refuse to handshake at all with +a "modern" TLS handshake. +

+

Default value: FALSE

+

Since 2.28

+
+
+
+

The "validation-flags" property

+
  "validation-flags"         GTlsCertificateFlags  : Read / Write / Construct
+

+What steps to perform when validating a certificate received from +a server. Server certificates that fail to validate in all of the +ways indicated here will be rejected unless the application +overrides the default via "accept-certificate". +

+

Default value: G_TLS_CERTIFICATE_UNKNOWN_CA|G_TLS_CERTIFICATE_BAD_IDENTITY|G_TLS_CERTIFICATE_NOT_ACTIVATED|G_TLS_CERTIFICATE_EXPIRED|G_TLS_CERTIFICATE_REVOKED|G_TLS_CERTIFICATE_INSECURE|G_TLS_CERTIFICATE_GENERIC_ERROR

+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GTlsConnection.html b/docs/reference/gio/html/GTlsConnection.html new file mode 100644 index 0000000..f8e8428 --- /dev/null +++ b/docs/reference/gio/html/GTlsConnection.html @@ -0,0 +1,879 @@ + + + + +GTlsConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTlsConnection

+

GTlsConnection — TLS connection type

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GIOStream
+         +----GTlsConnection
+
+
+
+

Known Derived Interfaces

+

+GTlsConnection is required by + GTlsClientConnection and GTlsServerConnection.

+
+
+

Properties

+
+  "base-io-stream"           GIOStream*            : Read / Write / Construct Only
+  "certificate"              GTlsCertificate*      : Read / Write
+  "peer-certificate"         GTlsCertificate*      : Read
+  "peer-certificate-errors"  GTlsCertificateFlags  : Read
+  "rehandshake-mode"         GTlsRehandshakeMode   : Read / Write / Construct
+  "require-close-notify"     gboolean              : Read / Write / Construct
+  "use-system-certdb"        gboolean              : Read / Write / Construct
+
+
+
+

Signals

+
+  "accept-certificate"                             : Run Last
+
+
+
+

Description

+

+GTlsConnection is the base TLS connection class type, which wraps +a GIOStream and provides TLS encryption on top of it. Its +subclasses, GTlsClientConnection and GTlsServerConnection, +implement client-side and server-side TLS, respectively. +

+
+
+

Details

+
+

GTlsConnection

+
typedef struct _GTlsConnection GTlsConnection;
+

+TLS connection. This is an abstract type that will be subclassed by +a TLS-library-specific subtype. +

+

Since 2.28

+
+
+
+

g_tls_connection_set_certificate ()

+
void                g_tls_connection_set_certificate    (GTlsConnection *conn,
+                                                         GTlsCertificate *certificate);
+

+This sets the certificate that conn will present to its peer +during the TLS handshake. For a GTlsServerConnection, it is +mandatory to set this, and that will normally be done at construct +time. +

+

+For a GTlsClientConnection, this is optional. If a handshake fails +with G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server +requires a certificate, and if you try connecting again, you should +call this method first. You can call +g_tls_client_connection_get_accepted_cas() on the failed connection +to get a list of Certificate Authorities that the server will +accept certificates from. +

+

+(It is also possible that a server will allow the connection with +or without a certificate; in that case, if you don't provide a +certificate, you can tell that the server requested one by the fact +that g_tls_client_connection_get_accepted_cas() will return +non-NULL.) +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

certificate :

the certificate to use for conn +
+

Since 2.28

+
+
+
+

g_tls_connection_get_certificate ()

+
GTlsCertificate *   g_tls_connection_get_certificate    (GTlsConnection *conn);
+

+Gets conn's certificate, as set by +g_tls_connection_set_certificate(). +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

Returns :

conn's certificate, or NULL. [transfer none] +
+

Since 2.28

+
+
+
+

g_tls_connection_get_peer_certificate ()

+
GTlsCertificate *   g_tls_connection_get_peer_certificate
+                                                        (GTlsConnection *conn);
+

+Gets conn's peer's certificate after the handshake has completed. +(It is not set during the emission of +"accept-certificate".) +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

Returns :

conn's peer's certificate, or NULL. [transfer none] +
+

Since 2.28

+
+
+
+

g_tls_connection_get_peer_certificate_errors ()

+
GTlsCertificateFlags  g_tls_connection_get_peer_certificate_errors
+                                                        (GTlsConnection *conn);
+

+Gets the errors associated with validating conn's peer's +certificate, after the handshake has completed. (It is not set +during the emission of "accept-certificate".) +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

Returns :

conn's peer's certificate errors + +
+

Since 2.28

+
+
+
+

g_tls_connection_set_require_close_notify ()

+
void                g_tls_connection_set_require_close_notify
+                                                        (GTlsConnection *conn,
+                                                         gboolean require_close_notify);
+

+Sets whether or not conn expects a proper TLS close notification +before the connection is closed. If this is TRUE (the default), +then conn will expect to receive a TLS close notification from its +peer before the connection is closed, and will return a +G_TLS_ERROR_EOF error if the connection is closed without proper +notification (since this may indicate a network error, or +man-in-the-middle attack). +

+

+In some protocols, the application will know whether or not the +connection was closed cleanly based on application-level data +(because the application-level data includes a length field, or is +somehow self-delimiting); in this case, the close notify is +redundant and sometimes omitted. (TLS 1.1 explicitly allows this; +in TLS 1.0 it is technically an error, but often done anyway.) You +can use g_tls_connection_set_require_close_notify() to tell conn +to allow an "unannounced" connection close, in which case the close +will show up as a 0-length read, as in a non-TLS +GSocketConnection, and it is up to the application to check that +the data has been fully received. +

+

+Note that this only affects the behavior when the peer closes the +connection; when the application calls g_io_stream_close() itself +on conn, this will send a close notification regardless of the +setting of this property. If you explicitly want to do an unclean +close, you can close conn's "base-io-stream" rather +than closing conn itself. +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

require_close_notify :

whether or not to require close notification +
+

Since 2.28

+
+
+
+

g_tls_connection_get_require_close_notify ()

+
gboolean            g_tls_connection_get_require_close_notify
+                                                        (GTlsConnection *conn);
+

+Tests whether or not conn expects a proper TLS close notification +when the connection is closed. See +g_tls_connection_set_require_close_notify() for details. +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

Returns :

TRUE if conn requires a proper TLS close +notification. + +
+

Since 2.28

+
+
+
+

enum GTlsRehandshakeMode

+
typedef enum {
+  G_TLS_REHANDSHAKE_NEVER,
+  G_TLS_REHANDSHAKE_SAFELY,
+  G_TLS_REHANDSHAKE_UNSAFELY
+} GTlsRehandshakeMode;
+
+

+When to allow rehandshaking. See +g_tls_connection_set_rehandshake_mode(). +

+
++ + + + + + + + + + + + + + +

G_TLS_REHANDSHAKE_NEVER

Never allow rehandshaking +

G_TLS_REHANDSHAKE_SAFELY

Allow safe rehandshaking only +

G_TLS_REHANDSHAKE_UNSAFELY

Allow unsafe rehandshaking +
+

Since 2.28

+
+
+
+

g_tls_connection_set_rehandshake_mode ()

+
void                g_tls_connection_set_rehandshake_mode
+                                                        (GTlsConnection *conn,
+                                                         GTlsRehandshakeMode mode);
+

+Sets how conn behaves with respect to rehandshaking requests. +

+

+G_TLS_REHANDSHAKE_NEVER means that it will never agree to +rehandshake after the initial handshake is complete. (For a client, +this means it will refuse rehandshake requests from the server, and +for a server, this means it will close the connection with an error +if the client attempts to rehandshake.) +

+

+G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a +rehandshake only if the other end of the connection supports the +TLS renegotiation_info extension. This is the +default behavior, but means that rehandshaking will not work +against older implementations that do not support that extension. +

+

+G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow +rehandshaking even without the +renegotiation_info extension. On the server side +in particular, this is not recommended, since it leaves the server +open to certain attacks. However, this mode is necessary if you +need to allow renegotiation with older client software. +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

mode :

the rehandshaking mode +
+

Since 2.28

+
+
+
+

g_tls_connection_get_rehandshake_mode ()

+
GTlsRehandshakeMode  g_tls_connection_get_rehandshake_mode
+                                                        (GTlsConnection *conn);
+

+Gets conn rehandshaking mode. See +g_tls_connection_set_rehandshake() for details. +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

Returns :

conn's rehandshaking mode + +
+

Since 2.28

+
+
+
+

g_tls_connection_set_use_system_certdb ()

+
void                g_tls_connection_set_use_system_certdb
+                                                        (GTlsConnection *conn,
+                                                         gboolean use_system_certdb);
+

+Sets whether conn uses the system certificate database to verify +peer certificates. This is TRUE by default. If set to FALSE, then +peer certificate validation will always set the +G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning +"accept-certificate" will always be emitted on +client-side connections, unless that bit is not set in +"validation-flags"). +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

use_system_certdb :

whether to use the system certificate database +
+

Since 2.28

+
+
+
+

g_tls_connection_get_use_system_certdb ()

+
gboolean            g_tls_connection_get_use_system_certdb
+                                                        (GTlsConnection *conn);
+

+Gets whether conn uses the system certificate database to verify +peer certificates. See g_tls_connection_set_use_system_certdb(). +

+
++ + + + + + + + + + +

conn :

a GTlsConnection +

Returns :

whether conn uses the system certificate database + +
+

Since 2.28

+
+
+
+

g_tls_connection_handshake ()

+
gboolean            g_tls_connection_handshake          (GTlsConnection *conn,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Attempts a TLS handshake on conn. +

+

+On the client side, it is never necessary to call this method; +although the connection needs to perform a handshake after +connecting (or after sending a "STARTTLS"-type command) and may +need to rehandshake later if the server requests it, +GTlsConnection will handle this for you automatically when you try +to send or receive data on the connection. However, you can call +g_tls_connection_handshake() manually if you want to know for sure +whether the initial handshake succeeded or failed (as opposed to +just immediately trying to write to conn's output stream, in which +case if it fails, it may not be possible to tell if it failed +before or after completing the handshake). +

+

+Likewise, on the server side, although a handshake is necessary at +the beginning of the communication, you do not need to call this +function explicitly unless you want clearer error reporting. +However, you may call g_tls_connection_handshake() later on to +renegotiate parameters (encryption methods, etc) with the client. +

+

+"accept_certificate" may be emitted during the +handshake. +

+
++ + + + + + + + + + + + + + + + + + +

conn :

a GTlsConnection +

cancellable :

a GCancellable, or NULL +

error :

a GError, or NULL +

Returns :

success or failure + +
+

Since 2.28

+
+
+
+

g_tls_connection_handshake_async ()

+
void                g_tls_connection_handshake_async    (GTlsConnection *conn,
+                                                         int io_priority,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously performs a TLS handshake on conn. See +g_tls_connection_handshake() for more information. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

conn :

a GTlsConnection +

io_priority :

the I/O priority +of the request. +

cancellable :

a GCancellable, or NULL +

callback :

callback to call when the handshake is complete +

user_data :

the data to pass to the callback function +
+

Since 2.28

+
+
+
+

g_tls_connection_handshake_finish ()

+
gboolean            g_tls_connection_handshake_finish   (GTlsConnection *conn,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+

+Finish an asynchronous TLS handshake operation. See +g_tls_connection_handshake() for more information. +

+
++ + + + + + + + + + + + + + + + + + +

conn :

a GTlsConnection +

result :

a GAsyncResult. +

error :

a GError pointer, or NULL +

Returns :

TRUE on success, FALSE on failure, in which +case error will be set. + +
+

Since 2.28

+
+
+
+

g_tls_connection_emit_accept_certificate ()

+
gboolean            g_tls_connection_emit_accept_certificate
+                                                        (GTlsConnection *conn,
+                                                         GTlsCertificate *peer_cert,
+                                                         GTlsCertificateFlags errors);
+

+Used by GTlsConnection implementations to emit the +"accept-certificate" signal. +

+
++ + + + + + + + + + + + + + + + + + +

conn :

a GTlsConnection +

peer_cert :

the peer's GTlsCertificate +

errors :

the problems with peer_cert +

Returns :

TRUE if one of the signal handlers has returned + TRUE to accept peer_cert + +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "base-io-stream" property

+
  "base-io-stream"           GIOStream*            : Read / Write / Construct Only
+

+The GIOStream that the connection wraps +

+

Since 2.28

+
+
+
+

The "certificate" property

+
  "certificate"              GTlsCertificate*      : Read / Write
+

+The connection's certificate; see +g_tls_connection_set_certificate(). +

+

Since 2.28

+
+
+
+

The "peer-certificate" property

+
  "peer-certificate"         GTlsCertificate*      : Read
+

+The connection's peer's certificate, after the TLS handshake has +completed and the certificate has been accepted. Note in +particular that this is not yet set during the emission of +"accept-certificate". +

+

+(You can watch for a "notify" signal on this property to +detect when a handshake has occurred.) +

+

Since 2.28

+
+
+
+

The "peer-certificate-errors" property

+
  "peer-certificate-errors"  GTlsCertificateFlags  : Read
+

+The errors noticed-and-ignored while verifying +"peer-certificate". Normally this should be 0, but +it may not be if "validation-flags" is not +G_TLS_CERTIFICATE_VALIDATE_ALL, or if +"accept-certificate" overrode the default +behavior. +

+

Since 2.28

+
+
+
+

The "rehandshake-mode" property

+
  "rehandshake-mode"         GTlsRehandshakeMode   : Read / Write / Construct
+

+The rehandshaking mode. See +g_tls_connection_set_rehandshake_mode(). +

+

Default value: G_TLS_REHANDSHAKE_SAFELY

+

Since 2.28

+
+
+
+

The "require-close-notify" property

+
  "require-close-notify"     gboolean              : Read / Write / Construct
+

+Whether or not proper TLS close notification is required. +See g_tls_connection_set_require_close_notify(). +

+

Default value: TRUE

+

Since 2.28

+
+
+
+

The "use-system-certdb" property

+
  "use-system-certdb"        gboolean              : Read / Write / Construct
+

+Whether or not the system certificate database will be used to +verify peer certificates. See +g_tls_connection_set_use_system_certdb(). +

+

Default value: TRUE

+

Since 2.28

+
+
+
+

Signal Details

+
+

The "accept-certificate" signal

+
gboolean            user_function                      (GTlsConnection      *conn,
+                                                        GTlsCertificate     *peer_cert,
+                                                        GTlsCertificateFlags errors,
+                                                        gpointer             user_data)      : Run Last
+

+Emitted during the TLS handshake after the peer certificate has +been received. You can examine peer_cert's certification path by +calling g_tls_certificate_get_issuer() on it. +

+

+For a client-side connection, peer_cert is the server's +certificate, and the signal will only be emitted if the +certificate was not acceptable according to conn's +"validation_flags". If you would like the +certificate to be accepted despite errors, return TRUE from the +signal handler. Otherwise, if no handler accepts the certificate, +the handshake will fail with G_TLS_ERROR_BAD_CERTIFICATE. +

+

+For a server-side connection, peer_cert is the certificate +presented by the client, if this was requested via the server's +"authentication_mode". On the server side, +the signal is always emitted when the client presents a +certificate, and the certificate will only be accepted if a +handler returns TRUE. +

+

+Note that if this signal is emitted as part of asynchronous I/O +in the main thread, then you should not attempt to interact with +the user before returning from the signal handler. If you want to +let the user decide whether or not to accept the certificate, you +would have to return FALSE from the signal handler on the first +attempt, and then after the connection attempt returns a +G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if +the user decides to accept the certificate, remember that fact, +create a new connection, and return TRUE from the signal handler +the next time. +

+

+If you are doing I/O in another thread, you do not +need to worry about this, and can simply block in the signal +handler until the UI thread returns an answer. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

conn :

a GTlsConnection +

peer_cert :

the peer's GTlsCertificate +

errors :

the problems with peer_cert. +

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to accept peer_cert (which will also +immediately end the signal emission). FALSE to allow the signal +emission to continue, which will cause the handshake to fail if +no one else overrides it. +
+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GTlsServerConnection.html b/docs/reference/gio/html/GTlsServerConnection.html new file mode 100644 index 0000000..7a5e3de --- /dev/null +++ b/docs/reference/gio/html/GTlsServerConnection.html @@ -0,0 +1,162 @@ + + + + +GTlsServerConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GTlsServerConnection

+

GTlsServerConnection — TLS server-side connection

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GTlsServerConnection;
+                    GTlsServerConnectionInterface;
+GIOStream *         g_tls_server_connection_new         (GIOStream *base_io_stream,
+                                                         GTlsCertificate *certificate,
+                                                         GError **error);
+
+
+
+

Object Hierarchy

+
+  GInterface
+   +----GTlsServerConnection
+
+
+
+

Prerequisites

+

+GTlsServerConnection requires + GTlsConnection.

+
+
+

Properties

+
+  "authentication-mode"      GTlsAuthenticationMode  : Read / Write
+
+
+
+

Description

+

+GTlsServerConnection is the server-side subclass of GTlsConnection, +representing a server-side TLS connection. +

+
+
+

Details

+
+

GTlsServerConnection

+
typedef struct _GTlsServerConnection GTlsServerConnection;
+

+TLS server-side connection. This is the server-side implementation +of a GTlsConnection. +

+

Since 2.28

+
+
+
+

GTlsServerConnectionInterface

+
typedef struct {
+  GTypeInterface g_iface;
+} GTlsServerConnectionInterface;
+
+

+

+
+
+
+

g_tls_server_connection_new ()

+
GIOStream *         g_tls_server_connection_new         (GIOStream *base_io_stream,
+                                                         GTlsCertificate *certificate,
+                                                         GError **error);
+

+Creates a new GTlsServerConnection wrapping base_io_stream (which +must have pollable input and output streams). +

+
++ + + + + + + + + + + + + + + + + + +

base_io_stream :

the GIOStream to wrap +

certificate :

the default server certificate, or NULL. [allow-none] +

error :

+GError for error reporting, or NULL to ignore. +

Returns :

the new GTlsServerConnection, or NULL on error + +
+

Since 2.28

+
+
+
+

Property Details

+
+

The "authentication-mode" property

+
  "authentication-mode"      GTlsAuthenticationMode  : Read / Write
+

+The GTlsAuthenticationMode for the server. This can be changed +before calling g_tls_connection_handshake() if you want to +rehandshake with a different mode from the initial handshake. +

+

Default value: G_TLS_AUTHENTICATION_NONE

+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GUnixConnection.html b/docs/reference/gio/html/GUnixConnection.html new file mode 100644 index 0000000..a67fe6c --- /dev/null +++ b/docs/reference/gio/html/GUnixConnection.html @@ -0,0 +1,297 @@ + + + + +GUnixConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GUnixConnection

+

GUnixConnection — A UNIX domain GSocketConnection

+
+
+

Synopsis

+
+#include <gio/gunixconnection.h>
+
+                    GUnixConnection;
+gint                g_unix_connection_receive_fd        (GUnixConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+gboolean            g_unix_connection_send_fd           (GUnixConnection *connection,
+                                                         gint fd,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+GCredentials *      g_unix_connection_receive_credentials
+                                                        (GUnixConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+gboolean            g_unix_connection_send_credentials  (GUnixConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----GIOStream
+         +----GSocketConnection
+               +----GUnixConnection
+
+
+
+

Description

+

+This is the subclass of GSocketConnection that is created +for UNIX domain sockets. +

+

+It contains functions to do some of the UNIX socket specific +functionality like passing file descriptors. +

+

+Note that <gio/gunixconnection.h> belongs to +the UNIX-specific GIO interfaces, thus you have to use the +gio-unix-2.0.pc pkg-config file when using it. +

+
+
+

Details

+
+

GUnixConnection

+
typedef struct _GUnixConnection GUnixConnection;
+

+

+
+
+
+

g_unix_connection_receive_fd ()

+
gint                g_unix_connection_receive_fd        (GUnixConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Receives a file descriptor from the sending end of the connection. +The sending end has to call g_unix_connection_send_fd() for this +to work. +

+

+As well as reading the fd this also reads a single byte from the +stream, as this is required for fd passing to work on some +implementations. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

a GUnixConnection +

cancellable :

optional GCancellable object, NULL to ignore. [allow-none] +

error :

GError for error reporting, or NULL to ignore. [allow-none] +

Returns :

a file descriptor on success, -1 on error. + +
+

Since 2.22

+
+
+
+

g_unix_connection_send_fd ()

+
gboolean            g_unix_connection_send_fd           (GUnixConnection *connection,
+                                                         gint fd,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Passes a file descriptor to the recieving side of the +connection. The recieving end has to call g_unix_connection_receive_fd() +to accept the file descriptor. +

+

+As well as sending the fd this also writes a single byte to the +stream, as this is required for fd passing to work on some +implementations. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

connection :

a GUnixConnection +

fd :

a file descriptor +

cancellable :

optional GCancellable object, NULL to ignore. [allow-none] +

error :

GError for error reporting, or NULL to ignore. [allow-none] +

Returns :

a TRUE on success, NULL on error. + +
+

Since 2.22

+
+
+
+

g_unix_connection_receive_credentials ()

+
GCredentials *      g_unix_connection_receive_credentials
+                                                        (GUnixConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Receives credentials from the sending end of the connection. The +sending end has to call g_unix_connection_send_credentials() (or +similar) for this to work. +

+

+As well as reading the credentials this also reads (and discards) a +single byte from the stream, as this is required for credentials +passing to work on some implementations. +

+

+Other ways to exchange credentials with a foreign peer includes the +GUnixCredentialsMessage type and g_socket_get_credentials() function. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GUnixConnection. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

Received credentials on success (free with +g_object_unref()), NULL if error is set. [transfer full] +
+

Since 2.26

+
+
+
+

g_unix_connection_send_credentials ()

+
gboolean            g_unix_connection_send_credentials  (GUnixConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Passes the credentials of the current user the receiving side +of the connection. The recieving end has to call +g_unix_connection_receive_credentials() (or similar) to accept the +credentials. +

+

+As well as sending the credentials this also writes a single NUL +byte to the stream, as this is required for credentials passing to +work on some implementations. +

+

+Other ways to exchange credentials with a foreign peer includes the +GUnixCredentialsMessage type and g_socket_get_credentials() function. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

A GUnixConnection. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

TRUE on success, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

See Also

+GSocketConnection. +
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GUnixCredentialsMessage.html b/docs/reference/gio/html/GUnixCredentialsMessage.html new file mode 100644 index 0000000..114f67f --- /dev/null +++ b/docs/reference/gio/html/GUnixCredentialsMessage.html @@ -0,0 +1,221 @@ + + + + +GUnixCredentialsMessage + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GUnixCredentialsMessage

+

GUnixCredentialsMessage — A GSocketControlMessage containing credentials

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----GSocketControlMessage
+         +----GUnixCredentialsMessage
+
+
+
+

Properties

+
+  "credentials"              GCredentials*         : Read / Write / Construct Only
+
+
+
+

Description

+

+This GSocketControlMessage contains a GCredentials instance. It +may be sent using g_socket_send_message() and received using +g_socket_receive_message() over UNIX sockets (ie: sockets in the +G_SOCKET_FAMILY_UNIX family). +

+

+For an easier way to send and receive credentials over +stream-oriented UNIX sockets, see +g_unix_connection_send_credentials() and +g_unix_connection_receive_credentials(). To receive credentials of +a foreign process connected to a socket, use +g_socket_get_credentials(). +

+
+
+

Details

+
+

GUnixCredentialsMessage

+
typedef struct _GUnixCredentialsMessage GUnixCredentialsMessage;
+

+The GUnixCredentialsMessage structure contains only private data +and should only be accessed using the provided API. +

+

Since 2.26

+
+
+
+

GUnixCredentialsMessageClass

+
typedef struct {
+  GSocketControlMessageClass parent_class;
+} GUnixCredentialsMessageClass;
+
+

+Class structure for GUnixCredentialsMessage. +

+

Since 2.26

+
+
+
+

g_unix_credentials_message_new ()

+
GSocketControlMessage * g_unix_credentials_message_new  (void);
+

+Creates a new GUnixCredentialsMessage with credentials matching the current processes. +

+
++ + + + +

Returns :

a new GUnixCredentialsMessage + +
+

Since 2.26

+
+
+
+

g_unix_credentials_message_new_with_credentials ()

+
GSocketControlMessage * g_unix_credentials_message_new_with_credentials
+                                                        (GCredentials *credentials);
+

+Creates a new GUnixCredentialsMessage holding credentials. +

+
++ + + + + + + + + + +

credentials :

A GCredentials object. +

Returns :

a new GUnixCredentialsMessage + +
+

Since 2.26

+
+
+
+

g_unix_credentials_message_get_credentials ()

+
GCredentials *      g_unix_credentials_message_get_credentials
+                                                        (GUnixCredentialsMessage *message);
+

+Gets the credentials stored in message. +

+
++ + + + + + + + + + +

message :

A GUnixCredentialsMessage. +

Returns :

A GCredentials instance. Do not free, it is owned by message. [transfer none] +
+

Since 2.26

+
+
+
+

g_unix_credentials_message_is_supported ()

+
gboolean            g_unix_credentials_message_is_supported
+                                                        (void);
+

+Checks if passing a GCredential on a GSocket is supported on this platform. +

+
++ + + + +

Returns :

TRUE if supported, FALSE otherwise + +
+

Since 2.26

+
+
+
+

Property Details

+
+

The "credentials" property

+
  "credentials"              GCredentials*         : Read / Write / Construct Only
+

+The credentials stored in the message. +

+

Since 2.26

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/GUnixFDList.html b/docs/reference/gio/html/GUnixFDList.html index 892a281..c150d7f 100644 --- a/docs/reference/gio/html/GUnixFDList.html +++ b/docs/reference/gio/html/GUnixFDList.html @@ -3,12 +3,12 @@ GUnixFDList - + - + - + @@ -33,33 +33,36 @@

GUnixFDList

-

GUnixFDList — An object containing a set of file descriptors

+

GUnixFDList — An object containing a set of UNIX file descriptors

Synopsis

-
                    GUnixFDList;
-GUnixFDList *       g_unix_fd_list_new_from_array       (const gint *fds,
-                                                         gint n_fds);
+
+#include <gio/gunixfdlist.h>
+
+                    GUnixFDList;
+GUnixFDList *       g_unix_fd_list_new_from_array       (const gint *fds,
+                                                         gint n_fds);
 GUnixFDList *       g_unix_fd_list_new                  (void);
-gint                g_unix_fd_list_get_length           (GUnixFDList *list);
-gint                g_unix_fd_list_get                  (GUnixFDList *list,
-                                                         gint index_,
-                                                         GError **error);
-const gint *        g_unix_fd_list_peek_fds             (GUnixFDList *list,
-                                                         gint *length);
-gint *              g_unix_fd_list_steal_fds            (GUnixFDList *list,
-                                                         gint *length);
-gint                g_unix_fd_list_append               (GUnixFDList *list,
-                                                         gint fd,
-                                                         GError **error);
+gint                g_unix_fd_list_get_length           (GUnixFDList *list);
+gint                g_unix_fd_list_get                  (GUnixFDList *list,
+                                                         gint index_,
+                                                         GError **error);
+const gint *        g_unix_fd_list_peek_fds             (GUnixFDList *list,
+                                                         gint *length);
+gint *              g_unix_fd_list_steal_fds            (GUnixFDList *list,
+                                                         gint *length);
+gint                g_unix_fd_list_append               (GUnixFDList *list,
+                                                         gint fd,
+                                                         GError **error);
 

Object Hierarchy

-  GObject
+  GObject
    +----GUnixFDList
 
@@ -74,6 +77,11 @@ It may be wrapped in a G_SOCKET_ADDRESS_UNIX
family by using g_socket_send_message() and received using g_socket_receive_message().

+

+Note that <gio/gunixfdlist.h> belongs to +the UNIX-specific GIO interfaces, thus you have to use the +gio-unix-2.0.pc pkg-config file when using it. +

Details

@@ -86,8 +94,8 @@ and received using

g_unix_fd_list_new_from_array ()

-
GUnixFDList *       g_unix_fd_list_new_from_array       (const gint *fds,
-                                                         gint n_fds);
+
GUnixFDList *       g_unix_fd_list_new_from_array       (const gint *fds,
+                                                         gint n_fds);

Creates a new GUnixFDList containing the file descriptors given in fds. The file descriptors become the property of the new list and @@ -144,7 +152,7 @@ Creates a new

g_unix_fd_list_get_length ()

-
gint                g_unix_fd_list_get_length           (GUnixFDList *list);
+
gint                g_unix_fd_list_get_length           (GUnixFDList *list);

Gets the length of list (ie: the number of file descriptors contained within). @@ -170,9 +178,9 @@ contained within).


g_unix_fd_list_get ()

-
gint                g_unix_fd_list_get                  (GUnixFDList *list,
-                                                         gint index_,
-                                                         GError **error);
+
gint                g_unix_fd_list_get                  (GUnixFDList *list,
+                                                         gint index_,
+                                                         GError **error);

Gets a file descriptor out of list.

@@ -205,7 +213,7 @@ system-wide file descriptor limit.

error :

-a GError pointer +a GError pointer @@ -221,8 +229,8 @@ system-wide file descriptor limit.

g_unix_fd_list_peek_fds ()

-
const gint *        g_unix_fd_list_peek_fds             (GUnixFDList *list,
-                                                         gint *length);
+
const gint *        g_unix_fd_list_peek_fds             (GUnixFDList *list,
+                                                         gint *length);

Returns the array of file descriptors that is contained in this object. @@ -233,12 +241,12 @@ caller must not close them and must not free the array. The array is valid only until list is changed in any way.

-If length is non-NULL then it is set to the number of file +If length is non-NULL then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.

-This function never returns NULL. In case there are no file +This function never returns NULL. In case there are no file descriptors contained in list, an empty array is returned.

@@ -251,7 +259,7 @@ descriptors contained in list, an empty - @@ -267,8 +275,8 @@ descriptors contained in list, an empty

g_unix_fd_list_steal_fds ()

-
gint *              g_unix_fd_list_steal_fds            (GUnixFDList *list,
-                                                         gint *length);
+
gint *              g_unix_fd_list_steal_fds            (GUnixFDList *list,
+                                                         gint *length);

Returns the array of file descriptors that is contained in this object. @@ -279,18 +287,18 @@ After this call, the descriptors are no longer contained in descriptors have been added).

-The return result of this function must be freed with g_free(). +The return result of this function must be freed with g_free(). The caller is also responsible for closing all of the file descriptors. The file descriptors in the array are set to close-on-exec.

-If length is non-NULL then it is set to the number of file +If length is non-NULL then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.

-This function never returns NULL. In case there are no file +This function never returns NULL. In case there are no file descriptors contained in list, an empty array is returned.

length :

pointer to the length of the returned array, or NULL +pointer to the length of the returned array, or NULL
@@ -303,7 +311,7 @@ descriptors contained in list, an empty - @@ -319,9 +327,9 @@ descriptors contained in list, an empty

g_unix_fd_list_append ()

-
gint                g_unix_fd_list_append               (GUnixFDList *list,
-                                                         gint fd,
-                                                         GError **error);
+
gint                g_unix_fd_list_append               (GUnixFDList *list,
+                                                         gint fd,
+                                                         GError **error);

Adds a file descriptor to list.

@@ -354,7 +362,7 @@ duplicated copy of the same file descriptor.
- @@ -376,6 +384,6 @@ duplicated copy of the same file descriptor. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GUnixFDMessage.html b/docs/reference/gio/html/GUnixFDMessage.html index 9481327..22fa9e2 100644 --- a/docs/reference/gio/html/GUnixFDMessage.html +++ b/docs/reference/gio/html/GUnixFDMessage.html @@ -3,12 +3,12 @@ GUnixFDMessage - + - + - - + + @@ -18,7 +18,7 @@ - + - @@ -165,9 +172,9 @@ the lifetime of message.

g_unix_fd_message_append_fd ()

-
gboolean            g_unix_fd_message_append_fd         (GUnixFDMessage *message,
-                                                         gint fd,
-                                                         GError **error);
+
gboolean            g_unix_fd_message_append_fd         (GUnixFDMessage *message,
+                                                         gint fd,
+                                                         GError **error);

Adds a file descriptor to message.

@@ -195,12 +202,12 @@ system-wide file descriptor limit.
- - @@ -211,8 +218,8 @@ system-wide file descriptor limit.

g_unix_fd_message_steal_fds ()

-
gint *              g_unix_fd_message_steal_fds         (GUnixFDMessage *message,
-                                                         gint *length);
+
gint *              g_unix_fd_message_steal_fds         (GUnixFDMessage *message,
+                                                         gint *length);

Returns the array of file descriptors that is contained in this object. @@ -223,17 +230,17 @@ After this call, the descriptors are no longer contained in descriptors have been added).

-The return result of this function must be freed with g_free(). +The return result of this function must be freed with g_free(). The caller is also responsible for closing all of the file descriptors.

-If length is non-NULL then it is set to the number of file +If length is non-NULL then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.

-This function never returns NULL. In case there are no file +This function never returns NULL. In case there are no file descriptors contained in message, an empty array is returned.

length :

pointer to the length of the returned array, or NULL +pointer to the length of the returned array, or NULL

error :

a GError pointer +a GError pointer
Up Home GIO Reference ManualNextNext
Top @@ -35,28 +35,31 @@

GUnixFDMessage

-

GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList

+

GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList

Object Hierarchy

-  GObject
+  GObject
    +----GSocketControlMessage
          +----GUnixFDMessage
 
@@ -70,16 +73,21 @@

Description

-This GSocketControlMessage contains a GUnixFDList. It may be sent -using g_socket_send_message() and received using +This GSocketControlMessage contains a GUnixFDList. +It may be sent using g_socket_send_message() and received using g_socket_receive_message() over UNIX sockets (ie: sockets in the -G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied +G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied between processes by the kernel.

For an easier way to send and receive file descriptors over -stream-oriented UNIX sockets, see g_unix_connection_send_fd() and -g_unix_connection_receive_fd(). +stream-oriented UNIX sockets, see g_unix_connection_send_fd() and +g_unix_connection_receive_fd(). +

+

+Note that <gio/gunixfdmessage.h> belongs to +the UNIX-specific GIO interfaces, thus you have to use the +gio-unix-2.0.pc pkg-config file when using it.

@@ -154,8 +162,7 @@ the lifetime of message.

Returns :

the GUnixFDList from message - + the GUnixFDList from message. [transfer none]

error :

a GError pointer +a GError pointer

Returns :

TRUE in case of success, else FALSE (and error is set) + TRUE in case of success, else FALSE (and error is set)
@@ -246,7 +253,7 @@ descriptors contained in message, an emp - @@ -270,11 +277,11 @@ descriptors contained in message, an emp + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GUnixInputStream.html b/docs/reference/gio/html/GUnixInputStream.html index 27b3032..61f445b 100644 --- a/docs/reference/gio/html/GUnixInputStream.html +++ b/docs/reference/gio/html/GUnixInputStream.html @@ -3,12 +3,12 @@ GUnixInputStream - + - + @@ -27,6 +27,8 @@  |  Object Hierarchy  |  + Implemented Interfaces +  |  Properties

length :

pointer to the length of the returned array, or NULL +pointer to the length of the returned array, or NULL
@@ -45,27 +47,33 @@ #include <gio/gunixinputstream.h> GUnixInputStream; -GInputStream * g_unix_input_stream_new (gint fd, - gboolean close_fd); +GInputStream * g_unix_input_stream_new (gint fd, + gboolean close_fd); void g_unix_input_stream_set_close_fd (GUnixInputStream *stream, - gboolean close_fd); -gboolean g_unix_input_stream_get_close_fd (GUnixInputStream *stream); -gint g_unix_input_stream_get_fd (GUnixInputStream *stream); + gboolean close_fd); +gboolean g_unix_input_stream_get_close_fd (GUnixInputStream *stream); +gint g_unix_input_stream_get_fd (GUnixInputStream *stream);

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GUnixInputStream
 
+
+

Implemented Interfaces

+

+GUnixInputStream implements + GPollableInputStream.

+

Properties

-  "close-fd"                 gboolean              : Read / Write
-  "fd"                       gint                  : Read / Write / Construct Only
+  "close-fd"                 gboolean              : Read / Write
+  "fd"                       gint                  : Read / Write / Construct Only
 
@@ -76,8 +84,8 @@ UNIX file descriptor, including asynchronous operations. The file descriptor must be selectable, so it doesn't work with opened files.

-Note that <gio/gunixinputstream.h> belongs -to the UNIX-specific GIO interfaces, thus you have to use the +Note that <gio/gunixinputstream.h> belongs +to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

@@ -93,13 +101,13 @@ Implements

g_unix_input_stream_new ()

-
GInputStream *      g_unix_input_stream_new             (gint fd,
-                                                         gboolean close_fd);
+
GInputStream *      g_unix_input_stream_new             (gint fd,
+                                                         gboolean close_fd);

Creates a new GUnixInputStream for the given fd.

-If close_fd is TRUE, the file descriptor will be closed +If close_fd is TRUE, the file descriptor will be closed when the stream is closed.

@@ -113,7 +121,7 @@ when the stream is closed. @@ -128,7 +136,7 @@ when the stream is closed.

g_unix_input_stream_set_close_fd ()

void                g_unix_input_stream_set_close_fd    (GUnixInputStream *stream,
-                                                         gboolean close_fd);
+ gboolean close_fd);

Sets whether the file descriptor of stream shall be closed when the stream is closed. @@ -144,7 +152,7 @@ when the stream is closed.

@@ -154,7 +162,7 @@ when the stream is closed.

g_unix_input_stream_get_close_fd ()

-
gboolean            g_unix_input_stream_get_close_fd    (GUnixInputStream *stream);
+
gboolean            g_unix_input_stream_get_close_fd    (GUnixInputStream *stream);

Returns whether the file descriptor of stream will be closed when the stream is closed. @@ -169,7 +177,7 @@ closed when the stream is closed.

- @@ -180,7 +188,7 @@ closed when the stream is closed.

g_unix_input_stream_get_fd ()

-
gint                g_unix_input_stream_get_fd          (GUnixInputStream *stream);
+
gint                g_unix_input_stream_get_fd          (GUnixInputStream *stream);

Return the UNIX file descriptor that the stream reads from.

@@ -207,7 +215,7 @@ Return the UNIX file descriptor that the stream reads from.

Property Details

The "close-fd" property

-
  "close-fd"                 gboolean              : Read / Write
+
  "close-fd"                 gboolean              : Read / Write

Whether to close the file descriptor when the stream is closed.

@@ -217,7 +225,7 @@ Whether to close the file descriptor when the stream is closed.

The "fd" property

-
  "fd"                       gint                  : Read / Write / Construct Only
+
  "fd"                       gint                  : Read / Write / Construct Only

The file descriptor that the stream reads from.

@@ -232,6 +240,6 @@ The file descriptor that the stream reads from.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GUnixOutputStream.html b/docs/reference/gio/html/GUnixOutputStream.html index 443c9ec..b3fc863 100644 --- a/docs/reference/gio/html/GUnixOutputStream.html +++ b/docs/reference/gio/html/GUnixOutputStream.html @@ -3,12 +3,12 @@ GUnixOutputStream - + - + @@ -27,6 +27,8 @@  |  Object Hierarchy  |  + Implemented Interfaces +  |  Properties

close_fd :

-TRUE to close the file descriptor when done +TRUE to close the file descriptor when done

close_fd :

-TRUE to close the file descriptor when done +TRUE to close the file descriptor when done

Returns :

TRUE if the file descriptor is closed when done + TRUE if the file descriptor is closed when done
@@ -35,7 +37,7 @@

GUnixOutputStream

-

GUnixOutputStream — Streaming output operations for Unix file descriptors

+

GUnixOutputStream — Streaming output operations for UNIX file descriptors

@@ -45,38 +47,44 @@ #include <gio/gunixoutputstream.h> GUnixOutputStream; -GOutputStream * g_unix_output_stream_new (gint fd, - gboolean close_fd); +GOutputStream * g_unix_output_stream_new (gint fd, + gboolean close_fd); void g_unix_output_stream_set_close_fd (GUnixOutputStream *stream, - gboolean close_fd); -gboolean g_unix_output_stream_get_close_fd (GUnixOutputStream *stream); -gint g_unix_output_stream_get_fd (GUnixOutputStream *stream); + gboolean close_fd); +gboolean g_unix_output_stream_get_close_fd (GUnixOutputStream *stream); +gint g_unix_output_stream_get_fd (GUnixOutputStream *stream);

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GUnixOutputStream
 
+
+

Implemented Interfaces

+

+GUnixOutputStream implements + GPollableOutputStream.

+

Properties

-  "close-fd"                 gboolean              : Read / Write
-  "fd"                       gint                  : Read / Write / Construct Only
+  "close-fd"                 gboolean              : Read / Write
+  "fd"                       gint                  : Read / Write / Construct Only
 

Description

GUnixOutputStream implements GOutputStream for writing to a -unix file descriptor, including asynchronous operations. The file +UNIX file descriptor, including asynchronous operations. The file descriptor must be selectable, so it doesn't work with opened files.

-Note that <gio/gunixoutputstream.h> belongs +Note that <gio/gunixoutputstream.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

@@ -93,13 +101,13 @@ Implements

g_unix_output_stream_new ()

-
GOutputStream *     g_unix_output_stream_new            (gint fd,
-                                                         gboolean close_fd);
+
GOutputStream *     g_unix_output_stream_new            (gint fd,
+                                                         gboolean close_fd);

Creates a new GUnixOutputStream for the given fd.

-If close_fd, is TRUE, the file descriptor will be closed when +If close_fd, is TRUE, the file descriptor will be closed when the output stream is destroyed.

@@ -113,7 +121,7 @@ the output stream is destroyed. @@ -128,7 +136,7 @@ the output stream is destroyed.

g_unix_output_stream_set_close_fd ()

void                g_unix_output_stream_set_close_fd   (GUnixOutputStream *stream,
-                                                         gboolean close_fd);
+ gboolean close_fd);

Sets whether the file descriptor of stream shall be closed when the stream is closed. @@ -144,7 +152,7 @@ when the stream is closed.

@@ -154,7 +162,7 @@ when the stream is closed.

g_unix_output_stream_get_close_fd ()

-
gboolean            g_unix_output_stream_get_close_fd   (GUnixOutputStream *stream);
+
gboolean            g_unix_output_stream_get_close_fd   (GUnixOutputStream *stream);

Returns whether the file descriptor of stream will be closed when the stream is closed. @@ -169,7 +177,7 @@ closed when the stream is closed.

- @@ -180,7 +188,7 @@ closed when the stream is closed.

g_unix_output_stream_get_fd ()

-
gint                g_unix_output_stream_get_fd         (GUnixOutputStream *stream);
+
gint                g_unix_output_stream_get_fd         (GUnixOutputStream *stream);

Return the UNIX file descriptor that the stream writes to.

@@ -207,7 +215,7 @@ Return the UNIX file descriptor that the stream writes to.

Property Details

The "close-fd" property

-
  "close-fd"                 gboolean              : Read / Write
+
  "close-fd"                 gboolean              : Read / Write

Whether to close the file descriptor when the stream is closed.

@@ -217,7 +225,7 @@ Whether to close the file descriptor when the stream is closed.

The "fd" property

-
  "fd"                       gint                  : Read / Write / Construct Only
+
  "fd"                       gint                  : Read / Write / Construct Only

The file descriptor that the stream writes to.

@@ -232,6 +240,6 @@ The file descriptor that the stream writes to.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GUnixSocketAddress.html b/docs/reference/gio/html/GUnixSocketAddress.html index bbf8ab8..a94dfed 100644 --- a/docs/reference/gio/html/GUnixSocketAddress.html +++ b/docs/reference/gio/html/GUnixSocketAddress.html @@ -3,12 +3,12 @@ GUnixSocketAddress - + - + - + @@ -43,22 +43,31 @@

close_fd :

-TRUE to close the file descriptor when done +TRUE to close the file descriptor when done

close_fd :

-TRUE to close the file descriptor when done +TRUE to close the file descriptor when done

Returns :

TRUE if the file descriptor is closed when done + TRUE if the file descriptor is closed when done

Object Hierarchy

-  GObject
+  GObject
    +----GSocketAddress
          +----GUnixSocketAddress
 
@@ -72,15 +81,31 @@ GUnixSocketAddress implements

Properties

-  "abstract"                 gboolean              : Read / Write / Construct Only
-  "path"                     gchar*                : Read / Write / Construct Only
-  "path-as-array"            GByteArray*           : Read / Write / Construct Only
+  "abstract"                 gboolean              : Read / Write / Construct Only
+  "address-type"             GUnixSocketAddressType  : Read / Write / Construct Only
+  "path"                     gchar*                : Read / Write / Construct Only
+  "path-as-array"            GByteArray*           : Read / Write / Construct Only
 

Description

-Support for UNIX-domain (aka local) sockets. +Support for UNIX-domain (also known as local) sockets. +

+

+UNIX domain sockets are generally visible in the filesystem. +However, some systems support abstract socket names which are not +visible in the filesystem and not affected by the filesystem +permissions, visibility, etc. Currently this is only supported +under Linux. If you attempt to use abstract sockets on other +systems, function calls may return G_IO_ERROR_NOT_SUPPORTED +errors. You can use g_unix_socket_address_abstract_names_supported() +to see if abstract names are supported. +

+

+Note that <gio/gunixsocketaddress.h> belongs to +the UNIX-specific GIO interfaces, thus you have to use the +gio-unix-2.0.pc pkg-config file when using it.

@@ -94,9 +119,70 @@ A UNIX-domain (local) socket address, corresponding to a


+
+

enum GUnixSocketAddressType

+
typedef enum {
+  G_UNIX_SOCKET_ADDRESS_INVALID,
+  G_UNIX_SOCKET_ADDRESS_ANONYMOUS,
+  G_UNIX_SOCKET_ADDRESS_PATH,
+  G_UNIX_SOCKET_ADDRESS_ABSTRACT,
+  G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
+} GUnixSocketAddressType;
+
+

+The type of name used by a GUnixSocketAddress. +G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain +socket bound to a filesystem path. G_UNIX_SOCKET_ADDRESS_ANONYMOUS +indicates a socket not bound to any name (eg, a client-side socket, +or a socket created with socketpair()). +

+

+For abstract sockets, there are two incompatible ways of naming +them: the man pages suggest using the entire struct +sockaddr_un as the name, padding the unused parts of the +sun_path field with zeroes; this corresponds to +G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. However, many programs +instead just use a portion of sun_path, and pass an appropriate +smaller length to bind() or connect(). This is +G_UNIX_SOCKET_ADDRESS_ABSTRACT. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

G_UNIX_SOCKET_ADDRESS_INVALID

invalid +

G_UNIX_SOCKET_ADDRESS_ANONYMOUS

anonymous +

G_UNIX_SOCKET_ADDRESS_PATH

a filesystem path +

G_UNIX_SOCKET_ADDRESS_ABSTRACT

an abstract name +

G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED

an abstract name, 0-padded + to the full length of a unix socket name +
+

Since 2.26

+
+

g_unix_socket_address_new ()

-
GSocketAddress *    g_unix_socket_address_new           (const gchar *path);
+
GSocketAddress *    g_unix_socket_address_new           (const gchar *path);

Creates a new GUnixSocketAddress for path.

@@ -125,35 +211,84 @@ use

g_unix_socket_address_new_abstract ()

-
GSocketAddress *    g_unix_socket_address_new_abstract  (const gchar *path,
-                                                         int path_len);
+
GSocketAddress *    g_unix_socket_address_new_abstract  (const gchar *path,
+                                                         gint path_len);
+
+

Warning

+

g_unix_socket_address_new_abstract is deprecated and should not be used in newly-written code. Use g_unix_socket_address_new_with_type().

+

-Creates a new abstract GUnixSocketAddress for path. +Creates a new G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED +GUnixSocketAddress for path.

+
++ + + + + + + + + + + + + + +

path :

the abstract name +

path_len :

the length of path, or -1 +

Returns :

a new GUnixSocketAddress + +
+
+
+
+

g_unix_socket_address_new_with_type ()

+
GSocketAddress *    g_unix_socket_address_new_with_type (const gchar *path,
+                                                         gint path_len,
+                                                         GUnixSocketAddressType type);

-Unix domain sockets are generally visible in the filesystem. However, some -systems support abstract socket name which are not visible in the -filesystem and not affected by the filesystem permissions, visibility, etc. +Creates a new GUnixSocketAddress of type type with name path.

-Note that not all systems (really only Linux) support abstract -socket names, so if you use them on other systems function calls may -return G_IO_ERROR_NOT_SUPPORTED errors. You can use -g_unix_socket_address_abstract_names_supported() to see if abstract -names are supported. +If type is G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to +calling g_unix_socket_address_new().

-If path_len is -1 then path is assumed to be a zero terminated -string (although in general abstract names need not be zero terminated -and can have embedded nuls). All bytes after path_len up to the max size -of an abstract unix domain name is filled with zero bytes. +If path_type is G_UNIX_SOCKET_ADDRESS_ABSTRACT, then path_len +bytes of path will be copied to the socket's path, and only those +bytes will be considered part of the name. (If path_len is -1, +then path is assumed to be NUL-terminated.) For example, if path +was "test", then calling g_socket_address_get_native_size() on the +returned socket would return 7 (2 bytes of overhead, 1 byte for the +abstract-socket indicator byte, and 4 bytes for the name "test"). +

+

+If path_type is G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then +path_len bytes of path will be copied to the socket's path, the +rest of the path will be padded with 0 bytes, and the entire +zero-padded buffer will be considered the name. (As above, if +path_len is -1, then path is assumed to be NUL-terminated.) In +this case, g_socket_address_get_native_size() will always return +the full size of a struct sockaddr_un, although +g_unix_socket_address_get_path_len() will still return just the +length of path. +

+

+G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over +G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course, +when connecting to a server created by another process, you must +use the appropriate type corresponding to how that process created +its listening socket.

- @@ -162,6 +297,11 @@ of an abstract unix domain name is filled with zero bytes. + + + +

path :

the abstract name +the name

type :

a GUnixSocketAddressType +

Returns :

a new GUnixSocketAddress @@ -169,15 +309,19 @@ of an abstract unix domain name is filled with zero bytes.
-

Since 2.22

+

Since 2.26


g_unix_socket_address_get_is_abstract ()

-
gboolean            g_unix_socket_address_get_is_abstract
+
gboolean            g_unix_socket_address_get_is_abstract
                                                         (GUnixSocketAddress *address);
+
+

Warning

+

g_unix_socket_address_get_is_abstract is deprecated and should not be used in newly-written code. Use g_unix_socket_address_get_address_type()

+

-Gets address's path. +Tests if address is abstract.

@@ -189,7 +333,7 @@ Gets address's path. - @@ -198,6 +342,32 @@ Gets address's path.

Since 2.22


+
+

g_unix_socket_address_get_address_type ()

+
GUnixSocketAddressType  g_unix_socket_address_get_address_type
+                                                        (GUnixSocketAddress *address);
+

+Gets address's type. +

+

Returns :

TRUE if the address is abstract, FALSE otherwise + TRUE if the address is abstract, FALSE otherwise
++ + + + + + + + + + +

address :

a GInetSocketAddress +

Returns :

a GUnixSocketAddressType + +
+

Since 2.26

+
+

g_unix_socket_address_get_path ()

const char *        g_unix_socket_address_get_path      (GUnixSocketAddress *address);
@@ -231,7 +401,7 @@ of this string.

g_unix_socket_address_get_path_len ()

-
gsize               g_unix_socket_address_get_path_len  (GUnixSocketAddress *address);
+
gsize               g_unix_socket_address_get_path_len  (GUnixSocketAddress *address);

Gets the length of address's path.

@@ -259,7 +429,7 @@ For details, see

g_unix_socket_address_abstract_names_supported ()

-
gboolean            g_unix_socket_address_abstract_names_supported
+
gboolean            g_unix_socket_address_abstract_names_supported
                                                         (void);

Checks if abstract unix domain socket names are supported. @@ -268,7 +438,7 @@ Checks if abstract unix domain socket names are supported.

Returns :

- TRUE if supported, FALSE otherwise + TRUE if supported, FALSE otherwise @@ -280,27 +450,42 @@ Checks if abstract unix domain socket names are supported.

Property Details

The "abstract" property

-
  "abstract"                 gboolean              : Read / Write / Construct Only
-

Whether or not this is an abstract address.

+
  "abstract"                 gboolean              : Read / Write / Construct Only
+
+

Warning

+

GUnixSocketAddress:abstract is deprecated and should not be used in newly-written code. Use "address-type", which +distinguishes between zero-padded and non-zero-padded +abstract addresses.

+
+

+Whether or not this is an abstract address +

Default value: FALSE


+
+

The "address-type" property

+
  "address-type"             GUnixSocketAddressType  : Read / Write / Construct Only
+

The type of UNIX socket address.

+

Default value: G_UNIX_SOCKET_ADDRESS_PATH

+
+

The "path" property

-
  "path"                     gchar*                : Read / Write / Construct Only
+
  "path"                     gchar*                : Read / Write / Construct Only

UNIX socket path.

Default value: NULL


The "path-as-array" property

-
  "path-as-array"            GByteArray*           : Read / Write / Construct Only
+
  "path-as-array"            GByteArray*           : Read / Write / Construct Only

UNIX socket path, as byte array.

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GVfs.html b/docs/reference/gio/html/GVfs.html index da41211..31e2bc7 100644 --- a/docs/reference/gio/html/GVfs.html +++ b/docs/reference/gio/html/GVfs.html @@ -3,12 +3,12 @@ GVfs - + - + @@ -52,14 +52,14 @@ const char *parse_name); GVfs * g_vfs_get_default (void); GVfs * g_vfs_get_local (void); -gboolean g_vfs_is_active (GVfs *vfs); -const gchar* const * g_vfs_get_supported_uri_schemes (GVfs *vfs); +gboolean g_vfs_is_active (GVfs *vfs); +const gchar* const * g_vfs_get_supported_uri_schemes (GVfs *vfs);

Object Hierarchy

-  GObject
+  GObject
    +----GVfs
 
@@ -112,7 +112,7 @@ Gets a GFile<

Returns :

a
GFile. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). [transfer full] @@ -147,7 +147,7 @@ is malformed or if the URI scheme is not supported.

Returns :

a GFile. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). [transfer full] @@ -179,7 +179,7 @@ be parsed by the Returns :

a
GFile for the given parse_name. - Free the returned object with g_object_unref(). + Free the returned object with g_object_unref(). [transfer full] @@ -196,7 +196,7 @@ Gets the default

Returns :

- a
GVfs. + a GVfs. [transfer none]
@@ -212,7 +212,7 @@ Gets the local

Returns :

- a
GVfs. + a GVfs. [transfer none]
@@ -220,7 +220,7 @@ Gets the local

g_vfs_is_active ()

-
gboolean            g_vfs_is_active                     (GVfs *vfs);
+
gboolean            g_vfs_is_active                     (GVfs *vfs);

Checks if the VFS is active.

@@ -234,7 +234,7 @@ Checks if the VFS is active.

Returns :

- TRUE if construction of the vfs was successful and it is now active. + TRUE if construction of the vfs was successful and it is now active. @@ -243,7 +243,7 @@ Checks if the VFS is active.

g_vfs_get_supported_uri_schemes ()

-
const gchar* const * g_vfs_get_supported_uri_schemes    (GVfs *vfs);
+
const gchar* const * g_vfs_get_supported_uri_schemes    (GVfs *vfs);

Gets a list of URI schemes supported by vfs.

@@ -257,9 +257,9 @@ Gets a list of URI schemes supported by vfs

Returns :

- a NULL-terminated array of strings. + a NULL-terminated array of strings. The returned array belongs to GIO and must - not be freed or modified. + not be freed or modified. [transfer none] @@ -269,6 +269,6 @@ Gets a list of URI schemes supported by vfs + Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GVolume.html b/docs/reference/gio/html/GVolume.html index 206deb0..a9ed044 100644 --- a/docs/reference/gio/html/GVolume.html +++ b/docs/reference/gio/html/GVolume.html @@ -3,12 +3,12 @@ GVolume - + - + @@ -53,37 +53,37 @@ GIcon * g_volume_get_icon (GVolume *volume); GDrive * g_volume_get_drive (GVolume *volume); GMount * g_volume_get_mount (GVolume *volume); -gboolean g_volume_can_mount (GVolume *volume); -gboolean g_volume_should_automount (GVolume *volume); +gboolean g_volume_can_mount (GVolume *volume); +gboolean g_volume_should_automount (GVolume *volume); GFile * g_volume_get_activation_root (GVolume *volume); void g_volume_mount (GVolume *volume, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_volume_mount_finish (GVolume *volume, + gpointer user_data); +gboolean g_volume_mount_finish (GVolume *volume, GAsyncResult *result, - GError **error); -gboolean g_volume_can_eject (GVolume *volume); + GError **error); +gboolean g_volume_can_eject (GVolume *volume); void g_volume_eject (GVolume *volume, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_volume_eject_finish (GVolume *volume, + gpointer user_data); +gboolean g_volume_eject_finish (GVolume *volume, GAsyncResult *result, - GError **error); + GError **error); void g_volume_eject_with_operation (GVolume *volume, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); -gboolean g_volume_eject_with_operation_finish + gpointer user_data); +gboolean g_volume_eject_with_operation_finish (GVolume *volume, GAsyncResult *result, - GError **error); + GError **error); #define G_VOLUME_IDENTIFIER_KIND_HAL_UDI #define G_VOLUME_IDENTIFIER_KIND_LABEL #define G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT @@ -105,7 +105,7 @@

Prerequisites

GVolume requires - GObject.

+ GObject.

Signals

@@ -119,7 +119,7 @@ GVolume requires

The GVolume interface represents user-visible objects that can be mounted. Note, when porting from GnomeVFS, GVolume is the moral -equivalent of GnomeVFSDrive. +equivalent of GnomeVFSDrive.

Mounting a GVolume instance is an asynchronous operation. For more @@ -129,7 +129,7 @@ information about asynchronous operations, see GAsyncReadyGMountOperation object and a GAsyncReadyCallback.

-Typically, one will only want to pass NULL for the +Typically, one will only want to pass NULL for the GMountOperation if automounting all volumes when a desktop session starts since it's not desirable to put up a lot of dialogs asking for credentials. @@ -240,7 +240,7 @@ Interface for implementing operations for mountable volumes. -

GTypeInterface g_iface;

+

GTypeInterface g_iface;

The parent interface. @@ -266,22 +266,22 @@ Interface for implementing operations for mountable volumes.

get_uuid ()

-Gets the UUID for the GVolume. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns NULL if there is no UUID available. +Gets the UUID for the GVolume. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns NULL if there is no UUID available.

get_drive ()

-Gets a GDrive the volume is located on. Returns NULL if the GVolume is not associated with a GDrive. +Gets a GDrive the volume is located on. Returns NULL if the GVolume is not associated with a GDrive.

get_mount ()

-Gets a GMount representing the mounted volume. Returns NULL if the GVolume is not mounted. +Gets a GMount representing the mounted volume. Returns NULL if the GVolume is not mounted.

can_mount ()

-Returns TRUE if the GVolume can be mounted. +Returns TRUE if the GVolume can be mounted. @@ -314,7 +314,7 @@ Interface for implementing operations for mountable volumes.

get_identifier ()

-Returns the identifier of the given kind, or NULL if +Returns the identifier of the given kind, or NULL if the GVolume doesn't have one. @@ -326,12 +326,12 @@ Interface for implementing operations for mountable volumes.

should_automount ()

-Returns TRUE if the GVolume should be automatically mounted. +Returns TRUE if the GVolume should be automatically mounted.

get_activation_root ()

-Returns the activation root for the GVolume if it is known in advance or NULL if +Returns the activation root for the GVolume if it is known in advance or NULL if it is not known. @@ -366,7 +366,7 @@ Gets the name of volume.

Returns :

the name for the given volume. The returned string should -be freed with g_free() when no longer needed. +be freed with g_free() when no longer needed. @@ -379,7 +379,7 @@ be freed with volume
. The reference is typically based on the file system UUID for the volume in question and should be -considered an opaque string. Returns NULL if there is no UUID +considered an opaque string. Returns NULL if there is no UUID available.

@@ -392,8 +392,8 @@ available. - @@ -418,8 +418,8 @@ Gets the icon for volume. @@ -442,9 +442,9 @@ Gets the drive for the volume. - @@ -467,9 +467,9 @@ Gets the mount for the volume. - @@ -478,7 +478,7 @@ Gets the mount for the volume.

g_volume_can_mount ()

-
gboolean            g_volume_can_mount                  (GVolume *volume);
+
gboolean            g_volume_can_mount                  (GVolume *volume);

Checks if a volume can be mounted.

@@ -492,7 +492,7 @@ Checks if a volume can be mounted.
- @@ -501,7 +501,7 @@ Checks if a volume can be mounted.

g_volume_should_automount ()

-
gboolean            g_volume_should_automount           (GVolume *volume);
+
gboolean            g_volume_should_automount           (GVolume *volume);

Returns whether the volume should be automatically mounted.

@@ -515,7 +515,7 @@ Returns whether the volume should be automatically mounted.
- @@ -527,7 +527,7 @@ Returns whether the volume should be automatically mounted.
GFile *             g_volume_get_activation_root        (GVolume *volume);

Gets the activation root for a GVolume if it is known ahead of -mount time. Returns NULL otherwise. If not NULL and if volume +mount time. Returns NULL otherwise. If not NULL and if volume is mounted, then the result of g_mount_get_root() on the GMount object obtained from g_volume_get_mount() will always either be equal or a prefix of what this function returns. In @@ -558,7 +558,7 @@ then the expression

-will always be TRUE. +will always be TRUE.

Activation roots are typically used in GVolumeMonitor @@ -575,9 +575,8 @@ implementations to find the underlying mount to shadow, see

- @@ -592,12 +591,15 @@ implementations to find the underlying mount to shadow, see GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Mounts a volume. This is an asynchronous operation, and is finished by calling g_volume_mount_finish() with the volume and GAsyncResult returned in the callback.

+

+Virtual: mount_fn +

Returns :

the UUID for volume or NULL if no UUID can be computed. - The returned string should be freed with g_free() + the UUID for volume or NULL if no UUID can be computed. + The returned string should be freed with g_free() when no longer needed.

Returns :

a GIcon. - The returned object should be unreffed with g_object_unref() - when no longer needed. + The returned object should be unreffed with g_object_unref() + when no longer needed. [transfer full]

Returns :

a GDrive or NULL if volume is not associated with a drive. - The returned object should be unreffed with g_object_unref() - when no longer needed. + a GDrive or NULL if volume is not associated with a drive. + The returned object should be unreffed with g_object_unref() + when no longer needed. [transfer full]

Returns :

a GMount or NULL if volume isn't mounted. - The returned object should be unreffed with g_object_unref() - when no longer needed. + a GMount or NULL if volume isn't mounted. + The returned object should be unreffed with g_object_unref() + when no longer needed. [transfer full]

Returns :

TRUE if the volume can be mounted. FALSE otherwise. + TRUE if the volume can be mounted. FALSE otherwise.

Returns :

TRUE if the volume should be automatically mounted. + TRUE if the volume should be automatically mounted.

Returns :

the activation root of volume or NULL. Use -g_object_unref() to free. - + the activation root of volume or NULL. Use +g_object_unref() to free. [transfer full]
@@ -613,17 +615,17 @@ and mount_operation :

-
- - @@ -637,12 +639,12 @@ and

g_volume_mount_finish ()

-
gboolean            g_volume_mount_finish               (GVolume *volume,
+
gboolean            g_volume_mount_finish               (GVolume *volume,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes mounting a volume. If any errors occured during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

If the mount operation succeeded, g_volume_get_mount() on volume @@ -665,12 +667,12 @@ function; there's no need to listen for the 'mount-added' signal on

- - @@ -679,7 +681,7 @@ function; there's no need to listen for the 'mount-added' signal on

g_volume_can_eject ()

-
gboolean            g_volume_can_eject                  (GVolume *volume);
+
gboolean            g_volume_can_eject                  (GVolume *volume);

Checks if a volume can be ejected.

@@ -693,7 +695,7 @@ Checks if a volume can be ejected.
- @@ -706,7 +708,7 @@ Checks if a volume can be ejected. GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Warning

g_volume_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation() instead.

@@ -731,12 +733,12 @@ and cancellable :

-
- @@ -750,16 +752,16 @@ and

g_volume_eject_finish ()

-
gboolean            g_volume_eject_finish               (GVolume *volume,
+
gboolean            g_volume_eject_finish               (GVolume *volume,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Warning

g_volume_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation_finish() instead.

Finishes ejecting a volume. If any errors occured during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

a GMountOperation or NULL to avoid user interaction. + a GMountOperation or NULL to avoid user interaction. [allow-none]

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.

error :

a GError location to store an error, or NULL to ignore +a GError location to store an error, or NULL to ignore

Returns :

TRUE, FALSE if operation failed. + TRUE, FALSE if operation failed.

Returns :

TRUE if the volume can be ejected. FALSE otherwise. + TRUE if the volume can be ejected. FALSE otherwise.
optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -776,12 +778,12 @@ Finishes ejecting a volume. If any errors occured during the operation, - - @@ -796,7 +798,7 @@ Finishes ejecting a volume. If any errors occured during the operation, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data); + gpointer user_data);

Ejects a volume. This is an asynchronous operation, and is finished by calling g_volume_eject_with_operation_finish() with the volume @@ -817,17 +819,17 @@ and mount_operation :

- - - @@ -842,13 +844,13 @@ and

g_volume_eject_with_operation_finish ()

-
gboolean            g_volume_eject_with_operation_finish
+
gboolean            g_volume_eject_with_operation_finish
                                                         (GVolume *volume,
                                                          GAsyncResult *result,
-                                                         GError **error);
+ GError **error);

Finishes ejecting a volume. If any errors occurred during the operation, -error will be set to contain the errors and FALSE will be returned. +error will be set to contain the errors and FALSE will be returned.

error :

a GError location to store an error, or NULL to ignore +a GError location to store an error, or NULL to ignore

Returns :

TRUE, FALSE if operation failed. + TRUE, FALSE if operation failed.
a GMountOperation or NULL to avoid user interaction. +a GMountOperation or NULL to avoid user interaction.

cancellable :

optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore.

callback :

a GAsyncReadyCallback, or NULL. +a GAsyncReadyCallback, or NULL.
@@ -865,13 +867,13 @@ Finishes ejecting a volume. If any errors occurred during the operation, - - @@ -943,8 +945,8 @@ the identifiers themselves. - @@ -976,7 +978,7 @@ for more information about volume identifiers. @@ -989,7 +991,7 @@ for more information about volume identifiers.

The "changed" signal

void                user_function                      (GVolume *arg0,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the volume has been changed.

@@ -1005,7 +1007,7 @@ Emitted when the volume has been changed.

The "removed" signal

void                user_function                      (GVolume *arg0,
-                                                        gpointer user_data)      : Run Last
+ gpointer user_data) : Run Last

This signal is emitted when the GVolume have been removed. If the recipient is holding references to the object they should @@ -1023,6 +1025,6 @@ release them so the object can be finalized.

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GVolumeMonitor.html b/docs/reference/gio/html/GVolumeMonitor.html index d8da455..e6591ab 100644 --- a/docs/reference/gio/html/GVolumeMonitor.html +++ b/docs/reference/gio/html/GVolumeMonitor.html @@ -3,12 +3,12 @@ GVolumeMonitor - + - + @@ -47,10 +47,10 @@ GVolumeMonitor; #define G_VOLUME_MONITOR_EXTENSION_POINT_NAMEGVolumeMonitor * g_volume_monitor_get (void); -GList * g_volume_monitor_get_connected_drives +GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor); -GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor); -GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor); +GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor); +GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor); GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount); GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor, const char *uuid); @@ -62,7 +62,7 @@

Object Hierarchy

-  GObject
+  GObject
    +----GVolumeMonitor
 
@@ -104,10 +104,6 @@ thread, with no thread-default-context active.

A Volume Monitor that watches for volume events.

-

error :

a GError location to store the error occuring, or NULL to +a GError location to store the error occuring, or NULL to ignore.

Returns :

TRUE if the volume was successfully ejected. FALSE otherwise. + TRUE if the volume was successfully ejected. FALSE otherwise.

Returns :

a NULL-terminated array of strings containing - kinds of identifiers. Use g_strfreev() to free. + a NULL-terminated array + of strings containing kinds of identifiers. Use g_strfreev() to free. [array zero-terminated=1][transfer full zero-terminated=1]

Returns :

a newly allocated string containing the - requested identfier, or NULL if the GVolume + requested identfier, or NULL if the GVolume doesn't have this kind of identifier
-- -

@@ -131,7 +127,7 @@ Gets the volume monitor used by gio.

Returns :

a reference to the GVolumeMonitor used by gio. Call - g_object_unref() when done with it. + g_object_unref() when done with it. [transfer full]
@@ -139,14 +135,14 @@ Gets the volume monitor used by gio.

g_volume_monitor_get_connected_drives ()

-
GList *             g_volume_monitor_get_connected_drives
+
GList *             g_volume_monitor_get_connected_drives
                                                         (GVolumeMonitor *volume_monitor);

Gets a list of drives connected to the system.

-The returned list should be freed with g_list_free(), after -its elements have been unreffed with g_object_unref(). +The returned list should be freed with g_list_free(), after +its elements have been unreffed with g_object_unref().

@@ -158,7 +154,7 @@ its elements have been unreffed with Returns :

-
@@ -167,13 +163,13 @@ its elements have been unreffed with

g_volume_monitor_get_volumes ()

-
GList *             g_volume_monitor_get_volumes        (GVolumeMonitor *volume_monitor);
+
GList *             g_volume_monitor_get_volumes        (GVolumeMonitor *volume_monitor);

Gets a list of the volumes on the system.

-The returned list should be freed with g_list_free(), after -its elements have been unreffed with g_object_unref(). +The returned list should be freed with g_list_free(), after +its elements have been unreffed with g_object_unref().

a GList of connected GDrive objects. + a GList of connected GDrive objects. [element-type GDrive][transfer full GDrive]
@@ -185,7 +181,7 @@ its elements have been unreffed with Returns :

-
@@ -194,13 +190,13 @@ its elements have been unreffed with

g_volume_monitor_get_mounts ()

-
GList *             g_volume_monitor_get_mounts         (GVolumeMonitor *volume_monitor);
+
GList *             g_volume_monitor_get_mounts         (GVolumeMonitor *volume_monitor);

Gets a list of the mounts on the system.

-The returned list should be freed with g_list_free(), after -its elements have been unreffed with g_object_unref(). +The returned list should be freed with g_list_free(), after +its elements have been unreffed with g_object_unref().

a GList of GVolume objects. + a GList of GVolume objects. [element-type GVolume][transfer full GVolume]
@@ -212,7 +208,7 @@ its elements have been unreffed with Returns :

-
@@ -237,7 +233,7 @@ associated with a mount_added signal.

-If the return value is not NULL, the caller must associate the +If the return value is not NULL, the caller must associate the returned GVolume object with the GMount. This involves returning it in its g_mount_get_volume() implementation. The caller must also listen for the "removed" signal on the returned object @@ -275,9 +271,8 @@ is to return Returns :

- @@ -306,8 +301,8 @@ Finds a GMo - @@ -337,8 +332,8 @@ Finds a G - @@ -351,7 +346,7 @@ Finds a G

The "drive-changed" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GDrive         *drive,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a drive changes.

@@ -380,7 +375,7 @@ Emitted when a drive changes.

The "drive-connected" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GDrive         *drive,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a drive is connected to the system.

@@ -409,7 +404,7 @@ Emitted when a drive is connected to the system.

The "drive-disconnected" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GDrive         *drive,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a drive is disconnected from the system.

@@ -438,7 +433,7 @@ Emitted when a drive is disconnected from the system.

The "drive-eject-button" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GDrive         *drive,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when the eject button is pressed on drive.

@@ -468,7 +463,7 @@ Emitted when the eject button is pressed on drive

The "drive-stop-button" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GDrive         *drive,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when the stop button is pressed on drive.

@@ -498,7 +493,7 @@ Emitted when the stop button is pressed on drive

The "mount-added" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GMount         *mount,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mount is added.

@@ -527,7 +522,7 @@ Emitted when a mount is added.

The "mount-changed" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GMount         *mount,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mount changes.

@@ -556,7 +551,7 @@ Emitted when a mount changes.

The "mount-pre-unmount" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GMount         *mount,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mount is about to be removed.

@@ -585,7 +580,7 @@ Emitted when a mount is about to be removed.

The "mount-removed" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GMount         *mount,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mount is removed.

@@ -614,7 +609,7 @@ Emitted when a mount is removed.

The "volume-added" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GVolume        *volume,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mountable volume is added to the system.

@@ -643,7 +638,7 @@ Emitted when a mountable volume is added to the system.

The "volume-changed" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GVolume        *volume,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when mountable volume is changed.

@@ -672,7 +667,7 @@ Emitted when mountable volume is changed.

The "volume-removed" signal

void                user_function                      (GVolumeMonitor *volume_monitor,
                                                         GVolume        *volume,
-                                                        gpointer        user_data)           : Run Last
+ gpointer user_data) : Run Last

Emitted when a mountable volume is removed from the system.

@@ -704,6 +699,6 @@ Emitted when a mountable volume is removed from the system. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/GZlibCompressor.html b/docs/reference/gio/html/GZlibCompressor.html index 7dbe574..ae7879f 100644 --- a/docs/reference/gio/html/GZlibCompressor.html +++ b/docs/reference/gio/html/GZlibCompressor.html @@ -3,12 +3,12 @@ GZlibCompressor - + - + @@ -50,12 +50,15 @@ enum GZlibCompressorFormat; GZlibCompressor * g_zlib_compressor_new (GZlibCompressorFormat format, int level); +GFileInfo * g_zlib_compressor_get_file_info (GZlibCompressor *compressor); +void g_zlib_compressor_set_file_info (GZlibCompressor *compressor, + GFileInfo *file_info);

Object Hierarchy

-  GObject
+  GObject
    +----GZlibCompressor
 
@@ -68,8 +71,9 @@ GZlibCompressor implements

Properties

+  "file-info"                GFileInfo*            : Read / Write
   "format"                   GZlibCompressorFormat  : Read / Write / Construct Only
-  "level"                    gint                  : Read / Write / Construct Only
+  "level"                    gint                  : Read / Write / Construct Only
 
@@ -154,9 +158,77 @@ Creates a new Since 2.24

+
+
+

g_zlib_compressor_get_file_info ()

+
GFileInfo *         g_zlib_compressor_get_file_info     (GZlibCompressor *compressor);
+

+Returns the "file-info" property. +

+
a GList of GMount objects. + a GList of GMount objects. [element-type GMount][transfer full GMount]
the GVolume object that is the parent for mount or NULL -if no wants to adopt the GMount. - + the GVolume object that is the parent for mount or NULL +if no wants to adopt the GMount. [transfer full]

Returns :

a GMount or NULL if no such mount is available. - Free the returned object with g_object_unref(). + a GMount or NULL if no such mount is available. + Free the returned object with g_object_unref(). [transfer full]

Returns :

a GVolume or NULL if no such volume is available. - Free the returned object with g_object_unref(). + a GVolume or NULL if no such volume is available. + Free the returned object with g_object_unref(). [transfer full]
++ + + + + + + + + + +

compressor :

a GZlibCompressor +

Returns :

a GFileInfo, or NULL. [transfer none] +
+

Since 2.26

+
+
+
+

g_zlib_compressor_set_file_info ()

+
void                g_zlib_compressor_set_file_info     (GZlibCompressor *compressor,
+                                                         GFileInfo *file_info);
+

+Sets file_info in compressor. If non-NULL, and compressor's +"format" property is G_ZLIB_COMPRESSOR_FORMAT_GZIP, +it will be used to set the file name and modification time in +the GZIP header of the compressed data. +

+

+Note: it is an error to call this function while a compression is in +progress; it may only be called immediately after creation of compressor, +or after resetting it with g_converter_reset(). +

+
++ + + + + + + + + + +

compressor :

a GZlibCompressor +

file_info :

a GFileInfo. [allow-none] +
+

Since 2.26

+

Property Details

+
+

The "file-info" property

+
  "file-info"                GFileInfo*            : Read / Write
+

+If set to a non-NULL GFileInfo object, and "format" is +G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name +and modification time from the file info to the the GZIP header. +

+

Since 2.26

+
+

The "format" property

  "format"                   GZlibCompressorFormat  : Read / Write / Construct Only
@@ -166,7 +238,7 @@ Creates a new

The "level" property

-
  "level"                    gint                  : Read / Write / Construct Only
+
  "level"                    gint                  : Read / Write / Construct Only

The level of compression from 0 (no compression) to 9 (most compression), -1 for the default level.

Allowed values: [G_MAXULONG,9]

Default value: -1

@@ -175,6 +247,6 @@ Creates a new
- Generated by GTK-Doc V1.14
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/GZlibDecompressor.html b/docs/reference/gio/html/GZlibDecompressor.html index 957843d..cc2c635 100644 --- a/docs/reference/gio/html/GZlibDecompressor.html +++ b/docs/reference/gio/html/GZlibDecompressor.html @@ -3,12 +3,12 @@ GZlibDecompressor - + - + @@ -48,12 +48,13 @@ GZlibDecompressor; GZlibDecompressor * g_zlib_decompressor_new (GZlibCompressorFormat format); +GFileInfo * g_zlib_decompressor_get_file_info (GZlibDecompressor *decompressor);

Object Hierarchy

-  GObject
+  GObject
    +----GZlibDecompressor
 
@@ -66,6 +67,7 @@ GZlibDecompressor implements

Properties

+  "file-info"                GFileInfo*            : Read
   "format"                   GZlibCompressorFormat  : Read / Write / Construct Only
 
@@ -110,9 +112,49 @@ Creates a new Since 2.24

+
+
+

g_zlib_decompressor_get_file_info ()

+
GFileInfo *         g_zlib_decompressor_get_file_info   (GZlibDecompressor *decompressor);
+

+Retrieves the GFileInfo constructed from the GZIP header data +of compressed data processed by compressor, or NULL if decompressor's +"format" property is not G_ZLIB_COMPRESSOR_FORMAT_GZIP, +or the header data was not fully processed yet, or it not present in the +data stream at all. +

+
++ + + + + + + + + + +

decompressor :

a GZlibDecompressor +

Returns :

a GFileInfo, or NULL. [transfer none] +
+

Since 2.26

+

Property Details

+
+

The "file-info" property

+
  "file-info"                GFileInfo*            : Read
+

+A GFileInfo containing the information found in the GZIP header +of the data stream processed, or NULL if the header was not yet +fully processed, is not present at all, or the compressor's +"format" property is not G_ZLIB_COMPRESSOR_FORMAT_GZIP. +

+

Since 2.26

+
+

The "format" property

  "format"                   GZlibCompressorFormat  : Read / Write / Construct Only
@@ -123,6 +165,6 @@ Creates a new
- Generated by GTK-Doc V1.14
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/annotation-glossary.html b/docs/reference/gio/html/annotation-glossary.html new file mode 100644 index 0000000..6ed26b4 --- /dev/null +++ b/docs/reference/gio/html/annotation-glossary.html @@ -0,0 +1,80 @@ + + + + +Annotation Glossary + + + + + + + + + + + + + + + + + + +
+

+Annotation Glossary

+

O

+
+out
+

Parameter for returning results. Default is transfer full.

+

S

+
+scope async
+

The callback is valid until first called.

+

A

+
+allow-none
+

NULL is ok, both for passing and for returning.

+

T

+
+transfer none
+

Don't free data after the code is done.

+

A

+
+array
+

Parameter points to an array of items.

+

E

+
+element-type
+

Generics and defining elements of containers and arrays.

+

T

+
+transfer full
+

Free data after the code is done.

+

S

+
+scope call
+

The callback is valid only during the call to the method.

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/api-index-2-18.html b/docs/reference/gio/html/api-index-2-18.html index 35fd3cb..4f66894 100644 --- a/docs/reference/gio/html/api-index-2-18.html +++ b/docs/reference/gio/html/api-index-2-18.html @@ -3,12 +3,12 @@ Index of new symbols in 2.18 - + - + @@ -52,7 +52,7 @@

D

-g_desktop_app_info_new_from_keyfile, function in Desktop file based GAppInfo +g_desktop_app_info_new_from_keyfile, function in Desktop file based GAppInfo

E

@@ -148,6 +148,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/api-index-2-20.html b/docs/reference/gio/html/api-index-2-20.html index 1868c7d..ed66c41 100644 --- a/docs/reference/gio/html/api-index-2-20.html +++ b/docs/reference/gio/html/api-index-2-20.html @@ -3,12 +3,12 @@ Index of new symbols in 2.20 - + - + @@ -31,6 +31,8 @@  |  M  |  + S +  |  U @@ -106,6 +108,11 @@ g_mount_unshadow, function in GMount
+

S

+
+g_simple_async_result_is_valid, function in GSimpleAsyncResult +
+

U

GUnixInputStream:close-fd, object property in GUnixInputStream @@ -150,6 +157,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/api-index-2-22.html b/docs/reference/gio/html/api-index-2-22.html index ea345b7..839507e 100644 --- a/docs/reference/gio/html/api-index-2-22.html +++ b/docs/reference/gio/html/api-index-2-22.html @@ -3,12 +3,12 @@ Index of new symbols in 2.22 - + - + @@ -1003,15 +1003,15 @@

T

-GTcpConnection, struct in GSocketConnection +GTcpConnection, struct in GTcpConnection
-g_tcp_connection_get_graceful_disconnect, function in GSocketConnection +g_tcp_connection_get_graceful_disconnect, function in GTcpConnection
-g_tcp_connection_set_graceful_disconnect, function in GSocketConnection +g_tcp_connection_set_graceful_disconnect, function in GTcpConnection
@@ -1024,11 +1024,11 @@

U

-g_unix_connection_receive_fd, function in GSocketConnection +g_unix_connection_receive_fd, function in GUnixConnection
-g_unix_connection_send_fd, function in GSocketConnection +g_unix_connection_send_fd, function in GUnixConnection
@@ -1063,10 +1063,6 @@ g_unix_socket_address_new, function in GUnixSocketAddress
-
-g_unix_socket_address_new_abstract, function in GUnixSocketAddress -
-

V

GVolumeMonitor::drive-stop-button, object signal in GVolumeMonitor @@ -1083,6 +1079,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/api-index-2-24.html b/docs/reference/gio/html/api-index-2-24.html index 3ae9469..2a27d6f 100644 --- a/docs/reference/gio/html/api-index-2-24.html +++ b/docs/reference/gio/html/api-index-2-24.html @@ -3,11 +3,12 @@ Index of new symbols in 2.24 - + - + + @@ -17,7 +18,7 @@   Home GIO Reference Manual -  +Next A @@ -71,6 +72,10 @@
+GConverterFlags, enum in GConverter +
+
+
GConverterIface, struct in GConverter
@@ -96,7 +101,19 @@

D

-g_desktop_app_info_get_filename, function in Desktop file based GAppInfo +g_data_input_stream_read_upto, function in GDataInputStream +
+
+
+g_data_input_stream_read_upto_async, function in GDataInputStream +
+
+
+g_data_input_stream_read_upto_finish, function in GDataInputStream +
+
+
+g_desktop_app_info_get_filename, function in Desktop file based GAppInfo

F

@@ -201,6 +218,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/api-index-2-26.html b/docs/reference/gio/html/api-index-2-26.html new file mode 100644 index 0000000..e799681 --- /dev/null +++ b/docs/reference/gio/html/api-index-2-26.html @@ -0,0 +1,1637 @@ + + + + +Index of new symbols in 2.26 + + + + + + + + + + + + + + + + + + + +
+

+Index of new symbols in 2.26

+

A

+
+GApplication, struct in GApplication +
+
+
+GApplicationClass, struct in GApplication +
+
+
+GApplicationCommandLine, struct in GApplicationCommandLine +
+
+
+GApplicationCommandLineClass, struct in GApplicationCommandLine +
+
+
+GApplicationFlags, enum in GApplication +
+
+

B

+
+GBusAcquiredCallback, user_function in Owning Bus Names +
+
+
+GBusNameAcquiredCallback, user_function in Owning Bus Names +
+
+
+GBusNameAppearedCallback, user_function in Watching Bus Names +
+
+
+GBusNameLostCallback, user_function in Owning Bus Names +
+
+
+GBusNameOwnerFlags, enum in Owning Bus Names +
+
+
+GBusNameVanishedCallback, user_function in Watching Bus Names +
+
+
+GBusNameWatcherFlags, enum in Watching Bus Names +
+
+
+GBusType, enum in GDBusConnection +
+
+
+g_bus_get, function in GDBusConnection +
+
+
+g_bus_get_finish, function in GDBusConnection +
+
+
+g_bus_get_sync, function in GDBusConnection +
+
+
+g_bus_own_name, function in Owning Bus Names +
+
+
+g_bus_own_name_on_connection, function in Owning Bus Names +
+
+
+g_bus_own_name_on_connection_with_closures, function in Owning Bus Names +
+
+
+g_bus_own_name_with_closures, function in Owning Bus Names +
+
+
+g_bus_unown_name, function in Owning Bus Names +
+
+
+g_bus_unwatch_name, function in Watching Bus Names +
+
+
+g_bus_watch_name, function in Watching Bus Names +
+
+
+g_bus_watch_name_on_connection, function in Watching Bus Names +
+
+
+g_bus_watch_name_on_connection_with_closures, function in Watching Bus Names +
+
+
+g_bus_watch_name_with_closures, function in Watching Bus Names +
+
+

C

+
+GCredentials, struct in GCredentials +
+
+
+GCredentialsType, enum in GCredentials +
+
+
+g_credentials_get_native, function in GCredentials +
+
+
+g_credentials_get_unix_user, function in GCredentials +
+
+
+g_credentials_is_same_user, function in GCredentials +
+
+
+g_credentials_new, function in GCredentials +
+
+
+g_credentials_set_native, function in GCredentials +
+
+
+g_credentials_set_unix_user, function in GCredentials +
+
+
+g_credentials_to_string, function in GCredentials +
+
+

D

+
+GDBusAnnotationInfo, struct in D-Bus Introspection Data +
+
+
+GDBusArgInfo, struct in D-Bus Introspection Data +
+
+
+GDBusAuthObserver, struct in GDBusAuthObserver +
+
+
+GDBusAuthObserver::authorize-authenticated-peer, object signal in GDBusAuthObserver +
+
+
+GDBusCallFlags, enum in GDBusConnection +
+
+
+GDBusCapabilityFlags, enum in GDBusConnection +
+
+
+GDBusConnection, struct in GDBusConnection +
+
+
+GDBusConnection::closed, object signal in GDBusConnection +
+
+
+GDBusConnection:address, object property in GDBusConnection +
+
+
+GDBusConnection:authentication-observer, object property in GDBusConnection +
+
+
+GDBusConnection:capabilities, object property in GDBusConnection +
+
+
+GDBusConnection:closed, object property in GDBusConnection +
+
+
+GDBusConnection:exit-on-close, object property in GDBusConnection +
+
+
+GDBusConnection:flags, object property in GDBusConnection +
+
+
+GDBusConnection:guid, object property in GDBusConnection +
+
+
+GDBusConnection:stream, object property in GDBusConnection +
+
+
+GDBusConnection:unique-name, object property in GDBusConnection +
+
+
+GDBusConnectionFlags, enum in GDBusConnection +
+
+
+GDBusError, enum in GDBusError +
+
+
+GDBusErrorEntry, struct in GDBusError +
+
+
+GDBusInterfaceGetPropertyFunc, user_function in GDBusConnection +
+
+
+GDBusInterfaceInfo, struct in D-Bus Introspection Data +
+
+
+GDBusInterfaceMethodCallFunc, user_function in GDBusConnection +
+
+
+GDBusInterfaceSetPropertyFunc, user_function in GDBusConnection +
+
+
+GDBusInterfaceVTable, struct in GDBusConnection +
+
+
+GDBusMessage, struct in GDBusMessage +
+
+
+GDBusMessageByteOrder, enum in GDBusMessage +
+
+
+GDBusMessageFilterFunction, user_function in GDBusConnection +
+
+
+GDBusMessageFlags, enum in GDBusMessage +
+
+
+GDBusMessageHeaderField, enum in GDBusMessage +
+
+
+GDBusMessageType, enum in GDBusMessage +
+
+
+GDBusMethodInfo, struct in D-Bus Introspection Data +
+
+
+GDBusMethodInvocation, struct in GDBusMethodInvocation +
+
+
+GDBusNodeInfo, struct in D-Bus Introspection Data +
+
+
+GDBusPropertyInfo, struct in D-Bus Introspection Data +
+
+
+GDBusPropertyInfoFlags, enum in D-Bus Introspection Data +
+
+
+GDBusProxy, struct in GDBusProxy +
+
+
+GDBusProxy::g-properties-changed, object signal in GDBusProxy +
+
+
+GDBusProxy::g-signal, object signal in GDBusProxy +
+
+
+GDBusProxy:g-bus-type, object property in GDBusProxy +
+
+
+GDBusProxy:g-connection, object property in GDBusProxy +
+
+
+GDBusProxy:g-default-timeout, object property in GDBusProxy +
+
+
+GDBusProxy:g-flags, object property in GDBusProxy +
+
+
+GDBusProxy:g-interface-info, object property in GDBusProxy +
+
+
+GDBusProxy:g-interface-name, object property in GDBusProxy +
+
+
+GDBusProxy:g-name, object property in GDBusProxy +
+
+
+GDBusProxy:g-name-owner, object property in GDBusProxy +
+
+
+GDBusProxy:g-object-path, object property in GDBusProxy +
+
+
+GDBusProxyClass, struct in GDBusProxy +
+
+
+GDBusProxyFlags, enum in GDBusProxy +
+
+
+GDBusSendMessageFlags, enum in GDBusConnection +
+
+
+GDBusServer, struct in GDBusServer +
+
+
+GDBusServer::new-connection, object signal in GDBusServer +
+
+
+GDBusServer:active, object property in GDBusServer +
+
+
+GDBusServer:address, object property in GDBusServer +
+
+
+GDBusServer:authentication-observer, object property in GDBusServer +
+
+
+GDBusServer:client-address, object property in GDBusServer +
+
+
+GDBusServer:flags, object property in GDBusServer +
+
+
+GDBusServer:guid, object property in GDBusServer +
+
+
+GDBusServerFlags, enum in GDBusServer +
+
+
+GDBusSignalCallback, user_function in GDBusConnection +
+
+
+GDBusSignalFlags, enum in GDBusConnection +
+
+
+GDBusSignalInfo, struct in D-Bus Introspection Data +
+
+
+GDBusSubtreeDispatchFunc, user_function in GDBusConnection +
+
+
+GDBusSubtreeEnumerateFunc, user_function in GDBusConnection +
+
+
+GDBusSubtreeFlags, enum in GDBusConnection +
+
+
+GDBusSubtreeIntrospectFunc, user_function in GDBusConnection +
+
+
+GDBusSubtreeVTable, struct in GDBusConnection +
+
+
+g_dbus_address_get_for_bus_sync, function in D-Bus Addresses +
+
+
+g_dbus_address_get_stream, function in D-Bus Addresses +
+
+
+g_dbus_address_get_stream_finish, function in D-Bus Addresses +
+
+
+g_dbus_address_get_stream_sync, function in D-Bus Addresses +
+
+
+g_dbus_annotation_info_lookup, function in D-Bus Introspection Data +
+
+
+g_dbus_annotation_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_annotation_info_unref, function in D-Bus Introspection Data +
+
+
+g_dbus_arg_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_arg_info_unref, function in D-Bus Introspection Data +
+
+
+g_dbus_auth_observer_authorize_authenticated_peer, function in GDBusAuthObserver +
+
+
+g_dbus_auth_observer_new, function in GDBusAuthObserver +
+
+
+g_dbus_connection_add_filter, function in GDBusConnection +
+
+
+g_dbus_connection_call, function in GDBusConnection +
+
+
+g_dbus_connection_call_finish, function in GDBusConnection +
+
+
+g_dbus_connection_call_sync, function in GDBusConnection +
+
+
+g_dbus_connection_close, function in GDBusConnection +
+
+
+g_dbus_connection_close_finish, function in GDBusConnection +
+
+
+g_dbus_connection_close_sync, function in GDBusConnection +
+
+
+g_dbus_connection_emit_signal, function in GDBusConnection +
+
+
+g_dbus_connection_flush, function in GDBusConnection +
+
+
+g_dbus_connection_flush_finish, function in GDBusConnection +
+
+
+g_dbus_connection_flush_sync, function in GDBusConnection +
+
+
+g_dbus_connection_get_capabilities, function in GDBusConnection +
+
+
+g_dbus_connection_get_exit_on_close, function in GDBusConnection +
+
+
+g_dbus_connection_get_guid, function in GDBusConnection +
+
+
+g_dbus_connection_get_peer_credentials, function in GDBusConnection +
+
+
+g_dbus_connection_get_stream, function in GDBusConnection +
+
+
+g_dbus_connection_get_unique_name, function in GDBusConnection +
+
+
+g_dbus_connection_is_closed, function in GDBusConnection +
+
+
+g_dbus_connection_new, function in GDBusConnection +
+
+
+g_dbus_connection_new_finish, function in GDBusConnection +
+
+
+g_dbus_connection_new_for_address, function in GDBusConnection +
+
+
+g_dbus_connection_new_for_address_finish, function in GDBusConnection +
+
+
+g_dbus_connection_new_for_address_sync, function in GDBusConnection +
+
+
+g_dbus_connection_new_sync, function in GDBusConnection +
+
+
+g_dbus_connection_register_object, function in GDBusConnection +
+
+
+g_dbus_connection_register_subtree, function in GDBusConnection +
+
+
+g_dbus_connection_remove_filter, function in GDBusConnection +
+
+
+g_dbus_connection_send_message, function in GDBusConnection +
+
+
+g_dbus_connection_send_message_with_reply, function in GDBusConnection +
+
+
+g_dbus_connection_send_message_with_reply_finish, function in GDBusConnection +
+
+
+g_dbus_connection_send_message_with_reply_sync, function in GDBusConnection +
+
+
+g_dbus_connection_set_exit_on_close, function in GDBusConnection +
+
+
+g_dbus_connection_signal_subscribe, function in GDBusConnection +
+
+
+g_dbus_connection_signal_unsubscribe, function in GDBusConnection +
+
+
+g_dbus_connection_start_message_processing, function in GDBusConnection +
+
+
+g_dbus_connection_unregister_object, function in GDBusConnection +
+
+
+g_dbus_connection_unregister_subtree, function in GDBusConnection +
+
+
+G_DBUS_ERROR, macro in GDBusError +
+
+
+g_dbus_error_encode_gerror, function in GDBusError +
+
+
+g_dbus_error_get_remote_error, function in GDBusError +
+
+
+g_dbus_error_is_remote_error, function in GDBusError +
+
+
+g_dbus_error_new_for_dbus_error, function in GDBusError +
+
+
+g_dbus_error_register_error, function in GDBusError +
+
+
+g_dbus_error_register_error_domain, function in GDBusError +
+
+
+g_dbus_error_set_dbus_error, function in GDBusError +
+
+
+g_dbus_error_set_dbus_error_valist, function in GDBusError +
+
+
+g_dbus_error_strip_remote_error, function in GDBusError +
+
+
+g_dbus_error_unregister_error, function in GDBusError +
+
+
+g_dbus_generate_guid, function in D-Bus Utilities +
+
+
+g_dbus_interface_info_generate_xml, function in D-Bus Introspection Data +
+
+
+g_dbus_interface_info_lookup_method, function in D-Bus Introspection Data +
+
+
+g_dbus_interface_info_lookup_property, function in D-Bus Introspection Data +
+
+
+g_dbus_interface_info_lookup_signal, function in D-Bus Introspection Data +
+
+
+g_dbus_interface_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_interface_info_unref, function in D-Bus Introspection Data +
+
+
+g_dbus_is_address, function in D-Bus Addresses +
+
+
+g_dbus_is_guid, function in D-Bus Utilities +
+
+
+g_dbus_is_interface_name, function in D-Bus Utilities +
+
+
+g_dbus_is_member_name, function in D-Bus Utilities +
+
+
+g_dbus_is_name, function in D-Bus Utilities +
+
+
+g_dbus_is_supported_address, function in D-Bus Addresses +
+
+
+g_dbus_is_unique_name, function in D-Bus Utilities +
+
+
+g_dbus_message_bytes_needed, function in GDBusMessage +
+
+
+g_dbus_message_copy, function in GDBusMessage +
+
+
+g_dbus_message_get_arg0, function in GDBusMessage +
+
+
+g_dbus_message_get_body, function in GDBusMessage +
+
+
+g_dbus_message_get_destination, function in GDBusMessage +
+
+
+g_dbus_message_get_error_name, function in GDBusMessage +
+
+
+g_dbus_message_get_flags, function in GDBusMessage +
+
+
+g_dbus_message_get_header, function in GDBusMessage +
+
+
+g_dbus_message_get_header_fields, function in GDBusMessage +
+
+
+g_dbus_message_get_interface, function in GDBusMessage +
+
+
+g_dbus_message_get_locked, function in GDBusMessage +
+
+
+g_dbus_message_get_member, function in GDBusMessage +
+
+
+g_dbus_message_get_message_type, function in GDBusMessage +
+
+
+g_dbus_message_get_num_unix_fds, function in GDBusMessage +
+
+
+g_dbus_message_get_path, function in GDBusMessage +
+
+
+g_dbus_message_get_reply_serial, function in GDBusMessage +
+
+
+g_dbus_message_get_sender, function in GDBusMessage +
+
+
+g_dbus_message_get_serial, function in GDBusMessage +
+
+
+g_dbus_message_get_signature, function in GDBusMessage +
+
+
+g_dbus_message_get_unix_fd_list, function in GDBusMessage +
+
+
+g_dbus_message_lock, function in GDBusMessage +
+
+
+g_dbus_message_new, function in GDBusMessage +
+
+
+g_dbus_message_new_from_blob, function in GDBusMessage +
+
+
+g_dbus_message_new_method_call, function in GDBusMessage +
+
+
+g_dbus_message_new_method_error, function in GDBusMessage +
+
+
+g_dbus_message_new_method_error_literal, function in GDBusMessage +
+
+
+g_dbus_message_new_method_error_valist, function in GDBusMessage +
+
+
+g_dbus_message_new_method_reply, function in GDBusMessage +
+
+
+g_dbus_message_new_signal, function in GDBusMessage +
+
+
+g_dbus_message_print, function in GDBusMessage +
+
+
+g_dbus_message_set_body, function in GDBusMessage +
+
+
+g_dbus_message_set_destination, function in GDBusMessage +
+
+
+g_dbus_message_set_error_name, function in GDBusMessage +
+
+
+g_dbus_message_set_flags, function in GDBusMessage +
+
+
+g_dbus_message_set_header, function in GDBusMessage +
+
+
+g_dbus_message_set_interface, function in GDBusMessage +
+
+
+g_dbus_message_set_member, function in GDBusMessage +
+
+
+g_dbus_message_set_message_type, function in GDBusMessage +
+
+
+g_dbus_message_set_num_unix_fds, function in GDBusMessage +
+
+
+g_dbus_message_set_path, function in GDBusMessage +
+
+
+g_dbus_message_set_reply_serial, function in GDBusMessage +
+
+
+g_dbus_message_set_sender, function in GDBusMessage +
+
+
+g_dbus_message_set_serial, function in GDBusMessage +
+
+
+g_dbus_message_set_signature, function in GDBusMessage +
+
+
+g_dbus_message_set_unix_fd_list, function in GDBusMessage +
+
+
+g_dbus_message_to_blob, function in GDBusMessage +
+
+
+g_dbus_message_to_gerror, function in GDBusMessage +
+
+
+g_dbus_method_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_method_info_unref, function in D-Bus Introspection Data +
+
+
+g_dbus_method_invocation_get_connection, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_interface_name, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_message, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_method_info, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_method_name, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_object_path, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_parameters, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_sender, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_get_user_data, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_return_dbus_error, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_return_error, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_return_error_literal, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_return_error_valist, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_return_gerror, function in GDBusMethodInvocation +
+
+
+g_dbus_method_invocation_return_value, function in GDBusMethodInvocation +
+
+
+g_dbus_node_info_generate_xml, function in D-Bus Introspection Data +
+
+
+g_dbus_node_info_lookup_interface, function in D-Bus Introspection Data +
+
+
+g_dbus_node_info_new_for_xml, function in D-Bus Introspection Data +
+
+
+g_dbus_node_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_node_info_unref, function in D-Bus Introspection Data +
+
+
+g_dbus_property_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_property_info_unref, function in D-Bus Introspection Data +
+
+
+g_dbus_proxy_call, function in GDBusProxy +
+
+
+g_dbus_proxy_call_finish, function in GDBusProxy +
+
+
+g_dbus_proxy_call_sync, function in GDBusProxy +
+
+
+g_dbus_proxy_get_cached_property, function in GDBusProxy +
+
+
+g_dbus_proxy_get_cached_property_names, function in GDBusProxy +
+
+
+g_dbus_proxy_get_connection, function in GDBusProxy +
+
+
+g_dbus_proxy_get_default_timeout, function in GDBusProxy +
+
+
+g_dbus_proxy_get_flags, function in GDBusProxy +
+
+
+g_dbus_proxy_get_interface_info, function in GDBusProxy +
+
+
+g_dbus_proxy_get_interface_name, function in GDBusProxy +
+
+
+g_dbus_proxy_get_name, function in GDBusProxy +
+
+
+g_dbus_proxy_get_name_owner, function in GDBusProxy +
+
+
+g_dbus_proxy_get_object_path, function in GDBusProxy +
+
+
+g_dbus_proxy_new, function in GDBusProxy +
+
+
+g_dbus_proxy_new_finish, function in GDBusProxy +
+
+
+g_dbus_proxy_new_for_bus, function in GDBusProxy +
+
+
+g_dbus_proxy_new_for_bus_finish, function in GDBusProxy +
+
+
+g_dbus_proxy_new_for_bus_sync, function in GDBusProxy +
+
+
+g_dbus_proxy_new_sync, function in GDBusProxy +
+
+
+g_dbus_proxy_set_cached_property, function in GDBusProxy +
+
+
+g_dbus_proxy_set_default_timeout, function in GDBusProxy +
+
+
+g_dbus_proxy_set_interface_info, function in GDBusProxy +
+
+
+g_dbus_server_get_client_address, function in GDBusServer +
+
+
+g_dbus_server_get_flags, function in GDBusServer +
+
+
+g_dbus_server_get_guid, function in GDBusServer +
+
+
+g_dbus_server_is_active, function in GDBusServer +
+
+
+g_dbus_server_new_sync, function in GDBusServer +
+
+
+g_dbus_server_start, function in GDBusServer +
+
+
+g_dbus_server_stop, function in GDBusServer +
+
+
+g_dbus_signal_info_ref, function in D-Bus Introspection Data +
+
+
+g_dbus_signal_info_unref, function in D-Bus Introspection Data +
+
+

I

+
+g_io_error_from_win32_error, function in GIOError +
+
+

M

+
+g_memory_output_stream_steal_data, function in GMemoryOutputStream +
+
+

N

+
+g_network_address_get_scheme, function in GNetworkAddress +
+
+
+g_network_address_parse_uri, function in GNetworkAddress +
+
+
+g_network_service_get_scheme, function in GNetworkService +
+
+
+g_network_service_set_scheme, function in GNetworkService +
+
+

P

+
+g_permission_acquire, function in GPermission +
+
+
+g_permission_acquire_async, function in GPermission +
+
+
+g_permission_acquire_finish, function in GPermission +
+
+
+g_permission_get_allowed, function in GPermission +
+
+
+g_permission_get_can_acquire, function in GPermission +
+
+
+g_permission_get_can_release, function in GPermission +
+
+
+g_permission_impl_update, function in GPermission +
+
+
+g_permission_release, function in GPermission +
+
+
+g_permission_release_async, function in GPermission +
+
+
+g_permission_release_finish, function in GPermission +
+
+
+GProxy, struct in GProxy +
+
+
+GProxyAddress, struct in GProxyAddress +
+
+
+GProxyInterface, struct in GProxy +
+
+
+GProxyResolver, struct in GProxyResolver +
+
+
+g_proxy_address_get_destination_hostname, function in GProxyAddress +
+
+
+g_proxy_address_get_destination_port, function in GProxyAddress +
+
+
+g_proxy_address_get_password, function in GProxyAddress +
+
+
+g_proxy_address_get_protocol, function in GProxyAddress +
+
+
+g_proxy_address_get_username, function in GProxyAddress +
+
+
+g_proxy_address_new, function in GProxyAddress +
+
+
+g_proxy_connect, function in GProxy +
+
+
+g_proxy_connect_async, function in GProxy +
+
+
+g_proxy_connect_finish, function in GProxy +
+
+
+G_PROXY_EXTENSION_POINT_NAME, macro in GProxy +
+
+
+g_proxy_get_default_for_protocol, function in GProxy +
+
+
+g_proxy_resolver_get_default, function in GProxyResolver +
+
+
+g_proxy_resolver_is_supported, function in GProxyResolver +
+
+
+g_proxy_resolver_lookup, function in GProxyResolver +
+
+
+g_proxy_resolver_lookup_async, function in GProxyResolver +
+
+
+g_proxy_resolver_lookup_finish, function in GProxyResolver +
+
+
+g_proxy_supports_hostname, function in GProxy +
+
+

S

+
+g_settings_backend_changed, function in GSettingsBackend +
+
+
+g_settings_backend_changed_tree, function in GSettingsBackend +
+
+
+g_settings_backend_flatten_tree, function in GSettingsBackend +
+
+
+g_settings_backend_keys_changed, function in GSettingsBackend +
+
+
+g_settings_backend_path_changed, function in GSettingsBackend +
+
+
+g_settings_backend_path_writable_changed, function in GSettingsBackend +
+
+
+g_settings_backend_writable_changed, function in GSettingsBackend +
+
+
+g_settings_bind, function in GSettings +
+
+
+g_settings_bind_with_mapping, function in GSettings +
+
+
+g_settings_bind_writable, function in GSettings +
+
+
+g_settings_delay, function in GSettings +
+
+
+g_settings_get, function in GSettings +
+
+
+g_settings_get_boolean, function in GSettings +
+
+
+g_settings_get_child, function in GSettings +
+
+
+g_settings_get_double, function in GSettings +
+
+
+g_settings_get_enum, function in GSettings +
+
+
+g_settings_get_flags, function in GSettings +
+
+
+g_settings_get_has_unapplied, function in GSettings +
+
+
+g_settings_get_int, function in GSettings +
+
+
+g_settings_get_string, function in GSettings +
+
+
+g_settings_get_strv, function in GSettings +
+
+
+g_settings_get_value, function in GSettings +
+
+
+g_settings_is_writable, function in GSettings +
+
+
+g_settings_new, function in GSettings +
+
+
+g_settings_new_with_backend, function in GSettings +
+
+
+g_settings_new_with_backend_and_path, function in GSettings +
+
+
+g_settings_new_with_path, function in GSettings +
+
+
+g_settings_set, function in GSettings +
+
+
+g_settings_set_boolean, function in GSettings +
+
+
+g_settings_set_double, function in GSettings +
+
+
+g_settings_set_int, function in GSettings +
+
+
+g_settings_set_string, function in GSettings +
+
+
+g_settings_set_strv, function in GSettings +
+
+
+g_settings_set_value, function in GSettings +
+
+
+g_settings_unbind, function in GSettings +
+
+
+GSimpleAction, struct in GSimpleAction +
+
+
+GSimpleActionClass, struct in GSimpleAction +
+
+
+GSimpleActionGroup, struct in GSimpleActionGroup +
+
+
+g_simple_permission_new, function in GSimplePermission +
+
+
+GSocket:timeout, object property in GSocket +
+
+
+g_socket_client_connect_to_uri, function in GSocketClient +
+
+
+g_socket_client_connect_to_uri_async, function in GSocketClient +
+
+
+g_socket_client_connect_to_uri_finish, function in GSocketClient +
+
+
+g_socket_client_get_enable_proxy, function in GSocketClient +
+
+
+g_socket_client_get_timeout, function in GSocketClient +
+
+
+g_socket_client_set_enable_proxy, function in GSocketClient +
+
+
+g_socket_client_set_timeout, function in GSocketClient +
+
+
+g_socket_connectable_proxy_enumerate, function in GSocketConnectable +
+
+
+g_socket_get_credentials, function in GSocket +
+
+
+g_socket_get_timeout, function in GSocket +
+
+
+g_socket_receive_with_blocking, function in GSocket +
+
+
+g_socket_send_with_blocking, function in GSocket +
+
+
+g_socket_set_timeout, function in GSocket +
+
+

T

+
+G_TYPE_DBUS_ANNOTATION_INFO, macro in D-Bus Introspection Data +
+
+
+G_TYPE_DBUS_ARG_INFO, macro in D-Bus Introspection Data +
+
+
+G_TYPE_DBUS_INTERFACE_INFO, macro in D-Bus Introspection Data +
+
+
+G_TYPE_DBUS_METHOD_INFO, macro in D-Bus Introspection Data +
+
+
+G_TYPE_DBUS_NODE_INFO, macro in D-Bus Introspection Data +
+
+
+G_TYPE_DBUS_PROPERTY_INFO, macro in D-Bus Introspection Data +
+
+
+G_TYPE_DBUS_SIGNAL_INFO, macro in D-Bus Introspection Data +
+
+

U

+
+GUnixCredentialsMessage, struct in GUnixCredentialsMessage +
+
+
+GUnixCredentialsMessage:credentials, object property in GUnixCredentialsMessage +
+
+
+GUnixCredentialsMessageClass, struct in GUnixCredentialsMessage +
+
+
+GUnixSocketAddressType, enum in GUnixSocketAddress +
+
+
+g_unix_connection_receive_credentials, function in GUnixConnection +
+
+
+g_unix_connection_send_credentials, function in GUnixConnection +
+
+
+g_unix_credentials_message_get_credentials, function in GUnixCredentialsMessage +
+
+
+g_unix_credentials_message_is_supported, function in GUnixCredentialsMessage +
+
+
+g_unix_credentials_message_new, function in GUnixCredentialsMessage +
+
+
+g_unix_credentials_message_new_with_credentials, function in GUnixCredentialsMessage +
+
+
+g_unix_socket_address_get_address_type, function in GUnixSocketAddress +
+
+
+g_unix_socket_address_new_with_type, function in GUnixSocketAddress +
+
+

Z

+
+GZlibCompressor:file-info, object property in GZlibCompressor +
+
+
+GZlibDecompressor:file-info, object property in GZlibDecompressor +
+
+
+g_zlib_compressor_get_file_info, function in GZlibCompressor +
+
+
+g_zlib_compressor_set_file_info, function in GZlibCompressor +
+
+
+g_zlib_decompressor_get_file_info, function in GZlibDecompressor +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/api-index-2-28.html b/docs/reference/gio/html/api-index-2-28.html new file mode 100644 index 0000000..41ab8d4 --- /dev/null +++ b/docs/reference/gio/html/api-index-2-28.html @@ -0,0 +1,686 @@ + + + + +Index of new symbols in 2.28 + + + + + + + + + + + + + + + + + + + +
+

+Index of new symbols in 2.28

+

A

+
+GAction:enabled, object property in GAction +
+
+
+GAction:name, object property in GAction +
+
+
+GAction:parameter-type, object property in GAction +
+
+
+GAction:state, object property in GAction +
+
+
+GAction:state-type, object property in GAction +
+
+
+GActionGroup::action-added, object signal in GActionGroup +
+
+
+GActionGroup::action-enabled-changed, object signal in GActionGroup +
+
+
+GActionGroup::action-removed, object signal in GActionGroup +
+
+
+GActionGroup::action-state-changed, object signal in GActionGroup +
+
+
+g_action_activate, function in GAction +
+
+
+g_action_get_enabled, function in GAction +
+
+
+g_action_get_name, function in GAction +
+
+
+g_action_get_parameter_type, function in GAction +
+
+
+g_action_get_state, function in GAction +
+
+
+g_action_get_state_hint, function in GAction +
+
+
+g_action_get_state_type, function in GAction +
+
+
+g_action_group_action_added, function in GActionGroup +
+
+
+g_action_group_action_enabled_changed, function in GActionGroup +
+
+
+g_action_group_action_removed, function in GActionGroup +
+
+
+g_action_group_action_state_changed, function in GActionGroup +
+
+
+g_action_group_activate_action, function in GActionGroup +
+
+
+g_action_group_change_action_state, function in GActionGroup +
+
+
+g_action_group_get_action_enabled, function in GActionGroup +
+
+
+g_action_group_get_action_parameter_type, function in GActionGroup +
+
+
+g_action_group_get_action_state, function in GActionGroup +
+
+
+g_action_group_get_action_state_hint, function in GActionGroup +
+
+
+g_action_group_get_action_state_type, function in GActionGroup +
+
+
+g_action_group_has_action, function in GActionGroup +
+
+
+g_action_group_list_actions, function in GActionGroup +
+
+
+g_action_set_state, function in GAction +
+
+
+g_application_activate, function in GApplication +
+
+
+g_application_command_line_getenv, function in GApplicationCommandLine +
+
+
+g_application_command_line_get_arguments, function in GApplicationCommandLine +
+
+
+g_application_command_line_get_cwd, function in GApplicationCommandLine +
+
+
+g_application_command_line_get_exit_status, function in GApplicationCommandLine +
+
+
+g_application_command_line_get_is_remote, function in GApplicationCommandLine +
+
+
+g_application_command_line_get_platform_data, function in GApplicationCommandLine +
+
+
+g_application_command_line_print, function in GApplicationCommandLine +
+
+
+g_application_command_line_printerr, function in GApplicationCommandLine +
+
+
+g_application_command_line_set_exit_status, function in GApplicationCommandLine +
+
+
+g_application_get_application_id, function in GApplication +
+
+
+g_application_get_flags, function in GApplication +
+
+
+g_application_get_inactivity_timeout, function in GApplication +
+
+
+g_application_get_is_registered, function in GApplication +
+
+
+g_application_get_is_remote, function in GApplication +
+
+
+g_application_open, function in GApplication +
+
+
+g_application_register, function in GApplication +
+
+
+g_application_run, function in GApplication +
+
+
+g_application_set_action_group, function in GApplication +
+
+
+g_application_set_application_id, function in GApplication +
+
+
+g_application_set_flags, function in GApplication +
+
+
+g_application_set_inactivity_timeout, function in GApplication +
+
+
+g_app_info_get_fallback_for_type, function in GAppInfo +
+
+
+g_app_info_get_recommended_for_type, function in GAppInfo +
+
+

C

+
+GCancellableSourceFunc, user_function in GCancellable +
+
+
+g_cancellable_source_new, function in GCancellable +
+
+

E

+
+g_emblemed_icon_clear_emblems, function in GEmblemedIcon +
+
+

I

+
+GIOStreamSpliceFlags, enum in GIOStream +
+
+
+g_io_stream_splice_async, function in GIOStream +
+
+
+g_io_stream_splice_finish, function in GIOStream +
+
+

P

+
+GPollableInputStream, struct in GPollableInputStream +
+
+
+GPollableInputStreamInterface, struct in GPollableInputStream +
+
+
+GPollableOutputStream, struct in GPollableOutputStream +
+
+
+GPollableOutputStreamInterface, struct in GPollableOutputStream +
+
+
+GPollableSourceFunc, user_function in GPollableInputStream +
+
+
+g_pollable_input_stream_can_poll, function in GPollableInputStream +
+
+
+g_pollable_input_stream_create_source, function in GPollableInputStream +
+
+
+g_pollable_input_stream_is_readable, function in GPollableInputStream +
+
+
+g_pollable_output_stream_can_poll, function in GPollableOutputStream +
+
+
+g_pollable_output_stream_create_source, function in GPollableOutputStream +
+
+
+g_pollable_output_stream_is_writable, function in GPollableOutputStream +
+
+
+g_pollable_source_new, function in GPollableInputStream +
+
+

S

+
+GSettings:delay-apply, object property in GSettings +
+
+
+g_settings_get_range, function in GSettings +
+
+
+g_settings_range_check, function in GSettings +
+
+
+GSimpleAction::activate, object signal in GSimpleAction +
+
+
+GSimpleAction:enabled, object property in GSimpleAction +
+
+
+GSimpleAction:name, object property in GSimpleAction +
+
+
+GSimpleAction:parameter-type, object property in GSimpleAction +
+
+
+GSimpleAction:state, object property in GSimpleAction +
+
+
+GSimpleAction:state-type, object property in GSimpleAction +
+
+
+g_simple_action_group_insert, function in GSimpleActionGroup +
+
+
+g_simple_action_group_lookup, function in GSimpleActionGroup +
+
+
+g_simple_action_group_new, function in GSimpleActionGroup +
+
+
+g_simple_action_group_remove, function in GSimpleActionGroup +
+
+
+g_simple_action_new, function in GSimpleAction +
+
+
+g_simple_action_new_stateful, function in GSimpleAction +
+
+
+g_simple_action_set_enabled, function in GSimpleAction +
+
+
+g_simple_async_report_take_gerror_in_idle, function in GSimpleAsyncResult +
+
+
+g_simple_async_result_new_take_error, function in GSimpleAsyncResult +
+
+
+g_simple_async_result_take_error, function in GSimpleAsyncResult +
+
+
+g_socket_client_get_tls, function in GSocketClient +
+
+
+g_socket_client_get_tls_validation_flags, function in GSocketClient +
+
+
+g_socket_client_set_tls, function in GSocketClient +
+
+
+g_socket_client_set_tls_validation_flags, function in GSocketClient +
+
+

T

+
+g_tcp_wrapper_connection_new, function in GTcpWrapperConnection +
+
+
+GTlsAuthenticationMode, enum in TLS Overview +
+
+
+GTlsBackend, struct in GTlsBackend +
+
+
+GTlsBackendInterface, struct in GTlsBackend +
+
+
+GTlsCertificate, struct in GTlsCertificate +
+
+
+GTlsCertificate:certificate, object property in GTlsCertificate +
+
+
+GTlsCertificate:certificate-pem, object property in GTlsCertificate +
+
+
+GTlsCertificate:issuer, object property in GTlsCertificate +
+
+
+GTlsCertificate:private-key, object property in GTlsCertificate +
+
+
+GTlsCertificate:private-key-pem, object property in GTlsCertificate +
+
+
+GTlsCertificateFlags, enum in TLS Overview +
+
+
+GTlsClientConnection, struct in GTlsClientConnection +
+
+
+GTlsClientConnection:accepted-cas, object property in GTlsClientConnection +
+
+
+GTlsClientConnection:server-identity, object property in GTlsClientConnection +
+
+
+GTlsClientConnection:use-ssl3, object property in GTlsClientConnection +
+
+
+GTlsClientConnection:validation-flags, object property in GTlsClientConnection +
+
+
+GTlsConnection, struct in GTlsConnection +
+
+
+GTlsConnection::accept-certificate, object signal in GTlsConnection +
+
+
+GTlsConnection:base-io-stream, object property in GTlsConnection +
+
+
+GTlsConnection:certificate, object property in GTlsConnection +
+
+
+GTlsConnection:peer-certificate, object property in GTlsConnection +
+
+
+GTlsConnection:peer-certificate-errors, object property in GTlsConnection +
+
+
+GTlsConnection:rehandshake-mode, object property in GTlsConnection +
+
+
+GTlsConnection:require-close-notify, object property in GTlsConnection +
+
+
+GTlsConnection:use-system-certdb, object property in GTlsConnection +
+
+
+GTlsError, enum in TLS Overview +
+
+
+GTlsRehandshakeMode, enum in GTlsConnection +
+
+
+GTlsServerConnection, struct in GTlsServerConnection +
+
+
+GTlsServerConnection:authentication-mode, object property in GTlsServerConnection +
+
+
+g_tls_backend_get_certificate_type, function in GTlsBackend +
+
+
+g_tls_backend_get_client_connection_type, function in GTlsBackend +
+
+
+g_tls_backend_get_default, function in GTlsBackend +
+
+
+g_tls_backend_get_server_connection_type, function in GTlsBackend +
+
+
+g_tls_backend_supports_tls, function in GTlsBackend +
+
+
+g_tls_certificate_get_issuer, function in GTlsCertificate +
+
+
+g_tls_certificate_list_new_from_file, function in GTlsCertificate +
+
+
+g_tls_certificate_new_from_file, function in GTlsCertificate +
+
+
+g_tls_certificate_new_from_files, function in GTlsCertificate +
+
+
+g_tls_certificate_new_from_pem, function in GTlsCertificate +
+
+
+g_tls_certificate_verify, function in GTlsCertificate +
+
+
+g_tls_client_connection_get_accepted_cas, function in GTlsClientConnection +
+
+
+g_tls_client_connection_get_server_identity, function in GTlsClientConnection +
+
+
+g_tls_client_connection_get_use_ssl3, function in GTlsClientConnection +
+
+
+g_tls_client_connection_get_validation_flags, function in GTlsClientConnection +
+
+
+g_tls_client_connection_new, function in GTlsClientConnection +
+
+
+g_tls_client_connection_set_server_identity, function in GTlsClientConnection +
+
+
+g_tls_client_connection_set_use_ssl3, function in GTlsClientConnection +
+
+
+g_tls_client_connection_set_validation_flags, function in GTlsClientConnection +
+
+
+g_tls_connection_emit_accept_certificate, function in GTlsConnection +
+
+
+g_tls_connection_get_certificate, function in GTlsConnection +
+
+
+g_tls_connection_get_peer_certificate, function in GTlsConnection +
+
+
+g_tls_connection_get_peer_certificate_errors, function in GTlsConnection +
+
+
+g_tls_connection_get_rehandshake_mode, function in GTlsConnection +
+
+
+g_tls_connection_get_require_close_notify, function in GTlsConnection +
+
+
+g_tls_connection_get_use_system_certdb, function in GTlsConnection +
+
+
+g_tls_connection_handshake, function in GTlsConnection +
+
+
+g_tls_connection_handshake_async, function in GTlsConnection +
+
+
+g_tls_connection_handshake_finish, function in GTlsConnection +
+
+
+g_tls_connection_set_certificate, function in GTlsConnection +
+
+
+g_tls_connection_set_rehandshake_mode, function in GTlsConnection +
+
+
+g_tls_connection_set_require_close_notify, function in GTlsConnection +
+
+
+g_tls_connection_set_use_system_certdb, function in GTlsConnection +
+
+
+g_tls_server_connection_new, function in GTlsServerConnection +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/api-index-deprecated.html b/docs/reference/gio/html/api-index-deprecated.html index 8e23904..cc224c4 100644 --- a/docs/reference/gio/html/api-index-deprecated.html +++ b/docs/reference/gio/html/api-index-deprecated.html @@ -3,12 +3,12 @@ Index of deprecated symbols - + - + @@ -27,6 +27,8 @@  |  M  |  + U +  |  V @@ -76,6 +78,19 @@ g_mount_unmount_finish, function in GMount
+

U

+
+GUnixSocketAddress:abstract, object property in GUnixSocketAddress +
+
+
+g_unix_socket_address_get_is_abstract, function in GUnixSocketAddress +
+
+
+g_unix_socket_address_new_abstract, function in GUnixSocketAddress +
+

V

g_volume_eject, function in GVolume @@ -92,6 +107,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/api-index-full.html b/docs/reference/gio/html/api-index-full.html index 9a6d980..f7ee07f 100644 --- a/docs/reference/gio/html/api-index-full.html +++ b/docs/reference/gio/html/api-index-full.html @@ -3,12 +3,12 @@ Index - + - + @@ -35,6 +35,8 @@  |  I  |  + K +  |  L  |  M @@ -63,2277 +65,3713 @@ Index

A

-GAppInfo, struct in GAppInfo +GAction, struct in GAction
-GAppInfoCreateFlags, enum in GAppInfo +GAction:enabled, object property in GAction
-GAppInfoIface, struct in GAppInfo +GAction:name, object property in GAction
-GAppLaunchContext, struct in GAppInfo +GAction:parameter-type, object property in GAction
-g_app_info_add_supports_type, function in GAppInfo +GAction:state, object property in GAction
-g_app_info_can_delete, function in GAppInfo +GAction:state-type, object property in GAction
-g_app_info_can_remove_supports_type, function in GAppInfo +GActionGroup, struct in GActionGroup
-g_app_info_create_from_commandline, function in GAppInfo +GActionGroup::action-added, object signal in GActionGroup
-g_app_info_delete, function in GAppInfo +GActionGroup::action-enabled-changed, object signal in GActionGroup
-g_app_info_dup, function in GAppInfo +GActionGroup::action-removed, object signal in GActionGroup
-g_app_info_equal, function in GAppInfo +GActionGroup::action-state-changed, object signal in GActionGroup
-g_app_info_get_all, function in GAppInfo +g_action_activate, function in GAction
-g_app_info_get_all_for_type, function in GAppInfo +g_action_get_enabled, function in GAction
-g_app_info_get_commandline, function in GAppInfo +g_action_get_name, function in GAction
-g_app_info_get_default_for_type, function in GAppInfo +g_action_get_parameter_type, function in GAction
-g_app_info_get_default_for_uri_scheme, function in GAppInfo +g_action_get_state, function in GAction
-g_app_info_get_description, function in GAppInfo +g_action_get_state_hint, function in GAction
-g_app_info_get_display_name, function in GAppInfo +g_action_get_state_type, function in GAction
-g_app_info_get_executable, function in GAppInfo +g_action_group_action_added, function in GActionGroup
-g_app_info_get_icon, function in GAppInfo +g_action_group_action_enabled_changed, function in GActionGroup
-g_app_info_get_id, function in GAppInfo +g_action_group_action_removed, function in GActionGroup
-g_app_info_get_name, function in GAppInfo +g_action_group_action_state_changed, function in GActionGroup
-g_app_info_launch, function in GAppInfo +g_action_group_activate_action, function in GActionGroup
-g_app_info_launch_default_for_uri, function in GAppInfo +g_action_group_change_action_state, function in GActionGroup
-g_app_info_launch_uris, function in GAppInfo +g_action_group_get_action_enabled, function in GActionGroup
-g_app_info_remove_supports_type, function in GAppInfo +g_action_group_get_action_parameter_type, function in GActionGroup
-g_app_info_reset_type_associations, function in GAppInfo +g_action_group_get_action_state, function in GActionGroup
-g_app_info_set_as_default_for_extension, function in GAppInfo +g_action_group_get_action_state_hint, function in GActionGroup
-g_app_info_set_as_default_for_type, function in GAppInfo +g_action_group_get_action_state_type, function in GActionGroup
-g_app_info_should_show, function in GAppInfo +g_action_group_has_action, function in GActionGroup
-g_app_info_supports_files, function in GAppInfo +g_action_group_list_actions, function in GActionGroup
-g_app_info_supports_uris, function in GAppInfo +g_action_set_state, function in GAction
-g_app_launch_context_get_display, function in GAppInfo +GAppInfo, struct in GAppInfo
-g_app_launch_context_get_startup_notify_id, function in GAppInfo +GAppInfoCreateFlags, enum in GAppInfo
-g_app_launch_context_launch_failed, function in GAppInfo +GAppInfoIface, struct in GAppInfo
-g_app_launch_context_new, function in GAppInfo +GAppLaunchContext, struct in GAppInfo
-GAskPasswordFlags, enum in GMountOperation +GApplication, struct in GApplication
-GAsyncInitable, struct in GAsyncInitable +GApplication::activate, object signal in GApplication
-GAsyncInitableIface, struct in GAsyncInitable +GApplication::command-line, object signal in GApplication
-GAsyncReadyCallback, user_function in GAsyncResult +GApplication::open, object signal in GApplication
-GAsyncResult, struct in GAsyncResult +GApplication::startup, object signal in GApplication
-GAsyncResultIface, struct in GAsyncResult +GApplication:action-group, object property in GApplication
-g_async_initable_init_async, function in GAsyncInitable +GApplication:application-id, object property in GApplication
-g_async_initable_init_finish, function in GAsyncInitable +GApplication:flags, object property in GApplication
-g_async_initable_newv_async, function in GAsyncInitable +GApplication:inactivity-timeout, object property in GApplication
-g_async_initable_new_async, function in GAsyncInitable +GApplication:is-registered, object property in GApplication
-g_async_initable_new_finish, function in GAsyncInitable +GApplication:is-remote, object property in GApplication
-g_async_initable_new_valist_async, function in GAsyncInitable +GApplicationClass, struct in GApplication
-g_async_result_get_source_object, function in GAsyncResult +GApplicationCommandLine, struct in GApplicationCommandLine
-g_async_result_get_user_data, function in GAsyncResult +GApplicationCommandLineClass, struct in GApplicationCommandLine
-

B

-GBufferedInputStream, struct in GBufferedInputStream +GApplicationFlags, enum in GApplication
-GBufferedInputStream:buffer-size, object property in GBufferedInputStream +g_application_activate, function in GApplication
-GBufferedOutputStream, struct in GBufferedOutputStream +g_application_command_line_getenv, function in GApplicationCommandLine
-GBufferedOutputStream:auto-grow, object property in GBufferedOutputStream +g_application_command_line_get_arguments, function in GApplicationCommandLine
-GBufferedOutputStream:buffer-size, object property in GBufferedOutputStream +g_application_command_line_get_cwd, function in GApplicationCommandLine
-g_buffered_input_stream_fill, function in GBufferedInputStream +g_application_command_line_get_exit_status, function in GApplicationCommandLine
-g_buffered_input_stream_fill_async, function in GBufferedInputStream +g_application_command_line_get_is_remote, function in GApplicationCommandLine
-g_buffered_input_stream_fill_finish, function in GBufferedInputStream +g_application_command_line_get_platform_data, function in GApplicationCommandLine
-g_buffered_input_stream_get_available, function in GBufferedInputStream +g_application_command_line_print, function in GApplicationCommandLine
-g_buffered_input_stream_get_buffer_size, function in GBufferedInputStream +g_application_command_line_printerr, function in GApplicationCommandLine
-g_buffered_input_stream_new, function in GBufferedInputStream +g_application_command_line_set_exit_status, function in GApplicationCommandLine
-g_buffered_input_stream_new_sized, function in GBufferedInputStream +g_application_get_application_id, function in GApplication
-g_buffered_input_stream_peek, function in GBufferedInputStream +g_application_get_flags, function in GApplication
-g_buffered_input_stream_peek_buffer, function in GBufferedInputStream +g_application_get_inactivity_timeout, function in GApplication
-g_buffered_input_stream_read_byte, function in GBufferedInputStream +g_application_get_is_registered, function in GApplication
-g_buffered_input_stream_set_buffer_size, function in GBufferedInputStream +g_application_get_is_remote, function in GApplication
-g_buffered_output_stream_get_auto_grow, function in GBufferedOutputStream +g_application_hold, function in GApplication
-g_buffered_output_stream_get_buffer_size, function in GBufferedOutputStream +g_application_id_is_valid, function in GApplication
-g_buffered_output_stream_new, function in GBufferedOutputStream +g_application_new, function in GApplication
-g_buffered_output_stream_new_sized, function in GBufferedOutputStream +g_application_open, function in GApplication
-g_buffered_output_stream_set_auto_grow, function in GBufferedOutputStream +g_application_register, function in GApplication
-g_buffered_output_stream_set_buffer_size, function in GBufferedOutputStream +g_application_release, function in GApplication
-

C

-GCancellable, struct in GCancellable +g_application_run, function in GApplication
-GCancellable::cancelled, object signal in GCancellable +g_application_set_action_group, function in GApplication
-g_cancellable_cancel, function in GCancellable +g_application_set_application_id, function in GApplication
-g_cancellable_connect, function in GCancellable +g_application_set_flags, function in GApplication
-g_cancellable_disconnect, function in GCancellable +g_application_set_inactivity_timeout, function in GApplication
-g_cancellable_get_current, function in GCancellable +g_app_info_add_supports_type, function in GAppInfo
-g_cancellable_get_fd, function in GCancellable +g_app_info_can_delete, function in GAppInfo
-g_cancellable_is_cancelled, function in GCancellable +g_app_info_can_remove_supports_type, function in GAppInfo
-g_cancellable_make_pollfd, function in GCancellable +g_app_info_create_from_commandline, function in GAppInfo
-g_cancellable_new, function in GCancellable +g_app_info_delete, function in GAppInfo
-g_cancellable_pop_current, function in GCancellable +g_app_info_dup, function in GAppInfo
-g_cancellable_push_current, function in GCancellable +g_app_info_equal, function in GAppInfo
-g_cancellable_release_fd, function in GCancellable +g_app_info_get_all, function in GAppInfo
-g_cancellable_reset, function in GCancellable +g_app_info_get_all_for_type, function in GAppInfo
-g_cancellable_set_error_if_cancelled, function in GCancellable +g_app_info_get_commandline, function in GAppInfo
-GCharsetConverter, struct in GCharsetConverter +g_app_info_get_default_for_type, function in GAppInfo
-GCharsetConverter:from-charset, object property in GCharsetConverter +g_app_info_get_default_for_uri_scheme, function in GAppInfo
-GCharsetConverter:to-charset, object property in GCharsetConverter +g_app_info_get_description, function in GAppInfo
-GCharsetConverter:use-fallback, object property in GCharsetConverter +g_app_info_get_display_name, function in GAppInfo
-g_charset_converter_get_num_fallbacks, function in GCharsetConverter +g_app_info_get_executable, function in GAppInfo
-g_charset_converter_get_use_fallback, function in GCharsetConverter +g_app_info_get_fallback_for_type, function in GAppInfo
-g_charset_converter_new, function in GCharsetConverter +g_app_info_get_icon, function in GAppInfo
-g_charset_converter_set_use_fallback, function in GCharsetConverter +g_app_info_get_id, function in GAppInfo
-g_content_types_get_registered, function in GContentType +g_app_info_get_name, function in GAppInfo
-g_content_type_can_be_executable, function in GContentType +g_app_info_get_recommended_for_type, function in GAppInfo
-g_content_type_equals, function in GContentType +g_app_info_launch, function in GAppInfo
-g_content_type_from_mime_type, function in GContentType +g_app_info_launch_default_for_uri, function in GAppInfo
-g_content_type_get_description, function in GContentType +g_app_info_launch_uris, function in GAppInfo
-g_content_type_get_icon, function in GContentType +g_app_info_remove_supports_type, function in GAppInfo
-g_content_type_get_mime_type, function in GContentType +g_app_info_reset_type_associations, function in GAppInfo
-g_content_type_guess, function in GContentType +g_app_info_set_as_default_for_extension, function in GAppInfo
-g_content_type_guess_for_tree, function in GContentType +g_app_info_set_as_default_for_type, function in GAppInfo
-g_content_type_is_a, function in GContentType +g_app_info_set_as_last_used_for_type, function in GAppInfo
-g_content_type_is_unknown, function in GContentType +g_app_info_should_show, function in GAppInfo
-GConverter, struct in GConverter +g_app_info_supports_files, function in GAppInfo
-GConverterIface, struct in GConverter +g_app_info_supports_uris, function in GAppInfo
-GConverterInputStream, struct in GConverterInputstream +g_app_launch_context_get_display, function in GAppInfo
-GConverterInputStream:converter, object property in GConverterInputstream +g_app_launch_context_get_startup_notify_id, function in GAppInfo
-GConverterOutputStream, struct in GConverterOutputstream +g_app_launch_context_launch_failed, function in GAppInfo
-GConverterOutputStream:converter, object property in GConverterOutputstream +g_app_launch_context_new, function in GAppInfo
-GConverterResult, enum in GConverter +GAskPasswordFlags, enum in GMountOperation
-g_converter_convert, function in GConverter +GAsyncInitable, struct in GAsyncInitable
-g_converter_input_stream_get_converter, function in GConverterInputstream +GAsyncInitableIface, struct in GAsyncInitable
-g_converter_input_stream_new, function in GConverterInputstream +GAsyncReadyCallback, user_function in GAsyncResult
-g_converter_output_stream_get_converter, function in GConverterOutputstream +GAsyncResult, struct in GAsyncResult
-g_converter_output_stream_new, function in GConverterOutputstream +GAsyncResultIface, struct in GAsyncResult
-g_converter_reset, function in GConverter +g_async_initable_init_async, function in GAsyncInitable
-

D

-GDataInputStream, struct in GDataInputStream +g_async_initable_init_finish, function in GAsyncInitable
-GDataInputStream:byte-order, object property in GDataInputStream +g_async_initable_newv_async, function in GAsyncInitable
-GDataInputStream:newline-type, object property in GDataInputStream +g_async_initable_new_async, function in GAsyncInitable
-GDataOutputStream, struct in GDataOutputStream +g_async_initable_new_finish, function in GAsyncInitable
-GDataOutputStream:byte-order, object property in GDataOutputStream +g_async_initable_new_valist_async, function in GAsyncInitable
-GDataStreamByteOrder, enum in GDataInputStream +g_async_result_get_source_object, function in GAsyncResult
-GDataStreamNewlineType, enum in GDataInputStream +g_async_result_get_user_data, function in GAsyncResult
+

B

-g_data_input_stream_get_byte_order, function in GDataInputStream +GBufferedInputStream, struct in GBufferedInputStream
-g_data_input_stream_get_newline_type, function in GDataInputStream +GBufferedInputStream:buffer-size, object property in GBufferedInputStream
-g_data_input_stream_new, function in GDataInputStream +GBufferedOutputStream, struct in GBufferedOutputStream
-g_data_input_stream_read_byte, function in GDataInputStream +GBufferedOutputStream:auto-grow, object property in GBufferedOutputStream
-g_data_input_stream_read_int16, function in GDataInputStream +GBufferedOutputStream:buffer-size, object property in GBufferedOutputStream
-g_data_input_stream_read_int32, function in GDataInputStream +g_buffered_input_stream_fill, function in GBufferedInputStream
-g_data_input_stream_read_int64, function in GDataInputStream +g_buffered_input_stream_fill_async, function in GBufferedInputStream
-g_data_input_stream_read_line, function in GDataInputStream +g_buffered_input_stream_fill_finish, function in GBufferedInputStream
-g_data_input_stream_read_line_async, function in GDataInputStream +g_buffered_input_stream_get_available, function in GBufferedInputStream
-g_data_input_stream_read_line_finish, function in GDataInputStream +g_buffered_input_stream_get_buffer_size, function in GBufferedInputStream
-g_data_input_stream_read_uint16, function in GDataInputStream +g_buffered_input_stream_new, function in GBufferedInputStream
-g_data_input_stream_read_uint32, function in GDataInputStream +g_buffered_input_stream_new_sized, function in GBufferedInputStream
-g_data_input_stream_read_uint64, function in GDataInputStream +g_buffered_input_stream_peek, function in GBufferedInputStream
-g_data_input_stream_read_until, function in GDataInputStream +g_buffered_input_stream_peek_buffer, function in GBufferedInputStream
-g_data_input_stream_read_until_async, function in GDataInputStream +g_buffered_input_stream_read_byte, function in GBufferedInputStream
-g_data_input_stream_read_until_finish, function in GDataInputStream +g_buffered_input_stream_set_buffer_size, function in GBufferedInputStream
-g_data_input_stream_set_byte_order, function in GDataInputStream +g_buffered_output_stream_get_auto_grow, function in GBufferedOutputStream
-g_data_input_stream_set_newline_type, function in GDataInputStream +g_buffered_output_stream_get_buffer_size, function in GBufferedOutputStream
-g_data_output_stream_get_byte_order, function in GDataOutputStream +g_buffered_output_stream_new, function in GBufferedOutputStream
-g_data_output_stream_new, function in GDataOutputStream +g_buffered_output_stream_new_sized, function in GBufferedOutputStream
-g_data_output_stream_put_byte, function in GDataOutputStream +g_buffered_output_stream_set_auto_grow, function in GBufferedOutputStream
-g_data_output_stream_put_int16, function in GDataOutputStream +g_buffered_output_stream_set_buffer_size, function in GBufferedOutputStream
-g_data_output_stream_put_int32, function in GDataOutputStream +GBusAcquiredCallback, user_function in Owning Bus Names
-g_data_output_stream_put_int64, function in GDataOutputStream +GBusNameAcquiredCallback, user_function in Owning Bus Names
-g_data_output_stream_put_string, function in GDataOutputStream +GBusNameAppearedCallback, user_function in Watching Bus Names
-g_data_output_stream_put_uint16, function in GDataOutputStream +GBusNameLostCallback, user_function in Owning Bus Names
-g_data_output_stream_put_uint32, function in GDataOutputStream +GBusNameOwnerFlags, enum in Owning Bus Names
-g_data_output_stream_put_uint64, function in GDataOutputStream +GBusNameVanishedCallback, user_function in Watching Bus Names
-g_data_output_stream_set_byte_order, function in GDataOutputStream +GBusNameWatcherFlags, enum in Watching Bus Names
-GDesktopAppInfo, struct in Desktop file based GAppInfo +GBusType, enum in GDBusConnection
-GDesktopAppInfoLookup, struct in Desktop file based GAppInfo +g_bus_get, function in GDBusConnection
-g_desktop_app_info_get_filename, function in Desktop file based GAppInfo +g_bus_get_finish, function in GDBusConnection
-g_desktop_app_info_get_is_hidden, function in Desktop file based GAppInfo +g_bus_get_sync, function in GDBusConnection
-G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME, macro in Desktop file based GAppInfo +g_bus_own_name, function in Owning Bus Names
-g_desktop_app_info_lookup_get_default_for_uri_scheme, function in Desktop file based GAppInfo +g_bus_own_name_on_connection, function in Owning Bus Names
-g_desktop_app_info_new, function in Desktop file based GAppInfo +g_bus_own_name_on_connection_with_closures, function in Owning Bus Names
-g_desktop_app_info_new_from_filename, function in Desktop file based GAppInfo +g_bus_own_name_with_closures, function in Owning Bus Names
-g_desktop_app_info_new_from_keyfile, function in Desktop file based GAppInfo +g_bus_unown_name, function in Owning Bus Names
-g_desktop_app_info_set_desktop_env, function in Desktop file based GAppInfo +g_bus_unwatch_name, function in Watching Bus Names
-GDrive, struct in GDrive +g_bus_watch_name, function in Watching Bus Names
-GDrive::changed, object signal in GDrive +g_bus_watch_name_on_connection, function in Watching Bus Names
-GDrive::disconnected, object signal in GDrive +g_bus_watch_name_on_connection_with_closures, function in Watching Bus Names
-GDrive::eject-button, object signal in GDrive +g_bus_watch_name_with_closures, function in Watching Bus Names
+

C

-GDrive::stop-button, object signal in GDrive +GCancellable, struct in GCancellable
-GDriveIface, struct in GDrive +GCancellable::cancelled, object signal in GCancellable
-GDriveStartFlags, enum in GDrive +GCancellableSourceFunc, user_function in GCancellable
-GDriveStartStopType, enum in GDrive +g_cancellable_cancel, function in GCancellable
-g_drive_can_eject, function in GDrive +g_cancellable_connect, function in GCancellable
-g_drive_can_poll_for_media, function in GDrive +g_cancellable_disconnect, function in GCancellable
-g_drive_can_start, function in GDrive +g_cancellable_get_current, function in GCancellable
-g_drive_can_start_degraded, function in GDrive +g_cancellable_get_fd, function in GCancellable
-g_drive_can_stop, function in GDrive +g_cancellable_is_cancelled, function in GCancellable
-g_drive_eject, function in GDrive +g_cancellable_make_pollfd, function in GCancellable
-g_drive_eject_finish, function in GDrive +g_cancellable_new, function in GCancellable
-g_drive_eject_with_operation, function in GDrive +g_cancellable_pop_current, function in GCancellable
-g_drive_eject_with_operation_finish, function in GDrive +g_cancellable_push_current, function in GCancellable
-g_drive_enumerate_identifiers, function in GDrive +g_cancellable_release_fd, function in GCancellable
-g_drive_get_icon, function in GDrive +g_cancellable_reset, function in GCancellable
-g_drive_get_identifier, function in GDrive +g_cancellable_set_error_if_cancelled, function in GCancellable
-g_drive_get_name, function in GDrive +g_cancellable_source_new, function in GCancellable
-g_drive_get_start_stop_type, function in GDrive +GCharsetConverter, struct in GCharsetConverter
-g_drive_get_volumes, function in GDrive +GCharsetConverter:from-charset, object property in GCharsetConverter
-g_drive_has_media, function in GDrive +GCharsetConverter:to-charset, object property in GCharsetConverter
-g_drive_has_volumes, function in GDrive +GCharsetConverter:use-fallback, object property in GCharsetConverter
-g_drive_is_media_check_automatic, function in GDrive +g_charset_converter_get_num_fallbacks, function in GCharsetConverter
-g_drive_is_media_removable, function in GDrive +g_charset_converter_get_use_fallback, function in GCharsetConverter
-g_drive_poll_for_media, function in GDrive +g_charset_converter_new, function in GCharsetConverter
-g_drive_poll_for_media_finish, function in GDrive +g_charset_converter_set_use_fallback, function in GCharsetConverter
-g_drive_start, function in GDrive +g_content_types_get_registered, function in GContentType
-g_drive_start_finish, function in GDrive +g_content_type_can_be_executable, function in GContentType
-g_drive_stop, function in GDrive +g_content_type_equals, function in GContentType
-g_drive_stop_finish, function in GDrive +g_content_type_from_mime_type, function in GContentType
-

E

-GEmblem, struct in GEmblem +g_content_type_get_description, function in GContentType
-GEmblem:icon, object property in GEmblem +g_content_type_get_icon, function in GContentType
-GEmblem:origin, object property in GEmblem +g_content_type_get_mime_type, function in GContentType
-GEmblemedIcon, struct in GEmblemedIcon +g_content_type_guess, function in GContentType
-g_emblemed_icon_add_emblem, function in GEmblemedIcon +g_content_type_guess_for_tree, function in GContentType
-g_emblemed_icon_get_emblems, function in GEmblemedIcon +g_content_type_is_a, function in GContentType
-g_emblemed_icon_get_icon, function in GEmblemedIcon +g_content_type_is_unknown, function in GContentType
-g_emblemed_icon_new, function in GEmblemedIcon +GConverter, struct in GConverter
-GEmblemOrigin, enum in GEmblem +GConverterFlags, enum in GConverter
-g_emblem_get_icon, function in GEmblem +GConverterIface, struct in GConverter
-g_emblem_get_origin, function in GEmblem +GConverterInputStream, struct in GConverterInputstream
-g_emblem_new, function in GEmblem +GConverterInputStream:converter, object property in GConverterInputstream
-g_emblem_new_with_origin, function in GEmblem +GConverterOutputStream, struct in GConverterOutputstream
-

F

-GFile, struct in GFile +GConverterOutputStream:converter, object property in GConverterOutputstream
-GFileAttributeInfo, struct in GFileAttribute +GConverterResult, enum in GConverter
-GFileAttributeInfoFlags, enum in GFileAttribute +g_converter_convert, function in GConverter
-GFileAttributeInfoList, struct in GFileAttribute +g_converter_input_stream_get_converter, function in GConverterInputstream
-GFileAttributeMatcher, struct in GFileInfo +g_converter_input_stream_new, function in GConverterInputstream
-GFileAttributeStatus, enum in GFileAttribute +g_converter_output_stream_get_converter, function in GConverterOutputstream
-GFileAttributeType, enum in GFileAttribute +g_converter_output_stream_new, function in GConverterOutputstream
-GFileCopyFlags, enum in GFile +g_converter_reset, function in GConverter
-GFileCreateFlags, enum in GFile +GCredentials, struct in GCredentials
-GFileDescriptorBased, struct in GFileDescriptorBased +GCredentialsType, enum in GCredentials
-GFileEnumerator, struct in GFileEnumerator +g_credentials_get_native, function in GCredentials
-GFileEnumerator:container, object property in GFileEnumerator +g_credentials_get_unix_user, function in GCredentials
-GFileIcon, struct in GFileIcon +g_credentials_is_same_user, function in GCredentials
-GFileIcon:file, object property in GFileIcon +g_credentials_new, function in GCredentials
-GFileIface, struct in GFile +g_credentials_set_native, function in GCredentials
-GFileInfo, struct in GFileInfo +g_credentials_set_unix_user, function in GCredentials
-GFileInputStream, struct in GFileInputStream +g_credentials_to_string, function in GCredentials
+

D

-GFileIOStream, struct in GFileIOStream +GDataInputStream, struct in GDataInputStream
-GFileMonitor, struct in GFileMonitor +GDataInputStream:byte-order, object property in GDataInputStream
-GFileMonitor::changed, object signal in GFileMonitor +GDataInputStream:newline-type, object property in GDataInputStream
-GFileMonitor:cancelled, object property in GFileMonitor +GDataOutputStream, struct in GDataOutputStream
-GFileMonitor:rate-limit, object property in GFileMonitor +GDataOutputStream:byte-order, object property in GDataOutputStream
-GFileMonitorEvent, enum in GFileMonitor +GDataStreamByteOrder, enum in GDataInputStream
-GFileMonitorFlags, enum in GFile +GDataStreamNewlineType, enum in GDataInputStream
-GFilenameCompleter, struct in GFilenameCompleter +g_data_input_stream_get_byte_order, function in GDataInputStream
-GFilenameCompleter::got-completion-data, object signal in GFilenameCompleter +g_data_input_stream_get_newline_type, function in GDataInputStream
-g_filename_completer_get_completions, function in GFilenameCompleter +g_data_input_stream_new, function in GDataInputStream
-g_filename_completer_get_completion_suffix, function in GFilenameCompleter +g_data_input_stream_read_byte, function in GDataInputStream
-g_filename_completer_new, function in GFilenameCompleter +g_data_input_stream_read_int16, function in GDataInputStream
-g_filename_completer_set_dirs_only, function in GFilenameCompleter +g_data_input_stream_read_int32, function in GDataInputStream
-GFileOutputStream, struct in GFileOutputStream +g_data_input_stream_read_int64, function in GDataInputStream
-GFileProgressCallback, user_function in GFile +g_data_input_stream_read_line, function in GDataInputStream
-GFileQueryInfoFlags, enum in GFile +g_data_input_stream_read_line_async, function in GDataInputStream
-GFileReadMoreCallback, user_function in GFile +g_data_input_stream_read_line_finish, function in GDataInputStream
-GFilesystemPreviewType, enum in GFile +g_data_input_stream_read_uint16, function in GDataInputStream
-GFileType, enum in GFileInfo +g_data_input_stream_read_uint32, function in GDataInputStream
-g_file_append_to, function in GFile +g_data_input_stream_read_uint64, function in GDataInputStream
-g_file_append_to_async, function in GFile +g_data_input_stream_read_until, function in GDataInputStream
-g_file_append_to_finish, function in GFile +g_data_input_stream_read_until_async, function in GDataInputStream
-G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, macro in GFileInfo +g_data_input_stream_read_until_finish, function in GDataInputStream
-G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, macro in GFileInfo +g_data_input_stream_read_upto, function in GDataInputStream
-G_FILE_ATTRIBUTE_ACCESS_CAN_READ, macro in GFileInfo +g_data_input_stream_read_upto_async, function in GDataInputStream
-G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME, macro in GFileInfo +g_data_input_stream_read_upto_finish, function in GDataInputStream
-G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, macro in GFileInfo +g_data_input_stream_set_byte_order, function in GDataInputStream
-G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, macro in GFileInfo +g_data_input_stream_set_newline_type, function in GDataInputStream
-G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE, macro in GFileInfo +g_data_output_stream_get_byte_order, function in GDataOutputStream
-G_FILE_ATTRIBUTE_DOS_IS_SYSTEM, macro in GFileInfo +g_data_output_stream_new, function in GDataOutputStream
-G_FILE_ATTRIBUTE_ETAG_VALUE, macro in GFileInfo +g_data_output_stream_put_byte, function in GDataOutputStream
-G_FILE_ATTRIBUTE_FILESYSTEM_FREE, macro in GFileInfo +g_data_output_stream_put_int16, function in GDataOutputStream
-G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, macro in GFileInfo +g_data_output_stream_put_int32, function in GDataOutputStream
-G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, macro in GFileInfo +g_data_output_stream_put_int64, function in GDataOutputStream
-G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, macro in GFileInfo +g_data_output_stream_put_string, function in GDataOutputStream
-G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, macro in GFileInfo +g_data_output_stream_put_uint16, function in GDataOutputStream
-G_FILE_ATTRIBUTE_GVFS_BACKEND, macro in GFileInfo +g_data_output_stream_put_uint32, function in GDataOutputStream
-G_FILE_ATTRIBUTE_ID_FILE, macro in GFileInfo +g_data_output_stream_put_uint64, function in GDataOutputStream
-G_FILE_ATTRIBUTE_ID_FILESYSTEM, macro in GFileInfo +g_data_output_stream_set_byte_order, function in GDataOutputStream
-g_file_attribute_info_list_add, function in GFileAttribute +GDBusAnnotationInfo, struct in D-Bus Introspection Data
-g_file_attribute_info_list_dup, function in GFileAttribute +GDBusArgInfo, struct in D-Bus Introspection Data
-g_file_attribute_info_list_lookup, function in GFileAttribute +GDBusAuthObserver, struct in GDBusAuthObserver
-g_file_attribute_info_list_new, function in GFileAttribute +GDBusAuthObserver::authorize-authenticated-peer, object signal in GDBusAuthObserver
-g_file_attribute_info_list_ref, function in GFileAttribute +GDBusCallFlags, enum in GDBusConnection
-g_file_attribute_info_list_unref, function in GFileAttribute +GDBusCapabilityFlags, enum in GDBusConnection
-g_file_attribute_matcher_enumerate_namespace, function in GFileInfo +GDBusConnection, struct in GDBusConnection
-g_file_attribute_matcher_enumerate_next, function in GFileInfo +GDBusConnection::closed, object signal in GDBusConnection
-g_file_attribute_matcher_matches, function in GFileInfo +GDBusConnection:address, object property in GDBusConnection
-g_file_attribute_matcher_matches_only, function in GFileInfo +GDBusConnection:authentication-observer, object property in GDBusConnection
-g_file_attribute_matcher_new, function in GFileInfo +GDBusConnection:capabilities, object property in GDBusConnection
-g_file_attribute_matcher_ref, function in GFileInfo +GDBusConnection:closed, object property in GDBusConnection
-g_file_attribute_matcher_unref, function in GFileInfo +GDBusConnection:exit-on-close, object property in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT, macro in GFileInfo +GDBusConnection:flags, object property in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, macro in GFileInfo +GDBusConnection:guid, object property in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL, macro in GFileInfo +GDBusConnection:stream, object property in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START, macro in GFileInfo +GDBusConnection:unique-name, object property in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED, macro in GFileInfo +GDBusConnectionFlags, enum in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP, macro in GFileInfo +GDBusError, enum in GDBusError
-G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT, macro in GFileInfo +GDBusErrorEntry, struct in GDBusError
-G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI, macro in GFileInfo +GDBusInterfaceGetPropertyFunc, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC, macro in GFileInfo +GDBusInterfaceInfo, struct in D-Bus Introspection Data
-G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE, macro in GFileInfo +GDBusInterfaceMethodCallFunc, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE, macro in GFileInfo +GDBusInterfaceSetPropertyFunc, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE, macro in GFileInfo +GDBusInterfaceVTable, struct in GDBusConnection
-G_FILE_ATTRIBUTE_OWNER_GROUP, macro in GFileInfo +GDBusMessage, struct in GDBusMessage
-G_FILE_ATTRIBUTE_OWNER_USER, macro in GFileInfo +GDBusMessage:locked, object property in GDBusMessage
-G_FILE_ATTRIBUTE_OWNER_USER_REAL, macro in GFileInfo +GDBusMessageByteOrder, enum in GDBusMessage
-G_FILE_ATTRIBUTE_PREVIEW_ICON, macro in GFileInfo +GDBusMessageFilterFunction, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_SELINUX_CONTEXT, macro in GFileInfo +GDBusMessageFlags, enum in GDBusMessage
-G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE, macro in GFileInfo +GDBusMessageHeaderField, enum in GDBusMessage
-G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, macro in GFileInfo +GDBusMessageType, enum in GDBusMessage
-G_FILE_ATTRIBUTE_STANDARD_COPY_NAME, macro in GFileInfo +GDBusMethodInfo, struct in D-Bus Introspection Data
-G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION, macro in GFileInfo +GDBusMethodInvocation, struct in GDBusMethodInvocation
-G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, macro in GFileInfo +GDBusNodeInfo, struct in D-Bus Introspection Data
-G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME, macro in GFileInfo +GDBusPropertyInfo, struct in D-Bus Introspection Data
-G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, macro in GFileInfo +GDBusPropertyInfoFlags, enum in D-Bus Introspection Data
-G_FILE_ATTRIBUTE_STANDARD_ICON, macro in GFileInfo +GDBusProxy, struct in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP, macro in GFileInfo +GDBusProxy::g-properties-changed, object signal in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN, macro in GFileInfo +GDBusProxy::g-signal, object signal in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK, macro in GFileInfo +GDBusProxy:g-bus-type, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL, macro in GFileInfo +GDBusProxy:g-connection, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_NAME, macro in GFileInfo +GDBusProxy:g-default-timeout, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_SIZE, macro in GFileInfo +GDBusProxy:g-flags, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER, macro in GFileInfo +GDBusProxy:g-interface-info, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET, macro in GFileInfo +GDBusProxy:g-interface-name, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_TARGET_URI, macro in GFileInfo +GDBusProxy:g-name, object property in GDBusProxy
-G_FILE_ATTRIBUTE_STANDARD_TYPE, macro in GFileInfo +GDBusProxy:g-name-owner, object property in GDBusProxy
-G_FILE_ATTRIBUTE_THUMBNAILING_FAILED, macro in GFileInfo +GDBusProxy:g-object-path, object property in GDBusProxy
-G_FILE_ATTRIBUTE_THUMBNAIL_PATH, macro in GFileInfo +GDBusProxyClass, struct in GDBusProxy
-G_FILE_ATTRIBUTE_TIME_ACCESS, macro in GFileInfo +GDBusProxyFlags, enum in GDBusProxy
-G_FILE_ATTRIBUTE_TIME_ACCESS_USEC, macro in GFileInfo +GDBusSendMessageFlags, enum in GDBusConnection
-G_FILE_ATTRIBUTE_TIME_CHANGED, macro in GFileInfo +GDBusServer, struct in GDBusServer
-G_FILE_ATTRIBUTE_TIME_CHANGED_USEC, macro in GFileInfo +GDBusServer::new-connection, object signal in GDBusServer
-G_FILE_ATTRIBUTE_TIME_CREATED, macro in GFileInfo +GDBusServer:active, object property in GDBusServer
-G_FILE_ATTRIBUTE_TIME_CREATED_USEC, macro in GFileInfo +GDBusServer:address, object property in GDBusServer
-G_FILE_ATTRIBUTE_TIME_MODIFIED, macro in GFileInfo +GDBusServer:authentication-observer, object property in GDBusServer
-G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, macro in GFileInfo +GDBusServer:client-address, object property in GDBusServer
-G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT, macro in GFileInfo +GDBusServer:flags, object property in GDBusServer
-G_FILE_ATTRIBUTE_UNIX_BLOCKS, macro in GFileInfo +GDBusServer:guid, object property in GDBusServer
-G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE, macro in GFileInfo +GDBusServerFlags, enum in GDBusServer
-G_FILE_ATTRIBUTE_UNIX_DEVICE, macro in GFileInfo +GDBusSignalCallback, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_UNIX_GID, macro in GFileInfo +GDBusSignalFlags, enum in GDBusConnection
-G_FILE_ATTRIBUTE_UNIX_INODE, macro in GFileInfo +GDBusSignalInfo, struct in D-Bus Introspection Data
-G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT, macro in GFileInfo +GDBusSubtreeDispatchFunc, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_UNIX_MODE, macro in GFileInfo +GDBusSubtreeEnumerateFunc, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_UNIX_NLINK, macro in GFileInfo +GDBusSubtreeFlags, enum in GDBusConnection
-G_FILE_ATTRIBUTE_UNIX_RDEV, macro in GFileInfo +GDBusSubtreeIntrospectFunc, user_function in GDBusConnection
-G_FILE_ATTRIBUTE_UNIX_UID, macro in GFileInfo +GDBusSubtreeVTable, struct in GDBusConnection
-g_file_copy, function in GFile +g_dbus_address_get_for_bus_sync, function in D-Bus Addresses
-g_file_copy_async, function in GFile +g_dbus_address_get_stream, function in D-Bus Addresses
-g_file_copy_attributes, function in GFile +g_dbus_address_get_stream_finish, function in D-Bus Addresses
-g_file_copy_finish, function in GFile +g_dbus_address_get_stream_sync, function in D-Bus Addresses
-g_file_create, function in GFile +g_dbus_annotation_info_lookup, function in D-Bus Introspection Data
-g_file_create_async, function in GFile +g_dbus_annotation_info_ref, function in D-Bus Introspection Data
-g_file_create_finish, function in GFile +g_dbus_annotation_info_unref, function in D-Bus Introspection Data
-g_file_create_readwrite, function in GFile +g_dbus_arg_info_ref, function in D-Bus Introspection Data
-g_file_create_readwrite_async, function in GFile +g_dbus_arg_info_unref, function in D-Bus Introspection Data
-g_file_create_readwrite_finish, function in GFile +g_dbus_auth_observer_authorize_authenticated_peer, function in GDBusAuthObserver
-g_file_delete, function in GFile +g_dbus_auth_observer_new, function in GDBusAuthObserver
-g_file_descriptor_based_get_fd, function in GFileDescriptorBased +g_dbus_connection_add_filter, function in GDBusConnection
-g_file_dup, function in GFile +g_dbus_connection_call, function in GDBusConnection
-g_file_eject_mountable, function in GFile +g_dbus_connection_call_finish, function in GDBusConnection
-g_file_eject_mountable_finish, function in GFile +g_dbus_connection_call_sync, function in GDBusConnection
-g_file_eject_mountable_with_operation, function in GFile +g_dbus_connection_close, function in GDBusConnection
-g_file_eject_mountable_with_operation_finish, function in GFile +g_dbus_connection_close_finish, function in GDBusConnection
-g_file_enumerate_children, function in GFile +g_dbus_connection_close_sync, function in GDBusConnection
-g_file_enumerate_children_async, function in GFile +g_dbus_connection_emit_signal, function in GDBusConnection
-g_file_enumerate_children_finish, function in GFile +g_dbus_connection_flush, function in GDBusConnection
-g_file_enumerator_close, function in GFileEnumerator +g_dbus_connection_flush_finish, function in GDBusConnection
-g_file_enumerator_close_async, function in GFileEnumerator +g_dbus_connection_flush_sync, function in GDBusConnection
-g_file_enumerator_close_finish, function in GFileEnumerator +g_dbus_connection_get_capabilities, function in GDBusConnection
-g_file_enumerator_get_container, function in GFileEnumerator +g_dbus_connection_get_exit_on_close, function in GDBusConnection
-g_file_enumerator_has_pending, function in GFileEnumerator +g_dbus_connection_get_guid, function in GDBusConnection
-g_file_enumerator_is_closed, function in GFileEnumerator +g_dbus_connection_get_peer_credentials, function in GDBusConnection
-g_file_enumerator_next_file, function in GFileEnumerator +g_dbus_connection_get_stream, function in GDBusConnection
-g_file_enumerator_next_files_async, function in GFileEnumerator +g_dbus_connection_get_unique_name, function in GDBusConnection
-g_file_enumerator_next_files_finish, function in GFileEnumerator +g_dbus_connection_is_closed, function in GDBusConnection
-g_file_enumerator_set_pending, function in GFileEnumerator +g_dbus_connection_new, function in GDBusConnection
-g_file_equal, function in GFile +g_dbus_connection_new_finish, function in GDBusConnection
-g_file_find_enclosing_mount, function in GFile +g_dbus_connection_new_for_address, function in GDBusConnection
-g_file_find_enclosing_mount_async, function in GFile +g_dbus_connection_new_for_address_finish, function in GDBusConnection
-g_file_find_enclosing_mount_finish, function in GFile +g_dbus_connection_new_for_address_sync, function in GDBusConnection
-g_file_get_basename, function in GFile +g_dbus_connection_new_sync, function in GDBusConnection
-g_file_get_child, function in GFile +g_dbus_connection_register_object, function in GDBusConnection
-g_file_get_child_for_display_name, function in GFile +g_dbus_connection_register_subtree, function in GDBusConnection
-g_file_get_parent, function in GFile +g_dbus_connection_remove_filter, function in GDBusConnection
-g_file_get_parse_name, function in GFile +g_dbus_connection_send_message, function in GDBusConnection
-g_file_get_path, function in GFile +g_dbus_connection_send_message_with_reply, function in GDBusConnection
-g_file_get_relative_path, function in GFile +g_dbus_connection_send_message_with_reply_finish, function in GDBusConnection
-g_file_get_uri, function in GFile +g_dbus_connection_send_message_with_reply_sync, function in GDBusConnection
-g_file_get_uri_scheme, function in GFile +g_dbus_connection_set_exit_on_close, function in GDBusConnection
-g_file_hash, function in GFile +g_dbus_connection_signal_subscribe, function in GDBusConnection
-g_file_has_parent, function in GFile +g_dbus_connection_signal_unsubscribe, function in GDBusConnection
-g_file_has_prefix, function in GFile +g_dbus_connection_start_message_processing, function in GDBusConnection
-g_file_has_uri_scheme, function in GFile +g_dbus_connection_unregister_object, function in GDBusConnection
-g_file_icon_get_file, function in GFileIcon +g_dbus_connection_unregister_subtree, function in GDBusConnection
-g_file_icon_new, function in GFileIcon +G_DBUS_ERROR, macro in GDBusError
-g_file_info_clear_status, function in GFileInfo +g_dbus_error_encode_gerror, function in GDBusError
-g_file_info_copy_into, function in GFileInfo +g_dbus_error_get_remote_error, function in GDBusError
-g_file_info_dup, function in GFileInfo +g_dbus_error_is_remote_error, function in GDBusError
-g_file_info_get_attribute_as_string, function in GFileInfo +g_dbus_error_new_for_dbus_error, function in GDBusError
-g_file_info_get_attribute_boolean, function in GFileInfo +g_dbus_error_register_error, function in GDBusError
-g_file_info_get_attribute_byte_string, function in GFileInfo +g_dbus_error_register_error_domain, function in GDBusError
-g_file_info_get_attribute_data, function in GFileInfo +g_dbus_error_set_dbus_error, function in GDBusError
-g_file_info_get_attribute_int32, function in GFileInfo +g_dbus_error_set_dbus_error_valist, function in GDBusError
-g_file_info_get_attribute_int64, function in GFileInfo +g_dbus_error_strip_remote_error, function in GDBusError
-g_file_info_get_attribute_object, function in GFileInfo +g_dbus_error_unregister_error, function in GDBusError
-g_file_info_get_attribute_status, function in GFileInfo +g_dbus_generate_guid, function in D-Bus Utilities
-g_file_info_get_attribute_string, function in GFileInfo +g_dbus_interface_info_generate_xml, function in D-Bus Introspection Data
-g_file_info_get_attribute_stringv, function in GFileInfo +g_dbus_interface_info_lookup_method, function in D-Bus Introspection Data
-g_file_info_get_attribute_type, function in GFileInfo +g_dbus_interface_info_lookup_property, function in D-Bus Introspection Data
-g_file_info_get_attribute_uint32, function in GFileInfo +g_dbus_interface_info_lookup_signal, function in D-Bus Introspection Data
-g_file_info_get_attribute_uint64, function in GFileInfo +g_dbus_interface_info_ref, function in D-Bus Introspection Data
-g_file_info_get_content_type, function in GFileInfo +g_dbus_interface_info_unref, function in D-Bus Introspection Data
-g_file_info_get_display_name, function in GFileInfo +g_dbus_is_address, function in D-Bus Addresses
-g_file_info_get_edit_name, function in GFileInfo +g_dbus_is_guid, function in D-Bus Utilities
-g_file_info_get_etag, function in GFileInfo +g_dbus_is_interface_name, function in D-Bus Utilities
-g_file_info_get_file_type, function in GFileInfo +g_dbus_is_member_name, function in D-Bus Utilities
-g_file_info_get_icon, function in GFileInfo +g_dbus_is_name, function in D-Bus Utilities
-g_file_info_get_is_backup, function in GFileInfo +g_dbus_is_supported_address, function in D-Bus Addresses
-g_file_info_get_is_hidden, function in GFileInfo +g_dbus_is_unique_name, function in D-Bus Utilities
-g_file_info_get_is_symlink, function in GFileInfo +g_dbus_message_bytes_needed, function in GDBusMessage
-g_file_info_get_modification_time, function in GFileInfo +g_dbus_message_copy, function in GDBusMessage
-g_file_info_get_name, function in GFileInfo +g_dbus_message_get_arg0, function in GDBusMessage
-g_file_info_get_size, function in GFileInfo +g_dbus_message_get_body, function in GDBusMessage
-g_file_info_get_sort_order, function in GFileInfo +g_dbus_message_get_byte_order, function in GDBusMessage
-g_file_info_get_symlink_target, function in GFileInfo +g_dbus_message_get_destination, function in GDBusMessage
-g_file_info_has_attribute, function in GFileInfo +g_dbus_message_get_error_name, function in GDBusMessage
-g_file_info_has_namespace, function in GFileInfo +g_dbus_message_get_flags, function in GDBusMessage
-g_file_info_list_attributes, function in GFileInfo +g_dbus_message_get_header, function in GDBusMessage
-g_file_info_new, function in GFileInfo +g_dbus_message_get_header_fields, function in GDBusMessage
-g_file_info_remove_attribute, function in GFileInfo +g_dbus_message_get_interface, function in GDBusMessage
-g_file_info_set_attribute, function in GFileInfo +g_dbus_message_get_locked, function in GDBusMessage
-g_file_info_set_attribute_boolean, function in GFileInfo +g_dbus_message_get_member, function in GDBusMessage
-g_file_info_set_attribute_byte_string, function in GFileInfo +g_dbus_message_get_message_type, function in GDBusMessage
-g_file_info_set_attribute_int32, function in GFileInfo +g_dbus_message_get_num_unix_fds, function in GDBusMessage
-g_file_info_set_attribute_int64, function in GFileInfo +g_dbus_message_get_path, function in GDBusMessage
-g_file_info_set_attribute_mask, function in GFileInfo +g_dbus_message_get_reply_serial, function in GDBusMessage
-g_file_info_set_attribute_object, function in GFileInfo +g_dbus_message_get_sender, function in GDBusMessage
-g_file_info_set_attribute_status, function in GFileInfo +g_dbus_message_get_serial, function in GDBusMessage
-g_file_info_set_attribute_string, function in GFileInfo +g_dbus_message_get_signature, function in GDBusMessage
-g_file_info_set_attribute_stringv, function in GFileInfo +g_dbus_message_get_unix_fd_list, function in GDBusMessage
-g_file_info_set_attribute_uint32, function in GFileInfo +g_dbus_message_lock, function in GDBusMessage
-g_file_info_set_attribute_uint64, function in GFileInfo +g_dbus_message_new, function in GDBusMessage
-g_file_info_set_content_type, function in GFileInfo +g_dbus_message_new_from_blob, function in GDBusMessage
-g_file_info_set_display_name, function in GFileInfo +g_dbus_message_new_method_call, function in GDBusMessage
-g_file_info_set_edit_name, function in GFileInfo +g_dbus_message_new_method_error, function in GDBusMessage
-g_file_info_set_file_type, function in GFileInfo +g_dbus_message_new_method_error_literal, function in GDBusMessage
-g_file_info_set_icon, function in GFileInfo +g_dbus_message_new_method_error_valist, function in GDBusMessage
-g_file_info_set_is_hidden, function in GFileInfo +g_dbus_message_new_method_reply, function in GDBusMessage
-g_file_info_set_is_symlink, function in GFileInfo +g_dbus_message_new_signal, function in GDBusMessage
-g_file_info_set_modification_time, function in GFileInfo +g_dbus_message_print, function in GDBusMessage
-g_file_info_set_name, function in GFileInfo +g_dbus_message_set_body, function in GDBusMessage
-g_file_info_set_size, function in GFileInfo +g_dbus_message_set_byte_order, function in GDBusMessage
-g_file_info_set_sort_order, function in GFileInfo +g_dbus_message_set_destination, function in GDBusMessage
-g_file_info_set_symlink_target, function in GFileInfo +g_dbus_message_set_error_name, function in GDBusMessage
-g_file_info_unset_attribute_mask, function in GFileInfo +g_dbus_message_set_flags, function in GDBusMessage
-g_file_input_stream_query_info, function in GFileInputStream +g_dbus_message_set_header, function in GDBusMessage
-g_file_input_stream_query_info_async, function in GFileInputStream +g_dbus_message_set_interface, function in GDBusMessage
-g_file_input_stream_query_info_finish, function in GFileInputStream +g_dbus_message_set_member, function in GDBusMessage
-g_file_io_stream_get_etag, function in GFileIOStream +g_dbus_message_set_message_type, function in GDBusMessage
-g_file_io_stream_query_info, function in GFileIOStream +g_dbus_message_set_num_unix_fds, function in GDBusMessage
-g_file_io_stream_query_info_async, function in GFileIOStream +g_dbus_message_set_path, function in GDBusMessage
-g_file_io_stream_query_info_finish, function in GFileIOStream +g_dbus_message_set_reply_serial, function in GDBusMessage
-g_file_is_native, function in GFile +g_dbus_message_set_sender, function in GDBusMessage
-g_file_load_contents, function in GFile +g_dbus_message_set_serial, function in GDBusMessage
-g_file_load_contents_async, function in GFile +g_dbus_message_set_signature, function in GDBusMessage
-g_file_load_contents_finish, function in GFile +g_dbus_message_set_unix_fd_list, function in GDBusMessage
-g_file_load_partial_contents_async, function in GFile +g_dbus_message_to_blob, function in GDBusMessage
-g_file_load_partial_contents_finish, function in GFile +g_dbus_message_to_gerror, function in GDBusMessage
-g_file_make_directory, function in GFile +g_dbus_method_info_ref, function in D-Bus Introspection Data
-g_file_make_directory_with_parents, function in GFile +g_dbus_method_info_unref, function in D-Bus Introspection Data
-g_file_make_symbolic_link, function in GFile +g_dbus_method_invocation_get_connection, function in GDBusMethodInvocation
-g_file_monitor, function in GFile +g_dbus_method_invocation_get_interface_name, function in GDBusMethodInvocation
-g_file_monitor_cancel, function in GFileMonitor +g_dbus_method_invocation_get_message, function in GDBusMethodInvocation
-g_file_monitor_directory, function in GFile +g_dbus_method_invocation_get_method_info, function in GDBusMethodInvocation
-g_file_monitor_emit_event, function in GFileMonitor +g_dbus_method_invocation_get_method_name, function in GDBusMethodInvocation
-g_file_monitor_file, function in GFile +g_dbus_method_invocation_get_object_path, function in GDBusMethodInvocation
-g_file_monitor_is_cancelled, function in GFileMonitor +g_dbus_method_invocation_get_parameters, function in GDBusMethodInvocation
-g_file_monitor_set_rate_limit, function in GFileMonitor +g_dbus_method_invocation_get_sender, function in GDBusMethodInvocation
-g_file_mount_enclosing_volume, function in GFile +g_dbus_method_invocation_get_user_data, function in GDBusMethodInvocation
-g_file_mount_enclosing_volume_finish, function in GFile +g_dbus_method_invocation_return_dbus_error, function in GDBusMethodInvocation
-g_file_mount_mountable, function in GFile +g_dbus_method_invocation_return_error, function in GDBusMethodInvocation
-g_file_mount_mountable_finish, function in GFile +g_dbus_method_invocation_return_error_literal, function in GDBusMethodInvocation
-g_file_move, function in GFile +g_dbus_method_invocation_return_error_valist, function in GDBusMethodInvocation
-g_file_new_for_commandline_arg, function in GFile +g_dbus_method_invocation_return_gerror, function in GDBusMethodInvocation
-g_file_new_for_path, function in GFile +g_dbus_method_invocation_return_value, function in GDBusMethodInvocation
-g_file_new_for_uri, function in GFile +g_dbus_node_info_generate_xml, function in D-Bus Introspection Data
-g_file_open_readwrite, function in GFile +g_dbus_node_info_lookup_interface, function in D-Bus Introspection Data
-g_file_open_readwrite_async, function in GFile +g_dbus_node_info_new_for_xml, function in D-Bus Introspection Data
-g_file_open_readwrite_finish, function in GFile +g_dbus_node_info_ref, function in D-Bus Introspection Data
-g_file_output_stream_get_etag, function in GFileOutputStream +g_dbus_node_info_unref, function in D-Bus Introspection Data
-g_file_output_stream_query_info, function in GFileOutputStream +g_dbus_property_info_ref, function in D-Bus Introspection Data
-g_file_output_stream_query_info_async, function in GFileOutputStream +g_dbus_property_info_unref, function in D-Bus Introspection Data
-g_file_output_stream_query_info_finish, function in GFileOutputStream +g_dbus_proxy_call, function in GDBusProxy
-g_file_parse_name, function in GFile +g_dbus_proxy_call_finish, function in GDBusProxy
-g_file_poll_mountable, function in GFile +g_dbus_proxy_call_sync, function in GDBusProxy
-g_file_poll_mountable_finish, function in GFile +g_dbus_proxy_get_cached_property, function in GDBusProxy
-g_file_query_default_handler, function in GFile +g_dbus_proxy_get_cached_property_names, function in GDBusProxy
-g_file_query_exists, function in GFile +g_dbus_proxy_get_connection, function in GDBusProxy
-g_file_query_filesystem_info, function in GFile +g_dbus_proxy_get_default_timeout, function in GDBusProxy
-g_file_query_filesystem_info_async, function in GFile +g_dbus_proxy_get_flags, function in GDBusProxy
-g_file_query_filesystem_info_finish, function in GFile +g_dbus_proxy_get_interface_info, function in GDBusProxy
-g_file_query_file_type, function in GFile +g_dbus_proxy_get_interface_name, function in GDBusProxy
-g_file_query_info, function in GFile +g_dbus_proxy_get_name, function in GDBusProxy
-g_file_query_info_async, function in GFile +g_dbus_proxy_get_name_owner, function in GDBusProxy
-g_file_query_info_finish, function in GFile +g_dbus_proxy_get_object_path, function in GDBusProxy
-g_file_query_settable_attributes, function in GFile +g_dbus_proxy_new, function in GDBusProxy
-g_file_query_writable_namespaces, function in GFile +g_dbus_proxy_new_finish, function in GDBusProxy
-g_file_read, function in GFile +g_dbus_proxy_new_for_bus, function in GDBusProxy
-g_file_read_async, function in GFile +g_dbus_proxy_new_for_bus_finish, function in GDBusProxy
-g_file_read_finish, function in GFile +g_dbus_proxy_new_for_bus_sync, function in GDBusProxy
-g_file_replace, function in GFile +g_dbus_proxy_new_sync, function in GDBusProxy
-g_file_replace_async, function in GFile +g_dbus_proxy_set_cached_property, function in GDBusProxy
-g_file_replace_contents, function in GFile +g_dbus_proxy_set_default_timeout, function in GDBusProxy
-g_file_replace_contents_async, function in GFile +g_dbus_proxy_set_interface_info, function in GDBusProxy
-g_file_replace_contents_finish, function in GFile +g_dbus_server_get_client_address, function in GDBusServer
-g_file_replace_finish, function in GFile +g_dbus_server_get_flags, function in GDBusServer
-g_file_replace_readwrite, function in GFile +g_dbus_server_get_guid, function in GDBusServer
-g_file_replace_readwrite_async, function in GFile +g_dbus_server_is_active, function in GDBusServer
-g_file_replace_readwrite_finish, function in GFile +g_dbus_server_new_sync, function in GDBusServer
-g_file_resolve_relative_path, function in GFile +g_dbus_server_start, function in GDBusServer
-g_file_set_attribute, function in GFile +g_dbus_server_stop, function in GDBusServer
-g_file_set_attributes_async, function in GFile +g_dbus_signal_info_ref, function in D-Bus Introspection Data
-g_file_set_attributes_finish, function in GFile +g_dbus_signal_info_unref, function in D-Bus Introspection Data
-g_file_set_attributes_from_info, function in GFile +GDesktopAppInfo, struct in Desktop file based GAppInfo
-g_file_set_attribute_byte_string, function in GFile +g_desktop_app_info_get_filename, function in Desktop file based GAppInfo
-g_file_set_attribute_int32, function in GFile +g_desktop_app_info_get_is_hidden, function in Desktop file based GAppInfo
-g_file_set_attribute_int64, function in GFile +g_desktop_app_info_new, function in Desktop file based GAppInfo
-g_file_set_attribute_string, function in GFile +g_desktop_app_info_new_from_filename, function in Desktop file based GAppInfo
-g_file_set_attribute_uint32, function in GFile +g_desktop_app_info_new_from_keyfile, function in Desktop file based GAppInfo
-g_file_set_attribute_uint64, function in GFile +g_desktop_app_info_set_desktop_env, function in Desktop file based GAppInfo
-g_file_set_display_name, function in GFile +GDrive, struct in GDrive
-g_file_set_display_name_async, function in GFile +GDrive::changed, object signal in GDrive
-g_file_set_display_name_finish, function in GFile +GDrive::disconnected, object signal in GDrive
-g_file_start_mountable, function in GFile +GDrive::eject-button, object signal in GDrive
-g_file_start_mountable_finish, function in GFile +GDrive::stop-button, object signal in GDrive
-g_file_stop_mountable, function in GFile +GDriveIface, struct in GDrive
-g_file_stop_mountable_finish, function in GFile +GDriveStartFlags, enum in GDrive
-g_file_supports_thread_contexts, function in GFile +GDriveStartStopType, enum in GDrive
-g_file_trash, function in GFile +g_drive_can_eject, function in GDrive
-g_file_unmount_mountable, function in GFile +g_drive_can_poll_for_media, function in GDrive
-g_file_unmount_mountable_finish, function in GFile +g_drive_can_start, function in GDrive
-g_file_unmount_mountable_with_operation, function in GFile +g_drive_can_start_degraded, function in GDrive
-g_file_unmount_mountable_with_operation_finish, function in GFile +g_drive_can_stop, function in GDrive
-GFilterInputStream, struct in GFilterInputStream +g_drive_eject, function in GDrive
-GFilterInputStream:base-stream, object property in GFilterInputStream +g_drive_eject_finish, function in GDrive
-GFilterInputStream:close-base-stream, object property in GFilterInputStream +g_drive_eject_with_operation, function in GDrive
-GFilterOutputStream, struct in GFilterOutputStream +g_drive_eject_with_operation_finish, function in GDrive
-GFilterOutputStream:base-stream, object property in GFilterOutputStream +g_drive_enumerate_identifiers, function in GDrive
-GFilterOutputStream:close-base-stream, object property in GFilterOutputStream +g_drive_get_icon, function in GDrive
-g_filter_input_stream_get_base_stream, function in GFilterInputStream +g_drive_get_identifier, function in GDrive
-g_filter_input_stream_get_close_base_stream, function in GFilterInputStream +g_drive_get_name, function in GDrive
-g_filter_input_stream_set_close_base_stream, function in GFilterInputStream +g_drive_get_start_stop_type, function in GDrive
-g_filter_output_stream_get_base_stream, function in GFilterOutputStream +g_drive_get_volumes, function in GDrive
-g_filter_output_stream_get_close_base_stream, function in GFilterOutputStream +g_drive_has_media, function in GDrive
-g_filter_output_stream_set_close_base_stream, function in GFilterOutputStream +g_drive_has_volumes, function in GDrive
-

I

-GIcon, struct in GIcon +g_drive_is_media_check_automatic, function in GDrive
-GIconIface, struct in GIcon +g_drive_is_media_removable, function in GDrive
-g_icon_equal, function in GIcon +g_drive_poll_for_media, function in GDrive
-g_icon_hash, function in GIcon +g_drive_poll_for_media_finish, function in GDrive
-g_icon_new_for_string, function in GIcon +g_drive_start, function in GDrive
-g_icon_to_string, function in GIcon +g_drive_start_finish, function in GDrive
-GInetAddress, struct in GInetAddress +g_drive_stop, function in GDrive
-GInetAddress:bytes, object property in GInetAddress +g_drive_stop_finish, function in GDrive
+

E

-GInetAddress:family, object property in GInetAddress +GEmblem, struct in GEmblem
-GInetAddress:is-any, object property in GInetAddress +GEmblem:icon, object property in GEmblem
-GInetAddress:is-link-local, object property in GInetAddress +GEmblem:origin, object property in GEmblem
-GInetAddress:is-loopback, object property in GInetAddress +GEmblemedIcon, struct in GEmblemedIcon
-GInetAddress:is-mc-global, object property in GInetAddress +GEmblemedIcon:gicon, object property in GEmblemedIcon
-GInetAddress:is-mc-link-local, object property in GInetAddress +g_emblemed_icon_add_emblem, function in GEmblemedIcon
-GInetAddress:is-mc-node-local, object property in GInetAddress +g_emblemed_icon_clear_emblems, function in GEmblemedIcon
-GInetAddress:is-mc-org-local, object property in GInetAddress +g_emblemed_icon_get_emblems, function in GEmblemedIcon
-GInetAddress:is-mc-site-local, object property in GInetAddress +g_emblemed_icon_get_icon, function in GEmblemedIcon
-GInetAddress:is-multicast, object property in GInetAddress +g_emblemed_icon_new, function in GEmblemedIcon
-GInetAddress:is-site-local, object property in GInetAddress +GEmblemOrigin, enum in GEmblem
-GInetSocketAddress, struct in GInetSocketAddress +g_emblem_get_icon, function in GEmblem
-GInetSocketAddress:address, object property in GInetSocketAddress +g_emblem_get_origin, function in GEmblem
-GInetSocketAddress:port, object property in GInetSocketAddress +g_emblem_new, function in GEmblem +
+
+
+g_emblem_new_with_origin, function in GEmblem +
+
+

F

+
+GFile, struct in GFile +
+
+
+GFileAttributeInfo, struct in GFileAttribute +
+
+
+GFileAttributeInfoFlags, enum in GFileAttribute +
+
+
+GFileAttributeInfoList, struct in GFileAttribute +
+
+
+GFileAttributeMatcher, struct in GFileInfo +
+
+
+GFileAttributeStatus, enum in GFileAttribute +
+
+
+GFileAttributeType, enum in GFileAttribute +
+
+
+GFileCopyFlags, enum in GFile +
+
+
+GFileCreateFlags, enum in GFile +
+
+
+GFileDescriptorBased, struct in GFileDescriptorBased +
+
+
+GFileEnumerator, struct in GFileEnumerator +
+
+
+GFileEnumerator:container, object property in GFileEnumerator +
+
+
+GFileIcon, struct in GFileIcon +
+
+
+GFileIcon:file, object property in GFileIcon +
+
+
+GFileIface, struct in GFile +
+
+
+GFileInfo, struct in GFileInfo +
+
+
+GFileInputStream, struct in GFileInputStream +
+
+
+GFileIOStream, struct in GFileIOStream +
+
+
+GFileMonitor, struct in GFileMonitor +
+
+
+GFileMonitor::changed, object signal in GFileMonitor +
+
+
+GFileMonitor:cancelled, object property in GFileMonitor +
+
+
+GFileMonitor:rate-limit, object property in GFileMonitor +
+
+
+GFileMonitorEvent, enum in GFileMonitor +
+
+
+GFileMonitorFlags, enum in GFile +
+
+
+GFilenameCompleter, struct in GFilenameCompleter +
+
+
+GFilenameCompleter::got-completion-data, object signal in GFilenameCompleter +
+
+
+g_filename_completer_get_completions, function in GFilenameCompleter +
+
+
+g_filename_completer_get_completion_suffix, function in GFilenameCompleter +
+
+
+g_filename_completer_new, function in GFilenameCompleter +
+
+
+g_filename_completer_set_dirs_only, function in GFilenameCompleter +
+
+
+GFileOutputStream, struct in GFileOutputStream +
+
+
+GFileProgressCallback, user_function in GFile +
+
+
+GFileQueryInfoFlags, enum in GFile +
+
+
+GFileReadMoreCallback, user_function in GFile +
+
+
+GFilesystemPreviewType, enum in GFile +
+
+
+GFileType, enum in GFileInfo +
+
+
+g_file_append_to, function in GFile +
+
+
+g_file_append_to_async, function in GFile +
+
+
+g_file_append_to_finish, function in GFile +
+
+
+G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ACCESS_CAN_READ, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_DOS_IS_SYSTEM, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ETAG_VALUE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_FILESYSTEM_FREE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_GVFS_BACKEND, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ID_FILE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_ID_FILESYSTEM, macro in GFileInfo +
+
+
+g_file_attribute_info_list_add, function in GFileAttribute +
+
+
+g_file_attribute_info_list_dup, function in GFileAttribute +
+
+
+g_file_attribute_info_list_lookup, function in GFileAttribute +
+
+
+g_file_attribute_info_list_new, function in GFileAttribute +
+
+
+g_file_attribute_info_list_ref, function in GFileAttribute +
+
+
+g_file_attribute_info_list_unref, function in GFileAttribute +
+
+
+g_file_attribute_matcher_enumerate_namespace, function in GFileInfo +
+
+
+g_file_attribute_matcher_enumerate_next, function in GFileInfo +
+
+
+g_file_attribute_matcher_matches, function in GFileInfo +
+
+
+g_file_attribute_matcher_matches_only, function in GFileInfo +
+
+
+g_file_attribute_matcher_new, function in GFileInfo +
+
+
+g_file_attribute_matcher_ref, function in GFileInfo +
+
+
+g_file_attribute_matcher_unref, function in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_OWNER_GROUP, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_OWNER_USER, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_OWNER_USER_REAL, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_PREVIEW_ICON, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_SELINUX_CONTEXT, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_COPY_NAME, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_ICON, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_NAME, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_SIZE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_TARGET_URI, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_STANDARD_TYPE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_THUMBNAILING_FAILED, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_THUMBNAIL_PATH, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_ACCESS, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_ACCESS_USEC, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_CHANGED, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_CHANGED_USEC, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_CREATED, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_CREATED_USEC, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_MODIFIED, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TRASH_DELETION_DATE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_TRASH_ORIG_PATH, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_BLOCKS, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_DEVICE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_GID, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_INODE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_MODE, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_NLINK, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_RDEV, macro in GFileInfo +
+
+
+G_FILE_ATTRIBUTE_UNIX_UID, macro in GFileInfo +
+
+
+g_file_copy, function in GFile +
+
+
+g_file_copy_async, function in GFile +
+
+
+g_file_copy_attributes, function in GFile +
+
+
+g_file_copy_finish, function in GFile +
+
+
+g_file_create, function in GFile +
+
+
+g_file_create_async, function in GFile +
+
+
+g_file_create_finish, function in GFile +
+
+
+g_file_create_readwrite, function in GFile +
+
+
+g_file_create_readwrite_async, function in GFile +
+
+
+g_file_create_readwrite_finish, function in GFile +
+
+
+g_file_delete, function in GFile +
+
+
+g_file_descriptor_based_get_fd, function in GFileDescriptorBased +
+
+
+g_file_dup, function in GFile +
+
+
+g_file_eject_mountable, function in GFile +
+
+
+g_file_eject_mountable_finish, function in GFile +
+
+
+g_file_eject_mountable_with_operation, function in GFile +
+
+
+g_file_eject_mountable_with_operation_finish, function in GFile +
+
+
+g_file_enumerate_children, function in GFile +
+
+
+g_file_enumerate_children_async, function in GFile +
+
+
+g_file_enumerate_children_finish, function in GFile +
+
+
+g_file_enumerator_close, function in GFileEnumerator +
+
+
+g_file_enumerator_close_async, function in GFileEnumerator +
+
+
+g_file_enumerator_close_finish, function in GFileEnumerator +
+
+
+g_file_enumerator_get_container, function in GFileEnumerator +
+
+
+g_file_enumerator_has_pending, function in GFileEnumerator +
+
+
+g_file_enumerator_is_closed, function in GFileEnumerator +
+
+
+g_file_enumerator_next_file, function in GFileEnumerator +
+
+
+g_file_enumerator_next_files_async, function in GFileEnumerator +
+
+
+g_file_enumerator_next_files_finish, function in GFileEnumerator +
+
+
+g_file_enumerator_set_pending, function in GFileEnumerator +
+
+
+g_file_equal, function in GFile +
+
+
+g_file_find_enclosing_mount, function in GFile +
+
+
+g_file_find_enclosing_mount_async, function in GFile +
+
+
+g_file_find_enclosing_mount_finish, function in GFile +
+
+
+g_file_get_basename, function in GFile +
+
+
+g_file_get_child, function in GFile +
+
+
+g_file_get_child_for_display_name, function in GFile +
+
+
+g_file_get_parent, function in GFile +
+
+
+g_file_get_parse_name, function in GFile +
+
+
+g_file_get_path, function in GFile +
+
+
+g_file_get_relative_path, function in GFile +
+
+
+g_file_get_uri, function in GFile +
+
+
+g_file_get_uri_scheme, function in GFile +
+
+
+g_file_hash, function in GFile +
+
+
+g_file_has_parent, function in GFile +
+
+
+g_file_has_prefix, function in GFile +
+
+
+g_file_has_uri_scheme, function in GFile +
+
+
+g_file_icon_get_file, function in GFileIcon +
+
+
+g_file_icon_new, function in GFileIcon +
+
+
+g_file_info_clear_status, function in GFileInfo +
+
+
+g_file_info_copy_into, function in GFileInfo +
+
+
+g_file_info_dup, function in GFileInfo +
+
+
+g_file_info_get_attribute_as_string, function in GFileInfo +
+
+
+g_file_info_get_attribute_boolean, function in GFileInfo +
+
+
+g_file_info_get_attribute_byte_string, function in GFileInfo +
+
+
+g_file_info_get_attribute_data, function in GFileInfo +
+
+
+g_file_info_get_attribute_int32, function in GFileInfo +
+
+
+g_file_info_get_attribute_int64, function in GFileInfo +
+
+
+g_file_info_get_attribute_object, function in GFileInfo +
+
+
+g_file_info_get_attribute_status, function in GFileInfo +
+
+
+g_file_info_get_attribute_string, function in GFileInfo +
+
+
+g_file_info_get_attribute_stringv, function in GFileInfo +
+
+
+g_file_info_get_attribute_type, function in GFileInfo +
+
+
+g_file_info_get_attribute_uint32, function in GFileInfo +
+
+
+g_file_info_get_attribute_uint64, function in GFileInfo +
+
+
+g_file_info_get_content_type, function in GFileInfo +
+
+
+g_file_info_get_display_name, function in GFileInfo +
+
+
+g_file_info_get_edit_name, function in GFileInfo +
+
+
+g_file_info_get_etag, function in GFileInfo +
+
+
+g_file_info_get_file_type, function in GFileInfo +
+
+
+g_file_info_get_icon, function in GFileInfo +
+
+
+g_file_info_get_is_backup, function in GFileInfo +
+
+
+g_file_info_get_is_hidden, function in GFileInfo +
+
+
+g_file_info_get_is_symlink, function in GFileInfo +
+
+
+g_file_info_get_modification_time, function in GFileInfo +
+
+
+g_file_info_get_name, function in GFileInfo +
+
+
+g_file_info_get_size, function in GFileInfo +
+
+
+g_file_info_get_sort_order, function in GFileInfo +
+
+
+g_file_info_get_symlink_target, function in GFileInfo +
+
+
+g_file_info_has_attribute, function in GFileInfo +
+
+
+g_file_info_has_namespace, function in GFileInfo +
+
+
+g_file_info_list_attributes, function in GFileInfo +
+
+
+g_file_info_new, function in GFileInfo +
+
+
+g_file_info_remove_attribute, function in GFileInfo +
+
+
+g_file_info_set_attribute, function in GFileInfo +
+
+
+g_file_info_set_attribute_boolean, function in GFileInfo +
+
+
+g_file_info_set_attribute_byte_string, function in GFileInfo +
+
+
+g_file_info_set_attribute_int32, function in GFileInfo +
+
+
+g_file_info_set_attribute_int64, function in GFileInfo +
+
+
+g_file_info_set_attribute_mask, function in GFileInfo +
+
+
+g_file_info_set_attribute_object, function in GFileInfo +
+
+
+g_file_info_set_attribute_status, function in GFileInfo +
+
+
+g_file_info_set_attribute_string, function in GFileInfo +
+
+
+g_file_info_set_attribute_stringv, function in GFileInfo +
+
+
+g_file_info_set_attribute_uint32, function in GFileInfo +
+
+
+g_file_info_set_attribute_uint64, function in GFileInfo +
+
+
+g_file_info_set_content_type, function in GFileInfo +
+
+
+g_file_info_set_display_name, function in GFileInfo +
+
+
+g_file_info_set_edit_name, function in GFileInfo +
+
+
+g_file_info_set_file_type, function in GFileInfo +
+
+
+g_file_info_set_icon, function in GFileInfo +
+
+
+g_file_info_set_is_hidden, function in GFileInfo +
+
+
+g_file_info_set_is_symlink, function in GFileInfo +
+
+
+g_file_info_set_modification_time, function in GFileInfo +
+
+
+g_file_info_set_name, function in GFileInfo +
+
+
+g_file_info_set_size, function in GFileInfo +
+
+
+g_file_info_set_sort_order, function in GFileInfo +
+
+
+g_file_info_set_symlink_target, function in GFileInfo +
+
+
+g_file_info_unset_attribute_mask, function in GFileInfo +
+
+
+g_file_input_stream_query_info, function in GFileInputStream +
+
+
+g_file_input_stream_query_info_async, function in GFileInputStream +
+
+
+g_file_input_stream_query_info_finish, function in GFileInputStream +
+
+
+g_file_io_stream_get_etag, function in GFileIOStream +
+
+
+g_file_io_stream_query_info, function in GFileIOStream +
+
+
+g_file_io_stream_query_info_async, function in GFileIOStream +
+
+
+g_file_io_stream_query_info_finish, function in GFileIOStream +
+
+
+g_file_is_native, function in GFile +
+
+
+g_file_load_contents, function in GFile +
+
+
+g_file_load_contents_async, function in GFile +
+
+
+g_file_load_contents_finish, function in GFile +
+
+
+g_file_load_partial_contents_async, function in GFile +
+
+
+g_file_load_partial_contents_finish, function in GFile +
+
+
+g_file_make_directory, function in GFile +
+
+
+g_file_make_directory_with_parents, function in GFile +
+
+
+g_file_make_symbolic_link, function in GFile +
+
+
+g_file_monitor, function in GFile +
+
+
+g_file_monitor_cancel, function in GFileMonitor +
+
+
+g_file_monitor_directory, function in GFile +
+
+
+g_file_monitor_emit_event, function in GFileMonitor +
+
+
+g_file_monitor_file, function in GFile +
+
+
+g_file_monitor_is_cancelled, function in GFileMonitor +
+
+
+g_file_monitor_set_rate_limit, function in GFileMonitor +
+
+
+g_file_mount_enclosing_volume, function in GFile +
+
+
+g_file_mount_enclosing_volume_finish, function in GFile +
+
+
+g_file_mount_mountable, function in GFile +
+
+
+g_file_mount_mountable_finish, function in GFile +
+
+
+g_file_move, function in GFile +
+
+
+g_file_new_for_commandline_arg, function in GFile +
+
+
+g_file_new_for_path, function in GFile +
+
+
+g_file_new_for_uri, function in GFile +
+
+
+g_file_open_readwrite, function in GFile +
+
+
+g_file_open_readwrite_async, function in GFile +
+
+
+g_file_open_readwrite_finish, function in GFile +
+
+
+g_file_output_stream_get_etag, function in GFileOutputStream +
+
+
+g_file_output_stream_query_info, function in GFileOutputStream +
+
+
+g_file_output_stream_query_info_async, function in GFileOutputStream +
+
+
+g_file_output_stream_query_info_finish, function in GFileOutputStream +
+
+
+g_file_parse_name, function in GFile +
+
+
+g_file_poll_mountable, function in GFile +
+
+
+g_file_poll_mountable_finish, function in GFile +
+
+
+g_file_query_default_handler, function in GFile +
+
+
+g_file_query_exists, function in GFile +
+
+
+g_file_query_filesystem_info, function in GFile +
+
+
+g_file_query_filesystem_info_async, function in GFile +
+
+
+g_file_query_filesystem_info_finish, function in GFile +
+
+
+g_file_query_file_type, function in GFile +
+
+
+g_file_query_info, function in GFile +
+
+
+g_file_query_info_async, function in GFile +
+
+
+g_file_query_info_finish, function in GFile +
+
+
+g_file_query_settable_attributes, function in GFile +
+
+
+g_file_query_writable_namespaces, function in GFile +
+
+
+g_file_read, function in GFile +
+
+
+g_file_read_async, function in GFile +
+
+
+g_file_read_finish, function in GFile +
+
+
+g_file_replace, function in GFile +
+
+
+g_file_replace_async, function in GFile +
+
+
+g_file_replace_contents, function in GFile +
+
+
+g_file_replace_contents_async, function in GFile +
+
+
+g_file_replace_contents_finish, function in GFile +
+
+
+g_file_replace_finish, function in GFile +
+
+
+g_file_replace_readwrite, function in GFile +
+
+
+g_file_replace_readwrite_async, function in GFile +
+
+
+g_file_replace_readwrite_finish, function in GFile +
+
+
+g_file_resolve_relative_path, function in GFile +
+
+
+g_file_set_attribute, function in GFile +
+
+
+g_file_set_attributes_async, function in GFile +
+
+
+g_file_set_attributes_finish, function in GFile +
+
+
+g_file_set_attributes_from_info, function in GFile +
+
+
+g_file_set_attribute_byte_string, function in GFile +
+
+
+g_file_set_attribute_int32, function in GFile +
+
+
+g_file_set_attribute_int64, function in GFile +
+
+
+g_file_set_attribute_string, function in GFile +
+
+
+g_file_set_attribute_uint32, function in GFile +
+
+
+g_file_set_attribute_uint64, function in GFile +
+
+
+g_file_set_display_name, function in GFile +
+
+
+g_file_set_display_name_async, function in GFile +
+
+
+g_file_set_display_name_finish, function in GFile +
+
+
+g_file_start_mountable, function in GFile +
+
+
+g_file_start_mountable_finish, function in GFile +
+
+
+g_file_stop_mountable, function in GFile +
+
+
+g_file_stop_mountable_finish, function in GFile +
+
+
+g_file_supports_thread_contexts, function in GFile +
+
+
+g_file_trash, function in GFile +
+
+
+g_file_unmount_mountable, function in GFile +
+
+
+g_file_unmount_mountable_finish, function in GFile +
+
+
+g_file_unmount_mountable_with_operation, function in GFile +
+
+
+g_file_unmount_mountable_with_operation_finish, function in GFile +
+
+
+GFilterInputStream, struct in GFilterInputStream +
+
+
+GFilterInputStream:base-stream, object property in GFilterInputStream +
+
+
+GFilterInputStream:close-base-stream, object property in GFilterInputStream +
+
+
+GFilterOutputStream, struct in GFilterOutputStream +
+
+
+GFilterOutputStream:base-stream, object property in GFilterOutputStream +
+
+
+GFilterOutputStream:close-base-stream, object property in GFilterOutputStream +
+
+
+g_filter_input_stream_get_base_stream, function in GFilterInputStream +
+
+
+g_filter_input_stream_get_close_base_stream, function in GFilterInputStream +
+
+
+g_filter_input_stream_set_close_base_stream, function in GFilterInputStream +
+
+
+g_filter_output_stream_get_base_stream, function in GFilterOutputStream +
+
+
+g_filter_output_stream_get_close_base_stream, function in GFilterOutputStream +
+
+
+g_filter_output_stream_set_close_base_stream, function in GFilterOutputStream +
+
+

I

+
+GIcon, struct in GIcon +
+
+
+GIconIface, struct in GIcon +
+
+
+g_icon_equal, function in GIcon +
+
+
+g_icon_hash, function in GIcon +
+
+
+g_icon_new_for_string, function in GIcon +
+
+
+g_icon_to_string, function in GIcon +
+
+
+GInetAddress, struct in GInetAddress +
+
+
+GInetAddress:bytes, object property in GInetAddress +
+
+
+GInetAddress:family, object property in GInetAddress +
+
+
+GInetAddress:is-any, object property in GInetAddress +
+
+
+GInetAddress:is-link-local, object property in GInetAddress +
+
+
+GInetAddress:is-loopback, object property in GInetAddress +
+
+
+GInetAddress:is-mc-global, object property in GInetAddress +
+
+
+GInetAddress:is-mc-link-local, object property in GInetAddress +
+
+
+GInetAddress:is-mc-node-local, object property in GInetAddress +
+
+
+GInetAddress:is-mc-org-local, object property in GInetAddress +
+
+
+GInetAddress:is-mc-site-local, object property in GInetAddress +
+
+
+GInetAddress:is-multicast, object property in GInetAddress +
+
+
+GInetAddress:is-site-local, object property in GInetAddress +
+
+
+GInetSocketAddress, struct in GInetSocketAddress +
+
+
+GInetSocketAddress:address, object property in GInetSocketAddress +
+
+
+GInetSocketAddress:port, object property in GInetSocketAddress
@@ -2341,1588 +3779,2625 @@
-g_inet_address_get_is_any, function in GInetAddress +g_inet_address_get_is_any, function in GInetAddress +
+
+
+g_inet_address_get_is_link_local, function in GInetAddress +
+
+
+g_inet_address_get_is_loopback, function in GInetAddress +
+
+
+g_inet_address_get_is_mc_global, function in GInetAddress +
+
+
+g_inet_address_get_is_mc_link_local, function in GInetAddress +
+
+
+g_inet_address_get_is_mc_node_local, function in GInetAddress +
+
+
+g_inet_address_get_is_mc_org_local, function in GInetAddress +
+
+
+g_inet_address_get_is_mc_site_local, function in GInetAddress +
+
+
+g_inet_address_get_is_multicast, function in GInetAddress +
+
+
+g_inet_address_get_is_site_local, function in GInetAddress +
+
+
+g_inet_address_get_native_size, function in GInetAddress +
+
+
+g_inet_address_new_any, function in GInetAddress +
+
+
+g_inet_address_new_from_bytes, function in GInetAddress +
+
+
+g_inet_address_new_from_string, function in GInetAddress +
+
+
+g_inet_address_new_loopback, function in GInetAddress +
+
+
+g_inet_address_to_bytes, function in GInetAddress +
+
+
+g_inet_address_to_string, function in GInetAddress +
+
+
+g_inet_socket_address_get_address, function in GInetSocketAddress +
+
+
+g_inet_socket_address_get_port, function in GInetSocketAddress +
+
+
+g_inet_socket_address_new, function in GInetSocketAddress +
+
+
+GInitable, struct in GInitable +
+
+
+GInitableIface, struct in GInitable +
+
+
+g_initable_init, function in GInitable +
+
+
+g_initable_new, function in GInitable +
+
+
+g_initable_newv, function in GInitable +
+
+
+g_initable_new_valist, function in GInitable +
+
+
+GInputStream, struct in GInputStream +
+
+
+GInputVector, struct in GSocket +
+
+
+g_input_stream_clear_pending, function in GInputStream +
+
+
+g_input_stream_close, function in GInputStream +
+
+
+g_input_stream_close_async, function in GInputStream +
+
+
+g_input_stream_close_finish, function in GInputStream +
+
+
+g_input_stream_has_pending, function in GInputStream +
+
+
+g_input_stream_is_closed, function in GInputStream +
+
+
+g_input_stream_read, function in GInputStream +
+
+
+g_input_stream_read_all, function in GInputStream +
+
+
+g_input_stream_read_async, function in GInputStream +
+
+
+g_input_stream_read_finish, function in GInputStream +
+
+
+g_input_stream_set_pending, function in GInputStream +
+
+
+g_input_stream_skip, function in GInputStream +
+
+
+g_input_stream_skip_async, function in GInputStream +
+
+
+g_input_stream_skip_finish, function in GInputStream +
+
+
+GIOErrorEnum, enum in GIOError +
+
+
+GIOExtension, struct in Extension Points +
+
+
+GIOExtensionPoint, struct in Extension Points +
+
+
+GIOModule, struct in GIOModule +
+
+
+GIOSchedulerJob, struct in GIOScheduler +
+
+
+GIOSchedulerJobFunc, user_function in GIOScheduler +
+
+
+GIOStream, struct in GIOStream +
+
+
+GIOStream:closed, object property in GIOStream +
+
+
+GIOStream:input-stream, object property in GIOStream +
+
+
+GIOStream:output-stream, object property in GIOStream +
+
+
+GIOStreamSpliceFlags, enum in GIOStream +
+
+
+G_IO_ERROR, macro in GIOError +
+
+
+g_io_error_from_errno, function in GIOError +
+
+
+g_io_error_from_win32_error, function in GIOError +
+
+
+g_io_extension_get_name, function in Extension Points +
+
+
+g_io_extension_get_priority, function in Extension Points +
+
+
+g_io_extension_get_type, function in Extension Points +
+
+
+g_io_extension_point_get_extensions, function in Extension Points +
+
+
+g_io_extension_point_get_extension_by_name, function in Extension Points +
+
+
+g_io_extension_point_get_required_type, function in Extension Points +
+
+
+g_io_extension_point_implement, function in Extension Points +
+
+
+g_io_extension_point_lookup, function in Extension Points +
+
+
+g_io_extension_point_register, function in Extension Points +
+
+
+g_io_extension_point_set_required_type, function in Extension Points +
+
+
+g_io_extension_ref_class, function in Extension Points +
+
+
+g_io_modules_load_all_in_directory, function in GIOModule +
+
+
+g_io_modules_scan_all_in_directory, function in GIOModule +
+
+
+g_io_module_load, function in GIOModule +
+
+
+g_io_module_new, function in GIOModule +
+
+
+g_io_module_query, function in GIOModule +
+
+
+g_io_module_unload, function in GIOModule +
+
+
+g_io_scheduler_cancel_all_jobs, function in GIOScheduler +
+
+
+g_io_scheduler_job_send_to_mainloop, function in GIOScheduler +
+
+
+g_io_scheduler_job_send_to_mainloop_async, function in GIOScheduler +
+
+
+g_io_scheduler_push_job, function in GIOScheduler +
+
+
+g_io_stream_clear_pending, function in GIOStream +
+
+
+g_io_stream_close, function in GIOStream +
+
+
+g_io_stream_close_async, function in GIOStream +
+
+
+g_io_stream_close_finish, function in GIOStream +
+
+
+g_io_stream_get_input_stream, function in GIOStream +
+
+
+g_io_stream_get_output_stream, function in GIOStream +
+
+
+g_io_stream_has_pending, function in GIOStream +
+
+
+g_io_stream_is_closed, function in GIOStream +
+
+
+g_io_stream_set_pending, function in GIOStream +
+
+
+g_io_stream_splice_async, function in GIOStream +
+
+
+g_io_stream_splice_finish, function in GIOStream +
+
+

K

+
+g_keyfile_settings_backend_new, function in GSettingsBackend +
+
+

L

+
+GLoadableIcon, struct in GLoadableIcon +
+
+
+GLoadableIconIface, struct in GLoadableIcon +
+
+
+g_loadable_icon_load, function in GLoadableIcon +
+
+
+g_loadable_icon_load_async, function in GLoadableIcon +
+
+
+g_loadable_icon_load_finish, function in GLoadableIcon +
+
+

M

+
+GMemoryInputStream, struct in GMemoryInputStream +
+
+
+GMemoryOutputStream, struct in GMemoryOutputStream +
+
+
+GMemoryOutputStream:data, object property in GMemoryOutputStream +
+
+
+GMemoryOutputStream:data-size, object property in GMemoryOutputStream +
+
+
+GMemoryOutputStream:destroy-function, object property in GMemoryOutputStream +
+
+
+GMemoryOutputStream:realloc-function, object property in GMemoryOutputStream +
+
+
+GMemoryOutputStream:size, object property in GMemoryOutputStream +
+
+
+g_memory_input_stream_add_data, function in GMemoryInputStream +
+
+
+g_memory_input_stream_new, function in GMemoryInputStream +
+
+
+g_memory_input_stream_new_from_data, function in GMemoryInputStream +
+
+
+g_memory_output_stream_get_data, function in GMemoryOutputStream +
+
+
+g_memory_output_stream_get_data_size, function in GMemoryOutputStream +
+
+
+g_memory_output_stream_get_size, function in GMemoryOutputStream +
+
+
+g_memory_output_stream_new, function in GMemoryOutputStream +
+
+
+g_memory_output_stream_steal_data, function in GMemoryOutputStream +
+
+
+GMount, struct in GMount +
+
+
+GMount::changed, object signal in GMount +
+
+
+GMount::pre-unmount, object signal in GMount +
+
+
+GMount::unmounted, object signal in GMount +
+
+
+GMountIface, struct in GMount +
+
+
+GMountMountFlags, enum in GMount +
+
+
+GMountOperation, struct in GMountOperation +
+
+
+GMountOperation::aborted, object signal in GMountOperation +
+
+
+GMountOperation::ask-password, object signal in GMountOperation +
+
+
+GMountOperation::ask-question, object signal in GMountOperation +
+
+
+GMountOperation::reply, object signal in GMountOperation +
+
+
+GMountOperation::show-processes, object signal in GMountOperation +
+
+
+GMountOperation:anonymous, object property in GMountOperation +
+
+
+GMountOperation:choice, object property in GMountOperation +
+
+
+GMountOperation:domain, object property in GMountOperation +
+
+
+GMountOperation:password, object property in GMountOperation +
+
+
+GMountOperation:password-save, object property in GMountOperation +
+
+
+GMountOperation:username, object property in GMountOperation +
+
+
+GMountOperationResult, enum in GMountOperation +
+
+
+GMountUnmountFlags, enum in GMount +
+
+
+g_mount_can_eject, function in GMount +
+
+
+g_mount_can_unmount, function in GMount +
+
+
+g_mount_eject, function in GMount +
+
+
+g_mount_eject_finish, function in GMount +
+
+
+g_mount_eject_with_operation, function in GMount +
+
+
+g_mount_eject_with_operation_finish, function in GMount +
+
+
+g_mount_get_default_location, function in GMount +
+
+
+g_mount_get_drive, function in GMount +
+
+
+g_mount_get_icon, function in GMount +
+
+
+g_mount_get_name, function in GMount +
+
+
+g_mount_get_root, function in GMount +
+
+
+g_mount_get_uuid, function in GMount +
+
+
+g_mount_get_volume, function in GMount +
+
+
+g_mount_guess_content_type, function in GMount +
+
+
+g_mount_guess_content_type_finish, function in GMount +
+
+
+g_mount_guess_content_type_sync, function in GMount +
+
+
+g_mount_is_shadowed, function in GMount +
+
+
+g_mount_operation_get_anonymous, function in GMountOperation +
+
+
+g_mount_operation_get_choice, function in GMountOperation +
+
+
+g_mount_operation_get_domain, function in GMountOperation +
+
+
+g_mount_operation_get_password, function in GMountOperation +
+
+
+g_mount_operation_get_password_save, function in GMountOperation +
+
+
+g_mount_operation_get_username, function in GMountOperation +
+
+
+g_mount_operation_new, function in GMountOperation +
+
+
+g_mount_operation_reply, function in GMountOperation +
+
+
+g_mount_operation_set_anonymous, function in GMountOperation +
+
+
+g_mount_operation_set_choice, function in GMountOperation +
+
+
+g_mount_operation_set_domain, function in GMountOperation +
+
+
+g_mount_operation_set_password, function in GMountOperation +
+
+
+g_mount_operation_set_password_save, function in GMountOperation +
+
+
+g_mount_operation_set_username, function in GMountOperation +
+
+
+g_mount_remount, function in GMount +
+
+
+g_mount_remount_finish, function in GMount +
+
+
+g_mount_shadow, function in GMount +
+
+
+g_mount_unmount, function in GMount +
+
+
+g_mount_unmount_finish, function in GMount +
+
+
+g_mount_unmount_with_operation, function in GMount +
+
+
+g_mount_unmount_with_operation_finish, function in GMount +
+
+
+g_mount_unshadow, function in GMount +
+
+

N

+
+GNetworkAddress, struct in GNetworkAddress +
+
+
+GNetworkAddress:hostname, object property in GNetworkAddress +
+
+
+GNetworkAddress:port, object property in GNetworkAddress +
+
+
+GNetworkAddress:scheme, object property in GNetworkAddress +
+
+
+GNetworkService, struct in GNetworkService +
+
+
+GNetworkService:domain, object property in GNetworkService +
+
+
+GNetworkService:protocol, object property in GNetworkService +
+
+
+GNetworkService:scheme, object property in GNetworkService +
+
+
+GNetworkService:service, object property in GNetworkService +
+
+
+g_network_address_get_hostname, function in GNetworkAddress +
+
+
+g_network_address_get_port, function in GNetworkAddress +
+
+
+g_network_address_get_scheme, function in GNetworkAddress +
+
+
+g_network_address_new, function in GNetworkAddress +
+
+
+g_network_address_parse, function in GNetworkAddress +
+
+
+g_network_address_parse_uri, function in GNetworkAddress +
+
+
+g_network_service_get_domain, function in GNetworkService +
+
+
+g_network_service_get_protocol, function in GNetworkService +
+
+
+g_network_service_get_scheme, function in GNetworkService +
+
+
+g_network_service_get_service, function in GNetworkService +
+
+
+g_network_service_new, function in GNetworkService +
+
+
+g_network_service_set_scheme, function in GNetworkService +
+
+

O

+
+GOutputStream, struct in GOutputStream +
+
+
+GOutputStreamSpliceFlags, enum in GOutputStream +
+
+
+GOutputVector, struct in GSocket +
+
+
+g_output_stream_clear_pending, function in GOutputStream +
+
+
+g_output_stream_close, function in GOutputStream +
+
+
+g_output_stream_close_async, function in GOutputStream +
+
+
+g_output_stream_close_finish, function in GOutputStream +
+
+
+g_output_stream_flush, function in GOutputStream +
+
+
+g_output_stream_flush_async, function in GOutputStream +
+
+
+g_output_stream_flush_finish, function in GOutputStream +
+
+
+g_output_stream_has_pending, function in GOutputStream +
+
+
+g_output_stream_is_closed, function in GOutputStream +
+
+
+g_output_stream_is_closing, function in GOutputStream +
+
+
+g_output_stream_set_pending, function in GOutputStream +
+
+
+g_output_stream_splice, function in GOutputStream +
+
+
+g_output_stream_splice_async, function in GOutputStream +
+
+
+g_output_stream_splice_finish, function in GOutputStream +
+
+
+g_output_stream_write, function in GOutputStream +
+
+
+g_output_stream_write_all, function in GOutputStream +
+
+
+g_output_stream_write_async, function in GOutputStream +
+
+
+g_output_stream_write_finish, function in GOutputStream +
+
+

P

+
+GPasswordSave, enum in GMountOperation +
+
+
+GPermission, struct in GPermission +
+
+
+GPermission:allowed, object property in GPermission +
+
+
+GPermission:can-acquire, object property in GPermission +
+
+
+GPermission:can-release, object property in GPermission +
+
+
+g_permission_acquire, function in GPermission +
+
+
+g_permission_acquire_async, function in GPermission +
+
+
+g_permission_acquire_finish, function in GPermission
-g_inet_address_get_is_link_local, function in GInetAddress +g_permission_get_allowed, function in GPermission
-g_inet_address_get_is_loopback, function in GInetAddress +g_permission_get_can_acquire, function in GPermission
-g_inet_address_get_is_mc_global, function in GInetAddress +g_permission_get_can_release, function in GPermission
-g_inet_address_get_is_mc_link_local, function in GInetAddress +g_permission_impl_update, function in GPermission
-g_inet_address_get_is_mc_node_local, function in GInetAddress +g_permission_release, function in GPermission
-g_inet_address_get_is_mc_org_local, function in GInetAddress +g_permission_release_async, function in GPermission
-g_inet_address_get_is_mc_site_local, function in GInetAddress +g_permission_release_finish, function in GPermission
-g_inet_address_get_is_multicast, function in GInetAddress +GPollableInputStream, struct in GPollableInputStream
-g_inet_address_get_is_site_local, function in GInetAddress +GPollableInputStreamInterface, struct in GPollableInputStream
-g_inet_address_get_native_size, function in GInetAddress +GPollableOutputStream, struct in GPollableOutputStream
-g_inet_address_new_any, function in GInetAddress +GPollableOutputStreamInterface, struct in GPollableOutputStream
-g_inet_address_new_from_bytes, function in GInetAddress +GPollableSourceFunc, user_function in GPollableInputStream
-g_inet_address_new_from_string, function in GInetAddress +g_pollable_input_stream_can_poll, function in GPollableInputStream
-g_inet_address_new_loopback, function in GInetAddress +g_pollable_input_stream_create_source, function in GPollableInputStream
-g_inet_address_to_bytes, function in GInetAddress +g_pollable_input_stream_is_readable, function in GPollableInputStream
-g_inet_address_to_string, function in GInetAddress +g_pollable_input_stream_read_nonblocking, function in GPollableInputStream
-g_inet_socket_address_get_address, function in GInetSocketAddress +g_pollable_output_stream_can_poll, function in GPollableOutputStream
-g_inet_socket_address_get_port, function in GInetSocketAddress +g_pollable_output_stream_create_source, function in GPollableOutputStream
-g_inet_socket_address_new, function in GInetSocketAddress +g_pollable_output_stream_is_writable, function in GPollableOutputStream
-GInitable, struct in GInitable +g_pollable_output_stream_write_nonblocking, function in GPollableOutputStream
-GInitableIface, struct in GInitable +g_pollable_source_new, function in GPollableInputStream
-g_initable_init, function in GInitable +GProxy, struct in GProxy
-g_initable_new, function in GInitable +GProxyAddress, struct in GProxyAddress
-g_initable_newv, function in GInitable +GProxyAddress:destination-hostname, object property in GProxyAddress
-g_initable_new_valist, function in GInitable +GProxyAddress:destination-port, object property in GProxyAddress
-GInputStream, struct in GInputStream +GProxyAddress:password, object property in GProxyAddress
-GInputVector, struct in GSocket +GProxyAddress:protocol, object property in GProxyAddress
-g_input_stream_clear_pending, function in GInputStream +GProxyAddress:username, object property in GProxyAddress
-g_input_stream_close, function in GInputStream +GProxyAddressClass, struct in GProxyAddress
-g_input_stream_close_async, function in GInputStream +GProxyAddressEnumerator, struct in GSocketConnectable
-g_input_stream_close_finish, function in GInputStream +GProxyAddressEnumerator:connectable, object property in GSocketConnectable
-g_input_stream_has_pending, function in GInputStream +GProxyAddressEnumerator:uri, object property in GSocketConnectable
-g_input_stream_is_closed, function in GInputStream +GProxyInterface, struct in GProxy
-g_input_stream_read, function in GInputStream +GProxyResolver, struct in GProxyResolver
-g_input_stream_read_all, function in GInputStream +GProxyResolverInterface, struct in GProxyResolver
-g_input_stream_read_async, function in GInputStream +g_proxy_address_get_destination_hostname, function in GProxyAddress
-g_input_stream_read_finish, function in GInputStream +g_proxy_address_get_destination_port, function in GProxyAddress
-g_input_stream_set_pending, function in GInputStream +g_proxy_address_get_password, function in GProxyAddress
-g_input_stream_skip, function in GInputStream +g_proxy_address_get_protocol, function in GProxyAddress
-g_input_stream_skip_async, function in GInputStream +g_proxy_address_get_username, function in GProxyAddress
-g_input_stream_skip_finish, function in GInputStream +g_proxy_address_new, function in GProxyAddress
-GIOErrorEnum, enum in GIOError +g_proxy_connect, function in GProxy
-GIOExtension, struct in Extension Points +g_proxy_connect_async, function in GProxy
-GIOExtensionPoint, struct in Extension Points +g_proxy_connect_finish, function in GProxy
-GIOModule, struct in GIOModule +G_PROXY_EXTENSION_POINT_NAME, macro in GProxy
-GIOSchedulerJob, struct in GIOScheduler +g_proxy_get_default_for_protocol, function in GProxy
-GIOSchedulerJobFunc, user_function in GIOScheduler +G_PROXY_RESOLVER_EXTENSION_POINT_NAME, macro in GProxyResolver
-GIOStream, struct in GIOStream +g_proxy_resolver_get_default, function in GProxyResolver
-GIOStream:closed, object property in GIOStream +g_proxy_resolver_is_supported, function in GProxyResolver
-GIOStream:input-stream, object property in GIOStream +g_proxy_resolver_lookup, function in GProxyResolver
-GIOStream:output-stream, object property in GIOStream +g_proxy_resolver_lookup_async, function in GProxyResolver
-G_IO_ERROR, macro in GIOError +g_proxy_resolver_lookup_finish, function in GProxyResolver
-g_io_error_from_errno, function in GIOError +g_proxy_supports_hostname, function in GProxy
+

R

-g_io_extension_get_name, function in Extension Points +GReallocFunc, user_function in GMemoryOutputStream
-g_io_extension_get_priority, function in Extension Points +GResolver, struct in GResolver
-g_io_extension_get_type, function in Extension Points +GResolver::reload, object signal in GResolver
-g_io_extension_point_get_extensions, function in Extension Points +GResolverError, enum in GResolver
-g_io_extension_point_get_extension_by_name, function in Extension Points +G_RESOLVER_ERROR, macro in GResolver
-g_io_extension_point_get_required_type, function in Extension Points +g_resolver_free_addresses, function in GResolver
-g_io_extension_point_implement, function in Extension Points +g_resolver_free_targets, function in GResolver
-g_io_extension_point_lookup, function in Extension Points +g_resolver_get_default, function in GResolver
-g_io_extension_point_register, function in Extension Points +g_resolver_lookup_by_address, function in GResolver
-g_io_extension_point_set_required_type, function in Extension Points +g_resolver_lookup_by_address_async, function in GResolver
-g_io_extension_ref_class, function in Extension Points +g_resolver_lookup_by_address_finish, function in GResolver
-g_io_modules_load_all_in_directory, function in GIOModule +g_resolver_lookup_by_name, function in GResolver
-g_io_modules_scan_all_in_directory, function in GIOModule +g_resolver_lookup_by_name_async, function in GResolver
-g_io_module_load, function in GIOModule +g_resolver_lookup_by_name_finish, function in GResolver
-g_io_module_new, function in GIOModule +g_resolver_lookup_service, function in GResolver
-g_io_module_query, function in GIOModule +g_resolver_lookup_service_async, function in GResolver
-g_io_module_unload, function in GIOModule +g_resolver_lookup_service_finish, function in GResolver
-g_io_scheduler_cancel_all_jobs, function in GIOScheduler +g_resolver_set_default, function in GResolver
+

S

-g_io_scheduler_job_send_to_mainloop, function in GIOScheduler +GSeekable, struct in GSeekable
-g_io_scheduler_job_send_to_mainloop_async, function in GIOScheduler +GSeekableIface, struct in GSeekable
-g_io_scheduler_push_job, function in GIOScheduler +g_seekable_can_seek, function in GSeekable
-g_io_stream_clear_pending, function in GIOStream +g_seekable_can_truncate, function in GSeekable
-g_io_stream_close, function in GIOStream +g_seekable_seek, function in GSeekable
-g_io_stream_close_async, function in GIOStream +g_seekable_tell, function in GSeekable
-g_io_stream_close_finish, function in GIOStream +g_seekable_truncate, function in GSeekable
-g_io_stream_get_input_stream, function in GIOStream +GSettings, struct in GSettings
-g_io_stream_get_output_stream, function in GIOStream +GSettings::change-event, object signal in GSettings
-g_io_stream_has_pending, function in GIOStream +GSettings::changed, object signal in GSettings
-g_io_stream_is_closed, function in GIOStream +GSettings::writable-change-event, object signal in GSettings
-g_io_stream_set_pending, function in GIOStream +GSettings::writable-changed, object signal in GSettings
-

L

-GLoadableIcon, struct in GLoadableIcon +GSettings:backend, object property in GSettings
-GLoadableIconIface, struct in GLoadableIcon +GSettings:delay-apply, object property in GSettings
-g_loadable_icon_load, function in GLoadableIcon +GSettings:has-unapplied, object property in GSettings
-g_loadable_icon_load_async, function in GLoadableIcon +GSettings:path, object property in GSettings
-g_loadable_icon_load_finish, function in GLoadableIcon +GSettings:schema, object property in GSettings
-

M

-GMemoryInputStream, struct in GMemoryInputStream +GSettingsBackend, struct in GSettingsBackend
-GMemoryOutputStream, struct in GMemoryOutputStream +GSettingsBackendClass, struct in GSettingsBackend
-GMemoryOutputStream:data, object property in GMemoryOutputStream +GSettingsBindFlags, enum in GSettings
-GMemoryOutputStream:data-size, object property in GMemoryOutputStream +GSettingsBindGetMapping, user_function in GSettings
-GMemoryOutputStream:destroy-function, object property in GMemoryOutputStream +GSettingsBindSetMapping, user_function in GSettings
-GMemoryOutputStream:realloc-function, object property in GMemoryOutputStream +GSettingsGetMapping, user_function in GSettings
-GMemoryOutputStream:size, object property in GMemoryOutputStream +g_settings_apply, function in GSettings
-g_memory_input_stream_add_data, function in GMemoryInputStream +g_settings_backend_changed, function in GSettingsBackend
-g_memory_input_stream_new, function in GMemoryInputStream +g_settings_backend_changed_tree, function in GSettingsBackend
-g_memory_input_stream_new_from_data, function in GMemoryInputStream +G_SETTINGS_BACKEND_EXTENSION_POINT_NAME, macro in GSettingsBackend +
+
+
+g_settings_backend_flatten_tree, function in GSettingsBackend +
+
+
+g_settings_backend_keys_changed, function in GSettingsBackend +
+
+
+g_settings_backend_path_changed, function in GSettingsBackend +
+
+
+g_settings_backend_path_writable_changed, function in GSettingsBackend +
+
+
+g_settings_backend_writable_changed, function in GSettingsBackend +
+
+
+g_settings_bind, function in GSettings +
+
+
+g_settings_bind_with_mapping, function in GSettings +
+
+
+g_settings_bind_writable, function in GSettings +
+
+
+g_settings_delay, function in GSettings +
+
+
+g_settings_get, function in GSettings +
+
+
+g_settings_get_boolean, function in GSettings +
+
+
+g_settings_get_child, function in GSettings +
+
+
+g_settings_get_double, function in GSettings +
+
+
+g_settings_get_enum, function in GSettings +
+
+
+g_settings_get_flags, function in GSettings +
+
+
+g_settings_get_has_unapplied, function in GSettings +
+
+
+g_settings_get_int, function in GSettings +
+
+
+g_settings_get_mapped, function in GSettings +
+
+
+g_settings_get_range, function in GSettings +
+
+
+g_settings_get_string, function in GSettings +
+
+
+g_settings_get_strv, function in GSettings +
+
+
+g_settings_get_value, function in GSettings +
+
+
+g_settings_is_writable, function in GSettings +
+
+
+g_settings_list_children, function in GSettings +
+
+
+g_settings_list_keys, function in GSettings +
+
+
+g_settings_new, function in GSettings +
+
+
+g_settings_new_with_backend, function in GSettings +
+
+
+g_settings_new_with_backend_and_path, function in GSettings +
+
+
+g_settings_new_with_path, function in GSettings +
+
+
+g_settings_range_check, function in GSettings +
+
+
+g_settings_reset, function in GSettings +
+
+
+g_settings_revert, function in GSettings +
+
+
+g_settings_set, function in GSettings +
+
+
+g_settings_set_boolean, function in GSettings +
+
+
+g_settings_set_double, function in GSettings +
+
+
+g_settings_set_enum, function in GSettings +
+
+
+g_settings_set_flags, function in GSettings +
+
+
+g_settings_set_int, function in GSettings +
+
+
+g_settings_set_string, function in GSettings +
+
+
+g_settings_set_strv, function in GSettings +
+
+
+g_settings_set_value, function in GSettings +
+
+
+g_settings_sync, function in GSettings
-g_memory_output_stream_get_data, function in GMemoryOutputStream +g_settings_unbind, function in GSettings
-g_memory_output_stream_get_data_size, function in GMemoryOutputStream +GSimpleAction, struct in GSimpleAction
-g_memory_output_stream_get_size, function in GMemoryOutputStream +GSimpleAction::activate, object signal in GSimpleAction
-g_memory_output_stream_new, function in GMemoryOutputStream +GSimpleAction:enabled, object property in GSimpleAction
-GMount, struct in GMount +GSimpleAction:name, object property in GSimpleAction
-GMount::changed, object signal in GMount +GSimpleAction:parameter-type, object property in GSimpleAction
-GMount::pre-unmount, object signal in GMount +GSimpleAction:state, object property in GSimpleAction
-GMount::unmounted, object signal in GMount +GSimpleAction:state-type, object property in GSimpleAction
-GMountIface, struct in GMount +GSimpleActionClass, struct in GSimpleAction
-GMountMountFlags, enum in GMount +GSimpleActionGroup, struct in GSimpleActionGroup
-GMountOperation, struct in GMountOperation +GSimpleAsyncResult, struct in GSimpleAsyncResult
-GMountOperation::aborted, object signal in GMountOperation +GSimpleAsyncThreadFunc, user_function in GSimpleAsyncResult
-GMountOperation::ask-password, object signal in GMountOperation +GSimplePermission, struct in GSimplePermission
-GMountOperation::ask-question, object signal in GMountOperation +g_simple_action_group_insert, function in GSimpleActionGroup
-GMountOperation::reply, object signal in GMountOperation +g_simple_action_group_lookup, function in GSimpleActionGroup
-GMountOperation::show-processes, object signal in GMountOperation +g_simple_action_group_new, function in GSimpleActionGroup
-GMountOperation:anonymous, object property in GMountOperation +g_simple_action_group_remove, function in GSimpleActionGroup
-GMountOperation:choice, object property in GMountOperation +g_simple_action_new, function in GSimpleAction
-GMountOperation:domain, object property in GMountOperation +g_simple_action_new_stateful, function in GSimpleAction
-GMountOperation:password, object property in GMountOperation +g_simple_action_set_enabled, function in GSimpleAction
-GMountOperation:password-save, object property in GMountOperation +g_simple_async_report_error_in_idle, function in GSimpleAsyncResult
-GMountOperation:username, object property in GMountOperation +g_simple_async_report_gerror_in_idle, function in GSimpleAsyncResult
-GMountOperationResult, enum in GMountOperation +g_simple_async_report_take_gerror_in_idle, function in GSimpleAsyncResult
-GMountUnmountFlags, enum in GMount +g_simple_async_result_complete, function in GSimpleAsyncResult
-g_mount_can_eject, function in GMount +g_simple_async_result_complete_in_idle, function in GSimpleAsyncResult
-g_mount_can_unmount, function in GMount +g_simple_async_result_get_op_res_gboolean, function in GSimpleAsyncResult
-g_mount_eject, function in GMount +g_simple_async_result_get_op_res_gpointer, function in GSimpleAsyncResult
-g_mount_eject_finish, function in GMount +g_simple_async_result_get_op_res_gssize, function in GSimpleAsyncResult
-g_mount_eject_with_operation, function in GMount +g_simple_async_result_get_source_tag, function in GSimpleAsyncResult
-g_mount_eject_with_operation_finish, function in GMount +g_simple_async_result_is_valid, function in GSimpleAsyncResult
-g_mount_get_default_location, function in GMount +g_simple_async_result_new, function in GSimpleAsyncResult
-g_mount_get_drive, function in GMount +g_simple_async_result_new_error, function in GSimpleAsyncResult
-g_mount_get_icon, function in GMount +g_simple_async_result_new_from_error, function in GSimpleAsyncResult
-g_mount_get_name, function in GMount +g_simple_async_result_new_take_error, function in GSimpleAsyncResult
-g_mount_get_root, function in GMount +g_simple_async_result_propagate_error, function in GSimpleAsyncResult
-g_mount_get_uuid, function in GMount +g_simple_async_result_run_in_thread, function in GSimpleAsyncResult
-g_mount_get_volume, function in GMount +g_simple_async_result_set_error, function in GSimpleAsyncResult
-g_mount_guess_content_type, function in GMount +g_simple_async_result_set_error_va, function in GSimpleAsyncResult
-g_mount_guess_content_type_finish, function in GMount +g_simple_async_result_set_from_error, function in GSimpleAsyncResult
-g_mount_guess_content_type_sync, function in GMount +g_simple_async_result_set_handle_cancellation, function in GSimpleAsyncResult
-g_mount_is_shadowed, function in GMount +g_simple_async_result_set_op_res_gboolean, function in GSimpleAsyncResult
-g_mount_operation_get_anonymous, function in GMountOperation +g_simple_async_result_set_op_res_gpointer, function in GSimpleAsyncResult
-g_mount_operation_get_choice, function in GMountOperation +g_simple_async_result_set_op_res_gssize, function in GSimpleAsyncResult
-g_mount_operation_get_domain, function in GMountOperation +g_simple_async_result_take_error, function in GSimpleAsyncResult
-g_mount_operation_get_password, function in GMountOperation +g_simple_permission_new, function in GSimplePermission
-g_mount_operation_get_password_save, function in GMountOperation +GSocket, struct in GSocket
-g_mount_operation_get_username, function in GMountOperation +GSocket:blocking, object property in GSocket
-g_mount_operation_new, function in GMountOperation +GSocket:family, object property in GSocket
-g_mount_operation_reply, function in GMountOperation +GSocket:fd, object property in GSocket
-g_mount_operation_set_anonymous, function in GMountOperation +GSocket:keepalive, object property in GSocket
-g_mount_operation_set_choice, function in GMountOperation +GSocket:listen-backlog, object property in GSocket
-g_mount_operation_set_domain, function in GMountOperation +GSocket:local-address, object property in GSocket
-g_mount_operation_set_password, function in GMountOperation +GSocket:protocol, object property in GSocket
-g_mount_operation_set_password_save, function in GMountOperation +GSocket:remote-address, object property in GSocket
-g_mount_operation_set_username, function in GMountOperation +GSocket:timeout, object property in GSocket
-g_mount_remount, function in GMount +GSocket:type, object property in GSocket
-g_mount_remount_finish, function in GMount +GSocketAddress, struct in GSocketAddress
-g_mount_shadow, function in GMount +GSocketAddress:family, object property in GSocketAddress
-g_mount_unmount, function in GMount +GSocketAddressEnumerator, struct in GSocketConnectable
-g_mount_unmount_finish, function in GMount +GSocketClient, struct in GSocketClient
-g_mount_unmount_with_operation, function in GMount +GSocketClient:enable-proxy, object property in GSocketClient
-g_mount_unmount_with_operation_finish, function in GMount +GSocketClient:family, object property in GSocketClient
-g_mount_unshadow, function in GMount +GSocketClient:local-address, object property in GSocketClient
-

N

-GNetworkAddress, struct in GNetworkAddress +GSocketClient:protocol, object property in GSocketClient
-GNetworkAddress:hostname, object property in GNetworkAddress +GSocketClient:timeout, object property in GSocketClient
-GNetworkAddress:port, object property in GNetworkAddress +GSocketClient:tls, object property in GSocketClient
-GNetworkService, struct in GNetworkService +GSocketClient:tls-validation-flags, object property in GSocketClient
-GNetworkService:domain, object property in GNetworkService +GSocketClient:type, object property in GSocketClient
-GNetworkService:protocol, object property in GNetworkService +GSocketConnectable, struct in GSocketConnectable
-GNetworkService:service, object property in GNetworkService +GSocketConnectableIface, struct in GSocketConnectable
-g_network_address_get_hostname, function in GNetworkAddress +GSocketConnection, struct in GSocketConnection
-g_network_address_get_port, function in GNetworkAddress +GSocketConnection:socket, object property in GSocketConnection
-g_network_address_new, function in GNetworkAddress +GSocketControlMessage, struct in GSocketControlMessage
-g_network_address_parse, function in GNetworkAddress +GSocketFamily, enum in GSocketAddress
-g_network_service_get_domain, function in GNetworkService +GSocketListener, struct in GSocketListener
-g_network_service_get_protocol, function in GNetworkService +GSocketListener:listen-backlog, object property in GSocketListener
-g_network_service_get_service, function in GNetworkService +GSocketMsgFlags, enum in GSocket
-g_network_service_new, function in GNetworkService +GSocketProtocol, enum in GSocket
-

O

-GOutputStream, struct in GOutputStream +GSocketService, struct in GSocketService
-GOutputStreamSpliceFlags, enum in GOutputStream +GSocketService::incoming, object signal in GSocketService
-GOutputVector, struct in GSocket +GSocketSourceFunc, user_function in GSocket
-g_output_stream_clear_pending, function in GOutputStream +GSocketType, enum in GSocket
-g_output_stream_close, function in GOutputStream +g_socket_accept, function in GSocket
-g_output_stream_close_async, function in GOutputStream +g_socket_address_enumerator_next, function in GSocketConnectable
-g_output_stream_close_finish, function in GOutputStream +g_socket_address_enumerator_next_async, function in GSocketConnectable
-g_output_stream_flush, function in GOutputStream +g_socket_address_enumerator_next_finish, function in GSocketConnectable
-g_output_stream_flush_async, function in GOutputStream +g_socket_address_get_family, function in GSocketAddress
-g_output_stream_flush_finish, function in GOutputStream +g_socket_address_get_native_size, function in GSocketAddress
-g_output_stream_has_pending, function in GOutputStream +g_socket_address_new_from_native, function in GSocketAddress
-g_output_stream_is_closed, function in GOutputStream +g_socket_address_to_native, function in GSocketAddress
-g_output_stream_is_closing, function in GOutputStream +g_socket_bind, function in GSocket
-g_output_stream_set_pending, function in GOutputStream +g_socket_check_connect_result, function in GSocket
-g_output_stream_splice, function in GOutputStream +g_socket_client_add_application_proxy, function in GSocketClient
-g_output_stream_splice_async, function in GOutputStream +g_socket_client_connect, function in GSocketClient
-g_output_stream_splice_finish, function in GOutputStream +g_socket_client_connect_async, function in GSocketClient
-g_output_stream_write, function in GOutputStream +g_socket_client_connect_finish, function in GSocketClient
-g_output_stream_write_all, function in GOutputStream +g_socket_client_connect_to_host, function in GSocketClient
-g_output_stream_write_async, function in GOutputStream +g_socket_client_connect_to_host_async, function in GSocketClient
-g_output_stream_write_finish, function in GOutputStream +g_socket_client_connect_to_host_finish, function in GSocketClient
-

P

-GPasswordSave, enum in GMountOperation +g_socket_client_connect_to_service, function in GSocketClient
-

R

-GReallocFunc, user_function in GMemoryOutputStream +g_socket_client_connect_to_service_async, function in GSocketClient
-GResolver, struct in GResolver +g_socket_client_connect_to_service_finish, function in GSocketClient
-GResolver::reload, object signal in GResolver +g_socket_client_connect_to_uri, function in GSocketClient
-GResolverError, enum in GResolver +g_socket_client_connect_to_uri_async, function in GSocketClient
-G_RESOLVER_ERROR, macro in GResolver +g_socket_client_connect_to_uri_finish, function in GSocketClient
-g_resolver_free_addresses, function in GResolver +g_socket_client_get_enable_proxy, function in GSocketClient
-g_resolver_free_targets, function in GResolver +g_socket_client_get_family, function in GSocketClient
-g_resolver_get_default, function in GResolver +g_socket_client_get_local_address, function in GSocketClient
-g_resolver_lookup_by_address, function in GResolver +g_socket_client_get_protocol, function in GSocketClient
-g_resolver_lookup_by_address_async, function in GResolver +g_socket_client_get_socket_type, function in GSocketClient
-g_resolver_lookup_by_address_finish, function in GResolver +g_socket_client_get_timeout, function in GSocketClient
-g_resolver_lookup_by_name, function in GResolver +g_socket_client_get_tls, function in GSocketClient
-g_resolver_lookup_by_name_async, function in GResolver +g_socket_client_get_tls_validation_flags, function in GSocketClient
-g_resolver_lookup_by_name_finish, function in GResolver +g_socket_client_new, function in GSocketClient
-g_resolver_lookup_service, function in GResolver +g_socket_client_set_enable_proxy, function in GSocketClient
-g_resolver_lookup_service_async, function in GResolver +g_socket_client_set_family, function in GSocketClient
-g_resolver_lookup_service_finish, function in GResolver +g_socket_client_set_local_address, function in GSocketClient
-g_resolver_set_default, function in GResolver +g_socket_client_set_protocol, function in GSocketClient
-

S

-GSeekable, struct in GSeekable +g_socket_client_set_socket_type, function in GSocketClient
-GSeekableIface, struct in GSeekable +g_socket_client_set_timeout, function in GSocketClient
-g_seekable_can_seek, function in GSeekable +g_socket_client_set_tls, function in GSocketClient
-g_seekable_can_truncate, function in GSeekable +g_socket_client_set_tls_validation_flags, function in GSocketClient
-g_seekable_seek, function in GSeekable +g_socket_close, function in GSocket
-g_seekable_tell, function in GSeekable +g_socket_condition_check, function in GSocket
-g_seekable_truncate, function in GSeekable +g_socket_condition_wait, function in GSocket
-GSimpleAsyncResult, struct in GSimpleAsyncResult +g_socket_connect, function in GSocket
-GSimpleAsyncThreadFunc, user_function in GSimpleAsyncResult +g_socket_connectable_enumerate, function in GSocketConnectable
-g_simple_async_report_error_in_idle, function in GSimpleAsyncResult +g_socket_connectable_proxy_enumerate, function in GSocketConnectable
-g_simple_async_report_gerror_in_idle, function in GSimpleAsyncResult +g_socket_connection_factory_create_connection, function in GSocketConnection
-g_simple_async_result_complete, function in GSimpleAsyncResult +g_socket_connection_factory_lookup_type, function in GSocketConnection
-g_simple_async_result_complete_in_idle, function in GSimpleAsyncResult +g_socket_connection_factory_register_type, function in GSocketConnection
-g_simple_async_result_get_op_res_gboolean, function in GSimpleAsyncResult +g_socket_connection_get_local_address, function in GSocketConnection
-g_simple_async_result_get_op_res_gpointer, function in GSimpleAsyncResult +g_socket_connection_get_remote_address, function in GSocketConnection
-g_simple_async_result_get_op_res_gssize, function in GSimpleAsyncResult +g_socket_connection_get_socket, function in GSocketConnection
-g_simple_async_result_get_source_tag, function in GSimpleAsyncResult +g_socket_control_message_deserialize, function in GSocketControlMessage
-g_simple_async_result_is_valid, function in GSimpleAsyncResult +g_socket_control_message_get_level, function in GSocketControlMessage
-g_simple_async_result_new, function in GSimpleAsyncResult +g_socket_control_message_get_msg_type, function in GSocketControlMessage
-g_simple_async_result_new_error, function in GSimpleAsyncResult +g_socket_control_message_get_size, function in GSocketControlMessage
-g_simple_async_result_new_from_error, function in GSimpleAsyncResult +g_socket_control_message_serialize, function in GSocketControlMessage
-g_simple_async_result_propagate_error, function in GSimpleAsyncResult +g_socket_create_source, function in GSocket
-g_simple_async_result_run_in_thread, function in GSimpleAsyncResult +g_socket_get_blocking, function in GSocket
-g_simple_async_result_set_error, function in GSimpleAsyncResult +g_socket_get_credentials, function in GSocket
-g_simple_async_result_set_error_va, function in GSimpleAsyncResult +g_socket_get_family, function in GSocket
-g_simple_async_result_set_from_error, function in GSimpleAsyncResult +g_socket_get_fd, function in GSocket
-g_simple_async_result_set_handle_cancellation, function in GSimpleAsyncResult +g_socket_get_keepalive, function in GSocket
-g_simple_async_result_set_op_res_gboolean, function in GSimpleAsyncResult +g_socket_get_listen_backlog, function in GSocket
-g_simple_async_result_set_op_res_gpointer, function in GSimpleAsyncResult +g_socket_get_local_address, function in GSocket
-g_simple_async_result_set_op_res_gssize, function in GSimpleAsyncResult +g_socket_get_protocol, function in GSocket
-GSocket, struct in GSocket +g_socket_get_remote_address, function in GSocket
-GSocket:blocking, object property in GSocket +g_socket_get_socket_type, function in GSocket
-GSocket:family, object property in GSocket +g_socket_get_timeout, function in GSocket
-GSocket:fd, object property in GSocket +g_socket_is_closed, function in GSocket
-GSocket:keepalive, object property in GSocket +g_socket_is_connected, function in GSocket
-GSocket:listen-backlog, object property in GSocket +g_socket_listen, function in GSocket
-GSocket:local-address, object property in GSocket +g_socket_listener_accept, function in GSocketListener
-GSocket:protocol, object property in GSocket +g_socket_listener_accept_async, function in GSocketListener
-GSocket:remote-address, object property in GSocket +g_socket_listener_accept_finish, function in GSocketListener
-GSocket:type, object property in GSocket +g_socket_listener_accept_socket, function in GSocketListener
-GSocketAddress, struct in GSocketAddress +g_socket_listener_accept_socket_async, function in GSocketListener
-GSocketAddress:family, object property in GSocketAddress +g_socket_listener_accept_socket_finish, function in GSocketListener
-GSocketAddressEnumerator, struct in GSocketConnectable +g_socket_listener_add_address, function in GSocketListener
-GSocketClient, struct in GSocketClient +g_socket_listener_add_any_inet_port, function in GSocketListener
-GSocketClient:family, object property in GSocketClient +g_socket_listener_add_inet_port, function in GSocketListener
-GSocketClient:local-address, object property in GSocketClient +g_socket_listener_add_socket, function in GSocketListener
-GSocketClient:protocol, object property in GSocketClient +g_socket_listener_close, function in GSocketListener
-GSocketClient:type, object property in GSocketClient +g_socket_listener_new, function in GSocketListener
-GSocketConnectable, struct in GSocketConnectable +g_socket_listener_set_backlog, function in GSocketListener
-GSocketConnectableIface, struct in GSocketConnectable +g_socket_new, function in GSocket
-GSocketConnection, struct in GSocketConnection +g_socket_new_from_fd, function in GSocket
-GSocketConnection:socket, object property in GSocketConnection +g_socket_receive, function in GSocket
-GSocketControlMessage, struct in GSocketControlMessage +g_socket_receive_from, function in GSocket
-GSocketFamily, enum in GSocketAddress +g_socket_receive_message, function in GSocket
-GSocketListener, struct in GSocketListener +g_socket_receive_with_blocking, function in GSocket
-GSocketListener:listen-backlog, object property in GSocketListener +g_socket_send, function in GSocket
-GSocketMsgFlags, enum in GSocket +g_socket_send_message, function in GSocket
-GSocketProtocol, enum in GSocket +g_socket_send_to, function in GSocket
-GSocketService, struct in GSocketService +g_socket_send_with_blocking, function in GSocket
-GSocketService::incoming, object signal in GSocketService +g_socket_service_is_active, function in GSocketService
-GSocketSourceFunc, user_function in GSocket +g_socket_service_new, function in GSocketService
-GSocketType, enum in GSocket +g_socket_service_start, function in GSocketService
-g_socket_accept, function in GSocket +g_socket_service_stop, function in GSocketService
-g_socket_address_enumerator_next, function in GSocketConnectable +g_socket_set_blocking, function in GSocket
-g_socket_address_enumerator_next_async, function in GSocketConnectable +g_socket_set_keepalive, function in GSocket
-g_socket_address_enumerator_next_finish, function in GSocketConnectable +g_socket_set_listen_backlog, function in GSocket
-g_socket_address_get_family, function in GSocketAddress +g_socket_set_timeout, function in GSocket
-g_socket_address_get_native_size, function in GSocketAddress +g_socket_shutdown, function in GSocket
-g_socket_address_new_from_native, function in GSocketAddress +g_socket_speaks_ipv4, function in GSocket
-g_socket_address_to_native, function in GSocketAddress +GSrvTarget, struct in GSrvTarget
-g_socket_bind, function in GSocket +g_srv_target_copy, function in GSrvTarget
-g_socket_check_connect_result, function in GSocket +g_srv_target_free, function in GSrvTarget
-g_socket_client_connect, function in GSocketClient +g_srv_target_get_hostname, function in GSrvTarget
-g_socket_client_connect_async, function in GSocketClient +g_srv_target_get_port, function in GSrvTarget
-g_socket_client_connect_finish, function in GSocketClient +g_srv_target_get_priority, function in GSrvTarget
-g_socket_client_connect_to_host, function in GSocketClient +g_srv_target_get_weight, function in GSrvTarget
-g_socket_client_connect_to_host_async, function in GSocketClient +g_srv_target_list_sort, function in GSrvTarget
-g_socket_client_connect_to_host_finish, function in GSocketClient +g_srv_target_new, function in GSrvTarget
+

T

-g_socket_client_connect_to_service, function in GSocketClient +GTcpConnection, struct in GTcpConnection
-g_socket_client_connect_to_service_async, function in GSocketClient +GTcpConnection:graceful-disconnect, object property in GTcpConnection
-g_socket_client_connect_to_service_finish, function in GSocketClient +GTcpWrapperConnection, struct in GTcpWrapperConnection
-g_socket_client_get_family, function in GSocketClient +GTcpWrapperConnection:base-io-stream, object property in GTcpWrapperConnection
-g_socket_client_get_local_address, function in GSocketClient +g_tcp_connection_get_graceful_disconnect, function in GTcpConnection
-g_socket_client_get_protocol, function in GSocketClient +g_tcp_connection_set_graceful_disconnect, function in GTcpConnection
-g_socket_client_get_socket_type, function in GSocketClient +g_tcp_wrapper_connection_get_base_io_stream, function in GTcpWrapperConnection
-g_socket_client_new, function in GSocketClient +g_tcp_wrapper_connection_new, function in GTcpWrapperConnection
-g_socket_client_set_family, function in GSocketClient +GThemedIcon, struct in GThemedIcon
-g_socket_client_set_local_address, function in GSocketClient +GThemedIcon:name, object property in GThemedIcon
-g_socket_client_set_protocol, function in GSocketClient +GThemedIcon:names, object property in GThemedIcon
-g_socket_client_set_socket_type, function in GSocketClient +GThemedIcon:use-default-fallbacks, object property in GThemedIcon
-g_socket_close, function in GSocket +g_themed_icon_append_name, function in GThemedIcon
-g_socket_condition_check, function in GSocket +g_themed_icon_get_names, function in GThemedIcon
-g_socket_condition_wait, function in GSocket +g_themed_icon_new, function in GThemedIcon
-g_socket_connect, function in GSocket +g_themed_icon_new_from_names, function in GThemedIcon
-g_socket_connectable_enumerate, function in GSocketConnectable +g_themed_icon_new_with_default_fallbacks, function in GThemedIcon
-g_socket_connection_factory_create_connection, function in GSocketConnection +g_themed_icon_prepend_name, function in GThemedIcon
-g_socket_connection_factory_lookup_type, function in GSocketConnection +GThreadedSocketService, struct in GThreadedSocketService
-g_socket_connection_factory_register_type, function in GSocketConnection +GThreadedSocketService::run, object signal in GThreadedSocketService
-g_socket_connection_get_local_address, function in GSocketConnection +GThreadedSocketService:max-threads, object property in GThreadedSocketService
-g_socket_connection_get_remote_address, function in GSocketConnection +g_threaded_socket_service_new, function in GThreadedSocketService
-g_socket_connection_get_socket, function in GSocketConnection +GTlsAuthenticationMode, enum in TLS Overview
-g_socket_control_message_deserialize, function in GSocketControlMessage +GTlsBackend, struct in GTlsBackend
-g_socket_control_message_get_level, function in GSocketControlMessage +GTlsBackendInterface, struct in GTlsBackend
-g_socket_control_message_get_msg_type, function in GSocketControlMessage +GTlsCertificate, struct in GTlsCertificate
-g_socket_control_message_get_size, function in GSocketControlMessage +GTlsCertificate:certificate, object property in GTlsCertificate
-g_socket_control_message_serialize, function in GSocketControlMessage +GTlsCertificate:certificate-pem, object property in GTlsCertificate
-g_socket_create_source, function in GSocket +GTlsCertificate:issuer, object property in GTlsCertificate
-g_socket_get_blocking, function in GSocket +GTlsCertificate:private-key, object property in GTlsCertificate
-g_socket_get_family, function in GSocket +GTlsCertificate:private-key-pem, object property in GTlsCertificate
-g_socket_get_fd, function in GSocket +GTlsCertificateFlags, enum in TLS Overview
-g_socket_get_keepalive, function in GSocket +GTlsClientConnection, struct in GTlsClientConnection
-g_socket_get_listen_backlog, function in GSocket +GTlsClientConnection:accepted-cas, object property in GTlsClientConnection
-g_socket_get_local_address, function in GSocket +GTlsClientConnection:server-identity, object property in GTlsClientConnection
-g_socket_get_protocol, function in GSocket +GTlsClientConnection:use-ssl3, object property in GTlsClientConnection
-g_socket_get_remote_address, function in GSocket +GTlsClientConnection:validation-flags, object property in GTlsClientConnection
-g_socket_get_socket_type, function in GSocket +GTlsClientConnectionInterface, struct in GTlsClientConnection
-g_socket_is_closed, function in GSocket +GTlsConnection, struct in GTlsConnection
-g_socket_is_connected, function in GSocket +GTlsConnection::accept-certificate, object signal in GTlsConnection
-g_socket_listen, function in GSocket +GTlsConnection:base-io-stream, object property in GTlsConnection
-g_socket_listener_accept, function in GSocketListener +GTlsConnection:certificate, object property in GTlsConnection
-g_socket_listener_accept_async, function in GSocketListener +GTlsConnection:peer-certificate, object property in GTlsConnection
-g_socket_listener_accept_finish, function in GSocketListener +GTlsConnection:peer-certificate-errors, object property in GTlsConnection
-g_socket_listener_accept_socket, function in GSocketListener +GTlsConnection:rehandshake-mode, object property in GTlsConnection
-g_socket_listener_accept_socket_async, function in GSocketListener +GTlsConnection:require-close-notify, object property in GTlsConnection
-g_socket_listener_accept_socket_finish, function in GSocketListener +GTlsConnection:use-system-certdb, object property in GTlsConnection
-g_socket_listener_add_address, function in GSocketListener +GTlsError, enum in TLS Overview
-g_socket_listener_add_any_inet_port, function in GSocketListener +GTlsRehandshakeMode, enum in GTlsConnection
-g_socket_listener_add_inet_port, function in GSocketListener +GTlsServerConnection, struct in GTlsServerConnection
-g_socket_listener_add_socket, function in GSocketListener +GTlsServerConnection:authentication-mode, object property in GTlsServerConnection
-g_socket_listener_close, function in GSocketListener +GTlsServerConnectionInterface, struct in GTlsServerConnection
-g_socket_listener_new, function in GSocketListener +G_TLS_BACKEND_EXTENSION_POINT_NAME, macro in GTlsBackend
-g_socket_listener_set_backlog, function in GSocketListener +g_tls_backend_get_certificate_type, function in GTlsBackend
-g_socket_new, function in GSocket +g_tls_backend_get_client_connection_type, function in GTlsBackend
-g_socket_new_from_fd, function in GSocket +g_tls_backend_get_default, function in GTlsBackend
-g_socket_receive, function in GSocket +g_tls_backend_get_server_connection_type, function in GTlsBackend
-g_socket_receive_from, function in GSocket +g_tls_backend_supports_tls, function in GTlsBackend
-g_socket_receive_message, function in GSocket +g_tls_certificate_get_issuer, function in GTlsCertificate
-g_socket_send, function in GSocket +g_tls_certificate_list_new_from_file, function in GTlsCertificate
-g_socket_send_message, function in GSocket +g_tls_certificate_new_from_file, function in GTlsCertificate
-g_socket_send_to, function in GSocket +g_tls_certificate_new_from_files, function in GTlsCertificate
-g_socket_service_is_active, function in GSocketService +g_tls_certificate_new_from_pem, function in GTlsCertificate
-g_socket_service_new, function in GSocketService +g_tls_certificate_verify, function in GTlsCertificate
-g_socket_service_start, function in GSocketService +g_tls_client_connection_get_accepted_cas, function in GTlsClientConnection
-g_socket_service_stop, function in GSocketService +g_tls_client_connection_get_server_identity, function in GTlsClientConnection
-g_socket_set_blocking, function in GSocket +g_tls_client_connection_get_use_ssl3, function in GTlsClientConnection
-g_socket_set_keepalive, function in GSocket +g_tls_client_connection_get_validation_flags, function in GTlsClientConnection
-g_socket_set_listen_backlog, function in GSocket +g_tls_client_connection_new, function in GTlsClientConnection
-g_socket_shutdown, function in GSocket +g_tls_client_connection_set_server_identity, function in GTlsClientConnection
-g_socket_speaks_ipv4, function in GSocket +g_tls_client_connection_set_use_ssl3, function in GTlsClientConnection
-GSrvTarget, struct in GSrvTarget +g_tls_client_connection_set_validation_flags, function in GTlsClientConnection
-g_srv_target_copy, function in GSrvTarget +g_tls_connection_emit_accept_certificate, function in GTlsConnection
-g_srv_target_free, function in GSrvTarget +g_tls_connection_get_certificate, function in GTlsConnection
-g_srv_target_get_hostname, function in GSrvTarget +g_tls_connection_get_peer_certificate, function in GTlsConnection
-g_srv_target_get_port, function in GSrvTarget +g_tls_connection_get_peer_certificate_errors, function in GTlsConnection
-g_srv_target_get_priority, function in GSrvTarget +g_tls_connection_get_rehandshake_mode, function in GTlsConnection
-g_srv_target_get_weight, function in GSrvTarget +g_tls_connection_get_require_close_notify, function in GTlsConnection
-g_srv_target_list_sort, function in GSrvTarget +g_tls_connection_get_use_system_certdb, function in GTlsConnection
-g_srv_target_new, function in GSrvTarget +g_tls_connection_handshake, function in GTlsConnection
-

T

-GTcpConnection, struct in GSocketConnection +g_tls_connection_handshake_async, function in GTlsConnection
-GTcpConnection:graceful-disconnect, object property in GSocketConnection +g_tls_connection_handshake_finish, function in GTlsConnection
-g_tcp_connection_get_graceful_disconnect, function in GSocketConnection +g_tls_connection_set_certificate, function in GTlsConnection
-g_tcp_connection_set_graceful_disconnect, function in GSocketConnection +g_tls_connection_set_rehandshake_mode, function in GTlsConnection
-GThemedIcon, struct in GThemedIcon +g_tls_connection_set_require_close_notify, function in GTlsConnection
-GThemedIcon:name, object property in GThemedIcon +g_tls_connection_set_use_system_certdb, function in GTlsConnection
-GThemedIcon:names, object property in GThemedIcon +G_TLS_ERROR, macro in TLS Overview
-GThemedIcon:use-default-fallbacks, object property in GThemedIcon +g_tls_server_connection_new, function in GTlsServerConnection
-g_themed_icon_append_name, function in GThemedIcon +G_TYPE_DBUS_ANNOTATION_INFO, macro in D-Bus Introspection Data
-g_themed_icon_get_names, function in GThemedIcon +G_TYPE_DBUS_ARG_INFO, macro in D-Bus Introspection Data
-g_themed_icon_new, function in GThemedIcon +G_TYPE_DBUS_INTERFACE_INFO, macro in D-Bus Introspection Data
-g_themed_icon_new_from_names, function in GThemedIcon +G_TYPE_DBUS_METHOD_INFO, macro in D-Bus Introspection Data
-g_themed_icon_new_with_default_fallbacks, function in GThemedIcon +G_TYPE_DBUS_NODE_INFO, macro in D-Bus Introspection Data
-g_themed_icon_prepend_name, function in GThemedIcon +G_TYPE_DBUS_PROPERTY_INFO, macro in D-Bus Introspection Data
-GThreadedSocketService, struct in GThreadedSocketService +G_TYPE_DBUS_SIGNAL_INFO, macro in D-Bus Introspection Data
+

U

-GThreadedSocketService::run, object signal in GThreadedSocketService +GUnixConnection, struct in GUnixConnection
-GThreadedSocketService:max-threads, object property in GThreadedSocketService +GUnixCredentialsMessage, struct in GUnixCredentialsMessage
-g_threaded_socket_service_new, function in GThreadedSocketService +GUnixCredentialsMessage:credentials, object property in GUnixCredentialsMessage
-

U

-GUnixConnection, struct in GSocketConnection +GUnixCredentialsMessageClass, struct in GUnixCredentialsMessage
@@ -3950,10 +6425,6 @@
-GUnixMount, struct in Unix Mounts -
-
-
GUnixMountEntry, struct in Unix Mounts
@@ -3994,6 +6465,10 @@
+GUnixSocketAddress:address-type, object property in GUnixSocketAddress +
+
+
GUnixSocketAddress:path, object property in GUnixSocketAddress
@@ -4002,11 +6477,39 @@
-g_unix_connection_receive_fd, function in GSocketConnection +GUnixSocketAddressType, enum in GUnixSocketAddress +
+
+
+g_unix_connection_receive_credentials, function in GUnixConnection +
+
+
+g_unix_connection_receive_fd, function in GUnixConnection +
+
+
+g_unix_connection_send_credentials, function in GUnixConnection +
+
+
+g_unix_connection_send_fd, function in GUnixConnection +
+
+
+g_unix_credentials_message_get_credentials, function in GUnixCredentialsMessage +
+
+
+g_unix_credentials_message_is_supported, function in GUnixCredentialsMessage
-g_unix_connection_send_fd, function in GSocketConnection +g_unix_credentials_message_new, function in GUnixCredentialsMessage +
+
+
+g_unix_credentials_message_new_with_credentials, function in GUnixCredentialsMessage
@@ -4214,6 +6717,10 @@
+g_unix_socket_address_get_address_type, function in GUnixSocketAddress +
+
+
g_unix_socket_address_get_is_abstract, function in GUnixSocketAddress
@@ -4233,6 +6740,10 @@ g_unix_socket_address_new_abstract, function in GUnixSocketAddress
+
+g_unix_socket_address_new_with_type, function in GUnixSocketAddress +
+

V

GVfs, struct in GVfs @@ -4464,6 +6975,10 @@
+GZlibCompressor:file-info, object property in GZlibCompressor +
+
+
GZlibCompressor:format, object property in GZlibCompressor
@@ -4480,20 +6995,36 @@
+GZlibDecompressor:file-info, object property in GZlibDecompressor +
+
+
GZlibDecompressor:format, object property in GZlibDecompressor
+g_zlib_compressor_get_file_info, function in GZlibCompressor +
+
+
g_zlib_compressor_new, function in GZlibCompressor
+g_zlib_compressor_set_file_info, function in GZlibCompressor +
+
+
+g_zlib_decompressor_get_file_info, function in GZlibDecompressor +
+
+
g_zlib_decompressor_new, function in GZlibDecompressor
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/application.html b/docs/reference/gio/html/application.html new file mode 100644 index 0000000..9992ff5 --- /dev/null +++ b/docs/reference/gio/html/application.html @@ -0,0 +1,50 @@ + + + + +Application support + + + + + + + + + + + + + + + + +
+

+Application support

+
+
+GActionGroup — A group of actions +
+
+GSimpleActionGroup — A simple GActionGroup implementation +
+
+GAction — An action +
+
+GSimpleAction — A simple GSimpleAction +
+
+GApplication — Core application class +
+
+GApplicationCommandLine — A command-line invocation of an application +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/async.html b/docs/reference/gio/html/async.html index eaa808d..9f46a52 100644 --- a/docs/reference/gio/html/async.html +++ b/docs/reference/gio/html/async.html @@ -3,17 +3,17 @@ Asynchronous I/O - + - + - + - + @@ -39,6 +39,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/ch01.html b/docs/reference/gio/html/ch01.html index e4e75f1..8d2ba47 100644 --- a/docs/reference/gio/html/ch01.html +++ b/docs/reference/gio/html/ch01.html @@ -3,12 +3,12 @@ Introduction - + - + @@ -21,13 +21,13 @@

-Introduction

+Introduction

GIO is striving to provide a modern, easy-to-use VFS API that sits at the right level in the library stack. The goal is to overcome the shortcomings of GnomeVFS and provide an API that is so good that developers prefer it over raw POSIX calls. Among other things - that means using GObject. It also means not cloning the POSIX + that means using GObject. It also means not cloning the POSIX API, but providing higher-level, document-centric interfaces.

@@ -106,6 +106,16 @@

+ There is a framework for storing and retrieving application settings: +

+
++ + + + +

GSettings

stores and retrieves application settings

+

There is support for network programming, including name resolution, lowlevel socket APIs and highlevel client and server helper classes:

@@ -135,18 +145,44 @@

+ There is support for connecting to D-Bus, + sending and receiving messages, owning and watching bus names, + and making objects available on the bus: +

+
++ + + + + + + + + + + + + + + + + + +

GDBusConnection

a D-Bus connection

GDBusMethodInvocation

for handling remove calls

GDBusServer

helper for accepting connections

GDBusProxy

proxy to access D-Bus interfaces on a remote object

+

Beyond these, GIO provides facilities for file monitoring, - asynchronous I/O and filename completion. In addition to the - interfaces, GIO provides implementations for the local case. - Implementations for various network file systems are provided + asynchronous I/O and filename completion. In addition to the + interfaces, GIO provides implementations for the local case. + Implementations for various network file systems are provided by the GVFS package as loadable modules.

Other design choices which consciously break with the GnomeVFS design are to move backends out-of-process, which minimizes the dependency bloat and makes the whole system more robust. The backends - are not included in GIO, but in the separate GVFS package. The GVFS - package also contains the GVFS daemon, which spawn further mount + are not included in GIO, but in the separate GVFS package. The GVFS + package also contains the GVFS daemon, which spawn further mount daemons for each individual connection.

@@ -154,18 +190,18 @@
GIO in the GTK+ library stack

- The GIO model of I/O is stateful: if an application establishes e.g. - a SFTP connection to a server, it becomes available to all applications - in the session; the user does not have to enter his password over + The GIO model of I/O is stateful: if an application establishes e.g. + a SFTP connection to a server, it becomes available to all applications + in the session; the user does not have to enter his password over and over again.

- One of the big advantages of putting the VFS in the GLib layer + One of the big advantages of putting the VFS in the GLib layer is that GTK+ can directly use it, e.g. in the filechooser.

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/ch02.html b/docs/reference/gio/html/ch02.html index c3c6a88..d346c4b 100644 --- a/docs/reference/gio/html/ch02.html +++ b/docs/reference/gio/html/ch02.html @@ -3,12 +3,12 @@ Compiling GIO applications - + - + @@ -21,25 +21,30 @@

-Compiling GIO applications

+Compiling GIO applications

GIO comes with a gio-2.0.pc file that you should use together with pkg-config to obtain the necessary information about header files and libraries. See - the pkg-config man page or the GLib documentation - for more information on how to use pkg-config + the pkg-config man page or the GLib documentation + for more information on how to use pkg-config to compile your application.

If you are using GIO on UNIX-like systems, you may want to use - UNIX-specific GIO interfaces such as GUnixInputStream, - GUnixOutputStream, GUnixMount or GDesktopAppInfo. - To do so, use the gio-unix-2.0.pc file + UNIX-specific GIO interfaces such as GUnixInputStream, + GUnixOutputStream, GUnixMount or GDesktopAppInfo. + To do so, use the gio-unix-2.0.pc file instead of gio-2.0.pc

+

+ Since GIO is based on GObject, you need to call g_type_init() + before you can use any GIO functions. If your application uses + GTK+, this is already taken care of by gtk_init(). +

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/ch03.html b/docs/reference/gio/html/ch03.html index 59491d7..4239654 100644 --- a/docs/reference/gio/html/ch03.html +++ b/docs/reference/gio/html/ch03.html @@ -3,12 +3,12 @@ Running GIO applications - + - + @@ -21,13 +21,13 @@

-Running GIO applications

+Running GIO applications

GIO inspects a few of environment variables in addition to the ones used by GLib.

XDG_DATA_HOME, XDG_DATA_DIRS.  - GIO uses these environment variables to locate MIME information. + GIO uses these environment variables to locate MIME information. For more information, see the Shared MIME-info Database and the Base Directory Specification.

@@ -41,40 +41,139 @@ production environment.

GIO_USE_VFS.  - This environment variable can be set to the name of a GVfs + This environment variable can be set to the name of a GVfs implementation to override the default for debugging purposes. - The GVfs implementation for local files that is included in GIO - has the name "local", the implementation in the gvfs module has - the name "gvfs". + The GVfs implementation for local files that is included in GIO + has the name "local", the implementation in the gvfs module has + the name "gvfs".

GIO_USE_VOLUME_MONITOR.  - This variable can be set to the name of a GVolumeMonitor + This variable can be set to the name of a GVolumeMonitor implementation to override the default for debugging purposes. The GVolumeMonitor implementation for local files that is included in GIO has the name "unix", the hal-based implementation in the gvfs module has the name "hal".

-

GIO_USE_URI_ASSOCIATION.  - This variable can be set to the name of a GDesktopAppInfoLookup +

GIO_USE_TLS.  + This variable can be set to the name of a GTlsBackend implementation to override the default for debugging purposes. - GIO does not include a GDesktopAppInfoLookup implementation, - the GConf-based implementation in the gvfs module has the name - "gconf". + GIO does not include a GTlsBackend implementation, the gnutls-based + implementation in the glib-networking module has the name "gnutls".

GVFS_INOTIFY_DIAG.  When this environment variable is set and GIO has been built - with inotify support, a dump of diagnostic inotify information + with inotify support, a dump of diagnostic inotify information will be written every 20 seconds to a file named /tmp/gvfsdid.pid.

GIO_EXTRA_MODULES.  - When this environment variable is set to a path, or a set of - paths separated by a colon, GIO will attempt to load - modules from within the path. + When this environment variable is set to a path, or a set of + paths separated by a colon, GIO will attempt to load + modules from within the path. +

+

GSETTINGS_BACKEND.  + This variable can be set to the name of a GSettingsBackend + implementation to override the default for debugging purposes. + The memory-based implementation that is included in GIO has + the name "memory", the one in dconf has the name "dconf-settings". +

+

GSETTINGS_SCHEMA_DIR.  + This variable can be set to the name of a directory that is + considered in addition to the glib-2.0/schemas + subdirectories of the XDG system data dirs when looking + for compiled schemas for GSettings. +

+

DBUS_SYSTEM_BUS_ADDRESS.  + This variable is consulted to find the address of the D-Bus system + bus. For the format of D-Bus addresses, see the D-Bus + specification. + + Setting this variable overrides platform-specific ways of determining + the system bus address. +

+

DBUS_SESSION_BUS_ADDRESS.  + This variable is consulted to find the address of the D-Bus session bus. + + Setting this variable overrides platform-specific ways of determining + the session bus address. +

+

DBUS_STARTER_BUS_TYPE.  + This variable is consulted to find out the 'starter' bus for an + application that has been started via D-Bus activation. The possible + values are 'system' or 'session'. +

+

G_DBUS_DEBUG.  + This variable can be set to a list of debug options, which + cause GLib to print out different types of debugging + information when using the D-Bus routines. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

transport

Show IO activity (e.g. reads and writes)

message

Show all sent and received D-Bus messages

payload

Show payload for all sent and received D-Bus messages (implies message)

call

Trace g_dbus_connection_call() and g_dbus_connection_call_sync() API usage

signal

Show when a D-Bus signal is received

incoming

Show when an incoming D-Bus method call is received

return

Show when a reply is returned via the GDBusMethodInvocation API

emission

Trace g_dbus_connection_emit_signal() API usage

authentication

Show information about connection authentication

address

Show information about D-Bus address lookups and autolaunching

+

+ The special value all can be used to turn + on all debug options. The special value + help can be used to print a list of + supported options to standard output. +

+

G_DBUS_COOKIE_SHA1_KEYRING_DIR.  + Can be used to override the directory used to store the + keyring used in the DBUS_COOKIE_SHA1 + authentication mechanism. Normally the directory used is + .dbus-keyrings in the user's home + directory. +

+

G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION.  + If set, the permissions of the directory used to store the + keyring used in the DBUS_COOKIE_SHA1 + authentication mechanism won't be checked. Normally the + directory must be readable only by the user.

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/ch19.html b/docs/reference/gio/html/ch26.html similarity index 80% rename from docs/reference/gio/html/ch19.html rename to docs/reference/gio/html/ch26.html index 0322a87..2dd504a 100644 --- a/docs/reference/gio/html/ch19.html +++ b/docs/reference/gio/html/ch26.html @@ -3,12 +3,12 @@ Migrating from POSIX to GIO - + - - - - + + + + @@ -17,11 +17,11 @@ Up Home GIO Reference Manual -Next +Next

-Migrating from POSIX to GIO

+Migrating from POSIX to GIO

Table 4. Comparison of POSIX and GIO concepts

@@ -70,6 +70,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/ch20.html b/docs/reference/gio/html/ch27.html similarity index 69% rename from docs/reference/gio/html/ch20.html rename to docs/reference/gio/html/ch27.html index fe66490..cce4407 100644 --- a/docs/reference/gio/html/ch20.html +++ b/docs/reference/gio/html/ch27.html @@ -3,29 +3,29 @@ Migrating from GnomeVFS to GIO - + - - - + + +
- + - +

-Migrating from GnomeVFS to GIO

+Migrating from GnomeVFS to GIO

Table 5. Comparison of GnomeVFS and GIO concepts

@@ -96,7 +96,7 @@

-Trash handling

+Trash handling

The handling of trashed files has been changed in GIO, compared to gnome-vfs. gnome-vfs has a home-grown trash implementation that @@ -164,10 +164,10 @@ switch (event_type) { case G_FILE_MONITOR_EVENT_DELETED: - g_print ("'%s' removed from trash\n", g_file_get_basename (child)); + g_print ("'%s' removed from trash\n", g_file_get_basename (child)); break; case G_FILE_MONITOR_EVENT_CREATED: - g_print ("'%s' added to trash\n", g_file_get_basename (child)); + g_print ("'%s' added to trash\n", g_file_get_basename (child)); break; default: ; } @@ -180,10 +180,10 @@ GFileMonitor *monitor; file = g_file_new_for_uri ("trash://"); - monitor = g_file_monitor_directory (file, 0, NULL, NULL); - g_object_unref (file); + monitor = g_file_monitor_directory (file, 0, NULL, NULL); + g_object_unref (file); - g_signal_connect (monitor, "changed", G_CALLBACK (file_changed), NULL); + g_signal_connect (monitor, "changed", G_CALLBACK (file_changed), NULL); /* ... */ @@ -203,8 +203,8 @@ reflect that state of the trash can.

- Moving a file to the trash is much simpler with GIO. Instead of - using gnome_vfs_find_directory() with GNOME_VFS_DIRECTORY_KIND_TRASH + Moving a file to the trash is much simpler with GIO. Instead of + using gnome_vfs_find_directory() with GNOME_VFS_DIRECTORY_KIND_TRASH to find out where to move the trashed file, just use the g_file_trash() function.

@@ -212,6 +212,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/ch20s02.html b/docs/reference/gio/html/ch27s02.html similarity index 65% rename from docs/reference/gio/html/ch20s02.html rename to docs/reference/gio/html/ch27s02.html index 3ea36e3..355697d 100644 --- a/docs/reference/gio/html/ch20s02.html +++ b/docs/reference/gio/html/ch27s02.html @@ -3,27 +3,27 @@ Operations on multiple files - + - - - - + + + + - - + + - +

-Operations on multiple files

+Operations on multiple files

- gnome-vfs has the dreaded gnome_vfs_xfer_uri_list() function which + gnome-vfs has the dreaded gnome_vfs_xfer_uri_list() function which has tons of options and offers the equivalent of cp, mv, ln, mkdir and rm at the same time.

@@ -36,6 +36,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/ch20s03.html b/docs/reference/gio/html/ch27s03.html similarity index 50% rename from docs/reference/gio/html/ch20s03.html rename to docs/reference/gio/html/ch27s03.html index e99f772..fcde883 100644 --- a/docs/reference/gio/html/ch20s03.html +++ b/docs/reference/gio/html/ch27s03.html @@ -3,37 +3,37 @@ Mime monitoring - + - - - - + + + + - - + + - +

-Mime monitoring

+Mime monitoring

gnome-vfs offered a way to monitor the association between mime types - and default handlers for changes, with the GnomeVFSMIMEMonitor object. + and default handlers for changes, with the GnomeVFSMIMEMonitor object. GIO does not offer a replacement for this functionality at this time, - since we have not found a compelling use case where - GnomeVFSMIMEMonitor was used. If you think you have such a use - case, please report it at + since we have not found a compelling use case where + GnomeVFSMIMEMonitor was used. If you think you have such a use + case, please report it at bugzilla.gnome.org.

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/ch28.html b/docs/reference/gio/html/ch28.html new file mode 100644 index 0000000..7ceed48 --- /dev/null +++ b/docs/reference/gio/html/ch28.html @@ -0,0 +1,57 @@ + + + + +Migrating from GConf to GSettings + + + + + + + + + + + + + + + + +
+

+Migrating from GConf to GSettings

+ +
+

+Before you start

+

+ Converting individual applications and their settings from GConf to + GSettings can be done at will. But desktop-wide settings like font or + theme settings often have consumers in multiple modules. Therefore, + some consideration has to go into making sure that all users of a setting + are converted to GSettings at the same time or that the program + responsible for configuring that setting continues to update the value in + both places. +

+

+ It is always a good idea to have a look at how others have handled + similar problems before. An examplaric conversion can be found e.g. + in the gsettings-tutorial branch of gnome-utils. +

+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch28s02.html b/docs/reference/gio/html/ch28s02.html new file mode 100644 index 0000000..77c6294 --- /dev/null +++ b/docs/reference/gio/html/ch28s02.html @@ -0,0 +1,59 @@ + + + + +Conceptual differences + + + + + + + + + + + + + + + + +
+

+Conceptual differences

+

+ Conceptually, GConf and GSettings are fairly similar. Both + have a concept of pluggable backends. Both keep information + about keys and their types in schemas. Both have a concept of + mandatory values, which lets you implement lock-down. +

+

+ There are some differences in the approach to schemas. GConf + installs the schemas into the database and has API to handle + schema information (gconf_client_get_default_from_schema(), + gconf_value_get_schema(), etc). GSettings on the other hand + assumes that an application knows its own schemas, and does + not provide API to handle schema information at runtime. + GSettings is also more strict about requiring a schema whenever + you want to read or write a key. To deal with more free-form + information that would appear in schema-less entries in GConf, + GSettings allows for schemas to be 'relocatable'. +

+

+ One difference in the way applications interact with their + settings is that with GConf you interact with a tree of + settings (ie the keys you pass to functions when reading + or writing values are actually paths with the actual name + of the key as the last element. With GSettings, you create + a GSettings object which has an implicit prefix that determines + where the settings get stored in the global tree of settings, + but the keys you pass when reading or writing values are just + the key names, not the full path. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch28s03.html b/docs/reference/gio/html/ch28s03.html new file mode 100644 index 0000000..3103950 --- /dev/null +++ b/docs/reference/gio/html/ch28s03.html @@ -0,0 +1,159 @@ + + + + +GConfClient (and GConfBridge) API conversion + + + + + + + + + + + + + + + + +
+

+GConfClient (and GConfBridge) API conversion

+

+ Most people use GConf via the high-level GConfClient API. + The corresponding API is the GSettings object. While not + every GConfClient function has a direct GSettings equivalent, + many do: +

+
+

Table 6. 

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GConfClientGSettings
gconf_client_get_default()no direct equivalent, + instead you call g_settings_new() for the schemas you use
gconf_client_set()g_settings_set()
gconf_client_get()g_settings_get()
gconf_client_get_bool()g_settings_get_boolean()
gconf_client_set_bool()g_settings_set_boolean()
gconf_client_get_int()g_settings_get_int()
gconf_client_set_int()g_settings_set_int()
gconf_client_get_float()g_settings_get_double()
gconf_client_set_float()g_settings_set_double()
gconf_client_get_string()g_settings_get_string()
gconf_client_set_string()g_settings_set_string()
gconf_client_get_list()for string lists, see g_settings_get_strv(), else see g_settings_get_value() and GVariant API
gconf_client_set_list()for string lists, see g_settings_set_strv(), else see g_settings_set_value() and GVariant API
gconf_entry_get_is_writable()g_settings_is_writable()
gconf_client_notify_add()not required, the "changed" signal is emitted automatically
gconf_client_add_dir()not required, each GSettings instance automatically watches all keys in its path
GConfChangeSet +g_settings_delay(), g_settings_apply() +
gconf_client_get_default_from_schema()no equivalent, applications are expected to know their schema
gconf_client_all_entries()no equivalent, applications are expected to know their schema, and GSettings does not allow schema-less entries
gconf_client_get_without_default()no equivalent
gconf_bridge_bind_property()g_settings_bind()
gconf_bridge_bind_property_full()g_settings_bind_with_mapping()
+
+


+

+

+ GConfBridge was a third-party library that used GConf to bind an object property + to a particular configuration key. GSettings offers this service itself. +

+

+ There is a pattern that is sometimes used for GConf, where a setting can have + explicit 'value A', explicit 'value B' or 'use the system default'. With GConf, + 'use the system default' is sometimes implemented by unsetting the user value. +

+

+ This is not possible in GSettings, since it does not have API to determine if a value + is the default and does not let you unset values. The recommended way (and much + clearer) way in which this can be implemented in GSettings is to have a separate + 'use-system-default' boolean setting. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch28s04.html b/docs/reference/gio/html/ch28s04.html new file mode 100644 index 0000000..b907f49 --- /dev/null +++ b/docs/reference/gio/html/ch28s04.html @@ -0,0 +1,46 @@ + + + + +Change notification + + + + + + + + + + + + + + + + +
+

+Change notification

+

+ GConf requires you to call gconf_client_add_dir() and + gconf_client_notify_add() to get change notification. With + GSettings, this is not necessary; signals get emitted automatically + for every change. +

+

+ The "changed" signal is emitted for each changed key. + There is also a "change-event" signal that you can handle + if you need to see groups of keys that get changed at the same time. +

+

+ GSettings also notifies you about changes in writability of keys, + with the "writable-changed" signal (and the + "writable-change-event" signal). +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch28s05.html b/docs/reference/gio/html/ch28s05.html new file mode 100644 index 0000000..265359f --- /dev/null +++ b/docs/reference/gio/html/ch28s05.html @@ -0,0 +1,48 @@ + + + + +Change sets + + + + + + + + + + + + + + + + +
+

+Change sets

+

+ GConf has a a concept of a set of changes which can be applied or reverted + at once: GConfChangeSet (GConf doesn't actually apply changes atomically, + which is one of its shortcomings). +

+

+ Instead of a separate object to represent a change set, GSettings has a + 'delayed-apply' mode, which can be turned on for a GSettings object by + calling g_settings_delay(). In this mode, changes done to the GSettings + object are not applied - they are still visible when calling g_settings_get() + on the same object, but not to other GSettings instances + or even other processes. +

+

+ To apply the pending changes all at once (GSettings does + atomicity here), call g_settings_apply(). To revert the pending changes, + call g_settings_revert() or just drop the reference to the GSettings object. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch28s06.html b/docs/reference/gio/html/ch28s06.html new file mode 100644 index 0000000..79d588b --- /dev/null +++ b/docs/reference/gio/html/ch28s06.html @@ -0,0 +1,277 @@ + + + + +Schema conversion + + + + + + + + + + + + + + + + +
+

+Schema conversion

+

+ If you are porting your application from GConf, most likely you already + have a GConf schema. GConf comes with a commandline tool + gsettings-schema-convert + that can help with the task of converting a GConf schema into + an equivalent GSettings schema. The tool is not perfect and + may need assistence in some cases. +

+
+

Example 17. An example for using gsettings-schema-convert

+
+

Running gsettings-schema-convert --gconf --xml --schema-id "org.gnome.font-rendering" --output org.gnome.font-rendering.gschema.xml destop_gnome_font_rendering.schemas on the following desktop_gnome_font_rendering.schemas file: +

+
+
+<?xml version="1.0"?>
+<gconfschemafile>
+    <schemalist>
+        <schema>
+            <key>/schemas/desktop/gnome/font_rendering/dpi</key>
+            <applyto>/desktop/gnome/font_rendering/dpi</applyto>
+            <owner>gnome</owner>
+            <type>int</type>
+            <default>96</default>
+            <locale name="C">
+                <short>DPI</short>
+                <long>The resolution used for converting font sizes to pixel sizes, in dots per inch.</long>
+            </locale>
+        </schema>
+    </schemalist>
+</gconfschemafile>
+
+
+

+produces a org.gnome.font-rendering.gschema.xml file with the following content: +

+
+
+<schemalist>
+  <schema id="org.gnome.font-rendering" path="/desktop/gnome/font_rendering/">
+    <key name="dpi" type="i">
+      <default>96</default>
+      <summary>DPI</summary>
+      <description>The resolution used for converting font sizes to pixel sizes, in dots per inch.</description>
+    </key>
+  </schema>
+</schemalist>
+
+
+

+

+
+
+

+ GSettings schemas are identified at runtime by their id (as specified + in the XML source file). It is recommended to use a dotted name as schema + id, similar in style to a DBus bus name, e.g. "org.gnome.font-rendering". + The filename used for the XML schema source is immaterial, but + schema compiler expects the files to have the extension + .gschema.xml. It is recommended to simply + use the schema id as the filename, followed by this extension, + e.g. org.gnome.font-rendering.gschema.xml. +

+

+ The XML source file for your GSettings schema needs to get installed + into $datadir/glib-2.0/schemas, and needs to be + compiled into a binary form. At runtime, GSettings looks for compiled + schemas in the glib-2.0/schemas subdirectories + of all XDG_DATA_DIRS directories, so if you install + your schema in a different location, you need to set the + XDG_DATA_DIRS environment variable appropriately. +

+

+ Schemas are compiled into binary form by the + glib-compile-schemas utility. + GIO provides a glib_compile_schemas + variable for the schema compiler. +

+

+ You can ignore all of this by using the provided m4 macros. To + do this, add to your configure.ac: +

+
+GLIB_GSETTINGS
+
+

+ The corresponding Makefile.am fragment looks like + this: +

+
+# gsettings_SCHEMAS is a list of all the schemas you want to install
+gsettings_SCHEMAS = my.app.gschema.xml
+
+# include the appropriate makefile rules for schema handling
+@GSETTINGS_RULES@
+
+

+

+

+ This is not sufficient on its own. You need to mention what the source + of the my.app.gschema.xml file is. If the schema + file is distributed directly with your project's tarball then a mention + in EXTRA_DIST is appropriate. If the schema file is + generated from another source then you will need the appropriate rule + for that, plus probably an item in EXTRA_DIST for the + source files used by that rule. +

+

+ One possible pitfall in doing schema conversion is that the default + values in GSettings schemas are parsed by the GVariant parser. + This means that strings need to include quotes in the XML. Also note + that the types are now specified as GVariant type strings. +

+
+
+<type>string</type>
+<default>rgb</default>
+
+        
+

+ becomes +

+
+
+<key name="rgba-order" type="s">
+  <default>'rgb'</default> <!-- note quotes -->
+</key>
+
+        
+

+

+

+ Another possible complication is that GConf specifies full paths + for each key, while a GSettings schema has a 'path' attribute that + contains the prefix for all the keys in the schema, and individual + keys just have a simple name. So +

+
+
+<key>/schemas/desktop/gnome/font_rendering/antialiasing</key>
+
+        
+

+ becomes +

+
+
+<schema id="org.gnome.font" path="/desktop/gnome/font_rendering/">
+  <key name="antialiasing" type="s">
+
+        
+

+

+

+ Default values can be localized in both GConf and GSettings schemas, + but GSettings uses gettext for the localization. You can specify + the gettext domain to use in the gettext-domain + attribute. Therefore, when converting localized defaults in GConf, +

+
+
+<key>/schemas/apps/my_app/font_size</key>
+  <locale name="C">
+    <default>18</default>
+  </locale>
+  <locale name="be">
+    <default>24</default>
+  </locale>
+</key>
+
+        
+

+ becomes +

+
+
+<schema id="..." gettext-domain="your-domain">
+ ...
+<key name="font-size" type="i">
+  <default l10n="messages" context="font_size">18</default>
+</key>
+
+        
+

+

+

+ GSettings uses gettext for translation of default values. + The string that is translated is exactly the string that appears + inside of the <default> element. This + includes the quotation marks that appear around strings. + Default values must be marked with the l10n + attribute in the <default> tag, which + should be set as equal to 'messages' or + 'time' depending on the desired category. An + optional translation context can also be specified with the + context attribute, as in the example. This + is usually recommended, since the string "18" + is not particularly easy to translate without context. The + translated version of the default value should be stored in the + specified gettext-domain. Care must be taken + during translation to ensure that all translated values remain + syntactically valid; mistakes here will cause runtime errors. +

+

+ GSettings schemas have optional <summary> and + <description> elements for each key which + correspond to the <short> and + <long> elements in the GConf schema and + will be used in similar ways by a future gsettings-editor, so you + should use the same conventions for them: The summary is just a short + label with no punctuation, the description can be one or more complete + sentences. If multiple paragraphs are desired for the description, the + paragraphs should be separated by a completely empty line. +

+

+ Translations for these strings will also be handled + via gettext, so you should arrange for these strings to be + extracted into your gettext catalog. One way to do that is to use + intltool. For that, you use <_summary> + and <_description> elements in a + .gschema.xml.in file and use + @INTLTOOL_XML_NOMERGE_RULE@ + in your Makefile.am to produce the .gschema.xml file. The + NOMERGE part of the rule instructs intltool + to extract translatable strings, but not merge the translations + back into the generated xml file. +

+

+ GSettings is a bit more restrictive about key names than GConf. Key + names in GSettings can be at most 32 characters long, and must only + consist of lowercase characters, numbers and dashes, with no + consecutive dashes. The first character must not be a number or dash, + and the last character cannot be '-'. +

+

+ If you are using the GConf backend for GSettings during the + transition, you may want to keep your key names the same they + were in GConf, so that existing settings in the users GConf + database are preserved. You can achieve this by using the + --allow-any-name with the + glib-compile-schemas schema + compiler. Note that this option is only meant + to ease the process of porting your application, allowing parts + of your application to continue to access GConf and parts to use + GSettings. By the time you have finished porting your application + you must ensure that all key names are valid. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch28s07.html b/docs/reference/gio/html/ch28s07.html new file mode 100644 index 0000000..024af7b --- /dev/null +++ b/docs/reference/gio/html/ch28s07.html @@ -0,0 +1,160 @@ + + + + +Data conversion + + + + + + + + + + + + + + + + +
+

+Data conversion

+

+ GConf comes with a GSettings backend that can be used to + facility the transition to the GSettings API until you are + ready to make the jump to a different backend (most likely + dconf). To use it, you need to set the GSETTINGS_BACKEND + to 'gconf', e.g. by using +

+
+  g_setenv ("GSETTINGS_BACKEND", "gconf", TRUE);
+
+

+ early on in your program. Note that this backend is meant purely + as a transition tool, and should not be used in production. +

+

+ GConf also comes with a utility called + gsettings-data-convert, which is designed to help + with the task of migrating user settings from GConf into another + GSettings backend. It can be run manually, but it is designed to be + executed automatically, every time a user logs in. It keeps track of + the data migrations that it has already done, and it is harmless to + run it more than once. +

+

+ To make use of this utility, you must install a keyfile in the + directory /usr/share/GConf/gsettings which + lists the GSettings keys and GConf paths to map to each other, for + each schema that you want to migrate user data for. +

+

+ Here is an example: +

+
+
+[org.gnome.fonts]
+antialiasing = /desktop/gnome/font_rendering/antialiasing
+dpi = /desktop/gnome/font_rendering/dpi
+hinting = /desktop/gnome/font_rendering/hinting
+rgba-order = /desktop/gnome/font_rendering/rgba_order
+
+[apps.myapp:/path/to/myapps/]
+some-odd-key1 = /apps/myapp/some_ODD-key1
+
+        
+

+ The last key demonstrates that it may be necessary to modify the key + name to comply with stricter GSettings key name rules. Of course, + that means your application must use the new key names when looking + up settings in GSettings. +

+

+ The last group in the example also shows how to handle the case + of 'relocatable' schemas, which don't have a fixed path. You can + specify the path to use in the group name, separated by a colon. +

+

+ There are some limitations: gsettings-data-convert + does not do any transformation of the values. And it does not handle + complex GConf types other than lists of strings or integers. +

+

+ Don't forget to require GConf 2.31.1 or newer in your configure + script if you are making use of the GConf backend or the conversion + utility. +

+

+ If, as an application developer, you are interested in manually + ensuring that gsettings-data-convert has been + invoked (for example, to deal with the case where the user is + logged in during a distribution upgrade or for non-XDG desktop + environments which do not run the command as an autostart) you + may invoke it manually during your program initialisation. This + is not recommended for all application authors -- it is your + choice if this use case concerns you enough. +

+

+ Internally, gsettings-data-convert uses a + keyfile to track which settings have been migrated. The + following code fragment will check that keyfile to see if your + data conversion script has been run yet and, if not, will + attempt to invoke the tool to run it. You should adapt it to + your application as you see fit. +

+

+

+
+
+static void
+ensure_migrated (const gchar *name)
+{
+  gboolean needed = TRUE;
+  GKeyFile *kf;
+  gchar **list;
+  gsize i, n;
+
+  kf = g_key_file_new ();
+
+  g_key_file_load_from_data_dirs (kf, "gsettings-data-convert",
+                                  NULL, G_KEY_FILE_NONE, NULL);
+  list = g_key_file_get_string_list (kf, "State", "converted", &n, NULL);
+
+  if (list)
+    {
+      for (i = 0; i < n; i++)
+        if (strcmp (list[i], name) == 0)
+          {
+            needed = FALSE;
+            break;
+          }
+
+      g_strfreev (list);
+    }
+
+  g_key_file_free (kf);
+
+  if (needed)
+    g_spawn_command_line_sync ("gsettings-data-convert",
+                               NULL, NULL, NULL, NULL);
+}
+
+
+        
+

+

+

+ Although there is the possibility that the + gsettings-data-convert script will end up + running multiple times concurrently with this approach, it is + believed that this is safe. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch29.html b/docs/reference/gio/html/ch29.html new file mode 100644 index 0000000..1f87642 --- /dev/null +++ b/docs/reference/gio/html/ch29.html @@ -0,0 +1,70 @@ + + + + +Migrating to GDBus + + + + + + + + + + + + + + + + +
+

+Migrating to GDBus

+ +
+

+Conceptual differences

+

+ The central concepts of D-Bus are modelled in a very similar way + in dbus-glib and GDBus. Both have a objects representing connections, + proxies and method invocations. But there are some important + differences: +

+
    +
  • + dbus-glib uses libdbus, GDBus doesn't. Instead, it relies on GIO + streams as transport layer, and has its own implementation for the + the D-Bus connection setup and authentication. Apart from using + streams as transport, avoiding libdbus also lets GDBus avoid some + thorny multithreading issues. +

  • +
  • + dbus-glib uses the GObject type system for method arguments and + return values, including a homegrown container specialization + mechanism. GDBus relies uses the GVariant type system which is + explicitly designed to match D-Bus types. +

  • +
  • + The typical way to export an object in dbus-glib involves generating + glue code from XML introspection data using dbus-binding-tool. GDBus does not (yet?) use code generation; you are expected to + embed the introspection data in your application code. +

  • +
+

+

+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch29s02.html b/docs/reference/gio/html/ch29s02.html new file mode 100644 index 0000000..e6e3689 --- /dev/null +++ b/docs/reference/gio/html/ch29s02.html @@ -0,0 +1,130 @@ + + + + +API comparison + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch29s03.html b/docs/reference/gio/html/ch29s03.html new file mode 100644 index 0000000..5e54063 --- /dev/null +++ b/docs/reference/gio/html/ch29s03.html @@ -0,0 +1,202 @@ + + + + +Owning bus names + + + + + + + + + + + + + + + + +
+

+Owning bus names

+

+ Using dbus-glib, you typically call RequestName manually + to own a name, like in the following excerpt: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
error = NULL;
+res = dbus_g_proxy_call (system_bus_proxy,
+                         "RequestName",
+                         &error,
+                         G_TYPE_STRING, NAME_TO_CLAIM,
+                         G_TYPE_UINT,   DBUS_NAME_FLAG_ALLOW_REPLACEMENT,
+                         G_TYPE_INVALID,
+                         G_TYPE_UINT,   &result,
+                         G_TYPE_INVALID);
+if (!res)
+  {
+    if (error != NULL)
+      {
+        g_warning ("Failed to acquire %s: %s",
+                   NAME_TO_CLAIM, error->message);
+        g_error_free (error);
+      }
+    else
+      {
+        g_warning ("Failed to acquire %s", NAME_TO_CLAIM);
+      }
+    goto out;
+  }
+
+if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
+  {
+    if (error != NULL)
+      {
+        g_warning ("Failed to acquire %s: %s",
+                   NAME_TO_CLAIM, error->message);
+        g_error_free (error);
+      }
+    else
+      {
+        g_warning ("Failed to acquire %s", NAME_TO_CLAIM);
+      }
+    exit (1);
+  }
+
+dbus_g_proxy_add_signal (system_bus_proxy, "NameLost",
+                         G_TYPE_STRING, G_TYPE_INVALID);
+dbus_g_proxy_connect_signal (system_bus_proxy, "NameLost",
+                             G_CALLBACK (on_name_lost), NULL, NULL);
+
+/* further setup ... */
+
+ +

+

+

+ While you can do things this way with GDBus too, using + g_dbus_proxy_call_sync(), it is much nicer to use the high-level API + for this: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+  /* further setup ... */
+}
+
+/* ... */
+
+  owner_id = g_bus_own_name (G_BUS_TYPE_SYSTEM,
+                             NAME_TO_CLAIM,
+                             G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT,
+                             on_bus_acquired,
+                             on_name_acquired,
+                             on_name_lost,
+                             NULL,
+                             NULL);
+
+  g_main_loop_run (loop);
+
+  g_bus_unown_name (owner_id);
+
+ +

+ Note that g_bus_own_name() works asynchronously and requires + you to enter your mainloop to await the on_name_aquired() + callback. Also note that in order to avoid race conditions (e.g. + when your service is activated by a method call), you have to export + your manager object before acquiring the + name. The on_bus_acquired() callback is the right place to do + such preparations. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch29s04.html b/docs/reference/gio/html/ch29s04.html new file mode 100644 index 0000000..683aa66 --- /dev/null +++ b/docs/reference/gio/html/ch29s04.html @@ -0,0 +1,96 @@ + + + + +Creating proxies for well-known names + + + + + + + + + + + + + + + + +
+

+Creating proxies for well-known names

+

+ dbus-glib lets you create proxy objects for well-known names, like the + following example: +

+
+ + + + + + + +
1
+2
+3
+4
proxy = dbus_g_proxy_new_for_name (system_bus_connection,
+                                   "org.freedesktop.Accounts",
+                                   "/org/freedesktop/Accounts",
+                                   "org.freedesktop.Accounts");
+
+ +

+ For a DBusGProxy constructed like this, method calls will be sent to + the current owner of the name, and that owner can change over time. +

+

+ The same can be achieved with GDBusProxy: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
error = NULL;
+proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                       G_DBUS_PROXY_FLAGS_NONE,
+                                       NULL, /* GDBusInterfaceInfo */
+                                       "org.freedesktop.Accounts",
+                                       "/org/freedesktop/Accounts",
+                                       "org.freedesktop.Accounts",
+                                       NULL, /* GCancellable */
+                                       &error);
+
+ +

+ For an added layer of safety, you can specify what D-Bus + interface the proxy is expected to conform to by using the + GDBusInterfaceInfo type. +

+

+ Additionally, GDBusProxy loads, caches and tracks changes to + the D-Bus properties on the remote object. It also sets up match + rules so D-Bus signals from the remote object are delivered + locally. +

+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch29s05.html b/docs/reference/gio/html/ch29s05.html new file mode 100644 index 0000000..6d480f3 --- /dev/null +++ b/docs/reference/gio/html/ch29s05.html @@ -0,0 +1,823 @@ + + + + +Client-side GObject bindings + + + + + + + + + + + + + + + + +
+

+Client-side GObject bindings

+

+ dbus-glib comes with dbus-binding-tool, which + can produce somewhat nice client-side wrappers for a D-Bus interface. + GDBus does not have code-generation at this point, but GDBusProxy + is designed to allow the creating of client-side wrappers by + subclassing GDBusProxy. +

+

+ For an example of a GDBusProxy-derived class that wraps a D-Bus + interface in a type-safe way, see Example 18, “GDBusProxy subclass example”. The comparison is as + follows: +

+
+

Table 8. Wrapping the org.freedesktop.Accounts.User D-Bus interface in the AccountUser GObject type

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
D-Bus conceptGObject concept
AutomaticLogin property +

AccountsUser:automatic-login GObject property

+

C getter: accounts_user_get_automatic_login()

+

Watch changes via the notify::automatic-login signal

+
RealName property +

AccountsUser:real-name GObject property

+

C getter: accounts_user_get_real_name()

+

Watch changes via the notify::real-name signal

+
UserName property +

AccountsUser:user-name GObject property

+

C getter: accounts_user_get_user_name()

+

Watch changes via the notify::user-name signal

+
Changed signal +

AccountsUser::changed GObject signal

+

Watch via e.g. g_signal_connect()

+
Frobnicate method +

Use accounts_user_frobnicate() + accounts_user_frobnicate_finish() or accounts_user_frobnicate_sync() to invoke

+
+
+


+

+
+

Example 18. GDBusProxy subclass example

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
#include <gio/gio.h>
+
+/* ---------------------------------------------------------------------------------------------------- */
+/* The D-Bus interface definition we want to create a GDBusProxy-derived type for: */
+/* ---------------------------------------------------------------------------------------------------- */
+
+static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.freedesktop.Accounts.User'>"
+  "    <method name='Frobnicate'>"
+  "      <arg name='flux' type='s' direction='in'/>"
+  "      <arg name='baz' type='s' direction='in'/>"
+  "      <arg name='result' type='s' direction='out'/>"
+  "    </method>"
+  "    <signal name='Changed'/>"
+  "    <property name='AutomaticLogin' type='b' access='readwrite'/>"
+  "    <property name='RealName' type='s' access='read'/>"
+  "    <property name='UserName' type='s' access='read'/>"
+  "  </interface>"
+  "</node>";
+
+/* ---------------------------------------------------------------------------------------------------- */
+/* Definition of the AccountsUser type */
+/* ---------------------------------------------------------------------------------------------------- */
+
+#define ACCOUNTS_TYPE_USER         (accounts_user_get_type ())
+#define ACCOUNTS_USER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), ACCOUNTS_TYPE_USER, AccountsUser))
+#define ACCOUNTS_USER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), ACCOUNTS_TYPE_USER, AccountsUserClass))
+#define ACCOUNTS_USER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ACCOUNTS_TYPE_USER, AccountsUserClass))
+#define ACCOUNTS_IS_USER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), ACCOUNTS_TYPE_USER))
+#define ACCOUNTS_IS_USER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), ACCOUNTS_TYPE_USER))
+
+typedef struct _AccountsUser        AccountsUser;
+typedef struct _AccountsUserClass   AccountsUserClass;
+typedef struct _AccountsUserPrivate AccountsUserPrivate;
+
+struct _AccountsUser
+{
+  /*< private >*/
+  GDBusProxy parent_instance;
+  AccountsUserPrivate *priv;
+};
+
+struct _AccountsUserClass
+{
+  /*< private >*/
+  GDBusProxyClass parent_class;
+  void (*changed) (AccountsUser *user);
+};
+
+GType        accounts_user_get_type            (void) G_GNUC_CONST;
+
+const gchar *accounts_user_get_user_name       (AccountsUser        *user);
+const gchar *accounts_user_get_real_name       (AccountsUser        *user);
+gboolean     accounts_user_get_automatic_login (AccountsUser        *user);
+
+void         accounts_user_frobnicate          (AccountsUser        *user,
+                                                const gchar         *flux,
+                                                gint                 baz,
+                                                GCancellable        *cancellable,
+                                                GAsyncReadyCallback  callback,
+                                                gpointer             user_data);
+gchar       *accounts_user_frobnicate_finish   (AccountsUser        *user,
+                                                GAsyncResult        *res,
+                                                GError             **error);
+gchar       *accounts_user_frobnicate_sync     (AccountsUser        *user,
+                                                const gchar         *flux,
+                                                gint                 baz,
+                                                GCancellable        *cancellable,
+                                                GError             **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+/* Implementation of the AccountsUser type */
+/* ---------------------------------------------------------------------------------------------------- */
+
+/* A more efficient approach than parsing XML is to use const static
+ * GDBusInterfaceInfo, GDBusMethodInfo, ... structures
+ */
+static GDBusInterfaceInfo *
+accounts_user_get_interface_info (void)
+{
+  static gsize has_info = 0;
+  static GDBusInterfaceInfo *info = NULL;
+  if (g_once_init_enter (&has_info))
+    {
+      GDBusNodeInfo *introspection_data;
+      introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+      info = introspection_data->interfaces[0];
+      g_once_init_leave (&has_info, 1);
+    }
+  return info;
+}
+
+enum
+{
+  PROP_0,
+  PROP_USER_NAME,
+  PROP_REAL_NAME,
+  PROP_AUTOMATIC_LOGIN,
+};
+
+enum
+{
+  CHANGED_SIGNAL,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = {0};
+
+G_DEFINE_TYPE (AccountsUser, accounts_user, G_TYPE_DBUS_PROXY);
+
+static void
+accounts_user_finalize (GObject *object)
+{
+  G_GNUC_UNUSED AccountsUser *user = ACCOUNTS_USER (object);
+
+  if (G_OBJECT_CLASS (accounts_user_parent_class)->finalize != NULL)
+    G_OBJECT_CLASS (accounts_user_parent_class)->finalize (object);
+}
+
+static void
+accounts_user_init (AccountsUser *user)
+{
+  /* Sets the expected interface */
+  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (user), accounts_user_get_interface_info ());
+}
+
+static void
+accounts_user_get_property (GObject    *object,
+                            guint       prop_id,
+                            GValue     *value,
+                            GParamSpec *pspec)
+{
+  AccountsUser *user = ACCOUNTS_USER (object);
+
+  switch (prop_id)
+    {
+    case PROP_USER_NAME:
+      g_value_set_string (value, accounts_user_get_user_name (user));
+      break;
+
+    case PROP_REAL_NAME:
+      g_value_set_string (value, accounts_user_get_real_name (user));
+      break;
+
+    case PROP_AUTOMATIC_LOGIN:
+      g_value_set_boolean (value, accounts_user_get_automatic_login (user));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+const gchar *
+accounts_user_get_user_name (AccountsUser *user)
+{
+  GVariant *value;
+  const gchar *ret;
+  g_return_val_if_fail (ACCOUNTS_IS_USER (user), NULL);
+  value = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (user), "UserName");
+  ret = g_variant_get_string (value, NULL);
+  g_variant_unref (value);
+  return ret;
+}
+
+const gchar *
+accounts_user_get_real_name (AccountsUser *user)
+{
+  GVariant *value;
+  const gchar *ret;
+  g_return_val_if_fail (ACCOUNTS_IS_USER (user), NULL);
+  value = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (user), "RealName");
+  ret = g_variant_get_string (value, NULL);
+  g_variant_unref (value);
+  return ret;
+}
+
+gboolean
+accounts_user_get_automatic_login (AccountsUser *user)
+{
+  GVariant *value;
+  gboolean ret;
+  g_return_val_if_fail (ACCOUNTS_IS_USER (user), FALSE);
+  value = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (user), "AutomaticLogin");
+  ret = g_variant_get_boolean (value);
+  g_variant_unref (value);
+  return ret;
+}
+
+static void
+accounts_user_g_signal (GDBusProxy   *proxy,
+                        const gchar  *sender_name,
+                        const gchar  *signal_name,
+                        GVariant     *parameters)
+{
+  AccountsUser *user = ACCOUNTS_USER (proxy);
+  if (g_strcmp0 (signal_name, "Changed") == 0)
+    g_signal_emit (user, signals[CHANGED_SIGNAL], 0);
+}
+
+static void
+accounts_user_g_properties_changed (GDBusProxy          *proxy,
+                                    GVariant            *changed_properties,
+                                    const gchar* const  *invalidated_properties)
+{
+  AccountsUser *user = ACCOUNTS_USER (proxy);
+  GVariantIter *iter;
+  const gchar *key;
+
+  if (changed_properties != NULL)
+    {
+      g_variant_get (changed_properties, "a{sv}", &iter);
+      while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+        {
+          if (g_strcmp0 (key, "AutomaticLogin") == 0)
+            g_object_notify (G_OBJECT (user), "automatic-login");
+          else if (g_strcmp0 (key, "RealName") == 0)
+            g_object_notify (G_OBJECT (user), "real-name");
+          else if (g_strcmp0 (key, "UserName") == 0)
+            g_object_notify (G_OBJECT (user), "user-name");
+        }
+      g_variant_iter_free (iter);
+    }
+}
+
+static void
+accounts_user_class_init (AccountsUserClass *klass)
+{
+  GObjectClass *gobject_class;
+  GDBusProxyClass *proxy_class;
+
+  gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->get_property = accounts_user_get_property;
+  gobject_class->finalize = accounts_user_finalize;
+
+  proxy_class = G_DBUS_PROXY_CLASS (klass);
+  proxy_class->g_signal             = accounts_user_g_signal;
+  proxy_class->g_properties_changed = accounts_user_g_properties_changed;
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_USER_NAME,
+                                   g_param_spec_string ("user-name",
+                                                        "User Name",
+                                                        "The user name of the user",
+                                                        NULL,
+                                                        G_PARAM_READABLE |
+                                                        G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_REAL_NAME,
+                                   g_param_spec_string ("real-name",
+                                                        "Real Name",
+                                                        "The real name of the user",
+                                                        NULL,
+                                                        G_PARAM_READABLE |
+                                                        G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_AUTOMATIC_LOGIN,
+                                   g_param_spec_boolean ("automatic-login",
+                                                         "Automatic Login",
+                                                         "Whether the user is automatically logged in",
+                                                         FALSE,
+                                                         G_PARAM_READABLE |
+                                                         G_PARAM_STATIC_STRINGS));
+
+  signals[CHANGED_SIGNAL] = g_signal_new ("changed",
+                                          ACCOUNTS_TYPE_USER,
+                                          G_SIGNAL_RUN_LAST,
+                                          G_STRUCT_OFFSET (AccountsUserClass, changed),
+                                          NULL,
+                                          NULL,
+                                          g_cclosure_marshal_VOID__VOID,
+                                          G_TYPE_NONE,
+                                          0);
+}
+
+gchar *
+accounts_user_frobnicate_sync (AccountsUser        *user,
+                               const gchar         *flux,
+                               gint                 baz,
+                               GCancellable        *cancellable,
+                               GError             **error)
+{
+  gchar *ret;
+  GVariant *value;
+
+  g_return_val_if_fail (ACCOUNTS_IS_USER (user), NULL);
+
+  ret = NULL;
+
+  value = g_dbus_proxy_call_sync (G_DBUS_PROXY (user),
+                                  "Frobnicate",
+                                  g_variant_new ("(si)",
+                                                 flux,
+                                                 baz),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  cancellable,
+                                  error);
+  if (value != NULL)
+    {
+      g_variant_get (value, "(s)", &ret);
+      g_variant_unref (value);
+    }
+  return ret;
+}
+
+void
+accounts_user_frobnicate (AccountsUser        *user,
+                          const gchar         *flux,
+                          gint                 baz,
+                          GCancellable        *cancellable,
+                          GAsyncReadyCallback  callback,
+                          gpointer             user_data)
+{
+  g_return_if_fail (ACCOUNTS_IS_USER (user));
+  g_dbus_proxy_call (G_DBUS_PROXY (user),
+                     "Frobnicate",
+                     g_variant_new ("(si)",
+                                    flux,
+                                    baz),
+                     G_DBUS_CALL_FLAGS_NONE,
+                     -1,
+                     cancellable,
+                     callback,
+                     user_data);
+}
+
+
+gchar *
+accounts_user_frobnicate_finish (AccountsUser        *user,
+                                 GAsyncResult        *res,
+                                 GError             **error)
+{
+  gchar *ret;
+  GVariant *value;
+
+  ret = NULL;
+  value = g_dbus_proxy_call_finish (G_DBUS_PROXY (user), res, error);
+  if (value != NULL)
+    {
+      g_variant_get (value, "(s)", &ret);
+      g_variant_unref (value);
+    }
+  return ret;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+gint
+main (gint argc, gchar *argv[])
+{
+  return 0;
+}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/ch29s06.html b/docs/reference/gio/html/ch29s06.html new file mode 100644 index 0000000..22ebe64 --- /dev/null +++ b/docs/reference/gio/html/ch29s06.html @@ -0,0 +1,828 @@ + + + + +Exporting objects + + + + + + + + + + + + + + + + +
+

+Exporting objects

+

+ With dbus-glib, exporting an object over D-Bus works by generating + a bunch of glue code from your introspection XML with + dbus-binding-tool. The glue code gets included in + your source, and you need to call +

+
+ + + + + + + +
1
+2
dbus_g_object_type_install_info (TYPE_MYOBJECT,
+                                 &dbus_glib_myobject_object_info);
+
+ +

+ in your class_init() function to tell dbus-glib about your type. + To actually export an instance, you call +

+
+ + + + + + + +
1
+2
+3
dbus_g_connection_register_g_object (system_bus_connection,
+                                     my_object_path,
+                                     G_OBJECT (my_object));
+
+ +

+ +

+

+ The GDBus way of exporting an object works by embedding the + introspection XML in the source, creating introspection data + structures from it with g_dbus_node_info_new_for_xml(), and + passing that along when you register the object: +

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.gtk.GDBus.TestPeerInterface'>"
+  "    <method name='HelloWorld'>"
+  "      <arg type='s' name='greeting' direction='in'/>"
+  "      <arg type='s' name='response' direction='out'/>"
+  "    </method>"
+  "  </interface>"
+  "</node>";
+
+/* parse introspection data */
+introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+
+/
+id = g_dbus_connection_register_object (connection,
+                                        "/org/gtk/GDBus/TestObject",
+                                        "org.gtk.GDBus.TestPeerInterface",
+                                        introspection_data->interfaces[0],
+                                        &interface_vtable,
+                                        NULL,  /* user_data */
+                                        NULL,  /* user_data_free_func */
+                                        NULL); /* GError** */
+
+ +

+

+

+ The actual implementation of the exported object is done by specifying + a GDBusInterfaceVTable that has method_call(), get_property() and + set_property() methods. There is no direct support beyond that for + exporting GObjects, so there is quite a bit of manual work involved, + as you can see in the following example. +

+

+ Since the VTable methods don't have any direct GObject support, we + pass the exported object as user_data. Also note that we have to handle + the emission of the PropertiesChanged signal ourselves, by connecting + to ::notify. +

+
+

Example 19. Exporting a GObject

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
#include <gio/gio.h>
+#include <stdlib.h>
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+/* The object we want to export */
+typedef struct _MyObjectClass MyObjectClass;
+typedef struct _MyObject MyObject;
+
+struct _MyObjectClass
+{
+  GObjectClass parent_class;
+};
+
+struct _MyObject
+{
+  GObject parent_instance;
+
+  gint count;
+  gchar *name;
+};
+
+enum
+{
+  PROP_0,
+  PROP_COUNT,
+  PROP_NAME
+};
+
+G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT);
+
+static void
+my_object_finalize (GObject *object)
+{
+  MyObject *myobj = (MyObject*)object;
+
+  g_free (myobj->name);
+
+  G_OBJECT_CLASS (my_object_parent_class)->finalize (object);
+}
+
+static void
+my_object_init (MyObject *object)
+{
+  object->count = 0;
+  object->name = NULL;
+}
+
+static void
+my_object_get_property (GObject    *object,
+                        guint       prop_id,
+                        GValue     *value,
+                        GParamSpec *pspec)
+{
+  MyObject *myobj = (MyObject*)object;
+
+  switch (prop_id)
+    {
+    case PROP_COUNT:
+      g_value_set_int (value, myobj->count);
+      break;
+
+    case PROP_NAME:
+      g_value_set_string (value, myobj->name);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+my_object_set_property (GObject      *object,
+                        guint         prop_id,
+                        const GValue *value,
+                        GParamSpec   *pspec)
+{
+  MyObject *myobj = (MyObject*)object;
+
+  switch (prop_id)
+    {
+    case PROP_COUNT:
+      myobj->count = g_value_get_int (value);
+      break;
+
+    case PROP_NAME:
+      g_free (myobj->name);
+      myobj->name = g_value_dup_string (value);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+my_object_class_init (MyObjectClass *class)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+  gobject_class->finalize = my_object_finalize;
+  gobject_class->set_property = my_object_set_property;
+  gobject_class->get_property = my_object_get_property;
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_COUNT,
+                                   g_param_spec_int ("count",
+                                                     "Count",
+                                                     "Count",
+                                                     0, 99999, 0,
+                                                     G_PARAM_READWRITE));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_NAME,
+                                   g_param_spec_string ("name",
+                                                        "Name",
+                                                        "Name",
+                                                        NULL,
+                                                        G_PARAM_READWRITE));
+}
+
+/* A method that we want to export */
+void
+my_object_change_count (MyObject *myobj,
+                        gint      change)
+{
+  myobj->count = 2 * myobj->count + change;
+
+  g_object_notify (G_OBJECT (myobj), "count");
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusNodeInfo *introspection_data = NULL;
+
+/* Introspection data for the service we are exporting */
+static const gchar introspection_xml[] =
+  "<node>"
+  "  <interface name='org.myorg.MyObject'>"
+  "    <method name='ChangeCount'>"
+  "      <arg type='i' name='change' direction='in'/>"
+  "    </method>"
+  "    <property type='i' name='Count' access='read'/>"
+  "    <property type='s' name='Name' access='readwrite'/>"
+  "  </interface>"
+  "</node>";
+
+
+static void
+handle_method_call (GDBusConnection       *connection,
+                    const gchar           *sender,
+                    const gchar           *object_path,
+                    const gchar           *interface_name,
+                    const gchar           *method_name,
+                    GVariant              *parameters,
+                    GDBusMethodInvocation *invocation,
+                    gpointer               user_data)
+{
+  MyObject *myobj = user_data;
+
+  if (g_strcmp0 (method_name, "ChangeCount") == 0)
+    {
+      gint change;
+      g_variant_get (parameters, "(i)", &change);
+
+      my_object_change_count (myobj, change);
+
+      g_dbus_method_invocation_return_value (invocation, NULL);
+    }
+}
+
+static GVariant *
+handle_get_property (GDBusConnection  *connection,
+                     const gchar      *sender,
+                     const gchar      *object_path,
+                     const gchar      *interface_name,
+                     const gchar      *property_name,
+                     GError          **error,
+                     gpointer          user_data)
+{
+  GVariant *ret;
+  MyObject *myobj = user_data;
+
+  ret = NULL;
+  if (g_strcmp0 (property_name, "Count") == 0)
+    {
+      ret = g_variant_new_int32 (myobj->count);
+    }
+  else if (g_strcmp0 (property_name, "Name") == 0)
+    {
+      ret = g_variant_new_string (myobj->name ? myobj->name : "");
+    }
+
+  return ret;
+}
+
+static gboolean
+handle_set_property (GDBusConnection  *connection,
+                     const gchar      *sender,
+                     const gchar      *object_path,
+                     const gchar      *interface_name,
+                     const gchar      *property_name,
+                     GVariant         *value,
+                     GError          **error,
+                     gpointer          user_data)
+{
+  MyObject *myobj = user_data;
+
+  if (g_strcmp0 (property_name, "Count") == 0)
+    {
+      g_object_set (myobj, "count", g_variant_get_int32 (value), NULL);
+    }
+  else if (g_strcmp0 (property_name, "Name") == 0)
+    {
+      g_object_set (myobj, "name", g_variant_get_string (value, NULL), NULL);
+    }
+
+  return TRUE;
+}
+
+
+/* for now */
+static const GDBusInterfaceVTable interface_vtable =
+{
+  handle_method_call,
+  handle_get_property,
+  handle_set_property
+};
+
+static void
+send_property_change (GObject         *obj,
+                      GParamSpec      *pspec,
+                      GDBusConnection *connection)
+{
+  GVariantBuilder *builder;
+  GVariantBuilder *invalidated_builder;
+  MyObject *myobj = (MyObject *)obj;
+
+  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
+  invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+
+  if (g_strcmp0 (pspec->name, "count") == 0)
+    g_variant_builder_add (builder,
+                           "{sv}",
+                           "Count", g_variant_new_int32 (myobj->count));
+  else if (g_strcmp0 (pspec->name, "name") == 0)
+    g_variant_builder_add (builder,
+                           "{sv}",
+                           "Name", g_variant_new_string (myobj->name ? myobj->name : ""));
+
+  g_dbus_connection_emit_signal (connection,
+                                 NULL,
+                                 "/org/myorg/MyObject",
+                                 "org.freedesktop.DBus.Properties",
+                                 "PropertiesChanged",
+                                 g_variant_new ("(sa{sv}as)",
+                                                "org.myorg.MyObject",
+                                                builder,
+                                                invalidated_builder),
+                                 NULL);
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+  MyObject *myobj = user_data;
+  guint registration_id;
+
+  g_signal_connect (myobj, "notify",
+                    G_CALLBACK (send_property_change), connection);
+  registration_id = g_dbus_connection_register_object (connection,
+                                                       "/org/myorg/MyObject",
+                                                       introspection_data->interfaces[0],
+                                                       &interface_vtable,
+                                                       myobj,
+                                                       NULL,  /* user_data_free_func */
+                                                       NULL); /* GError** */
+  g_assert (registration_id > 0);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+  exit (1);
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint owner_id;
+  GMainLoop *loop;
+  MyObject *myobj;
+
+  g_type_init ();
+
+  /* We are lazy here - we don't want to manually provide
+   * the introspection data structures - so we just build
+   * them from XML.
+   */
+  introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+  g_assert (introspection_data != NULL);
+
+  myobj = g_object_new (my_object_get_type (), NULL);
+
+  owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+                             "org.myorg.MyObject",
+                             G_BUS_NAME_OWNER_FLAGS_NONE,
+                             on_bus_acquired,
+                             on_name_acquired,
+                             on_name_lost,
+                             myobj,
+                             NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unown_name (owner_id);
+
+  g_dbus_node_info_unref (introspection_data);
+
+  g_object_unref (myobj);
+
+  return 0;
+}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/conversion.html b/docs/reference/gio/html/conversion.html index 89618e1..61f227c 100644 --- a/docs/reference/gio/html/conversion.html +++ b/docs/reference/gio/html/conversion.html @@ -3,12 +3,12 @@ Data conversion - + - + @@ -39,6 +39,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/extending-gio.html b/docs/reference/gio/html/extending-gio.html index cb5a8f9..5da6eb3 100644 --- a/docs/reference/gio/html/extending-gio.html +++ b/docs/reference/gio/html/extending-gio.html @@ -3,12 +3,12 @@ Extending GIO - + - + @@ -25,7 +25,7 @@

A lot of the functionality that is accessible through GIO is implemented in loadable modules, and modules provide a convenient - way to extend GIO. In addition to the GIOModule API which supports + way to extend GIO. In addition to the GIOModule API which supports writing such modules, GIO has a mechanism to define extension points, and register implementations thereof, see GIOExtensionPoint.

@@ -56,13 +56,13 @@ the highest priority that is supported, as determined by the is_supported() vfunc in GVolumeMonitorClass. - GIO implements this extension point for local mounts, - gvfs contains a hal-based implementation. + GIO implements this extension point for local mounts, + gvfs contains a hal-based implementation.

G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME.  - Allows to override the file monitor implementation for - local files. Implementations of this extension point must - be derived from GLocalFileMonitor. GIO uses the implementation + Allows to override the file monitor implementation for + local files. Implementations of this extension point must + be derived from GLocalFileMonitor. GIO uses the implementation with the highest priority that is supported, as determined by the is_supported() vfunc in GLocalFileMonitorClass. @@ -70,8 +70,8 @@ its fam-based and inotify-based file monitoring implementations.

G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME.  - Allows to override the directory monitor implementation for - local files. Implementations of this extension point must be + Allows to override the directory monitor implementation for + local files. Implementations of this extension point must be derived from GLocalDirectoryMonitor. GIO uses the implementation with the highest priority that is supported, as determined by the is_supported() vfunc in GLocalDirectoryMonitorClass. @@ -81,16 +81,42 @@

G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME.  Unix-only. Allows to provide a way to associate default handlers - with URI schemes. Implementations of this extension point must - implement the GDesktopAppInfoLookup interface. GIO uses the + with URI schemes. Implementations of this extension point must + implement the GDesktopAppInfoLookup interface. GIO uses the implementation with the highest priority. - gvfs contains a GConf-based implementation that uses the - same GConf keys as gnome-vfs. + This extension point has been discontinued in GLib 2.28. It is + still available to keep API and ABI stability, but GIO is no + longer using it for default handlers. Instead, the mime handler + mechanism is used, together with x-scheme-handler pseudo-mimetypes.

+

G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.  + Allows to provide an alternative storage for GSettings. + Implementations of this extension point must derive from the + GSettingsBackend type. GIO contains a keyfile-based + implementation of this extension point, another one is provided + by dconf. +

+

G_PROXY_EXTENSION_POINT_NAME.  + Allows to provide implementations for network proxying. + Implementations of this extension point must provide the + GProxy interface, and must be named after the network + protocol they are proxying. + + glib-networking contains an implementation of this extension + point based on libproxy. +

+

G_TLS_BACKEND_EXTENSION_POINT_NAME.  + Allows to provide implementations for TLS support. + Implementations of this extension point must implement + the GTlsBackend interface. + + glib-networking contains an implementation of this extension + point. +

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/extending.html b/docs/reference/gio/html/extending.html index 91993cd..d2ddac0 100644 --- a/docs/reference/gio/html/extending.html +++ b/docs/reference/gio/html/extending.html @@ -3,17 +3,17 @@ Extending GIO - + - + - + - + @@ -36,6 +36,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/failable_initialization.html b/docs/reference/gio/html/failable_initialization.html index ff64899..df214f2 100644 --- a/docs/reference/gio/html/failable_initialization.html +++ b/docs/reference/gio/html/failable_initialization.html @@ -3,12 +3,12 @@ Failable Initialization - + - + @@ -33,6 +33,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/file_mon.html b/docs/reference/gio/html/file_mon.html index 6a31df8..1ceae82 100644 --- a/docs/reference/gio/html/file_mon.html +++ b/docs/reference/gio/html/file_mon.html @@ -3,12 +3,12 @@ File System Monitoring - + - + @@ -28,6 +28,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/file_ops.html b/docs/reference/gio/html/file_ops.html index b078511..e3afa07 100644 --- a/docs/reference/gio/html/file_ops.html +++ b/docs/reference/gio/html/file_ops.html @@ -3,12 +3,12 @@ File Operations - + - + @@ -45,6 +45,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gdbus-convenience.html b/docs/reference/gio/html/gdbus-convenience.html new file mode 100644 index 0000000..84cade7 --- /dev/null +++ b/docs/reference/gio/html/gdbus-convenience.html @@ -0,0 +1,41 @@ + + + + +Highlevel D-Bus Support + + + + + + + + + + + + + + + + +
+

+Highlevel D-Bus Support

+
+
+Owning Bus Names — Simple API for owning bus names +
+
+Watching Bus Names — Simple API for watching bus names +
+
+GDBusProxy — Client-side proxies +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gdbus-lowlevel.html b/docs/reference/gio/html/gdbus-lowlevel.html new file mode 100644 index 0000000..5a6356a --- /dev/null +++ b/docs/reference/gio/html/gdbus-lowlevel.html @@ -0,0 +1,59 @@ + + + + +Lowlevel D-Bus Support + + + + + + + + + + + + + + + + +
+

+Lowlevel D-Bus Support

+
+
+D-Bus Utilities — Various utilities related to D-Bus. +
+
+D-Bus Addresses — D-Bus connection endpoints +
+
+D-Bus Introspection Data — Node and interface description data structures +
+
+GDBusError — Mapping D-Bus errors to and from GError +
+
+GDBusMessage — D-Bus Message +
+
+GDBusConnection — D-Bus Connections +
+
+GDBusMethodInvocation — Object for handling remote calls +
+
+GDBusServer — Helper for accepting connections +
+
+GDBusAuthObserver — Object used for authenticating connections +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gdbus.html b/docs/reference/gio/html/gdbus.html new file mode 100644 index 0000000..eb65161 --- /dev/null +++ b/docs/reference/gio/html/gdbus.html @@ -0,0 +1,243 @@ + + + + +gdbus + + + + + + + + + + + + + + + + +
+
+
+ + +
+

gdbus

+

gdbus — Introspect and call remote objects

+
+
+

Synopsis

+

gdbus introspect [ --system | --session | --address address ] --dest bus_name --object-path /path/to/object --xml

+

gdbus monitor [ --system | --session | --address address ] --dest bus_name [ --object-path /path/to/object ]

+

gdbus call [ --system | --session | --address address ] --dest bus_name --object-path /path/to/object --method org.project.InterfaceName.MethodName ARG1 ARG2...

+

gdbus help

+
+
+

Description

+

+ gdbus offers a simple commandline utility for + introspecting and calling methods on remote objects. +

+
+

Commands

+
++ + + + + + + + + + + + + + + + + + +

introspect

+ Prints out interfaces and property values for a remote object. + For this to work, the owner of the object needs to implement the + org.freedesktop.DBus.Introspectable interface. +

monitor

+ Monitors one or all objects owned by the owner of + bus_name. +

call

+ Invokes a method on a remote object. Each argument to pass to the + method must be specified as a serialized + GVariant except that strings do + not need explicit quotes. The return values are printed out as + serialized GVariant + values. +

help

+ Prints help and exit. +

+
+
+
+

Bash Completion

+

+ gdbus ships with a bash completion script to + complete commands, destinations, bus names, object paths and + interface/method names. +

+
+
+

Examples

+ This shows how to introspect an object - note that the value of each + property is displayed: +
+$ gdbus introspect --system \
+        --dest org.freedesktop.NetworkManager \
+        --object-path /org/freedesktop/NetworkManager/Devices/0
+node /org/freedesktop/NetworkManager/Devices/0 {
+  interface org.freedesktop.DBus.Introspectable {
+    methods:
+      Introspect(out s data);
+  };
+  interface org.freedesktop.DBus.Properties {
+    methods:
+      Get(in  s interface,
+          in  s propname,
+          out v value);
+      Set(in  s interface,
+          in  s propname,
+          in  v value);
+      GetAll(in  s interface,
+             out a{sv} props);
+  };
+  interface org.freedesktop.NetworkManager.Device.Wired {
+    signals:
+      PropertiesChanged(a{sv} arg_0);
+    properties:
+      readonly b Carrier = false;
+      readonly u Speed = 0;
+      readonly s HwAddress = '00:1D:72:88:BE:97';
+  };
+  interface org.freedesktop.NetworkManager.Device {
+    methods:
+      Disconnect();
+    signals:
+      StateChanged(u arg_0,
+                   u arg_1,
+                   u arg_2);
+    properties:
+      readonly u DeviceType = 1;
+      readonly b Managed = true;
+      readwrite o Ip6Config = '/';
+      readwrite o Dhcp4Config = '/';
+      readwrite o Ip4Config = '/';
+      readonly u State = 2;
+      readwrite u Ip4Address = 0;
+      readonly u Capabilities = 3;
+      readonly s Driver = 'e1000e';
+      readwrite s Interface = 'eth0';
+      readonly s Udi = '/sys/devices/pci0000:00/0000:00:19.0/net/eth0';
+  };
+};
+
+

+ In a similar fashion, the introspect command can be + used to learn details about the Notify method: +

+
+[...]
+  interface org.freedesktop.Notifications {
+    methods:
+      GetServerInformation(out s return_name,
+                           out s return_vendor,
+                           out s return_version,
+                           out s return_spec_version);
+      GetCapabilities(out as return_caps);
+      CloseNotification(in  u id);
+      Notify(in  s app_name,
+             in  u id,
+             in  s icon,
+             in  s summary,
+             in  s body,
+             in  as actions,
+             in  a{sv} hints,
+             in  i timeout,
+             out u return_id);
+  };
+[...]
+
+

+ With this information, it's easy to use the call + command to display a notification +

+
+$ gdbus call --session \
+             --dest org.freedesktop.Notifications \
+             --object-path /org/freedesktop/Notifications \
+             --method org.freedesktop.Notifications.Notify \
+             my_app_name \
+             42 \
+             gtk-dialog-info \
+             "The Summary" \
+             "Here's the body of the notification" \
+             [] \
+             {} \
+             5000
+(uint32 12,)
+
+

+ Monitoring all objects on a service: +

+
+$ gdbus monitor --system --dest org.freedesktop.ConsoleKit
+Monitoring signals from all objects owned by org.freedesktop.ConsoleKit
+The name org.freedesktop.ConsoleKit is owned by :1.15
+/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (false,)
+/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('',)
+/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (true,)
+/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('/org/freedesktop/ConsoleKit/Session2',)
+
+

+ Monitoring a single object on a service: +

+
+$ gdbus monitor --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager/AccessPoint/4141
+Monitoring signals on object /org/freedesktop/NetworkManager/AccessPoint/4141 owned by org.freedesktop.NetworkManager
+The name org.freedesktop.NetworkManager is owned by :1.5
+/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5c>},)
+/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},)
+/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5e>},)
+/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},)
+
+
+
+

AUTHOR

+

+ Written by David Zeuthen with + a lot of help from many others. +

+
+
+

BUGS

+

+ Please send bug reports to either the distribution bug tracker + or the upstream bug tracker at + https://bugzilla.gnome.org/enter_bug.cgi?product=glib. +

+
+
+

SEE ALSO

+

+ dbus-send(1) +

+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-D-Bus-Addresses.html b/docs/reference/gio/html/gio-D-Bus-Addresses.html new file mode 100644 index 0000000..44b9ddc --- /dev/null +++ b/docs/reference/gio/html/gio-D-Bus-Addresses.html @@ -0,0 +1,314 @@ + + + + +D-Bus Addresses + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

D-Bus Addresses

+

D-Bus Addresses — D-Bus connection endpoints

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+gboolean            g_dbus_is_address                   (const gchar *string);
+gboolean            g_dbus_is_supported_address         (const gchar *string,
+                                                         GError **error);
+void                g_dbus_address_get_stream           (const gchar *address,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+GIOStream *         g_dbus_address_get_stream_finish    (GAsyncResult *res,
+                                                         gchar **out_guid,
+                                                         GError **error);
+GIOStream *         g_dbus_address_get_stream_sync      (const gchar *address,
+                                                         gchar **out_guid,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+gchar *             g_dbus_address_get_for_bus_sync     (GBusType bus_type,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+
+
+
+

Description

+

+Routines for working with D-Bus addresses. A D-Bus address is a string +like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses +is explained in detail in the D-Bus specification. +

+
+
+

Details

+
+

g_dbus_is_address ()

+
gboolean            g_dbus_is_address                   (const gchar *string);
+

+Checks if string is a D-Bus address. +

+

+This doesn't check if string is actually supported by GDBusServer +or GDBusConnection - use g_dbus_is_supported_address() to do more +checks. +

+
++ + + + + + + + + + +

string :

A string. +

Returns :

TRUE if string is a valid D-Bus address, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_is_supported_address ()

+
gboolean            g_dbus_is_supported_address         (const gchar *string,
+                                                         GError **error);
+

+Like g_dbus_is_address() but also checks if the library suppors the +transports in string and that key/value pairs for each transport +are valid. +

+
++ + + + + + + + + + + + + + +

string :

A string. +

error :

Return location for error or NULL. +

Returns :

TRUE if string is a valid D-Bus address that is +supported by this library, FALSE if error is set. + +
+

Since 2.26

+
+
+
+

g_dbus_address_get_stream ()

+
void                g_dbus_address_get_stream           (const gchar *address,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+

+Asynchronously connects to an endpoint specified by address and +sets up the connection so it is in a state to run the client-side +of the D-Bus authentication conversation. +

+

+When the operation is finished, callback will be invoked. You can +then call g_dbus_address_get_stream_finish() to get the result of +the operation. +

+

+This is an asynchronous failable function. See +g_dbus_address_get_stream_sync() for the synchronous version. +

+
++ + + + + + + + + + + + + + + + + + +

address :

A valid D-Bus address. +

cancellable :

A GCancellable or NULL. +

callback :

A GAsyncReadyCallback to call when the request is satisfied. +

user_data :

Data to pass to callback. +
+

Since 2.26

+
+
+
+

g_dbus_address_get_stream_finish ()

+
GIOStream *         g_dbus_address_get_stream_finish    (GAsyncResult *res,
+                                                         gchar **out_guid,
+                                                         GError **error);
+

+Finishes an operation started with g_dbus_address_get_stream(). +

+
++ + + + + + + + + + + + + + + + + + +

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream(). +

out_guid :

+NULL or return location to store the GUID extracted from address, if any. +

error :

Return location for error or NULL. +

Returns :

A GIOStream or NULL if error is set. [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_address_get_stream_sync ()

+
GIOStream *         g_dbus_address_get_stream_sync      (const gchar *address,
+                                                         gchar **out_guid,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously connects to an endpoint specified by address and +sets up the connection so it is in a state to run the client-side +of the D-Bus authentication conversation. +

+

+This is a synchronous failable function. See +g_dbus_address_get_stream() for the asynchronous version. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

address :

A valid D-Bus address. +

out_guid :

+NULL or return location to store the GUID extracted from address, if any. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A GIOStream or NULL if error is set. [transfer full] +
+

Since 2.26

+
+
+
+

g_dbus_address_get_for_bus_sync ()

+
gchar *             g_dbus_address_get_for_bus_sync     (GBusType bus_type,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+

+Synchronously looks up the D-Bus address for the well-known message +bus instance specified by bus_type. This may involve using various +platform specific mechanisms. +

+
++ + + + + + + + + + + + + + + + + + +

bus_type :

A GBusType. +

cancellable :

A GCancellable or NULL. +

error :

Return location for error or NULL. +

Returns :

A valid D-Bus address string for bus_type or NULL if error is set. + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-D-Bus-Introspection-Data.html b/docs/reference/gio/html/gio-D-Bus-Introspection-Data.html new file mode 100644 index 0000000..e18afc2 --- /dev/null +++ b/docs/reference/gio/html/gio-D-Bus-Introspection-Data.html @@ -0,0 +1,1117 @@ + + + + +D-Bus Introspection Data + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

D-Bus Introspection Data

+

D-Bus Introspection Data — Node and interface description data structures

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+                    GDBusAnnotationInfo;
+                    GDBusArgInfo;
+                    GDBusMethodInfo;
+                    GDBusSignalInfo;
+enum                GDBusPropertyInfoFlags;
+                    GDBusPropertyInfo;
+                    GDBusInterfaceInfo;
+                    GDBusNodeInfo;
+const gchar *       g_dbus_annotation_info_lookup       (GDBusAnnotationInfo **annotations,
+                                                         const gchar *name);
+GDBusMethodInfo *   g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
+                                                         const gchar *name);
+GDBusSignalInfo *   g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
+                                                         const gchar *name);
+GDBusPropertyInfo * g_dbus_interface_info_lookup_property
+                                                        (GDBusInterfaceInfo *info,
+                                                         const gchar *name);
+void                g_dbus_interface_info_generate_xml  (GDBusInterfaceInfo *info,
+                                                         guint indent,
+                                                         GString *string_builder);
+GDBusNodeInfo *     g_dbus_node_info_new_for_xml        (const gchar *xml_data,
+                                                         GError **error);
+GDBusInterfaceInfo * g_dbus_node_info_lookup_interface  (GDBusNodeInfo *info,
+                                                         const gchar *name);
+void                g_dbus_node_info_generate_xml       (GDBusNodeInfo *info,
+                                                         guint indent,
+                                                         GString *string_builder);
+#define             G_TYPE_DBUS_NODE_INFO
+#define             G_TYPE_DBUS_INTERFACE_INFO
+#define             G_TYPE_DBUS_METHOD_INFO
+#define             G_TYPE_DBUS_SIGNAL_INFO
+#define             G_TYPE_DBUS_PROPERTY_INFO
+#define             G_TYPE_DBUS_ARG_INFO
+#define             G_TYPE_DBUS_ANNOTATION_INFO
+GDBusNodeInfo *     g_dbus_node_info_ref                (GDBusNodeInfo *info);
+GDBusInterfaceInfo * g_dbus_interface_info_ref          (GDBusInterfaceInfo *info);
+GDBusMethodInfo *   g_dbus_method_info_ref              (GDBusMethodInfo *info);
+GDBusSignalInfo *   g_dbus_signal_info_ref              (GDBusSignalInfo *info);
+GDBusPropertyInfo * g_dbus_property_info_ref            (GDBusPropertyInfo *info);
+GDBusArgInfo *      g_dbus_arg_info_ref                 (GDBusArgInfo *info);
+GDBusAnnotationInfo * g_dbus_annotation_info_ref        (GDBusAnnotationInfo *info);
+void                g_dbus_node_info_unref              (GDBusNodeInfo *info);
+void                g_dbus_interface_info_unref         (GDBusInterfaceInfo *info);
+void                g_dbus_method_info_unref            (GDBusMethodInfo *info);
+void                g_dbus_signal_info_unref            (GDBusSignalInfo *info);
+void                g_dbus_property_info_unref          (GDBusPropertyInfo *info);
+void                g_dbus_arg_info_unref               (GDBusArgInfo *info);
+void                g_dbus_annotation_info_unref        (GDBusAnnotationInfo *info);
+
+
+
+

Description

+

+Various data structures and convenience routines to parse and +generate D-Bus introspection XML. Introspection information is +used when registering objects with g_dbus_connection_register_object(). +

+

+The format of D-Bus introspection XML is specified in the +D-Bus specification. +

+
+
+

Details

+
+

GDBusAnnotationInfo

+
typedef struct {
+  volatile gint         ref_count;
+  gchar                *key;
+  gchar                *value;
+  GDBusAnnotationInfo **annotations;
+} GDBusAnnotationInfo;
+
+

+Information about an annotation. +

+
++ + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *key;

The name of the annotation, e.g. "org.freedesktop.DBus.Deprecated". +

gchar *value;

The value of the annotation. +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

GDBusArgInfo

+
typedef struct {
+  volatile gint         ref_count;
+  gchar                *name;
+  gchar                *signature;
+  GDBusAnnotationInfo **annotations;
+} GDBusArgInfo;
+
+

+Information about an argument for a method or a signal. +

+
++ + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *name;

Name of the argument, e.g. unix_user_id. +

gchar *signature;

D-Bus signature of the argument (a single complete type). +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

GDBusMethodInfo

+
typedef struct {
+  volatile gint         ref_count;
+  gchar                *name;
+  GDBusArgInfo        **in_args;
+  GDBusArgInfo        **out_args;
+  GDBusAnnotationInfo **annotations;
+} GDBusMethodInfo;
+
+

+Information about a method on an D-Bus interface. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *name;

The name of the D-Bus method, e.g. RequestName. +

GDBusArgInfo **in_args;

A pointer to a NULL-terminated array of pointers to GDBusArgInfo structures or NULL if there are no in arguments. +

GDBusArgInfo **out_args;

A pointer to a NULL-terminated array of pointers to GDBusArgInfo structures or NULL if there are no out arguments. +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

GDBusSignalInfo

+
typedef struct {
+  volatile gint         ref_count;
+  gchar                *name;
+  GDBusArgInfo        **args;
+  GDBusAnnotationInfo **annotations;
+} GDBusSignalInfo;
+
+

+Information about a signal on a D-Bus interface. +

+
++ + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *name;

The name of the D-Bus signal, e.g. "NameOwnerChanged". +

GDBusArgInfo **args;

A pointer to a NULL-terminated array of pointers to GDBusArgInfo structures or NULL if there are no arguments. +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

enum GDBusPropertyInfoFlags

+
typedef enum
+{
+  G_DBUS_PROPERTY_INFO_FLAGS_NONE = 0,
+  G_DBUS_PROPERTY_INFO_FLAGS_READABLE = (1<<0),
+  G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE = (1<<1)
+} GDBusPropertyInfoFlags;
+
+

+Flags describing the access control of a D-Bus property. +

+
++ + + + + + + + + + + + + + +

G_DBUS_PROPERTY_INFO_FLAGS_NONE

No flags set. +

G_DBUS_PROPERTY_INFO_FLAGS_READABLE

Property is readable. +

G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE

Property is writable. +
+

Since 2.26

+
+
+
+

GDBusPropertyInfo

+
typedef struct {
+  volatile gint             ref_count;
+  gchar                    *name;
+  gchar                    *signature;
+  GDBusPropertyInfoFlags    flags;
+  GDBusAnnotationInfo     **annotations;
+} GDBusPropertyInfo;
+
+

+Information about a D-Bus property on a D-Bus interface. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *name;

The name of the D-Bus property, e.g. "SupportedFilesystems". +

gchar *signature;

The D-Bus signature of the property (a single complete type). +

GDBusPropertyInfoFlags flags;

Access control flags for the property. +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

GDBusInterfaceInfo

+
typedef struct {
+  volatile gint         ref_count;
+  gchar                *name;
+  GDBusMethodInfo     **methods;
+  GDBusSignalInfo     **signals;
+  GDBusPropertyInfo   **properties;
+  GDBusAnnotationInfo **annotations;
+} GDBusInterfaceInfo;
+
+

+Information about a D-Bus interface. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *name;

The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties". +

GDBusMethodInfo **methods;

A pointer to a NULL-terminated array of pointers to GDBusMethodInfo structures or NULL if there are no methods. +

GDBusSignalInfo **signals;

A pointer to a NULL-terminated array of pointers to GDBusSignalInfo structures or NULL if there are no signals. +

GDBusPropertyInfo **properties;

A pointer to a NULL-terminated array of pointers to GDBusPropertyInfo structures or NULL if there are no properties. +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

GDBusNodeInfo

+
typedef struct {
+  volatile gint         ref_count;
+  gchar                *path;
+  GDBusInterfaceInfo  **interfaces;
+  GDBusNodeInfo       **nodes;
+  GDBusAnnotationInfo **annotations;
+} GDBusNodeInfo;
+
+

+Information about nodes in a remote object hierarchy. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

volatile gint ref_count;

The reference count or -1 if statically allocated. +

gchar *path;

The path of the node or NULL if omitted. Note that this may be a relative path. See the D-Bus specification for more details. +

GDBusInterfaceInfo **interfaces;

A pointer to a NULL-terminated array of pointers to GDBusInterfaceInfo structures or NULL if there are no interfaces. +

GDBusNodeInfo **nodes;

A pointer to a NULL-terminated array of pointers to GDBusNodeInfo structures or NULL if there are no nodes. +

GDBusAnnotationInfo **annotations;

A pointer to a NULL-terminated array of pointers to GDBusAnnotationInfo structures or NULL if there are no annotations. +
+

Since 2.26

+
+
+
+

g_dbus_annotation_info_lookup ()

+
const gchar *       g_dbus_annotation_info_lookup       (GDBusAnnotationInfo **annotations,
+                                                         const gchar *name);
+

+Looks up the value of an annotation. +

+

+This cost of this function is O(n) in number of annotations. +

+
++ + + + + + + + + + + + + + +

annotations :

A NULL-terminated array of annotations or NULL. +

name :

The name of the annotation to look up. +

Returns :

The value or NULL if not found. Do not free, it is owned by annotations. + +
+

Since 2.26

+
+
+
+

g_dbus_interface_info_lookup_method ()

+
GDBusMethodInfo *   g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
+                                                         const gchar *name);
+

+Looks up information about a method. +

+

+This cost of this function is O(n) in number of methods. +

+
++ + + + + + + + + + + + + + +

info :

A GDBusInterfaceInfo. +

name :

A D-Bus method name (typically in CamelCase) +

Returns :

A GDBusMethodInfo or NULL if not found. Do not free, it is owned by info. + +
+

Since 2.26

+
+
+
+

g_dbus_interface_info_lookup_signal ()

+
GDBusSignalInfo *   g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
+                                                         const gchar *name);
+

+Looks up information about a signal. +

+

+This cost of this function is O(n) in number of signals. +

+
++ + + + + + + + + + + + + + +

info :

A GDBusInterfaceInfo. +

name :

A D-Bus signal name (typically in CamelCase) +

Returns :

A GDBusSignalInfo or NULL if not found. Do not free, it is owned by info. + +
+

Since 2.26

+
+
+
+

g_dbus_interface_info_lookup_property ()

+
GDBusPropertyInfo * g_dbus_interface_info_lookup_property
+                                                        (GDBusInterfaceInfo *info,
+                                                         const gchar *name);
+

+Looks up information about a property. +

+

+This cost of this function is O(n) in number of properties. +

+
++ + + + + + + + + + + + + + +

info :

A GDBusInterfaceInfo. +

name :

A D-Bus property name (typically in CamelCase). +

Returns :

A GDBusPropertyInfo or NULL if not found. Do not free, it is owned by info. + +
+

Since 2.26

+
+
+
+

g_dbus_interface_info_generate_xml ()

+
void                g_dbus_interface_info_generate_xml  (GDBusInterfaceInfo *info,
+                                                         guint indent,
+                                                         GString *string_builder);
+

+Appends an XML representation of info (and its children) to string_builder. +

+

+This function is typically used for generating introspection XML +documents at run-time for handling the +org.freedesktop.DBus.Introspectable.Introspect +method. +

+
++ + + + + + + + + + + + + + +

info :

A GDBusNodeInfo +

indent :

Indentation level. +

string_builder :

A GString to to append XML data to. +
+

Since 2.26

+
+
+
+

g_dbus_node_info_new_for_xml ()

+
GDBusNodeInfo *     g_dbus_node_info_new_for_xml        (const gchar *xml_data,
+                                                         GError **error);
+

+Parses xml_data and returns a GDBusNodeInfo representing the data. +

+
++ + + + + + + + + + + + + + +

xml_data :

Valid D-Bus introspection XML. +

error :

Return location for error. +

Returns :

A GDBusNodeInfo structure or NULL if error is set. Free +with g_dbus_node_info_unref(). + +
+

Since 2.26

+
+
+
+

g_dbus_node_info_lookup_interface ()

+
GDBusInterfaceInfo * g_dbus_node_info_lookup_interface  (GDBusNodeInfo *info,
+                                                         const gchar *name);
+

+Looks up information about an interface. +

+

+This cost of this function is O(n) in number of interfaces. +

+
++ + + + + + + + + + + + + + +

info :

A GDBusNodeInfo. +

name :

A D-Bus interface name. +

Returns :

A GDBusInterfaceInfo or NULL if not found. Do not free, it is owned by info. + +
+

Since 2.26

+
+
+
+

g_dbus_node_info_generate_xml ()

+
void                g_dbus_node_info_generate_xml       (GDBusNodeInfo *info,
+                                                         guint indent,
+                                                         GString *string_builder);
+

+Appends an XML representation of info (and its children) to string_builder. +

+

+This function is typically used for generating introspection XML documents at run-time for +handling the org.freedesktop.DBus.Introspectable.Introspect method. +

+
++ + + + + + + + + + + + + + +

info :

A GDBusNodeInfo. +

indent :

Indentation level. +

string_builder :

A GString to to append XML data to. +
+

Since 2.26

+
+
+
+

G_TYPE_DBUS_NODE_INFO

+
#define G_TYPE_DBUS_NODE_INFO       (g_dbus_node_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusNodeInfo. +

+

Since 2.26

+
+
+
+

G_TYPE_DBUS_INTERFACE_INFO

+
#define G_TYPE_DBUS_INTERFACE_INFO  (g_dbus_interface_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusInterfaceInfo. +

+

Since 2.26

+
+
+
+

G_TYPE_DBUS_METHOD_INFO

+
#define G_TYPE_DBUS_METHOD_INFO     (g_dbus_method_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusMethodInfo. +

+

Since 2.26

+
+
+
+

G_TYPE_DBUS_SIGNAL_INFO

+
#define G_TYPE_DBUS_SIGNAL_INFO     (g_dbus_signal_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusSignalInfo. +

+

Since 2.26

+
+
+
+

G_TYPE_DBUS_PROPERTY_INFO

+
#define G_TYPE_DBUS_PROPERTY_INFO   (g_dbus_property_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusPropertyInfo. +

+

Since 2.26

+
+
+
+

G_TYPE_DBUS_ARG_INFO

+
#define G_TYPE_DBUS_ARG_INFO        (g_dbus_arg_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusArgInfo. +

+

Since 2.26

+
+
+
+

G_TYPE_DBUS_ANNOTATION_INFO

+
#define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
+
+

+The GType for a boxed type holding a GDBusAnnotationInfo. +

+

Since 2.26

+
+
+
+

g_dbus_node_info_ref ()

+
GDBusNodeInfo *     g_dbus_node_info_ref                (GDBusNodeInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusNodeInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_interface_info_ref ()

+
GDBusInterfaceInfo * g_dbus_interface_info_ref          (GDBusInterfaceInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusInterfaceInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_method_info_ref ()

+
GDBusMethodInfo *   g_dbus_method_info_ref              (GDBusMethodInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusMethodInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_signal_info_ref ()

+
GDBusSignalInfo *   g_dbus_signal_info_ref              (GDBusSignalInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusSignalInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_property_info_ref ()

+
GDBusPropertyInfo * g_dbus_property_info_ref            (GDBusPropertyInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusPropertyInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_arg_info_ref ()

+
GDBusArgInfo *      g_dbus_arg_info_ref                 (GDBusArgInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusArgInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_annotation_info_ref ()

+
GDBusAnnotationInfo * g_dbus_annotation_info_ref        (GDBusAnnotationInfo *info);
+

+If info is statically allocated does nothing. Otherwise increases +the reference count. +

+
++ + + + + + + + + + +

info :

A GDBusNodeInfo +

Returns :

The same info. + +
+

Since 2.26

+
+
+
+

g_dbus_node_info_unref ()

+
void                g_dbus_node_info_unref              (GDBusNodeInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusNodeInfo. +
+

Since 2.26

+
+
+
+

g_dbus_interface_info_unref ()

+
void                g_dbus_interface_info_unref         (GDBusInterfaceInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusInterfaceInfo. +
+

Since 2.26

+
+
+
+

g_dbus_method_info_unref ()

+
void                g_dbus_method_info_unref            (GDBusMethodInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusMethodInfo. +
+

Since 2.26

+
+
+
+

g_dbus_signal_info_unref ()

+
void                g_dbus_signal_info_unref            (GDBusSignalInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusSignalInfo. +
+

Since 2.26

+
+
+
+

g_dbus_property_info_unref ()

+
void                g_dbus_property_info_unref          (GDBusPropertyInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusPropertyInfo. +
+

Since 2.26

+
+
+
+

g_dbus_arg_info_unref ()

+
void                g_dbus_arg_info_unref               (GDBusArgInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusArgInfo. +
+

Since 2.26

+
+
+
+

g_dbus_annotation_info_unref ()

+
void                g_dbus_annotation_info_unref        (GDBusAnnotationInfo *info);
+

+If info is statically allocated, does nothing. Otherwise decreases +the reference count of info. When its reference count drops to 0, +the memory used is freed. +

+
++ + + + +

info :

A GDBusAnnotationInfo. +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-D-Bus-Utilities.html b/docs/reference/gio/html/gio-D-Bus-Utilities.html new file mode 100644 index 0000000..fe8cc7f --- /dev/null +++ b/docs/reference/gio/html/gio-D-Bus-Utilities.html @@ -0,0 +1,216 @@ + + + + +D-Bus Utilities + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

D-Bus Utilities

+

D-Bus Utilities — Various utilities related to D-Bus.

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+gchar *             g_dbus_generate_guid                (void);
+gboolean            g_dbus_is_guid                      (const gchar *string);
+gboolean            g_dbus_is_name                      (const gchar *string);
+gboolean            g_dbus_is_unique_name               (const gchar *string);
+gboolean            g_dbus_is_member_name               (const gchar *string);
+gboolean            g_dbus_is_interface_name            (const gchar *string);
+
+
+
+

Description

+

+Various utility routines related to D-Bus. +

+
+
+

Details

+
+

g_dbus_generate_guid ()

+
gchar *             g_dbus_generate_guid                (void);
+

+Generate a D-Bus GUID that can be used with +e.g. g_dbus_connection_new(). +

+

+See the D-Bus specification regarding what strings are valid D-Bus +GUID (for example, D-Bus GUIDs are not RFC-4122 compliant). +

+
++ + + + +

Returns :

A valid D-Bus GUID. Free with g_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_is_guid ()

+
gboolean            g_dbus_is_guid                      (const gchar *string);
+

+Checks if string is a D-Bus GUID. +

+

+See the D-Bus specification regarding what strings are valid D-Bus +GUID (for example, D-Bus GUIDs are not RFC-4122 compliant). +

+
++ + + + + + + + + + +

string :

The string to check. +

Returns :

TRUE if string is a guid, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_is_name ()

+
gboolean            g_dbus_is_name                      (const gchar *string);
+

+Checks if string is a valid D-Bus bus name (either unique or well-known). +

+
++ + + + + + + + + + +

string :

The string to check. +

Returns :

TRUE if valid, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_is_unique_name ()

+
gboolean            g_dbus_is_unique_name               (const gchar *string);
+

+Checks if string is a valid D-Bus unique bus name. +

+
++ + + + + + + + + + +

string :

The string to check. +

Returns :

TRUE if valid, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_is_member_name ()

+
gboolean            g_dbus_is_member_name               (const gchar *string);
+

+Checks if string is a valid D-Bus member (e.g. signal or method) name. +

+
++ + + + + + + + + + +

string :

The string to check. +

Returns :

TRUE if valid, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_is_interface_name ()

+
gboolean            g_dbus_is_interface_name            (const gchar *string);
+

+Checks if string is a valid D-Bus interface name. +

+
++ + + + + + + + + + +

string :

The string to check. +

Returns :

TRUE if valid, FALSE otherwise. + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-Desktop-file-based-GAppInfo.html b/docs/reference/gio/html/gio-Desktop-file-based-GAppInfo.html index e93ea09..6f210b6 100644 --- a/docs/reference/gio/html/gio-Desktop-file-based-GAppInfo.html +++ b/docs/reference/gio/html/gio-Desktop-file-based-GAppInfo.html @@ -2,13 +2,13 @@ -Desktop file based GAppInfo - +GDesktopAppInfo + - + @@ -28,55 +28,38 @@ Object Hierarchy  |  Implemented Interfaces -  |  - Prerequisites -
+
-

Desktop file based GAppInfo

-

Desktop file based GAppInfo — Application information from desktop files

+

GDesktopAppInfo

+

GDesktopAppInfo — Application information from desktop files

Object Hierarchy

-  GObject
+  GObject
    +----GDesktopAppInfo
 
-
-  GInterface
-   +----GDesktopAppInfoLookup
-
-
-
-

Prerequisites

-

-GDesktopAppInfoLookup requires - GObject.

Implemented Interfaces

@@ -91,8 +74,8 @@ GDesktopAppInfo implements desktop files.

-Note that <gio/gdesktopappinfo.h> belongs to -the UNIX-specific GIO interfaces, thus you have to use the +Note that <gio/gdesktopappinfo.h> belongs to +the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

@@ -123,7 +106,7 @@ Creates a new Returns :

- a new
GDesktopAppInfo or NULL on error. + a new GDesktopAppInfo or NULL on error. @@ -132,7 +115,7 @@ Creates a new

g_desktop_app_info_new_from_keyfile ()

-
GDesktopAppInfo *   g_desktop_app_info_new_from_keyfile (GKeyFile *key_file);
+
GDesktopAppInfo *   g_desktop_app_info_new_from_keyfile (GKeyFile *key_file);

Creates a new GDesktopAppInfo.

@@ -141,12 +124,12 @@ Creates a new key_file :

-an opened
GKeyFile +an opened GKeyFile

Returns :

- a new GDesktopAppInfo or NULL on error. + a new GDesktopAppInfo or NULL on error. @@ -182,7 +165,7 @@ described in the Returns :

- a new
GDesktopAppInfo, or NULL if no desktop file with that id + a new GDesktopAppInfo, or NULL if no desktop file with that id @@ -195,7 +178,7 @@ described in the info
was created from a known filename, return it. In some situations such as the GDesktopAppInfo returned from -g_desktop_app_info_new_from_keyfile(), this function will return NULL. +g_desktop_app_info_new_from_keyfile(), this function will return NULL.

@@ -207,7 +190,7 @@ situations such as the Returns :

-
@@ -217,7 +200,7 @@ situations such as the

g_desktop_app_info_get_is_hidden ()

-
gboolean            g_desktop_app_info_get_is_hidden    (GDesktopAppInfo *info);
+
gboolean            g_desktop_app_info_get_is_hidden    (GDesktopAppInfo *info);

A desktop file is hidden if the Hidden key in it is set to True. @@ -232,7 +215,7 @@ set to True.

- @@ -273,67 +256,10 @@ Should be called only once; subsequent calls are ignored.
The full path to the file for info, or NULL if not known. + The full path to the file for info, or NULL if not known.

Returns :

TRUE if hidden, FALSE otherwise. + TRUE if hidden, FALSE otherwise.
-
-
-

GDesktopAppInfoLookup

-
typedef struct _GDesktopAppInfoLookup GDesktopAppInfoLookup;
-

-Interface that is used by backends to associate default -handlers with URI schemes. -

-
-
-
-

G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME

-
#define G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME "gio-desktop-app-info-lookup"
-
-

-Extension point for default handler to URI association. See -Extending GIO. -

-
-
-
-

g_desktop_app_info_lookup_get_default_for_uri_scheme ()

-
GAppInfo *          g_desktop_app_info_lookup_get_default_for_uri_scheme
-                                                        (GDesktopAppInfoLookup *lookup,
-                                                         const char *uri_scheme);
-

-Gets the default application for launching applications -using this URI scheme for a particular GDesktopAppInfoLookup -implementation. -

-

-The GDesktopAppInfoLookup interface and this function is used -to implement g_app_info_get_default_for_uri_scheme() backends -in a GIO module. There is no reason for applications to use it -directly. Applications should use g_app_info_get_default_for_uri_scheme(). -

-
-- - - - - - - - - - - - - - -

lookup :

a GDesktopAppInfoLookup -

uri_scheme :

a string containing a URI scheme. -

Returns :

GAppInfo for given uri_scheme or NULL on error. -
-
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gio-Extension-Points.html b/docs/reference/gio/html/gio-Extension-Points.html index e94266f..ece59b9 100644 --- a/docs/reference/gio/html/gio-Extension-Points.html +++ b/docs/reference/gio/html/gio-Extension-Points.html @@ -3,12 +3,12 @@ Extension Points - + - - + + @@ -18,7 +18,7 @@ Up Home GIO Reference Manual -Next +Next Top @@ -43,24 +43,24 @@ GIOExtension; GIOExtensionPoint; const char * g_io_extension_get_name (GIOExtension *extension); -gint g_io_extension_get_priority (GIOExtension *extension); -GType g_io_extension_get_type (GIOExtension *extension); +gint g_io_extension_get_priority (GIOExtension *extension); +GType g_io_extension_get_type (GIOExtension *extension); GIOExtension * g_io_extension_point_get_extension_by_name (GIOExtensionPoint *extension_point, const char *name); -GList * g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point); -GType g_io_extension_point_get_required_type +GList * g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point); +GType g_io_extension_point_get_required_type (GIOExtensionPoint *extension_point); GIOExtension * g_io_extension_point_implement (const char *extension_point_name, - GType type, + GType type, const char *extension_name, - gint priority); + gint priority); GIOExtensionPoint * g_io_extension_point_lookup (const char *name); GIOExtensionPoint * g_io_extension_point_register (const char *name); void g_io_extension_point_set_required_type (GIOExtensionPoint *extension_point, - GType type); -GTypeClass* g_io_extension_ref_class (GIOExtension *extension); + GType type); +GTypeClass* g_io_extension_ref_class (GIOExtension *extension);
@@ -78,7 +78,7 @@ extension point, and GType +A module can implement an extension point by specifying the GType that implements the functionality. Additionally, each implementation of an extension point has a name, and a priority. Use g_io_extension_point_implement() to implement an extension point. @@ -119,7 +119,7 @@ of an extension point has a name, and a priority. Use 5 6
/* Implement an extension point */
-G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
+G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
 g_io_extension_point_implement ("my-extension-point",
                                 my_example_impl_get_type (),
                                 "my-example",
@@ -138,6 +138,13 @@ of an extension point has a name, and a priority. Use
  only the one with the highest priority, or pick a specific
  one by name.
 

+

+ To avoid opening all modules just to find out what extension + points they implement, GIO makes use of a caching mechanism, + see gio-querymodules. + You are expected to run this command after installing a + GIO module. +

Details

@@ -184,7 +191,7 @@ for multiple extension points, under different names.

g_io_extension_get_priority ()

-
gint                g_io_extension_get_priority         (GIOExtension *extension);
+
gint                g_io_extension_get_priority         (GIOExtension *extension);

Gets the priority with which extension was registered.

@@ -207,7 +214,7 @@ Gets the priority with which extension w

g_io_extension_get_type ()

-
GType               g_io_extension_get_type             (GIOExtension *extension);
+
GType               g_io_extension_get_type             (GIOExtension *extension);

Gets the type associated with extension.

@@ -252,7 +259,7 @@ Finds a Returns :

the
GIOExtension for extension_point that has the - given name, or NULL if there is no extension with that name + given name, or NULL if there is no extension with that name. [transfer none] @@ -261,7 +268,7 @@ Finds a

g_io_extension_point_get_extensions ()

-
GList *             g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point);
+
GList *             g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point);

Gets a list of all extensions that implement this extension point. The list is sorted by priority, beginning with the highest priority. @@ -276,8 +283,9 @@ The list is sorted by priority, beginning with the highest priority.

Returns :

- a GList of GIOExtensions. The list is owned by - GIO and should not be modified + a GList of +GIOExtensions. The list is owned by GIO and should not be +modified. [element-type GIOExtension][transfer none GIOExtension] @@ -286,7 +294,7 @@ The list is sorted by priority, beginning with the highest priority.

g_io_extension_point_get_required_type ()

-
GType               g_io_extension_point_get_required_type
+
GType               g_io_extension_point_get_required_type
                                                         (GIOExtensionPoint *extension_point);

Gets the required type for extension_point. @@ -301,8 +309,8 @@ Gets the required type for extension_point

Returns :

- the GType that all implementations must have, - or G_TYPE_INVALID if the extension point has no required type + the GType that all implementations must have, + or G_TYPE_INVALID if the extension point has no required type @@ -312,9 +320,9 @@ Gets the required type for extension_point

g_io_extension_point_implement ()

GIOExtension *      g_io_extension_point_implement      (const char *extension_point_name,
-                                                         GType type,
+                                                         GType type,
                                                          const char *extension_name,
-                                                         gint priority);
+ gint priority);

Registers type as extension for the extension point with name extension_point_name. @@ -333,7 +341,7 @@ extension point, the existing type :

-the GType to register as extension +the GType to register as extension @@ -348,7 +356,7 @@ extension point, the existing Returns :

- a
GIOExtension object for GType + a GIOExtension object for GType @@ -371,7 +379,7 @@ Looks up an existing extension point.

Returns :

- the GIOExtensionPoint, or NULL if there is no + the GIOExtensionPoint, or NULL if there is no registered extension point with the given name @@ -407,7 +415,7 @@ Registers an extension point.

g_io_extension_point_set_required_type ()

void                g_io_extension_point_set_required_type
                                                         (GIOExtensionPoint *extension_point,
-                                                         GType type);
+ GType type);

Sets the required type for extension_point to type. All implementations must henceforth have this type. @@ -422,7 +430,7 @@ All implementations must henceforth have this type.

type :

-the GType to require +the GType to require @@ -431,7 +439,7 @@ All implementations must henceforth have this type.

g_io_extension_ref_class ()

-
GTypeClass*         g_io_extension_ref_class            (GIOExtension *extension);
+
GTypeClass*         g_io_extension_ref_class            (GIOExtension *extension);

Gets a reference to the class for the type that is associated with extension. @@ -446,7 +454,7 @@ associated with extension.

Returns :

- the GTypeClass for the type of extension + the GTypeClass for the type of extension. [transfer full] @@ -460,6 +468,6 @@ Extending GIO
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/gio-GContentType.html b/docs/reference/gio/html/gio-GContentType.html index 5f84a14..eb51785 100644 --- a/docs/reference/gio/html/gio-GContentType.html +++ b/docs/reference/gio/html/gio-GContentType.html @@ -3,12 +3,12 @@ GContentType - + - + @@ -40,22 +40,22 @@
 #include <gio/gio.h>
 
-gboolean            g_content_type_equals               (const char *type1,
-                                                         const char *type2);
-gboolean            g_content_type_is_a                 (const char *type,
-                                                         const char *supertype);
-gboolean            g_content_type_is_unknown           (const char *type);
-char *              g_content_type_get_description      (const char *type);
-char *              g_content_type_get_mime_type        (const char *type);
-GIcon *             g_content_type_get_icon             (const char *type);
-gboolean            g_content_type_can_be_executable    (const char *type);
-char *              g_content_type_from_mime_type       (const char *mime_type);
-char *              g_content_type_guess                (const char *filename,
-                                                         const guchar *data,
-                                                         gsize data_size,
-                                                         gboolean *result_uncertain);
-char **             g_content_type_guess_for_tree       (GFile *root);
-GList *             g_content_types_get_registered      (void);
+gboolean            g_content_type_equals               (const gchar *type1,
+                                                         const gchar *type2);
+gboolean            g_content_type_is_a                 (const gchar *type,
+                                                         const gchar *supertype);
+gboolean            g_content_type_is_unknown           (const gchar *type);
+gchar *             g_content_type_get_description      (const gchar *type);
+gchar *             g_content_type_get_mime_type        (const gchar *type);
+GIcon *             g_content_type_get_icon             (const gchar *type);
+gboolean            g_content_type_can_be_executable    (const gchar *type);
+gchar *             g_content_type_from_mime_type       (const gchar *mime_type);
+gchar *             g_content_type_guess                (const gchar *filename,
+                                                         const guchar *data,
+                                                         gsize data_size,
+                                                         gboolean *result_uncertain);
+gchar **            g_content_type_guess_for_tree       (GFile *root);
+GList *             g_content_types_get_registered      (void);
 
@@ -71,8 +71,8 @@ can be looked up in the registry at HKEY_CLASSES_ROOT.

Details

g_content_type_equals ()

-
gboolean            g_content_type_equals               (const char *type1,
-                                                         const char *type2);
+
gboolean            g_content_type_equals               (const gchar *type1,
+                                                         const gchar *type2);

Compares two content types for equality.

@@ -81,18 +81,18 @@ Compares two content types for equality.

type1 :

-a content type string. +a content type string

type2 :

-a content type string. +a content type string

Returns :

- TRUE if the two strings are identical or equivalent, -FALSE otherwise. + TRUE if the two strings are identical or equivalent, + FALSE otherwise. @@ -101,8 +101,8 @@ Compares two content types for equality.

g_content_type_is_a ()

-
gboolean            g_content_type_is_a                 (const char *type,
-                                                         const char *supertype);
+
gboolean            g_content_type_is_a                 (const gchar *type,
+                                                         const gchar *supertype);

Determines if type is a subset of supertype.

@@ -111,18 +111,18 @@ Determines if type is a subset of

type :

-a content type string. +a content type string

supertype :

-a string. +a content type string

Returns :

- TRUE if type is a kind of supertype, -FALSE otherwise. + TRUE if type is a kind of supertype, + FALSE otherwise. @@ -131,10 +131,10 @@ Determines if type is a subset of

g_content_type_is_unknown ()

-
gboolean            g_content_type_is_unknown           (const char *type);
+
gboolean            g_content_type_is_unknown           (const gchar *type);

Checks if the content type is the generic "unknown" type. -On unix this is the "application/octet-stream" mimetype, +On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*".

@@ -142,12 +142,12 @@ while on win32 it is "*". - - @@ -156,7 +156,7 @@ while on win32 it is "*".

g_content_type_get_description ()

-
char *              g_content_type_get_description      (const char *type);
+
gchar *             g_content_type_get_description      (const gchar *type);

Gets the human readable description of the content type.

@@ -165,12 +165,13 @@ Gets the human readable description of the content type.
- - @@ -179,21 +180,22 @@ Gets the human readable description of the content type.

g_content_type_get_mime_type ()

-
char *              g_content_type_get_mime_type        (const char *type);
+
gchar *             g_content_type_get_mime_type        (const gchar *type);

-Gets the mime-type for the content type. If one is registered +Gets the mime type for the content type, if one is registered.

type :

a content type string. +a content type string

Returns :

TRUE if the type is the unknown type. + TRUE if the type is the unknown type.

type :

a content type string. +a content type string

Returns :

a short description of the content type type. + a short description of the content type type. Free the + returned string with g_free()
- - @@ -202,7 +204,7 @@ Gets the mime-type for the content type. If one is registered

g_content_type_get_icon ()

-
GIcon *             g_content_type_get_icon             (const char *type);
+
GIcon *             g_content_type_get_icon             (const gchar *type);

Gets the icon for a content type.

@@ -211,12 +213,13 @@ Gets the icon for a content type.
- - @@ -225,7 +228,7 @@ Gets the icon for a content type.

g_content_type_can_be_executable ()

-
gboolean            g_content_type_can_be_executable    (const char *type);
+
gboolean            g_content_type_can_be_executable    (const gchar *type);

Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files). @@ -235,13 +238,13 @@ things like text files can be executables (i.e. scripts and batch files).

- - @@ -250,7 +253,7 @@ can be executable,

g_content_type_from_mime_type ()

-
char *              g_content_type_from_mime_type       (const char *mime_type);
+
gchar *             g_content_type_from_mime_type       (const gchar *mime_type);

Tries to find a content type based on the mime type name.

@@ -259,13 +262,13 @@ Tries to find a content type based on the mime type name. - - @@ -275,14 +278,14 @@ Tries to find a content type based on the mime type name.

g_content_type_guess ()

-
char *              g_content_type_guess                (const char *filename,
-                                                         const guchar *data,
-                                                         gsize data_size,
-                                                         gboolean *result_uncertain);
+
gchar *             g_content_type_guess                (const gchar *filename,
+                                                         const guchar *data,
+                                                         gsize data_size,
+                                                         gboolean *result_uncertain);

-Guesses the content type based on example data. If the function is -uncertain, result_uncertain will be set to TRUE. Either filename -or data may be NULL, in which case the guess will be based solely +Guesses the content type based on example data. If the function is +uncertain, result_uncertain will be set to TRUE. Either filename +or data may be NULL, in which case the guess will be based solely on the other argument.

type :

a content type string. +a content type string

Returns :

the registered mime-type for the given type, or NULL if unknown. + the registered mime type for the given type, + or NULL if unknown. [allow-none]

type :

a content type string. +a content type string

Returns :

GIcon corresponding to the content type. + GIcon corresponding to the content type. Free the returned + object with g_object_unref(). [transfer full]

type :

a content type string. +a content type string

Returns :

TRUE if the file type corresponds to a type that -can be executable, FALSE otherwise. + TRUE if the file type corresponds to a type that + can be executable, FALSE otherwise.

mime_type :

a mime type string. +a mime type string

Returns :

Newly allocated string with content type or NULL when does not know. - + Newly allocated string with content type + or NULL. Free with g_free(). [allow-none]
@@ -290,12 +293,12 @@ on the other argument. - - @@ -305,13 +308,14 @@ on the other argument. - - @@ -320,7 +324,7 @@ given data.

g_content_type_guess_for_tree ()

-
char **             g_content_type_guess_for_tree       (GFile *root);
+
gchar **            g_content_type_guess_for_tree       (GFile *root);

Tries to guess the type of the tree with root root, by looking at the files it contains. The result is an array @@ -328,12 +332,13 @@ of content types, with the best guess coming first.

The types returned all have the form x-content/foo, e.g. -x-content/audio-cdda (for audio CDs) or x-content/image-dcf +x-content/audio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the shared-mime-info specification for more on x-content types.

-This function is useful in the implementation of g_mount_guess_content_type(). +This function is useful in the implementation of +g_mount_guess_content_type().

filename :

a string, or NULL + a string, or NULL. [allow-none]

data :

a stream of data, or NULL + a stream of data, or NULL. [allow-none][array length=data_size]

result_uncertain :

a flag indicating the certainty of the result + return location for the certainty + of the result, or NULL. [allow-none][out]

Returns :

a string indicating a guessed content type for the -given data. + a string indicating a guessed content type for the + given data. Free with g_free()
@@ -345,9 +350,8 @@ This function is useful in the implementation of Returns :

-
@@ -357,17 +361,22 @@ This function is useful in the implementation of

g_content_types_get_registered ()

-
GList *             g_content_types_get_registered      (void);
+
GList *             g_content_types_get_registered      (void);

Gets a list of strings containing all the registered content types -known to the system. The list and its data should be freed using -g_list_foreach(list, g_free, NULL) and g_list_free(list) +known to the system. The list and its data should be freed using +

+
+g_list_foreach (list, g_free, NULL);
+g_list_free (list);
+
+

an NULL-terminated array of zero or more content types, or NULL. - Free with g_strfreev() - + an NULL-terminated array of zero or more content types, + or NULL. Free with g_strfreev(). [transfer full]
-

Returns :

GList of the registered content types. + GList of the registered content types. [element-type utf8][transfer full utf8]
@@ -376,6 +385,6 @@ known to the system. The list and its data should be freed using
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/gio-GConverterInputstream.html b/docs/reference/gio/html/gio-GConverterInputstream.html index 4a4ebe3..2e5befb 100644 --- a/docs/reference/gio/html/gio-GConverterInputstream.html +++ b/docs/reference/gio/html/gio-GConverterInputstream.html @@ -3,12 +3,12 @@ GConverterInputstream - + - + @@ -54,7 +54,7 @@

Object Hierarchy

-  GObject
+  GObject
    +----GInputStream
          +----GFilterInputStream
                +----GConverterInputStream
@@ -82,10 +82,6 @@ conversion of data of various types during reading.
 An implementation of GFilterInputStream that allows data
 conversion.
 

-
-- -

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/gio-GConverterOutputstream.html b/docs/reference/gio/html/gio-GConverterOutputstream.html index 4632fe2..a0e540a 100644 --- a/docs/reference/gio/html/gio-GConverterOutputstream.html +++ b/docs/reference/gio/html/gio-GConverterOutputstream.html @@ -3,12 +3,12 @@ GConverterOutputstream - + - - + + @@ -18,7 +18,7 @@ Up Home GIO Reference Manual -Next +Next Top @@ -54,7 +54,7 @@

Object Hierarchy

-  GObject
+  GObject
    +----GOutputStream
          +----GFilterOutputStream
                +----GConverterOutputStream
@@ -82,10 +82,6 @@ conversion of data of various types during reading.
 An implementation of GFilterOutputStream that allows data
 conversion.
 

-
-- -

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/gio-GDBusError.html b/docs/reference/gio/html/gio-GDBusError.html new file mode 100644 index 0000000..6501605 --- /dev/null +++ b/docs/reference/gio/html/gio-GDBusError.html @@ -0,0 +1,908 @@ + + + + +GDBusError + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GDBusError

+

GDBusError — Mapping D-Bus errors to and from GError

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+enum                GDBusError;
+#define             G_DBUS_ERROR
+gboolean            g_dbus_error_is_remote_error        (const GError *error);
+gchar *             g_dbus_error_get_remote_error       (const GError *error);
+gboolean            g_dbus_error_strip_remote_error     (GError *error);
+                    GDBusErrorEntry;
+void                g_dbus_error_register_error_domain  (const gchar *error_domain_quark_name,
+                                                         volatile gsize *quark_volatile,
+                                                         const GDBusErrorEntry *entries,
+                                                         guint num_entries);
+gboolean            g_dbus_error_register_error         (GQuark error_domain,
+                                                         gint error_code,
+                                                         const gchar *dbus_error_name);
+gboolean            g_dbus_error_unregister_error       (GQuark error_domain,
+                                                         gint error_code,
+                                                         const gchar *dbus_error_name);
+GError *            g_dbus_error_new_for_dbus_error     (const gchar *dbus_error_name,
+                                                         const gchar *dbus_error_message);
+void                g_dbus_error_set_dbus_error         (GError **error,
+                                                         const gchar *dbus_error_name,
+                                                         const gchar *dbus_error_message,
+                                                         const gchar *format,
+                                                         ...);
+void                g_dbus_error_set_dbus_error_valist  (GError **error,
+                                                         const gchar *dbus_error_name,
+                                                         const gchar *dbus_error_message,
+                                                         const gchar *format,
+                                                         va_list var_args);
+gchar *             g_dbus_error_encode_gerror          (const GError *error);
+
+
+
+

Description

+

+All facilities that return errors from remote methods (such as +g_dbus_connection_call_sync()) use GError to represent both D-Bus +errors (e.g. errors returned from the other peer) and locally +in-process generated errors. +

+

+To check if a returned GError is an error from a remote peer, use +g_dbus_error_is_remote_error(). To get the actual D-Bus error name, +use g_dbus_error_get_remote_error(). Before presenting an error, +always use g_dbus_error_strip_remote_error(). +

+

+In addition, facilities used to return errors to a remote peer also +use GError. See g_dbus_method_invocation_return_error() for +discussion about how the D-Bus error name is set. +

+

+Applications can associate a GError error domain with a set of D-Bus errors in order to +automatically map from D-Bus errors to GError and back. This +is typically done in the function returning the GQuark for the +error domain: +

+
+

Example 1. Error Registration

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
/* foo-bar-error.h: */
+
+#define FOO_BAR_ERROR (foo_bar_error_quark ())
+GQuark foo_bar_error_quark (void);
+
+typedef enum
+{
+  FOO_BAR_ERROR_FAILED,
+  FOO_BAR_ERROR_ANOTHER_ERROR,
+  FOO_BAR_ERROR_SOME_THIRD_ERROR,
+} FooBarError;
+
+/* foo-bar-error.c: */
+
+static const GDBusErrorEntry foo_bar_error_entries[] =
+{
+  {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
+  {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
+  {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
+};
+
+GQuark
+foo_bar_error_quark (void)
+{
+  static volatile gsize quark_volatile = 0;
+  g_dbus_error_register_error_domain ("foo-bar-error-quark",
+                                      &quark_volatile,
+                                      foo_bar_error_entries,
+                                      G_N_ELEMENTS (foo_bar_error_entries));
+  G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) - 1 == FOO_BAR_ERROR_SOME_THIRD_ERROR);
+  return (GQuark) quark_volatile;
+}
+
+ +
+


+With this setup, a D-Bus peer can transparently pass e.g. FOO_BAR_ERROR_ANOTHER_ERROR and +other peers will see the D-Bus error name org.project.Foo.Bar.Error.AnotherError. +If the other peer is using GDBus, the peer will see also FOO_BAR_ERROR_ANOTHER_ERROR instead +of G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover +org.project.Foo.Bar.Error.AnotherError using g_dbus_error_get_remote_error(). +

+

+Note that errors in the G_DBUS_ERROR error domain is intended only +for returning errors from a remote message bus process. Errors +generated locally in-process by e.g. GDBusConnection is from the +G_IO_ERROR domain. +

+
+
+

Details

+
+

enum GDBusError

+
typedef enum
+{
+  /* Well-known errors in the org.freedesktop.DBus.Error namespace */
+  G_DBUS_ERROR_FAILED,                           /* org.freedesktop.DBus.Error.Failed */
+  G_DBUS_ERROR_NO_MEMORY,                        /* org.freedesktop.DBus.Error.NoMemory */
+  G_DBUS_ERROR_SERVICE_UNKNOWN,                  /* org.freedesktop.DBus.Error.ServiceUnknown */
+  G_DBUS_ERROR_NAME_HAS_NO_OWNER,                /* org.freedesktop.DBus.Error.NameHasNoOwner */
+  G_DBUS_ERROR_NO_REPLY,                         /* org.freedesktop.DBus.Error.NoReply */
+  G_DBUS_ERROR_IO_ERROR,                         /* org.freedesktop.DBus.Error.IOError */
+  G_DBUS_ERROR_BAD_ADDRESS,                      /* org.freedesktop.DBus.Error.BadAddress */
+  G_DBUS_ERROR_NOT_SUPPORTED,                    /* org.freedesktop.DBus.Error.NotSupported */
+  G_DBUS_ERROR_LIMITS_EXCEEDED,                  /* org.freedesktop.DBus.Error.LimitsExceeded */
+  G_DBUS_ERROR_ACCESS_DENIED,                    /* org.freedesktop.DBus.Error.AccessDenied */
+  G_DBUS_ERROR_AUTH_FAILED,                      /* org.freedesktop.DBus.Error.AuthFailed */
+  G_DBUS_ERROR_NO_SERVER,                        /* org.freedesktop.DBus.Error.NoServer */
+  G_DBUS_ERROR_TIMEOUT,                          /* org.freedesktop.DBus.Error.Timeout */
+  G_DBUS_ERROR_NO_NETWORK,                       /* org.freedesktop.DBus.Error.NoNetwork */
+  G_DBUS_ERROR_ADDRESS_IN_USE,                   /* org.freedesktop.DBus.Error.AddressInUse */
+  G_DBUS_ERROR_DISCONNECTED,                     /* org.freedesktop.DBus.Error.Disconnected */
+  G_DBUS_ERROR_INVALID_ARGS,                     /* org.freedesktop.DBus.Error.InvalidArgs */
+  G_DBUS_ERROR_FILE_NOT_FOUND,                   /* org.freedesktop.DBus.Error.FileNotFound */
+  G_DBUS_ERROR_FILE_EXISTS,                      /* org.freedesktop.DBus.Error.FileExists */
+  G_DBUS_ERROR_UNKNOWN_METHOD,                   /* org.freedesktop.DBus.Error.UnknownMethod */
+  G_DBUS_ERROR_TIMED_OUT,                        /* org.freedesktop.DBus.Error.TimedOut */
+  G_DBUS_ERROR_MATCH_RULE_NOT_FOUND,             /* org.freedesktop.DBus.Error.MatchRuleNotFound */
+  G_DBUS_ERROR_MATCH_RULE_INVALID,               /* org.freedesktop.DBus.Error.MatchRuleInvalid */
+  G_DBUS_ERROR_SPAWN_EXEC_FAILED,                /* org.freedesktop.DBus.Error.Spawn.ExecFailed */
+  G_DBUS_ERROR_SPAWN_FORK_FAILED,                /* org.freedesktop.DBus.Error.Spawn.ForkFailed */
+  G_DBUS_ERROR_SPAWN_CHILD_EXITED,               /* org.freedesktop.DBus.Error.Spawn.ChildExited */
+  G_DBUS_ERROR_SPAWN_CHILD_SIGNALED,             /* org.freedesktop.DBus.Error.Spawn.ChildSignaled */
+  G_DBUS_ERROR_SPAWN_FAILED,                     /* org.freedesktop.DBus.Error.Spawn.Failed */
+  G_DBUS_ERROR_SPAWN_SETUP_FAILED,               /* org.freedesktop.DBus.Error.Spawn.FailedToSetup */
+  G_DBUS_ERROR_SPAWN_CONFIG_INVALID,             /* org.freedesktop.DBus.Error.Spawn.ConfigInvalid */
+  G_DBUS_ERROR_SPAWN_SERVICE_INVALID,            /* org.freedesktop.DBus.Error.Spawn.ServiceNotValid */
+  G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND,          /* org.freedesktop.DBus.Error.Spawn.ServiceNotFound */
+  G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,        /* org.freedesktop.DBus.Error.Spawn.PermissionsInvalid */
+  G_DBUS_ERROR_SPAWN_FILE_INVALID,               /* org.freedesktop.DBus.Error.Spawn.FileInvalid */
+  G_DBUS_ERROR_SPAWN_NO_MEMORY,                  /* org.freedesktop.DBus.Error.Spawn.NoMemory */
+  G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN,          /* org.freedesktop.DBus.Error.UnixProcessIdUnknown */
+  G_DBUS_ERROR_INVALID_SIGNATURE,                /* org.freedesktop.DBus.Error.InvalidSignature */
+  G_DBUS_ERROR_INVALID_FILE_CONTENT,             /* org.freedesktop.DBus.Error.InvalidFileContent */
+  G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, /* org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown */
+  G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN,           /* org.freedesktop.DBus.Error.AdtAuditDataUnknown */
+  G_DBUS_ERROR_OBJECT_PATH_IN_USE                /* org.freedesktop.DBus.Error.ObjectPathInUse */
+} GDBusError;
+
+

+Error codes for the G_DBUS_ERROR error domain. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

G_DBUS_ERROR_FAILED

A generic error; "something went wrong" - see the error message for +more. +

G_DBUS_ERROR_NO_MEMORY

There was not enough memory to complete an operation. +

G_DBUS_ERROR_SERVICE_UNKNOWN

The bus doesn't know how to launch a service to supply the bus name +you wanted. +

G_DBUS_ERROR_NAME_HAS_NO_OWNER

The bus name you referenced doesn't exist (i.e. no application owns +it). +

G_DBUS_ERROR_NO_REPLY

No reply to a message expecting one, usually means a timeout occurred. +

G_DBUS_ERROR_IO_ERROR

Something went wrong reading or writing to a socket, for example. +

G_DBUS_ERROR_BAD_ADDRESS

A D-Bus bus address was malformed. +

G_DBUS_ERROR_NOT_SUPPORTED

Requested operation isn't supported (like ENOSYS on UNIX). +

G_DBUS_ERROR_LIMITS_EXCEEDED

Some limited resource is exhausted. +

G_DBUS_ERROR_ACCESS_DENIED

Security restrictions don't allow doing what you're trying to do. +

G_DBUS_ERROR_AUTH_FAILED

Authentication didn't work. +

G_DBUS_ERROR_NO_SERVER

Unable to connect to server (probably caused by ECONNREFUSED on a +socket). +

G_DBUS_ERROR_TIMEOUT

Certain timeout errors, possibly ETIMEDOUT on a socket. Note that +G_DBUS_ERROR_NO_REPLY is used for message reply timeouts. Warning: +this is confusingly-named given that G_DBUS_ERROR_TIMED_OUT also +exists. We can't fix it for compatibility reasons so just be +careful. +

G_DBUS_ERROR_NO_NETWORK

No network access (probably ENETUNREACH on a socket). +

G_DBUS_ERROR_ADDRESS_IN_USE

Can't bind a socket since its address is in use (i.e. EADDRINUSE). +

G_DBUS_ERROR_DISCONNECTED

The connection is disconnected and you're trying to use it. +

G_DBUS_ERROR_INVALID_ARGS

Invalid arguments passed to a method call. +

G_DBUS_ERROR_FILE_NOT_FOUND

Missing file. +

G_DBUS_ERROR_FILE_EXISTS

Existing file and the operation you're using does not silently overwrite. +

G_DBUS_ERROR_UNKNOWN_METHOD

Method name you invoked isn't known by the object you invoked it on. +

G_DBUS_ERROR_TIMED_OUT

Certain timeout errors, e.g. while starting a service. Warning: this is +confusingly-named given that G_DBUS_ERROR_TIMEOUT also exists. We +can't fix it for compatibility reasons so just be careful. +

G_DBUS_ERROR_MATCH_RULE_NOT_FOUND

Tried to remove or modify a match rule that didn't exist. +

G_DBUS_ERROR_MATCH_RULE_INVALID

The match rule isn't syntactically valid. +

G_DBUS_ERROR_SPAWN_EXEC_FAILED

While starting a new process, the exec() call failed. +

G_DBUS_ERROR_SPAWN_FORK_FAILED

While starting a new process, the fork() call failed. +

G_DBUS_ERROR_SPAWN_CHILD_EXITED

While starting a new process, the child exited with a status code. +

G_DBUS_ERROR_SPAWN_CHILD_SIGNALED

While starting a new process, the child exited on a signal. +

G_DBUS_ERROR_SPAWN_FAILED

While starting a new process, something went wrong. +

G_DBUS_ERROR_SPAWN_SETUP_FAILED

We failed to setup the environment correctly. +

G_DBUS_ERROR_SPAWN_CONFIG_INVALID

We failed to setup the config parser correctly. +

G_DBUS_ERROR_SPAWN_SERVICE_INVALID

Bus name was not valid. +

G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND

Service file not found in system-services directory. +

G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID

Permissions are incorrect on the setuid helper. +

G_DBUS_ERROR_SPAWN_FILE_INVALID

Service file invalid (Name, User or Exec missing). +

G_DBUS_ERROR_SPAWN_NO_MEMORY

Tried to get a UNIX process ID and it wasn't available. +

G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN

Tried to get a UNIX process ID and it wasn't available. +

G_DBUS_ERROR_INVALID_SIGNATURE

A type signature is not valid. +

G_DBUS_ERROR_INVALID_FILE_CONTENT

A file contains invalid syntax or is otherwise broken. +

G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN

Asked for SELinux security context and it wasn't available. +

G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN

Asked for ADT audit data and it wasn't available. +

G_DBUS_ERROR_OBJECT_PATH_IN_USE

There's already an object with the requested object path. +
+

Since 2.26

+
+
+
+

G_DBUS_ERROR

+
#define G_DBUS_ERROR g_dbus_error_quark()
+
+

+Error domain for errors generated by a remote message bus. Errors +in this domain will be from the GDBusError enumeration. See +GError for more information on error domains. +

+

+Note that errors in this error domain is intended only for +returning errors from a remote message bus process. Errors +generated locally in-process by e.g. GDBusConnection is from the +G_IO_ERROR domain. +

+

Since 2.26

+
+
+
+

g_dbus_error_is_remote_error ()

+
gboolean            g_dbus_error_is_remote_error        (const GError *error);
+

+Checks if error represents an error received via D-Bus from a remote peer. If so, +use g_dbus_error_get_remote_error() to get the name of the error. +

+
++ + + + + + + + + + +

error :

A GError. +

Returns :

TRUE if error represents an error from a remote peer, +FALSE otherwise. + +
+

Since 2.26

+
+
+
+

g_dbus_error_get_remote_error ()

+
gchar *             g_dbus_error_get_remote_error       (const GError *error);
+

+Gets the D-Bus error name used for error, if any. +

+

+This function is guaranteed to return a D-Bus error name for all +GErrors returned from functions handling remote method +calls (e.g. g_dbus_connection_call_finish()) unless +g_dbus_error_strip_remote_error() has been used on error. +

+
++ + + + + + + + + + +

error :

A GError. +

Returns :

An allocated string or NULL if the D-Bus error name could not be found. Free with g_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_error_strip_remote_error ()

+
gboolean            g_dbus_error_strip_remote_error     (GError *error);
+

+Looks for extra information in the error message used to recover +the D-Bus error name and strips it if found. If stripped, the +message field in error will correspond exactly to what was +received on the wire. +

+

+This is typically used when presenting errors to the end user. +

+
++ + + + + + + + + + +

error :

A GError. +

Returns :

TRUE if information was stripped, FALSE otherwise. + +
+

Since 2.26

+
+
+
+

GDBusErrorEntry

+
typedef struct {
+  gint         error_code;
+  const gchar *dbus_error_name;
+} GDBusErrorEntry;
+
+

+Struct used in g_dbus_error_register_error_domain(). +

+
++ + + + + + + + + + +

gint error_code;

An error code. +

const gchar *dbus_error_name;

The D-Bus error name to associate with error_code. +
+

Since 2.26

+
+
+
+

g_dbus_error_register_error_domain ()

+
void                g_dbus_error_register_error_domain  (const gchar *error_domain_quark_name,
+                                                         volatile gsize *quark_volatile,
+                                                         const GDBusErrorEntry *entries,
+                                                         guint num_entries);
+

+Helper function for associating a GError error domain with D-Bus error names. +

+
++ + + + + + + + + + + + + + + + + + +

error_domain_quark_name :

The error domain name. +

quark_volatile :

A pointer where to store the GQuark. +

entries :

A pointer to num_entries GDBusErrorEntry struct items. +

num_entries :

Number of items to register. +
+

Since 2.26

+
+
+
+

g_dbus_error_register_error ()

+
gboolean            g_dbus_error_register_error         (GQuark error_domain,
+                                                         gint error_code,
+                                                         const gchar *dbus_error_name);
+

+Creates an association to map between dbus_error_name and +GErrors specified by error_domain and error_code. +

+

+This is typically done in the routine that returns the GQuark for +an error domain. +

+
++ + + + + + + + + + + + + + + + + + +

error_domain :

A GQuark for a error domain. +

error_code :

An error code. +

dbus_error_name :

A D-Bus error name. +

Returns :

TRUE if the association was created, FALSE if it already +exists. + +
+

Since 2.26

+
+
+
+

g_dbus_error_unregister_error ()

+
gboolean            g_dbus_error_unregister_error       (GQuark error_domain,
+                                                         gint error_code,
+                                                         const gchar *dbus_error_name);
+

+Destroys an association previously set up with g_dbus_error_register_error(). +

+
++ + + + + + + + + + + + + + + + + + +

error_domain :

A GQuark for a error domain. +

error_code :

An error code. +

dbus_error_name :

A D-Bus error name. +

Returns :

TRUE if the association was destroyed, FALSE if it wasn't found. + +
+

Since 2.26

+
+
+
+

g_dbus_error_new_for_dbus_error ()

+
GError *            g_dbus_error_new_for_dbus_error     (const gchar *dbus_error_name,
+                                                         const gchar *dbus_error_message);
+

+Creates a GError based on the contents of dbus_error_name and +dbus_error_message. +

+

+Errors registered with g_dbus_error_register_error() will be looked +up using dbus_error_name and if a match is found, the error domain +and code is used. Applications can use g_dbus_error_get_remote_error() +to recover dbus_error_name. +

+

+If a match against a registered error is not found and the D-Bus +error name is in a form as returned by g_dbus_error_encode_gerror() +the error domain and code encoded in the name is used to +create the GError. Also, dbus_error_name is added to the error message +such that it can be recovered with g_dbus_error_get_remote_error(). +

+

+Otherwise, a GError with the error code G_IO_ERROR_DBUS_ERROR +in the G_IO_ERROR error domain is returned. Also, dbus_error_name is +added to the error message such that it can be recovered with +g_dbus_error_get_remote_error(). +

+

+In all three cases, dbus_error_name can always be recovered from the +returned GError using the g_dbus_error_get_remote_error() function +(unless g_dbus_error_strip_remote_error() hasn't been used on the returned error). +

+

+This function is typically only used in object mappings to prepare +GError instances for applications. Regular applications should not use +it. +

+
++ + + + + + + + + + + + + + +

dbus_error_name :

D-Bus error name. +

dbus_error_message :

D-Bus error message. +

Returns :

An allocated GError. Free with g_error_free(). + +
+

Since 2.26

+
+
+
+

g_dbus_error_set_dbus_error ()

+
void                g_dbus_error_set_dbus_error         (GError **error,
+                                                         const gchar *dbus_error_name,
+                                                         const gchar *dbus_error_message,
+                                                         const gchar *format,
+                                                         ...);
+

+Does nothing if error is NULL. Otherwise sets *error to +a new GError created with g_dbus_error_new_for_dbus_error() +with dbus_error_message prepend with format (unless NULL). +

+
++ + + + + + + + + + + + + + + + + + + + + + +

error :

A pointer to a GError or NULL. +

dbus_error_name :

D-Bus error name. +

dbus_error_message :

D-Bus error message. +

format :

printf()-style format to prepend to dbus_error_message or NULL. +

... :

Arguments for format. +
+

Since 2.26

+
+
+
+

g_dbus_error_set_dbus_error_valist ()

+
void                g_dbus_error_set_dbus_error_valist  (GError **error,
+                                                         const gchar *dbus_error_name,
+                                                         const gchar *dbus_error_message,
+                                                         const gchar *format,
+                                                         va_list var_args);
+

+Like g_dbus_error_set_dbus_error() but intended for language bindings. +

+
++ + + + + + + + + + + + + + + + + + + + + + +

error :

A pointer to a GError or NULL. +

dbus_error_name :

D-Bus error name. +

dbus_error_message :

D-Bus error message. +

format :

printf()-style format to prepend to dbus_error_message or NULL. +

var_args :

Arguments for format. +
+

Since 2.26

+
+
+
+

g_dbus_error_encode_gerror ()

+
gchar *             g_dbus_error_encode_gerror          (const GError *error);
+

+Creates a D-Bus error name to use for error. If error matches +a registered error (cf. g_dbus_error_register_error()), the corresponding +D-Bus error name will be returned. +

+

+Otherwise the a name of the form +org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE +will be used. This allows other GDBus applications to map the error +on the wire back to a GError using g_dbus_error_new_for_dbus_error(). +

+

+This function is typically only used in object mappings to put a +GError on the wire. Regular applications should not use it. +

+
++ + + + + + + + + + +

error :

A GError. +

Returns :

A D-Bus error name (never NULL). Free with g_free(). + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-GFileAttribute.html b/docs/reference/gio/html/gio-GFileAttribute.html index 36b77f4..994fb71 100644 --- a/docs/reference/gio/html/gio-GFileAttribute.html +++ b/docs/reference/gio/html/gio-GFileAttribute.html @@ -3,12 +3,12 @@ GFileAttribute - + - + @@ -92,7 +92,7 @@ attribute key will be registered for the user id for a given file).

-

Table 1. GFileAttributes Default Namespaces

+

Table 1. GFileAttributes Default Namespaces

@@ -126,7 +126,7 @@ to check for loops and to uniquely identify files. @@ -219,7 +219,7 @@ For more information about writing GIO modules, see -

Table 2. GFileAttributes Built-in Keys and Value Types

+

Table 2. GFileAttributes Built-in Keys and Value Types

The "Access" namespace. Used to check if a user has the proper privilidges to access files and perform file operations. Keys in this namespace are made to be generic -and easily understood, e.g. the "can_read" key is TRUE if +and easily understood, e.g. the "can_read" key is TRUE if the current user has permission to read the file. UNIX permissions and NTFS ACLs in Windows should be mapped to these values.
@@ -628,12 +628,12 @@ The data types for file attributes. - - @@ -799,7 +799,7 @@ References a file attribute info list. - @@ -869,7 +869,7 @@ Gets the file attribute with the name name - @@ -922,6 +922,6 @@ its type and + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gio-GIOError.html b/docs/reference/gio/html/gio-GIOError.html index f9eb211..7a7d1c5 100644 --- a/docs/reference/gio/html/gio-GIOError.html +++ b/docs/reference/gio/html/gio-GIOError.html @@ -3,12 +3,12 @@ GIOError - + - + @@ -42,7 +42,8 @@ #define G_IO_ERROR enum GIOErrorEnum; -GIOErrorEnum g_io_error_from_errno (gint err_no); +GIOErrorEnum g_io_error_from_errno (gint err_no); +GIOErrorEnum g_io_error_from_win32_error (gint error_code);
@@ -59,7 +60,7 @@ Contains helper functions for reporting errors to the user.

Error domain for GIO. Errors in this domain will be from the GIOErrorEnum enumeration. -See GError for more information on error domains. +See GError for more information on error domains.


@@ -101,7 +102,15 @@ See

@@ -262,14 +271,14 @@ Error codes returned by GIO functions.

- - @@ -293,13 +302,58 @@ Error codes returned by GIO functions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

G_FILE_ATTRIBUTE_TYPE_OBJECT

a GObject. +a GObject.

G_FILE_ATTRIBUTE_TYPE_STRINGV

a NULL terminated char **. Since 2.22 +a NULL terminated char **. Since 2.22

Returns :

GFileAttributeInfoList or NULL on error. + GFileAttributeInfoList or NULL on error.

Returns :

a GFileAttributeInfo for the name, or NULL if an + a GFileAttributeInfo for the name, or NULL if an attribute isn't found.

G_IO_ERROR_FAILED_HANDLED

Operation failed and a helper program has +Operation failed and a helper program has already interacted with the user. Do not display any error dialog.

G_IO_ERROR_TOO_MANY_OPEN_FILES

The current process has too many files - open and can't open any more. Duplicate descriptors do count toward +The current process has too many files + open and can't open any more. Duplicate descriptors do count toward this limit. Since 2.20
There input data was invalid. Since 2.24

G_IO_ERROR_DBUS_ERROR

A remote object generated an error that + doesn't correspond to a locally registered GError error + domain. Use g_dbus_error_get_remote_error() to extract the D-Bus + error name and g_dbus_error_strip_remote_error() to fix up the + message so it matches what was received on the wire. Since 2.26. +

G_IO_ERROR_HOST_UNREACHABLE

Host unreachable. Since 2.26 +

G_IO_ERROR_NETWORK_UNREACHABLE

Network unreachable. Since 2.26 +

G_IO_ERROR_CONNECTION_REFUSED

Connection refused. Since 2.26 +

G_IO_ERROR_PROXY_FAILED

Connection to proxy server failed. Since 2.26 +

G_IO_ERROR_PROXY_AUTH_FAILED

Proxy authentication failed. Since 2.26 +

G_IO_ERROR_PROXY_NEED_AUTH

Proxy server needs authentication. Since 2.26 +

G_IO_ERROR_PROXY_NOT_ALLOWED

Proxy connection is not allowed by ruleset. + Since 2.26 +

g_io_error_from_errno ()

-
GIOErrorEnum        g_io_error_from_errno               (gint err_no);
+
GIOErrorEnum        g_io_error_from_errno               (gint err_no);

Converts errno.h error codes into GIO error codes.

@@ -319,10 +373,37 @@ Converts errno.h error codes into GIO error codes.
+
+
+

g_io_error_from_win32_error ()

+
GIOErrorEnum        g_io_error_from_win32_error         (gint error_code);
+

+Converts some common error codes into GIO error codes. The +fallback value G_IO_ERROR_FAILED is returned for error codes not +handled. +

+
++ + + + + + + + + + +

error_code :

Windows error number. +

Returns :

GIOErrorEnum value for the given error number. + +
+

Since 2.26

+
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gio-GIOScheduler.html b/docs/reference/gio/html/gio-GIOScheduler.html index 49256e5..106d1fa 100644 --- a/docs/reference/gio/html/gio-GIOScheduler.html +++ b/docs/reference/gio/html/gio-GIOScheduler.html @@ -3,12 +3,12 @@ GIOScheduler - + - + @@ -41,31 +41,31 @@ #include <gio/gio.h> GIOSchedulerJob; -gboolean (*GIOSchedulerJobFunc) (GIOSchedulerJob *job, +gboolean (*GIOSchedulerJobFunc) (GIOSchedulerJob *job, GCancellable *cancellable, - gpointer user_data); + gpointer user_data); void g_io_scheduler_push_job (GIOSchedulerJobFunc job_func, - gpointer user_data, - GDestroyNotify notify, - gint io_priority, + gpointer user_data, + GDestroyNotify notify, + gint io_priority, GCancellable *cancellable); void g_io_scheduler_cancel_all_jobs (void); -gboolean g_io_scheduler_job_send_to_mainloop (GIOSchedulerJob *job, - GSourceFunc func, - gpointer user_data, - GDestroyNotify notify); +gboolean g_io_scheduler_job_send_to_mainloop (GIOSchedulerJob *job, + GSourceFunc func, + gpointer user_data, + GDestroyNotify notify); void g_io_scheduler_job_send_to_mainloop_async (GIOSchedulerJob *job, - GSourceFunc func, - gpointer user_data, - GDestroyNotify notify); + GSourceFunc func, + gpointer user_data, + GDestroyNotify notify);

Description

Schedules asynchronous I/O operations. GIOScheduler integrates -into the main event loop (GMainLoop) and may use threads if they +into the main event loop (GMainLoop) and may use threads if they are available.

@@ -75,8 +75,8 @@ Each I/O operation has a priority, and the scheduler uses the priorities to determine the order in which operations are executed. They are not used to determine system-wide I/O scheduling. Priorities are integers, with lower numbers indicating higher priority. -It is recommended to choose priorities between G_PRIORITY_LOW and -G_PRIORITY_HIGH, with G_PRIORITY_DEFAULT as a default. +It is recommended to choose priorities between G_PRIORITY_LOW and +G_PRIORITY_HIGH, with G_PRIORITY_DEFAULT as a default.

@@ -93,9 +93,9 @@ Opaque class for definining and scheduling IO jobs.

GIOSchedulerJobFunc ()

-
gboolean            (*GIOSchedulerJobFunc)              (GIOSchedulerJob *job,
+
gboolean            (*GIOSchedulerJobFunc)              (GIOSchedulerJob *job,
                                                          GCancellable *cancellable,
-                                                         gpointer user_data);
+ gpointer user_data);

I/O Job function.

@@ -118,7 +118,7 @@ to see if they have been cancelled.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore. @@ -128,8 +128,8 @@ to see if they have been cancelled.

Returns :

- TRUE if this function should be called again to - complete the job, FALSE if the job is complete (or cancelled) + TRUE if this function should be called again to + complete the job, FALSE if the job is complete (or cancelled) @@ -139,9 +139,9 @@ to see if they have been cancelled.

g_io_scheduler_push_job ()

void                g_io_scheduler_push_job             (GIOSchedulerJobFunc job_func,
-                                                         gpointer user_data,
-                                                         GDestroyNotify notify,
-                                                         gint io_priority,
+                                                         gpointer user_data,
+                                                         GDestroyNotify notify,
+                                                         gint io_priority,
                                                          GCancellable *cancellable);

Schedules the I/O job to run. @@ -151,7 +151,7 @@ Schedules the I/O job to run. regardless whether the job was cancelled or has run to completion.

-If cancellable is not NULL, it can be used to cancel the I/O job +If cancellable is not NULL, it can be used to cancel the I/O job by calling g_cancellable_cancel() or by calling g_io_scheduler_cancel_all_jobs().

@@ -170,7 +170,7 @@ by calling notify :

-a
GDestroyNotify for user_data, or NULL +a GDestroyNotify for user_data, or NULL @@ -181,7 +181,7 @@ of the request.

cancellable :

-optional GCancellable object, NULL to ignore. +optional GCancellable object, NULL to ignore. @@ -202,10 +202,10 @@ A job is cancellable if a

g_io_scheduler_job_send_to_mainloop ()

-
gboolean            g_io_scheduler_job_send_to_mainloop (GIOSchedulerJob *job,
-                                                         GSourceFunc func,
-                                                         gpointer user_data,
-                                                         GDestroyNotify notify);
+
gboolean            g_io_scheduler_job_send_to_mainloop (GIOSchedulerJob *job,
+                                                         GSourceFunc func,
+                                                         gpointer user_data,
+                                                         GDestroyNotify notify);

Used from an I/O job to send a callback to be run in the thread that the job was started from, waiting for the result (and thus @@ -221,7 +221,7 @@ blocking the I/O job).

func :

-a GSourceFunc callback that will be called in the original thread +a GSourceFunc callback that will be called in the original thread @@ -231,7 +231,7 @@ blocking the I/O job).

notify :

-a GDestroyNotify for user_data, or NULL +a GDestroyNotify for user_data, or NULL @@ -247,9 +247,9 @@ blocking the I/O job).

g_io_scheduler_job_send_to_mainloop_async ()

void                g_io_scheduler_job_send_to_mainloop_async
                                                         (GIOSchedulerJob *job,
-                                                         GSourceFunc func,
-                                                         gpointer user_data,
-                                                         GDestroyNotify notify);
+ GSourceFunc func, + gpointer user_data, + GDestroyNotify notify);

Used from an I/O job to send a callback to be run asynchronously in the thread that the job was started from. The callback will be run @@ -259,7 +259,7 @@ have finished. The return value from the callback is ignored.

Note that if you are passing the user_data from g_io_scheduler_push_job() on to this function you have to ensure that it is not freed before -func is called, either by passing NULL as notify to +func is called, either by passing NULL as notify to g_io_scheduler_push_job() or by using refcounting for user_data.

@@ -272,7 +272,7 @@ on to this function you have to ensure that it is not freed before - @@ -282,7 +282,7 @@ on to this function you have to ensure that it is not freed before - @@ -292,6 +292,6 @@ on to this function you have to ensure that it is not freed before + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gio-GSrvTarget.html b/docs/reference/gio/html/gio-GSrvTarget.html index 16ffc8f..d159a45 100644 --- a/docs/reference/gio/html/gio-GSrvTarget.html +++ b/docs/reference/gio/html/gio-GSrvTarget.html @@ -3,12 +3,12 @@ GSrvTarget - + - - + + @@ -18,7 +18,7 @@ - + -

func :

a GSourceFunc callback that will be called in the original thread +a GSourceFunc callback that will be called in the original thread

notify :

a GDestroyNotify for user_data, or NULL +a GDestroyNotify for user_data, or NULL
Up Home GIO Reference ManualNextNext
Top @@ -41,17 +41,17 @@ #include <gio/gio.h> GSrvTarget; -GSrvTarget * g_srv_target_new (const gchar *hostname, - guint16 port, - guint16 priority, - guint16 weight); +GSrvTarget * g_srv_target_new (const gchar *hostname, + guint16 port, + guint16 priority, + guint16 weight); GSrvTarget * g_srv_target_copy (GSrvTarget *target); void g_srv_target_free (GSrvTarget *target); -const gchar * g_srv_target_get_hostname (GSrvTarget *target); -guint16 g_srv_target_get_port (GSrvTarget *target); -guint16 g_srv_target_get_priority (GSrvTarget *target); -guint16 g_srv_target_get_weight (GSrvTarget *target); -GList * g_srv_target_list_sort (GList *targets); +const gchar * g_srv_target_get_hostname (GSrvTarget *target); +guint16 g_srv_target_get_port (GSrvTarget *target); +guint16 g_srv_target_get_priority (GSrvTarget *target); +guint16 g_srv_target_get_weight (GSrvTarget *target); +GList * g_srv_target_list_sort (GList *targets);
@@ -86,10 +86,10 @@ A single target host/port that a network service is running on.

g_srv_target_new ()

-
GSrvTarget *        g_srv_target_new                    (const gchar *hostname,
-                                                         guint16 port,
-                                                         guint16 priority,
-                                                         guint16 weight);
+
GSrvTarget *        g_srv_target_new                    (const gchar *hostname,
+                                                         guint16 port,
+                                                         guint16 priority,
+                                                         guint16 weight);

Creates a new GSrvTarget with the given parameters.

@@ -175,12 +175,12 @@ Frees target

g_srv_target_get_hostname ()

-
const gchar *       g_srv_target_get_hostname           (GSrvTarget *target);
+
const gchar *       g_srv_target_get_hostname           (GSrvTarget *target);

Gets target's hostname (in ASCII form; if you are going to present -this to the user, you should use g_hostname_is_ascii_encoded() to +this to the user, you should use g_hostname_is_ascii_encoded() to check if it contains encoded Unicode segments, and use -g_hostname_to_unicode() to convert it if it does.) +g_hostname_to_unicode() to convert it if it does.)

@@ -203,7 +203,7 @@ check if it contains encoded Unicode segments, and use

g_srv_target_get_port ()

-
guint16             g_srv_target_get_port               (GSrvTarget *target);
+
guint16             g_srv_target_get_port               (GSrvTarget *target);

Gets target's port

@@ -228,7 +228,7 @@ Gets target's port

g_srv_target_get_priority ()

-
guint16             g_srv_target_get_priority           (GSrvTarget *target);
+
guint16             g_srv_target_get_priority           (GSrvTarget *target);

Gets target's priority. You should not need to look at this; GResolver already sorts the targets according to the algorithm in @@ -255,7 +255,7 @@ RFC 2782.


g_srv_target_get_weight ()

-
guint16             g_srv_target_get_weight             (GSrvTarget *target);
+
guint16             g_srv_target_get_weight             (GSrvTarget *target);

Gets target's weight. You should not need to look at this; GResolver already sorts the targets according to the algorithm in @@ -282,7 +282,7 @@ RFC 2782.


g_srv_target_list_sort ()

-
GList *             g_srv_target_list_sort              (GList *targets);
+
GList *             g_srv_target_list_sort              (GList *targets);

Sorts targets in place according to the algorithm in RFC 2782.

@@ -291,13 +291,12 @@ Sorts targets in place according to the
- - @@ -308,6 +307,6 @@ Sorts targets in place according to the + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gio-Owning-Bus-Names.html b/docs/reference/gio/html/gio-Owning-Bus-Names.html new file mode 100644 index 0000000..62acc19 --- /dev/null +++ b/docs/reference/gio/html/gio-Owning-Bus-Names.html @@ -0,0 +1,736 @@ + + + + +Owning Bus Names + + + + + + + + + +

targets :

a GList of GSrvTarget +a GList of GSrvTarget

Returns :

the head of the sorted list. - + the head of the sorted list. [transfer full]
+ + + + + + + + + +
+
+
+ + +
+

Owning Bus Names

+

Owning Bus Names — Simple API for owning bus names

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+void                (*GBusAcquiredCallback)             (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+void                (*GBusNameAcquiredCallback)         (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+void                (*GBusNameLostCallback)             (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+enum                GBusNameOwnerFlags;
+guint               g_bus_own_name                      (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GBusAcquiredCallback bus_acquired_handler,
+                                                         GBusNameAcquiredCallback name_acquired_handler,
+                                                         GBusNameLostCallback name_lost_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+guint               g_bus_own_name_on_connection        (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GBusNameAcquiredCallback name_acquired_handler,
+                                                         GBusNameLostCallback name_lost_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+void                g_bus_unown_name                    (guint owner_id);
+guint               g_bus_own_name_with_closures        (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GClosure *bus_acquired_closure,
+                                                         GClosure *name_acquired_closure,
+                                                         GClosure *name_lost_closure);
+guint               g_bus_own_name_on_connection_with_closures
+                                                        (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GClosure *name_acquired_closure,
+                                                         GClosure *name_lost_closure);
+
+
+
+

Description

+

+Convenience API for owning bus names. +

+

+

+
+

Example 8. Simple application owning a name

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
#include <gio/gio.h>
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+                 const gchar     *name,
+                 gpointer         user_data)
+{
+  /* This is where we'd export some objects on the bus */
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+  g_print ("Acquired the name %s on the session bus\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+              const gchar     *name,
+              gpointer         user_data)
+{
+  g_print ("Lost the name %s on the session bus\n", name);
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint owner_id;
+  GMainLoop *loop;
+  GBusNameOwnerFlags flags;
+  gboolean opt_replace;
+  gboolean opt_allow_replacement;
+  gchar *opt_name;
+  GOptionContext *opt_context;
+  GError *error;
+  GOptionEntry opt_entries[] =
+    {
+      { "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace existing name if possible", NULL },
+      { "allow-replacement", 'a', 0, G_OPTION_ARG_NONE, &opt_allow_replacement, "Allow replacement", NULL },
+      { "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name to acquire", NULL },
+      { NULL}
+    };
+
+  g_type_init ();
+
+  error = NULL;
+  opt_name = NULL;
+  opt_replace = FALSE;
+  opt_allow_replacement = FALSE;
+  opt_context = g_option_context_new ("g_bus_own_name() example");
+  g_option_context_add_main_entries (opt_context, opt_entries, NULL);
+  if (!g_option_context_parse (opt_context, &argc, &argv, &error))
+    {
+      g_printerr ("Error parsing options: %s", error->message);
+      return 1;
+    }
+  if (opt_name == NULL)
+    {
+      g_printerr ("Incorrect usage, try --help.\n");
+      return 1;
+    }
+
+  flags = G_BUS_NAME_OWNER_FLAGS_NONE;
+  if (opt_replace)
+    flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE;
+  if (opt_allow_replacement)
+    flags |= G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT;
+
+  owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+                             opt_name,
+                             flags,
+                             on_bus_acquired,
+                             on_name_acquired,
+                             on_name_lost,
+                             NULL,
+                             NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unown_name (owner_id);
+
+  return 0;
+}
+
+ +
+


+

+
+
+

Details

+
+

GBusAcquiredCallback ()

+
void                (*GBusAcquiredCallback)             (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+

+Invoked when a connection to a message bus has been obtained. +

+
++ + + + + + + + + + + + + + +

connection :

The GDBusConnection to a message bus. +

name :

The name that is requested to be owned. +

user_data :

User data passed to g_bus_own_name(). +
+

Since 2.26

+
+
+
+

GBusNameAcquiredCallback ()

+
void                (*GBusNameAcquiredCallback)         (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+

+Invoked when the name is acquired. +

+
++ + + + + + + + + + + + + + +

connection :

The GDBusConnection on which to acquired the name. +

name :

The name being owned. +

user_data :

User data passed to g_bus_own_name() or g_bus_own_name_on_connection(). +
+

Since 2.26

+
+
+
+

GBusNameLostCallback ()

+
void                (*GBusNameLostCallback)             (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+

+Invoked when the name is lost or connection has been closed. +

+
++ + + + + + + + + + + + + + +

connection :

The GDBusConnection on which to acquire the name or NULL if +the connection was disconnected. +

name :

The name being owned. +

user_data :

User data passed to g_bus_own_name() or g_bus_own_name_on_connection(). +
+

Since 2.26

+
+
+
+

enum GBusNameOwnerFlags

+
typedef enum
+{
+  G_BUS_NAME_OWNER_FLAGS_NONE = 0,                    /*< nick=none >*/
+  G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT = (1<<0),  /*< nick=allow-replacement >*/
+  G_BUS_NAME_OWNER_FLAGS_REPLACE = (1<<1)            /*< nick=replace >*/
+} GBusNameOwnerFlags;
+
+

+Flags used in g_bus_own_name(). +

+
++ + + + + + + + + + + + + + +

G_BUS_NAME_OWNER_FLAGS_NONE

No flags set. +

G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT

Allow another message bus connection to claim the the name. +

G_BUS_NAME_OWNER_FLAGS_REPLACE

If another message bus connection owns the name and have +specified G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection. +
+

Since 2.26

+
+
+
+

g_bus_own_name ()

+
guint               g_bus_own_name                      (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GBusAcquiredCallback bus_acquired_handler,
+                                                         GBusNameAcquiredCallback name_acquired_handler,
+                                                         GBusNameLostCallback name_lost_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+

+Starts acquiring name on the bus specified by bus_type and calls +name_acquired_handler and name_lost_handler when the name is +acquired respectively lost. Callbacks will be invoked in the thread-default main +loop of the thread you are calling this function from. +

+

+You are guaranteed that one of the name_acquired_handler and name_lost_handler +callbacks will be invoked after calling this function - there are three +possible cases: +

+
    +
  • + name_lost_handler with a NULL connection (if a connection to the bus can't be made). +

  • +
  • + bus_acquired_handler then name_lost_handler (if the name can't be obtained) +

  • +
  • + bus_acquired_handler then name_acquired_handler (if the name was obtained). +

  • +
+

+When you are done owning the name, just call g_bus_unown_name() +with the owner id this function returns. +

+

+If the name is acquired or lost (for example another application +could acquire the name if you allow replacement or the application +currently owning the name exits), the handlers are also invoked. If the +GDBusConnection that is used for attempting to own the name +closes, then name_lost_handler is invoked since it is no +longer possible for other processes to access the process. +

+

+You cannot use g_bus_own_name() several times for the same name (unless +interleaved with calls to g_bus_unown_name()) - only the first call +will work. +

+

+Another guarantee is that invocations of name_acquired_handler +and name_lost_handler are guaranteed to alternate; that +is, if name_acquired_handler is invoked then you are +guaranteed that the next time one of the handlers is invoked, it +will be name_lost_handler. The reverse is also true. +

+

+If you plan on exporting objects (using e.g. +g_dbus_connection_register_object()), note that it is generally too late +to export the objects in name_acquired_handler. Instead, you can do this +in bus_acquired_handler since you are guaranteed that this will run +before name is requested from the bus. +

+

+This behavior makes it very simple to write applications that wants +to own names and export objects, see Example 8, “Simple application owning a name”. +Simply register objects to be exported in bus_acquired_handler and +unregister the objects (if any) in name_lost_handler. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bus_type :

The type of bus to own a name on. +

name :

The well-known name to own. +

flags :

A set of flags from the GBusNameOwnerFlags enumeration. +

bus_acquired_handler :

Handler to invoke when connected to the bus of type bus_type or NULL. +

name_acquired_handler :

Handler to invoke when name is acquired or NULL. +

name_lost_handler :

Handler to invoke when name is lost or NULL. +

user_data :

User data to pass to handlers. +

user_data_free_func :

Function for freeing user_data or NULL. +

Returns :

An identifier (never 0) that an be used with +g_bus_unown_name() to stop owning the name. + +
+

Since 2.26

+
+
+
+

g_bus_own_name_on_connection ()

+
guint               g_bus_own_name_on_connection        (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GBusNameAcquiredCallback name_acquired_handler,
+                                                         GBusNameLostCallback name_lost_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+

+Like g_bus_own_name() but takes a GDBusConnection instead of a +GBusType. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

name :

The well-known name to own. +

flags :

A set of flags from the GBusNameOwnerFlags enumeration. +

name_acquired_handler :

Handler to invoke when name is acquired or NULL. +

name_lost_handler :

Handler to invoke when name is lost or NULL. +

user_data :

User data to pass to handlers. +

user_data_free_func :

Function for freeing user_data or NULL. +

Returns :

An identifier (never 0) that an be used with +g_bus_unown_name() to stop owning the name. + +
+

Since 2.26

+
+
+
+

g_bus_unown_name ()

+
void                g_bus_unown_name                    (guint owner_id);
+

+Stops owning a name. +

+
++ + + + +

owner_id :

An identifier obtained from g_bus_own_name() +
+

Since 2.26

+
+
+
+

g_bus_own_name_with_closures ()

+
guint               g_bus_own_name_with_closures        (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GClosure *bus_acquired_closure,
+                                                         GClosure *name_acquired_closure,
+                                                         GClosure *name_lost_closure);
+

+Version of g_bus_own_name() using closures instead of callbacks for +easier binding in other languages. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bus_type :

The type of bus to own a name on. +

name :

The well-known name to own. +

flags :

A set of flags from the GBusNameOwnerFlags enumeration. +

bus_acquired_closure :

GClosure to invoke when connected to +the bus of type bus_type or NULL. [allow-none] +

name_acquired_closure :

GClosure to invoke when name is +acquired or NULL. [allow-none] +

name_lost_closure :

GClosure to invoke when name is lost or +NULL. [allow-none] +

Returns :

An identifier (never 0) that an be used with +g_bus_unown_name() to stop owning the name. + +Rename to: g_bus_own_name + +
+

Since 2.26

+
+
+
+

g_bus_own_name_on_connection_with_closures ()

+
guint               g_bus_own_name_on_connection_with_closures
+                                                        (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameOwnerFlags flags,
+                                                         GClosure *name_acquired_closure,
+                                                         GClosure *name_lost_closure);
+

+Version of g_bus_own_name_on_connection() using closures instead of callbacks for +easier binding in other languages. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

name :

The well-known name to own. +

flags :

A set of flags from the GBusNameOwnerFlags enumeration. +

name_acquired_closure :

GClosure to invoke when name is +acquired or NULL. [allow-none] +

name_lost_closure :

GClosure to invoke when name is lost or +NULL. [allow-none] +

Returns :

An identifier (never 0) that an be used with +g_bus_unown_name() to stop owning the name. + +Rename to: g_bus_own_name_on_connection + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-TLS-Overview.html b/docs/reference/gio/html/gio-TLS-Overview.html new file mode 100644 index 0000000..a5dca9c --- /dev/null +++ b/docs/reference/gio/html/gio-TLS-Overview.html @@ -0,0 +1,274 @@ + + + + +TLS Overview + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

TLS Overview

+

TLS Overview — TLS (aka SSL) support for GSocketConnection

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+#define             G_TLS_ERROR
+enum                GTlsError;
+
+enum                GTlsAuthenticationMode;
+enum                GTlsCertificateFlags;
+
+
+
+

Description

+

+GTlsConnection and related classes provide TLS (Transport Layer +Security, previously known as SSL, Secure Sockets Layer) support for +gio-based network streams. +

+

+In the simplest case, for a client connection, you can just set the +"tls" flag on a GSocketClient, and then any +connections created by that client will have TLS negotiated +automatically, using appropriate default settings, and rejecting +any invalid or self-signed certificates (unless you change that +default by setting the "tls-validation-flags" +property). The returned object will be a GTcpWrapperConnection, +which wraps the underlying GTlsClientConnection. +

+

+For greater control, you can create your own GTlsClientConnection, +wrapping a GSocketConnection (or an arbitrary GIOStream with +pollable input and output streams) and then connect to its signals, +such as "accept-certificate", before starting the +handshake. +

+

+Server-side TLS is similar, using GTlsServerConnection. At the +moment, there is no support for automatically wrapping server-side +connections in the way GSocketClient does for client-side +connections. +

+
+
+

Details

+
+

G_TLS_ERROR

+
#define G_TLS_ERROR (g_tls_error_quark ())
+
+

+Error domain for TLS. Errors in this domain will be from the +GTlsError enumeration. See GError for more information on error +domains. +

+
+
+
+

enum GTlsError

+
typedef enum {
+  G_TLS_ERROR_UNAVAILABLE,
+  G_TLS_ERROR_MISC,
+  G_TLS_ERROR_BAD_CERTIFICATE,
+  G_TLS_ERROR_NOT_TLS,
+  G_TLS_ERROR_HANDSHAKE,
+  G_TLS_ERROR_CERTIFICATE_REQUIRED,
+  G_TLS_ERROR_EOF
+} GTlsError;
+
+

+An error code used with G_TLS_ERROR in a GError returned from a +TLS-related routine. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

G_TLS_ERROR_UNAVAILABLE

No TLS provider is available +

G_TLS_ERROR_MISC

Miscellaneous TLS error +

G_TLS_ERROR_BAD_CERTIFICATE

A certificate could not be parsed +

G_TLS_ERROR_NOT_TLS

The TLS handshake failed because the + peer does not seem to be a TLS server. +

G_TLS_ERROR_HANDSHAKE

The TLS handshake failed because the + peer's certificate was not acceptable. +

G_TLS_ERROR_CERTIFICATE_REQUIRED

The TLS handshake failed because + the server requested a client-side certificate, but none was + provided. See g_tls_connection_set_certificate(). +

G_TLS_ERROR_EOF

The TLS connection was closed without proper + notice, which may indicate an attack. See + g_tls_connection_set_require_close_notify(). +
+

Since 2.28

+
+
+
+

enum GTlsAuthenticationMode

+
typedef enum {
+  G_TLS_AUTHENTICATION_NONE,
+  G_TLS_AUTHENTICATION_REQUESTED,
+  G_TLS_AUTHENTICATION_REQUIRED
+} GTlsAuthenticationMode;
+
+

+The client authentication mode for a GTlsServerConnection. +

+
++ + + + + + + + + + + + + + +

G_TLS_AUTHENTICATION_NONE

client authentication not required +

G_TLS_AUTHENTICATION_REQUESTED

client authentication is requested +

G_TLS_AUTHENTICATION_REQUIRED

client authentication is required +
+

Since 2.28

+
+
+
+

enum GTlsCertificateFlags

+
typedef enum {
+  G_TLS_CERTIFICATE_UNKNOWN_CA    = (1 << 0),
+  G_TLS_CERTIFICATE_BAD_IDENTITY  = (1 << 1),
+  G_TLS_CERTIFICATE_NOT_ACTIVATED = (1 << 2),
+  G_TLS_CERTIFICATE_EXPIRED       = (1 << 3),
+  G_TLS_CERTIFICATE_REVOKED       = (1 << 4),
+  G_TLS_CERTIFICATE_INSECURE      = (1 << 5),
+  G_TLS_CERTIFICATE_GENERIC_ERROR = (1 << 6),
+
+  G_TLS_CERTIFICATE_VALIDATE_ALL  = 0x007f
+} GTlsCertificateFlags;
+
+

+A set of flags describing TLS certification validation. This can be +used to set which validation steps to perform (eg, with +g_tls_client_connection_set_validation_flags()), or to describe why +a particular certificate was rejected (eg, in +"accept-certificate"). +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

G_TLS_CERTIFICATE_UNKNOWN_CA

The signing certificate authority is + not known. +

G_TLS_CERTIFICATE_BAD_IDENTITY

The certificate does not match the + expected identity of the site that it was retrieved from. +

G_TLS_CERTIFICATE_NOT_ACTIVATED

The certificate's activation time + is still in the future +

G_TLS_CERTIFICATE_EXPIRED

The certificate has expired +

G_TLS_CERTIFICATE_REVOKED

The certificate has been revoked + according to the GTlsContext's certificate revocation list. +

G_TLS_CERTIFICATE_INSECURE

The certificate's algorithm is + considered insecure. +

G_TLS_CERTIFICATE_GENERIC_ERROR

Some other error occurred validating + the certificate +

G_TLS_CERTIFICATE_VALIDATE_ALL

the combination of all of the above + flags +
+

Since 2.28

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-Unix-Mounts.html b/docs/reference/gio/html/gio-Unix-Mounts.html index 3bcffea..ee86a3c 100644 --- a/docs/reference/gio/html/gio-Unix-Mounts.html +++ b/docs/reference/gio/html/gio-Unix-Mounts.html @@ -3,12 +3,12 @@ Unix Mounts - + - + @@ -35,7 +35,7 @@

Unix Mounts

-

Unix Mounts — Unix Mounts

+

Unix Mounts — UNIX mounts

@@ -44,52 +44,51 @@
 #include <gio/gunixmounts.h>
 
-                    GUnixMount;
                     GUnixMountPoint;
                     GUnixMountEntry;
                     GUnixMountMonitor;
 void                g_unix_mount_free                   (GUnixMountEntry *mount_entry);
-gint                g_unix_mount_compare                (GUnixMountEntry *mount1,
+gint                g_unix_mount_compare                (GUnixMountEntry *mount1,
                                                          GUnixMountEntry *mount2);
 const char *        g_unix_mount_get_mount_path         (GUnixMountEntry *mount_entry);
 const char *        g_unix_mount_get_device_path        (GUnixMountEntry *mount_entry);
 const char *        g_unix_mount_get_fs_type            (GUnixMountEntry *mount_entry);
-gboolean            g_unix_mount_is_readonly            (GUnixMountEntry *mount_entry);
-gboolean            g_unix_mount_is_system_internal     (GUnixMountEntry *mount_entry);
+gboolean            g_unix_mount_is_readonly            (GUnixMountEntry *mount_entry);
+gboolean            g_unix_mount_is_system_internal     (GUnixMountEntry *mount_entry);
 GIcon *             g_unix_mount_guess_icon             (GUnixMountEntry *mount_entry);
 char *              g_unix_mount_guess_name             (GUnixMountEntry *mount_entry);
-gboolean            g_unix_mount_guess_can_eject        (GUnixMountEntry *mount_entry);
-gboolean            g_unix_mount_guess_should_display   (GUnixMountEntry *mount_entry);
+gboolean            g_unix_mount_guess_can_eject        (GUnixMountEntry *mount_entry);
+gboolean            g_unix_mount_guess_should_display   (GUnixMountEntry *mount_entry);
 void                g_unix_mount_point_free             (GUnixMountPoint *mount_point);
-gint                g_unix_mount_point_compare          (GUnixMountPoint *mount1,
+gint                g_unix_mount_point_compare          (GUnixMountPoint *mount1,
                                                          GUnixMountPoint *mount2);
 const char *        g_unix_mount_point_get_mount_path   (GUnixMountPoint *mount_point);
 const char *        g_unix_mount_point_get_device_path  (GUnixMountPoint *mount_point);
 const char *        g_unix_mount_point_get_fs_type      (GUnixMountPoint *mount_point);
-gboolean            g_unix_mount_point_is_readonly      (GUnixMountPoint *mount_point);
-gboolean            g_unix_mount_point_is_user_mountable
+gboolean            g_unix_mount_point_is_readonly      (GUnixMountPoint *mount_point);
+gboolean            g_unix_mount_point_is_user_mountable
                                                         (GUnixMountPoint *mount_point);
-gboolean            g_unix_mount_point_is_loopback      (GUnixMountPoint *mount_point);
+gboolean            g_unix_mount_point_is_loopback      (GUnixMountPoint *mount_point);
 GIcon *             g_unix_mount_point_guess_icon       (GUnixMountPoint *mount_point);
 char *              g_unix_mount_point_guess_name       (GUnixMountPoint *mount_point);
-gboolean            g_unix_mount_point_guess_can_eject  (GUnixMountPoint *mount_point);
-GList *             g_unix_mount_points_get             (guint64 *time_read);
-GList *             g_unix_mounts_get                   (guint64 *time_read);
+gboolean            g_unix_mount_point_guess_can_eject  (GUnixMountPoint *mount_point);
+GList *             g_unix_mount_points_get             (guint64 *time_read);
+GList *             g_unix_mounts_get                   (guint64 *time_read);
 GUnixMountEntry *   g_unix_mount_at                     (const char *mount_path,
-                                                         guint64 *time_read);
-gboolean            g_unix_mounts_changed_since         (guint64 time);
-gboolean            g_unix_mount_points_changed_since   (guint64 time);
+                                                         guint64 *time_read);
+gboolean            g_unix_mounts_changed_since         (guint64 time);
+gboolean            g_unix_mount_points_changed_since   (guint64 time);
 GUnixMountMonitor * g_unix_mount_monitor_new            (void);
 void                g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
                                                          int limit_msec);
-gboolean            g_unix_is_mount_path_system_internal
+gboolean            g_unix_is_mount_path_system_internal
                                                         (const char *mount_path);
 

Object Hierarchy

-  GObject
+  GObject
    +----GUnixMountMonitor
 
@@ -106,21 +105,13 @@ const char * <gio/gunixmounts.h> belongs to the -UNIX-specific GIO interfaces, thus you have to use the +Note that <gio/gunixmounts.h> belongs to the +UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

Details

-
-

GUnixMount

-
typedef struct _GUnixMount GUnixMount;
-

-Implementation of the GMount interface for Unix systems. -

-
-

GUnixMountPoint

typedef struct _GUnixMountPoint GUnixMountPoint;
@@ -143,7 +134,7 @@ This corresponds roughly to a mtab entry.

GUnixMountMonitor

typedef struct _GUnixMountMonitor GUnixMountMonitor;

-Watches GUnixMounts for changes. +Watches GUnixMounts for changes.


@@ -157,7 +148,7 @@ Frees a unix mount.

mount_entry :

a GUnixMount. +a GUnixMount.
@@ -165,7 +156,7 @@ Frees a unix mount.

g_unix_mount_compare ()

-
gint                g_unix_mount_compare                (GUnixMountEntry *mount1,
+
gint                g_unix_mount_compare                (GUnixMountEntry *mount1,
                                                          GUnixMountEntry *mount2);

Compares two unix mounts. @@ -227,7 +218,7 @@ Gets the device path for a unix mount.

mount_entry :

-a GUnixMount. +a GUnixMount. @@ -250,7 +241,7 @@ Gets the filesystem type for the unix mount.

mount_entry :

-a GUnixMount. +a GUnixMount. @@ -264,7 +255,7 @@ Gets the filesystem type for the unix mount.

g_unix_mount_is_readonly ()

-
gboolean            g_unix_mount_is_readonly            (GUnixMountEntry *mount_entry);
+
gboolean            g_unix_mount_is_readonly            (GUnixMountEntry *mount_entry);

Checks if a unix mount is mounted read only.

@@ -273,12 +264,12 @@ Checks if a unix mount is mounted read only.

mount_entry :

-a GUnixMount. +a GUnixMount.

Returns :

- TRUE if mount_entry is read only. + TRUE if mount_entry is read only. @@ -287,7 +278,7 @@ Checks if a unix mount is mounted read only.

g_unix_mount_is_system_internal ()

-
gboolean            g_unix_mount_is_system_internal     (GUnixMountEntry *mount_entry);
+
gboolean            g_unix_mount_is_system_internal     (GUnixMountEntry *mount_entry);

Checks if a unix mount is a system path.

@@ -296,12 +287,12 @@ Checks if a unix mount is a system path.

mount_entry :

-a GUnixMount. +a GUnixMount.

Returns :

- TRUE if the unix mount is for a system path. + TRUE if the unix mount is for a system path. @@ -324,7 +315,7 @@ Guesses the icon of a Unix mount.

Returns :

- a GIcon + a GIcon. [transfer full] @@ -349,7 +340,7 @@ The result is a translated string.

Returns :

A newly allocated string that must - be freed with g_free() + be freed with g_free() @@ -358,7 +349,7 @@ The result is a translated string.

g_unix_mount_guess_can_eject ()

-
gboolean            g_unix_mount_guess_can_eject        (GUnixMountEntry *mount_entry);
+
gboolean            g_unix_mount_guess_can_eject        (GUnixMountEntry *mount_entry);

Guesses whether a Unix mount can be ejected.

@@ -372,7 +363,7 @@ Guesses whether a Unix mount can be ejected.

Returns :

- TRUE if mount_entry is deemed to be ejectable. + TRUE if mount_entry is deemed to be ejectable. @@ -381,7 +372,7 @@ Guesses whether a Unix mount can be ejected.

g_unix_mount_guess_should_display ()

-
gboolean            g_unix_mount_guess_should_display   (GUnixMountEntry *mount_entry);
+
gboolean            g_unix_mount_guess_should_display   (GUnixMountEntry *mount_entry);

Guesses whether a Unix mount should be displayed in the UI.

@@ -395,7 +386,7 @@ Guesses whether a Unix mount should be displayed in the UI.

Returns :

- TRUE if mount_entry is deemed to be displayable. + TRUE if mount_entry is deemed to be displayable. @@ -420,7 +411,7 @@ Frees a unix mount point.

g_unix_mount_point_compare ()

-
gint                g_unix_mount_point_compare          (GUnixMountPoint *mount1,
+
gint                g_unix_mount_point_compare          (GUnixMountPoint *mount1,
                                                          GUnixMountPoint *mount2);

Compares two unix mount points. @@ -430,12 +421,12 @@ Compares two unix mount points.

mount1 :

-a GUnixMount. +a GUnixMount.

mount2 :

-a GUnixMount. +a GUnixMount. @@ -519,7 +510,7 @@ Gets the file system type for the mount point.

g_unix_mount_point_is_readonly ()

-
gboolean            g_unix_mount_point_is_readonly      (GUnixMountPoint *mount_point);
+
gboolean            g_unix_mount_point_is_readonly      (GUnixMountPoint *mount_point);

Checks if a unix mount point is read only.

@@ -533,7 +524,7 @@ Checks if a unix mount point is read only.

Returns :

- TRUE if a mount point is read only. + TRUE if a mount point is read only. @@ -542,7 +533,7 @@ Checks if a unix mount point is read only.

g_unix_mount_point_is_user_mountable ()

-
gboolean            g_unix_mount_point_is_user_mountable
+
gboolean            g_unix_mount_point_is_user_mountable
                                                         (GUnixMountPoint *mount_point);

Checks if a unix mount point is mountable by the user. @@ -557,7 +548,7 @@ Checks if a unix mount point is mountable by the user.

Returns :

- TRUE if the mount point is user mountable. + TRUE if the mount point is user mountable. @@ -566,7 +557,7 @@ Checks if a unix mount point is mountable by the user.

g_unix_mount_point_is_loopback ()

-
gboolean            g_unix_mount_point_is_loopback      (GUnixMountPoint *mount_point);
+
gboolean            g_unix_mount_point_is_loopback      (GUnixMountPoint *mount_point);

Checks if a unix mount point is a loopback device.

@@ -580,7 +571,7 @@ Checks if a unix mount point is a loopback device.

Returns :

- TRUE if the mount point is a loopback. FALSE otherwise. + TRUE if the mount point is a loopback. FALSE otherwise. @@ -603,7 +594,7 @@ Guesses the icon of a Unix mount point.

Returns :

- a GIcon + a GIcon. [transfer full] @@ -628,7 +619,7 @@ The result is a translated string.

Returns :

A newly allocated string that must - be freed with g_free() + be freed with g_free() @@ -637,7 +628,7 @@ The result is a translated string.

g_unix_mount_point_guess_can_eject ()

-
gboolean            g_unix_mount_point_guess_can_eject  (GUnixMountPoint *mount_point);
+
gboolean            g_unix_mount_point_guess_can_eject  (GUnixMountPoint *mount_point);

Guesses whether a Unix mount point can be ejected.

@@ -651,7 +642,7 @@ Guesses whether a Unix mount point can be ejected.

Returns :

- TRUE if mount_point is deemed to be ejectable. + TRUE if mount_point is deemed to be ejectable. @@ -660,11 +651,11 @@ Guesses whether a Unix mount point can be ejected.

g_unix_mount_points_get ()

-
GList *             g_unix_mount_points_get             (guint64 *time_read);
+
GList *             g_unix_mount_points_get             (guint64 *time_read);

-Gets a GList of strings containing the unix mount points. +Gets a GList of GUnixMountPoint containing the unix mount points. If time_read is set, it will be filled with the mount timestamp, -allowing for checking if the mounts have changed with +allowing for checking if the mounts have changed with g_unix_mounts_points_changed_since().

@@ -672,12 +663,12 @@ allowing for checking if the mounts have changed with - - @@ -686,11 +677,11 @@ allowing for checking if the mounts have changed with

g_unix_mounts_get ()

-
GList *             g_unix_mounts_get                   (guint64 *time_read);
+
GList *             g_unix_mounts_get                   (guint64 *time_read);

-Gets a GList of strings containing the unix mounts. -If time_read is set, it will be filled with the mount -timestamp, allowing for checking if the mounts have changed +Gets a GList of GUnixMountEntry containing the unix mounts. +If time_read is set, it will be filled with the mount +timestamp, allowing for checking if the mounts have changed with g_unix_mounts_changed_since().

time_read :

guint64 to contain a timestamp. + guint64 to contain a timestamp. [allow-none]

Returns :

a GList of the UNIX mountpoints. + a GList of the UNIX mountpoints. [element-type utf8][transfer full utf8]
@@ -698,12 +689,12 @@ with - - @@ -713,7 +704,7 @@ with

g_unix_mount_at ()

GUnixMountEntry *   g_unix_mount_at                     (const char *mount_path,
-                                                         guint64 *time_read);
+ guint64 *time_read);

Gets a GUnixMountEntry for a given mount path. If time_read is set, it will be filled with a unix timestamp for checking @@ -734,7 +725,7 @@ if the mounts have changed since with Returns :

- @@ -743,7 +734,7 @@ if the mounts have changed since with

g_unix_mounts_changed_since ()

-
gboolean            g_unix_mounts_changed_since         (guint64 time);
+
gboolean            g_unix_mounts_changed_since         (guint64 time);

Checks if the unix mounts have changed since a given unix time.

@@ -757,7 +748,7 @@ Checks if the unix mounts have changed since a given unix time. - @@ -766,7 +757,7 @@ Checks if the unix mounts have changed since a given unix time.

g_unix_mount_points_changed_since ()

-
gboolean            g_unix_mount_points_changed_since   (guint64 time);
+
gboolean            g_unix_mount_points_changed_since   (guint64 time);

Checks if the unix mount points have changed since a given unix time.

@@ -780,7 +771,7 @@ Checks if the unix mount points have changed since a given unix time.
- @@ -835,7 +826,7 @@ consecutive change events to the mount and mount point entry files.

g_unix_is_mount_path_system_internal ()

-
gboolean            g_unix_is_mount_path_system_internal
+
gboolean            g_unix_is_mount_path_system_internal
                                                         (const char *mount_path);

Determines if mount_path is considered an implementation of the @@ -854,7 +845,7 @@ casual user.

- @@ -867,7 +858,7 @@ casual user.

The "mountpoints-changed" signal

void                user_function                      (GUnixMountMonitor *monitor,
-                                                        gpointer           user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the unix mount points have changed.

@@ -890,7 +881,7 @@ Emitted when the unix mount points have changed.

The "mounts-changed" signal

void                user_function                      (GUnixMountMonitor *monitor,
-                                                        gpointer           user_data)      : Run Last
+ gpointer user_data) : Run Last

Emitted when the unix mounts have changed.

@@ -913,6 +904,6 @@ Emitted when the unix mounts have changed.
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/gio-Watching-Bus-Names.html b/docs/reference/gio/html/gio-Watching-Bus-Names.html new file mode 100644 index 0000000..9b08f38 --- /dev/null +++ b/docs/reference/gio/html/gio-Watching-Bus-Names.html @@ -0,0 +1,666 @@ + + + + +Watching Bus Names + + + + + + + + + +

time_read :

guint64 to contain a timestamp. + guint64 to contain a timestamp, or NULL. [allow-none]

Returns :

a GList of the UNIX mounts. + a GList of the UNIX mounts. [element-type utf8][transfer full utf8]
a GUnixMount. + a GUnixMount. [transfer full]

Returns :

TRUE if the mounts have changed since time. + TRUE if the mounts have changed since time.

Returns :

TRUE if the mount points have changed since time. + TRUE if the mount points have changed since time.

Returns :

TRUE if mount_path is considered an implementation detail + TRUE if mount_path is considered an implementation detail of the OS.
+ + + + + + + + + +
+
+
+ + +
+

Watching Bus Names

+

Watching Bus Names — Simple API for watching bus names

+
+
+

Synopsis

+
+#include <gio/gio.h>
+
+void                (*GBusNameAppearedCallback)         (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         const gchar *name_owner,
+                                                         gpointer user_data);
+void                (*GBusNameVanishedCallback)         (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+enum                GBusNameWatcherFlags;
+guint               g_bus_watch_name                    (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GBusNameAppearedCallback name_appeared_handler,
+                                                         GBusNameVanishedCallback name_vanished_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+guint               g_bus_watch_name_on_connection      (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GBusNameAppearedCallback name_appeared_handler,
+                                                         GBusNameVanishedCallback name_vanished_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+void                g_bus_unwatch_name                  (guint watcher_id);
+guint               g_bus_watch_name_with_closures      (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GClosure *name_appeared_closure,
+                                                         GClosure *name_vanished_closure);
+guint               g_bus_watch_name_on_connection_with_closures
+                                                        (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GClosure *name_appeared_closure,
+                                                         GClosure *name_vanished_closure);
+
+
+
+

Description

+

+Convenience API for watching bus names. +

+

+

+
+

Example 9. Simple application watching a name

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
#include <gio/gio.h>
+
+static gchar *opt_name         = NULL;
+static gboolean opt_system_bus = FALSE;
+static gboolean opt_auto_start = FALSE;
+
+static GOptionEntry opt_entries[] =
+{
+  { "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name to watch", NULL },
+  { "system-bus", 's', 0, G_OPTION_ARG_NONE, &opt_system_bus, "Use the system-bus instead of the session-bus", NULL },
+  { "auto-start", 'a', 0, G_OPTION_ARG_NONE, &opt_auto_start, "Instruct the bus to launch an owner for the name", NULL},
+  { NULL}
+};
+
+static void
+on_name_appeared (GDBusConnection *connection,
+                  const gchar     *name,
+                  const gchar     *name_owner,
+                  gpointer         user_data)
+{
+  g_print ("Name %s on %s is owned by %s\n",
+           name,
+           opt_system_bus ? "the system bus" : "the session bus",
+           name_owner);
+}
+
+static void
+on_name_vanished (GDBusConnection *connection,
+                  const gchar     *name,
+                  gpointer         user_data)
+{
+  g_print ("Name %s does not exist on %s\n",
+           name,
+           opt_system_bus ? "the system bus" : "the session bus");
+}
+
+int
+main (int argc, char *argv[])
+{
+  guint watcher_id;
+  GMainLoop *loop;
+  GOptionContext *opt_context;
+  GError *error;
+  GBusNameWatcherFlags flags;
+
+  g_type_init ();
+
+  error = NULL;
+  opt_context = g_option_context_new ("g_bus_watch_name() example");
+  g_option_context_set_summary (opt_context,
+                                "Example: to watch the power manager on the session bus, use:\n"
+                                "\n"
+                                "  ./example-watch-name -n org.gnome.PowerManager");
+  g_option_context_add_main_entries (opt_context, opt_entries, NULL);
+  if (!g_option_context_parse (opt_context, &argc, &argv, &error))
+    {
+      g_printerr ("Error parsing options: %s", error->message);
+      goto out;
+    }
+  if (opt_name == NULL)
+    {
+      g_printerr ("Incorrect usage, try --help.\n");
+      goto out;
+    }
+
+  flags = G_BUS_NAME_WATCHER_FLAGS_NONE;
+  if (opt_auto_start)
+    flags |= G_BUS_NAME_WATCHER_FLAGS_AUTO_START;
+
+  watcher_id = g_bus_watch_name (opt_system_bus ? G_BUS_TYPE_SYSTEM : G_BUS_TYPE_SESSION,
+                                 opt_name,
+                                 flags,
+                                 on_name_appeared,
+                                 on_name_vanished,
+                                 NULL,
+                                 NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (loop);
+
+  g_bus_unwatch_name (watcher_id);
+
+ out:
+  g_option_context_free (opt_context);
+  g_free (opt_name);
+
+  return 0;
+}
+
+ +
+


+

+
+
+

Details

+
+

GBusNameAppearedCallback ()

+
void                (*GBusNameAppearedCallback)         (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         const gchar *name_owner,
+                                                         gpointer user_data);
+

+Invoked when the name being watched is known to have to have a owner. +

+
++ + + + + + + + + + + + + + + + + + +

connection :

The GDBusConnection the name is being watched on. +

name :

The name being watched. +

name_owner :

Unique name of the owner of the name being watched. +

user_data :

User data passed to g_bus_watch_name(). +
+

Since 2.26

+
+
+
+

GBusNameVanishedCallback ()

+
void                (*GBusNameVanishedCallback)         (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         gpointer user_data);
+

+Invoked when the name being watched is known not to have to have a owner. +

+
++ + + + + + + + + + + + + + +

connection :

The GDBusConnection the name is being watched on. +

name :

The name being watched. +

user_data :

User data passed to g_bus_watch_name(). +
+

Since 2.26

+
+
+
+

enum GBusNameWatcherFlags

+
typedef enum
+{
+  G_BUS_NAME_WATCHER_FLAGS_NONE = 0,
+  G_BUS_NAME_WATCHER_FLAGS_AUTO_START = (1<<0)
+} GBusNameWatcherFlags;
+
+

+Flags used in g_bus_watch_name(). +

+
++ + + + + + + + + + +

G_BUS_NAME_WATCHER_FLAGS_NONE

No flags set. +

G_BUS_NAME_WATCHER_FLAGS_AUTO_START

If no-one owns the name when +beginning to watch the name, ask the bus to launch an owner for the +name. +
+

Since 2.26

+
+
+
+

g_bus_watch_name ()

+
guint               g_bus_watch_name                    (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GBusNameAppearedCallback name_appeared_handler,
+                                                         GBusNameVanishedCallback name_vanished_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+

+Starts watching name on the bus specified by bus_type and calls +name_appeared_handler and name_vanished_handler when the name is +known to have a owner respectively known to lose its +owner. Callbacks will be invoked in the thread-default main +loop of the thread you are calling this function from. +

+

+You are guaranteed that one of the handlers will be invoked after +calling this function. When you are done watching the name, just +call g_bus_unwatch_name() with the watcher id this function +returns. +

+

+If the name vanishes or appears (for example the application owning +the name could restart), the handlers are also invoked. If the +GDBusConnection that is used for watching the name disconnects, then +name_vanished_handler is invoked since it is no longer +possible to access the name. +

+

+Another guarantee is that invocations of name_appeared_handler +and name_vanished_handler are guaranteed to alternate; that +is, if name_appeared_handler is invoked then you are +guaranteed that the next time one of the handlers is invoked, it +will be name_vanished_handler. The reverse is also true. +

+

+This behavior makes it very simple to write applications that wants +to take action when a certain name exists, see Example 9, “Simple application watching a name”. Basically, the application +should create object proxies in name_appeared_handler and destroy +them again (if any) in name_vanished_handler. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

bus_type :

The type of bus to watch a name on. +

name :

The name (well-known or unique) to watch. +

flags :

Flags from the GBusNameWatcherFlags enumeration. +

name_appeared_handler :

Handler to invoke when name is known to exist or NULL. +

name_vanished_handler :

Handler to invoke when name is known to not exist or NULL. +

user_data :

User data to pass to handlers. +

user_data_free_func :

Function for freeing user_data or NULL. +

Returns :

An identifier (never 0) that an be used with +g_bus_unwatch_name() to stop watching the name. + +
+

Since 2.26

+
+
+
+

g_bus_watch_name_on_connection ()

+
guint               g_bus_watch_name_on_connection      (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GBusNameAppearedCallback name_appeared_handler,
+                                                         GBusNameVanishedCallback name_vanished_handler,
+                                                         gpointer user_data,
+                                                         GDestroyNotify user_data_free_func);
+

+Like g_bus_watch_name() but takes a GDBusConnection instead of a +GBusType. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

name :

The name (well-known or unique) to watch. +

flags :

Flags from the GBusNameWatcherFlags enumeration. +

name_appeared_handler :

Handler to invoke when name is known to exist or NULL. +

name_vanished_handler :

Handler to invoke when name is known to not exist or NULL. +

user_data :

User data to pass to handlers. +

user_data_free_func :

Function for freeing user_data or NULL. +

Returns :

An identifier (never 0) that an be used with +g_bus_unwatch_name() to stop watching the name. + +
+

Since 2.26

+
+
+
+

g_bus_unwatch_name ()

+
void                g_bus_unwatch_name                  (guint watcher_id);
+

+Stops watching a name. +

+
++ + + + +

watcher_id :

An identifier obtained from g_bus_watch_name() +
+

Since 2.26

+
+
+
+

g_bus_watch_name_with_closures ()

+
guint               g_bus_watch_name_with_closures      (GBusType bus_type,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GClosure *name_appeared_closure,
+                                                         GClosure *name_vanished_closure);
+

+Version of g_bus_watch_name() using closures instead of callbacks for +easier binding in other languages. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

bus_type :

The type of bus to watch a name on. +

name :

The name (well-known or unique) to watch. +

flags :

Flags from the GBusNameWatcherFlags enumeration. +

name_appeared_closure :

GClosure to invoke when name is known +to exist or NULL. [allow-none] +

name_vanished_closure :

GClosure to invoke when name is known +to not exist or NULL. [allow-none] +

Returns :

An identifier (never 0) that an be used with +g_bus_unwatch_name() to stop watching the name. + +Rename to: g_bus_watch_name + +
+

Since 2.26

+
+
+
+

g_bus_watch_name_on_connection_with_closures ()

+
guint               g_bus_watch_name_on_connection_with_closures
+                                                        (GDBusConnection *connection,
+                                                         const gchar *name,
+                                                         GBusNameWatcherFlags flags,
+                                                         GClosure *name_appeared_closure,
+                                                         GClosure *name_vanished_closure);
+

+Version of g_bus_watch_name_on_connection() using closures instead of callbacks for +easier binding in other languages. +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + +

connection :

A GDBusConnection. +

name :

The name (well-known or unique) to watch. +

flags :

Flags from the GBusNameWatcherFlags enumeration. +

name_appeared_closure :

GClosure to invoke when name is known +to exist or NULL. [allow-none] +

name_vanished_closure :

GClosure to invoke when name is known +to not exist or NULL. [allow-none] +

Returns :

An identifier (never 0) that an be used with +g_bus_unwatch_name() to stop watching the name. + +Rename to: g_bus_watch_name_on_connection + +
+

Since 2.26

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio-hierarchy.html b/docs/reference/gio/html/gio-hierarchy.html index de2bfc0..30ce2a3 100644 --- a/docs/reference/gio/html/gio-hierarchy.html +++ b/docs/reference/gio/html/gio-hierarchy.html @@ -3,17 +3,17 @@ Object Hierarchy - + - + - + - + @@ -23,8 +23,11 @@

Object Hierarchy

-    GObject
+    GObject
+        GSimpleAction
+        GSimpleActionGroup
         GAppLaunchContext
+        GApplication
         GInputStream
             GFilterInputStream
                 GBufferedInputStream
@@ -52,43 +55,62 @@
         GIOStream
             GFileIOStream
             GSocketConnection
-                GTcpConnection
-                GUnixConnection
+                GTcpConnection
+                    GTcpWrapperConnection
+                GUnixConnection
+            GTlsConnection
         GFileMonitor
         GFilenameCompleter
         GInetAddress
         GSocketAddress
             GInetSocketAddress
+                GProxyAddress
             GUnixSocketAddress
-        GTypeModule
+        GTypeModule
             GIOModule
         GMountOperation
         GVolumeMonitor
         GNetworkAddress
         GNetworkService
+        GPermission
+            GSimplePermission
+        GSocketAddressEnumerator
+            GProxyAddressEnumerator
         GResolver
+        GSettings
+        GSettingsBackend
         GSimpleAsyncResult
-        GSocketAddressEnumerator
         GSocketClient
         GSocketControlMessage
             GUnixFDMessage
+            GUnixCredentialsMessage
         GSocket
         GSocketListener
             GSocketService
                 GThreadedSocketService
         GThemedIcon
+        GTlsCertificate
         GUnixFDList
         GUnixMountMonitor
         GVfs
         GZlibCompressor
         GZlibDecompressor
+        GDBusMessage
+        GDBusConnection
+        GDBusProxy
+        GDBusMethodInvocation
+        GDBusServer
+        GDBusAuthObserver
+        GCredentials
+        GApplicationCommandLine
     GInterface
+        GAction
+        GActionGroup
         GAppInfo
         GAsyncInitable
         GAsyncResult
         GConverter
         GInitable
-        GDesktopAppInfoLookup
         GDrive
         GIcon
         GFileDescriptorBased
@@ -97,11 +119,18 @@
         GSeekable
         GSocketConnectable
         GMount
+        GPollableInputStream
+        GPollableOutputStream
+        GProxy
+        GProxyResolver
+        GTlsBackend
+        GTlsClientConnection
+        GTlsServerConnection
         GVolume
 
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/gio-querymodules.html b/docs/reference/gio/html/gio-querymodules.html new file mode 100644 index 0000000..5edad1d --- /dev/null +++ b/docs/reference/gio/html/gio-querymodules.html @@ -0,0 +1,53 @@ + + + + +gio-querymodules + + + + + + + + + + + + + + + + +
+
+
+ + +
+

gio-querymodules

+

gio-querymodules — GIO module cache creation

+
+
+

Synopsis

+

gio-querymodules {directory...}

+
+
+

Description

+

gio-querymodules creates a +giomodule.cache file in the listed directories. +This file lists the implemented extension points for each module +that has been found. It is used by GIO at runtime to avoid opening +all modules just to find out which extension points they are implementing. +

+

+GIO modules are usually installed in the gio/modules +subdirectory of libdir. +

+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gio.devhelp b/docs/reference/gio/html/gio.devhelp index a3dff97..136f920 100644 --- a/docs/reference/gio/html/gio.devhelp +++ b/docs/reference/gio/html/gio.devhelp @@ -20,6 +20,9 @@ + + + @@ -53,11 +56,13 @@ + + - + @@ -78,7 +83,7 @@ - + @@ -87,36 +92,106 @@ + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -126,6 +201,9 @@ + + + @@ -334,6 +412,8 @@ + + @@ -418,6 +498,7 @@ + @@ -456,6 +537,12 @@ + + + + + + @@ -463,6 +550,8 @@ + + @@ -487,6 +576,7 @@ + @@ -500,14 +590,17 @@ + + + @@ -521,10 +614,15 @@ + + + + + @@ -568,9 +666,12 @@ + + + @@ -619,6 +720,7 @@ + @@ -664,6 +766,9 @@ + + + @@ -704,6 +809,20 @@ + + + + + + + + + + + + + + @@ -739,6 +858,7 @@ + @@ -746,6 +866,8 @@ + + @@ -758,9 +880,6 @@ - - - @@ -873,7 +992,6 @@ - @@ -939,6 +1057,8 @@ + + @@ -978,9 +1098,11 @@ + + @@ -994,6 +1116,8 @@ + + @@ -1001,6 +1125,7 @@ + @@ -1009,6 +1134,7 @@ + @@ -1055,13 +1181,17 @@ + + + + @@ -1085,55 +1215,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1144,33 +1264,54 @@ + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + @@ -1196,12 +1337,583 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1231,5 +1943,9 @@ + + + + diff --git a/docs/reference/gio/html/gio.devhelp2 b/docs/reference/gio/html/gio.devhelp2 index ac1978d..f2d4c95 100644 --- a/docs/reference/gio/html/gio.devhelp2 +++ b/docs/reference/gio/html/gio.devhelp2 @@ -20,6 +20,9 @@ + + + @@ -53,11 +56,13 @@ + + - + @@ -78,7 +83,7 @@ - + @@ -87,36 +92,106 @@ + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -126,6 +201,9 @@ + + + @@ -334,6 +412,8 @@ + + @@ -418,6 +498,7 @@ + @@ -456,6 +537,12 @@ + + + + + + @@ -463,6 +550,8 @@ + + @@ -487,6 +576,7 @@ + @@ -494,20 +584,23 @@ - + + + + @@ -521,10 +614,15 @@ + + + + + @@ -568,9 +666,12 @@ + + + @@ -619,6 +720,7 @@ + @@ -664,6 +766,9 @@ + + + @@ -704,6 +809,20 @@ + + + + + + + + + + + + + + @@ -739,6 +858,7 @@ + @@ -746,6 +866,8 @@ + + @@ -758,9 +880,6 @@ - - - @@ -873,7 +992,6 @@ - @@ -939,6 +1057,8 @@ + + @@ -978,9 +1098,11 @@ + + @@ -994,6 +1116,8 @@ + + @@ -1001,6 +1125,7 @@ + @@ -1009,6 +1134,7 @@ + @@ -1055,13 +1181,17 @@ + - - + + + + + @@ -1085,55 +1215,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1144,33 +1264,54 @@ + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + @@ -1196,12 +1337,583 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1231,6 +1943,10 @@ + + + + @@ -1308,6 +2024,14 @@ + + + + + + + + @@ -1331,12 +2055,19 @@ + + + + + + + @@ -1347,6 +2078,7 @@ + @@ -1377,8 +2109,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/gio/html/glib-compile-schemas.html b/docs/reference/gio/html/glib-compile-schemas.html new file mode 100644 index 0000000..07bb535 --- /dev/null +++ b/docs/reference/gio/html/glib-compile-schemas.html @@ -0,0 +1,102 @@ + + + + +glib-compile-schemas + + + + + + + + + + + + + + + + +
+
+
+ + +
+

glib-compile-schemas

+

glib-compile-schemas — GSettings schema compiler

+
+
+

Synopsis

+

glib-compile-schemas [option...] {directory}

+
+
+

Description

+

glib-compile-schemas compiles all the GSettings XML +schema files in directory into a binary file +with the name gschemas.compiled that can be used +by GSettings. The XML schema +files must have the filename extension .gschema.xml. +For a detailed description of the XML file format, see the +GSettings documentation. +

+

+At runtime, GSettings looks for schemas in the +glib-2.0/schemas subdirectories of all directories +specified in the XDG_DATA_DIRS environment variable. The +usual location to install schema files is +/usr/share/glib-2.0/schemas. +

+

+In addition to schema files, glib-compile-schemas reads 'vendor override' +files, which are key files that can override default values for keys in +the schemas. The group names in the key files are the schema id, and the +values are written in serialized GVariant form. +

+
+

Options

+
++ + + + + + + + + + + + + + + + + + +

-h, --help

+Print help and exit +

--targetdir=TARGETDIR

+Store gschemas.compiled in TARGETDIR instead of directory. +

--dry-run

+Don't write gschemas.compiled. This option can be used +to check .gschema.xml sources for errors. +

--allow-any-name

+Do not enforce restrictions on key names. Note that this option is purely +to facility the transition from GConf, and will be removed at some time +in the future. +

+
+
+
+

See also

+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/gsettings.html b/docs/reference/gio/html/gsettings.html new file mode 100644 index 0000000..d778c21 --- /dev/null +++ b/docs/reference/gio/html/gsettings.html @@ -0,0 +1,129 @@ + + + + +gsettings + + + + + + + + + + + + + + + + +
+
+
+ + +
+

gsettings

+

gsettings — GSettings configuration tool

+
+
+

Synopsis

+

gsettings get [option...] {schema} {key}

+

gsettings monitor [option...] {schema} {key}

+

gsettings writable [option...] {schema} {key}

+

gsettings set [option...] {schema} {key} {value}

+

gsettings help

+
+
+

Description

+

gsettings offers a simple commandline +interface to GSettings. +It lets you get, set or monitor an individual key for changes. +

+

+The schema and key +arguments are required to specify the schema id and the name of the key +to operate on. +

+

+When setting a key, you also need specify a value +The format for the value is that of a serialized +GVariant, +so e.g. a string +must include explicit quotes: "'foo'". This format is also used when printing +out values. +

+
+

Commands

+
++ + + + + + + + + + + + + + + + + + + + + + +

get

+Get the value of key. The value is printed out +as a serialised +GVariant. +

monitor

+Monitor key for changes and print the changed +values. Monitoring will continue until the process is terminated. +

writable

+Find out whether key is writable. +

set

+Set the value of key to value. +The value is specified as a serialised +GVariant. +

help

+Print help and exit +

+
+
+
+

Options

+
++ + + + + + + + + + +

-h, --help

+Print help for the command and exit +

-p path, --path=path

+The path for the schema. This option is only needed if the schema +does not have a fixed path. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/highlevel-socket.html b/docs/reference/gio/html/highlevel-socket.html index 6a320e8..5ff182d 100644 --- a/docs/reference/gio/html/highlevel-socket.html +++ b/docs/reference/gio/html/highlevel-socket.html @@ -3,17 +3,17 @@ Highlevel network functionallity - + - + - + - + @@ -30,6 +30,15 @@ GSocketConnection — A socket connection
+GUnixConnection — A UNIX domain GSocketConnection +
+
+GTcpConnection — A TCP GSocketConnection +
+
+GTcpWrapperConnection — wrapper for non-GSocketConnection-based, GSocket-based GIOStreams +
+
GSocketListener — Helper for accepting network client connections
@@ -42,6 +51,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/icons.html b/docs/reference/gio/html/icons.html index 2cff8e7..e6eed21 100644 --- a/docs/reference/gio/html/icons.html +++ b/docs/reference/gio/html/icons.html @@ -3,12 +3,12 @@ Icons - + - + @@ -45,6 +45,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/index.html b/docs/reference/gio/html/index.html index 8ab937a..5d8099b 100644 --- a/docs/reference/gio/html/index.html +++ b/docs/reference/gio/html/index.html @@ -3,10 +3,10 @@ GIO Reference Manual - + - + @@ -15,7 +15,7 @@

- for GIO 2.24.2 + for GIO 2.27.5 The latest version of this documentation can be found on-line at http://library.gnome.org/devel/gio/unstable/. @@ -58,6 +58,10 @@

GFileMonitor — File Monitor
+
File-related Utilities
+
+GFilenameCompleter — Filename Completer +
Asynchronous I/O
@@ -142,7 +146,7 @@ GUnixInputStream — Streaming input operations for UNIX file descriptors
-GUnixOutputStream — Streaming output operations for Unix file descriptors +GUnixOutputStream — Streaming output operations for UNIX file descriptors
GConverterInputstream — Converter Input Stream @@ -150,6 +154,12 @@
GConverterOutputstream — Converter Output Stream
+
+GPollableInputStream — Interface for pollable input streams +
+
+GPollableOutputStream — Interface for pollable output streams +
File types and applications
@@ -160,7 +170,7 @@ GAppInfo — Application information and launch contexts
-Desktop file based GAppInfo — Application information from desktop files +GDesktopAppInfo — Application information from desktop files
Volumes and Drives
@@ -178,7 +188,7 @@ GDrive — Drive management
-Unix Mounts — Unix Mounts +Unix Mounts — UNIX mounts
Icons
@@ -211,7 +221,7 @@ GAsyncInitable — Asynchronously failable object initialization interface -
Lowlevel platform-independent network support
+
Lowlevel network support
GSocket — Low-level socket object @@ -233,10 +243,70 @@ socket communication GSocketControlMessage — A GSocket control message
-GUnixFDList — An object containing a set of file descriptors +GUnixFDList — An object containing a set of UNIX file descriptors +
+
+GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList +
+
+GCredentials — An object containing credentials +
+
+GUnixCredentialsMessage — A GSocketControlMessage containing credentials +
+
+GProxy — Interface for proxy handling +
+
+GProxyAddress — An internet address with proxy information +
+
+
Highlevel network functionallity
+
+
+GSocketClient — Helper for connecting to a network service +
+
+GSocketConnection — A socket connection +
+
+GUnixConnection — A UNIX domain GSocketConnection +
+
+GTcpConnection — A TCP GSocketConnection
-GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList +GTcpWrapperConnection — wrapper for non-GSocketConnection-based, GSocket-based GIOStreams +
+
+GSocketListener — Helper for accepting network client connections +
+
+GSocketService — Make it easy to implement a network service +
+
+GThreadedSocketService — A threaded GSocketService +
+
+
TLS (SSL) support
+
+
+TLS Overview — TLS (aka SSL) support for GSocketConnection +
+
+GTlsCertificate — TLS certificate +
+
+GTlsConnection — TLS connection type +
+
+GTlsClientConnection — TLS client-side connection +
+
+GTlsServerConnection — TLS server-side connection +
+
+GTlsBackend — TLS backend implementation
DNS resolution
@@ -245,6 +315,9 @@ socket communication GResolver — Asynchronous and cancellable DNS resolver
+GProxyResolver — Asynchronous and cancellable network proxy resolver +
+
GSocketConnectable — Interface for potential socket endpoints
@@ -257,28 +330,88 @@ socket communication GSrvTarget — DNS SRV record target
-
Highlevel network functionallity
+
Lowlevel D-Bus Support
-GSocketClient — Helper for connecting to a network service +D-Bus Utilities — Various utilities related to D-Bus.
-GSocketConnection — A socket connection +D-Bus Addresses — D-Bus connection endpoints
-GSocketListener — Helper for accepting network client connections +D-Bus Introspection Data — Node and interface description data structures
-GSocketService — Make it easy to implement a network service +GDBusError — Mapping D-Bus errors to and from GError
-GThreadedSocketService — A threaded GSocketService +GDBusMessage — D-Bus Message +
+
+GDBusConnection — D-Bus Connections +
+
+GDBusMethodInvocation — Object for handling remote calls +
+
+GDBusServer — Helper for accepting connections +
+
+GDBusAuthObserver — Object used for authenticating connections +
+
+
Highlevel D-Bus Support
+
+
+Owning Bus Names — Simple API for owning bus names +
+
+Watching Bus Names — Simple API for watching bus names +
+
+GDBusProxy — Client-side proxies +
+
+
Settings
+
+
+GSettings — High-level API for application settings +
+
+GSettingsBackend — Interface for settings backend implementations +
+
+
Permissions
+
+
+GPermission — An object representing the permission to perform + a certain action +
+
+GSimplePermission — A GPermission that doesn't change value +
+
+
Application support
+
+
+GActionGroup — A group of actions +
+
+GSimpleActionGroup — A simple GActionGroup implementation +
+
+GAction — An action +
+
+GSimpleAction — A simple GSimpleAction +
+
+GApplication — Core application class +
+
+GApplicationCommandLine — A command-line invocation of an application
-
Utilities
-
-GFilenameCompleter — Filename Completer -
Extending GIO
@@ -291,15 +424,48 @@ socket communication Extension Points — Extension Points
+
GIO Tools
+
+
+gio-querymodules — GIO module cache creation +
+
+gsettings — GSettings configuration tool +
+
+glib-compile-schemas — GSettings schema compiler +
+
+gdbus — Introspect and call remote objects +
+
III. Migrating to GIO
-
Migrating from POSIX to GIO
-
Migrating from GnomeVFS to GIO
+
Migrating from GnomeVFS to GIO
+
+
Trash handling
+
Operations on multiple files
+
Mime monitoring
+
+
Migrating from GConf to GSettings
+
+
Before you start
+
Conceptual differences
+
GConfClient (and GConfBridge) API conversion
+
Change notification
+
Change sets
+
Schema conversion
+
Data conversion
+
+
Migrating to GDBus
-
Trash handling
-
Operations on multiple files
-
Mime monitoring
+
Conceptual differences
+
API comparison
+
Owning bus names
+
Creating proxies for well-known names
+
Client-side GObject bindings
+
Exporting objects
Object Hierarchy
@@ -309,10 +475,13 @@ socket communication
Index of new symbols in 2.20
Index of new symbols in 2.22
Index of new symbols in 2.24
+
Index of new symbols in 2.26
+
Index of new symbols in 2.28
+
Annotation Glossary
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/index.sgml b/docs/reference/gio/html/index.sgml index 675513f..8b0976f 100644 --- a/docs/reference/gio/html/index.sgml +++ b/docs/reference/gio/html/index.sgml @@ -1,3 +1,4 @@ + @@ -262,6 +263,8 @@ + + @@ -393,7 +396,16 @@ + + + + + + + + + @@ -469,6 +481,19 @@ + + + + + + + + + + + + + @@ -482,6 +507,8 @@ + + @@ -525,6 +552,7 @@ + @@ -538,11 +566,13 @@ + + @@ -558,6 +588,10 @@ + + + + @@ -590,7 +624,10 @@ + + + @@ -602,7 +639,9 @@ + + @@ -622,6 +661,7 @@ + @@ -642,6 +682,7 @@ + @@ -673,9 +714,16 @@ + + + + + + + @@ -782,6 +830,7 @@ + @@ -858,6 +907,9 @@ + + + @@ -889,6 +941,7 @@ + @@ -904,6 +957,7 @@ + @@ -942,6 +996,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -969,6 +1053,7 @@ + @@ -992,6 +1077,7 @@ + @@ -999,6 +1085,8 @@ + + @@ -1007,9 +1095,7 @@ - - @@ -1020,9 +1106,6 @@ - - - @@ -1129,6 +1212,7 @@ + @@ -1183,7 +1267,6 @@ - @@ -1283,6 +1366,7 @@ + @@ -1290,6 +1374,9 @@ + + + @@ -1330,6 +1417,7 @@ + @@ -1378,9 +1466,11 @@ + + @@ -1394,6 +1484,8 @@ + + @@ -1401,6 +1493,7 @@ + @@ -1410,6 +1503,7 @@ + @@ -1491,14 +1585,23 @@ + + + + + + + + + @@ -1542,92 +1645,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1635,6 +1719,7 @@ + @@ -1645,24 +1730,37 @@ + + + + + + + + + + + + + + + - - @@ -1671,19 +1769,47 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1735,19 +1861,951 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1793,3 +2851,15 @@ + + + + + + + + + + + + diff --git a/docs/reference/gio/html/migrating.html b/docs/reference/gio/html/migrating.html index 9249b0d..50ea654 100644 --- a/docs/reference/gio/html/migrating.html +++ b/docs/reference/gio/html/migrating.html @@ -3,21 +3,21 @@ Part III. Migrating to GIO - + - - - + + + - + - +
\ No newline at end of file diff --git a/docs/reference/gio/html/networking.html b/docs/reference/gio/html/networking.html index bdc4591..eeae5ab 100644 --- a/docs/reference/gio/html/networking.html +++ b/docs/reference/gio/html/networking.html @@ -2,13 +2,13 @@ -Lowlevel platform-independent network support - +Lowlevel network support + - + @@ -19,9 +19,9 @@ GIO Reference Manual Next -
+

-Lowlevel platform-independent network support

+Lowlevel network support
GSocket — Low-level socket object @@ -43,15 +43,27 @@ socket communication GSocketControlMessage — A GSocket control message
-GUnixFDList — An object containing a set of file descriptors +GUnixFDList — An object containing a set of UNIX file descriptors
-GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList +GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList +
+
+GCredentials — An object containing credentials +
+
+GUnixCredentialsMessage — A GSocketControlMessage containing credentials +
+
+GProxy — Interface for proxy handling +
+
+GProxyAddress — An internet address with proxy information
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/permissions.html b/docs/reference/gio/html/permissions.html new file mode 100644 index 0000000..fc56ec6 --- /dev/null +++ b/docs/reference/gio/html/permissions.html @@ -0,0 +1,39 @@ + + + + +Permissions + + + + + + + + + + + + + + + + +
+

+Permissions

+
+
+GPermission — An object representing the permission to perform + a certain action +
+
+GSimplePermission — A GPermission that doesn't change value +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/pt01.html b/docs/reference/gio/html/pt01.html index 4e2985a..f44ca3e 100644 --- a/docs/reference/gio/html/pt01.html +++ b/docs/reference/gio/html/pt01.html @@ -3,12 +3,12 @@ Part I. GIO Overview - + - + @@ -21,7 +21,7 @@

-Part I. GIO Overview

+Part I. GIO Overview

Table of Contents

@@ -34,6 +34,6 @@
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/pt02.html b/docs/reference/gio/html/pt02.html index e738913..beba82d 100644 --- a/docs/reference/gio/html/pt02.html +++ b/docs/reference/gio/html/pt02.html @@ -3,12 +3,12 @@ Part II. API Reference - + - + @@ -21,7 +21,7 @@

-Part II. API Reference

+Part II. API Reference

Table of Contents

@@ -50,6 +50,10 @@
GFileMonitor — File Monitor
+
File-related Utilities
+
+GFilenameCompleter — Filename Completer +
Asynchronous I/O
@@ -134,7 +138,7 @@ GUnixInputStream — Streaming input operations for UNIX file descriptors
-GUnixOutputStream — Streaming output operations for Unix file descriptors +GUnixOutputStream — Streaming output operations for UNIX file descriptors
GConverterInputstream — Converter Input Stream @@ -142,6 +146,12 @@
GConverterOutputstream — Converter Output Stream
+
+GPollableInputStream — Interface for pollable input streams +
+
+GPollableOutputStream — Interface for pollable output streams +
File types and applications
@@ -152,7 +162,7 @@ GAppInfo — Application information and launch contexts
-Desktop file based GAppInfo — Application information from desktop files +GDesktopAppInfo — Application information from desktop files
Volumes and Drives
@@ -170,7 +180,7 @@ GDrive — Drive management
-Unix Mounts — Unix Mounts +Unix Mounts — UNIX mounts
Icons
@@ -203,7 +213,7 @@ GAsyncInitable — Asynchronously failable object initialization interface -
Lowlevel platform-independent network support
+
Lowlevel network support
GSocket — Low-level socket object @@ -225,10 +235,70 @@ socket communication GSocketControlMessage — A GSocket control message
-GUnixFDList — An object containing a set of file descriptors +GUnixFDList — An object containing a set of UNIX file descriptors +
+
+GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList +
+
+GCredentials — An object containing credentials +
+
+GUnixCredentialsMessage — A GSocketControlMessage containing credentials +
+
+GProxy — Interface for proxy handling +
+
+GProxyAddress — An internet address with proxy information +
+
+
Highlevel network functionallity
+
+
+GSocketClient — Helper for connecting to a network service +
+
+GSocketConnection — A socket connection +
+
+GUnixConnection — A UNIX domain GSocketConnection +
+
+GTcpConnection — A TCP GSocketConnection +
+
+GTcpWrapperConnection — wrapper for non-GSocketConnection-based, GSocket-based GIOStreams +
+
+GSocketListener — Helper for accepting network client connections
-GUnixFDMessage — A GSocketControlMessage containing a GUnixFDList +GSocketService — Make it easy to implement a network service +
+
+GThreadedSocketService — A threaded GSocketService +
+
+
TLS (SSL) support
+
+
+TLS Overview — TLS (aka SSL) support for GSocketConnection +
+
+GTlsCertificate — TLS certificate +
+
+GTlsConnection — TLS connection type +
+
+GTlsClientConnection — TLS client-side connection +
+
+GTlsServerConnection — TLS server-side connection +
+
+GTlsBackend — TLS backend implementation
DNS resolution
@@ -237,6 +307,9 @@ socket communication GResolver — Asynchronous and cancellable DNS resolver
+GProxyResolver — Asynchronous and cancellable network proxy resolver +
+
GSocketConnectable — Interface for potential socket endpoints
@@ -249,28 +322,88 @@ socket communication GSrvTarget — DNS SRV record target
-
Highlevel network functionallity
+
Lowlevel D-Bus Support
-GSocketClient — Helper for connecting to a network service +D-Bus Utilities — Various utilities related to D-Bus.
-GSocketConnection — A socket connection +D-Bus Addresses — D-Bus connection endpoints
-GSocketListener — Helper for accepting network client connections +D-Bus Introspection Data — Node and interface description data structures
-GSocketService — Make it easy to implement a network service +GDBusError — Mapping D-Bus errors to and from GError
-GThreadedSocketService — A threaded GSocketService +GDBusMessage — D-Bus Message +
+
+GDBusConnection — D-Bus Connections +
+
+GDBusMethodInvocation — Object for handling remote calls +
+
+GDBusServer — Helper for accepting connections +
+
+GDBusAuthObserver — Object used for authenticating connections +
+
+
Highlevel D-Bus Support
+
+
+Owning Bus Names — Simple API for owning bus names +
+
+Watching Bus Names — Simple API for watching bus names +
+
+GDBusProxy — Client-side proxies +
+
+
Settings
+
+
+GSettings — High-level API for application settings +
+
+GSettingsBackend — Interface for settings backend implementations +
+
+
Permissions
+
+
+GPermission — An object representing the permission to perform + a certain action +
+
+GSimplePermission — A GPermission that doesn't change value +
+
+
Application support
+
+
+GActionGroup — A group of actions +
+
+GSimpleActionGroup — A simple GActionGroup implementation +
+
+GAction — An action +
+
+GSimpleAction — A simple GSimpleAction +
+
+GApplication — Core application class +
+
+GApplicationCommandLine — A command-line invocation of an application
-
Utilities
-
-GFilenameCompleter — Filename Completer -
Extending GIO
@@ -283,11 +416,26 @@ socket communication Extension Points — Extension Points
+
GIO Tools
+
+
+gio-querymodules — GIO module cache creation +
+
+gsettings — GSettings configuration tool +
+
+glib-compile-schemas — GSettings schema compiler +
+
+gdbus — Introspect and call remote objects +
+
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/resolver.html b/docs/reference/gio/html/resolver.html index 9746d4f..0e97408 100644 --- a/docs/reference/gio/html/resolver.html +++ b/docs/reference/gio/html/resolver.html @@ -3,17 +3,17 @@ DNS resolution - + - + - + - + @@ -27,6 +27,9 @@ GResolver — Asynchronous and cancellable DNS resolver
+GProxyResolver — Asynchronous and cancellable network proxy resolver +
+
GSocketConnectable — Interface for potential socket endpoints
@@ -42,6 +45,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/settings.html b/docs/reference/gio/html/settings.html new file mode 100644 index 0000000..ba95ec9 --- /dev/null +++ b/docs/reference/gio/html/settings.html @@ -0,0 +1,38 @@ + + + + +Settings + + + + + + + + + +
+ + + + + + +
+

+Settings

+
+
+GSettings — High-level API for application settings +
+
+GSettingsBackend — Interface for settings backend implementations +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/streaming.html b/docs/reference/gio/html/streaming.html index 1fc0978..7e23cba 100644 --- a/docs/reference/gio/html/streaming.html +++ b/docs/reference/gio/html/streaming.html @@ -3,12 +3,12 @@ Streaming I/O - + - + @@ -75,7 +75,7 @@ GUnixInputStream — Streaming input operations for UNIX file descriptors
-GUnixOutputStream — Streaming output operations for Unix file descriptors +GUnixOutputStream — Streaming output operations for UNIX file descriptors
GConverterInputstream — Converter Input Stream @@ -83,10 +83,16 @@
GConverterOutputstream — Converter Output Stream
+
+GPollableInputStream — Interface for pollable input streams +
+
+GPollableOutputStream — Interface for pollable output streams +
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/gio/html/style.css b/docs/reference/gio/html/style.css index 82115eb..d544a2c 100644 --- a/docs/reference/gio/html/style.css +++ b/docs/reference/gio/html/style.css @@ -209,6 +209,14 @@ h2 .extralinks, h3 .extralinks font-weight: normal; } +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-size: 80%; + font-weight: normal; +} + /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ diff --git a/docs/reference/gio/html/tls.html b/docs/reference/gio/html/tls.html new file mode 100644 index 0000000..1386bbb --- /dev/null +++ b/docs/reference/gio/html/tls.html @@ -0,0 +1,50 @@ + + + + +TLS (SSL) support + + + + + + + + + + + + + + + + +
+

+TLS (SSL) support

+
+
+TLS Overview — TLS (aka SSL) support for GSocketConnection +
+
+GTlsCertificate — TLS certificate +
+
+GTlsConnection — TLS connection type +
+
+GTlsClientConnection — TLS client-side connection +
+
+GTlsServerConnection — TLS server-side connection +
+
+GTlsBackend — TLS backend implementation +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/tools.html b/docs/reference/gio/html/tools.html new file mode 100644 index 0000000..b0280c6 --- /dev/null +++ b/docs/reference/gio/html/tools.html @@ -0,0 +1,44 @@ + + + + +GIO Tools + + + + + + + + + + + + + + + + +
+

+GIO Tools

+
+
+gio-querymodules — GIO module cache creation +
+
+gsettings — GSettings configuration tool +
+
+glib-compile-schemas — GSettings schema compiler +
+
+gdbus — Introspect and call remote objects +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/gio/html/types.html b/docs/reference/gio/html/types.html index 073e2a0..8307a74 100644 --- a/docs/reference/gio/html/types.html +++ b/docs/reference/gio/html/types.html @@ -3,17 +3,17 @@ File types and applications - + - + - + - + @@ -30,12 +30,12 @@ GAppInfo — Application information and launch contexts
-Desktop file based GAppInfo — Application information from desktop files +GDesktopAppInfo — Application information from desktop files
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/utils.html b/docs/reference/gio/html/utils.html index 31b86c4..b6b37a1 100644 --- a/docs/reference/gio/html/utils.html +++ b/docs/reference/gio/html/utils.html @@ -2,32 +2,32 @@ -Utilities - +File-related Utilities + - + - + - + -
+

-Utilities

+File-related Utilities
GFilenameCompleter — Filename Completer
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/html/volume_mon.html b/docs/reference/gio/html/volume_mon.html index 81fa5a0..03476e9 100644 --- a/docs/reference/gio/html/volume_mon.html +++ b/docs/reference/gio/html/volume_mon.html @@ -3,12 +3,12 @@ Volumes and Drives - + - + - + @@ -36,12 +36,12 @@ GDrive — Drive management
-Unix Mounts — Unix Mounts +Unix Mounts — UNIX mounts
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gio/migrating-gconf.xml b/docs/reference/gio/migrating-gconf.xml new file mode 100644 index 0000000..44d455b --- /dev/null +++ b/docs/reference/gio/migrating-gconf.xml @@ -0,0 +1,517 @@ + + Migrating from GConf to GSettings + +
+ Before you start + + + Converting individual applications and their settings from GConf to + GSettings can be done at will. But desktop-wide settings like font or + theme settings often have consumers in multiple modules. Therefore, + some consideration has to go into making sure that all users of a setting + are converted to GSettings at the same time or that the program + responsible for configuring that setting continues to update the value in + both places. + + + It is always a good idea to have a look at how others have handled + similar problems before. An examplaric conversion can be found e.g. + in the gsettings-tutorial branch of gnome-utils. + +
+ +
+ Conceptual differences + + + Conceptually, GConf and GSettings are fairly similar. Both + have a concept of pluggable backends. Both keep information + about keys and their types in schemas. Both have a concept of + mandatory values, which lets you implement lock-down. + + + There are some differences in the approach to schemas. GConf + installs the schemas into the database and has API to handle + schema information (gconf_client_get_default_from_schema(), + gconf_value_get_schema(), etc). GSettings on the other hand + assumes that an application knows its own schemas, and does + not provide API to handle schema information at runtime. + GSettings is also more strict about requiring a schema whenever + you want to read or write a key. To deal with more free-form + information that would appear in schema-less entries in GConf, + GSettings allows for schemas to be 'relocatable'. + + + One difference in the way applications interact with their + settings is that with GConf you interact with a tree of + settings (ie the keys you pass to functions when reading + or writing values are actually paths with the actual name + of the key as the last element. With GSettings, you create + a GSettings object which has an implicit prefix that determines + where the settings get stored in the global tree of settings, + but the keys you pass when reading or writing values are just + the key names, not the full path. + +
+ +
+ GConfClient (and GConfBridge) API conversion + + + Most people use GConf via the high-level #GConfClient API. + The corresponding API is the #GSettings object. While not + every GConfClient function has a direct GSettings equivalent, + many do: + + + + GConfClientGSettings + + + gconf_client_get_default()no direct equivalent, + instead you call g_settings_new() for the schemas you use + gconf_client_set()g_settings_set() + gconf_client_get()g_settings_get() + gconf_client_get_bool()g_settings_get_boolean() + gconf_client_set_bool()g_settings_set_boolean() + gconf_client_get_int()g_settings_get_int() + gconf_client_set_int()g_settings_set_int() + gconf_client_get_float()g_settings_get_double() + gconf_client_set_float()g_settings_set_double() + gconf_client_get_string()g_settings_get_string() + gconf_client_set_string()g_settings_set_string() + gconf_client_get_list()for string lists, see g_settings_get_strv(), else see g_settings_get_value() and #GVariant API + gconf_client_set_list()for string lists, see g_settings_set_strv(), else see g_settings_set_value() and #GVariant API + gconf_entry_get_is_writable()g_settings_is_writable() + gconf_client_notify_add()not required, the #GSettings::changed signal is emitted automatically + gconf_client_add_dir()not required, each GSettings instance automatically watches all keys in its path + #GConfChangeSetg_settings_delay(), g_settings_apply() + gconf_client_get_default_from_schema()no equivalent, applications are expected to know their schema + gconf_client_all_entries()no equivalent, applications are expected to know their schema, and GSettings does not allow schema-less entries + gconf_client_get_without_default()no equivalent + gconf_bridge_bind_property()g_settings_bind() + gconf_bridge_bind_property_full()g_settings_bind_with_mapping() + + +
+
+ + GConfBridge was a third-party library that used GConf to bind an object property + to a particular configuration key. GSettings offers this service itself. + + + There is a pattern that is sometimes used for GConf, where a setting can have + explicit 'value A', explicit 'value B' or 'use the system default'. With GConf, + 'use the system default' is sometimes implemented by unsetting the user value. + + + This is not possible in GSettings, since it does not have API to determine if a value + is the default and does not let you unset values. The recommended way (and much + clearer) way in which this can be implemented in GSettings is to have a separate + 'use-system-default' boolean setting. + +
+ +
+ Change notification + + + GConf requires you to call gconf_client_add_dir() and + gconf_client_notify_add() to get change notification. With + GSettings, this is not necessary; signals get emitted automatically + for every change. + + + The #GSettings::changed signal is emitted for each changed key. + There is also a #GSettings::change-event signal that you can handle + if you need to see groups of keys that get changed at the same time. + + + GSettings also notifies you about changes in writability of keys, + with the #GSettings::writable-changed signal (and the + #GSettings::writable-change-event signal). + +
+ +
Change sets + + GConf has a a concept of a set of changes which can be applied or reverted + at once: #GConfChangeSet (GConf doesn't actually apply changes atomically, + which is one of its shortcomings). + + + Instead of a separate object to represent a change set, GSettings has a + 'delayed-apply' mode, which can be turned on for a GSettings object by + calling g_settings_delay(). In this mode, changes done to the GSettings + object are not applied - they are still visible when calling g_settings_get() + on the same object, but not to other GSettings instances + or even other processes. + + + To apply the pending changes all at once (GSettings does + atomicity here), call g_settings_apply(). To revert the pending changes, + call g_settings_revert() or just drop the reference to the #GSettings object. + +
+ +
+ Schema conversion + + + If you are porting your application from GConf, most likely you already + have a GConf schema. GConf comes with a commandline tool + gsettings-schema-convert + that can help with the task of converting a GConf schema into + an equivalent GSettings schema. The tool is not perfect and + may need assistence in some cases. + + An example for using gsettings-schema-convert + Running gsettings-schema-convert --gconf --xml --schema-id "org.gnome.font-rendering" --output org.gnome.font-rendering.gschema.xml destop_gnome_font_rendering.schemas on the following desktop_gnome_font_rendering.schemas file: + + + + + + /schemas/desktop/gnome/font_rendering/dpi + /desktop/gnome/font_rendering/dpi + gnome + int + 96 + + DPI + The resolution used for converting font sizes to pixel sizes, in dots per inch. + + + + +]]> + +produces a org.gnome.font-rendering.gschema.xml file with the following content: + + + + + 96 + DPI + The resolution used for converting font sizes to pixel sizes, in dots per inch. + + + +]]> + + + + + + GSettings schemas are identified at runtime by their id (as specified + in the XML source file). It is recommended to use a dotted name as schema + id, similar in style to a DBus bus name, e.g. "org.gnome.font-rendering". + The filename used for the XML schema source is immaterial, but + schema compiler expects the files to have the extension + .gschema.xml. It is recommended to simply + use the schema id as the filename, followed by this extension, + e.g. org.gnome.font-rendering.gschema.xml. + + + + The XML source file for your GSettings schema needs to get installed + into $datadir/glib-2.0/schemas, and needs to be + compiled into a binary form. At runtime, GSettings looks for compiled + schemas in the glib-2.0/schemas subdirectories + of all XDG_DATA_DIRS directories, so if you install + your schema in a different location, you need to set the + XDG_DATA_DIRS environment variable appropriately. + + + Schemas are compiled into binary form by the + glib-compile-schemas utility. + GIO provides a glib_compile_schemas + variable for the schema compiler. + + + You can ignore all of this by using the provided m4 macros. To + do this, add to your configure.ac: + +GLIB_GSETTINGS + + The corresponding Makefile.am fragment looks like + this: + +# gsettings_SCHEMAS is a list of all the schemas you want to install +gsettings_SCHEMAS = my.app.gschema.xml + +# include the appropriate makefile rules for schema handling +@GSETTINGS_RULES@ + + + + + This is not sufficient on its own. You need to mention what the source + of the my.app.gschema.xml file is. If the schema + file is distributed directly with your project's tarball then a mention + in EXTRA_DIST is appropriate. If the schema file is + generated from another source then you will need the appropriate rule + for that, plus probably an item in EXTRA_DIST for the + source files used by that rule. + + + + One possible pitfall in doing schema conversion is that the default + values in GSettings schemas are parsed by the #GVariant parser. + This means that strings need to include quotes in the XML. Also note + that the types are now specified as #GVariant type strings. + +string +rgb +]]> + + becomes + + + 'rgb' + +]]> + + + + Another possible complication is that GConf specifies full paths + for each key, while a GSettings schema has a 'path' attribute that + contains the prefix for all the keys in the schema, and individual + keys just have a simple name. So + +/schemas/desktop/gnome/font_rendering/antialiasing +]]> + + becomes + + + +]]> + + + + Default values can be localized in both GConf and GSettings schemas, + but GSettings uses gettext for the localization. You can specify + the gettext domain to use in the gettext-domain + attribute. Therefore, when converting localized defaults in GConf, + +/schemas/apps/my_app/font_size + + 18 + + + 24 + + +]]> + + becomes + + + ... + + 18 + +]]> + + + + GSettings uses gettext for translation of default values. + The string that is translated is exactly the string that appears + inside of the default element. This + includes the quotation marks that appear around strings. + Default values must be marked with the l10n + attribute in the default tag, which + should be set as equal to 'messages' or + 'time' depending on the desired category. An + optional translation context can also be specified with the + context attribute, as in the example. This + is usually recommended, since the string "18" + is not particularly easy to translate without context. The + translated version of the default value should be stored in the + specified gettext-domain. Care must be taken + during translation to ensure that all translated values remain + syntactically valid; mistakes here will cause runtime errors. + + + GSettings schemas have optional summary and + description elements for each key which + correspond to the short and + long elements in the GConf schema and + will be used in similar ways by a future gsettings-editor, so you + should use the same conventions for them: The summary is just a short + label with no punctuation, the description can be one or more complete + sentences. If multiple paragraphs are desired for the description, the + paragraphs should be separated by a completely empty line. + + + Translations for these strings will also be handled + via gettext, so you should arrange for these strings to be + extracted into your gettext catalog. One way to do that is to use + intltool. For that, you use _summary + and _description elements in a + .gschema.xml.in file and use + @INTLTOOL_XML_NOMERGE_RULE@ + in your Makefile.am to produce the .gschema.xml file. The + NOMERGE part of the rule instructs intltool + to extract translatable strings, but not merge the translations + back into the generated xml file. + + + GSettings is a bit more restrictive about key names than GConf. Key + names in GSettings can be at most 32 characters long, and must only + consist of lowercase characters, numbers and dashes, with no + consecutive dashes. The first character must not be a number or dash, + and the last character cannot be '-'. + + + If you are using the GConf backend for GSettings during the + transition, you may want to keep your key names the same they + were in GConf, so that existing settings in the users GConf + database are preserved. You can achieve this by using the + with the + glib-compile-schemas schema + compiler. Note that this option is only meant + to ease the process of porting your application, allowing parts + of your application to continue to access GConf and parts to use + GSettings. By the time you have finished porting your application + you must ensure that all key names are valid. + +
+ +
Data conversion + + GConf comes with a GSettings backend that can be used to + facility the transition to the GSettings API until you are + ready to make the jump to a different backend (most likely + dconf). To use it, you need to set the GSETTINGS_BACKEND + to 'gconf', e.g. by using + + g_setenv ("GSETTINGS_BACKEND", "gconf", TRUE); + + early on in your program. Note that this backend is meant purely + as a transition tool, and should not be used in production. + + + GConf also comes with a utility called + gsettings-data-convert, which is designed to help + with the task of migrating user settings from GConf into another + GSettings backend. It can be run manually, but it is designed to be + executed automatically, every time a user logs in. It keeps track of + the data migrations that it has already done, and it is harmless to + run it more than once. + + + To make use of this utility, you must install a keyfile in the + directory /usr/share/GConf/gsettings which + lists the GSettings keys and GConf paths to map to each other, for + each schema that you want to migrate user data for. + + + Here is an example: + + + + The last key demonstrates that it may be necessary to modify the key + name to comply with stricter GSettings key name rules. Of course, + that means your application must use the new key names when looking + up settings in GSettings. + + + The last group in the example also shows how to handle the case + of 'relocatable' schemas, which don't have a fixed path. You can + specify the path to use in the group name, separated by a colon. + + + There are some limitations: gsettings-data-convert + does not do any transformation of the values. And it does not handle + complex GConf types other than lists of strings or integers. + + + Don't forget to require GConf 2.31.1 or newer in your configure + script if you are making use of the GConf backend or the conversion + utility. + + + + If, as an application developer, you are interested in manually + ensuring that gsettings-data-convert has been + invoked (for example, to deal with the case where the user is + logged in during a distribution upgrade or for non-XDG desktop + environments which do not run the command as an autostart) you + may invoke it manually during your program initialisation. This + is not recommended for all application authors -- it is your + choice if this use case concerns you enough. + + + Internally, gsettings-data-convert uses a + keyfile to track which settings have been migrated. The + following code fragment will check that keyfile to see if your + data conversion script has been run yet and, if not, will + attempt to invoke the tool to run it. You should adapt it to + your application as you see fit. + + + + + + + + Although there is the possibility that the + gsettings-data-convert script will end up + running multiple times concurrently with this approach, it is + believed that this is safe. + +
+
diff --git a/docs/reference/gio/migrating-gdbus.xml b/docs/reference/gio/migrating-gdbus.xml new file mode 100644 index 0000000..bd7b8c5 --- /dev/null +++ b/docs/reference/gio/migrating-gdbus.xml @@ -0,0 +1,340 @@ + + Migrating to GDBus + +
+ Conceptual differences + + + The central concepts of D-Bus are modelled in a very similar way + in dbus-glib and GDBus. Both have a objects representing connections, + proxies and method invocations. But there are some important + differences: + + + dbus-glib uses libdbus, GDBus doesn't. Instead, it relies on GIO + streams as transport layer, and has its own implementation for the + the D-Bus connection setup and authentication. Apart from using + streams as transport, avoiding libdbus also lets GDBus avoid some + thorny multithreading issues. + + + dbus-glib uses the GObject type system for method arguments and + return values, including a homegrown container specialization + mechanism. GDBus relies uses the #GVariant type system which is + explicitly designed to match D-Bus types. + + + The typical way to export an object in dbus-glib involves generating + glue code from XML introspection data using dbus-binding-tool. GDBus does not (yet?) use code generation; you are expected to + embed the introspection data in your application code. + + + +
+ +
+ API comparison + + + dbus-glib APIs and their GDBus counterparts + + + dbus-glibGDBus + + + #DBusGConnection#GDBusConnection + #DBusGProxy#GDBusProxy + #DBusGMethodInvocation#GDBusMethodInvocation + dbus_g_bus_get()g_bus_get_sync(), also see + g_bus_get() + dbus_g_proxy_new_for_name()g_dbus_proxy_new_sync() and + g_dbus_proxy_new_for_bus_sync(), also see g_dbus_proxy_new() + dbus_g_proxy_add_signal()not needed, use the generic #GDBusProxy::g-signal + dbus_g_proxy_connect_signal()use g_signal_connect() with #GDBusProxy::g-signal + dbus_g_connection_register_g_object()g_dbus_connection_register_object() + dbus_g_connection_unregister_g_object()g_dbus_connection_unregister_object() + dbus_g_object_type_install_info()introspection data is installed while registering + an object, see g_dbus_connection_register_object() + dbus_g_proxy_begin_call()g_dbus_proxy_call() + dbus_g_proxy_end_call()g_dbus_proxy_call_finish() + dbus_g_proxy_call()g_dbus_proxy_call_sync() + dbus_g_error_domain_register()g_dbus_error_register_error_domain() + dbus_g_error_has_name()no direct equivalent, see g_dbus_error_get_remote_error() + dbus_g_method_return()g_dbus_method_invocation_return_value() + dbus_g_method_return_error()g_dbus_method_invocation_return_error() and variants + dbus_g_method_get_sender()g_dbus_method_invocation_get_sender() + + +
+
+ +
+ Owning bus names + + Using dbus-glib, you typically call RequestName manually + to own a name, like in the following excerpt: + message); + g_error_free (error); + } + else + { + g_warning ("Failed to acquire %s", NAME_TO_CLAIM); + } + goto out; + } + + if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) + { + if (error != NULL) + { + g_warning ("Failed to acquire %s: %s", + NAME_TO_CLAIM, error->message); + g_error_free (error); + } + else + { + g_warning ("Failed to acquire %s", NAME_TO_CLAIM); + } + exit (1); + } + + dbus_g_proxy_add_signal (system_bus_proxy, "NameLost", + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (system_bus_proxy, "NameLost", + G_CALLBACK (on_name_lost), NULL, NULL); + + /* further setup ... */ +]]> + + + + While you can do things this way with GDBus too, using + g_dbus_proxy_call_sync(), it is much nicer to use the high-level API + for this: + + + Note that g_bus_own_name() works asynchronously and requires + you to enter your mainloop to await the on_name_aquired() + callback. Also note that in order to avoid race conditions (e.g. + when your service is activated by a method call), you have to export + your manager object before acquiring the + name. The on_bus_acquired() callback is the right place to do + such preparations. + +
+ +
+ Creating proxies for well-known names + + dbus-glib lets you create proxy objects for well-known names, like the + following example: + + + For a #DBusGProxy constructed like this, method calls will be sent to + the current owner of the name, and that owner can change over time. + + + The same can be achieved with #GDBusProxy: + + + For an added layer of safety, you can specify what D-Bus + interface the proxy is expected to conform to by using the + #GDBusInterfaceInfo type. + + + Additionally, #GDBusProxy loads, caches and tracks changes to + the D-Bus properties on the remote object. It also sets up match + rules so D-Bus signals from the remote object are delivered + locally. + +
+
+ Client-side GObject bindings + + + dbus-glib comes with dbus-binding-tool, which + can produce somewhat nice client-side wrappers for a D-Bus interface. + GDBus does not have code-generation at this point, but #GDBusProxy + is designed to allow the creating of client-side wrappers by + subclassing #GDBusProxy. + + + For an example of a #GDBusProxy-derived class that wraps a D-Bus + interface in a type-safe way, see . The comparison is as + follows: + + Wrapping the org.freedesktop.Accounts.User D-Bus interface in the AccountUser GObject type + + + D-Bus conceptGObject concept + + + + AutomaticLogin property + + AccountsUser:automatic-login GObject property + C getter: accounts_user_get_automatic_login() + Watch changes via the notify::automatic-login signal + + + + RealName property + + AccountsUser:real-name GObject property + C getter: accounts_user_get_real_name() + Watch changes via the notify::real-name signal + + + + UserName property + + AccountsUser:user-name GObject property + C getter: accounts_user_get_user_name() + Watch changes via the notify::user-name signal + + + + Changed signal + + AccountsUser::changed GObject signal + Watch via e.g. g_signal_connect() + + + + Frobnicate method + + Use accounts_user_frobnicate() + accounts_user_frobnicate_finish() or accounts_user_frobnicate_sync() to invoke + + + + +
+
+ GDBusProxy subclass exampleFIXME: MISSING XINCLUDE CONTENT +
+ +
+ Exporting objects + + + With dbus-glib, exporting an object over D-Bus works by generating + a bunch of glue code from your introspection XML with + dbus-binding-tool. The glue code gets included in + your source, and you need to call + + dbus_g_object_type_install_info (TYPE_MYOBJECT, + &dbus_glib_myobject_object_info); + + in your class_init() function to tell dbus-glib about your type. + To actually export an instance, you call + + dbus_g_connection_register_g_object (system_bus_connection, + my_object_path, + G_OBJECT (my_object)); + + + + + The GDBus way of exporting an object works by embedding the + introspection XML in the source, creating introspection data + structures from it with g_dbus_node_info_new_for_xml(), and + passing that along when you register the object: + " + " " + " " + " " + " " + " " + " " + ""; + + /* parse introspection data */ + introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + + / + id = g_dbus_connection_register_object (connection, + "/org/gtk/GDBus/TestObject", + "org.gtk.GDBus.TestPeerInterface", + introspection_data->interfaces[0], + &interface_vtable, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + NULL); /* GError** */ + +]]> + + + + The actual implementation of the exported object is done by specifying + a #GDBusInterfaceVTable that has method_call(), get_property() and + set_property() methods. There is no direct support beyond that for + exporting #GObjects, so there is quite a bit of manual work involved, + as you can see in the following example. + + + Since the VTable methods don't have any direct #GObject support, we + pass the exported object as @user_data. Also note that we have to handle + the emission of the PropertiesChanged signal ourselves, by connecting + to ::notify. + + Exporting a GObjectFIXME: MISSING XINCLUDE CONTENT +
+ +
diff --git a/docs/reference/gio/migrating.xml b/docs/reference/gio/migrating-gnome-vfs.xml similarity index 81% rename from docs/reference/gio/migrating.xml rename to docs/reference/gio/migrating-gnome-vfs.xml index 89191d3..ba3987c 100644 --- a/docs/reference/gio/migrating.xml +++ b/docs/reference/gio/migrating-gnome-vfs.xml @@ -1,30 +1,3 @@ - - Migrating to GIO - - - Migrating from POSIX to GIO - - - Comparison of POSIX and GIO concepts - - - POSIXGIO - - - char *pathGFile *file - struct stat *bufGFileInfo *info - struct statvfs *bufGFileInfo *info - int fdGInputStream *in - GOutputStream *out - DIR *GFileEnumerator *enum - fstab entryGUnixMountPoint *mount_point - mtab entryGUnixMountEntry *mount_entry - - -
- -
- Migrating from GnomeVFS to GIO @@ -120,7 +93,7 @@ start_monitoring_trash (void) reflect that state of the trash can. - Moving a file to the trash is much simpler with GIO. Instead of + Moving a file to the trash is much simpler with GIO. Instead of using gnome_vfs_find_directory() with %GNOME_VFS_DIRECTORY_KIND_TRASH to find out where to move the trashed file, just use the g_file_trash() function. @@ -151,12 +124,10 @@ start_monitoring_trash (void) gnome-vfs offered a way to monitor the association between mime types and default handlers for changes, with the #GnomeVFSMIMEMonitor object. GIO does not offer a replacement for this functionality at this time, - since we have not found a compelling use case where + since we have not found a compelling use case where #GnomeVFSMIMEMonitor was used. If you think you have such a use - case, please report it at + case, please report it at bugzilla.gnome.org. - -
diff --git a/docs/reference/gio/migrating-posix.xml b/docs/reference/gio/migrating-posix.xml new file mode 100644 index 0000000..e7dc9f4 --- /dev/null +++ b/docs/reference/gio/migrating-posix.xml @@ -0,0 +1,27 @@ + + Migrating to GIO + + + Migrating from POSIX to GIO + + + Comparison of POSIX and GIO concepts + + + POSIXGIO + + + char *pathGFile *file + struct stat *bufGFileInfo *info + struct statvfs *bufGFileInfo *info + int fdGInputStream *in + GOutputStream *out + DIR *GFileEnumerator *enum + fstab entryGUnixMountPoint *mount_point + mtab entryGUnixMountEntry *mount_entry + + +
+ +
+
diff --git a/docs/reference/gio/overview.xml b/docs/reference/gio/overview.xml index 9964921..a6e327b 100644 --- a/docs/reference/gio/overview.xml +++ b/docs/reference/gio/overview.xml @@ -1,7 +1,7 @@ GIO Overview - + Introduction @@ -9,7 +9,7 @@ at the right level in the library stack. The goal is to overcome the shortcomings of GnomeVFS and provide an API that is so good that developers prefer it over raw POSIX calls. Among other things - that means using GObject. It also means not cloning the POSIX + that means using GObject. It also means not cloning the POSIX API, but providing higher-level, document-centric interfaces. @@ -74,6 +74,13 @@ abstract type for file and application icons + There is a framework for storing and retrieving application settings: + + + GSettings + stores and retrieves application settings + + There is support for network programming, including name resolution, lowlevel socket APIs and highlevel client and server helper classes: @@ -98,10 +105,35 @@ network connection stream + There is support for connecting to D-Bus, + sending and receiving messages, owning and watching bus names, + and making objects available on the bus: + + + GDBusConnection + a D-Bus connection + + + + GDBusMethodInvocation + for handling remove calls + + + + GDBusServer + helper for accepting connections + + + + GDBusProxy + proxy to access D-Bus interfaces on a remote object + + + Beyond these, GIO provides facilities for file monitoring, - asynchronous I/O and filename completion. In addition to the - interfaces, GIO provides implementations for the local case. - Implementations for various network file systems are provided + asynchronous I/O and filename completion. In addition to the + interfaces, GIO provides implementations for the local case. + Implementations for various network file systems are provided by the GVFS package as loadable modules. @@ -109,8 +141,8 @@ Other design choices which consciously break with the GnomeVFS design are to move backends out-of-process, which minimizes the dependency bloat and makes the whole system more robust. The backends - are not included in GIO, but in the separate GVFS package. The GVFS - package also contains the GVFS daemon, which spawn further mount + are not included in GIO, but in the separate GVFS package. The GVFS + package also contains the GVFS daemon, which spawn further mount daemons for each individual connection. @@ -120,13 +152,13 @@ - The GIO model of I/O is stateful: if an application establishes e.g. - a SFTP connection to a server, it becomes available to all applications - in the session; the user does not have to enter his password over + The GIO model of I/O is stateful: if an application establishes e.g. + a SFTP connection to a server, it becomes available to all applications + in the session; the user does not have to enter his password over and over again. - One of the big advantages of putting the VFS in the GLib layer + One of the big advantages of putting the VFS in the GLib layer is that GTK+ can directly use it, e.g. in the filechooser. @@ -138,18 +170,24 @@ GIO comes with a gio-2.0.pc file that you should use together with pkg-config to obtain the necessary information about header files and libraries. See - the pkg-config man page or the GLib documentation - for more information on how to use pkg-config + the pkg-config man page or the GLib documentation + for more information on how to use pkg-config to compile your application. If you are using GIO on UNIX-like systems, you may want to use - UNIX-specific GIO interfaces such as #GUnixInputStream, - #GUnixOutputStream, #GUnixMount or #GDesktopAppInfo. - To do so, use the gio-unix-2.0.pc file + UNIX-specific GIO interfaces such as #GUnixInputStream, + #GUnixOutputStream, #GUnixMount or #GDesktopAppInfo. + To do so, use the gio-unix-2.0.pc file instead of gio-2.0.pc + + + Since GIO is based on GObject, you need to call g_type_init() + before you can use any GIO functions. If your application uses + GTK+, this is already taken care of by gtk_init(). + @@ -164,7 +202,7 @@ <envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar> - GIO uses these environment variables to locate MIME information. + GIO uses these environment variables to locate MIME information. For more information, see the Shared MIME-info Database and the Base Directory Specification. @@ -188,19 +226,19 @@ <envar>GIO_USE_VFS</envar> - This environment variable can be set to the name of a #GVfs + This environment variable can be set to the name of a #GVfs implementation to override the default for debugging purposes. - The #GVfs implementation for local files that is included in GIO - has the name "local", the implementation in the gvfs module has - the name "gvfs". + The #GVfs implementation for local files that is included in GIO + has the name "local", the implementation in the gvfs module has + the name "gvfs". <envar>GIO_USE_VOLUME_MONITOR</envar> - + - This variable can be set to the name of a #GVolumeMonitor + This variable can be set to the name of a #GVolumeMonitor implementation to override the default for debugging purposes. The #GVolumeMonitor implementation for local files that is included in GIO has the name "unix", the hal-based implementation in the @@ -209,14 +247,13 @@ - <envar>GIO_USE_URI_ASSOCIATION</envar> + <envar>GIO_USE_TLS</envar> - This variable can be set to the name of a #GDesktopAppInfoLookup + This variable can be set to the name of a #GTlsBackend implementation to override the default for debugging purposes. - GIO does not include a #GDesktopAppInfoLookup implementation, - the GConf-based implementation in the gvfs module has the name - "gconf". + GIO does not include a #GTlsBackend implementation, the gnutls-based + implementation in the glib-networking module has the name "gnutls". @@ -225,7 +262,7 @@ When this environment variable is set and GIO has been built - with inotify support, a dump of diagnostic inotify information + with inotify support, a dump of diagnostic inotify information will be written every 20 seconds to a file named /tmp/gvfsdid.pid. @@ -235,12 +272,148 @@ <envar>GIO_EXTRA_MODULES</envar> - When this environment variable is set to a path, or a set of - paths separated by a colon, GIO will attempt to load - modules from within the path. + When this environment variable is set to a path, or a set of + paths separated by a colon, GIO will attempt to load + modules from within the path. + + + + + <envar>GSETTINGS_BACKEND</envar> + + + This variable can be set to the name of a #GSettingsBackend + implementation to override the default for debugging purposes. + The memory-based implementation that is included in GIO has + the name "memory", the one in dconf has the name "dconf-settings". + + + + + <envar>GSETTINGS_SCHEMA_DIR</envar> + + + This variable can be set to the name of a directory that is + considered in addition to the glib-2.0/schemas + subdirectories of the XDG system data dirs when looking + for compiled schemas for #GSettings. + + <envar>DBUS_SYSTEM_BUS_ADDRESS</envar> + + + This variable is consulted to find the address of the D-Bus system + bus. For the format of D-Bus addresses, see the D-Bus + specification. + + + Setting this variable overrides platform-specific ways of determining + the system bus address. + + + + + <envar>DBUS_SESSION_BUS_ADDRESS</envar> + + + This variable is consulted to find the address of the D-Bus session bus. + + + Setting this variable overrides platform-specific ways of determining + the session bus address. + + + + + <envar>DBUS_STARTER_BUS_TYPE</envar> + + + This variable is consulted to find out the 'starter' bus for an + application that has been started via D-Bus activation. The possible + values are 'system' or 'session'. + + + + + <envar>G_DBUS_DEBUG</envar> + + + This variable can be set to a list of debug options, which + cause GLib to print out different types of debugging + information when using the D-Bus routines. + + + transport + Show IO activity (e.g. reads and writes) + + + message + Show all sent and received D-Bus messages + + + payload + Show payload for all sent and received D-Bus messages (implies message) + + + call + Trace g_dbus_connection_call() and g_dbus_connection_call_sync() API usage + + + signal + Show when a D-Bus signal is received + + + incoming + Show when an incoming D-Bus method call is received + + + return + Show when a reply is returned via the #GDBusMethodInvocation API + + + emission + Trace g_dbus_connection_emit_signal() API usage + + + authentication + Show information about connection authentication + + + address + Show information about D-Bus address lookups and autolaunching + + + The special value all can be used to turn + on all debug options. The special value + help can be used to print a list of + supported options to standard output. + + + + + <envar>G_DBUS_COOKIE_SHA1_KEYRING_DIR</envar> + + + Can be used to override the directory used to store the + keyring used in the DBUS_COOKIE_SHA1 + authentication mechanism. Normally the directory used is + .dbus-keyrings in the user's home + directory. + + + + + <envar>G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION</envar> + + + If set, the permissions of the directory used to store the + keyring used in the DBUS_COOKIE_SHA1 + authentication mechanism won't be checked. Normally the + directory must be readable only by the user. + + @@ -249,7 +422,7 @@ A lot of the functionality that is accessible through GIO is implemented in loadable modules, and modules provide a convenient - way to extend GIO. In addition to the #GIOModule API which supports + way to extend GIO. In addition to the #GIOModule API which supports writing such modules, GIO has a mechanism to define extension points, and register implementations thereof, see #GIOExtensionPoint. @@ -297,8 +470,8 @@ is_supported() vfunc in #GVolumeMonitorClass. - GIO implements this extension point for local mounts, - gvfs contains a hal-based implementation. + GIO implements this extension point for local mounts, + gvfs contains a hal-based implementation. @@ -306,9 +479,9 @@ G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME - Allows to override the file monitor implementation for - local files. Implementations of this extension point must - be derived from #GLocalFileMonitor. GIO uses the implementation + Allows to override the file monitor implementation for + local files. Implementations of this extension point must + be derived from #GLocalFileMonitor. GIO uses the implementation with the highest priority that is supported, as determined by the is_supported() vfunc in #GLocalFileMonitorClass. @@ -322,8 +495,8 @@ G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME - Allows to override the directory monitor implementation for - local files. Implementations of this extension point must be + Allows to override the directory monitor implementation for + local files. Implementations of this extension point must be derived from #GLocalDirectoryMonitor. GIO uses the implementation with the highest priority that is supported, as determined by the is_supported() vfunc in #GLocalDirectoryMonitorClass. @@ -339,14 +512,58 @@ Unix-only. Allows to provide a way to associate default handlers - with URI schemes. Implementations of this extension point must - implement the #GDesktopAppInfoLookup interface. GIO uses the + with URI schemes. Implementations of this extension point must + implement the #GDesktopAppInfoLookup interface. GIO uses the implementation with the highest priority. - gvfs contains a GConf-based implementation that uses the - same GConf keys as gnome-vfs. + This extension point has been discontinued in GLib 2.28. It is + still available to keep API and ABI stability, but GIO is no + longer using it for default handlers. Instead, the mime handler + mechanism is used, together with x-scheme-handler pseudo-mimetypes. + + + + + G_SETTINGS_BACKEND_EXTENSION_POINT_NAME + + + Allows to provide an alternative storage for #GSettings. + Implementations of this extension point must derive from the + #GSettingsBackend type. GIO contains a keyfile-based + implementation of this extension point, another one is provided + by dconf. + + + G_PROXY_EXTENSION_POINT_NAME + + + Allows to provide implementations for network proxying. + Implementations of this extension point must provide the + #GProxy interface, and must be named after the network + protocol they are proxying. + + + glib-networking contains an implementation of this extension + point based on libproxy. + + + + + G_TLS_BACKEND_EXTENSION_POINT_NAME + + + Allows to provide implementations for TLS support. + Implementations of this extension point must implement + the #GTlsBackend interface. + + + glib-networking contains an implementation of this extension + point. + + + diff --git a/docs/reference/gio/tmpl/extensionpoints.sgml b/docs/reference/gio/tmpl/extensionpoints.sgml index 3d2abec..b08bc69 100644 --- a/docs/reference/gio/tmpl/extensionpoints.sgml +++ b/docs/reference/gio/tmpl/extensionpoints.sgml @@ -9,13 +9,11 @@ Extension Points - - diff --git a/docs/reference/gio/tmpl/gaction.sgml b/docs/reference/gio/tmpl/gaction.sgml new file mode 100644 index 0000000..5480327 --- /dev/null +++ b/docs/reference/gio/tmpl/gaction.sgml @@ -0,0 +1,125 @@ + +GAction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@action: +@Returns: + + + + + + + +@action: +@Returns: + + + + + + + +@action: +@Returns: + + + + + + + +@action: +@Returns: + + + + + + + +@action: +@Returns: + + + + + + + +@action: +@Returns: + + + + + + + +@action: +@value: + + + + + + + +@action: +@parameter: + + diff --git a/docs/reference/gio/tmpl/gactiongroup.sgml b/docs/reference/gio/tmpl/gactiongroup.sgml new file mode 100644 index 0000000..be687f2 --- /dev/null +++ b/docs/reference/gio/tmpl/gactiongroup.sgml @@ -0,0 +1,189 @@ + +GActionGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gactiongroup: the object which received the signal. +@arg1: + + + + + + +@gactiongroup: the object which received the signal. +@arg1: +@arg2: + + + + + + +@gactiongroup: the object which received the signal. +@arg1: + + + + + + +@gactiongroup: the object which received the signal. +@arg1: +@arg2: + + + + + + +@action_group: +@action_name: +@Returns: + + + + + + + +@action_group: +@Returns: + + + + + + + +@action_group: +@action_name: +@Returns: + + + + + + + +@action_group: +@action_name: +@Returns: + + + + + + + +@action_group: +@action_name: +@Returns: + + + + + + + +@action_group: +@action_name: +@Returns: + + + + + + + +@action_group: +@action_name: +@Returns: + + + + + + + +@action_group: +@action_name: +@value: + + + + + + + +@action_group: +@action_name: +@parameter: + + + + + + + +@action_group: +@action_name: + + + + + + + +@action_group: +@action_name: + + + + + + + +@action_group: +@action_name: +@enabled: + + + + + + + +@action_group: +@action_name: +@state: + + diff --git a/docs/reference/gio/tmpl/gappinfo.sgml b/docs/reference/gio/tmpl/gappinfo.sgml index b7334d9..a969e78 100644 --- a/docs/reference/gio/tmpl/gappinfo.sgml +++ b/docs/reference/gio/tmpl/gappinfo.sgml @@ -9,13 +9,11 @@ GAppInfo - - @@ -30,6 +28,7 @@ GAppInfo @G_APP_INFO_CREATE_NONE: @G_APP_INFO_CREATE_NEEDS_TERMINAL: @G_APP_INFO_CREATE_SUPPORTS_URIS: +@G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION: @@ -64,6 +63,7 @@ GAppInfo @do_delete: @get_commandline: @get_display_name: +@set_as_last_used_for_type: @@ -264,6 +264,17 @@ GAppInfo @Returns: + + + + + +@appinfo: +@content_type: +@error: +@Returns: + + @@ -332,6 +343,24 @@ GAppInfo @Returns: + + + + + +@content_type: +@Returns: + + + + + + + +@content_type: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gapplication.sgml b/docs/reference/gio/tmpl/gapplication.sgml new file mode 100644 index 0000000..5665648 --- /dev/null +++ b/docs/reference/gio/tmpl/gapplication.sgml @@ -0,0 +1,276 @@ + +gapplication + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gapplication: the object which received the signal. + + + + + + +@gapplication: the object which received the signal. +@arg1: +@Returns: + + + + + + +@gapplication: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + +@gapplication: the object which received the signal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@startup: +@activate: +@open: +@command_line: +@local_command_line: +@before_emit: +@after_emit: +@add_platform_data: +@quit_mainloop: +@run_mainloop: + + + + + + +@G_APPLICATION_FLAGS_NONE: +@G_APPLICATION_IS_SERVICE: +@G_APPLICATION_IS_LAUNCHER: +@G_APPLICATION_HANDLES_OPEN: +@G_APPLICATION_HANDLES_COMMAND_LINE: +@G_APPLICATION_SEND_ENVIRONMENT: + + + + + + +@application_id: +@Returns: + + + + + + + +@application_id: +@flags: +@Returns: + + + + + + + +@application: +@Returns: + + + + + + + +@application: +@application_id: + + + + + + + +@application: +@Returns: + + + + + + + +@application: +@inactivity_timeout: + + + + + + + +@application: +@Returns: + + + + + + + +@application: +@flags: + + + + + + + +@application: +@action_group: + + + + + + + +@application: +@Returns: + + + + + + + +@application: +@Returns: + + + + + + + +@application: +@cancellable: +@error: +@Returns: + + + + + + + +@application: + + + + + + + +@application: + + + + + + + +@application: + + + + + + + +@application: +@files: +@n_files: +@hint: + + + + + + + +@application: +@argc: +@argv: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gapplicationcommandline.sgml b/docs/reference/gio/tmpl/gapplicationcommandline.sgml new file mode 100644 index 0000000..9f4bf8e --- /dev/null +++ b/docs/reference/gio/tmpl/gapplicationcommandline.sgml @@ -0,0 +1,119 @@ + +gapplicationcommandline + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@cmdline: +@argc: +@Returns: + + + + + + + +@cmdline: +@Returns: + + + + + + + +@cmdline: +@name: +@Returns: + + + + + + + +@cmdline: +@Returns: + + + + + + + +@cmdline: +@Returns: + + + + + + + +@cmdline: +@exit_status: + + + + + + + +@cmdline: +@Returns: + + + + + + + +@cmdline: +@format: +@Varargs: + + + + + + + +@cmdline: +@format: +@Varargs: + + diff --git a/docs/reference/gio/tmpl/gasyncinitable.sgml b/docs/reference/gio/tmpl/gasyncinitable.sgml index d167694..1438c82 100644 --- a/docs/reference/gio/tmpl/gasyncinitable.sgml +++ b/docs/reference/gio/tmpl/gasyncinitable.sgml @@ -9,13 +9,11 @@ GAsyncInitable - - diff --git a/docs/reference/gio/tmpl/gasyncresult.sgml b/docs/reference/gio/tmpl/gasyncresult.sgml index 973af41..d93667e 100644 --- a/docs/reference/gio/tmpl/gasyncresult.sgml +++ b/docs/reference/gio/tmpl/gasyncresult.sgml @@ -9,13 +9,11 @@ GAsyncResult - - diff --git a/docs/reference/gio/tmpl/gbufferedinputstream.sgml b/docs/reference/gio/tmpl/gbufferedinputstream.sgml index a2366e2..3976519 100644 --- a/docs/reference/gio/tmpl/gbufferedinputstream.sgml +++ b/docs/reference/gio/tmpl/gbufferedinputstream.sgml @@ -9,13 +9,11 @@ GBufferedInputStream - - diff --git a/docs/reference/gio/tmpl/gbufferedoutputstream.sgml b/docs/reference/gio/tmpl/gbufferedoutputstream.sgml index 1446601..159dfe8 100644 --- a/docs/reference/gio/tmpl/gbufferedoutputstream.sgml +++ b/docs/reference/gio/tmpl/gbufferedoutputstream.sgml @@ -9,13 +9,11 @@ GBufferedOutputStream - - diff --git a/docs/reference/gio/tmpl/gcancellable.sgml b/docs/reference/gio/tmpl/gcancellable.sgml index af55605..d5c3043 100644 --- a/docs/reference/gio/tmpl/gcancellable.sgml +++ b/docs/reference/gio/tmpl/gcancellable.sgml @@ -9,13 +9,11 @@ GCancellable - - @@ -90,6 +88,25 @@ GCancellable @cancellable: + + + + + +@cancellable: +@Returns: + + + + + + + +@cancellable: +@user_data: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gcharsetconverter.sgml b/docs/reference/gio/tmpl/gcharsetconverter.sgml index fd3687b..932f058 100644 --- a/docs/reference/gio/tmpl/gcharsetconverter.sgml +++ b/docs/reference/gio/tmpl/gcharsetconverter.sgml @@ -9,13 +9,11 @@ GCharsetConverter - - diff --git a/docs/reference/gio/tmpl/gcontenttype.sgml b/docs/reference/gio/tmpl/gcontenttype.sgml index 70f942b..329e780 100644 --- a/docs/reference/gio/tmpl/gcontenttype.sgml +++ b/docs/reference/gio/tmpl/gcontenttype.sgml @@ -9,13 +9,11 @@ GContentType - - diff --git a/docs/reference/gio/tmpl/gconverter.sgml b/docs/reference/gio/tmpl/gconverter.sgml index 648544f..762f462 100644 --- a/docs/reference/gio/tmpl/gconverter.sgml +++ b/docs/reference/gio/tmpl/gconverter.sgml @@ -9,13 +9,11 @@ GConverter - - @@ -47,6 +45,15 @@ GConverter @G_CONVERTER_FINISHED: @G_CONVERTER_FLUSHED: + + + + + +@G_CONVERTER_NO_FLAGS: +@G_CONVERTER_INPUT_AT_END: +@G_CONVERTER_FLUSH: + diff --git a/docs/reference/gio/tmpl/gconverterinputstream.sgml b/docs/reference/gio/tmpl/gconverterinputstream.sgml index c305795..8ea5d58 100644 --- a/docs/reference/gio/tmpl/gconverterinputstream.sgml +++ b/docs/reference/gio/tmpl/gconverterinputstream.sgml @@ -9,13 +9,11 @@ GConverterInputstream - - diff --git a/docs/reference/gio/tmpl/gconverteroutputstream.sgml b/docs/reference/gio/tmpl/gconverteroutputstream.sgml index eb1bb2f..6238b8f 100644 --- a/docs/reference/gio/tmpl/gconverteroutputstream.sgml +++ b/docs/reference/gio/tmpl/gconverteroutputstream.sgml @@ -9,13 +9,11 @@ GConverterOutputstream - - diff --git a/docs/reference/gio/tmpl/gcredentials.sgml b/docs/reference/gio/tmpl/gcredentials.sgml new file mode 100644 index 0000000..a7ef805 --- /dev/null +++ b/docs/reference/gio/tmpl/gcredentials.sgml @@ -0,0 +1,107 @@ + +GCredentials + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@G_CREDENTIALS_TYPE_INVALID: +@G_CREDENTIALS_TYPE_LINUX_UCRED: +@G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED: + + + + + + +@void: +@Returns: + + + + + + + +@credentials: +@Returns: + + + + + + + +@credentials: +@native_type: +@Returns: + + + + + + + +@credentials: +@native_type: +@native: + + + + + + + +@credentials: +@other_credentials: +@error: +@Returns: + + + + + + + +@credentials: +@error: +@Returns: + + + + + + + +@credentials: +@uid: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdatainputstream.sgml b/docs/reference/gio/tmpl/gdatainputstream.sgml index c16a8aa..5121a0c 100644 --- a/docs/reference/gio/tmpl/gdatainputstream.sgml +++ b/docs/reference/gio/tmpl/gdatainputstream.sgml @@ -9,13 +9,11 @@ GDataInputStream - - @@ -215,6 +213,46 @@ GDataInputStream @Returns: + + + + + +@stream: +@stop_chars: +@stop_chars_len: +@length: +@cancellable: +@error: +@Returns: + + + + + + + +@stream: +@stop_chars: +@stop_chars_len: +@io_priority: +@cancellable: +@callback: +@user_data: + + + + + + + +@stream: +@result: +@length: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdataoutputstream.sgml b/docs/reference/gio/tmpl/gdataoutputstream.sgml index 7f99599..68e9f66 100644 --- a/docs/reference/gio/tmpl/gdataoutputstream.sgml +++ b/docs/reference/gio/tmpl/gdataoutputstream.sgml @@ -9,13 +9,11 @@ GDataOutputStream - - diff --git a/docs/reference/gio/tmpl/gdbusaddress.sgml b/docs/reference/gio/tmpl/gdbusaddress.sgml new file mode 100644 index 0000000..910ab79 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusaddress.sgml @@ -0,0 +1,86 @@ + +gdbusaddress + + + + + + + + + + + + + + + + + + + + + + + + + +@string: +@Returns: + + + + + + + +@string: +@error: +@Returns: + + + + + + + +@address: +@cancellable: +@callback: +@user_data: + + + + + + + +@res: +@out_guid: +@error: +@Returns: + + + + + + + +@address: +@out_guid: +@cancellable: +@error: +@Returns: + + + + + + + +@bus_type: +@cancellable: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusauthobserver.sgml b/docs/reference/gio/tmpl/gdbusauthobserver.sgml new file mode 100644 index 0000000..ba1a5a5 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusauthobserver.sgml @@ -0,0 +1,58 @@ + +GDBusAuthObserver + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gdbusauthobserver: the object which received the signal. +@arg1: +@arg2: +@Returns: + + + + + + +@void: +@Returns: + + + + + + + +@observer: +@stream: +@credentials: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusconnection.sgml b/docs/reference/gio/tmpl/gdbusconnection.sgml new file mode 100644 index 0000000..fb2f677 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusconnection.sgml @@ -0,0 +1,742 @@ + +GDBusConnection + + + + + + + + + + + + + + + + + + + + + + + + + +@G_BUS_TYPE_STARTER: +@G_BUS_TYPE_NONE: +@G_BUS_TYPE_SYSTEM: +@G_BUS_TYPE_SESSION: + + + + + + +@bus_type: +@cancellable: +@callback: +@user_data: + + + + + + + +@res: +@error: +@Returns: + + + + + + + +@bus_type: +@cancellable: +@error: +@Returns: + + + + + + + + + + + + + +@gdbusconnection: the object which received the signal. +@arg1: +@arg2: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@G_DBUS_CONNECTION_FLAGS_NONE: +@G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT: +@G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER: +@G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS: +@G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION: +@G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING: + + + + + + +@stream: +@guid: +@flags: +@observer: +@cancellable: +@callback: +@user_data: + + + + + + + +@res: +@error: +@Returns: + + + + + + + +@stream: +@guid: +@flags: +@observer: +@cancellable: +@error: +@Returns: + + + + + + + +@address: +@flags: +@observer: +@cancellable: +@callback: +@user_data: + + + + + + + +@res: +@error: +@Returns: + + + + + + + +@address: +@flags: +@observer: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: + + + + + + + +@connection: +@cancellable: +@callback: +@user_data: + + + + + + + +@connection: +@res: +@error: +@Returns: + + + + + + + +@connection: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@cancellable: +@callback: +@user_data: + + + + + + + +@connection: +@res: +@error: +@Returns: + + + + + + + +@connection: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@exit_on_close: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@G_DBUS_CAPABILITY_FLAGS_NONE: +@G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING: + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@G_DBUS_CALL_FLAGS_NONE: +@G_DBUS_CALL_FLAGS_NO_AUTO_START: + + + + + + +@connection: +@bus_name: +@object_path: +@interface_name: +@method_name: +@parameters: +@reply_type: +@flags: +@timeout_msec: +@cancellable: +@callback: +@user_data: + + + + + + + +@connection: +@res: +@error: +@Returns: + + + + + + + +@connection: +@bus_name: +@object_path: +@interface_name: +@method_name: +@parameters: +@reply_type: +@flags: +@timeout_msec: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@destination_bus_name: +@object_path: +@interface_name: +@signal_name: +@parameters: +@error: +@Returns: + + + + + + + +@G_DBUS_SIGNAL_FLAGS_NONE: +@G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE: + + + + + + +@connection: +@sender_name: +@object_path: +@interface_name: +@signal_name: +@parameters: +@user_data: + + + + + + + +@connection: +@sender: +@interface_name: +@member: +@object_path: +@arg0: +@flags: +@callback: +@user_data: +@user_data_free_func: +@Returns: + + + + + + + +@connection: +@subscription_id: + + + + + + + +@G_DBUS_SEND_MESSAGE_FLAGS_NONE: +@G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL: + + + + + + +@connection: +@message: +@flags: +@out_serial: +@error: +@Returns: + + + + + + + +@connection: +@message: +@flags: +@timeout_msec: +@out_serial: +@cancellable: +@callback: +@user_data: + + + + + + + +@connection: +@res: +@error: +@Returns: + + + + + + + +@connection: +@message: +@flags: +@timeout_msec: +@out_serial: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@message: +@incoming: +@user_data: +@Returns: + + + + + + + +@connection: +@filter_function: +@user_data: +@user_data_free_func: +@Returns: + + + + + + + +@connection: +@filter_id: + + + + + + + +@method_call: +@get_property: +@set_property: + + + + + + +@connection: +@sender: +@object_path: +@interface_name: +@method_name: +@parameters: +@invocation: +@user_data: + + + + + + + +@connection: +@sender: +@object_path: +@interface_name: +@property_name: +@error: +@user_data: +@Returns: + + + + + + + +@connection: +@sender: +@object_path: +@interface_name: +@property_name: +@value: +@error: +@user_data: +@Returns: + + + + + + + +@connection: +@object_path: +@interface_info: +@vtable: +@user_data: +@user_data_free_func: +@error: +@Returns: + + + + + + + +@connection: +@registration_id: +@Returns: + + + + + + + +@enumerate: +@introspect: +@dispatch: + + + + + + +@connection: +@sender: +@object_path: +@user_data: +@Returns: + + + + + + + +@connection: +@sender: +@object_path: +@node: +@user_data: +@Returns: + + + + + + + +@connection: +@sender: +@object_path: +@interface_name: +@node: +@out_user_data: +@user_data: +@Returns: + + + + + + + +@G_DBUS_SUBTREE_FLAGS_NONE: +@G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES: + + + + + + +@connection: +@object_path: +@vtable: +@flags: +@user_data: +@user_data_free_func: +@error: +@Returns: + + + + + + + +@connection: +@registration_id: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbuserror.sgml b/docs/reference/gio/tmpl/gdbuserror.sgml new file mode 100644 index 0000000..f4c9d32 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbuserror.sgml @@ -0,0 +1,187 @@ + +gdbuserror + + + + + + + + + + + + + + + + + + + + + + + + + +@G_DBUS_ERROR_FAILED: +@G_DBUS_ERROR_NO_MEMORY: +@G_DBUS_ERROR_SERVICE_UNKNOWN: +@G_DBUS_ERROR_NAME_HAS_NO_OWNER: +@G_DBUS_ERROR_NO_REPLY: +@G_DBUS_ERROR_IO_ERROR: +@G_DBUS_ERROR_BAD_ADDRESS: +@G_DBUS_ERROR_NOT_SUPPORTED: +@G_DBUS_ERROR_LIMITS_EXCEEDED: +@G_DBUS_ERROR_ACCESS_DENIED: +@G_DBUS_ERROR_AUTH_FAILED: +@G_DBUS_ERROR_NO_SERVER: +@G_DBUS_ERROR_TIMEOUT: +@G_DBUS_ERROR_NO_NETWORK: +@G_DBUS_ERROR_ADDRESS_IN_USE: +@G_DBUS_ERROR_DISCONNECTED: +@G_DBUS_ERROR_INVALID_ARGS: +@G_DBUS_ERROR_FILE_NOT_FOUND: +@G_DBUS_ERROR_FILE_EXISTS: +@G_DBUS_ERROR_UNKNOWN_METHOD: +@G_DBUS_ERROR_TIMED_OUT: +@G_DBUS_ERROR_MATCH_RULE_NOT_FOUND: +@G_DBUS_ERROR_MATCH_RULE_INVALID: +@G_DBUS_ERROR_SPAWN_EXEC_FAILED: +@G_DBUS_ERROR_SPAWN_FORK_FAILED: +@G_DBUS_ERROR_SPAWN_CHILD_EXITED: +@G_DBUS_ERROR_SPAWN_CHILD_SIGNALED: +@G_DBUS_ERROR_SPAWN_FAILED: +@G_DBUS_ERROR_SPAWN_SETUP_FAILED: +@G_DBUS_ERROR_SPAWN_CONFIG_INVALID: +@G_DBUS_ERROR_SPAWN_SERVICE_INVALID: +@G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND: +@G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID: +@G_DBUS_ERROR_SPAWN_FILE_INVALID: +@G_DBUS_ERROR_SPAWN_NO_MEMORY: +@G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN: +@G_DBUS_ERROR_INVALID_SIGNATURE: +@G_DBUS_ERROR_INVALID_FILE_CONTENT: +@G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN: +@G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN: +@G_DBUS_ERROR_OBJECT_PATH_IN_USE: + + + + + + + + + + + + + +@error: +@Returns: + + + + + + + +@error: +@Returns: + + + + + + + +@error: +@Returns: + + + + + + + +@error_code: +@dbus_error_name: + + + + + + +@error_domain_quark_name: +@quark_volatile: +@entries: +@num_entries: + + + + + + + +@error_domain: +@error_code: +@dbus_error_name: +@Returns: + + + + + + + +@error_domain: +@error_code: +@dbus_error_name: +@Returns: + + + + + + + +@dbus_error_name: +@dbus_error_message: +@Returns: + + + + + + + +@error: +@dbus_error_name: +@dbus_error_message: +@format: +@Varargs: + + + + + + + +@error: +@dbus_error_name: +@dbus_error_message: +@format: +@var_args: + + + + + + + +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusintrospection.sgml b/docs/reference/gio/tmpl/gdbusintrospection.sgml new file mode 100644 index 0000000..175f0b3 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusintrospection.sgml @@ -0,0 +1,354 @@ + +gdbusintrospection + + + + + + + + + + + + + + + + + + + + + + + + + +@ref_count: +@key: +@value: +@annotations: + + + + + + +@ref_count: +@name: +@signature: +@annotations: + + + + + + +@ref_count: +@name: +@in_args: +@out_args: +@annotations: + + + + + + +@ref_count: +@name: +@args: +@annotations: + + + + + + +@G_DBUS_PROPERTY_INFO_FLAGS_NONE: +@G_DBUS_PROPERTY_INFO_FLAGS_READABLE: +@G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE: + + + + + + +@ref_count: +@name: +@signature: +@flags: +@annotations: + + + + + + +@ref_count: +@name: +@methods: +@signals: +@properties: +@annotations: + + + + + + +@ref_count: +@path: +@interfaces: +@nodes: +@annotations: + + + + + + +@annotations: +@name: +@Returns: + + + + + + + +@info: +@name: +@Returns: + + + + + + + +@info: +@name: +@Returns: + + + + + + + +@info: +@name: +@Returns: + + + + + + + +@info: +@indent: +@string_builder: + + + + + + + +@xml_data: +@error: +@Returns: + + + + + + + +@info: +@name: +@Returns: + + + + + + + +@info: +@indent: +@string_builder: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@info: +@Returns: + + + + + + + +@info: +@Returns: + + + + + + + +@info: +@Returns: + + + + + + + +@info: +@Returns: + + + + + + + +@info: +@Returns: + + + + + + + +@info: +@Returns: + + + + + + + +@info: +@Returns: + + + + + + + +@info: + + + + + + + +@info: + + + + + + + +@info: + + + + + + + +@info: + + + + + + + +@info: + + + + + + + +@info: + + + + + + + +@info: + + diff --git a/docs/reference/gio/tmpl/gdbusmessage.sgml b/docs/reference/gio/tmpl/gdbusmessage.sgml new file mode 100644 index 0000000..8a6102a --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusmessage.sgml @@ -0,0 +1,543 @@ + +GDBusMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@G_DBUS_MESSAGE_TYPE_INVALID: +@G_DBUS_MESSAGE_TYPE_METHOD_CALL: +@G_DBUS_MESSAGE_TYPE_METHOD_RETURN: +@G_DBUS_MESSAGE_TYPE_ERROR: +@G_DBUS_MESSAGE_TYPE_SIGNAL: + + + + + + +@G_DBUS_MESSAGE_FLAGS_NONE: +@G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED: +@G_DBUS_MESSAGE_FLAGS_NO_AUTO_START: + + + + + + +@G_DBUS_MESSAGE_HEADER_FIELD_INVALID: +@G_DBUS_MESSAGE_HEADER_FIELD_PATH: +@G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE: +@G_DBUS_MESSAGE_HEADER_FIELD_MEMBER: +@G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME: +@G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL: +@G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION: +@G_DBUS_MESSAGE_HEADER_FIELD_SENDER: +@G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE: +@G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS: + + + + + + +@G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN: +@G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN: + + + + + + +@void: +@Returns: + + + + + + + +@path: +@interface_: +@signal: +@Returns: + + + + + + + +@name: +@path: +@interface_: +@method: +@Returns: + + + + + + + +@method_call_message: +@Returns: + + + + + + + +@method_call_message: +@error_name: +@error_message_format: +@Varargs: +@Returns: + + + + + + + +@method_call_message: +@error_name: +@error_message_format: +@var_args: +@Returns: + + + + + + + +@method_call_message: +@error_name: +@error_message: +@Returns: + + + + + + + +@message: +@indent: +@Returns: + + + + + + + +@message: +@Returns: + + + + + + + +@message: + + + + + + + +@message: +@error: +@Returns: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@byte_order: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@type: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@serial: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@flags: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@body: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@fd_list: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@header_field: +@Returns: + + + + + + + +@message: +@header_field: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@value: + + + + + + + +@message: +@Returns: + + + + + + + +@message: +@out_size: +@capabilities: +@error: +@Returns: + + + + + + + +@blob: +@blob_len: +@error: +@Returns: + + + + + + + +@blob: +@blob_len: +@capabilities: +@error: +@Returns: + + + + + + + +@message: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusmethodinvocation.sgml b/docs/reference/gio/tmpl/gdbusmethodinvocation.sgml new file mode 100644 index 0000000..620eba4 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusmethodinvocation.sgml @@ -0,0 +1,172 @@ + +GDBusMethodInvocation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@Returns: + + + + + + + +@invocation: +@parameters: + + + + + + + +@invocation: +@domain: +@code: +@format: +@Varargs: + + + + + + + +@invocation: +@domain: +@code: +@format: +@var_args: + + + + + + + +@invocation: +@domain: +@code: +@message: + + + + + + + +@invocation: +@error: + + + + + + + +@invocation: +@error_name: +@error_message: + + diff --git a/docs/reference/gio/tmpl/gdbusnameowning.sgml b/docs/reference/gio/tmpl/gdbusnameowning.sgml new file mode 100644 index 0000000..14ed174 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusnameowning.sgml @@ -0,0 +1,127 @@ + +gdbusnameowning + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@name: +@user_data: + + + + + + + +@connection: +@name: +@user_data: + + + + + + + +@connection: +@name: +@user_data: + + + + + + + +@G_BUS_NAME_OWNER_FLAGS_NONE: +@G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT: +@G_BUS_NAME_OWNER_FLAGS_REPLACE: + + + + + + +@bus_type: +@name: +@flags: +@bus_acquired_handler: +@name_acquired_handler: +@name_lost_handler: +@user_data: +@user_data_free_func: +@Returns: + + + + + + + +@connection: +@name: +@flags: +@name_acquired_handler: +@name_lost_handler: +@user_data: +@user_data_free_func: +@Returns: + + + + + + + +@owner_id: + + + + + + + +@bus_type: +@name: +@flags: +@bus_acquired_closure: +@name_acquired_closure: +@name_lost_closure: +@Returns: + + + + + + + +@connection: +@name: +@flags: +@name_acquired_closure: +@name_lost_closure: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusnamewatching.sgml b/docs/reference/gio/tmpl/gdbusnamewatching.sgml new file mode 100644 index 0000000..9dee70b --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusnamewatching.sgml @@ -0,0 +1,115 @@ + +gdbusnamewatching + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@name: +@name_owner: +@user_data: + + + + + + + +@connection: +@name: +@user_data: + + + + + + + +@G_BUS_NAME_WATCHER_FLAGS_NONE: +@G_BUS_NAME_WATCHER_FLAGS_AUTO_START: + + + + + + +@bus_type: +@name: +@flags: +@name_appeared_handler: +@name_vanished_handler: +@user_data: +@user_data_free_func: +@Returns: + + + + + + + +@connection: +@name: +@flags: +@name_appeared_handler: +@name_vanished_handler: +@user_data: +@user_data_free_func: +@Returns: + + + + + + + +@watcher_id: + + + + + + + +@bus_type: +@name: +@flags: +@name_appeared_closure: +@name_vanished_closure: +@Returns: + + + + + + + +@connection: +@name: +@flags: +@name_appeared_closure: +@name_vanished_closure: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusproxy.sgml b/docs/reference/gio/tmpl/gdbusproxy.sgml new file mode 100644 index 0000000..9d3d588 --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusproxy.sgml @@ -0,0 +1,354 @@ + +GDBusProxy + + + + + + + + + + + + + + + + + + + + + + + + + +@G_DBUS_PROXY_FLAGS_NONE: +@G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES: +@G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS: +@G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START: + + + + + + + + + + + + +@gdbusproxy: the object which received the signal. +@arg1: +@arg2: + + + + + + +@gdbusproxy: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_properties_changed: +@g_signal: + + + + + + +@connection: +@flags: +@info: +@name: +@object_path: +@interface_name: +@cancellable: +@callback: +@user_data: + + + + + + + +@res: +@error: +@Returns: + + + + + + + +@connection: +@flags: +@info: +@name: +@object_path: +@interface_name: +@cancellable: +@error: +@Returns: + + + + + + + +@bus_type: +@flags: +@info: +@name: +@object_path: +@interface_name: +@cancellable: +@callback: +@user_data: + + + + + + + +@res: +@error: +@Returns: + + + + + + + +@bus_type: +@flags: +@info: +@name: +@object_path: +@interface_name: +@cancellable: +@error: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@timeout_msec: + + + + + + + +@proxy: +@property_name: +@Returns: + + + + + + + +@proxy: +@property_name: +@value: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@info: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@method_name: +@parameters: +@flags: +@timeout_msec: +@cancellable: +@callback: +@user_data: + + + + + + + +@proxy: +@res: +@error: +@Returns: + + + + + + + +@proxy: +@method_name: +@parameters: +@flags: +@timeout_msec: +@cancellable: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusserver.sgml b/docs/reference/gio/tmpl/gdbusserver.sgml new file mode 100644 index 0000000..2f9b32a --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusserver.sgml @@ -0,0 +1,142 @@ + +GDBusServer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gdbusserver: the object which received the signal. +@arg1: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@G_DBUS_SERVER_FLAGS_NONE: +@G_DBUS_SERVER_FLAGS_RUN_IN_THREAD: +@G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS: + + + + + + +@address: +@flags: +@guid: +@observer: +@cancellable: +@error: +@Returns: + + + + + + + +@server: + + + + + + + +@server: + + + + + + + +@server: +@Returns: + + + + + + + +@server: +@Returns: + + + + + + + +@server: +@Returns: + + + + + + + +@server: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdbusutils.sgml b/docs/reference/gio/tmpl/gdbusutils.sgml new file mode 100644 index 0000000..4040e9e --- /dev/null +++ b/docs/reference/gio/tmpl/gdbusutils.sgml @@ -0,0 +1,76 @@ + +gdbusutils + + + + + + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@string: +@Returns: + + + + + + + +@string: +@Returns: + + + + + + + +@string: +@Returns: + + + + + + + +@string: +@Returns: + + + + + + + +@string: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gdesktopappinfo.sgml b/docs/reference/gio/tmpl/gdesktopappinfo.sgml index 2e3f7ae..7b623f8 100644 --- a/docs/reference/gio/tmpl/gdesktopappinfo.sgml +++ b/docs/reference/gio/tmpl/gdesktopappinfo.sgml @@ -9,13 +9,11 @@ Desktop file based GAppInfo - - @@ -81,26 +79,3 @@ Desktop file based GAppInfo @desktop_env: - - - - - - - - - - - - - - - - - - -@lookup: -@uri_scheme: -@Returns: - - diff --git a/docs/reference/gio/tmpl/gdrive.sgml b/docs/reference/gio/tmpl/gdrive.sgml index d90dbdc..9b178d1 100644 --- a/docs/reference/gio/tmpl/gdrive.sgml +++ b/docs/reference/gio/tmpl/gdrive.sgml @@ -9,13 +9,11 @@ GDrive - - diff --git a/docs/reference/gio/tmpl/gemblem.sgml b/docs/reference/gio/tmpl/gemblem.sgml index e60397f..7fe06a7 100644 --- a/docs/reference/gio/tmpl/gemblem.sgml +++ b/docs/reference/gio/tmpl/gemblem.sgml @@ -9,13 +9,11 @@ GEmblem - - diff --git a/docs/reference/gio/tmpl/gemblemedicon.sgml b/docs/reference/gio/tmpl/gemblemedicon.sgml index 754b8d7..7ea9e05 100644 --- a/docs/reference/gio/tmpl/gemblemedicon.sgml +++ b/docs/reference/gio/tmpl/gemblemedicon.sgml @@ -9,13 +9,11 @@ GEmblemedIcon - - @@ -28,6 +26,11 @@ GEmblemedIcon + + + + + @@ -65,3 +68,11 @@ GEmblemedIcon @emblem: + + + + + +@emblemed: + + diff --git a/docs/reference/gio/tmpl/gfile.sgml b/docs/reference/gio/tmpl/gfile.sgml index 2f1c125..b6bd25a 100644 --- a/docs/reference/gio/tmpl/gfile.sgml +++ b/docs/reference/gio/tmpl/gfile.sgml @@ -9,13 +9,11 @@ GFile - - diff --git a/docs/reference/gio/tmpl/gfileattribute.sgml b/docs/reference/gio/tmpl/gfileattribute.sgml index c8f0792..26d387b 100644 --- a/docs/reference/gio/tmpl/gfileattribute.sgml +++ b/docs/reference/gio/tmpl/gfileattribute.sgml @@ -9,13 +9,11 @@ GFileAttribute - - diff --git a/docs/reference/gio/tmpl/gfiledescriptorbased.sgml b/docs/reference/gio/tmpl/gfiledescriptorbased.sgml index 65d28d0..a7eb17c 100644 --- a/docs/reference/gio/tmpl/gfiledescriptorbased.sgml +++ b/docs/reference/gio/tmpl/gfiledescriptorbased.sgml @@ -9,13 +9,11 @@ GFileDescriptorBased - - diff --git a/docs/reference/gio/tmpl/gfileenumerator.sgml b/docs/reference/gio/tmpl/gfileenumerator.sgml index 545b5dd..d28a894 100644 --- a/docs/reference/gio/tmpl/gfileenumerator.sgml +++ b/docs/reference/gio/tmpl/gfileenumerator.sgml @@ -9,13 +9,11 @@ GFileEnumerator - - diff --git a/docs/reference/gio/tmpl/gfileicon.sgml b/docs/reference/gio/tmpl/gfileicon.sgml index 7913876..575f9a0 100644 --- a/docs/reference/gio/tmpl/gfileicon.sgml +++ b/docs/reference/gio/tmpl/gfileicon.sgml @@ -9,13 +9,11 @@ GFileIcon - - diff --git a/docs/reference/gio/tmpl/gfileinfo.sgml b/docs/reference/gio/tmpl/gfileinfo.sgml index 4217d19..620f7af 100644 --- a/docs/reference/gio/tmpl/gfileinfo.sgml +++ b/docs/reference/gio/tmpl/gfileinfo.sgml @@ -9,13 +9,11 @@ GFileInfo - - @@ -544,6 +542,20 @@ GFileInfo + + + + + + + + + + + + + + diff --git a/docs/reference/gio/tmpl/gfileinputstream.sgml b/docs/reference/gio/tmpl/gfileinputstream.sgml index cc5b655..56d2847 100644 --- a/docs/reference/gio/tmpl/gfileinputstream.sgml +++ b/docs/reference/gio/tmpl/gfileinputstream.sgml @@ -9,13 +9,11 @@ GFileInputStream - - diff --git a/docs/reference/gio/tmpl/gfileiostream.sgml b/docs/reference/gio/tmpl/gfileiostream.sgml index 92311b2..8f2e2d2 100644 --- a/docs/reference/gio/tmpl/gfileiostream.sgml +++ b/docs/reference/gio/tmpl/gfileiostream.sgml @@ -9,13 +9,11 @@ GFileIOStream - - diff --git a/docs/reference/gio/tmpl/gfilemonitor.sgml b/docs/reference/gio/tmpl/gfilemonitor.sgml index e2f08f9..60bd467 100644 --- a/docs/reference/gio/tmpl/gfilemonitor.sgml +++ b/docs/reference/gio/tmpl/gfilemonitor.sgml @@ -9,13 +9,11 @@ GFileMonitor - - diff --git a/docs/reference/gio/tmpl/gfilenamecompleter.sgml b/docs/reference/gio/tmpl/gfilenamecompleter.sgml index 68bc0d6..16c65b6 100644 --- a/docs/reference/gio/tmpl/gfilenamecompleter.sgml +++ b/docs/reference/gio/tmpl/gfilenamecompleter.sgml @@ -9,13 +9,11 @@ GFilenameCompleter - - diff --git a/docs/reference/gio/tmpl/gfileoutputstream.sgml b/docs/reference/gio/tmpl/gfileoutputstream.sgml index 8d86a84..48bc7a7 100644 --- a/docs/reference/gio/tmpl/gfileoutputstream.sgml +++ b/docs/reference/gio/tmpl/gfileoutputstream.sgml @@ -9,13 +9,11 @@ GFileOutputStream - - diff --git a/docs/reference/gio/tmpl/gfilterinputstream.sgml b/docs/reference/gio/tmpl/gfilterinputstream.sgml index 79dc65d..3c19ba6 100644 --- a/docs/reference/gio/tmpl/gfilterinputstream.sgml +++ b/docs/reference/gio/tmpl/gfilterinputstream.sgml @@ -9,13 +9,11 @@ GFilterInputStream - - diff --git a/docs/reference/gio/tmpl/gfilteroutputstream.sgml b/docs/reference/gio/tmpl/gfilteroutputstream.sgml index 40dc44b..415fc86 100644 --- a/docs/reference/gio/tmpl/gfilteroutputstream.sgml +++ b/docs/reference/gio/tmpl/gfilteroutputstream.sgml @@ -9,13 +9,11 @@ GFilterOutputStream - - diff --git a/docs/reference/gio/tmpl/gicon.sgml b/docs/reference/gio/tmpl/gicon.sgml index 2852ecb..6020533 100644 --- a/docs/reference/gio/tmpl/gicon.sgml +++ b/docs/reference/gio/tmpl/gicon.sgml @@ -9,13 +9,11 @@ GIcon - - diff --git a/docs/reference/gio/tmpl/ginetaddress.sgml b/docs/reference/gio/tmpl/ginetaddress.sgml index 5b5283f..9e8cf28 100644 --- a/docs/reference/gio/tmpl/ginetaddress.sgml +++ b/docs/reference/gio/tmpl/ginetaddress.sgml @@ -9,13 +9,11 @@ GInetAddress - - diff --git a/docs/reference/gio/tmpl/ginetsocketaddress.sgml b/docs/reference/gio/tmpl/ginetsocketaddress.sgml index 5a84445..7fa3871 100644 --- a/docs/reference/gio/tmpl/ginetsocketaddress.sgml +++ b/docs/reference/gio/tmpl/ginetsocketaddress.sgml @@ -9,13 +9,11 @@ GInetSocketAddress - - diff --git a/docs/reference/gio/tmpl/ginitable.sgml b/docs/reference/gio/tmpl/ginitable.sgml index 595596f..5a4dc77 100644 --- a/docs/reference/gio/tmpl/ginitable.sgml +++ b/docs/reference/gio/tmpl/ginitable.sgml @@ -9,13 +9,11 @@ GInitable - - diff --git a/docs/reference/gio/tmpl/ginputstream.sgml b/docs/reference/gio/tmpl/ginputstream.sgml index 7a55e4f..353ab60 100644 --- a/docs/reference/gio/tmpl/ginputstream.sgml +++ b/docs/reference/gio/tmpl/ginputstream.sgml @@ -9,13 +9,11 @@ GInputStream - - diff --git a/docs/reference/gio/tmpl/gioerror.sgml b/docs/reference/gio/tmpl/gioerror.sgml index cd9b2f5..6dd055b 100644 --- a/docs/reference/gio/tmpl/gioerror.sgml +++ b/docs/reference/gio/tmpl/gioerror.sgml @@ -9,13 +9,11 @@ GIOError - - @@ -70,6 +68,14 @@ GIOError @G_IO_ERROR_ADDRESS_IN_USE: @G_IO_ERROR_PARTIAL_INPUT: @G_IO_ERROR_INVALID_DATA: +@G_IO_ERROR_DBUS_ERROR: +@G_IO_ERROR_HOST_UNREACHABLE: +@G_IO_ERROR_NETWORK_UNREACHABLE: +@G_IO_ERROR_CONNECTION_REFUSED: +@G_IO_ERROR_PROXY_FAILED: +@G_IO_ERROR_PROXY_AUTH_FAILED: +@G_IO_ERROR_PROXY_NEED_AUTH: +@G_IO_ERROR_PROXY_NOT_ALLOWED: @@ -80,3 +86,12 @@ GIOError @Returns: + + + + + +@error_code: +@Returns: + + diff --git a/docs/reference/gio/tmpl/giomodule.sgml b/docs/reference/gio/tmpl/giomodule.sgml index 84606a1..a29d44b 100644 --- a/docs/reference/gio/tmpl/giomodule.sgml +++ b/docs/reference/gio/tmpl/giomodule.sgml @@ -9,13 +9,11 @@ GIOModule - - diff --git a/docs/reference/gio/tmpl/gioscheduler.sgml b/docs/reference/gio/tmpl/gioscheduler.sgml index 485b3a2..6d4bc60 100644 --- a/docs/reference/gio/tmpl/gioscheduler.sgml +++ b/docs/reference/gio/tmpl/gioscheduler.sgml @@ -9,13 +9,11 @@ GIOScheduler - - diff --git a/docs/reference/gio/tmpl/giostream.sgml b/docs/reference/gio/tmpl/giostream.sgml index fe6e884..a2b6fd3 100644 --- a/docs/reference/gio/tmpl/giostream.sgml +++ b/docs/reference/gio/tmpl/giostream.sgml @@ -9,19 +9,27 @@ GIOStream - - + + + + + +@G_IO_STREAM_SPLICE_NONE: +@G_IO_STREAM_SPLICE_CLOSE_STREAM1: +@G_IO_STREAM_SPLICE_CLOSE_STREAM2: +@G_IO_STREAM_SPLICE_WAIT_FOR_BOTH: + @@ -61,6 +69,30 @@ GIOStream @Returns: + + + + + +@stream1: +@stream2: +@flags: +@io_priority: +@cancellable: +@callback: +@user_data: + + + + + + + +@result: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gloadableicon.sgml b/docs/reference/gio/tmpl/gloadableicon.sgml index 36919b2..f93acc8 100644 --- a/docs/reference/gio/tmpl/gloadableicon.sgml +++ b/docs/reference/gio/tmpl/gloadableicon.sgml @@ -9,13 +9,11 @@ GLoadableIcon - - diff --git a/docs/reference/gio/tmpl/gmemoryinputstream.sgml b/docs/reference/gio/tmpl/gmemoryinputstream.sgml index 9fd949f..7afd436 100644 --- a/docs/reference/gio/tmpl/gmemoryinputstream.sgml +++ b/docs/reference/gio/tmpl/gmemoryinputstream.sgml @@ -9,13 +9,11 @@ GMemoryInputStream - - diff --git a/docs/reference/gio/tmpl/gmemoryoutputstream.sgml b/docs/reference/gio/tmpl/gmemoryoutputstream.sgml index 8acb7b6..c3ca065 100644 --- a/docs/reference/gio/tmpl/gmemoryoutputstream.sgml +++ b/docs/reference/gio/tmpl/gmemoryoutputstream.sgml @@ -9,13 +9,11 @@ GMemoryOutputStream - - @@ -102,3 +100,12 @@ GMemoryOutputStream @Returns: + + + + + +@ostream: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gmount.sgml b/docs/reference/gio/tmpl/gmount.sgml index 647d4e0..7f6bdf6 100644 --- a/docs/reference/gio/tmpl/gmount.sgml +++ b/docs/reference/gio/tmpl/gmount.sgml @@ -9,13 +9,11 @@ GMount - - diff --git a/docs/reference/gio/tmpl/gmountoperation.sgml b/docs/reference/gio/tmpl/gmountoperation.sgml index ae3b2e9..7661423 100644 --- a/docs/reference/gio/tmpl/gmountoperation.sgml +++ b/docs/reference/gio/tmpl/gmountoperation.sgml @@ -9,13 +9,11 @@ GMountOperation - - diff --git a/docs/reference/gio/tmpl/gnetworkaddress.sgml b/docs/reference/gio/tmpl/gnetworkaddress.sgml index 4dd33c6..e9e65ae 100644 --- a/docs/reference/gio/tmpl/gnetworkaddress.sgml +++ b/docs/reference/gio/tmpl/gnetworkaddress.sgml @@ -9,13 +9,11 @@ GNetworkAddress - - @@ -38,6 +36,11 @@ GNetworkAddress + + + + + @@ -66,6 +69,15 @@ GNetworkAddress @Returns: + + + + + +@addr: +@Returns: + + @@ -77,3 +89,14 @@ GNetworkAddress @Returns: + + + + + +@uri: +@default_port: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gnetworkservice.sgml b/docs/reference/gio/tmpl/gnetworkservice.sgml index 9f13312..ca8d5d7 100644 --- a/docs/reference/gio/tmpl/gnetworkservice.sgml +++ b/docs/reference/gio/tmpl/gnetworkservice.sgml @@ -9,13 +9,11 @@ GNetworkService - - @@ -38,6 +36,11 @@ GNetworkService + + + + + @@ -81,3 +84,21 @@ GNetworkService @Returns: + + + + + +@srv: +@Returns: + + + + + + + +@srv: +@scheme: + + diff --git a/docs/reference/gio/tmpl/goutputstream.sgml b/docs/reference/gio/tmpl/goutputstream.sgml index 567151a..21a01f6 100644 --- a/docs/reference/gio/tmpl/goutputstream.sgml +++ b/docs/reference/gio/tmpl/goutputstream.sgml @@ -9,13 +9,11 @@ GOutputStream - - diff --git a/docs/reference/gio/tmpl/gpermission.sgml b/docs/reference/gio/tmpl/gpermission.sgml new file mode 100644 index 0000000..e65d96e --- /dev/null +++ b/docs/reference/gio/tmpl/gpermission.sgml @@ -0,0 +1,147 @@ + +gpermission + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@permission: +@Returns: + + + + + + + +@permission: +@Returns: + + + + + + + +@permission: +@Returns: + + + + + + + +@permission: +@cancellable: +@error: +@Returns: + + + + + + + +@permission: +@cancellable: +@callback: +@user_data: + + + + + + + +@permission: +@result: +@error: +@Returns: + + + + + + + +@permission: +@cancellable: +@error: +@Returns: + + + + + + + +@permission: +@cancellable: +@callback: +@user_data: + + + + + + + +@permission: +@result: +@error: +@Returns: + + + + + + + +@permission: +@allowed: +@can_acquire: +@can_release: + + diff --git a/docs/reference/gio/tmpl/gpollableinputstream.sgml b/docs/reference/gio/tmpl/gpollableinputstream.sgml new file mode 100644 index 0000000..24295f2 --- /dev/null +++ b/docs/reference/gio/tmpl/gpollableinputstream.sgml @@ -0,0 +1,99 @@ + +GPollableInputStream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@can_poll: +@is_readable: +@create_source: +@read_nonblocking: + + + + + + +@stream: +@Returns: + + + + + + + +@stream: +@Returns: + + + + + + + +@stream: +@cancellable: +@Returns: + + + + + + + +@stream: +@buffer: +@size: +@cancellable: +@error: +@Returns: + + + + + + + +@pollable_stream: +@user_data: +@Returns: + + + + + + + +@pollable_stream: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gpollableoutputstream.sgml b/docs/reference/gio/tmpl/gpollableoutputstream.sgml new file mode 100644 index 0000000..b6ce479 --- /dev/null +++ b/docs/reference/gio/tmpl/gpollableoutputstream.sgml @@ -0,0 +1,80 @@ + +GPollableOutputStream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@can_poll: +@is_writable: +@create_source: +@write_nonblocking: + + + + + + +@stream: +@Returns: + + + + + + + +@stream: +@Returns: + + + + + + + +@stream: +@cancellable: +@Returns: + + + + + + + +@stream: +@buffer: +@size: +@cancellable: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gproxy.sgml b/docs/reference/gio/tmpl/gproxy.sgml new file mode 100644 index 0000000..1acd87c --- /dev/null +++ b/docs/reference/gio/tmpl/gproxy.sgml @@ -0,0 +1,101 @@ + +GProxy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@connect: +@connect_async: +@connect_finish: +@supports_hostname: + + + + + + + + + + + + + +@proxy: +@connection: +@proxy_address: +@cancellable: +@error: +@Returns: + + + + + + + +@proxy: +@connection: +@proxy_address: +@cancellable: +@callback: +@user_data: + + + + + + + +@proxy: +@result: +@error: +@Returns: + + + + + + + +@protocol: +@Returns: + + + + + + + +@proxy: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gproxyaddress.sgml b/docs/reference/gio/tmpl/gproxyaddress.sgml new file mode 100644 index 0000000..f1bef8e --- /dev/null +++ b/docs/reference/gio/tmpl/gproxyaddress.sgml @@ -0,0 +1,120 @@ + +GProxyAddress + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@proxy: +@Returns: + + + + + + + +@inetaddr: +@port: +@protocol: +@dest_hostname: +@dest_port: +@username: +@password: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gproxyresolver.sgml b/docs/reference/gio/tmpl/gproxyresolver.sgml new file mode 100644 index 0000000..eb668ab --- /dev/null +++ b/docs/reference/gio/tmpl/gproxyresolver.sgml @@ -0,0 +1,99 @@ + +GProxyResolver + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@is_supported: +@lookup: +@lookup_async: +@lookup_finish: + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@resolver: +@Returns: + + + + + + + +@resolver: +@uri: +@cancellable: +@error: +@Returns: + + + + + + + +@resolver: +@uri: +@cancellable: +@callback: +@user_data: + + + + + + + +@resolver: +@result: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gresolver.sgml b/docs/reference/gio/tmpl/gresolver.sgml index 235a53a..492a93b 100644 --- a/docs/reference/gio/tmpl/gresolver.sgml +++ b/docs/reference/gio/tmpl/gresolver.sgml @@ -9,13 +9,11 @@ GResolver - - diff --git a/docs/reference/gio/tmpl/gseekable.sgml b/docs/reference/gio/tmpl/gseekable.sgml index d918aeb..cc4b5b1 100644 --- a/docs/reference/gio/tmpl/gseekable.sgml +++ b/docs/reference/gio/tmpl/gseekable.sgml @@ -9,13 +9,11 @@ GSeekable - - diff --git a/docs/reference/gio/tmpl/gsettings.sgml b/docs/reference/gio/tmpl/gsettings.sgml new file mode 100644 index 0000000..f383c5a --- /dev/null +++ b/docs/reference/gio/tmpl/gsettings.sgml @@ -0,0 +1,534 @@ + +GSettings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gsettings: the object which received the signal. +@arg1: +@arg2: +@Returns: + + + + + + +@gsettings: the object which received the signal. +@arg1: + + + + + + +@gsettings: the object which received the signal. +@arg1: +@Returns: + + + + + + +@gsettings: the object which received the signal. +@arg1: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@schema: +@Returns: + + + + + + + +@schema: +@path: +@Returns: + + + + + + + +@schema: +@backend: +@Returns: + + + + + + + +@schema: +@backend: +@path: +@Returns: + + + + + + + +@void: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@name: +@Returns: + + + + + + + +@settings: + + + + + + + +@settings: + + + + + + + +@settings: + + + + + + + +@settings: +@Returns: + + + + + + + +@settings: +@name: +@Returns: + + + + + + + +@settings: +@key: + + + + + + + +@settings: +@Returns: + + + + + + + +@settings: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@format: +@Varargs: + + + + + + + +@settings: +@key: +@format: +@Varargs: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@settings: +@key: +@Returns: + + + + + + + +@settings: +@key: +@value: +@Returns: + + + + + + + +@value: +@result: +@user_data: +@Returns: + + + + + + + +@settings: +@key: +@mapping: +@user_data: +@Returns: + + + + + + + +@G_SETTINGS_BIND_DEFAULT: +@G_SETTINGS_BIND_GET: +@G_SETTINGS_BIND_SET: +@G_SETTINGS_BIND_NO_SENSITIVITY: +@G_SETTINGS_BIND_GET_NO_CHANGES: +@G_SETTINGS_BIND_INVERT_BOOLEAN: + + + + + + +@settings: +@key: +@object: +@property: +@flags: + + + + + + + +@settings: +@key: +@object: +@property: +@flags: +@get_mapping: +@set_mapping: +@user_data: +@destroy: + + + + + + + +@settings: +@key: +@object: +@property: +@inverted: + + + + + + + +@object: +@property: + + + + + + + +@value: +@expected_type: +@user_data: +@Returns: + + + + + + + +@value: +@variant: +@user_data: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gsettingsbackend.sgml b/docs/reference/gio/tmpl/gsettingsbackend.sgml new file mode 100644 index 0000000..37b6334 --- /dev/null +++ b/docs/reference/gio/tmpl/gsettingsbackend.sgml @@ -0,0 +1,133 @@ + +GSettingsBackend + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: +@read: +@get_writable: +@write: +@write_tree: +@reset: +@subscribe: +@unsubscribe: +@sync: +@get_permission: +@padding: + + + + + + + + + + + + + +@backend: +@key: +@origin_tag: + + + + + + + +@backend: +@path: +@origin_tag: + + + + + + + +@backend: +@path: +@items: +@origin_tag: + + + + + + + +@backend: +@path: + + + + + + + +@backend: +@key: + + + + + + + +@backend: +@tree: +@origin_tag: + + + + + + + +@tree: +@path: +@keys: +@values: + + + + + + + +@filename: +@root_path: +@root_group: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gsimpleaction.sgml b/docs/reference/gio/tmpl/gsimpleaction.sgml new file mode 100644 index 0000000..b765df9 --- /dev/null +++ b/docs/reference/gio/tmpl/gsimpleaction.sgml @@ -0,0 +1,99 @@ + +GSimpleAction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gsimpleaction: the object which received the signal. +@arg1: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: +@activate: + + + + + + +@name: +@parameter_type: +@Returns: + + + + + + + +@name: +@parameter_type: +@state: +@Returns: + + + + + + + +@simple: +@enabled: + + diff --git a/docs/reference/gio/tmpl/gsimpleactiongroup.sgml b/docs/reference/gio/tmpl/gsimpleactiongroup.sgml new file mode 100644 index 0000000..10094f7 --- /dev/null +++ b/docs/reference/gio/tmpl/gsimpleactiongroup.sgml @@ -0,0 +1,65 @@ + +GSimpleActionGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@simple: +@action_name: +@Returns: + + + + + + + +@simple: +@action: + + + + + + + +@simple: +@action_name: + + diff --git a/docs/reference/gio/tmpl/gsimpleasyncresult.sgml b/docs/reference/gio/tmpl/gsimpleasyncresult.sgml index ce116fa..0528030 100644 --- a/docs/reference/gio/tmpl/gsimpleasyncresult.sgml +++ b/docs/reference/gio/tmpl/gsimpleasyncresult.sgml @@ -9,13 +9,11 @@ GSimpleAsyncResult - - @@ -77,6 +75,18 @@ GSimpleAsyncResult @Returns: + + + + + +@source_object: +@callback: +@user_data: +@error: +@Returns: + + @@ -197,6 +207,15 @@ GSimpleAsyncResult @error: + + + + + +@simple: +@error: + + @@ -256,3 +275,14 @@ GSimpleAsyncResult @error: + + + + + +@object: +@callback: +@user_data: +@error: + + diff --git a/docs/reference/gio/tmpl/gsimplepermission.sgml b/docs/reference/gio/tmpl/gsimplepermission.sgml new file mode 100644 index 0000000..c2aa8ca --- /dev/null +++ b/docs/reference/gio/tmpl/gsimplepermission.sgml @@ -0,0 +1,37 @@ + +gsimplepermission + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@allowed: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gsocket.sgml b/docs/reference/gio/tmpl/gsocket.sgml index daa6050..44103b8 100644 --- a/docs/reference/gio/tmpl/gsocket.sgml +++ b/docs/reference/gio/tmpl/gsocket.sgml @@ -9,13 +9,11 @@ GSocket - - @@ -68,6 +66,11 @@ GSocket + + + + + @@ -252,6 +255,20 @@ GSocket @Returns: + + + + + +@socket: +@buffer: +@size: +@blocking: +@cancellable: +@error: +@Returns: + + @@ -296,6 +313,20 @@ GSocket @Returns: + + + + + +@socket: +@buffer: +@size: +@blocking: +@cancellable: +@error: +@Returns: + + @@ -423,6 +454,24 @@ GSocket @keepalive: + + + + + +@socket: +@Returns: + + + + + + + +@socket: +@timeout: + + @@ -488,3 +537,13 @@ GSocket @Returns: + + + + + +@socket: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gsocketaddress.sgml b/docs/reference/gio/tmpl/gsocketaddress.sgml index ec60606..9192f22 100644 --- a/docs/reference/gio/tmpl/gsocketaddress.sgml +++ b/docs/reference/gio/tmpl/gsocketaddress.sgml @@ -9,13 +9,11 @@ GSocketAddress - - diff --git a/docs/reference/gio/tmpl/gsocketclient.sgml b/docs/reference/gio/tmpl/gsocketclient.sgml index 1b7a2e7..30ef038 100644 --- a/docs/reference/gio/tmpl/gsocketclient.sgml +++ b/docs/reference/gio/tmpl/gsocketclient.sgml @@ -9,13 +9,11 @@ GSocketClient - - @@ -28,6 +26,11 @@ GSocketClient + + + + + @@ -43,11 +46,35 @@ GSocketClient + + + + + + + + + + + + + + + + + + + + +@client: +@protocol: + + @@ -166,6 +193,43 @@ GSocketClient @Returns: + + + + + +@client: +@uri: +@default_port: +@cancellable: +@error: +@Returns: + + + + + + + +@client: +@uri: +@default_port: +@cancellable: +@callback: +@user_data: + + + + + + + +@client: +@result: +@error: +@Returns: + + @@ -202,6 +266,42 @@ GSocketClient @type: + + + + + +@client: +@timeout: + + + + + + + +@client: +@enable: + + + + + + + +@client: +@tls: + + + + + + + +@client: +@flags: + + @@ -238,3 +338,39 @@ GSocketClient @Returns: + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gsocketconnectable.sgml b/docs/reference/gio/tmpl/gsocketconnectable.sgml index 769d4a6..06a6203 100644 --- a/docs/reference/gio/tmpl/gsocketconnectable.sgml +++ b/docs/reference/gio/tmpl/gsocketconnectable.sgml @@ -9,13 +9,11 @@ GSocketConnectable - - @@ -35,6 +33,7 @@ GSocketConnectable @g_iface: @enumerate: +@proxy_enumerate: @@ -45,6 +44,15 @@ GSocketConnectable @Returns: + + + + + +@connectable: +@Returns: + + @@ -84,3 +92,19 @@ GSocketConnectable @Returns: + + + + + + + + + + + + + + + + diff --git a/docs/reference/gio/tmpl/gsocketconnection.sgml b/docs/reference/gio/tmpl/gsocketconnection.sgml index a2ed560..4a11ae0 100644 --- a/docs/reference/gio/tmpl/gsocketconnection.sgml +++ b/docs/reference/gio/tmpl/gsocketconnection.sgml @@ -9,13 +9,11 @@ GSocketConnection - - @@ -62,64 +60,6 @@ GSocketConnection @Returns: - - - - - - - - - - - - - - - - -@connection: -@graceful_disconnect: - - - - - - - -@connection: -@Returns: - - - - - - - - - - - - - -@connection: -@cancellable: -@error: -@Returns: - - - - - - - -@connection: -@fd: -@cancellable: -@error: -@Returns: - - diff --git a/docs/reference/gio/tmpl/gsocketcontrolmessage.sgml b/docs/reference/gio/tmpl/gsocketcontrolmessage.sgml index f1a83d8..ccb6a3f 100644 --- a/docs/reference/gio/tmpl/gsocketcontrolmessage.sgml +++ b/docs/reference/gio/tmpl/gsocketcontrolmessage.sgml @@ -9,13 +9,11 @@ GSocketControlMessage - - diff --git a/docs/reference/gio/tmpl/gsocketlistener.sgml b/docs/reference/gio/tmpl/gsocketlistener.sgml index 85249f6..89c6c34 100644 --- a/docs/reference/gio/tmpl/gsocketlistener.sgml +++ b/docs/reference/gio/tmpl/gsocketlistener.sgml @@ -9,13 +9,11 @@ GSocketListener - - diff --git a/docs/reference/gio/tmpl/gsocketservice.sgml b/docs/reference/gio/tmpl/gsocketservice.sgml index 347c172..ca7e626 100644 --- a/docs/reference/gio/tmpl/gsocketservice.sgml +++ b/docs/reference/gio/tmpl/gsocketservice.sgml @@ -9,13 +9,11 @@ GSocketService - - diff --git a/docs/reference/gio/tmpl/gsrvtarget.sgml b/docs/reference/gio/tmpl/gsrvtarget.sgml index fcd6807..c9d8172 100644 --- a/docs/reference/gio/tmpl/gsrvtarget.sgml +++ b/docs/reference/gio/tmpl/gsrvtarget.sgml @@ -9,13 +9,11 @@ GSrvTarget - - diff --git a/docs/reference/gio/tmpl/gtcpconnection.sgml b/docs/reference/gio/tmpl/gtcpconnection.sgml new file mode 100644 index 0000000..0f7bcad --- /dev/null +++ b/docs/reference/gio/tmpl/gtcpconnection.sgml @@ -0,0 +1,51 @@ + +GTcpConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@graceful_disconnect: + + + + + + + +@connection: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gtcpwrapperconnection.sgml b/docs/reference/gio/tmpl/gtcpwrapperconnection.sgml new file mode 100644 index 0000000..b253c38 --- /dev/null +++ b/docs/reference/gio/tmpl/gtcpwrapperconnection.sgml @@ -0,0 +1,52 @@ + +GTcpWrapperConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@base_io_stream: +@socket: +@Returns: + + + + + + + +@conn: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gthemedicon.sgml b/docs/reference/gio/tmpl/gthemedicon.sgml index 3324a03..998f5ac 100644 --- a/docs/reference/gio/tmpl/gthemedicon.sgml +++ b/docs/reference/gio/tmpl/gthemedicon.sgml @@ -9,13 +9,11 @@ GThemedIcon - - diff --git a/docs/reference/gio/tmpl/gthreadedsocketservice.sgml b/docs/reference/gio/tmpl/gthreadedsocketservice.sgml index a780a14..ad54275 100644 --- a/docs/reference/gio/tmpl/gthreadedsocketservice.sgml +++ b/docs/reference/gio/tmpl/gthreadedsocketservice.sgml @@ -9,13 +9,11 @@ GThreadedSocketService - - diff --git a/docs/reference/gio/tmpl/gtls.sgml b/docs/reference/gio/tmpl/gtls.sgml new file mode 100644 index 0000000..3f0edf7 --- /dev/null +++ b/docs/reference/gio/tmpl/gtls.sgml @@ -0,0 +1,65 @@ + +gtls + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@G_TLS_ERROR_UNAVAILABLE: +@G_TLS_ERROR_MISC: +@G_TLS_ERROR_BAD_CERTIFICATE: +@G_TLS_ERROR_NOT_TLS: +@G_TLS_ERROR_HANDSHAKE: +@G_TLS_ERROR_CERTIFICATE_REQUIRED: +@G_TLS_ERROR_EOF: + + + + + + +@G_TLS_AUTHENTICATION_NONE: +@G_TLS_AUTHENTICATION_REQUESTED: +@G_TLS_AUTHENTICATION_REQUIRED: + + + + + + +@G_TLS_CERTIFICATE_UNKNOWN_CA: +@G_TLS_CERTIFICATE_BAD_IDENTITY: +@G_TLS_CERTIFICATE_NOT_ACTIVATED: +@G_TLS_CERTIFICATE_EXPIRED: +@G_TLS_CERTIFICATE_REVOKED: +@G_TLS_CERTIFICATE_INSECURE: +@G_TLS_CERTIFICATE_GENERIC_ERROR: +@G_TLS_CERTIFICATE_VALIDATE_ALL: + diff --git a/docs/reference/gio/tmpl/gtlsbackend.sgml b/docs/reference/gio/tmpl/gtlsbackend.sgml new file mode 100644 index 0000000..cba3000 --- /dev/null +++ b/docs/reference/gio/tmpl/gtlsbackend.sgml @@ -0,0 +1,91 @@ + +GTlsBackend + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@supports_tls: +@get_certificate_type: +@get_client_connection_type: +@get_server_connection_type: + + + + + + +@void: +@Returns: + + + + + + + +@backend: +@Returns: + + + + + + + +@backend: +@Returns: + + + + + + + +@backend: +@Returns: + + + + + + + +@backend: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gtlscertificate.sgml b/docs/reference/gio/tmpl/gtlscertificate.sgml new file mode 100644 index 0000000..ccb1435 --- /dev/null +++ b/docs/reference/gio/tmpl/gtlscertificate.sgml @@ -0,0 +1,115 @@ + +GTlsCertificate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@data: +@length: +@error: +@Returns: + + + + + + + +@file: +@error: +@Returns: + + + + + + + +@cert_file: +@key_file: +@error: +@Returns: + + + + + + + +@file: +@error: +@Returns: + + + + + + + +@cert: +@Returns: + + + + + + + +@cert: +@identity: +@trusted_ca: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gtlsclientconnection.sgml b/docs/reference/gio/tmpl/gtlsclientconnection.sgml new file mode 100644 index 0000000..63bdafe --- /dev/null +++ b/docs/reference/gio/tmpl/gtlsclientconnection.sgml @@ -0,0 +1,129 @@ + +GTlsClientConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: + + + + + + +@base_io_stream: +@server_identity: +@error: +@Returns: + + + + + + + +@conn: +@identity: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@flags: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@use_ssl3: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gtlsconnection.sgml b/docs/reference/gio/tmpl/gtlsconnection.sgml new file mode 100644 index 0000000..ebe0640 --- /dev/null +++ b/docs/reference/gio/tmpl/gtlsconnection.sgml @@ -0,0 +1,217 @@ + +GTlsConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gtlsconnection: the object which received the signal. +@arg1: +@arg2: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@conn: +@certificate: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@require_close_notify: + + + + + + + +@conn: +@Returns: + + + + + + + +@G_TLS_REHANDSHAKE_NEVER: +@G_TLS_REHANDSHAKE_SAFELY: +@G_TLS_REHANDSHAKE_UNSAFELY: + + + + + + +@conn: +@mode: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@use_system_certdb: + + + + + + + +@conn: +@Returns: + + + + + + + +@conn: +@cancellable: +@error: +@Returns: + + + + + + + +@conn: +@io_priority: +@cancellable: +@callback: +@user_data: + + + + + + + +@conn: +@result: +@error: +@Returns: + + + + + + + +@conn: +@peer_cert: +@errors: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gtlsserverconnection.sgml b/docs/reference/gio/tmpl/gtlsserverconnection.sgml new file mode 100644 index 0000000..3a028d4 --- /dev/null +++ b/docs/reference/gio/tmpl/gtlsserverconnection.sgml @@ -0,0 +1,51 @@ + +GTlsServerConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: + + + + + + +@base_io_stream: +@certificate: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gunixconnection.sgml b/docs/reference/gio/tmpl/gunixconnection.sgml new file mode 100644 index 0000000..a47acaa --- /dev/null +++ b/docs/reference/gio/tmpl/gunixconnection.sgml @@ -0,0 +1,73 @@ + +GUnixConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@fd: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@cancellable: +@error: +@Returns: + + + + + + + +@connection: +@cancellable: +@error: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gunixcredentialsmessage.sgml b/docs/reference/gio/tmpl/gunixcredentialsmessage.sgml new file mode 100644 index 0000000..847f73b --- /dev/null +++ b/docs/reference/gio/tmpl/gunixcredentialsmessage.sgml @@ -0,0 +1,76 @@ + +GUnixCredentialsMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: + + + + + + +@void: +@Returns: + + + + + + + +@credentials: +@Returns: + + + + + + + +@message: +@Returns: + + + + + + + +@void: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gunixfdlist.sgml b/docs/reference/gio/tmpl/gunixfdlist.sgml index 54613d1..90ac906 100644 --- a/docs/reference/gio/tmpl/gunixfdlist.sgml +++ b/docs/reference/gio/tmpl/gunixfdlist.sgml @@ -9,13 +9,11 @@ GUnixFDList - - diff --git a/docs/reference/gio/tmpl/gunixfdmessage.sgml b/docs/reference/gio/tmpl/gunixfdmessage.sgml index ab5bab0..e2d3210 100644 --- a/docs/reference/gio/tmpl/gunixfdmessage.sgml +++ b/docs/reference/gio/tmpl/gunixfdmessage.sgml @@ -9,13 +9,11 @@ GUnixFDMessage - - diff --git a/docs/reference/gio/tmpl/gunixinputstream.sgml b/docs/reference/gio/tmpl/gunixinputstream.sgml index 4dcdd92..448023a 100644 --- a/docs/reference/gio/tmpl/gunixinputstream.sgml +++ b/docs/reference/gio/tmpl/gunixinputstream.sgml @@ -9,13 +9,11 @@ GUnixInputStream - - diff --git a/docs/reference/gio/tmpl/gunixmounts.sgml b/docs/reference/gio/tmpl/gunixmounts.sgml index 10de671..58d31d2 100644 --- a/docs/reference/gio/tmpl/gunixmounts.sgml +++ b/docs/reference/gio/tmpl/gunixmounts.sgml @@ -9,25 +9,17 @@ Unix Mounts - - - - - - - - diff --git a/docs/reference/gio/tmpl/gunixoutputstream.sgml b/docs/reference/gio/tmpl/gunixoutputstream.sgml index 5442bd4..ce3197b 100644 --- a/docs/reference/gio/tmpl/gunixoutputstream.sgml +++ b/docs/reference/gio/tmpl/gunixoutputstream.sgml @@ -9,13 +9,11 @@ GUnixOutputStream - - diff --git a/docs/reference/gio/tmpl/gunixsocketaddress.sgml b/docs/reference/gio/tmpl/gunixsocketaddress.sgml index 0bbefd0..718309b 100644 --- a/docs/reference/gio/tmpl/gunixsocketaddress.sgml +++ b/docs/reference/gio/tmpl/gunixsocketaddress.sgml @@ -9,13 +9,11 @@ GUnixSocketAddress - - @@ -33,6 +31,11 @@ GUnixSocketAddress + + + + + @@ -43,6 +46,17 @@ GUnixSocketAddress + + + + + +@G_UNIX_SOCKET_ADDRESS_INVALID: +@G_UNIX_SOCKET_ADDRESS_ANONYMOUS: +@G_UNIX_SOCKET_ADDRESS_PATH: +@G_UNIX_SOCKET_ADDRESS_ABSTRACT: +@G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED: + @@ -62,6 +76,17 @@ GUnixSocketAddress @Returns: + + + + + +@path: +@path_len: +@type: +@Returns: + + @@ -71,6 +96,15 @@ GUnixSocketAddress @Returns: + + + + + +@address: +@Returns: + + diff --git a/docs/reference/gio/tmpl/gvfs.sgml b/docs/reference/gio/tmpl/gvfs.sgml index b98f97c..1caff6b 100644 --- a/docs/reference/gio/tmpl/gvfs.sgml +++ b/docs/reference/gio/tmpl/gvfs.sgml @@ -9,13 +9,11 @@ GVfs - - diff --git a/docs/reference/gio/tmpl/gvolume.sgml b/docs/reference/gio/tmpl/gvolume.sgml index 8a759e2..48593a0 100644 --- a/docs/reference/gio/tmpl/gvolume.sgml +++ b/docs/reference/gio/tmpl/gvolume.sgml @@ -9,13 +9,11 @@ GVolume - - diff --git a/docs/reference/gio/tmpl/gvolumemonitor.sgml b/docs/reference/gio/tmpl/gvolumemonitor.sgml index ecd4128..62c6143 100644 --- a/docs/reference/gio/tmpl/gvolumemonitor.sgml +++ b/docs/reference/gio/tmpl/gvolumemonitor.sgml @@ -9,13 +9,11 @@ GVolumeMonitor - - diff --git a/docs/reference/gio/tmpl/gzcompressor.sgml b/docs/reference/gio/tmpl/gzcompressor.sgml index 765ce79..72dacce 100644 --- a/docs/reference/gio/tmpl/gzcompressor.sgml +++ b/docs/reference/gio/tmpl/gzcompressor.sgml @@ -9,13 +9,11 @@ GZlibCompressor - - @@ -28,6 +26,11 @@ GZlibCompressor + + + + + @@ -57,3 +60,21 @@ GZlibCompressor @Returns: + + + + + +@compressor: +@Returns: + + + + + + + +@compressor: +@file_info: + + diff --git a/docs/reference/gio/tmpl/gzdecompressor.sgml b/docs/reference/gio/tmpl/gzdecompressor.sgml index 69cf3bf..699001a 100644 --- a/docs/reference/gio/tmpl/gzdecompressor.sgml +++ b/docs/reference/gio/tmpl/gzdecompressor.sgml @@ -9,13 +9,11 @@ GZlibDecompressor - - @@ -28,6 +26,11 @@ GZlibDecompressor + + + + + @@ -42,3 +45,12 @@ GZlibDecompressor @Returns: + + + + + +@decompressor: +@Returns: + + diff --git a/docs/reference/gio/version.xml b/docs/reference/gio/version.xml index 5827d9b..474d182 100644 --- a/docs/reference/gio/version.xml +++ b/docs/reference/gio/version.xml @@ -1 +1 @@ -2.24.2 +2.27.5 diff --git a/docs/reference/glib/Makefile.am b/docs/reference/glib/Makefile.am index a61110b..27fdf0b 100644 --- a/docs/reference/glib/Makefile.am +++ b/docs/reference/glib/Makefile.am @@ -10,7 +10,7 @@ DOC_MODULE=glib DOC_MAIN_SGML_FILE=glib-docs.sgml # The directory containing the source code. Relative to $(srcdir) -DOC_SOURCE_DIR=../../.. +DOC_SOURCE_DIR=../../../glib ../../../gmodule # Extra options to supply to gtkdoc-scan SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED" --ignore-decorators="GLIB_VAR" @@ -24,10 +24,6 @@ CFILE_GLOB=$(top_srcdir)/glib/*.c $(top_srcdir)/gmodule/*.c # Headers to ignore IGNORE_HFILES= \ - build \ - gobject \ - gio \ - config.h \ gdatasetprivate.h \ glibintl.h \ gbsearcharray.h \ @@ -36,10 +32,10 @@ IGNORE_HFILES= \ gunicomp.h \ gunidecomp.h \ gunichartables.h \ - glibconfig-sysdefs.h \ + glib_trace.h \ + libcharset.h \ gdebug.h \ gprintfint.h \ - galias.h \ gmirroringtable.h \ gscripttable.h \ glib-mirroring-tab \ @@ -93,18 +89,32 @@ man_MANS = \ glib-gettextize.1 \ gtester.1 \ gtester-report.1 + if ENABLE_MAN -%.1 : %.xml +.xml.1: @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< +dist-local-check-mans-enabled: + if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +else + +$(man_MANS): + echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. + echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +dist-local-check-mans-enabled: + echo "*** --enable-man must be used in order to make dist" + false + endif -BUILT_EXTRA_DIST = $(man_MANS) +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) + +EXTRA_DIST += $(man_MANS) -dist-hook-local: $(BUILT_EXTRA_DIST) - files='$(BUILT_EXTRA_DIST)'; \ - for f in $$files; do \ - if test -f $$f; then d=.; else d=$(srcdir); fi; \ - cp $$d/$$f $(distdir) || exit 1; done +dist-hook-local: dist-local-check-mans-enabled glib-docs-clean all-local +glib-docs-clean: clean + cd $(srcdir) && rm -rf xml html diff --git a/docs/reference/glib/Makefile.in b/docs/reference/glib/Makefile.in index 06db780..b7a782f 100644 --- a/docs/reference/glib/Makefile.in +++ b/docs/reference/glib/Makefile.in @@ -51,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -93,6 +93,7 @@ NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -117,11 +118,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -135,13 +139,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -188,6 +195,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -195,6 +204,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -220,6 +230,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -236,6 +248,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -245,11 +258,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -265,11 +280,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -283,7 +304,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -316,7 +336,7 @@ EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \ file-name-encodings.png file-name-encodings.sxd \ mainloop-states.fig mainloop-states.png mainloop-states.eps \ - version.xml.in + version.xml.in $(man_MANS) TEST_PROGS = AUTOMAKE_OPTIONS = 1.6 @@ -327,7 +347,7 @@ DOC_MODULE = glib DOC_MAIN_SGML_FILE = glib-docs.sgml # The directory containing the source code. Relative to $(srcdir) -DOC_SOURCE_DIR = ../../.. +DOC_SOURCE_DIR = ../../../glib ../../../gmodule # Extra options to supply to gtkdoc-scan SCAN_OPTIONS = --deprecated-guards="G_DISABLE_DEPRECATED" --ignore-decorators="GLIB_VAR" @@ -341,10 +361,6 @@ CFILE_GLOB = $(top_srcdir)/glib/*.c $(top_srcdir)/gmodule/*.c # Headers to ignore IGNORE_HFILES = \ - build \ - gobject \ - gio \ - config.h \ gdatasetprivate.h \ glibintl.h \ gbsearcharray.h \ @@ -353,10 +369,10 @@ IGNORE_HFILES = \ gunicomp.h \ gunidecomp.h \ gunichartables.h \ - glibconfig-sysdefs.h \ + glib_trace.h \ + libcharset.h \ gdebug.h \ gprintfint.h \ - galias.h \ gmirroringtable.h \ gscripttable.h \ glib-mirroring-tab \ @@ -437,10 +453,11 @@ man_MANS = \ gtester.1 \ gtester-report.1 -BUILT_EXTRA_DIST = $(man_MANS) +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) all: all-am .SUFFIXES: +.SUFFIXES: .1 .xml $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.decl $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -604,6 +621,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am @@ -693,13 +711,16 @@ uninstall-man: uninstall-man1 ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -726,8 +747,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -736,9 +761,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: @@ -752,8 +797,11 @@ $(REPORT_FILES): sgml-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) - @cd $(srcdir) && \ - gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ @@ -786,8 +834,11 @@ $(srcdir)/tmpl/*.sgml: sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) - @cd $(srcdir) && \ - gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @@ -897,14 +948,24 @@ dist-hook: dist-check-gtkdoc dist-hook-local .PHONY : dist-hook-local docs -@ENABLE_MAN_TRUE@%.1 : %.xml +@ENABLE_MAN_TRUE@.xml.1: @ENABLE_MAN_TRUE@ @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< -dist-hook-local: $(BUILT_EXTRA_DIST) - files='$(BUILT_EXTRA_DIST)'; \ - for f in $$files; do \ - if test -f $$f; then d=.; else d=$(srcdir); fi; \ - cp $$d/$$f $(distdir) || exit 1; done +@ENABLE_MAN_TRUE@dist-local-check-mans-enabled: +@ENABLE_MAN_TRUE@ if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +@ENABLE_MAN_FALSE@$(man_MANS): +@ENABLE_MAN_FALSE@ echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. +@ENABLE_MAN_FALSE@ echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +@ENABLE_MAN_FALSE@dist-local-check-mans-enabled: +@ENABLE_MAN_FALSE@ echo "*** --enable-man must be used in order to make dist" +@ENABLE_MAN_FALSE@ false + +dist-hook-local: dist-local-check-mans-enabled glib-docs-clean all-local + +glib-docs-clean: clean + cd $(srcdir) && rm -rf xml html # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/docs/reference/glib/building.sgml b/docs/reference/glib/building.sgml index a49a4d6..8b643e0 100644 --- a/docs/reference/glib/building.sgml +++ b/docs/reference/glib/building.sgml @@ -176,6 +176,19 @@ How to compile GLib itself configure option. + + + The optional support for DTrace requires the sys/sdt.h header, + which is provided by SystemTap on Linux. To build GLib without DTrace, use the + configure option. + + + + + The optional support for SystemTap can be disabled with the + configure option. + + @@ -219,8 +232,8 @@ How to compile GLib itself --enable-included-printf - --disable-visibility - --enable-visibility + --disable-Bsymbolic + --enable-Bsymbolic --disable-gtk-doc @@ -239,6 +252,18 @@ How to compile GLib itself --enable-selinux + --disable-dtrace + --enable-dtrace + + + --disable-systemtap + --enable-systemtap + + + --enable-gcov + --disable-gcov + + --with-runtime-libdir=RELPATH @@ -485,19 +510,18 @@ How to compile GLib itself - <systemitem>--disable-visibility</systemitem> and - <systemitem>--enable-visibility</systemitem> + <systemitem>--disable-Bsymbolic</systemitem> and + <systemitem>--enable-Bsymbolic</systemitem> - By default, GLib uses ELF visibility attributes to optimize - PLT table entries if the compiler supports ELF visibility - attributes. A side-effect of the way in which this is currently - implemented is that any header change forces a full - recompilation, and missing includes may go unnoticed. - Therefore, it makes sense to turn this feature off while - doing GLib development, even if the compiler supports ELF - visibility attributes. The - option allows to do that. + By default, GLib uses the -Bsymbolic-functions linker + flag to avoid intra-library PLT jumps. A side-effect + of this is that it is no longer possible to override + internal uses of GLib functions with + LD_PRELOAD. Therefore, it may make + sense to turn this feature off in some situations. + The option allows + to do that. @@ -562,6 +586,40 @@ How to compile GLib itself be included. + + + <systemitem>--disable-dtrace</systemitem> and + <systemitem>--enable-dtrace</systemitem> + + + By default the configure script will + detect if DTrace support is available, and use it. + + + + + <systemitem>--disable-systemtap</systemitem> and + <systemitem>--enable-systemtap</systemitem> + + + This option requires DTrace support. If it is available, then + the configure script will also check for + the presence of SystemTap. + + + + + <systemitem>--enable-gcov</systemitem> and + <systemitem>--disable-gcov</systemitem> + + + Enable the generation of coverage reports for the GLib tests. + This requires the lcov frontend to gcov from the + Linux Test Project. + To generate a coverage report, use the lcov make target. The + report is placed in the glib-lcov directory. + + <systemitem>--with-runtime-libdir=RELPATH</systemitem> diff --git a/docs/reference/glib/changes.sgml b/docs/reference/glib/changes.sgml index c64ffc2..51fcab4 100644 --- a/docs/reference/glib/changes.sgml +++ b/docs/reference/glib/changes.sgml @@ -56,14 +56,6 @@ with Glib-2.0 that you need to reproduce exactly. Incompatible changes from 1.2 to 2.0 - -The GNOME 2.0 -porting guide on http://developer.gnome.org -has some more detailed discussion of porting from 1.2 to 2.0. -See the section on GLib. - - diff --git a/docs/reference/glib/glib-docs.sgml b/docs/reference/glib/glib-docs.sgml index c63881d..9474af9 100644 --- a/docs/reference/glib/glib-docs.sgml +++ b/docs/reference/glib/glib-docs.sgml @@ -76,6 +76,8 @@ synchronize their operation. + + @@ -188,5 +190,15 @@ synchronize their operation. Index of new symbols in 2.24 + + Index of new symbols in 2.26 + + + + Index of new symbols in 2.28 + + + + diff --git a/docs/reference/glib/glib-gettextize.1 b/docs/reference/glib/glib-gettextize.1 index f8bfb9e..60a87ce 100644 --- a/docs/reference/glib/glib-gettextize.1 +++ b/docs/reference/glib/glib-gettextize.1 @@ -1,51 +1,80 @@ -.\" ** You probably do not want to edit this file directly ** -.\" It was generated using the DocBook XSL Stylesheets (version 1.69.0). -.\" Instead of manually editing it, you probably should edit the DocBook XML -.\" source for it and then use the DocBook XSL Stylesheets to regenerate it. -.TH "GLIB\-GETTEXTIZE" "1" "08/15/2005" "" "" +'\" t +.\" Title: glib-gettextize +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands +.\" Language: English +.\" +.TH "GLIB\-GETTEXTIZE" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" -glib\-gettextize \- gettext internationalization utility +glib-gettextize \- gettext internationalization utility .SH "SYNOPSIS" -.HP 16 +.HP \w'\fBglib\-gettextize\fR\ 'u \fBglib\-gettextize\fR [option...] [directory] .SH "DESCRIPTION" .PP -\fBglib\-gettextize\fR -helps to prepare a source package for being internationalized through -gettext. It is a variant of the -\fBgettextize\fR -that ships with -gettext. +\fBglib\-gettextize\fR +helps to prepare a source package for being internationalized through +gettext\&. It is a variant of the +\fBgettextize\fR +that ships with +gettext\&. .PP -\fBglib\-gettextize\fR -differs from -\fBgettextize\fR -in that it doesn't create an -\fIintl/\fR -subdirectory and doesn't modify -\fIpo/ChangeLog\fR -(note that newer versions of -\fBgettextize\fR -behave like this when called with the -\fB\-\-no\-changelog\fR -option). +\fBglib\-gettextize\fR +differs from +\fBgettextize\fR +in that it doesn\*(Aqt create an +intl/ +subdirectory and doesn\*(Aqt modify +po/ChangeLog +(note that newer versions of +\fBgettextize\fR +behave like this when called with the +\fB\-\-no\-changelog\fR +option)\&. .SS "Options" -.TP +.PP \fB\-\-help\fR +.RS 4 print help and exit -.TP +.RE +.PP \fB\-\-version\fR +.RS 4 print version information and exit -.TP +.RE +.PP \fB\-c\fR, \fB\-\-copy\fR +.RS 4 copy files instead of making symlinks -.TP +.RE +.PP \fB\-f\fR, \fB\-\-force\fR +.RS 4 force writing of new files even if old ones exist +.RE .SH "SEE ALSO" .PP - \fBgettextize\fR(1) + +\fBgettextize\fR(1) diff --git a/docs/reference/glib/glib-gettextize.xml b/docs/reference/glib/glib-gettextize.xml index c92dc57..e118397 100644 --- a/docs/reference/glib/glib-gettextize.xml +++ b/docs/reference/glib/glib-gettextize.xml @@ -1,8 +1,9 @@ - + glib-gettextize 1 +User Commands @@ -68,7 +69,7 @@ force writing of new files even if old ones exist See also -gettextize(1) +gettextize1 diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index bcfa7b0..05ba4f8 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -336,7 +336,6 @@ G_VA_COPY G_STRINGIFY G_PASTE -G_PASTE_ARGS G_STATIC_ASSERT @@ -347,6 +346,7 @@ G_GNUC_MALLOC G_GNUC_ALLOC_SIZE G_GNUC_ALLOC_SIZE2 G_GNUC_DEPRECATED +G_GNUC_DEPRECATED_FOR G_GNUC_NORETURN G_GNUC_UNUSED G_GNUC_PRINTF @@ -391,6 +391,7 @@ G_GUINTPTR_FORMAT GLIB_VAR G_STRINGIFY_ARG +G_PASTE_ARGS G_HAVE_INLINE G_CAN_INLINE inline @@ -399,6 +400,7 @@ G_HAVE___INLINE__ G_HAVE_GNUC_VARARGS G_HAVE_ISO_VARARGS G_HAVE_GROWING_STACK +G_VA_COPY_AS_ARRAY
@@ -473,6 +475,8 @@ g_main_context_remove_poll g_main_depth g_main_current_source g_main_set_poll_func +g_main_context_invoke +g_main_context_invoke_full g_main_context_get_thread_default @@ -522,12 +526,18 @@ g_source_get_priority g_source_set_can_recurse g_source_get_can_recurse g_source_get_id +g_source_get_name +g_source_set_name +g_source_set_name_by_id g_source_get_context g_source_set_callback GSourceFunc g_source_set_callback_indirect g_source_add_poll g_source_remove_poll +g_source_add_child_source +g_source_remove_child_source +g_source_get_time g_source_get_current_time g_source_remove g_source_remove_by_funcs_user_data @@ -537,12 +547,19 @@ g_source_remove_by_user_data GLIB_HAVE_SYS_POLL_H GLIB_HAVE_ALLOCA_H alloca +GLIB_USING_SYSTEM_PRINTF GLIB_SYSDEF_POLLERR GLIB_SYSDEF_POLLHUP GLIB_SYSDEF_POLLIN GLIB_SYSDEF_POLLNVAL GLIB_SYSDEF_POLLOUT GLIB_SYSDEF_POLLPRI +GLIB_SYSDEF_AF_INET +GLIB_SYSDEF_AF_INET6 +GLIB_SYSDEF_AF_UNIX +GLIB_SYSDEF_MSG_DONTROUTE +GLIB_SYSDEF_MSG_OOB +GLIB_SYSDEF_MSG_PEEK G_WIN32_MSG_HANDLE g_idle_funcs g_timeout_funcs @@ -679,6 +696,7 @@ GSystemThread g_thread_use_default_impl g_threads_got_initialized g_thread_functions_for_glib_use +g_thread_gettime g_thread_init_glib g_thread_error_quark g_once_impl @@ -752,6 +770,9 @@ g_atomic_pointer_set g_atomic_pointer_compare_and_exchange g_atomic_int_inc g_atomic_int_dec_and_test + + +G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
@@ -942,6 +963,8 @@ g_regex_get_pattern g_regex_get_max_backref g_regex_get_capture_count g_regex_get_string_number +g_regex_get_compile_flags +g_regex_get_match_flags g_regex_escape_string g_regex_match_simple g_regex_match @@ -1154,6 +1177,7 @@ g_mapped_file_get_contents g_open g_rename g_mkdir +GStatBuf g_stat g_lstat g_unlink @@ -1169,6 +1193,7 @@ g_utime g_file_error_quark +utimbuf
@@ -1298,6 +1323,10 @@ g_time_val_from_iso8601 g_time_val_to_iso8601 +g_get_monotonic_time +g_get_real_time + + GDate GTime GDateDMY @@ -1385,7 +1414,122 @@ g_date_sunday_week_of_year g_date_days_in_month g_date_monday_weeks_in_year g_date_sunday_weeks_in_year -tm + + +
+timezone + +GTimeZone +g_time_zone_unref +g_time_zone_ref + +g_time_zone_new +g_time_zone_new_local +g_time_zone_new_utc + +GTimeType +g_time_zone_find_interval +g_time_zone_adjust_time + +g_time_zone_get_abbreviation +g_time_zone_get_offset +g_time_zone_is_dst +
+ +
+date-time +GTimeSpan +G_TIME_SPAN_DAY +G_TIME_SPAN_HOUR +G_TIME_SPAN_MINUTE +G_TIME_SPAN_SECOND +G_TIME_SPAN_MILLISECOND + + +GDateTime +g_date_time_unref +g_date_time_ref + + +g_date_time_new_now +g_date_time_new_now_local +g_date_time_new_now_utc + + +g_date_time_new_from_unix_local +g_date_time_new_from_unix_utc + + +g_date_time_new_from_timeval_local +g_date_time_new_from_timeval_utc + + +g_date_time_new +g_date_time_new_local +g_date_time_new_utc + + +g_date_time_add + + +g_date_time_add_years +g_date_time_add_months +g_date_time_add_weeks +g_date_time_add_days + + +g_date_time_add_hours +g_date_time_add_minutes +g_date_time_add_seconds + + +g_date_time_add_full + + +g_date_time_compare +g_date_time_difference +g_date_time_hash +g_date_time_equal + + +g_date_time_get_ymd + + +g_date_time_get_year +g_date_time_get_month +g_date_time_get_day_of_month + + +g_date_time_get_week_numbering_year +g_date_time_get_week_of_year +g_date_time_get_day_of_week + + +g_date_time_get_day_of_year + + +g_date_time_get_hour +g_date_time_get_minute +g_date_time_get_second +g_date_time_get_microsecond +g_date_time_get_seconds + + +g_date_time_to_unix +g_date_time_to_timeval + + +g_date_time_get_utc_offset +g_date_time_get_timezone_abbreviation +g_date_time_is_daylight_savings + + +g_date_time_to_timezone +g_date_time_to_local +g_date_time_to_utc + + +g_date_time_format
@@ -1455,6 +1599,7 @@ g_get_application_name g_set_application_name g_get_prgname g_set_prgname +g_get_environ g_getenv g_setenv g_unsetenv @@ -1464,6 +1609,7 @@ g_get_real_name g_get_user_cache_dir g_get_user_data_dir g_get_user_config_dir +g_get_user_runtime_dir GUserDirectory g_get_user_special_dir g_get_system_data_dirs @@ -1607,6 +1753,8 @@ g_key_file_get_string g_key_file_get_locale_string g_key_file_get_boolean g_key_file_get_integer +g_key_file_get_int64 +g_key_file_get_uint64 g_key_file_get_double g_key_file_get_string_list g_key_file_get_locale_string_list @@ -1621,6 +1769,8 @@ g_key_file_set_string g_key_file_set_locale_string g_key_file_set_boolean g_key_file_set_integer +g_key_file_set_int64 +g_key_file_set_uint64 g_key_file_set_double g_key_file_set_string_list g_key_file_set_locale_string_list @@ -1846,6 +1996,7 @@ g_list_remove_link g_list_delete_link g_list_remove_all g_list_free +g_list_free_full g_list_alloc @@ -1902,6 +2053,7 @@ g_slist_remove_link g_slist_delete_link g_slist_remove_all g_slist_free +g_slist_free_full g_slist_free_1 g_slist_free1 @@ -2014,6 +2166,8 @@ g_sequence_remove_range g_sequence_move_range g_sequence_search g_sequence_search_iter +g_sequence_lookup +g_sequence_lookup_iter g_sequence_get @@ -2468,8 +2622,6 @@ g_iconv_close g_locale_to_utf8 g_filename_to_utf8 g_filename_from_utf8 -g_filename_from_uri -g_filename_to_uri g_get_filename_charsets g_filename_display_name g_filename_display_basename @@ -2565,11 +2717,13 @@ g_unichar_to_utf8 I18N i18n glib.h,glib/gi18n.h +_ Q_ C_ N_ NC_ g_dgettext +g_dcgettext g_dngettext g_dpgettext g_dpgettext2 @@ -2602,6 +2756,8 @@ g_uri_escape_string g_uri_unescape_string g_uri_unescape_segment g_uri_list_extract_uris +g_filename_from_uri +g_filename_to_uri
@@ -2635,7 +2791,9 @@ g_test_perf g_test_verbose g_test_quiet g_test_run +GTestFunc g_test_add_func +GTestDataFunc g_test_add_data_func g_test_add @@ -2682,6 +2840,7 @@ g_assert_error GTestCase GTestSuite +GTestFixtureFunc g_test_create_case g_test_create_suite g_test_get_root @@ -2699,7 +2858,6 @@ g_assertion_message_error g_test_add_vtable GTestConfig -g_test_config_vars GTestLogType GTestLogMsg GTestLogBuffer @@ -2738,6 +2896,9 @@ G_VARIANT_TYPE_TUPLE G_VARIANT_TYPE_UNIT G_VARIANT_TYPE_DICT_ENTRY G_VARIANT_TYPE_DICTIONARY +G_VARIANT_TYPE_STRING_ARRAY +G_VARIANT_TYPE_BYTESTRING +G_VARIANT_TYPE_BYTESTRING_ARRAY G_VARIANT_TYPE @@ -2789,10 +2950,12 @@ GVariant g_variant_unref g_variant_ref g_variant_ref_sink +g_variant_is_floating g_variant_get_type g_variant_get_type_string g_variant_is_of_type g_variant_is_container +g_variant_compare g_variant_classify @@ -2822,6 +2985,8 @@ g_variant_new_signature g_variant_is_signature g_variant_new_variant g_variant_new_strv +g_variant_new_bytestring +g_variant_new_bytestring_array g_variant_get_boolean @@ -2839,6 +3004,10 @@ g_variant_dup_string g_variant_get_variant g_variant_get_strv g_variant_dup_strv +g_variant_get_bytestring +g_variant_dup_bytestring +g_variant_get_bytestring_array +g_variant_dup_bytestring_array g_variant_new_maybe @@ -2851,6 +3020,8 @@ g_variant_get_maybe g_variant_n_children g_variant_get_child_value g_variant_get_child +g_variant_lookup_value +g_variant_lookup g_variant_get_fixed_array @@ -2890,11 +3061,13 @@ g_variant_builder_init g_variant_builder_clear g_variant_builder_add_value g_variant_builder_add +g_variant_builder_add_parsed g_variant_builder_end g_variant_builder_open g_variant_builder_close +GVariantParseError G_VARIANT_PARSE_ERROR g_variant_parse g_variant_new_parsed_va diff --git a/docs/reference/glib/gtester-report.1 b/docs/reference/glib/gtester-report.1 index fa3fe18..13f19a3 100644 --- a/docs/reference/glib/gtester-report.1 +++ b/docs/reference/glib/gtester-report.1 @@ -1,13 +1,22 @@ '\" t .\" Title: gtester-report .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 05/02/2010 -.\" Manual: [FIXME: manual] -.\" Source: [FIXME: source] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands .\" Language: English .\" -.TH "GTESTER\-REPORT" "1" "05/02/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "GTESTER\-REPORT" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/docs/reference/glib/gtester-report.xml b/docs/reference/glib/gtester-report.xml index 614341d..09c10d3 100644 --- a/docs/reference/glib/gtester-report.xml +++ b/docs/reference/glib/gtester-report.xml @@ -3,6 +3,7 @@ gtester-report 1 +User Commands @@ -46,7 +47,10 @@ print version information and exit See also -gtester(1) + +gtester +1 + diff --git a/docs/reference/glib/gtester.1 b/docs/reference/glib/gtester.1 index 50c1022..0848ddf 100644 --- a/docs/reference/glib/gtester.1 +++ b/docs/reference/glib/gtester.1 @@ -1,13 +1,22 @@ '\" t .\" Title: gtester .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.74.2 -.\" Date: 03/13/2009 -.\" Manual: [FIXME: manual] -.\" Source: [FIXME: source] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands .\" Language: English .\" -.TH "GTESTER" "1" "03/13/2009" "[FIXME: source]" "[FIXME: manual]" +.TH "GTESTER" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -98,4 +107,4 @@ report success per testcase .SH "SEE ALSO" .PP -\fBgtester\-report\fR(1) +\fBgtester-report\fR(1) diff --git a/docs/reference/glib/gtester.xml b/docs/reference/glib/gtester.xml index 840dbea..0ac13d3 100644 --- a/docs/reference/glib/gtester.xml +++ b/docs/reference/glib/gtester.xml @@ -3,6 +3,7 @@ gtester 1 +User Commands @@ -114,7 +115,10 @@ report success per testcase See also -gtester-report(1) + +gtester-report +1 + diff --git a/docs/reference/glib/gvariant-varargs.xml b/docs/reference/glib/gvariant-varargs.xml index 702235c..c62f61c 100644 --- a/docs/reference/glib/gvariant-varargs.xml +++ b/docs/reference/glib/gvariant-varargs.xml @@ -46,8 +46,8 @@ '&s' '&o', '&g', '^as', - '^ao', '^ag', '^a&s', '^a&o' or - '^a&g' + '^a&s', '^ay', '^&ay', '^aay' + or '^a&ay'. @@ -220,7 +220,9 @@ GVariant should be used in place of the normal C type or types. For g_variant_new() this means that you must pass a non-NULL (GVariant - *). For g_variant_get() this means that you + *); if it is a floating reference, ownership will be taken, as + if by using g_variant_ref_sink(). + For g_variant_get() this means that you must pass a pointer to a (GVariant *) for the value to be returned by reference or NULL to ignore the value. See GVariant * below. @@ -622,7 +624,7 @@ y = g_variant_get_variant (x);]]> (GVariantIter **)). A new heap-allocated iterator is created and returned, initialised for iterating over the elements of the array. This iterator should be freed when you are done with it, using - g_variant_iter_unref(). + g_variant_iter_free(). NULL may also be given to indicate that the value of the array should be ignored. @@ -633,12 +635,13 @@ y = g_variant_get_variant (x);]]> + g_print ("%s\n", str); + g_variant_iter_free (iter); +} + +g_variant_unref (value);]]> @@ -814,7 +819,7 @@ value2 = g_variant_new ("()"); @@ -932,39 +937,155 @@ value2 = g_variant_new ("(@(iii)*)", value1, g_variant_new_string ("foo")); - The '^' character currently only has one purpose: to convert to and from - G_TYPE_STRV type arrays of strings. It is always used with - arrays of strings (or other string types). It has two forms. - - - - - '^as' (or o or g) - - - - - '^a&s' (or o or g) - - - - - When used with g_variant_new() both forms are equivalent. - A (const gchar * const *) is collected. This must be a pointer to the - array of NULL-terminated pointers to strings. This array is - converted to a GVariant instance. Copies are made, so the original - array may be freed immediately. - - - When used with g_variant_get() the two forms have - different meaning. Both return a freshly allocated - NULL-terminated array of pointers to strings. In the case of - '^as', the strings are owned by the caller -- it is appropriate to free the array with - g_strfreev(). In the case of '^a&s', - a shallow copy is made; the strings themselves are embedded in the serialised data and owned by the original - GVariant instance -- it is only appropriate to free the outer array - with g_free(). + The '^' character currently supports conversion to and from bytestrings or to and from arrays + of strings or bytestrings. It has a number of forms. + + + + In all forms, when used with g_variant_new() one + pointer value is collected from the variable arguments and passed to a function (as given in the table below). + The result of that function is used as the value for this position. When used with + g_variant_get() one pointer value is produced by using + the function (given in the table) and returned by reference. + + + + + + + + + + + + Conversion + + + + + + Used with g_variant_new() + + + + + + + Used with g_variant_get() + + + + + + + + + + ^as + + + + + + equivalent to g_variant_new_strv() + + + + + equivalent to g_variant_dup_strv() + + + + + + + + + ^a&s + + + + + + equivalent to g_variant_get_strv() + + + + + + + + + ^ay + + + + + + equivalent to g_variant_new_bytestring() + + + + + equivalent to g_variant_dup_bytestring() + + + + + + + + + ^&ay + + + + + + equivalent to g_variant_get_bytestring() + + + + + + + + + ^aay + + + + + + equivalent to g_variant_new_bytestring_array() + + + + + equivalent to g_variant_dup_bytestring_array() + + + + + + + + + ^a&ay + + + + + + equivalent to g_variant_get_bytestring_array() + + + + + + + diff --git a/docs/reference/glib/html/annotation-glossary.html b/docs/reference/glib/html/annotation-glossary.html new file mode 100644 index 0000000..e619ad3 --- /dev/null +++ b/docs/reference/glib/html/annotation-glossary.html @@ -0,0 +1,83 @@ + + + + +Annotation Glossary + + + + + + + + + + + + + + + + + + +
+

+Annotation Glossary

+

O

+
+out
+

Parameter for returning results. Default is transfer full.

+

S

+
+shadows
+

+

A

+
+allow-none
+

NULL is ok, both for passing and for returning.

+

D

+
+default
+

Default parameter value (for in case the shadows-to function has less parameters).

+

T

+
+transfer none
+

Don't free data after the code is done.

+

A

+
+array
+

Parameter points to an array of items.

+

E

+
+element-type
+

Generics and defining elements of containers and arrays.

+

T

+
+transfer container
+

Free data container after the code is done.

+
+transfer full
+

Free data after the code is done.

+
+ + + \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-10.html b/docs/reference/glib/html/api-index-2-10.html index b3ef830..5293dfe 100644 --- a/docs/reference/glib/html/api-index-2-10.html +++ b/docs/reference/glib/html/api-index-2-10.html @@ -3,12 +3,12 @@ Index of new symbols in 2.10 - + - + @@ -175,6 +175,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-12.html b/docs/reference/glib/html/api-index-2-12.html index c2d410f..d25005b 100644 --- a/docs/reference/glib/html/api-index-2-12.html +++ b/docs/reference/glib/html/api-index-2-12.html @@ -3,12 +3,12 @@ Index of new symbols in 2.12 - + - + @@ -307,6 +307,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-14.html b/docs/reference/glib/html/api-index-2-14.html index 2e591cd..14c1b83 100644 --- a/docs/reference/glib/html/api-index-2-14.html +++ b/docs/reference/glib/html/api-index-2-14.html @@ -3,12 +3,12 @@ Index of new symbols in 2.14 - + - + @@ -273,10 +273,6 @@
-G_REGEX_ERROR, macro in Perl-compatible regular expressions -
-
-
g_regex_escape_string, function in Perl-compatible regular expressions
@@ -558,6 +554,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-16.html b/docs/reference/glib/html/api-index-2-16.html index e466f63..72b9af7 100644 --- a/docs/reference/glib/html/api-index-2-16.html +++ b/docs/reference/glib/html/api-index-2-16.html @@ -3,12 +3,12 @@ Index of new symbols in 2.16 - + - + @@ -357,6 +357,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-18.html b/docs/reference/glib/html/api-index-2-18.html index 6f3cc9c..3fd9783 100644 --- a/docs/reference/glib/html/api-index-2-18.html +++ b/docs/reference/glib/html/api-index-2-18.html @@ -3,12 +3,12 @@ Index of new symbols in 2.18 - + - + @@ -97,6 +97,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-2.html b/docs/reference/glib/html/api-index-2-2.html index ef25221..3c002e7 100644 --- a/docs/reference/glib/html/api-index-2-2.html +++ b/docs/reference/glib/html/api-index-2-2.html @@ -3,12 +3,12 @@ Index of new symbols in 2.2 - + - + @@ -119,6 +119,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-20.html b/docs/reference/glib/html/api-index-2-20.html index b16a7c0..bb4a486 100644 --- a/docs/reference/glib/html/api-index-2-20.html +++ b/docs/reference/glib/html/api-index-2-20.html @@ -3,12 +3,12 @@ Index of new symbols in 2.20 - + - + @@ -78,6 +78,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-22.html b/docs/reference/glib/html/api-index-2-22.html index 42624e3..2e1237d 100644 --- a/docs/reference/glib/html/api-index-2-22.html +++ b/docs/reference/glib/html/api-index-2-22.html @@ -3,12 +3,12 @@ Index of new symbols in 2.22 - + - + @@ -189,6 +189,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-24.html b/docs/reference/glib/html/api-index-2-24.html index d4e8cc6..fa55cef 100644 --- a/docs/reference/glib/html/api-index-2-24.html +++ b/docs/reference/glib/html/api-index-2-24.html @@ -3,11 +3,12 @@ Index of new symbols in 2.24 - + - + + @@ -17,7 +18,7 @@   Home GLib Reference Manual -  +Next B @@ -414,6 +415,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-26.html b/docs/reference/glib/html/api-index-2-26.html new file mode 100644 index 0000000..98341da --- /dev/null +++ b/docs/reference/glib/html/api-index-2-26.html @@ -0,0 +1,387 @@ + + + + +Index of new symbols in 2.26 + + + + + + + + + + + + + + + + + + + +
+

+Index of new symbols in 2.26

+

D

+
+GDateTime, struct in GDateTime +
+
+
+g_date_time_add, function in GDateTime +
+
+
+g_date_time_add_days, function in GDateTime +
+
+
+g_date_time_add_full, function in GDateTime +
+
+
+g_date_time_add_hours, function in GDateTime +
+
+
+g_date_time_add_minutes, function in GDateTime +
+
+
+g_date_time_add_months, function in GDateTime +
+
+
+g_date_time_add_seconds, function in GDateTime +
+
+
+g_date_time_add_weeks, function in GDateTime +
+
+
+g_date_time_add_years, function in GDateTime +
+
+
+g_date_time_compare, function in GDateTime +
+
+
+g_date_time_difference, function in GDateTime +
+
+
+g_date_time_equal, function in GDateTime +
+
+
+g_date_time_format, function in GDateTime +
+
+
+g_date_time_get_day_of_month, function in GDateTime +
+
+
+g_date_time_get_day_of_week, function in GDateTime +
+
+
+g_date_time_get_day_of_year, function in GDateTime +
+
+
+g_date_time_get_hour, function in GDateTime +
+
+
+g_date_time_get_microsecond, function in GDateTime +
+
+
+g_date_time_get_minute, function in GDateTime +
+
+
+g_date_time_get_month, function in GDateTime +
+
+
+g_date_time_get_second, function in GDateTime +
+
+
+g_date_time_get_seconds, function in GDateTime +
+
+
+g_date_time_get_timezone_abbreviation, function in GDateTime +
+
+
+g_date_time_get_utc_offset, function in GDateTime +
+
+
+g_date_time_get_week_numbering_year, function in GDateTime +
+
+
+g_date_time_get_week_of_year, function in GDateTime +
+
+
+g_date_time_get_year, function in GDateTime +
+
+
+g_date_time_get_ymd, function in GDateTime +
+
+
+g_date_time_hash, function in GDateTime +
+
+
+g_date_time_is_daylight_savings, function in GDateTime +
+
+
+g_date_time_new, function in GDateTime +
+
+
+g_date_time_new_from_timeval_local, function in GDateTime +
+
+
+g_date_time_new_from_timeval_utc, function in GDateTime +
+
+
+g_date_time_new_from_unix_local, function in GDateTime +
+
+
+g_date_time_new_from_unix_utc, function in GDateTime +
+
+
+g_date_time_new_now, function in GDateTime +
+
+
+g_date_time_new_now_local, function in GDateTime +
+
+
+g_date_time_new_now_utc, function in GDateTime +
+
+
+g_date_time_ref, function in GDateTime +
+
+
+g_date_time_to_local, function in GDateTime +
+
+
+g_date_time_to_timeval, function in GDateTime +
+
+
+g_date_time_to_timezone, function in GDateTime +
+
+
+g_date_time_to_unix, function in GDateTime +
+
+
+g_date_time_to_utc, function in GDateTime +
+
+
+g_date_time_unref, function in GDateTime +
+
+
+g_dcgettext, function in I18N +
+
+

K

+
+g_key_file_get_int64, function in Key-value file parser +
+
+
+g_key_file_get_uint64, function in Key-value file parser +
+
+
+g_key_file_set_int64, function in Key-value file parser +
+
+
+g_key_file_set_uint64, function in Key-value file parser +
+
+

R

+
+g_regex_get_compile_flags, function in Perl-compatible regular expressions +
+
+
+g_regex_get_match_flags, function in Perl-compatible regular expressions +
+
+

S

+
+g_sequence_lookup, function in Sequences +
+
+
+g_sequence_lookup_iter, function in Sequences +
+
+
+g_source_get_name, function in The Main Event Loop +
+
+
+g_source_set_name, function in The Main Event Loop +
+
+
+g_source_set_name_by_id, function in The Main Event Loop +
+
+

T

+
+GTimeSpan, typedef in GDateTime +
+
+
+GTimeZone, struct in GTimeZone +
+
+
+G_TIME_SPAN_DAY, macro in GDateTime +
+
+
+G_TIME_SPAN_HOUR, macro in GDateTime +
+
+
+G_TIME_SPAN_MILLISECOND, macro in GDateTime +
+
+
+G_TIME_SPAN_MINUTE, macro in GDateTime +
+
+
+G_TIME_SPAN_SECOND, macro in GDateTime +
+
+
+g_time_zone_adjust_time, function in GTimeZone +
+
+
+g_time_zone_find_interval, function in GTimeZone +
+
+
+g_time_zone_get_abbreviation, function in GTimeZone +
+
+
+g_time_zone_get_offset, function in GTimeZone +
+
+
+g_time_zone_is_dst, function in GTimeZone +
+
+
+g_time_zone_new, function in GTimeZone +
+
+
+g_time_zone_new_local, function in GTimeZone +
+
+
+g_time_zone_new_utc, function in GTimeZone +
+
+
+g_time_zone_ref, function in GTimeZone +
+
+
+g_time_zone_unref, function in GTimeZone +
+
+

V

+
+g_variant_builder_add_parsed, function in GVariant +
+
+
+g_variant_compare, function in GVariant +
+
+
+g_variant_dup_bytestring, function in GVariant +
+
+
+g_variant_dup_bytestring_array, function in GVariant +
+
+
+g_variant_get_bytestring, function in GVariant +
+
+
+g_variant_get_bytestring_array, function in GVariant +
+
+
+g_variant_is_floating, function in GVariant +
+
+
+g_variant_new_bytestring, function in GVariant +
+
+
+g_variant_new_bytestring_array, function in GVariant +
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-28.html b/docs/reference/glib/html/api-index-2-28.html new file mode 100644 index 0000000..ef841c5 --- /dev/null +++ b/docs/reference/glib/html/api-index-2-28.html @@ -0,0 +1,100 @@ + + + + +Index of new symbols in 2.28 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-4.html b/docs/reference/glib/html/api-index-2-4.html index 3e16631..434e71a 100644 --- a/docs/reference/glib/html/api-index-2-4.html +++ b/docs/reference/glib/html/api-index-2-4.html @@ -3,12 +3,12 @@ Index of new symbols in 2.4 - + - + @@ -52,6 +52,8 @@ U  |  V +  |  + _
@@ -381,9 +383,14 @@ g_vasprintf, function in String Utility Functions
+

_

+
+_, macro in I18N +
+
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-6.html b/docs/reference/glib/html/api-index-2-6.html index bd338cd..49f3e44 100644 --- a/docs/reference/glib/html/api-index-2-6.html +++ b/docs/reference/glib/html/api-index-2-6.html @@ -3,12 +3,12 @@ Index of new symbols in 2.6 - + - + @@ -408,6 +408,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-2-8.html b/docs/reference/glib/html/api-index-2-8.html index f101568..1b47efd 100644 --- a/docs/reference/glib/html/api-index-2-8.html +++ b/docs/reference/glib/html/api-index-2-8.html @@ -3,12 +3,12 @@ Index of new symbols in 2.8 - + - + @@ -153,6 +153,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-deprecated.html b/docs/reference/glib/html/api-index-deprecated.html index 17a5ea7..3c80277 100644 --- a/docs/reference/glib/html/api-index-deprecated.html +++ b/docs/reference/glib/html/api-index-deprecated.html @@ -3,12 +3,12 @@ Index of deprecated symbols - + - + @@ -41,6 +41,8 @@  |  N  |  + R +  |  S  |  T @@ -106,6 +108,38 @@ g_chunk_new0, macro in Memory Chunks
+
+g_completion_add_items, function in Automatic String Completion +
+
+
+g_completion_clear_items, function in Automatic String Completion +
+
+
+g_completion_complete, function in Automatic String Completion +
+
+
+g_completion_complete_utf8, function in Automatic String Completion +
+
+
+g_completion_free, function in Automatic String Completion +
+
+
+g_completion_new, function in Automatic String Completion +
+
+
+g_completion_remove_items, function in Automatic String Completion +
+
+
+g_completion_set_compare, function in Automatic String Completion +
+

D

g_date_set_time, function in Date and Time Functions @@ -253,6 +287,43 @@ g_node_push_allocator, function in N-ary Trees
+

R

+
+g_relation_count, function in Relations and Tuples +
+
+
+g_relation_delete, function in Relations and Tuples +
+
+
+g_relation_destroy, function in Relations and Tuples +
+
+
+g_relation_exists, function in Relations and Tuples +
+
+
+g_relation_index, function in Relations and Tuples +
+
+
+g_relation_insert, function in Relations and Tuples +
+
+
+g_relation_new, function in Relations and Tuples +
+
+
+g_relation_print, function in Relations and Tuples +
+
+
+g_relation_select, function in Relations and Tuples +
+

S

g_scanner_add_symbol, macro in Lexical Scanner @@ -283,6 +354,10 @@
+g_source_get_current_time, function in The Main Event Loop +
+
+
g_strcasecmp, function in String Utility Functions
@@ -319,6 +394,14 @@ g_tree_traverse, function in Balanced Binary Trees
+
+g_tuples_destroy, function in Relations and Tuples +
+
+
+g_tuples_index, function in Relations and Tuples +
+

W

G_WIN32_DLLMAIN_FOR_DLL_NAME, macro in Windows Compatibility Functions @@ -335,6 +418,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/api-index-full.html b/docs/reference/glib/html/api-index-full.html index 2eb07ca..96ab3f5 100644 --- a/docs/reference/glib/html/api-index-full.html +++ b/docs/reference/glib/html/api-index-full.html @@ -3,12 +3,12 @@ Index - + - + @@ -64,6 +64,8 @@ V  |  W +  |  + _
@@ -1194,6 +1196,10 @@
+GDateTime, struct in GDateTime +
+
+
GDateWeekday, enum in Date and Time Functions
@@ -1374,6 +1380,194 @@
+g_date_time_add, function in GDateTime +
+
+
+g_date_time_add_days, function in GDateTime +
+
+
+g_date_time_add_full, function in GDateTime +
+
+
+g_date_time_add_hours, function in GDateTime +
+
+
+g_date_time_add_minutes, function in GDateTime +
+
+
+g_date_time_add_months, function in GDateTime +
+
+
+g_date_time_add_seconds, function in GDateTime +
+
+
+g_date_time_add_weeks, function in GDateTime +
+
+
+g_date_time_add_years, function in GDateTime +
+
+
+g_date_time_compare, function in GDateTime +
+
+
+g_date_time_difference, function in GDateTime +
+
+
+g_date_time_equal, function in GDateTime +
+
+
+g_date_time_format, function in GDateTime +
+
+
+g_date_time_get_day_of_month, function in GDateTime +
+
+
+g_date_time_get_day_of_week, function in GDateTime +
+
+
+g_date_time_get_day_of_year, function in GDateTime +
+
+
+g_date_time_get_hour, function in GDateTime +
+
+
+g_date_time_get_microsecond, function in GDateTime +
+
+
+g_date_time_get_minute, function in GDateTime +
+
+
+g_date_time_get_month, function in GDateTime +
+
+
+g_date_time_get_second, function in GDateTime +
+
+
+g_date_time_get_seconds, function in GDateTime +
+
+
+g_date_time_get_timezone_abbreviation, function in GDateTime +
+
+
+g_date_time_get_utc_offset, function in GDateTime +
+
+
+g_date_time_get_week_numbering_year, function in GDateTime +
+
+
+g_date_time_get_week_of_year, function in GDateTime +
+
+
+g_date_time_get_year, function in GDateTime +
+
+
+g_date_time_get_ymd, function in GDateTime +
+
+
+g_date_time_hash, function in GDateTime +
+
+
+g_date_time_is_daylight_savings, function in GDateTime +
+
+
+g_date_time_new, function in GDateTime +
+
+
+g_date_time_new_from_timeval_local, function in GDateTime +
+
+
+g_date_time_new_from_timeval_utc, function in GDateTime +
+
+
+g_date_time_new_from_unix_local, function in GDateTime +
+
+
+g_date_time_new_from_unix_utc, function in GDateTime +
+
+
+g_date_time_new_local, function in GDateTime +
+
+
+g_date_time_new_now, function in GDateTime +
+
+
+g_date_time_new_now_local, function in GDateTime +
+
+
+g_date_time_new_now_utc, function in GDateTime +
+
+
+g_date_time_new_utc, function in GDateTime +
+
+
+g_date_time_ref, function in GDateTime +
+
+
+g_date_time_to_local, function in GDateTime +
+
+
+g_date_time_to_timeval, function in GDateTime +
+
+
+g_date_time_to_timezone, function in GDateTime +
+
+
+g_date_time_to_unix, function in GDateTime +
+
+
+g_date_time_to_utc, function in GDateTime +
+
+
+g_date_time_unref, function in GDateTime +
+
+
g_date_to_struct_tm, function in Date and Time Functions
@@ -1406,6 +1600,10 @@
+g_dcgettext, function in I18N +
+
+
g_debug, macro in Message Logging
@@ -1556,7 +1754,7 @@
-g_filename_from_uri, function in Character Set Conversion +g_filename_from_uri, function in URI Functions
@@ -1564,7 +1762,7 @@
-g_filename_to_uri, function in Character Set Conversion +g_filename_to_uri, function in URI Functions
@@ -1665,6 +1863,10 @@
+g_get_environ, function in Miscellaneous Utility Functions +
+
+
g_get_filename_charsets, function in Character Set Conversion
@@ -1681,6 +1883,10 @@
+g_get_monotonic_time, function in Date and Time Functions +
+
+
g_get_prgname, function in Miscellaneous Utility Functions
@@ -1689,6 +1895,10 @@
+g_get_real_time, function in Date and Time Functions +
+
+
g_get_system_config_dirs, function in Miscellaneous Utility Functions
@@ -1717,6 +1927,10 @@
+g_get_user_runtime_dir, function in Miscellaneous Utility Functions +
+
+
g_get_user_special_dir, function in Miscellaneous Utility Functions
@@ -1773,6 +1987,10 @@
+G_GNUC_DEPRECATED_FOR, macro in Miscellaneous Macros +
+
+
G_GNUC_EXTENSION, macro in Miscellaneous Macros
@@ -2704,6 +2922,10 @@
+g_key_file_get_int64, function in Key-value file parser +
+
+
g_key_file_get_integer, function in Key-value file parser
@@ -2736,6 +2958,10 @@
+g_key_file_get_uint64, function in Key-value file parser +
+
+
g_key_file_get_value, function in Key-value file parser
@@ -2800,6 +3026,10 @@
+g_key_file_set_int64, function in Key-value file parser +
+
+
g_key_file_set_integer, function in Key-value file parser
@@ -2828,6 +3058,10 @@
+g_key_file_set_uint64, function in Key-value file parser +
+
+
g_key_file_set_value, function in Key-value file parser
@@ -2917,6 +3151,10 @@
+g_list_free_full, function in Doubly-Linked Lists +
+
+
g_list_index, function in Doubly-Linked Lists
@@ -3170,6 +3408,14 @@
+g_main_context_invoke, function in The Main Event Loop +
+
+
+g_main_context_invoke_full, function in The Main Event Loop +
+
+
g_main_context_is_owner, function in The Main Event Loop
@@ -4205,10 +4451,6 @@
-G_PASTE_ARGS, macro in Miscellaneous Macros -
-
-
g_path_get_basename, function in Miscellaneous Utility Functions
@@ -4763,6 +5005,14 @@
+g_regex_get_compile_flags, function in Perl-compatible regular expressions +
+
+
+g_regex_get_match_flags, function in Perl-compatible regular expressions +
+
+
g_regex_get_max_backref, function in Perl-compatible regular expressions
@@ -5128,6 +5378,14 @@
+g_sequence_lookup, function in Sequences +
+
+
+g_sequence_lookup_iter, function in Sequences +
+
+
g_sequence_move, function in Sequences
@@ -5352,6 +5610,10 @@
+g_slist_free_full, function in Singly-Linked Lists +
+
+
g_slist_index, function in Singly-Linked Lists
@@ -5456,6 +5718,10 @@
+g_source_add_child_source, function in The Main Event Loop +
+
+
g_source_add_poll, function in The Main Event Loop
@@ -5484,10 +5750,18 @@
+g_source_get_name, function in The Main Event Loop +
+
+
g_source_get_priority, function in The Main Event Loop
+g_source_get_time, function in The Main Event Loop +
+
+
g_source_is_destroyed, function in The Main Event Loop
@@ -5512,6 +5786,10 @@
+g_source_remove_child_source, function in The Main Event Loop +
+
+
g_source_remove_poll, function in The Main Event Loop
@@ -5532,6 +5810,14 @@
+g_source_set_name, function in The Main Event Loop +
+
+
+g_source_set_name_by_id, function in The Main Event Loop +
+
+
g_source_set_priority, function in The Main Event Loop
@@ -5616,6 +5902,10 @@
+GStatBuf, typedef in File Utilities +
+
+
GStaticMutex, struct in Threads
@@ -6125,6 +6415,18 @@
+GTestDataFunc, user_function in Testing +
+
+
+GTestFixtureFunc, user_function in Testing +
+
+
+GTestFunc, user_function in Testing +
+
+
GTestLogFatalFunc, user_function in Testing
@@ -6509,10 +6811,42 @@
+GTimeSpan, typedef in GDateTime +
+
+
+GTimeType, enum in GTimeZone +
+
+
GTimeVal, struct in Date and Time Functions
+GTimeZone, struct in GTimeZone +
+
+
+G_TIME_SPAN_DAY, macro in GDateTime +
+
+
+G_TIME_SPAN_HOUR, macro in GDateTime +
+
+
+G_TIME_SPAN_MILLISECOND, macro in GDateTime +
+
+
+G_TIME_SPAN_MINUTE, macro in GDateTime +
+
+
+G_TIME_SPAN_SECOND, macro in GDateTime +
+
+
g_time_val_add, function in Date and Time Functions
@@ -6525,6 +6859,46 @@
+g_time_zone_adjust_time, function in GTimeZone +
+
+
+g_time_zone_find_interval, function in GTimeZone +
+
+
+g_time_zone_get_abbreviation, function in GTimeZone +
+
+
+g_time_zone_get_offset, function in GTimeZone +
+
+
+g_time_zone_is_dst, function in GTimeZone +
+
+
+g_time_zone_new, function in GTimeZone +
+
+
+g_time_zone_new_local, function in GTimeZone +
+
+
+g_time_zone_new_utc, function in GTimeZone +
+
+
+g_time_zone_ref, function in GTimeZone +
+
+
+g_time_zone_unref, function in GTimeZone +
+
+
GTokenType, enum in Lexical Scanner
@@ -7191,6 +7565,10 @@
+GVariantParseError, enum in GVariant +
+
+
GVariantType, struct in GVariantType
@@ -7199,6 +7577,10 @@
+g_variant_builder_add_parsed, function in GVariant +
+
+
g_variant_builder_add_value, function in GVariant
@@ -7243,6 +7625,18 @@
+g_variant_compare, function in GVariant +
+
+
+g_variant_dup_bytestring, function in GVariant +
+
+
+g_variant_dup_bytestring_array, function in GVariant +
+
+
g_variant_dup_string, function in GVariant
@@ -7267,6 +7661,14 @@
+g_variant_get_bytestring, function in GVariant +
+
+
+g_variant_get_bytestring_array, function in GVariant +
+
+
g_variant_get_child, function in GVariant
@@ -7359,6 +7761,10 @@
+g_variant_is_floating, function in GVariant +
+
+
g_variant_is_normal_form, function in GVariant
@@ -7407,6 +7813,14 @@
+g_variant_lookup, function in GVariant +
+
+
+g_variant_lookup_value, function in GVariant +
+
+
g_variant_new, function in GVariant
@@ -7423,6 +7837,14 @@
+g_variant_new_bytestring, function in GVariant +
+
+
+g_variant_new_bytestring_array, function in GVariant +
+
+
g_variant_new_dict_entry, function in GVariant
@@ -7559,6 +7981,14 @@
+G_VARIANT_TYPE_BYTESTRING, macro in GVariantType +
+
+
+G_VARIANT_TYPE_BYTESTRING_ARRAY, macro in GVariantType +
+
+
g_variant_type_copy, function in GVariantType
@@ -7707,6 +8137,10 @@
+G_VARIANT_TYPE_STRING_ARRAY, macro in GVariantType +
+
+
g_variant_type_string_is_valid, function in GVariantType
@@ -7827,9 +8261,14 @@ g_win32_locale_filename_from_utf8, function in Windows Compatibility Functions
+

_

+
+_, macro in I18N +
+
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Arrays.html b/docs/reference/glib/html/glib-Arrays.html index 924a4da..70c51c6 100644 --- a/docs/reference/glib/html/glib-Arrays.html +++ b/docs/reference/glib/html/glib-Arrays.html @@ -3,12 +3,12 @@ Arrays - + - + @@ -121,7 +121,7 @@ To free an array, use

-

Example 19. Using a GArray to store gint values

+

Example 19. Using a GArray to store gint values

@@ -762,7 +762,7 @@ value is cast to the given type.

-

Example 20. Getting a pointer to an element in a GArray

+

Example 20. Getting a pointer to an element in a GArray

@@ -888,6 +888,6 @@ they should be freed separately.

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Asynchronous-Queues.html b/docs/reference/glib/html/glib-Asynchronous-Queues.html index 59279a2..2cac5b9 100644 --- a/docs/reference/glib/html/glib-Asynchronous-Queues.html +++ b/docs/reference/glib/html/glib-Asynchronous-Queues.html @@ -3,12 +3,12 @@ Asynchronous Queues - + - + @@ -86,8 +86,8 @@ Often you need to communicate between different threads. In general it's safer not to do this by shared memory, but by explicit message passing. These messages only make sense asynchronously for -multi-threaded applications though, as a synchronous operation could as -well be done in the same thread. +multi-threaded applications though, as a synchronous operation could +as well be done in the same thread.

Asynchronous queues are an exception from most other GLib data @@ -101,10 +101,10 @@ For using an asynchronous queue you first have to create one with g_async_queue_new(). A newly-created queue will get the reference count 1. Whenever another thread is creating a new reference of (that is, pointer to) the queue, it has to increase the reference count -(using g_async_queue_ref()). Also, before removing this reference, the -reference count has to be decreased (using -g_async_queue_unref()). After that the queue might no longer exist so -you must not access it after that point. +(using g_async_queue_ref()). Also, before removing this reference, +the reference count has to be decreased (using g_async_queue_unref()). +After that the queue might no longer exist so you must not access +it after that point.

A thread, which wants to send a message to that queue simply calls @@ -120,14 +120,14 @@ and returned. The functions g_async_queue_lock() and release it with -g_async_queue_unlock()) over multiple queue accessing -instructions. This can be necessary to ensure the integrity of the -queue, but should only be used when really necessary, as it can make -your life harder if used unwisely. Normally you should only use the -locking function variants (those without the suffix _unlocked) +g_async_queue_unlock()) over multiple queue accessing instructions. +This can be necessary to ensure the integrity of the queue, but should +only be used when really necessary, as it can make your life harder +if used unwisely. Normally you should only use the locking function +variants (those without the suffix _unlocked)

@@ -136,7 +136,7 @@ locking function variants (those without the suffix _unlocked)

GAsyncQueue

typedef struct _GAsyncQueue GAsyncQueue;

-The GAsyncQueue struct is an opaque data structure, which represents +The GAsyncQueue struct is an opaque data structure, which represents an asynchronous queue. It should only be accessed through the g_async_queue_* functions.

@@ -813,6 +813,6 @@ This function is called while holding the queue + Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/glib/html/glib-Atomic-Operations.html b/docs/reference/glib/html/glib-Atomic-Operations.html index 878f199..6418355 100644 --- a/docs/reference/glib/html/glib-Atomic-Operations.html +++ b/docs/reference/glib/html/glib-Atomic-Operations.html @@ -3,12 +3,12 @@ Atomic Operations - + - + @@ -75,37 +75,45 @@ The most important usage is reference counting. Using g_atomic_int_inc() and g_atomic_int_dec_and_test() makes reference counting a very fast operation.

+

+

Note

-

-You must not directly read integers or pointers concurrently accessed -by multiple threads, but use the atomic accessor functions instead. -That is, always use g_atomic_int_get() and g_atomic_pointer_get() for -read outs. -They provide the neccessary synchonization mechanisms like memory -barriers to access memory locations concurrently. +

You must not directly read integers or pointers concurrently +accessed by multiple threads, but use the atomic accessor functions +instead. That is, always use g_atomic_int_get() and g_atomic_pointer_get() +for read outs. They provide the neccessary synchonization mechanisms +like memory barriers to access memory locations concurrently.

+

+

+

+

Note

-

-If you are using those functions for anything apart from simple -reference counting, you should really be aware of the implications of -doing that. There are literally thousands of ways to shoot yourself in -the foot. So if in doubt, use a GMutex. If you don't know, what +

If you are using those functions for anything apart from +simple reference counting, you should really be aware of the implications +of doing that. There are literally thousands of ways to shoot yourself +in the foot. So if in doubt, use a GMutex. If you don't know, what memory barriers are, do not use anything but g_atomic_int_inc() and g_atomic_int_dec_and_test().

+

+

+

+

Note

-

-It is not safe to set an integer or pointer just by assigning to it, -when it is concurrently accessed by other threads with the following +

It is not safe to set an integer or pointer just by assigning +to it, when it is concurrently accessed by other threads with the following functions. Use g_atomic_int_compare_and_exchange() or g_atomic_pointer_compare_and_exchange() respectively.

+

+

Details

@@ -113,8 +121,8 @@ functions. Use

g_atomic_int_get ()

gint                g_atomic_int_get                    (volatile gint G_GNUC_MAY_ALIAS *atomic);

-Reads the value of the integer pointed to by atomic. Also acts as -a memory barrier. +Reads the value of the integer pointed to by atomic. +Also acts as a memory barrier.

@@ -126,7 +134,8 @@ a memory barrier. - @@ -173,12 +182,12 @@ Also acts as a memory barrier. - - @@ -191,26 +200,27 @@ Also acts as a memory barrier.
gint                g_atomic_int_exchange_and_add       (volatile gint G_GNUC_MAY_ALIAS *atomic,
                                                          gint val);

-Atomically adds val to the integer pointed to by atomic. It returns -the value of *atomic just before the addition took place. -Also acts as a memory barrier. +Atomically adds val to the integer pointed to by atomic. +It returns the value of *atomic just before the addition +took place. Also acts as a memory barrier.

Returns :

the value of *atomic + the value of *atomic +

atomic :

a pointer to an integer. +a pointer to an integer

val :

the value to add to *atomic. +the value to add to *atomic
- - - @@ -233,23 +243,23 @@ Also acts as a memory barrier. - - - - @@ -261,8 +271,8 @@ Also acts as a memory barrier.

g_atomic_pointer_get ()

gpointer            g_atomic_pointer_get                (volatile gpointer G_GNUC_MAY_ALIAS *atomic);

-Reads the value of the pointer pointed to by atomic. Also acts as -a memory barrier. +Reads the value of the pointer pointed to by atomic. +Also acts as a memory barrier.

atomic :

a pointer to an integer. +a pointer to an integer

val :

the value to add to *atomic. +the value to add to *atomic

Returns :

the value of *atomic before the addition. + the value of *atomic before the addition. +

atomic :

a pointer to an integer. +a pointer to an integer

oldval :

the assumed old value of *atomic. +the assumed old value of *atomic

newval :

the new value of *atomic. +the new value of *atomic

Returns :

-TRUE, if *atomic was equal oldval. FALSE otherwise. + TRUE, if *atomic was equal oldval. FALSE otherwise. +
@@ -274,7 +284,8 @@ a memory barrier. - @@ -324,23 +335,23 @@ Also acts as a memory barrier. - - - - @@ -376,14 +387,14 @@ Atomically decrements the integer pointed to by atom - - @@ -393,21 +404,11 @@ decrementing it.

See Also

-

-

-

Returns :

the value to add to *atomic. + the value to add to *atomic. +

atomic :

a pointer to a gpointer. +a pointer to a gpointer

oldval :

the assumed old value of *atomic. +the assumed old value of *atomic

newval :

the new value of *atomic. +the new value of *atomic

Returns :

-TRUE, if *atomic was equal oldval. FALSE otherwise. + TRUE, if *atomic was equal oldval. FALSE otherwise. +

atomic :

a pointer to an integer. +a pointer to an integer

Returns :

-TRUE, if the integer pointed to by atomic is 0 after -decrementing it. + TRUE if the integer pointed to by atomic is 0 + after decrementing it +
-- - - - -

GMutex

GLib mutual exclusions.

-

-

+GMutex
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Automatic-String-Completion.html b/docs/reference/glib/html/glib-Automatic-String-Completion.html index c9fa459..79cfc83 100644 --- a/docs/reference/glib/html/glib-Automatic-String-Completion.html +++ b/docs/reference/glib/html/glib-Automatic-String-Completion.html @@ -3,12 +3,12 @@ Automatic String Completion - + - + @@ -86,6 +86,10 @@ retrieves the item's string from the data structure. You can change the way in which strings are compared by setting a different GCompletionStrncmpFunc in g_completion_set_compare().

+

+GCompletion has been marked as deprecated, since this API is rarely +used and not very actively maintained. +

Details

@@ -141,6 +145,10 @@ The data structure used for automatic completion.

g_completion_new ()

GCompletion*        g_completion_new                    (GCompletionFunc func);
+
+

Warning

+

g_completion_new is deprecated and should not be used in newly-written code.

+

Creates a new GCompletion.

@@ -192,6 +200,10 @@ This is used when you use data structures as

g_completion_add_items ()

void                g_completion_add_items              (GCompletion *cmp,
                                                          GList *items);
+
+

Warning

+

g_completion_add_items has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Adds items to the GCompletion.

@@ -216,6 +228,10 @@ Adds items to the

g_completion_remove_items ()

void                g_completion_remove_items           (GCompletion *cmp,
                                                          GList *items);
+
+

Warning

+

g_completion_remove_items has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Removes items from a GCompletion.

@@ -239,6 +255,10 @@ Removes items from a

g_completion_clear_items ()

void                g_completion_clear_items            (GCompletion *cmp);
+
+

Warning

+

g_completion_clear_items has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Removes all items from the GCompletion.

@@ -257,6 +277,10 @@ Removes all items from the GList* g_completion_complete (GCompletion *cmp, const gchar *prefix, gchar **new_prefix); +
+

Warning

+

g_completion_complete has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Attempts to complete the string prefix using the GCompletion target items. @@ -298,6 +322,10 @@ target items.

GList*              g_completion_complete_utf8          (GCompletion *cmp,
                                                          const gchar *prefix,
                                                          gchar **new_prefix);
+
+

Warning

+

g_completion_complete_utf8 has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Attempts to complete the string prefix using the GCompletion target items. In contrast to g_completion_complete(), this function returns the largest common @@ -345,6 +373,10 @@ not be changed.

g_completion_set_compare ()

void                g_completion_set_compare            (GCompletion *cmp,
                                                          GCompletionStrncmpFunc strncmp_func);
+
+

Warning

+

g_completion_set_compare has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Sets the function to use for string comparisons. The default string comparison function is strncmp(). @@ -409,6 +441,10 @@ Specifies the type of the function passed to

g_completion_free ()

void                g_completion_free                   (GCompletion *cmp);
+
+

Warning

+

g_completion_free has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

+

Frees all memory used by the GCompletion.

@@ -425,6 +461,6 @@ Frees all memory used by the
- Generated by GTK-Doc V1.14
+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/glib/html/glib-Balanced-Binary-Trees.html b/docs/reference/glib/html/glib-Balanced-Binary-Trees.html index b877113..c1f7dd5 100644 --- a/docs/reference/glib/html/glib-Balanced-Binary-Trees.html +++ b/docs/reference/glib/html/glib-Balanced-Binary-Trees.html @@ -3,12 +3,12 @@ Balanced Binary Trees - + - + @@ -797,6 +797,6 @@ the <
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Base64-Encoding.html b/docs/reference/glib/html/glib-Base64-Encoding.html index 9616b1b..721fcda 100644 --- a/docs/reference/glib/html/glib-Base64-Encoding.html +++ b/docs/reference/glib/html/glib-Base64-Encoding.html @@ -3,12 +3,12 @@ Base64 Encoding - + - + @@ -96,11 +96,11 @@ Support for Base64 encoding has been added in GLib 2.12. gint *save);

Incrementally encode a sequence of binary data into its Base-64 stringified -representation. By calling this function multiple times you can convert +representation. By calling this function multiple times you can convert data in chunks to avoid having to have the full encoded data in memory.

-When all of the data has been converted you must call +When all of the data has been converted you must call g_base64_encode_close() to flush the saved state.

@@ -112,7 +112,7 @@ non-zero state). If you enable line-breaking you will need at least:

break_lines is typically used when putting base64-encoded data in emails. -It breaks the lines at 72 columns instead of putting all of the text on +It breaks the lines at 72 columns instead of putting all of the text on the same line. This avoids problems with long lines in the email system.

@@ -231,7 +231,7 @@ representation. @@ -250,7 +250,7 @@ representation. guint *save);

Incrementally decode a sequence of binary data from its Base-64 stringified -representation. By calling this function multiple times you can convert +representation. By calling this function multiple times you can convert data in chunks to avoid having to have the full encoded data in memory.

@@ -367,6 +367,6 @@ by overwriting the input data.

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Basic-Types.html b/docs/reference/glib/html/glib-Basic-Types.html index 9f06d23..cf9627e 100644 --- a/docs/reference/glib/html/glib-Basic-Types.html +++ b/docs/reference/glib/html/glib-Basic-Types.html @@ -3,12 +3,12 @@ Basic Types - + - + @@ -495,6 +495,6 @@ Since: 2.18 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Bookmark-file-parser.html b/docs/reference/glib/html/glib-Bookmark-file-parser.html index ea0cbc1..78287b8 100644 --- a/docs/reference/glib/html/glib-Bookmark-file-parser.html +++ b/docs/reference/glib/html/glib-Bookmark-file-parser.html @@ -3,12 +3,12 @@ Bookmark file parser - + - + @@ -181,31 +181,31 @@ enum

Description

-GBookmarkFile lets you parse, edit or create files containing bookmarks -to URI, along with some meta-data about the resource pointed by the URI like -its MIME type, the application that is registering the bookmark and the -icon that should be used to represent the bookmark. The data is stored using -the +GBookmarkFile lets you parse, edit or create files containing bookmarks +to URI, along with some meta-data about the resource pointed by the URI +like its MIME type, the application that is registering the bookmark and +the icon that should be used to represent the bookmark. The data is stored +using the Desktop Bookmark Specification.

The syntax of the bookmark files is described in detail inside the Desktop -Bookmark Specification, here is a quick summary: bookmark files use a sub-class -of the -XML Bookmark Exchange Language specification, consisting -of valid UTF-8 encoded XML, under the xbel root element; -each bookmark is stored inside a bookmark element, using -its URI: no relative paths can be used inside a bookmark file. The bookmark -may have a user defined title and description, to be used instead of the URI. -Under the metadata element, with its owner +Bookmark Specification, here is a quick summary: bookmark files use a +sub-class of the XML Bookmark Exchange Language +specification, consisting of valid UTF-8 encoded XML, under the +xbel root element; each bookmark is stored inside a +bookmark element, using its URI: no relative paths can +be used inside a bookmark file. The bookmark may have a user defined title +and description, to be used instead of the URI. Under the +metadata element, with its owner attribute set to http://freedesktop.org, is stored the meta-data about a resource pointed by its URI. The meta-data consists of the resource's MIME type; the applications that have registered a bookmark; the groups to which a bookmark belongs to; a visibility flag, used to set the bookmark as "private" to the applications and groups that has it -registered; the URI and MIME type of an icon, to be used when displaying the -bookmark inside a GUI. +registered; the URI and MIME type of an icon, to be used when displaying +the bookmark inside a GUI.

Returns :

a newly allocated, zero-terminated Base-64 encoded - string representing data. The returned string must + string representing data. The returned string must be freed with g_free().
@@ -246,32 +246,34 @@ bookmark inside a GUI. <info> <metadata owner="http://freedesktop.org"> <mime:mime-type>text/xml</mime:mime-type> - <bookmark:applications> + <bookmark:applications> <bookmark:application name="GEdit" count="2" exec="gedit %u" timestamp="1115726763"/> <bookmark:application name="GViM" count="7" exec="gvim %f" timestamp="1115726812"/> - </bookmark:applications> - <bookmark:groups> - <bookmark:group>Editors</bookmark:group> - </bookmark:groups> + </bookmark:applications> + <bookmark:groups> + <bookmark:group>Editors</bookmark:group> + </bookmark:groups> </metadata> </info> </bookmark> -</xbel> +</xbel

-A bookmark file might contain more than one bookmark; each bookmark is accessed -through its URI.

-The important caveat of bookmark files is that when you add a new bookmark you -must also add the application that is registering it, using -g_bookmark_file_add_application() or g_bookmark_file_set_app_info(). If a -bookmark has no applications then it won't be dumped when creating the -on disk representation, using g_bookmark_file_to_data() or +A bookmark file might contain more than one bookmark; each bookmark +is accessed through its URI. +

+

+The important caveat of bookmark files is that when you add a new +bookmark you must also add the application that is registering it, using +g_bookmark_file_add_application() or g_bookmark_file_set_app_info(). +If a bookmark has no applications then it won't be dumped when creating +the on disk representation, using g_bookmark_file_to_data() or g_bookmark_file_to_file().

@@ -284,8 +286,8 @@ The

GBookmarkFile

typedef struct _GBookmarkFile GBookmarkFile;

-The GBookmarkFile struct contains only private data -and should not be used directly. +The GBookmarkFile struct contains only +private data and should not be directly accessed.


@@ -294,9 +296,9 @@ and should not be used directly.
#define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
 

-Error domain for bookmark file parsing. Errors in this domain will be -from the GBookmarkFileError enumeration. See GError for informations -on error domains. +Error domain for bookmark file parsing. +Errors in this domain will be from the GBookmarkFileError +enumeration. See GError for information on error domains.


@@ -332,8 +334,8 @@ Error codes returned by bookmark file parsing.

G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED

-a requested application did not -register a bookmark +a requested application did + not register a bookmark @@ -348,8 +350,8 @@ register a bookmark

G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING

-the text being parsed was in an -unknown encoding +the text being parsed was + in an unknown encoding @@ -2049,6 +2051,6 @@ In the event the URI cannot be found,
- Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Byte-Arrays.html b/docs/reference/glib/html/glib-Byte-Arrays.html index 62ed8a5..f53af1b 100644 --- a/docs/reference/glib/html/glib-Byte-Arrays.html +++ b/docs/reference/glib/html/glib-Byte-Arrays.html @@ -3,12 +3,12 @@ Byte Arrays - + - + @@ -92,7 +92,7 @@ To free a
-

Example 22. Using a GByteArray

+

Example 22. Using a GByteArray

@@ -555,6 +555,6 @@ the size of array will be set to zero. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Byte-Order-Macros.html b/docs/reference/glib/html/glib-Byte-Order-Macros.html index 5f4a8c3..288b5f2 100644 --- a/docs/reference/glib/html/glib-Byte-Order-Macros.html +++ b/docs/reference/glib/html/glib-Byte-Order-Macros.html @@ -3,12 +3,12 @@ Byte Order Macros - + - + @@ -1681,6 +1681,6 @@ The conversion is symmetric so it can be used both ways. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Caches.html b/docs/reference/glib/html/glib-Caches.html index 4dd6963..83a63c0 100644 --- a/docs/reference/glib/html/glib-Caches.html +++ b/docs/reference/glib/html/glib-Caches.html @@ -3,12 +3,12 @@ Caches - + - + @@ -74,8 +74,8 @@ A GtkStyles and GdkGCs. These consume a lot of -resources, so a GCache is used to see if a GtkStyle or GdkGC with +GTK+ uses caches for GtkStyles and GdkGCs. These consume a lot of +resources, so a GCache is used to see if a GtkStyle or GdkGC with the required properties already exists. If it does, then the existing object is used instead of creating a new one.

@@ -393,6 +393,6 @@ value corresponding to the key. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Character-Set-Conversion.html b/docs/reference/glib/html/glib-Character-Set-Conversion.html index 7319f77..b97878e 100644 --- a/docs/reference/glib/html/glib-Character-Set-Conversion.html +++ b/docs/reference/glib/html/glib-Character-Set-Conversion.html @@ -3,12 +3,12 @@ Character Set Conversion - + - + @@ -31,7 +31,7 @@

Character Set Conversion

-

Character Set Conversion — convert strings between different character sets using iconv()

+

Character Set Conversion — Convert strings between different character sets

@@ -86,12 +86,6 @@ gsize *bytes_read, gsize *bytes_written, GError **error); -gchar * g_filename_from_uri (const gchar *uri, - gchar **hostname, - GError **error); -gchar * g_filename_to_uri (const gchar *filename, - const gchar *hostname, - GError **error); gboolean g_get_filename_charsets (G_CONST_RETURN gchar ***charsets); gchar * g_filename_display_name (const gchar *filename); gchar * g_filename_display_basename (const gchar *filename); @@ -108,74 +102,73 @@ enum

Description

+The g_convert() family of function wraps the functionality of iconv(). In +addition to pure character set conversions, GLib has functions to deal +with the extra complications of encodings for file names.

File Name Encodings

- Historically, Unix has not had a defined encoding for file - names: a file name is valid as long as it does not have path - separators in it ("/"). However, displaying file names may - require conversion: from the character set in which they were - created, to the character set in which the application - operates. Consider the Spanish file name - "Presentación.sxi". If the - application which created it uses ISO-8859-1 for its encoding, - then the actual file name on disk would look like this: -

+Historically, Unix has not had a defined encoding for file +names: a file name is valid as long as it does not have path +separators in it ("/"). However, displaying file names may +require conversion: from the character set in which they were +created, to the character set in which the application +operates. Consider the Spanish file name +"Presentación.sxi". If the +application which created it uses ISO-8859-1 for its encoding, +

 Character:  P  r  e  s  e  n  t  a  c  i  ó  n  .  s  x  i
 Hex code:   50 72 65 73 65 6e 74 61 63 69 f3 6e 2e 73 78 69
-      
+

- However, if the application use UTF-8, the actual file name on - disk would look like this: -

+However, if the application use UTF-8, the actual file name on +disk would look like this: +

 Character:  P  r  e  s  e  n  t  a  c  i  ó     n  .  s  x  i
 Hex code:   50 72 65 73 65 6e 74 61 63 69 c3 b3 6e 2e 73 78 69
-      
+

- Glib uses UTF-8 for its strings, and GUI toolkits like GTK+ - that use Glib do the same thing. If you get a file name from - the file system, for example, from - readdir(3) or from g_dir_read_name(), - and you wish to display the file name to the user, you - will need to convert it into UTF-8. The - opposite case is when the user types the name of a file he - wishes to save: the toolkit will give you that string in - UTF-8 encoding, and you will need to convert it to the - character set used for file names before you can create the - file with open(2) or - fopen(3). -

+Glib uses UTF-8 for its strings, and GUI toolkits like GTK+ +that use Glib do the same thing. If you get a file name from +the file system, for example, from readdir(3) or from g_dir_read_name(), +and you wish to display the file name to the user, you +will need to convert it into UTF-8. The +opposite case is when the user types the name of a file he +wishes to save: the toolkit will give you that string in +UTF-8 encoding, and you will need to convert it to the +character set used for file names before you can create the +file with open(2) or fopen(3). +

- By default, Glib assumes that file names on disk are in UTF-8 - encoding. This is a valid assumption for file systems which - were created relatively recently: most applications use UTF-8 - encoding for their strings, and that is also what they use for - the file names they create. However, older file systems may - still contain file names created in "older" encodings, such as - ISO-8859-1. In this case, for compatibility reasons, you may - want to instruct Glib to use that particular encoding for file - names rather than UTF-8. You can do this by specifying the - encoding for file names in the G_FILENAME_ENCODING - environment variable. For example, if your installation uses - ISO-8859-1 for file names, you can put this in your - ~/.profile: -

+By default, Glib assumes that file names on disk are in UTF-8 +encoding. This is a valid assumption for file systems which +were created relatively recently: most applications use UTF-8 +encoding for their strings, and that is also what they use for +the file names they create. However, older file systems may +still contain file names created in "older" encodings, such as +ISO-8859-1. In this case, for compatibility reasons, you may +want to instruct Glib to use that particular encoding for file +names rather than UTF-8. You can do this by specifying the +encoding for file names in the G_FILENAME_ENCODING +environment variable. For example, if your installation uses +ISO-8859-1 for file names, you can put this in your +~/.profile: +

 export G_FILENAME_ENCODING=ISO-8859-1
-      
+

- Glib provides the functions g_filename_to_utf8() - and g_filename_from_utf8() - to perform the necessary conversions. These functions convert - file names from the encoding specified in - G_FILENAME_ENCODING to UTF-8 and vice-versa. - Figure 2, “Conversion between File Name Encodings” illustrates how - these functions are used to convert between UTF-8 and the - encoding for file names in the file system. -

+Glib provides the functions g_filename_to_utf8() and +g_filename_from_utf8() to perform the necessary conversions. These +functions convert file names from the encoding specified in +G_FILENAME_ENCODING to UTF-8 and vice-versa. +Figure 2, “Conversion between File Name Encodings” illustrates how +these functions are used to convert between UTF-8 and the +encoding for file names in the file system. +

Figure 2. Conversion between File Name Encodings

Conversion between File Name Encodings
@@ -183,49 +176,42 @@ export G_FILENAME_ENCODING=ISO-8859-1

Checklist for Application Writers

- This section is a practical summary of the detailed - description above. You can use this as a checklist of - things to do to make sure your applications process file - name encodings correctly. -

+This section is a practical summary of the detailed +description above. You can use this as a checklist of +things to do to make sure your applications process file +name encodings correctly. +

  1. - If you get a file name from the file system from a - function such as readdir(3) or - gtk_file_chooser_get_filename(), - you do not need to do any conversion to pass that - file name to functions like open(2), - rename(2), or - fopen(3) — those are "raw" - file names which the file system understands. -

  2. +If you get a file name from the file system from a function +such as readdir(3) or gtk_file_chooser_get_filename(), +you do not need to do any conversion to pass that +file name to functions like open(2), rename(2), or +fopen(3) — those are "raw" file names which the file +system understands. +

  3. - If you need to display a file name, convert it to UTF-8 - first by using g_filename_to_utf8(). - If conversion fails, display a string like - "Unknown file name". Do - not convert this string back into the - encoding used for file names if you wish to pass it to - the file system; use the original file name instead. - For example, the document window of a word processor - could display "Unknown file name" in its title bar but - still let the user save the file, as it would keep the - raw file name internally. This can happen if the user - has not set the G_FILENAME_ENCODING - environment variable even though he has files whose - names are not encoded in UTF-8. -

  4. +If you need to display a file name, convert it to UTF-8 first by +using g_filename_to_utf8(). If conversion fails, display a string like +"Unknown file name". Do not +convert this string back into the encoding used for file names if you +wish to pass it to the file system; use the original file name instead. +For example, the document window of a word processor could display +"Unknown file name" in its title bar but still let the user save the +file, as it would keep the raw file name internally. This can happen +if the user has not set the G_FILENAME_ENCODING +environment variable even though he has files whose names are not +encoded in UTF-8. +

  5. - If your user interface lets the user type a file name - for saving or renaming, convert it to the encoding used - for file names in the file system by using g_filename_from_utf8(). - Pass the converted file name to functions like - fopen(3). If conversion fails, ask - the user to enter a different file name. This can - happen if the user types Japanese characters when - G_FILENAME_ENCODING is set to - ISO-8859-1, for example. -

  6. +If your user interface lets the user type a file name for saving or +renaming, convert it to the encoding used for file names in the file +system by using g_filename_from_utf8(). Pass the converted file name +to functions like fopen(3). If conversion fails, ask the user to enter +a different file name. This can happen if the user types Japanese +characters when G_FILENAME_ENCODING is set to +ISO-8859-1, for example. +

@@ -399,9 +385,6 @@ conversions[

GIConv

typedef struct _GIConv GIConv;

-The GIConv struct wraps an -iconv() conversion descriptor. It contains private data -and should only be accessed using the following functions.


@@ -786,86 +769,6 @@ on other platforms, this function indirectly depends on the
-
-

g_filename_from_uri ()

-
gchar *             g_filename_from_uri                 (const gchar *uri,
-                                                         gchar **hostname,
-                                                         GError **error);
-

-Converts an escaped ASCII-encoded URI to a local filename in the -encoding used for filenames. -

-
-- - - - - - - - - - - - - - - - - - -

uri :

a uri describing a filename (escaped, encoded in ASCII). -

hostname :

Location to store hostname for the URI, or NULL. - If there is no hostname in the URI, NULL will be - stored in this location. -

error :

location to store the error occuring, or NULL to ignore - errors. Any of the errors in GConvertError may occur. -

Returns :

a newly-allocated string holding the resulting - filename, or NULL on an error. -
-
-
-
-

g_filename_to_uri ()

-
gchar *             g_filename_to_uri                   (const gchar *filename,
-                                                         const gchar *hostname,
-                                                         GError **error);
-

-Converts an absolute filename to an escaped ASCII-encoded URI, with the path -component following Section 3.3. of RFC 2396. -

-
-- - - - - - - - - - - - - - - - - - -

filename :

an absolute filename specified in the GLib file name encoding, - which is the on-disk file name bytes on Unix, and UTF-8 on - Windows -

hostname :

A UTF-8 encoded hostname, or NULL for none. -

error :

location to store the error occuring, or NULL to ignore - errors. Any of the errors in GConvertError may occur. -

Returns :

a newly-allocated string holding the resulting - URI, or NULL on an error. -
-
-

g_get_filename_charsets ()

gboolean            g_get_filename_charsets             (G_CONST_RETURN gchar ***charsets);
@@ -1067,7 +970,7 @@ Windows this means the system codepage.

enum GConvertError

-
typedef enum 
+
typedef enum
 {
   G_CONVERT_ERROR_NO_CONVERSION,
   G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
@@ -1085,8 +988,8 @@ Error codes returned by character set conversion routines.
 
 
 

G_CONVERT_ERROR_NO_CONVERSION

-Conversion between the requested character sets -is not supported. +Conversion between the requested character + sets is not supported. @@ -1162,12 +1065,12 @@ freed.


-

[1] +

[1] Note that some encodings may allow nul bytes to occur inside strings. In that case, using -1 for the len parameter is unsafe.

-

[2] +

[2] Despite the fact that byes_read can return information about partial characters, the g_convert_... functions are not generally suitable for streaming. If the underlying converter @@ -1182,6 +1085,6 @@ character.)

+ Generated by GTK-Doc V1.15
\ No newline at end of file diff --git a/docs/reference/glib/html/glib-Commandline-option-parser.html b/docs/reference/glib/html/glib-Commandline-option-parser.html index e61625b..75acaac 100644 --- a/docs/reference/glib/html/glib-Commandline-option-parser.html +++ b/docs/reference/glib/html/glib-Commandline-option-parser.html @@ -3,12 +3,12 @@ Commandline option parser - + - + @@ -125,15 +125,16 @@ enum

Description

-The GOption commandline parser is intended to be a simpler replacement for the -popt library. It supports short and long commandline options, as shown in the -following example: +The GOption commandline parser is intended to be a simpler replacement +for the popt library. It supports short and long commandline options, +as shown in the following example:

testtreemodel -r 1 --max-size 20 --rand --display=:1.0 -vb -- file1 file2

-The example demonstrates a number of features of the GOption commandline parser +The example demonstrates a number of features of the GOption +commandline parser

  • @@ -144,29 +145,33 @@ The example demonstrates a number of features of the GOption commandline parser Long options are prefixed by two consecutive dashes.

  • - Options can have an extra argument, which can be a number, a string or a - filename. For long options, the extra argument can be appended with an - equals sign after the option name. + Options can have an extra argument, which can be a number, a string or + a filename. For long options, the extra argument can be appended with + an equals sign after the option name, which is useful if the extra + argument starts with a dash, which would otherwise cause it to be + interpreted as another option.

  • Non-option arguments are returned to the application as rest arguments.

  • - An argument consisting solely of two dashes turns off further parsing, - any remaining arguments (even those starting with a dash) are returned + An argument consisting solely of two dashes turns off further parsing, + any remaining arguments (even those starting with a dash) are returned to the application as rest arguments.

-Another important feature of GOption is that it can automatically generate -nicely formatted help output. Unless it is explicitly turned off with -g_option_context_set_help_enabled(), GOption will recognize the ---help, -?, --help-all -and --help-groupname options -(where groupname is the name of a GOptionGroup) -and write a text similar to the one shown in the following example to stdout. +Another important feature of GOption is that it can automatically +generate nicely formatted help output. Unless it is explicitly turned +off with g_option_context_set_help_enabled(), GOption will recognize +the --help, -?, +--help-all and +--help-groupname options +(where groupname is the name of a +GOptionGroup) and write a text similar to the one shown in the +following example to stdout.

@@ -184,7 +189,7 @@ Application Options: -m, --max-size=M Test up to 2^M items --display=DISPLAY X display to use -v, --verbose Be verbose - -b, --beep Beep when done + -b, --beep Beep when done --rand Randomize the data

@@ -194,13 +199,14 @@ GOption groups options in GOptionContext, and parse all options by a single call -to g_option_context_parse(). See gtk_get_option_group() for an example. +to g_option_context_parse(). See gtk_get_option_group() for an example.

If an option is declared to be of type string or filename, GOption takes -care of converting it to the right encoding; strings are returned in UTF-8, -filenames are returned in the GLib filename encoding. Note that this only -works if setlocale() has been called before g_option_context_parse(). +care of converting it to the right encoding; strings are returned in +UTF-8, filenames are returned in the GLib filename encoding. Note that +this only works if setlocale() has been called before +g_option_context_parse().

Here is a complete example of setting up GOption to parse the example @@ -252,7 +258,7 @@ commandline above and produce the example help output. static gboolean beep = FALSE; static gboolean rand = FALSE; -static GOptionEntry entries[] = +static GOptionEntry entries[] = { { "repeats", 'r', 0, G_OPTION_ARG_INT, &repeats, "Average over N repetitions", "N" }, { "max-size", 'm', 0, G_OPTION_ARG_INT, &max_size, "Test up to 2^M items", "M" }, @@ -262,7 +268,7 @@ commandline above and produce the example help output. { NULL } }; -int +int main (int argc, char *argv[]) { GError *error = NULL; @@ -270,14 +276,14 @@ commandline above and produce the example help output. context = g_option_context_new ("- test tree model performance"); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); - g_option_context_add_group (context, gtk_get_option_group (TRUE)); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print ("option parsing failed: %s\n", error->message); exit (1); } - // ... + /* ... */ } @@ -398,7 +404,7 @@ fields and should not be directly accessed.

g_option_context_new ()

GOptionContext *    g_option_context_new                (const gchar *parameter_string);

-Creates a new option context. +Creates a new option context.

The parameter_string can serve multiple purposes. It can be used @@ -428,7 +434,7 @@ it should normally be passed untranslated.

parameter_string :

a string which is displayed in the first line of --help output, after the - usage summary + usage summary programname [OPTION...] @@ -451,10 +457,10 @@ it should normally be passed untranslated.

Adds a string to be displayed in --help output before the list of options. This is typically a summary of the -program functionality. +program functionality.

-Note that the summary is translated (see +Note that the summary is translated (see g_option_context_set_translate_func() and g_option_context_set_translation_domain()).

@@ -468,7 +474,7 @@ Note that the summary is translated (see

summary :

-a string to be shown in --help output +a string to be shown in --help output before the list of options, or NULL @@ -512,7 +518,7 @@ after the list of options. This text often includes a bug reporting address.

-Note that the summary is translated (see +Note that the summary is translated (see g_option_context_set_translate_func()).

@@ -525,7 +531,7 @@ Note that the summary is translated (see - @@ -598,14 +604,14 @@ strings, for --help output. gpointer data, GDestroyNotify destroy_notify);

-Sets the function which is used to translate the contexts -user-visible strings, for --help output. +Sets the function which is used to translate the contexts +user-visible strings, for --help output. If func is NULL, strings are not translated.

-Note that option groups have their own translation functions, -this function only affects the parameter_string (see g_option_context_new()), -the summary (see g_option_context_set_summary()) and the description +Note that option groups have their own translation functions, +this function only affects the parameter_string (see g_option_context_new()), +the summary (see g_option_context_set_summary()) and the description (see g_option_context_set_description()).

@@ -622,7 +628,7 @@ domain, see func :

- @@ -671,7 +677,7 @@ user-visible strings.

g_option_context_free ()

void                g_option_context_free               (GOptionContext *context);

-Frees context and all the groups which have been +Frees context and all the groups which have been added to it.

@@ -682,7 +688,7 @@ Please note that parsed arguments need to be freed separately (see

-

description :

a string to be shown in --help output +a string to be shown in --help output after the list of options, or NULL
the GTranslateFunc, or NULL +the GTranslateFunc, or NULL

context :

a GOptionContext +a GOptionContext
@@ -697,28 +703,28 @@ Please note that parsed arguments need to be freed separately (see GError **error);

Parses the command line arguments, recognizing options -which have been added to context. A side-effect of +which have been added to context. A side-effect of calling this function is that g_set_prgname() will be called.

If the parsing is successful, any parsed arguments are -removed from the array and argc and argv are updated +removed from the array and argc and argv are updated accordingly. A '--' option is stripped from argv -unless there are unparsed options before and after it, -or some of the options after it start with '-'. In case -of an error, argc and argv are left unmodified. +unless there are unparsed options before and after it, +or some of the options after it start with '-'. In case +of an error, argc and argv are left unmodified.

If automatic --help support is enabled -(see g_option_context_set_help_enabled()), and the +(see g_option_context_set_help_enabled()), and the argv array contains one of the recognized help options, this function will produce help output to stdout and call exit (0).

-Note that function depends on the -current locale for +Note that function depends on the +current locale for automatic character set conversion of string and filename arguments.

@@ -742,12 +748,12 @@ arguments.

error :

-a return location for errors +a return location for errors

Returns :

- TRUE if the parsing was successful, + TRUE if the parsing was successful, FALSE if an error occurred @@ -762,7 +768,7 @@ arguments.
void                g_option_context_set_help_enabled   (GOptionContext *context,
                                                          gboolean help_enabled);

-Enables or disables automatic generation of --help +Enables or disables automatic generation of --help output. By default, g_option_context_parse() recognizes --help, -h, -?, --help-all @@ -820,12 +826,12 @@ is turned on for context. See GOptionContext *context, gboolean ignore_unknown);

-Sets whether to ignore unknown options or not. If an argument is -ignored, it is left in the argv array after parsing. By default, +Sets whether to ignore unknown options or not. If an argument is +ignored, it is left in the argv array after parsing. By default, g_option_context_parse() treats unknown options as error.

-This setting does not affect non-option arguments (i.e. arguments +This setting does not affect non-option arguments (i.e. arguments which don't start with a dash). But note that GOption cannot reliably determine whether a non-option belongs to a preceding unknown option.

@@ -900,7 +906,7 @@ To obtain the help text for an option group, call

main_help :

-if TRUE, only include the main group +if TRUE, only include the main group @@ -1212,7 +1218,7 @@ To have an effect, they must be added to a const GOptionEntry *entries
, const gchar *translation_domain);

-A convenience function which creates a main group if it doesn't +A convenience function which creates a main group if it doesn't exist, adds the entries to it and sets the translation domain.

@@ -1289,9 +1295,9 @@ to a context.
void                g_option_context_set_main_group     (GOptionContext *context,
                                                          GOptionGroup *group);

-Sets a GOptionGroup as main group of the context. -This has the same effect as calling g_option_context_add_group(), -the only difference is that the options in the main group are +Sets a GOptionGroup as main group of the context. +This has the same effect as calling g_option_context_add_group(), +the only difference is that the options in the main group are treated differently when generating --help output.

@@ -1360,7 +1366,7 @@ Creates a new description :

-
@@ -1385,7 +1391,7 @@ Creates a new Returns :

-
@@ -1487,7 +1493,7 @@ The type of function that can be called before and after parsing. GOptionParseFunc pre_parse_func, GOptionParseFunc post_parse_func);

-Associates two functions with group which will be called +Associates two functions with group which will be called from g_option_context_parse() before the first option is parsed and after the last option has been parsed, respectively.

@@ -1561,7 +1567,7 @@ The type of function to be used as callback when a parse error occurs.
void                g_option_group_set_error_hook       (GOptionGroup *group,
                                                          GOptionErrorFunc error_func);

-Associates a function with group which will be called +Associates a function with group which will be called from g_option_context_parse() when an error occurs.

@@ -1612,7 +1618,7 @@ domain, see func :

- @@ -1660,6 +1666,6 @@ user-visible strings. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Data-Checksums.html b/docs/reference/glib/html/glib-Data-Checksums.html index dc4d4e0..b2be173 100644 --- a/docs/reference/glib/html/glib-Data-Checksums.html +++ b/docs/reference/glib/html/glib-Data-Checksums.html @@ -3,12 +3,12 @@ Data Checksums - + - + @@ -100,7 +100,7 @@ The hashing algorithm to be used by GChecksumType enumeration may be extended at a later +Note that the GChecksumType enumeration may be extended at a later date to include new hashing algorithm types.

a description for this group to be shown in +a description for this group to be shown in --help. This string is translated using the translation domain or translation function of the group a newly created option group. It should be added + a newly created option group. It should be added to a GOptionContext or freed with g_option_group_free(). the GTranslateFunc, or NULL +the GTranslateFunc, or NULL
@@ -167,7 +167,7 @@ a GChecksum, use

g_checksum_new ()

GChecksum *         g_checksum_new                      (GChecksumType checksum_type);

-Creates a new GChecksum, using the checksum algorithm checksum_type. +Creates a new GChecksum, using the checksum algorithm checksum_type. If the checksum_type is not known, NULL is returned. A GChecksum can be used to compute the checksum, or digest, of an arbitrary binary blob, using different hashing algorithms. @@ -192,7 +192,7 @@ on it anymore.

- @@ -455,6 +455,6 @@ The hexadecimal string returned will be in lower case. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Datasets.html b/docs/reference/glib/html/glib-Datasets.html index 1648d62..11342bd 100644 --- a/docs/reference/glib/html/glib-Datasets.html +++ b/docs/reference/glib/html/glib-Datasets.html @@ -3,12 +3,12 @@ Datasets - + - + @@ -523,6 +523,6 @@ destroy functions set for data elements. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Date-and-Time-Functions.html b/docs/reference/glib/html/glib-Date-and-Time-Functions.html index a95cbe6..717639e 100644 --- a/docs/reference/glib/html/glib-Date-and-Time-Functions.html +++ b/docs/reference/glib/html/glib-Date-and-Time-Functions.html @@ -3,12 +3,12 @@ Date and Time Functions - + - - + + @@ -18,7 +18,7 @@ - +

Returns :

the newly created GChecksum, or NULL. + the newly created GChecksum, or NULL. Use g_checksum_free() to free the memory allocated by it. Up Home GLib Reference ManualNextNext
Top @@ -50,6 +50,9 @@ GTimeVal *time_); gchar* g_time_val_to_iso8601 (GTimeVal *time_); +gint64 g_get_monotonic_time (void); +gint64 g_get_real_time (void); + GDate; typedef GTime; enum GDateDMY; @@ -195,10 +198,7 @@ struct. Often only the day-month-year or only the Julian representation is valid. Sometimes neither is valid. Use the API.

-GLib doesn't contain any time-manipulation functions; however, there -is a GTime typedef and a GTimeVal struct which represents a more -precise time (with microseconds). You can request the current time as -a GTimeVal with g_get_current_time(). +GLib also features GDateTime which represents a precise time.

@@ -225,6 +225,11 @@ Represents a precise time, with seconds and microseconds. Similar to the struct timeval returned by the gettimeofday() UNIX call.

+

+GLib is attempting to unify around the use of 64bit integers to +represent microsecond-precision time. As such, this type will be +removed from a future version of GLib. +

@@ -248,6 +253,9 @@ the gettimeofday() U

Equivalent to the UNIX gettimeofday() function, but portable.

+

+You may find g_get_real_time() to be more convenient. +

@@ -362,6 +370,64 @@ Coordinated Universal Time (UTC).

Since 2.12


+
+

g_get_monotonic_time ()

+
gint64              g_get_monotonic_time                (void);
+

+Queries the system monotonic time, if available. +

+

+On POSIX systems with clock_gettime() and CLOCK_MONOTONIC this call +is a very shallow wrapper for that. Otherwise, we make a best effort +that probably involves returning the wall clock time (with at least +microsecond accuracy, subject to the limitations of the OS kernel). +

+

+Note that, on Windows, "limitations of the OS kernel" is a rather +substantial statement. Depending on the configuration of the system, +the wall clock time is updated as infrequently as 64 times a second +(which is approximately every 16ms). +

+
++ + + + +

Returns :

the monotonic time, in microseconds + +
+

Since 2.28

+
+
+
+

g_get_real_time ()

+
gint64              g_get_real_time                     (void);
+

+Queries the system wall-clock time. +

+

+This call is functionally equivalent to g_get_current_time() except +that the return value is often more convenient than dealing with a +GTimeVal. +

+

+You should only use this call if you are actually interested in the real +wall-clock time. g_get_monotonic_time() is probably more useful for +measuring intervals. +

+
++ + + + +

Returns :

the number of microseconds since January 1, 1970 UTC. + +
+

Since 2.28

+
+

GDate

typedef struct {
@@ -1054,6 +1120,9 @@ Sets the value of a date from a tv_usec member is ignored, because GDate can't make use of the
 additional precision.
 

+

+The time to date conversion is done using the user's current timezone. +

@@ -1608,7 +1677,7 @@ Returns

g_date_is_leap_year ()

gboolean            g_date_is_leap_year                 (GDateYear year);

-Returns TRUE if the year is a leap year.[4] +Returns TRUE if the year is a leap year.[4]

@@ -2029,7 +2098,7 @@ values are the only valid weekdays.


-

[4] +

[4] For the purposes of this function, leap year is every year divisible by 4 unless that year is divisible by 100. If it is divisible by 100 it would be a leap year only if that year is also divisible by 400.

@@ -2037,6 +2106,6 @@ be a leap year only if that year is also divisible by 400.

+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Double-ended-Queues.html b/docs/reference/glib/html/glib-Double-ended-Queues.html index b7f537e..4310563 100644 --- a/docs/reference/glib/html/glib-Double-ended-Queues.html +++ b/docs/reference/glib/html/glib-Double-ended-Queues.html @@ -3,12 +3,12 @@ Double-ended Queues - + - + @@ -808,7 +808,7 @@ Removes the first element in queue that
void                g_queue_remove_all                  (GQueue *queue,
                                                          gconstpointer data);

-Remove all elemeents in queue which contains data. +Remove all elements whose data equals data from queue.

@@ -1273,6 +1273,6 @@ Removes link_ from + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Doubly-Linked-Lists.html b/docs/reference/glib/html/glib-Doubly-Linked-Lists.html index 32b96a4..abd271d 100644 --- a/docs/reference/glib/html/glib-Doubly-Linked-Lists.html +++ b/docs/reference/glib/html/glib-Doubly-Linked-Lists.html @@ -3,12 +3,12 @@ Doubly-Linked Lists - + - + @@ -66,6 +66,8 @@ GList* g_list_remove_all (GList *list, gconstpointer data); void g_list_free (GList *list); +void g_list_free_full (GList *list, + GDestroyNotify free_func); GList* g_list_alloc (void); void g_list_free_1 (GList *list); @@ -608,7 +610,8 @@ The freed elements are returned to the slice allocator.

Note

If list elements contain dynamically-allocated memory, -they should be freed first. +you should either use g_list_free_full() or free them manually +first.

@@ -623,6 +626,32 @@ they should be freed first.


+
+

g_list_free_full ()

+
void                g_list_free_full                    (GList *list,
+                                                         GDestroyNotify free_func);
+

+Convenience method, which frees all the memory used by a GList, and +calls the specified destroy function on every element's data. +

+
++ + + + + + + + + + +

list :

a pointer to a GList +

free_func :

the function to be called to free each element's data +
+

Since 2.28

+
+

g_list_alloc ()

GList*              g_list_alloc                        (void);
@@ -1401,6 +1430,6 @@ with --disable-mem-pools
+ Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Dynamic-Loading-of-Modules.html b/docs/reference/glib/html/glib-Dynamic-Loading-of-Modules.html index bbf3135..da866ae 100644 --- a/docs/reference/glib/html/glib-Dynamic-Loading-of-Modules.html +++ b/docs/reference/glib/html/glib-Dynamic-Loading-of-Modules.html @@ -3,12 +3,12 @@ Dynamic Loading of Modules - + - + @@ -100,7 +100,7 @@ it must ensure that it is never unloaded, by calling -

Example 11. Calling a function defined in a GModule

+

Example 11. Calling a function defined in a GModule

@@ -543,6 +543,6 @@ Used to declare functions imported from modules. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Error-Reporting.html b/docs/reference/glib/html/glib-Error-Reporting.html index 2cb7506..92278e9 100644 --- a/docs/reference/glib/html/glib-Error-Reporting.html +++ b/docs/reference/glib/html/glib-Error-Reporting.html @@ -3,12 +3,12 @@ Error Reporting - + - + @@ -490,6 +490,9 @@ The error domain is called

  • +The quark function for the error domain is called <namespace>_<module>_error_quark, for example g_spawn_error_quark() or %g_thread_error_quark(). +

  • +
  • The error codes are in an enumeration called <Namespace><Module>Error; for example, GThreadError or GSpawnError. @@ -1018,6 +1021,6 @@ After the move, add a prefix as with

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-File-Utilities.html b/docs/reference/glib/html/glib-File-Utilities.html index ab9ba21..1cab1aa 100644 --- a/docs/reference/glib/html/glib-File-Utilities.html +++ b/docs/reference/glib/html/glib-File-Utilities.html @@ -3,12 +3,12 @@ File Utilities - + - + @@ -92,10 +92,11 @@ const const gchar *newfilename); int g_mkdir (const gchar *filename, int mode); +typedef GStatBuf; int g_stat (const gchar *filename, - struct _g_stat_struct *buf); + GStatBuf *buf); int g_lstat (const gchar *filename, - struct _g_stat_struct *buf); + GStatBuf *buf); int g_unlink (const gchar *filename); int g_remove (const gchar *filename); int g_rmdir (const gchar *filename); @@ -553,6 +554,10 @@ If the call was sucessful, it returns FALSE and sets error. The error domain is G_FILE_ERROR. Possible error codes are those in the GFileError enumeration.

    +

    +Note that the name for the temporary file is constructed by appending up +to 7 characters to filename. +

  • @@ -904,7 +909,8 @@ An opaque structure representing an opened directory. GError **error);

    Opens a directory for reading. The names of the files in the -directory can then be retrieved using g_dir_read_name(). +directory can then be retrieved using g_dir_read_name(). Note +that the ordering is not defined.

    @@ -942,9 +948,18 @@ directory can then be retrieved using

    g_dir_read_name ()

    const gchar *       g_dir_read_name                     (GDir *dir);

    -Retrieves the name of the next entry in the directory. The '.' and -'..' entries are omitted. On Windows, the returned name is in -UTF-8. On Unix, it is in the on-disk encoding. +Retrieves the name of another entry in the directory, or NULL. +The order of entries returned from this function is not defined, +and may vary by file system or other operating-system dependent +factors. +

    +

    +On Unix, the '.' and '..' entries are omitted, and the returned +name is in the on-disk encoding. +

    +

    +On Windows, as is true of all GLib functions which operate on +filenames, the returned name is in UTF-8.

    @@ -1318,10 +1333,21 @@ See your C library manual for more details about mkdir()<

    Since 2.6


    +
    +

    GStatBuf

    +

    +A type corresponding to the appropriate struct type for the stat +system call, depending on the platform and/or compiler being used. +

    +

    +See g_stat() for more information. +

    +
    +

    g_stat ()

    int                 g_stat                              (const gchar *filename,
    -                                                         struct _g_stat_struct *buf);
    + GStatBuf *buf);

    A wrapper for the POSIX stat() function. The stat() function returns information about a file. On Windows the stat() function in @@ -1330,6 +1356,22 @@ not look at the ACL at all. Thus on Windows the protection bits in the st_mode field are a fabrication of little use.

    +On Windows the Microsoft C libraries have several variants of the +stat struct and stat() function with names +like "_stat", "_stat32", "_stat32i64" and "_stat64i32". The one +used here is for 32-bit code the one with 32-bit size and time +fields, specifically called "_stat32". +

    +

    +In Microsoft's compiler, by default "struct stat" means one with +64-bit time fields while in MinGW "struct stat" is the legacy one +with 32-bit fields. To hopefully clear up this messs, the gstdio.h +header defines a type GStatBuf which is the appropriate struct type +depending on the platform and/or compiler being used. On POSIX it +is just "struct stat", but note that even on POSIX platforms, +"stat" might be a macro. +

    +

    See your C library manual for more details about stat().

    @@ -1361,7 +1403,7 @@ See your C library manual for more details about stat()

    g_lstat ()

    int                 g_lstat                             (const gchar *filename,
    -                                                         struct _g_stat_struct *buf);
    + GStatBuf *buf);

    A wrapper for the POSIX lstat() function. The lstat() function is like stat() except that in the case of symbolic links, it returns @@ -1805,6 +1847,6 @@ on your system.

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-GDateTime.html b/docs/reference/glib/html/glib-GDateTime.html new file mode 100644 index 0000000..981902a --- /dev/null +++ b/docs/reference/glib/html/glib-GDateTime.html @@ -0,0 +1,2195 @@ + + + + +GDateTime + + + + + + + + + +
    + + + + + + + + + +
    +
    +
    + + +
    +

    GDateTime

    +

    GDateTime — A structure representing Date and Time

    +
    +
    +

    Synopsis

    +
    +#include <glib.h>
    +
    +typedef             GTimeSpan;
    +#define             G_TIME_SPAN_DAY
    +#define             G_TIME_SPAN_HOUR
    +#define             G_TIME_SPAN_MINUTE
    +#define             G_TIME_SPAN_SECOND
    +#define             G_TIME_SPAN_MILLISECOND
    +
    +                    GDateTime;
    +void                g_date_time_unref                   (GDateTime *datetime);
    +GDateTime *         g_date_time_ref                     (GDateTime *datetime);
    +
    +GDateTime *         g_date_time_new_now                 (GTimeZone *tz);
    +GDateTime *         g_date_time_new_now_local           (void);
    +GDateTime *         g_date_time_new_now_utc             (void);
    +
    +GDateTime *         g_date_time_new_from_unix_local     (gint64 t);
    +GDateTime *         g_date_time_new_from_unix_utc       (gint64 t);
    +
    +GDateTime *         g_date_time_new_from_timeval_local  (const GTimeVal *tv);
    +GDateTime *         g_date_time_new_from_timeval_utc    (const GTimeVal *tv);
    +
    +GDateTime *         g_date_time_new                     (GTimeZone *tz,
    +                                                         gint year,
    +                                                         gint month,
    +                                                         gint day,
    +                                                         gint hour,
    +                                                         gint minute,
    +                                                         gdouble seconds);
    +GDateTime *         g_date_time_new_local               (gint year,
    +                                                         gint month,
    +                                                         gint day,
    +                                                         gint hour,
    +                                                         gint minute,
    +                                                         gdouble seconds);
    +GDateTime *         g_date_time_new_utc                 (gint year,
    +                                                         gint month,
    +                                                         gint day,
    +                                                         gint hour,
    +                                                         gint minute,
    +                                                         gdouble seconds);
    +
    +GDateTime *         g_date_time_add                     (GDateTime *datetime,
    +                                                         GTimeSpan timespan);
    +
    +GDateTime *         g_date_time_add_years               (GDateTime *datetime,
    +                                                         gint years);
    +GDateTime *         g_date_time_add_months              (GDateTime *datetime,
    +                                                         gint months);
    +GDateTime *         g_date_time_add_weeks               (GDateTime *datetime,
    +                                                         gint weeks);
    +GDateTime *         g_date_time_add_days                (GDateTime *datetime,
    +                                                         gint days);
    +
    +GDateTime *         g_date_time_add_hours               (GDateTime *datetime,
    +                                                         gint hours);
    +GDateTime *         g_date_time_add_minutes             (GDateTime *datetime,
    +                                                         gint minutes);
    +GDateTime *         g_date_time_add_seconds             (GDateTime *datetime,
    +                                                         gdouble seconds);
    +
    +GDateTime *         g_date_time_add_full                (GDateTime *datetime,
    +                                                         gint years,
    +                                                         gint months,
    +                                                         gint days,
    +                                                         gint hours,
    +                                                         gint minutes,
    +                                                         gdouble seconds);
    +
    +gint                g_date_time_compare                 (gconstpointer dt1,
    +                                                         gconstpointer dt2);
    +GTimeSpan           g_date_time_difference              (GDateTime *end,
    +                                                         GDateTime *begin);
    +guint               g_date_time_hash                    (gconstpointer datetime);
    +gboolean            g_date_time_equal                   (gconstpointer dt1,
    +                                                         gconstpointer dt2);
    +
    +void                g_date_time_get_ymd                 (GDateTime *datetime,
    +                                                         gint *year,
    +                                                         gint *month,
    +                                                         gint *day);
    +
    +gint                g_date_time_get_year                (GDateTime *datetime);
    +gint                g_date_time_get_month               (GDateTime *datetime);
    +gint                g_date_time_get_day_of_month        (GDateTime *datetime);
    +
    +gint                g_date_time_get_week_numbering_year (GDateTime *datetime);
    +gint                g_date_time_get_week_of_year        (GDateTime *datetime);
    +gint                g_date_time_get_day_of_week         (GDateTime *datetime);
    +
    +gint                g_date_time_get_day_of_year         (GDateTime *datetime);
    +
    +gint                g_date_time_get_hour                (GDateTime *datetime);
    +gint                g_date_time_get_minute              (GDateTime *datetime);
    +gint                g_date_time_get_second              (GDateTime *datetime);
    +gint                g_date_time_get_microsecond         (GDateTime *datetime);
    +gdouble             g_date_time_get_seconds             (GDateTime *datetime);
    +
    +gint64              g_date_time_to_unix                 (GDateTime *datetime);
    +gboolean            g_date_time_to_timeval              (GDateTime *datetime,
    +                                                         GTimeVal *tv);
    +
    +GTimeSpan           g_date_time_get_utc_offset          (GDateTime *datetime);
    +const gchar *       g_date_time_get_timezone_abbreviation
    +                                                        (GDateTime *datetime);
    +gboolean            g_date_time_is_daylight_savings     (GDateTime *datetime);
    +
    +GDateTime *         g_date_time_to_timezone             (GDateTime *datetime,
    +                                                         GTimeZone *tz);
    +GDateTime *         g_date_time_to_local                (GDateTime *datetime);
    +GDateTime *         g_date_time_to_utc                  (GDateTime *datetime);
    +
    +gchar *             g_date_time_format                  (GDateTime *datetime,
    +                                                         const gchar *format);
    +
    +
    +
    +

    Description

    +

    +GDateTime is a structure that combines a Gregorian date and time +into a single structure. It provides many conversion and methods to +manipulate dates and times. Time precision is provided down to +microseconds and the time can range (proleptically) from 0001-01-01 +00:00:00 to 9999-12-31 23:59:59.999999. GDateTime follows POSIX +time in the sense that it is oblivious to leap seconds. +

    +

    +GDateTime is an immutable object; once it has been created it cannot +be modified further. All modifiers will create a new GDateTime. +Nearly all such functions can fail due to the date or time going out +of range, in which case NULL will be returned. +

    +

    +GDateTime is reference counted: the reference count is increased by calling +g_date_time_ref() and decreased by calling g_date_time_unref(). When the +reference count drops to 0, the resources allocated by the GDateTime +structure are released. +

    +

    +Many parts of the API may produce non-obvious results. As an +example, adding two months to January 31st will yield March 31st +whereas adding one month and then one month again will yield either +March 28th or March 29th. Also note that adding 24 hours is not +always the same as adding one day (since days containing daylight +savings time transitions are either 23 or 25 hours in length). +

    +

    +GDateTime is available since GLib 2.26. +

    +
    +
    +

    Details

    +
    +

    GTimeSpan

    +
    typedef gint64 GTimeSpan;
    +
    +

    +A value representing an interval of time, in microseconds. +

    +

    Since 2.26

    +
    +
    +
    +

    G_TIME_SPAN_DAY

    +
    #define G_TIME_SPAN_DAY                 (G_GINT64_CONSTANT (86400000000))
    +
    +

    +Evaluates to a time span of one day. +

    +

    Since 2.26

    +
    +
    +
    +

    G_TIME_SPAN_HOUR

    +
    #define G_TIME_SPAN_HOUR                (G_GINT64_CONSTANT (3600000000))
    +
    +

    +Evaluates to a time span of one hour. +

    +

    Since 2.26

    +
    +
    +
    +

    G_TIME_SPAN_MINUTE

    +
    #define G_TIME_SPAN_MINUTE              (G_GINT64_CONSTANT (60000000))
    +
    +

    +Evaluates to a time span of one minute. +

    +

    Since 2.26

    +
    +
    +
    +

    G_TIME_SPAN_SECOND

    +
    #define G_TIME_SPAN_SECOND              (G_GINT64_CONSTANT (1000000))
    +
    +

    +Evaluates to a time span of one second. +

    +

    Since 2.26

    +
    +
    +
    +

    G_TIME_SPAN_MILLISECOND

    +
    #define G_TIME_SPAN_MILLISECOND         (G_GINT64_CONSTANT (1000))
    +
    +

    +Evaluates to a time span of one millisecond. +

    +

    Since 2.26

    +
    +
    +
    +

    GDateTime

    +
    typedef struct _GDateTime GDateTime;
    +

    +GDateTime is an opaque structure whose members +cannot be accessed directly. +

    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_unref ()

    +
    void                g_date_time_unref                   (GDateTime *datetime);
    +

    +Atomically decrements the reference count of datetime by one. +

    +

    +When the reference count reaches zero, the resources allocated by +datetime are freed +

    +
    ++ + + + +

    datetime :

    a GDateTime +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_ref ()

    +
    GDateTime *         g_date_time_ref                     (GDateTime *datetime);
    +

    +Atomically increments the reference count of datetime by one. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the GDateTime with the reference count increased + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_now ()

    +
    GDateTime *         g_date_time_new_now                 (GTimeZone *tz);
    +

    +Creates a GDateTime corresponding to this exact instant in the given +time zone tz. The time is as accurate as the system allows, to a +maximum accuracy of 1 microsecond. +

    +

    +This function will always succeed unless the system clock is set to +truly insane values (or unless GLib is still being used after the +year 9999). +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + +

    tz :

    a GTimeZone +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_now_local ()

    +
    GDateTime *         g_date_time_new_now_local           (void);
    +

    +Creates a GDateTime corresponding to this exact instant in the local +time zone. +

    +

    +This is equivalent to calling g_date_time_new_now() with the time +zone returned by g_time_zone_new_local(). +

    +
    ++ + + + +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_now_utc ()

    +
    GDateTime *         g_date_time_new_now_utc             (void);
    +

    +Creates a GDateTime corresponding to this exact instant in UTC. +

    +

    +This is equivalent to calling g_date_time_new_now() with the time +zone returned by g_time_zone_new_utc(). +

    +
    ++ + + + +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_from_unix_local ()

    +
    GDateTime *         g_date_time_new_from_unix_local     (gint64 t);
    +

    +Creates a GDateTime corresponding to the given Unix time t in the +local time zone. +

    +

    +Unix time is the number of seconds that have elapsed since 1970-01-01 +00:00:00 UTC, regardless of the local time offset. +

    +

    +This call can fail (returning NULL) if t represents a time outside +of the supported range of GDateTime. +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + +

    t :

    the Unix time +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_from_unix_utc ()

    +
    GDateTime *         g_date_time_new_from_unix_utc       (gint64 t);
    +

    +Creates a GDateTime corresponding to the given Unix time t in UTC. +

    +

    +Unix time is the number of seconds that have elapsed since 1970-01-01 +00:00:00 UTC. +

    +

    +This call can fail (returning NULL) if t represents a time outside +of the supported range of GDateTime. +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + +

    t :

    the Unix time +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_from_timeval_local ()

    +
    GDateTime *         g_date_time_new_from_timeval_local  (const GTimeVal *tv);
    +

    +Creates a GDateTime corresponding to the given GTimeVal tv in the +local time zone. +

    +

    +The time contained in a GTimeVal is always stored in the form of +seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the +local time offset. +

    +

    +This call can fail (returning NULL) if tv represents a time outside +of the supported range of GDateTime. +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + +

    tv :

    a GTimeVal +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_from_timeval_utc ()

    +
    GDateTime *         g_date_time_new_from_timeval_utc    (const GTimeVal *tv);
    +

    +Creates a GDateTime corresponding to the given GTimeVal tv in UTC. +

    +

    +The time contained in a GTimeVal is always stored in the form of +seconds elapsed since 1970-01-01 00:00:00 UTC. +

    +

    +This call can fail (returning NULL) if tv represents a time outside +of the supported range of GDateTime. +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + +

    tv :

    a GTimeVal +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new ()

    +
    GDateTime *         g_date_time_new                     (GTimeZone *tz,
    +                                                         gint year,
    +                                                         gint month,
    +                                                         gint day,
    +                                                         gint hour,
    +                                                         gint minute,
    +                                                         gdouble seconds);
    +

    +Creates a new GDateTime corresponding to the given date and time in +the time zone tz. +

    +

    +The year must be between 1 and 9999, month between 1 and 12 and day +between 1 and 28, 29, 30 or 31 depending on the month and the year. +

    +

    +hour must be between 0 and 23 and minute must be between 0 and 59. +

    +

    +seconds must be at least 0.0 and must be strictly less than 60.0. +It will be rounded down to the nearest microsecond. +

    +

    +If the given time is not representable in the given time zone (for +example, 02:30 on March 14th 2010 in Toronto, due to daylight savings +time) then the time will be rounded up to the nearest existing time +(in this case, 03:00). If this matters to you then you should verify +the return value for containing the same as the numbers you gave. +

    +

    +In the case that the given time is ambiguous in the given time zone +(for example, 01:30 on November 7th 2010 in Toronto, due to daylight +savings time) then the time falling within standard (ie: +non-daylight) time is taken. +

    +

    +It not considered a programmer error for the values to this function +to be out of range, but in the case that they are, the function will +return NULL. +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    tz :

    a GTimeZone +

    year :

    the year component of the date +

    month :

    the month component of the date +

    day :

    the day component of the date +

    hour :

    the hour component of the date +

    minute :

    the minute component of the date +

    seconds :

    the number of seconds past the minute +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_new_local ()

    +
    GDateTime *         g_date_time_new_local               (gint year,
    +                                                         gint month,
    +                                                         gint day,
    +                                                         gint hour,
    +                                                         gint minute,
    +                                                         gdouble seconds);
    +

    +Creates a new GDateTime corresponding to the given date and time in +the local time zone. +

    +

    +This call is equivalent to calling g_date_time_new() with the time +zone returned by g_time_zone_new_local(). +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    year :

    the year component of the date +

    month :

    the month component of the date +

    day :

    the day component of the date +

    hour :

    the hour component of the date +

    minute :

    the minute component of the date +

    seconds :

    the number of seconds past the minute +

    Returns :

    a GDateTime, or NULL + +
    +

    Since 2.26.

    +
    +
    +
    +

    g_date_time_new_utc ()

    +
    GDateTime *         g_date_time_new_utc                 (gint year,
    +                                                         gint month,
    +                                                         gint day,
    +                                                         gint hour,
    +                                                         gint minute,
    +                                                         gdouble seconds);
    +

    +Creates a new GDateTime corresponding to the given date and time in +UTC. +

    +

    +This call is equivalent to calling g_date_time_new() with the time +zone returned by g_time_zone_new_utc(). +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    year :

    the year component of the date +

    month :

    the month component of the date +

    day :

    the day component of the date +

    hour :

    the hour component of the date +

    minute :

    the minute component of the date +

    seconds :

    the number of seconds past the minute +

    Returns :

    a GDateTime, or NULL + +
    +

    Since 2.26.

    +
    +
    +
    +

    g_date_time_add ()

    +
    GDateTime *         g_date_time_add                     (GDateTime *datetime,
    +                                                         GTimeSpan timespan);
    +

    +Creates a copy of datetime and adds the specified timespan to the copy. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    timespan :

    a GTimeSpan +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_years ()

    +
    GDateTime *         g_date_time_add_years               (GDateTime *datetime,
    +                                                         gint years);
    +

    +Creates a copy of datetime and adds the specified number of years to the +copy. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    years :

    the number of years +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_months ()

    +
    GDateTime *         g_date_time_add_months              (GDateTime *datetime,
    +                                                         gint months);
    +

    +Creates a copy of datetime and adds the specified number of months to the +copy. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    months :

    the number of months +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_weeks ()

    +
    GDateTime *         g_date_time_add_weeks               (GDateTime *datetime,
    +                                                         gint weeks);
    +

    +Creates a copy of datetime and adds the specified number of weeks to the +copy. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    weeks :

    the number of weeks +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_days ()

    +
    GDateTime *         g_date_time_add_days                (GDateTime *datetime,
    +                                                         gint days);
    +

    +Creates a copy of datetime and adds the specified number of days to the +copy. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    days :

    the number of days +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_hours ()

    +
    GDateTime *         g_date_time_add_hours               (GDateTime *datetime,
    +                                                         gint hours);
    +

    +Creates a copy of datetime and adds the specified number of hours +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    hours :

    the number of hours to add +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_minutes ()

    +
    GDateTime *         g_date_time_add_minutes             (GDateTime *datetime,
    +                                                         gint minutes);
    +

    +Creates a copy of datetime adding the specified number of minutes. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    minutes :

    the number of minutes to add +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_seconds ()

    +
    GDateTime *         g_date_time_add_seconds             (GDateTime *datetime,
    +                                                         gdouble seconds);
    +

    +Creates a copy of datetime and adds the specified number of seconds. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    seconds :

    the number of seconds to add +

    Returns :

    the newly created GDateTime which should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_add_full ()

    +
    GDateTime *         g_date_time_add_full                (GDateTime *datetime,
    +                                                         gint years,
    +                                                         gint months,
    +                                                         gint days,
    +                                                         gint hours,
    +                                                         gint minutes,
    +                                                         gdouble seconds);
    +

    +Creates a new GDateTime adding the specified values to the current date and +time in datetime. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    years :

    the number of years to add +

    months :

    the number of months to add +

    days :

    the number of days to add +

    hours :

    the number of hours to add +

    minutes :

    the number of minutes to add +

    seconds :

    the number of seconds to add +

    Returns :

    the newly created GDateTime that should be freed with + g_date_time_unref(). + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_compare ()

    +
    gint                g_date_time_compare                 (gconstpointer dt1,
    +                                                         gconstpointer dt2);
    +

    +GCompareFunc-compatible comparison for GDateTime's. Both +GDateTime<-- -->'s must be non-NULL. +

    +
    ++ + + + + + + + + + + + + + +

    dt1 :

    first GDateTime to compare +

    dt2 :

    second GDateTime to compare +

    Returns :

    0 for equal, less than zero if dt1 is less than dt2, greater + than zero if dt2 is greator than dt1. + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_difference ()

    +
    GTimeSpan           g_date_time_difference              (GDateTime *end,
    +                                                         GDateTime *begin);
    +

    +Calculates the difference in time between end and begin. The +GTimeSpan that is returned is effectively end - begin (ie: +positive if the first simparameter is larger). +

    +
    ++ + + + + + + + + + + + + + +

    end :

    a GDateTime +

    begin :

    a GDateTime +

    Returns :

    the difference between the two GDateTime, as a time + span expressed in microseconds. + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_hash ()

    +
    guint               g_date_time_hash                    (gconstpointer datetime);
    +

    +Hashes datetime into a guint, suitable for use within GHashTable. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    a guint containing the hash + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_equal ()

    +
    gboolean            g_date_time_equal                   (gconstpointer dt1,
    +                                                         gconstpointer dt2);
    +

    +Checks to see if dt1 and dt2 are equal. +

    +

    +Equal here means that they represent the same moment after converting +them to the same time zone. +

    +
    ++ + + + + + + + + + + + + + +

    dt1 :

    a GDateTime +

    dt2 :

    a GDateTime +

    Returns :

    TRUE if dt1 and dt2 are equal + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_ymd ()

    +
    void                g_date_time_get_ymd                 (GDateTime *datetime,
    +                                                         gint *year,
    +                                                         gint *month,
    +                                                         gint *day);
    +

    +Retrieves the Gregorian day, month, and year of a given GDateTime. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    datetime :

    a GDateTime. +

    year :

    the return location for the gregorian year, or NULL. [out] +

    month :

    the return location for the month of the year, or NULL. [out] +

    day :

    the return location for the day of the month, or NULL. [out] +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_year ()

    +
    gint                g_date_time_get_year                (GDateTime *datetime);
    +

    +Retrieves the year represented by datetime in the Gregorian calendar. +

    +
    ++ + + + + + + + + + +

    datetime :

    A GDateTime +

    Returns :

    the year represented by datetime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_month ()

    +
    gint                g_date_time_get_month               (GDateTime *datetime);
    +

    +Retrieves the month of the year represented by datetime in the Gregorian +calendar. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the month represented by datetime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_day_of_month ()

    +
    gint                g_date_time_get_day_of_month        (GDateTime *datetime);
    +

    +Retrieves the day of the month represented by datetime in the gregorian +calendar. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the day of the month + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_week_numbering_year ()

    +
    gint                g_date_time_get_week_numbering_year (GDateTime *datetime);
    +

    +Returns the ISO 8601 week-numbering year in which the week containing +datetime falls. +

    +

    +This function, taken together with g_date_time_get_week_of_year() and +g_date_time_get_day_of_week() can be used to determine the full ISO +week date on which datetime falls. +

    +

    +This is usually equal to the normal Gregorian year (as returned by +g_date_time_get_year()), except as detailed below: +

    +

    +For Thursday, the week-numbering year is always equal to the usual +calendar year. For other days, the number is such that every day +within a complete week (Monday to Sunday) is contained within the +same week-numbering year. +

    +

    +For Monday, Tuesday and Wednesday occuring near the end of the year, +this may mean that the week-numbering year is one greater than the +calendar year (so that these days have the same week-numbering year +as the Thursday occuring early in the next year). +

    +

    +For Friday, Saturaday and Sunday occuring near the start of the year, +this may mean that the week-numbering year is one less than the +calendar year (so that these days have the same week-numbering year +as the Thursday occuring late in the previous year). +

    +

    +An equivalent description is that the week-numbering year is equal to +the calendar year containing the majority of the days in the current +week (Monday to Sunday). +

    +

    +Note that January 1 0001 in the proleptic Gregorian calendar is a +Monday, so this function never returns 0. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the ISO 8601 week-numbering year for datetime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_week_of_year ()

    +
    gint                g_date_time_get_week_of_year        (GDateTime *datetime);
    +

    +Returns the ISO 8601 week number for the week containing datetime. +The ISO 8601 week number is the same for every day of the week (from +Moday through Sunday). That can produce some unusual results +(described below). +

    +

    +The first week of the year is week 1. This is the week that contains +the first Thursday of the year. Equivalently, this is the first week +that has more than 4 of its days falling within the calendar year. +

    +

    +The value 0 is never returned by this function. Days contained +within a year but occuring before the first ISO 8601 week of that +year are considered as being contained in the last week of the +previous year. Similarly, the final days of a calendar year may be +considered as being part of the first ISO 8601 week of the next year +if 4 or more days of that week are contained within the new year. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the ISO 8601 week number for datetime. + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_day_of_week ()

    +
    gint                g_date_time_get_day_of_week         (GDateTime *datetime);
    +

    +Retrieves the ISO 8601 day of the week on which datetime falls (1 is +Monday, 2 is Tuesday... 7 is Sunday). +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the day of the week + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_day_of_year ()

    +
    gint                g_date_time_get_day_of_year         (GDateTime *datetime);
    +

    +Retrieves the day of the year represented by datetime in the Gregorian +calendar. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the day of the year + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_hour ()

    +
    gint                g_date_time_get_hour                (GDateTime *datetime);
    +

    +Retrieves the hour of the day represented by datetime +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the hour of the day + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_minute ()

    +
    gint                g_date_time_get_minute              (GDateTime *datetime);
    +

    +Retrieves the minute of the hour represented by datetime +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the minute of the hour + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_second ()

    +
    gint                g_date_time_get_second              (GDateTime *datetime);
    +

    +Retrieves the second of the minute represented by datetime +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the second represented by datetime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_microsecond ()

    +
    gint                g_date_time_get_microsecond         (GDateTime *datetime);
    +

    +Retrieves the microsecond of the date represented by datetime +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the microsecond of the second + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_seconds ()

    +
    gdouble             g_date_time_get_seconds             (GDateTime *datetime);
    +

    +Retrieves the number of seconds since the start of the last minute, +including the fractional part. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the number of seconds + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_to_unix ()

    +
    gint64              g_date_time_to_unix                 (GDateTime *datetime);
    +

    +Gives the Unix time corresponding to datetime, rounding down to the +nearest second. +

    +

    +Unix time is the number of seconds that have elapsed since 1970-01-01 +00:00:00 UTC, regardless of the time zone associated with datetime. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the Unix time corresponding to datetime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_to_timeval ()

    +
    gboolean            g_date_time_to_timeval              (GDateTime *datetime,
    +                                                         GTimeVal *tv);
    +

    +Stores the instant in time that datetime represents into tv. +

    +

    +The time contained in a GTimeVal is always stored in the form of +seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the time +zone associated with datetime. +

    +

    +On systems where 'long' is 32bit (ie: all 32bit systems and all +Windows systems), a GTimeVal is incapable of storing the entire +range of values that GDateTime is capable of expressing. On those +systems, this function returns FALSE to indicate that the time is +out of range. +

    +

    +On systems where 'long' is 64bit, this function never fails. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    tv :

    a GTimeVal to modify +

    Returns :

    TRUE if successful, else FALSE + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_utc_offset ()

    +
    GTimeSpan           g_date_time_get_utc_offset          (GDateTime *datetime);
    +

    +Determines the offset to UTC in effect at the time and in the time +zone of datetime. +

    +

    +The offset is the number of microseconds that you add to UTC time to +arrive at local time for the time zone (ie: negative numbers for time +zones west of GMT, positive numbers for east). +

    +

    +If datetime represents UTC time, then the offset is always zero. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the number of microseconds that should be added to UTC to + get the local time + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_get_timezone_abbreviation ()

    +
    const gchar *       g_date_time_get_timezone_abbreviation
    +                                                        (GDateTime *datetime);
    +

    +Determines the time zone abbreviation to be used at the time and in +the time zone of datetime. +

    +

    +For example, in Toronto this is currently "EST" during the winter +months and "EDT" during the summer months when daylight savings +time is in effect. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the time zone abbreviation. The returned + string is owned by the GDateTime and it should not be + modified or freed. [transfer none] +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_is_daylight_savings ()

    +
    gboolean            g_date_time_is_daylight_savings     (GDateTime *datetime);
    +

    +Determines if daylight savings time is in effect at the time and in +the time zone of datetime. +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    TRUE if daylight savings time is in effect + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_to_timezone ()

    +
    GDateTime *         g_date_time_to_timezone             (GDateTime *datetime,
    +                                                         GTimeZone *tz);
    +

    +Create a new GDateTime corresponding to the same instant in time as +datetime, but in the time zone tz. +

    +

    +This call can fail in the case that the time goes out of bounds. For +example, converting 0001-01-01 00:00:00 UTC to a time zone west of +Greenwich will fail (due to the year 0 being out of range). +

    +

    +You should release the return value by calling g_date_time_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    a GDateTime +

    tz :

    the new GTimeZone +

    Returns :

    a new GDateTime, or NULL + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_to_local ()

    +
    GDateTime *         g_date_time_to_local                (GDateTime *datetime);
    +

    +Creates a new GDateTime corresponding to the same instant in time as +datetime, but in the local time zone. +

    +

    +This call is equivalent to calling g_date_time_to_timezone() with the +time zone returned by g_time_zone_new_local(). +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the newly created GDateTime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_to_utc ()

    +
    GDateTime *         g_date_time_to_utc                  (GDateTime *datetime);
    +

    +Creates a new GDateTime corresponding to the same instant in time as +datetime, but in UTC. +

    +

    +This call is equivalent to calling g_date_time_to_timezone() with the +time zone returned by g_time_zone_new_utc(). +

    +
    ++ + + + + + + + + + +

    datetime :

    a GDateTime +

    Returns :

    the newly created GDateTime + +
    +

    Since 2.26

    +
    +
    +
    +

    g_date_time_format ()

    +
    gchar *             g_date_time_format                  (GDateTime *datetime,
    +                                                         const gchar *format);
    +

    +Creates a newly allocated string representing the requested format. +

    +

    +The following format specifiers are supported: +

    +

    +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + %a: +

    + the abbreviated weekday name according to the current locale +

    + %A: +

    + the full weekday name according to the current locale +

    + %b: +

    + the abbreviated month name according to the current locale +

    + %B: +

    + the full month name according to the current locale +

    + %d: +

    + the day of the month as a decimal number (range 01 to 31) +

    + %e: +

    + the day of the month as a decimal number (range 1 to 31) +

    + %F: +

    + equivalent to %Y-%m-%d (the ISO 8601 date + format) +

    + %h: +

    + equivalent to %b +

    + %H: +

    + the hour as a decimal number using a 24-hour clock (range 00 to + 23) +

    + %I: +

    + the hour as a decimal number using a 12-hour clock (range 01 to + 12) +

    + %j: +

    + the day of the year as a decimal number (range 001 to 366) +

    + %k: +

    + the hour (24-hour clock) as a decimal number (range 0 to 23); + single digits are preceded by a blank +

    + %l: +

    + the hour (12-hour clock) as a decimal number (range 1 to 12); + single digits are preceded by a blank +

    + %m: +

    + the month as a decimal number (range 01 to 12) +

    + %M: +

    + the minute as a decimal number (range 00 to 59) +

    + %N: +

    + the micro-seconds as a decimal number +

    + %p: +

    + either "AM" or "PM" according to the given time value, or the + corresponding strings for the current locale. Noon is treated as + "PM" and midnight as "AM". +

    + %P: +

    + like %p but lowercase: "am" or "pm" or a corresponding string for + the current locale +

    + %r: +

    + the time in a.m. or p.m. notation +

    + %R: +

    + the time in 24-hour notation (%H:%M) +

    + %s: +

    + the number of seconds since the Epoch, that is, since 1970-01-01 + 00:00:00 UTC +

    + %S: +

    + the second as a decimal number (range 00 to 60) +

    + %t: +

    + a tab character +

    + %u: +

    + the day of the week as a decimal, range 1 to 7, Monday being 1 +

    + %W: +

    + the week number of the current year as a decimal number +

    + %x: +

    + the preferred date representation for the current locale without + the time +

    + %X: +

    + the preferred time representation for the current locale without + the date +

    + %y: +

    + the year as a decimal number without the century +

    + %Y: +

    + the year as a decimal number including the century +

    + %z: +

    + the time-zone as hour offset from UTC +

    + %Z: +

    + the time zone or name or abbreviation +

    + %%%: +

    + a literal %% character +
    +

    +

    +
    ++ + + + + + + + + + + + + + +

    datetime :

    A GDateTime +

    format :

    a valid UTF-8 string, containing the format for the + GDateTime +

    Returns :

    a newly allocated string formatted to the requested format + or NULL in the case that there was an error. The string + should be freed with g_free(). + +
    +

    Since 2.26

    +
    +
    +
    +

    See Also

    +GTimeZone +
    +
    + + + \ No newline at end of file diff --git a/docs/reference/glib/html/glib-GTimeZone.html b/docs/reference/glib/html/glib-GTimeZone.html new file mode 100644 index 0000000..a2d0c83 --- /dev/null +++ b/docs/reference/glib/html/glib-GTimeZone.html @@ -0,0 +1,535 @@ + + + + +GTimeZone + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    GTimeZone

    +

    GTimeZone — A structure representing a time zone

    +
    +
    +

    Synopsis

    +
    +#include <glib.h>
    +
    +                    GTimeZone;
    +void                g_time_zone_unref                   (GTimeZone *tz);
    +GTimeZone *         g_time_zone_ref                     (GTimeZone *tz);
    +
    +GTimeZone *         g_time_zone_new                     (const gchar *identifier);
    +GTimeZone *         g_time_zone_new_local               (void);
    +GTimeZone *         g_time_zone_new_utc                 (void);
    +
    +enum                GTimeType;
    +gint                g_time_zone_find_interval           (GTimeZone *tz,
    +                                                         GTimeType type,
    +                                                         gint64 time);
    +gint                g_time_zone_adjust_time             (GTimeZone *tz,
    +                                                         GTimeType type,
    +                                                         gint64 *time);
    +
    +const gchar *       g_time_zone_get_abbreviation        (GTimeZone *tz,
    +                                                         gint interval);
    +gint32              g_time_zone_get_offset              (GTimeZone *tz,
    +                                                         gint interval);
    +gboolean            g_time_zone_is_dst                  (GTimeZone *tz,
    +                                                         gint interval);
    +
    +
    +
    +

    Description

    +

    +GTimeZone is a structure that represents a time zone, at no +particular point in time. It is refcounted and immutable. +

    +

    +A time zone contains a number of intervals. Each interval has +an abbreviation to describe it, an offet to UTC and a flag indicating +if the daylight savings time is in effect during that interval. A +time zone always has at least one interval -- interval 0. +

    +

    +Every UTC time is contained within exactly one interval, but a given +local time may be contained within zero, one or two intervals (due to +incontinuities associated with daylight savings time). +

    +

    +An interval may refer to a specific period of time (eg: the duration +of daylight savings time during 2010) or it may refer to many periods +of time that share the same properties (eg: all periods of daylight +savings time). It is also possible (usually for political reasons) +that some properties (like the abbreviation) change between intervals +without other properties changing. +

    +

    +GTimeZone is available since GLib 2.26. +

    +
    +
    +

    Details

    +
    +

    GTimeZone

    +
    typedef struct _GTimeZone GTimeZone;
    +

    +GDateTime is an opaque structure whose members cannot be accessed +directly. +

    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_unref ()

    +
    void                g_time_zone_unref                   (GTimeZone *tz);
    +

    +Decreases the reference count on tz. +

    +
    ++ + + + +

    tz :

    a GTimeZone +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_ref ()

    +
    GTimeZone *         g_time_zone_ref                     (GTimeZone *tz);
    +

    +Increases the reference count on tz. +

    +
    ++ + + + + + + + + + +

    tz :

    a GTimeZone +

    Returns :

    a new reference to tz. + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_new ()

    +
    GTimeZone *         g_time_zone_new                     (const gchar *identifier);
    +

    +Creates a GTimeZone corresponding to identifier. +

    +

    +identifier can either be an RFC3339/ISO 8601 time offset or +something that would pass as a valid value for the +TZ environment variable (including NULL). +

    +

    +Valid RFC3339 time offsets are "Z" (for UTC) or +"±hh:mm". ISO 8601 additionally specifies +"±hhmm" and "±hh". +

    +

    +The TZ environment variable typically corresponds +to the name of a file in the zoneinfo database, but there are many +other possibilities. Note that those other possibilities are not +currently implemented, but are planned. +

    +

    +g_time_zone_new_local() calls this function with the value of the +TZ environment variable. This function itself is +independent of the value of TZ, but if identifier +is NULL then /etc/localtime will be consulted +to discover the correct timezone. +

    +

    +See RFC3339 +§5.6 for a precise definition of valid RFC3339 time offsets +(the time-offset expansion) and ISO 8601 for the +full list of valid time offsets. See The +GNU C Library manual for an explanation of the possible +values of the TZ environment variable. +

    +

    +You should release the return value by calling g_time_zone_unref() +when you are done with it. +

    +
    ++ + + + + + + + + + +

    identifier :

    a timezone identifier. [allow-none] +

    Returns :

    the requested timezone + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_new_local ()

    +
    GTimeZone *         g_time_zone_new_local               (void);
    +

    +Creates a GTimeZone corresponding to local time. +

    +

    +This is equivalent to calling g_time_zone_new() with the value of the +TZ environment variable (including the possibility +of NULL). Changes made to TZ after the first +call to this function may or may not be noticed by future calls. +

    +

    +You should release the return value by calling g_time_zone_unref() +when you are done with it. +

    +
    ++ + + + +

    Returns :

    the local timezone + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_new_utc ()

    +
    GTimeZone *         g_time_zone_new_utc                 (void);
    +

    +Creates a GTimeZone corresponding to UTC. +

    +

    +This is equivalent to calling g_time_zone_new() with a value like +"Z", "UTC", "+00", etc. +

    +

    +You should release the return value by calling g_time_zone_unref() +when you are done with it. +

    +
    ++ + + + +

    Returns :

    the universal timezone + +
    +

    Since 2.26

    +
    +
    +
    +

    enum GTimeType

    +
    typedef enum
    +{
    +  G_TIME_TYPE_STANDARD,
    +  G_TIME_TYPE_DAYLIGHT,
    +  G_TIME_TYPE_UNIVERSAL
    +} GTimeType;
    +
    +

    +Disambiguates a given time in two ways. +

    +

    +First, specifies if the given time is in universal or local time. +

    +

    +Second, if the time is in local time, specifies if it is local +standard time or local daylight time. This is important for the case +where the same local time occurs twice (during daylight savings time +transitions, for example). +

    +
    ++ + + + + + + + + + + + + + +

    G_TIME_TYPE_STANDARD

    the time is in local standard time +

    G_TIME_TYPE_DAYLIGHT

    the time is in local daylight time +

    G_TIME_TYPE_UNIVERSAL

    the time is in UTC +
    +
    +
    +
    +

    g_time_zone_find_interval ()

    +
    gint                g_time_zone_find_interval           (GTimeZone *tz,
    +                                                         GTimeType type,
    +                                                         gint64 time);
    +

    +Finds an the interval within tz that corresponds to the given time. +The meaning of time depends on type. +

    +

    +If type is G_TIME_TYPE_UNIVERSAL then this function will always +succeed (since universal time is monotonic and continuous). +

    +

    +Otherwise time is treated is local time. The distinction between +G_TIME_TYPE_STANDARD and G_TIME_TYPE_DAYLIGHT is ignored except in +the case that the given time is ambiguous. In Toronto, for example, +01:30 on November 7th 2010 occured twice (once inside of daylight +savings time and the next, an hour later, outside of daylight savings +time). In this case, the different value of type would result in a +different interval being returned. +

    +

    +It is still possible for this function to fail. In Toronto, for +example, 02:00 on March 14th 2010 does not exist (due to the leap +forward to begin daylight savings time). -1 is returned in that +case. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    tz :

    a GTimeZone +

    type :

    the GTimeType of time +

    time :

    a number of seconds since January 1, 1970 +

    Returns :

    the interval containing time, or -1 in case of failure + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_adjust_time ()

    +
    gint                g_time_zone_adjust_time             (GTimeZone *tz,
    +                                                         GTimeType type,
    +                                                         gint64 *time);
    +

    +Finds an interval within tz that corresponds to the given time, +possibly adjusting time if required to fit into an interval. +The meaning of time depends on type. +

    +

    +This function is similar to g_time_zone_find_interval(), with the +difference that it always succeeds (by making the adjustments +described below). +

    +

    +In any of the cases where g_time_zone_find_interval() succeeds then +this function returns the same value, without modifying time. +

    +

    +This function may, however, modify time in order to deal with +non-existent times. If the non-existent local time of 02:30 were +requested on March 13th 2010 in Toronto then this function would +adjust time to be 03:00 and return the interval containing the +adjusted time. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    tz :

    a GTimeZone +

    type :

    the GTimeType of time +

    time :

    a pointer to a number of seconds since January 1, 1970 +

    Returns :

    the interval containing time, never -1 + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_get_abbreviation ()

    +
    const gchar *       g_time_zone_get_abbreviation        (GTimeZone *tz,
    +                                                         gint interval);
    +

    +Determines the time zone abbreviation to be used during a particular +interval of time in the time zone tz. +

    +

    +For example, in Toronto this is currently "EST" during the winter +months and "EDT" during the summer months when daylight savings time +is in effect. +

    +
    ++ + + + + + + + + + + + + + +

    tz :

    a GTimeZone +

    interval :

    an interval within the timezone +

    Returns :

    the time zone abbreviation, which belongs to tz + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_get_offset ()

    +
    gint32              g_time_zone_get_offset              (GTimeZone *tz,
    +                                                         gint interval);
    +

    +Determines the offset to UTC in effect during a particular interval +of time in the time zone tz. +

    +

    +The offset is the number of seconds that you add to UTC time to +arrive at local time for tz (ie: negative numbers for time zones +west of GMT, positive numbers for east). +

    +
    ++ + + + + + + + + + + + + + +

    tz :

    a GTimeZone +

    interval :

    an interval within the timezone +

    Returns :

    the number of seconds that should be added to UTC to get the + local time in tz + +
    +

    Since 2.26

    +
    +
    +
    +

    g_time_zone_is_dst ()

    +
    gboolean            g_time_zone_is_dst                  (GTimeZone *tz,
    +                                                         gint interval);
    +

    +Determines if daylight savings time is in effect during a particular +interval of time in the time zone tz. +

    +
    ++ + + + + + + + + + + + + + +

    tz :

    a GTimeZone +

    interval :

    an interval within the timezone +

    Returns :

    TRUE if daylight savings time is in effect + +
    +

    Since 2.26

    +
    +
    +
    +

    See Also

    +GDateTime +
    +
    + + + \ No newline at end of file diff --git a/docs/reference/glib/html/glib-GVariant.html b/docs/reference/glib/html/glib-GVariant.html index b1b01d9..6ba78f5 100644 --- a/docs/reference/glib/html/glib-GVariant.html +++ b/docs/reference/glib/html/glib-GVariant.html @@ -3,12 +3,12 @@ GVariant - + - + @@ -44,11 +44,14 @@ void g_variant_unref (GVariant *value); GVariant * g_variant_ref (GVariant *value); GVariant * g_variant_ref_sink (GVariant *value); +gboolean g_variant_is_floating (GVariant *value); const GVariantType * g_variant_get_type (GVariant *value); const gchar * g_variant_get_type_string (GVariant *value); gboolean g_variant_is_of_type (GVariant *value, const GVariantType *type); gboolean g_variant_is_container (GVariant *value); +gint g_variant_compare (gconstpointer one, + gconstpointer two); GVariantClass g_variant_classify (GVariant *value); enum GVariantClass; @@ -84,6 +87,9 @@ enum GVariant * g_variant_new_variant (GVariant *value); GVariant * g_variant_new_strv (const gchar * const *strv, gssize length); +GVariant * g_variant_new_bytestring (const gchar *string); +GVariant * g_variant_new_bytestring_array (const gchar * const *strv, + gssize length); gboolean g_variant_get_boolean (GVariant *value); guchar g_variant_get_byte (GVariant *value); @@ -104,6 +110,13 @@ const gsize *length
    ); gchar ** g_variant_dup_strv (GVariant *value, gsize *length); +const gchar * g_variant_get_bytestring (GVariant *value); +gchar * g_variant_dup_bytestring (GVariant *value, + gsize *length); +const gchar ** g_variant_get_bytestring_array (GVariant *value, + gsize *length); +gchar ** g_variant_dup_bytestring_array (GVariant *value, + gsize *length); GVariant * g_variant_new_maybe (const GVariantType *child_type, GVariant *child); @@ -123,6 +136,13 @@ const gsize index_, const gchar *format_string, ...); +GVariant * g_variant_lookup_value (GVariant *dictionary, + const gchar *key, + const GVariantType *expected_type); +gboolean g_variant_lookup (GVariant *dictionary, + const gchar *key, + const gchar *format_string, + ...); gconstpointer g_variant_get_fixed_array (GVariant *value, gsize *n_elements, gsize element_size); @@ -178,11 +198,15 @@ const void g_variant_builder_add (GVariantBuilder *builder, const gchar *format_string, ...); +void g_variant_builder_add_parsed (GVariantBuilder *builder, + const gchar *format, + ...); GVariant * g_variant_builder_end (GVariantBuilder *builder); void g_variant_builder_open (GVariantBuilder *builder, const GVariantType *type); void g_variant_builder_close (GVariantBuilder *builder); +enum GVariantParseError; #define G_VARIANT_PARSE_ERROR GVariant * g_variant_parse (const GVariantType *type, const gchar *text, @@ -242,7 +266,7 @@ values.
    -

    Memory Use

    +

    Memory Use

    GVariant tries to be quite efficient with respect to memory use. This section gives a rough idea of how much memory is used by the @@ -256,7 +280,7 @@ with type inferencing. GVariant structure itself.

    -

    Serialised Data Memory

    +

    Serialised Data Memory

    This is the memory that is used for storing GVariant data in serialised form. This is what would be sent over the network or @@ -324,7 +348,7 @@ with type inferencing.

    -

    Type Information Cache

    +

    Type Information Cache

    For each GVariant type that currently exists in the program a type information structure is kept in the type information cache. The @@ -379,7 +403,7 @@ with type inferencing.

    -

    Buffer Management Memory

    +

    Buffer Management Memory

    GVariant uses an internal buffer management structure to deal with the various different possible sources of serialised data @@ -395,7 +419,7 @@ with type inferencing.

    -

    GVariant structure

    +

    GVariant structure

    The size of a GVariant structure is 6 * (void *). On 32 bit systems, that's 24 bytes. @@ -420,7 +444,7 @@ with type inferencing.

    -

    Summary

    +

    Summary

    To put the entire example together, for our dictionary mapping strings to variants (with two entries, as given above), we are @@ -539,6 +563,39 @@ are not floating.

    Since 2.24


    +
    +

    g_variant_is_floating ()

    +
    gboolean            g_variant_is_floating               (GVariant *value);
    +

    +Checks whether value has a floating reference count. +

    +

    +This function should only ever be used to assert that a given variant +is or is not floating, or for debug purposes. To acquire a reference +to a variant that might be floating, always use g_variant_ref_sink(). +

    +

    +See g_variant_ref_sink() for more information about floating reference +counts. +

    +
    ++ + + + + + + + + + +

    value :

    a GVariant +

    Returns :

    whether value is floating +
    +

    Since 2.26

    +
    +

    g_variant_get_type ()

    const GVariantType * g_variant_get_type                 (GVariant *value);
    @@ -648,6 +705,60 @@ Checks if value is a container.

    +
    +

    g_variant_compare ()

    +
    gint                g_variant_compare                   (gconstpointer one,
    +                                                         gconstpointer two);
    +

    +Compares one and two. +

    +

    +The types of one and two are gconstpointer only to allow use of +this function with GTree, GPtrArray, etc. They must each be a +GVariant. +

    +

    +Comparison is only defined for basic types (ie: booleans, numbers, +strings). For booleans, FALSE is less than TRUE. Numbers are +ordered in the usual way. Strings are in ASCII lexographical order. +

    +

    +It is a programmer error to attempt to compare container values or +two values that have types that are not exactly equal. For example, +you can not compare a 32-bit signed integer with a 32-bit unsigned +integer. Also note that this function is not particularly +well-behaved when it comes to comparison of doubles; in particular, +the handling of incomparable values (ie: NaN) is undefined. +

    +

    +If you only require an equality comparison, g_variant_equal() is more +general. +

    +
    ++ + + + + + + + + + + + + + +

    one :

    a basic-typed GVariant instance. [type GVariant] +

    two :

    a GVariant instance of the same type. [type GVariant] +

    Returns :

    negative value if a < b; + zero if a = b; + positive value if a > b. +
    +

    Since 2.26

    +
    +

    g_variant_classify ()

    GVariantClass       g_variant_classify                  (GVariant *value);
    @@ -887,7 +998,8 @@ varargs call by the user.

    endptr :

    -location to store the end pointer, or NULL + location to store the end pointer, + or NULL. [allow-none][default NULL] @@ -1000,7 +1112,8 @@ or by passing it to another endptr :

    -location to store the end pointer, or
    NULL + location to store the end pointer, + or NULL. [allow-none][default NULL] @@ -1034,7 +1147,7 @@ Creates a new boolean Returns :

    -a new boolean
    GVariant instance +a floating reference to a new boolean GVariant instance @@ -1058,7 +1171,7 @@ Creates a new byte Returns :

    -a new byte
    GVariant instance +a floating reference to a new byte GVariant instance @@ -1082,7 +1195,7 @@ Creates a new int16 Returns :

    -a new int16
    GVariant instance +a floating reference to a new int16 GVariant instance @@ -1106,7 +1219,7 @@ Creates a new uint16 Returns :

    -a new uint16
    GVariant instance +a floating reference to a new uint16 GVariant instance @@ -1130,7 +1243,7 @@ Creates a new int32 Returns :

    -a new int32
    GVariant instance +a floating reference to a new int32 GVariant instance @@ -1154,7 +1267,7 @@ Creates a new uint32 Returns :

    -a new uint32
    GVariant instance +a floating reference to a new uint32 GVariant instance @@ -1178,7 +1291,7 @@ Creates a new int64 Returns :

    -a new int64
    GVariant instance +a floating reference to a new int64 GVariant instance @@ -1202,7 +1315,7 @@ Creates a new uint64 Returns :

    -a new uint64
    GVariant instance +a floating reference to a new uint64 GVariant instance @@ -1231,7 +1344,7 @@ with DBus, you probably don't need them.

    Returns :

    -a new handle GVariant instance +a floating reference to a new handle GVariant instance @@ -1255,7 +1368,7 @@ Creates a new double Returns :

    -a new double
    GVariant instance +a floating reference to a new double GVariant instance @@ -1269,17 +1382,20 @@ Creates a new double GVariant with the contents of string.

    +

    +string must be valid utf8. +

    - - @@ -1305,7 +1421,7 @@ Creates a DBus object path - @@ -1364,7 +1480,7 @@ Creates a DBus type signature - @@ -1377,7 +1493,7 @@ Creates a DBus type signature gboolean g_variant_is_signature (const gchar *string);

    Determines if a given string is a valid DBus type signature. You -should ensure that a string is a valid DBus object path before +should ensure that a string is a valid DBus type signature before passing it to g_variant_new_signature().

    @@ -1410,6 +1526,10 @@ strings in sequence. Boxes value. The result is a GVariant instance representing a variant containing the original value.

    +

    +If child is a floating reference (see g_variant_ref_sink()), the new +instance takes ownership of child. +

    string :

    a normal C nul-terminated string +a normal utf8 nul-terminated string

    Returns :

    a new string GVariant instance +a floating reference to a new string GVariant instance

    Returns :

    a new object path GVariant instance +a floating reference to a new object path GVariant instance

    Returns :

    a new signature GVariant instance +a floating reference to a new signature GVariant instance
    @@ -1420,7 +1540,7 @@ variant containing the original value. - @@ -1437,15 +1557,14 @@ Constructs an array of strings length is not -1 then it gives the maximum length of strv. In -any case, a NULL pointer in strv is taken as a terminator. +If length is -1 then strv is NULL-terminated.

    Returns :

    a new variant GVariant instance +a floating reference to a new variant GVariant instance
    - @@ -1463,6 +1582,70 @@ any case, a Since 2.24


    +
    +

    g_variant_new_bytestring ()

    +
    GVariant *          g_variant_new_bytestring            (const gchar *string);
    +

    +Creates an array-of-bytes GVariant with the contents of string. +This function is just like g_variant_new_string() except that the +string need not be valid utf8. +

    +

    +The nul terminator character at the end of the string is stored in +the array. +

    +

    strv :

    an array of strings + an array of strings. [array length=length][element-type utf8]
    ++ + + + + + + + + + +

    string :

    a normal nul-terminated string in no particular encoding +

    Returns :

    a floating reference to a new bytestring GVariant instance +
    +

    Since 2.26

    +
    +
    +
    +

    g_variant_new_bytestring_array ()

    +
    GVariant *          g_variant_new_bytestring_array      (const gchar * const *strv,
    +                                                         gssize length);
    +

    +Constructs an array of bytestring GVariant from the given array of +strings. +

    +

    +If length is -1 then strv is NULL-terminated. +

    +
    ++ + + + + + + + + + + + + + +

    strv :

    an array of strings. [array length=length] +

    length :

    the length of strv, or -1 +

    Returns :

    a new floating GVariant instance +
    +

    Since 2.26

    +
    +

    g_variant_get_boolean ()

    gboolean            g_variant_get_boolean               (GVariant *value);
    @@ -1759,6 +1942,9 @@ type. This includes the types G_VARIANT_TYPE_OBJECT_PATH and G_VARIANT_TYPE_SIGNATURE.

    +The string will always be utf8 encoded. +

    +

    If length is non-NULL then the length of the string (in bytes) is returned there. For trusted values, this information is already known. For untrusted values, a strlen() will be performed. @@ -1780,12 +1966,13 @@ The return value remains valid as long as value

    length :

    -a pointer to a gsize, to store the length + a pointer to a gsize, + to store the length. [allow-none][default NULL][out NULL]

    Returns :

    -the constant string +the constant string, utf8 encoded @@ -1802,6 +1989,9 @@ Similar to

    +The string will always be utf8 encoded. +

    +

    The return value must be freed using g_free().

    @@ -1819,7 +2009,7 @@ The return value must be freed using Returns :

    -
    @@ -1880,12 +2070,13 @@ For an empty array, length will be set t - - @@ -1921,12 +2112,12 @@ For an empty array, length will be set t - - @@ -1934,35 +2125,199 @@ For an empty array, length will be set t

    Since 2.24


    +
    +

    g_variant_get_bytestring ()

    +
    const gchar *       g_variant_get_bytestring            (GVariant *value);
    +

    +Returns the string value of a GVariant instance with an +array-of-bytes type. The string has no particular encoding. +

    +

    +If the array does not end with a nul terminator character, the empty +string is returned. For this reason, you can always trust that a +non-NULL nul-terminated string will be returned by this function. +

    +

    +If the array contains a nul terminator character somewhere other than +the last byte then the returned string is the string, up to the first +such nul character. +

    +

    +It is an error to call this function with a value that is not an +array of bytes. +

    +

    +The return value remains valid as long as value exists. +

    +
    a newly allocated string +a newly allocated string, utf8 encoded

    length :

    the length of the result, or NULL + the length of the result, or NULL. [allow-none]

    Returns :

    an array of constant strings + an array of constant +strings. [array length=length][transfer container length=length]

    length :

    the length of the result, or NULL + the length of the result, or NULL. [allow-none]

    Returns :

    an array of constant strings + an array of strings. [array length=length]
    ++ + + + + + + + + + +

    value :

    an array-of-bytes GVariant instance +

    Returns :

    the constant string +
    +

    Since 2.26

    +
    +
    +
    +

    g_variant_dup_bytestring ()

    +
    gchar *             g_variant_dup_bytestring            (GVariant *value,
    +                                                         gsize *length);
    +

    +Similar to g_variant_get_bytestring() except that instead of +returning a constant string, the string is duplicated. +

    +

    +The return value must be freed using g_free(). +

    +
    ++ + + + + + + + + + + + + + +

    value :

    an array-of-bytes GVariant instance +

    length :

    a pointer to a gsize, to store + the length (not including the nul terminator). [allow-none][default NULL] +

    Returns :

    a newly allocated string +
    +

    Since 2.26

    +
    +
    +
    +

    g_variant_get_bytestring_array ()

    +
    const gchar **      g_variant_get_bytestring_array      (GVariant *value,
    +                                                         gsize *length);
    +

    +Gets the contents of an array of array of bytes GVariant. This call +makes a shallow copy; the return result should be released with +g_free(), but the individual strings must not be modified. +

    +

    +If length is non-NULL then the number of elements in the result is +stored there. In any case, the resulting array will be +NULL-terminated. +

    +

    +For an empty array, length will be set to 0 and a pointer to a +NULL pointer will be returned. +

    +
    ++ + + + + + + + + + + + + + +

    value :

    an array of array of bytes GVariant ('aay') +

    length :

    the length of the result, or NULL. [allow-none] +

    Returns :

    an array of constant strings. [array length=length] +
    +

    Since 2.26

    +
    +
    +
    +

    g_variant_dup_bytestring_array ()

    +
    gchar **            g_variant_dup_bytestring_array      (GVariant *value,
    +                                                         gsize *length);
    +

    +Gets the contents of an array of array of bytes GVariant. This call +makes a deep copy; the return result should be released with +g_strfreev(). +

    +

    +If length is non-NULL then the number of elements in the result is +stored there. In any case, the resulting array will be +NULL-terminated. +

    +

    +For an empty array, length will be set to 0 and a pointer to a +NULL pointer will be returned. +

    +
    ++ + + + + + + + + + + + + + +

    value :

    an array of array of bytes GVariant ('aay') +

    length :

    the length of the result, or NULL. [allow-none] +

    Returns :

    an array of strings. [array length=length] +
    +

    Since 2.26

    +
    +

    g_variant_new_maybe ()

    GVariant *          g_variant_new_maybe                 (const GVariantType *child_type,
                                                              GVariant *child);

    -Depending on if value is NULL, either wraps value inside of a +Depending on if child is NULL, either wraps child inside of a maybe container or creates a Nothing instance for the given type.

    -At least one of type and value must be non-NULL. If type is -non-NULL then it must be a definite type. If they are both -non-NULL then type must be the type of value. +At least one of child_type and child must be non-NULL. +If child_type is non-NULL then it must be a definite type. +If they are both non-NULL then child_type must be the type +of child. +

    +

    +If child is a floating reference (see g_variant_ref_sink()), the new +instance takes ownership of child.

    - - - @@ -1992,17 +2347,22 @@ in the children array may be child_type, if given.

    +

    +If the children are floating references (see g_variant_ref_sink()), the +new instance takes ownership of them as if via g_variant_ref_sink(). +

    child_type :

    the GVariantType of the child + the GVariantType of the child, or NULL. [allow-none]

    child :

    the child value, or NULL + the child value, or NULL. [allow-none]

    Returns :

    a new GVariant maybe instance +a floating reference to a new GVariant maybe instance
    - - @@ -2012,7 +2372,7 @@ same as child_type, if given. - @@ -2032,12 +2392,16 @@ type is determined from the types of children

    If n_children is 0 then the unit tuple is constructed.

    +

    +If the children are floating references (see g_variant_ref_sink()), the +new instance takes ownership of them as if via g_variant_ref_sink(). +

    child_type :

    the element type of the new array + the element type of the new array. [allow-none]

    children :

    an array of GVariant pointers, the children + an array of + GVariant pointers, the children. [allow-none][array length=n_children]

    Returns :

    a new GVariant array +a floating reference to a new GVariant array
    - @@ -2047,7 +2411,7 @@ If n_children is 0 then the unit tuple i - @@ -2066,6 +2430,10 @@ non- key must be a value of a basic type (ie: not a container).

    +

    +If the key or value are floating references (see g_variant_ref_sink()), +the new instance takes ownership of them as if via g_variant_ref_sink(). +

    children :

    the items to make the tuple out of + the items to make the tuple out of. [array length=n_children]

    Returns :

    a new GVariant tuple +a floating reference to a new GVariant tuple
    @@ -2081,7 +2449,7 @@ non- - @@ -2106,7 +2474,7 @@ value is Nothing, then this function returns Returns :

    -
    @@ -2230,6 +2598,119 @@ essentially a combination of Since 2.24


    +
    +

    g_variant_lookup_value ()

    +
    GVariant *          g_variant_lookup_value              (GVariant *dictionary,
    +                                                         const gchar *key,
    +                                                         const GVariantType *expected_type);
    +

    +Looks up a value in a dictionary GVariant. +

    +

    +This function works with dictionaries of the type +a{s*} (and equally well with type +a{o*}, but we only further discuss the string case +for sake of clarity). +

    +

    +In the event that dictionary has the type a{sv}, +the expected_type string specifies what type of value is expected to +be inside of the variant. If the value inside the variant has a +different type then NULL is returned. In the event that dictionary +has a value type other than v then expected_type +must directly match the key type and it is used to unpack the value +directly or an error occurs. +

    +

    +In either case, if key is not found in dictionary, NULL is +returned. +

    +

    +If the key is found and the value has the correct type, it is +returned. If expected_type was specified then any non-NULL return +value will have this type. +

    +

    Returns :

    a new dictionary entry GVariant +a floating reference to a new dictionary entry GVariant
    the contents of value, or NULL + the contents of value, or NULL. [allow-none]
    ++ + + + + + + + + + + + + + + + + + +

    dictionary :

    a dictionary GVariant +

    key :

    the key to lookup in the dictionary +

    expected_type :

    a GVariantType, or NULL +

    Returns :

    the value of the dictionary key, or NULL + +
    +

    Since 2.28

    +
    +
    +
    +

    g_variant_lookup ()

    +
    gboolean            g_variant_lookup                    (GVariant *dictionary,
    +                                                         const gchar *key,
    +                                                         const gchar *format_string,
    +                                                         ...);
    +

    +Looks up a value in a dictionary GVariant. +

    +

    +This function is a wrapper around g_variant_lookup_value() and +g_variant_get(). In the case that NULL would have been returned, +this function returns FALSE. Otherwise, it unpacks the returned +value and returns TRUE. +

    +

    +See g_variant_get() for information about format_string. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    dictionary :

    a dictionary GVariant +

    key :

    the key to lookup in the dictionary +

    format_string :

    a GVariant format string +

    ... :

    the arguments to unpack the value into +

    Returns :

    TRUE if a value was unpacked + +
    +

    Since 2.28

    +
    +

    g_variant_get_fixed_array ()

    gconstpointer       g_variant_get_fixed_array           (GVariant *value,
    @@ -2274,7 +2755,7 @@ items in the array.
     
     
     

    Returns :

    -a pointer to the fixed array + a pointer to the fixed array. [array length=n_elements] @@ -2606,7 +3087,7 @@ function with value :

    -a basic
    GVariant value as a gconstpointer + a basic GVariant value as a gconstpointer. [type GVariant] @@ -2635,12 +3116,12 @@ this function with

    one :

    -a
    GVariant instance + a GVariant instance. [type GVariant]

    two :

    -a GVariant instance + a GVariant instance. [type GVariant] @@ -2711,7 +3192,7 @@ a new empty

    string :

    -a
    GString, or NULL + a GString, or NULL. [allow-none][default NULL] @@ -2908,7 +3389,7 @@ you no longer need it.

    -

    Example 23. Iterating with g_variant_iter_next_value()

    +

    Example 23. Iterating with g_variant_iter_next_value()

    @@ -2967,7 +3448,7 @@ you no longer need it. - @@ -2994,9 +3475,13 @@ responsibility of the caller to free all of the values returned by the unpacking process.

    +See the section on GVariant +Format Strings. +

    +

    -

    Example 24. Memory management with g_variant_iter_next()

    +

    Example 24. Memory management with g_variant_iter_next()

    Returns :

    a GVariant, or NULL + a GVariant, or NULL. [allow-none]
    @@ -3111,9 +3596,13 @@ function and

    +See the section on GVariant +Format Strings. +

    +

    -

    Example 25. Memory management with g_variant_iter_loop()

    +

    Example 25. Memory management with g_variant_iter_loop()

    @@ -3445,8 +3934,7 @@ make_pointless_dictionary (void) GVariantBuilder *builder; int i; - builder = g_variant_builder_new (G_VARIANT_TYPE_CLASS_ARRAY, - NULL); + builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY); for (i = 0; i < 16; i++) { gchar buf[3]; @@ -3483,6 +3971,63 @@ make_pointless_dictionary (void)

    Since 2.24


    +
    +

    g_variant_builder_add_parsed ()

    +
    void                g_variant_builder_add_parsed        (GVariantBuilder *builder,
    +                                                         const gchar *format,
    +                                                         ...);
    +

    +Adds to a GVariantBuilder. +

    +

    +This call is a convenience wrapper that is exactly equivalent to +calling g_variant_new_parsed() followed by +g_variant_builder_add_value(). +

    +

    +This function might be used as follows: +

    +

    +

    +
    +GVariant *
    +make_pointless_dictionary (void)
    +{
    +  GVariantBuilder *builder;
    +  int i;
    +
    +  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
    +  g_variant_builder_add_parsed (builder, "{'width', <%i>}", 600);
    +  g_variant_builder_add_parsed (builder, "{'title', <%s>}", "foo");
    +  g_variant_builder_add_parsed (builder, "{'transparency', <0.5>}");
    +  return g_variant_builder_end (builder);
    +}
    +
    +

    +

    +
    ++ + + + + + + + + + + + + + +

    builder :

    a GVariantBuilder +

    format :

    a text format GVariant +

    ... :

    arguments as per format +
    +

    Since 2.26

    +
    +

    g_variant_builder_end ()

    GVariant *          g_variant_builder_end               (GVariantBuilder *builder);
    @@ -3514,7 +4059,7 @@ the empty array.

    Returns :

    -a new, floating, GVariant + a new, floating, GVariant. [transfer none] @@ -3576,6 +4121,130 @@ subcontainer).

    Since 2.24


    +
    +

    enum GVariantParseError

    +
    typedef enum
    +{
    +  G_VARIANT_PARSE_ERROR_FAILED,
    +  G_VARIANT_PARSE_ERROR_BASIC_TYPE_EXPECTED,
    +  G_VARIANT_PARSE_ERROR_CANNOT_INFER_TYPE,
    +  G_VARIANT_PARSE_ERROR_DEFINITE_TYPE_EXPECTED,
    +  G_VARIANT_PARSE_ERROR_INPUT_NOT_AT_END,
    +  G_VARIANT_PARSE_ERROR_INVALID_CHARACTER,
    +  G_VARIANT_PARSE_ERROR_INVALID_FORMAT_STRING,
    +  G_VARIANT_PARSE_ERROR_INVALID_OBJECT_PATH,
    +  G_VARIANT_PARSE_ERROR_INVALID_SIGNATURE,
    +  G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING,
    +  G_VARIANT_PARSE_ERROR_NO_COMMON_TYPE,
    +  G_VARIANT_PARSE_ERROR_NUMBER_OUT_OF_RANGE,
    +  G_VARIANT_PARSE_ERROR_NUMBER_TOO_BIG,
    +  G_VARIANT_PARSE_ERROR_TYPE_ERROR,
    +  G_VARIANT_PARSE_ERROR_UNEXPECTED_TOKEN,
    +  G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD,
    +  G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT,
    +  G_VARIANT_PARSE_ERROR_VALUE_EXPECTED
    +} GVariantParseError;
    +
    +

    +Error codes returned by parsing text-format GVariants. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    G_VARIANT_PARSE_ERROR_FAILED

    generic error (unused) +

    G_VARIANT_PARSE_ERROR_BASIC_TYPE_EXPECTED

    a non-basic GVariantType was given where a basic type was expected +

    G_VARIANT_PARSE_ERROR_CANNOT_INFER_TYPE

    cannot infer the GVariantType +

    G_VARIANT_PARSE_ERROR_DEFINITE_TYPE_EXPECTED

    an indefinite GVariantType was given where a definite type was expected +

    G_VARIANT_PARSE_ERROR_INPUT_NOT_AT_END

    extra data after parsing finished +

    G_VARIANT_PARSE_ERROR_INVALID_CHARACTER

    invalid character in number or unicode escape +

    G_VARIANT_PARSE_ERROR_INVALID_FORMAT_STRING

    not a valid GVariant format string +

    G_VARIANT_PARSE_ERROR_INVALID_OBJECT_PATH

    not a valid object path +

    G_VARIANT_PARSE_ERROR_INVALID_SIGNATURE

    not a valid type signature +

    G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING

    not a valid GVariant type string +

    G_VARIANT_PARSE_ERROR_NO_COMMON_TYPE

    could not find a common type for array entries +

    G_VARIANT_PARSE_ERROR_NUMBER_OUT_OF_RANGE

    the numerical value is out of range of the given type +

    G_VARIANT_PARSE_ERROR_NUMBER_TOO_BIG

    the numerical value is out of range for any type +

    G_VARIANT_PARSE_ERROR_TYPE_ERROR

    cannot parse as variant of the specified type +

    G_VARIANT_PARSE_ERROR_UNEXPECTED_TOKEN

    an unexpected token was encountered +

    G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD

    an unknown keyword was encountered +

    G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT

    unterminated string constant +

    G_VARIANT_PARSE_ERROR_VALUE_EXPECTED

    no value given +
    +
    +

    G_VARIANT_PARSE_ERROR

    #define G_VARIANT_PARSE_ERROR (g_variant_parser_get_error_quark ())
    @@ -3724,7 +4393,7 @@ or by passing it to another format and returns the result.
     

    -format must be a text format GVariant with one extention: at any +format must be a text format GVariant with one extension: at any point that a value may appear in the text, a '%' character followed by a GVariant format string (as per g_variant_new()) may appear. In that case, the same arguments are collected from the argument list as @@ -3793,6 +4462,6 @@ GVariantType

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-GVariantType.html b/docs/reference/glib/html/glib-GVariantType.html index 75294aa..54cf672 100644 --- a/docs/reference/glib/html/glib-GVariantType.html +++ b/docs/reference/glib/html/glib-GVariantType.html @@ -3,12 +3,12 @@ GVariantType - + - + @@ -63,6 +63,9 @@ #define G_VARIANT_TYPE_UNIT #define G_VARIANT_TYPE_DICT_ENTRY #define G_VARIANT_TYPE_DICTIONARY +#define G_VARIANT_TYPE_STRING_ARRAY +#define G_VARIANT_TYPE_BYTESTRING +#define G_VARIANT_TYPE_BYTESTRING_ARRAY #define G_VARIANT_TYPE (type_string) void g_variant_type_free (GVariantType *type); @@ -167,10 +170,10 @@ certainly matches the type of "an array of no particular type", since This is similar to how instances of abstract classes may not directly exist in other type systems, but instances of their non-abstract subtypes may. For example, in GTK, no object that has -the type of GtkBin can exist (since GtkBin is an abstract class), -but a GtkWindow can certainly be instantiated, and you would say -that the GtkWindow is a GtkBin (since GtkWindow is a subclass of -GtkBin). +the type of GtkBin can exist (since GtkBin is an abstract class), +but a GtkWindow can certainly be instantiated, and you would say +that the GtkWindow is a GtkBin (since GtkWindow is a subclass of +GtkBin).

    A detailed description of GVariant type strings is given here: @@ -802,6 +805,36 @@ dictionary entry type.


    +
    +

    G_VARIANT_TYPE_STRING_ARRAY

    +
    #define G_VARIANT_TYPE_STRING_ARRAY         ((const GVariantType *) "as")
    +
    +

    +The type of an array of strings. +

    +
    +
    +
    +

    G_VARIANT_TYPE_BYTESTRING

    +
    #define G_VARIANT_TYPE_BYTESTRING           ((const GVariantType *) "ay")
    +
    +

    +The type of an array of bytes. This type is commonly used to pass +around strings that may not be valid utf8. In that case, the +convention is that the nul terminator character should be included as +the last character in the array. +

    +
    +
    +
    +

    G_VARIANT_TYPE_BYTESTRING_ARRAY

    +
    #define G_VARIANT_TYPE_BYTESTRING_ARRAY     ((const GVariantType *) "aay")
    +
    +

    +The type of an array of byte strings (an array of arrays of bytes). +

    +
    +

    G_VARIANT_TYPE()

    #define             G_VARIANT_TYPE(type_string)
    @@ -1810,6 +1843,6 @@ Since 2.24
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Glob-style-pattern-matching.html b/docs/reference/glib/html/glib-Glob-style-pattern-matching.html index 7623a73..a06f0c5 100644 --- a/docs/reference/glib/html/glib-Glob-style-pattern-matching.html +++ b/docs/reference/glib/html/glib-Glob-style-pattern-matching.html @@ -3,12 +3,12 @@ Glob-style pattern matching - + - + @@ -290,6 +290,6 @@ the pattern once with
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Hash-Tables.html b/docs/reference/glib/html/glib-Hash-Tables.html index a36b7e0..152a0d4 100644 --- a/docs/reference/glib/html/glib-Hash-Tables.html +++ b/docs/reference/glib/html/glib-Hash-Tables.html @@ -3,12 +3,12 @@ Hash Tables - + - + @@ -1484,8 +1484,17 @@ see
    guint g_str_hash (gconstpointer v);

    Converts a string to a hash value. -It can be passed to g_hash_table_new() as the hash_func -parameter, when using strings as keys in a GHashTable. +

    +

    +This function implements the widely used "djb" hash apparently posted +by Daniel Bernstein to comp.lang.c some time ago. The 32 bit +unsigned hash value starts at 5381 and for each byte 'c' in the +string, is updated: hash = hash * 33 + c. This +function uses the signed value of each byte. +

    +

    +It can be passed to g_hash_table_new() as the hash_func parameter, +when using strings as keys in a GHashTable.

    @@ -1507,6 +1516,6 @@ parameter, when using strings as keys in a
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Hook-Functions.html b/docs/reference/glib/html/glib-Hook-Functions.html index d967415..4606392 100644 --- a/docs/reference/glib/html/glib-Hook-Functions.html +++ b/docs/reference/glib/html/glib-Hook-Functions.html @@ -3,12 +3,12 @@ Hook Functions - + - + @@ -1362,6 +1362,6 @@ Removes one
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Hostname-Utilities.html b/docs/reference/glib/html/glib-Hostname-Utilities.html index 5c6d54f..5c2ed58 100644 --- a/docs/reference/glib/html/glib-Hostname-Utilities.html +++ b/docs/reference/glib/html/glib-Hostname-Utilities.html @@ -3,12 +3,12 @@ Hostname Utilities - + - + @@ -224,6 +224,6 @@ Tests if hostname is the string form of + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-I18N.html b/docs/reference/glib/html/glib-I18N.html index b00a7c8..c255861 100644 --- a/docs/reference/glib/html/glib-I18N.html +++ b/docs/reference/glib/html/glib-I18N.html @@ -3,12 +3,12 @@ Internationalization - + - + @@ -41,6 +41,7 @@ #include <glib.h> #include <glib/gi18n.h> +#define _ (String) #define Q_ (String) #define C_ (Context, String) @@ -49,6 +50,9 @@ String) const gchar * g_dgettext (const gchar *domain, const gchar *msgid); +const gchar * g_dcgettext (const gchar *domain, + const gchar *msgid, + int category); const gchar * g_dngettext (const gchar *domain, const gchar *msgid, const gchar *msgid_plural, @@ -99,11 +103,29 @@ with xgettext.

    Details

    +
    +

    _()

    +
    #define             _(String)
    +

    +Marks a string for translation, gets replaced with the translated string +at runtime. +

    +
    ++ + + + +

    String :

    the string to be translated +
    +

    Since 2.4

    + +

    Q_()

    #define             Q_(String)

    -Like _(), but handles context in message ids. This has the advantage that +Like _(), but handles context in message ids. This has the advantage that the string can be adorned with a prefix to guarantee uniqueness and provide context to the translator.

    @@ -237,7 +259,7 @@ To get the translated string, call gettext() at ru const char *string; ... string - = index > 1 ? _("a default message") : gettext (messages[index]); + = index > 1 ? _("a default message") : gettext (messages[index]); fputs (string); ... @@ -372,7 +394,7 @@ cases the application should call textdomain() aft

    Applications should normally not use this function directly, -but use the _() macro for translations. +but use the _() macro for translations.

    @@ -399,6 +421,47 @@ but use the _() macro for translations.

    Since 2.18


    +
    +

    g_dcgettext ()

    +
    const gchar *       g_dcgettext                         (const gchar *domain,
    +                                                         const gchar *msgid,
    +                                                         int category);
    +

    +This is a variant of g_dgettext() that allows specifying a locale +category instead of always using LC_MESSAGES. See g_dgettext() for +more information about how this functions differs from calling +dcgettext() directly. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    domain :

    the translation domain to use, or NULL to use + the domain set with textdomain(). [allow-none] +

    msgid :

    message to translate +

    category :

    a locale category +

    Returns :

    the translated string for the given locale category + +
    +

    Since 2.26

    +
    +

    g_dngettext ()

    const gchar *       g_dngettext                         (const gchar *domain,
    @@ -518,7 +581,7 @@ This uses dgettext() proper.
     

    -This function differs from C_() in that it is not a macro and +This function differs from C_() in that it is not a macro and thus you may use non-string-literals as context and msgid arguments.

    @@ -575,7 +638,7 @@ An auxiliary function for gettext() support (see < @@ -624,6 +687,6 @@ The gettext manual. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-IO-Channels.html b/docs/reference/glib/html/glib-IO-Channels.html index a1a9056..6102a7f 100644 --- a/docs/reference/glib/html/glib-IO-Channels.html +++ b/docs/reference/glib/html/glib-IO-Channels.html @@ -3,12 +3,12 @@ IO Channels - + - + @@ -1224,7 +1224,7 @@ with the given priority.

    This internally creates a main loop source using g_io_create_watch() and attaches it to the main loop context with g_source_attach(). -You can do these steps manuallt if you need greater control. +You can do these steps manually if you need greater control.

    Returns :

    msgval, unless msgval is identical to msgid and contains a '|' character, in which case a pointer to the substring of msgid after - the first '|' character is returned. + the first '|' character is returned.
    @@ -2191,6 +2191,6 @@ last reference is dropped using
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Key-value-file-parser.html b/docs/reference/glib/html/glib-Key-value-file-parser.html index f2ece0a..10f7362 100644 --- a/docs/reference/glib/html/glib-Key-value-file-parser.html +++ b/docs/reference/glib/html/glib-Key-value-file-parser.html @@ -3,12 +3,12 @@ Key-value file parser - + - + @@ -107,6 +107,14 @@ enum
    const gchar *group_name, const gchar *key, GError **error); +gint64g_key_file_get_int64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + GError **error); +guint64g_key_file_get_uint64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + GError **error); gdoubleg_key_file_get_double (GKeyFile *key_file, const gchar *group_name, const gchar *key, @@ -163,6 +171,14 @@ enum const gchar *group_name, const gchar *key, gint value); +voidg_key_file_set_int64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + gint64 value); +voidg_key_file_set_uint64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + guint64 value); voidg_key_file_set_double (GKeyFile *key_file, const gchar *group_name, const gchar *key, @@ -1223,6 +1239,98 @@ and error is set to Since 2.6


    +
    +

    g_key_file_get_int64 ()

    +
    gint64              g_key_file_get_int64                (GKeyFile *key_file,
    +                                                         const gchar *group_name,
    +                                                         const gchar *key,
    +                                                         GError **error);
    +

    +Returns the value associated with key under group_name as a signed +64-bit integer. This is similar to g_key_file_get_integer() but can return +64-bit results without truncation. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    key_file :

    a non-NULL GKeyFile +

    group_name :

    a non-NULL group name +

    key :

    a non-NULL key +

    error :

    return location for a GError +

    Returns :

    the value associated with the key as a signed 64-bit integer, or +0 if the key was not found or could not be parsed. + +
    +

    Since 2.26

    +
    +
    +
    +

    g_key_file_get_uint64 ()

    +
    guint64             g_key_file_get_uint64               (GKeyFile *key_file,
    +                                                         const gchar *group_name,
    +                                                         const gchar *key,
    +                                                         GError **error);
    +

    +Returns the value associated with key under group_name as an unsigned +64-bit integer. This is similar to g_key_file_get_integer() but can return +large positive results without truncation. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    key_file :

    a non-NULL GKeyFile +

    group_name :

    a non-NULL group name +

    key :

    a non-NULL key +

    error :

    return location for a GError +

    Returns :

    the value associated with the key as an unsigned 64-bit integer, +or 0 if the key was not found or could not be parsed. + +
    +

    Since 2.26

    +
    +

    g_key_file_get_double ()

    gdouble             g_key_file_get_double               (GKeyFile *key_file,
    @@ -1819,6 +1927,82 @@ If key cannot be found then it is create
     

    Since 2.6


    +
    +

    g_key_file_set_int64 ()

    +
    void                g_key_file_set_int64                (GKeyFile *key_file,
    +                                                         const gchar *group_name,
    +                                                         const gchar *key,
    +                                                         gint64 value);
    +

    +Associates a new integer value with key under group_name. +If key cannot be found then it is created. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    key_file :

    a GKeyFile +

    group_name :

    a group name +

    key :

    a key +

    value :

    an integer value +
    +

    Since 2.26

    +
    +
    +
    +

    g_key_file_set_uint64 ()

    +
    void                g_key_file_set_uint64               (GKeyFile *key_file,
    +                                                         const gchar *group_name,
    +                                                         const gchar *key,
    +                                                         guint64 value);
    +

    +Associates a new integer value with key under group_name. +If key cannot be found then it is created. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    key_file :

    a GKeyFile +

    group_name :

    a group name +

    key :

    a key +

    value :

    an integer value +
    +

    Since 2.26

    +
    +

    g_key_file_set_double ()

    void                g_key_file_set_double               (GKeyFile *key_file,
    @@ -2551,6 +2735,6 @@ key for desktop entries representing directories.
     
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Keyed-Data-Lists.html b/docs/reference/glib/html/glib-Keyed-Data-Lists.html index 9ba60ea..4dbda7b 100644 --- a/docs/reference/glib/html/glib-Keyed-Data-Lists.html +++ b/docs/reference/glib/html/glib-Keyed-Data-Lists.html @@ -3,12 +3,12 @@ Keyed Data Lists - + - + @@ -96,8 +96,8 @@ The GQuarks anyway.

    -Data lists are used for associating arbitrary data with GObjects, -using g_object_set_data() and related functions. +Data lists are used for associating arbitrary data with GObjects, +using g_object_set_data() and related functions.

    To create a datalist, use g_datalist_init(). @@ -513,7 +513,7 @@ Turns on flag values for a data list. This function is used to keep a small number of boolean flags in an object with a data list without using any additional space. It is not generally useful except in circumstances where space -is very tight. (It is used in the base GObject type, for +is very tight. (It is used in the base GObject type, for example.)

    @@ -607,6 +607,6 @@ flags & ~G_DATALIST_FLAGS_MASK != 0 is an error. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Lexical-Scanner.html b/docs/reference/glib/html/glib-Lexical-Scanner.html index 162eb10..b1f9cc1 100644 --- a/docs/reference/glib/html/glib-Lexical-Scanner.html +++ b/docs/reference/glib/html/glib-Lexical-Scanner.html @@ -3,12 +3,12 @@ Lexical Scanner - + - + @@ -1446,6 +1446,6 @@ of
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Limits-of-Basic-Types.html b/docs/reference/glib/html/glib-Limits-of-Basic-Types.html index bf71ba9..29a7ee7 100644 --- a/docs/reference/glib/html/glib-Limits-of-Basic-Types.html +++ b/docs/reference/glib/html/glib-Limits-of-Basic-Types.html @@ -3,12 +3,12 @@ Limits of Basic Types - + - + @@ -346,7 +346,7 @@ The minimum positive value which can be held in a
    gfloat, -use -G_MAX_FLOAT. +use -G_MAXFLOAT.


    @@ -384,6 +384,6 @@ The maximum value which can be held in a
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Memory-Allocation.html b/docs/reference/glib/html/glib-Memory-Allocation.html index 5f8c563..c6dd22f 100644 --- a/docs/reference/glib/html/glib-Memory-Allocation.html +++ b/docs/reference/glib/html/glib-Memory-Allocation.html @@ -3,12 +3,12 @@ Memory Allocation - + - + @@ -104,23 +104,27 @@ extern GMemVTable *

    Note

    -

    If any call to allocate memory fails, the application is terminated. This also means that there is no need to check if the call succeeded. -

    +

    +

    +

    +

    Note

    -

    It's important to match g_malloc() with g_free(), plain malloc() with free(), and (if you're using C++) new with delete and new[] with delete[]. Otherwise bad things can happen, since these allocators may use different memory pools (and new/delete call constructors and destructors). See also g_mem_set_vtable(). -

    +

    +

    Details

    @@ -153,7 +157,7 @@ so might hide memory allocation errors.
    - @@ -189,7 +193,7 @@ so might hide memory allocation errors. - @@ -225,7 +229,7 @@ Care is taken to avoid overflow when calculating the size of the allocated block - @@ -256,7 +260,7 @@ The function returns - @@ -289,7 +293,7 @@ The function returns - @@ -327,7 +331,7 @@ The function returns - @@ -352,7 +356,7 @@ If n_bytes is 0 it returns Returns :

    -
    @@ -376,7 +380,7 @@ If n_bytes is 0 it returns Returns :

    -
    @@ -409,7 +413,7 @@ and mem will be freed unless it is - @@ -433,7 +437,7 @@ Contrast with - @@ -457,7 +461,7 @@ failure. Contrast with Returns :

    -
    @@ -489,7 +493,7 @@ on failure. If mem is - @@ -519,7 +523,7 @@ but care is taken to detect possible overflow during multiplication. - @@ -550,7 +554,7 @@ but care is taken to detect possible overflow during multiplication. - @@ -587,7 +591,7 @@ but care is taken to detect possible overflow during multiplication. - @@ -618,7 +622,7 @@ but care is taken to detect possible overflow during multiplication. - @@ -649,7 +653,7 @@ but care is taken to detect possible overflow during multiplication. - @@ -686,7 +690,7 @@ but care is taken to detect possible overflow during multiplication. - @@ -782,12 +786,12 @@ Thus it provides the same advantages and pitfalls as allo - - @@ -810,12 +814,12 @@ Wraps n_structs :

    -
    - @@ -880,8 +884,8 @@ from mem. If - @@ -973,7 +977,7 @@ should return g_malloc() is the system's malloc implementation. If it returns TRUE memory allocated with -malloc() can be used interchangeable with memory allocated using g_malloc(). +malloc() can be used interchangeable with memory allocated using g_malloc(). This function is useful for avoiding an extra copy of allocated memory returned by a non-GLib-based API.

    @@ -1024,6 +1028,6 @@ previously installed the
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Memory-Allocators.html b/docs/reference/glib/html/glib-Memory-Allocators.html index eef3e40..de958e5 100644 --- a/docs/reference/glib/html/glib-Memory-Allocators.html +++ b/docs/reference/glib/html/glib-Memory-Allocators.html @@ -3,12 +3,12 @@ Memory Allocators - + - + @@ -136,6 +136,6 @@ Frees all of the memory allocated by the

    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Memory-Chunks.html b/docs/reference/glib/html/glib-Memory-Chunks.html index ddeb9f0..8bb60a6 100644 --- a/docs/reference/glib/html/glib-Memory-Chunks.html +++ b/docs/reference/glib/html/glib-Memory-Chunks.html @@ -3,12 +3,12 @@ Memory Chunks - + - + @@ -134,7 +134,7 @@ To help debug memory chunks, use
    -

    Example 17. Using a GMemChunk

    +

    Example 17. Using a GMemChunk

    Returns :

    a pointer to the allocated memory, cast to a pointer to struct_type + a pointer to the allocated memory, cast to a pointer to struct_type

    Returns :

    a pointer to the allocated memory, cast to a pointer to struct_type. + a pointer to the allocated memory, cast to a pointer to struct_type.

    Returns :

    a pointer to the new allocated memory, cast to a pointer to struct_type + a pointer to the new allocated memory, cast to a pointer to struct_type

    Returns :

    a pointer to the allocated memory, cast to a pointer to struct_type + a pointer to the allocated memory, cast to a pointer to struct_type

    Returns :

    a pointer to the allocated memory, cast to a pointer to struct_type + a pointer to the allocated memory, cast to a pointer to struct_type

    Returns :

    a pointer to the new allocated memory, cast to a pointer to struct_type + a pointer to the new allocated memory, cast to a pointer to struct_type
    a pointer to the allocated memory + a pointer to the allocated memory
    a pointer to the allocated memory + a pointer to the allocated memory

    Returns :

    the new address of the allocated memory + the new address of the allocated memory

    Returns :

    the allocated memory, or NULL. + the allocated memory, or NULL.
    the allocated memory, or NULL + the allocated memory, or NULL

    Returns :

    the allocated memory, or NULL. + the allocated memory, or NULL.

    Returns :

    a pointer to the allocated memory + a pointer to the allocated memory

    Returns :

    a pointer to the allocated memory + a pointer to the allocated memory

    Returns :

    the new address of the allocated memory + the new address of the allocated memory

    Returns :

    the allocated memory, or NULL. + the allocated memory, or NULL.

    Returns :

    the allocated memory, or NULL + the allocated memory, or NULL

    Returns :

    the allocated memory, or NULL. + the allocated memory, or NULL.

    size :

    number of bytes to allocate. +number of bytes to allocate.

    Returns :

    space for size bytes, allocated on the stack + space for size bytes, allocated on the stack
    Number of chunks to be allocated +Number of chunks to be allocated

    Returns :

    Pointer to stack space for n_structs chunks of type struct_type + Pointer to stack space for n_structs chunks of type struct_type

    Returns :

    a pointer to the newly-allocated copy of the memory, or NULL if mem -is NULL. + a pointer to the newly-allocated copy of the memory, or NULL if mem + is NULL.
    @@ -198,7 +198,7 @@ To help debug memory chunks, use -

    Example 18. Using a GMemChunk with data structures

    +

    Example 18. Using a GMemChunk with data structures

    @@ -701,6 +701,6 @@ used, and the number of blocks of memory allocated. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Memory-Slices.html b/docs/reference/glib/html/glib-Memory-Slices.html index ee35b8a..8ea31dd 100644 --- a/docs/reference/glib/html/glib-Memory-Slices.html +++ b/docs/reference/glib/html/glib-Memory-Slices.html @@ -3,12 +3,12 @@ Memory Slices - + - + @@ -72,7 +72,7 @@ memory-waste, scalability and performance problems.

    To achieve these goals, the slice allocator uses a sophisticated, layered design that has been inspired by Bonwick's slab allocator -[6]. +[6]. It uses posix_memalign() to optimize allocations of many equally-sized chunks, and has per-thread free lists (the so-called magazine layer) to quickly satisfy allocation requests of already known structure sizes. @@ -93,7 +93,7 @@ friends, as long as objects are not resized during their lifetime and the object size used at allocation time is still available when freeing.

    -

    Example 15. Using the slice allocator

    +

    Example 15. Using the slice allocator

    @@ -135,7 +135,7 @@ object size used at allocation time is still available when freeing.
    -

    Example 16. Using the slice allocator with data structures

    +

    Example 16. Using the slice allocator with data structures

    @@ -495,7 +495,7 @@ also see G_SLIC


    -

    [6] +

    [6] [Bonwick94] Jeff Bonwick, The slab allocator: An object-caching kernel memory allocator. USENIX 1994, and [Bonwick01] Bonwick and Jonathan Adams, Magazines and vmem: Extending the @@ -505,6 +505,6 @@ slab allocator to many cpu's and arbitrary resources. USENIX 2001

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Message-Logging.html b/docs/reference/glib/html/glib-Message-Logging.html index 15550b3..f37675f 100644 --- a/docs/reference/glib/html/glib-Message-Logging.html +++ b/docs/reference/glib/html/glib-Message-Logging.html @@ -3,12 +3,12 @@ Message Logging - + - + @@ -449,7 +449,7 @@ you want to set a handler for this log level you must combine it with G_LOG_FLAG_FATAL.

    -

    Example 12. Adding a log handler for all warning messages in the default +

    Example 12. Adding a log handler for all warning messages in the default (application) domain

    @@ -466,7 +466,7 @@ you want to set a handler for this log level you must combine it with
    -

    Example 13. Adding a log handler for all critical messages from GTK+

    +

    Example 13. Adding a log handler for all critical messages from GTK+

    @@ -482,7 +482,7 @@ you want to set a handler for this log level you must combine it with
    -

    Example 14. Adding a log handler for all messages from +

    Example 14. Adding a log handler for all messages from GLib

    @@ -698,6 +698,6 @@ and log level combination. By default, GLib uses + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Miscellaneous-Macros.html b/docs/reference/glib/html/glib-Miscellaneous-Macros.html index ff8a2d0..00f119a 100644 --- a/docs/reference/glib/html/glib-Miscellaneous-Macros.html +++ b/docs/reference/glib/html/glib-Miscellaneous-Macros.html @@ -3,12 +3,12 @@ Miscellaneous Macros - + - + @@ -56,8 +56,6 @@ #define G_STRINGIFY (macro_or_string) #define G_PASTE (identifier1, identifier2) -#define G_PASTE_ARGS (identifier1, - identifier2) #define G_STATIC_ASSERT (expr) #define G_GNUC_EXTENSION @@ -68,6 +66,7 @@ #define G_GNUC_ALLOC_SIZE2 (x, y) #define G_GNUC_DEPRECATED +#define G_GNUC_DEPRECATED_FOR (f) #define G_GNUC_NORETURN #define G_GNUC_UNUSED #define G_GNUC_PRINTF (format_idx, @@ -230,8 +229,35 @@ does not include string.h for you.

    Accepts a macro or a string and converts it into a string after -preprocessor argument expansion. +preprocessor argument expansion. For example, the following code: +

    +
    +
    + + + + + + +
    1
    +2
    #define AGE 27
    +const gchar *greeting = G_STRINGIFY (AGE) " today!";
    +
    + +

    +is transformed by the preprocessor into (code equivalent to):

    +
    + + + + + + + +
    1
    const gchar *greeting = "27 today!";
    +
    +
    @@ -247,48 +273,61 @@ preprocessor argument expansion.
    #define G_PASTE(identifier1,identifier2)      G_PASTE_ARGS (identifier1, identifier2)
     

    -Yields a new preprocessor pasted identifier 'identifier1identifier2' -from its expanded arguments 'identifier1' and 'identifier2'. +Yields a new preprocessor pasted identifier identifier1identifier2 +from its expanded arguments identifier1 and identifier2. For example, the +following code:

    -
    -- - - - - - - - - - -

    identifier1 :

    an identifier -

    identifier2 :

    an identifier -
    -

    Since 2.20

    +
    + + + + + + + +
    1
    +2
    +3
    +4
    #define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller)
    +const gchar *name = GET (traveller, name);
    +const gchar *quest = GET (traveller, quest);
    +GdkColor *favourite = GET (traveller, favourite_colour);
    -
    -
    -

    G_PASTE_ARGS()

    -
    #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
    -
    +

    +is transformed by the preprocessor into:

    +
    + + + + + + + +
    1
    +2
    +3
    const gchar *name = traveller_get_name (traveller);
    +const gchar *quest = traveller_get_quest (traveller);
    +GdkColor *favourite = traveller_get_favourite_colour (traveller);
    +
    +
    - -

    identifier1 :

    +an identifier

    identifier2 :

    +an identifier
    +

    Since 2.20


    @@ -299,6 +338,15 @@ from its expanded arguments 'identifier1' and 'identifier2'. The G_STATIC_ASSERT macro lets the programmer check a condition at compile time, the condition needs to be compile time computable. The macro can be used in any place where a typedef is valid. +

    +
    +

    Note

    +

    +A typedef is generally allowed in exactly the same +places that a variable declaration is allowed. For this reason, you should not use G_STATIC_ASSERT in the middle of blocks of code. +

    +
    +

    The macro should only be used once per source code line.

    @@ -432,6 +480,27 @@ See the GNU C documentation for details.

    Since 2.2


    +
    +

    G_GNUC_DEPRECATED_FOR()

    +
    #define             G_GNUC_DEPRECATED_FOR(f)
    +

    +Like G_GNUC_DEPRECATED, but names the intended replacement for the +deprecated symbol if the version of gcc in use is +new enough to support custom deprecation messages. +See the GNU C documentation for details. +

    +
    ++ + + + +

    f :

    the intended replacement for the deprecated symbol, such as the name of a + function +
    +

    Since 2.25.3

    +
    +

    G_GNUC_NORETURN

    #define             G_GNUC_NORETURN
    @@ -1040,6 +1109,6 @@ printing values of type + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Miscellaneous-Utility-Functions.html b/docs/reference/glib/html/glib-Miscellaneous-Utility-Functions.html index ce3d05a..33c8212 100644 --- a/docs/reference/glib/html/glib-Miscellaneous-Utility-Functions.html +++ b/docs/reference/glib/html/glib-Miscellaneous-Utility-Functions.html @@ -3,12 +3,12 @@ Miscellaneous Utility Functions - + - + @@ -44,6 +44,7 @@ const void g_set_application_name (const gchar *application_name); gchar* g_get_prgname (void); void g_set_prgname (const gchar *prgname); +gchar** g_get_environ (void); const gchar* g_getenv (const gchar *variable); gboolean g_setenv (const gchar *variable, const gchar *value, @@ -55,6 +56,7 @@ const gchar* g_get_user_cache_dir (void); const gchar* g_get_user_data_dir (void); const gchar* g_get_user_config_dir (void); +const gchar * g_get_user_runtime_dir (void); enum GUserDirectory; const gchar* g_get_user_special_dir (GUserDirectory directory); const gchar* const * g_get_system_data_dirs (void); @@ -149,7 +151,7 @@ been called). Sets a human-readable name for the application. This name should be localized if possible, and is intended for display to the user. Contrast with g_set_prgname(), which sets a non-localized name. -g_set_prgname() will be called automatically by gtk_init(), +g_set_prgname() will be called automatically by gtk_init(), but g_set_application_name() will not.

    @@ -177,8 +179,8 @@ or when displaying an application's name in the task list.

    Gets the name of the program. This name should not be localized, contrast with g_get_application_name(). -(If you are using GDK or GTK+ the program name is set in gdk_init(), -which is called by gtk_init(). The program name is found by taking +(If you are using GDK or GTK+ the program name is set in gdk_init(), +which is called by gtk_init(). The program name is found by taking the last component of argv[0].)

    @@ -210,6 +212,34 @@ thread-safety reasons this function can only be called once.

    +
    +

    g_get_environ ()

    +
    gchar**             g_get_environ                       (void);
    +

    +Gets the list of environment variables for the current process. The +list is NULL terminated and each item in the list is of the form +'NAME=VALUE'. +

    +

    +This is equivalent to direct access to the 'environ' global variable, +except portable. +

    +

    +The return value is freshly allocated and it should be freed with +g_strfreev() when it is no longer needed. +

    +
    ++ + + + +

    Returns :

    the list of environment variables + +
    +

    Since 2.28

    +
    +

    g_getenv ()

    const gchar*        g_getenv                            (const gchar *variable);
    @@ -383,7 +413,14 @@ data specific to particular user.

    On UNIX platforms this is determined using the mechanisms described in the -XDG Base Directory Specification +XDG Base Directory Specification. +In this case the directory retrieved will be XDG_CACHE_HOME. +

    +

    +On Windows is the directory that serves as a common repository for +temporary Internet files. A typical path is +C:\Documents and Settings\username\Local Settings\Temporary Internet Files. +See documentation for CSIDL_INTERNET_CACHE.

    @@ -407,7 +444,14 @@ as icons that is customized for a particular user.

    On UNIX platforms this is determined using the mechanisms described in the -XDG Base Directory Specification +XDG Base Directory Specification. +In this case the directory retrieved will be XDG_DATA_HOME. +

    +

    +On Windows this is the folder to use for local (as opposed to +roaming) application data. See documentation for +CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as +what g_get_user_config_dir() returns.

    @@ -431,7 +475,14 @@ configuration information such as user preferences and settings.

    On UNIX platforms this is determined using the mechanisms described in the -XDG Base Directory Specification +XDG Base Directory Specification. +In this case the directory retrieved will be XDG_CONFIG_HOME. +

    +

    +On Windows this is the folder to use for local (as opposed to +roaming) application data. See documentation for +CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as +what g_get_user_data_dir() returns.

    @@ -445,6 +496,39 @@ XDG Base Directory Specification

    Since 2.6


    +
    +

    g_get_user_runtime_dir ()

    +
    const gchar *       g_get_user_runtime_dir              (void);
    +

    +Returns a directory that is unique to the current user on the local +system. +

    +

    +On UNIX platforms this is determined using the mechanisms described in +the +XDG Base Directory Specification. This is the directory +specified in the XDG_RUNTIME_DIR environment variable. +In the case that this variable is not set, GLib will issue a warning +message to stderr and return the value of g_get_user_cache_dir(). +

    +

    +On Windows this is the folder to use for local (as opposed to +roaming) application data. See documentation for +CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as +what g_get_user_config_dir() returns. +

    +
    ++ + + + +

    Returns :

    a string owned by GLib that must not be modified or freed. + +
    +

    Since 2.28

    +
    +

    enum GUserDirectory

    typedef enum {
    @@ -572,6 +656,7 @@ system-wide application data.
     On UNIX platforms this is determined using the mechanisms described in
     the 
     XDG Base Directory Specification
    +In this case the list of directories retrieved will be XDG_DATA_DIRS.
     

    On Windows the first elements in the list are the Application Data @@ -622,7 +707,16 @@ system-wide configuration information.

    On UNIX platforms this is determined using the mechanisms described in the -XDG Base Directory Specification +XDG Base Directory Specification. +In this case the list of directories retrieved will be XDG_CONFIG_DIRS. +

    +

    +On Windows is the directory that contains application data for all users. +A typical path is C:\Documents and Settings\All Users\Application Data. +This folder is used for application data that is not user specific. +For example, an application can store a spell-check dictionary, a database +of clip art, or a log file in the CSIDL_COMMON_APPDATA folder. +This information will not roam and is available to anyone using the computer.

    @@ -748,7 +842,7 @@ inspecting the environment variables TMPDIR, TMP, and TEMP in that order. If none of those are defined "/tmp" is returned on UNIX and "C:\" on Windows. The encoding of the returned string is system-defined. On Windows, -it is always UTF-8. The return value is never NULL. +it is always UTF-8. The return value is never NULL or the empty string.

    @@ -839,9 +933,34 @@ The returned string should be freed when no longer needed.

    g_path_is_absolute ()

    gboolean            g_path_is_absolute                  (const gchar *file_name);

    -Returns TRUE if the given file_name is an absolute file name, -i.e. it contains a full path from the root directory such as "/usr/local" -on UNIX or "C:\windows" on Windows systems. +Returns TRUE if the given file_name is an absolute file name. +Note that this is a somewhat vague concept on Windows. +

    +

    +On POSIX systems, an absolute file name is well-defined. It always +starts from the single root directory. For example "/usr/local". +

    +

    +On Windows, the concepts of current drive and drive-specific +current directory introduce vagueness. This function interprets as +an absolute file name one that either begins with a directory +separator such as "\Users\tml" or begins with the root on a drive, +for example "C:\Windows". The first case also includes UNC paths +such as "\\myserver\docs\foo". In all cases, either slashes or +backslashes are accepted. +

    +

    +Note that a file name relative to the current drive root does not +truly specify a file uniquely over time and across processes, as +the current drive is a per-process value and can be changed. +

    +

    +File names relative the current directory on some specific drive, +such as "D:foo/bar", are not interpreted as absolute by this +function, but they obviously are not relative to the normal current +directory as returned by getcwd() or g_get_current_dir() +either. Such paths should be avoided, or need to be handled using +Windows-specific code.

    @@ -853,7 +972,7 @@ on UNIX or "C:\windows" on Windows systems. - @@ -1518,6 +1637,6 @@ Set the pointer at the specified location to
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-N-ary-Trees.html b/docs/reference/glib/html/glib-N-ary-Trees.html index c67d75d..bf37e99 100644 --- a/docs/reference/glib/html/glib-N-ary-Trees.html +++ b/docs/reference/glib/html/glib-N-ary-Trees.html @@ -3,12 +3,12 @@ N-ary Trees - + - + @@ -1137,7 +1137,8 @@ Gets the next sibling of a
    - @@ -1160,7 +1161,8 @@ Gets the previous sibling of a Returns :

    -
    @@ -1461,6 +1463,6 @@ with --disable-mem-pools + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Numerical-Definitions.html b/docs/reference/glib/html/glib-Numerical-Definitions.html index 42e28fe..0f9465f 100644 --- a/docs/reference/glib/html/glib-Numerical-Definitions.html +++ b/docs/reference/glib/html/glib-Numerical-Definitions.html @@ -3,12 +3,12 @@ Numerical Definitions - + - + @@ -65,10 +65,11 @@ versions always exist.

    The GFloatIEEE754 and GDoubleIEEE754 unions are used to access the - sign, mantissa and exponent of IEEE floats and doubles. These - unions are defined as appropriate for a given platform. - IEEE floats and doubles are supported (used for - storage) by at least Intel, PPC and Sparc, for reference: http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +sign, mantissa and exponent of IEEE floats and doubles. These unions are +defined as appropriate for a given platform. IEEE floats and doubles are +supported (used for storage) by at least Intel, PPC and Sparc. See +IEEE 754-2008 +for more information about IEEE number formats.

    @@ -78,7 +79,7 @@ The #define G_IEEE754_FLOAT_BIAS (127)

    -See http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The bias by which exponents in single-precision floats are offset.


    @@ -87,7 +88,7 @@ See #define G_IEEE754_DOUBLE_BIAS (1023)

    -See http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The bias by which exponents in double-precision floats are offset.


    @@ -95,12 +96,10 @@ See

    union GFloatIEEE754

    -The GFloatIEEE754 and GDoubleIEEE754 unions are used to access the - sign, mantissa and exponent of IEEE floats and doubles. These - unions are defined as appropriate for a given platform. - IEEE floats and doubles are supported (used for - storage) by at least Intel, PPC and Sparc, for reference: -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The GFloatIEEE754 and GDoubleIEEE754 unions are used to access the sign, +mantissa and exponent of IEEE floats and doubles. These unions are defined +as appropriate for a given platform. IEEE floats and doubles are supported +(used for storage) by at least Intel, PPC and Sparc.


    @@ -108,12 +107,10 @@ The

    union GDoubleIEEE754

    -The GFloatIEEE754 and GDoubleIEEE754 unions are used to access the - sign, mantissa and exponent of IEEE floats and doubles. These - unions are defined as appropriate for a given platform. - IEEE floats and doubles are supported (used for - storage) by at least Intel, PPC and Sparc, for reference: -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The GFloatIEEE754 and GDoubleIEEE754 unions are used to access the sign, +mantissa and exponent of IEEE floats and doubles. These unions are defined +as appropriate for a given platform. IEEE floats and doubles are supported +(used for storage) by at least Intel, PPC and Sparc.


    @@ -185,20 +182,13 @@ The square root of two.
    #define G_LOG_2_BASE_10		(0.30102999566398119521)
     

    -Used for fooling around with float formats, see -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +Multiplying the base 2 exponent by this number yields the base 10 exponent.

    - + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Perl-compatible-regular-expressions.html b/docs/reference/glib/html/glib-Perl-compatible-regular-expressions.html index f817c75..1bea4e1 100644 --- a/docs/reference/glib/html/glib-Perl-compatible-regular-expressions.html +++ b/docs/reference/glib/html/glib-Perl-compatible-regular-expressions.html @@ -3,12 +3,12 @@ Perl-compatible regular expressions - + - + @@ -59,6 +59,8 @@ const gintg_regex_get_capture_count (const GRegex *regex); gintg_regex_get_string_number (const GRegex *regex, const gchar *name); +GRegexCompileFlagsg_regex_get_compile_flags (const GRegex *regex); +GRegexMatchFlagsg_regex_get_match_flags (const GRegex *regex); gchar * g_regex_escape_string (const gchar *string, gint length); gbooleang_regex_match_simple (const gchar *pattern, @@ -161,58 +163,57 @@ expression pattern matching using syntax and semantics similar to Perl regular expression.

    -Some functions accept a start_position argument, -setting it differs from just passing over a shortened string and setting -G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind -of lookbehind assertion. +Some functions accept a start_position argument, setting it differs +from just passing over a shortened string and setting G_REGEX_MATCH_NOTBOL +in the case of a pattern that begins with any kind of lookbehind assertion. For example, consider the pattern "\Biss\B" which finds occurrences of "iss" in the middle of words. ("\B" matches only if the current position in the subject is not a word boundary.) When applied to the string "Mississipi" from the fourth byte, namely "issipi", it does not match, because "\B" is always false at the start of the subject, which is deemed to be a word boundary. However, if the entire string is passed , but with -start_position set to 4, it finds the second -occurrence of "iss" because it is able to look behind the starting point -to discover that it is preceded by a letter. +start_position set to 4, it finds the second occurrence of "iss" because +it is able to look behind the starting point to discover that it is +preceded by a letter.

    Note that, unless you set the G_REGEX_RAW flag, all the strings passed to these functions must be encoded in UTF-8. The lengths and the positions inside the strings are in bytes and not in characters, so, for instance, -"\xc3\xa0" (i.e. "à") is two bytes long but it is treated as a single -character. If you set G_REGEX_RAW the strings can be non-valid UTF-8 -strings and a byte is treated as a character, so "\xc3\xa0" is two bytes -and two characters long. +"\xc3\xa0" (i.e. "à") is two bytes long but it is treated as a +single character. If you set G_REGEX_RAW the strings can be non-valid +UTF-8 strings and a byte is treated as a character, so "\xc3\xa0" is two +bytes and two characters long.

    -When matching a pattern, "\n" matches only against a "\n" character in the -string, and "\r" matches only a "\r" character. To match any newline sequence -use "\R". This particular group matches either the two-character sequence -CR + LF ("\r\n"), or one of the single characters LF (linefeed, U+000A, "\n"), VT -(vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"), CR (carriage return, -U+000D, "\r"), NEL (next line, U+0085), LS (line separator, U+2028), or PS -(paragraph separator, U+2029). +When matching a pattern, "\n" matches only against a "\n" character in +the string, and "\r" matches only a "\r" character. To match any newline +sequence use "\R". This particular group matches either the two-character +sequence CR + LF ("\r\n"), or one of the single characters LF (linefeed, +U+000A, "\n"), VT vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"), +CR (carriage return, U+000D, "\r"), NEL (next line, U+0085), LS (line +separator, U+2028), or PS (paragraph separator, U+2029).

    -The behaviour of the dot, circumflex, and dollar metacharacters are affected by -newline characters, the default is to recognize any newline character (the same -characters recognized by "\R"). This can be changed with G_REGEX_NEWLINE_CR, -G_REGEX_NEWLINE_LF and G_REGEX_NEWLINE_CRLF compile options, -and with G_REGEX_MATCH_NEWLINE_ANY, G_REGEX_MATCH_NEWLINE_CR, -G_REGEX_MATCH_NEWLINE_LF and G_REGEX_MATCH_NEWLINE_CRLF match options. -These settings are also relevant when compiling a pattern if -G_REGEX_EXTENDED is set, and an unescaped "#" outside a character class is -encountered. This indicates a comment that lasts until after the next -newline. +The behaviour of the dot, circumflex, and dollar metacharacters are +affected by newline characters, the default is to recognize any newline +character (the same characters recognized by "\R"). This can be changed +with G_REGEX_NEWLINE_CR, G_REGEX_NEWLINE_LF and G_REGEX_NEWLINE_CRLF +compile options, and with G_REGEX_MATCH_NEWLINE_ANY, +G_REGEX_MATCH_NEWLINE_CR, G_REGEX_MATCH_NEWLINE_LF and +G_REGEX_MATCH_NEWLINE_CRLF match options. These settings are also +relevant when compiling a pattern if G_REGEX_EXTENDED is set, and an +unescaped "#" outside a character class is encountered. This indicates +a comment that lasts until after the next newline.

    Creating and manipulating the same GRegex structure from different threads is not a problem as GRegex does not modify its internal -state between creation and destruction, on the other hand GMatchInfo is -not threadsafe. +state between creation and destruction, on the other hand GMatchInfo +is not threadsafe.

    -The regular expressions low level functionalities are obtained through +The regular expressions low-level functionalities are obtained through the excellent PCRE library written by Philip Hazel.

    @@ -287,7 +288,8 @@ Error codes returned by regular expressions functions. - @@ -297,7 +299,8 @@ Error codes returned by regular expressions functions. - @@ -312,32 +315,38 @@ Error codes returned by regular expressions functions. - - - - - - @@ -347,32 +356,38 @@ Error codes returned by regular expressions functions. - - - - - - @@ -382,37 +397,44 @@ Error codes returned by regular expressions functions. - - - - - - - @@ -422,68 +444,80 @@ Error codes returned by regular expressions functions. - - - - - - - - - - - - - @@ -496,9 +530,11 @@ optionally braced non-zero number. Since 2.16
    #define G_REGEX_ERROR g_regex_error_quark ()
     

    -Error domain for regular expressions. Errors in this domain will be from the GRegexError enumeration. See GError for information on error domains. +Error domain for regular expressions. Errors in this domain will be +from the GRegexError enumeration. See GError for information on +error domains.

    -

    Since 2.14

    +

    Since


    @@ -529,111 +565,114 @@ Flags specifying compile-time options.
    - - @@ -665,69 +704,73 @@ Flags specifying match-time options. - - - - @@ -761,9 +804,9 @@ to match_info :

    -
    @@ -778,8 +821,8 @@ need the Returns :

    -
    @@ -794,7 +837,7 @@ need the GRegexMatchFlags match_options, GError **error);

    -Compiles the regular expression to an internal form, and does +Compiles the regular expression to an internal form, and does the initial setup of the GRegex structure.

    Returns :

    TRUE if file_name is an absolute path. + TRUE if file_name is absolute.

    Returns :

    the next sibling of node, or NULL if node is NULL + the next sibling of node, or NULL if node is the last node + or NULL
    the previous sibling of node, or NULL if node is NULL + the previous sibling of node, or NULL if node is the first + node or NULL

    G_REGEX_ERROR_REPLACE

    Replacement failed due to an ill-formed replacement string. +Replacement failed due to an ill-formed replacement + string.

    G_REGEX_ERROR_INTERNAL

    Internal error of the regular expression engine. Since 2.16 +Internal error of the regular expression engine. + Since 2.16

    G_REGEX_ERROR_UNRECOGNIZED_ESCAPE

    Unrecognized character follows "\\". Since 2.16 +Unrecognized character follows "\\". + Since 2.16

    G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER

    Numbers out of order in "{}" quantifier. Since 2.16 +Numbers out of order in "{}" + quantifier. Since 2.16

    G_REGEX_ERROR_QUANTIFIER_TOO_BIG

    Number too big in "{}" quantifier. Since 2.16 +Number too big in "{}" quantifier. + Since 2.16

    G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS

    Missing terminating "]" for character class. Since 2.16 +Missing terminating "]" for + character class. Since 2.16

    G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS

    Invalid escape sequence in character class. Since 2.16 +Invalid escape sequence + in character class. Since 2.16

    G_REGEX_ERROR_RANGE_OUT_OF_ORDER

    Range out of order in character class. Since 2.16 +Range out of order in character class. + Since 2.16

    G_REGEX_ERROR_UNRECOGNIZED_CHARACTER

    Unrecognized character after "(?", "(?<" or "(?P". Since 2.16 +Unrecognized character after "(?", + "(?<" or "(?P". Since 2.16

    G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS

    POSIX named classes are supported only within a class. Since 2.16 +POSIX named classes are + supported only within a class. Since 2.16

    G_REGEX_ERROR_UNMATCHED_PARENTHESIS

    Missing terminating ")" or ")" without opening "(". Since 2.16 +Missing terminating ")" or ")" + without opening "(". Since 2.16

    G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE

    Reference to non-existent subpattern. Since 2.16 +Reference to non-existent + subpattern. Since 2.16

    G_REGEX_ERROR_UNTERMINATED_COMMENT

    Missing terminating ")" after comment. Since 2.16 +Missing terminating ")" after comment. + Since 2.16

    G_REGEX_ERROR_EXPRESSION_TOO_LARGE

    Regular expression too large. Since 2.16 +Regular expression too large. + Since 2.16

    G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND

    Lookbehind assertion is not fixed length. Since 2.16 +Lookbehind assertion is not + fixed length. Since 2.16

    G_REGEX_ERROR_MALFORMED_CONDITION

    Malformed number or name after "(?(". Since 2.16 +Malformed number or name after "(?(". + Since 2.16

    G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES

    Conditional group contains more than two branches. Since 2.16 +Conditional group contains + more than two branches. Since 2.16

    G_REGEX_ERROR_ASSERTION_EXPECTED

    Assertion expected after "(?(". Since 2.16 +Assertion expected after "(?(". + Since 2.16

    G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME

    Unknown POSIX class name. Since 2.16 +Unknown POSIX class name. + Since 2.16

    G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED

    POSIX collating elements are not supported. Since 2.16 +POSIX collating + elements are not supported. Since 2.16

    G_REGEX_ERROR_HEX_CODE_TOO_LARGE

    Character value in "\\x{...}" sequence is too large. Since 2.16 +Character value in "\\x{...}" sequence + is too large. Since 2.16

    G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND

    \\C not allowed in lookbehind assertion. Since 2.16 +\\C not allowed in + lookbehind assertion. Since 2.16

    G_REGEX_ERROR_INFINITE_LOOP

    Recursive call could loop indefinitely. Since 2.16 +Recursive call could loop indefinitely. + Since 2.16

    G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR

    Missing terminator in subpattern name. Since 2.16 +Missing terminator + in subpattern name. Since 2.16

    G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME

    Two named subpatterns have the same name. Since 2.16 +Two named subpatterns have + the same name. Since 2.16

    G_REGEX_ERROR_MALFORMED_PROPERTY

    Malformed "\\P" or "\\p" sequence. Since 2.16 +Malformed "\\P" or "\\p" sequence. + Since 2.16

    G_REGEX_ERROR_UNKNOWN_PROPERTY

    Unknown property name after "\\P" or "\\p". Since 2.16 +Unknown property name after "\\P" or + "\\p". Since 2.16

    G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG

    Subpattern name is too long (maximum 32 characters). Since 2.16 +Subpattern name is too long + (maximum 32 characters). Since 2.16

    G_REGEX_ERROR_TOO_MANY_SUBPATTERNS

    Too many named subpatterns (maximum 10,000). Since 2.16 +Too many named subpatterns (maximum + 10,000). Since 2.16

    G_REGEX_ERROR_INVALID_OCTAL_VALUE

    Octal value is greater than "\\377". Since 2.16 +Octal value is greater than "\\377". + Since 2.16

    G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE

    "DEFINE" group contains more than one branch. Since 2.16 +"DEFINE" group contains more + than one branch. Since 2.16

    G_REGEX_ERROR_DEFINE_REPETION

    Repeating a "DEFINE" group is not allowed. Since 2.16 +Repeating a "DEFINE" group is not allowed. + Since 2.16

    G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS

    Inconsistent newline options. Since 2.16 +Inconsistent newline options. + Since 2.16

    G_REGEX_ERROR_MISSING_BACK_REFERENCE

    "\\g" is not followed by a braced name or an -optionally braced non-zero number. Since 2.16 +"\\g" is not followed by a braced + name or an optionally braced non-zero number. Since 2.16

    G_REGEX_CASELESS

    Letters in the pattern match both upper and lower case -letters. This option can be changed within a pattern by a "(?i)" option -setting. +Letters in the pattern match both upper- and + lowercase letters. This option can be changed within a pattern + by a "(?i)" option setting.

    G_REGEX_MULTILINE

    By default, GRegex treats the strings as consisting -of a single line of characters (even if it actually contains newlines). -The "start of line" metacharacter ("^") matches only at the start of the -string, while the "end of line" metacharacter ("$") matches only at the -end of the string, or before a terminating newline (unless -G_REGEX_DOLLAR_ENDONLY is set). When G_REGEX_MULTILINE is set, -the "start of line" and "end of line" constructs match immediately following -or immediately before any newline in the string, respectively, as well -as at the very start and end. This can be changed within a pattern by a -"(?m)" option setting. + of a single line of characters (even if it actually contains + newlines). The "start of line" metacharacter ("^") matches only + at the start of the string, while the "end of line" metacharacter + ("$") matches only at the end of the string, or before a terminating + newline (unless G_REGEX_DOLLAR_ENDONLY is set). When + G_REGEX_MULTILINE is set, the "start of line" and "end of line" + constructs match immediately following or immediately before any + newline in the string, respectively, as well as at the very start + and end. This can be changed within a pattern by a "(?m)" option + setting.

    G_REGEX_DOTALL

    A dot metacharater (".") in the pattern matches all -characters, including newlines. Without it, newlines are excluded. This -option can be changed within a pattern by a ("?s") option setting. + characters, including newlines. Without it, newlines are excluded. + This option can be changed within a pattern by a ("?s") option setting.

    G_REGEX_EXTENDED

    Whitespace data characters in the pattern are -totally ignored except when escaped or inside a character class. -Whitespace does not include the VT character (code 11). In addition, -characters between an unescaped "#" outside a character class and -the next newline character, inclusive, are also ignored. This can be -changed within a pattern by a "(?x)" option setting. + totally ignored except when escaped or inside a character class. + Whitespace does not include the VT character (code 11). In addition, + characters between an unescaped "#" outside a character class and + the next newline character, inclusive, are also ignored. This can + be changed within a pattern by a "(?x)" option setting.

    G_REGEX_ANCHORED

    The pattern is forced to be "anchored", that is, -it is constrained to match only at the first matching point in the string -that is being searched. This effect can also be achieved by appropriate -constructs in the pattern itself such as the "^" metacharater. + it is constrained to match only at the first matching point in the + string that is being searched. This effect can also be achieved by + appropriate constructs in the pattern itself such as the "^" + metacharater.

    G_REGEX_DOLLAR_ENDONLY

    A dollar metacharacter ("$") in the pattern -matches only at the end of the string. Without this option, a dollar also -matches immediately before the final character if it is a newline (but -not before any other newlines). This option is ignored if -G_REGEX_MULTILINE is set. + matches only at the end of the string. Without this option, a + dollar also matches immediately before the final character if + it is a newline (but not before any other newlines). This option + is ignored if G_REGEX_MULTILINE is set.

    G_REGEX_UNGREEDY

    Inverts the "greediness" of the -quantifiers so that they are not greedy by default, but become greedy -if followed by "?". It can also be set by a "(?U)" option setting within -the pattern. +Inverts the "greediness" of the quantifiers so that + they are not greedy by default, but become greedy if followed by "?". + It can also be set by a "(?U)" option setting within the pattern.

    G_REGEX_RAW

    Usually strings must be valid UTF-8 strings, using this -flag they are considered as a raw sequence of bytes. + flag they are considered as a raw sequence of bytes.

    G_REGEX_NO_AUTO_CAPTURE

    Disables the use of numbered capturing -parentheses in the pattern. Any opening parenthesis that is not followed -by "?" behaves as if it were followed by "?:" but named parentheses can -still be used for capturing (and they acquire numbers in the usual way). + parentheses in the pattern. Any opening parenthesis that is not + followed by "?" behaves as if it were followed by "?:" but named + parentheses can still be used for capturing (and they acquire numbers + in the usual way).

    G_REGEX_OPTIMIZE

    Optimize the regular expression. If the pattern will -be used many times, then it may be worth the effort to optimize it to -improve the speed of matches. + be used many times, then it may be worth the effort to optimize it + to improve the speed of matches.

    G_REGEX_DUPNAMES

    Names used to identify capturing subpatterns need not -be unique. This can be helpful for certain types of pattern when it is known -that only one instance of the named subpattern can ever be matched. + be unique. This can be helpful for certain types of pattern when it + is known that only one instance of the named subpattern can ever be + matched.

    G_REGEX_NEWLINE_CR

    Usually any newline character is recognized, if this -option is set, the only recognized newline character is '\r'. + option is set, the only recognized newline character is '\r'.

    G_REGEX_NEWLINE_LF

    Usually any newline character is recognized, if this -option is set, the only recognized newline character is '\n'. + option is set, the only recognized newline character is '\n'.

    G_REGEX_NEWLINE_CRLF

    Usually any newline character is recognized, if this -option is set, the only recognized newline character sequence is '\r\n'. + option is set, the only recognized newline character sequence is '\r\n'.

    G_REGEX_MATCH_ANCHORED

    The pattern is forced to be "anchored", that is, -it is constrained to match only at the first matching point in the string -that is being searched. This effect can also be achieved by appropriate -constructs in the pattern itself such as the "^" metacharater. + it is constrained to match only at the first matching point in the + string that is being searched. This effect can also be achieved by + appropriate constructs in the pattern itself such as the "^" + metacharater.

    G_REGEX_MATCH_NOTBOL

    Specifies that first character of the string is -not the beginning of a line, so the circumflex metacharacter should not -match before it. Setting this without G_REGEX_MULTILINE (at compile time) -causes circumflex never to match. This option affects only the behaviour of -the circumflex metacharacter, it does not affect "\A". + not the beginning of a line, so the circumflex metacharacter should + not match before it. Setting this without G_REGEX_MULTILINE (at + compile time) causes circumflex never to match. This option affects + only the behaviour of the circumflex metacharacter, it does not + affect "\A".

    G_REGEX_MATCH_NOTEOL

    Specifies that the end of the subject string is -not the end of a line, so the dollar metacharacter should not match it nor -(except in multiline mode) a newline immediately before it. Setting this -without G_REGEX_MULTILINE (at compile time) causes dollar never to match. -This option affects only the behaviour of the dollar metacharacter, it does -not affect "\Z" or "\z". + not the end of a line, so the dollar metacharacter should not match + it nor (except in multiline mode) a newline immediately before it. + Setting this without G_REGEX_MULTILINE (at compile time) causes + dollar never to match. This option affects only the behaviour of + the dollar metacharacter, it does not affect "\Z" or "\z".

    G_REGEX_MATCH_NOTEMPTY

    An empty string is not considered to be a valid -match if this option is set. If there are alternatives in the pattern, they -are tried. If all the alternatives match the empty string, the entire match -fails. For example, if the pattern "a?b?" is applied to a string not beginning -with "a" or "b", it matches the empty string at the start of the string. -With this flag set, this match is not valid, so GRegex searches further -into the string for occurrences of "a" or "b". + match if this option is set. If there are alternatives in the pattern, + they are tried. If all the alternatives match the empty string, the + entire match fails. For example, if the pattern "a?b?" is applied to + a string not beginning with "a" or "b", it matches the empty string + at the start of the string. With this flag set, this match is not + valid, so GRegex searches further into the string for occurrences + of "a" or "b".

    G_REGEX_MATCH_PARTIAL

    Turns on the partial matching feature, for more -documentation on partial matching see g_match_info_is_partial_match(). + documentation on partial matching see g_match_info_is_partial_match().

    G_REGEX_MATCH_NEWLINE_CR

    Overrides the newline definition set when creating -a new GRegex, setting the '\r' character as line terminator. +Overrides the newline definition set when + creating a new GRegex, setting the '\r' character as line terminator.

    G_REGEX_MATCH_NEWLINE_LF

    Overrides the newline definition set when creating -a new GRegex, setting the '\n' character as line terminator. +Overrides the newline definition set when + creating a new GRegex, setting the '\n' character as line terminator.

    G_REGEX_MATCH_NEWLINE_CRLF

    Overrides the newline definition set when creating -a new GRegex, setting the '\r\n' characters as line terminator. +Overrides the newline definition set when + creating a new GRegex, setting the '\r\n' characters as line terminator.

    G_REGEX_MATCH_NEWLINE_ANY

    Overrides the newline definition set when creating -a new GRegex, any newline character or character sequence is recognized. +Overrides the newline definition set when + creating a new GRegex, any newline character or character sequence + is recognized.
    the GMatchInfo generated by the match. -Use g_match_info_get_regex() and g_match_info_get_string() if you -need the GRegex or the matched string. +the GMatchInfo generated by the match. + Use g_match_info_get_regex() and g_match_info_get_string() if you + need the GRegex or the matched string.
    -FALSE to continue the replacement process, TRUE to stop it + FALSE to continue the replacement process, TRUE to stop it +
    @@ -807,7 +850,7 @@ the initial setup of the compile_options :

    -
    @@ -822,7 +865,7 @@ the initial setup of the Returns :

    -
    @@ -879,7 +922,7 @@ to zero, it frees all the memory associated with the regex structure.

    g_regex_get_pattern ()

    const gchar *       g_regex_get_pattern                 (const GRegex *regex);

    -Gets the pattern string associated with regex, i.e. a copy of +Gets the pattern string associated with regex, i.e. a copy of the string passed to g_regex_new().

    compile options for the regular expression, or 0 +compile options for the regular expression, or 0
    a GRegex structure. Call g_regex_unref() when you + a GRegex structure. Call g_regex_unref() when you are done with it
    @@ -976,7 +1019,7 @@ Retrieves the number of the subexpression named name - @@ -986,18 +1029,68 @@ Retrieves the number of the subexpression named name

    Since 2.14


    +
    +

    g_regex_get_compile_flags ()

    +
    GRegexCompileFlags  g_regex_get_compile_flags           (const GRegex *regex);
    +

    +Returns the compile options that regex was created with. +

    +

    Returns :

    The number of the subexpression or -1 if name + The number of the subexpression or -1 if name does not exists
    ++ + + + + + + + + + +

    regex :

    a GRegex +

    Returns :

    flags from GRegexCompileFlags + +
    +

    Since 2.26

    +
    +
    +
    +

    g_regex_get_match_flags ()

    +
    GRegexMatchFlags    g_regex_get_match_flags             (const GRegex *regex);
    +

    +Returns the match options that regex was created with. +

    +
    ++ + + + + + + + + + +

    regex :

    a GRegex +

    Returns :

    flags from GRegexMatchFlags + +
    +

    Since 2.26

    +
    +

    g_regex_escape_string ()

    gchar *             g_regex_escape_string               (const gchar *string,
                                                              gint length);

    -Escapes the special characters used for regular expressions -in string, for instance "a.b*c" becomes "a\.b\*c". This +Escapes the special characters used for regular expressions +in string, for instance "a.b*c" becomes "a\.b\*c". This function is useful to dynamically generate regular expressions.

    -string can contain nul characters that are replaced with "\0", -in this case remember to specify the correct length of string +string can contain nul characters that are replaced with "\0", +in this case remember to specify the correct length of string in length.

    @@ -1005,7 +1098,7 @@ in length. - @@ -1085,19 +1178,19 @@ once, it's more efficient to compile the pattern once with GRegexMatchFlags match_options, GMatchInfo **match_info);

    -Scans for a match in string for the pattern in regex. -The match_options are combined with the match options specified -when the regex structure was created, letting you have more +Scans for a match in string for the pattern in regex. +The match_options are combined with the match options specified +when the regex structure was created, letting you have more flexibility in reusing GRegex structures.

    -A GMatchInfo structure, used to get information on the match, -is stored in match_info if not NULL. Note that if match_info -is not NULL then it is created even if the function returns FALSE, +A GMatchInfo structure, used to get information on the match, +is stored in match_info if not NULL. Note that if match_info +is not NULL then it is created even if the function returns FALSE, i.e. you must free it regardless if regular expression actually matched.

    -To retrieve all the non-overlapping matches of the pattern in +To retrieve all the non-overlapping matches of the pattern in string you can use g_match_info_next().

    @@ -1152,8 +1245,8 @@ string you can use string is not copied and is used in GMatchInfo internally. If -you use any GMatchInfo method (except g_match_info_free()) after +string is not copied and is used in GMatchInfo internally. If +you use any GMatchInfo method (except g_match_info_free()) after freeing or modifying string then the behaviour is undefined.

    string :

    the string to escape + the string to escape. [array length=length]
    @@ -1176,8 +1269,8 @@ freeing or modifying string then the beh - @@ -1201,30 +1294,30 @@ freeing or modifying string then the beh GMatchInfo **match_info, GError **error);

    -Scans for a match in string for the pattern in regex. -The match_options are combined with the match options specified -when the regex structure was created, letting you have more +Scans for a match in string for the pattern in regex. +The match_options are combined with the match options specified +when the regex structure was created, letting you have more flexibility in reusing GRegex structures.

    -Setting start_position differs from just passing over a shortened -string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern +Setting start_position differs from just passing over a shortened +string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

    -A GMatchInfo structure, used to get information on the match, is -stored in match_info if not NULL. Note that if match_info is -not NULL then it is created even if the function returns FALSE, -i.e. you must free it regardless if regular expression actually +A GMatchInfo structure, used to get information on the match, is +stored in match_info if not NULL. Note that if match_info is +not NULL then it is created even if the function returns FALSE, +i.e. you must free it regardless if regular expression actually matched.

    -string is not copied and is used in GMatchInfo internally. If -you use any GMatchInfo method (except g_match_info_free()) after +string is not copied and is used in GMatchInfo internally. If +you use any GMatchInfo method (except g_match_info_free()) after freeing or modifying string then the behaviour is undefined.

    -To retrieve all the non-overlapping matches of the pattern in +To retrieve all the non-overlapping matches of the pattern in string you can use g_match_info_next().

    @@ -1300,7 +1393,7 @@ string you can use string :

    - @@ -1320,8 +1413,8 @@ string you can use match_info :

    -
    @@ -1347,21 +1440,21 @@ string you can use GRegexMatchFlags match_options, GMatchInfo **match_info);

    -Using the standard algorithm for regular expression matching only -the longest match in the string is retrieved. This function uses +Using the standard algorithm for regular expression matching only +the longest match in the string is retrieved. This function uses a different algorithm so it can retrieve all the possible matches. For more documentation see g_regex_match_all_full().

    -A GMatchInfo structure, used to get information on the match, is -stored in match_info if not NULL. Note that if match_info is -not NULL then it is created even if the function returns FALSE, -i.e. you must free it regardless if regular expression actually +A GMatchInfo structure, used to get information on the match, is +stored in match_info if not NULL. Note that if match_info is +not NULL then it is created even if the function returns FALSE, +i.e. you must free it regardless if regular expression actually matched.

    -string is not copied and is used in GMatchInfo internally. If -you use any GMatchInfo method (except g_match_info_free()) after +string is not copied and is used in GMatchInfo internally. If +you use any GMatchInfo method (except g_match_info_free()) after freeing or modifying string then the behaviour is undefined.

    match_info :

    pointer to location where to store the GMatchInfo, - or NULL if you do not need it + pointer to location where to store + the GMatchInfo, or NULL if you do not need it. [out][allow-none]
    the string to scan for matches + the string to scan for matches. [array length=string_len]
    pointer to location where to store the GMatchInfo, - or NULL if you do not need it + pointer to location where to store + the GMatchInfo, or NULL if you do not need it. [out][allow-none]
    @@ -1384,8 +1477,8 @@ freeing or modifying string then the beh - @@ -1409,47 +1502,47 @@ freeing or modifying string then the beh GMatchInfo **match_info, GError **error);

    -Using the standard algorithm for regular expression matching only -the longest match in the string is retrieved, it is not possibile +Using the standard algorithm for regular expression matching only +the longest match in the string is retrieved, it is not possibile to obtain all the available matches. For instance matching -"<a> <b> <c>" against the pattern "<.*>" +"<a> <b> <c>" against the pattern "<.*>" you get "<a> <b> <c>".

    This function uses a different algorithm (called DFA, i.e. deterministic finite automaton), so it can retrieve all the possible matches, all starting at the same point in the string. For instance matching -"<a> <b> <c>" against the pattern "<.*>" +"<a> <b> <c>" against the pattern "<.*>" you would obtain three matches: "<a> <b> <c>", "<a> <b>" and "<a>".

    The number of matched strings is retrieved using -g_match_info_get_match_count(). To obtain the matched strings and -their position you can use, respectively, g_match_info_fetch() and -g_match_info_fetch_pos(). Note that the strings are returned in -reverse order of length; that is, the longest matching string is +g_match_info_get_match_count(). To obtain the matched strings and +their position you can use, respectively, g_match_info_fetch() and +g_match_info_fetch_pos(). Note that the strings are returned in +reverse order of length; that is, the longest matching string is given first.

    -Note that the DFA algorithm is slower than the standard one and it +Note that the DFA algorithm is slower than the standard one and it is not able to capture substrings, so backreferences do not work.

    -Setting start_position differs from just passing over a shortened -string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern +Setting start_position differs from just passing over a shortened +string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

    -A GMatchInfo structure, used to get information on the match, is -stored in match_info if not NULL. Note that if match_info is -not NULL then it is created even if the function returns FALSE, -i.e. you must free it regardless if regular expression actually +A GMatchInfo structure, used to get information on the match, is +stored in match_info if not NULL. Note that if match_info is +not NULL then it is created even if the function returns FALSE, +i.e. you must free it regardless if regular expression actually matched.

    -string is not copied and is used in GMatchInfo internally. If -you use any GMatchInfo method (except g_match_info_free()) after +string is not copied and is used in GMatchInfo internally. If +you use any GMatchInfo method (except g_match_info_free()) after freeing or modifying string then the behaviour is undefined.

    match_info :

    pointer to location where to store the GMatchInfo, - or NULL if you do not need it + pointer to location where to store + the GMatchInfo, or NULL if you do not need it. [out][allow-none]
    @@ -1462,7 +1555,7 @@ freeing or modifying string then the beh - @@ -1482,8 +1575,8 @@ freeing or modifying string then the beh - @@ -1509,16 +1602,16 @@ freeing or modifying string then the beh GRegexCompileFlags compile_options, GRegexMatchFlags match_options);

    -Breaks the string on the pattern, and returns an array of -the tokens. If the pattern contains capturing parentheses, -then the text for each of the substrings will also be returned. -If the pattern does not match anywhere in the string, then the +Breaks the string on the pattern, and returns an array of +the tokens. If the pattern contains capturing parentheses, +then the text for each of the substrings will also be returned. +If the pattern does not match anywhere in the string, then the whole string is returned as the first token.

    -This function is equivalent to g_regex_split() but it does -not require to compile the pattern with g_regex_new(), avoiding -some lines of code when you need just to do a split without +This function is equivalent to g_regex_split() but it does +not require to compile the pattern with g_regex_new(), avoiding +some lines of code when you need just to do a split without extracting substrings, capture counts, and so on.

    @@ -1527,18 +1620,18 @@ once, it's more efficient to compile the pattern once with g_regex_new() and then use g_regex_split().

    -As a special case, the result of splitting the empty string "" -is an empty vector, not a vector containing a single string. -The reason for this special case is that being able to represent -a empty vector is typically more useful than consistent handling -of empty elements. If you do need to represent empty elements, -you'll need to check for the empty string before calling this +As a special case, the result of splitting the empty string "" +is an empty vector, not a vector containing a single string. +The reason for this special case is that being able to represent +a empty vector is typically more useful than consistent handling +of empty elements. If you do need to represent empty elements, +you'll need to check for the empty string before calling this function.

    -A pattern that can match empty strings splits string into -separate characters wherever it matches the empty string between -characters. For example splitting "ab c" using as a separator +A pattern that can match empty strings splits string into +separate characters wherever it matches the empty string between +characters. For example splitting "ab c" using as a separator "\s*", you will get "a", "b" and "c".

    string :

    the string to scan for matches + the string to scan for matches. [array length=string_len]

    match_info :

    pointer to location where to store the GMatchInfo, - or NULL if you do not need it + pointer to location where to store + the GMatchInfo, or NULL if you do not need it. [out][allow-none]
    @@ -1661,8 +1754,8 @@ For example splitting "ab c" using as a separator "\s*", you will get "a", "b" and "c".

    -Setting start_position differs from just passing over a shortened -string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern +Setting start_position differs from just passing over a shortened +string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

    @@ -1675,7 +1768,7 @@ that begins with any kind of lookbehind assertion, such as "\b". - @@ -1695,7 +1788,7 @@ that begins with any kind of lookbehind assertion, such as "\b". - @@ -1726,11 +1819,11 @@ that begins with any kind of lookbehind assertion, such as "\b". GError **error);

    Replaces all occurrences of the pattern in regex with the -replacement text. Backreferences of the form '\number' or -'\g<number>' in the replacement text are interpolated by the -number-th captured subexpression of the match, '\g<name>' refers -to the captured subexpression with the given name. '\0' refers to the -complete match, but '\0' followed by a number is the octal representation +replacement text. Backreferences of the form '\number' or +'\g<number>' in the replacement text are interpolated by the +number-th captured subexpression of the match, '\g<name>' refers +to the captured subexpression with the given name. '\0' refers to the +complete match, but '\0' followed by a number is the octal representation of a character. To include a literal '\' in the replacement, write '\\'. There are also escapes that changes the case of the following text:

    @@ -1772,8 +1865,8 @@ passed to g_regex_replace_literal().

    -Setting start_position differs from just passing over a shortened -string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that +Setting start_position differs from just passing over a shortened +string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

    string :

    the string to split with the pattern + the string to split with the pattern. [array length=string_len]

    max_tokens :

    the maximum number of tokens to split string into. +the maximum number of tokens to split string into. If this is less than 1, the string is split completely
    @@ -1786,7 +1879,7 @@ begins with any kind of lookbehind assertion, such as "\b". - @@ -1840,9 +1933,9 @@ replacement text. replacement is replace include backreferences use g_regex_replace().

    -Setting start_position differs from just passing over a -shortened string and setting G_REGEX_MATCH_NOTBOL in the -case of a pattern that begins with any kind of lookbehind +Setting start_position differs from just passing over a +shortened string and setting G_REGEX_MATCH_NOTBOL in the +case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

    string :

    the string to perform matches against + the string to perform matches against. [array length=string_len]
    @@ -1855,7 +1948,7 @@ assertion, such as "\b". - @@ -1905,12 +1998,12 @@ assertion, such as "\b". gpointer user_data, GError **error);

    -Replaces occurrences of the pattern in regex with the output of +Replaces occurrences of the pattern in regex with the output of eval for that occurrence.

    -Setting start_position differs from just passing over a shortened -string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern +Setting start_position differs from just passing over a shortened +string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

    @@ -1955,8 +2048,8 @@ strings at once: 32 33 34 -

    - @@ -2056,15 +2149,15 @@ strings at once: gboolean *has_references, GError **error);

    -Checks whether replacement is a valid replacement string -(see g_regex_replace()), i.e. that all escape sequences in +Checks whether replacement is a valid replacement string +(see g_regex_replace()), i.e. that all escape sequences in it are valid.

    -If has_references is not NULL then replacement is checked +If has_references is not NULL then replacement is checked for pattern references. For instance, replacement text 'foo\n' does not contain references and may be evaluated without information -about actual match, but '\0\1' (whole match followed by first +about actual match, but '\0\1' (whole match followed by first subpattern) requires valid GMatchInfo object.

    string :

    the string to perform matches against + the string to perform matches against. [array length=string_len]
    static gboolean 
    -eval_cb (const GMatchInfo *info,          
    +        
    static gboolean
    +eval_cb (const GMatchInfo *info,
              GString          *res,
              gpointer          data)
     {
    @@ -2006,7 +2099,7 @@ strings at once:
     

    string :

    string to perform matches against + string to perform matches against. [array length=string_len]
    @@ -2077,8 +2170,8 @@ subpattern) requires valid has_references :

    -
    @@ -2195,7 +2288,7 @@ Returns whether the previous match operation succeeded. - @@ -2246,12 +2339,12 @@ cannot free it before calling this function.

    g_match_info_get_match_count ()

    gint                g_match_info_get_match_count        (const GMatchInfo *match_info);

    -Retrieves the number of matched substrings (including substring 0, -that is the whole matched text), so 1 is returned if the pattern +Retrieves the number of matched substrings (including substring 0, +that is the whole matched text), so 1 is returned if the pattern has no substrings in it and 0 is returned if the match failed.

    -If the last match was obtained using the DFA algorithm, that is +If the last match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved count is not that of the number of capturing parentheses but that of the number of matched substrings. @@ -2305,15 +2398,15 @@ return

    -Because of the way certain internal optimizations are implemented -the partial matching algorithm cannot be used with all patterns. -So repeated single characters such as "a{2,4}" and repeated single -meta-sequences such as "\d+" are not permitted if the maximum number -of occurrences is greater than one. Optional items such as "\d?" -(where the maximum is one) are permitted. Quantifiers with any values -are permitted after parentheses, so the invalid examples above can be -coded thus "(a){2,4}" and "(\d)+". If G_REGEX_MATCH_PARTIAL is set -for a pattern that does not conform to the restrictions, matching +Because of the way certain internal optimizations are implemented +the partial matching algorithm cannot be used with all patterns. +So repeated single characters such as "a{2,4}" and repeated single +meta-sequences such as "\d+" are not permitted if the maximum number +of occurrences is greater than one. Optional items such as "\d?" +(where the maximum is one) are permitted. Quantifiers with any values +are permitted after parentheses, so the invalid examples above can be +coded thus "(a){2,4}" and "(\d)+". If G_REGEX_MATCH_PARTIAL is set +for a pattern that does not conform to the restrictions, matching functions return an error.

    location to store information about - references in replacement or NULL + location to store information about + references in replacement or NULL. [out][allow-none]

    Returns :

    TRUE if the previous match operation succeeded, + TRUE if the previous match operation succeeded, FALSE otherwise
    @@ -2382,8 +2475,7 @@ contains references. - @@ -2396,20 +2488,20 @@ contains references.
    gchar *             g_match_info_fetch                  (const GMatchInfo *match_info,
                                                              gint match_num);

    -Retrieves the text matching the match_num'th capturing -parentheses. 0 is the full text of the match, 1 is the first paren +Retrieves the text matching the match_num'th capturing +parentheses. 0 is the full text of the match, 1 is the first paren set, 2 the second, and so on.

    -If match_num is a valid sub pattern but it didn't match anything -(e.g. sub pattern 1, matching "b" against "(a)?b") then an empty +If match_num is a valid sub pattern but it didn't match anything +(e.g. sub pattern 1, matching "b" against "(a)?b") then an empty string is returned.

    If the match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved string is not that of a set of parentheses but that of a matched -substring. Substrings are matched in reverse order of length, so +substring. Substrings are matched in reverse order of length, so 0 is the longest match.

    @@ -2432,9 +2524,8 @@ so you cannot call this function after freeing the string.

    - @@ -2449,20 +2540,20 @@ so you cannot call this function after freeing the string. gint *start_pos, gint *end_pos);

    -Retrieves the position in bytes of the match_num'th capturing -parentheses. 0 is the full text of the match, 1 is the first +Retrieves the position in bytes of the match_num'th capturing +parentheses. 0 is the full text of the match, 1 is the first paren set, 2 the second, and so on.

    -If match_num is a valid sub pattern but it didn't match anything -(e.g. sub pattern 1, matching "b" against "(a)?b") then start_pos +If match_num is a valid sub pattern but it didn't match anything +(e.g. sub pattern 1, matching "b" against "(a)?b") then start_pos and end_pos are set to -1 and TRUE is returned.

    If the match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved position is not that of a set of parentheses but that of a matched -substring. Substrings are matched in reverse order of length, so +substring. Substrings are matched in reverse order of length, so 0 is the longest match.

    Returns :

    the expanded string, or NULL if an error occurred - + the expanded string, or NULL if an error occurred. [allow-none]

    Returns :

    The matched substring, or NULL if an error occurred. - You have to free the string yourself - + The matched substring, or NULL if an error + occurred. You have to free the string yourself. [allow-none]
    @@ -2481,18 +2572,20 @@ substring. Substrings are matched in reverse order of length, so - - - @@ -2510,8 +2603,8 @@ substring. Substrings are matched in reverse order of length, so Retrieves the text matching the capturing parentheses named name.

    -If name is a valid sub pattern name but it didn't match anything -(e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") +If name is a valid sub pattern name but it didn't match anything +(e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") then an empty string is returned.

    @@ -2534,9 +2627,8 @@ so you cannot call this function after freeing the string.

    - @@ -2554,8 +2646,8 @@ so you cannot call this function after freeing the string. Retrieves the position in bytes of the capturing parentheses named name.

    -If name is a valid sub pattern name but it didn't match anything -(e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") +If name is a valid sub pattern name but it didn't match anything +(e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") then start_pos and end_pos are set to -1 and TRUE is returned.

    start_pos :

    pointer to location where to store the start position + pointer to location where to store + the start position, or NULL. [out][allow-none]

    end_pos :

    pointer to location where to store the end position + pointer to location where to store + the end position, or NULL. [out][allow-none]

    Returns :

    TRUE if the position was fetched, FALSE otherwise. If - the position cannot be fetched, start_pos and end_pos are left + TRUE if the position was fetched, FALSE otherwise. If + the position cannot be fetched, start_pos and end_pos are left unchanged

    Returns :

    The matched substring, or NULL if an error occurred. - You have to free the string yourself - + The matched substring, or NULL if an error + occurred. You have to free the string yourself. [allow-none]
    @@ -2574,19 +2666,21 @@ then start_pos and - - - @@ -2629,10 +2723,9 @@ so you cannot call this function after freeing the string. - @@ -2640,9 +2733,13 @@ so you cannot call this function after freeing the string.

    Since 2.14

    + + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Pointer-Arrays.html b/docs/reference/glib/html/glib-Pointer-Arrays.html index f6e725a..67d0782 100644 --- a/docs/reference/glib/html/glib-Pointer-Arrays.html +++ b/docs/reference/glib/html/glib-Pointer-Arrays.html @@ -3,12 +3,12 @@ Pointer Arrays - + - + @@ -118,7 +118,7 @@ To free a pointer array, use -

    Example 21. Using a GPtrArray

    +

    Example 21. Using a GPtrArray

    start_pos :

    pointer to location where to store the start position + pointer to location where to store + the start position, or NULL. [out][allow-none]

    end_pos :

    pointer to location where to store the end position + pointer to location where to store + the end position, or NULL. [out][allow-none]

    Returns :

    TRUE if the position was fetched, FALSE otherwise. If - the position cannot be fetched, start_pos and end_pos are left - unchanged + TRUE if the position was fetched, FALSE otherwise. + If the position cannot be fetched, start_pos and end_pos + are left unchanged.

    Returns :

    a NULL-terminated array of gchar * pointers. It must be - freed using g_strfreev(). If the previous match failed NULL is - returned - + a NULL-terminated array of gchar * pointers. + It must be freed using g_strfreev(). If the previous match failed + NULL is returned. [allow-none]
    @@ -747,6 +747,6 @@ Calls a function for each element of a
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Quarks.html b/docs/reference/glib/html/glib-Quarks.html index d79724a..7e44729 100644 --- a/docs/reference/glib/html/glib-Quarks.html +++ b/docs/reference/glib/html/glib-Quarks.html @@ -3,12 +3,12 @@ Quarks - + - + @@ -264,6 +264,6 @@ not be freed or modified. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Random-Numbers.html b/docs/reference/glib/html/glib-Random-Numbers.html index 685bdc8..d70f320 100644 --- a/docs/reference/glib/html/glib-Random-Numbers.html +++ b/docs/reference/glib/html/glib-Random-Numbers.html @@ -3,18 +3,18 @@ Random Numbers - + - + - +
    - + @@ -78,8 +78,8 @@ The following functions allow you to use a portable, fast and good pseudo-random number generator (PRNG). It uses the Mersenne Twister PRNG, which was originally developed by Makoto Matsumoto and Takuji Nishimura. Further information can be found at - -www.math.keio.ac.jp/~matumoto/emt.html. + +http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html.

    If you just need a random number, you simply call the @@ -573,6 +573,6 @@ Returns a random


    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Relations-and-Tuples.html b/docs/reference/glib/html/glib-Relations-and-Tuples.html index 1e676c3..fa6756b 100644 --- a/docs/reference/glib/html/glib-Relations-and-Tuples.html +++ b/docs/reference/glib/html/glib-Relations-and-Tuples.html @@ -3,12 +3,12 @@ Relations and Tuples - + - + @@ -120,6 +120,11 @@ To destroy the To help debug GRelation objects, use g_relation_print().

    +

    +GRelation has been marked as deprecated, since this API has never +been fully implemented, is not very actively maintained and rarely +used. +

    Details

    @@ -136,6 +141,10 @@ only be accessed via the following functions.

    g_relation_new ()

    GRelation*          g_relation_new                      (gint fields);
    +
    +

    Warning

    +

    g_relation_new has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Creates a new GRelation with the given number of fields. Note that currently the number of fields must be 2. @@ -163,6 +172,10 @@ currently the number of fields must be 2. gint field, GHashFunc hash_func, GEqualFunc key_equal_func); +

    +

    Warning

    +

    g_relation_index has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Creates an index on the given field. Note that this must be called before any records are added to the GRelation. @@ -198,6 +211,10 @@ before any records are added to the

    g_relation_insert ()

    void                g_relation_insert                   (GRelation *relation,
                                                              ...);
    +
    +

    Warning

    +

    g_relation_insert has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Inserts a record into a GRelation.

    @@ -224,6 +241,10 @@ Inserts a record into a

    g_relation_exists ()

    gboolean            g_relation_exists                   (GRelation *relation,
                                                              ...);
    +
    +

    Warning

    +

    g_relation_exists has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Returns TRUE if a record with the given values exists in a GRelation. Note that the values are compared directly, so that, for @@ -258,6 +279,10 @@ example, two copies of the same string will not match.

    gint                g_relation_count                    (GRelation *relation,
                                                              gconstpointer key,
                                                              gint field);
    +
    +

    Warning

    +

    g_relation_count has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Returns the number of tuples in a GRelation that have the given value in the given field. @@ -294,6 +319,10 @@ value in the given field.

    GTuples*            g_relation_select                   (GRelation *relation,
                                                              gconstpointer key,
                                                              gint field);
    +
    +

    Warning

    +

    g_relation_select has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Returns all of the tuples which have the given key in the given field. Use g_tuples_index() to access the returned records. The @@ -331,6 +360,10 @@ returned records should be freed with gint g_relation_delete (GRelation *relation, gconstpointer key, gint field); +

    +

    Warning

    +

    g_relation_delete has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Deletes any records from a GRelation that have the given key value in the given field. @@ -365,6 +398,10 @@ in the given field.

    g_relation_destroy ()

    void                g_relation_destroy                  (GRelation *relation);
    +
    +

    Warning

    +

    g_relation_destroy has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Destroys the GRelation, freeing all memory allocated. However, it does not free memory allocated for the tuple data, so you should @@ -383,6 +420,10 @@ free that first if appropriate.

    g_relation_print ()

    void                g_relation_print                    (GRelation *relation);
    +
    +

    Warning

    +

    g_relation_print has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Outputs information about all records in a GRelation, as well as the indexes. It is for debugging. @@ -422,6 +463,10 @@ records, you must use

    g_tuples_destroy ()

    void                g_tuples_destroy                    (GTuples *tuples);
    +
    +

    Warning

    +

    g_tuples_destroy has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Frees the records which were returned by g_relation_select(). This should always be called after g_relation_select() when you are @@ -443,6 +488,10 @@ finished with the records. The records are not removed from the

    gpointer            g_tuples_index                      (GTuples *tuples,
                                                              gint index_,
                                                              gint field);
    +
    +

    Warning

    +

    g_tuples_index has been deprecated since version 2.26 and should not be used in newly-written code. Rarely used API

    +

    Gets a field from the records returned by g_relation_select(). It returns the given field of the record at the given index. The @@ -478,6 +527,6 @@ returned value should not be changed.

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Sequences.html b/docs/reference/glib/html/glib-Sequences.html index 5271236..0bbcee0 100644 --- a/docs/reference/glib/html/glib-Sequences.html +++ b/docs/reference/glib/html/glib-Sequences.html @@ -3,12 +3,12 @@ Sequences - + - + @@ -105,6 +105,14 @@ typedef gpointer data
    , GSequenceIterCompareFunc iter_cmp, gpointer cmp_data); +GSequenceIter * g_sequence_lookup (GSequence *seq, + gpointer data, + GCompareDataFunc cmp_func, + gpointer cmp_data); +GSequenceIter * g_sequence_lookup_iter (GSequence *seq, + gpointer data, + GSequenceIterCompareFunc iter_cmp, + gpointer cmp_data); gpointer g_sequence_get (GSequenceIter *iter); void g_sequence_set (GSequenceIter *iter, @@ -259,7 +267,7 @@ are removed from the sequence.

    g_sequence_free ()

    void                g_sequence_free                     (GSequence *seq);

    -Frees the memory allocated for seq. If seq has a data destroy +Frees the memory allocated for seq. If seq has a data destroy function associated with it, that function is called on all items in seq.

    @@ -475,7 +483,7 @@ Returns the end iterator for seg
    - @@ -942,6 +950,10 @@ the (begin, Returns an iterator pointing to the position where data would be inserted according to cmp_func and cmp_data.

    +

    +If you are simply searching for an existing element of the sequence, +consider using g_sequence_lookup(). +

    @@ -992,6 +1004,10 @@ Like GSequenceIterCompareFunc instead of a GCompareDataFunc as the compare function.

    +

    +If you are simply searching for an existing element of the sequence, +consider using g_sequence_lookup_iter(). +

    @@ -1031,6 +1047,108 @@ where data would have been inserted acco

    Since 2.14


    +
    +

    g_sequence_lookup ()

    +
    GSequenceIter *     g_sequence_lookup                   (GSequence *seq,
    +                                                         gpointer data,
    +                                                         GCompareDataFunc cmp_func,
    +                                                         gpointer cmp_data);
    +

    +Returns an iterator pointing to the position of the first item found +equal to data according to cmp_func and cmp_data. If more than one item +is equal, it is not guaranteed that it is the first which is returned. +In that case, you can use g_sequence_iter_next() and g_sequence_iter_prev() +to get others. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    seq :

    a GSequence +

    data :

    data to lookup +

    cmp_func :

    the GCompareDataFunc used to compare items in the sequence. It + is called with two items of the seq and user_data. It should + return 0 if the items are equal, a negative value if the first + item comes before the second, and a positive value if the second + item comes before the first. +

    cmp_data :

    user data passed to cmp_func. +

    Returns :

    an GSequenceIter pointing to the position of the first item +found equal to data according to cmp_func and cmp_data. + +
    +

    Since 2.26

    +
    +
    +
    +

    g_sequence_lookup_iter ()

    +
    GSequenceIter *     g_sequence_lookup_iter              (GSequence *seq,
    +                                                         gpointer data,
    +                                                         GSequenceIterCompareFunc iter_cmp,
    +                                                         gpointer cmp_data);
    +

    +Like g_sequence_lookup(), but uses +a GSequenceIterCompareFunc instead of a GCompareDataFunc as +the compare function. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    seq :

    a GSequence +

    data :

    data to lookup +

    iter_cmp :

    the GSequenceIterCompare function used to compare iterators + in the sequence. It is called with two iterators pointing into seq. + It should return 0 if the iterators are equal, a negative value if the + first iterator comes before the second, and a positive value if the + second iterator comes before the first. +

    cmp_data :

    user data passed to iter_cmp +

    Returns :

    an GSequenceIter pointing to the position of the first item +found equal to data according to cmp_func and cmp_data. + +
    +

    Since 2.26

    +
    +

    g_sequence_get ()

    gpointer            g_sequence_get                      (GSequenceIter *iter);
    @@ -1348,6 +1466,6 @@ The begin and + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Shell-related-Utilities.html b/docs/reference/glib/html/glib-Shell-related-Utilities.html index de33583..c014e89 100644 --- a/docs/reference/glib/html/glib-Shell-related-Utilities.html +++ b/docs/reference/glib/html/glib-Shell-related-Utilities.html @@ -3,12 +3,12 @@ Shell-related Utilities - + - + @@ -233,6 +233,6 @@ literally. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Simple-XML-Subset-Parser.html b/docs/reference/glib/html/glib-Simple-XML-Subset-Parser.html index 2a5eee9..5138014 100644 --- a/docs/reference/glib/html/glib-Simple-XML-Subset-Parser.html +++ b/docs/reference/glib/html/glib-Simple-XML-Subset-Parser.html @@ -3,12 +3,12 @@ Simple XML Subset Parser - + - + @@ -71,7 +71,7 @@ const gssize text_len, GError **error); void g_markup_parse_context_push (GMarkupParseContext *context, - GMarkupParser *parser, + const GMarkupParser *parser, gpointer user_data); gpointer g_markup_parse_context_pop (GMarkupParseContext *context); @@ -384,12 +384,11 @@ from being processed according to the XML rules for normalization of line endings and attribute values.

    -Note also that if given a string containing them, this function -will produce character references in the range of &x1; .. -&x1f; for all control sequences except for tabstop, newline -and carriage return. The character references in this range are -not valid XML 1.0, but they are valid XML 1.1 and will be accepted -by the GMarkup parser. +Note also that this function will produce character references in +the range of &x1; ... &x1f; for all control sequences +except for tabstop, newline and carriage return. The character +references in this range are not valid XML 1.0, but they are +valid XML 1.1 and will be accepted by the GMarkup parser.

    @@ -789,7 +788,7 @@ data may be fed to the

    g_markup_parse_context_push ()

    void                g_markup_parse_context_push         (GMarkupParseContext *context,
    -                                                         GMarkupParser *parser,
    +                                                         const GMarkupParser *parser,
                                                              gpointer user_data);

    Temporarily redirects markup data to a sub-parser. @@ -1278,6 +1277,6 @@ will be returned and error will be set a

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Singly-Linked-Lists.html b/docs/reference/glib/html/glib-Singly-Linked-Lists.html index eff776b..1c5553b 100644 --- a/docs/reference/glib/html/glib-Singly-Linked-Lists.html +++ b/docs/reference/glib/html/glib-Singly-Linked-Lists.html @@ -3,12 +3,12 @@ Singly-Linked Lists - + - + @@ -67,6 +67,8 @@ GSList* g_slist_remove_all (GSList *list, gconstpointer data); voidg_slist_free (GSList *list); +voidg_slist_free_full (GSList *list, + GDestroyNotify free_func); voidg_slist_free_1 (GSList *list); #define g_slist_free1 @@ -226,7 +228,7 @@ Adds a new element on to the end of the list.

    Note

    -The return value is the new start of the list, which may +The return value is the new start of the list, which may have changed, so make sure you store the new value.

    @@ -237,9 +239,9 @@ have changed, so make sure you store the new value.

    Note

    -Note that g_slist_append() has to traverse the entire list -to find the end, which is inefficient when adding multiple -elements. A common idiom to avoid the inefficiency is to prepend +Note that g_slist_append() has to traverse the entire list +to find the end, which is inefficient when adding multiple +elements. A common idiom to avoid the inefficiency is to prepend the elements and reverse the list when all elements have been added.

    @@ -312,7 +314,7 @@ Adds a new element on to the start of the list.

    Note

    -The return value is the new start of the list, which +The return value is the new start of the list, which may have changed, so make sure you store the new value.

    @@ -384,8 +386,8 @@ Inserts a new element into the list at the given position. - @@ -440,7 +442,7 @@ Inserts a node before sibling containing gpointer data, GCompareFunc func);

    -Inserts a new element into the list, using the given +Inserts a new element into the list, using the given comparison function to determine its position.

    position :

    the position to insert the element. - If this is negative, or is larger than the number +the position to insert the element. + If this is negative, or is larger than the number of elements in the list, the new element is added on to the end of the list.
    @@ -458,8 +460,8 @@ comparison function to determine its position. - @@ -508,8 +510,8 @@ If none of the elements contain the data, the GSList* g_slist_remove_link (GSList *list, GSList *link_);

    -Removes an element from a GSList, without -freeing the element. The removed element's next +Removes an element from a GSList, without +freeing the element. The removed element's next link is set to NULL, so that it becomes a self-contained list with one element.

    @@ -540,8 +542,8 @@ self-contained list with one element.
    GSList*             g_slist_delete_link                 (GSList *list,
                                                              GSList *link_);

    -Removes the node link_ from the list and frees it. -Compare this to g_slist_remove_link() which removes the node +Removes the node link_ from the list and frees it. +Compare this to g_slist_remove_link() which removes the node without freeing it.

    func :

    the function to compare elements in the list. - It should return a number > 0 if the first parameter +the function to compare elements in the list. + It should return a number > 0 if the first parameter comes after the second parameter in the sort order.
    @@ -571,9 +573,9 @@ without freeing it.
    GSList*             g_slist_remove_all                  (GSList *list,
                                                              gconstpointer data);

    -Removes all list nodes with data equal to data. -Returns the new head of the list. Contrast with -g_slist_remove() which removes only the first node +Removes all list nodes with data equal to data. +Returns the new head of the list. Contrast with +g_slist_remove() which removes only the first node matching the given data.

    @@ -605,6 +607,18 @@ matching the given data. Frees all of the memory used by a GSList. The freed elements are returned to the slice allocator.

    +

    +

    +
    +

    Note

    +

    +If list elements contain dynamically-allocated memory, +you should either use g_slist_free_full() or free them manually +first. +

    +
    +

    +

    @@ -615,6 +629,32 @@ The freed elements are returned to the slice allocator.

    +
    +

    g_slist_free_full ()

    +
    void                g_slist_free_full                   (GSList *list,
    +                                                         GDestroyNotify free_func);
    +

    +Convenience method, which frees all the memory used by a GSList, and +calls the specified destroy function on every element's data. +

    +
    ++ + + + + + + + + + +

    list :

    a pointer to a GSList +

    free_func :

    the function to be called to free each element's data +
    +

    Since 2.28

    +
    +

    g_slist_free_1 ()

    void                g_slist_free_1                      (GSList *list);
    @@ -652,7 +692,7 @@ Gets the number of elements in a

    Note

    -This function iterates over the whole list to +This function iterates over the whole list to count its elements.

    @@ -686,8 +726,8 @@ Copies a

    Note

    -Note that this is a "shallow" copy. If the list elements -consist of pointers to data, the pointers are copied but +Note that this is a "shallow" copy. If the list elements +consist of pointers to data, the pointers are copied but the actual data isn't.

    @@ -740,7 +780,7 @@ Reverses a
    GCompareDataFunc func
    , gpointer user_data);

    -Inserts a new element into the list, using the given +Inserts a new element into the list, using the given comparison function to determine its position.

    @@ -758,8 +798,8 @@ comparison function to determine its position. - @@ -797,9 +837,9 @@ Sorts a compare_func :

    @@ -913,7 +953,8 @@ Calls a function for each element of a GSList* g_slist_last (GSList *list);

    Gets the last element in a GSList. - +

    +

    Note

    @@ -928,12 +969,12 @@ This function iterates over the whole list.
    - - @@ -986,7 +1027,7 @@ Gets the element at the given position in a Returns :

    -
    @@ -1016,7 +1057,7 @@ Gets the data of the element at the given position. - @@ -1029,7 +1070,7 @@ Gets the data of the element at the given position.
    GSList*             g_slist_find                        (GSList *list,
                                                              gconstpointer data);

    -Finds the element in a GSList which +Finds the element in a GSList which contains the given data.

    func :

    the function to compare elements in the list. - It should return a number > 0 if the first parameter +the function to compare elements in the list. + It should return a number > 0 if the first parameter comes after the second parameter in the sort order.
    the comparison function used to sort the GSList. - This function is passed the data from 2 elements of the GSList - and should return 0 if they are equal, a negative value if the - first element comes before the second, or a positive value if + This function is passed the data from 2 elements of the GSList + and should return 0 if they are equal, a negative value if the + first element comes before the second, or a positive value if the first element comes after the second.

    list :

    a GSList +a GSList

    Returns :

    the last element in the GSList, + the last element in the GSList, or NULL if the GSList has no elements
    the element, or NULL if the position is off + the element, or NULL if the position is off the end of the GSList

    Returns :

    the element's data, or NULL if the position + the element's data, or NULL if the position is off the end of the GSList
    @@ -1047,7 +1088,7 @@ contains the given data. - @@ -1061,11 +1102,11 @@ contains the given data. gconstpointer data, GCompareFunc func);

    -Finds an element in a GSList, using a supplied function to -find the desired element. It iterates over the list, calling -the given function which should return 0 when the desired -element is found. The function takes two gconstpointer arguments, -the GSList element's data as the first argument and the +Finds an element in a GSList, using a supplied function to +find the desired element. It iterates over the list, calling +the given function which should return 0 when the desired +element is found. The function takes two gconstpointer arguments, +the GSList element's data as the first argument and the given user data.

    Returns :

    the found GSList element, + the found GSList element, or NULL if it is not found
    @@ -1083,7 +1124,7 @@ given user data. - @@ -1101,7 +1142,7 @@ given user data.
    gint                g_slist_position                    (GSList *list,
                                                              GSList *llink);

    -Gets the position of the given element +Gets the position of the given element in the GSList (starting from 0).

    func :

    the function to call for each element. +the function to call for each element. It should return 0 when the desired element is found
    @@ -1119,7 +1160,7 @@ in the Returns :

    -
    @@ -1132,7 +1173,7 @@ in the gint g_slist_index (GSList *list, gconstpointer data);

    -Gets the position of the element containing +Gets the position of the element containing the given data (starting from 0).

    the position of the element in the GSList, + the position of the element in the GSList, or -1 if the element is not found
    @@ -1150,7 +1191,7 @@ the given data (starting from 0). - @@ -1207,6 +1248,6 @@ with --disable-mem-pools + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Spawning-Processes.html b/docs/reference/glib/html/glib-Spawning-Processes.html index 5b511db..c18c28d 100644 --- a/docs/reference/glib/html/glib-Spawning-Processes.html +++ b/docs/reference/glib/html/glib-Spawning-Processes.html @@ -3,12 +3,12 @@ Spawning Processes - + - + @@ -529,7 +529,7 @@ process reference must be closed using gdk_spawn_on_screen_with_pipes() instead to ensure that +want to use gdk_spawn_on_screen_with_pipes() instead to ensure that the spawned program opens its windows on the right screen.

    @@ -627,7 +627,7 @@ reference when you don't need it any more.

    If you are writing a GTK+ application, and the program you are spawning is a graphical application, too, then you may -want to use gdk_spawn_on_screen() instead to ensure that +want to use gdk_spawn_on_screen() instead to ensure that the spawned program opens its windows on the right screen.

    @@ -919,6 +919,6 @@ though it doesn't do anything under UNIX. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Standard-Macros.html b/docs/reference/glib/html/glib-Standard-Macros.html index 007e504..348f263 100644 --- a/docs/reference/glib/html/glib-Standard-Macros.html +++ b/docs/reference/glib/html/glib-Standard-Macros.html @@ -3,12 +3,12 @@ Standard Macros - + - + @@ -440,6 +440,10 @@ Returns the offset, in bytes, of a member of a struct. Indicates the number of bytes to which memory will be aligned on the current platform.

    +

    +Indicates the number of bytes to which memory will be aligned on the +current platform. +


    @@ -461,6 +465,6 @@ turn it off. This macro should only be used for return values and for
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-String-Chunks.html b/docs/reference/glib/html/glib-String-Chunks.html index 898dcea..f1c85c4 100644 --- a/docs/reference/glib/html/glib-String-Chunks.html +++ b/docs/reference/glib/html/glib-String-Chunks.html @@ -3,12 +3,12 @@ String Chunks - + - + @@ -296,6 +296,6 @@ access any of the strings which were contained within it. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-String-Utility-Functions.html b/docs/reference/glib/html/glib-String-Utility-Functions.html index e43497b..6380156 100644 --- a/docs/reference/glib/html/glib-String-Utility-Functions.html +++ b/docs/reference/glib/html/glib-String-Utility-Functions.html @@ -3,12 +3,12 @@ String Utility Functions - + - + @@ -236,7 +236,7 @@ wide characters (see gchar* g_strdup (const gchar *str);

    Duplicates a string. If str is NULL it returns NULL. -The returned string should be freed with g_free() +The returned string should be freed with g_free() when no longer needed.

    Returns :

    the index of the element containing the data, + the index of the element containing the data, or -1 if the data is not found
    @@ -293,8 +293,8 @@ To copy a number of characters from a UTF-8 encoded string, use - @@ -568,6 +568,7 @@ Looks whether the string str ends with <

    Compares str1 and str2 like strcmp(). Handles NULL gracefully by sorting it before non-NULL strings. +Comparing two NULL pointers returns 0.

    Returns :

    a newly-allocated buffer containing the first n bytes - of str, nul-terminated + a newly-allocated buffer containing the first n bytes + of str, nul-terminated
    @@ -599,16 +600,16 @@ gracefully by sorting it before non-const gchar *src, gsize dest_size);

    -Portability wrapper that calls strlcpy() on systems which have it, -and emulates strlcpy() otherwise. Copies src to dest; dest is -guaranteed to be nul-terminated; src must be nul-terminated; -dest_size is the buffer size, not the number of chars to copy. +Portability wrapper that calls strlcpy() on systems which have it, +and emulates strlcpy() otherwise. Copies src to dest; dest is +guaranteed to be nul-terminated; src must be nul-terminated; +dest_size is the buffer size, not the number of chars to copy.

    At most dest_size - 1 characters will be copied. Always nul-terminates -(unless dest_size == 0). This function does not -allocate memory. Unlike strncpy(), this function doesn't pad dest (so -it's often faster). It returns the size of the attempted result, +(unless dest_size == 0). This function does not +allocate memory. Unlike strncpy(), this function doesn't pad dest (so +it's often faster). It returns the size of the attempted result, strlen (src), so if retval >= dest_size, truncation occurred.

    @@ -616,7 +617,7 @@ strlen (src), so if retval >=

    Note

    Caveat: strlcpy() is supposedly more secure than -strcpy() or strncpy(), but if you really want to avoid screwups, +strcpy() or strncpy(), but if you really want to avoid screwups, g_strdup() is an even better idea.

    @@ -654,10 +655,10 @@ strlen (src), so if retval >= const gchar *src, gsize dest_size);

    -Portability wrapper that calls strlcat() on systems which have it, -and emulates it otherwise. Appends nul-terminated src string to dest, -guaranteeing nul-termination for dest. The total size of dest won't -exceed dest_size. +Portability wrapper that calls strlcat() on systems which have it, +and emulates it otherwise. Appends nul-terminated src string to dest, +guaranteeing nul-termination for dest. The total size of dest won't +exceed dest_size.

    At most dest_size - 1 characters will be copied. @@ -670,8 +671,8 @@ in the dest_size characters of dest to start with).

    Note

    -

    Caveat: this is supposedly a more secure alternative to -strcat() or strncat(), but for real security g_strconcat() is harder +

    Caveat: this is supposedly a more secure alternative to +strcat() or strncat(), but for real security g_strconcat() is harder to mess up.

    @@ -691,15 +692,15 @@ to mess up.

    - - @@ -711,9 +712,9 @@ so if retval >= dest_size, truncation occurred.
    gchar*              g_strdup_printf                     (const gchar *format,
                                                              ...);

    -Similar to the standard C sprintf() function but safer, since it -calculates the maximum space required and allocates memory to hold -the result. The returned string should be freed with g_free() when no +Similar to the standard C sprintf() function but safer, since it +calculates the maximum space required and allocates memory to hold +the result. The returned string should be freed with g_free() when no longer needed.

    dest_size :

    length of dest buffer in bytes (not length of existing string +length of dest buffer in bytes (not length of existing string inside dest)

    Returns :

    size of attempted result, which is -MIN (dest_size, strlen (original dest)) + strlen (src), -so if retval >= dest_size, truncation occurred. + size of attempted result, which is MIN (dest_size, strlen + (original dest)) + strlen (src), so if retval >= dest_size, + truncation occurred.
    @@ -744,13 +745,13 @@ longer needed.
    gchar*              g_strdup_vprintf                    (const gchar *format,
                                                              va_list args);

    -Similar to the standard C vsprintf() function but safer, since it -calculates the maximum space required and allocates memory to hold -the result. The returned string should be freed with g_free() when +Similar to the standard C vsprintf() function but safer, since it +calculates the maximum space required and allocates memory to hold +the result. The returned string should be freed with g_free() when no longer needed.

    -See also g_vasprintf(), which offers the same functionality, but +See also g_vasprintf(), which offers the same functionality, but additionally returns the length of the allocated string.

    @@ -926,22 +927,29 @@ positional parameters, as specified in the Single Unix Specification. gchar const *format, ...);

    -An implementation of the standard sprintf() function which supports +An implementation of the standard sprintf() function which supports positional parameters, as specified in the Single Unix Specification.

    +

    +Note that it is usually better to use g_snprintf(), to avoid the +risk of buffer overflow. +

    +

    +See also g_strdup_printf(). +

    - - @@ -1008,25 +1016,25 @@ positional parameters, as specified in the Single Unix Specification. ...);

    A safer form of the standard sprintf() function. The output is guaranteed -to not exceed n characters (including the terminating nul character), so +to not exceed n characters (including the terminating nul character), so it is easy to ensure that a buffer overflow cannot occur.

    See also g_strdup_printf().

    -In versions of GLib prior to 1.2.3, this function may return -1 if the -output was truncated, and the truncated string may not be nul-terminated. -In versions prior to 1.3.12, this function returns the length of the output +In versions of GLib prior to 1.2.3, this function may return -1 if the +output was truncated, and the truncated string may not be nul-terminated. +In versions prior to 1.3.12, this function returns the length of the output string.

    The return value of g_snprintf() conforms to the snprintf() -function as standardized in ISO C99. Note that this is different from +function as standardized in ISO C99. Note that this is different from traditional snprintf(), which returns the length of the output string.

    -The format string may contain positional parameters, as specified in +The format string may contain positional parameters, as specified in the Single Unix Specification.

    string :

    A pointer to a memory buffer to contain the resulting string. It - is up to the caller to ensure that the allocated buffer is large +A pointer to a memory buffer to contain the resulting string. It + is up to the caller to ensure that the allocated buffer is large enough to hold the formatted result

    format :

    a standard printf() format string, but notice +a standard printf() format string, but notice string precision pitfalls.
    @@ -1039,13 +1047,13 @@ the Single Unix Specification. - - @@ -1638,7 +1646,7 @@ strings using this function, you will get false matches. - @@ -1685,7 +1693,7 @@ corresponding to ASCII letters always represent themselves. - @@ -1882,7 +1890,7 @@ Converts all upper case ASCII letters to lower case ASCII letters.
    gchar*              g_strup                             (gchar *string);

    Warning

    -

    g_strup has been deprecated since version 2.2 and should not be used in newly-written code. This function is totally broken for the reasons discussed +

    g_strup has been deprecated since version 2.2 and should not be used in newly-written code. This function is totally broken for the reasons discussed in the g_strncasecmp() docs - use g_ascii_strup() or g_utf8_strup() instead.

    @@ -1911,8 +1919,8 @@ Converts a string to upper case.

    gchar*              g_strdown                           (gchar *string);

    Warning

    -

    g_strdown has been deprecated since version 2.2 and should not be used in newly-written code. This function is totally broken for the reasons discussed -in the g_strncasecmp() docs - use g_ascii_strdown() or g_utf8_strdown() +

    g_strdown has been deprecated since version 2.2 and should not be used in newly-written code. This function is totally broken for the reasons discussed +in the g_strncasecmp() docs - use g_ascii_strdown() or g_utf8_strdown() instead.

    @@ -1928,7 +1936,7 @@ Converts a string to lower case.

    - @@ -1942,7 +1950,7 @@ Converts a string to lower case. const gchar *s2);

    Warning

    -

    g_strcasecmp has been deprecated since version 2.2 and should not be used in newly-written code. See g_strncasecmp() for a discussion of why this function +

    g_strcasecmp has been deprecated since version 2.2 and should not be used in newly-written code. See g_strncasecmp() for a discussion of why this function is deprecated and how to replace it.

    @@ -1964,7 +1972,7 @@ A case-insensitive string comparison, corresponding to the standard

    - @@ -1980,7 +1988,7 @@ A case-insensitive string comparison, corresponding to the standard guint n);

    Warning

    -

    g_strncasecmp has been deprecated since version 2.2 and should not be used in newly-written code. The problem with g_strncasecmp() is that it does the +

    g_strncasecmp has been deprecated since version 2.2 and should not be used in newly-written code. The problem with g_strncasecmp() is that it does the comparison by calling toupper()/tolower(). These functions are locale-specific and operate on single bytes. However, it is impossible to handle things correctly from an I18N standpoint by operating on @@ -1998,7 +2006,7 @@ which only works on ASCII and is not locale-sensitive, and

    A case-insensitive string comparison, corresponding to the standard strncasecmp() function on platforms which support it. -It is similar to g_strcasecmp() except it only compares the first n +It is similar to g_strcasecmp() except it only compares the first n characters of the strings.

    n :

    the maximum number of bytes to produce (including the +the maximum number of bytes to produce (including the terminating nul character).

    format :

    a standard printf() format string, but notice +a standard printf() format string, but notice string precision pitfalls.

    Returns :

    0 if the strings match, a negative value if s1 < s2, + 0 if the strings match, a negative value if s1 < s2, or a positive value if s1 > s2.

    Returns :

    0 if the strings match, a negative value if s1 < s2, + 0 if the strings match, a negative value if s1 < s2, or a positive value if s1 > s2.

    Returns :

    the string + the string

    Returns :

    0 if the strings match, a negative value if s1 < s2, + 0 if the strings match, a negative value if s1 < s2, or a positive value if s1 > s2.
    @@ -2021,7 +2029,7 @@ characters of the strings. - @@ -2034,13 +2042,13 @@ characters of the strings.

    g_strreverse ()

    gchar*              g_strreverse                        (gchar *string);

    -Reverses all of the bytes in a string. For example, -g_strreverse ("abcdef") will result +Reverses all of the bytes in a string. For example, +g_strreverse ("abcdef") will result in "fedcba".

    -Note that g_strreverse() doesn't work on UTF-8 strings -containing multibyte characters. For that purpose, use +Note that g_strreverse() doesn't work on UTF-8 strings +containing multibyte characters. For that purpose, use g_utf8_strreverse().

    Returns :

    0 if the strings match, a negative value if s1 < s2, + 0 if the strings match, a negative value if s1 < s2, or a positive value if s1 > s2.
    @@ -2048,7 +2056,7 @@ containing multibyte characters. For that purpose, use - @@ -2208,10 +2216,10 @@ Converts a string to a

    This function behaves like the standard strtod() function -does in the C locale. It does this without actually changing -the current locale, since that would not be thread-safe. +does in the C locale. It does this without actually changing +the current locale, since that would not be thread-safe. A limitation of the implementation is that this function -will still accept localized versions of infinities and NANs. +will still accept localized versions of infinities and NANs.

    This function is typically used when reading configuration @@ -2263,7 +2271,7 @@ you can reliably detect overflow and underflow. gdouble d);

    Converts a gdouble to a string, using the '.' as -decimal point. +decimal point.

    This functions generates enough precision that converting @@ -2309,7 +2317,7 @@ be larger than G_ASCII_DTOSTR_BUF_SIZE b Converts a gdouble to a string, using the '.' as decimal point. To format the number you pass in a printf()-style format string. Allowed conversion -specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. +specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.

    If you just want to want to serialize the value into a @@ -2331,7 +2339,7 @@ string, use format :

    @@ -2629,7 +2637,7 @@ nesting such as g_ascii_strup (g_strcanon (str, "abc", '?'

    Splits a string into a maximum of max_tokens pieces, using the given delimiter. If max_tokens is reached, the remainder of string is appended -to the last token. +to the last token.

    As a special case, the result of splitting the empty string "" is an empty @@ -2662,7 +2670,7 @@ before calling Returns :

    -
    @@ -2683,7 +2691,7 @@ remainder is appended to the last token.

    For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a -NULL-terminated vector containing the three strings "abc", "def", +NULL-terminated vector containing the three strings "abc", "def", and "ghi".

    @@ -2699,7 +2707,7 @@ to represent empty elements, you'll need to check for the empty string before calling g_strsplit_set().

    -Note that this function works on bytes not characters, so it can't be used +Note that this function works on bytes not characters, so it can't be used to delimit UTF-8 strings for anything but ASCII characters.

    string :

    the string to reverse +the string to reverse
    The printf()-style format to use for the - code to use for converting. + code to use for converting.
    a newly-allocated NULL-terminated array of strings. Use + a newly-allocated NULL-terminated array of strings. Use g_strfreev() to free it.
    @@ -2718,13 +2726,13 @@ to delimit UTF-8 strings for anything but ASCII characters. - - @@ -2760,10 +2768,15 @@ Concatenates all of the given strings into one long string. The returned string should be freed with g_free() when no longer needed.

    +Note that this function is usually not the right function to use to +assemble a translated message from pieces, since proper translation +often requires the pieces to be reordered. +

    +

    Warning

    -

    The variable argument list must end +

    The variable argument list must end with NULL. If you forget the NULL, g_strconcat() will start appending random memory junk to your string.

    @@ -2796,7 +2809,7 @@ random memory junk to your string.

    gchar*              g_strjoin                           (const gchar *separator,
                                                              ...);

    -Joins a number of strings together to form one long string, with the +Joins a number of strings together to form one long string, with the optional separator inserted between each of them. The returned string should be freed with g_free().

    @@ -2828,7 +2841,7 @@ should be freed with gchar* g_strjoinv (const gchar *separator, gchar **str_array);

    -Joins a number of strings together to form one long string, with the +Joins a number of strings together to form one long string, with the optional separator inserted between each of them. The returned string should be freed with g_free().

    @@ -2859,7 +2872,7 @@ should be freed with

    g_strv_length ()

    guint               g_strv_length                       (gchar **str_array);

    -Returns the length of the given NULL-terminated +Returns the length of the given NULL-terminated string array str_array.

    max_tokens :

    The maximum number of tokens to split string into. +The maximum number of tokens to split string into. If this is less than 1, the string is split completely

    Returns :

    a newly-allocated NULL-terminated array of strings. Use + a newly-allocated NULL-terminated array of strings. Use g_strfreev() to free it.
    @@ -2885,9 +2898,9 @@ string array str_array.

    g_strerror ()

    const gchar*        g_strerror                          (gint errnum);

    -Returns a string corresponding to the given error code, e.g. -"no such process". You should use this function in preference to -strerror(), because it returns a string in UTF-8 encoding, and since +Returns a string corresponding to the given error code, e.g. +"no such process". You should use this function in preference to +strerror(), because it returns a string in UTF-8 encoding, and since not all platforms support the strerror() function.

    @@ -2901,8 +2914,8 @@ not all platforms support the strerror() function. - @@ -2915,7 +2928,7 @@ not all platforms support the strerror() function.
    const gchar*        g_strsignal                         (gint signum);

    Returns a string describing the given signal, e.g. "Segmentation fault". -You should use this function in preference to strsignal(), because it +You should use this function in preference to strsignal(), because it returns a string in UTF-8 encoding, and since not all platforms support the strsignal() function.

    @@ -2931,7 +2944,7 @@ the strsignal() function.
    @@ -2942,6 +2955,6 @@ the strsignal() function. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Strings.html b/docs/reference/glib/html/glib-Strings.html index f239856..29a00d3 100644 --- a/docs/reference/glib/html/glib-Strings.html +++ b/docs/reference/glib/html/glib-Strings.html @@ -3,12 +3,12 @@ Strings - + - + @@ -124,10 +124,11 @@

    Description

    -A GString is similar to a standard C string, except that it grows -automatically as text is appended or inserted. Also, it stores the -length of the string, so can be used for binary data with embedded -nul bytes. +A GString is an object that handles the memory management of a C string +for you. You can think of it as similar to a Java StringBuffer. +In addition to the string itself, GString stores the length of the string, +so can be used for binary data with embedded nul bytes. To access the C +string managed by the GString string, simply use string->str.

    @@ -648,7 +649,7 @@ are reserved in URIs using URI-style escape sequences.
    - @@ -914,14 +915,14 @@ into the string at the given position. const gchar *val, gssize len);

    -Inserts len bytes of val into string at pos. -Because len is provided, val may contain embedded -nuls and need not be nul-terminated. If pos is -1, +Inserts len bytes of val into string at pos. +Because len is provided, val may contain embedded +nuls and need not be nul-terminated. If pos is -1, bytes are inserted at the end of the string.

    -Since this function does not stop at nul bytes, it is -the caller's responsibility to ensure that val has at +Since this function does not stop at nul bytes, it is +the caller's responsibility to ensure that val has at least len addressable bytes.

    Returns :

    a UTF-8 string describing the error code. If the error code - is unknown, it returns "unknown error (<code>)". The string + a UTF-8 string describing the error code. If the error code + is unknown, it returns "unknown error (<code>)". The string can only be used until the next call to g_strerror()

    Returns :

    a UTF-8 string describing the signal. If the signal is unknown, - it returns "unknown signal (<signum>)". The string can only be + it returns "unknown signal (<signum>)". The string can only be used until the next call to g_strsignal()

    reserved_chars_allowed :

    a string of reserved characters allowed to be used +a string of reserved characters allowed to be used, or NULL
    @@ -934,7 +935,7 @@ least len addressable bytes. - @@ -1143,7 +1144,9 @@ always, string->str[string->len] will be a nul byte.) gboolean free_segment);

    Frees the memory allocated for the GString. -If free_segment is TRUE it also frees the character data. +If free_segment is TRUE it also frees the character data. If +it's FALSE, the caller gains ownership of the buffer and must +free it after use with g_free().

    pos :

    position in string where insertion should +position in string where insertion should happen, or -1 for at the end
    @@ -1285,6 +1288,6 @@ For use with
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Testing.html b/docs/reference/glib/html/glib-Testing.html index c48435e..6503c1e 100644 --- a/docs/reference/glib/html/glib-Testing.html +++ b/docs/reference/glib/html/glib-Testing.html @@ -3,12 +3,12 @@ Testing - + - + @@ -56,11 +56,13 @@ #define
    g_test_verbose #define g_test_quiet int g_test_run (void); +void (*GTestFunc) (void); void g_test_add_func (const char *testpath, - void (test_funcvoid) ()); + GTestFunc test_func); +void (*GTestDataFunc) (gconstpointer user_data); void g_test_add_data_func (const char *testpath, gconstpointer test_data, - void (test_funcgconstpointer) ()); + GTestDataFunc test_func); #define g_test_add (testpath, Fixture, tdata, @@ -125,12 +127,14 @@ enum GTestCase; typedef GTestSuite; +void (*GTestFixtureFunc) (gpointer fixture, + gconstpointer user_data); GTestCase* g_test_create_case (const char *test_name, gsize data_size, gconstpointer test_data, - void (data_setupvoid) (), - void (data_testvoid) (), - void (data_teardownvoid) ()); + GTestFixtureFunc data_setup, + GTestFixtureFunc data_test, + GTestFixtureFunc data_teardown); GTestSuite* g_test_create_suite (const char *suite_name); GTestSuite* g_test_get_root (void); void g_test_suite_add (GTestSuite *suite, @@ -472,10 +476,18 @@ in a program.

    Since 2.16


    +
    +

    GTestFunc ()

    +
    void                (*GTestFunc)                        (void);
    +

    +The type used for test case functions. +

    +
    +

    g_test_add_func ()

    void                g_test_add_func                     (const char *testpath,
    -                                                         void (test_funcvoid) ());
    + GTestFunc test_func);

    Create a new test case, similar to g_test_create_case(). However the test is assumed to use no fixture, and test suites are automatically @@ -484,20 +496,44 @@ slash-separated portions of testpath.

    - + + - + + + + + +

    testpath :

    Slash-separated test case path name for the test.

    test_func :

    The test function to invoke for this test. +

    Since 2.16


    +
    +

    GTestDataFunc ()

    +
    void                (*GTestDataFunc)                    (gconstpointer user_data);
    +

    +The type used for test case functions that take an extra pointer +argument. +

    +
    ++ + + + +

    user_data :

    the data provided when registering the test +
    +
    +

    g_test_add_data_func ()

    void                g_test_add_data_func                (const char *testpath,
                                                              gconstpointer test_data,
    -                                                         void (test_funcgconstpointer) ());
    + GTestDataFunc test_func);

    Create a new test case, similar to g_test_create_case(). However the test is assumed to use no fixture, and test suites are automatically @@ -519,8 +555,8 @@ will be passed as first argument to test_func -

    gconstpointer :

    - +

    test_func :

    +The test function to invoke for this test. @@ -834,9 +870,9 @@ callback A before callback B will cause B() to be

    g_test_queue_unref()

    #define             g_test_queue_unref(gobject)

    -Enqueue an object to be released with g_object_unref() during +Enqueue an object to be released with g_object_unref() during the next teardown phase. This is equivalent to calling g_test_queue_destroy() -with a destroy callback of g_object_unref(). +with a destroy callback of g_object_unref().

    @@ -1527,14 +1563,49 @@ An opaque structure representing a test suite.


    +
    +

    GTestFixtureFunc ()

    +
    void                (*GTestFixtureFunc)                 (gpointer fixture,
    +                                                         gconstpointer user_data);
    +

    +The type used for functions that operate on test fixtures. This is +used for the fixture setup and teardown functions as well as for the +testcases themselves. +

    +

    +user_data is a pointer to the data that was given when registering +the test case. +

    +

    +fixture will be a pointer to the area of memory allocated by the +test framework, of the size requested. If the requested size was +zero then fixture will be equal to user_data. +

    +
    ++ + + + + + + + + + +

    fixture :

    the test fixture +

    user_data :

    the data provided when registering the test +
    +
    +

    g_test_create_case ()

    GTestCase*          g_test_create_case                  (const char *test_name,
                                                              gsize data_size,
                                                              gconstpointer test_data,
    -                                                         void (data_setupvoid) (),
    -                                                         void (data_testvoid) (),
    -                                                         void (data_teardownvoid) ());
    + GTestFixtureFunc data_setup, + GTestFixtureFunc data_test, + GTestFixtureFunc data_teardown);

    Create a new GTestCase, named test_name, this API is fairly low level, calling g_test_add() or g_test_add_func() is preferable. @@ -1571,6 +1642,21 @@ called with the same fixture, but varying test_name< +

    data_setup :

    +the function to set up the fixture data + + + +

    data_test :

    +the actual test function + + + +

    data_teardown :

    +the function to teardown the fixture data + + +

    Returns :

    a newly allocated GTestCase. @@ -1714,6 +1800,6 @@ in a program.
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-The-Main-Event-Loop.html b/docs/reference/glib/html/glib-The-Main-Event-Loop.html index ce25745..5fe2d8e 100644 --- a/docs/reference/glib/html/glib-The-Main-Event-Loop.html +++ b/docs/reference/glib/html/glib-The-Main-Event-Loop.html @@ -3,12 +3,12 @@ The Main Event Loop - + - + @@ -113,6 +113,14 @@ gint g_main_depth (void); GSource * g_main_current_source (void); #define g_main_set_poll_func (func) +void g_main_context_invoke (GMainContext *context, + GSourceFunc function, + gpointer data); +void g_main_context_invoke_full (GMainContext *context, + gint priority, + GSourceFunc function, + gpointer data, + GDestroyNotify notify); GMainContext * g_main_context_get_thread_default (void); void g_main_context_push_thread_default (GMainContext *context); @@ -187,6 +195,11 @@ typedef gboolean can_recurse); gboolean g_source_get_can_recurse (GSource *source); guint g_source_get_id (GSource *source); +const char* g_source_get_name (GSource *source); +void g_source_set_name (GSource *source, + const char *name); +void g_source_set_name_by_id (guint tag, + const char *name); GMainContext * g_source_get_context (GSource *source); void g_source_set_callback (GSource *source, GSourceFunc func, @@ -200,6 +213,11 @@ typedef GPollFD *fd
    ); void g_source_remove_poll (GSource *source, GPollFD *fd); +void g_source_add_child_source (GSource *source, + GSource *child_source); +void g_source_remove_child_source (GSource *source, + GSource *child_source); +gint64 g_source_get_time (GSource *source); void g_source_get_current_time (GSource *source, GTimeVal *timeval); gboolean g_source_remove (guint tag); @@ -211,91 +229,80 @@ typedef

    Description

    - The main event loop manages all the available sources of events for - GLib and GTK+ applications. These events can come from any number of - different types of sources such as file descriptors (plain files, - pipes or sockets) and timeouts. New types of event sources can also - be added using g_source_attach(). -

    -

    - To allow multiple independent sets of sources to be handled in - different threads, each source is associated with a GMainContext. - A GMainContext can only be running in a single thread, but - sources can be added to it and removed from it from other threads. -

    -

    - Each event source is assigned a priority. The default priority, - G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher - priorities. Values greater than 0 denote lower priorities. Events - from high priority sources are always processed before events from - lower priority sources. -

    -

    - Idle functions can also be added, and assigned a priority. These will - be run whenever no events with a higher priority are ready to be - processed. -

    -

    - The GMainLoop data type represents a main event loop. A GMainLoop - is created with g_main_loop_new(). After adding the initial event sources, - g_main_loop_run() is called. This continuously checks for new events from - each of the event sources and dispatches them. Finally, the - processing of an event from one of the sources leads to a call to - g_main_loop_quit() to exit the main loop, and g_main_loop_run() returns. -

    -

    - It is possible to create new instances of GMainLoop recursively. - This is often used in GTK+ applications when showing modal dialog - boxes. Note that event sources are associated with a particular - GMainContext, and will be checked and dispatched for all main - loops associated with that GMainContext. -

    -

    - GTK+ contains wrappers of some of these functions, e.g. gtk_main(), - gtk_main_quit() and gtk_events_pending(). -

    -
    -

    Creating new sources types

    -

    - One of the unusual features of the GTK+ main loop functionality - is that new types of event source can be created and used in - addition to the builtin type of event source. A new event source - type is used for handling GDK events. A new source type is - created by deriving from the GSource - structure. The derived type of source is represented by a - structure that has the GSource structure as a first element, - and other elements specific to the new source type. To create - an instance of the new source type, call g_source_new() passing - in the size of the derived structure and a table of functions. - These GSourceFuncs determine the behavior of the new source - types. -

    -

    - New source types basically interact with the main context - in two ways. Their prepare function in GSourceFuncs can set - a timeout to determine the maximum amount of time that the - main loop will sleep before checking the source again. In - addition, or as well, the source can add file descriptors to - the set that the main context checks using g_source_add_poll(). -

    +The main event loop manages all the available sources of events for +GLib and GTK+ applications. These events can come from any number of +different types of sources such as file descriptors (plain files, +pipes or sockets) and timeouts. New types of event sources can also +be added using g_source_attach(). +

    +

    +To allow multiple independent sets of sources to be handled in +different threads, each source is associated with a GMainContext. +A GMainContext can only be running in a single thread, but +sources can be added to it and removed from it from other threads. +

    +

    +Each event source is assigned a priority. The default priority, +G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher priorities. +Values greater than 0 denote lower priorities. Events from high priority +sources are always processed before events from lower priority sources. +

    +

    +Idle functions can also be added, and assigned a priority. These will +be run whenever no events with a higher priority are ready to be processed. +

    +

    +The GMainLoop data type represents a main event loop. A GMainLoop is +created with g_main_loop_new(). After adding the initial event sources, +g_main_loop_run() is called. This continuously checks for new events from +each of the event sources and dispatches them. Finally, the processing of +an event from one of the sources leads to a call to g_main_loop_quit() to +exit the main loop, and g_main_loop_run() returns. +

    +

    +It is possible to create new instances of GMainLoop recursively. +This is often used in GTK+ applications when showing modal dialog +boxes. Note that event sources are associated with a particular +GMainContext, and will be checked and dispatched for all main +loops associated with that GMainContext. +

    +

    +GTK+ contains wrappers of some of these functions, e.g. gtk_main(), +gtk_main_quit() and gtk_events_pending(). +

    +
    +

    Creating new source types

    +

    One of the unusual features of the GMainLoop functionality +is that new types of event source can be created and used in +addition to the builtin type of event source. A new event source +type is used for handling GDK events. A new source type is created +by deriving from the GSource structure. +The derived type of source is represented by a structure that has +the GSource structure as a first element, and other elements specific +to the new source type. To create an instance of the new source type, +call g_source_new() passing in the size of the derived structure and +a table of functions. These GSourceFuncs determine the behavior of +the new source type.

    +

    New source types basically interact with the main context +in two ways. Their prepare function in GSourceFuncs can set a timeout +to determine the maximum amount of time that the main loop will sleep +before checking the source again. In addition, or as well, the source +can add file descriptors to the set that the main context checks using +g_source_add_poll().


    -

    Customizing the main loop iteration

    -

    - Single iterations of a GMainContext can be run with - g_main_context_iteration(). In some cases, more detailed control - of exactly how the details of the main loop work is desired, - for instance, when integrating the GMainLoop with an external - main loop. In such cases, you can call the component functions - of g_main_context_iteration() directly. These functions - are g_main_context_prepare(), g_main_context_query(), - g_main_context_check() and g_main_context_dispatch(). -

    -

    - The operation of these functions can best be seen in terms - of a state diagram, as shown in Figure 1, “States of a Main Context”. -

    +

    Customizing the main loop iteration

    +

    Single iterations of a GMainContext can be run with +g_main_context_iteration(). In some cases, more detailed control +of exactly how the details of the main loop work is desired, for +instance, when integrating the GMainLoop with an external main loop. +In such cases, you can call the component functions of +g_main_context_iteration() directly. These functions are +g_main_context_prepare(), g_main_context_query(), +g_main_context_check() and g_main_context_dispatch().

    +

    The operation of these functions can best be seen in terms +of a state diagram, as shown in Figure 1, “States of a Main Context”.

    Figure 1. States of a Main Context

    States of a Main Context
    @@ -476,23 +483,25 @@ Returns the #define g_main_new(is_running)

    Warning

    -

    g_main_new has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_new() instead.

    +

    g_main_new has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_new() instead

    -Creates a new GMainLoop for the default main loop. +Creates a new GMainLoop for th default main context.

    - - @@ -504,7 +513,7 @@ very important since calling #define g_main_destroy(loop)

    Warning

    -

    g_main_destroy has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_unref() instead.

    +

    g_main_destroy has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_unref() instead

    Frees the memory allocated for the GMainLoop. @@ -513,7 +522,7 @@ Frees the memory allocated for the

    -

    is_running :

    set to TRUE to indicate that the loop is running. This is not -very important since calling g_main_run() will set this to TRUE anyway. +set to TRUE to indicate that the loop is running. This + is not very important since calling g_main_run() will set this + to TRUE anyway.

    Returns :

    a new GMainLoop. + a new GMainLoop +

    loop :

    a GMainLoop. +a GMainLoop
    @@ -524,7 +533,7 @@ Frees the memory allocated for the #define g_main_run(loop)

    Warning

    -

    g_main_run has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_run() instead.

    +

    g_main_run has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_run() instead

    Runs a main loop until it stops running. @@ -533,7 +542,7 @@ Runs a main loop until it stops running.

    loop :

    -a GMainLoop. +a GMainLoop
    @@ -544,17 +553,17 @@ Runs a main loop until it stops running.
    #define             g_main_quit(loop)

    Warning

    -

    g_main_quit has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_quit() instead.

    +

    g_main_quit has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_quit() instead

    -Stops the GMainLoop. If g_main_run() was called to run the GMainLoop, -it will now return. +Stops the GMainLoop. +If g_main_run() was called to run the GMainLoop, it will now return.

    -

    loop :

    a GMainLoop. +a GMainLoop
    @@ -565,7 +574,7 @@ it will now return.
    #define             g_main_is_running(loop)

    Warning

    -

    g_main_is_running has been deprecated since version 2.2 and should not be used in newly-written code. USe g_main_loop_is_running() instead.

    +

    g_main_is_running has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_is_running() instead

    Checks if the main loop is running. @@ -575,13 +584,13 @@ Checks if the main loop is running.

    loop :

    -a GMainLoop. +a GMainLoop

    Returns :

    - -TRUE if the main loop is running. + TRUE if the main loop is running + @@ -594,6 +603,8 @@ Checks if the main loop is running.

    Use this for high priority event sources. +

    +

    It is not used within GLib or GTK+.

    @@ -604,9 +615,11 @@ It is not used within GLib or GTK+.

    Use this for default priority event sources. -In GLib this priority is used when adding timeout functions with -g_timeout_add(). -In GDK this priority is used for events from the X server. +

    +

    +In GLib this priority is used when adding timeout functions +with g_timeout_add(). In GDK this priority is used for events +from the X server.


    @@ -616,10 +629,12 @@ In GDK this priority is used for events from the X server.

    Use this for high priority idle functions. -GTK+ uses G_PRIORITY_HIGH_IDLE + 10 for resizing operations, and -G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is done to -ensure that any pending resizes are processed before any pending redraws, -so that widgets are not redrawn twice unnecessarily.) +

    +

    +GTK+ uses G_PRIORITY_HIGH_IDLE + 10 for resizing operations, +and G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is +done to ensure that any pending resizes are processed before any +pending redraws, so that widgets are not redrawn twice unnecessarily.)


    @@ -629,16 +644,21 @@ so that widgets are not redrawn twice unnecessarily.)

    Use this for default priority idle functions. -In GLib this priority is used when adding idle functions with g_idle_add(). +

    +

    +In GLib this priority is used when adding idle functions with +g_idle_add().


    G_PRIORITY_LOW

    -
    #define G_PRIORITY_LOW	            300
    +
    #define G_PRIORITY_LOW              300
     

    Use this for very low priority background tasks. +

    +

    It is not used within GLib or GTK+.

    @@ -647,8 +667,8 @@ It is not used within GLib or GTK+.

    GMainContext

    typedef struct _GMainContext GMainContext;

    -The GMainContext struct is an opaque data type -representing a set of sources to be handled in a main loop. +The GMainContext struct is an opaque data +type representing a set of sources to be handled in a main loop.


    @@ -783,16 +803,16 @@ Runs a single iteration for the default may_block :

    -set to
    TRUE if it should block (i.e. wait) until an event source -becomes ready. It will return after an event source has been processed. -If set to FALSE it will return immediately if no event source is ready to be -processed. +set to TRUE if it should block (i.e. wait) until an event + source becomes ready. It will return after an event source has been + processed. If set to FALSE it will return immediately if no event + source is ready to be processed.

    Returns :

    - -TRUE if more events are pending. + TRUE if more events are pending. + @@ -827,7 +847,7 @@ Checks if any sources have pending events for the given context.
    #define             g_main_pending()

    Warning

    -

    g_main_pending has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_context_pending() instead.

    +

    g_main_pending is deprecated and should not be used in newly-written code.

    Checks if any events are pending for the default GMainContext @@ -837,8 +857,9 @@ Checks if any events are pending for the default

    Returns :

    - -TRUE if any events are pending. + TRUE if any events are pending. + +Deprected: 2.2: Use g_main_context_pending() instead. @@ -1281,32 +1302,31 @@ Gets the poll function set by gint timeout_
    );

    Specifies the type of function passed to g_main_context_set_poll_func(). -The semantics of the function should match those of the -poll() system call. +The semantics of the function should match those of the poll() system call.

    - - - @@ -1554,7 +1574,7 @@ following techniques:

    1. - Use gtk_widget_set_sensitive() or modal dialogs to prevent + Use gtk_widget_set_sensitive() or modal dialogs to prevent the user from interacting with elements while the main loop is recursing.

    2. @@ -1600,7 +1620,7 @@ Returns the currently firing source for this thread.
      #define             g_main_set_poll_func(func)

      Warning

      -

      g_main_set_poll_func has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_context_set_poll_func() instead.

      +

      g_main_set_poll_func has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_context_set_poll_func() again

      Sets the function to use for the handle polling of file descriptors @@ -1610,12 +1630,120 @@ for the default main context.

    -

    ufds :

    an array of GPollFD elements. +an array of GPollFD elements

    nfsd :

    the number of elements in ufds. +the number of elements in ufds

    timeout_ :

    the maximum time to wait for an event of the file descriptors. - A negative value indicates an infinite timeout. + A negative value indicates an infinite timeout.

    Returns :

    the number of GPollFD elements which have events or errors reported, -or -1 if an error occurred. + the number of GPollFD elements which have events or errors + reported, or -1 if an error occurred.

    func :

    the function to call to poll all file descriptors. +the function to call to poll all file descriptors

    +
    +

    g_main_context_invoke ()

    +
    void                g_main_context_invoke               (GMainContext *context,
    +                                                         GSourceFunc function,
    +                                                         gpointer data);
    +

    +Invokes a function in such a way that context is owned during the +invocation of function. +

    +

    +If context is NULL then the global default main context — as +returned by g_main_context_default() — is used. +

    +

    +If context is owned by the current thread, function is called +directly. Otherwise, if context is the thread-default main context +of the current thread and g_main_context_acquire() succeeds, then +function is called and g_main_context_release() is called +afterwards. +

    +

    +In any other case, an idle source is created to call function and +that source is attached to context (presumably to be run in another +thread). The idle source is attached with G_PRIORITY_DEFAULT +priority. If you want a different priority, use +g_main_context_invoke_full(). +

    +

    +Note that, as with normal idle functions, function should probably +return FALSE. If it returns TRUE, it will be continuously run in a +loop (and may prevent this call from returning). +

    +
    ++ + + + + + + + + + + + + + +

    context :

    a GMainContext, or NULL +

    function :

    function to call +

    data :

    data to pass to function +
    +

    Since 2.28

    +
    +
    +
    +

    g_main_context_invoke_full ()

    +
    void                g_main_context_invoke_full          (GMainContext *context,
    +                                                         gint priority,
    +                                                         GSourceFunc function,
    +                                                         gpointer data,
    +                                                         GDestroyNotify notify);
    +

    +Invokes a function in such a way that context is owned during the +invocation of function. +

    +

    +This function is the same as g_main_context_invoke() except that it +lets you specify the priority incase function ends up being +scheduled as an idle and also lets you give a GDestroyNotify for data. +

    +

    +notify should not assume that it is called from any particular +thread or with any particular context acquired. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    context :

    a GMainContext, or NULL +

    priority :

    the priority at which to run function +

    function :

    function to call +

    data :

    data to pass to function +

    notify :

    a function to call when data is no longer in use, or NULL. +
    +

    Since 2.28

    +
    +

    g_main_context_get_thread_default ()

    GMainContext *      g_main_context_get_thread_default   (void);
    @@ -1674,7 +1802,7 @@ started while the non-default context is active.

    Beware that libraries that predate this function may not correctly handle being used from a thread with a thread-default context. Eg, -see g_file_supports_thread_contexts(). +see g_file_supports_thread_contexts().

    @@ -2160,9 +2288,10 @@ Removes the idle function with the given data.

    A type which is used to hold a process identification. -On Unix, processes are identified by a process id (an -integer), while Windows uses process handles (which are -pointers). +

    +

    +On UNIX, processes are identified by a process id (an integer), +while Windows uses process handles (which are pointers).


    @@ -2185,7 +2314,7 @@ The type of functions to be called when a child exists. @@ -2388,39 +2517,34 @@ Windows a handle for a process (which doesn't have to be a child). gushort revents; } GPollFD; -

    -

    -

    status :

    Status information about the child process, - see waitpid(2) for more information about this field + see waitpid(2) for more information about this field
    ---- +
    + + - + - - + + + + + - - +

    gint64 fd;

    -gint fd;the file descriptor to poll (or a HANDLE on Win32 platforms).
    -gushort events;a bitwise combination of flags from GIOCondition, specifying which -events should be polled for. Typically for reading from a file descriptor -you would use G_IO_IN | G_IO_HUP | G_IO_ERR, and for writing you would use -G_IO_OUT | G_IO_ERR. +

    gint fd;

    gushort events;

    a bitwise combination from GIOCondition, specifying which + events should be polled for. Typically for reading from a file + descriptor you would use G_IO_IN | G_IO_HUP | G_IO_ERR, and + for writing you would use G_IO_OUT | G_IO_ERR.
    -gushort revents;a bitwise combination of flags from GIOCondition, returned from the -poll() function to indicate which events occurred. +

    gushort revents;

    a bitwise combination of flags from GIOCondition, returned + from the poll() function to indicate which events occurred.
    -

    -


    @@ -2493,8 +2617,8 @@ if the call was interrupted. } GSource;

    -The GSource struct is an opaque data type representing -an event source. +The GSource struct is an opaque data type +representing an event source.


    @@ -2502,7 +2626,7 @@ an event source.

    GSourceDummyMarshal ()

    void                (*GSourceDummyMarshal)              (void);

    -This is just a placeholder for GClosureMarshal, which cannot be used here +This is just a placeholder for GClosureMarshal, which cannot be used here for dependency reasons.

    @@ -2511,75 +2635,74 @@ for dependency reasons.

    GSourceFuncs

    typedef struct {
       gboolean (*prepare)  (GSource    *source,
    -			gint       *timeout_);
    +                        gint       *timeout_);
       gboolean (*check)    (GSource    *source);
       gboolean (*dispatch) (GSource    *source,
    -			GSourceFunc callback,
    -			gpointer    user_data);
    +                        GSourceFunc callback,
    +                        gpointer    user_data);
       void     (*finalize) (GSource    *source); /* Can be NULL */
     
       /* For use by g_source_set_closure */
    -  GSourceFunc     closure_callback;	   
    +  GSourceFunc     closure_callback;        
       GSourceDummyMarshal closure_marshal; /* Really is of type GClosureMarshal */
     } GSourceFuncs;
     

    -The GSourceFuncs struct contains a table of functions used to handle -event sources in a generic manner. +The GSourceFuncs struct contains a table of +functions used to handle event sources in a generic manner.

    -For idle sources, the prepare and check functions always return TRUE to -indicate that the source is always ready to be processed. -The prepare function also returns a timeout value of 0 to ensure that the -poll() call doesn't block (since that would be time -wasted which could have been spent running the idle function). +For idle sources, the prepare and check functions always return TRUE +to indicate that the source is always ready to be processed. The prepare +function also returns a timeout value of 0 to ensure that the poll() call +doesn't block (since that would be time wasted which could have been spent +running the idle function).

    -For timeout sources, the prepare and check functions both return TRUE if the -timeout interval has expired. The prepare function also returns a timeout -value to ensure that the poll() call doesn't block too -long and miss the next timeout. +For timeout sources, the prepare and check functions both return TRUE +if the timeout interval has expired. The prepare function also returns +a timeout value to ensure that the poll() call doesn't block too long +and miss the next timeout.

    For file descriptor sources, the prepare function typically returns FALSE, -since it must wait until poll() has been called before -it knows whether any events need to be processed. It sets the returned -timeout to -1 to indicate that it doesn't mind how long the -poll() call blocks. -In the check function, it tests the results of the poll() -call to see if the required condition has been met, and returns TRUE if so. +since it must wait until poll() has been called before it knows whether +any events need to be processed. It sets the returned timeout to -1 to +indicate that it doesn't mind how long the poll() call blocks. In the +check function, it tests the results of the poll() call to see if the +required condition has been met, and returns TRUE if so.

    - - - @@ -2589,13 +2712,11 @@ needed for this type of event source. - + - +

    prepare ()

    Called before all the file descriptors are polled. -If the source can determine that it is ready here (without waiting for the -results of the poll() call) it should return TRUE. -It can also return a timeout_ value which should be the maximum timeout -(in milliseconds) which should be passed to the poll() call. -The actual timeout used will be -1 if all sources returned -1, or it will -be the minimum of all the timeout_ values returned which were >= 0. +Called before all the file descriptors are polled. If the + source can determine that it is ready here (without waiting for the + results of the poll() call) it should return TRUE. It can also return + a timeout_ value which should be the maximum timeout (in milliseconds) + which should be passed to the poll() call. The actual timeout used will + be -1 if all sources returned -1, or it will be the minimum of all the + timeout_ values returned which were >= 0.

    check ()

    Called after all the file descriptors are polled. -The source should return TRUE if it is ready to be dispatched. -Note that some time may have passed since the previous prepare function was -called, so the source should be checked again here. +Called after all the file descriptors are polled. The source + should return TRUE if it is ready to be dispatched. Note that some + time may have passed since the previous prepare function was called, + so the source should be checked again here.

    dispatch ()

    Called to dispatch the event source, after it has returned TRUE in -either its prepare or its check function. The dispatch function is -passed in a callback function and data. The callback function may be -NULL if the source was never connected to a callback using -g_source_set_callback(). The dispatch function should call the -callback function with user_data and whatever additional parameters are -needed for this type of event source. +Called to dispatch the event source, after it has returned + TRUE in either its prepare or its check function. The dispatch + function is passed in a callback function and data. The callback + function may be NULL if the source was never connected to a callback + using g_source_set_callback(). The dispatch function should call the + callback function with user_data and whatever additional parameters + are needed for this type of event source.

    GSourceFunc closure_callback;

    -

    GSourceDummyMarshal closure_marshal;

    -
    @@ -2607,9 +2728,9 @@ needed for this type of event source. void (*ref) (gpointer cb_data); void (*unref) (gpointer cb_data); void (*get) (gpointer cb_data, - GSource *source, - GSourceFunc *func, - gpointer *data); + GSource *source, + GSourceFunc *func, + gpointer *data); } GSourceCallbackFuncs;

    @@ -2621,17 +2742,18 @@ functions for managing callback objects.

    ref ()

    -Called when a reference is added to the callback object. +Called when a reference is added to the callback object

    unref ()

    -Called when a reference to the callback object is dropped. +Called when a reference to the callback object is dropped

    get ()

    -Called to extract the callback function and data from the callback object. +Called to extract the callback function and data from the + callback object. @@ -2843,10 +2965,10 @@ before the dispatch of your idle handler. { SomeWidget *self = data; - GDK_THREADS_ENTER (); + GDK_THREADS_ENTER (); /* do stuff with self */ self->idle_id = 0; - GDK_THREADS_LEAVE (); + GDK_THREADS_LEAVE (); return FALSE; } @@ -2865,7 +2987,7 @@ before the dispatch of your idle handler. if (self->idle_id) g_source_remove (self->idle_id); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -2906,12 +3028,12 @@ has already been destroy within the callback. { SomeWidget *self = data; - GDK_THREADS_ENTER (); + GDK_THREADS_ENTER (); if (!g_source_is_destroyed (g_main_current_source ())) { /* do stuff with self */ } - GDK_THREADS_LEAVE (); + GDK_THREADS_LEAVE (); return FALSE; } @@ -2946,9 +3068,10 @@ has already been destroy within the callback.
    void                g_source_set_priority               (GSource *source,
                                                              gint priority);

    -Sets the priority of a source. While the main loop is being -run, a source will be dispatched if it is ready to be dispatched and no sources -at a higher (numerically smaller) priority are ready to be dispatched. +Sets the priority of a source. While the main loop is being run, a +source will be dispatched if it is ready to be dispatched and no +sources at a higher (numerically smaller) priority are ready to be +dispatched.

    @@ -3067,6 +3190,98 @@ mapping from ID to source is done by +

    g_source_get_name ()

    +
    const char*         g_source_get_name                   (GSource *source);
    +

    +Gets a name for the source, used in debugging and profiling. +The name may be NULL if it has never been set with +g_source_set_name(). +

    +
    ++ + + + + + + + + + +

    source :

    a GSource +

    Returns :

    the name of the source +
    +

    Since 2.26

    + +
    +
    +

    g_source_set_name ()

    +
    void                g_source_set_name                   (GSource *source,
    +                                                         const char *name);
    +

    +Sets a name for the source, used in debugging and profiling. +The name defaults to NULL. +

    +

    +The source name should describe in a human-readable way +what the source does. For example, "X11 event queue" +or "GTK+ repaint idle handler" or whatever it is. +

    +

    +It is permitted to call this function multiple times, but is not +recommended due to the potential performance impact. For example, +one could change the name in the "check" function of a GSourceFuncs +to include details like the event type in the source name. +

    +
    ++ + + + + + + + + + +

    source :

    a GSource +

    name :

    debug name for the source +
    +

    Since 2.26

    +
    +
    +
    +

    g_source_set_name_by_id ()

    +
    void                g_source_set_name_by_id             (guint tag,
    +                                                         const char *name);
    +

    +Sets the name of a source using its ID. +

    +

    +This is a convenience utility to set source names from the return +value of g_idle_add(), g_timeout_add(), etc. +

    +
    ++ + + + + + + + + + +

    tag :

    a GSource ID +

    name :

    debug name for the source +
    +

    Since 2.26

    +
    +

    g_source_get_context ()

    GMainContext *      g_source_get_context                (GSource *source);
    @@ -3254,10 +3469,112 @@ this source.

    +
    +

    g_source_add_child_source ()

    +
    void                g_source_add_child_source           (GSource *source,
    +                                                         GSource *child_source);
    +

    +Adds child_source to source as a "polled" source; when source is +added to a GMainContext, child_source will be automatically added +with the same priority, when child_source is triggered, it will +cause source to dispatch (and won't call child_source's own +callback), and when source is destroyed, it will destroy +child_source as well. (source will also still be dispatched if +its own prepare/check functions indicate that it is ready.) +

    +

    +If you need child_source to do anything on its own when it +triggers, you can call g_source_set_dummy_callback() on it to set a +callback that does nothing (except return TRUE if appropriate). +

    +

    +source will hold a reference on child_source while child_source +is attached to it. +

    +
    ++ + + + + + + + + + +

    source :

    a GSource +

    child_source :

    a second GSource that source should "poll" +
    +

    Since 2.28

    +
    +
    +
    +

    g_source_remove_child_source ()

    +
    void                g_source_remove_child_source        (GSource *source,
    +                                                         GSource *child_source);
    +

    +Detaches child_source from source and destroys it. +

    +
    ++ + + + + + + + + + +

    source :

    a GSource +

    child_source :

    a GSource previously passed to + g_source_add_child_source(). +
    +

    Since 2.28

    +
    +
    +
    +

    g_source_get_time ()

    +
    gint64              g_source_get_time                   (GSource *source);
    +

    +Gets the time to be used when checking this source. The advantage of +calling this function over calling g_get_monotonic_time() directly is +that when checking multiple sources, GLib can cache a single value +instead of having to repeatedly get the system monotonic time. +

    +

    +The time here is the system monotonic time, if available, or some +other reasonable alternative otherwise. See g_get_monotonic_time(). +

    +
    ++ + + + + + + + + + +

    source :

    a GSource +

    Returns :

    the monotonic time in microseconds + +
    +

    Since 2.28

    +
    +

    g_source_get_current_time ()

    void                g_source_get_current_time           (GSource *source,
                                                              GTimeVal *timeval);
    +
    +

    Warning

    +

    g_source_get_current_time has been deprecated since version 2.28 and should not be used in newly-written code. use g_source_get_time() instead

    +

    Gets the "current time" to be used when checking this source. The advantage of calling this function over @@ -3374,6 +3691,6 @@ data, only one will be destroyed.

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Thread-Pools.html b/docs/reference/glib/html/glib-Thread-Pools.html index bf16174..fe97a5e 100644 --- a/docs/reference/glib/html/glib-Thread-Pools.html +++ b/docs/reference/glib/html/glib-Thread-Pools.html @@ -3,12 +3,12 @@ Thread Pools - + - + @@ -601,6 +601,6 @@ new work are not stopped. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Threads.html b/docs/reference/glib/html/glib-Threads.html index 97249f7..fbadc87 100644 --- a/docs/reference/glib/html/glib-Threads.html +++ b/docs/reference/glib/html/glib-Threads.html @@ -3,12 +3,12 @@ Threads - + - + @@ -207,10 +207,10 @@ this should be avoided if possible.

    Please note that since version 2.24 the GObject initialization -function g_type_init() initializes threads (with a NULL argument), +function g_type_init() initializes threads (with a NULL argument), so most applications, including those using Gtk+ will run with threads enabled. If you want a special thread implementation, make -sure you call g_thread_init() before g_type_init() is called. +sure you call g_thread_init() before g_type_init() is called.

    After calling g_thread_init(), GLib is completely thread safe (all @@ -1023,7 +1023,7 @@ access. Take for example the following function:

    -

    Example 2. A function which will not work in a threaded environment

    +

    Example 2. A function which will not work in a threaded environment

    @@ -1068,7 +1068,7 @@ access. A first naive implementation would be:

    -

    Example 3. The wrong way to write a thread-safe function

    +

    Example 3. The wrong way to write a thread-safe function

    @@ -1120,7 +1120,7 @@ is:

    -

    Example 4. A correct thread-safe function

    +

    Example 4. A correct thread-safe function

    @@ -1368,7 +1368,7 @@ example:

    -

    Example 5.  +

    Example 5.  Using GStaticMutex to simplify thread-safe programming

    @@ -1619,7 +1619,7 @@ of the variable you intent to protect with the lock. Look at our

    -

    Example 6. Using the G_LOCK_* convenience macros

    +

    Example 6. Using the G_LOCK_* convenience macros

    @@ -1994,7 +1994,7 @@ example:

    -

    Example 7. An array with access functions

    +

    Example 7. An array with access functions

    @@ -2341,7 +2341,7 @@ threads to be woken up.

    -

    Example 8.  +

    Example 8.  Using GCond to block a thread until a condition is satisfied

    @@ -2615,7 +2615,7 @@ This can be done as follows:

    -

    Example 9. Using GPrivate for per-thread data

    +

    Example 9. Using GPrivate for per-thread data

    @@ -2824,7 +2824,7 @@ look at our give_me_next_number()<

    -

    Example 10. Using GStaticPrivate for per-thread data

    +

    Example 10. Using GStaticPrivate for per-thread data

    @@ -3406,6 +3406,6 @@ reliably. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Timers.html b/docs/reference/glib/html/glib-Timers.html index 67883f7..1a2e08f 100644 --- a/docs/reference/glib/html/glib-Timers.html +++ b/docs/reference/glib/html/glib-Timers.html @@ -3,12 +3,12 @@ Timers - + - + @@ -59,19 +59,6 @@ that time. This is done somewhat differently on different platforms, and can be tricky to get exactly right, so GTimer provides a portable/convenient interface.

    -

    -

    -
    -

    Note

    -

    - GTimer uses a higher-quality clock when thread support is available. - Therefore, calling g_thread_init() while timers are running may lead to - unreliable results. It is best to call g_thread_init() before starting any - timers, if you are using threads at all. -

    -
    -

    -

    Details

    @@ -240,6 +227,6 @@ Destroys a timer, freeing associated resources.
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Trash-Stacks.html b/docs/reference/glib/html/glib-Trash-Stacks.html index 049b2a6..bebcd65 100644 --- a/docs/reference/glib/html/glib-Trash-Stacks.html +++ b/docs/reference/glib/html/glib-Trash-Stacks.html @@ -3,12 +3,12 @@ Trash Stacks - + - + @@ -183,6 +183,6 @@ where N denotes the number of items on the stack. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Type-Conversion-Macros.html b/docs/reference/glib/html/glib-Type-Conversion-Macros.html index c03df86..e1e02ae 100644 --- a/docs/reference/glib/html/glib-Type-Conversion-Macros.html +++ b/docs/reference/glib/html/glib-Type-Conversion-Macros.html @@ -3,12 +3,12 @@ Type Conversion Macros - + - + @@ -258,6 +258,6 @@ been stored in the pointer with
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-URI-Functions.html b/docs/reference/glib/html/glib-URI-Functions.html index 4336e45..b61bf8b 100644 --- a/docs/reference/glib/html/glib-URI-Functions.html +++ b/docs/reference/glib/html/glib-URI-Functions.html @@ -3,12 +3,12 @@ URI Functions - + - + @@ -55,6 +55,12 @@ const char *escaped_string_end, const char *illegal_characters);
    gchar ** g_uri_list_extract_uris (const gchar *uri_list); +gchar * g_filename_from_uri (const gchar *uri, + gchar **hostname, + GError **error); +gchar * g_filename_to_uri (const gchar *filename, + const gchar *hostname, + GError **error);
    @@ -172,7 +178,7 @@ a URI.
    @@ -305,10 +311,90 @@ discarding any comments. The URIs are not validated.

    reserved_chars_allowed :

    a string of reserved characters that are - allowed to be used. + allowed to be used, or NULL.

    Since 2.6

    +
    +
    +

    g_filename_from_uri ()

    +
    gchar *             g_filename_from_uri                 (const gchar *uri,
    +                                                         gchar **hostname,
    +                                                         GError **error);
    +

    +Converts an escaped ASCII-encoded URI to a local filename in the +encoding used for filenames. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    uri :

    a uri describing a filename (escaped, encoded in ASCII). +

    hostname :

    Location to store hostname for the URI, or NULL. + If there is no hostname in the URI, NULL will be + stored in this location. +

    error :

    location to store the error occuring, or NULL to ignore + errors. Any of the errors in GConvertError may occur. +

    Returns :

    a newly-allocated string holding the resulting + filename, or NULL on an error. +
    +
    +
    +
    +

    g_filename_to_uri ()

    +
    gchar *             g_filename_to_uri                   (const gchar *filename,
    +                                                         const gchar *hostname,
    +                                                         GError **error);
    +

    +Converts an absolute filename to an escaped ASCII-encoded URI, with the path +component following Section 3.3. of RFC 2396. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    filename :

    an absolute filename specified in the GLib file name encoding, + which is the on-disk file name bytes on Unix, and UTF-8 on + Windows +

    hostname :

    A UTF-8 encoded hostname, or NULL for none. +

    error :

    location to store the error occuring, or NULL to ignore + errors. Any of the errors in GConvertError may occur. +

    Returns :

    a newly-allocated string holding the resulting + URI, or NULL on an error. +
    +
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Unicode-Manipulation.html b/docs/reference/glib/html/glib-Unicode-Manipulation.html index dd116ed..f008eb2 100644 --- a/docs/reference/glib/html/glib-Unicode-Manipulation.html +++ b/docs/reference/glib/html/glib-Unicode-Manipulation.html @@ -3,12 +3,12 @@ Unicode Manipulation - + - + @@ -1554,7 +1554,24 @@ pointed to by mirrored_ch. Otherwise th G_UNICODE_SCRIPT_VAI, /* Vaii */ G_UNICODE_SCRIPT_CARIAN, /* Cari */ G_UNICODE_SCRIPT_LYCIAN, /* Lyci */ - G_UNICODE_SCRIPT_LYDIAN /* Lydi */ + G_UNICODE_SCRIPT_LYDIAN, /* Lydi */ + + /* Unicode-5.2 additions */ + G_UNICODE_SCRIPT_AVESTAN, /* Avestan */ + G_UNICODE_SCRIPT_BAMUM, /* Bamum */ + G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyptian Hieroglyphs */ + G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC, /* Imperial Aramaic */ + G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Inscriptional Pahlavi */ + G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Inscriptional Parthian */ + G_UNICODE_SCRIPT_JAVANESE, /* Javanese */ + G_UNICODE_SCRIPT_KAITHI, /* Kaithi */ + G_UNICODE_SCRIPT_LISU, /* Lisu */ + G_UNICODE_SCRIPT_MEETEI_MAYEK, /* Meetei Mayek */ + G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN, /* Old South Arabian */ + G_UNICODE_SCRIPT_OLD_TURKISH, /* Old Turkish */ + G_UNICODE_SCRIPT_SAMARITAN, /* Samaritan */ + G_UNICODE_SCRIPT_TAI_THAM, /* Tai Tham */ + G_UNICODE_SCRIPT_TAI_VIET /* Tai Viet */ } GUnicodeScript;

    @@ -1967,6 +1984,81 @@ See U Lydian. Since 2.16.3 + +

    G_UNICODE_SCRIPT_AVESTAN

    + Avestan. Since 2.26 + + + +

    G_UNICODE_SCRIPT_BAMUM

    + Bamum. Since 2.26 + + + +

    G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS

    + Egyptian Hieroglpyhs. Since 2.26 + + + +

    G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC

    + Imperial Aramaic. Since 2.26 + + + +

    G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI

    + Inscriptional Pahlavi. Since 2.26 + + + +

    G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN

    +Inscriptional Parthian. Since 2.26 + + + +

    G_UNICODE_SCRIPT_JAVANESE

    + Javanese. Since 2.26 + + + +

    G_UNICODE_SCRIPT_KAITHI

    + Kaithi. Since 2.26 + + + +

    G_UNICODE_SCRIPT_LISU

    + Lisu. Since 2.26 + + + +

    G_UNICODE_SCRIPT_MEETEI_MAYEK

    + Meetei Mayek. Since 2.26 + + + +

    G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN

    + Old South Arabian. Since 2.26 + + + +

    G_UNICODE_SCRIPT_OLD_TURKISH

    + Old Turkish. Since 2.26 + + + +

    G_UNICODE_SCRIPT_SAMARITAN

    + Samaritan. Since 2.26 + + + +

    G_UNICODE_SCRIPT_TAI_THAM

    + Tai Tham. Since 2.26 + + + +

    G_UNICODE_SCRIPT_TAI_VIET

    + Tai Viet. Since 2.26 + + @@ -3351,6 +3443,6 @@ Convenience functions for converting between UTF-8 and the locale encoding. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Version-Information.html b/docs/reference/glib/html/glib-Version-Information.html index 6f70f1e..8140321 100644 --- a/docs/reference/glib/html/glib-Version-Information.html +++ b/docs/reference/glib/html/glib-Version-Information.html @@ -3,12 +3,12 @@ Version Information - + - + @@ -72,11 +72,11 @@ at application run time.

    GLIB_MINOR_VERSION

    -
    #define GLIB_MINOR_VERSION 24
    +
    #define GLIB_MINOR_VERSION 27
     

    The minor version number of the GLib library. -Like gtk_minor_version, but from the headers used at +Like gtk_minor_version, but from the headers used at application compile time, rather than from the library linked against at application run time.

    @@ -84,11 +84,11 @@ at application run time.

    GLIB_MICRO_VERSION

    -
    #define GLIB_MICRO_VERSION 2
    +
    #define GLIB_MICRO_VERSION 5
     

    The micro version number of the GLib library. -Like gtk_micro_version, but from the headers used at +Like gtk_micro_version, but from the headers used at application compile time, rather than from the library linked against at application run time.

    @@ -103,7 +103,7 @@ Returns as or newer than the passed-in version.

    -

    Example 1. Checking the version of the GLib library

    +

    Example 1. Checking the version of the GLib library

    @@ -145,6 +145,6 @@ as or newer than the passed-in version. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Warnings-and-Assertions.html b/docs/reference/glib/html/glib-Warnings-and-Assertions.html index ea3276a..1869b3a 100644 --- a/docs/reference/glib/html/glib-Warnings-and-Assertions.html +++ b/docs/reference/glib/html/glib-Warnings-and-Assertions.html @@ -3,12 +3,12 @@ Message Output and Debugging Functions - + - + @@ -392,7 +392,7 @@ This function may cause different actions on non-UNIX platforms.

    prg_name :

    the program name, needed by gdb for the [S]tack trace option. If prg_name is NULL, g_get_prgname() is called to get the program name -(which will work correctly if gdk_init() or gtk_init() has been called). +(which will work correctly if gdk_init() or gtk_init() has been called).
    @@ -414,7 +414,7 @@ This function may cause different actions on non-UNIX platforms.

    prg_name :

    the program name, needed by gdb for the [S]tack trace option. If prg_name is NULL, g_get_prgname() is called to get the program name -(which will work correctly if gdk_init() or gtk_init() has been called). +(which will work correctly if gdk_init() or gtk_init() has been called).
    @@ -433,6 +433,6 @@ a SIGTRAP signal.
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-Windows-Compatibility-Functions.html b/docs/reference/glib/html/glib-Windows-Compatibility-Functions.html index b510785..e76d207 100644 --- a/docs/reference/glib/html/glib-Windows-Compatibility-Functions.html +++ b/docs/reference/glib/html/glib-Windows-Compatibility-Functions.html @@ -3,12 +3,12 @@ Windows Compatibility Functions - + - + @@ -471,6 +471,6 @@ On non-Windows platforms, it is not defined. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-building.html b/docs/reference/glib/html/glib-building.html index 807be16..17c6f49 100644 --- a/docs/reference/glib/html/glib-building.html +++ b/docs/reference/glib/html/glib-building.html @@ -3,12 +3,12 @@ Compiling the GLib package - + - + @@ -60,7 +60,7 @@ How to compile GLib itself

    The GTK+ documentation contains - further details + further details about the build process and ways to influence it.

    @@ -175,6 +175,15 @@ How to compile GLib itself GLib without SELinux support, use the --disable-selinux configure option.

    +
  • + The optional support for DTrace requires the sys/sdt.h header, + which is provided by SystemTap on Linux. To build GLib without DTrace, use the + --disable-dtrace configure option. +

  • +
  • + The optional support for SystemTap can be disabled with the + --disable-systemtap configure option. +

  • @@ -185,7 +194,7 @@ How to compile GLib itself library supports these additional arguments:

    -

    configure [[--enable-debug=[no|minimum|yes]]] [[--disable-gc-friendly] | [--enable-gc-friendly]] [[--disable-mem-pools] | [--enable-mem-pools]] [[--disable-threads] | [--enable-threads]] [[--with-threads=[none|posix|dce|win32]]] [[--disable-regex] | [--enable-regex]] [[--with-pcre=[internal|system]]] [[--disable-included-printf] | [--enable-included-printf]] [[--disable-visibility] | [--enable-visibility]] [[--disable-gtk-doc] | [--enable-gtk-doc]] [[--disable-man] | [--enable-man]] [[--disable-xattr] | [--enable-xattr]] [[--disable-selinux] | [--enable-selinux]] [[--with-runtime-libdir=RELPATH]]

    +

    configure [[--enable-debug=[no|minimum|yes]]] [[--disable-gc-friendly] | [--enable-gc-friendly]] [[--disable-mem-pools] | [--enable-mem-pools]] [[--disable-threads] | [--enable-threads]] [[--with-threads=[none|posix|dce|win32]]] [[--disable-regex] | [--enable-regex]] [[--with-pcre=[internal|system]]] [[--disable-included-printf] | [--enable-included-printf]] [[--disable-Bsymbolic] | [--enable-Bsymbolic]] [[--disable-gtk-doc] | [--enable-gtk-doc]] [[--disable-man] | [--enable-man]] [[--disable-xattr] | [--enable-xattr]] [[--disable-selinux] | [--enable-selinux]] [[--disable-dtrace] | [--enable-dtrace]] [[--disable-systemtap] | [--enable-systemtap]] [[--enable-gcov] | [--disable-gcov]] [[--with-runtime-libdir=RELPATH]]

    --enable-debug.  @@ -363,17 +372,16 @@ How to compile GLib itself an implementation fo the printf() family should be included or not.

    -

    --disable-visibility and - --enable-visibility.  - By default, GLib uses ELF visibility attributes to optimize - PLT table entries if the compiler supports ELF visibility - attributes. A side-effect of the way in which this is currently - implemented is that any header change forces a full - recompilation, and missing includes may go unnoticed. - Therefore, it makes sense to turn this feature off while - doing GLib development, even if the compiler supports ELF - visibility attributes. The --disable-visibility - option allows to do that. +

    --disable-Bsymbolic and + --enable-Bsymbolic.  + By default, GLib uses the -Bsymbolic-functions linker + flag to avoid intra-library PLT jumps. A side-effect + of this is that it is no longer possible to override + internal uses of GLib functions with + <envvar>LD_PRELOAD</envvar>. Therefore, it may make + sense to turn this feature off in some situations. + The --disable-Bsymbolic option allows + to do that.

    --disable-gtk-doc and --enable-gtk-doc.  @@ -417,6 +425,25 @@ How to compile GLib itself used to explicitly control whether SELinux support should be included.

    +

    --disable-dtrace and + --enable-dtrace.  + By default the configure script will + detect if DTrace support is available, and use it. +

    +

    --disable-systemtap and + --enable-systemtap.  + This option requires DTrace support. If it is available, then + the configure script will also check for + the presence of SystemTap. +

    +

    --enable-gcov and + --disable-gcov.  + Enable the generation of coverage reports for the GLib tests. + This requires the lcov frontend to gcov from the + Linux Test Project. + To generate a coverage report, use the lcov make target. The + report is placed in the glib-lcov directory. +

    --with-runtime-libdir=RELPATH.  Allows specifying a relative path to where to install the runtime libraries (meaning library files used for running, not developing, @@ -433,6 +460,6 @@ How to compile GLib itself

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-changes.html b/docs/reference/glib/html/glib-changes.html index 576f814..516781f 100644 --- a/docs/reference/glib/html/glib-changes.html +++ b/docs/reference/glib/html/glib-changes.html @@ -3,12 +3,12 @@ Changes to GLib - + - + @@ -31,7 +31,7 @@ Incompatible changes made between successing versions of GLib
    -

    Incompatible changes from 2.0 to 2.2

    +

    Incompatible changes from 2.0 to 2.2

    • GLib changed the seeding algorithm for the pseudo-random number @@ -56,13 +56,7 @@ with Glib-2.0 that you need to reproduce exactly.

    -

    Incompatible changes from 1.2 to 2.0

    -

    -The GNOME 2.0 -porting guide on http://developer.gnome.org -has some more detailed discussion of porting from 1.2 to 2.0. -See the section on GLib. -

    +

    Incompatible changes from 1.2 to 2.0

    • @@ -154,6 +148,6 @@ Deprecated functions that got removed:

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-compiling.html b/docs/reference/glib/html/glib-compiling.html index 7d1f08e..a9b523b 100644 --- a/docs/reference/glib/html/glib-compiling.html +++ b/docs/reference/glib/html/glib-compiling.html @@ -3,12 +3,12 @@ Compiling GLib Applications - + - + @@ -31,7 +31,7 @@ How to compile your GLib application
    -

    Compiling GLib Applications on UNIX

    +

    Compiling GLib Applications on UNIX

    To compile a GLib application, you need to tell the compiler where to find the GLib header files and libraries. This is done with the @@ -113,6 +113,6 @@ by using the command line option -DG_DISABLE_SINGLE_INCLUD

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-core.html b/docs/reference/glib/html/glib-core.html index 0cebc65..f458305 100644 --- a/docs/reference/glib/html/glib-core.html +++ b/docs/reference/glib/html/glib-core.html @@ -3,12 +3,12 @@ GLib Core Application Support - + - + @@ -59,6 +59,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-cross-compiling.html b/docs/reference/glib/html/glib-cross-compiling.html index ef4b315..21a75af 100644 --- a/docs/reference/glib/html/glib-cross-compiling.html +++ b/docs/reference/glib/html/glib-cross-compiling.html @@ -3,12 +3,12 @@ Cross-compiling the GLib package - + - + @@ -155,6 +155,6 @@ chmod a-w win32.cache # prevent configure from changing it + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-data-types.html b/docs/reference/glib/html/glib-data-types.html index d6815af..655ac96 100644 --- a/docs/reference/glib/html/glib-data-types.html +++ b/docs/reference/glib/html/glib-data-types.html @@ -3,12 +3,12 @@ GLib Data Types - + - + @@ -115,6 +115,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-fundamentals.html b/docs/reference/glib/html/glib-fundamentals.html index 8d26156..50a1c8e 100644 --- a/docs/reference/glib/html/glib-fundamentals.html +++ b/docs/reference/glib/html/glib-fundamentals.html @@ -3,12 +3,12 @@ GLib Fundamentals - + - + @@ -54,6 +54,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-gettextize.html b/docs/reference/glib/html/glib-gettextize.html index 8770b3d..79938cf 100644 --- a/docs/reference/glib/html/glib-gettextize.html +++ b/docs/reference/glib/html/glib-gettextize.html @@ -3,12 +3,12 @@ glib-gettextize - + - + @@ -19,7 +19,7 @@ GLib Reference Manual Next -
    +
    @@ -33,7 +33,7 @@

    glib-gettextize [option...] [directory]

    -

    Description

    +

    Description

    glib-gettextize helps to prepare a source package for being internationalized through gettext. It is a variant of the gettextize that ships with @@ -47,7 +47,7 @@ from gettextize in that it doesn't --no-changelog option).

    -

    Options

    +

    Options

    @@ -80,14 +80,14 @@ force writing of new files even if old ones exist
    -

    See also

    +

    See also

    -gettextize(1) +gettextize(1)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-regex-syntax.html b/docs/reference/glib/html/glib-regex-syntax.html index c60b781..ee96667 100644 --- a/docs/reference/glib/html/glib-regex-syntax.html +++ b/docs/reference/glib/html/glib-regex-syntax.html @@ -3,12 +3,12 @@ Regular expression syntax - + - + @@ -31,7 +31,7 @@ Syntax and semantics of the regular expressions supported by GRegex
    -

    GRegex regular expression details

    +

    GRegex regular expression details

    A regular expression is a pattern that is matched against a string from left to right. Most characters stand for themselves in a @@ -59,7 +59,7 @@ that are recognized in square brackets. Outside square brackets, the metacharacters are as follows:

    -

    Table 1. Metacharacters outside square brackets

    +

    Table 1. Metacharacters outside square brackets

    @@ -126,7 +126,7 @@ Part of a pattern that is in square brackets is called a "character class". In a character class the only metacharacters are:

    -

    Table 2. Metacharacters inside square brackets

    +

    Table 2. Metacharacters inside square brackets

    @@ -163,7 +163,7 @@ class". In a character class the only metacharacters are:
    -

    Backslash

    +

    Backslash

    The backslash character has several uses. Firstly, if it is followed by a non-alphanumeric character, it takes away any special meaning that @@ -187,13 +187,18 @@ An escaping backslash can be used to include a whitespace or # character as part of the pattern.

    +Note that the C compiler interprets backslash in strings itself, therefore +you need to duplicate all \ characters when you put a regular expression +in a C string, like "\\d{3}". +

    +

    If you want to remove the special meaning from a sequence of characters, you can do so by putting them between \Q and \E. The \Q...\E sequence is recognized both inside and outside character classes.

    -

    Non-printing characters

    +

    Non-printing characters

    A second use of backslash provides a way of encoding non-printing characters in patterns in a visible manner. There is no restriction on the @@ -203,7 +208,7 @@ editing, it is usually easier to use one of the following escape sequences than the binary character it represents:

    -

    Table 3. Non-printing characters

    +

    Table 3. Non-printing characters

    @@ -304,7 +309,7 @@ up to three octal digits following the backslash, and uses them to generate a data character. Any subsequent digits stand for themselves. For example:

    -

    Table 4. Non-printing characters

    +

    Table 4. Non-printing characters

    @@ -368,7 +373,7 @@ Outside a character class, these sequences have different meanings (see below).
    -

    Absolute and relative back references

    +

    Absolute and relative back references

    The sequence \g followed by a positive or negative number, optionally enclosed in braces, is an absolute or relative back reference. Back references are @@ -377,13 +382,13 @@ discussed later, following the discussion of parenthesized subpatterns.


    -

    Generic character types

    +

    Generic character types

    Another use of backslash is for specifying generic character types. The following are always recognized:

    -

    Table 5. Generic characters

    +

    Table 5. Generic characters

    @@ -447,7 +452,7 @@ Characters with values greater than 128 never match \d,
    -

    Newline sequences

    +

    Newline sequences

    Outside a character class, the escape sequence \R matches any Unicode newline sequence. This particular group matches either the two-character sequence CR followed by @@ -459,13 +464,13 @@ cannot be split. Inside a character class, \R matches the letter "R".


    -

    Unicode character properties

    +

    Unicode character properties

    To support generic character types there are three additional escape sequences, they are:

    -

    Table 6. Generic character types

    +

    Table 6. Generic character types

    @@ -505,76 +510,11 @@ example, \p{Greek} or \P{Han}.

    Those that are not part of an identified script are lumped together as -"Common". The current list of scripts is: +"Common". The current list of scripts can be found in the documentation for +the #GUnicodeScript enumeration. Script names for use with \p{} can be +found by replacing all spaces with underscores, e.g. for Linear B use +\p{Linear_B}.

    -
      -
    • Arabic

    • -
    • Armenian

    • -
    • Balinese

    • -
    • Bengali

    • -
    • Bopomofo

    • -
    • Braille

    • -
    • Buginese

    • -
    • Buhid

    • -
    • Canadian_Aboriginal

    • -
    • Cherokee

    • -
    • Common

    • -
    • Coptic

    • -
    • Cuneiform

    • -
    • Cypriot

    • -
    • Cyrillic

    • -
    • Deseret

    • -
    • Devanagari

    • -
    • Ethiopic

    • -
    • Georgian

    • -
    • Glagolitic

    • -
    • Gothic

    • -
    • Greek

    • -
    • Gujarati

    • -
    • Gurmukhi

    • -
    • Han

    • -
    • Hangul

    • -
    • Hanunoo

    • -
    • Hebrew

    • -
    • Hiragana

    • -
    • Inherited

    • -
    • Kannada

    • -
    • Katakana

    • -
    • Kharoshthi

    • -
    • Khmer

    • -
    • Lao

    • -
    • Latin

    • -
    • Limbu

    • -
    • Linear_B

    • -
    • Malayalam

    • -
    • Mongolian

    • -
    • Myanmar

    • -
    • New_Tai_Lue

    • -
    • Nko

    • -
    • Ogham

    • -
    • Old_Italic

    • -
    • Old_Persian

    • -
    • Oriya

    • -
    • Osmanya

    • -
    • Phags_Pa

    • -
    • Phoenician

    • -
    • Runic

    • -
    • Shavian

    • -
    • Sinhala

    • -
    • Syloti_Nagri

    • -
    • Syriac

    • -
    • Tagalog

    • -
    • Tagbanwa

    • -
    • Tai_Le

    • -
    • Tamil

    • -
    • Telugu

    • -
    • Thaana

    • -
    • Thai

    • -
    • Tibetan

    • -
    • Tifinagh

    • -
    • Ugaritic

    • -
    • Yi

    • -

    Each character has exactly one general category property, specified by a two-letter abbreviation. For compatibility with Perl, negation can be specified @@ -592,10 +532,12 @@ examples have the same effect: \pL

    -The following general category property codes are supported: +In addition to the two-letter category codes listed in the +documentation for the #GUnicodeType enumeration, the following +general category property codes are supported:

    -

    Table 7. Property codes

    +

    Table 7. Property codes

    @@ -611,149 +553,29 @@ The following general category property codes are supported: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Other
    CcControl
    CfFormat
    CnUnassigned
    CoPrivate use
    CsSurrogate
    L Letter
    LlLower case letter
    LmModifier letter
    LoOther letter
    LtTitle case letter
    LuUpper case letter
    M Mark
    McSpacing mark
    MeEnclosing mark
    MnNon-spacing mark
    N Number
    NdDecimal number
    NlLetter number
    NoOther number
    P Punctuation
    PcConnector punctuation
    PdDash punctuation
    PeClose punctuation
    PfFinal punctuation
    PiInitial punctuation
    PoOther punctuation
    PsOpen punctuation
    S Symbol
    ScCurrency symbol
    SkModifier symbol
    SmMathematical symbol
    SoOther symbol
    Z Separator
    ZlLine separator
    ZpParagraph separator
    ZsSpace separator
    @@ -798,7 +620,7 @@ characters. That is why the traditional escape sequences such as \d and

    -

    Simple assertions

    +

    Simple assertions

    The final use of backslash is for certain simple assertions. An assertion specifies a condition that has to be met at a particular point in @@ -807,7 +629,7 @@ use of subpatterns for more complicated assertions is described below. The backslashed assertions are:

    -

    Table 8. Simple assertions

    +

    Table 8. Simple assertions

    @@ -889,7 +711,7 @@ in the compiled regular expression.
    -

    Circumflex and dollar

    +

    Circumflex and dollar

    Outside a character class, in the default matching mode, the circumflex character is an assertion that is true only if the current matching @@ -947,7 +769,7 @@ is set.

    -

    Full stop (period, dot)

    +

    Full stop (period, dot)

    Outside a character class, a dot in the pattern matches any one character in the string, including a non-printing character, but not (by @@ -980,7 +802,7 @@ special meaning in a character class.

    -

    Matching a single byte

    +

    Matching a single byte

    Outside a character class, the escape sequence \C matches any one byte, both in and out of UTF-8 mode. Unlike a dot, it always matches any line @@ -997,7 +819,7 @@ the length of the lookbehind.

    -

    Square brackets and character classes

    +

    Square brackets and character classes

    An opening square bracket introduces a character class, terminated by a closing square bracket. A closing square bracket on its own is not special. If a closing square bracket is required as a member of the class, @@ -1082,7 +904,7 @@ escaping other non-alphanumeric characters does no harm.

    -

    Posix character classes

    +

    Posix character classes

    GRegex supports the POSIX notation for character classes. This uses names enclosed by [: and :] within the enclosing square brackets. For example, @@ -1095,7 +917,7 @@ matches "0", "1", any alphabetic character, or "%". The supported class names are

    -

    Table 9. Posix classes

    +

    Table 9. Posix classes

    @@ -1190,7 +1012,7 @@ of the POSIX character classes.

    -

    Vertical bar

    +

    Vertical bar

    Vertical bar characters are used to separate alternative patterns. For example, the pattern @@ -1206,7 +1028,7 @@ left to right, and the first one that succeeds is used. If the alternatives are

    -

    Internal option setting

    +

    Internal option setting

    The settings of the G_REGEX_CASELESS, G_REGEX_MULTILINE, G_REGEX_MULTILINE, and G_REGEX_EXTENDED options can be changed from within the pattern by a @@ -1214,7 +1036,7 @@ sequence of Perl-style option letters enclosed between "(?" and ")". The option letters are

    -

    Table 10. Option settings

    +

    Table 10. Option settings

    @@ -1288,7 +1110,7 @@ the characters U, X and J respectively.

    -

    Subpatterns

    +

    Subpatterns

    Subpatterns are delimited by parentheses (round brackets), which can be nested. Turning part of a pattern into a subpattern does two things: @@ -1352,7 +1174,7 @@ subsequent branches, so the above patterns match "SUNDAY" as well as

    -

    Named subpatterns

    +

    Named subpatterns

    Identifying capturing parentheses by number is simple, but it can be very hard to keep track of the numbers in complicated regular expressions. @@ -1393,7 +1215,7 @@ pattern, the one that corresponds to the lowest number is used.

    -

    Repetition

    +

    Repetition

    Repetition is specified by quantifiers, which can follow any of the following items: @@ -1456,7 +1278,7 @@ For convenience, the three most common quantifiers have single-character abbreviations:

    -

    Table 11. Abbreviations for quantifiers

    +

    Table 11. Abbreviations for quantifiers

    @@ -1597,7 +1419,7 @@ matches "aba" the value of the second captured substring is "b".

    -

    Atomic grouping and possessive quantifiers

    +

    Atomic grouping and possessive quantifiers

    With both maximizing ("greedy") and minimizing ("ungreedy" or "lazy") repetition, failure of what follows normally causes the repeated @@ -1715,7 +1537,7 @@ sequences of non-digits cannot be broken, and failure happens quickly.

    -

    Back references

    +

    Back references

    Outside a character class, a backslash followed by a digit greater than 0 (and possibly further digits) is a back reference to a capturing subpattern @@ -1824,7 +1646,7 @@ the example above, or by a quantifier with a minimum of zero.

    -

    Assertions

    +

    Assertions

    An assertion is a test on the characters following or preceding the current matching point that does not actually consume any characters. @@ -1848,7 +1670,7 @@ out only for positive assertions, because it does not make sense for negative assertions.

    -

    Lookahead assertions

    +

    Lookahead assertions

    Lookahead assertions start with (?= for positive assertions and (?! for negative assertions. For example, @@ -1885,7 +1707,7 @@ string must always fail.


    -

    Lookbehind assertions

    +

    Lookbehind assertions

    Lookbehind assertions start with (?<= for positive assertions and (?<! for negative assertions. For example, @@ -1974,7 +1796,7 @@ processing time.


    -

    Using multiple assertions

    +

    Using multiple assertions

    Several assertions (of any sort) may occur in succession. For example,

    @@ -2019,7 +1841,7 @@ three characters that are not "999".
    -

    Conditional subpatterns

    +

    Conditional subpatterns

    It is possible to cause the matching process to obey a subpattern conditionally or to choose between two alternative subpatterns, depending @@ -2040,7 +1862,7 @@ There are four kinds of condition: references to subpatterns, references to recursion, a pseudo-condition called DEFINE, and assertions.

    -

    Checking for a used subpattern by number

    +

    Checking for a used subpattern by number

    If the text between the parentheses consists of a sequence of digits, the condition is true if the capturing subpattern of that number has previously @@ -2069,7 +1891,7 @@ optionally enclosed in parentheses.


    -

    Checking for a used subpattern by name

    +

    Checking for a used subpattern by name

    Perl uses the syntax (?(<name>)...) or (?('name')...) to test for a used subpattern by name, the Python syntax (?(name)...) is also recognized. However, @@ -2088,7 +1910,7 @@ Rewriting the above example to use a named subpattern gives this:


    -

    Checking for pattern recursion

    +

    Checking for pattern recursion

    If the condition is the string (R), and there is no subpattern with the name R, the condition is true if a recursive call to the whole pattern or any @@ -2111,7 +1933,7 @@ patterns are described below.


    -

    Defining subpatterns for use by reference only

    +

    Defining subpatterns for use by reference only

    If the condition is the string (DEFINE), and there is no subpattern with the name DEFINE, the condition is always false. In this case, there may be only one @@ -2139,7 +1961,7 @@ each end.


    -

    Assertion conditions

    +

    Assertion conditions

    If the condition is not in any of the above formats, it must be an assertion. This may be a positive or negative lookahead or lookbehind @@ -2162,7 +1984,7 @@ letters and dd are digits.

    -

    Comments

    +

    Comments

    The sequence (?# marks the start of a comment that continues up to the next closing parenthesis. Nested parentheses are not permitted. The @@ -2176,7 +1998,7 @@ immediately after the next newline in the pattern.

    -

    Recursive patterns

    +

    Recursive patterns

    Consider the problem of matching a string in parentheses, allowing for unlimited nested parentheses. Without the use of recursion, the best @@ -2308,7 +2130,7 @@ The (?R) item is the actual recursive call.

    -

    Subpatterns as subroutines

    +

    Subpatterns as subroutines

    If the syntax for a recursive subpattern reference (either by number or by name) is used outside the parentheses to which it refers, it operates @@ -2350,7 +2172,7 @@ processing option does not affect the called subpattern.

    -

    Copyright

    +

    Copyright

    This document was copied and adapted from the PCRE documentation, specifically from the man page for pcrepattern. @@ -2390,6 +2212,6 @@ POSSIBILITY OF SUCH DAMAGE.

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/glib-resources.html b/docs/reference/glib/html/glib-resources.html index 8104a3b..1974285 100644 --- a/docs/reference/glib/html/glib-resources.html +++ b/docs/reference/glib/html/glib-resources.html @@ -3,12 +3,12 @@ Mailing lists and bug reports - + - + @@ -31,7 +31,7 @@ Getting help with GLib
    -

    Filing a bug report or feature request

    +

    Filing a bug report or feature request

    If you encounter a bug, misfeature, or missing feature in GLib, please file a bug report on @@ -53,7 +53,7 @@ the way to be sure the GLib developers won't forget about an issue.

    -

    Submitting Patches

    +

    Submitting Patches

    If you develop a bugfix or enhancement for GLib, please file that in Bugzilla as well. Bugzilla allows you to attach files; please attach a @@ -70,7 +70,7 @@ list and not in Bugzilla, it's likely to slip through the cracks.

    -

    Mailing lists

    +

    Mailing lists

    There are several mailing lists dedicated to GTK+ and related libraries. Discussion of GLib generally takes place on these lists. @@ -116,6 +116,6 @@ documentation system (used to document GTK+ and Glib), and for work on the GTK+

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-running.html b/docs/reference/glib/html/glib-running.html index 4bb7b38..d7d840e 100644 --- a/docs/reference/glib/html/glib-running.html +++ b/docs/reference/glib/html/glib-running.html @@ -3,12 +3,12 @@ Running GLib Applications - + - + @@ -31,9 +31,9 @@ How to run and debug your GLib application
    -

    Running and debugging GLib Applications

    +

    Running and debugging GLib Applications

    -

    Environment variables

    +

    Environment variables

    GLib inspects a few of environment variables in addition to standard variables like LANG, PATH or HOME. @@ -182,6 +182,12 @@ variables like LANG, PATH character set conversion routines. The default location is the libdir specified at compilation time.

    +

    TZDIR.  + Allows to specify a nonstandard location for the timezone data files + that are used by the #GDateTime API. The default location is under + /usr/share/zoneinfo. For more information, + also look at the tzset manual page. +


    @@ -209,7 +215,7 @@ returned by functions like strftime().

    -

    Traps and traces

    +

    Traps and traces

    @@ -250,7 +256,7 @@ is 20.


    -

    Gdb debugging macros

    +

    Gdb debugging macros

    glib ships with a set of python macros for the gdb debugger. These includes pretty printers for lists, hashtables and gobject types. It also has a backtrace filter @@ -280,8 +286,19 @@ Which would print the contents of each widget in a list of widgets.


    +
    +

    SystemTap

    +

    +SystemTap is a dynamic whole-system +analysis toolkit. GLib ships with a file glib.stp which defines a +set of probe points, which you can hook into with custom SystemTap scripts. +See the files glib.stp and gobject.stp which +are in your shared SystemTap scripts directory. +

    +
    +
    -

    Memory statistics

    +

    Memory statistics

    g_mem_profile() will output a summary g_malloc() memory usage, if memory profiling has been enabled by calling @@ -297,6 +314,6 @@ output details about the memory usage of the slice allocator.

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib-utilities.html b/docs/reference/glib/html/glib-utilities.html index eb95173..7e793a0 100644 --- a/docs/reference/glib/html/glib-utilities.html +++ b/docs/reference/glib/html/glib-utilities.html @@ -3,12 +3,12 @@ GLib Utilities - + - + @@ -27,7 +27,7 @@ String Utility Functions — various string-related functions
    -Character Set Conversion — convert strings between different character sets using iconv() +Character Set Conversion — Convert strings between different character sets
    Unicode Manipulation — functions operating on Unicode characters and UTF-8 strings @@ -45,6 +45,12 @@ Date and Time Functions — calendrical calculations and miscellaneous time stuff
    +GTimeZone — A structure representing a time zone +
    +
    +GDateTime — A structure representing Date and Time +
    +
    Random Numbers — pseudo-random number generator
    @@ -107,6 +113,6 @@
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/glib.devhelp b/docs/reference/glib/html/glib.devhelp index ab166df..17b4371 100644 --- a/docs/reference/glib/html/glib.devhelp +++ b/docs/reference/glib/html/glib.devhelp @@ -42,6 +42,8 @@ + + @@ -107,27 +109,31 @@ + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -302,7 +308,6 @@ - @@ -311,6 +316,7 @@ + @@ -355,8 +361,8 @@ - - + + @@ -404,6 +410,8 @@ + + @@ -441,12 +449,18 @@ + + + + + + @@ -800,8 +814,6 @@ - - @@ -891,11 +903,13 @@ + + @@ -908,6 +922,8 @@ + + @@ -966,6 +982,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1030,6 +1112,7 @@ + @@ -1039,6 +1122,7 @@ + @@ -1164,6 +1248,7 @@ + @@ -1186,6 +1271,8 @@ + + @@ -1253,6 +1340,8 @@ + + @@ -1322,6 +1411,8 @@ + + @@ -1334,6 +1425,8 @@ + + @@ -1419,7 +1512,9 @@ + + @@ -1459,6 +1554,7 @@ + @@ -1514,6 +1610,7 @@ + @@ -1553,6 +1650,7 @@ + @@ -1641,6 +1739,8 @@ + + @@ -1946,6 +2046,9 @@ + + + @@ -1976,15 +2079,17 @@ - + + + @@ -2008,6 +2113,8 @@ + + @@ -2023,6 +2130,10 @@ + + + + @@ -2031,6 +2142,8 @@ + + @@ -2060,9 +2173,11 @@ + + @@ -2077,8 +2192,8 @@ - - - + + + diff --git a/docs/reference/glib/html/glib.devhelp2 b/docs/reference/glib/html/glib.devhelp2 index da252e8..6365089 100644 --- a/docs/reference/glib/html/glib.devhelp2 +++ b/docs/reference/glib/html/glib.devhelp2 @@ -42,6 +42,8 @@ + + @@ -107,27 +109,31 @@ + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -302,7 +308,6 @@ - @@ -311,6 +316,7 @@ + @@ -355,8 +361,8 @@ - - + + @@ -365,11 +371,11 @@ - - - - - + + + + + @@ -383,7 +389,7 @@ - + @@ -403,7 +409,9 @@ - + + + @@ -441,13 +449,19 @@ + + + - + + + + @@ -800,8 +814,6 @@ - - @@ -891,11 +903,13 @@ + + @@ -908,6 +922,8 @@ + + @@ -966,6 +982,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1030,6 +1112,7 @@ + @@ -1039,6 +1122,7 @@ + @@ -1109,16 +1193,16 @@ - + - - - - - - + + + + + + - + @@ -1164,6 +1248,7 @@ + @@ -1186,6 +1271,8 @@ + + @@ -1241,7 +1328,7 @@ - + @@ -1253,6 +1340,8 @@ + + @@ -1322,6 +1411,8 @@ + + @@ -1334,6 +1425,8 @@ + + @@ -1419,7 +1512,9 @@ + + @@ -1459,6 +1554,7 @@ + @@ -1514,6 +1610,7 @@ + @@ -1553,6 +1650,7 @@ + @@ -1641,6 +1739,8 @@ + + @@ -1897,18 +1997,18 @@ - - - - - - - - - + + + + + + + + + - - + + @@ -1946,6 +2046,9 @@ + + + @@ -1976,15 +2079,17 @@ - + + + @@ -2008,6 +2113,8 @@ + + @@ -2023,6 +2130,10 @@ + + + + @@ -2031,6 +2142,8 @@ + + @@ -2060,9 +2173,11 @@ + + @@ -2077,9 +2192,9 @@ - - - + + + @@ -2285,6 +2400,21 @@ + + + + + + + + + + + + + + + @@ -2320,6 +2450,9 @@ + + + @@ -2552,5 +2685,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/glib/html/glib.html b/docs/reference/glib/html/glib.html index bd3c44c..6fe17e2 100644 --- a/docs/reference/glib/html/glib.html +++ b/docs/reference/glib/html/glib.html @@ -3,12 +3,12 @@ GLib Overview - + - + @@ -75,6 +75,6 @@ synchronize their operation. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/gtester-report.html b/docs/reference/glib/html/gtester-report.html index a7591bb..9296c33 100644 --- a/docs/reference/glib/html/gtester-report.html +++ b/docs/reference/glib/html/gtester-report.html @@ -3,12 +3,12 @@ gtester-report - + - + @@ -33,12 +33,12 @@

    gtester-report [option...] [gtester-log]

    -

    Description

    +

    Description

    gtester-report is a script which converts the XML output generated by gtester into HTML.

    -

    Options

    +

    Options

    @@ -59,14 +59,14 @@ print version information and exit
    -

    See also

    +

    See also

    -gtester(1) +gtester(1)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/gtester.html b/docs/reference/glib/html/gtester.html index f525e83..5f0b87b 100644 --- a/docs/reference/glib/html/gtester.html +++ b/docs/reference/glib/html/gtester.html @@ -3,12 +3,12 @@ gtester - + - + @@ -33,7 +33,7 @@

    gtester [option...] [testprogram]

    -

    Description

    +

    Description

    gtester is a utility to run unit tests that have been written using the GLib test framework.

    @@ -43,7 +43,7 @@ writes an XML report of the test results, which can be converted into HTML using the gtester-report utility.

    -

    Options

    +

    Options

    @@ -118,14 +118,14 @@ report success per testcase
    -

    See also

    +

    See also

    -gtester-report(1) +gtester-report(1)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/gvariant-format-strings.html b/docs/reference/glib/html/gvariant-format-strings.html index 9a465fc..f4c925c 100644 --- a/docs/reference/glib/html/gvariant-format-strings.html +++ b/docs/reference/glib/html/gvariant-format-strings.html @@ -3,12 +3,12 @@ GVariant Format Strings - + - + @@ -22,7 +22,7 @@
    -

    Variable Argument Conversions

    +

    Variable Argument Conversions

    This page attempts to document how to perform variable argument conversions with GVariant.

    @@ -38,7 +38,7 @@

    -

    Syntax

    +

    Syntax

    This section exhaustively describes all possibilities for GVariant format strings. There are no valid forms of format strings other than those described here. Please note that the format string syntax is likely to expand in the @@ -54,8 +54,8 @@

  • '&s' '&o', '&g', '^as', - '^ao', '^ag', '^a&s', '^a&o' or - '^a&g' + '^a&s', '^ay', '^&ay', '^aay' + or '^a&ay'.

  • any format string, prefixed with an 'm' @@ -70,15 +70,15 @@

  • -

    Symbols

    +

    Symbols

    The following table describes the rough meaning of symbols that may appear inside a GVariant format string. Each symbol is described in detail in its own section, including usage examples.

    --++ @@ -211,7 +211,9 @@ GVariant should be used in place of the normal C type or types. For g_variant_new() this means that you must pass a non-NULL(GVariant - *). For g_variant_get() this means that you + *); if it is a floating reference, ownership will be taken, as + if by using g_variant_ref_sink(). + For g_variant_get() this means that you must pass a pointer to a (GVariant *) for the value to be returned by reference or NULL to ignore the value. See GVariant * below. @@ -282,8 +284,8 @@

    --++ @@ -460,7 +462,7 @@ it operates with pointers. The pointers must always point to a memory region of exactly the correct size.

    -

    Examples

    +

    Examples

    @@ -534,7 +536,7 @@ string should be ignored (in which case no copy is made).

    -

    Examples

    +

    Examples

    @@ -603,7 +605,7 @@ ignored (in which case no new reference is created).

    -

    Examples

    +

    Examples

    @@ -657,12 +659,12 @@ (GVariantIter **)). A new heap-allocated iterator is created and returned, initialised for iterating over the elements of the array. This iterator should be freed when you are done with it, using - g_variant_iter_unref(). + g_variant_iter_free(). NULL may also be given to indicate that the value of the array should be ignored.

    -

    Examples

    +

    Examples

    @@ -685,16 +687,20 @@ 16 17 18 -19 +19 +20 +21 +22 + g_print ("%s\n", str); + g_variant_iter_free (iter); +} + +g_variant_unref (value);
    GVariantBuilder *builder;
     GVariant *value;
     
    -builder = g_variant_builder_new (G_VARIANT_TYPE_CLASS_ARRAY, NULL);
    +builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
     g_variant_builder_add (builder, "s", "when");
     g_variant_builder_add (builder, "s", "in");
     g_variant_builder_add (builder, "s", "the");
     g_variant_builder_add (builder, "s", "course");
     value = g_variant_new ("as", builder);
    +g_variant_builder_unref (builder);
     
     {
       GVariantIter *iter;
    @@ -702,9 +708,11 @@
     
       g_variant_get (value, "as", &iter);
       while (g_variant_iter_loop (iter, "s", &str))
    -    g_print ("%s\n");
    -  g_variant_iter_unref (iter);
    -}
    @@ -762,7 +770,7 @@ but have their values set to binary zero.

    -

    Examples

    +

    Examples

    @@ -896,7 +904,7 @@ Tuples are handled by handling each item in the tuple, in sequence. Each item is handled in the usual way.

    -

    Examples

    +

    Examples

    @@ -950,7 +958,7 @@ Dictionary entries are handled by handling first the key, then the value. Each is handled in the usual way.

    -

    Examples

    +

    Examples

    @@ -965,7 +973,7 @@ @@ -1013,7 +1021,7 @@ improvements in type safety and code self-documentation.

    -

    Examples

    +

    Examples

    GVariantBuilder *b;
     GVariant *dict;
     
    -b = g_variant_builder_new (G_VARIANT_TYPE_CLASS_ARRAY, G_VARIANT_TYPE ("a{sv}"));
    +b = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
     g_variant_builder_add (b, "{sv}", "name", g_variant_new_string ("foo"));
     g_variant_builder_add (b, "{sv}", "timeout", g_variant_new_int32 (10));
     dict = g_variant_builder_end (b);
    @@ -1093,7 +1101,7 @@ always be properly nul-terminated.

    -

    Examples

    +

    Examples

    @@ -1132,40 +1140,149 @@

    - The '^' character currently only has one purpose: to convert to and from - G_TYPE_STRV type arrays of strings. It is always used with - arrays of strings (or other string types). It has two forms. -

    -
      -
    • - '^as' (or o or g) -

    • -
    • - '^a&s' (or o or g) -

    • -
    -

    - When used with g_variant_new() both forms are equivalent. - A (const gchar * const *) is collected. This must be a pointer to the - array of NULL-terminated pointers to strings. This array is - converted to a GVariant instance. Copies are made, so the original - array may be freed immediately. + The '^' character currently supports conversion to and from bytestrings or to and from arrays + of strings or bytestrings. It has a number of forms.

    - When used with g_variant_get() the two forms have - different meaning. Both return a freshly allocated - NULL-terminated array of pointers to strings. In the case of - '^as', the strings are owned by the caller -- it is appropriate to free the array with - g_strfreev(). In the case of '^a&s', - a shallow copy is made; the strings themselves are embedded in the serialised data and owned by the original - GVariant instance -- it is only appropriate to free the outer array - with g_free(). + In all forms, when used with g_variant_new() one + pointer value is collected from the variable arguments and passed to a function (as given in the table below). + The result of that function is used as the value for this position. When used with + g_variant_get() one pointer value is produced by using + the function (given in the table) and returned by reference.

    +
    ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    + Conversion +

    +
    +

    + + Used with g_variant_new() + +

    +
    +

    + + Used with g_variant_get() + +

    +
    +

    + + ^as + +

    +
    +

    + equivalent to g_variant_new_strv() +

    +
    +

    + equivalent to g_variant_dup_strv() +

    +
    +

    + + ^a&s + +

    +
    +

    + equivalent to g_variant_get_strv() +

    +
    +

    + + ^ay + +

    +
    +

    + equivalent to g_variant_new_bytestring() +

    +
    +

    + equivalent to g_variant_dup_bytestring() +

    +
    +

    + + ^&ay + +

    +
    +

    + equivalent to g_variant_get_bytestring() +

    +
    +

    + + ^aay + +

    +
    +

    + equivalent to g_variant_new_bytestring_array() +

    +
    +

    + equivalent to g_variant_dup_bytestring_array() +

    +
    +

    + + ^a&ay + +

    +
    +

    + equivalent to g_variant_get_bytestring_array() +

    +
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/glib/html/index.html b/docs/reference/glib/html/index.html index fe41f82..66fb51f 100644 --- a/docs/reference/glib/html/index.html +++ b/docs/reference/glib/html/index.html @@ -3,10 +3,10 @@ GLib Reference Manual - + - + @@ -15,7 +15,7 @@

    - for GLib 2.24.2 + for GLib 2.27.5 The latest version of this documentation can be found on-line at http://library.gnome.org/devel/glib/unstable/. @@ -133,7 +133,7 @@ Getting help with GLib String Utility Functions — various string-related functions

    -Character Set Conversion — convert strings between different character sets using iconv() +Character Set Conversion — Convert strings between different character sets
    Unicode Manipulation — functions operating on Unicode characters and UTF-8 strings @@ -151,6 +151,12 @@ Getting help with GLib Date and Time Functions — calendrical calculations and miscellaneous time stuff
    +GTimeZone — A structure representing a time zone +
    +
    +GDateTime — A structure representing Date and Time +
    +
    Random Numbers — pseudo-random number generator
    @@ -327,10 +333,13 @@ Getting help with GLib
    Index of new symbols in 2.20
    Index of new symbols in 2.22
    Index of new symbols in 2.24
    +
    Index of new symbols in 2.26
    +
    Index of new symbols in 2.28
    +
    Annotation Glossary
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/html/index.sgml b/docs/reference/glib/html/index.sgml index afbabde..9a20045 100644 --- a/docs/reference/glib/html/index.sgml +++ b/docs/reference/glib/html/index.sgml @@ -1,3 +1,4 @@ + @@ -204,7 +205,6 @@ - @@ -218,7 +218,6 @@ - @@ -227,6 +226,7 @@ + @@ -327,6 +327,8 @@ + + @@ -364,12 +366,18 @@ + + + + + + @@ -824,8 +832,6 @@ - - @@ -1021,6 +1027,21 @@ + + + + + + + + + + + + + + + @@ -1094,11 +1115,13 @@ + + @@ -1116,6 +1139,8 @@ + + @@ -1198,6 +1223,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1277,6 +1381,7 @@ + @@ -1286,6 +1391,7 @@ + @@ -1509,6 +1615,7 @@ + @@ -1535,6 +1642,8 @@ + + @@ -1709,6 +1818,8 @@ + + @@ -1736,6 +1847,7 @@ + @@ -1811,6 +1923,8 @@ + + @@ -1823,6 +1937,8 @@ + + @@ -1924,7 +2040,9 @@ + + @@ -1967,6 +2085,7 @@ + @@ -2039,6 +2158,7 @@ + @@ -2082,6 +2202,7 @@ + @@ -2178,6 +2299,8 @@ + + @@ -2557,6 +2680,9 @@ + + + @@ -2596,10 +2722,12 @@ + + @@ -2641,6 +2769,8 @@ + + @@ -2656,6 +2786,10 @@ + + + + @@ -2664,6 +2798,8 @@ + + @@ -2693,9 +2829,29 @@ + + + + + + + + + + + + + + + + + + + + @@ -2715,3 +2871,12 @@ + + + + + + + + + diff --git a/docs/reference/glib/html/style.css b/docs/reference/glib/html/style.css index 82115eb..d544a2c 100644 --- a/docs/reference/glib/html/style.css +++ b/docs/reference/glib/html/style.css @@ -209,6 +209,14 @@ h2 .extralinks, h3 .extralinks font-weight: normal; } +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-size: 80%; + font-weight: normal; +} + /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ diff --git a/docs/reference/glib/html/tools.html b/docs/reference/glib/html/tools.html index 85be7d8..a6546a5 100644 --- a/docs/reference/glib/html/tools.html +++ b/docs/reference/glib/html/tools.html @@ -3,12 +3,12 @@ GLib Tools - + - + @@ -36,6 +36,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/glib/regex-syntax.sgml b/docs/reference/glib/regex-syntax.sgml index 901b447..8be1a13 100644 --- a/docs/reference/glib/regex-syntax.sgml +++ b/docs/reference/glib/regex-syntax.sgml @@ -188,6 +188,12 @@ as part of the pattern. +Note that the C compiler interprets backslash in strings itself, therefore +you need to duplicate all \ characters when you put a regular expression +in a C string, like "\\d{3}". + + + If you want to remove the special meaning from a sequence of characters, you can do so by putting them between \Q and \E. The \Q...\E sequence is recognized both inside and outside character @@ -524,78 +530,12 @@ example, \p{Greek} or \P{Han}. Those that are not part of an identified script are lumped together as -"Common". The current list of scripts is: +"Common". The current list of scripts can be found in the documentation for +the #GUnicodeScript enumeration. Script names for use with \p{} can be +found by replacing all spaces with underscores, e.g. for Linear B use +\p{Linear_B}. - -Arabic -Armenian -Balinese -Bengali -Bopomofo -Braille -Buginese -Buhid -Canadian_Aboriginal -Cherokee -Common -Coptic -Cuneiform -Cypriot -Cyrillic -Deseret -Devanagari -Ethiopic -Georgian -Glagolitic -Gothic -Greek -Gujarati -Gurmukhi -Han -Hangul -Hanunoo -Hebrew -Hiragana -Inherited -Kannada -Katakana -Kharoshthi -Khmer -Lao -Latin -Limbu -Linear_B -Malayalam -Mongolian -Myanmar -New_Tai_Lue -Nko -Ogham -Old_Italic -Old_Persian -Oriya -Osmanya -Phags_Pa -Phoenician -Runic -Shavian -Sinhala -Syloti_Nagri -Syriac -Tagalog -Tagbanwa -Tai_Le -Tamil -Telugu -Thaana -Thai -Tibetan -Tifinagh -Ugaritic -Yi - - Each character has exactly one general category property, specified by a two-letter abbreviation. For compatibility with Perl, negation can be specified @@ -616,7 +556,9 @@ examples have the same effect: -The following general category property codes are supported: +In addition to the two-letter category codes listed in the +documentation for the #GUnicodeType enumeration, the following +general category property codes are supported: @@ -635,149 +577,29 @@ The following general category property codes are supported: Other - Cc - Control - - - Cf - Format - - - Cn - Unassigned - - - Co - Private use - - - Cs - Surrogate - - L Letter - Ll - Lower case letter - - - Lm - Modifier letter - - - Lo - Other letter - - - Lt - Title case letter - - - Lu - Upper case letter - - M Mark - Mc - Spacing mark - - - Me - Enclosing mark - - - Mn - Non-spacing mark - - N Number - Nd - Decimal number - - - Nl - Letter number - - - No - Other number - - P Punctuation - Pc - Connector punctuation - - - Pd - Dash punctuation - - - Pe - Close punctuation - - - Pf - Final punctuation - - - Pi - Initial punctuation - - - Po - Other punctuation - - - Ps - Open punctuation - - S Symbol - Sc - Currency symbol - - - Sk - Modifier symbol - - - Sm - Mathematical symbol - - - So - Other symbol - - Z Separator - - Zl - Line separator - - - Zp - Paragraph separator - - - Zs - Space separator -
    diff --git a/docs/reference/glib/running.sgml b/docs/reference/glib/running.sgml index 9c33da8..a130e66 100644 --- a/docs/reference/glib/running.sgml +++ b/docs/reference/glib/running.sgml @@ -202,6 +202,17 @@ variables like LANG, PATH or HOME.
    + + <envar>TZDIR</envar> + + + Allows to specify a nonstandard location for the timezone data files + that are used by the #GDateTime API. The default location is under + /usr/share/zoneinfo. For more information, + also look at the tzset manual page. + + + @@ -306,6 +317,19 @@ Which would print the contents of each widget in a list of widgets. +SystemTap + + +SystemTap is a dynamic whole-system +analysis toolkit. GLib ships with a file glib.stp which defines a +set of probe points, which you can hook into with custom SystemTap scripts. +See the files glib.stp and gobject.stp which +are in your shared SystemTap scripts directory. + + + + + Memory statistics diff --git a/docs/reference/glib/tmpl/allocators.sgml b/docs/reference/glib/tmpl/allocators.sgml index 6dd0448..09e7abf 100644 --- a/docs/reference/glib/tmpl/allocators.sgml +++ b/docs/reference/glib/tmpl/allocators.sgml @@ -9,13 +9,11 @@ Memory Allocators - - diff --git a/docs/reference/glib/tmpl/arrays.sgml b/docs/reference/glib/tmpl/arrays.sgml index 2eea9b7..16dd150 100644 --- a/docs/reference/glib/tmpl/arrays.sgml +++ b/docs/reference/glib/tmpl/arrays.sgml @@ -9,13 +9,11 @@ Arrays
    - - diff --git a/docs/reference/glib/tmpl/arrays_byte.sgml b/docs/reference/glib/tmpl/arrays_byte.sgml index 577fb39..0cd8579 100644 --- a/docs/reference/glib/tmpl/arrays_byte.sgml +++ b/docs/reference/glib/tmpl/arrays_byte.sgml @@ -9,13 +9,11 @@ Byte Arrays - - diff --git a/docs/reference/glib/tmpl/arrays_pointer.sgml b/docs/reference/glib/tmpl/arrays_pointer.sgml index 4a16cd1..6f7c817 100644 --- a/docs/reference/glib/tmpl/arrays_pointer.sgml +++ b/docs/reference/glib/tmpl/arrays_pointer.sgml @@ -9,13 +9,11 @@ Pointer Arrays - - diff --git a/docs/reference/glib/tmpl/async_queues.sgml b/docs/reference/glib/tmpl/async_queues.sgml index 7a58f3e..2292472 100644 --- a/docs/reference/glib/tmpl/async_queues.sgml +++ b/docs/reference/glib/tmpl/async_queues.sgml @@ -2,60 +2,11 @@ Asynchronous Queues -asynchronous communication between threads - - -Often you need to communicate between different threads. In general -it's safer not to do this by shared memory, but by explicit message -passing. These messages only make sense asynchronously for -multi-threaded applications though, as a synchronous operation could as -well be done in the same thread. - - - -Asynchronous queues are an exception from most other GLib data -structures, as they can be used simultaneously from multiple threads -without explicit locking and they bring their own builtin reference -counting. This is because the nature of an asynchronous queue is that -it will always be used by at least 2 concurrent threads. - - - -For using an asynchronous queue you first have to create one with -g_async_queue_new(). A newly-created queue will get the reference -count 1. Whenever another thread is creating a new reference of (that -is, pointer to) the queue, it has to increase the reference count -(using g_async_queue_ref()). Also, before removing this reference, the -reference count has to be decreased (using -g_async_queue_unref()). After that the queue might no longer exist so -you must not access it after that point. - - - -A thread, which wants to send a message to that queue simply calls -g_async_queue_push() to push the message to the queue. - + -A thread, which is expecting messages from an asynchronous queue -simply calls g_async_queue_pop() for that queue. If no message is -available in the queue at that point, the thread is now put to sleep -until a message arrives. The message will be removed from the queue -and returned. The functions g_async_queue_try_pop() and -g_async_queue_timed_pop() can be used to only check for the presence -of messages or to only wait a certain time for messages respectively. - - -For almost every function there exist two variants, one that locks the -queue and one that doesn't. That way you can hold the queue lock -(acquire it with g_async_queue_lock() and release it with -g_async_queue_unlock()) over multiple queue accessing -instructions. This can be necessary to ensure the integrity of the -queue, but should only be used when really necessary, as it can make -your life harder if used unwisely. Normally you should only use the -locking function variants (those without the suffix _unlocked) @@ -71,9 +22,7 @@ locking function variants (those without the suffix _unlocked) -The #GAsyncQueue struct is an opaque data structure, which represents -an asynchronous queue. It should only be accessed through the -g_async_queue_* functions. + diff --git a/docs/reference/glib/tmpl/atomic_operations.sgml b/docs/reference/glib/tmpl/atomic_operations.sgml index d7eab3f..ff54548 100644 --- a/docs/reference/glib/tmpl/atomic_operations.sgml +++ b/docs/reference/glib/tmpl/atomic_operations.sgml @@ -2,64 +2,16 @@ Atomic Operations -basic atomic integer and pointer operations + -The following functions can be used to atomically access integers and -pointers. They are implemented as inline assembler function on most -platforms and use slower fall-backs otherwise. Using them can sometimes -save you from using a performance-expensive #GMutex to protect the -integer or pointer. - - -The most important usage is reference counting. Using -g_atomic_int_inc() and g_atomic_int_dec_and_test() makes reference -counting a very fast operation. - - -You must not directly read integers or pointers concurrently accessed -by multiple threads, but use the atomic accessor functions instead. -That is, always use g_atomic_int_get() and g_atomic_pointer_get() for -read outs. -They provide the neccessary synchonization mechanisms like memory -barriers to access memory locations concurrently. - - - - - -If you are using those functions for anything apart from simple -reference counting, you should really be aware of the implications of -doing that. There are literally thousands of ways to shoot yourself in -the foot. So if in doubt, use a #GMutex. If you don't know, what -memory barriers are, do not use anything but g_atomic_int_inc() and -g_atomic_int_dec_and_test(). - - - - - -It is not safe to set an integer or pointer just by assigning to it, -when it is concurrently accessed by other threads with the following -functions. Use g_atomic_int_compare_and_exchange() or -g_atomic_pointer_compare_and_exchange() respectively. - - - - - - -#GMutex -GLib mutual exclusions. - - - + @@ -70,117 +22,95 @@ g_atomic_pointer_compare_and_exchange() respectively. -Reads the value of the integer pointed to by @atomic. Also acts as -a memory barrier. + -@atomic: a pointer to an integer -@Returns: the value of *@atomic -@Since: 2.4 +@atomic: +@Returns: -Sets the value of the integer pointed to by @atomic. -Also acts as a memory barrier. + -@atomic: a pointer to an integer -@newval: the new value -@Since: 2.10 +@atomic: +@newval: -Atomically adds @val to the integer pointed to by @atomic. -Also acts as a memory barrier. + -@atomic: a pointer to an integer. -@val: the value to add to *@atomic. -@Since: 2.4 +@atomic: +@val: -Atomically adds @val to the integer pointed to by @atomic. It returns -the value of *@atomic just before the addition took place. -Also acts as a memory barrier. + -@atomic: a pointer to an integer. -@val: the value to add to *@atomic. -@Returns: the value of *@atomic before the addition. -@Since: 2.4 +@atomic: +@val: +@Returns: -Compares @oldval with the integer pointed to by @atomic and -if they are equal, atomically exchanges *@atomic with @newval. -Also acts as a memory barrier. + -@atomic: a pointer to an integer. -@oldval: the assumed old value of *@atomic. -@newval: the new value of *@atomic. -@Returns: %TRUE, if *@atomic was equal @oldval. %FALSE otherwise. -@Since: 2.4 +@atomic: +@oldval: +@newval: +@Returns: -Reads the value of the pointer pointed to by @atomic. Also acts as -a memory barrier. + -@atomic: a pointer to a #gpointer. -@Returns: the value to add to *@atomic. -@Since: 2.4 +@atomic: +@Returns: -Sets the value of the pointer pointed to by @atomic. -Also acts as a memory barrier. + -@atomic: a pointer to a #gpointer -@newval: the new value -@Since: 2.10 +@atomic: +@newval: -Compares @oldval with the pointer pointed to by @atomic and -if they are equal, atomically exchanges *@atomic with @newval. -Also acts as a memory barrier. + -@atomic: a pointer to a #gpointer. -@oldval: the assumed old value of *@atomic. -@newval: the new value of *@atomic. -@Returns: %TRUE, if *@atomic was equal @oldval. %FALSE otherwise. -@Since: 2.4 +@atomic: +@oldval: +@newval: +@Returns: -Atomically increments the integer pointed to by @atomic by 1. + -@atomic: a pointer to an integer. -@Since: 2.4 +@atomic: -Atomically decrements the integer pointed to by @atomic by 1. + -@atomic: a pointer to an integer. -@Returns: %TRUE, if the integer pointed to by @atomic is 0 after -decrementing it. -@Since: 2.4 +@atomic: +@Returns: diff --git a/docs/reference/glib/tmpl/base64.sgml b/docs/reference/glib/tmpl/base64.sgml index b6aeb27..4881ed3 100644 --- a/docs/reference/glib/tmpl/base64.sgml +++ b/docs/reference/glib/tmpl/base64.sgml @@ -9,13 +9,11 @@ Base64 Encoding - - diff --git a/docs/reference/glib/tmpl/bookmarkfile.sgml b/docs/reference/glib/tmpl/bookmarkfile.sgml index 6ffae8e..d6da84b 100644 --- a/docs/reference/glib/tmpl/bookmarkfile.sgml +++ b/docs/reference/glib/tmpl/bookmarkfile.sgml @@ -2,82 +2,11 @@ Bookmark file parser -parses files containing bookmarks + -#GBookmarkFile lets you parse, edit or create files containing bookmarks -to URI, along with some meta-data about the resource pointed by the URI like -its MIME type, the application that is registering the bookmark and the -icon that should be used to represent the bookmark. The data is stored using -the -Desktop Bookmark -Specification. - - - -The syntax of the bookmark files is described in detail inside the Desktop -Bookmark Specification, here is a quick summary: bookmark files use a sub-class -of the -XML Bookmark Exchange Language specification, consisting -of valid UTF-8 encoded XML, under the xbel root element; -each bookmark is stored inside a bookmark element, using -its URI: no relative paths can be used inside a bookmark file. The bookmark -may have a user defined title and description, to be used instead of the URI. -Under the metadata element, with its owner -attribute set to http://freedesktop.org, is stored the -meta-data about a resource pointed by its URI. The meta-data consists of -the resource's MIME type; the applications that have registered a bookmark; -the groups to which a bookmark belongs to; a visibility flag, used to set -the bookmark as "private" to the applications and groups that has it -registered; the URI and MIME type of an icon, to be used when displaying the -bookmark inside a GUI. - - - - - - - - Desktop Bookmarks Spec - - - text/xml - - - - - - Editors - - - - - -]]> - - - -A bookmark file might contain more than one bookmark; each bookmark is accessed -through its URI. - - - -The important caveat of bookmark files is that when you add a new bookmark you -must also add the application that is registering it, using -g_bookmark_file_add_application() or g_bookmark_file_set_app_info(). If a -bookmark has no applications then it won't be dumped when creating the -on disk representation, using g_bookmark_file_to_data() or -g_bookmark_file_to_file(). - - - -The #GBookmarkFile parser was added in GLib 2.12. + @@ -93,35 +22,30 @@ The #GBookmarkFile parser was added in GLib 2.12. -The GBookmarkFile struct contains only private data -and should not be used directly. + -Error domain for bookmark file parsing. Errors in this domain will be -from the #GBookmarkFileError enumeration. See #GError for informations -on error domains. + -Error codes returned by bookmark file parsing. + -@G_BOOKMARK_FILE_ERROR_INVALID_URI: URI was ill-formed -@G_BOOKMARK_FILE_ERROR_INVALID_VALUE: a requested field was not found -@G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED: a requested application did not -register a bookmark -@G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND: a requested URI was not found -@G_BOOKMARK_FILE_ERROR_READ: document was ill formed -@G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING: the text being parsed was in an -unknown encoding -@G_BOOKMARK_FILE_ERROR_WRITE: an error occurred while writing -@G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND: requested file was not found +@G_BOOKMARK_FILE_ERROR_INVALID_URI: +@G_BOOKMARK_FILE_ERROR_INVALID_VALUE: +@G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED: +@G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND: +@G_BOOKMARK_FILE_ERROR_READ: +@G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING: +@G_BOOKMARK_FILE_ERROR_WRITE: +@G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND: diff --git a/docs/reference/glib/tmpl/caches.sgml b/docs/reference/glib/tmpl/caches.sgml index 2730337..4ea270e 100644 --- a/docs/reference/glib/tmpl/caches.sgml +++ b/docs/reference/glib/tmpl/caches.sgml @@ -9,13 +9,11 @@ Caches - - diff --git a/docs/reference/glib/tmpl/checksum.sgml b/docs/reference/glib/tmpl/checksum.sgml index fc739d8..606bd7a 100644 --- a/docs/reference/glib/tmpl/checksum.sgml +++ b/docs/reference/glib/tmpl/checksum.sgml @@ -9,13 +9,11 @@ Data Checksums - - diff --git a/docs/reference/glib/tmpl/completion.sgml b/docs/reference/glib/tmpl/completion.sgml index 7b23aeb..1d4e0da 100644 --- a/docs/reference/glib/tmpl/completion.sgml +++ b/docs/reference/glib/tmpl/completion.sgml @@ -9,13 +9,11 @@ Automatic String Completion - - diff --git a/docs/reference/glib/tmpl/conversions.sgml b/docs/reference/glib/tmpl/conversions.sgml index 3bfad72..2dea268 100644 --- a/docs/reference/glib/tmpl/conversions.sgml +++ b/docs/reference/glib/tmpl/conversions.sgml @@ -2,159 +2,10 @@ Character Set Conversion -convert strings between different character sets using iconv() - - - + - - File Name Encodings - - - Historically, Unix has not had a defined encoding for file - names: a file name is valid as long as it does not have path - separators in it ("/"). However, displaying file names may - require conversion: from the character set in which they were - created, to the character set in which the application - operates. Consider the Spanish file name - "Presentación.sxi". If the - application which created it uses ISO-8859-1 for its encoding, - then the actual file name on disk would look like this: - - - -Character: P r e s e n t a c i ó n . s x i -Hex code: 50 72 65 73 65 6e 74 61 63 69 f3 6e 2e 73 78 69 - - - - However, if the application use UTF-8, the actual file name on - disk would look like this: - - - -Character: P r e s e n t a c i ó n . s x i -Hex code: 50 72 65 73 65 6e 74 61 63 69 c3 b3 6e 2e 73 78 69 - - - - Glib uses UTF-8 for its strings, and GUI toolkits like GTK+ - that use Glib do the same thing. If you get a file name from - the file system, for example, from - readdir(3) or from g_dir_read_name(), - and you wish to display the file name to the user, you - will need to convert it into UTF-8. The - opposite case is when the user types the name of a file he - wishes to save: the toolkit will give you that string in - UTF-8 encoding, and you will need to convert it to the - character set used for file names before you can create the - file with open(2) or - fopen(3). - - - - By default, Glib assumes that file names on disk are in UTF-8 - encoding. This is a valid assumption for file systems which - were created relatively recently: most applications use UTF-8 - encoding for their strings, and that is also what they use for - the file names they create. However, older file systems may - still contain file names created in "older" encodings, such as - ISO-8859-1. In this case, for compatibility reasons, you may - want to instruct Glib to use that particular encoding for file - names rather than UTF-8. You can do this by specifying the - encoding for file names in the G_FILENAME_ENCODING - environment variable. For example, if your installation uses - ISO-8859-1 for file names, you can put this in your - ~/.profile: - - - -export G_FILENAME_ENCODING=ISO-8859-1 - - - - Glib provides the functions g_filename_to_utf8() - and g_filename_from_utf8() - to perform the necessary conversions. These functions convert - file names from the encoding specified in - G_FILENAME_ENCODING to UTF-8 and vice-versa. - illustrates how - these functions are used to convert between UTF-8 and the - encoding for file names in the file system. - - -
    - Conversion between File Name Encodings - -
    - - - Checklist for Application Writers - - - This section is a practical summary of the detailed - description above. You can use this as a checklist of - things to do to make sure your applications process file - name encodings correctly. - - - - - - If you get a file name from the file system from a - function such as readdir(3) or - gtk_file_chooser_get_filename(), - you do not need to do any conversion to pass that - file name to functions like open(2), - rename(2), or - fopen(3) — those are "raw" - file names which the file system understands. - - - - - - If you need to display a file name, convert it to UTF-8 - first by using g_filename_to_utf8(). - If conversion fails, display a string like - "Unknown file name". Do - not convert this string back into the - encoding used for file names if you wish to pass it to - the file system; use the original file name instead. - For example, the document window of a word processor - could display "Unknown file name" in its title bar but - still let the user save the file, as it would keep the - raw file name internally. This can happen if the user - has not set the G_FILENAME_ENCODING - environment variable even though he has files whose - names are not encoded in UTF-8. - - - - - - If your user interface lets the user type a file name - for saving or renaming, convert it to the encoding used - for file names in the file system by using g_filename_from_utf8(). - Pass the converted file name to functions like - fopen(3). If conversion fails, ask - the user to enter a different file name. This can - happen if the user types Japanese characters when - G_FILENAME_ENCODING is set to - ISO-8859-1, for example. - - - - -
    @@ -200,9 +51,7 @@ export G_FILENAME_ENCODING=ISO-8859-1 -The GIConv struct wraps an -iconv() conversion descriptor. It contains private data -and should only be accessed using the following functions. + @@ -222,9 +71,7 @@ and should only be accessed using the following functions. -Error domain for character set conversions. Errors in this domain will -be from the #GConvertError enumeration. See #GError for information on -error domains. + @@ -300,28 +147,6 @@ error domains. @Returns: - - - - - -@uri: -@hostname: -@error: -@Returns: - - - - - - - -@filename: -@hostname: -@error: -@Returns: - - @@ -364,16 +189,15 @@ error domains. -Error codes returned by character set conversion routines. + -@G_CONVERT_ERROR_NO_CONVERSION: Conversion between the requested character sets -is not supported. -@G_CONVERT_ERROR_ILLEGAL_SEQUENCE: Invalid byte sequence in conversion input. -@G_CONVERT_ERROR_FAILED: Conversion failed for some reason. -@G_CONVERT_ERROR_PARTIAL_INPUT: Partial character sequence at end of input. -@G_CONVERT_ERROR_BAD_URI: URI is invalid. -@G_CONVERT_ERROR_NOT_ABSOLUTE_PATH: Pathname is not an absolute path. +@G_CONVERT_ERROR_NO_CONVERSION: +@G_CONVERT_ERROR_ILLEGAL_SEQUENCE: +@G_CONVERT_ERROR_FAILED: +@G_CONVERT_ERROR_PARTIAL_INPUT: +@G_CONVERT_ERROR_BAD_URI: +@G_CONVERT_ERROR_NOT_ABSOLUTE_PATH: diff --git a/docs/reference/glib/tmpl/datalist.sgml b/docs/reference/glib/tmpl/datalist.sgml index fb61360..c23cf40 100644 --- a/docs/reference/glib/tmpl/datalist.sgml +++ b/docs/reference/glib/tmpl/datalist.sgml @@ -9,13 +9,11 @@ Keyed Data Lists - - diff --git a/docs/reference/glib/tmpl/datasets.sgml b/docs/reference/glib/tmpl/datasets.sgml index 1e3b6b2..df117cf 100644 --- a/docs/reference/glib/tmpl/datasets.sgml +++ b/docs/reference/glib/tmpl/datasets.sgml @@ -9,13 +9,11 @@ Datasets - - diff --git a/docs/reference/glib/tmpl/date-time.sgml b/docs/reference/glib/tmpl/date-time.sgml new file mode 100644 index 0000000..9067240 --- /dev/null +++ b/docs/reference/glib/tmpl/date-time.sgml @@ -0,0 +1,529 @@ + +date-time + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@datetime: + + + + + + + +@datetime: +@Returns: + + + + + + + +@tz: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@t: +@Returns: + + + + + + + +@t: +@Returns: + + + + + + + +@tv: +@Returns: + + + + + + + +@tv: +@Returns: + + + + + + + +@tz: +@year: +@month: +@day: +@hour: +@minute: +@seconds: +@Returns: + + + + + + + +@year: +@month: +@day: +@hour: +@minute: +@seconds: +@Returns: + + + + + + + +@year: +@month: +@day: +@hour: +@minute: +@seconds: +@Returns: + + + + + + + +@datetime: +@timespan: +@Returns: + + + + + + + +@datetime: +@years: +@Returns: + + + + + + + +@datetime: +@months: +@Returns: + + + + + + + +@datetime: +@weeks: +@Returns: + + + + + + + +@datetime: +@days: +@Returns: + + + + + + + +@datetime: +@hours: +@Returns: + + + + + + + +@datetime: +@minutes: +@Returns: + + + + + + + +@datetime: +@seconds: +@Returns: + + + + + + + +@datetime: +@years: +@months: +@days: +@hours: +@minutes: +@seconds: +@Returns: + + + + + + + +@dt1: +@dt2: +@Returns: + + + + + + + +@end: +@begin: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@dt1: +@dt2: +@Returns: + + + + + + + +@datetime: +@year: +@month: +@day: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@tv: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@tz: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@Returns: + + + + + + + +@datetime: +@format: +@Returns: + + diff --git a/docs/reference/glib/tmpl/date.sgml b/docs/reference/glib/tmpl/date.sgml index d097edb..b3ae1d9 100644 --- a/docs/reference/glib/tmpl/date.sgml +++ b/docs/reference/glib/tmpl/date.sgml @@ -52,10 +52,7 @@ representation is valid. Sometimes neither is valid. Use the API. -GLib doesn't contain any time-manipulation functions; however, there -is a #GTime typedef and a #GTimeVal struct which represents a more -precise time (with microseconds). You can request the current time as -a #GTimeVal with g_get_current_time(). +GLib also features #GDateTime which represents a precise time. @@ -84,6 +81,12 @@ Similar to the struct timeval returned by the gettimeofday() UNIX call. + +GLib is attempting to unify around the use of 64bit integers to +represent microsecond-precision time. As such, this type will be +removed from a future version of GLib. + + @tv_sec: seconds @tv_usec: microseconds @@ -134,6 +137,24 @@ length of the sleep. @Returns: + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + Represents a day between January 1, Year 1 and a few thousand years in diff --git a/docs/reference/glib/tmpl/error_reporting.sgml b/docs/reference/glib/tmpl/error_reporting.sgml index 858e48e..895fff3 100644 --- a/docs/reference/glib/tmpl/error_reporting.sgml +++ b/docs/reference/glib/tmpl/error_reporting.sgml @@ -257,6 +257,11 @@ g_spawn_error_quark (void) +The quark function for the error domain is called <namespace>_<module>_error_quark, for example g_spawn_error_quark() or %g_thread_error_quark(). + + + + The error codes are in an enumeration called <Namespace><Module>Error; for example, #GThreadError or #GSpawnError. diff --git a/docs/reference/glib/tmpl/fileutils.sgml b/docs/reference/glib/tmpl/fileutils.sgml index b99430b..7b65df6 100644 --- a/docs/reference/glib/tmpl/fileutils.sgml +++ b/docs/reference/glib/tmpl/fileutils.sgml @@ -382,6 +382,12 @@ not be accessed directly. @Returns: + + + + + + diff --git a/docs/reference/glib/tmpl/ghostutils.sgml b/docs/reference/glib/tmpl/ghostutils.sgml index 1f49102..ed00501 100644 --- a/docs/reference/glib/tmpl/ghostutils.sgml +++ b/docs/reference/glib/tmpl/ghostutils.sgml @@ -9,13 +9,11 @@ Hostname Utilities - - diff --git a/docs/reference/glib/tmpl/glib-unused.sgml b/docs/reference/glib/tmpl/glib-unused.sgml index 139c500..8a8e943 100644 --- a/docs/reference/glib/tmpl/glib-unused.sgml +++ b/docs/reference/glib/tmpl/glib-unused.sgml @@ -48,6 +48,34 @@ Desktop Entry Parser + + + + + + + + + + + + + + + + + + + + + + + + + +Version Information + + @@ -206,6 +234,14 @@ the end of the string. @G_MATCH_EXACT: a pattern matching exactly one string. @G_MATCH_LAST: + + + + + +@tv_sec: +@tv_nsec: + Specifies the type of function passed to g_set_warning_handler(). @@ -275,15 +311,6 @@ i.e. just the foo in /usr/bin/foo. - - -Marks a string for translation, gets replaced with the translated string -at runtime. - - -@String: the string to be translated -@Since: 2.4 - @@ -877,6 +904,24 @@ Turns the argument into a string literal by using the '#' stringizing operator. @x: text to convert to a literal string. + + + + + +@value: +@length: +@Returns: + + + + + + +@array: +@length: +@Returns: + @@ -902,9 +947,7 @@ Turns the argument into a string literal by using the '#' stringizing operator. -This is the binary age passed to libtool. If -libtool means nothing to you, don't worry -about it. ;-) + @@ -920,50 +963,25 @@ about it. ;-) -This is the interface age passed to libtool. If -libtool means nothing to you, don't worry -about it. ;-) + -The major version number of the GLib library. -(e.g. in GLib version 1.2.5 this is 1.) - - -This variable is in the library, so represents the -GLib library you have linked against. Contrast with the -#GLIB_MAJOR_VERSION macro, which represents the major version of the -GLib headers you have included. -The micro version number of the GLib library. -(e.g. in GLib version 1.2.5 this is 5.) - - -This variable is in the library, so represents the GLib library you -have linked against. Contrast with the #GLIB_MICRO_VERSION macro, which -represents the micro version of the GLib headers you have included. -The minor version number of the GLib library. -(e.g. in GLib version 1.2.5 this is 2.) - - -This variable is in the library, so represents the -GLib library you have linked against. Contrast with the -#GLIB_MINOR_VERSION macro, which represents the minor version of the -GLib headers you have included. diff --git a/docs/reference/glib/tmpl/gregex.sgml b/docs/reference/glib/tmpl/gregex.sgml index 51fbeb8..8167906 100644 --- a/docs/reference/glib/tmpl/gregex.sgml +++ b/docs/reference/glib/tmpl/gregex.sgml @@ -2,69 +2,11 @@ Perl-compatible regular expressions -matches strings against regular expressions + -The g_regex_*() functions implement regular -expression pattern matching using syntax and semantics similar to -Perl regular expression. - - -Some functions accept a start_position argument, -setting it differs from just passing over a shortened string and setting -#G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind -of lookbehind assertion. -For example, consider the pattern "\Biss\B" which finds occurrences of "iss" -in the middle of words. ("\B" matches only if the current position in the -subject is not a word boundary.) When applied to the string "Mississipi" -from the fourth byte, namely "issipi", it does not match, because "\B" is -always false at the start of the subject, which is deemed to be a word -boundary. However, if the entire string is passed , but with -start_position set to 4, it finds the second -occurrence of "iss" because it is able to look behind the starting point -to discover that it is preceded by a letter. - - -Note that, unless you set the #G_REGEX_RAW flag, all the strings passed -to these functions must be encoded in UTF-8. The lengths and the positions -inside the strings are in bytes and not in characters, so, for instance, -"\xc3\xa0" (i.e. "à") is two bytes long but it is treated as a single -character. If you set #G_REGEX_RAW the strings can be non-valid UTF-8 -strings and a byte is treated as a character, so "\xc3\xa0" is two bytes -and two characters long. - - -When matching a pattern, "\n" matches only against a "\n" character in the -string, and "\r" matches only a "\r" character. To match any newline sequence -use "\R". This particular group matches either the two-character sequence -CR + LF ("\r\n"), or one of the single characters LF (linefeed, U+000A, "\n"), VT -(vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"), CR (carriage return, -U+000D, "\r"), NEL (next line, U+0085), LS (line separator, U+2028), or PS -(paragraph separator, U+2029). - - -The behaviour of the dot, circumflex, and dollar metacharacters are affected by -newline characters, the default is to recognize any newline character (the same -characters recognized by "\R"). This can be changed with #G_REGEX_NEWLINE_CR, -#G_REGEX_NEWLINE_LF and #G_REGEX_NEWLINE_CRLF compile options, -and with #G_REGEX_MATCH_NEWLINE_ANY, #G_REGEX_MATCH_NEWLINE_CR, -#G_REGEX_MATCH_NEWLINE_LF and #G_REGEX_MATCH_NEWLINE_CRLF match options. -These settings are also relevant when compiling a pattern if -#G_REGEX_EXTENDED is set, and an unescaped "#" outside a character class is -encountered. This indicates a comment that lasts until after the next -newline. - - -Creating and manipulating the same #GRegex structure from different -threads is not a problem as #GRegex does not modify its internal -state between creation and destruction, on the other hand #GMatchInfo is -not threadsafe. - - -The regular expressions low level functionalities are obtained through -the excellent PCRE library -written by Philip Hazel. + @@ -80,184 +22,110 @@ written by Philip Hazel. -Error codes returned by regular expressions functions. - - -@G_REGEX_ERROR_COMPILE: Compilation of the regular expression failed. -@G_REGEX_ERROR_OPTIMIZE: Optimization of the regular expression failed. -@G_REGEX_ERROR_REPLACE: Replacement failed due to an ill-formed replacement string. -@G_REGEX_ERROR_MATCH: The match process failed. -@G_REGEX_ERROR_INTERNAL: Internal error of the regular expression engine. Since 2.16 -@G_REGEX_ERROR_STRAY_BACKSLASH: "\\" at end of pattern. Since 2.16 -@G_REGEX_ERROR_MISSING_CONTROL_CHAR: "\\c" at end of pattern. Since 2.16 -@G_REGEX_ERROR_UNRECOGNIZED_ESCAPE: Unrecognized character follows "\\". Since 2.16 -@G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER: Numbers out of order in "{}" quantifier. Since 2.16 -@G_REGEX_ERROR_QUANTIFIER_TOO_BIG: Number too big in "{}" quantifier. Since 2.16 -@G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS: Missing terminating "]" for character class. Since 2.16 -@G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS: Invalid escape sequence in character class. Since 2.16 -@G_REGEX_ERROR_RANGE_OUT_OF_ORDER: Range out of order in character class. Since 2.16 -@G_REGEX_ERROR_NOTHING_TO_REPEAT: Nothing to repeat. Since 2.16 -@G_REGEX_ERROR_UNRECOGNIZED_CHARACTER: Unrecognized character after "(?", "(?<" or "(?P". Since 2.16 -@G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS: POSIX named classes are supported only within a class. Since 2.16 -@G_REGEX_ERROR_UNMATCHED_PARENTHESIS: Missing terminating ")" or ")" without opening "(". Since 2.16 -@G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE: Reference to non-existent subpattern. Since 2.16 -@G_REGEX_ERROR_UNTERMINATED_COMMENT: Missing terminating ")" after comment. Since 2.16 -@G_REGEX_ERROR_EXPRESSION_TOO_LARGE: Regular expression too large. Since 2.16 -@G_REGEX_ERROR_MEMORY_ERROR: Failed to get memory. Since 2.16 -@G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND: Lookbehind assertion is not fixed length. Since 2.16 -@G_REGEX_ERROR_MALFORMED_CONDITION: Malformed number or name after "(?(". Since 2.16 -@G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES: Conditional group contains more than two branches. Since 2.16 -@G_REGEX_ERROR_ASSERTION_EXPECTED: Assertion expected after "(?(". Since 2.16 -@G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME: Unknown POSIX class name. Since 2.16 -@G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED: POSIX collating elements are not supported. Since 2.16 -@G_REGEX_ERROR_HEX_CODE_TOO_LARGE: Character value in "\\x{...}" sequence is too large. Since 2.16 -@G_REGEX_ERROR_INVALID_CONDITION: Invalid condition "(?(0)". Since 2.16 -@G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND: \\C not allowed in lookbehind assertion. Since 2.16 -@G_REGEX_ERROR_INFINITE_LOOP: Recursive call could loop indefinitely. Since 2.16 -@G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR: Missing terminator in subpattern name. Since 2.16 -@G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME: Two named subpatterns have the same name. Since 2.16 -@G_REGEX_ERROR_MALFORMED_PROPERTY: Malformed "\\P" or "\\p" sequence. Since 2.16 -@G_REGEX_ERROR_UNKNOWN_PROPERTY: Unknown property name after "\\P" or "\\p". Since 2.16 -@G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG: Subpattern name is too long (maximum 32 characters). Since 2.16 -@G_REGEX_ERROR_TOO_MANY_SUBPATTERNS: Too many named subpatterns (maximum 10,000). Since 2.16 -@G_REGEX_ERROR_INVALID_OCTAL_VALUE: Octal value is greater than "\\377". Since 2.16 -@G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE: "DEFINE" group contains more than one branch. Since 2.16 -@G_REGEX_ERROR_DEFINE_REPETION: Repeating a "DEFINE" group is not allowed. Since 2.16 -@G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS: Inconsistent newline options. Since 2.16 -@G_REGEX_ERROR_MISSING_BACK_REFERENCE: "\\g" is not followed by a braced name or an -optionally braced non-zero number. Since 2.16 -@Since: 2.14 + + + +@G_REGEX_ERROR_COMPILE: +@G_REGEX_ERROR_OPTIMIZE: +@G_REGEX_ERROR_REPLACE: +@G_REGEX_ERROR_MATCH: +@G_REGEX_ERROR_INTERNAL: +@G_REGEX_ERROR_STRAY_BACKSLASH: +@G_REGEX_ERROR_MISSING_CONTROL_CHAR: +@G_REGEX_ERROR_UNRECOGNIZED_ESCAPE: +@G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER: +@G_REGEX_ERROR_QUANTIFIER_TOO_BIG: +@G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS: +@G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS: +@G_REGEX_ERROR_RANGE_OUT_OF_ORDER: +@G_REGEX_ERROR_NOTHING_TO_REPEAT: +@G_REGEX_ERROR_UNRECOGNIZED_CHARACTER: +@G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS: +@G_REGEX_ERROR_UNMATCHED_PARENTHESIS: +@G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE: +@G_REGEX_ERROR_UNTERMINATED_COMMENT: +@G_REGEX_ERROR_EXPRESSION_TOO_LARGE: +@G_REGEX_ERROR_MEMORY_ERROR: +@G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND: +@G_REGEX_ERROR_MALFORMED_CONDITION: +@G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES: +@G_REGEX_ERROR_ASSERTION_EXPECTED: +@G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME: +@G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED: +@G_REGEX_ERROR_HEX_CODE_TOO_LARGE: +@G_REGEX_ERROR_INVALID_CONDITION: +@G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND: +@G_REGEX_ERROR_INFINITE_LOOP: +@G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR: +@G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME: +@G_REGEX_ERROR_MALFORMED_PROPERTY: +@G_REGEX_ERROR_UNKNOWN_PROPERTY: +@G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG: +@G_REGEX_ERROR_TOO_MANY_SUBPATTERNS: +@G_REGEX_ERROR_INVALID_OCTAL_VALUE: +@G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE: +@G_REGEX_ERROR_DEFINE_REPETION: +@G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS: +@G_REGEX_ERROR_MISSING_BACK_REFERENCE: -Error domain for regular expressions. Errors in this domain will be from the #GRegexError enumeration. See #GError for information on error domains. + -@Since: 2.14 +@Since: -Flags specifying compile-time options. - - -@G_REGEX_CASELESS: Letters in the pattern match both upper and lower case -letters. This option can be changed within a pattern by a "(?i)" option -setting. -@G_REGEX_MULTILINE: By default, GRegex treats the strings as consisting -of a single line of characters (even if it actually contains newlines). -The "start of line" metacharacter ("^") matches only at the start of the -string, while the "end of line" metacharacter ("$") matches only at the -end of the string, or before a terminating newline (unless -#G_REGEX_DOLLAR_ENDONLY is set). When #G_REGEX_MULTILINE is set, -the "start of line" and "end of line" constructs match immediately following -or immediately before any newline in the string, respectively, as well -as at the very start and end. This can be changed within a pattern by a -"(?m)" option setting. -@G_REGEX_DOTALL: A dot metacharater (".") in the pattern matches all -characters, including newlines. Without it, newlines are excluded. This -option can be changed within a pattern by a ("?s") option setting. -@G_REGEX_EXTENDED: Whitespace data characters in the pattern are -totally ignored except when escaped or inside a character class. -Whitespace does not include the VT character (code 11). In addition, -characters between an unescaped "#" outside a character class and -the next newline character, inclusive, are also ignored. This can be -changed within a pattern by a "(?x)" option setting. -@G_REGEX_ANCHORED: The pattern is forced to be "anchored", that is, -it is constrained to match only at the first matching point in the string -that is being searched. This effect can also be achieved by appropriate -constructs in the pattern itself such as the "^" metacharater. -@G_REGEX_DOLLAR_ENDONLY: A dollar metacharacter ("$") in the pattern -matches only at the end of the string. Without this option, a dollar also -matches immediately before the final character if it is a newline (but -not before any other newlines). This option is ignored if -#G_REGEX_MULTILINE is set. -@G_REGEX_UNGREEDY: Inverts the "greediness" of the -quantifiers so that they are not greedy by default, but become greedy -if followed by "?". It can also be set by a "(?U)" option setting within -the pattern. -@G_REGEX_RAW: Usually strings must be valid UTF-8 strings, using this -flag they are considered as a raw sequence of bytes. -@G_REGEX_NO_AUTO_CAPTURE: Disables the use of numbered capturing -parentheses in the pattern. Any opening parenthesis that is not followed -by "?" behaves as if it were followed by "?:" but named parentheses can -still be used for capturing (and they acquire numbers in the usual way). -@G_REGEX_OPTIMIZE: Optimize the regular expression. If the pattern will -be used many times, then it may be worth the effort to optimize it to -improve the speed of matches. -@G_REGEX_DUPNAMES: Names used to identify capturing subpatterns need not -be unique. This can be helpful for certain types of pattern when it is known -that only one instance of the named subpattern can ever be matched. -@G_REGEX_NEWLINE_CR: Usually any newline character is recognized, if this -option is set, the only recognized newline character is '\r'. -@G_REGEX_NEWLINE_LF: Usually any newline character is recognized, if this -option is set, the only recognized newline character is '\n'. -@G_REGEX_NEWLINE_CRLF: Usually any newline character is recognized, if this -option is set, the only recognized newline character sequence is '\r\n'. -@Since: 2.14 + + + +@G_REGEX_CASELESS: +@G_REGEX_MULTILINE: +@G_REGEX_DOTALL: +@G_REGEX_EXTENDED: +@G_REGEX_ANCHORED: +@G_REGEX_DOLLAR_ENDONLY: +@G_REGEX_UNGREEDY: +@G_REGEX_RAW: +@G_REGEX_NO_AUTO_CAPTURE: +@G_REGEX_OPTIMIZE: +@G_REGEX_DUPNAMES: +@G_REGEX_NEWLINE_CR: +@G_REGEX_NEWLINE_LF: +@G_REGEX_NEWLINE_CRLF: -Flags specifying match-time options. - - -@G_REGEX_MATCH_ANCHORED: The pattern is forced to be "anchored", that is, -it is constrained to match only at the first matching point in the string -that is being searched. This effect can also be achieved by appropriate -constructs in the pattern itself such as the "^" metacharater. -@G_REGEX_MATCH_NOTBOL: Specifies that first character of the string is -not the beginning of a line, so the circumflex metacharacter should not -match before it. Setting this without G_REGEX_MULTILINE (at compile time) -causes circumflex never to match. This option affects only the behaviour of -the circumflex metacharacter, it does not affect "\A". -@G_REGEX_MATCH_NOTEOL: Specifies that the end of the subject string is -not the end of a line, so the dollar metacharacter should not match it nor -(except in multiline mode) a newline immediately before it. Setting this -without G_REGEX_MULTILINE (at compile time) causes dollar never to match. -This option affects only the behaviour of the dollar metacharacter, it does -not affect "\Z" or "\z". -@G_REGEX_MATCH_NOTEMPTY: An empty string is not considered to be a valid -match if this option is set. If there are alternatives in the pattern, they -are tried. If all the alternatives match the empty string, the entire match -fails. For example, if the pattern "a?b?" is applied to a string not beginning -with "a" or "b", it matches the empty string at the start of the string. -With this flag set, this match is not valid, so GRegex searches further -into the string for occurrences of "a" or "b". -@G_REGEX_MATCH_PARTIAL: Turns on the partial matching feature, for more -documentation on partial matching see g_match_info_is_partial_match(). -@G_REGEX_MATCH_NEWLINE_CR: Overrides the newline definition set when creating -a new #GRegex, setting the '\r' character as line terminator. -@G_REGEX_MATCH_NEWLINE_LF: Overrides the newline definition set when creating -a new #GRegex, setting the '\n' character as line terminator. -@G_REGEX_MATCH_NEWLINE_CRLF: Overrides the newline definition set when creating -a new #GRegex, setting the '\r\n' characters as line terminator. -@G_REGEX_MATCH_NEWLINE_ANY: Overrides the newline definition set when creating -a new #GRegex, any newline character or character sequence is recognized. -@Since: 2.14 + + + +@G_REGEX_MATCH_ANCHORED: +@G_REGEX_MATCH_NOTBOL: +@G_REGEX_MATCH_NOTEOL: +@G_REGEX_MATCH_NOTEMPTY: +@G_REGEX_MATCH_PARTIAL: +@G_REGEX_MATCH_NEWLINE_CR: +@G_REGEX_MATCH_NEWLINE_LF: +@G_REGEX_MATCH_NEWLINE_CRLF: +@G_REGEX_MATCH_NEWLINE_ANY: -A GRegex is the "compiled" form of a regular expression pattern. This -structure is opaque and its fields cannot be accessed directly. + -@Since: 2.14 -Specifies the type of the function passed to g_regex_replace_eval(). -It is called for each occurance of the pattern in the string passed -to g_regex_replace_eval(), and it should append the replacement to -@result. + -@match_info: the #GMatchInfo generated by the match. -Use g_match_info_get_regex() and g_match_info_get_string() if you -need the #GRegex or the matched string. -@result: a #GString containing the new string -@user_data: user data passed to g_regex_replace_eval() -@Returns: %FALSE to continue the replacement process, %TRUE to stop it -@Since: 2.14 +@match_info: +@result: +@user_data: +@Returns: @@ -326,6 +194,24 @@ need the #GRegex or the matched string. @Returns: + + + + + +@regex: +@Returns: + + + + + + + +@regex: +@Returns: + + diff --git a/docs/reference/glib/tmpl/gurifuncs.sgml b/docs/reference/glib/tmpl/gurifuncs.sgml index b2bbd6d..9157b65 100644 --- a/docs/reference/glib/tmpl/gurifuncs.sgml +++ b/docs/reference/glib/tmpl/gurifuncs.sgml @@ -9,13 +9,11 @@ URI Functions - - @@ -107,3 +105,25 @@ URI Functions @Returns: + + + + + +@uri: +@hostname: +@error: +@Returns: + + + + + + + +@filename: +@hostname: +@error: +@Returns: + + diff --git a/docs/reference/glib/tmpl/gvariant.sgml b/docs/reference/glib/tmpl/gvariant.sgml index c2ca7a0..c29455a 100644 --- a/docs/reference/glib/tmpl/gvariant.sgml +++ b/docs/reference/glib/tmpl/gvariant.sgml @@ -9,13 +9,11 @@ GVariant - - @@ -54,6 +52,15 @@ GVariant @Returns: + + + + + +@value: +@Returns: + + @@ -91,6 +98,16 @@ GVariant @Returns: + + + + + +@one: +@two: +@Returns: + + @@ -320,6 +337,25 @@ GVariant @Returns: + + + + + +@string: +@Returns: + + + + + + + +@strv: +@length: +@Returns: + + @@ -459,6 +495,45 @@ GVariant @Returns: + + + + + +@value: +@Returns: + + + + + + + +@value: +@length: +@Returns: + + + + + + + +@value: +@length: +@Returns: + + + + + + + +@value: +@length: +@Returns: + + @@ -539,6 +614,29 @@ GVariant @Varargs: + + + + + +@dictionary: +@key: +@expected_type: +@Returns: + + + + + + + +@dictionary: +@key: +@format_string: +@Varargs: +@Returns: + + @@ -808,6 +906,16 @@ GVariant @Varargs: + + + + + +@builder: +@format: +@Varargs: + + @@ -834,6 +942,30 @@ GVariant @builder: + + + + + +@G_VARIANT_PARSE_ERROR_FAILED: +@G_VARIANT_PARSE_ERROR_BASIC_TYPE_EXPECTED: +@G_VARIANT_PARSE_ERROR_CANNOT_INFER_TYPE: +@G_VARIANT_PARSE_ERROR_DEFINITE_TYPE_EXPECTED: +@G_VARIANT_PARSE_ERROR_INPUT_NOT_AT_END: +@G_VARIANT_PARSE_ERROR_INVALID_CHARACTER: +@G_VARIANT_PARSE_ERROR_INVALID_FORMAT_STRING: +@G_VARIANT_PARSE_ERROR_INVALID_OBJECT_PATH: +@G_VARIANT_PARSE_ERROR_INVALID_SIGNATURE: +@G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING: +@G_VARIANT_PARSE_ERROR_NO_COMMON_TYPE: +@G_VARIANT_PARSE_ERROR_NUMBER_OUT_OF_RANGE: +@G_VARIANT_PARSE_ERROR_NUMBER_TOO_BIG: +@G_VARIANT_PARSE_ERROR_TYPE_ERROR: +@G_VARIANT_PARSE_ERROR_UNEXPECTED_TOKEN: +@G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD: +@G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT: +@G_VARIANT_PARSE_ERROR_VALUE_EXPECTED: + diff --git a/docs/reference/glib/tmpl/gvarianttype.sgml b/docs/reference/glib/tmpl/gvarianttype.sgml index dc846df..7ae0790 100644 --- a/docs/reference/glib/tmpl/gvarianttype.sgml +++ b/docs/reference/glib/tmpl/gvarianttype.sgml @@ -9,13 +9,11 @@ GVariantType - - @@ -182,6 +180,27 @@ GVariantType + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/glib/tmpl/hash_tables.sgml b/docs/reference/glib/tmpl/hash_tables.sgml index 51755e3..e9d856a 100644 --- a/docs/reference/glib/tmpl/hash_tables.sgml +++ b/docs/reference/glib/tmpl/hash_tables.sgml @@ -9,13 +9,11 @@ Hash Tables - - diff --git a/docs/reference/glib/tmpl/i18n.sgml b/docs/reference/glib/tmpl/i18n.sgml index 665371d..ebcc7d5 100644 --- a/docs/reference/glib/tmpl/i18n.sgml +++ b/docs/reference/glib/tmpl/i18n.sgml @@ -35,6 +35,16 @@ The gettext manual. + + +Marks a string for translation, gets replaced with the translated string +at runtime. + + +@String: the string to be translated +@Since: 2.4 + + Like _(), but handles context in message ids. This has the advantage that @@ -163,6 +173,17 @@ Intltool has support for the NC_() macro since version 0.40.1. @Returns: + + + + + +@domain: +@msgid: +@category: +@Returns: + + diff --git a/docs/reference/glib/tmpl/iochannels.sgml b/docs/reference/glib/tmpl/iochannels.sgml index 26cd23d..6a810d4 100644 --- a/docs/reference/glib/tmpl/iochannels.sgml +++ b/docs/reference/glib/tmpl/iochannels.sgml @@ -9,13 +9,11 @@ IO Channels - - diff --git a/docs/reference/glib/tmpl/keyfile.sgml b/docs/reference/glib/tmpl/keyfile.sgml index 4e72ad6..8080774 100644 --- a/docs/reference/glib/tmpl/keyfile.sgml +++ b/docs/reference/glib/tmpl/keyfile.sgml @@ -365,6 +365,30 @@ Flags which influence the parsing. @Returns: + + + + + +@key_file: +@group_name: +@key: +@error: +@Returns: + + + + + + + +@key_file: +@group_name: +@key: +@error: +@Returns: + + @@ -511,6 +535,28 @@ Flags which influence the parsing. @value: + + + + + +@key_file: +@group_name: +@key: +@value: + + + + + + + +@key_file: +@group_name: +@key: +@value: + + diff --git a/docs/reference/glib/tmpl/limits.sgml b/docs/reference/glib/tmpl/limits.sgml index caa305d..5326b48 100644 --- a/docs/reference/glib/tmpl/limits.sgml +++ b/docs/reference/glib/tmpl/limits.sgml @@ -221,7 +221,7 @@ The minimum positive value which can be held in a #gfloat. If you are interested in the smallest value which can be held in a #gfloat, -use -G_MAX_FLOAT. +use -G_MAXFLOAT. diff --git a/docs/reference/glib/tmpl/linked_lists_double.sgml b/docs/reference/glib/tmpl/linked_lists_double.sgml index f495abd..b6fea20 100644 --- a/docs/reference/glib/tmpl/linked_lists_double.sgml +++ b/docs/reference/glib/tmpl/linked_lists_double.sgml @@ -9,13 +9,11 @@ Doubly-Linked Lists - - @@ -132,6 +130,15 @@ Doubly-Linked Lists @list: + + + + + +@list: +@free_func: + + diff --git a/docs/reference/glib/tmpl/linked_lists_single.sgml b/docs/reference/glib/tmpl/linked_lists_single.sgml index b5863bf..d53027d 100644 --- a/docs/reference/glib/tmpl/linked_lists_single.sgml +++ b/docs/reference/glib/tmpl/linked_lists_single.sgml @@ -9,13 +9,11 @@ Singly-Linked Lists - - @@ -140,6 +138,15 @@ Singly-Linked Lists @list: + + + + + +@list: +@free_func: + + diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml index 131472d..eb875bb 100644 --- a/docs/reference/glib/tmpl/macros_misc.sgml +++ b/docs/reference/glib/tmpl/macros_misc.sgml @@ -100,30 +100,52 @@ does not include string.h for you. Accepts a macro or a string and converts it into a string after -preprocessor argument expansion. +preprocessor argument expansion. For example, the following code: + +#define AGE 27 +const gchar *greeting = G_STRINGIFY (AGE) " today!"; + + + +is transformed by the preprocessor into (code equivalent to): + + + +const gchar *greeting = "27 today!"; + + @macro_or_string: a macro or a string. -Yields a new preprocessor pasted identifier 'identifier1identifier2' -from its expanded arguments 'identifier1' and 'identifier2'. +Yields a new preprocessor pasted identifier identifier1identifier2 +from its expanded arguments @identifier1 and @identifier2. For example, the +following code: -@identifier1: an identifier -@identifier2: an identifier -@Since: 2.20 - + +#define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller) +const gchar *name = GET (traveller, name); +const gchar *quest = GET (traveller, quest); +GdkColor *favourite = GET (traveller, favourite_colour); + - - +is transformed by the preprocessor into: -@identifier1: -@identifier2: + +const gchar *name = traveller_get_name (traveller); +const gchar *quest = traveller_get_quest (traveller); +GdkColor *favourite = traveller_get_favourite_colour (traveller); + + +@identifier1: an identifier +@identifier2: an identifier +@Since: 2.20 @@ -131,6 +153,12 @@ from its expanded arguments 'identifier1' and 'identifier2'. The G_STATIC_ASSERT macro lets the programmer check a condition at compile time, the condition needs to be compile time computable. The macro can be used in any place where a typedef is valid. + + +A typedef is generally allowed in exactly the same +places that a variable declaration is allowed. For this reason, you should not use G_STATIC_ASSERT in the middle of blocks of code. + + The macro should only be used once per source code line. @@ -228,6 +256,19 @@ See the GNU C documentation for details. @Since: 2.2 + + +Like %G_GNUC_DEPRECATED, but names the intended replacement for the +deprecated symbol if the version of gcc in use is +new enough to support custom deprecation messages. +See the GNU C documentation for details. + + +@f: the intended replacement for the deprecated symbol, such as the name of a + function +@Since: 2.25.3 + + Expands to the GNU C noreturn function attribute if the diff --git a/docs/reference/glib/tmpl/main.sgml b/docs/reference/glib/tmpl/main.sgml index 04c0eb3..cc7ac2d 100644 --- a/docs/reference/glib/tmpl/main.sgml +++ b/docs/reference/glib/tmpl/main.sgml @@ -2,99 +2,12 @@ The Main Event Loop -manages all available sources of events + - - The main event loop manages all the available sources of events for - GLib and GTK+ applications. These events can come from any number of - different types of sources such as file descriptors (plain files, - pipes or sockets) and timeouts. New types of event sources can also - be added using g_source_attach(). - - - To allow multiple independent sets of sources to be handled in - different threads, each source is associated with a #GMainContext. - A #GMainContext can only be running in a single thread, but - sources can be added to it and removed from it from other threads. - - - Each event source is assigned a priority. The default priority, - #G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher - priorities. Values greater than 0 denote lower priorities. Events - from high priority sources are always processed before events from - lower priority sources. - - - Idle functions can also be added, and assigned a priority. These will - be run whenever no events with a higher priority are ready to be - processed. - - - The #GMainLoop data type represents a main event loop. A #GMainLoop - is created with g_main_loop_new(). After adding the initial event sources, - g_main_loop_run() is called. This continuously checks for new events from - each of the event sources and dispatches them. Finally, the - processing of an event from one of the sources leads to a call to - g_main_loop_quit() to exit the main loop, and g_main_loop_run() returns. - - - It is possible to create new instances of #GMainLoop recursively. - This is often used in GTK+ applications when showing modal dialog - boxes. Note that event sources are associated with a particular - #GMainContext, and will be checked and dispatched for all main - loops associated with that #GMainContext. - - - GTK+ contains wrappers of some of these functions, e.g. gtk_main(), - gtk_main_quit() and gtk_events_pending(). - - - Creating new sources types - - One of the unusual features of the GTK+ main loop functionality - is that new types of event source can be created and used in - addition to the builtin type of event source. A new event source - type is used for handling GDK events. A new source type is - created by deriving from the #GSource - structure. The derived type of source is represented by a - structure that has the #GSource structure as a first element, - and other elements specific to the new source type. To create - an instance of the new source type, call g_source_new() passing - in the size of the derived structure and a table of functions. - These #GSourceFuncs determine the behavior of the new source - types. - - - New source types basically interact with the main context - in two ways. Their prepare function in #GSourceFuncs can set - a timeout to determine the maximum amount of time that the - main loop will sleep before checking the source again. In - addition, or as well, the source can add file descriptors to - the set that the main context checks using g_source_add_poll(). - - - - Customizing the main loop iteration - - Single iterations of a #GMainContext can be run with - g_main_context_iteration(). In some cases, more detailed control - of exactly how the details of the main loop work is desired, - for instance, when integrating the #GMainLoop with an external - main loop. In such cases, you can call the component functions - of g_main_context_iteration() directly. These functions - are g_main_context_prepare(), g_main_context_query(), - g_main_context_check() and g_main_context_dispatch(). - - - The operation of these functions can best be seen in terms - of a state diagram, as shown in . - -
    - States of a Main Context - -
    -
    + + + @@ -109,8 +22,7 @@ manages all available sources of events -The GMainLoop struct is an opaque data type -representing the main event loop of a GLib or GTK+ application. + @@ -177,102 +89,82 @@ representing the main event loop of a GLib or GTK+ application. -Creates a new #GMainLoop for the default main loop. + -@is_running: set to %TRUE to indicate that the loop is running. This is not -very important since calling g_main_run() will set this to %TRUE anyway. -@Returns: a new #GMainLoop. -@Deprecated: 2.2: Use g_main_loop_new() instead. +@is_running: -Frees the memory allocated for the #GMainLoop. + -@loop: a #GMainLoop. -@Deprecated: 2.2: Use g_main_loop_unref() instead. +@loop: -Runs a main loop until it stops running. + -@loop: a #GMainLoop. -@Deprecated: 2.2: Use g_main_loop_run() instead. +@loop: -Stops the #GMainLoop. If g_main_run() was called to run the #GMainLoop, -it will now return. + -@loop: a #GMainLoop. -@Deprecated: 2.2: Use g_main_loop_quit() instead. +@loop: -Checks if the main loop is running. + -@loop: a #GMainLoop. -@Returns: %TRUE if the main loop is running. -@Deprecated: 2.2: USe g_main_loop_is_running() instead. +@loop: -Use this for high priority event sources. -It is not used within GLib or GTK+. + -Use this for default priority event sources. -In GLib this priority is used when adding timeout functions with -g_timeout_add(). -In GDK this priority is used for events from the X server. + -Use this for high priority idle functions. -GTK+ uses #G_PRIORITY_HIGH_IDLE + 10 for resizing operations, and -#G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is done to -ensure that any pending resizes are processed before any pending redraws, -so that widgets are not redrawn twice unnecessarily.) + -Use this for default priority idle functions. -In GLib this priority is used when adding idle functions with g_idle_add(). + -Use this for very low priority background tasks. -It is not used within GLib or GTK+. + -The GMainContext struct is an opaque data type -representing a set of sources to be handled in a main loop. + @@ -323,15 +215,10 @@ representing a set of sources to be handled in a main loop. -Runs a single iteration for the default #GMainContext. + -@may_block: set to %TRUE if it should block (i.e. wait) until an event source -becomes ready. It will return after an event source has been processed. -If set to %FALSE it will return immediately if no event source is ready to be -processed. -@Returns: %TRUE if more events are pending. -@Deprecated: 2.2: Use g_main_context_iteration() instead. +@may_block: @@ -345,12 +232,9 @@ processed. -Checks if any events are pending for the default #GMainContext -(i.e. ready to be processed). + -@Returns: %TRUE if any events are pending. -@Deprecated: 2.2: Use g_main_context_pending() instead. @@ -492,17 +376,13 @@ Checks if any events are pending for the default #GMainContext -Specifies the type of function passed to g_main_context_set_poll_func(). -The semantics of the function should match those of the -poll() system call. + -@ufds: an array of #GPollFD elements. -@nfsd: the number of elements in @ufds. -@timeout_: the maximum time to wait for an event of the file descriptors. - A negative value indicates an infinite timeout. -@Returns: the number of #GPollFD elements which have events or errors reported, -or -1 if an error occurred. +@ufds: +@nfsd: +@timeout_: +@Returns: @@ -544,12 +424,32 @@ or -1 if an error occurred. -Sets the function to use for the handle polling of file descriptors -for the default main context. + + + +@func: + + + + + + + +@context: +@function: +@data: + + + + + -@func: the function to call to poll all file descriptors. -@Deprecated: 2.2: Use g_main_context_set_poll_func() instead. +@context: +@priority: +@function: +@data: +@notify: @@ -680,22 +580,18 @@ for the default main context. -A type which is used to hold a process identification. -On Unix, processes are identified by a process id (an -integer), while Windows uses process handles (which are -pointers). + -The type of functions to be called when a child exists. + -@pid: the process id of the child process -@status: Status information about the child process, - see waitpid(2) for more information about this field -@data: user data passed to g_child_watch_add() +@pid: +@status: +@data: @@ -734,32 +630,6 @@ The type of functions to be called when a child exists. - - - - - -#gint fd; -the file descriptor to poll (or a HANDLE on Win32 platforms). - - - -#gushort events; -a bitwise combination of flags from #GIOCondition, specifying which -events should be polled for. Typically for reading from a file descriptor -you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and for writing you would use -%G_IO_OUT | %G_IO_ERR. - - - - -#gushort revents; -a bitwise combination of flags from #GIOCondition, returned from the -poll() function to indicate which events occurred. - - - - @fd: @@ -787,8 +657,7 @@ you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and for writing you would use -The GSource struct is an opaque data type representing -an event source. + @@ -803,63 +672,24 @@ for dependency reasons. -The #GSourceFuncs struct contains a table of functions used to handle -event sources in a generic manner. - - -For idle sources, the prepare and check functions always return %TRUE to -indicate that the source is always ready to be processed. -The prepare function also returns a timeout value of 0 to ensure that the -poll() call doesn't block (since that would be time -wasted which could have been spent running the idle function). - - -For timeout sources, the prepare and check functions both return %TRUE if the -timeout interval has expired. The prepare function also returns a timeout -value to ensure that the poll() call doesn't block too -long and miss the next timeout. - - -For file descriptor sources, the prepare function typically returns %FALSE, -since it must wait until poll() has been called before -it knows whether any events need to be processed. It sets the returned -timeout to -1 to indicate that it doesn't mind how long the -poll() call blocks. -In the check function, it tests the results of the poll() -call to see if the required condition has been met, and returns %TRUE if so. - - -@prepare: Called before all the file descriptors are polled. -If the source can determine that it is ready here (without waiting for the -results of the poll() call) it should return %TRUE. -It can also return a @timeout_ value which should be the maximum timeout -(in milliseconds) which should be passed to the poll() call. -The actual timeout used will be -1 if all sources returned -1, or it will -be the minimum of all the @timeout_ values returned which were >= 0. -@check: Called after all the file descriptors are polled. -The source should return %TRUE if it is ready to be dispatched. -Note that some time may have passed since the previous prepare function was -called, so the source should be checked again here. -@dispatch: Called to dispatch the event source, after it has returned %TRUE in -either its @prepare or its @check function. The @dispatch function is -passed in a callback function and data. The callback function may be -%NULL if the source was never connected to a callback using -g_source_set_callback(). The @dispatch function should call the -callback function with @user_data and whatever additional parameters are -needed for this type of event source. -@finalize: Called when the source is finalized. + + + +@prepare: +@check: +@dispatch: +@finalize: @closure_callback: @closure_marshal: -The GSourceCallbackFuncs struct contains -functions for managing callback objects. + -@ref: Called when a reference is added to the callback object. -@unref: Called when a reference to the callback object is dropped. -@get: Called to extract the callback function and data from the callback object. +@ref: +@unref: +@get: @@ -969,6 +799,33 @@ functions for managing callback objects. @Returns: + + + + + +@source: +@Returns: + + + + + + + +@source: +@name: + + + + + + + +@tag: +@name: + + @@ -1028,6 +885,33 @@ of the above functions. @fd: + + + + + +@source: +@child_source: + + + + + + + +@source: +@child_source: + + + + + + + +@source: +@Returns: + + diff --git a/docs/reference/glib/tmpl/memory.sgml b/docs/reference/glib/tmpl/memory.sgml index 3e8fe97..13d1809 100644 --- a/docs/reference/glib/tmpl/memory.sgml +++ b/docs/reference/glib/tmpl/memory.sgml @@ -2,29 +2,12 @@ Memory Allocation -general memory-handling + -These functions provide support for allocating and freeing memory. - - - -If any call to allocate memory fails, the application is terminated. -This also means that there is no need to check if the call succeeded. - - - - -It's important to match g_malloc() with g_free(), plain malloc() with free(), -and (if you're using C++) new with delete and new[] with delete[]. Otherwise -bad things can happen, since these allocators may use different memory -pools (and new/delete call constructors and destructors). See also -g_mem_set_vtable(). - - @@ -39,304 +22,207 @@ g_mem_set_vtable(). -Allocates @n_structs elements of type @struct_type. -The returned pointer is cast to a pointer to the given type. -If @n_structs is 0 it returns %NULL. -Care is taken to avoid overflow when calculating the size of the allocated block. - - -Since the returned pointer is already casted to the right type, -it is normally unnecessary to cast it explicitly, and doing -so might hide memory allocation errors. + -@struct_type: the type of the elements to allocate -@n_structs: the number of elements to allocate -@Returns: a pointer to the allocated memory, cast to a pointer to @struct_type +@struct_type: +@n_structs: -Allocates @n_structs elements of type @struct_type, initialized to 0's. -The returned pointer is cast to a pointer to the given type. -If @n_structs is 0 it returns %NULL. -Care is taken to avoid overflow when calculating the size of the allocated block. - - -Since the returned pointer is already casted to the right type, -it is normally unnecessary to cast it explicitly, and doing -so might hide memory allocation errors. + -@struct_type: the type of the elements to allocate. -@n_structs: the number of elements to allocate. -@Returns: a pointer to the allocated memory, cast to a pointer to @struct_type. +@struct_type: +@n_structs: -Reallocates the memory pointed to by @mem, so that it now has space for -@n_structs elements of type @struct_type. It returns the new address of -the memory, which may have been moved. -Care is taken to avoid overflow when calculating the size of the allocated block. + -@struct_type: the type of the elements to allocate -@mem: the currently allocated memory -@n_structs: the number of elements to allocate -@Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type +@struct_type: +@mem: +@n_structs: -Attempts to allocate @n_structs elements of type @struct_type, and returns -%NULL on failure. Contrast with g_new(), which aborts the program on failure. -The returned pointer is cast to a pointer to the given type. -The function returns %NULL when @n_structs is 0 of if an overflow occurs. + -@struct_type: the type of the elements to allocate -@n_structs: the number of elements to allocate -@Returns: a pointer to the allocated memory, cast to a pointer to @struct_type -@Since: 2.8 +@struct_type: +@n_structs: -Attempts to allocate @n_structs elements of type @struct_type, initialized -to 0's, and returns %NULL on failure. Contrast with g_new0(), which aborts -the program on failure. -The returned pointer is cast to a pointer to the given type. -The function returns %NULL when @n_structs is 0 of if an overflow occurs. + -@struct_type: the type of the elements to allocate -@n_structs: the number of elements to allocate -@Returns: a pointer to the allocated memory, cast to a pointer to @struct_type -@Since: 2.8 +@struct_type: +@n_structs: -Attempts to reallocate the memory pointed to by @mem, so that it now has -space for @n_structs elements of type @struct_type, and returns %NULL on -failure. Contrast with g_renew(), which aborts the program on failure. -It returns the new address of the memory, which may have been moved. -The function returns %NULL if an overflow occurs. + -@struct_type: the type of the elements to allocate -@mem: the currently allocated memory -@n_structs: the number of elements to allocate -@Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type -@Since: 2.8 +@struct_type: +@mem: +@n_structs: -Allocates @n_bytes bytes of memory. -If @n_bytes is 0 it returns %NULL. + -@n_bytes: the number of bytes to allocate -@Returns: a pointer to the allocated memory +@n_bytes: +@Returns: -Allocates @n_bytes bytes of memory, initialized to 0's. -If @n_bytes is 0 it returns %NULL. + -@n_bytes: the number of bytes to allocate -@Returns: a pointer to the allocated memory +@n_bytes: +@Returns: -Reallocates the memory pointed to by @mem, so that it now has space for -@n_bytes bytes of memory. It returns the new address of the memory, which may -have been moved. @mem may be %NULL, in which case it's considered to -have zero-length. @n_bytes may be 0, in which case %NULL will be returned -and @mem will be freed unless it is %NULL. + -@mem: the memory to reallocate -@n_bytes: new size of the memory in bytes -@Returns: the new address of the allocated memory +@mem: +@n_bytes: +@Returns: -Attempts to allocate @n_bytes, and returns %NULL on failure. -Contrast with g_malloc(), which aborts the program on failure. + -@n_bytes: number of bytes to allocate. -@Returns: the allocated memory, or %NULL. +@n_bytes: +@Returns: -Attempts to allocate @n_bytes, initialized to 0's, and returns %NULL on -failure. Contrast with g_malloc0(), which aborts the program on failure. + -@n_bytes: number of bytes to allocate -@Returns: the allocated memory, or %NULL -@Since: 2.8 +@n_bytes: +@Returns: -Attempts to realloc @mem to a new size, @n_bytes, and returns %NULL -on failure. Contrast with g_realloc(), which aborts the program -on failure. If @mem is %NULL, behaves the same as g_try_malloc(). + -@mem: previously-allocated memory, or %NULL. -@n_bytes: number of bytes to allocate. -@Returns: the allocated memory, or %NULL. +@mem: +@n_bytes: +@Returns: -This function is similar to g_malloc(), allocating (@n_blocks * @n_block_bytes) bytes, -but care is taken to detect possible overflow during multiplication. + -@n_blocks: the number of blocks to allocate -@n_block_bytes: the size of each block in bytes -@Returns: a pointer to the allocated memory -@Since: 2.24 +@n_blocks: +@n_block_bytes: +@Returns: -This function is similar to g_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes, -but care is taken to detect possible overflow during multiplication. + -@n_blocks: the number of blocks to allocate -@n_block_bytes: the size of each block in bytes -@Returns: a pointer to the allocated memory -@Since: 2.24 +@n_blocks: +@n_block_bytes: +@Returns: -This function is similar to g_realloc(), allocating (@n_blocks * @n_block_bytes) bytes, -but care is taken to detect possible overflow during multiplication. + -@mem: the memory to reallocate -@n_blocks: the number of blocks to allocate -@n_block_bytes: the size of each block in bytes -@Returns: the new address of the allocated memory -@Since: 2.24 +@mem: +@n_blocks: +@n_block_bytes: +@Returns: -This function is similar to g_try_malloc(), allocating (@n_blocks * @n_block_bytes) bytes, -but care is taken to detect possible overflow during multiplication. + -@n_blocks: the number of blocks to allocate -@n_block_bytes: the size of each block in bytes -@Returns: the allocated memory, or %NULL. -@Since: 2.24 +@n_blocks: +@n_block_bytes: +@Returns: -This function is similar to g_try_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes, -but care is taken to detect possible overflow during multiplication. + -@n_blocks: the number of blocks to allocate -@n_block_bytes: the size of each block in bytes -@Returns: the allocated memory, or %NULL -@Since: 2.24 +@n_blocks: +@n_block_bytes: +@Returns: -This function is similar to g_try_realloc(), allocating (@n_blocks * @n_block_bytes) bytes, -but care is taken to detect possible overflow during multiplication. + -@mem: previously-allocated memory, or %NULL. -@n_blocks: the number of blocks to allocate -@n_block_bytes: the size of each block in bytes -@Returns: the allocated memory, or %NULL. -@Since: 2.24 +@mem: +@n_blocks: +@n_block_bytes: +@Returns: -Frees the memory pointed to by @mem. -If @mem is %NULL it simply returns. + -@mem: the memory to free +@mem: -This variable is %TRUE if the G_DEBUG environment variable -includes the key gc-friendly. + -Allocates @size bytes on the stack; these bytes will be freed when the current -stack frame is cleaned up. This macro essentially just wraps the alloca() -function present on most UNIX variants. -Thus it provides the same advantages and pitfalls as alloca(): - - - + alloca() is very fast, as on most systems it's implemented by just adjusting - the stack pointer register. - - - + It doesn't cause any memory fragmentation, within its scope, separate alloca() - blocks just build up and are released together at function end. - - - - Allocation sizes have to fit into the current stack frame. For instance in a - threaded environment on Linux, the per-thread stack size is limited to 2 Megabytes, - so be sparse with alloca() uses. - - - - Allocation failure due to insufficient stack space is not indicated with a %NULL - return like e.g. with malloc(). Instead, most systems probably handle it the same - way as out of stack space situations from infinite function recursion, i.e. - with a segmentation fault. - - - - Special care has to be taken when mixing alloca() with GNU C variable sized arrays. - Stack space allocated with alloca() in the same scope as a variable sized array - will be freed together with the variable sized array upon exit of that scope, and - not upon exit of the enclosing function scope. - - -@size: number of bytes to allocate. -@Returns: space for @size bytes, allocated on the stack +@size: -Wraps g_alloca() in a more typesafe manner. + -@struct_type: Type of memory chunks to be allocated -@n_structs: Number of chunks to be allocated -@Returns: Pointer to stack space for @n_structs chunks of type @struct_type +@struct_type: +@n_structs: @@ -351,42 +237,32 @@ Wraps g_alloca() in a more typesafe manner. -Allocates @byte_size bytes of memory, and copies @byte_size bytes into it -from @mem. If @mem is %NULL it returns %NULL. + -@mem: the memory to copy. -@byte_size: the number of bytes to copy. -@Returns: a pointer to the newly-allocated copy of the memory, or %NULL if @mem -is %NULL. +@mem: +@byte_size: +@Returns: -A set of functions used to perform memory allocation. The same #GMemVTable must -be used for all allocations in the same program; a call to g_mem_set_vtable(), -if it exists, should be prior to any use of GLib. + -@malloc: function to use for allocating memory. -@realloc: function to use for reallocating memory. -@free: function to use to free memory. -@calloc: function to use for allocating zero-filled memory. -@try_malloc: function to use for allocating memory without a default error handler. -@try_realloc: function to use for reallocating memory without a default error handler. +@malloc: +@realloc: +@free: +@calloc: +@try_malloc: +@try_realloc: -Sets the #GMemVTable to use for memory allocation. You can use this to provide -custom memory allocation routines. This function must be called -before using any other GLib functions. The @vtable only needs to -provide malloc(), realloc(), and free() functions; GLib can provide default -implementations of the others. The malloc() and realloc() implementations -should return %NULL on failure, GLib will handle error-checking for you. -@vtable is copied, so need not persist after this function has been called. + -@vtable: table of memory allocation routines. +@vtable: @@ -400,27 +276,13 @@ should return %NULL on failure, GLib will handle error-checking for you. -A #GMemVTable containing profiling variants of the memory -allocation functions. Use them together with g_mem_profile() -in order to get information about the memory allocation pattern -of your program. + -Outputs a summary of memory usage. - - -It outputs the frequency of allocations of different sizes, -the total number of bytes which have been allocated, -the total number of bytes which have been freed, -and the difference between the previous two values, i.e. the number of bytes -still in use. - - -Note that this function will not output anything unless you have -previously installed the #glib_mem_profiler_table with g_mem_set_vtable(). + @void: diff --git a/docs/reference/glib/tmpl/memory_chunks.sgml b/docs/reference/glib/tmpl/memory_chunks.sgml index 21f979a..a1983e1 100644 --- a/docs/reference/glib/tmpl/memory_chunks.sgml +++ b/docs/reference/glib/tmpl/memory_chunks.sgml @@ -9,13 +9,11 @@ Memory Chunks - - diff --git a/docs/reference/glib/tmpl/misc_utils.sgml b/docs/reference/glib/tmpl/misc_utils.sgml index 6e9d790..91c1e7b 100644 --- a/docs/reference/glib/tmpl/misc_utils.sgml +++ b/docs/reference/glib/tmpl/misc_utils.sgml @@ -54,6 +54,15 @@ These are portable utility functions. @prgname: + + + + + +@void: +@Returns: + + @@ -136,6 +145,15 @@ These are portable utility functions. @Returns: + + + + + +@void: +@Returns: + + diff --git a/docs/reference/glib/tmpl/numerical.sgml b/docs/reference/glib/tmpl/numerical.sgml index 64d9800..ebb9589 100644 --- a/docs/reference/glib/tmpl/numerical.sgml +++ b/docs/reference/glib/tmpl/numerical.sgml @@ -13,15 +13,16 @@ versions always exist. The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the - sign, mantissa and exponent of IEEE floats and doubles. These - unions are defined as appropriate for a given platform. - IEEE floats and doubles are supported (used for - storage) by at least Intel, PPC and Sparc, for reference: http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +sign, mantissa and exponent of IEEE floats and doubles. These unions are +defined as appropriate for a given platform. IEEE floats and doubles are +supported (used for storage) by at least Intel, PPC and Sparc. See +IEEE 754-2008 +for more information about IEEE number formats. -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html + @@ -32,37 +33,33 @@ The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the -See http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The bias by which exponents in single-precision floats are offset. -See http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The bias by which exponents in double-precision floats are offset. -The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the - sign, mantissa and exponent of IEEE floats and doubles. These - unions are defined as appropriate for a given platform. - IEEE floats and doubles are supported (used for - storage) by at least Intel, PPC and Sparc, for reference: -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign, +mantissa and exponent of IEEE floats and doubles. These unions are defined +as appropriate for a given platform. IEEE floats and doubles are supported +(used for storage) by at least Intel, PPC and Sparc. -The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the - sign, mantissa and exponent of IEEE floats and doubles. These - unions are defined as appropriate for a given platform. - IEEE floats and doubles are supported (used for - storage) by at least Intel, PPC and Sparc, for reference: -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign, +mantissa and exponent of IEEE floats and doubles. These unions are defined +as appropriate for a given platform. IEEE floats and doubles are supported +(used for storage) by at least Intel, PPC and Sparc. @@ -117,8 +114,7 @@ The square root of two. -Used for fooling around with float formats, see -http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html +Multiplying the base 2 exponent by this number yields the base 10 exponent. diff --git a/docs/reference/glib/tmpl/option.sgml b/docs/reference/glib/tmpl/option.sgml index 475caeb..71e1acb 100644 --- a/docs/reference/glib/tmpl/option.sgml +++ b/docs/reference/glib/tmpl/option.sgml @@ -9,13 +9,11 @@ Commandline option parser - - diff --git a/docs/reference/glib/tmpl/patterns.sgml b/docs/reference/glib/tmpl/patterns.sgml index c07e8c8..87555f0 100644 --- a/docs/reference/glib/tmpl/patterns.sgml +++ b/docs/reference/glib/tmpl/patterns.sgml @@ -9,13 +9,11 @@ Glob-style pattern matching - - diff --git a/docs/reference/glib/tmpl/quarks.sgml b/docs/reference/glib/tmpl/quarks.sgml index 4ca807b..ba5e10b 100644 --- a/docs/reference/glib/tmpl/quarks.sgml +++ b/docs/reference/glib/tmpl/quarks.sgml @@ -9,13 +9,11 @@ Quarks - - diff --git a/docs/reference/glib/tmpl/random_numbers.sgml b/docs/reference/glib/tmpl/random_numbers.sgml index 2cac1c9..e10486d 100644 --- a/docs/reference/glib/tmpl/random_numbers.sgml +++ b/docs/reference/glib/tmpl/random_numbers.sgml @@ -9,13 +9,11 @@ Random Numbers - - diff --git a/docs/reference/glib/tmpl/relations.sgml b/docs/reference/glib/tmpl/relations.sgml index bcbbd24..6aff655 100644 --- a/docs/reference/glib/tmpl/relations.sgml +++ b/docs/reference/glib/tmpl/relations.sgml @@ -9,13 +9,11 @@ Relations and Tuples - - diff --git a/docs/reference/glib/tmpl/sequence.sgml b/docs/reference/glib/tmpl/sequence.sgml index 40c4e2e..0234ec7 100644 --- a/docs/reference/glib/tmpl/sequence.sgml +++ b/docs/reference/glib/tmpl/sequence.sgml @@ -9,13 +9,11 @@ Sequences
    - - @@ -283,6 +281,30 @@ Sequences @Returns: + + + + + +@seq: +@data: +@cmp_func: +@cmp_data: +@Returns: + + + + + + + +@seq: +@data: +@iter_cmp: +@cmp_data: +@Returns: + + diff --git a/docs/reference/glib/tmpl/shell.sgml b/docs/reference/glib/tmpl/shell.sgml index 3581d69..733416c 100644 --- a/docs/reference/glib/tmpl/shell.sgml +++ b/docs/reference/glib/tmpl/shell.sgml @@ -9,13 +9,11 @@ Shell-related Utilities - - diff --git a/docs/reference/glib/tmpl/string_chunks.sgml b/docs/reference/glib/tmpl/string_chunks.sgml index c8a3c2c..15863dc 100644 --- a/docs/reference/glib/tmpl/string_chunks.sgml +++ b/docs/reference/glib/tmpl/string_chunks.sgml @@ -9,13 +9,11 @@ String Chunks
    - - diff --git a/docs/reference/glib/tmpl/strings.sgml b/docs/reference/glib/tmpl/strings.sgml index cf435a6..3c0b1bc 100644 --- a/docs/reference/glib/tmpl/strings.sgml +++ b/docs/reference/glib/tmpl/strings.sgml @@ -6,10 +6,11 @@ text buffers which grow automatically as text is added -A #GString is similar to a standard C string, except that it grows -automatically as text is appended or inserted. Also, it stores the -length of the string, so can be used for binary data with embedded -nul bytes. +A #GString is an object that handles the memory management of a C string +for you. You can think of it as similar to a Java StringBuffer. +In addition to the string itself, GString stores the length of the string, +so can be used for binary data with embedded nul bytes. To access the C +string managed by the GString @string, simply use @string->str. diff --git a/docs/reference/glib/tmpl/testing.sgml b/docs/reference/glib/tmpl/testing.sgml index 477c88d..af7c3ca 100644 --- a/docs/reference/glib/tmpl/testing.sgml +++ b/docs/reference/glib/tmpl/testing.sgml @@ -150,13 +150,29 @@ Returns %TRUE if tests are run in quiet mode. @Returns: + + + + + +@void: + + @testpath: -@void: +@test_func: + + + + + + + +@user_data: @@ -166,7 +182,7 @@ Returns %TRUE if tests are run in quiet mode. @testpath: @test_data: -@gconstpointer: +@test_func: @@ -597,6 +613,15 @@ An opaque structure representing a test suite.
    + + + + + +@fixture: +@user_data: + + @@ -605,9 +630,9 @@ An opaque structure representing a test suite. @test_name: @data_size: @test_data: -@void: -@void: -@void: +@data_setup: +@data_test: +@data_teardown: @Returns: diff --git a/docs/reference/glib/tmpl/thread_pools.sgml b/docs/reference/glib/tmpl/thread_pools.sgml index acff92a..99087a8 100644 --- a/docs/reference/glib/tmpl/thread_pools.sgml +++ b/docs/reference/glib/tmpl/thread_pools.sgml @@ -9,13 +9,11 @@ Thread Pools - - diff --git a/docs/reference/glib/tmpl/threads.sgml b/docs/reference/glib/tmpl/threads.sgml index 25ee759..deb74fd 100644 --- a/docs/reference/glib/tmpl/threads.sgml +++ b/docs/reference/glib/tmpl/threads.sgml @@ -9,13 +9,11 @@ Threads
    - - diff --git a/docs/reference/glib/tmpl/timers.sgml b/docs/reference/glib/tmpl/timers.sgml index ec97218..ad742a9 100644 --- a/docs/reference/glib/tmpl/timers.sgml +++ b/docs/reference/glib/tmpl/timers.sgml @@ -9,13 +9,11 @@ Timers
    - - diff --git a/docs/reference/glib/tmpl/timezone.sgml b/docs/reference/glib/tmpl/timezone.sgml new file mode 100644 index 0000000..a53a994 --- /dev/null +++ b/docs/reference/glib/tmpl/timezone.sgml @@ -0,0 +1,133 @@ + +timezone + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@tz: + + + + + + + +@tz: +@Returns: + + + + + + + +@identifier: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@G_TIME_TYPE_STANDARD: +@G_TIME_TYPE_DAYLIGHT: +@G_TIME_TYPE_UNIVERSAL: + + + + + + +@tz: +@type: +@time: +@Returns: + + + + + + + +@tz: +@type: +@time: +@Returns: + + + + + + + +@tz: +@interval: +@Returns: + + + + + + + +@tz: +@interval: +@Returns: + + + + + + + +@tz: +@interval: +@Returns: + + diff --git a/docs/reference/glib/tmpl/trees-binary.sgml b/docs/reference/glib/tmpl/trees-binary.sgml index d89baa4..8764ba2 100644 --- a/docs/reference/glib/tmpl/trees-binary.sgml +++ b/docs/reference/glib/tmpl/trees-binary.sgml @@ -9,13 +9,11 @@ Balanced Binary Trees
    - - diff --git a/docs/reference/glib/tmpl/trees-nary.sgml b/docs/reference/glib/tmpl/trees-nary.sgml index bdab3c4..4dd82a2 100644 --- a/docs/reference/glib/tmpl/trees-nary.sgml +++ b/docs/reference/glib/tmpl/trees-nary.sgml @@ -9,13 +9,11 @@ N-ary Trees
    - - diff --git a/docs/reference/glib/tmpl/unicode.sgml b/docs/reference/glib/tmpl/unicode.sgml index 120723c..713ca6f 100644 --- a/docs/reference/glib/tmpl/unicode.sgml +++ b/docs/reference/glib/tmpl/unicode.sgml @@ -538,6 +538,21 @@ url="http://www.unicode.org/reports/tr24/">Unicode Standard Annex @G_UNICODE_SCRIPT_CARIAN: Carian. Since 2.16.3 @G_UNICODE_SCRIPT_LYCIAN: Lycian. Since 2.16.3 @G_UNICODE_SCRIPT_LYDIAN: Lydian. Since 2.16.3 +@G_UNICODE_SCRIPT_AVESTAN: Avestan. Since 2.26 +@G_UNICODE_SCRIPT_BAMUM: Bamum. Since 2.26 +@G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS: Egyptian Hieroglpyhs. Since 2.26 +@G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC: Imperial Aramaic. Since 2.26 +@G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI: Inscriptional Pahlavi. Since 2.26 +@G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN: Inscriptional Parthian. Since 2.26 +@G_UNICODE_SCRIPT_JAVANESE: Javanese. Since 2.26 +@G_UNICODE_SCRIPT_KAITHI: Kaithi. Since 2.26 +@G_UNICODE_SCRIPT_LISU: Lisu. Since 2.26 +@G_UNICODE_SCRIPT_MEETEI_MAYEK: Meetei Mayek. Since 2.26 +@G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN: Old South Arabian. Since 2.26 +@G_UNICODE_SCRIPT_OLD_TURKISH: Old Turkish. Since 2.26 +@G_UNICODE_SCRIPT_SAMARITAN: Samaritan. Since 2.26 +@G_UNICODE_SCRIPT_TAI_THAM: Tai Tham. Since 2.26 +@G_UNICODE_SCRIPT_TAI_VIET: Tai Viet. Since 2.26 diff --git a/docs/reference/glib/version.xml b/docs/reference/glib/version.xml index 5827d9b..474d182 100644 --- a/docs/reference/glib/version.xml +++ b/docs/reference/glib/version.xml @@ -1 +1 @@ -2.24.2 +2.27.5 diff --git a/docs/reference/gobject/Makefile.am b/docs/reference/gobject/Makefile.am index 0c88234..61de126 100644 --- a/docs/reference/gobject/Makefile.am +++ b/docs/reference/gobject/Makefile.am @@ -24,16 +24,15 @@ HFILE_GLOB=$(top_srcdir)/gobject/*.h CFILE_GLOB=$(top_srcdir)/gobject/*.c # Headers to ignore -IGNORE_HFILES=gobjectalias.h +IGNORE_HFILES = \ + gobject_trace.h \ + gatomicarray.h # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. INCLUDES = \ -I$(srcdir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_builddir) \ - -I$(top_builddir)/glib \ + $(gobject_INCLUDES) \ $(GLIB_DEBUG_FLAGS) GTKDOC_LIBS = \ $(top_builddir)/glib/libglib-2.0.la \ @@ -41,7 +40,7 @@ GTKDOC_LIBS = \ # Images to copy into HTML directory HTML_IMAGES = \ - $(srcdir)/images/glue.png + images/glue.png # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE) content_files = version.xml \ @@ -67,19 +66,36 @@ EXTRA_DIST += \ ######################################################################## -man_MANS = glib-mkenums.1 glib-genmarshal.1 gobject-query.1 +man_MANS = \ + glib-mkenums.1 \ + glib-genmarshal.1 \ + gobject-query.1 if ENABLE_MAN -%.1 : %.xml +.xml.1: @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< +dist-local-check-mans-enabled: + if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +else + +$(man_MANS): + echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. + echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +dist-local-check-mans-enabled: + echo "*** --enable-man must be used in order to make dist" + false + endif -BUILT_EXTRA_DIST = $(man_MANS) +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) + +EXTRA_DIST += $(man_MANS) + +dist-hook-local: dist-local-check-mans-enabled gobject-docs-clean all-local -dist-hook-local: $(BUILT_EXTRA_DIST) - files='$(BUILT_EXTRA_DIST)'; \ - for f in $$files; do \ - if test -f $$f; then d=.; else d=$(srcdir); fi; \ - cp $$d/$$f $(distdir) || exit 1; done +gobject-docs-clean: clean + cd $(srcdir) && rm -rf xml html diff --git a/docs/reference/gobject/Makefile.in b/docs/reference/gobject/Makefile.in index c190cd9..8880d43 100644 --- a/docs/reference/gobject/Makefile.in +++ b/docs/reference/gobject/Makefile.in @@ -51,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -93,6 +93,7 @@ NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -117,11 +118,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -135,13 +139,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -188,6 +195,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -195,6 +204,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -220,6 +230,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -236,6 +248,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -245,11 +258,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -265,11 +280,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -283,7 +304,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -312,7 +332,7 @@ GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package # Other files to distribute EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \ - gobject.cI version.xml.in + gobject.cI version.xml.in $(man_MANS) TEST_PROGS = AUTOMAKE_OPTIONS = 1.6 @@ -338,16 +358,16 @@ HFILE_GLOB = $(top_srcdir)/gobject/*.h CFILE_GLOB = $(top_srcdir)/gobject/*.c # Headers to ignore -IGNORE_HFILES = gobjectalias.h +IGNORE_HFILES = \ + gobject_trace.h \ + gatomicarray.h + # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. INCLUDES = \ -I$(srcdir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_builddir) \ - -I$(top_builddir)/glib \ + $(gobject_INCLUDES) \ $(GLIB_DEBUG_FLAGS) GTKDOC_LIBS = \ @@ -357,7 +377,7 @@ GTKDOC_LIBS = \ # Images to copy into HTML directory HTML_IMAGES = \ - $(srcdir)/images/glue.png + images/glue.png # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE) @@ -413,11 +433,16 @@ CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp ######################################################################## -man_MANS = glib-mkenums.1 glib-genmarshal.1 gobject-query.1 -BUILT_EXTRA_DIST = $(man_MANS) +man_MANS = \ + glib-mkenums.1 \ + glib-genmarshal.1 \ + gobject-query.1 + +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) all: all-am .SUFFIXES: +.SUFFIXES: .1 .xml $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.decl $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -581,6 +606,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am @@ -670,13 +696,16 @@ uninstall-man: uninstall-man1 ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -703,8 +732,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -713,9 +746,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: @@ -729,8 +782,11 @@ $(REPORT_FILES): sgml-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) - @cd $(srcdir) && \ - gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ @@ -763,8 +819,11 @@ $(srcdir)/tmpl/*.sgml: sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) - @cd $(srcdir) && \ - gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @@ -874,14 +933,24 @@ dist-hook: dist-check-gtkdoc dist-hook-local .PHONY : dist-hook-local docs -@ENABLE_MAN_TRUE@%.1 : %.xml +@ENABLE_MAN_TRUE@.xml.1: @ENABLE_MAN_TRUE@ @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< -dist-hook-local: $(BUILT_EXTRA_DIST) - files='$(BUILT_EXTRA_DIST)'; \ - for f in $$files; do \ - if test -f $$f; then d=.; else d=$(srcdir); fi; \ - cp $$d/$$f $(distdir) || exit 1; done +@ENABLE_MAN_TRUE@dist-local-check-mans-enabled: +@ENABLE_MAN_TRUE@ if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +@ENABLE_MAN_FALSE@$(man_MANS): +@ENABLE_MAN_FALSE@ echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. +@ENABLE_MAN_FALSE@ echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +@ENABLE_MAN_FALSE@dist-local-check-mans-enabled: +@ENABLE_MAN_FALSE@ echo "*** --enable-man must be used in order to make dist" +@ENABLE_MAN_FALSE@ false + +dist-hook-local: dist-local-check-mans-enabled gobject-docs-clean all-local + +gobject-docs-clean: clean + cd $(srcdir) && rm -rf xml html # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/docs/reference/gobject/glib-genmarshal.1 b/docs/reference/gobject/glib-genmarshal.1 index 3ea1dd8..9ff04f4 100644 --- a/docs/reference/gobject/glib-genmarshal.1 +++ b/docs/reference/gobject/glib-genmarshal.1 @@ -1,13 +1,22 @@ '\" t .\" Title: glib-genmarshal .\" Author: [see the "Author" section] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 05/02/2010 -.\" Manual: [FIXME: manual] -.\" Source: [FIXME: source] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands .\" Language: English .\" -.TH "GLIB\-GENMARSHAL" "1" "05/02/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "GLIB\-GENMARSHAL" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -46,7 +55,7 @@ Generate C code file contents of the marshallers\&. \fB\-\-prefix=string\fR, \fB\-\-prefix string\fR .RS 4 Specify marshaller prefix\&. The default prefix is -`g_cclosure_marshal\'\&. +`g_cclosure_marshal\*(Aq\&. .RE .PP \fB\-\-skip\-source\fR @@ -108,8 +117,8 @@ or a marshaller specification of the form .PP The \fIRTYPE\fR -part specifies the callback\'s return type and the -\fIPTYPE\fRs right to the colon specify the callback\'s parameter list, except for the first and the last arguments which are always pointers\&. +part specifies the callback\*(Aqs return type and the +\fIPTYPE\fRs right to the colon specify the callback\*(Aqs parameter list, except for the first and the last arguments which are always pointers\&. .SS "Parameter types" .PP Currently, the following types are supported: @@ -211,6 +220,11 @@ for anonymous pointer types (gpointer) for GObject or derived types (GObject*) .RE .PP +\fIVARIANT\fR +.RS 4 +for GVariant types (GVariant*) +.RE +.PP \fINONE\fR .RS 4 deprecated alias for diff --git a/docs/reference/gobject/glib-genmarshal.xml b/docs/reference/gobject/glib-genmarshal.xml index 3bce42b..5dfcb71 100644 --- a/docs/reference/gobject/glib-genmarshal.xml +++ b/docs/reference/gobject/glib-genmarshal.xml @@ -1,8 +1,9 @@ - + glib-genmarshal 1 +User Commands @@ -261,6 +262,13 @@ for GObject or derived types (GObject*) +VARIANT + +for GVariant types (GVariant*) + + + + NONE deprecated alias for VOID diff --git a/docs/reference/gobject/glib-mkenums.1 b/docs/reference/gobject/glib-mkenums.1 index d0463ab..d488d4f 100644 --- a/docs/reference/gobject/glib-mkenums.1 +++ b/docs/reference/gobject/glib-mkenums.1 @@ -1,13 +1,22 @@ '\" t .\" Title: glib-mkenums .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 05/02/2010 -.\" Manual: [FIXME: manual] -.\" Source: [FIXME: source] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands .\" Language: English .\" -.TH "GLIB\-MKENUMS" "1" "05/02/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "GLIB\-MKENUMS" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -172,6 +181,17 @@ The enum value name currently being processed with words uppercase and word\-sep A nick name for the enum value currently being processed, this is usually generated by stripping common prefix words of all the enum values of the current enum, the words are lowercase and underscores are substituted by a minus (e\&.g\&. the\-xvalue)\&. .RE .PP +@valuenum@ +.RS 4 +The integer value for the enum value currently being processed\&. This is calculated by using +\fBperl\fR +to attempt to evaluate the expression as it appears in the C source code\&. If evaluation fails then +\fBglib\-mkenums\fR +will exit with an error status, but this only happens if +@valuenum@ +appears in your value production template\&. (Since: 2\&.26) +.RE +.PP @type@ .RS 4 This is substituted either by "enum" or "flags", depending on whether the enum value definitions contained bit\-shift operators or not (e\&.g\&. flags)\&. @@ -231,4 +251,5 @@ typedef enum /*< flags,prefix=PREFIX >*/ .sp .SH "SEE ALSO" .PP -\fBglib\-genmarshal\fR(1) + +\fBglib-genmarshal\fR(1) diff --git a/docs/reference/gobject/glib-mkenums.xml b/docs/reference/gobject/glib-mkenums.xml index 1eeac9e..38e400d 100644 --- a/docs/reference/gobject/glib-mkenums.xml +++ b/docs/reference/gobject/glib-mkenums.xml @@ -1,8 +1,9 @@ - + glib-mkenums 1 +User Commands @@ -200,6 +201,18 @@ minus (e.g. the-xvalue). +@valuenum@ + +The integer value for the enum value currently being processed. This is +calculated by using perl to attempt to evaluate the +expression as it appears in the C source code. If evaluation fails then +glib-mkenums will exit with an error status, but this +only happens if @valuenum@ appears in your value +production template. (Since: 2.26) + + + + @type@ This is substituted either by "enum" or "flags", depending on whether the @@ -271,7 +284,11 @@ typedef enum /*< flags,prefix=PREFIX >*/ See also -glib-genmarshal(1) + + +glib-genmarshal +1 + diff --git a/docs/reference/gobject/gobject-docs.sgml b/docs/reference/gobject/gobject-docs.sgml index 61704ea..30498ad 100644 --- a/docs/reference/gobject/gobject-docs.sgml +++ b/docs/reference/gobject/gobject-docs.sgml @@ -83,6 +83,7 @@ + Tools Reference @@ -143,5 +144,15 @@ Index of new symbols in 2.24 - + + Index of new symbols in 2.26 + + + + Index of new symbols in 2.28 + + + + + diff --git a/docs/reference/gobject/gobject-query.1 b/docs/reference/gobject/gobject-query.1 index 02f4464..6c45805 100644 --- a/docs/reference/gobject/gobject-query.1 +++ b/docs/reference/gobject/gobject-query.1 @@ -1,13 +1,22 @@ '\" t .\" Title: gobject-query .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 08/08/2010 -.\" Manual: [FIXME: manual] -.\" Source: [FIXME: source] +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 12/20/2010 +.\" Manual: User Commands +.\" Source: User Commands .\" Language: English .\" -.TH "GOBJECT\-QUERY" "1" "08/08/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "GOBJECT\-QUERY" "1" "12/20/2010" "User Commands" "User Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -54,7 +63,7 @@ specify the root type .PP \fB\-n\fR .RS 4 -don\'t descend type tree +don\*(Aqt descend type tree .RE .PP \fB\-b\fR \fIstring\fR diff --git a/docs/reference/gobject/gobject-query.xml b/docs/reference/gobject/gobject-query.xml index af6fccc..5d9d8bc 100644 --- a/docs/reference/gobject/gobject-query.xml +++ b/docs/reference/gobject/gobject-query.xml @@ -1,8 +1,9 @@ - + gobject-query 1 +User Commands diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt index 44c6947..7eb75fd 100644 --- a/docs/reference/gobject/gobject-sections.txt +++ b/docs/reference/gobject/gobject-sections.txt @@ -30,6 +30,7 @@ G_TYPE_FROM_INTERFACE G_TYPE_INSTANCE_GET_CLASS G_TYPE_INSTANCE_GET_INTERFACE G_TYPE_INSTANCE_GET_PRIVATE +G_TYPE_CLASS_GET_PRIVATE G_TYPE_CHECK_INSTANCE G_TYPE_CHECK_INSTANCE_CAST G_TYPE_CHECK_INSTANCE_TYPE @@ -106,6 +107,10 @@ G_DEFINE_INTERFACE G_DEFINE_INTERFACE_WITH_CODE G_IMPLEMENT_INTERFACE G_DEFINE_TYPE_EXTENDED +G_DEFINE_BOXED_TYPE +G_DEFINE_BOXED_TYPE_WITH_CODE +G_DEFINE_POINTER_TYPE +G_DEFINE_POINTER_TYPE_WITH_CODE G_TYPE_FUNDAMENTAL_SHIFT @@ -146,6 +151,7 @@ G_TYPE_BOXED G_TYPE_PARAM G_TYPE_OBJECT G_TYPE_GTYPE +G_TYPE_VARIANT G_TYPE_RESERVED_GLIB_FIRST @@ -238,6 +244,7 @@ G_OBJECT_TYPE_NAME G_OBJECT_CLASS_TYPE G_OBJECT_CLASS_NAME g_object_class_install_property +g_object_class_install_properties g_object_class_find_property g_object_class_list_properties g_object_class_override_property @@ -250,6 +257,7 @@ GParameter g_object_ref g_object_unref g_object_ref_sink +g_clear_object GInitiallyUnowned GInitiallyUnownedClass G_TYPE_INITIALLY_UNOWNED @@ -268,6 +276,7 @@ g_object_disconnect g_object_set g_object_get g_object_notify +g_object_notify_by_pspec g_object_freeze_notify g_object_thaw_notify g_object_get_data @@ -349,8 +358,9 @@ G_TYPE_REGEX G_TYPE_ARRAY G_TYPE_BYTE_ARRAY G_TYPE_PTR_ARRAY -G_TYPE_VARIANT G_TYPE_VARIANT_TYPE +G_TYPE_ERROR +G_TYPE_DATE_TIME GStrv @@ -365,6 +375,8 @@ g_regex_get_type g_array_get_type g_byte_array_get_type g_ptr_array_get_type +g_error_get_type +g_date_time_get_type g_variant_get_gtype g_variant_type_get_gtype
    @@ -695,6 +707,18 @@ g_param_spec_gtype g_value_get_gtype g_value_set_gtype + +G_IS_PARAM_SPEC_VARIANT +G_PARAM_SPEC_VARIANT +G_VALUE_HOLDS_VARIANT +G_TYPE_PARAM_VARIANT +GParamSpecVariant +g_param_spec_variant +g_value_get_variant +g_value_dup_variant +g_value_set_variant +g_value_take_variant + g_value_set_instance g_param_spec_types @@ -767,6 +791,7 @@ g_signal_remove_emission_hook g_signal_parse_name g_signal_get_invocation_hint g_signal_type_cclosure_new +g_signal_accumulator_first_wins g_signal_accumulator_true_handled g_signal_handlers_destroy @@ -804,6 +829,7 @@ g_closure_set_marshal g_closure_add_marshal_guards g_closure_set_meta_marshal g_source_set_closure +g_source_set_dummy_callback G_TYPE_IO_CHANNEL G_TYPE_IO_CONDITION @@ -825,6 +851,7 @@ g_cclosure_marshal_VOID__PARAM g_cclosure_marshal_VOID__BOXED g_cclosure_marshal_VOID__POINTER g_cclosure_marshal_VOID__OBJECT +g_cclosure_marshal_VOID__VARIANT g_cclosure_marshal_STRING__OBJECT_POINTER g_cclosure_marshal_VOID__UINT_POINTER g_cclosure_marshal_BOOLEAN__FLAGS @@ -836,3 +863,27 @@ g_closure_get_type g_io_channel_get_type g_io_condition_get_type + +
    +gbinding +GBinding +GBindingFlags +g_binding_get_source +g_binding_get_source_property +g_binding_get_target +g_binding_get_target_property +g_binding_get_flags + +g_object_bind_property +GBindingTransformFunc +g_object_bind_property_full +g_object_bind_property_with_closures + +G_TYPE_BINDING +G_TYPE_BINDING_FLAGS +G_BINDING +G_IS_BINDING + +g_binding_flags_get_type +g_binding_get_type +
    diff --git a/docs/reference/gobject/gobject.types b/docs/reference/gobject/gobject.types index b8d745f..bb4e7b8 100644 --- a/docs/reference/gobject/gobject.types +++ b/docs/reference/gobject/gobject.types @@ -1,6 +1,7 @@ #include #include "gobject.cI" +g_binding_get_type g_object_get_type g_type_module_get_type g_type_plugin_get_type diff --git a/docs/reference/gobject/html/GBinding.html b/docs/reference/gobject/html/GBinding.html new file mode 100644 index 0000000..1bcbb72 --- /dev/null +++ b/docs/reference/gobject/html/GBinding.html @@ -0,0 +1,803 @@ + + + + +GBinding + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    GBinding

    +

    GBinding — Bind two object properties

    +
    +
    +

    Synopsis

    +
    +#include <glib-object.h>
    +
    +                    GBinding;
    +enum                GBindingFlags;
    +GObject *           g_binding_get_source                (GBinding *binding);
    +const gchar *       g_binding_get_source_property       (GBinding *binding);
    +GObject *           g_binding_get_target                (GBinding *binding);
    +const gchar *       g_binding_get_target_property       (GBinding *binding);
    +GBindingFlags       g_binding_get_flags                 (GBinding *binding);
    +
    +GBinding *          g_object_bind_property              (gpointer source,
    +                                                         const gchar *source_property,
    +                                                         gpointer target,
    +                                                         const gchar *target_property,
    +                                                         GBindingFlags flags);
    +gboolean            (*GBindingTransformFunc)            (GBinding *binding,
    +                                                         const GValue *source_value,
    +                                                         GValue *target_value,
    +                                                         gpointer user_data);
    +GBinding *          g_object_bind_property_full         (gpointer source,
    +                                                         const gchar *source_property,
    +                                                         gpointer target,
    +                                                         const gchar *target_property,
    +                                                         GBindingFlags flags,
    +                                                         GBindingTransformFunc transform_to,
    +                                                         GBindingTransformFunc transform_from,
    +                                                         gpointer user_data,
    +                                                         GDestroyNotify notify);
    +GBinding *          g_object_bind_property_with_closures
    +                                                        (gpointer source,
    +                                                         const gchar *source_property,
    +                                                         gpointer target,
    +                                                         const gchar *target_property,
    +                                                         GBindingFlags flags,
    +                                                         GClosure *transform_to,
    +                                                         GClosure *transform_from);
    +
    +
    +
    +

    Object Hierarchy

    +
    +  GObject
    +   +----GBinding
    +
    +
    +
    +

    Properties

    +
    +  "flags"                    GBindingFlags         : Read / Write / Construct Only
    +  "source"                   GObject*              : Read / Write / Construct Only
    +  "source-property"          gchar*                : Read / Write / Construct Only
    +  "target"                   GObject*              : Read / Write / Construct Only
    +  "target-property"          gchar*                : Read / Write / Construct Only
    +
    +
    +
    +

    Description

    +

    +GBinding is the representation of a binding between a property on a +GObject instance (or source) and another property on another GObject +instance (or target). Whenever the source property changes, the same +value is applied to the target property; for instance, the following +binding: +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    g_object_bind_property (object1, "property-a",
    +                        object2, "property-b",
    +                        G_BINDING_DEFAULT);
    +
    + +

    +

    +

    +will cause object2:property-b to be updated every +time g_object_set() or the specific accessor changes the value of +object1:property-a. +

    +

    +It is possible to create a bidirectional binding between two properties +of two GObject instances, so that if either property changes, the +other is updated as well, for instance: +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    g_object_bind_property (object1, "property-a",
    +                        object2, "property-b",
    +                        G_BINDING_BIDIRECTIONAL);
    +
    + +

    +

    +

    +will keep the two properties in sync. +

    +

    +It is also possible to set a custom transformation function (in both +directions, in case of a bidirectional binding) to apply a custom +transformation from the source value to the target value before +applying it; for instance, the following binding: +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    +4
    +5
    +6
    g_object_bind_property_full (adjustment1, "value",
    +                             adjustment2, "value",
    +                             G_BINDING_BIDIRECTIONAL,
    +                             celsius_to_fahrenheit,
    +                             fahrenheit_to_celsius,
    +                             NULL, NULL);
    +
    + +

    +

    +

    +will keep the value property of the two adjustments +in sync; the celsius_to_fahrenheit function will be +called whenever the adjustment1:value property changes +and will transform the current value of the property before applying it +to the adjustment2:value property; vice versa, the +fahrenheit_to_celsius function will be called whenever +the adjustment2:value property changes, and will +transform the current value of the property before applying it to the +adjustment1:value. +

    +

    +Note that GBinding does not resolve cycles by itself; a cycle like +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    object1:propertyA -> object2:propertyB
    +object2:propertyB -> object3:propertyC
    +object3:propertyC -> object1:propertyA
    +
    + +

    +

    +

    +might lead to an infinite loop. The loop, in this particular case, +can be avoided if the objects emit the "notify" signal only +if the value has effectively been changed. A binding is implemented +using the "notify" signal, so it is susceptible to all the +various ways of blocking a signal emission, like g_signal_stop_emission() +or g_signal_handler_block(). +

    +

    +A binding will be severed, and the resources it allocates freed, whenever +either one of the GObject instances it refers to are finalized, or when +the GBinding instance loses its last reference. +

    +

    +GBinding is available since GObject 2.26 +

    +
    +
    +

    Details

    +
    +

    GBinding

    +
    typedef struct _GBinding GBinding;
    +

    +GBinding is an opaque structure whose members +cannot be accessed directly. +

    +

    Since 2.26

    +
    +
    +
    +

    enum GBindingFlags

    +
    typedef enum { /*< prefix=G_BINDING >*/
    +  G_BINDING_DEFAULT        = 0,
    +
    +  G_BINDING_BIDIRECTIONAL  = 1 << 0,
    +  G_BINDING_SYNC_CREATE    = 1 << 1,
    +  G_BINDING_INVERT_BOOLEAN = 1 << 2
    +} GBindingFlags;
    +
    +

    +Flags to be passed to g_object_bind_property() or +g_object_bind_property_full(). +

    +

    +This enumeration can be extended at later date. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    G_BINDING_DEFAULT

    The default binding; if the source property + changes, the target property is updated with its value. +

    G_BINDING_BIDIRECTIONAL

    Bidirectional binding; if either the + property of the source or the property of the target changes, + the other is updated. +

    G_BINDING_SYNC_CREATE

    Synchronize the values of the source and + target properties when creating the binding; the direction of + the synchronization is always from the source to the target. +

    G_BINDING_INVERT_BOOLEAN

    If the two properties being bound are + booleans, setting one to TRUE will result in the other being + set to FALSE and vice versa. This flag will only work for + boolean properties, and cannot be used when passing custom + transformation functions to g_object_bind_property_full(). +
    +

    Since 2.26

    +
    +
    +
    +

    g_binding_get_source ()

    +
    GObject *           g_binding_get_source                (GBinding *binding);
    +

    +Retrieves the GObject instance used as the source of the binding +

    +
    ++ + + + + + + + + + +

    binding :

    a GBinding +

    Returns :

    the source GObject. [transfer none] +
    +

    Since 2.26

    +
    +
    +
    +

    g_binding_get_source_property ()

    +
    const gchar *       g_binding_get_source_property       (GBinding *binding);
    +

    +Retrieves the name of the property of "source" used as the source +of the binding +

    +
    ++ + + + + + + + + + +

    binding :

    a GBinding +

    Returns :

    the name of the source property + +
    +

    Since 2.26

    +
    +
    +
    +

    g_binding_get_target ()

    +
    GObject *           g_binding_get_target                (GBinding *binding);
    +

    +Retrieves the GObject instance used as the target of the binding +

    +
    ++ + + + + + + + + + +

    binding :

    a GBinding +

    Returns :

    the target GObject. [transfer none] +
    +

    Since 2.26

    +
    +
    +
    +

    g_binding_get_target_property ()

    +
    const gchar *       g_binding_get_target_property       (GBinding *binding);
    +

    +Retrieves the name of the property of "target" used as the target +of the binding +

    +
    ++ + + + + + + + + + +

    binding :

    a GBinding +

    Returns :

    the name of the target property + +
    +

    Since 2.26

    +
    +
    +
    +

    g_binding_get_flags ()

    +
    GBindingFlags       g_binding_get_flags                 (GBinding *binding);
    +

    +Retrieves the flags passed when constructing the GBinding +

    +
    ++ + + + + + + + + + +

    binding :

    a GBinding +

    Returns :

    the GBindingFlags used by the GBinding + +
    +

    Since 2.26

    +
    +
    +
    +

    g_object_bind_property ()

    +
    GBinding *          g_object_bind_property              (gpointer source,
    +                                                         const gchar *source_property,
    +                                                         gpointer target,
    +                                                         const gchar *target_property,
    +                                                         GBindingFlags flags);
    +

    +Creates a binding between source_property on source and target_property +on target. Whenever the source_property is changed the target_property is +updated using the same value. For instance: +

    +

    +

    +
    + + + + + + + +
    1
    g_object_bind_property (action, "active", widget, "sensitive", 0);
    +
    + +

    +

    +

    +Will result in the "sensitive" property of the widget GObject instance to be +updated with the same value of the "active" property of the action GObject +instance. +

    +

    +If flags contains G_BINDING_BIDIRECTIONAL then the binding will be mutual: +if target_property on target changes then the source_property on source +will be updated as well. +

    +

    +The binding will automatically be removed when either the source or the +target instances are finalized. To remove the binding without affecting the +source and the target you can just call g_object_unref() on the returned +GBinding instance. +

    +

    +A GObject can have multiple bindings. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + +

    source :

    the source GObject +

    source_property :

    the property on source to bind +

    target :

    the target GObject +

    target_property :

    the property on target to bind +

    flags :

    flags to pass to GBinding +

    Returns :

    the GBinding instance representing the + binding between the two GObject instances. The binding is released + whenever the GBinding reference count reaches zero. [transfer none] +
    +

    Since 2.26

    +
    +
    +
    +

    GBindingTransformFunc ()

    +
    gboolean            (*GBindingTransformFunc)            (GBinding *binding,
    +                                                         const GValue *source_value,
    +                                                         GValue *target_value,
    +                                                         gpointer user_data);
    +

    +A function to be called to transform the source property of source +from source_value into the target property of target +using target_value. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    binding :

    a GBinding +

    source_value :

    the value of the source property +

    target_value :

    the value of the target property +

    user_data :

    data passed to the transform function +

    Returns :

    TRUE if the transformation was successful, and FALSE + otherwise + +
    +

    Since 2.26

    +
    +
    +
    +

    g_object_bind_property_full ()

    +
    GBinding *          g_object_bind_property_full         (gpointer source,
    +                                                         const gchar *source_property,
    +                                                         gpointer target,
    +                                                         const gchar *target_property,
    +                                                         GBindingFlags flags,
    +                                                         GBindingTransformFunc transform_to,
    +                                                         GBindingTransformFunc transform_from,
    +                                                         gpointer user_data,
    +                                                         GDestroyNotify notify);
    +

    +Complete version of g_object_bind_property(). +

    +

    +Creates a binding between source_property on source and target_property +on target, allowing you to set the transformation functions to be used by +the binding. +

    +

    +If flags contains G_BINDING_BIDIRECTIONAL then the binding will be mutual: +if target_property on target changes then the source_property on source +will be updated as well. The transform_from function is only used in case +of bidirectional bindings, otherwise it will be ignored +

    +

    +The binding will automatically be removed when either the source or the +target instances are finalized. To remove the binding without affecting the +source and the target you can just call g_object_unref() on the returned +GBinding instance. +

    +

    +A GObject can have multiple bindings. +

    +

    +

    +
    +

    Note

    The same user_data parameter will be used for both transform_to +and transform_from transformation functions; the notify function will +be called once, when the binding is removed. If you need different data +for each transformation function, please use +g_object_bind_property_with_closures() instead.
    +

    +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    source :

    the source GObject +

    source_property :

    the property on source to bind +

    target :

    the target GObject +

    target_property :

    the property on target to bind +

    flags :

    flags to pass to GBinding +

    transform_to :

    the transformation function + from the source to the target, or NULL to use the default. [scope notified][allow-none] +

    transform_from :

    the transformation function + from the target to the source, or NULL to use the default. [scope notified][allow-none] +

    user_data :

    custom data to be passed to the transformation functions, + or NULL +

    notify :

    function to be called when disposing the binding, to free the + resources used by the transformation functions +

    Returns :

    the GBinding instance representing the + binding between the two GObject instances. The binding is released + whenever the GBinding reference count reaches zero. [transfer none] +
    +

    Since 2.26

    +
    +
    +
    +

    g_object_bind_property_with_closures ()

    +
    GBinding *          g_object_bind_property_with_closures
    +                                                        (gpointer source,
    +                                                         const gchar *source_property,
    +                                                         gpointer target,
    +                                                         const gchar *target_property,
    +                                                         GBindingFlags flags,
    +                                                         GClosure *transform_to,
    +                                                         GClosure *transform_from);
    +

    +Creates a binding between source_property on source and target_property +on target, allowing you to set the transformation functions to be used by +the binding. +

    +

    +This function is the language bindings friendly version of +g_object_bind_property_full(), using GClosures instead of +function pointers. +

    +

    +Rename to: g_object_bind_property_full +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    source :

    the source GObject +

    source_property :

    the property on source to bind +

    target :

    the target GObject +

    target_property :

    the property on target to bind +

    flags :

    flags to pass to GBinding +

    transform_to :

    a GClosure wrapping the transformation function + from the source to the target, or NULL to use the default +

    transform_from :

    a GClosure wrapping the transformation function + from the target to the source, or NULL to use the default +

    Returns :

    the GBinding instance representing the + binding between the two GObject instances. The binding is released + whenever the GBinding reference count reaches zero. [transfer none] +
    +

    Since 2.26

    +
    +
    +
    +

    Property Details

    +
    +

    The "flags" property

    +
      "flags"                    GBindingFlags         : Read / Write / Construct Only
    +

    +Flags to be used to control the GBinding +

    +

    Since 2.26

    +
    +
    +
    +

    The "source" property

    +
      "source"                   GObject*              : Read / Write / Construct Only
    +

    +The GObject that should be used as the source of the binding +

    +

    Since 2.26

    +
    +
    +
    +

    The "source-property" property

    +
      "source-property"          gchar*                : Read / Write / Construct Only
    +

    +The name of the property of "source" that should be used +as the source of the binding +

    +

    Default value: NULL

    +

    Since 2.26

    +
    +
    +
    +

    The "target" property

    +
      "target"                   GObject*              : Read / Write / Construct Only
    +

    +The GObject that should be used as the target of the binding +

    +

    Since 2.26

    +
    +
    +
    +

    The "target-property" property

    +
      "target-property"          gchar*                : Read / Write / Construct Only
    +

    +The name of the property of "target" that should be used +as the target of the binding +

    +

    Default value: NULL

    +

    Since 2.26

    +
    +
    +
    + + + \ No newline at end of file diff --git a/docs/reference/gobject/html/GTypeModule.html b/docs/reference/gobject/html/GTypeModule.html index 2d3c3e1..17464de 100644 --- a/docs/reference/gobject/html/GTypeModule.html +++ b/docs/reference/gobject/html/GTypeModule.html @@ -3,12 +3,12 @@ GTypeModule - + - + @@ -705,6 +705,6 @@ names from that macro. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/GTypePlugin.html b/docs/reference/gobject/html/GTypePlugin.html index 47bcd0b..d57b900 100644 --- a/docs/reference/gobject/html/GTypePlugin.html +++ b/docs/reference/gobject/html/GTypePlugin.html @@ -3,12 +3,12 @@ GTypePlugin - + - + @@ -448,6 +448,6 @@ function outside of the GObject type system itself. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/annotation-glossary.html b/docs/reference/gobject/html/annotation-glossary.html new file mode 100644 index 0000000..0f589da --- /dev/null +++ b/docs/reference/gobject/html/annotation-glossary.html @@ -0,0 +1,62 @@ + + + + +Annotation Glossary + + + + + + + + + + + + + + + + + + +
    +

    +Annotation Glossary

    +

    A

    +
    +array
    +

    Parameter points to an array of items.

    +
    +allow-none
    +

    NULL is ok, both for passing and for returning.

    +

    I

    +
    +inout
    +

    Parameter for input and for returning results. Default is transfer full.

    +

    S

    +
    +scope call
    +

    The callback is valid only during the call to the method.

    +

    T

    +
    +transfer full
    +

    Free data after the code is done.

    +
    +transfer none
    +

    Don't free data after the code is done.

    +
    + + + \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-10.html b/docs/reference/gobject/html/api-index-2-10.html index 67f5333..4c98843 100644 --- a/docs/reference/gobject/html/api-index-2-10.html +++ b/docs/reference/gobject/html/api-index-2-10.html @@ -3,12 +3,12 @@ Index of new symbols in 2.10 - + - + @@ -80,6 +80,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-12.html b/docs/reference/gobject/html/api-index-2-12.html index 11b8240..18c4c3a 100644 --- a/docs/reference/gobject/html/api-index-2-12.html +++ b/docs/reference/gobject/html/api-index-2-12.html @@ -3,12 +3,12 @@ Index of new symbols in 2.12 - + - + @@ -50,6 +50,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-14.html b/docs/reference/gobject/html/api-index-2-14.html index d80a6fe..6c3e021 100644 --- a/docs/reference/gobject/html/api-index-2-14.html +++ b/docs/reference/gobject/html/api-index-2-14.html @@ -3,12 +3,12 @@ Index of new symbols in 2.14 - + - + @@ -46,6 +46,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-18.html b/docs/reference/gobject/html/api-index-2-18.html index 4ea0819..50b16cf 100644 --- a/docs/reference/gobject/html/api-index-2-18.html +++ b/docs/reference/gobject/html/api-index-2-18.html @@ -3,12 +3,12 @@ Index of new symbols in 2.18 - + - + @@ -41,6 +41,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-2.html b/docs/reference/gobject/html/api-index-2-2.html index d8d73ce..7c00f78 100644 --- a/docs/reference/gobject/html/api-index-2-2.html +++ b/docs/reference/gobject/html/api-index-2-2.html @@ -3,12 +3,12 @@ Index of new symbols in 2.2 - + - + @@ -33,6 +33,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-22.html b/docs/reference/gobject/html/api-index-2-22.html index 5e312c0..a6cb6c5 100644 --- a/docs/reference/gobject/html/api-index-2-22.html +++ b/docs/reference/gobject/html/api-index-2-22.html @@ -3,12 +3,12 @@ Index of new symbols in 2.22 - + - + @@ -41,6 +41,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-24.html b/docs/reference/gobject/html/api-index-2-24.html index 57e6698..8ca89cb 100644 --- a/docs/reference/gobject/html/api-index-2-24.html +++ b/docs/reference/gobject/html/api-index-2-24.html @@ -3,11 +3,12 @@ Index of new symbols in 2.24 - + - + + @@ -17,7 +18,7 @@   Home GObject Reference Manual -  +Next D @@ -52,7 +53,7 @@
    -G_TYPE_VARIANT, macro in Boxed Types +G_TYPE_CLASS_GET_PRIVATE, macro in Type Information
    @@ -67,6 +68,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-26.html b/docs/reference/gobject/html/api-index-2-26.html new file mode 100644 index 0000000..59a0370 --- /dev/null +++ b/docs/reference/gobject/html/api-index-2-26.html @@ -0,0 +1,201 @@ + + + + +Index of new symbols in 2.26 + + + + + + + + + + + + + + + + + + + +
    +

    +Index of new symbols in 2.26

    +

    B

    +
    +GBinding, struct in GBinding +
    +
    +
    +GBinding:flags, object property in GBinding +
    +
    +
    +GBinding:source, object property in GBinding +
    +
    +
    +GBinding:source-property, object property in GBinding +
    +
    +
    +GBinding:target, object property in GBinding +
    +
    +
    +GBinding:target-property, object property in GBinding +
    +
    +
    +GBindingFlags, enum in GBinding +
    +
    +
    +GBindingTransformFunc, user_function in GBinding +
    +
    +
    +g_binding_get_flags, function in GBinding +
    +
    +
    +g_binding_get_source, function in GBinding +
    +
    +
    +g_binding_get_source_property, function in GBinding +
    +
    +
    +g_binding_get_target, function in GBinding +
    +
    +
    +g_binding_get_target_property, function in GBinding +
    +
    +

    C

    +
    +g_cclosure_marshal_VOID__VARIANT, function in Closures +
    +
    +

    D

    +
    +G_DEFINE_BOXED_TYPE, macro in Type Information +
    +
    +
    +G_DEFINE_BOXED_TYPE_WITH_CODE, macro in Type Information +
    +
    +
    +G_DEFINE_POINTER_TYPE, macro in Type Information +
    +
    +
    +G_DEFINE_POINTER_TYPE_WITH_CODE, macro in Type Information +
    +
    +

    I

    +
    +G_IS_PARAM_SPEC_VARIANT, macro in Standard Parameter and Value Types +
    +
    +

    O

    +
    +g_object_bind_property, function in GBinding +
    +
    +
    +g_object_bind_property_full, function in GBinding +
    +
    +
    +g_object_bind_property_with_closures, function in GBinding +
    +
    +
    +g_object_class_install_properties, function in The Base Object Type +
    +
    +
    +g_object_notify_by_pspec, function in The Base Object Type +
    +
    +

    P

    +
    +GParamSpecVariant, struct in Standard Parameter and Value Types +
    +
    +
    +g_param_spec_variant, function in Standard Parameter and Value Types +
    +
    +
    +G_PARAM_SPEC_VARIANT, macro in Standard Parameter and Value Types +
    +
    +

    T

    +
    +G_TYPE_DATE_TIME, macro in Boxed Types +
    +
    +
    +G_TYPE_ERROR, macro in Boxed Types +
    +
    +
    +G_TYPE_PARAM_VARIANT, macro in Standard Parameter and Value Types +
    +
    +
    +G_TYPE_VARIANT, macro in Type Information +
    +
    +

    V

    +
    +g_value_dup_variant, function in Standard Parameter and Value Types +
    +
    +
    +g_value_get_variant, function in Standard Parameter and Value Types +
    +
    +
    +G_VALUE_HOLDS_VARIANT, macro in Standard Parameter and Value Types +
    +
    +
    +g_value_set_variant, function in Standard Parameter and Value Types +
    +
    +
    +g_value_take_variant, function in Standard Parameter and Value Types +
    +
    + + + + \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-28.html b/docs/reference/gobject/html/api-index-2-28.html new file mode 100644 index 0000000..69870cc --- /dev/null +++ b/docs/reference/gobject/html/api-index-2-28.html @@ -0,0 +1,47 @@ + + + + +Index of new symbols in 2.28 + + + + + + + + + + + + + + + + + + + +
    +

    +Index of new symbols in 2.28

    +

    C

    +
    +g_clear_object, function in The Base Object Type +
    +
    +

    S

    +
    +g_signal_accumulator_first_wins, function in Signals +
    +
    +
    + + + \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-4.html b/docs/reference/gobject/html/api-index-2-4.html index b4f0b0c..9c90ffe 100644 --- a/docs/reference/gobject/html/api-index-2-4.html +++ b/docs/reference/gobject/html/api-index-2-4.html @@ -3,12 +3,12 @@ Index of new symbols in 2.4 - + - + @@ -173,6 +173,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-6.html b/docs/reference/gobject/html/api-index-2-6.html index 3d147a0..499400f 100644 --- a/docs/reference/gobject/html/api-index-2-6.html +++ b/docs/reference/gobject/html/api-index-2-6.html @@ -3,12 +3,12 @@ Index of new symbols in 2.6 - + - + @@ -37,6 +37,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-2-8.html b/docs/reference/gobject/html/api-index-2-8.html index 3b36dc1..7ca09f5 100644 --- a/docs/reference/gobject/html/api-index-2-8.html +++ b/docs/reference/gobject/html/api-index-2-8.html @@ -3,12 +3,12 @@ Index of new symbols in 2.8 - + - + @@ -37,6 +37,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-deprecated.html b/docs/reference/gobject/html/api-index-deprecated.html index c333884..7699148 100644 --- a/docs/reference/gobject/html/api-index-deprecated.html +++ b/docs/reference/gobject/html/api-index-deprecated.html @@ -3,12 +3,12 @@ Index of deprecated symbols - + - + @@ -45,6 +45,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/api-index-full.html b/docs/reference/gobject/html/api-index-full.html index eb8dbb2..fc48c1d 100644 --- a/docs/reference/gobject/html/api-index-full.html +++ b/docs/reference/gobject/html/api-index-full.html @@ -3,12 +3,12 @@ Index - + - + @@ -59,6 +59,58 @@
    +GBinding, struct in GBinding +
    +
    +
    +GBinding:flags, object property in GBinding +
    +
    +
    +GBinding:source, object property in GBinding +
    +
    +
    +GBinding:source-property, object property in GBinding +
    +
    +
    +GBinding:target, object property in GBinding +
    +
    +
    +GBinding:target-property, object property in GBinding +
    +
    +
    +GBindingFlags, enum in GBinding +
    +
    +
    +GBindingTransformFunc, user_function in GBinding +
    +
    +
    +g_binding_get_flags, function in GBinding +
    +
    +
    +g_binding_get_source, function in GBinding +
    +
    +
    +g_binding_get_source_property, function in GBinding +
    +
    +
    +g_binding_get_target, function in GBinding +
    +
    +
    +g_binding_get_target_property, function in GBinding +
    +
    +
    GBoxedCopyFunc, user_function in Boxed Types
    @@ -172,6 +224,10 @@
    +g_cclosure_marshal_VOID__VARIANT, function in Closures +
    +
    +
    g_cclosure_marshal_VOID__VOID, function in Closures
    @@ -208,6 +264,10 @@
    +g_clear_object, function in The Base Object Type +
    +
    +
    GClosure, struct in Closures
    @@ -297,6 +357,14 @@
    +G_DEFINE_BOXED_TYPE, macro in Type Information +
    +
    +
    +G_DEFINE_BOXED_TYPE_WITH_CODE, macro in Type Information +
    +
    +
    G_DEFINE_DYNAMIC_TYPE, macro in GTypeModule
    @@ -313,6 +381,14 @@
    +G_DEFINE_POINTER_TYPE, macro in Type Information +
    +
    +
    +G_DEFINE_POINTER_TYPE_WITH_CODE, macro in Type Information +
    +
    +
    G_DEFINE_TYPE, macro in Type Information
    @@ -552,6 +628,10 @@
    +G_IS_PARAM_SPEC_VARIANT, macro in Standard Parameter and Value Types +
    +
    +
    G_IS_VALUE, macro in Generic values
    @@ -597,6 +677,18 @@
    +g_object_bind_property, function in GBinding +
    +
    +
    +g_object_bind_property_full, function in GBinding +
    +
    +
    +g_object_bind_property_with_closures, function in GBinding +
    +
    +
    G_OBJECT_CLASS, macro in The Base Object Type
    @@ -605,6 +697,10 @@
    +g_object_class_install_properties, function in The Base Object Type +
    +
    +
    g_object_class_install_property, function in The Base Object Type
    @@ -697,6 +793,10 @@
    +g_object_notify_by_pspec, function in The Base Object Type +
    +
    +
    g_object_ref, function in The Base Object Type
    @@ -898,6 +998,10 @@
    +GParamSpecVariant, struct in Standard Parameter and Value Types +
    +
    +
    G_PARAM_MASK, macro in GParamSpec
    @@ -1182,6 +1286,14 @@
    +g_param_spec_variant, function in Standard Parameter and Value Types +
    +
    +
    +G_PARAM_SPEC_VARIANT, macro in Standard Parameter and Value Types +
    +
    +
    G_PARAM_STATIC_STRINGS, macro in GParamSpec
    @@ -1247,6 +1359,10 @@
    +g_signal_accumulator_first_wins, function in Signals +
    +
    +
    g_signal_accumulator_true_handled, function in Signals
    @@ -1435,6 +1551,10 @@
    +g_source_set_dummy_callback, function in Closures +
    +
    +
    g_strdup_value_contents, function in Generic values
    @@ -1612,6 +1732,10 @@
    +G_TYPE_CLASS_GET_PRIVATE, macro in Type Information +
    +
    +
    g_type_class_peek, function in Type Information
    @@ -1648,6 +1772,10 @@
    +G_TYPE_DATE_TIME, macro in Boxed Types +
    +
    +
    g_type_default_interface_peek, function in Type Information
    @@ -1672,6 +1800,10 @@
    +G_TYPE_ERROR, macro in Boxed Types +
    +
    +
    G_TYPE_FLAGS, macro in Type Information
    @@ -2024,6 +2156,10 @@
    +G_TYPE_PARAM_VARIANT, macro in Standard Parameter and Value Types +
    +
    +
    g_type_parent, function in Type Information
    @@ -2148,7 +2284,7 @@
    -G_TYPE_VARIANT, macro in Boxed Types +G_TYPE_VARIANT, macro in Type Information
    @@ -2241,6 +2377,10 @@
    +g_value_dup_variant, function in Standard Parameter and Value Types +
    +
    +
    g_value_fits_pointer, function in Generic values
    @@ -2321,6 +2461,10 @@
    +g_value_get_variant, function in Standard Parameter and Value Types +
    +
    +
    G_VALUE_HOLDS, macro in Generic values
    @@ -2401,6 +2545,10 @@
    +G_VALUE_HOLDS_VARIANT, macro in Standard Parameter and Value Types +
    +
    +
    g_value_init, function in Generic values
    @@ -2525,6 +2673,10 @@
    +g_value_set_variant, function in Standard Parameter and Value Types +
    +
    +
    g_value_take_boxed, function in Standard Parameter and Value Types
    @@ -2541,6 +2693,10 @@
    +g_value_take_variant, function in Standard Parameter and Value Types +
    +
    +
    g_value_transform, function in Generic values
    @@ -2572,6 +2728,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/ch01s02.html b/docs/reference/gobject/html/ch01s02.html index da7a52e..dcba854 100644 --- a/docs/reference/gobject/html/ch01s02.html +++ b/docs/reference/gobject/html/ch01s02.html @@ -3,12 +3,12 @@ Exporting a C API - + - + @@ -21,7 +21,7 @@

    -Exporting a C API

    +Exporting a C API

    C APIs are defined by a set of functions and global variables which are usually exported from a binary. C functions have an arbitrary number of arguments and one return value. Each function is thus @@ -91,7 +91,7 @@ call 0x80482f4 <function_foo> reads the original function signature.

  • The solution used by GLib is to use the GType library which holds at runtime a description of all the objects manipulated by the programmer. This so-called dynamic type - [1] + [1] library is then used by special generic glue code to automatically convert function parameters and function calling conventions between different runtime domains.

  • @@ -100,7 +100,7 @@ call 0x80482f4 <function_foo> boundaries is written once: the figure below states this more clearly.

    -

    Figure 1. 

    +

    Figure 1. 


    @@ -118,7 +118,7 @@ call 0x80482f4 <function_foo>



    -

    [1] +

    [1] There are numerous different implementations of dynamic type systems: all C++ compilers have one, Java and .NET have one too. A dynamic type system allows you to get information about every instantiated object at runtime. It can be implemented @@ -131,6 +131,6 @@ call 0x80482f4 <function_foo>

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/ch06s03.html b/docs/reference/gobject/html/ch06s03.html index 38f213c..cade44d 100644 --- a/docs/reference/gobject/html/ch06s03.html +++ b/docs/reference/gobject/html/ch06s03.html @@ -3,12 +3,12 @@ Interface definition prerequisites - + - + @@ -21,7 +21,7 @@

    -Interface definition prerequisites

    +Interface definition prerequisites

    To specify that an interface requires the presence of other interfaces when implemented, GObject introduces the concept of @@ -108,6 +108,6 @@ G_DEFINE_TYPE_WITH_CODE (MamanBar, maman_bar, G_TYPE_OBJECT,

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/chapter-gobject.html b/docs/reference/gobject/html/chapter-gobject.html index da30c9f..fbc35ac 100644 --- a/docs/reference/gobject/html/chapter-gobject.html +++ b/docs/reference/gobject/html/chapter-gobject.html @@ -3,12 +3,12 @@ The GObject base class - + - + @@ -36,10 +36,10 @@

    The two previous chapters discussed the details of GLib's Dynamic Type System and its signal control system. The GObject library also contains an implementation - for a base fundamental type named GObject. + for a base fundamental type named GObject.

    - GObject is a fundamental classed instantiable type. It implements: + GObject is a fundamental classed instantiable type. It implements:

    • Memory management with reference counting

    • @@ -49,7 +49,7 @@

    All the GNOME libraries which use the GLib type system (like GTK+ and GStreamer) - inherit from GObject which is why it is important to understand + inherit from GObject which is why it is important to understand the details of how it works.

    @@ -128,10 +128,7 @@ maman_bar_constructor (GType gtype, { /* Always chain up to the parent constructor */ - MamanBarClass *klass; - GObjectClass *parent_class; - parent_class = G_OBJECT_CLASS (maman_bar_parent_class); - obj = parent_class->constructor (gtype, n_properties, properties); + obj = G_OBJECT_CLASS (maman_bar_parent_class)->constructor (gtype, n_properties, properties); } /* update the object state depending on constructor properties */ @@ -288,6 +285,6 @@ MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL);
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/chapter-gtype.html b/docs/reference/gobject/html/chapter-gtype.html index 92efae2..6c5bd5d 100644 --- a/docs/reference/gobject/html/chapter-gtype.html +++ b/docs/reference/gobject/html/chapter-gtype.html @@ -3,12 +3,12 @@ The GLib Dynamic Type System - + - + @@ -79,12 +79,12 @@ GType g_type_register_fundamental (GType type_id, g_type_register_fundamental are the C functions, defined in gtype.h and implemented in gtype.c - which you should use to register a new GType in the program's type system. + which you should use to register a new GType in the program's type system. It is not likely you will ever need to use g_type_register_fundamental (you have to be Tim Janik to do that) but in case you want to, the last chapter explains how to create new fundamental types. - [2] + [2]

    Fundamental types are top-level types which do not derive from any other type @@ -99,35 +99,35 @@ GType g_type_register_fundamental (GType type_id,

    • - class size: the class_size field in GTypeInfo. + class size: the class_size field in GTypeInfo.

    • class initialization functions (C++ constructor): the base_init and - class_init fields in GTypeInfo. + class_init fields in GTypeInfo.

    • class destruction functions (C++ destructor): the base_finalize and - class_finalize fields in GTypeInfo. + class_finalize fields in GTypeInfo.

    • instance size (C++ parameter to new): the instance_size field in - GTypeInfo. + GTypeInfo.

    • instantiation policy (C++ type of new operator): the n_preallocs - field in GTypeInfo. + field in GTypeInfo.

    • copy functions (C++ copy operators): the value_table field in - GTypeInfo. + GTypeInfo.

    • - type characteristic flags: GTypeFlags. + type characteristic flags: GTypeFlags.

    - Fundamental types are also defined by a set of GTypeFundamentalFlags - which are stored in a GTypeFundamentalInfo. + Fundamental types are also defined by a set of GTypeFundamentalFlags + which are stored in a GTypeFundamentalInfo. Non-fundamental types are furthermore defined by the type of their parent which is passed as the parent_type parameter to g_type_register_static and g_type_register_dynamic. @@ -141,16 +141,16 @@ GType g_type_register_fundamental (GType type_id, they can all be manipulated through a single API to copy/assign them.

    - The GValue structure is used as an abstract container for all of these + The GValue structure is used as an abstract container for all of these types. Its simplistic API (defined in gobject/gvalue.h) can be used to invoke the value_table functions registered during type registration: for example g_value_copy copies the - content of a GValue to another GValue. This is similar + content of a GValue to another GValue. This is similar to a C++ assignment which invokes the C++ copy operator to modify the default bit-by-bit copy semantics of C++/C structures/classes.

    - The following code shows how you can copy around a 64 bit integer, as well as a GObject + The following code shows how you can copy around a 64 bit integer, as well as a GObject instance pointer (sample code for this is located in the source tarball for this document in sample/gtype/test.c):

    @@ -248,7 +248,7 @@ struct _GTypeValueTable


    -

    [2] +

    [2] Please note that there exists another registration function: the g_type_register_dynamic. We will not discuss this function here since its use is very similar to the _static @@ -258,6 +258,6 @@ struct _GTypeValueTable

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/chapter-intro.html b/docs/reference/gobject/html/chapter-intro.html index e28671a..1a549d7 100644 --- a/docs/reference/gobject/html/chapter-intro.html +++ b/docs/reference/gobject/html/chapter-intro.html @@ -3,12 +3,12 @@ Background - + - + @@ -23,7 +23,7 @@

    Background

    @@ -52,7 +52,7 @@

    -Data types and programming

    +Data types and programming

    One could say (I have seen such definitions used in some textbooks on programming language theory) that a programming language is merely a way to create data types and manipulate them. Most languages @@ -87,6 +87,6 @@ print "this is an integer converted to a string:" . $tmp . "\n";

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/chapter-signal.html b/docs/reference/gobject/html/chapter-signal.html index b809853..9b137b1 100644 --- a/docs/reference/gobject/html/chapter-signal.html +++ b/docs/reference/gobject/html/chapter-signal.html @@ -3,12 +3,12 @@ The GObject messaging system - + - + @@ -25,8 +25,8 @@
    Closures
    -
    C Closures
    -
    Non-C closures (for the fearless)
    +
    C Closures
    +
    Non-C closures (for the fearless)
    Signals
    @@ -67,15 +67,15 @@ return_type function_callback (... , gpointer user_data);

    - The GClosure structure represents the common functionality of all + The GClosure structure represents the common functionality of all closure implementations: there exists a different Closure implementation for each separate runtime which wants to use the GObject type system. - [6] - The GObject library provides a simple GCClosure type which + [6] + The GObject library provides a simple GCClosure type which is a specific implementation of closures to be used with C/C++ callbacks.

    - A GClosure provides simple services: + A GClosure provides simple services:

    -C Closures

    +C Closures

    If you are using C or C++ - to connect a callback to a given event, you will either use simple GCClosures + to connect a callback to a given event, you will either use simple GCClosures which have a pretty minimal API or the even simpler g_signal_connect functions (which will be presented a bit later :).

    @@ -134,7 +134,7 @@ GClosure *g_signal_type_cclosure_new (GType itype,

    -Non-C closures (for the fearless)

    +Non-C closures (for the fearless)

    As was explained above, closures hide the details of callback invocation. In C, callback invocation is just like function invocation: it is a matter of creating @@ -193,7 +193,7 @@ g_cclosure_marshal_VOID__INT (GClosure *closure,



    -

    [6] +

    [6] In practice, closures sit at the boundary of language runtimes: if you are writing Python code and one of your Python callbacks receives a signal from a GTK+ widget, the C code in GTK+ needs to execute your Python @@ -201,7 +201,7 @@ g_cclosure_marshal_VOID__INT (GClosure *closure, it behaves as a normal C object for GTK+ and as a normal Python object for Python code.

    -

    [7] +

    [7] Closures are reference counted and notify listeners of their destruction in a two-stage process: the invalidation notifiers are invoked before the finalization notifiers.

    @@ -209,6 +209,6 @@ g_cclosure_marshal_VOID__INT (GClosure *closure,
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/glib-genmarshal.html b/docs/reference/gobject/html/glib-genmarshal.html index c3129be..a062bc0 100644 --- a/docs/reference/gobject/html/glib-genmarshal.html +++ b/docs/reference/gobject/html/glib-genmarshal.html @@ -3,12 +3,12 @@ glib-genmarshal - + - + @@ -19,7 +19,7 @@ GObject Reference Manual Next -
    +
    - @@ -558,11 +558,6 @@ This is an internal function introduced mainly for C marshallers.

    g_value_peek_pointer ()

    gpointer            g_value_peek_pointer                (const GValue *value);
    -

    -Return the value contents as pointer. This function asserts that -g_value_fits_pointer() returned TRUE for the passed in value. -This is an internal function introduced mainly for C marshallers. -

    @@ -33,7 +33,7 @@

    glib-genmarshal [options...] [files...]

    -

    Description

    +

    Description

    glib-genmarshal is a small utility that generates C code marshallers for callback functions of the GClosure mechanism in the GObject sublibrary of GLib. The marshaller functions have a standard signature, @@ -45,13 +45,13 @@ collect its return value.

    -

    Invocation

    +

    Invocation

    glib-genmarshal takes a list of marshallers to generate as input. The marshaller list is either read from standard input or from files passed as additional arguments on the command line.

    -

    Options

    +

    Options

    @@ -109,7 +109,7 @@ Print version and exit.
    -

    Marshaller list format

    +

    Marshaller list format

    The marshaller lists are processed line by line, a line can contain a comment in the form of @@ -137,7 +137,7 @@ which are always pointers.


    -

    Parameter types

    +

    Parameter types

    Currently, the following types are supported:

    @@ -261,6 +261,12 @@ for GObject or derived types (GObject*)

    + + + +

    VARIANT

    +for GVariant types (GVariant*) +

    NONE

    deprecated alias for VOID @@ -279,7 +285,7 @@ deprecated alias for BOOLEAN

    -

    Example

    +

    Example

    To generate marshallers for the following callback functions:

    @@ -327,19 +333,19 @@ g_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR);
    -

    See also

    +

    See also

    glib-mkenums(1)

    -

    Bugs

    +

    Bugs

    None known yet.

    -

    Author

    +

    Author

    glib-genmarshal has been written by Tim Janik .

    @@ -350,6 +356,6 @@ This manual page was provided by Tim Janik
    GObject Reference Manual Next
    -
    +
    @@ -420,7 +420,9 @@ Normally, GParamSpec classes are filled by G_PARAM_PRIVATE = G_PARAM_STATIC_NAME, #endif G_PARAM_STATIC_NICK = 1 << 6, - G_PARAM_STATIC_BLURB = 1 << 7 + G_PARAM_STATIC_BLURB = 1 << 7, + /* User defined flags go up to 30 */ + G_PARAM_DEPRECATED = 1 << 31 } GParamFlags;

    @@ -485,6 +487,14 @@ can be configured. Since 2.8 +

    + + +
    @@ -33,7 +33,7 @@

    glib-mkenums [options...] [files...]

    -

    Description

    +

    Description

    glib-mkenums is a small perl-script utility that parses C code to extract enum definitions and produces enum descriptions based on text templates specified by the user. Most frequently this script is used to @@ -42,14 +42,14 @@ value name strings for introspection.

    -

    Invocation

    +

    Invocation

    glib-mkenums takes a list of valid C code files as input. The options specified control the text that is output, certain substitutions are performed on the text templates for keywords enclosed in @ characters.

    -

    Options

    +

    Options

    @@ -144,7 +144,7 @@ Print version and exit.
    -

    Production text substitutions

    +

    Production text substitutions

    Certain keywords enclosed in @ characters will be substituted in the emitted text. For the substitution examples of the keywords below, @@ -210,6 +210,17 @@ minus (e.g. the-xvalue).

    + + + + - @@ -727,7 +734,7 @@ alive while the caller holds a pointer to it. - @@ -887,8 +894,9 @@ Invokes the closure, i.e. executes the callback represented by the param_values :

    -
    @@ -1164,7 +1172,7 @@ implementing new types of closures. - @@ -1318,6 +1326,32 @@ filled in with pointers to appropriate functions.

    @valuenum@

    +The integer value for the enum value currently being processed. This is +calculated by using perl to attempt to evaluate the +expression as it appears in the C source code. If evaluation fails then +glib-mkenums will exit with an error status, but this +only happens if @valuenum@ appears in your value +production template. (Since: 2.26) +

    @type@

    This is substituted either by "enum" or "flags", depending on whether the @@ -247,7 +258,7 @@ The base name of the input file currently being processed (e.g. foo.h). (Since:


    -

    Trigraph extensions

    +

    Trigraph extensions

    Some C comments are treated specially in the parsed enum definitions, such comments start out with the trigraph sequence /*< @@ -283,13 +294,14 @@ typedef enum /*< flags,prefix=PREFIX >*/

    -

    See also

    -

    glib-genmarshal(1) +

    See also

    +

    +glib-genmarshal(1)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Boxed-Types.html b/docs/reference/gobject/html/gobject-Boxed-Types.html index e14e9ad..8946261 100644 --- a/docs/reference/gobject/html/gobject-Boxed-Types.html +++ b/docs/reference/gobject/html/gobject-Boxed-Types.html @@ -3,12 +3,12 @@ Boxed Types - + - + @@ -60,8 +60,9 @@ #define G_TYPE_ARRAY #define G_TYPE_BYTE_ARRAY #define G_TYPE_PTR_ARRAY -#define G_TYPE_VARIANT #define G_TYPE_VARIANT_TYPE +#define G_TYPE_ERROR +#define G_TYPE_DATE_TIME typedef GStrv; @@ -301,8 +302,8 @@ and
    g_object_class_install_property (object_class,
                                      PROP_AUTHORS,
                                      g_param_spec_boxed ("authors",
    -                                                     _("Authors"),
    -                                                     _("List of authors"),
    +                                                     _("Authors"),
    +                                                     _("List of authors"),
                                                          G_TYPE_STRV,
                                                          G_PARAM_READWRITE));
     
    @@ -365,24 +366,34 @@ The Since 2.22


    -
    -

    G_TYPE_VARIANT

    -
    #define G_TYPE_VARIANT (g_variant_get_gtype ())
    +
    +

    G_TYPE_VARIANT_TYPE

    +
    #define G_TYPE_VARIANT_TYPE (g_variant_type_get_gtype ())
     

    -The GType for a boxed type holding a GVariant reference. +The GType for a boxed type holding a GVariantType.

    Since 2.24


    -
    -

    G_TYPE_VARIANT_TYPE

    -
    #define G_TYPE_VARIANT_TYPE (g_variant_type_get_gtype ())
    +
    +

    G_TYPE_ERROR

    +
    #define G_TYPE_ERROR (g_error_get_type ())
     

    -The GType for a boxed type holding a GVariantType. +The GType for a boxed type holding a GError.

    -

    Since 2.24

    +

    Since 2.26

    +
    +
    +
    +

    G_TYPE_DATE_TIME

    +
    #define G_TYPE_DATE_TIME (g_date_time_get_type ())
    +
    +

    +The GType for a boxed type holding a GDateTime. +

    +

    Since 2.26


    @@ -401,6 +412,6 @@ A C representable type name for
    - Generated by GTK-Doc V1.14
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Closures.html b/docs/reference/gobject/html/gobject-Closures.html index 258054e..af8af19 100644 --- a/docs/reference/gobject/html/gobject-Closures.html +++ b/docs/reference/gobject/html/gobject-Closures.html @@ -3,12 +3,12 @@ Closures - + - + @@ -104,6 +104,7 @@ GClosureMarshal meta_marshal); void g_source_set_closure (GSource *source, GClosure *closure); +void g_source_set_dummy_callback (GSource *source); #define G_TYPE_IO_CHANNEL #define G_TYPE_IO_CONDITION @@ -209,6 +210,12 @@ const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); +void g_cclosure_marshal_VOID__VARIANT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); void g_cclosure_marshal_STRING__OBJECT_POINTER (GClosure *closure, GValue *return_value, @@ -602,7 +609,7 @@ the first parameter.

    Returns :

    a new GCClosure + a new GCClosure. [transfer full]

    Returns :

    The closure passed in, for convenience + The closure passed in, for convenience. [transfer none]
    an array of GValues holding the arguments on - which to invoke the callback of closure + an array of + GValues holding the arguments on which to + invoke the callback of closure. [array length=n_param_values]

    Returns :

    a newly allocated GClosure + a newly allocated GClosure. [transfer full]

    +
    +

    g_source_set_dummy_callback ()

    +
    void                g_source_set_dummy_callback         (GSource *source);
    +

    +Sets a dummy callback for source. The callback will do nothing, and +if the source expects a gboolean return value, it will return TRUE. +(If the source expects any other type of return value, it will return +a 0/NULL value; whatever g_value_init() initializes a GValue to for +that type.) +

    +

    +If the source is not one of the standard GLib types, the +closure_callback and closure_marshal fields of the GSourceFuncs +structure must have been filled in with pointers to appropriate +functions. +

    +
    ++ + + + +

    source :

    the source +
    +
    +

    G_TYPE_IO_CHANNEL

    #define G_TYPE_IO_CHANNEL (g_io_channel_get_type ())
    @@ -2146,7 +2180,7 @@ A marshaller for a gpointer marshal_data);

    A marshaller for a GCClosure with a callback of type -void (*callback) (gpointer instance, GOBject *arg1, gpointer user_data). +void (*callback) (gpointer instance, GObject *arg1, gpointer user_data).

    @@ -2186,6 +2220,57 @@ A marshaller for a
    +
    +

    g_cclosure_marshal_VOID__VARIANT ()

    +
    void                g_cclosure_marshal_VOID__VARIANT    (GClosure *closure,
    +                                                         GValue *return_value,
    +                                                         guint n_param_values,
    +                                                         const GValue *param_values,
    +                                                         gpointer invocation_hint,
    +                                                         gpointer marshal_data);
    +

    +A marshaller for a GCClosure with a callback of type +void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data). +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + +

    closure :

    the GClosure to which the marshaller belongs +

    return_value :

    ignored +

    n_param_values :

    2 +

    param_values :

    a GValue array holding the instance and the GVariant* parameter +

    invocation_hint :

    the invocation hint given as the last argument + to g_closure_invoke() +

    marshal_data :

    additional data specified when registering the marshaller +
    +

    Since 2.26

    +
    +

    g_cclosure_marshal_STRING__OBJECT_POINTER ()

    void                g_cclosure_marshal_STRING__OBJECT_POINTER
    @@ -2350,6 +2435,6 @@ Another name for 
     
    - Generated by GTK-Doc V1.14
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Enumeration-and-Flag-Types.html b/docs/reference/gobject/html/gobject-Enumeration-and-Flag-Types.html index 8ed630f..b67373a 100644 --- a/docs/reference/gobject/html/gobject-Enumeration-and-Flag-Types.html +++ b/docs/reference/gobject/html/gobject-Enumeration-and-Flag-Types.html @@ -3,12 +3,12 @@ Enumeration and Flag Types - + - + @@ -842,6 +842,6 @@ function of a + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-GParamSpec.html b/docs/reference/gobject/html/gobject-GParamSpec.html index f65f1f4..3742b09 100644 --- a/docs/reference/gobject/html/gobject-GParamSpec.html +++ b/docs/reference/gobject/html/gobject-GParamSpec.html @@ -3,12 +3,12 @@ GParamSpec - + - + @@ -332,7 +332,7 @@ should not be used directly.

    GType owner_type;

    -GType type that uses (introduces) this paremeter +GType type that uses (introduces) this parameter

    G_PARAM_DEPRECATED

    the parameter is deprecated and will be removed + in a future version. A warning will be generated if it is used + while running with G_ENABLE_DIAGNOSTIC=1. + Since: 2.26 +
    @@ -525,7 +535,7 @@ Mask containing the bits of GParamSpec.flags. +GParamSpec.flags. The maximum allowed is 30 + G_PARAM_USER_SHIFT.


    @@ -1418,6 +1428,6 @@ g_object_class_install_property(),
    - Generated by GTK-Doc V1.14
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Generic-values.html b/docs/reference/gobject/html/gobject-Generic-values.html index f41749d..52b62e1 100644 --- a/docs/reference/gobject/html/gobject-Generic-values.html +++ b/docs/reference/gobject/html/gobject-Generic-values.html @@ -3,12 +3,12 @@ Generic values - + - + @@ -432,7 +432,7 @@ Initializes value with the default value

    Returns :

    the GValue structure that has been passed in + the GValue structure that has been passed in. [transfer none]
    @@ -573,7 +568,10 @@ This is an internal function introduced mainly for C marshallers. - @@ -771,6 +769,6 @@ The fundamental types which all support
    - Generated by GTK-Doc V1.14 + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Signals.html b/docs/reference/gobject/html/gobject-Signals.html index 94bb692..4fd132d 100644 --- a/docs/reference/gobject/html/gobject-Signals.html +++ b/docs/reference/gobject/html/gobject-Signals.html @@ -3,12 +3,12 @@ Signals - + - + @@ -233,6 +233,10 @@ enum
    GSignalInvocationHint* g_signal_get_invocation_hint (gpointer instance); GClosure* g_signal_type_cclosure_new (GType itype, guint struct_offset); +gbooleang_signal_accumulator_first_wins (GSignalInvocationHint *ihint, + GValue *return_accu, + const GValue *handler_return, + gpointer dummy); gbooleang_signal_accumulator_true_handled (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, @@ -250,7 +254,7 @@ basically they are a per-type facility that is inherited. A signal emission mainly involves invocation of a certain set of callbacks in precisely defined manner. There are two main categories of such callbacks, per-object -[10] +[10] ones and user provided ones. The per-object callbacks are most often referred to as "object method handler" or "default (signal) handler", while user provided callbacks are @@ -683,7 +687,7 @@ of
    g_signal_new ("size_request",
       G_TYPE_FROM_CLASS (gobject_class),
          G_SIGNAL_RUN_FIRST,
    -     G_STRUCT_OFFSET (GtkWidgetClass, size_request),
    +     G_STRUCT_OFFSET (GtkWidgetClass, size_request),
          NULL, NULL,
          _gtk_marshal_VOID__BOXED,
          G_TYPE_NONE, 1,
    @@ -2678,6 +2682,59 @@ identified by itype.
     

    Returns :

    TRUE if value will fit inside a pointer value. + the value contents as pointer. This +function asserts that g_value_fits_pointer() returned TRUE for the +passed in value. This is an internal function introduced mainly +for C marshallers. [transfer none]

    +
    +

    g_signal_accumulator_first_wins ()

    +
    gboolean            g_signal_accumulator_first_wins     (GSignalInvocationHint *ihint,
    +                                                         GValue *return_accu,
    +                                                         const GValue *handler_return,
    +                                                         gpointer dummy);
    +

    +A predefined GSignalAccumulator for signals intended to be used as a +hook for application code to provide a particular value. Usually +only one such value is desired and multiple handlers for the same +signal don't make much sense (except for the case of the default +handler defined in the class structure, in which case you will +usually want the signal connection to override the class handler). +

    +

    +This accumulator will use the return value from the first signal +handler that is run as the return value for the signal and not run +any further handlers (ie: the first handler "wins"). +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    ihint :

    standard GSignalAccumulator parameter +

    return_accu :

    standard GSignalAccumulator parameter +

    handler_return :

    standard GSignalAccumulator parameter +

    dummy :

    standard GSignalAccumulator parameter +

    Returns :

    standard GSignalAccumulator result + +
    +

    Since 2.28

    +
    +

    g_signal_accumulator_true_handled ()

    gboolean            g_signal_accumulator_true_handled   (GSignalInvocationHint *ihint,
    @@ -2689,7 +2746,7 @@ A predefined TRUE stops the signal emission: no further
     callbacks will be invoked, while a return of FALSE allows
    -the emission to coninue. The idea here is that a TRUE return
    +the emission to continue. The idea here is that a TRUE return
     indicates that the callback handled the signal,
     and no further handling is needed.
     

    @@ -2728,7 +2785,7 @@ and no further handling is needed.


    -

    [10] Although signals can deal with any kind of instantiatable +

    [10] Although signals can deal with any kind of instantiatable type, i'm referring to those types as "object types" in the following, simply because that is the context most users will encounter signals in.

    @@ -2736,6 +2793,6 @@ simply because that is the context most users will encounter signals in.
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Standard-Parameter-and-Value-Types.html b/docs/reference/gobject/html/gobject-Standard-Parameter-and-Value-Types.html index 7a1f590..ba5c6ec 100644 --- a/docs/reference/gobject/html/gobject-Standard-Parameter-and-Value-Types.html +++ b/docs/reference/gobject/html/gobject-Standard-Parameter-and-Value-Types.html @@ -3,12 +3,12 @@ Parameters and Values - + - + @@ -378,6 +378,24 @@ const GType g_value_get_gtype (const GValue *value); void g_value_set_gtype (GValue *value, GType v_gtype); + +#define G_IS_PARAM_SPEC_VARIANT (pspec) +#define G_PARAM_SPEC_VARIANT (pspec) +#define G_VALUE_HOLDS_VARIANT (value) +#define G_TYPE_PARAM_VARIANT + GParamSpecVariant; +GParamSpec* g_param_spec_variant (const gchar *name, + const gchar *nick, + const gchar *blurb, + const GVariantType *type, + GVariant *default_value, + GParamFlags flags); +GVariant* g_value_get_variant (const GValue *value); +GVariant* g_value_dup_variant (const GValue *value); +void g_value_set_variant (GValue *value, + GVariant *variant); +void g_value_take_variant (GValue *value, + GVariant *variant);
    +
    +
    +

    G_IS_PARAM_SPEC_VARIANT()

    +
    #define G_IS_PARAM_SPEC_VARIANT(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VARIANT))
    +
    +

    +Checks whether the given GParamSpec is of type G_TYPE_PARAM_VARIANT. +

    +
    ++ + + + + + + + + + +

    pspec :

    a GParamSpec +

    Returns :

    TRUE on success + +
    +

    Since 2.26

    +
    +
    +
    +

    G_PARAM_SPEC_VARIANT()

    +
    #define G_PARAM_SPEC_VARIANT(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VARIANT, GParamSpecVariant))
    +
    +

    +Casts a GParamSpec into a GParamSpecVariant. +

    +
    ++ + + + +

    pspec :

    a GParamSpec +
    +

    Since 2.26

    +
    +
    +
    +

    G_VALUE_HOLDS_VARIANT()

    +
    #define G_VALUE_HOLDS_VARIANT(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_VARIANT))
    +
    +

    +Checks whether the given GValue can hold values of type G_TYPE_VARIANT. +

    +
    ++ + + + + + + + + + +

    value :

    a valid GValue structure +

    Returns :

    TRUE on success. + +
    +

    Since 2.26

    +
    +
    +
    +

    G_TYPE_PARAM_VARIANT

    +
    #define G_TYPE_PARAM_VARIANT                (g_param_spec_types[22])
    +
    +

    +The GType of GParamSpecVariant. +

    +

    Since 2.26

    +
    +
    +
    +

    GParamSpecVariant

    +
    typedef struct {
    +  GParamSpec    parent_instance;
    +  GVariantType *type;
    +  GVariant     *default_value;
    +} GParamSpecVariant;
    +
    +

    +A GParamSpec derived structure that contains the meta data for GVariant properties. +

    +
    ++ + + + + + + + + + + + + + +

    GParamSpec parent_instance;

    private GParamSpec portion +

    GVariantType *type;

    a GVariantType, or NULL +

    GVariant *default_value;

    a GVariant, or NULL +
    +

    Since 2.26

    +
    +
    +
    +

    g_param_spec_variant ()

    +
    GParamSpec*         g_param_spec_variant                (const gchar *name,
    +                                                         const gchar *nick,
    +                                                         const gchar *blurb,
    +                                                         const GVariantType *type,
    +                                                         GVariant *default_value,
    +                                                         GParamFlags flags);
    +

    +Creates a new GParamSpecVariant instance specifying a GVariant +property. +

    +

    +If default_value is floating, it is consumed. +

    +

    +See g_param_spec_internal() for details on property names. +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    name :

    canonical name of the property specified +

    nick :

    nick name for the property specified +

    blurb :

    description of the property specified +

    type :

    a GVariantType +

    default_value :

    a GVariant of type type to use as the + default value, or NULL. [allow-none] +

    flags :

    flags for the property specified +

    Returns :

    the newly created GParamSpec + +
    +

    Since 2.26

    +
    +
    +
    +

    g_value_get_variant ()

    +
    GVariant*           g_value_get_variant                 (const GValue *value);
    +

    +Get the contents of a variant GValue. +

    +
    ++ + + + + + + + + + +

    value :

    a valid GValue of type G_TYPE_VARIANT +

    Returns :

    variant contents of value + +
    +

    Since 2.26

    +
    +
    +
    +

    g_value_dup_variant ()

    +
    GVariant*           g_value_dup_variant                 (const GValue *value);
    +

    +Get the contents of a variant GValue, increasing its refcount. +

    +
    ++ + + + + + + + + + +

    value :

    a valid GValue of type G_TYPE_VARIANT +

    Returns :

    variant contents of value, should be unrefed using + g_variant_unref() when no longer needed + +
    +

    Since 2.26

    +
    +
    +
    +

    g_value_set_variant ()

    +
    void                g_value_set_variant                 (GValue *value,
    +                                                         GVariant *variant);
    +

    +Set the contents of a variant GValue to variant. +If the variant is floating, it is consumed. +

    +
    ++ + + + + + + + + + +

    value :

    a valid GValue of type G_TYPE_VARIANT +

    variant :

    a GVariant, or NULL +
    +

    Since 2.26

    +
    +
    +
    +

    g_value_take_variant ()

    +
    void                g_value_take_variant                (GValue *value,
    +                                                         GVariant *variant);
    +

    +Set the contents of a variant GValue to variant, and takes over +the ownership of the caller's reference to variant; +the caller doesn't have to unref it any more (i.e. the reference +count of the variant is not increased). +

    +

    +It is a programmer error to pass a floating variant to this function. +In particular this means that callbacks in closures, and signal handlers +for signals of return type G_TYPE_VARIANT, must never return floating +variants. +

    +

    +If you want the GValue to hold its own reference to variant, use +g_value_set_variant() instead. +

    +

    +This is an internal function introduced mainly for C marshallers. +

    +
    ++ + + + + + + + + + +

    value :

    a valid GValue of type G_TYPE_VARIANT +

    variant :

    a GVariant, or NULL +
    +

    Since 2.26

    +

    See Also

    @@ -5237,6 +5550,6 @@ Set the contents of a
    - Generated by GTK-Doc V1.14
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-The-Base-Object-Type.html b/docs/reference/gobject/html/gobject-The-Base-Object-Type.html index 2c7a5be..e6e1273 100644 --- a/docs/reference/gobject/html/gobject-The-Base-Object-Type.html +++ b/docs/reference/gobject/html/gobject-The-Base-Object-Type.html @@ -3,12 +3,12 @@ The Base Object Type - + - + @@ -69,6 +69,9 @@ void g_object_class_install_property (GObjectClass *oclass, guint property_id, GParamSpec *pspec); +void g_object_class_install_properties (GObjectClass *oclass, + guint n_pspecs, + GParamSpec **pspecs); GParamSpec* g_object_class_find_property (GObjectClass *oclass, const gchar *property_name); GParamSpec** g_object_class_list_properties (GObjectClass *oclass, @@ -92,6 +95,7 @@ gpointer g_object_ref (gpointer object); void g_object_unref (gpointer object); gpointer g_object_ref_sink (gpointer object); +void g_clear_object (volatile GObject **object_ptr); typedef GInitiallyUnowned; typedef GInitiallyUnownedClass; #define G_TYPE_INITIALLY_UNOWNED @@ -132,6 +136,8 @@ typedef ...
    ); void g_object_notify (GObject *object, const gchar *property_name); +void g_object_notify_by_pspec (GObject *object, + GParamSpec *pspec); void g_object_freeze_notify (GObject *object); void g_object_thaw_notify (GObject *object); gpointer g_object_get_data (GObject *object, @@ -183,6 +189,7 @@ typedef

    Object Hierarchy

       GObject
    +   +----GBinding
        +----GTypeModule
     
    @@ -265,7 +272,7 @@ need to expose floating references in their API.

    Some object implementations may need to save an objects floating state -across certain code portions (an example is GtkMenu), to achive this, the +across certain code portions (an example is GtkMenu), to achive this, the following sequence can be used:

    @@ -349,7 +356,7 @@ The class structure for the GObject type.

    -

    Example 1. Implementing singletons using a constructor

    +

    Example 1. Implementing singletons using a constructor

    @@ -849,6 +856,155 @@ e.g. to change the range of allowed values or the default value.

    +
    +

    g_object_class_install_properties ()

    +
    void                g_object_class_install_properties   (GObjectClass *oclass,
    +                                                         guint n_pspecs,
    +                                                         GParamSpec **pspecs);
    +

    +Installs new properties from an array of GParamSpecs. This is +usually done in the class initializer. +

    +

    +The property id of each property is the index of each GParamSpec in +the pspecs array. +

    +

    +The property id of 0 is treated specially by GObject and it should not +be used to store a GParamSpec. +

    +

    +This function should be used if you plan to use a static array of +GParamSpecs and g_object_notify_by_pspec(). For instance, this +class initialization: +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    enum {
    +  PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
    +};
    +
    +static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
    +
    +static void
    +my_object_class_init (MyObjectClass *klass)
    +{
    +  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
    +
    +  obj_properties[PROP_FOO] =
    +    g_param_spec_int ("foo", "Foo", "Foo",
    +                      -1, G_MAXINT,
    +                      0,
    +                      G_PARAM_READWRITE);
    +
    +  obj_properties[PROP_BAR] =
    +    g_param_spec_string ("bar", "Bar", "Bar",
    +                         NULL,
    +                         G_PARAM_READWRITE);
    +
    +  gobject_class->set_property = my_object_set_property;
    +  gobject_class->get_property = my_object_get_property;
    +  g_object_class_install_properties (gobject_class,
    +                                     N_PROPERTIES,
    +                                     obj_properties);
    +}
    +
    + +

    +

    +

    +allows calling g_object_notify_by_pspec() to notify of property changes: +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    void
    +my_object_set_foo (MyObject *self, gint foo)
    +{
    +  if (self->foo != foo)
    +    {
    +      self->foo = foo;
    +      g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
    +    }
    + }
    +
    + +

    +

    +
    ++ + + + + + + + + + + + + + +

    oclass :

    a GObjectClass +

    n_pspecs :

    the length of the GParamSpecs array +

    pspecs :

    the GParamSpecs array + defining the new properties. [array length=n_pspecs] +
    +

    Since 2.26

    +
    +

    g_object_class_find_property ()

    GParamSpec*         g_object_class_find_property        (GObjectClass *oclass,
    @@ -901,7 +1057,8 @@ Get an array of 
     
     

    Returns :

    - an array of
    GParamSpec* which should be freed after use + an array of + GParamSpec* which should be freed after use. [array length=n_properties][transfer full length=n_properties] @@ -1254,6 +1411,39 @@ adds a new normal reference increasing the reference count by one.

    Since 2.10


    +
    +

    g_clear_object ()

    +
    void                g_clear_object                      (volatile GObject **object_ptr);
    +

    +Clears a reference to a GObject. +

    +

    +object_ptr must not be NULL. +

    +

    +If the reference is NULL then this function does nothing. +Otherwise, the reference count of the object is decreased and the +pointer is set to NULL. +

    +

    +This function is threadsafe and modifies the pointer atomically, +using memory barriers where needed. +

    +

    +A macro is also included that allows this function to be used without +pointer casts. +

    +
    ++ + + + +

    object_ptr :

    a pointer to a GObject reference +
    +

    Since 2.28

    +
    +

    GInitiallyUnowned

    typedef struct _GObject                  GInitiallyUnowned;
    @@ -1442,7 +1632,7 @@ the lifetime of object. When the 
     
     

    weak_pointer_location :

    -The memory address of a pointer. + The memory address of a pointer. [inout] @@ -1468,7 +1658,7 @@ to match the one used with weak_pointer_location :

    -The memory address of a pointer. + The memory address of a pointer. [inout] @@ -1690,12 +1880,12 @@ equivalent to g_signal_connect_object (..., G_CONNECT_SWAP 7 8
    menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
    -                           "type", GTK_WINDOW_POPUP,
    +                           "type", GTK_WINDOW_POPUP,
                                "child", menu,
                                NULL),
                          "signal::event", gtk_menu_window_event, menu,
                          "signal::size_request", gtk_menu_window_size_request, menu,
    -                     "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
    +                     "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
                          NULL);
    @@ -1820,7 +2010,7 @@ the type, for instance by calling -

    Example 2. Using g_object_get()

    +

    Example 2. Using g_object_get()

    An example of using g_object_get() to get the contents of three properties - one of type G_TYPE_INT, @@ -1875,6 +2065,11 @@ one of type property_name on object.

    +

    +When possible, eg. when signaling a property change from within the class +that registered the property, you should use g_object_notify_by_pspec() +instead. +

    @@ -1892,6 +2087,112 @@ Emits a "notify" signal for the property property_na

    +
    +

    g_object_notify_by_pspec ()

    +
    void                g_object_notify_by_pspec            (GObject *object,
    +                                                         GParamSpec *pspec);
    +

    +Emits a "notify" signal for the property specified by pspec on object. +

    +

    +This function omits the property name lookup, hence it is faster than +g_object_notify(). +

    +

    +One way to avoid using g_object_notify() from within the +class that registered the properties, and using g_object_notify_by_pspec() +instead, is to store the GParamSpec used with +g_object_class_install_property() inside a static array, e.g.: +

    +

    +

    +
    + + + + + + + +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    enum
    +{
    +  PROP_0,
    +  PROP_FOO,
    +  PROP_LAST
    +};
    +
    +static GParamSpec *properties[PROP_LAST];
    +
    +static void
    +my_object_class_init (MyObjectClass *klass)
    +{
    +  properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    +                                           0, 100,
    +                                           50,
    +                                           G_PARAM_READWRITE);
    +  g_object_class_install_property (gobject_class,
    +                                   PROP_FOO,
    +                                   properties[PROP_FOO]);
    +}
    +
    + +

    +

    +

    +and then notify a change on the "foo" property with: +

    +

    +

    +
    + + + + + + + +
    1
    g_object_notify_by_pspec (self, properties[PROP_FOO]);
    +
    + +

    +

    +
    ++ + + + + + + + + + +

    object :

    a GObject +

    pspec :

    the GParamSpec of a property installed on the class of object. +
    +

    Since 2.26

    +
    +

    g_object_freeze_notify ()

    void                g_object_freeze_notify              (GObject *object);
    @@ -2314,7 +2615,9 @@ Sets a property on an object. const gchar *property_name, GValue *value);

    -Gets a property of an object. +Gets a property of an object. value must have been initialized to the +expected type of the property (or a type to which the expected type can be +transformed) using g_value_init().

    In general, a copy is made of the property contents and the caller is @@ -2604,6 +2907,6 @@ detail strings for the notify signal.

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Type-Information.html b/docs/reference/gobject/html/gobject-Type-Information.html index fb5a530..9705394 100644 --- a/docs/reference/gobject/html/gobject-Type-Information.html +++ b/docs/reference/gobject/html/gobject-Type-Information.html @@ -3,12 +3,12 @@ Type Information - + - + @@ -74,6 +74,9 @@ typedef G_TYPE_INSTANCE_GET_PRIVATE (instance, g_type, c_type) +#define G_TYPE_CLASS_GET_PRIVATE (klass, + g_type, + c_type) #define G_TYPE_CHECK_INSTANCE (instance) #define G_TYPE_CHECK_INSTANCE_CAST (instance, g_type, @@ -221,6 +224,20 @@ enum G_DEFINE_BOXED_TYPE (TypeName, + type_name, + copy_func, + free_func) +#define G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, + type_name, + copy_func, + free_func, + _C_) +#define G_DEFINE_POINTER_TYPE (TypeName, + type_name) +#define G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, + type_name, + _C_) #define G_TYPE_INVALID @@ -245,6 +262,7 @@ enum G_TYPE_PARAM #define G_TYPE_OBJECT #define G_TYPE_GTYPE +#define G_TYPE_VARIANT #define G_TYPE_RESERVED_GLIB_FIRST #define G_TYPE_RESERVED_GLIB_LAST @@ -1332,6 +1350,46 @@ This macro should only be used in type implementations.

    Since 2.4


    +
    +

    G_TYPE_CLASS_GET_PRIVATE()

    +
    #define G_TYPE_CLASS_GET_PRIVATE(klass, g_type, c_type)   ((c_type*) g_type_class_get_private ((GTypeClass*) (klass), (g_type)))
    +
    +

    +Gets the private class structure for a particular type. +The private structure must have been registered in the +get_type() function with g_type_add_class_private(). +

    +

    +This macro should only be used in type implementations. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    klass :

    the class of a type deriving from private_type. +

    g_type :

    the type identifying which private data to retrieve. +

    c_type :

    The C type for the private structure. +

    Returns :

    a pointer to the private data structure. +
    +

    Since 2.24

    +
    +

    G_TYPE_CHECK_INSTANCE()

    #define G_TYPE_CHECK_INSTANCE(instance)				(_G_TYPE_CHI ((GTypeInstance*) (instance)))
    @@ -1965,13 +2023,24 @@ g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
     
    void                g_type_class_add_private            (gpointer g_class,
                                                              gsize private_size);

    -Registers a private structure for an instantiatable type; -when an object is allocated, the private structures for +Registers a private structure for an instantiatable type. +

    +

    +When an object is allocated, the private structures for the type and all of its parent types are allocated sequentially in the same memory block as the public -structures. This function should be called in the -type's class_init() function. The private structure can -be retrieved using the G_TYPE_INSTANCE_GET_PRIVATE() macro. +structures. +

    +

    +Note that the accumulated size of the private structures of +a type and all its parent types cannot excced 64kB. +

    +

    +This function should be called in the type's class_init() function. +The private structure can be retrieved using the +G_TYPE_INSTANCE_GET_PRIVATE() macro. +

    +

    The following example shows attaching a private structure MyObjectPrivate to an object MyObject defined in the standard GObject @@ -2089,7 +2158,7 @@ sequentially in the same memory block as the public structures. This function should be called in the type's get_type() function after the type is registered. The private structure can be retrieved using the -G_TYPE_CLASS_GET_PRIVATE() macro. +G_TYPE_CLASS_GET_PRIVATE() macro.

    @@ -3969,6 +4038,147 @@ class init functions.

    Since 2.4


    +
    +

    G_DEFINE_BOXED_TYPE()

    +
    #define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
    +
    +

    +A convenience macro for boxed type implementations, which defines a +type_name_get_type() function registering the boxed type. +

    +
    ++ + + + + + + + + + + + + + + + + + +

    TypeName :

    The name of the new type, in Camel case. +

    type_name :

    The name of the new type, in lowercase, with words + separated by '_'. +

    copy_func :

    the GBoxedCopyFunc for the new type +

    free_func :

    the GBoxedFreeFunc for the new type +
    +

    Since 2.26

    +
    +
    +
    +

    G_DEFINE_BOXED_TYPE_WITH_CODE()

    +
    #define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
    +
    +

    +A convenience macro for boxed type implementations. +Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the +type_name_get_type() function, e.g. to register value transformations with +g_value_register_transform_func(). +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    TypeName :

    The name of the new type, in Camel case. +

    type_name :

    The name of the new type, in lowercase, with words + separated by '_'. +

    copy_func :

    the GBoxedCopyFunc for the new type +

    free_func :

    the GBoxedFreeFunc for the new type +

    _C_ :

    Custom code that gets inserted in the *_get_type() function. +
    +

    Since 2.26

    +
    +
    +
    +

    G_DEFINE_POINTER_TYPE()

    +
    #define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {})
    +
    +

    +A convenience macro for pointer type implementations, which defines a +type_name_get_type() function registering the pointer type. +

    +
    ++ + + + + + + + + + +

    TypeName :

    The name of the new type, in Camel case. +

    type_name :

    The name of the new type, in lowercase, with words + separated by '_'. +
    +

    Since 2.26

    +
    +
    +
    +

    G_DEFINE_POINTER_TYPE_WITH_CODE()

    +
    #define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
    +
    +

    +A convenience macro for pointer type implementations. +Similar to G_DEFINE_POINTER_TYPE(), but allows to insert custom code into the +type_name_get_type() function. +

    +
    ++ + + + + + + + + + + + + + +

    TypeName :

    The name of the new type, in Camel case. +

    type_name :

    The name of the new type, in lowercase, with words + separated by '_'. +

    _C_ :

    Custom code that gets inserted in the *_get_type() function. +
    +

    Since 2.26

    +
    +

    G_TYPE_INVALID

    #define G_TYPE_INVALID			G_TYPE_MAKE_FUNDAMENTAL (0)
    @@ -4171,9 +4381,32 @@ The type for 
    +

    G_TYPE_VARIANT

    +
    #define G_TYPE_VARIANT                  G_TYPE_MAKE_FUNDAMENTAL (21)
    +
    +

    +The fundamental type corresponding to GVariant. +

    +

    +All floating GVariant instances passed through the GType system are +consumed. +

    +

    +Note that callbacks in closures, and signal handlers +for signals of return type G_TYPE_VARIANT, must never return floating +variants. +

    +

    +Note: GLib 2.24 did include a boxed type with this name. It was replaced +with this fundamental type in 2.26. +

    +

    Since 2.26

    +
    +

    G_TYPE_RESERVED_GLIB_FIRST

    -
    #define G_TYPE_RESERVED_GLIB_FIRST (21)
    +
    #define G_TYPE_RESERVED_GLIB_FIRST (22)
     

    First fundamental type number to create a new fundamental type id with @@ -4222,6 +4455,6 @@ type id with


    - Generated by GTK-Doc V1.14
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Value-arrays.html b/docs/reference/gobject/html/gobject-Value-arrays.html index 4ad6460..2c03291 100644 --- a/docs/reference/gobject/html/gobject-Value-arrays.html +++ b/docs/reference/gobject/html/gobject-Value-arrays.html @@ -3,12 +3,12 @@ Value arrays - + - - + + @@ -18,7 +18,7 @@ Up Home GObject Reference Manual -Next +Next Top @@ -124,7 +124,7 @@ Return a pointer to the value at index_

    Returns :

    - pointer to a value at index_ in value_array + pointer to a value at index_ in value_array. [transfer none] @@ -174,7 +174,7 @@ contents.

    Returns :

    - Newly allocated copy of GValueArray + Newly allocated copy of GValueArray. [transfer full] @@ -203,7 +203,8 @@ Free a GValueArray* g_value_array_append (GValueArray *value_array, const GValue *value);

    -Insert a copy of value as last element of value_array. +Insert a copy of value as last element of value_array. If value is +NULL, an uninitialized value is appended.

    @@ -216,13 +217,12 @@ Insert a copy of value as last element o - - @@ -234,7 +234,8 @@ Insert a copy of value as last element o
    GValueArray*        g_value_array_prepend               (GValueArray *value_array,
                                                              const GValue *value);

    -Insert a copy of value as first element of value_array. +Insert a copy of value as first element of value_array. If value is +NULL, an uninitialized value is prepended.

    value :

    -GValue to copy into GValueArray + GValue to copy into GValueArray, or NULL. [allow-none]

    Returns :

    the GValueArray passed in as value_array + the GValueArray passed in as value_array. [transfer none]
    @@ -247,13 +248,12 @@ Insert a copy of value as first element - - @@ -266,7 +266,8 @@ Insert a copy of value as first element guint index_, const GValue *value);

    -Insert a copy of value at specified position into value_array. +Insert a copy of value at specified position into value_array. If value +is NULL, an uninitialized value is inserted.

    value :

    -GValue to copy into GValueArray + GValue to copy into GValueArray, or NULL. [allow-none]

    Returns :

    the GValueArray passed in as value_array + the GValueArray passed in as value_array. [transfer none]
    @@ -284,13 +285,12 @@ Insert a copy of value at specified posi - - @@ -320,7 +320,7 @@ Remove the value at position index_ from - @@ -349,12 +349,12 @@ The current implementation uses Quick-Sort as sorting algorithm. - - @@ -373,6 +373,9 @@ to the semantics of

    value :

    -GValue to copy into GValueArray + GValue to copy into GValueArray, or NULL. [allow-none]

    Returns :

    the GValueArray passed in as value_array + the GValueArray passed in as value_array. [transfer none]

    Returns :

    the GValueArray passed in as value_array + the GValueArray passed in as value_array. [transfer none]

    compare_func :

    function to compare elements + function to compare elements. [scope call]

    Returns :

    the GValueArray passed in as value_array + the GValueArray passed in as value_array. [transfer none]
    @@ -384,17 +387,17 @@ The current implementation uses Quick-Sort as sorting algorithm. - - - @@ -408,6 +411,6 @@ The current implementation uses Quick-Sort as sorting algorithm. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-Varargs-Value-Collection.html b/docs/reference/gobject/html/gobject-Varargs-Value-Collection.html index 8e40fc6..def7786 100644 --- a/docs/reference/gobject/html/gobject-Varargs-Value-Collection.html +++ b/docs/reference/gobject/html/gobject-Varargs-Value-Collection.html @@ -3,12 +3,12 @@ Varargs Value Collection - + - + @@ -83,6 +83,36 @@ types and pointers.

    A union holding one collected value.

    +

    compare_func :

    function to compare elements + function to compare elements. [scope call]

    user_data :

    extra data argument provided for compare_func + extra data argument provided for compare_func. [closure]

    Returns :

    the GValueArray passed in as value_array + the GValueArray passed in as value_array. [transfer none]
    ++ + + + + + + + + + + + + + + + + + + + + + +

    gint v_int;

    the field for holding integer values +

    glong v_long;

    the field for holding long integer values +

    gint64 v_int64;

    the field for holding 64 bit integer values +

    gdouble v_double;

    the field for holding floating point values +

    gpointer v_pointer;

    the field for holding pointers +

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-memory.html b/docs/reference/gobject/html/gobject-memory.html index beb7f7f..1683d55 100644 --- a/docs/reference/gobject/html/gobject-memory.html +++ b/docs/reference/gobject/html/gobject-memory.html @@ -3,12 +3,12 @@ Object memory management - + - + @@ -199,7 +199,7 @@ void g_object_run_dispose (GObject *object);

    This two-step destruction process is very useful to break reference counting cycles. While the detection of the cycles is up to the external code, once the cycles have been - detected, the external code can invoke g_object_dispose which + detected, the external code can invoke g_object_run_dispose which will indeed break any existing cycles since it will run the dispose handler associated to the object and thus release all references to other objects.

    @@ -208,7 +208,7 @@ void g_object_run_dispose (GObject *object); we stated a bit sooner: the dispose handler can be invoked multiple times. Let's say we have a reference count cycle: object A references B which itself references object A. Let's say we have detected the cycle and we want to destroy the two objects. One way to - do this would be to invoke g_object_dispose on one of the + do this would be to invoke g_object_run_dispose on one of the objects.

    @@ -229,6 +229,6 @@ void g_object_run_dispose (GObject *object);

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-properties.html b/docs/reference/gobject/html/gobject-properties.html index 281095c..561af9b 100644 --- a/docs/reference/gobject/html/gobject-properties.html +++ b/docs/reference/gobject/html/gobject-properties.html @@ -3,12 +3,12 @@ Object properties - + - + @@ -162,17 +162,18 @@ g_value_unset (&val); g_value_transform will try to transform the input signed char into an unsigned int. Of course, the success of the transformation depends on the availability of the required transform function. In practice, there will almost always be a transformation - [4] + [4] which matches and conversion will be carried out if needed.

    - After transformation, the GValue is validated by + After transformation, the GValue is validated by g_param_value_validate which makes sure the user's - data stored in the GValue matches the characteristics specified by - the property's GParamSpec. Here, the GParamSpec we + data stored in the GValue matches the characteristics specified by + the property's GParamSpec. + Here, the GParamSpec we provided in class_init has a validation function which makes sure that the GValue contains a value which respects the minimum and maximum bounds of the - GParamSpec. In the example above, the client's GValue does not + GParamSpec. In the example above, the client's GValue does not respect these constraints (it is set to 11, while the maximum is 10). As such, the g_object_set_property function will return with an error.

    @@ -181,8 +182,8 @@ g_value_unset (&val); would have proceeded with calling the object's set_property class method. Here, since our implementation of Foo did override this method, the code path would jump to foo_set_property after having retrieved from the - GParamSpec the param_id - [5] + GParamSpec the param_id + [5] which had been stored by g_object_class_install_property.

    @@ -251,12 +252,12 @@ g_object_set (G_OBJECT (foo),


    -

    [4] Its behaviour might not be what you expect but it is up to you to actually avoid +

    [4] Its behaviour might not be what you expect but it is up to you to actually avoid relying on these transformations.

    -

    [5] +

    [5] It should be noted that the param_id used here need only to uniquely identify each - GParamSpec within the FooClass such that the switch + GParamSpec within the FooClass such that the switch used in the set and get methods actually works. Of course, this locally-unique integer is purely an optimization: it would have been possible to use a set of if (strcmp (a, b) == 0) {} else if (strcmp (a, b) == 0) {} statements. @@ -265,6 +266,6 @@ g_object_set (G_OBJECT (foo),

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject-query.html b/docs/reference/gobject/html/gobject-query.html index 37bf7b9..209ebb7 100644 --- a/docs/reference/gobject/html/gobject-query.html +++ b/docs/reference/gobject/html/gobject-query.html @@ -3,12 +3,12 @@ gobject-query - + - + @@ -19,7 +19,7 @@ GObject Reference Manual Next -
    +
    @@ -34,20 +34,20 @@

    gobject-query tree [options...]

    -

    Description

    +

    Description

    gobject-query is a small utility that draws a tree of types.

    -

    Invocation

    +

    Invocation

    gobject-query takes a mandatory argument that specifies whether it should iterate over the fundamental types or print a type tree.

    -

    Options

    +

    Options

    @@ -112,6 +112,6 @@ Print version and exit. + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gobject.devhelp b/docs/reference/gobject/html/gobject.devhelp index de04b4e..cf36d27 100644 --- a/docs/reference/gobject/html/gobject.devhelp +++ b/docs/reference/gobject/html/gobject.devhelp @@ -5,7 +5,7 @@ - + @@ -39,6 +39,7 @@ + @@ -83,6 +84,9 @@ + + + @@ -112,6 +116,7 @@ + @@ -187,6 +192,10 @@ + + + + @@ -209,6 +218,7 @@ + @@ -253,6 +263,7 @@ + @@ -265,6 +276,7 @@ + @@ -283,6 +295,7 @@ + @@ -340,8 +353,9 @@ - + + @@ -547,6 +561,16 @@ + + + + + + + + + + @@ -648,6 +672,7 @@ + @@ -678,6 +703,7 @@ + @@ -697,6 +723,7 @@ + @@ -712,12 +739,28 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/gobject/html/gobject.devhelp2 b/docs/reference/gobject/html/gobject.devhelp2 index 80f6371..1a6caa6 100644 --- a/docs/reference/gobject/html/gobject.devhelp2 +++ b/docs/reference/gobject/html/gobject.devhelp2 @@ -5,7 +5,7 @@ - + @@ -39,6 +39,7 @@ + @@ -83,6 +84,9 @@ + + + @@ -112,6 +116,7 @@ + @@ -187,6 +192,10 @@ + + + + @@ -209,6 +218,7 @@ + @@ -253,6 +263,7 @@ + @@ -265,6 +276,7 @@ + @@ -283,6 +295,7 @@ + @@ -340,8 +353,9 @@ - + + @@ -547,6 +561,16 @@ + + + + + + + + + + @@ -648,6 +672,7 @@ + @@ -678,6 +703,7 @@ + @@ -697,6 +723,7 @@ + @@ -712,13 +739,29 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -738,6 +781,7 @@ + @@ -753,5 +797,9 @@ + + + + diff --git a/docs/reference/gobject/html/gtype-conventions.html b/docs/reference/gobject/html/gtype-conventions.html index 0feb0e4..97c9443 100644 --- a/docs/reference/gobject/html/gtype-conventions.html +++ b/docs/reference/gobject/html/gtype-conventions.html @@ -3,12 +3,12 @@ Conventions - + - + @@ -34,7 +34,7 @@

  • Use prefixing to avoid namespace conflicts with other projects. If your library (or application) is named Maman, - [3] + [3] prefix all your function names with maman_. For example: maman_object_method. @@ -130,7 +130,7 @@ G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT)



    -

    [3] +

    [3] Maman is the French word for mum or mother - nothing more and nothing less.

    @@ -138,6 +138,6 @@ G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT)
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/gtype-instantiable-classed.html b/docs/reference/gobject/html/gtype-instantiable-classed.html index 03e57fd..eb78845 100644 --- a/docs/reference/gobject/html/gtype-instantiable-classed.html +++ b/docs/reference/gobject/html/gtype-instantiable-classed.html @@ -3,12 +3,12 @@ Instantiable classed types: objects - + - + @@ -25,7 +25,7 @@

    Types which are registered with a class and are declared instantiable are what most closely resembles an object. - Although GObjects (detailed in The GObject base class) + Although GObjects (detailed in The GObject base class) are the most well known type of instantiable classed types, other kinds of similar objects used as the base of an inheritance hierarchy have been externally developed and they are all built on the fundamental @@ -83,8 +83,8 @@ maman_bar_get_type (void)

    Every object must define two structures: its class structure and its instance structure. All class structures must contain as first member - a GTypeClass structure. All instance structures must contain as first - member a GTypeInstance structure. The declaration of these C types, + a GTypeClass structure. All instance structures must contain as first + member a GTypeInstance structure. The declaration of these C types, coming from gtype.h is shown below:

    @@ -179,9 +179,9 @@ void           g_type_free_instance   (GTypeInstance *instance);
                 a class structure: it allocates a buffer to hold the object's class structure and
                 initializes it. It first copies the parent's class structure over this structure
                 (if there is no parent, it initializes it to zero). It then invokes the 
    -            base_class_initialization functions (GBaseInitFunc) from topmost 
    +            base_class_initialization functions (GBaseInitFunc) from topmost 
                 fundamental object to bottom-most most derived object. The object's class_init 
    -            (GClassInitFunc) function is invoked afterwards to complete
    +            (GClassInitFunc) function is invoked afterwards to complete
                 initialization of the class structure.
                 Finally, the object's interfaces are initialized (we will discuss interface initialization
                 in more detail later).
    @@ -189,7 +189,7 @@ void           g_type_free_instance   (GTypeInstance *instance);
     

    Once the type system has a pointer to an initialized class structure, it sets the object's instance class pointer to the object's class structure and invokes the object's - instance_init (GInstanceInitFunc)functions, from top-most fundamental + instance_init (GInstanceInitFunc)functions, from top-most fundamental type to bottom-most most derived type.

    @@ -203,7 +203,7 @@ void g_type_free_instance (GTypeInstance *instance); the initialization: interfaces are destroyed first. Then, the most derived class_finalize (ClassFinalizeFunc) function is invoked. The - base_class_finalize (GBaseFinalizeFunc) functions are + base_class_finalize (GBaseFinalizeFunc) functions are Finally invoked from bottom-most most-derived type to top-most fundamental type and the class structure is freed.

    @@ -282,6 +282,6 @@ void g_type_free_instance (GTypeInstance *instance); + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/gtype-non-instantiable-classed.html b/docs/reference/gobject/html/gtype-non-instantiable-classed.html index 7d4a9d5..fa3c354 100644 --- a/docs/reference/gobject/html/gtype-non-instantiable-classed.html +++ b/docs/reference/gobject/html/gtype-non-instantiable-classed.html @@ -3,12 +3,12 @@ Non-instantiable classed types: interfaces - + - + @@ -30,13 +30,13 @@ control your CD player, MP3 player or anything that uses these symbols. To declare an interface you have to register a non-instantiable classed type which derives from - GTypeInterface. The following piece of code declares such an interface. + GTypeInterface. The following piece of code declares such an interface.

    -#define MAMAN_IBAZ_TYPE                (maman_ibaz_get_type ())
    -#define MAMAN_IBAZ(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_IBAZ_TYPE, MamanIbaz))
    -#define MAMAN_IS_IBAZ(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_IBAZ_TYPE))
    -#define MAMAN_IBAZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MAMAN_IBAZ_TYPE, MamanIbazInterface))
    +#define MAMAN_TYPE_IBAZ                (maman_ibaz_get_type ())
    +#define MAMAN_IBAZ(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_IBAZ, MamanIbaz))
    +#define MAMAN_IS_IBAZ(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_IBAZ))
    +#define MAMAN_IBAZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MAMAN_TYPE_IBAZ, MamanIbazInterface))
     
     typedef struct _MamanIbaz MamanIbaz; /* dummy object */
     typedef struct _MamanIbazInterface MamanIbazInterface;
    @@ -68,7 +68,7 @@ void maman_ibaz_do_action (MamanIbaz *self)
             

    An interface is defined by only one structure which must contain as first member - a GTypeInterface structure. The interface structure is expected to + a GTypeInterface structure. The interface structure is expected to contain the function pointers of the interface methods. It is good style to define helper functions for each of the interface methods which simply call the interface' method directly: maman_ibaz_do_action @@ -77,7 +77,7 @@ void maman_ibaz_do_action (MamanIbaz *self)

    Once an interface type is registered, you must register implementations for these interfaces. The function named maman_baz_get_type registers - a new GType named MamanBaz which inherits from GObject and which + a new GType named MamanBaz which inherits from GObject and which implements the interface MamanIBaz.

    @@ -120,7 +120,7 @@ maman_baz_get_type (void)
                                        "MamanBazType",
                                        &info, 0);
         g_type_add_interface_static (type,
    -                                 MAMAN_IBAZ_TYPE,
    +                                 MAMAN_TYPE_IBAZ,
                                      &ibaz_info);
       }
       return type;
    @@ -133,7 +133,7 @@ maman_baz_get_type (void)
               a given type implements also FooInterface 
               (foo_interface_get_type returns the type of 
               FooInterface).
    -                The GInterfaceInfo structure holds
    +                The GInterfaceInfo structure holds
               information about the implementation of the interface:
     

    @@ -311,6 +311,6 @@ maman_ibaz_base_init (gpointer g_iface)
     
     
    +          Generated by GTK-Doc V1.15
     
     
    \ No newline at end of file
    diff --git a/docs/reference/gobject/html/gtype-non-instantiable.html b/docs/reference/gobject/html/gtype-non-instantiable.html
    index 657717b..0f17183 100644
    --- a/docs/reference/gobject/html/gtype-non-instantiable.html
    +++ b/docs/reference/gobject/html/gtype-non-instantiable.html
    @@ -3,12 +3,12 @@
     
     
     Non-instantiable non-classed fundamental types
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -29,7 +29,7 @@
             

    To register such a type in the type system, you just need to fill the - GTypeInfo structure with zeros since these types are also most of the time + GTypeInfo structure with zeros since these types are also most of the time fundamental:

    @@ -63,14 +63,14 @@
     

    Having non-instantiable types might seem a bit useless: what good is a type if you cannot instantiate an instance of that type ? Most of these types - are used in conjunction with GValues: a GValue is initialized + are used in conjunction with GValues: a GValue is initialized with an integer or a string and it is passed around by using the registered - type's value_table. GValues (and by extension these trivial fundamental + type's value_table. GValues (and by extension these trivial fundamental types) are most useful when used in conjunction with object properties and signals.

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-gobject-chainup.html b/docs/reference/gobject/html/howto-gobject-chainup.html index d3df278..80effe4 100644 --- a/docs/reference/gobject/html/howto-gobject-chainup.html +++ b/docs/reference/gobject/html/howto-gobject-chainup.html @@ -3,12 +3,12 @@ Chaining up - + - + @@ -54,7 +54,7 @@ To explicitly chain up to the implementation of the virtual method in the parent class, you first need a handle to the original parent class structure. This pointer can then be used to access the original class function pointer and invoke it directly. - [11] + [11]

    The function g_type_class_peek_parent is used to access the original parent class structure. Its input is a pointer to the class of the derived object and it returns a pointer @@ -81,7 +81,7 @@ b_method_to_call (B *obj, int a)



    -

    [11] +

    [11] The original adjective used in this sentence is not innocuous. To fully understand its meaning, you need to recall how class structures are initialized: for each object type, the class structure associated to this object is created by first copying the class structure of its @@ -95,6 +95,6 @@ b_method_to_call (B *obj, int a)

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-gobject-code.html b/docs/reference/gobject/html/howto-gobject-code.html index a33a3b1..e43b585 100644 --- a/docs/reference/gobject/html/howto-gobject-code.html +++ b/docs/reference/gobject/html/howto-gobject-code.html @@ -3,12 +3,12 @@ Boilerplate code - + - + @@ -81,6 +81,6 @@ G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT);
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-gobject-construction.html b/docs/reference/gobject/html/howto-gobject-construction.html index 77eebee..13fa66e 100644 --- a/docs/reference/gobject/html/howto-gobject-construction.html +++ b/docs/reference/gobject/html/howto-gobject-construction.html @@ -3,12 +3,12 @@ Object Construction - + - + @@ -63,7 +63,7 @@ maman_bar_init (MamanBar *self) Now, if you need special construction properties, install the properties in the class_init function, override the set and get methods and implement the get and set methods as described in the section called “Object properties”. Make sure that these properties use a construct only - GParamSpec by setting the param spec's flag field to G_PARAM_CONSTRUCT_ONLY: this helps + GParamSpec by setting the param spec's flag field to G_PARAM_CONSTRUCT_ONLY: this helps GType ensure that these properties are not set again later by malicious user code.

    @@ -71,19 +71,19 @@ static void
     bar_class_init (MamanBarClass *klass)
     {
       GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
    -  GParamSpec *maman_param_spec;
    +  GParamSpec *pspec;
     
       gobject_class->set_property = bar_set_property;
       gobject_class->get_property = bar_get_property;
     
    -  maman_param_spec = g_param_spec_string ("maman",
    +  pspec = g_param_spec_string ("maman",
                                               "Maman construct prop",
                                               "Set maman's name",
                                               "no-name-set" /* default value */,
                                               G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
       g_object_class_install_property (gobject_class,
                                        PROP_MAMAN,
    -                                   maman_param_spec);
    +                                   pspec);
     }
     

    @@ -108,6 +108,6 @@ bar_class_init (MamanBarClass *klass)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-gobject-destruction.html b/docs/reference/gobject/html/howto-gobject-destruction.html index 3fb12bf..c59dc3f 100644 --- a/docs/reference/gobject/html/howto-gobject-destruction.html +++ b/docs/reference/gobject/html/howto-gobject-destruction.html @@ -3,12 +3,12 @@ Object Destruction - + - + @@ -117,6 +117,6 @@ maman_bar_init (MamanBar *self); + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-gobject-methods.html b/docs/reference/gobject/html/howto-gobject-methods.html index 18deb84..8801530 100644 --- a/docs/reference/gobject/html/howto-gobject-methods.html +++ b/docs/reference/gobject/html/howto-gobject-methods.html @@ -3,12 +3,12 @@ Object methods - + - + @@ -45,7 +45,7 @@

    -Non-virtual public methods

    +Non-virtual public methods

    These are the simplest: you want to provide a simple method which can act on your object. All you need to do is to provide a function @@ -71,7 +71,7 @@ maman_bar_do_action (MamanBar *self, /* parameters */)

    -Virtual public methods

    +Virtual public methods

    This is the preferred way to create polymorphic GObjects. All you need to do is to define the common method and its class function in @@ -169,7 +169,7 @@ maman_bar_do_action_two (MamanBar *self, /* parameters */)

    -Virtual private Methods

    +Virtual private Methods

    These are very similar to Virtual Public methods. They just don't have a public function to call the function directly. The header @@ -252,6 +252,6 @@ maman_bar_subtype_class_init (MamanBarSubTypeClass *klass)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-gobject.html b/docs/reference/gobject/html/howto-gobject.html index c0a00ca..5a85bb7 100644 --- a/docs/reference/gobject/html/howto-gobject.html +++ b/docs/reference/gobject/html/howto-gobject.html @@ -3,12 +3,12 @@ How to define and implement a new GObject - + - + @@ -29,9 +29,9 @@
    Object Destruction
    Object methods
    -
    Non-virtual public methods
    -
    Virtual public methods
    -
    Virtual private Methods
    +
    Non-virtual public methods
    +
    Virtual public methods
    +
    Virtual private Methods
    Chaining up
    @@ -79,8 +79,8 @@ (this is the convention used by GTK+)

  • - I personally like the first solution better: it makes reading file names - easier for those with poor eyesight like me. + Some people like the first two solutions better: it makes reading file + names easier for those with poor eyesight.

    When you need some private (internal) declarations in several @@ -278,6 +278,6 @@ maman_bar_init (MamanBar *self)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-interface-implement.html b/docs/reference/gobject/html/howto-interface-implement.html index cbaee1e..2e0bde9 100644 --- a/docs/reference/gobject/html/howto-interface-implement.html +++ b/docs/reference/gobject/html/howto-interface-implement.html @@ -3,12 +3,12 @@ How To define implement an Interface? - + - + @@ -120,6 +120,6 @@ maman_baz_init (MamanBaz *self) + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-interface-properties.html b/docs/reference/gobject/html/howto-interface-properties.html index e1213e0..f1beb3a 100644 --- a/docs/reference/gobject/html/howto-interface-properties.html +++ b/docs/reference/gobject/html/howto-interface-properties.html @@ -3,12 +3,12 @@ Interface Properties - + - + @@ -34,9 +34,9 @@ To include a property named 'name' of type string in the maman_ibaz interface example code above, we only need to add one - [12] + [12] line in the maman_ibaz_base_init - [13] + [13] as shown below:

    @@ -150,10 +150,10 @@ maman_baz_class_init (MamanBazClass *klass)
         



    -

    [12] +

    [12] That really is one line extended to six for the sake of clarity

    -

    [13] +

    [13] The g_object_interface_install_property can also be called from class_init but it must not be called after that point. @@ -162,6 +162,6 @@ maman_baz_class_init (MamanBazClass *klass)

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-interface.html b/docs/reference/gobject/html/howto-interface.html index fc7c9cd..cad251f 100644 --- a/docs/reference/gobject/html/howto-interface.html +++ b/docs/reference/gobject/html/howto-interface.html @@ -3,12 +3,12 @@ How to define and implement interfaces - + - + @@ -67,8 +67,8 @@ void maman_ibaz_do_action (MamanIbaz *self); #endif /* __MAMAN_IBAZ_H__ */

    - This code is the same as the code for a normal GType - which derives from a GObject except for a few details: + This code is the same as the code for a normal GType + which derives from a GObject except for a few details:

    • @@ -155,6 +155,6 @@ maman_ibaz_do_action (MamanIbaz *self)

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/howto-signals.html b/docs/reference/gobject/html/howto-signals.html index c7c22e3..8221675 100644 --- a/docs/reference/gobject/html/howto-signals.html +++ b/docs/reference/gobject/html/howto-signals.html @@ -3,12 +3,12 @@ How to create and use signals - + - + @@ -28,7 +28,7 @@ flexible: it is possible for its users to connect at runtime any number of callbacks (implemented in any language for which a binding exists) - [14] + [14] to any signal and to stop the emission of any signal at any state of the signal emission process. This flexibility makes it possible to use GSignal for much more than just emit signals which @@ -109,13 +109,13 @@ maman_file_write (MamanFile *self,


    -

    [14] A Python callback can be connected to any signal on any +

    [14] A Python callback can be connected to any signal on any C-based GObject.

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/index.html b/docs/reference/gobject/html/index.html index 8096924..3c80ab9 100644 --- a/docs/reference/gobject/html/index.html +++ b/docs/reference/gobject/html/index.html @@ -3,10 +3,10 @@ GObject Reference Manual - + - + @@ -15,7 +15,7 @@

    - for GObject 2.24.2 + for GObject 2.27.5 The latest version of this documentation can be found on-line at http://library.gnome.org/devel/gobject/unstable/. @@ -29,7 +29,7 @@

    Background
    -
    Data types and programming
    +
    Data types and programming
    Exporting a C API
    The GLib Dynamic Type System
    @@ -61,8 +61,8 @@
    Closures
    -
    C Closures
    -
    Non-C closures (for the fearless)
    +
    C Closures
    +
    Non-C closures (for the fearless)
    Signals
    @@ -119,6 +119,9 @@ Value arrays — A container structure to maintain an array of generic values +
    +GBinding — Bind two object properties +
    III. Tools Reference
    @@ -142,9 +145,9 @@
    Object Destruction
    Object methods
    -
    Non-virtual public methods
    -
    Virtual public methods
    -
    Virtual private Methods
    +
    Non-virtual public methods
    +
    Virtual public methods
    +
    Virtual private Methods
    Chaining up
    @@ -178,10 +181,13 @@
    Index of new symbols in 2.18
    Index of new symbols in 2.22
    Index of new symbols in 2.24
    +
    Index of new symbols in 2.26
    +
    Index of new symbols in 2.28
    +
    Annotation Glossary
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/index.sgml b/docs/reference/gobject/html/index.sgml index 4633c90..fe59f90 100644 --- a/docs/reference/gobject/html/index.sgml +++ b/docs/reference/gobject/html/index.sgml @@ -1,3 +1,4 @@ + @@ -29,6 +30,7 @@ + @@ -114,6 +116,10 @@ + + + + @@ -136,6 +142,7 @@ + @@ -201,6 +208,7 @@ + @@ -213,6 +221,7 @@ + @@ -231,6 +240,7 @@ + @@ -299,8 +309,9 @@ - + + @@ -516,6 +527,16 @@ + + + + + + + + + + @@ -542,6 +563,7 @@ + @@ -656,6 +678,7 @@ + @@ -690,6 +713,7 @@ + @@ -709,6 +733,7 @@ + @@ -729,6 +754,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/gobject/html/pr01.html b/docs/reference/gobject/html/pr01.html index 48bc456..13d4501 100644 --- a/docs/reference/gobject/html/pr01.html +++ b/docs/reference/gobject/html/pr01.html @@ -3,12 +3,12 @@ Introduction - + - + @@ -21,7 +21,7 @@

    -Introduction

    +Introduction

    Most modern programming languages come with their own native object systems and additional fundamental algorithmic language constructs. @@ -67,6 +67,6 @@

    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/pt01.html b/docs/reference/gobject/html/pt01.html index 4f844f4..15d1592 100644 --- a/docs/reference/gobject/html/pt01.html +++ b/docs/reference/gobject/html/pt01.html @@ -3,12 +3,12 @@ Part I. Concepts - + - + @@ -21,13 +21,13 @@

    -Part I. Concepts

    +Part I. Concepts
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/pt02.html b/docs/reference/gobject/html/pt02.html index b73cb40..90604c9 100644 --- a/docs/reference/gobject/html/pt02.html +++ b/docs/reference/gobject/html/pt02.html @@ -3,12 +3,12 @@ Part IV. Tutorial - + - + @@ -21,7 +21,7 @@

    -Part IV. Tutorial

    +Part IV. Tutorial
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/pt03.html b/docs/reference/gobject/html/pt03.html index 5b5fc8f..f1e22d2 100644 --- a/docs/reference/gobject/html/pt03.html +++ b/docs/reference/gobject/html/pt03.html @@ -3,12 +3,12 @@ Part V. Related Tools - + - + @@ -21,7 +21,7 @@

    -Part V. Related Tools

    +Part V. Related Tools

    @@ -50,6 +50,6 @@

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/rn01.html b/docs/reference/gobject/html/rn01.html index 126d055..1863630 100644 --- a/docs/reference/gobject/html/rn01.html +++ b/docs/reference/gobject/html/rn01.html @@ -3,12 +3,12 @@ API Reference - + - + @@ -22,7 +22,7 @@

    -API Reference

    +API Reference

    @@ -72,11 +72,14 @@ Value arrays — A container structure to maintain an array of generic values +
    +GBinding — Bind two object properties +
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/rn02.html b/docs/reference/gobject/html/rn02.html index 0e5d47c..3020153 100644 --- a/docs/reference/gobject/html/rn02.html +++ b/docs/reference/gobject/html/rn02.html @@ -3,17 +3,17 @@ Tools Reference - + - + - + - + @@ -22,7 +22,7 @@

    -Tools Reference

    +Tools Reference

    @@ -42,6 +42,6 @@
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/signal.html b/docs/reference/gobject/html/signal.html index 426eb76..71833b7 100644 --- a/docs/reference/gobject/html/signal.html +++ b/docs/reference/gobject/html/signal.html @@ -3,12 +3,12 @@ Signals - + - + @@ -190,7 +190,7 @@ void g_signal_emitv (const GValue *instance_and_params, no accumulator was specified. If an accumulator was specified during signal creation, this accumulator is used to calculate the return_value as a function of the return values of all the closures invoked during emission. - [8] + [8] If no closure is invoked during emission, the return_value is nonetheless initialized to zero/null.

    @@ -271,8 +271,8 @@ void g_signal_emitv (const GValue *instance_and_params,

    Of the three main connection functions, - only one has an explicit detail parameter as a GQuark - [9]: + only one has an explicit detail parameter as a GQuark + [9]:

     gulong     g_signal_connect_closure_by_id          (gpointer          instance,
    @@ -306,7 +306,7 @@ gulong     g_signal_connect_data              (gpointer          instance,
     	  

    Of the four main signal emission functions, three have an explicit detail parameter as a - GQuark again: + GQuark again:

     void                  g_signal_emitv        (const GValue       *instance_and_params,
    @@ -356,7 +356,7 @@ void                  g_signal_emit_by_name (gpointer            instance,
     
     


    -

    [8] +

    [8] James (again!!) gives a few non-trivial examples of accumulators: “ For instance, you may have an accumulator that ignores NULL returns from @@ -364,7 +364,7 @@ void g_signal_emit_by_name (gpointer instance, to return the list of values returned by the closures. ”

    -

    [9] A GQuark is an integer which uniquely represents a string. It is possible to transform +

    [9] A GQuark is an integer which uniquely represents a string. It is possible to transform back and forth between the integer and string representations with the functions g_quark_from_string and g_quark_to_string.

    @@ -372,6 +372,6 @@ void g_signal_emit_by_name (gpointer instance,
    + Generated by GTK-Doc V1.15
    \ No newline at end of file diff --git a/docs/reference/gobject/html/style.css b/docs/reference/gobject/html/style.css index 82115eb..d544a2c 100644 --- a/docs/reference/gobject/html/style.css +++ b/docs/reference/gobject/html/style.css @@ -209,6 +209,14 @@ h2 .extralinks, h3 .extralinks font-weight: normal; } +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-size: 80%; + font-weight: normal; +} + /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ diff --git a/docs/reference/gobject/html/tools-ginspector.html b/docs/reference/gobject/html/tools-ginspector.html index 62d4ec6..0ce814e 100644 --- a/docs/reference/gobject/html/tools-ginspector.html +++ b/docs/reference/gobject/html/tools-ginspector.html @@ -3,12 +3,12 @@ Graphical inspection of GObjects - + - + @@ -30,6 +30,6 @@
    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/tools-gob.html b/docs/reference/gobject/html/tools-gob.html index 6d05410..0db9a91 100644 --- a/docs/reference/gobject/html/tools-gob.html +++ b/docs/reference/gobject/html/tools-gob.html @@ -3,12 +3,12 @@ GObject builder - + - + @@ -35,6 +35,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/tools-gtkdoc.html b/docs/reference/gobject/html/tools-gtkdoc.html index 0a06e2f..eb48009 100644 --- a/docs/reference/gobject/html/tools-gtkdoc.html +++ b/docs/reference/gobject/html/tools-gtkdoc.html @@ -3,12 +3,12 @@ Writing API docs - + - + @@ -51,13 +51,13 @@ gtk_widget_freeze_child_notify (GtkWidget *widget)

    Thorough - documentation - on how to set up and use gtk-doc in your - project is provided on the GNOME developer website. + documentation + on how to set up and use gtk-doc in your project is provided on the + GNOME developer website.

    + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/tools-refdb.html b/docs/reference/gobject/html/tools-refdb.html index fde0dc5..69dbd4e 100644 --- a/docs/reference/gobject/html/tools-refdb.html +++ b/docs/reference/gobject/html/tools-refdb.html @@ -3,12 +3,12 @@ Debugging reference count problems - + - + @@ -50,6 +50,6 @@ static volatile GObject *g_trap_object_ref; + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/html/tools-vala.html b/docs/reference/gobject/html/tools-vala.html index 2ae0685..508ea45 100644 --- a/docs/reference/gobject/html/tools-vala.html +++ b/docs/reference/gobject/html/tools-vala.html @@ -3,12 +3,12 @@ Vala - + - + @@ -38,6 +38,6 @@ + Generated by GTK-Doc V1.15 \ No newline at end of file diff --git a/docs/reference/gobject/tmpl/enumerations_flags.sgml b/docs/reference/gobject/tmpl/enumerations_flags.sgml index 8d6f5c2..8f4ef47 100644 --- a/docs/reference/gobject/tmpl/enumerations_flags.sgml +++ b/docs/reference/gobject/tmpl/enumerations_flags.sgml @@ -9,13 +9,11 @@ Enumeration and Flag Types - - diff --git a/docs/reference/gobject/tmpl/gbinding.sgml b/docs/reference/gobject/tmpl/gbinding.sgml new file mode 100644 index 0000000..e7485ef --- /dev/null +++ b/docs/reference/gobject/tmpl/gbinding.sgml @@ -0,0 +1,165 @@ + +gbinding + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@G_BINDING_DEFAULT: +@G_BINDING_BIDIRECTIONAL: +@G_BINDING_SYNC_CREATE: +@G_BINDING_INVERT_BOOLEAN: + + + + + + +@binding: +@Returns: + + + + + + + +@binding: +@Returns: + + + + + + + +@binding: +@Returns: + + + + + + + +@binding: +@Returns: + + + + + + + +@binding: +@Returns: + + + + + + + +@source: +@source_property: +@target: +@target_property: +@flags: +@Returns: + + + + + + + +@binding: +@source_value: +@target_value: +@user_data: +@Returns: + + + + + + + +@source: +@source_property: +@target: +@target_property: +@flags: +@transform_to: +@transform_from: +@user_data: +@notify: +@Returns: + + + + + + + +@source: +@source_property: +@target: +@target_property: +@flags: +@transform_to: +@transform_from: +@Returns: + + diff --git a/docs/reference/gobject/tmpl/gboxed.sgml b/docs/reference/gobject/tmpl/gboxed.sgml index 9d79e18..d40056a 100644 --- a/docs/reference/gobject/tmpl/gboxed.sgml +++ b/docs/reference/gobject/tmpl/gboxed.sgml @@ -9,13 +9,11 @@ Boxed Types - - @@ -134,14 +132,21 @@ Boxed Types - + - + + + + + + + + diff --git a/docs/reference/gobject/tmpl/gclosure.sgml b/docs/reference/gobject/tmpl/gclosure.sgml index 0927037..a13d2ea 100644 --- a/docs/reference/gobject/tmpl/gclosure.sgml +++ b/docs/reference/gobject/tmpl/gclosure.sgml @@ -9,13 +9,11 @@ Closures - - @@ -294,6 +292,14 @@ Closures @closure: + + + + + +@source: + + @@ -529,6 +535,19 @@ Closures @marshal_data: + + + + + +@closure: +@return_value: +@n_param_values: +@param_values: +@invocation_hint: +@marshal_data: + + diff --git a/docs/reference/gobject/tmpl/generic_values.sgml b/docs/reference/gobject/tmpl/generic_values.sgml index 71a1cfa..2ee39c5 100644 --- a/docs/reference/gobject/tmpl/generic_values.sgml +++ b/docs/reference/gobject/tmpl/generic_values.sgml @@ -9,13 +9,11 @@ Generic values - - diff --git a/docs/reference/gobject/tmpl/gobject-unused.sgml b/docs/reference/gobject/tmpl/gobject-unused.sgml index 48f8a2e..e69de29 100644 --- a/docs/reference/gobject/tmpl/gobject-unused.sgml +++ b/docs/reference/gobject/tmpl/gobject-unused.sgml @@ -1,87 +0,0 @@ - - -The predefined identifiers of the reserved fundamental types. - - -@G_TYPE_INVALID: Usually a return value indicating an error. -@G_TYPE_NONE: A synonym for the "void" type in C. -@G_TYPE_INTERFACE: Root type of all interface types. -@G_TYPE_CHAR: Identifier for the built-in type "gchar". -@G_TYPE_UCHAR: Identifier for the built-in type "guchar". -@G_TYPE_BOOLEAN: Identifier for the built-in type "gboolean". -@G_TYPE_INT: Identifier for the built-in type "gint". -@G_TYPE_UINT: Identifier for the built-in type "guint". -@G_TYPE_LONG: Identifier for the built-in type "glong". -@G_TYPE_ULONG: Identifier for the built-in type "gulong". -@G_TYPE_INT64: -@G_TYPE_UINT64: -@G_TYPE_ENUM: Identifier for the "#GEnum" type. -@G_TYPE_FLAGS: Identifier for the "#GFlags" type. -@G_TYPE_FLOAT: Identifier for the built-in type "gfloat". -@G_TYPE_DOUBLE: Identifier for the built-in type "gdouble". -@G_TYPE_STRING: Identifier for a pointer to a null-terminated string "gchar*". -@G_TYPE_POINTER: Identifier for anonymous pointers "void*". -@G_TYPE_BOXED: Identifier for the "#GBoxed" type. -@G_TYPE_PARAM: Identifier for the "#GParam" type. -@G_TYPE_OBJECT: Identifier for the "#GObject" type. -@G_TYPE_RESERVED_BSE_FIRST: First fundamental type ID reserved for BSE. -@G_TYPE_RESERVED_BSE_LAST: Last fundamental type ID reserved for BSE. -@G_TYPE_RESERVED_LAST_FUNDAMENTAL: -@G_TYPE_CONSTANT_TYPES: -@G_TYPE_CLOSURE: -@G_TYPE_VALUE: -@G_TYPE_VALUE_ARRAY: -@G_TYPE_GSTRING: -@G_TYPE_PARAM_CHAR: -@G_TYPE_PARAM_UCHAR: -@G_TYPE_PARAM_BOOLEAN: -@G_TYPE_PARAM_INT: -@G_TYPE_PARAM_UINT: -@G_TYPE_PARAM_LONG: -@G_TYPE_PARAM_ULONG: -@G_TYPE_PARAM_INT64: -@G_TYPE_PARAM_UINT64: -@G_TYPE_PARAM_UNICHAR: -@G_TYPE_PARAM_ENUM: -@G_TYPE_PARAM_FLAGS: -@G_TYPE_PARAM_FLOAT: -@G_TYPE_PARAM_DOUBLE: -@G_TYPE_PARAM_STRING: -@G_TYPE_PARAM_PARAM: -@G_TYPE_PARAM_BOXED: -@G_TYPE_PARAM_POINTER: -@G_TYPE_PARAM_VALUE_ARRAY: -@G_TYPE_PARAM_CLOSURE: -@G_TYPE_PARAM_OBJECT: - - - -Determines whether a given set of #GTypeFlags and #GTypeFundamentalFlags -are set for @type. - - -@type: The type to check for flags. -@flags: Bitwise combination of #GTypeFlags and #GTypeFundamentalFlags. -@Returns: #TRUE if all @flags are set for @type, #FALSE otherwise. - - - -Determines if @instance adheres to the interface exported -by @iface_type. @iface_type is either a type that @instance -is derived from, or an interface type that is supported by -the anchestry of @instance. - - -@instance: A valid #GTypeInstance structure. -@iface_type: A #GType value. -@Returns: #TRUE if @instance conforms to @iface_type, #FALSE otherwise. - - - -Determines if @value is a #GValue whose type conforms to @type. - - -@value: A valid #GValue structure. -@type: A #GType value. -@Returns: #TRUE if @value is a #GValue of @type or #FALSE if not. - diff --git a/docs/reference/gobject/tmpl/gparamspec.sgml b/docs/reference/gobject/tmpl/gparamspec.sgml index 70aba3b..4a9ecbb 100644 --- a/docs/reference/gobject/tmpl/gparamspec.sgml +++ b/docs/reference/gobject/tmpl/gparamspec.sgml @@ -9,13 +9,11 @@ GParamSpec - - @@ -131,6 +129,7 @@ GParamSpec @G_PARAM_PRIVATE: @G_PARAM_STATIC_NICK: @G_PARAM_STATIC_BLURB: +@G_PARAM_DEPRECATED: diff --git a/docs/reference/gobject/tmpl/gtype.sgml b/docs/reference/gobject/tmpl/gtype.sgml index 3e796ca..f2ab667 100644 --- a/docs/reference/gobject/tmpl/gtype.sgml +++ b/docs/reference/gobject/tmpl/gtype.sgml @@ -9,13 +9,11 @@ Type Information - - @@ -249,6 +247,16 @@ Type Information @c_type: + + + + + +@klass: +@g_type: +@c_type: + + @@ -956,6 +964,48 @@ Type Information @_C_: + + + + + +@TypeName: +@type_name: +@copy_func: +@free_func: + + + + + + + +@TypeName: +@type_name: +@copy_func: +@free_func: +@_C_: + + + + + + + +@TypeName: +@type_name: + + + + + + + +@TypeName: +@type_name: +@_C_: + + @@ -1110,6 +1160,13 @@ Type Information + + + + + + + diff --git a/docs/reference/gobject/tmpl/gtypemodule.sgml b/docs/reference/gobject/tmpl/gtypemodule.sgml index 2b3bef6..5975a60 100644 --- a/docs/reference/gobject/tmpl/gtypemodule.sgml +++ b/docs/reference/gobject/tmpl/gtypemodule.sgml @@ -9,13 +9,11 @@ GTypeModule - - diff --git a/docs/reference/gobject/tmpl/gtypeplugin.sgml b/docs/reference/gobject/tmpl/gtypeplugin.sgml index d68687e..e410468 100644 --- a/docs/reference/gobject/tmpl/gtypeplugin.sgml +++ b/docs/reference/gobject/tmpl/gtypeplugin.sgml @@ -9,13 +9,11 @@ GTypePlugin - - diff --git a/docs/reference/gobject/tmpl/objects.sgml b/docs/reference/gobject/tmpl/objects.sgml index 327e922..012dc9c 100644 --- a/docs/reference/gobject/tmpl/objects.sgml +++ b/docs/reference/gobject/tmpl/objects.sgml @@ -9,13 +9,11 @@ The Base Object Type - - @@ -179,6 +177,16 @@ The Base Object Type @pspec: + + + + + +@oclass: +@n_pspecs: +@pspecs: + + @@ -294,6 +302,14 @@ The Base Object Type @Returns: + + + + + +@object_ptr: + + @@ -457,6 +473,15 @@ The Base Object Type @property_name: + + + + + +@object: +@pspec: + + diff --git a/docs/reference/gobject/tmpl/param_value_types.sgml b/docs/reference/gobject/tmpl/param_value_types.sgml index 25a4c00..4d416a9 100644 --- a/docs/reference/gobject/tmpl/param_value_types.sgml +++ b/docs/reference/gobject/tmpl/param_value_types.sgml @@ -9,13 +9,11 @@ Standard Parameter and Value Types - - @@ -1658,3 +1656,93 @@ Standard Parameter and Value Types @v_gtype: + + + + + +@pspec: + + + + + + + +@pspec: + + + + + + + +@value: + + + + + + + + + + + + + + +@parent_instance: +@type: +@default_value: + + + + + + +@name: +@nick: +@blurb: +@type: +@default_value: +@flags: +@Returns: + + + + + + + +@value: +@Returns: + + + + + + + +@value: +@Returns: + + + + + + + +@value: +@variant: + + + + + + + +@value: +@variant: + + diff --git a/docs/reference/gobject/tmpl/signals.sgml b/docs/reference/gobject/tmpl/signals.sgml index af57b57..3b7ea33 100644 --- a/docs/reference/gobject/tmpl/signals.sgml +++ b/docs/reference/gobject/tmpl/signals.sgml @@ -9,13 +9,11 @@ Signals - - @@ -616,6 +614,18 @@ Signals @Returns: + + + + + +@ihint: +@return_accu: +@handler_return: +@dummy: +@Returns: + + diff --git a/docs/reference/gobject/tmpl/value_arrays.sgml b/docs/reference/gobject/tmpl/value_arrays.sgml index d116c07..c19652a 100644 --- a/docs/reference/gobject/tmpl/value_arrays.sgml +++ b/docs/reference/gobject/tmpl/value_arrays.sgml @@ -9,13 +9,11 @@ Value arrays - - diff --git a/docs/reference/gobject/tmpl/value_collection.sgml b/docs/reference/gobject/tmpl/value_collection.sgml index 74477b6..13b0f30 100644 --- a/docs/reference/gobject/tmpl/value_collection.sgml +++ b/docs/reference/gobject/tmpl/value_collection.sgml @@ -9,13 +9,11 @@ Varargs Value Collection - - diff --git a/docs/reference/gobject/tut_gobject.xml b/docs/reference/gobject/tut_gobject.xml index 4c5e707..edeb6ea 100644 --- a/docs/reference/gobject/tut_gobject.xml +++ b/docs/reference/gobject/tut_gobject.xml @@ -8,11 +8,11 @@ The two previous chapters discussed the details of GLib's Dynamic Type System and its signal control system. The GObject library also contains an implementation - for a base fundamental type named GObject. + for a base fundamental type named GObject. - GObject is a fundamental classed instantiable type. It implements: + GObject is a fundamental classed instantiable type. It implements: Memory management with reference counting Construction/Destruction of instances @@ -20,7 +20,7 @@ Easy use of signals All the GNOME libraries which use the GLib type system (like GTK+ and GStreamer) - inherit from GObject which is why it is important to understand + inherit from GObject which is why it is important to understand the details of how it works. @@ -97,10 +97,7 @@ maman_bar_constructor (GType gtype, { /* Always chain up to the parent constructor */ - MamanBarClass *klass; - GObjectClass *parent_class; - parent_class = G_OBJECT_CLASS (maman_bar_parent_class); - obj = parent_class->constructor (gtype, n_properties, properties); + obj = G_OBJECT_CLASS (maman_bar_parent_class)->constructor (gtype, n_properties, properties); } /* update the object state depending on constructor properties */ @@ -459,7 +456,7 @@ void g_object_run_dispose (GObject *object); This two-step destruction process is very useful to break reference counting cycles. While the detection of the cycles is up to the external code, once the cycles have been - detected, the external code can invoke g_object_dispose which + detected, the external code can invoke g_object_run_dispose which will indeed break any existing cycles since it will run the dispose handler associated to the object and thus release all references to other objects. @@ -469,7 +466,7 @@ void g_object_run_dispose (GObject *object); we stated a bit sooner: the dispose handler can be invoked multiple times. Let's say we have a reference count cycle: object A references B which itself references object A. Let's say we have detected the cycle and we want to destroy the two objects. One way to - do this would be to invoke g_object_dispose on one of the + do this would be to invoke g_object_run_dispose on one of the objects. @@ -644,13 +641,14 @@ g_value_unset (&val); - After transformation, the GValue is validated by + After transformation, the GValue is validated by g_param_value_validate which makes sure the user's - data stored in the GValue matches the characteristics specified by - the property's GParamSpec. Here, the GParamSpec we + data stored in the GValue matches the characteristics specified by + the property's GParamSpec. + Here, the GParamSpec we provided in class_init has a validation function which makes sure that the GValue contains a value which respects the minimum and maximum bounds of the - GParamSpec. In the example above, the client's GValue does not + GParamSpec. In the example above, the client's GValue does not respect these constraints (it is set to 11, while the maximum is 10). As such, the g_object_set_property function will return with an error. @@ -660,11 +658,11 @@ g_value_unset (&val); would have proceeded with calling the object's set_property class method. Here, since our implementation of Foo did override this method, the code path would jump to foo_set_property after having retrieved from the - GParamSpec the param_id + GParamSpec the param_id It should be noted that the param_id used here need only to uniquely identify each - GParamSpec within the FooClass such that the switch + GParamSpec within the FooClass such that the switch used in the set and get methods actually works. Of course, this locally-unique integer is purely an optimization: it would have been possible to use a set of if (strcmp (a, b) == 0) {} else if (strcmp (a, b) == 0) {} statements. diff --git a/docs/reference/gobject/tut_gsignal.xml b/docs/reference/gobject/tut_gsignal.xml index 80f537a..87f6c75 100644 --- a/docs/reference/gobject/tut_gsignal.xml +++ b/docs/reference/gobject/tut_gsignal.xml @@ -31,7 +31,7 @@ return_type function_callback (... , gpointer user_data); - The GClosure structure represents the common functionality of all + The GClosure structure represents the common functionality of all closure implementations: there exists a different Closure implementation for each separate runtime which wants to use the GObject type system. @@ -42,11 +42,11 @@ return_type function_callback (... , gpointer user_data); it behaves as a normal C object for GTK+ and as a normal Python object for Python code. - The GObject library provides a simple GCClosure type which + The GObject library provides a simple GCClosure type which is a specific implementation of closures to be used with C/C++ callbacks. - A GClosure provides simple services: + A GClosure provides simple services: Invocation (g_closure_invoke): this is what closures @@ -77,7 +77,7 @@ return_type function_callback (... , gpointer user_data); If you are using C or C++ - to connect a callback to a given event, you will either use simple GCClosures + to connect a callback to a given event, you will either use simple GCClosures which have a pretty minimal API or the even simpler g_signal_connect functions (which will be presented a bit later :). @@ -432,7 +432,7 @@ void g_signal_emitv (const GValue *instance_and_params, Of the three main connection functions, - only one has an explicit detail parameter as a GQuark + only one has an explicit detail parameter as a GQuark A GQuark is an integer which uniquely represents a string. It is possible to transform back and forth between the integer and string representations with the functions @@ -469,7 +469,7 @@ gulong g_signal_connect_data (gpointer instance, Of the four main signal emission functions, three have an explicit detail parameter as a - GQuark again: + GQuark again: void g_signal_emitv (const GValue *instance_and_params, guint signal_id, diff --git a/docs/reference/gobject/tut_gtype.xml b/docs/reference/gobject/tut_gtype.xml index b4df241..133b5ae 100644 --- a/docs/reference/gobject/tut_gtype.xml +++ b/docs/reference/gobject/tut_gtype.xml @@ -49,7 +49,7 @@ GType g_type_register_fundamental (GType type_id, g_type_register_fundamental are the C functions, defined in gtype.h and implemented in gtype.c - which you should use to register a new GType in the program's type system. + which you should use to register a new GType in the program's type system. It is not likely you will ever need to use g_type_register_fundamental (you have to be Tim Janik to do that) but in case you want to, the last chapter explains how to create @@ -77,34 +77,34 @@ GType g_type_register_fundamental (GType type_id, Fundamental and non-fundamental types are defined by: - class size: the class_size field in GTypeInfo. + class size: the class_size field in GTypeInfo. class initialization functions (C++ constructor): the base_init and - class_init fields in GTypeInfo. + class_init fields in GTypeInfo. class destruction functions (C++ destructor): the base_finalize and - class_finalize fields in GTypeInfo. + class_finalize fields in GTypeInfo. instance size (C++ parameter to new): the instance_size field in - GTypeInfo. + GTypeInfo. instantiation policy (C++ type of new operator): the n_preallocs - field in GTypeInfo. + field in GTypeInfo. copy functions (C++ copy operators): the value_table field in - GTypeInfo. + GTypeInfo. - type characteristic flags: GTypeFlags. + type characteristic flags: GTypeFlags. - Fundamental types are also defined by a set of GTypeFundamentalFlags - which are stored in a GTypeFundamentalInfo. + Fundamental types are also defined by a set of GTypeFundamentalFlags + which are stored in a GTypeFundamentalInfo. Non-fundamental types are furthermore defined by the type of their parent which is passed as the parent_type parameter to g_type_register_static and g_type_register_dynamic. @@ -120,17 +120,17 @@ GType g_type_register_fundamental (GType type_id, - The GValue structure is used as an abstract container for all of these + The GValue structure is used as an abstract container for all of these types. Its simplistic API (defined in gobject/gvalue.h) can be used to invoke the value_table functions registered during type registration: for example g_value_copy copies the - content of a GValue to another GValue. This is similar + content of a GValue to another GValue. This is similar to a C++ assignment which invokes the C++ copy operator to modify the default bit-by-bit copy semantics of C++/C structures/classes. - The following code shows how you can copy around a 64 bit integer, as well as a GObject + The following code shows how you can copy around a 64 bit integer, as well as a GObject instance pointer (sample code for this is located in the source tarball for this document in sample/gtype/test.c): @@ -342,7 +342,7 @@ G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT) To register such a type in the type system, you just need to fill the - GTypeInfo structure with zeros since these types are also most of the time + GTypeInfo structure with zeros since these types are also most of the time fundamental: GTypeInfo info = { @@ -376,9 +376,9 @@ G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT) Having non-instantiable types might seem a bit useless: what good is a type if you cannot instantiate an instance of that type ? Most of these types - are used in conjunction with GValues: a GValue is initialized + are used in conjunction with GValues: a GValue is initialized with an integer or a string and it is passed around by using the registered - type's value_table. GValues (and by extension these trivial fundamental + type's value_table. GValues (and by extension these trivial fundamental types) are most useful when used in conjunction with object properties and signals. @@ -390,7 +390,7 @@ G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT) Types which are registered with a class and are declared instantiable are what most closely resembles an object. - Although GObjects (detailed in ) + Although GObjects (detailed in ) are the most well known type of instantiable classed types, other kinds of similar objects used as the base of an inheritance hierarchy have been externally developed and they are all built on the fundamental @@ -448,8 +448,8 @@ maman_bar_get_type (void) Every object must define two structures: its class structure and its instance structure. All class structures must contain as first member - a GTypeClass structure. All instance structures must contain as first - member a GTypeInstance structure. The declaration of these C types, + a GTypeClass structure. All instance structures must contain as first + member a GTypeInstance structure. The declaration of these C types, coming from gtype.h is shown below: struct _GTypeClass @@ -537,9 +537,9 @@ void g_type_free_instance (GTypeInstance *instance); a class structure: it allocates a buffer to hold the object's class structure and initializes it. It first copies the parent's class structure over this structure (if there is no parent, it initializes it to zero). It then invokes the - base_class_initialization functions (GBaseInitFunc) from topmost + base_class_initialization functions (GBaseInitFunc) from topmost fundamental object to bottom-most most derived object. The object's class_init - (GClassInitFunc) function is invoked afterwards to complete + (GClassInitFunc) function is invoked afterwards to complete initialization of the class structure. Finally, the object's interfaces are initialized (we will discuss interface initialization in more detail later). @@ -548,7 +548,7 @@ void g_type_free_instance (GTypeInstance *instance); Once the type system has a pointer to an initialized class structure, it sets the object's instance class pointer to the object's class structure and invokes the object's - instance_init (GInstanceInitFunc)functions, from top-most fundamental + instance_init (GInstanceInitFunc)functions, from top-most fundamental type to bottom-most most derived type. @@ -564,8 +564,8 @@ void g_type_free_instance (GTypeInstance *instance); referred to as finalization in GType) is the symmetric process of the initialization: interfaces are destroyed first. Then, the most derived - class_finalize (ClassFinalizeFunc) function is invoked. The - base_class_finalize (GBaseFinalizeFunc) functions are + class_finalize (ClassFinalizeFunc) function is invoked. The + base_class_finalize (GBaseFinalizeFunc) functions are Finally invoked from bottom-most most-derived type to top-most fundamental type and the class structure is freed. @@ -659,12 +659,12 @@ void g_type_free_instance (GTypeInstance *instance); control your CD player, MP3 player or anything that uses these symbols. To declare an interface you have to register a non-instantiable classed type which derives from - GTypeInterface. The following piece of code declares such an interface. + GTypeInterface. The following piece of code declares such an interface. -#define MAMAN_IBAZ_TYPE (maman_ibaz_get_type ()) -#define MAMAN_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_IBAZ_TYPE, MamanIbaz)) -#define MAMAN_IS_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_IBAZ_TYPE)) -#define MAMAN_IBAZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MAMAN_IBAZ_TYPE, MamanIbazInterface)) +#define MAMAN_TYPE_IBAZ (maman_ibaz_get_type ()) +#define MAMAN_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_IBAZ, MamanIbaz)) +#define MAMAN_IS_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_IBAZ)) +#define MAMAN_IBAZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MAMAN_TYPE_IBAZ, MamanIbazInterface)) typedef struct _MamanIbaz MamanIbaz; /* dummy object */ typedef struct _MamanIbazInterface MamanIbazInterface; @@ -694,7 +694,7 @@ void maman_ibaz_do_action (MamanIbaz *self) An interface is defined by only one structure which must contain as first member - a GTypeInterface structure. The interface structure is expected to + a GTypeInterface structure. The interface structure is expected to contain the function pointers of the interface methods. It is good style to define helper functions for each of the interface methods which simply call the interface' method directly: maman_ibaz_do_action @@ -704,7 +704,7 @@ void maman_ibaz_do_action (MamanIbaz *self) Once an interface type is registered, you must register implementations for these interfaces. The function named maman_baz_get_type registers - a new GType named MamanBaz which inherits from GObject and which + a new GType named MamanBaz which inherits from GObject and which implements the interface MamanIBaz. static void maman_baz_do_action (MamanIbaz *self) @@ -746,7 +746,7 @@ maman_baz_get_type (void) "MamanBazType", &info, 0); g_type_add_interface_static (type, - MAMAN_IBAZ_TYPE, + MAMAN_TYPE_IBAZ, &ibaz_info); } return type; @@ -759,7 +759,7 @@ maman_baz_get_type (void) a given type implements also FooInterface (foo_interface_get_type returns the type of FooInterface). - The GInterfaceInfo structure holds + The GInterfaceInfo structure holds information about the implementation of the interface: struct _GInterfaceInfo diff --git a/docs/reference/gobject/tut_howto.xml b/docs/reference/gobject/tut_howto.xml index d428168..aefed0d 100644 --- a/docs/reference/gobject/tut_howto.xml +++ b/docs/reference/gobject/tut_howto.xml @@ -57,8 +57,8 @@ mamanbar.h and mamanbar.c. (this is the convention used by GTK+) - I personally like the first solution better: it makes reading file names - easier for those with poor eyesight like me. + Some people like the first two solutions better: it makes reading file + names easier for those with poor eyesight. @@ -339,26 +339,26 @@ maman_bar_init (MamanBar *self) Now, if you need special construction properties, install the properties in the class_init function, override the set and get methods and implement the get and set methods as described in . Make sure that these properties use a construct only - GParamSpec by setting the param spec's flag field to G_PARAM_CONSTRUCT_ONLY: this helps + GParamSpec by setting the param spec's flag field to G_PARAM_CONSTRUCT_ONLY: this helps GType ensure that these properties are not set again later by malicious user code. static void bar_class_init (MamanBarClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GParamSpec *maman_param_spec; + GParamSpec *pspec; gobject_class->set_property = bar_set_property; gobject_class->get_property = bar_get_property; - maman_param_spec = g_param_spec_string ("maman", + pspec = g_param_spec_string ("maman", "Maman construct prop", "Set maman's name", "no-name-set" /* default value */, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); g_object_class_install_property (gobject_class, PROP_MAMAN, - maman_param_spec); + pspec); } If you need this, make sure you can build and run code similar to the code shown above. Make sure @@ -820,8 +820,8 @@ void maman_ibaz_do_action (MamanIbaz *self); #endif /* __MAMAN_IBAZ_H__ */ - This code is the same as the code for a normal GType - which derives from a GObject except for a few details: + This code is the same as the code for a normal GType + which derives from a GObject except for a few details: The _GET_CLASS macro is called _GET_INTERFACE @@ -1652,7 +1652,7 @@ klass->write_signal_id = Usually, the g_signal_new function is preferred over g_signal_newv. When g_signal_new is used, the default closure is exported as a class function. For example, - gobject.h contains the declaration of GObjectClass + gobject.h contains the declaration of GObjectClass whose notify class function is the default handler for the notify signal: @@ -1693,7 +1693,7 @@ g_object_do_class_init (GObjectClass *class) 1, G_TYPE_PARAM); } - g_signal_new creates a GClosure which dereferences the + g_signal_new creates a GClosure which dereferences the type's class structure to access the class function pointer and invoke it if it not NULL. The class function is ignored it is set to NULL. diff --git a/docs/reference/gobject/tut_tools.xml b/docs/reference/gobject/tut_tools.xml index b344abb..e74fe59 100644 --- a/docs/reference/gobject/tut_tools.xml +++ b/docs/reference/gobject/tut_tools.xml @@ -124,9 +124,9 @@ gtk_widget_freeze_child_notify (GtkWidget *widget) Thorough - documentation - on how to set up and use gtk-doc in your - project is provided on the GNOME developer website. + documentation + on how to set up and use gtk-doc in your project is provided on the + GNOME developer website. diff --git a/docs/reference/gobject/version.xml b/docs/reference/gobject/version.xml index 5827d9b..474d182 100644 --- a/docs/reference/gobject/version.xml +++ b/docs/reference/gobject/version.xml @@ -1 +1 @@ -2.24.2 +2.27.5 diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in index 6550377..92cda85 100644 --- a/gio-2.0.pc.in +++ b/gio-2.0.pc.in @@ -4,6 +4,7 @@ libdir=@libdir@ includedir=@includedir@ giomoduledir=@GIO_MODULE_DIR@ +glib_compile_schemas=@bindir@/glib-compile-schemas Name: GIO Description: glib I/O library diff --git a/gio-windows-2.0.pc.in b/gio-windows-2.0.pc.in new file mode 100644 index 0000000..77eecdf --- /dev/null +++ b/gio-windows-2.0.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: GIO Windows specific APIs +Description: Windows specific headers for glib I/O library +Version: @VERSION@ +Requires: gobject-2.0,gmodule-no-export-2.0,gio-2.0 +Libs: -L${libdir} -lgio-2.0 +Cflags: -I${includedir}/gio-win32-2.0/ diff --git a/gio/Makefile.am b/gio/Makefile.am index 188e9ec..e0b352e 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -24,20 +24,12 @@ uninstall-ms-lib: $(uninstall_ms_lib_cmd) gio.def: gio.symbols - (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \ + $(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \ mv gio.def.tmp gio.def -gioalias.h: gio.symbols - $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \ - mv gioalias.h.tmp gioalias.h - -gioaliasdef.c: gio.symbols - $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c.tmp && \ - mv gioaliasdef.c.tmp gioaliasdef.c - if OS_LINUX if HAVE_GNUC_VISIBILITY -TESTS = abicheck.sh pltcheck.sh +TESTS = abicheck.sh endif endif @@ -47,10 +39,7 @@ endif AM_CPPFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ + $(gmodule_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ $(THREAD_FLAGS) \ -DG_DISABLE_DEPRECATED \ @@ -71,14 +60,98 @@ else endif gio-marshal.h: gio-marshal.list - $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \ + $(AM_V_GEN) $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \ mv $@.tmp $@ gio-marshal.c: gio-marshal.h gio-marshal.list - (echo "#include \"gio-marshal.h\""; \ + $(AM_V_GEN) (echo "#include \"gio-marshal.h\""; \ $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \ mv $@.tmp $@ +gdbus_headers = \ + gdbusauthobserver.h \ + gcredentials.h \ + gdbusutils.h \ + gdbuserror.h \ + gdbusaddress.h \ + gdbusconnection.h \ + gdbusmessage.h \ + gdbusnameowning.h \ + gdbusnamewatching.h \ + gdbusproxy.h \ + gdbusintrospection.h \ + gdbusmethodinvocation.h \ + gdbusserver.h \ + $(NULL) + +gdbus_sources = \ + gdbusutils.h gdbusutils.c \ + gdbusaddress.h gdbusaddress.c \ + gdbusauthobserver.h gdbusauthobserver.c \ + gdbusauth.h gdbusauth.c \ + gdbusauthmechanism.h gdbusauthmechanism.c \ + gdbusauthmechanismanon.h gdbusauthmechanismanon.c \ + gdbusauthmechanismexternal.h gdbusauthmechanismexternal.c \ + gdbusauthmechanismsha1.h gdbusauthmechanismsha1.c \ + gdbuserror.h gdbuserror.c \ + gdbusconnection.h gdbusconnection.c \ + gdbusmessage.h gdbusmessage.c \ + gdbusnameowning.h gdbusnameowning.c \ + gdbusnamewatching.h gdbusnamewatching.c \ + gdbusproxy.h gdbusproxy.c \ + gdbusprivate.h gdbusprivate.c \ + gdbusintrospection.h gdbusintrospection.c \ + gdbusmethodinvocation.h gdbusmethodinvocation.c \ + gdbusserver.h gdbusserver.c \ + $(NULL) + +settings_headers = \ + gsettingsbackend.h \ + gsettings.h + +settings_sources = \ + gvdb/gvdb-format.h \ + gvdb/gvdb-reader.h \ + gvdb/gvdb-reader.c \ + gdelayedsettingsbackend.h \ + gdelayedsettingsbackend.c \ + gkeyfilesettingsbackend.c \ + gmemorysettingsbackend.h \ + gmemorysettingsbackend.c \ + gnullsettingsbackend.h \ + gnullsettingsbackend.c \ + gsettingsbackendinternal.h \ + gsettingsbackend.c \ + gsettingsschema.h \ + gsettingsschema.c \ + gsettings-mapping.h \ + gsettings-mapping.c \ + gsettings.c + +if OS_WIN32 +settings_sources += \ + gregistrysettingsbackend.h \ + gregistrysettingsbackend.c +endif + +application_headers = \ + gactiongroup.h \ + gsimpleactiongroup.h \ + gaction.h \ + gsimpleaction.h \ + gapplicationcommandline.h \ + gapplication.h + +application_sources = \ + gactiongroup.c \ + gsimpleactiongroup.c \ + gaction.c \ + gsimpleaction.c \ + gapplicationcommandline.c \ + gapplicationimpl.h \ + gapplicationimpl-dbus.c \ + gapplication.c + local_sources = \ glocaldirectorymonitor.c \ glocaldirectorymonitor.h \ @@ -98,6 +171,12 @@ local_sources = \ glocalfileiostream.h \ glocalvfs.c \ glocalvfs.h \ + gsocks4proxy.c \ + gsocks4proxy.h \ + gsocks4aproxy.c \ + gsocks4aproxy.h \ + gsocks5proxy.c \ + gsocks5proxy.h \ $(NULL) platform_libadd = @@ -123,7 +202,6 @@ platform_libadd += win32/libgiowin32.la platform_deps += win32/libgiowin32.la endif - SUBDIRS += . if HAVE_FAM @@ -131,17 +209,18 @@ SUBDIRS += fam endif if OS_UNIX -appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h +appinfo_sources += gdesktopappinfo.c platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la unix_sources = \ + gfiledescriptorbased.c \ gunixconnection.c \ + gunixcredentialsmessage.c \ gunixfdlist.c \ gunixfdmessage.c \ gunixmount.c \ gunixmount.h \ gunixmounts.c \ - gunixmounts.h \ gunixresolver.c \ gunixresolver.h \ gunixsocketaddress.c \ @@ -159,6 +238,7 @@ giounixinclude_HEADERS = \ gdesktopappinfo.h \ gfiledescriptorbased.h \ gunixconnection.h \ + gunixcredentialsmessage.h \ gunixmounts.h \ gunixfdlist.h \ gunixfdmessage.h \ @@ -168,16 +248,16 @@ giounixinclude_HEADERS = \ $(NULL) endif -if OS_WIN32 -appinfo_sources += gwin32appinfo.c gwin32appinfo.h -platform_libadd += -lshlwapi -lws2_32 -ldnsapi -win32_sources = \ +win32_actual_sources = \ gwin32mount.c \ gwin32mount.h \ gwin32resolver.c \ gwin32resolver.h \ gwin32volumemonitor.c \ gwin32volumemonitor.h \ + gwin32inputstream.c \ + gwin32outputstream.c \ + gwin32outputstream.h \ $(NULL) win32_more_sources_for_vcproj = \ @@ -188,6 +268,17 @@ win32_more_sources_for_vcproj = \ win32/gwinhttpfileoutputstream.c \ win32/gwinhttpvfs.c +if OS_WIN32 +appinfo_sources += gwin32appinfo.c gwin32appinfo.h +platform_libadd += -lshlwapi -lws2_32 -ldnsapi +win32_sources = $(win32_actual_sources) + +giowin32includedir=$(includedir)/gio-win32-2.0/gio +giowin32include_HEADERS = \ + gwin32inputstream.h \ + gwin32outputstream.h \ + $(NULL) + endif SUBDIRS += tests @@ -207,11 +298,16 @@ libgio_2_0_la_SOURCES = \ gconverter.c \ gconverterinputstream.c \ gconverteroutputstream.c \ + gcredentials.c \ gdatainputstream.c \ gdataoutputstream.c \ gdrive.c \ gdummyfile.h \ gdummyfile.c \ + gdummyproxyresolver.c \ + gdummyproxyresolver.h \ + gdummytlsbackend.c \ + gdummytlsbackend.h \ gemblem.h \ gemblem.c \ gemblemedicon.h \ @@ -219,8 +315,6 @@ libgio_2_0_la_SOURCES = \ gfile.c \ gfileattribute.c \ gfileattribute-priv.h \ - gfiledescriptorbased.h \ - gfiledescriptorbased.c \ gfileenumerator.c \ gfileicon.c \ gfileinfo.c \ @@ -254,11 +348,16 @@ libgio_2_0_la_SOURCES = \ gnetworkingprivate.h \ gnetworkservice.c \ goutputstream.c \ + gpermission.c \ + gpollableinputstream.c \ + gpollableoutputstream.c \ gpollfilemonitor.c \ gpollfilemonitor.h \ + gproxyresolver.c \ gresolver.c \ gseekable.c \ gsimpleasyncresult.c \ + gsimplepermission.c \ gsocket.c \ gsocketaddress.c \ gsocketaddressenumerator.c \ @@ -271,13 +370,22 @@ libgio_2_0_la_SOURCES = \ gsocketlistener.c \ gsocketoutputstream.c \ gsocketoutputstream.h \ + gproxy.c \ + gproxyaddress.c \ + gproxyaddressenumerator.c \ gsocketservice.c \ gsrvtarget.c \ gtcpconnection.c \ + gtcpwrapperconnection.c \ gthreadedsocketservice.c\ gthemedicon.c \ gthreadedresolver.c \ gthreadedresolver.h \ + gtlsbackend.c \ + gtlscertificate.c \ + gtlsclientconnection.c \ + gtlsconnection.c \ + gtlsserverconnection.c \ gunionvolumemonitor.c \ gunionvolumemonitor.h \ gvfs.c \ @@ -288,21 +396,23 @@ libgio_2_0_la_SOURCES = \ gmountprivate.h \ gioenumtypes.h \ gioenumtypes.c \ - gioalias.h \ - gioaliasdef.c \ $(appinfo_sources) \ $(unix_sources) \ $(win32_sources) \ + $(application_sources) \ + $(settings_sources) \ + $(gdbus_sources) \ $(local_sources) \ $(marshal_sources) \ $(NULL) +EXTRA_DIST += strinfo.c + $(libgio_2_0_la_OBJECTS): $(marshal_sources) libgio_2_0_la_LIBADD = \ $(top_builddir)/glib/libglib-2.0.la \ $(top_builddir)/gobject/libgobject-2.0.la \ - $(top_builddir)/gthread/libgthread-2.0.la \ $(top_builddir)/gmodule/libgmodule-2.0.la \ $(platform_libadd) \ $(ZLIB_LIBS) \ @@ -339,7 +449,7 @@ install-data-local: install-ms-lib install-def-file uninstall-local: uninstall-ms-lib uninstall-def-file -libgio_2_0_la_LDFLAGS = \ +libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ $(gio_win32_res_ldflag) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic $(no_undefined) $(export_symbols) @@ -399,9 +509,17 @@ gio_headers = \ gnetworkaddress.h \ gnetworkservice.h \ goutputstream.h \ + gpermission.h \ + gpollableinputstream.h \ + gpollableoutputstream.h \ + gproxyaddress.h \ + gproxy.h \ + gproxyaddressenumerator.h \ + gproxyresolver.h \ gresolver.h \ gseekable.h \ gsimpleasyncresult.h \ + gsimplepermission.h \ gsocket.h \ gsocketaddress.h \ gsocketaddressenumerator.h \ @@ -413,13 +531,22 @@ gio_headers = \ gsocketservice.h \ gsrvtarget.h \ gtcpconnection.h \ + gtcpwrapperconnection.h \ gthreadedsocketservice.h\ gthemedicon.h \ + gtlsbackend.h \ + gtlscertificate.h \ + gtlsclientconnection.h \ + gtlsconnection.h \ + gtlsserverconnection.h \ gvfs.h \ gvolume.h \ gvolumemonitor.h \ gzlibcompressor.h \ gzlibdecompressor.h \ + $(application_headers) \ + $(settings_headers) \ + $(gdbus_headers) \ $(NULL) gioincludedir=$(includedir)/glib-2.0/gio/ @@ -431,8 +558,6 @@ gioinclude_HEADERS = \ BUILT_SOURCES = \ gio-marshal.h \ gio-marshal.c \ - gioalias.h \ - gioaliasdef.c \ gioenumtypes.h \ gioenumtypes.c \ $(NULL) @@ -443,10 +568,9 @@ EXTRA_DIST += \ gioenumtypes.h.template \ gioenumtypes.c.template \ makefile.msc \ - makegioalias.pl \ abicheck.sh \ - pltcheck.sh \ gio.rc.in \ + gschema.dtd \ $(NULL) BUILT_EXTRA_DIST = \ @@ -457,28 +581,61 @@ CLEANFILES = \ $(NULL) gioenumtypes.h: $(gio_headers) gioenumtypes.h.template - ( top_builddir=`cd $(top_builddir) && pwd`; \ + $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \ cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \ gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h gioenumtypes.c: $(gio_headers) gioenumtypes.c.template - ( top_builddir=`cd $(top_builddir) && pwd`; \ + $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \ cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \ gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c gio-2.0.lib: libgio-2.0.la gio.def lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@ -bin_PROGRAMS = gio-querymodules +bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings + gio_querymodules_SOURCES = gio-querymodules.c gio_querymodules_LDADD = \ $(top_builddir)/glib/libglib-2.0.la \ $(top_builddir)/gobject/libgobject-2.0.la \ - $(top_builddir)/gthread/libgthread-2.0.la \ $(top_builddir)/gmodule/libgmodule-2.0.la \ libgio-2.0.la \ $(NULL) +glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la +glib_compile_schemas_SOURCES = \ + gvdb/gvdb-format.h \ + gvdb/gvdb-builder.h \ + gvdb/gvdb-builder.c \ + glib-compile-schemas.c + +gsettings_LDADD = \ + $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la \ + libgio-2.0.la +gsettings_SOURCES = gsettings-tool.c + +schemadir = $(datadir)/glib-2.0/schemas +dist_schema_DATA = gschema.dtd + +# ------------------------------------------------------------------------ +# gdbus(1) tool + +bin_PROGRAMS += gdbus +gdbus_SOURCES = gdbus-tool.c +gdbus_LDADD = libgio-2.0.la \ + $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la + +completiondir = $(sysconfdir)/bash_completion.d +completion_SCRIPTS = \ + gdbus-bash-completion.sh \ + gsettings-bash-completion.sh +EXTRA_DIST += $(completion_SCRIPTS) + +# ------------------------------------------------------------------------ + dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj files='$(BUILT_EXTRA_DIST)'; \ for f in $$files; do \ @@ -486,7 +643,7 @@ dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj cp $$d/$$f $(distdir) || exit 1; done ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin - for F in `echo $(libgio_2_0_la_SOURCES) $(win32_sources) $(win32_more_sources_for_vcproj) | tr '/' '\\'`; do \ + for F in `echo $(libgio_2_0_la_SOURCES) $(win32_actual_sources) $(win32_actual_more_sources_for_vcproj) | tr '/' '\\'`; do \ case $$F in \ gunix*.c|gdesktopappinfo.c) ;; \ *.c) echo ' ' \ diff --git a/gio/Makefile.in b/gio/Makefile.in index 2a0b21f..6f3ea1c 100644 --- a/gio/Makefile.in +++ b/gio/Makefile.in @@ -20,6 +20,7 @@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -39,27 +40,34 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(am__giounixinclude_HEADERS_DIST) $(gioinclude_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/gio.rc.in $(top_srcdir)/Makefile.decl ChangeLog +DIST_COMMON = $(am__giounixinclude_HEADERS_DIST) \ + $(am__giowin32include_HEADERS_DIST) $(dist_schema_DATA) \ + $(gioinclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/gio.rc.in \ + $(top_srcdir)/Makefile.decl ChangeLog @OS_UNIX_TRUE@am__append_1 = libasyncns xdgmime -@HAVE_INOTIFY_TRUE@am__append_2 = inotify -@HAVE_INOTIFY_TRUE@am__append_3 = inotify/libinotify.la +@OS_WIN32_TRUE@am__append_2 = \ +@OS_WIN32_TRUE@ gregistrysettingsbackend.h \ +@OS_WIN32_TRUE@ gregistrysettingsbackend.c + +@HAVE_INOTIFY_TRUE@am__append_3 = inotify @HAVE_INOTIFY_TRUE@am__append_4 = inotify/libinotify.la -@HAVE_FEN_TRUE@am__append_5 = -DHAVE_FEN -@HAVE_FEN_TRUE@am__append_6 = fen -@HAVE_FEN_TRUE@am__append_7 = fen/libfen.la +@HAVE_INOTIFY_TRUE@am__append_5 = inotify/libinotify.la +@HAVE_FEN_TRUE@am__append_6 = -DHAVE_FEN +@HAVE_FEN_TRUE@am__append_7 = fen @HAVE_FEN_TRUE@am__append_8 = fen/libfen.la -@OS_WIN32_TRUE@am__append_9 = win32 -@OS_WIN32_TRUE@am__append_10 = win32/libgiowin32.la +@HAVE_FEN_TRUE@am__append_9 = fen/libfen.la +@OS_WIN32_TRUE@am__append_10 = win32 @OS_WIN32_TRUE@am__append_11 = win32/libgiowin32.la -@HAVE_FAM_TRUE@am__append_12 = fam -@OS_UNIX_TRUE@am__append_13 = gdesktopappinfo.c gdesktopappinfo.h -@OS_UNIX_TRUE@am__append_14 = libasyncns/libasyncns.la xdgmime/libxdgmime.la +@OS_WIN32_TRUE@am__append_12 = win32/libgiowin32.la +@HAVE_FAM_TRUE@am__append_13 = fam +@OS_UNIX_TRUE@am__append_14 = gdesktopappinfo.c @OS_UNIX_TRUE@am__append_15 = libasyncns/libasyncns.la xdgmime/libxdgmime.la -@OS_WIN32_TRUE@am__append_16 = gwin32appinfo.c gwin32appinfo.h -@OS_WIN32_TRUE@am__append_17 = -lshlwapi -lws2_32 -ldnsapi -bin_PROGRAMS = gio-querymodules$(EXEEXT) +@OS_UNIX_TRUE@am__append_16 = libasyncns/libasyncns.la xdgmime/libxdgmime.la +@OS_WIN32_TRUE@am__append_17 = gwin32appinfo.c gwin32appinfo.h +@OS_WIN32_TRUE@am__append_18 = -lshlwapi -lws2_32 -ldnsapi +bin_PROGRAMS = gio-querymodules$(EXEEXT) glib-compile-schemas$(EXEEXT) \ + gsettings$(EXEEXT) gdbus$(EXEEXT) subdir = gio ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ @@ -67,7 +75,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -96,86 +104,139 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(gioincludedir)" "$(DESTDIR)$(giounixincludedir)" + "$(DESTDIR)$(completiondir)" "$(DESTDIR)$(schemadir)" \ + "$(DESTDIR)$(gioincludedir)" "$(DESTDIR)$(giounixincludedir)" \ + "$(DESTDIR)$(giowin32includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(am__append_3) $(am__append_7) $(am__append_10) \ - $(am__append_14) $(am__DEPENDENCIES_1) +am__DEPENDENCIES_2 = $(am__append_4) $(am__append_8) $(am__append_11) \ + $(am__append_15) $(am__DEPENDENCIES_1) am__libgio_2_0_la_SOURCES_DIST = gappinfo.c gasynchelper.c \ gasynchelper.h gasyncinitable.c gasyncresult.c \ gbufferedinputstream.c gbufferedoutputstream.c gcancellable.c \ gcontenttype.c gcontenttypeprivate.h gcharsetconverter.c \ gconverter.c gconverterinputstream.c gconverteroutputstream.c \ - gdatainputstream.c gdataoutputstream.c gdrive.c gdummyfile.h \ - gdummyfile.c gemblem.h gemblem.c gemblemedicon.h \ - gemblemedicon.c gfile.c gfileattribute.c gfileattribute-priv.h \ - gfiledescriptorbased.h gfiledescriptorbased.c \ - gfileenumerator.c gfileicon.c gfileinfo.c gfileinfo-priv.h \ - gfileinputstream.c gfilemonitor.c gfilenamecompleter.c \ - gfileoutputstream.c gfileiostream.c gfilterinputstream.c \ - gfilteroutputstream.c gicon.c ginetaddress.c \ - ginetsocketaddress.c ginitable.c ginputstream.c gioenums.h \ - gioerror.c giomodule.c giomodule-priv.h gioscheduler.c \ - giostream.c gloadableicon.c gmount.c gmemoryinputstream.c \ - gmemoryoutputstream.c gmountoperation.c gnativevolumemonitor.c \ + gcredentials.c gdatainputstream.c gdataoutputstream.c gdrive.c \ + gdummyfile.h gdummyfile.c gdummyproxyresolver.c \ + gdummyproxyresolver.h gdummytlsbackend.c gdummytlsbackend.h \ + gemblem.h gemblem.c gemblemedicon.h gemblemedicon.c gfile.c \ + gfileattribute.c gfileattribute-priv.h gfileenumerator.c \ + gfileicon.c gfileinfo.c gfileinfo-priv.h gfileinputstream.c \ + gfilemonitor.c gfilenamecompleter.c gfileoutputstream.c \ + gfileiostream.c gfilterinputstream.c gfilteroutputstream.c \ + gicon.c ginetaddress.c ginetsocketaddress.c ginitable.c \ + ginputstream.c gioenums.h gioerror.c giomodule.c \ + giomodule-priv.h gioscheduler.c giostream.c gloadableicon.c \ + gmount.c gmemoryinputstream.c gmemoryoutputstream.c \ + gmountoperation.c gnativevolumemonitor.c \ gnativevolumemonitor.h gnetworkaddress.c gnetworkingprivate.h \ - gnetworkservice.c goutputstream.c gpollfilemonitor.c \ - gpollfilemonitor.h gresolver.c gseekable.c \ - gsimpleasyncresult.c gsocket.c gsocketaddress.c \ + gnetworkservice.c goutputstream.c gpermission.c \ + gpollableinputstream.c gpollableoutputstream.c \ + gpollfilemonitor.c gpollfilemonitor.h gproxyresolver.c \ + gresolver.c gseekable.c gsimpleasyncresult.c \ + gsimplepermission.c gsocket.c gsocketaddress.c \ gsocketaddressenumerator.c gsocketclient.c \ gsocketconnectable.c gsocketconnection.c \ gsocketcontrolmessage.c gsocketinputstream.c \ gsocketinputstream.h gsocketlistener.c gsocketoutputstream.c \ - gsocketoutputstream.h gsocketservice.c gsrvtarget.c \ - gtcpconnection.c gthreadedsocketservice.c gthemedicon.c \ - gthreadedresolver.c gthreadedresolver.h gunionvolumemonitor.c \ - gunionvolumemonitor.h gvfs.c gvolume.c gvolumemonitor.c \ - gzlibcompressor.c gzlibdecompressor.c gmountprivate.h \ - gioenumtypes.h gioenumtypes.c gioalias.h gioaliasdef.c \ - gdesktopappinfo.c gdesktopappinfo.h gwin32appinfo.c \ - gwin32appinfo.h gunixconnection.c gunixfdlist.c \ - gunixfdmessage.c gunixmount.c gunixmount.h gunixmounts.c \ - gunixmounts.h gunixresolver.c gunixresolver.h \ - gunixsocketaddress.c gunixvolume.c gunixvolume.h \ - gunixvolumemonitor.c gunixvolumemonitor.h gunixinputstream.c \ - gunixoutputstream.c gwin32mount.c gwin32mount.h \ - gwin32resolver.c gwin32resolver.h gwin32volumemonitor.c \ - gwin32volumemonitor.h glocaldirectorymonitor.c \ + gsocketoutputstream.h gproxy.c gproxyaddress.c \ + gproxyaddressenumerator.c gsocketservice.c gsrvtarget.c \ + gtcpconnection.c gtcpwrapperconnection.c \ + gthreadedsocketservice.c gthemedicon.c gthreadedresolver.c \ + gthreadedresolver.h gtlsbackend.c gtlscertificate.c \ + gtlsclientconnection.c gtlsconnection.c gtlsserverconnection.c \ + gunionvolumemonitor.c gunionvolumemonitor.h gvfs.c gvolume.c \ + gvolumemonitor.c gzlibcompressor.c gzlibdecompressor.c \ + gmountprivate.h gioenumtypes.h gioenumtypes.c \ + gdesktopappinfo.c gwin32appinfo.c gwin32appinfo.h \ + gfiledescriptorbased.c gunixconnection.c \ + gunixcredentialsmessage.c gunixfdlist.c gunixfdmessage.c \ + gunixmount.c gunixmount.h gunixmounts.c gunixresolver.c \ + gunixresolver.h gunixsocketaddress.c gunixvolume.c \ + gunixvolume.h gunixvolumemonitor.c gunixvolumemonitor.h \ + gunixinputstream.c gunixoutputstream.c gwin32mount.c \ + gwin32mount.h gwin32resolver.c gwin32resolver.h \ + gwin32volumemonitor.c gwin32volumemonitor.h \ + gwin32inputstream.c gwin32outputstream.c gwin32outputstream.h \ + gactiongroup.c gsimpleactiongroup.c gaction.c gsimpleaction.c \ + gapplicationcommandline.c gapplicationimpl.h \ + gapplicationimpl-dbus.c gapplication.c gvdb/gvdb-format.h \ + gvdb/gvdb-reader.h gvdb/gvdb-reader.c \ + gdelayedsettingsbackend.h gdelayedsettingsbackend.c \ + gkeyfilesettingsbackend.c gmemorysettingsbackend.h \ + gmemorysettingsbackend.c gnullsettingsbackend.h \ + gnullsettingsbackend.c gsettingsbackendinternal.h \ + gsettingsbackend.c gsettingsschema.h gsettingsschema.c \ + gsettings-mapping.h gsettings-mapping.c gsettings.c \ + gregistrysettingsbackend.h gregistrysettingsbackend.c \ + gdbusutils.h gdbusutils.c gdbusaddress.h gdbusaddress.c \ + gdbusauthobserver.h gdbusauthobserver.c gdbusauth.h \ + gdbusauth.c gdbusauthmechanism.h gdbusauthmechanism.c \ + gdbusauthmechanismanon.h gdbusauthmechanismanon.c \ + gdbusauthmechanismexternal.h gdbusauthmechanismexternal.c \ + gdbusauthmechanismsha1.h gdbusauthmechanismsha1.c gdbuserror.h \ + gdbuserror.c gdbusconnection.h gdbusconnection.c \ + gdbusmessage.h gdbusmessage.c gdbusnameowning.h \ + gdbusnameowning.c gdbusnamewatching.h gdbusnamewatching.c \ + gdbusproxy.h gdbusproxy.c gdbusprivate.h gdbusprivate.c \ + gdbusintrospection.h gdbusintrospection.c \ + gdbusmethodinvocation.h gdbusmethodinvocation.c gdbusserver.h \ + gdbusserver.c glocaldirectorymonitor.c \ glocaldirectorymonitor.h glocalfile.c glocalfile.h \ glocalfileenumerator.c glocalfileenumerator.h glocalfileinfo.c \ glocalfileinfo.h glocalfileinputstream.c \ glocalfileinputstream.h glocalfilemonitor.c \ glocalfilemonitor.h glocalfileoutputstream.c \ glocalfileoutputstream.h glocalfileiostream.c \ - glocalfileiostream.h glocalvfs.c glocalvfs.h gio-marshal.h \ - gio-marshal.c + glocalfileiostream.h glocalvfs.c glocalvfs.h gsocks4proxy.c \ + gsocks4proxy.h gsocks4aproxy.c gsocks4aproxy.h gsocks5proxy.c \ + gsocks5proxy.h gio-marshal.h gio-marshal.c @OS_UNIX_TRUE@am__objects_1 = gdesktopappinfo.lo @OS_WIN32_TRUE@am__objects_2 = gwin32appinfo.lo am__objects_3 = $(am__objects_1) $(am__objects_2) am__objects_4 = -@OS_UNIX_TRUE@am__objects_5 = gunixconnection.lo gunixfdlist.lo \ -@OS_UNIX_TRUE@ gunixfdmessage.lo gunixmount.lo gunixmounts.lo \ -@OS_UNIX_TRUE@ gunixresolver.lo gunixsocketaddress.lo \ -@OS_UNIX_TRUE@ gunixvolume.lo gunixvolumemonitor.lo \ -@OS_UNIX_TRUE@ gunixinputstream.lo gunixoutputstream.lo \ -@OS_UNIX_TRUE@ $(am__objects_4) -@OS_WIN32_TRUE@am__objects_6 = gwin32mount.lo gwin32resolver.lo \ -@OS_WIN32_TRUE@ gwin32volumemonitor.lo $(am__objects_4) -am__objects_7 = glocaldirectorymonitor.lo glocalfile.lo \ +@OS_UNIX_TRUE@am__objects_5 = gfiledescriptorbased.lo \ +@OS_UNIX_TRUE@ gunixconnection.lo gunixcredentialsmessage.lo \ +@OS_UNIX_TRUE@ gunixfdlist.lo gunixfdmessage.lo gunixmount.lo \ +@OS_UNIX_TRUE@ gunixmounts.lo gunixresolver.lo \ +@OS_UNIX_TRUE@ gunixsocketaddress.lo gunixvolume.lo \ +@OS_UNIX_TRUE@ gunixvolumemonitor.lo gunixinputstream.lo \ +@OS_UNIX_TRUE@ gunixoutputstream.lo $(am__objects_4) +am__objects_6 = gwin32mount.lo gwin32resolver.lo \ + gwin32volumemonitor.lo gwin32inputstream.lo \ + gwin32outputstream.lo $(am__objects_4) +@OS_WIN32_TRUE@am__objects_7 = $(am__objects_6) +am__objects_8 = gactiongroup.lo gsimpleactiongroup.lo gaction.lo \ + gsimpleaction.lo gapplicationcommandline.lo \ + gapplicationimpl-dbus.lo gapplication.lo +@OS_WIN32_TRUE@am__objects_9 = gregistrysettingsbackend.lo +am__objects_10 = gvdb-reader.lo gdelayedsettingsbackend.lo \ + gkeyfilesettingsbackend.lo gmemorysettingsbackend.lo \ + gnullsettingsbackend.lo gsettingsbackend.lo gsettingsschema.lo \ + gsettings-mapping.lo gsettings.lo $(am__objects_9) +am__objects_11 = gdbusutils.lo gdbusaddress.lo gdbusauthobserver.lo \ + gdbusauth.lo gdbusauthmechanism.lo gdbusauthmechanismanon.lo \ + gdbusauthmechanismexternal.lo gdbusauthmechanismsha1.lo \ + gdbuserror.lo gdbusconnection.lo gdbusmessage.lo \ + gdbusnameowning.lo gdbusnamewatching.lo gdbusproxy.lo \ + gdbusprivate.lo gdbusintrospection.lo gdbusmethodinvocation.lo \ + gdbusserver.lo $(am__objects_4) +am__objects_12 = glocaldirectorymonitor.lo glocalfile.lo \ glocalfileenumerator.lo glocalfileinfo.lo \ glocalfileinputstream.lo glocalfilemonitor.lo \ glocalfileoutputstream.lo glocalfileiostream.lo glocalvfs.lo \ + gsocks4proxy.lo gsocks4aproxy.lo gsocks5proxy.lo \ $(am__objects_4) -am__objects_8 = gio-marshal.lo $(am__objects_4) +am__objects_13 = gio-marshal.lo $(am__objects_4) am_libgio_2_0_la_OBJECTS = gappinfo.lo gasynchelper.lo \ gasyncinitable.lo gasyncresult.lo gbufferedinputstream.lo \ gbufferedoutputstream.lo gcancellable.lo gcontenttype.lo \ gcharsetconverter.lo gconverter.lo gconverterinputstream.lo \ - gconverteroutputstream.lo gdatainputstream.lo \ - gdataoutputstream.lo gdrive.lo gdummyfile.lo gemblem.lo \ - gemblemedicon.lo gfile.lo gfileattribute.lo \ - gfiledescriptorbased.lo gfileenumerator.lo gfileicon.lo \ - gfileinfo.lo gfileinputstream.lo gfilemonitor.lo \ + gconverteroutputstream.lo gcredentials.lo gdatainputstream.lo \ + gdataoutputstream.lo gdrive.lo gdummyfile.lo \ + gdummyproxyresolver.lo gdummytlsbackend.lo gemblem.lo \ + gemblemedicon.lo gfile.lo gfileattribute.lo gfileenumerator.lo \ + gfileicon.lo gfileinfo.lo gfileinputstream.lo gfilemonitor.lo \ gfilenamecompleter.lo gfileoutputstream.lo gfileiostream.lo \ gfilterinputstream.lo gfilteroutputstream.lo gicon.lo \ ginetaddress.lo ginetsocketaddress.lo ginitable.lo \ @@ -183,18 +244,24 @@ am_libgio_2_0_la_OBJECTS = gappinfo.lo gasynchelper.lo \ giostream.lo gloadableicon.lo gmount.lo gmemoryinputstream.lo \ gmemoryoutputstream.lo gmountoperation.lo \ gnativevolumemonitor.lo gnetworkaddress.lo gnetworkservice.lo \ - goutputstream.lo gpollfilemonitor.lo gresolver.lo gseekable.lo \ - gsimpleasyncresult.lo gsocket.lo gsocketaddress.lo \ + goutputstream.lo gpermission.lo gpollableinputstream.lo \ + gpollableoutputstream.lo gpollfilemonitor.lo gproxyresolver.lo \ + gresolver.lo gseekable.lo gsimpleasyncresult.lo \ + gsimplepermission.lo gsocket.lo gsocketaddress.lo \ gsocketaddressenumerator.lo gsocketclient.lo \ gsocketconnectable.lo gsocketconnection.lo \ gsocketcontrolmessage.lo gsocketinputstream.lo \ - gsocketlistener.lo gsocketoutputstream.lo gsocketservice.lo \ - gsrvtarget.lo gtcpconnection.lo gthreadedsocketservice.lo \ - gthemedicon.lo gthreadedresolver.lo gunionvolumemonitor.lo \ - gvfs.lo gvolume.lo gvolumemonitor.lo gzlibcompressor.lo \ - gzlibdecompressor.lo gioenumtypes.lo gioaliasdef.lo \ - $(am__objects_3) $(am__objects_5) $(am__objects_6) \ - $(am__objects_7) $(am__objects_8) $(am__objects_4) + gsocketlistener.lo gsocketoutputstream.lo gproxy.lo \ + gproxyaddress.lo gproxyaddressenumerator.lo gsocketservice.lo \ + gsrvtarget.lo gtcpconnection.lo gtcpwrapperconnection.lo \ + gthreadedsocketservice.lo gthemedicon.lo gthreadedresolver.lo \ + gtlsbackend.lo gtlscertificate.lo gtlsclientconnection.lo \ + gtlsconnection.lo gtlsserverconnection.lo \ + gunionvolumemonitor.lo gvfs.lo gvolume.lo gvolumemonitor.lo \ + gzlibcompressor.lo gzlibdecompressor.lo gioenumtypes.lo \ + $(am__objects_3) $(am__objects_5) $(am__objects_7) \ + $(am__objects_8) $(am__objects_10) $(am__objects_11) \ + $(am__objects_12) $(am__objects_13) $(am__objects_4) libgio_2_0_la_OBJECTS = $(am_libgio_2_0_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -203,12 +270,26 @@ libgio_2_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgio_2_0_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) +am_gdbus_OBJECTS = gdbus-tool.$(OBJEXT) +gdbus_OBJECTS = $(am_gdbus_OBJECTS) +gdbus_DEPENDENCIES = libgio-2.0.la $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la am_gio_querymodules_OBJECTS = gio-querymodules.$(OBJEXT) gio_querymodules_OBJECTS = $(am_gio_querymodules_OBJECTS) gio_querymodules_DEPENDENCIES = $(top_builddir)/glib/libglib-2.0.la \ $(top_builddir)/gobject/libgobject-2.0.la \ $(top_builddir)/gmodule/libgmodule-2.0.la libgio-2.0.la \ $(am__DEPENDENCIES_1) +am_glib_compile_schemas_OBJECTS = gvdb-builder.$(OBJEXT) \ + glib-compile-schemas.$(OBJEXT) +glib_compile_schemas_OBJECTS = $(am_glib_compile_schemas_OBJECTS) +glib_compile_schemas_DEPENDENCIES = \ + $(top_builddir)/glib/libglib-2.0.la +am_gsettings_OBJECTS = gsettings-tool.$(OBJEXT) +gsettings_OBJECTS = $(am_gsettings_OBJECTS) +gsettings_DEPENDENCIES = $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la libgio-2.0.la +SCRIPTS = $(completion_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -235,9 +316,12 @@ am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libgio_2_0_la_SOURCES) $(gio_querymodules_SOURCES) -DIST_SOURCES = $(am__libgio_2_0_la_SOURCES_DIST) \ - $(gio_querymodules_SOURCES) +SOURCES = $(libgio_2_0_la_SOURCES) $(gdbus_SOURCES) \ + $(gio_querymodules_SOURCES) $(glib_compile_schemas_SOURCES) \ + $(gsettings_SOURCES) +DIST_SOURCES = $(am__libgio_2_0_la_SOURCES_DIST) $(gdbus_SOURCES) \ + $(gio_querymodules_SOURCES) $(glib_compile_schemas_SOURCES) \ + $(gsettings_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -245,12 +329,16 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive -DATA = $(noinst_DATA) +DATA = $(dist_schema_DATA) $(noinst_DATA) am__giounixinclude_HEADERS_DIST = gdesktopappinfo.h \ - gfiledescriptorbased.h gunixconnection.h gunixmounts.h \ - gunixfdlist.h gunixfdmessage.h gunixinputstream.h \ - gunixoutputstream.h gunixsocketaddress.h -HEADERS = $(gioinclude_HEADERS) $(giounixinclude_HEADERS) + gfiledescriptorbased.h gunixconnection.h \ + gunixcredentialsmessage.h gunixmounts.h gunixfdlist.h \ + gunixfdmessage.h gunixinputstream.h gunixoutputstream.h \ + gunixsocketaddress.h +am__giowin32include_HEADERS_DIST = gwin32inputstream.h \ + gwin32outputstream.h +HEADERS = $(gioinclude_HEADERS) $(giounixinclude_HEADERS) \ + $(giowin32include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -288,6 +376,7 @@ am__relativize = \ done; \ reldir="$$dir2" ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -312,11 +401,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -330,13 +422,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -383,6 +478,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -390,6 +487,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -415,6 +513,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -431,6 +531,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -440,11 +541,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -460,11 +563,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -478,7 +587,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -505,23 +613,23 @@ GTESTER = $(top_builddir)/glib/gtester # for the GLIB package GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package # initialize variables for unconditional += appending -EXTRA_DIST = gio-marshal.list gio.symbols gioenumtypes.h.template \ - gioenumtypes.c.template makefile.msc makegioalias.pl \ - abicheck.sh pltcheck.sh gio.rc.in $(NULL) +EXTRA_DIST = strinfo.c gio-marshal.list gio.symbols \ + gioenumtypes.h.template gioenumtypes.c.template makefile.msc \ + abicheck.sh gio.rc.in gschema.dtd $(NULL) \ + $(completion_SCRIPTS) TEST_PROGS = NULL = -SUBDIRS = $(am__append_1) $(am__append_2) $(am__append_6) \ - $(am__append_9) . $(am__append_12) tests +SUBDIRS = $(am__append_1) $(am__append_3) $(am__append_7) \ + $(am__append_10) . $(am__append_13) tests @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@noinst_DATA = gio-2.0.lib @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir) @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib -@HAVE_GNUC_VISIBILITY_TRUE@@OS_LINUX_TRUE@TESTS = abicheck.sh pltcheck.sh +@HAVE_GNUC_VISIBILITY_TRUE@@OS_LINUX_TRUE@TESTS = abicheck.sh @HAVE_THREADS_TRUE@THREAD_FLAGS = -DG_THREADS_MANDATORY -AM_CPPFLAGS = -DG_LOG_DOMAIN=\"GLib-GIO\" -I$(top_builddir) \ - -I$(top_srcdir) -I$(top_srcdir)/glib -I$(top_srcdir)/gmodule \ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"GLib-GIO\" $(gmodule_INCLUDES) \ $(GLIB_DEBUG_FLAGS) $(THREAD_FLAGS) -DG_DISABLE_DEPRECATED \ -DGIO_COMPILATION -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ - $(am__append_5) + $(am__append_6) lib_LTLIBRARIES = libgio-2.0.la marshal_sources = \ gio-marshal.h \ @@ -530,6 +638,73 @@ marshal_sources = \ @CROSS_COMPILING_FALSE@glib_genmarshal = ../gobject/glib-genmarshal @CROSS_COMPILING_TRUE@glib_genmarshal = $(GLIB_GENMARSHAL) +gdbus_headers = \ + gdbusauthobserver.h \ + gcredentials.h \ + gdbusutils.h \ + gdbuserror.h \ + gdbusaddress.h \ + gdbusconnection.h \ + gdbusmessage.h \ + gdbusnameowning.h \ + gdbusnamewatching.h \ + gdbusproxy.h \ + gdbusintrospection.h \ + gdbusmethodinvocation.h \ + gdbusserver.h \ + $(NULL) + +gdbus_sources = \ + gdbusutils.h gdbusutils.c \ + gdbusaddress.h gdbusaddress.c \ + gdbusauthobserver.h gdbusauthobserver.c \ + gdbusauth.h gdbusauth.c \ + gdbusauthmechanism.h gdbusauthmechanism.c \ + gdbusauthmechanismanon.h gdbusauthmechanismanon.c \ + gdbusauthmechanismexternal.h gdbusauthmechanismexternal.c \ + gdbusauthmechanismsha1.h gdbusauthmechanismsha1.c \ + gdbuserror.h gdbuserror.c \ + gdbusconnection.h gdbusconnection.c \ + gdbusmessage.h gdbusmessage.c \ + gdbusnameowning.h gdbusnameowning.c \ + gdbusnamewatching.h gdbusnamewatching.c \ + gdbusproxy.h gdbusproxy.c \ + gdbusprivate.h gdbusprivate.c \ + gdbusintrospection.h gdbusintrospection.c \ + gdbusmethodinvocation.h gdbusmethodinvocation.c \ + gdbusserver.h gdbusserver.c \ + $(NULL) + +settings_headers = \ + gsettingsbackend.h \ + gsettings.h + +settings_sources = gvdb/gvdb-format.h gvdb/gvdb-reader.h \ + gvdb/gvdb-reader.c gdelayedsettingsbackend.h \ + gdelayedsettingsbackend.c gkeyfilesettingsbackend.c \ + gmemorysettingsbackend.h gmemorysettingsbackend.c \ + gnullsettingsbackend.h gnullsettingsbackend.c \ + gsettingsbackendinternal.h gsettingsbackend.c \ + gsettingsschema.h gsettingsschema.c gsettings-mapping.h \ + gsettings-mapping.c gsettings.c $(am__append_2) +application_headers = \ + gactiongroup.h \ + gsimpleactiongroup.h \ + gaction.h \ + gsimpleaction.h \ + gapplicationcommandline.h \ + gapplication.h + +application_sources = \ + gactiongroup.c \ + gsimpleactiongroup.c \ + gaction.c \ + gsimpleaction.c \ + gapplicationcommandline.c \ + gapplicationimpl.h \ + gapplicationimpl-dbus.c \ + gapplication.c + local_sources = \ glocaldirectorymonitor.c \ glocaldirectorymonitor.h \ @@ -549,21 +724,28 @@ local_sources = \ glocalfileiostream.h \ glocalvfs.c \ glocalvfs.h \ + gsocks4proxy.c \ + gsocks4proxy.h \ + gsocks4aproxy.c \ + gsocks4aproxy.h \ + gsocks5proxy.c \ + gsocks5proxy.h \ $(NULL) -platform_libadd = $(am__append_3) $(am__append_7) $(am__append_10) \ - $(am__append_14) $(am__append_17) -platform_deps = $(am__append_4) $(am__append_8) $(am__append_11) \ - $(am__append_15) -appinfo_sources = $(am__append_13) $(am__append_16) +platform_libadd = $(am__append_4) $(am__append_8) $(am__append_11) \ + $(am__append_15) $(am__append_18) +platform_deps = $(am__append_5) $(am__append_9) $(am__append_12) \ + $(am__append_16) +appinfo_sources = $(am__append_14) $(am__append_17) @OS_UNIX_TRUE@unix_sources = \ +@OS_UNIX_TRUE@ gfiledescriptorbased.c \ @OS_UNIX_TRUE@ gunixconnection.c \ +@OS_UNIX_TRUE@ gunixcredentialsmessage.c \ @OS_UNIX_TRUE@ gunixfdlist.c \ @OS_UNIX_TRUE@ gunixfdmessage.c \ @OS_UNIX_TRUE@ gunixmount.c \ @OS_UNIX_TRUE@ gunixmount.h \ @OS_UNIX_TRUE@ gunixmounts.c \ -@OS_UNIX_TRUE@ gunixmounts.h \ @OS_UNIX_TRUE@ gunixresolver.c \ @OS_UNIX_TRUE@ gunixresolver.h \ @OS_UNIX_TRUE@ gunixsocketaddress.c \ @@ -580,6 +762,7 @@ appinfo_sources = $(am__append_13) $(am__append_16) @OS_UNIX_TRUE@ gdesktopappinfo.h \ @OS_UNIX_TRUE@ gfiledescriptorbased.h \ @OS_UNIX_TRUE@ gunixconnection.h \ +@OS_UNIX_TRUE@ gunixcredentialsmessage.h \ @OS_UNIX_TRUE@ gunixmounts.h \ @OS_UNIX_TRUE@ gunixfdlist.h \ @OS_UNIX_TRUE@ gunixfdmessage.h \ @@ -588,22 +771,32 @@ appinfo_sources = $(am__append_13) $(am__append_16) @OS_UNIX_TRUE@ gunixsocketaddress.h \ @OS_UNIX_TRUE@ $(NULL) -@OS_WIN32_TRUE@win32_sources = \ -@OS_WIN32_TRUE@ gwin32mount.c \ -@OS_WIN32_TRUE@ gwin32mount.h \ -@OS_WIN32_TRUE@ gwin32resolver.c \ -@OS_WIN32_TRUE@ gwin32resolver.h \ -@OS_WIN32_TRUE@ gwin32volumemonitor.c \ -@OS_WIN32_TRUE@ gwin32volumemonitor.h \ -@OS_WIN32_TRUE@ $(NULL) +win32_actual_sources = \ + gwin32mount.c \ + gwin32mount.h \ + gwin32resolver.c \ + gwin32resolver.h \ + gwin32volumemonitor.c \ + gwin32volumemonitor.h \ + gwin32inputstream.c \ + gwin32outputstream.c \ + gwin32outputstream.h \ + $(NULL) -@OS_WIN32_TRUE@win32_more_sources_for_vcproj = \ -@OS_WIN32_TRUE@ gwin32appinfo.c \ -@OS_WIN32_TRUE@ win32/gwin32directorymonitor.c \ -@OS_WIN32_TRUE@ win32/gwinhttpfile.c \ -@OS_WIN32_TRUE@ win32/gwinhttpfileinputstream.c \ -@OS_WIN32_TRUE@ win32/gwinhttpfileoutputstream.c \ -@OS_WIN32_TRUE@ win32/gwinhttpvfs.c +win32_more_sources_for_vcproj = \ + gwin32appinfo.c \ + win32/gwin32directorymonitor.c \ + win32/gwinhttpfile.c \ + win32/gwinhttpfileinputstream.c \ + win32/gwinhttpfileoutputstream.c \ + win32/gwinhttpvfs.c + +@OS_WIN32_TRUE@win32_sources = $(win32_actual_sources) +@OS_WIN32_TRUE@giowin32includedir = $(includedir)/gio-win32-2.0/gio +@OS_WIN32_TRUE@giowin32include_HEADERS = \ +@OS_WIN32_TRUE@ gwin32inputstream.h \ +@OS_WIN32_TRUE@ gwin32outputstream.h \ +@OS_WIN32_TRUE@ $(NULL) libgio_2_0_la_SOURCES = \ gappinfo.c \ @@ -620,11 +813,16 @@ libgio_2_0_la_SOURCES = \ gconverter.c \ gconverterinputstream.c \ gconverteroutputstream.c \ + gcredentials.c \ gdatainputstream.c \ gdataoutputstream.c \ gdrive.c \ gdummyfile.h \ gdummyfile.c \ + gdummyproxyresolver.c \ + gdummyproxyresolver.h \ + gdummytlsbackend.c \ + gdummytlsbackend.h \ gemblem.h \ gemblem.c \ gemblemedicon.h \ @@ -632,8 +830,6 @@ libgio_2_0_la_SOURCES = \ gfile.c \ gfileattribute.c \ gfileattribute-priv.h \ - gfiledescriptorbased.h \ - gfiledescriptorbased.c \ gfileenumerator.c \ gfileicon.c \ gfileinfo.c \ @@ -667,11 +863,16 @@ libgio_2_0_la_SOURCES = \ gnetworkingprivate.h \ gnetworkservice.c \ goutputstream.c \ + gpermission.c \ + gpollableinputstream.c \ + gpollableoutputstream.c \ gpollfilemonitor.c \ gpollfilemonitor.h \ + gproxyresolver.c \ gresolver.c \ gseekable.c \ gsimpleasyncresult.c \ + gsimplepermission.c \ gsocket.c \ gsocketaddress.c \ gsocketaddressenumerator.c \ @@ -684,13 +885,22 @@ libgio_2_0_la_SOURCES = \ gsocketlistener.c \ gsocketoutputstream.c \ gsocketoutputstream.h \ + gproxy.c \ + gproxyaddress.c \ + gproxyaddressenumerator.c \ gsocketservice.c \ gsrvtarget.c \ gtcpconnection.c \ + gtcpwrapperconnection.c \ gthreadedsocketservice.c\ gthemedicon.c \ gthreadedresolver.c \ gthreadedresolver.h \ + gtlsbackend.c \ + gtlscertificate.c \ + gtlsclientconnection.c \ + gtlsconnection.c \ + gtlsserverconnection.c \ gunionvolumemonitor.c \ gunionvolumemonitor.h \ gvfs.c \ @@ -701,11 +911,12 @@ libgio_2_0_la_SOURCES = \ gmountprivate.h \ gioenumtypes.h \ gioenumtypes.c \ - gioalias.h \ - gioaliasdef.c \ $(appinfo_sources) \ $(unix_sources) \ $(win32_sources) \ + $(application_sources) \ + $(settings_sources) \ + $(gdbus_sources) \ $(local_sources) \ $(marshal_sources) \ $(NULL) @@ -727,7 +938,7 @@ libgio_2_0_la_LIBADD = \ @OS_WIN32_AND_DLL_COMPILATION_TRUE@gio_def = gio.def @OS_WIN32_AND_DLL_COMPILATION_TRUE@gio_win32_res = gio-win32-res.o @OS_WIN32_AND_DLL_COMPILATION_TRUE@gio_win32_res_ldflag = -Wl,$(gio_win32_res) -libgio_2_0_la_LDFLAGS = \ +libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ $(gio_win32_res_ldflag) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic $(no_undefined) $(export_symbols) @@ -783,9 +994,17 @@ gio_headers = \ gnetworkaddress.h \ gnetworkservice.h \ goutputstream.h \ + gpermission.h \ + gpollableinputstream.h \ + gpollableoutputstream.h \ + gproxyaddress.h \ + gproxy.h \ + gproxyaddressenumerator.h \ + gproxyresolver.h \ gresolver.h \ gseekable.h \ gsimpleasyncresult.h \ + gsimplepermission.h \ gsocket.h \ gsocketaddress.h \ gsocketaddressenumerator.h \ @@ -797,13 +1016,22 @@ gio_headers = \ gsocketservice.h \ gsrvtarget.h \ gtcpconnection.h \ + gtcpwrapperconnection.h \ gthreadedsocketservice.h\ gthemedicon.h \ + gtlsbackend.h \ + gtlscertificate.h \ + gtlsclientconnection.h \ + gtlsconnection.h \ + gtlsserverconnection.h \ gvfs.h \ gvolume.h \ gvolumemonitor.h \ gzlibcompressor.h \ gzlibdecompressor.h \ + $(application_headers) \ + $(settings_headers) \ + $(gdbus_headers) \ $(NULL) gioincludedir = $(includedir)/glib-2.0/gio/ @@ -816,8 +1044,6 @@ gioinclude_HEADERS = \ BUILT_SOURCES = \ gio-marshal.h \ gio-marshal.c \ - gioalias.h \ - gioaliasdef.c \ gioenumtypes.h \ gioenumtypes.c \ $(NULL) @@ -837,6 +1063,31 @@ gio_querymodules_LDADD = \ libgio-2.0.la \ $(NULL) +glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la +glib_compile_schemas_SOURCES = \ + gvdb/gvdb-format.h \ + gvdb/gvdb-builder.h \ + gvdb/gvdb-builder.c \ + glib-compile-schemas.c + +gsettings_LDADD = \ + $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la \ + libgio-2.0.la + +gsettings_SOURCES = gsettings-tool.c +schemadir = $(datadir)/glib-2.0/schemas +dist_schema_DATA = gschema.dtd +gdbus_SOURCES = gdbus-tool.c +gdbus_LDADD = libgio-2.0.la \ + $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la + +completiondir = $(sysconfdir)/bash_completion.d +completion_SCRIPTS = \ + gdbus-bash-completion.sh \ + gsettings-bash-completion.sh + all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -950,9 +1201,52 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +gdbus$(EXEEXT): $(gdbus_OBJECTS) $(gdbus_DEPENDENCIES) + @rm -f gdbus$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_OBJECTS) $(gdbus_LDADD) $(LIBS) gio-querymodules$(EXEEXT): $(gio_querymodules_OBJECTS) $(gio_querymodules_DEPENDENCIES) @rm -f gio-querymodules$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gio_querymodules_OBJECTS) $(gio_querymodules_LDADD) $(LIBS) +glib-compile-schemas$(EXEEXT): $(glib_compile_schemas_OBJECTS) $(glib_compile_schemas_DEPENDENCIES) + @rm -f glib-compile-schemas$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(glib_compile_schemas_OBJECTS) $(glib_compile_schemas_LDADD) $(LIBS) +gsettings$(EXEEXT): $(gsettings_OBJECTS) $(gsettings_DEPENDENCIES) + @rm -f gsettings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gsettings_OBJECTS) $(gsettings_LDADD) $(LIBS) +install-completionSCRIPTS: $(completion_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(completiondir)" || $(MKDIR_P) "$(DESTDIR)$(completiondir)" + @list='$(completion_SCRIPTS)'; test -n "$(completiondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(completiondir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(completiondir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-completionSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(completion_SCRIPTS)'; test -n "$(completiondir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(completiondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(completiondir)" && rm -f $$files mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -960,7 +1254,12 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaction.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gactiongroup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gappinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplication.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplicationcommandline.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplicationimpl-dbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gasynchelper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gasyncinitable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gasyncresult.Plo@am__quote@ @@ -972,11 +1271,34 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconverter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconverterinputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconverteroutputstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcredentials.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdatainputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdataoutputstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusaddress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusauth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusauthmechanism.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusauthmechanismanon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusauthmechanismexternal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusauthmechanismsha1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusauthobserver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusconnection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbuserror.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusintrospection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusmessage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusmethodinvocation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusnameowning.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusnamewatching.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusprivate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusproxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusserver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbusutils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdelayedsettingsbackend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdesktopappinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdummyfile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdummyproxyresolver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdummytlsbackend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gemblem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gemblemedicon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile.Plo@am__quote@ @@ -999,12 +1321,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gio-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gio-querymodules.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gioaliasdef.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gioenumtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gioerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/giomodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gioscheduler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/giostream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gkeyfilesettingsbackend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glib-compile-schemas.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gloadableicon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocaldirectorymonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocalfile.Plo@am__quote@ @@ -1017,16 +1340,34 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocalvfs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmemoryinputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmemoryoutputstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmemorysettingsbackend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmountoperation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnativevolumemonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnetworkaddress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnetworkservice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnullsettingsbackend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goutputstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpermission.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpollableinputstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpollableoutputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpollfilemonitor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gproxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gproxyaddress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gproxyaddressenumerator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gproxyresolver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gregistrysettingsbackend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gresolver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gseekable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsettings-mapping.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsettings-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsettings.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsettingsbackend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsettingsschema.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsimpleaction.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsimpleactiongroup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsimpleasyncresult.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsimplepermission.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketaddress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketaddressenumerator.Plo@am__quote@ @@ -1038,13 +1379,23 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketlistener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketoutputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketservice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocks4aproxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocks4proxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocks5proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsrvtarget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtcpconnection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtcpwrapperconnection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthemedicon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthreadedresolver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthreadedsocketservice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtlsbackend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtlscertificate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtlsclientconnection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtlsconnection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtlsserverconnection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunionvolumemonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixconnection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixcredentialsmessage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixfdlist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixfdmessage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixinputstream.Plo@am__quote@ @@ -1055,11 +1406,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixsocketaddress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixvolume.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunixvolumemonitor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvdb-builder.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvdb-reader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvfs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvolume.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvolumemonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwin32appinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwin32inputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwin32mount.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwin32outputstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwin32resolver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwin32volumemonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzlibcompressor.Plo@am__quote@ @@ -1089,11 +1444,55 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +gvdb-reader.lo: gvdb/gvdb-reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gvdb-reader.lo -MD -MP -MF $(DEPDIR)/gvdb-reader.Tpo -c -o gvdb-reader.lo `test -f 'gvdb/gvdb-reader.c' || echo '$(srcdir)/'`gvdb/gvdb-reader.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gvdb-reader.Tpo $(DEPDIR)/gvdb-reader.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gvdb/gvdb-reader.c' object='gvdb-reader.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gvdb-reader.lo `test -f 'gvdb/gvdb-reader.c' || echo '$(srcdir)/'`gvdb/gvdb-reader.c + +gvdb-builder.o: gvdb/gvdb-builder.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gvdb-builder.o -MD -MP -MF $(DEPDIR)/gvdb-builder.Tpo -c -o gvdb-builder.o `test -f 'gvdb/gvdb-builder.c' || echo '$(srcdir)/'`gvdb/gvdb-builder.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gvdb-builder.Tpo $(DEPDIR)/gvdb-builder.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gvdb/gvdb-builder.c' object='gvdb-builder.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gvdb-builder.o `test -f 'gvdb/gvdb-builder.c' || echo '$(srcdir)/'`gvdb/gvdb-builder.c + +gvdb-builder.obj: gvdb/gvdb-builder.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gvdb-builder.obj -MD -MP -MF $(DEPDIR)/gvdb-builder.Tpo -c -o gvdb-builder.obj `if test -f 'gvdb/gvdb-builder.c'; then $(CYGPATH_W) 'gvdb/gvdb-builder.c'; else $(CYGPATH_W) '$(srcdir)/gvdb/gvdb-builder.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gvdb-builder.Tpo $(DEPDIR)/gvdb-builder.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gvdb/gvdb-builder.c' object='gvdb-builder.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gvdb-builder.obj `if test -f 'gvdb/gvdb-builder.c'; then $(CYGPATH_W) 'gvdb/gvdb-builder.c'; else $(CYGPATH_W) '$(srcdir)/gvdb/gvdb-builder.c'; fi` + mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs +install-dist_schemaDATA: $(dist_schema_DATA) + @$(NORMAL_INSTALL) + test -z "$(schemadir)" || $(MKDIR_P) "$(DESTDIR)$(schemadir)" + @list='$(dist_schema_DATA)'; test -n "$(schemadir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(schemadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(schemadir)" || exit $$?; \ + done + +uninstall-dist_schemaDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_schema_DATA)'; test -n "$(schemadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(schemadir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(schemadir)" && rm -f $$files install-gioincludeHEADERS: $(gioinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(gioincludedir)" || $(MKDIR_P) "$(DESTDIR)$(gioincludedir)" @@ -1134,6 +1533,26 @@ uninstall-giounixincludeHEADERS: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(giounixincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(giounixincludedir)" && rm -f $$files +install-giowin32includeHEADERS: $(giowin32include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(giowin32includedir)" || $(MKDIR_P) "$(DESTDIR)$(giowin32includedir)" + @list='$(giowin32include_HEADERS)'; test -n "$(giowin32includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(giowin32includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(giowin32includedir)" || exit $$?; \ + done + +uninstall-giowin32includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(giowin32include_HEADERS)'; test -n "$(giowin32includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(giowin32includedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(giowin32includedir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -1427,12 +1846,13 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ + $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gioincludedir)" "$(DESTDIR)$(giounixincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(completiondir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(gioincludedir)" "$(DESTDIR)$(giounixincludedir)" "$(DESTDIR)$(giowin32includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1487,8 +1907,9 @@ info: info-recursive info-am: -install-data-am: install-data-local install-gioincludeHEADERS \ - install-giounixincludeHEADERS +install-data-am: install-completionSCRIPTS install-data-local \ + install-dist_schemaDATA install-gioincludeHEADERS \ + install-giounixincludeHEADERS install-giowin32includeHEADERS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive @@ -1535,8 +1956,10 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-gioincludeHEADERS \ - uninstall-giounixincludeHEADERS uninstall-libLTLIBRARIES \ +uninstall-am: uninstall-binPROGRAMS uninstall-completionSCRIPTS \ + uninstall-dist_schemaDATA uninstall-gioincludeHEADERS \ + uninstall-giounixincludeHEADERS \ + uninstall-giowin32includeHEADERS uninstall-libLTLIBRARIES \ uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ @@ -1549,32 +1972,39 @@ uninstall-am: uninstall-binPROGRAMS uninstall-gioincludeHEADERS \ clean-libtool ctags ctags-recursive dist-hook distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-data-hook install-data-local \ + install install-am install-binPROGRAMS \ + install-completionSCRIPTS install-data install-data-am \ + install-data-hook install-data-local install-dist_schemaDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-gioincludeHEADERS install-giounixincludeHEADERS \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ + install-giowin32includeHEADERS install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-gioincludeHEADERS \ - uninstall-giounixincludeHEADERS uninstall-libLTLIBRARIES \ + uninstall-binPROGRAMS uninstall-completionSCRIPTS \ + uninstall-dist_schemaDATA uninstall-gioincludeHEADERS \ + uninstall-giounixincludeHEADERS \ + uninstall-giowin32includeHEADERS uninstall-libLTLIBRARIES \ uninstall-local ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -1601,8 +2031,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -1611,9 +2045,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive install-ms-lib: $(install_ms_lib_cmd) @@ -1622,23 +2076,15 @@ uninstall-ms-lib: $(uninstall_ms_lib_cmd) gio.def: gio.symbols - (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \ + $(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \ mv gio.def.tmp gio.def -gioalias.h: gio.symbols - $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \ - mv gioalias.h.tmp gioalias.h - -gioaliasdef.c: gio.symbols - $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c.tmp && \ - mv gioaliasdef.c.tmp gioaliasdef.c - gio-marshal.h: gio-marshal.list - $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \ + $(AM_V_GEN) $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \ mv $@.tmp $@ gio-marshal.c: gio-marshal.h gio-marshal.list - (echo "#include \"gio-marshal.h\""; \ + $(AM_V_GEN) (echo "#include \"gio-marshal.h\""; \ $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \ mv $@.tmp $@ @@ -1661,18 +2107,20 @@ gio-win32-res.o: gio.rc $(WINDRES) gio.rc $@ gioenumtypes.h: $(gio_headers) gioenumtypes.h.template - ( top_builddir=`cd $(top_builddir) && pwd`; \ + $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \ cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \ gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h gioenumtypes.c: $(gio_headers) gioenumtypes.c.template - ( top_builddir=`cd $(top_builddir) && pwd`; \ + $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \ cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \ gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c gio-2.0.lib: libgio-2.0.la gio.def lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@ +# ------------------------------------------------------------------------ + dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj files='$(BUILT_EXTRA_DIST)'; \ for f in $$files; do \ @@ -1680,7 +2128,7 @@ dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj cp $$d/$$f $(distdir) || exit 1; done ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin - for F in `echo $(libgio_2_0_la_SOURCES) $(win32_sources) $(win32_more_sources_for_vcproj) | tr '/' '\\'`; do \ + for F in `echo $(libgio_2_0_la_SOURCES) $(win32_actual_sources) $(win32_actual_more_sources_for_vcproj) | tr '/' '\\'`; do \ case $$F in \ gunix*.c|gdesktopappinfo.c) ;; \ *.c) echo ' ' \ diff --git a/gio/abicheck.sh b/gio/abicheck.sh index 5796399..2f76d7b 100755 --- a/gio/abicheck.sh +++ b/gio/abicheck.sh @@ -1,6 +1,6 @@ #! /bin/sh -egrep '^#([^i]|if).*[^\]$' "${top_builddir:-..}/glibconfig.h" > glibconfig.cpp +egrep '^#([^i]|if).*[^\]$' "${top_builddir:-..}/glib/glibconfig.h" > glibconfig.cpp INCLUDES="-include ${top_builddir:-..}/config.h" INCLUDES="$INCLUDES -include glibconfig.cpp" @@ -8,6 +8,6 @@ INCLUDES="$INCLUDES -include glibconfig.cpp" cpp -DINCLUDE_VARIABLES -P $INCLUDES -DALL_FILES ${srcdir:-.}/gio.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE$//' | sort > expected-abi rm glibconfig.cpp -nm -D -g --defined-only .libs/libgio-2.0.so | cut -d ' ' -f 3 | sort > actual-abi +nm -D -g --defined-only .libs/libgio-2.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi diff -u expected-abi actual-abi && rm expected-abi actual-abi diff --git a/gio/fam/Makefile.am b/gio/fam/Makefile.am index e4183bd..c2865c7 100644 --- a/gio/fam/Makefile.am +++ b/gio/fam/Makefile.am @@ -19,10 +19,7 @@ libgiofam_la_SOURCES = \ libgiofam_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ diff --git a/gio/fam/Makefile.in b/gio/fam/Makefile.in index 0368757..18c2699 100644 --- a/gio/fam/Makefile.in +++ b/gio/fam/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -124,6 +124,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -148,11 +149,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -166,13 +170,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -219,6 +226,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -226,6 +235,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -251,6 +261,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -267,6 +279,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -276,11 +289,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -296,11 +311,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -314,7 +335,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -359,10 +379,7 @@ libgiofam_la_SOURCES = \ libgiofam_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ @@ -728,13 +745,16 @@ uninstall-am: uninstall-giomoduleLTLIBRARIES uninstall-local ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -761,8 +781,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -771,9 +795,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive install-data-hook: if $(RUN_QUERY_MODULES) && test -z "$(DESTDIR)" ; then \ diff --git a/gio/fam/fam-helper.c b/gio/fam/fam-helper.c index 840c497..6cc7031 100644 --- a/gio/fam/fam-helper.c +++ b/gio/fam/fam-helper.c @@ -25,8 +25,8 @@ #include "config.h" #include #include +#include -#include "gfile.h" #include "fam-helper.h" static FAMConnection* fam_connection = NULL; diff --git a/gio/fam/fam-module.c b/gio/fam/fam-module.c index 91d6d62..79e4915 100644 --- a/gio/fam/fam-module.c +++ b/gio/fam/fam-module.c @@ -23,7 +23,7 @@ * Sebastian Dröge */ -#include "giomodule.h" +#include #include "gfamdirectorymonitor.h" #include "gfamfilemonitor.h" #include "fam-helper.h" diff --git a/gio/fam/gfamdirectorymonitor.c b/gio/fam/gfamdirectorymonitor.c index 831a2bc..72a75d2 100644 --- a/gio/fam/gfamdirectorymonitor.c +++ b/gio/fam/gfamdirectorymonitor.c @@ -26,7 +26,7 @@ #include "config.h" #include "gfamdirectorymonitor.h" -#include "giomodule.h" +#include #include "fam-helper.h" diff --git a/gio/fam/gfamdirectorymonitor.h b/gio/fam/gfamdirectorymonitor.h index 48192d1..8945da1 100644 --- a/gio/fam/gfamdirectorymonitor.h +++ b/gio/fam/gfamdirectorymonitor.h @@ -28,8 +28,8 @@ #include #include -#include "glocaldirectorymonitor.h" -#include "giomodule.h" +#include +#include G_BEGIN_DECLS diff --git a/gio/fam/gfamfilemonitor.c b/gio/fam/gfamfilemonitor.c index 1855047..47e207f 100644 --- a/gio/fam/gfamfilemonitor.c +++ b/gio/fam/gfamfilemonitor.c @@ -26,7 +26,7 @@ #include "config.h" #include "gfamfilemonitor.h" -#include "giomodule.h" +#include #include "fam-helper.h" diff --git a/gio/fam/gfamfilemonitor.h b/gio/fam/gfamfilemonitor.h index 559384e..b1b101f 100644 --- a/gio/fam/gfamfilemonitor.h +++ b/gio/fam/gfamfilemonitor.h @@ -29,8 +29,8 @@ #include #include #include -#include "glocalfilemonitor.h" -#include "giomodule.h" +#include +#include G_BEGIN_DECLS diff --git a/gio/fen/Makefile.am b/gio/fen/Makefile.am index 1acaa44..52af1cf 100644 --- a/gio/fen/Makefile.am +++ b/gio/fen/Makefile.am @@ -11,14 +11,8 @@ libfen_la_SOURCES = \ fen-kernel.h \ fen-node.c \ fen-node.h \ - fen-missing.c \ - fen-missing.h \ fen-helper.c \ fen-helper.h \ - fen-data.c \ - fen-data.h \ - fen-sub.c \ - fen-sub.h \ gfenfilemonitor.c \ gfenfilemonitor.h \ gfendirectorymonitor.c \ @@ -27,11 +21,7 @@ libfen_la_SOURCES = \ libfen_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ - -I$(top_builddir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ diff --git a/gio/fen/Makefile.in b/gio/fen/Makefile.in index d7140be..be5bd16 100644 --- a/gio/fen/Makefile.in +++ b/gio/fen/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -56,10 +56,9 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libfen_la_LIBADD = am__objects_1 = am_libfen_la_OBJECTS = libfen_la-fen-dump.lo libfen_la-fen-kernel.lo \ - libfen_la-fen-node.lo libfen_la-fen-missing.lo \ - libfen_la-fen-helper.lo libfen_la-fen-data.lo \ - libfen_la-fen-sub.lo libfen_la-gfenfilemonitor.lo \ - libfen_la-gfendirectorymonitor.lo $(am__objects_1) + libfen_la-fen-node.lo libfen_la-fen-helper.lo \ + libfen_la-gfenfilemonitor.lo libfen_la-gfendirectorymonitor.lo \ + $(am__objects_1) libfen_la_OBJECTS = $(am_libfen_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -99,6 +98,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -123,11 +123,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -141,13 +144,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -194,6 +200,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -201,6 +209,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -226,6 +235,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -242,6 +253,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -251,11 +263,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -271,11 +285,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -289,7 +309,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -327,14 +346,8 @@ libfen_la_SOURCES = \ fen-kernel.h \ fen-node.c \ fen-node.h \ - fen-missing.c \ - fen-missing.h \ fen-helper.c \ fen-helper.h \ - fen-data.c \ - fen-data.h \ - fen-sub.c \ - fen-sub.h \ gfenfilemonitor.c \ gfenfilemonitor.h \ gfendirectorymonitor.c \ @@ -343,11 +356,7 @@ libfen_la_SOURCES = \ libfen_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ - -I$(top_builddir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ @@ -405,13 +414,10 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-dump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-kernel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-missing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-node.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-fen-sub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-gfendirectorymonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfen_la-gfenfilemonitor.Plo@am__quote@ @@ -463,14 +469,6 @@ libfen_la-fen-node.lo: fen-node.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -c -o libfen_la-fen-node.lo `test -f 'fen-node.c' || echo '$(srcdir)/'`fen-node.c -libfen_la-fen-missing.lo: fen-missing.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -MT libfen_la-fen-missing.lo -MD -MP -MF $(DEPDIR)/libfen_la-fen-missing.Tpo -c -o libfen_la-fen-missing.lo `test -f 'fen-missing.c' || echo '$(srcdir)/'`fen-missing.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfen_la-fen-missing.Tpo $(DEPDIR)/libfen_la-fen-missing.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fen-missing.c' object='libfen_la-fen-missing.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -c -o libfen_la-fen-missing.lo `test -f 'fen-missing.c' || echo '$(srcdir)/'`fen-missing.c - libfen_la-fen-helper.lo: fen-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -MT libfen_la-fen-helper.lo -MD -MP -MF $(DEPDIR)/libfen_la-fen-helper.Tpo -c -o libfen_la-fen-helper.lo `test -f 'fen-helper.c' || echo '$(srcdir)/'`fen-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfen_la-fen-helper.Tpo $(DEPDIR)/libfen_la-fen-helper.Plo @@ -479,22 +477,6 @@ libfen_la-fen-helper.lo: fen-helper.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -c -o libfen_la-fen-helper.lo `test -f 'fen-helper.c' || echo '$(srcdir)/'`fen-helper.c -libfen_la-fen-data.lo: fen-data.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -MT libfen_la-fen-data.lo -MD -MP -MF $(DEPDIR)/libfen_la-fen-data.Tpo -c -o libfen_la-fen-data.lo `test -f 'fen-data.c' || echo '$(srcdir)/'`fen-data.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfen_la-fen-data.Tpo $(DEPDIR)/libfen_la-fen-data.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fen-data.c' object='libfen_la-fen-data.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -c -o libfen_la-fen-data.lo `test -f 'fen-data.c' || echo '$(srcdir)/'`fen-data.c - -libfen_la-fen-sub.lo: fen-sub.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -MT libfen_la-fen-sub.lo -MD -MP -MF $(DEPDIR)/libfen_la-fen-sub.Tpo -c -o libfen_la-fen-sub.lo `test -f 'fen-sub.c' || echo '$(srcdir)/'`fen-sub.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfen_la-fen-sub.Tpo $(DEPDIR)/libfen_la-fen-sub.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fen-sub.c' object='libfen_la-fen-sub.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -c -o libfen_la-fen-sub.lo `test -f 'fen-sub.c' || echo '$(srcdir)/'`fen-sub.c - libfen_la-gfenfilemonitor.lo: gfenfilemonitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfen_la_CFLAGS) $(CFLAGS) -MT libfen_la-gfenfilemonitor.lo -MD -MP -MF $(DEPDIR)/libfen_la-gfenfilemonitor.Tpo -c -o libfen_la-gfenfilemonitor.lo `test -f 'gfenfilemonitor.c' || echo '$(srcdir)/'`gfenfilemonitor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfen_la-gfenfilemonitor.Tpo $(DEPDIR)/libfen_la-gfenfilemonitor.Plo @@ -720,13 +702,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -753,8 +738,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -763,9 +752,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gio/fen/fen-data.c b/gio/fen/fen-data.c deleted file mode 100644 index fed317f..0000000 --- a/gio/fen/fen-data.c +++ /dev/null @@ -1,718 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:set expandtab ts=4 shiftwidth=4: */ -/* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Lin Ma - */ - -#include "config.h" -#include -#include -#include -#include -#include -#include -#include "fen-data.h" -#include "fen-kernel.h" -#include "fen-missing.h" -#include "fen-dump.h" - -#define PROCESS_EVENTQ_TIME 10 /* in milliseconds */ -#define PAIR_EVENTS_TIMEVAL 00000 /* in microseconds */ -#define PAIR_EVENTS_INC_TIMEVAL 0000 /* in microseconds */ -#define SCAN_CHANGINGS_TIME 50 /* in milliseconds */ -#define SCAN_CHANGINGS_MAX_TIME (4*100) /* in milliseconds */ -#define SCAN_CHANGINGS_MIN_TIME (4*100) /* in milliseconds */ -#define INIT_CHANGES_NUM 2 -#define BASE_NUM 2 - -#ifdef GIO_COMPILATION -#define FD_W if (fd_debug_enabled) g_warning -static gboolean fd_debug_enabled = FALSE; -#else -#include "gam_error.h" -#define FD_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__) -#endif - -G_LOCK_EXTERN (fen_lock); -static GList *deleting_data = NULL; -static guint deleting_data_id = 0; - -static void (*emit_once_cb) (fdata *f, int events, gpointer sub); -static void (*emit_cb) (fdata *f, int events); -static int (*_event_converter) (int event); - -static gboolean fdata_delete (fdata* f); -static gint fdata_sub_find (gpointer a, gpointer b); -static void scan_children (node_t *f); -static void scan_known_children (node_t* f); - -node_t* -_add_missing_cb (node_t* parent, gpointer user_data) -{ - g_assert (parent); - FD_W ("%s p:0x%p %s\n", __func__, parent, (gchar*)user_data); - return _add_node (parent, (gchar*)user_data); -} - -gboolean -_pre_del_cb (node_t* node, gpointer user_data) -{ - fdata* data; - - g_assert (node); - data = _node_get_data (node); - FD_W ("%s node:0x%p %s\n", __func__, node, NODE_NAME(node)); - if (data != NULL) { - if (!FN_IS_PASSIVE(data)) { - return FALSE; - } - fdata_delete (data); - } - return TRUE; -} - -static guint -_pow (guint x, guint y) -{ - guint z = 1; - g_assert (x >= 0 && y >= 0); - for (; y > 0; y--) { - z *= x; - } - return z; -} - -static guint -get_scalable_scan_time (fdata* data) -{ - guint sleep_time; - /* Caculate from num = 0 */ - sleep_time = _pow (BASE_NUM, data->changed_event_num) * SCAN_CHANGINGS_TIME; - if (sleep_time < SCAN_CHANGINGS_MIN_TIME) { - sleep_time = SCAN_CHANGINGS_MIN_TIME; - } else if (sleep_time > SCAN_CHANGINGS_MAX_TIME) { - sleep_time = SCAN_CHANGINGS_MAX_TIME; - data->change_update_id = INIT_CHANGES_NUM; - } - FD_W ("SCALABE SCAN num:time [ %4u : %4u ] %s\n", data->changed_event_num, sleep_time, FN_NAME(data)); - return sleep_time; -} - -static gboolean -g_timeval_lt (GTimeVal *val1, GTimeVal *val2) -{ - if (val1->tv_sec < val2->tv_sec) - return TRUE; - - if (val1->tv_sec > val2->tv_sec) - return FALSE; - - /* val1->tv_sec == val2->tv_sec */ - if (val1->tv_usec < val2->tv_usec) - return TRUE; - - return FALSE; -} - -/* - * If all active children nodes are ported, then cancel monitor the parent node - * - * Unsafe, need lock. - */ -static void -scan_known_children (node_t* f) -{ - GDir *dir; - GError *err = NULL; - fdata* pdata; - - FD_W ("%s %s [0x%p]\n", __func__, NODE_NAME(f), f); - pdata = _node_get_data (f); - /* - * Currect fdata must is directly monitored. Be sure it is 1 level monitor. - */ - dir = g_dir_open (NODE_NAME(f), 0, &err); - if (dir) { - const char *basename; - - while ((basename = g_dir_read_name (dir))) - { - node_t* childf = NULL; - fdata* data; - GList *idx; - /* - * If the node is existed, and isn't ported, then emit created - * event. Ignore others. - */ - childf = _children_find (f, basename); - if (childf && - (data = _node_get_data (childf)) != NULL && - !FN_IS_PASSIVE (data)) { - if (!is_monitoring (data) && - _port_add (&data->fobj, &data->len, data)) { - _fdata_emit_events (data, FN_EVENT_CREATED); - } - } - } - g_dir_close (dir); - } else { - FD_W (err->message); - g_error_free (err); - } -} - -static void -scan_children (node_t *f) -{ - GDir *dir; - GError *err = NULL; - fdata* pdata; - - FD_W ("%s %s [0x%p]\n", __func__, NODE_NAME(f), f); - pdata = _node_get_data (f); - /* - * Currect fdata must is directly monitored. Be sure it is 1 level monitor. - */ - dir = g_dir_open (NODE_NAME(f), 0, &err); - if (dir) { - const char *basename; - - while ((basename = g_dir_read_name (dir))) - { - node_t* childf = NULL; - fdata* data; - GList *idx; - - childf = _children_find (f, basename); - if (childf == NULL) { - gchar *filename; - - filename = g_build_filename (NODE_NAME(f), basename, NULL); - childf = _add_node (f, filename); - g_assert (childf); - data = _fdata_new (childf, FALSE); - g_free (filename); - } - if ((data = _node_get_data (childf)) == NULL) { - data = _fdata_new (childf, FALSE); - } - /* Be sure data isn't ported and add to port successfully */ - /* Don't need delete it, it will be deleted by the parent */ - if (is_monitoring (data)) { - /* Ignored */ - } else if (/* !_is_ported (data) && */ - _port_add (&data->fobj, &data->len, data)) { - _fdata_emit_events (data, FN_EVENT_CREATED); - } - } - g_dir_close (dir); - } else { - FD_W (err->message); - g_error_free (err); - } -} - -static gboolean -scan_deleting_data (gpointer data) -{ - fdata *f; - GList* i; - GList* deleted_list = NULL; - gboolean ret = TRUE; - - if (G_TRYLOCK (fen_lock)) { - for (i = deleting_data; i; i = i->next) { - f = (fdata*)i->data; - if (fdata_delete (f)) { - deleted_list = g_list_prepend (deleted_list, i); - } - } - - for (i = deleted_list; i; i = i->next) { - deleting_data = g_list_remove_link (deleting_data, - (GList *)i->data); - g_list_free_1 ((GList *)i->data); - } - g_list_free (deleted_list); - - if (deleting_data == NULL) { - deleting_data_id = 0; - ret = FALSE; - } - G_UNLOCK (fen_lock); - } - return ret; -} - -gboolean -is_monitoring (fdata* data) -{ - return _is_ported (data) || data->change_update_id > 0; -} - -fdata* -_get_parent_data (fdata* data) -{ - if (FN_NODE(data) && !IS_TOPNODE(FN_NODE(data))) { - return _node_get_data (FN_NODE(data)->parent); - } - return NULL; -} - -node_t* -_get_parent_node (fdata* data) -{ - if (FN_NODE(data)) { - return (FN_NODE(data)->parent); - } - return NULL; -} - -fdata * -_fdata_new (node_t* node, gboolean is_mondir) -{ - fdata *f = NULL; - - g_assert (node); - if ((f = g_new0 (fdata, 1)) != NULL) { - FN_NODE(f) = node; - FN_NAME(f) = g_strdup (NODE_NAME(node)); - f->is_dir = is_mondir; - f->eventq = g_queue_new (); - FD_W ("[ %s ] 0x%p %s\n", __func__, f, FN_NAME(f)); - _node_set_data (node, f); - } - return f; -} - -static gboolean -fdata_delete (fdata *f) -{ - fnode_event_t *ev; - - FD_W ("[ TRY %s ] 0x%p id[%4d:%4d] %s\n", __func__, f, f->eventq_id, f->change_update_id, FN_NAME(f)); - g_assert (FN_IS_PASSIVE(f)); - - _port_remove (f); - /* _missing_remove (f); */ - - if (f->node != NULL) { - _node_set_data (f->node, NULL); - f->node = NULL; - } - - if (f->change_update_id > 0 || f->eventq_id > 0) { - if (FN_IS_LIVING(f)) { - f->is_cancelled = TRUE; - deleting_data = g_list_prepend (deleting_data, f); - if (deleting_data_id == 0) { - deleting_data_id = g_idle_add (scan_deleting_data, NULL); - g_assert (deleting_data_id > 0); - } - } - return FALSE; - } - FD_W ("[ %s ] 0x%p %s\n", __func__, f, FN_NAME(f)); - - while ((ev = g_queue_pop_head (f->eventq)) != NULL) { - _fnode_event_delete (ev); - } - - g_queue_free (f->eventq); - g_free (FN_NAME(f)); - g_free (f); - return TRUE; -} - -void -_fdata_reset (fdata* data) -{ - fnode_event_t *ev; - - g_assert (data); - - while ((ev = g_queue_pop_head (data->eventq)) != NULL) { - _fnode_event_delete (ev); - } -} - -static gint -fdata_sub_find (gpointer a, gpointer b) -{ - if (a != b) { - return 1; - } else { - return 0; - } -} - -void -_fdata_sub_add (fdata *f, gpointer sub) -{ - FD_W ("[%s] [data: 0x%p ] [s: 0x%p ] %s\n", __func__, f, sub, FN_NAME(f)); - g_assert (g_list_find_custom (f->subs, sub, (GCompareFunc)fdata_sub_find) == NULL); - f->subs = g_list_prepend (f->subs, sub); -} - -void -_fdata_sub_remove (fdata *f, gpointer sub) -{ - GList *l; - FD_W ("[%s] [data: 0x%p ] [s: 0x%p ] %s\n", __func__, f, sub, FN_NAME(f)); - g_assert (g_list_find_custom (f->subs, sub, (GCompareFunc)fdata_sub_find) != NULL); - l = g_list_find_custom (f->subs, sub, (GCompareFunc)fdata_sub_find); - g_assert (l); - g_assert (sub == l->data); - f->subs = g_list_delete_link (f->subs, l); -} - -/* - * Adjust self on failing to Port - */ -void -_fdata_adjust_deleted (fdata* f) -{ - node_t* parent; - fdata* pdata; - node_op_t op = {NULL, NULL, _pre_del_cb, NULL}; - - /* - * It's a top node. We move it to missing list. - */ - parent = _get_parent_node (f); - pdata = _get_parent_data (f); - if (!FN_IS_PASSIVE(f) || - _children_num (FN_NODE(f)) > 0 || - (pdata && !FN_IS_PASSIVE(pdata))) { - if (parent) { - if (pdata == NULL) { - pdata = _fdata_new (parent, FALSE); - } - g_assert (pdata); - if (!_port_add (&pdata->fobj, &pdata->len, pdata)) { - _fdata_adjust_deleted (pdata); - } - } else { - /* f is root */ - g_assert (IS_TOPNODE(FN_NODE(f))); - _missing_add (f); - } - } else { -#ifdef GIO_COMPILATION - _pending_remove_node (FN_NODE(f), &op); -#else - _remove_node (FN_NODE(f), &op); -#endif - } -} - -static gboolean -fdata_adjust_changed (fdata *f) -{ - fnode_event_t *ev; - struct stat buf; - node_t* parent; - fdata* pdata; - - G_LOCK (fen_lock); - parent = _get_parent_node (f); - pdata = _get_parent_data (f); - - if (!FN_IS_LIVING(f) || - (_children_num (FN_NODE(f)) == 0 && - FN_IS_PASSIVE(f) && - pdata && FN_IS_PASSIVE(pdata))) { - f->change_update_id = 0; - G_UNLOCK (fen_lock); - return FALSE; - } - - FD_W ("[ %s ] %s\n", __func__, FN_NAME(f)); - if (FN_STAT (FN_NAME(f), &buf) != 0) { - FD_W ("LSTAT [%-20s] %s\n", FN_NAME(f), g_strerror (errno)); - goto L_delete; - } - f->is_dir = S_ISDIR (buf.st_mode) ? TRUE : FALSE; - if (f->len != buf.st_size) { - /* FD_W ("LEN [%lld:%lld] %s\n", f->len, buf.st_size, FN_NAME(f)); */ - f->len = buf.st_size; - ev = _fnode_event_new (FILE_MODIFIED, TRUE, f); - if (ev != NULL) { - ev->is_pending = TRUE; - _fdata_add_event (f, ev); - } - /* Fdata is still changing, so scalable scan */ - f->change_update_id = g_timeout_add (get_scalable_scan_time (f), - (GSourceFunc)fdata_adjust_changed, - (gpointer)f); - G_UNLOCK (fen_lock); - return FALSE; - } else { - f->changed_event_num = 0; - f->fobj.fo_atime = buf.st_atim; - f->fobj.fo_mtime = buf.st_mtim; - f->fobj.fo_ctime = buf.st_ctim; - if (FN_IS_DIR(f)) { - if (FN_IS_MONDIR(f)) { - scan_children (FN_NODE(f)); - } else { - scan_known_children (FN_NODE(f)); - if ((_children_num (FN_NODE(f)) == 0 && - FN_IS_PASSIVE(f) && - pdata && FN_IS_PASSIVE(pdata))) { - _port_remove (f); - goto L_exit; - } - } - } - if (!_port_add_simple (&f->fobj, f)) { - L_delete: - ev = _fnode_event_new (FILE_DELETE, FALSE, f); - if (ev != NULL) { - _fdata_add_event (f, ev); - } - } - } -L_exit: - f->change_update_id = 0; - G_UNLOCK (fen_lock); - return FALSE; -} - -void -_fdata_emit_events_once (fdata *f, int event, gpointer sub) -{ - emit_once_cb (f, _event_converter (event), sub); -} - -void -_fdata_emit_events (fdata *f, int event) -{ - emit_cb (f, _event_converter (event)); -} - -static gboolean -process_events (gpointer udata) -{ - node_op_t op = {NULL, NULL, _pre_del_cb, NULL}; - fdata* f; - fnode_event_t* ev; - int e; - - /* FD_W ("IN <======== %s\n", __func__); */ - - f = (fdata*)udata; - FD_W ("%s 0x%p id:%-4d %s\n", __func__, f, f->eventq_id, FN_NAME(f)); - - G_LOCK (fen_lock); - - if (!FN_IS_LIVING(f)) { - f->eventq_id = 0; - G_UNLOCK (fen_lock); - return FALSE; - } - - if ((ev = (fnode_event_t*)g_queue_pop_head (f->eventq)) != NULL) { - /* Send events to clients. */ - e = ev->e; - if (!ev->is_pending) { -#ifdef GIO_COMPILATION - if (ev->has_twin) { - _fdata_emit_events (f, FILE_ATTRIB); - } -#endif - _fdata_emit_events (f, ev->e); - } - - _fnode_event_delete (ev); - ev = NULL; - - /* Adjust node state. */ - /* - * Node the node has been created, so we can delete create event in - * optimizing. To reduce the statings, we add it to Port on discoving - * it then emit CREATED event. So we don't need to do anything here. - */ - switch (e) { - case FILE_MODIFIED: - case MOUNTEDOVER: - case UNMOUNTED: - /* If the event is a changed event, then pending process it */ - if (f->change_update_id == 0) { - f->change_update_id = g_timeout_add (get_scalable_scan_time(f), - (GSourceFunc)fdata_adjust_changed, - (gpointer)f); - g_assert (f->change_update_id > 0); - } - break; - case FILE_ATTRIB: - g_assert (f->change_update_id == 0); - if (!_port_add (&f->fobj, &f->len, f)) { - ev = _fnode_event_new (FILE_DELETE, FALSE, f); - if (ev != NULL) { - _fdata_add_event (f, ev); - } - } - break; - case FILE_DELETE: /* Ignored */ - break; - default: - g_assert_not_reached (); - break; - } - /* Process one event a time */ - G_UNLOCK (fen_lock); - return TRUE; - } - f->eventq_id = 0; - G_UNLOCK (fen_lock); - /* FD_W ("OUT ========> %s\n", __func__); */ - return FALSE; -} - -void -_fdata_add_event (fdata *f, fnode_event_t *ev) -{ - node_op_t op = {NULL, NULL, _pre_del_cb, NULL}; - fnode_event_t *tail; - - if (!FN_IS_LIVING(f)) { - _fnode_event_delete (ev); - return; - } - - FD_W ("%s %d\n", __func__, ev->e); - g_get_current_time (&ev->t); - /* - * If created/deleted events of child node happened, then we use parent - * event queue to handle. - * If child node emits deleted event, it seems no changes for the parent - * node, but the attr is changed. So we may try to cancel processing the - * coming changed events of the parent node. - */ - tail = (fnode_event_t*)g_queue_peek_tail (f->eventq); - switch (ev->e) { - case FILE_RENAME_FROM: - case FILE_RENAME_TO: - case FILE_ACCESS: - _fnode_event_delete (ev); - g_assert_not_reached (); - return; - case FILE_DELETE: - /* clear changed event number */ - f->changed_event_num = 0; - /* - * We will cancel all previous events. - */ - if (tail) { - g_queue_pop_tail (f->eventq); - do { - _fnode_event_delete (tail); - } while ((tail = (fnode_event_t*)g_queue_pop_tail (f->eventq)) != NULL); - } - /* - * Given a node "f" is deleted, process it ASAP. - */ - _fdata_emit_events (f, ev->e); - _fnode_event_delete (ev); - _fdata_adjust_deleted (f); - return; - case FILE_MODIFIED: - case UNMOUNTED: - case MOUNTEDOVER: - /* clear changed event number */ - f->changed_event_num ++; - case FILE_ATTRIB: - default: - /* - * If in the time range, we will try optimizing - * (changed+) to (changed) - * (attrchanged changed) to ([changed, attrchanged]) - * (event attrchanged) to ([event, attrchanged]) - */ - if (tail) { - do { - if (tail->e == ev->e) { - if (g_timeval_lt (&ev->t, &tail->t)) { - g_queue_peek_tail (f->eventq); - /* Add the increment */ - g_time_val_add (&ev->t, PAIR_EVENTS_INC_TIMEVAL); - /* skip the previous event */ - FD_W ("SKIPPED -- %s\n", _event_string (tail->e)); - _fnode_event_delete (tail); - } else { - break; - } - } else if (ev->e == FILE_MODIFIED && tail->e == FILE_ATTRIB) { - ev->has_twin = TRUE; - _fnode_event_delete (tail); - } else if (ev->e == FILE_ATTRIB && f->change_update_id > 0) { - tail->has_twin = TRUE; - /* skip the current event */ - _fnode_event_delete (ev); - return; - } else { - break; - } - } while ((tail = (fnode_event_t*)g_queue_peek_tail (f->eventq)) != NULL); - } - } - - /* must add the threshold time */ - g_time_val_add (&ev->t, PAIR_EVENTS_TIMEVAL); - - g_queue_push_tail (f->eventq, ev); - - /* starting process_events */ - if (f->eventq_id == 0) { - f->eventq_id = g_timeout_add (PROCESS_EVENTQ_TIME, - process_events, - (gpointer)f); - g_assert (f->eventq_id > 0); - } - FD_W ("%s 0x%p id:%-4d %s\n", __func__, f, f->eventq_id, FN_NAME(f)); -} - -gboolean -_fdata_class_init (void (*user_emit_cb) (fdata*, int), - void (*user_emit_once_cb) (fdata*, int, gpointer), - int (*user_event_converter) (int event)) -{ - FD_W ("%s\n", __func__); - if (user_emit_cb == NULL) { - return FALSE; - } - if (user_emit_once_cb == NULL) { - return FALSE; - } - if (user_event_converter == NULL) { - return FALSE; - } - emit_cb = user_emit_cb; - emit_once_cb = user_emit_once_cb; - _event_converter = user_event_converter; - - if (!_port_class_init (_fdata_add_event)) { - FD_W ("_port_class_init failed."); - return FALSE; - } - return TRUE; -} diff --git a/gio/fen/fen-data.h b/gio/fen/fen-data.h deleted file mode 100644 index 67419a2..0000000 --- a/gio/fen/fen-data.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:set expandtab ts=4 shiftwidth=4: */ -/* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Lin Ma - */ - -#include -#include -#include -#include "fen-node.h" -#include "fen-kernel.h" - -#ifndef _FEN_DATA_H_ -#define _FEN_DATA_H_ - -#define FN_EVENT_CREATED 0 -#define FN_NAME(fp) (((fdata*)(fp))->fobj.fo_name) -#define FN_NODE(fp) (((fdata*)(fp))->node) -#define FN_IS_DIR(fp) (((fdata*)(fp))->is_dir) -#define FN_IS_PASSIVE(fp) (((fdata*)(fp))->subs == NULL) -#define FN_IS_MONDIR(fp) (((fdata*)(fp))->mon_dir_num > 0) -#define FN_IS_LIVING(fp) (!((fdata*)(fp))->is_cancelled) - -typedef struct -{ - file_obj_t fobj; - off_t len; - gboolean is_cancelled; - - node_t* node; - /* to identify if the path is dir */ - gboolean is_dir; - guint mon_dir_num; - - /* List of subscriptions monitoring this fdata/path */ - GList *subs; - - /* prcessed changed events num */ - guint changed_event_num; - - /* process events source id */ - GQueue* eventq; - guint eventq_id; - guint change_update_id; -} fdata; - -/* fdata functions */ -fdata* _fdata_new (node_t* node, gboolean is_mondir); -void _fdata_reset (fdata* data); -void _fdata_emit_events_once (fdata *f, int event, gpointer sub); -void _fdata_emit_events (fdata *f, int event); -void _fdata_add_event (fdata *f, fnode_event_t *ev); -void _fdata_adjust_deleted (fdata *f); -fdata* _get_parent_data (fdata* data); -node_t* _get_parent_node (fdata* data); -gboolean _is_monitoring (fdata* data); - -/* sub */ -void _fdata_sub_add (fdata *f, gpointer sub); -void _fdata_sub_remove (fdata *f, gpointer sub); - -/* misc */ -node_t* _add_missing_cb (node_t* parent, gpointer user_data); -gboolean _pre_del_cb (node_t* node, gpointer user_data); - -/* init */ -gboolean _fdata_class_init (void (*user_emit_cb) (fdata*, int), - void (*user_emit_once_cb) (fdata*, int, gpointer), - int (*user_event_converter) (int event)); - -#endif /* _FEN_DATA_H_ */ diff --git a/gio/fen/fen-dump.c b/gio/fen/fen-dump.c index d9ac363..7a34fa4 100644 --- a/gio/fen/fen-dump.c +++ b/gio/fen/fen-dump.c @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,9 +26,6 @@ #include #include #include "fen-node.h" -#include "fen-data.h" -#include "fen-kernel.h" -#include "fen-missing.h" #include "fen-dump.h" G_LOCK_EXTERN (fen_lock); @@ -37,25 +34,16 @@ G_LOCK_EXTERN (fen_lock); static void dump_node (node_t* node, gpointer data) { - if (data && node->user_data) { - return; - } - g_printf ("[%s] < 0x%p : 0x%p > %s\n", __func__, node, node->user_data, NODE_NAME(node)); + g_printf ("n:0x%p ds:0x%p s:0x%p %s\n", node, node->dir_subs, node->subs, NODE_NAME(node)); } -static gboolean -dump_node_tree (node_t* node, gpointer user_data) +static void +dump_tree (node_t* node) { - node_op_t op = {dump_node, NULL, NULL, user_data}; - GList* children; - GList* i; if (G_TRYLOCK (fen_lock)) { - if (node) { - _travel_nodes (node, &op); - } + node_traverse(NULL, dump_node, NULL); G_UNLOCK (fen_lock); } - return TRUE; } /* ------------------ fdata port hash --------------------*/ @@ -64,7 +52,7 @@ dump_hash_cb (gpointer key, gpointer value, gpointer user_data) { - g_printf ("[%s] < 0x%p : 0x%p >\n", __func__, key, value); + g_printf ("k:0x%p v:0x%p >\n", key, value); } gboolean @@ -81,20 +69,8 @@ dump_hash (GHashTable* hash, gpointer user_data) /* ------------------ event --------------------*/ void -dump_event (fnode_event_t* ev, gpointer user_data) +dump_event (node_event_t* ev, gpointer user_data) { - fdata* data = ev->user_data; - g_printf ("[%s] < 0x%p : 0x%p > [ %10s ] %s\n", __func__, ev, ev->user_data, _event_string (ev->e), FN_NAME(data)); + node_t* node = ev->user_data; + g_printf ("ne:0x%p e:%p n:0x%p ds:0x%p s:0x%p s\n", ev, ev->e, node, node->dir_subs, node->subs, NODE_NAME(node)); } - -void -dump_event_queue (fdata* data, gpointer user_data) -{ - if (G_TRYLOCK (fen_lock)) { - if (data->eventq) { - g_queue_foreach (data->eventq, (GFunc)dump_event, user_data); - } - G_UNLOCK (fen_lock); - } -} - diff --git a/gio/fen/fen-dump.h b/gio/fen/fen-dump.h index 0e866fa..ffac822 100644 --- a/gio/fen/fen-dump.h +++ b/gio/fen/fen-dump.h @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/gio/fen/fen-helper.c b/gio/fen/fen-helper.c index c05cb41..418d003 100644 --- a/gio/fen/fen-helper.c +++ b/gio/fen/fen-helper.c @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,12 +24,10 @@ #include "config.h" #include -#include "fen-data.h" #include "fen-helper.h" #include "fen-kernel.h" #ifdef GIO_COMPILATION -#include "gfile.h" -#include "gfilemonitor.h" +#include #else #include "gam_event.h" #include "gam_server.h" @@ -37,7 +35,7 @@ #endif #ifdef GIO_COMPILATION -#define FH_W if (fh_debug_enabled) g_warning +#define FH_W if (fh_debug_enabled) g_debug static gboolean fh_debug_enabled = FALSE; #else #include "gam_error.h" @@ -46,292 +44,153 @@ static gboolean fh_debug_enabled = FALSE; G_LOCK_EXTERN (fen_lock); -static void default_emit_event_cb (fdata *f, int events); -static void default_emit_once_event_cb (fdata *f, int events, gpointer sub); -static int default_event_converter (int event); - +/* misc */ static void -scan_children_init (node_t *f, gpointer sub) +scan_children_init(node_t *f, gpointer sub) { - GDir *dir; - GError *err = NULL; - node_op_t op = {NULL, NULL, _pre_del_cb, NULL}; - fdata* pdata; - + gboolean emit; + gint event; + FH_W ("%s %s [0x%p]\n", __func__, NODE_NAME(f), f); - pdata = _node_get_data (f); - dir = g_dir_open (NODE_NAME(f), 0, &err); - if (dir) { - const char *basename; - - while ((basename = g_dir_read_name (dir))) - { - node_t *childf = NULL; - fdata* data; - GList *idx; +#ifdef GIO_COMPILATION + emit = FALSE; + event = G_FILE_MONITOR_EVENT_CREATED; +#else + emit = TRUE; + event = GAMIN_EVENT_EXISTS; +#endif + + if (!NODE_HAS_FLAG(f, NODE_FLAG_SNAPSHOT_UPDATED)) { + /* TODO snapshot should also compare to the sub created timestamp. */ + /* GIO initially doesn't emit created/existed events. */ + node_create_children_snapshot(f, event, emit); + } else { + GHashTableIter iter; + gpointer value; + + g_hash_table_iter_init (&iter, f->children); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + node_t *child = (node_t *)value; - childf = _children_find (f, basename); - if (childf == NULL) { - gchar *filename; - - filename = g_build_filename (NODE_NAME(f), basename, NULL); - childf = _add_node (f, filename); - g_assert (childf); - g_free (filename); - } - if ((data = _node_get_data (childf)) == NULL) { - data = _fdata_new (childf, FALSE); - } - - if (is_monitoring (data)) { - /* Ignored */ - } else if (/* !_is_ported (data) && */ - _port_add (&data->fobj, &data->len, data)) { - /* Emit created to all other subs */ - _fdata_emit_events (data, FN_EVENT_CREATED); - } - /* Emit created to the new sub */ #ifdef GIO_COMPILATION - /* _fdata_emit_events_once (data, FN_EVENT_CREATED, sub); */ + /* GIO initially doesn't emit created/existed events. */ + /* g_file_monitor_emit_event(G_FILE_MONITOR(sub), child->gfile, NULL, event); */ #else - gam_server_emit_one_event (NODE_NAME(childf), - gam_subscription_is_dir (sub), GAMIN_EVENT_EXISTS, sub, 1); + gam_server_emit_one_event(NODE_NAME(child), gam_subscription_is_dir(sub), event, sub, 1); #endif } - g_dir_close (dir); - } else { - FH_W (err->message); - g_error_free (err); } } /** - * _fen_add + * fen_add * - * Won't hold a ref, we have a timout callback to clean unused fdata. + * Won't hold a ref, we have a timout callback to clean unused node_t. * If there is no value for a key, add it and return it; else return the old * one. */ void -_fen_add (const gchar *filename, gpointer sub, gboolean is_mondir) +fen_add (const gchar *filename, gpointer sub, gboolean is_mondir) { - node_op_t op = {NULL, _add_missing_cb, _pre_del_cb, (gpointer)filename}; node_t* f; - fdata* data; - + g_assert (filename); g_assert (sub); G_LOCK (fen_lock); - f = _find_node_full (filename, &op); - FH_W ("[ %s ] f[0x%p] sub[0x%p] %s\n", __func__, f, sub, filename); + f = node_find(NULL, filename, TRUE); + FH_W ("%s 0x%p sub[0x%p] %s\n", __func__, f, sub, filename); g_assert (f); - data = _node_get_data (f); - if (data == NULL) { - data = _fdata_new (f, is_mondir); + + /* Update timestamp, the events in global queue will compare itself to this + * timestamp to decide if be emitted. TODO, timestamp should be per sub. + */ + if (!NODE_IS_ACTIVE(f)) { + g_get_current_time(&f->atv); } if (is_mondir) { - data->mon_dir_num ++; - } - - /* Change to active */ -#ifdef GIO_COMPILATION - if (_port_add (&data->fobj, &data->len, data) || - g_file_test (FN_NAME(data), G_FILE_TEST_EXISTS)) { - if (is_mondir) { - scan_children_init (f, sub); - } - _fdata_sub_add (data, sub); + f->dir_subs = g_list_prepend(f->dir_subs, sub); } else { - _fdata_sub_add (data, sub); - _fdata_adjust_deleted (data); + f->subs = g_list_prepend(f->subs, sub); } -#else - if (_port_add (&data->fobj, &data->len, data) || - g_file_test (FN_NAME(data), G_FILE_TEST_EXISTS)) { - gam_server_emit_one_event (FN_NAME(data), + + if (NODE_HAS_STATE(f, NODE_STATE_ASSOCIATED) || + (node_lstat(f) == 0 && port_add(f) == 0)) { +#ifndef GIO_COMPILATION + gam_server_emit_one_event (NODE_NAME(f), gam_subscription_is_dir (sub), GAMIN_EVENT_EXISTS, sub, 1); +#endif if (is_mondir) { scan_children_init (f, sub); } - gam_server_emit_one_event (FN_NAME(data), - gam_subscription_is_dir (sub), GAMIN_EVENT_ENDEXISTS, sub, 1); - _fdata_sub_add (data, sub); } else { - _fdata_sub_add (data, sub); - gam_server_emit_one_event (FN_NAME(data), +#ifndef GIO_COMPILATION + gam_server_emit_one_event (NODE_NAME(f), gam_subscription_is_dir (sub), GAMIN_EVENT_DELETED, sub, 1); - _fdata_adjust_deleted (data); - gam_server_emit_one_event (FN_NAME(data), - gam_subscription_is_dir (sub), GAMIN_EVENT_ENDEXISTS, sub, 1); +#endif + node_adjust_deleted (f); } +#ifndef GIO_COMPILATION + gam_server_emit_one_event (NODE_NAME(f), + gam_subscription_is_dir (sub), GAMIN_EVENT_ENDEXISTS, sub, 1); #endif G_UNLOCK (fen_lock); } void -_fen_remove (const gchar *filename, gpointer sub, gboolean is_mondir) +fen_remove (const gchar *filename, gpointer sub, gboolean is_mondir) { - node_op_t op = {NULL, _add_missing_cb, _pre_del_cb, (gpointer)filename}; node_t* f; - fdata* data; g_assert (filename); g_assert (sub); G_LOCK (fen_lock); - f = _find_node (filename); - FH_W ("[ %s ] f[0x%p] sub[0x%p] %s\n", __func__, f, sub, filename); + f = node_find(NULL, filename, FALSE); + FH_W ("%s 0x%p sub[0x%p] %s\n", __func__, f, sub, filename); - g_assert (f); - data = _node_get_data (f); - g_assert (data); - - if (is_mondir) { - data->mon_dir_num --; - } - _fdata_sub_remove (data, sub); - if (FN_IS_PASSIVE(data)) { -#ifdef GIO_COMPILATION - _pending_remove_node (f, &op); -#else - _remove_node (f, &op); -#endif - } - G_UNLOCK (fen_lock); -} + if (f) { + if (is_mondir) { + f->dir_subs = g_list_remove(f->dir_subs, sub); + } else { + f->subs = g_list_remove(f->subs, sub); + } -static gboolean -fen_init_once_func (gpointer data) -{ - FH_W ("%s\n", __func__); - if (!_node_class_init ()) { - FH_W ("_node_class_init failed."); - return FALSE; - } - if (!_fdata_class_init (default_emit_event_cb, - default_emit_once_event_cb, - default_event_converter)) { - FH_W ("_fdata_class_init failed."); - return FALSE; + if (!NODE_IS_ACTIVE(f)) { + node_try_delete (f); + } } - return TRUE; + G_UNLOCK (fen_lock); } +/** + * fen_init: + * + * FEN subsystem initializing. + */ gboolean -_fen_init () +fen_init () { -#ifdef GIO_COMPILATION - static GOnce fen_init_once = G_ONCE_INIT; - g_once (&fen_init_once, (GThreadFunc)fen_init_once_func, NULL); - return (gboolean)fen_init_once.retval; -#else - return fen_init_once_func (NULL); -#endif -} + static gboolean initialized = FALSE; + static gboolean result = FALSE; -static void -default_emit_once_event_cb (fdata *f, int events, gpointer sub) -{ -#ifdef GIO_COMPILATION - GFile* child; - fen_sub* _sub = (fen_sub*)sub; - child = g_file_new_for_path (FN_NAME(f)); - g_file_monitor_emit_event (G_FILE_MONITOR (_sub->user_data), - child, NULL, events); - g_object_unref (child); -#else - gam_server_emit_one_event (FN_NAME(f), - gam_subscription_is_dir (sub), events, sub, 1); -#endif -} - -static void -default_emit_event_cb (fdata *f, int events) -{ - GList* i; - fdata* pdata; - -#ifdef GIO_COMPILATION - GFile* child; - child = g_file_new_for_path (FN_NAME(f)); - for (i = f->subs; i; i = i->next) { - fen_sub* sub = (fen_sub*)i->data; - gboolean file_is_dir = sub->is_mondir; - if ((events != G_FILE_MONITOR_EVENT_CHANGED && - events != G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED) || - !file_is_dir) { - g_file_monitor_emit_event (G_FILE_MONITOR (sub->user_data), - child, NULL, events); - } - } - if ((pdata = _get_parent_data (f)) != NULL) { - for (i = pdata->subs; i; i = i->next) { - fen_sub* sub = (fen_sub*)i->data; - gboolean file_is_dir = sub->is_mondir; - g_file_monitor_emit_event (G_FILE_MONITOR (sub->user_data), - child, NULL, events); - } - } - g_object_unref (child); -#else - for (i = f->subs; i; i = i->next) { - gboolean file_is_dir = gam_subscription_is_dir (i->data); - if (events != GAMIN_EVENT_CHANGED || !file_is_dir) { - gam_server_emit_one_event (FN_NAME(f), file_is_dir, events, i->data, 1); - } - } - if ((pdata = _get_parent_data (f)) != NULL) { - for (i = pdata->subs; i; i = i->next) { - gboolean file_is_dir = gam_subscription_is_dir (i->data); - gam_server_emit_one_event (FN_NAME(f), file_is_dir, events, i->data, 1); - } + G_LOCK (fen_lock); + if (initialized) { + G_UNLOCK (fen_lock); + return result; } -#endif -} -static int -default_event_converter (int event) -{ -#ifdef GIO_COMPILATION - switch (event) { - case FN_EVENT_CREATED: - return G_FILE_MONITOR_EVENT_CREATED; - case FILE_DELETE: - case FILE_RENAME_FROM: - return G_FILE_MONITOR_EVENT_DELETED; - case UNMOUNTED: - return G_FILE_MONITOR_EVENT_UNMOUNTED; - case FILE_ATTRIB: - return G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED; - case MOUNTEDOVER: - case FILE_MODIFIED: - case FILE_RENAME_TO: - return G_FILE_MONITOR_EVENT_CHANGED; - default: - /* case FILE_ACCESS: */ - g_assert_not_reached (); - return -1; - } -#else - switch (event) { - case FN_EVENT_CREATED: - return GAMIN_EVENT_CREATED; - case FILE_DELETE: - case FILE_RENAME_FROM: - return GAMIN_EVENT_DELETED; - case FILE_ATTRIB: - case MOUNTEDOVER: - case UNMOUNTED: - case FILE_MODIFIED: - case FILE_RENAME_TO: - return GAMIN_EVENT_CHANGED; - default: - /* case FILE_ACCESS: */ - g_assert_not_reached (); - return -1; + result = node_class_init(); + + if (!result) { + G_UNLOCK (fen_lock); + return result; } -#endif + + initialized = TRUE; + + G_UNLOCK (fen_lock); + return result; } diff --git a/gio/fen/fen-helper.h b/gio/fen/fen-helper.h index 330d007..25df38f 100644 --- a/gio/fen/fen-helper.h +++ b/gio/fen/fen-helper.h @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,15 +22,12 @@ * Authors: Lin Ma */ -#include "fen-sub.h" - #ifndef _FEN_HELPER_H_ #define _FEN_HELPER_H_ -void _fen_add (const gchar *filename, gpointer sub, gboolean is_mondir); -void _fen_remove (const gchar *filename, gpointer sub, gboolean is_mondir); +void fen_add (const gchar *filename, gpointer sub, gboolean is_mondir); +void fen_remove (const gchar *filename, gpointer sub, gboolean is_mondir); -/* FEN subsystem initializing */ -gboolean _fen_init (); +gboolean fen_init (); #endif /* _FEN_HELPER_H_ */ diff --git a/gio/fen/fen-kernel.c b/gio/fen/fen-kernel.c index 1747d8f..a060016 100644 --- a/gio/fen/fen-kernel.c +++ b/gio/fen/fen-kernel.c @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,6 @@ #include "config.h" #include #include -#include #include #include #include @@ -34,7 +33,7 @@ #include "fen-dump.h" #ifdef GIO_COMPILATION -#define FK_W if (fk_debug_enabled) g_warning +#define FK_W if (fk_debug_enabled) g_debug static gboolean fk_debug_enabled = FALSE; #else #include "gam_error.h" @@ -42,396 +41,353 @@ static gboolean fk_debug_enabled = FALSE; #endif G_GNUC_INTERNAL G_LOCK_DEFINE (fen_lock); -#define PE_ALLOC 64 -#define F_PORT(pfo) (((_f *)(pfo))->port->port) -#define F_NAME(pfo) (((_f *)(pfo))->fobj->fo_name) -#define FEN_ALL_EVENTS (FILE_MODIFIED | FILE_ATTRIB | FILE_NOFOLLOW) -#define FEN_IGNORE_EVENTS (FILE_ACCESS) -#define PROCESS_PORT_EVENTS_TIME 400 /* in milliseconds */ - -static GHashTable *_obj_fen_hash = NULL; /* */ + static ulong max_port_events = 512; -static GList *pn_vq; /* the queue of ports which don't have the max objs */ -static GList *pn_fq; /* the queue of ports which have the max objs */ +static GList *pn_visible_list; /* the queue of ports which don't have the max objs */ static GQueue *g_eventq = NULL; -static void (*add_event_cb) (gpointer, fnode_event_t*); - -typedef struct pnode -{ - long ref; /* how many fds are associated to this port */ - int port; - guint port_source_id; -} pnode_t; - -typedef struct { - pnode_t* port; - file_obj_t* fobj; - - gboolean is_active; - gpointer user_data; -} _f; +static timespec_t zero_wait; +static void (*user_process_events_cb) (gpointer, node_event_t*); +static port_event_t *pevents = NULL; +static gint PE_ALLOC = 2048; +static GHashTable *renamed_hash = NULL; /* */ + +typedef struct _PSource { + GSource source; /* Inherit from GSource, must be the first. */ + GPollFD gfd; + gboolean pending; + uint_t event_growing_factor; + uint_t pending_events; +} PSource; + +#define PGPFD(s) (&((PSource *)(s))->gfd) +#define SLEEP_BASE_TIME 10 /* in milliseconds */ +#define EXPECT_INC_EVENTS(pn) (1 << (pn->event_growing_factor)) + +#define RENAME_EVENTS_INTERVAL 500 /* in milliseconds */ +#define PROCESS_PORT_EVENTS_TIME 1000 /* in milliseconds */ +guint process_port_event_id = 0; + +static gchar* _event_strings(int event); +static const gchar* _event_string (int event); +static GSource *psource_new(); + +static gboolean port_prepare(GSource *source, gint *timeout_); +static gboolean port_check(GSource *source); +static gboolean port_dispatch(GSource *source, GSourceFunc callback, gpointer user_data); +static GSourceFuncs fen_source_func = { + port_prepare, + port_check, + port_dispatch, + NULL +}; -static gboolean port_fetch_event_cb (void *arg); -static pnode_t *pnode_new (); -static void pnode_delete (pnode_t *pn); - -gboolean -_is_ported (gpointer f) +static gboolean +port_prepare(GSource *source, gint *timeout_) { - _f* fo = g_hash_table_lookup (_obj_fen_hash, f); - - if (fo) { - return fo->is_active; - } return FALSE; } -static gchar* -printevent (const char *pname, int event, const char *tag) -{ - static gchar *event_string = NULL; - GString *str; - - if (event_string) { - g_free(event_string); - } - - str = g_string_new (""); - g_string_printf (str, "[%s] [%-20s]", tag, pname); - if (event & FILE_ACCESS) { - str = g_string_append (str, " ACCESS"); - } - if (event & FILE_MODIFIED) { - str = g_string_append (str, " MODIFIED"); - } - if (event & FILE_ATTRIB) { - str = g_string_append (str, " ATTRIB"); - } - if (event & FILE_DELETE) { - str = g_string_append (str, " DELETE"); - } - if (event & FILE_RENAME_TO) { - str = g_string_append (str, " RENAME_TO"); - } - if (event & FILE_RENAME_FROM) { - str = g_string_append (str, " RENAME_FROM"); - } - if (event & UNMOUNTED) { - str = g_string_append (str, " UNMOUNTED"); - } - if (event & MOUNTEDOVER) { - str = g_string_append (str, " MOUNTEDOVER"); - } - event_string = str->str; - g_string_free (str, FALSE); - return event_string; -} - -static void -port_add_kevent (int e, gpointer f) +static gboolean +port_check(GSource *source) { - fnode_event_t *ev, *tail; - GTimeVal t; - gboolean has_twin = FALSE; - - /* - * Child FILE_DELETE | FILE_RENAME_FROM will trigger parent FILE_MODIFIED. - * FILE_MODIFIED will trigger FILE_ATTRIB. - */ - - if ((e & FILE_ATTRIB) && e != FILE_ATTRIB) { - e ^= FILE_ATTRIB; - has_twin = TRUE; - } - if (e == FILE_RENAME_FROM) { - e = FILE_DELETE; - } - if (e == FILE_RENAME_TO) { - e = FILE_MODIFIED; - } + PSource *pn = (PSource *)source; + uint_t nget; - switch (e) { - case FILE_DELETE: - case FILE_RENAME_FROM: - case FILE_MODIFIED: - case FILE_ATTRIB: - case UNMOUNTED: - case MOUNTEDOVER: - break; - case FILE_RENAME_TO: - case FILE_ACCESS: - default: - g_assert_not_reached (); - return; + if (pn->pending) { + pn->pending = FALSE; + g_source_add_poll(source, PGPFD(source)); + g_source_unref(source); + return FALSE; } - tail = (fnode_event_t*) g_queue_peek_tail (g_eventq); - if (tail) { - if (tail->user_data == f) { - if (tail->e == e) { - tail->has_twin = (has_twin | (tail->has_twin ^ has_twin)); - /* skip the current */ - return; - } else if (e == FILE_MODIFIED && !has_twin - && tail->e == FILE_ATTRIB) { - tail->e = FILE_MODIFIED; - tail->has_twin = TRUE; - return; - } else if (e == FILE_ATTRIB - && tail->e == FILE_MODIFIED && !tail->has_twin) { - tail->has_twin = TRUE; - return; - } + if (!(PGPFD(pn)->revents & G_IO_IN)) + return FALSE; + + if (port_getn(PGPFD(source)->fd, NULL, 0, &nget, 0) == 0) { + if (nget - pn->pending_events > EXPECT_INC_EVENTS(pn)) { + /* Sleep for a while. */ + pn->pending_events = nget; + pn->event_growing_factor ++; + + pn->pending = TRUE; + g_source_ref(source); + g_source_remove_poll(source, PGPFD(source)); + g_timeout_add(SLEEP_BASE_TIME, + (GSourceFunc)port_check, + (gpointer)pn); + return FALSE; } } - - if ((ev = _fnode_event_new (e, has_twin, f)) != NULL) { - g_queue_push_tail (g_eventq, ev); - } -} -static void -port_process_kevents () -{ - fnode_event_t *ev; - - while ((ev = (fnode_event_t*)g_queue_pop_head (g_eventq)) != NULL) { - FK_W ("[%s] 0x%p %s\n", __func__, ev, _event_string (ev->e)); - add_event_cb (ev->user_data, ev); - } + pn->pending_events = 0; + pn->event_growing_factor = 0; + + return TRUE; } static gboolean -port_fetch_event_cb (void *arg) +port_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) { - pnode_t *pn = (pnode_t *)arg; - _f* fo; + node_t *f; uint_t nget = 0; - port_event_t pe[PE_ALLOC]; - timespec_t timeout; - gpointer f; - gboolean ret = TRUE; - - /* FK_W ("IN <======== %s\n", __func__); */ + uint_t total = 0; + + FK_W ("%s 0x%p fd %d\n", __func__, source, PGPFD(source)->fd); + G_LOCK (fen_lock); - - memset (&timeout, 0, sizeof (timespec_t)); do { nget = 1; - if (port_getn (pn->port, pe, PE_ALLOC, &nget, &timeout) == 0) { + if (port_getn(PGPFD(source)->fd, pevents, PE_ALLOC, &nget, &zero_wait) == 0) { int i; for (i = 0; i < nget; i++) { - fo = (_f*)pe[i].portev_user; - /* handle event */ - switch (pe[i].portev_source) { - case PORT_SOURCE_FILE: - /* If got FILE_EXCEPTION or add to port failed, - delete the pnode */ - fo->is_active = FALSE; - if (fo->user_data) { - FK_W("%s\n", - printevent(F_NAME(fo), pe[i].portev_events, "RAW")); - port_add_kevent (pe[i].portev_events, fo->user_data); - } else { - /* fnode is deleted */ - goto L_delete; - } - if (pe[i].portev_events & FILE_EXCEPTION) { - g_hash_table_remove (_obj_fen_hash, fo->user_data); - L_delete: - FK_W ("[ FREE_FO ] [0x%p]\n", fo); - pnode_delete (fo->port); - g_free (fo); + f = (node_t *)pevents[i].portev_user; + + if (pevents[i].portev_source == PORT_SOURCE_FILE) { + + NODE_CLE_STATE(f, NODE_STATE_ASSOCIATED); + NODE_SET_STATE(f, NODE_STATE_HAS_EVENTS); + + if (HAS_NO_EXCEPTION_EVENTS(pevents[i].portev_events)) { + /* If the events do not show it's deleted, update + * file timestamp to avoid missing events next time. + */ + if (node_lstat(f) != 0 /* || port_add(f) != 0 */) { + /* Included deleted event. */ + pevents[i].portev_events |= FILE_DELETE; + } } - break; - default: - /* case PORT_SOURCE_TIMER: */ - FK_W ("[kernel] unknown portev_source %d\n", pe[i].portev_source); + + /* Queue it and waiting for processing. */ + g_queue_push_tail(g_eventq, + node_event_new(pevents[i].portev_events, (gpointer)f)); + + } else { + FK_W ("[kernel] unknown portev_source %d\n", pevents[i].portev_source); } } + + total += nget; + } else { FK_W ("[kernel] port_getn %s\n", g_strerror (errno)); - nget = 0; + break; } } while (nget == PE_ALLOC); + G_UNLOCK (fen_lock); + + if (total > 0 && callback) { + FK_W ("[kernel] get total %ld events\n", total); + return callback (user_data); + } + return TRUE; +} + +static gboolean +process_renamed_hash_cb(gpointer key, gpointer value, gpointer user_data) +{ + node_event_t *ev = value; + +#if 0 + node_add_event(ev->user_data, ev); +#else + user_process_events_cb(ev->user_data, ev); +#endif + /* Always delete self from hash. */ + return TRUE; +} + +static gboolean +port_events_process_cb(gpointer user_data) +{ + node_event_t *ev; + + G_LOCK (fen_lock); + /* Processing g_eventq */ - port_process_kevents (); + while ((ev = (node_event_t*)g_queue_pop_head (g_eventq)) != NULL) { + + /* FK_W ("[%s] 0x%p %s\n", __func__, ev, _event_string (ev->e)); */ + + { + gchar *log = _event_strings(ev->e); + FK_W ("%s %s %s\n", __func__, NODE_NAME(ev->user_data), log); + g_free(log); + } + +#ifdef GIO_COMPILATION + /* Use the parent node as a hash, because only the dir_subs in the + * parent node should receive MOVE event. + */ + if (NODE_PARENT(ev->user_data)) { + if (ev->e == FILE_RENAME_TO) { + g_hash_table_insert(renamed_hash, NODE_PARENT(ev->user_data), ev); + g_time_val_add(&ev->rename_tv, RENAME_EVENTS_INTERVAL); + continue; + } + if (ev->e == FILE_RENAME_FROM) { + node_event_t *pair_ev; + + pair_ev = g_hash_table_lookup(renamed_hash, NODE_PARENT(ev->user_data)); + if (pair_ev && node_timeval_lt(&ev->ctv, &pair_ev->rename_tv)) { + g_hash_table_remove(renamed_hash, NODE_PARENT(ev->user_data)); + pair_ev->pair_data = ev->user_data; + /* Free ev, exchange pair_ev and ev. */ + node_event_delete(ev); + ev = pair_ev; + } + } + } +#endif - if (pn->ref == 0) { - pn->port_source_id = 0; - ret = FALSE; +#if 0 + node_add_event(ev->user_data, ev); +#else + user_process_events_cb(ev->user_data, ev); +#endif } + + /* Processing the events in renamed_hash. TODO we should delay it and wait + * for more possible pair. + */ + g_hash_table_foreach_remove(renamed_hash, process_renamed_hash_cb, NULL); + G_UNLOCK (fen_lock); - /* FK_W ("OUT ========> %s\n", __func__); */ - return ret; + + process_port_event_id = 0; + return FALSE; } -/* - * ref - 1 if remove a watching file succeeded. - */ -static void -pnode_delete (pnode_t *pn) +static gboolean +port_events_read_cb(gpointer user_data) { - g_assert (pn->ref <= max_port_events); - - if (pn->ref == max_port_events) { - FK_W ("PORT : move to visible queue - [pn] 0x%p [ref] %d\n", pn, pn->ref); - pn_fq = g_list_remove (pn_fq, pn); - pn_vq = g_list_prepend (pn_vq, pn); - } - if ((-- pn->ref) == 0) { - /* Should dispatch the source */ - } - FK_W ("%s [pn] 0x%p [ref] %d\n", __func__, pn, pn->ref); + + if (process_port_event_id == 0) { + process_port_event_id = g_timeout_add(PROCESS_PORT_EVENTS_TIME, + port_events_process_cb, + NULL); + } + + return TRUE; } /* - * malloc pnode_t and port_create, start thread at pnode_ref. - * if pnode_new succeeded, the pnode_t will never - * be freed. So pnode_t can be freed only in pnode_new. - * Note pnode_monitor_remove_all can also free pnode_t, but currently no one + * malloc PSource and port_create, start thread at pnode_ref. + * if psource_new succeeded, the PSource will never + * be freed. So PSource can be freed only in psource_new. + * Note pnode_monitor_remove_all can also free PSource, but currently no one * invork it. */ -static pnode_t * -pnode_new () +static GSource* +psource_new() { - pnode_t *pn = NULL; - - if (pn_vq) { - pn = (pnode_t*)pn_vq->data; - g_assert (pn->ref < max_port_events); - } else { - pn = g_new0 (pnode_t, 1); - if (pn != NULL) { - if ((pn->port = port_create ()) >= 0) { - g_assert (g_list_find (pn_vq, pn) == NULL); - pn_vq = g_list_prepend (pn_vq, pn); - } else { - FK_W ("PORT_CREATE %s\n", g_strerror (errno)); - g_free (pn); - pn = NULL; - } - } - } - if (pn) { - FK_W ("%s [pn] 0x%p [ref] %d\n", __func__, pn, pn->ref); - pn->ref++; - if (pn->ref == max_port_events) { - FK_W ("PORT : move to full queue - [pn] 0x%p [ref] %d\n", pn, pn->ref); - pn_vq = g_list_remove (pn_vq, pn); - pn_fq = g_list_prepend (pn_fq, pn); - g_assert (g_list_find (pn_vq, pn) == NULL); - } - /* attach the source */ - if (pn->port_source_id == 0) { - pn->port_source_id = g_timeout_add (PROCESS_PORT_EVENTS_TIME, - port_fetch_event_cb, - (void *)pn); - g_assert (pn->port_source_id > 0); - } - } + GSource *source = NULL; + int fd; + + if ((fd = port_create()) >= 0) { + source = g_source_new(&fen_source_func, sizeof(PSource)); + PGPFD(source)->fd = fd; + PGPFD(source)->events = G_IO_IN | G_IO_HUP | G_IO_ERR; + g_source_set_callback(source, port_events_read_cb, NULL, NULL); + g_source_attach(source, NULL); + g_source_unref(source); + g_source_add_poll(source, PGPFD(source)); + + FK_W ("%s 0x%p fd %d\n", __func__, source, PGPFD(source)->fd); + } else { + FK_W ("PORT_CREATE %s\n", g_strerror(errno)); + g_return_val_if_reached(NULL); + } - return pn; + return source; } /* - * port_add_internal + * port_add: + * @f: * - * < private > * Unsafe, need lock fen_lock. + * port_add will associate a GSource to @f->source */ -static gboolean -port_add_internal (file_obj_t* fobj, off_t* len, - gpointer f, gboolean need_stat) +gint +port_add(node_t *f) { - int ret; - struct stat buf; - _f* fo = NULL; - - g_assert (f && fobj); - FK_W ("%s [0x%p] %s\n", __func__, f, fobj->fo_name); - - if ((fo = g_hash_table_lookup (_obj_fen_hash, f)) == NULL) { - fo = g_new0 (_f, 1); - fo->fobj = fobj; - fo->user_data = f; - g_assert (fo); - FK_W ("[ NEW_FO ] [0x%p] %s\n", fo, F_NAME(fo)); - g_hash_table_insert (_obj_fen_hash, f, fo); - } + GSource *source = f->source; - if (fo->is_active) { - return TRUE; - } + FK_W ("%s [0x%p] %s\n", __func__, f, NODE_NAME(f)); - if (fo->port == NULL) { - fo->port = pnode_new (); - } - - if (need_stat) { - if (FN_STAT (F_NAME(fo), &buf) != 0) { - FK_W ("LSTAT [%-20s] %s\n", F_NAME(fo), g_strerror (errno)); - goto L_exit; + g_assert(f); + g_assert(NODE_HAS_FLAG(f, NODE_FLAG_STAT_UPDATED)); + + /* if (!NODE_HAS_FLAG(f, NODE_FLAG_STAT_DONE)) { */ + /* if (NODE_STAT(f) != 0) { */ + /* return errno; */ + /* } */ + /* } */ + + /* Try re-use f->pn. f->pn may be used by other request, e.g. f is deleted + * for a long time. So if pn is full, we try to open a new one. + */ + if (!source) { +start_over: + /* Try the next visible source. */ + if (pn_visible_list) { + source = (GSource *)pn_visible_list->data; + } else { + if ((source = psource_new()) != NULL) { + g_assert (g_list_find (pn_visible_list, source) == NULL); + pn_visible_list = g_list_prepend (pn_visible_list, source); + } } - g_assert (len); - fo->fobj->fo_atime = buf.st_atim; - fo->fobj->fo_mtime = buf.st_mtim; - fo->fobj->fo_ctime = buf.st_ctim; - *len = buf.st_size; } - - if (port_associate (F_PORT(fo), - PORT_SOURCE_FILE, - (uintptr_t)fo->fobj, - FEN_ALL_EVENTS, - (void *)fo) == 0) { - fo->is_active = TRUE; - FK_W ("%s %s\n", "PORT_ASSOCIATE", F_NAME(fo)); - return TRUE; + + if (port_associate(PGPFD(source)->fd, PORT_SOURCE_FILE, (uintptr_t)FILE_OBJECT(f), + CONCERNED_EVENTS, + (void *)f) == 0) { + f->source = source; + NODE_SET_STATE(f, NODE_STATE_ASSOCIATED); + NODE_CLE_FLAG(f, NODE_FLAG_STAT_UPDATED); + FK_W ("PORT_ASSOCIATE 0x%p OK\n", f); + return 0; + } else if (errno == EAGAIN) { + /* Full, remove it. */ + pn_visible_list = g_list_remove (pn_visible_list, source); + /* Re-add to port */ + goto start_over; + + } else if (errno == ENOENT) { + /* File is not exist */ + } else if (errno == ENOTSUP) { + /* FS is not supported. Currently we think it no longer make sense to + * monitor it, so clean the stat info and return 0 to ignore this + * node. If there are requirement, we can consider to add polling + * method. + */ + NODE_CLE_FLAG(f, NODE_FLAG_STAT_UPDATED); + return 0; } else { - FK_W ("PORT_ASSOCIATE [%-20s] %s\n", F_NAME(fo), g_strerror (errno)); - L_exit: - FK_W ("[ FREE_FO ] [0x%p]\n", fo); - g_hash_table_remove (_obj_fen_hash, f); - pnode_delete (fo->port); - g_free (fo); + FK_W ("PORT_ASSOCIATE 0x%p %s\n", f, g_strerror (errno)); } - return FALSE; -} - -gboolean -_port_add (file_obj_t* fobj, off_t* len, gpointer f) -{ - return port_add_internal (fobj, len, f, TRUE); -} -gboolean -_port_add_simple (file_obj_t* fobj, gpointer f) -{ - return port_add_internal (fobj, NULL, f, FALSE); + /* No matter if associated successfully, stat info is out-of-date, so clean it. */ + NODE_CLE_FLAG(f, NODE_FLAG_STAT_UPDATED); + return errno; } /* - * port_remove: + * port_remove * * < private > * Unsafe, need lock fen_lock. */ void -_port_remove (gpointer f) +port_remove (node_t *f) { - _f* fo = NULL; - - FK_W ("%s\n", __func__); - if ((fo = g_hash_table_lookup (_obj_fen_hash, f)) != NULL) { - /* Marked */ - fo->user_data = NULL; - g_hash_table_remove (_obj_fen_hash, f); - - if (port_dissociate (F_PORT(fo), - PORT_SOURCE_FILE, - (uintptr_t)fo->fobj) == 0) { + /* g_assert(f->source); */ + + if (NODE_HAS_STATE(f, NODE_STATE_ASSOCIATED)) { + /* Mark unregisted. */ + if (port_dissociate(PGPFD(f->source)->fd, PORT_SOURCE_FILE, (uintptr_t)FILE_OBJECT(f)) == 0) { /* * Note, we can run foode_delete if dissociating is failed, * because there may be some pending events (mostly like @@ -439,50 +395,29 @@ _port_remove (gpointer f) * the fnode may be deleted, then port_get will run on an invalid * address. */ - FK_W ("[ FREE_FO ] [0x%p]\n", fo); - pnode_delete (fo->port); - g_free (fo); + NODE_CLE_STATE(f, NODE_STATE_ASSOCIATED); + FK_W ("PORT_DISSOCIATE 0x%p OK\n", f); + } else if (errno == ENOENT) { + /* The file has been removed from port, after port_get or before + * port_get but DELETED event has been generated. + * Ignored. */ } else { - FK_W ("PORT_DISSOCIATE [%-20s] %s\n", F_NAME(fo), g_strerror (errno)); + FK_W ("PORT_DISSOCIATE 0x%p %s\n", f, g_strerror (errno)); + g_return_if_reached(); } } } -const gchar * -_event_string (int event) -{ - switch (event) { - case FILE_DELETE: - return "FILE_DELETE"; - case FILE_RENAME_FROM: - return "FILE_RENAME_FROM"; - case FILE_MODIFIED: - return "FILE_MODIFIED"; - case FILE_RENAME_TO: - return "FILE_RENAME_TO"; - case MOUNTEDOVER: - return "MOUNTEDOVER"; - case FILE_ATTRIB: - return "FILE_ATTRIB"; - case UNMOUNTED: - return "UNMOUNTED"; - case FILE_ACCESS: - return "FILE_ACCESS"; - default: - return "EVENT_UNKNOWN"; - } -} - /* * Get Solaris resouce values. * */ extern gboolean -_port_class_init (void (*user_add_event) (gpointer, fnode_event_t*)) +port_class_init (void (*user_process_events_callback) (gpointer, node_event_t*)) { rctlblk_t *rblk; - FK_W ("%s\n", __func__); + if ((rblk = malloc (rctlblk_size ())) == NULL) { FK_W ("[kernel] rblk malloc %s\n", g_strerror (errno)); return FALSE; @@ -493,42 +428,129 @@ _port_class_init (void (*user_add_event) (gpointer, fnode_event_t*)) return FALSE; } else { max_port_events = rctlblk_get_value(rblk); - FK_W ("[kernel] max_port_events = %u\n", max_port_events); + FK_W ("max_port_events = %u\n", max_port_events); free (rblk); } - if ((_obj_fen_hash = g_hash_table_new(g_direct_hash, - g_direct_equal)) == NULL) { - FK_W ("[kernel] fobj hash initializing faild\n"); + renamed_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, + NULL, NULL); + if (renamed_hash == NULL) { + FK_W ("[kernel] FEN global renamed queue initializing faild\n"); return FALSE; } if ((g_eventq = g_queue_new ()) == NULL) { FK_W ("[kernel] FEN global event queue initializing faild\n"); + return FALSE; + } + if (user_process_events_callback == NULL) { + FK_W ("[kernel] FEN global no user_process_events_callback\n"); + return FALSE; } - if (user_add_event == NULL) { + user_process_events_cb = user_process_events_callback; + memset (&zero_wait, 0, sizeof (timespec_t)); + + pevents = g_malloc(PE_ALLOC * sizeof(port_event_t)); + if (pevents == NULL) { + FK_W ("[kernel] FEN global alloc pevents failed\n"); return FALSE; } - add_event_cb = user_add_event; + return TRUE; } -fnode_event_t* -_fnode_event_new (int event, gboolean has_twin, gpointer user_data) +static gchar* +printevent (const char *pname, int event, const char *tag) { - fnode_event_t *ev; - - if ((ev = g_new (fnode_event_t, 1)) != NULL) { - g_assert (ev); - ev->e = event; - ev->user_data = user_data; - ev->has_twin = has_twin; - /* Default isn't a pending event. */ - ev->is_pending = FALSE; + static gchar *event_string = NULL; + GString *str; + + if (event_string) { + g_free(event_string); } - return ev; + + str = g_string_new (""); + g_string_printf (str, "[%s] [%-20s]", tag, pname); + if (event & FILE_ACCESS) { + str = g_string_append (str, " ACCESS"); + } + if (event & FILE_MODIFIED) { + str = g_string_append (str, " MODIFIED"); + } + if (event & FILE_ATTRIB) { + str = g_string_append (str, " ATTRIB"); + } + if (event & FILE_DELETE) { + str = g_string_append (str, " DELETE"); + } + if (event & FILE_RENAME_TO) { + str = g_string_append (str, " RENAME_TO"); + } + if (event & FILE_RENAME_FROM) { + str = g_string_append (str, " RENAME_FROM"); + } + if (event & UNMOUNTED) { + str = g_string_append (str, " UNMOUNTED"); + } + if (event & MOUNTEDOVER) { + str = g_string_append (str, " MOUNTEDOVER"); + } + event_string = str->str; + g_string_free (str, FALSE); + return event_string; } -void -_fnode_event_delete (fnode_event_t* ev) +static gchar * +_event_strings(int event) { - g_free (ev); + GString *str = g_string_sized_new(80); + + if (event & FILE_DELETE) + g_string_append(str, " FILE_DELETE"); + + if (event & FILE_RENAME_FROM) + g_string_append(str, " FILE_RENAME_FROM"); + + if (event & FILE_MODIFIED) + g_string_append(str, " FILE_MODIFIED"); + + if (event & FILE_RENAME_TO) + g_string_append(str, " FILE_RENAME_TO"); + + if (event & MOUNTEDOVER) + g_string_append(str, " MOUNTEDOVER"); + + if (event & FILE_ATTRIB) + g_string_append(str, " FILE_ATTRIB"); + + if (event & UNMOUNTED) + g_string_append(str, " UNMOUNTED"); + + if (event & FILE_ACCESS) + g_string_append(str, " FILE_ACCESS"); + + return g_string_free(str, FALSE); +} + +static const gchar * +_event_string (int event) +{ + switch (event) { + case FILE_DELETE: + return "FILE_DELETE"; + case FILE_RENAME_FROM: + return "FILE_RENAME_FROM"; + case FILE_MODIFIED: + return "FILE_MODIFIED"; + case FILE_RENAME_TO: + return "FILE_RENAME_TO"; + case MOUNTEDOVER: + return "MOUNTEDOVER"; + case FILE_ATTRIB: + return "FILE_ATTRIB"; + case UNMOUNTED: + return "UNMOUNTED"; + case FILE_ACCESS: + return "FILE_ACCESS"; + default: + return "EVENT_UNKNOWN"; + } } diff --git a/gio/fen/fen-kernel.h b/gio/fen/fen-kernel.h index af1ab5c..6d2c49b 100644 --- a/gio/fen/fen-kernel.h +++ b/gio/fen/fen-kernel.h @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,33 +22,22 @@ * Authors: Lin Ma */ -#include #include -#include +#include + +#include "fen-node.h" #ifndef _FEN_KERNEL_H_ #define _FEN_KERNEL_H_ -#define FN_STAT lstat - -typedef struct fnode_event -{ - int e; - gboolean has_twin; - gboolean is_pending; - gpointer user_data; - GTimeVal t; -} fnode_event_t; - -gboolean _port_add (file_obj_t* fobj, off_t* len, gpointer f); -gboolean _port_add_simple (file_obj_t* fobj, gpointer f); -void _port_remove (gpointer f); -gboolean _is_ported (gpointer f); +#define CONCERNED_EVENTS (FILE_MODIFIED | FILE_ATTRIB | FILE_NOFOLLOW) +#define EXCEPTION_EVENTS (FILE_DELETE | FILE_RENAME_FROM) +#define HAS_EXCEPTION_EVENTS(e) ((e & EXCEPTION_EVENTS) != 0) +#define HAS_NO_EXCEPTION_EVENTS(e) ((e & EXCEPTION_EVENTS) == 0) -fnode_event_t* _fnode_event_new (int event, gboolean has_twin, gpointer user_data); -void _fnode_event_delete (fnode_event_t* ev); -const gchar * _event_string (int event); +gint port_add (node_t* f); +void port_remove (node_t *f); -extern gboolean _port_class_init (); +gboolean port_class_init (); #endif /* _FEN_KERNEL_H_ */ diff --git a/gio/fen/fen-missing.c b/gio/fen/fen-missing.c deleted file mode 100644 index 9091587..0000000 --- a/gio/fen/fen-missing.c +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:set expandtab ts=4 shiftwidth=4: */ -/* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Lin Ma - */ - -#include "config.h" -#include -#include "fen-data.h" -#include "fen-missing.h" - -G_LOCK_EXTERN (fen_lock); -#define SCAN_MISSING_INTERVAL 4000 /* in milliseconds */ - -#ifdef GIO_COMPILATION -#define FM_W if (fm_debug_enabled) g_warning -gboolean fm_debug_enabled = FALSE; -#else -#include "gam_error.h" -#define FM_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__) -#endif - -/* global data structure for scan missing files */ -static GList *missing_list = NULL; -static guint scan_missing_source_id = 0; - -static gboolean scan_missing_list (gpointer data); - -static gboolean -scan_missing_list (gpointer data) -{ - GList *existing_list = NULL; - GList *idx = NULL; - fdata *f; - gboolean ret = TRUE; - - G_LOCK (fen_lock); - - for (idx = missing_list; idx; idx = idx->next) { - f = (fdata*)idx->data; - - if (_port_add (&f->fobj, &f->len, f)) { - /* TODO - emit CREATE event */ - _fdata_emit_events (f, FN_EVENT_CREATED); - existing_list = g_list_prepend (existing_list, idx); - } - } - - for (idx = existing_list; idx; idx = idx->next) { - missing_list = g_list_remove_link (missing_list, (GList *)idx->data); - g_list_free_1 ((GList *)idx->data); - } - g_list_free (existing_list); - - if (missing_list == NULL) { - scan_missing_source_id = 0; - ret = FALSE; - } - - G_UNLOCK (fen_lock); - return ret; -} - -/** - * missing_add - * - * Unsafe, need lock fen_lock. - */ -void -_missing_add (fdata *f) -{ - GList *idx; - - g_assert (!_is_ported (f)); - - if (g_list_find (missing_list, f) != NULL) { - FM_W ("%s is ALREADY added %s\n", __func__, FN_NAME(f)); - return; - } - FM_W ("%s is added %s\n", __func__, FN_NAME(f)); - - missing_list = g_list_prepend (missing_list, f); - - /* if doesn't scan, then start */ - if (scan_missing_source_id == 0) { - scan_missing_source_id = g_timeout_add (SCAN_MISSING_INTERVAL, - scan_missing_list, - NULL); - g_assert (scan_missing_source_id > 0); - } -} - -/** - * missing_remove - * - * Unsafe, need lock fen_lock. - */ -void -_missing_remove (fdata *f) -{ - FM_W ("%s %s\n", __func__, FN_NAME(f)); - missing_list = g_list_remove (missing_list, f); -} diff --git a/gio/fen/fen-node.c b/gio/fen/fen-node.c index a8fbf69..5bbe6b8 100644 --- a/gio/fen/fen-node.c +++ b/gio/fen/fen-node.c @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,22 +23,24 @@ */ #include "config.h" +#include #include #include #include +#include "fen-kernel.h" #include "fen-node.h" #include "fen-dump.h" -#define NODE_STAT(n) (((node_t*)(n))->stat) - -struct _dnode { - gchar* filename; - node_op_t* op; - GTimeVal tv; -}; +#ifdef GIO_COMPILATION +#include +#else +#include "gam_event.h" +#include "gam_server.h" +#include "gam_protocol.h" +#endif #ifdef GIO_COMPILATION -#define FN_W if (fn_debug_enabled) g_warning +#define FN_W if (fn_debug_enabled) g_debug static gboolean fn_debug_enabled = FALSE; #else #include "gam_error.h" @@ -46,50 +48,45 @@ static gboolean fn_debug_enabled = FALSE; #endif G_LOCK_EXTERN (fen_lock); -#define PROCESS_DELETING_INTERVAL 900 /* in second */ -static node_t* _head = NULL; -static GList *deleting_nodes = NULL; -static guint deleting_nodes_id = 0; +/* Must continue monitoring if: + * 1) I'm subscribed, + * 2) The subscribed children (one of the children has subs) are missing, + * 3) my parent is subscribed (monitoring directory). + */ +#define NODE_NEED_MONITOR(f) \ + (NODE_IS_ACTIVE(f) || node_children_num(f) > 0 || NODE_IS_REQUIRED_BY_PARENT(f)) + +static int concern_events[] = { + FILE_DELETE, + FILE_RENAME_FROM, + UNMOUNTED, + MOUNTEDOVER, +#ifdef GIO_COMPILATION + FILE_MODIFIED, + FILE_ATTRIB, +#else + FILE_MODIFIED | FILE_ATTRIB, +#endif + FILE_RENAME_TO, +}; + +node_t *ROOT = NULL; +static void node_emit_one_event(node_t *f, GList *subs, node_t *other, int event); +static void node_emit_events(node_t *f, const node_event_t *ne); +static int node_event_translate(int event, gboolean pair); +static void node_add_event (node_t *f, node_event_t *ev); static node_t* node_new (node_t* parent, const gchar* basename); static void node_delete (node_t* parent); -static gboolean remove_node_internal (node_t* node, node_op_t* op); +static node_t* node_get_child (node_t *f, const gchar *basename); static void children_add (node_t *p, node_t *f); static void children_remove (node_t *p, node_t *f); -static guint children_foreach_remove (node_t *f, GHRFunc func, gpointer user_data); -static void children_foreach (node_t *f, GHFunc func, gpointer user_data); -static gboolean children_remove_cb (gpointer key, - gpointer value, - gpointer user_data); - -static struct _dnode* -_dnode_new (const gchar* filename, node_op_t* op) -{ - struct _dnode* d; - - g_assert (op); - if ((d = g_new (struct _dnode, 1)) != NULL) { - d->filename = g_strdup (filename); - d->op = g_memdup (op, sizeof (node_op_t)); - g_assert (d->op); - g_get_current_time (&d->tv); - g_time_val_add (&d->tv, PROCESS_DELETING_INTERVAL); - } - return d; -} +static gboolean children_remove_cb (gpointer key, gpointer value, gpointer user_data); +static guint node_children_num (node_t *f); -static void -_dnode_free (struct _dnode* d) -{ - g_assert (d); - g_free (d->filename); - g_free (d->op); - g_free (d); -} - -static gboolean -g_timeval_lt (GTimeVal *val1, GTimeVal *val2) +gboolean +node_timeval_lt(const GTimeVal *val1, const GTimeVal *val2) { if (val1->tv_sec < val2->tv_sec) return TRUE; @@ -104,85 +101,29 @@ g_timeval_lt (GTimeVal *val1, GTimeVal *val2) return FALSE; } -static gboolean -scan_deleting_nodes (gpointer data) +void +node_traverse (node_t* node, void(*traverse_cb)(node_t*, gpointer), gpointer user_data) { - struct _dnode* d; - GTimeVal tv_now; - GList* i; - GList* deleted_list = NULL; - gboolean ret = TRUE; - node_t* node; - - g_get_current_time (&tv_now); - - if (G_TRYLOCK (fen_lock)) { - for (i = deleting_nodes; i; i = i->next) { - d = (struct _dnode*)i->data; - /* Time to free, try only once */ - if (g_timeval_lt (&d->tv, &tv_now)) { - if ((node = _find_node (d->filename)) != NULL) { - remove_node_internal (node, d->op); - } - _dnode_free (d); - deleted_list = g_list_prepend (deleted_list, i); - } - } + GHashTableIter iter; + gpointer value; - for (i = deleted_list; i; i = i->next) { - deleting_nodes = g_list_remove_link (deleting_nodes, - (GList *)i->data); - g_list_free_1 ((GList *)i->data); - } - g_list_free (deleted_list); - - if (deleting_nodes == NULL) { - deleting_nodes_id = 0; - ret = FALSE; - } - G_UNLOCK (fen_lock); + g_assert(traverse_cb); + if (node == NULL) { + node = ROOT; } - return ret; -} - -gpointer -_node_get_data (node_t* node) -{ - g_assert (node); - return node->user_data; -} - -gpointer -_node_set_data (node_t* node, gpointer user_data) -{ - gpointer data = node->user_data; - g_assert (node); - node->user_data = user_data; - return data; -} - -void -_travel_nodes (node_t* node, node_op_t* op) -{ - GList* children; - GList* i; if (node) { - if (op && op->hit) { - op->hit (node, op->user_data); - } + traverse_cb(node, user_data); } - children = g_hash_table_get_values (node->children); - if (children) { - for (i = children; i; i = i->next) { - _travel_nodes (i->data, op); - } - g_list_free (children); + + g_hash_table_iter_init (&iter, node->children); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + node_traverse((node_t *)value, traverse_cb, user_data); } } -static node_t* -find_node_internal (node_t* node, const gchar* filename, node_op_t* op) +node_t* +node_find(node_t* node, const gchar* filename, gboolean create_on_missing) { gchar* str; gchar* token; @@ -191,166 +132,171 @@ find_node_internal (node_t* node, const gchar* filename, node_op_t* op) node_t* child; g_assert (filename && filename[0] == '/'); - g_assert (node); + + if (node == NULL) { + node = ROOT; + } - parent = node; - str = g_strdup (filename + strlen (NODE_NAME(parent))); + FN_W ("%s %s\n", __func__, filename); + + parent = child = node; + str = g_strdup (filename); - if ((token = strtok_r (str, G_DIR_SEPARATOR_S, &lasts)) != NULL) { - do { - FN_W ("%s %s + %s\n", __func__, NODE_NAME(parent), token); - child = _children_find (parent, token); + for (token = strtok_r (str, G_DIR_SEPARATOR_S, &lasts); + token != NULL && child != NULL; + token = strtok_r (NULL, G_DIR_SEPARATOR_S, &lasts)) { + FN_W ("%s %s + %s\n", __func__, NODE_NAME(parent), token); + child = node_get_child(parent, token); + if (child) { + parent = child; + } else if (create_on_missing) { + child = node_new (parent, token); if (child) { + children_add (parent, child); parent = child; + continue; } else { - if (op && op->add_missing) { - child = op->add_missing (parent, op->user_data); - goto L_hit; - } - break; + FN_W ("%s create %s failed", __func__, token); } - } while ((token = strtok_r (NULL, G_DIR_SEPARATOR_S, &lasts)) != NULL); - } else { - /* It's the head */ - g_assert (parent == _head); - child = _head; - } - - if (token == NULL && child) { - L_hit: - if (op && op->hit) { - op->hit (child, op->user_data); + } else { + break; } } + g_free (str); return child; } -node_t* -_find_node (const gchar *filename) +gint +node_lstat(node_t *f) { - return find_node_internal (_head, filename, NULL); + struct stat buf; + + g_assert(!NODE_HAS_STATE(f, NODE_STATE_ASSOCIATED)); + + if (lstat(NODE_NAME(f), &buf) == 0) { + FN_W ("%s %s\n", __func__, NODE_NAME(f)); + FILE_OBJECT(f)->fo_atime = buf.st_atim; + FILE_OBJECT(f)->fo_mtime = buf.st_mtim; + FILE_OBJECT(f)->fo_ctime = buf.st_ctim; + NODE_SET_FLAG(f, NODE_FLAG_STAT_UPDATED | + (S_ISDIR (buf.st_mode) ? NODE_FLAG_DIR : NODE_FLAG_NONE)); + return 0; + } else { + FN_W ("%s(lstat) %s %s\n", __func__, NODE_NAME(f), g_strerror (errno)); + } + return errno; } -node_t* -_find_node_full (const gchar* filename, node_op_t* op) +void +node_create_children_snapshot(node_t *f, gint created_event, gboolean emit) { - return find_node_internal (_head, filename, op); -} + GDir *dir; + GError *err = NULL; + + FN_W ("%s %s [0x%p]\n", __func__, NODE_NAME(f), f); + + dir = g_dir_open (NODE_NAME(f), 0, &err); + if (dir) { + const char *basename; + node_t *child = NULL; + + while ((basename = g_dir_read_name (dir))) { + node_t* data; + GList *idx; + + child = node_get_child (f, basename); + if (child == NULL) { + gchar *filename; + + child = node_new (f, basename); + children_add (f, child); + } -node_t* -_add_node (node_t* parent, const gchar* filename) -{ - gchar* str; - gchar* token; - gchar* lasts; - node_t* child = NULL; + if (f->dir_subs) { + /* We need monitor the new children, or the existed child which + * is in the DELETED mode. + */ + if (!NODE_HAS_STATE(child, NODE_STATE_ASSOCIATED) && + node_lstat(child) == 0 && port_add(child) == 0) { + if (emit) { + /* Emit the whatever event for the new found file. */ + node_emit_one_event(child, child->dir_subs, NULL, created_event); + node_emit_one_event(child, child->subs, NULL, created_event); + node_emit_one_event(child, f->dir_subs, NULL, created_event); + node_emit_one_event(child, f->subs, NULL, created_event); + } + } + /* else ignore, because it may be deleted. */ + } + } + g_dir_close (dir); - g_assert (_head); - g_assert (filename && filename[0] == '/'); + /* We have finished children snapshot. Any other new added subs should + * directory iterate the snapshot instead of scan directory again. + */ + NODE_SET_FLAG(f, NODE_FLAG_SNAPSHOT_UPDATED); - if (parent == NULL) { - parent = _head; - } - - str = g_strdup (filename + strlen (NODE_NAME(parent))); - - if ((token = strtok_r (str, G_DIR_SEPARATOR_S, &lasts)) != NULL) { - do { - FN_W ("%s %s + %s\n", __func__, NODE_NAME(parent), token); - child = node_new (parent, token); - if (child) { - children_add (parent, child); - parent = child; - } else { - break; - } - } while ((token = strtok_r (NULL, G_DIR_SEPARATOR_S, &lasts)) != NULL); - } - g_free (str); - if (token == NULL) { - return child; } else { - return NULL; + FN_W (err->message); + g_error_free (err); } } /* - * delete recursively + * If all active children nodes are ported, then cancel monitor the parent + * node. If we know how many children are created, then we can stop accordingly. + * + * Unsafe, need lock. */ -static gboolean -remove_children (node_t* node, node_op_t* op) -{ - FN_W ("%s 0x%p %s\n", __func__, node, NODE_NAME(node)); - if (_children_num (node) > 0) { - children_foreach_remove (node, children_remove_cb, - (gpointer)op); - } - if (_children_num (node) == 0) { - return TRUE; - } - return FALSE; -} - -static gboolean -remove_node_internal (node_t* node, node_op_t* op) +static void +foreach_known_children_scan(gpointer key, gpointer value, gpointer user_data) { - node_t* parent = NULL; - /* - * If the parent is passive and doesn't have children, delete it. - * NOTE node_delete_deep is a depth first delete recursively. - * Top node is deleted in node_cancel_sub - */ - g_assert (node); - g_assert (op && op->pre_del); - if (node != _head) { - if (remove_children (node, op)) { - if (node->user_data) { - if (!op->pre_del (node, op->user_data)) { - return FALSE; - } - } - parent = node->parent; - children_remove (parent, node); - node_delete (node); - if (_children_num (parent) == 0) { - remove_node_internal (parent, op); + node_t* f = (node_t*)value; + + FN_W ("%s 0x%p %s\n", __func__, f, NODE_NAME(f)); + + if (!NODE_HAS_STATE(f, NODE_STATE_ASSOCIATED)) { + if (node_lstat(f) == 0 && port_add(f) == 0) { + node_emit_one_event(f, f->dir_subs, NULL, FN_EVENT_CREATED); + node_emit_one_event(f, f->subs, NULL, FN_EVENT_CREATED); + if (NODE_PARENT(f)) { + node_emit_one_event(f, NODE_PARENT(f)->dir_subs, NULL, FN_EVENT_CREATED); + node_emit_one_event(f, NODE_PARENT(f)->subs, NULL, FN_EVENT_CREATED); } - return TRUE; } - return FALSE; } - return TRUE; } -void -_pending_remove_node (node_t* node, node_op_t* op) +gboolean +node_try_delete(node_t* node) { - struct _dnode* d; - GList* l; - - for (l = deleting_nodes; l; l=l->next) { - d = (struct _dnode*) l->data; - if (g_ascii_strcasecmp (d->filename, NODE_NAME(node)) == 0) { - return; - } + g_assert (node); + + FN_W ("%s 0x%p %s\n", __func__, node, NODE_NAME(node)); + + /* Try clean children */ + if (node_children_num (node) > 0) { + g_hash_table_foreach_remove(node->children, children_remove_cb, NULL); } - - d = _dnode_new (NODE_NAME(node), op); - g_assert (d); - deleting_nodes = g_list_prepend (deleting_nodes, d); - if (deleting_nodes_id == 0) { - deleting_nodes_id = g_timeout_add_seconds (PROCESS_DELETING_INTERVAL, - scan_deleting_nodes, - NULL); - g_assert (deleting_nodes_id > 0); + if (!NODE_NEED_MONITOR(node)) { + /* Clean some flags. */ + /* NODE_CLE_FLAG(node, NODE_FLAG_HAS_SNAPSHOT | NODE_FLAG_STAT_DONE); */ + node->flag = 0; + + /* Now we handle the state. */ + if (NODE_HAS_STATE(node, NODE_STATE_ASSOCIATED)) { + port_remove(node); + } + /* Actually ignore the ROOT node. */ + if (node->state == 0 && NODE_PARENT(node)) { + children_remove(NODE_PARENT(node), node); + /* Do clean instead of returning TRUE. */ + node_delete (node); + } + /* else, we have events, clean event queue? */ } -} - -void -_remove_node (node_t* node, node_op_t* op) -{ - remove_node_internal (node, op); + return FALSE; } static node_t* @@ -359,18 +305,22 @@ node_new (node_t* parent, const gchar* basename) node_t *f = NULL; g_assert (basename && basename[0]); - if ((f = g_new0 (node_t, 1)) != NULL) { + + if ((f = g_new0(node_t, 1)) != NULL) { if (parent) { - f->basename = g_strdup (basename); - f->filename = g_build_filename (G_DIR_SEPARATOR_S, - NODE_NAME(parent), basename, NULL); + NODE_NAME(f) = g_build_filename(NODE_NAME(parent), basename, NULL); } else { - f->basename = g_strdup (basename); - f->filename = g_strdup (basename); + NODE_NAME(f) = g_strdup(G_DIR_SEPARATOR_S); } + f->basename = g_strdup (basename); + /* f->children = g_hash_table_new_full (g_str_hash, g_str_equal, */ + /* NULL, (GDestroyNotify)node_delete); */ f->children = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, (GDestroyNotify)node_delete); - FN_W ("[ %s ] 0x%p %s\n", __func__, f, NODE_NAME(f)); + NULL, NULL); +#ifdef GIO_COMPILATION + f->gfile = g_file_new_for_path (NODE_NAME(f)); +#endif + FN_W ("%s 0x%p %s\n", __func__, f, NODE_NAME(f)); } return f; } @@ -378,89 +328,314 @@ node_new (node_t* parent, const gchar* basename) static void node_delete (node_t *f) { - FN_W ("[ %s ] 0x%p %s\n", __func__, f, NODE_NAME(f)); - g_assert (g_hash_table_size (f->children) == 0); - g_assert (f->user_data == NULL); - - g_hash_table_unref (f->children); - g_free (f->basename); - g_free (f->filename); + FN_W ("%s 0x%p %s\n", __func__, f, NODE_NAME(f)); + g_assert(f->state == 0); + g_assert(!NODE_IS_ACTIVE(f)); + g_assert(g_hash_table_size (f->children) == 0); + g_assert(NODE_PARENT(f) == NULL); + g_hash_table_unref(f->children); +#ifdef GIO_COMPILATION + g_object_unref (f->gfile); +#endif + g_free(f->basename); + g_free(NODE_NAME(f)); g_free (f); } static void children_add (node_t *p, node_t *f) { - FN_W ("%s [p] %8s [c] %8s\n", __func__, p->basename, f->basename); + FN_W ("%s %s %s\n", __func__, NODE_NAME(p), f->basename); g_hash_table_insert (p->children, f->basename, f); - f->parent = p; + NODE_PARENT(f) = p; } static void children_remove (node_t *p, node_t *f) { - FN_W ("%s [p] %8s [c] %8s\n", __func__, p->basename, f->basename); + FN_W ("%s %s %s\n", __func__, NODE_NAME(p), f->basename); g_hash_table_steal (p->children, f->basename); - f->parent = NULL; + NODE_PARENT(f) = NULL; } -guint -_children_num (node_t *f) +static node_t * +node_get_child (node_t *f, const gchar *basename) { - return g_hash_table_size (f->children); + if (f->children) { + return (node_t *) g_hash_table_lookup (f->children, (gpointer)basename); + } + return NULL; } -node_t * -_children_find (node_t *f, const gchar *basename) +static guint +node_children_num (node_t *f) { - return (node_t *) g_hash_table_lookup (f->children, (gpointer)basename); + return g_hash_table_size (f->children); } /* * depth first delete recursively */ static gboolean -children_remove_cb (gpointer key, - gpointer value, - gpointer user_data) +children_remove_cb (gpointer key, gpointer value, gpointer user_data) { - node_t* f = (node_t*)value; - node_op_t* op = (node_op_t*) user_data; - - g_assert (f->parent); + return node_try_delete ((node_t*)value); +} + +gboolean +node_class_init() +{ + ROOT = node_new (NULL, G_DIR_SEPARATOR_S); + if (ROOT == NULL) { + FN_W ("[node] Create ROOT node failed.\n"); + return FALSE; + } + + return port_class_init (node_add_event); +} - FN_W ("%s [p] %8s [c] %8s\n", __func__, f->parent->basename, f->basename); - if (remove_children (f, op)) { - if (f->user_data != NULL) { - return op->pre_del (f, op->user_data); +/* + * Adjust self on failing to Port + */ +void +node_adjust_deleted(node_t* f) +{ + node_t *ancestor; + + FN_W ("%s %s\n", __func__, NODE_NAME(f)); + + for (ancestor = NODE_PARENT(f); + ancestor != NULL; + ancestor = NODE_PARENT(ancestor)) { + /* Stop if we find a node which been already associated or is existed + * and can be associated. + */ + if (NODE_HAS_STATE(ancestor, NODE_STATE_ASSOCIATED) || + (node_lstat(ancestor) == 0 && port_add(ancestor) == 0)) { + break; } - return TRUE; } - return FALSE; + + /* We assume we shouldn't reach here, because Root is always existed and + * associated. But given bugster#6955199, if PORT FS has problems on root, + * we may reach here. So just return ROOT and the whole GIO fen backend will + * fail. + */ + /* g_assert(ancestor != NULL); */ } -static guint -children_foreach_remove (node_t *f, GHRFunc func, gpointer user_data) + +static void +node_emit_events(node_t *f, const node_event_t *ne) { - g_assert (f); - - return g_hash_table_foreach_remove (f->children, func, user_data); + gsize num = sizeof(concern_events)/sizeof(int); + gint i; + int translated_e; + node_t *p; + + if (node_timeval_lt(&f->atv, &ne->ctv)) { + int event = ne->e; + + /* Emit DELETED on the pair_data */ + if (ne->pair_data) { + node_t *from = ne->pair_data; + node_emit_one_event(from, from->dir_subs, NULL, node_event_translate(FILE_DELETE, FALSE)); + node_emit_one_event(from, from->subs, NULL, node_event_translate(FILE_DELETE, FALSE)); + } + + for (i = 0; i < num; i++) { + if (event & concern_events[i]) { + translated_e = node_event_translate(concern_events[i], FALSE); + /* Neither GIO or gamin cares about modified events on a + * directory. + */ +#ifdef GIO_COMPILATION + if ((concern_events[i] & FILE_MODIFIED) == 0) { + node_emit_one_event(f, f->dir_subs, NULL, translated_e); + } +#else + /* Gamin doesn't care about attrib changed events on a directory + * either. + */ + if ((concern_events[i] & (FILE_MODIFIED | FILE_ATTRIB)) == 0) { + node_emit_one_event(f, f->dir_subs, NULL, translated_e); + } +#endif + node_emit_one_event(f, f->subs, NULL, translated_e); + } + event &= ~concern_events[i]; + } + } + + p = NODE_PARENT(f); + if (p != NULL && node_timeval_lt(&p->atv, &ne->ctv)) { + int event = ne->e; + for (i = 0; i < num; i++) { + if (event & concern_events[i]) { + translated_e = node_event_translate(concern_events[i], ne->pair_data != NULL); + node_emit_one_event(f, p->dir_subs, ne->pair_data, translated_e); + node_emit_one_event(f, p->subs, ne->pair_data, translated_e); + } + event &= ~concern_events[i]; + } + } } +/* + * node_add_event: + * + */ static void -children_foreach (node_t *f, GHFunc func, gpointer user_data) +node_add_event (node_t *f, node_event_t *ev) { - g_assert (f); + FN_W ("%s %d\n", __func__, ev->e); + + /* Clean the events flag early, because all received events need be + * processed in this function. + */ + NODE_CLE_STATE(f, NODE_STATE_HAS_EVENTS); + + /* + * Node the node has been created, so we can delete create event in + * optimizing. To reduce the statings, we add it to Port on discoving + * it then emit CREATED event. So we don't need to do anything here. + */ + if (NODE_NEED_MONITOR(f)) { + if (HAS_NO_EXCEPTION_EVENTS(ev->e)) { + if (NODE_HAS_STATE(f, NODE_STATE_ASSOCIATED) || port_add(f) == 0) { + if ((ev->e & FILE_MODIFIED) && NODE_HAS_FLAG(f, NODE_FLAG_DIR)) { + if (f->dir_subs) { + node_create_children_snapshot(f, FN_EVENT_CREATED, TRUE); + } else { + g_hash_table_foreach(f->children, foreach_known_children_scan, NULL); + } + } + } else { + /* Emit delete event */ + ev->e |= FILE_DELETE; + + node_adjust_deleted(f); + } + + } else { + node_adjust_deleted(f); + } + + /* Send events to clients. */ + node_emit_events (f, ev); + + } else { + /* Send events to clients. */ + node_emit_events (f, ev); + + node_try_delete(f); + } + + if (ev->pair_data) { + node_t *from = ev->pair_data; + g_assert(ev->e == FILE_RENAME_TO); + + if (NODE_NEED_MONITOR(from)) { + /* Clean the events flag, since it may block free this node. */ + NODE_CLE_STATE(from, NODE_STATE_HAS_EVENTS); + node_adjust_deleted(from); + } else { + node_try_delete(from); + } + } + + node_event_delete (ev); +} + +static void +node_emit_one_event(node_t *f, GList *subs, node_t *other, int event) +{ + GList* idx; - g_hash_table_foreach (f->children, func, user_data); + FN_W ("%s %s %d\n", __func__, NODE_NAME(f), event); + +#ifdef GIO_COMPILATION + for (idx = subs; idx; idx = idx->next) { + g_file_monitor_emit_event(G_FILE_MONITOR(idx->data), f->gfile, + (other == NULL ? NULL : other->gfile), event); + } +#else + for (idx = subs; idx; idx = idx->next) { + gam_server_emit_one_event(NODE_NAME(f), gam_subscription_is_dir(idx->data), event, idx->data, 1); + } +#endif } -gboolean -_node_class_init () +static int +node_event_translate(int event, gboolean pair) { - FN_W ("%s\n", __func__); - if (_head == NULL) { - _head = node_new (NULL, G_DIR_SEPARATOR_S); +#ifdef GIO_COMPILATION + switch (event) { + case FILE_DELETE: + case FILE_RENAME_FROM: + return G_FILE_MONITOR_EVENT_DELETED; + case UNMOUNTED: + return G_FILE_MONITOR_EVENT_UNMOUNTED; + case FILE_ATTRIB: + return G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED; + case MOUNTEDOVER: + case FILE_MODIFIED: + return G_FILE_MONITOR_EVENT_CHANGED; + case FILE_RENAME_TO: + if (pair) { + return G_FILE_MONITOR_EVENT_MOVED; + } else { + return G_FILE_MONITOR_EVENT_CREATED; + } + default: + /* case FILE_ACCESS: */ + g_assert_not_reached (); + return -1; } - return _head != NULL; +#else + switch (event) { + case FILE_DELETE: + case FILE_RENAME_FROM: + return GAMIN_EVENT_DELETED; + case MOUNTEDOVER: + case UNMOUNTED: + return GAMIN_EVENT_CHANGED; + case FILE_RENAME_TO: + if (pair) { + return GAMIN_EVENT_MOVED; + } else { + return GAMIN_EVENT_CREATED; + } + default: + if (event & (FILE_ATTRIB | FILE_MODIFIED)) { + return GAMIN_EVENT_CHANGED; + } + /* case FILE_ACCESS: */ + g_assert_not_reached (); + return -1; + } +#endif +} + +node_event_t* +node_event_new (int event, gpointer user_data) +{ + node_event_t *ev; + + if ((ev = g_new (node_event_t, 1)) != NULL) { + g_assert (ev); + ev->e = event; + ev->user_data = user_data; + ev->pair_data = NULL; /* For renamed file. */ + /* Created timestamp */ + g_get_current_time(&ev->ctv); + ev->rename_tv = ev->ctv; + } + return ev; +} + +void +node_event_delete (node_event_t* ev) +{ + g_free (ev); } diff --git a/gio/fen/fen-node.h b/gio/fen/fen-node.h index f2ef1ea..7e99032 100644 --- a/gio/fen/fen-node.h +++ b/gio/fen/fen-node.h @@ -1,8 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim:set expandtab ts=4 shiftwidth=4: */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,52 +22,83 @@ * Authors: Lin Ma */ +#include +#include + #ifndef _FEN_NODE_H_ #define _FEN_NODE_H_ -typedef struct node node_t; +#ifdef GIO_COMPILATION +#define FN_EVENT_CREATED G_FILE_MONITOR_EVENT_CREATED +#else +#define FN_EVENT_CREATED GAMIN_EVENT_CREATED +#endif + +#define NODE_STATE_NONE 0x00000000 +#define NODE_STATE_ASSOCIATED 0x00000001 /* This is a confilct to NODE_FLAG_STAT_DONE */ +#define NODE_STATE_HAS_EVENTS 0x00000002 + +#define NODE_FLAG_NONE 0x00000000 +#define NODE_FLAG_SNAPSHOT_UPDATED 0x00000001 +#define NODE_FLAG_DIR 0x00000002 +#define NODE_FLAG_STAT_UPDATED 0x00000004 +#define NODE_CLE_STATE(f, st) (f->state &= ~(st)) +#define NODE_SET_STATE(f, st) (f->state = ((f->state & ~(st)) | (st))) +#define NODE_HAS_STATE(f, st) (f->state & (st)) + +#define NODE_CLE_FLAG(f, fl) (f->flag &= ~(fl)) +#define NODE_SET_FLAG(f, fl) (f->flag = ((f->flag & ~(fl)) | (fl))) +#define NODE_HAS_FLAG(f, fl) (f->flag & (fl)) + +typedef struct node node_t; struct node { - gchar *filename; - gchar *basename; - gint stat; - + file_obj_t fobj; /* Inherit from file_obj_t, must be the first. */ + GSource *source; + gchar *basename; + guint32 state; + guint32 flag; + GTimeVal atv; /* Timestamp for the first added sub. */ + /* the parent and children of node */ node_t *parent; GHashTable *children; /* children in basename */ - gpointer user_data; + /* List of subscriptions monitoring this fdata/path */ + GList *subs; + GList *dir_subs; + +#ifdef GIO_COMPILATION + GFile* gfile; +#endif }; -#define IS_TOPNODE(fp) (((node_t *)(fp))->parent == NULL) -#define NODE_NAME(fp) (((node_t *)(fp))->filename) +#define FILE_OBJECT(f) ((file_obj_t *)(f)) +#define NODE_NAME(f) (FILE_OBJECT(f)->fo_name) +#define NODE_PARENT(f) (((node_t *)f)->parent) +#define NODE_IS_ACTIVE(f) (f->dir_subs || f->subs) +#define NODE_IS_REQUIRED_BY_PARENT(f) (NODE_PARENT(f) && NODE_PARENT(f)->dir_subs) -typedef struct node_op +gboolean node_timeval_lt(const GTimeVal *val1, const GTimeVal *val2); +gboolean node_try_delete(node_t* node); +void node_traverse(node_t* node, void(*traverse_cb)(node_t*, gpointer), gpointer user_data); +node_t* node_find(node_t* node, const gchar* filename, gboolean create_on_missing); +gint node_lstat(node_t *f); +void node_create_children_snapshot(node_t *f, gint created_event, gboolean emit); +void node_adjust_deleted(node_t *f); +gboolean node_class_init(); + +typedef struct node_event { - /* find */ - void (*hit) (node_t* node, gpointer user_data); - node_t* (*add_missing) (node_t* parent, gpointer user_data); - /* delete */ - gboolean (*pre_del) (node_t* node, gpointer user_data); - /* data */ + int e; gpointer user_data; -} node_op_t; - -node_t* _add_node (node_t* parent, const gchar* filename); -void _remove_node (node_t* node, node_op_t* op); -void _pending_remove_node (node_t* node, node_op_t* op); - -void _travel_nodes (node_t* node, node_op_t* op); -node_t* _find_node_full (const gchar* filename, node_op_t* op); -node_t* _find_node (const gchar *filename); - -node_t* _children_find (node_t *f, const gchar *basename); -guint _children_num (node_t *f); - -gpointer _node_get_data (node_t* node); -gpointer _node_set_data (node_t* node, gpointer user_data); + gpointer pair_data; + GTimeVal ctv; /* Created timestamp */ + GTimeVal rename_tv; /* Possible rename timestamp */ +} node_event_t; -gboolean _node_class_init (); +node_event_t* node_event_new (int event, gpointer user_data); +void node_event_delete (node_event_t* ev); #endif /* _FEN_NODE_H_ */ diff --git a/gio/fen/gfendirectorymonitor.c b/gio/fen/gfendirectorymonitor.c index ba79713..055f52f 100644 --- a/gio/fen/gfendirectorymonitor.c +++ b/gio/fen/gfendirectorymonitor.c @@ -4,8 +4,8 @@ * * Copyright (C) 2006-2007 Red Hat, Inc. * Copyright (C) 2007 Sebastian Dröge. - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,17 +31,14 @@ #include "config.h" #include "gfendirectorymonitor.h" -#include "giomodule.h" +#include #include "fen-helper.h" -#include "gioalias.h" - struct _GFenDirectoryMonitor { - GLocalDirectoryMonitor parent_instance; - gboolean cancelled; - fen_sub* sub; + GLocalDirectoryMonitor parent_instance; + gboolean enabled; }; static gboolean g_fen_directory_monitor_cancel (GFileMonitor* monitor); @@ -56,16 +53,15 @@ G_DEFINE_TYPE_WITH_CODE (GFenDirectoryMonitor, g_fen_directory_monitor, G_TYPE_L static void g_fen_directory_monitor_finalize (GObject *object) { - GFenDirectoryMonitor *self = G_FEN_DIRECTORY_MONITOR (object); + GFenDirectoryMonitor *self = G_FEN_DIRECTORY_MONITOR (object); - if (self->sub) { - _fen_remove (G_LOCAL_DIRECTORY_MONITOR (self)->dirname, self->sub, TRUE); - _fen_sub_delete (self->sub); - self->sub = NULL; + if (self->enabled) { + fen_remove (G_LOCAL_DIRECTORY_MONITOR (self)->dirname, self, TRUE); + self->enabled = FALSE; } - if (G_OBJECT_CLASS (g_fen_directory_monitor_parent_class)->finalize) - (*G_OBJECT_CLASS (g_fen_directory_monitor_parent_class)->finalize) (object); + if (G_OBJECT_CLASS (g_fen_directory_monitor_parent_class)->finalize) + (*G_OBJECT_CLASS (g_fen_directory_monitor_parent_class)->finalize) (object); } static GObject * @@ -73,57 +69,55 @@ g_fen_directory_monitor_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { - GObject *obj; - GFenDirectoryMonitorClass *klass; - GObjectClass *parent_class; - GFenDirectoryMonitor *self; - const gchar *dirname = NULL; + GObject *obj; + GFenDirectoryMonitorClass *klass; + GObjectClass *parent_class; + GFenDirectoryMonitor *self; + const gchar *dirname = NULL; - klass = G_FEN_DIRECTORY_MONITOR_CLASS (g_type_class_peek (G_TYPE_FEN_DIRECTORY_MONITOR)); - parent_class = g_fen_directory_monitor_parent_class; - obj = parent_class->constructor (type, + klass = G_FEN_DIRECTORY_MONITOR_CLASS (g_type_class_peek (G_TYPE_FEN_DIRECTORY_MONITOR)); + parent_class = g_fen_directory_monitor_parent_class; + obj = parent_class->constructor (type, n_construct_properties, construct_properties); - self = G_FEN_DIRECTORY_MONITOR (obj); + self = G_FEN_DIRECTORY_MONITOR (obj); - dirname = G_LOCAL_DIRECTORY_MONITOR (self)->dirname; - g_assert (dirname != NULL); + dirname = G_LOCAL_DIRECTORY_MONITOR (self)->dirname; + g_assert (dirname != NULL); - /* Will never fail as is_supported() should be called before instanciating - * anyway */ - if (!_fen_init ()) + /* Will never fail as is_supported() should be called before instanciating + * anyway */ + if (!fen_init ()) g_assert_not_reached (); - /* FIXME: what to do about errors here? we can't return NULL or another - * kind of error and an assertion is probably too hard */ - self->sub = _fen_sub_new (self, TRUE); - g_assert (self->sub); - - _fen_add (dirname, self->sub, TRUE); + /* FIXME: what to do about errors here? we can't return NULL or another + * kind of error and an assertion is probably too hard */ + fen_add (dirname, self, TRUE); + self->enabled = TRUE; - return obj; + return obj; } static gboolean g_fen_directory_monitor_is_supported (void) { - return _fen_init (); + return fen_init (); } static void g_fen_directory_monitor_class_init (GFenDirectoryMonitorClass* klass) { - GObjectClass* gobject_class = G_OBJECT_CLASS (klass); - GFileMonitorClass *directory_monitor_class = G_FILE_MONITOR_CLASS (klass); - GLocalDirectoryMonitorClass *local_directory_monitor_class = G_LOCAL_DIRECTORY_MONITOR_CLASS (klass); + GObjectClass* gobject_class = G_OBJECT_CLASS (klass); + GFileMonitorClass *directory_monitor_class = G_FILE_MONITOR_CLASS (klass); + GLocalDirectoryMonitorClass *local_directory_monitor_class = G_LOCAL_DIRECTORY_MONITOR_CLASS (klass); - gobject_class->finalize = g_fen_directory_monitor_finalize; - gobject_class->constructor = g_fen_directory_monitor_constructor; - directory_monitor_class->cancel = g_fen_directory_monitor_cancel; + gobject_class->finalize = g_fen_directory_monitor_finalize; + gobject_class->constructor = g_fen_directory_monitor_constructor; + directory_monitor_class->cancel = g_fen_directory_monitor_cancel; - local_directory_monitor_class->mount_notify = TRUE; - local_directory_monitor_class->is_supported = g_fen_directory_monitor_is_supported; + local_directory_monitor_class->mount_notify = TRUE; + local_directory_monitor_class->is_supported = g_fen_directory_monitor_is_supported; } static void @@ -134,17 +128,15 @@ g_fen_directory_monitor_init (GFenDirectoryMonitor* monitor) static gboolean g_fen_directory_monitor_cancel (GFileMonitor* monitor) { - GFenDirectoryMonitor *self = G_FEN_DIRECTORY_MONITOR (monitor); + GFenDirectoryMonitor *self = G_FEN_DIRECTORY_MONITOR (monitor); - if (self->sub) { - _fen_remove (G_LOCAL_DIRECTORY_MONITOR (self)->dirname, self->sub, TRUE); - _fen_sub_delete (self->sub); - self->sub = NULL; + if (self->enabled) { + fen_remove (G_LOCAL_DIRECTORY_MONITOR (self)->dirname, self, TRUE); + self->enabled = FALSE; } - if (G_FILE_MONITOR_CLASS (g_fen_directory_monitor_parent_class)->cancel) - (*G_FILE_MONITOR_CLASS (g_fen_directory_monitor_parent_class)->cancel) (monitor); + if (G_FILE_MONITOR_CLASS (g_fen_directory_monitor_parent_class)->cancel) + (*G_FILE_MONITOR_CLASS (g_fen_directory_monitor_parent_class)->cancel) (monitor); - return TRUE; + return TRUE; } - diff --git a/gio/fen/gfendirectorymonitor.h b/gio/fen/gfendirectorymonitor.h index c22998c..a4d133d 100644 --- a/gio/fen/gfendirectorymonitor.h +++ b/gio/fen/gfendirectorymonitor.h @@ -4,6 +4,8 @@ * * Copyright (C) 2006-2007 Red Hat, Inc. * Copyright (C) 2007 Sebastian Dröge. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +25,7 @@ * Authors: Alexander Larsson * John McCutchan * Sebastian Dröge + * Lin Ma */ #ifndef __G_FEN_DIRECTORY_MONITOR_H__ @@ -30,8 +33,8 @@ #include #include -#include "glocaldirectorymonitor.h" -#include "giomodule.h" +#include +#include G_BEGIN_DECLS diff --git a/gio/fen/gfenfilemonitor.c b/gio/fen/gfenfilemonitor.c index f075388..72394cf 100644 --- a/gio/fen/gfenfilemonitor.c +++ b/gio/fen/gfenfilemonitor.c @@ -4,8 +4,8 @@ * * Copyright (C) 2006-2007 Red Hat, Inc. * Copyright (C) 2007 Sebastian Dröge. - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,12 +35,10 @@ #include "fen-helper.h" -#include "gioalias.h" - struct _GFenFileMonitor { GLocalFileMonitor parent_instance; - fen_sub* sub; + gboolean enabled; }; static gboolean g_fen_file_monitor_cancel (GFileMonitor* monitor); @@ -55,12 +53,11 @@ G_DEFINE_TYPE_WITH_CODE (GFenFileMonitor, g_fen_file_monitor, G_TYPE_LOCAL_FILE_ static void g_fen_file_monitor_finalize (GObject *object) { - GFenFileMonitor *self = G_FEN_FILE_MONITOR (object); + GFenFileMonitor *self = G_FEN_FILE_MONITOR (object); - if (self->sub) { - _fen_remove (G_LOCAL_FILE_MONITOR (self)->filename, self->sub, FALSE); - _fen_sub_delete (self->sub); - self->sub = NULL; + if (self->enabled) { + fen_remove (G_LOCAL_FILE_MONITOR (self)->filename, self, FALSE); + self->enabled = FALSE; } if (G_OBJECT_CLASS (g_fen_file_monitor_parent_class)->finalize) @@ -92,15 +89,13 @@ g_fen_file_monitor_constructor (GType type, /* Will never fail as is_supported() should be called before instanciating * anyway */ - if (!_fen_init ()) + if (!fen_init ()) g_assert_not_reached (); /* FIXME: what to do about errors here? we can't return NULL or another * kind of error and an assertion is probably too hard */ - self->sub = _fen_sub_new (self, FALSE); - g_assert (self->sub); - - _fen_add (filename, self->sub, FALSE); + fen_add (filename, self, FALSE); + self->enabled = TRUE; return obj; } @@ -108,7 +103,7 @@ g_fen_file_monitor_constructor (GType type, static gboolean g_fen_file_monitor_is_supported (void) { - return _fen_init (); + return fen_init (); } static void @@ -135,10 +130,9 @@ g_fen_file_monitor_cancel (GFileMonitor* monitor) { GFenFileMonitor *self = G_FEN_FILE_MONITOR (monitor); - if (self->sub) { - _fen_remove (G_LOCAL_FILE_MONITOR (self)->filename, self->sub, FALSE); - _fen_sub_delete (self->sub); - self->sub = NULL; + if (self->enabled) { + fen_remove (G_LOCAL_FILE_MONITOR (self)->filename, self, FALSE); + self->enabled = FALSE; } if (G_FILE_MONITOR_CLASS (g_fen_file_monitor_parent_class)->cancel) @@ -146,4 +140,3 @@ g_fen_file_monitor_cancel (GFileMonitor* monitor) return TRUE; } - diff --git a/gio/fen/gfenfilemonitor.h b/gio/fen/gfenfilemonitor.h index e8b2e6a..e44fd99 100644 --- a/gio/fen/gfenfilemonitor.h +++ b/gio/fen/gfenfilemonitor.h @@ -4,6 +4,8 @@ * * Copyright (C) 2006-2007 Red Hat, Inc. * Copyright (C) 2007 Sebastian Dröge. + * Copyright (c) 2008, 2010 Oracle and/or its affiliates, Inc. All rights + * reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +25,7 @@ * Authors: Alexander Larsson * John McCutchan * Sebastian Dröge + * Lin Ma */ #ifndef __G_FEN_FILE_MONITOR_H__ diff --git a/gio/gaction.c b/gio/gaction.c new file mode 100644 index 0000000..6c2ee1d --- /dev/null +++ b/gio/gaction.c @@ -0,0 +1,375 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#include "config.h" +#include "gaction.h" +#include "glibintl.h" + +G_DEFINE_INTERFACE (GAction, g_action, G_TYPE_OBJECT) + +/** + * SECTION:gaction + * @title: GAction + * @short_description: An action + * + * #GAction represents a single named action. + * + * The main interface to an action is that it can be activated with + * g_action_activate(). This results in the 'activate' signal being + * emitted. An activation has a #GVariant parameter (which may be + * %NULL). The correct type for the parameter is determined by a static + * parameter type (which is given at construction time). + * + * An action may optionally have a state, in which case the state may be + * set with g_action_set_state(). This call takes a #GVariant. The + * correct type for the state is determined by a static state type + * (which is given at construction time). + * + * The state may have a hint associated with it, specifying its valid + * range. + * + * #GAction is merely the interface to the concept of an action, as + * described above. Various implementations of actions exist, including + * #GSimpleAction and #GtkAction. + * + * In all cases, the implementing class is responsible for storing the + * name of the action, the parameter type, the enabled state, the + * optional state type and the state and emitting the appropriate + * signals when these change. The implementor responsible for filtering + * calls to g_action_activate() and g_action_set_state() for type safety + * and for the state being enabled. + * + * Probably the only useful thing to do with a #GAction is to put it + * inside of a #GSimpleActionGroup. + **/ + +void +g_action_default_init (GActionInterface *iface) +{ + /** + * GAction:name: + * + * The name of the action. This is mostly meaningful for identifying + * the action once it has been added to a #GActionGroup. + * + * Since: 2.28 + **/ + g_object_interface_install_property (iface, + g_param_spec_string ("name", + P_("Action Name"), + P_("The name used to invoke the action"), + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GAction:parameter-type: + * + * The type of the parameter that must be given when activating the + * action. + * + * Since: 2.28 + **/ + g_object_interface_install_property (iface, + g_param_spec_boxed ("parameter-type", + P_("Parameter Type"), + P_("The type of GVariant passed to activate()"), + G_TYPE_VARIANT_TYPE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GAction:enabled: + * + * If @action is currently enabled. + * + * If the action is disabled then calls to g_action_activate() and + * g_action_set_state() have no effect. + * + * Since: 2.28 + **/ + g_object_interface_install_property (iface, + g_param_spec_boolean ("enabled", + P_("Enabled"), + P_("If the action can be activated"), + TRUE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GAction:state-type: + * + * The #GVariantType of the state that the action has, or %NULL if the + * action is stateless. + * + * Since: 2.28 + **/ + g_object_interface_install_property (iface, + g_param_spec_boxed ("state-type", + P_("State Type"), + P_("The type of the state kept by the action"), + G_TYPE_VARIANT_TYPE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GAction:state: + * + * The state of the action, or %NULL if the action is stateless. + * + * Since: 2.28 + **/ + g_object_interface_install_property (iface, + g_param_spec_variant ("state", + P_("State"), + P_("The state the action is in"), + G_VARIANT_TYPE_ANY, + NULL, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); +} + +/** + * g_action_set_state: + * @action: a #GAction + * @value: the new state + * + * Request for the state of @action to be changed to @value. + * + * The action must be stateful and @value must be of the correct type. + * See g_action_get_state_type(). + * + * This call merely requests a change. The action may refuse to change + * its state or may change its state to something other than @value. + * See g_action_get_state_hint(). + * + * If the @value GVariant is floating, it is consumed. + * + * Since: 2.28 + **/ +void +g_action_set_state (GAction *action, + GVariant *value) +{ + const GVariantType *state_type; + + g_return_if_fail (G_IS_ACTION (action)); + g_return_if_fail (value != NULL); + state_type = g_action_get_state_type (action); + g_return_if_fail (state_type != NULL); + g_return_if_fail (g_variant_is_of_type (value, state_type)); + + g_variant_ref_sink (value); + + G_ACTION_GET_IFACE (action) + ->set_state (action, value); + + g_variant_unref (value); +} + +/** + * g_action_get_state: + * @action: a #GAction + * + * Queries the current state of @action. + * + * If the action is not stateful then %NULL will be returned. If the + * action is stateful then the type of the return value is the type + * given by g_action_get_state_type(). + * + * The return value (if non-%NULL) should be freed with + * g_variant_unref() when it is no longer required. + * + * Returns: (transfer full): the current state of the action + * + * Since: 2.28 + **/ +GVariant * +g_action_get_state (GAction *action) +{ + g_return_val_if_fail (G_IS_ACTION (action), NULL); + + return G_ACTION_GET_IFACE (action) + ->get_state (action); +} + +/** + * g_action_get_name: + * @action: a #GAction + * + * Queries the name of @action. + * + * Returns: the name of the action + * + * Since: 2.28 + **/ +const gchar * +g_action_get_name (GAction *action) +{ + g_return_val_if_fail (G_IS_ACTION (action), NULL); + + return G_ACTION_GET_IFACE (action) + ->get_name (action); +} + +/** + * g_action_get_parameter_type: + * @action: a #GAction + * + * Queries the type of the parameter that must be given when activating + * @action. + * + * When activating the action using g_action_activate(), the #GVariant + * given to that function must be of the type returned by this function. + * + * In the case that this function returns %NULL, you must not give any + * #GVariant, but %NULL instead. + * + * Returns: (allow-none): the parameter type + * + * Since: 2.28 + **/ +const GVariantType * +g_action_get_parameter_type (GAction *action) +{ + g_return_val_if_fail (G_IS_ACTION (action), NULL); + + return G_ACTION_GET_IFACE (action) + ->get_parameter_type (action); +} + +/** + * g_action_get_state_type: + * @action: a #GAction + * + * Queries the type of the state of @action. + * + * If the action is stateful (ie: was created with + * g_action_new_stateful()) then this function returns the #GVariantType + * of the state. This is the type of the initial value given as the + * state. All calls to g_action_set_state() must give a #GVariant of + * this type and g_action_get_state() will return a #GVariant of the + * same type. + * + * If the action is not stateful (ie: created with g_action_new()) then + * this function will return %NULL. In that case, g_action_get_state() + * will return %NULL and you must not call g_action_set_state(). + * + * Returns: (allow-none): the state type, if the action is stateful + * + * Since: 2.28 + **/ +const GVariantType * +g_action_get_state_type (GAction *action) +{ + g_return_val_if_fail (G_IS_ACTION (action), NULL); + + return G_ACTION_GET_IFACE (action) + ->get_state_type (action); +} + +/** + * g_action_get_state_hint: + * @action: a #GAction + * + * Requests a hint about the valid range of values for the state of + * @action. + * + * If %NULL is returned it either means that the action is not stateful + * or that there is no hint about the valid range of values for the + * state of the action. + * + * If a #GVariant array is returned then each item in the array is a + * possible value for the state. If a #GVariant pair (ie: two-tuple) is + * returned then the tuple specifies the inclusive lower and upper bound + * of valid values for the state. + * + * In any case, the information is merely a hint. It may be possible to + * have a state value outside of the hinted range and setting a value + * within the range may fail. + * + * The return value (if non-%NULL) should be freed with + * g_variant_unref() when it is no longer required. + * + * Returns: (transfer full): the state range hint + * + * Since: 2.28 + **/ +GVariant * +g_action_get_state_hint (GAction *action) +{ + g_return_val_if_fail (G_IS_ACTION (action), NULL); + + return G_ACTION_GET_IFACE (action) + ->get_state_hint (action); +} + +/** + * g_action_get_enabled: + * @action: a #GAction + * + * Checks if @action is currently enabled. + * + * An action must be enabled in order to be activated or in order to + * have its state changed from outside callers. + * + * Returns: whether the action is enabled + * + * Since: 2.28 + **/ +gboolean +g_action_get_enabled (GAction *action) +{ + g_return_val_if_fail (G_IS_ACTION (action), FALSE); + + return G_ACTION_GET_IFACE (action) + ->get_enabled (action); +} + +/** + * g_action_activate: + * @action: a #GAction + * @parameter: (allow-none): the parameter to the activation + * + * Activates the action. + * + * @parameter must be the correct type of parameter for the action (ie: + * the parameter type given at construction time). If the parameter + * type was %NULL then @parameter must also be %NULL. + * + * Since: 2.28 + **/ +void +g_action_activate (GAction *action, + GVariant *parameter) +{ + g_return_if_fail (G_IS_ACTION (action)); + + if (parameter != NULL) + g_variant_ref_sink (parameter); + + G_ACTION_GET_IFACE (action) + ->activate (action, parameter); + + if (parameter != NULL) + g_variant_unref (parameter); +} diff --git a/gio/gaction.h b/gio/gaction.h new file mode 100644 index 0000000..292c71a --- /dev/null +++ b/gio/gaction.h @@ -0,0 +1,91 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_ACTION_H__ +#define __G_ACTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_ACTION (g_action_get_type ()) +#define G_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_ACTION, GAction)) +#define G_IS_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_ACTION)) +#define G_ACTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \ + G_TYPE_ACTION, GActionInterface)) + +typedef struct _GActionInterface GActionInterface; + +/** + * GActionInterface: + * @get_name: the virtual function pointer for g_action_get_name() + * @get_parameter_type: the virtual function pointer for g_action_get_parameter_type() + * @get_state_type: the virtual function pointer for g_action_get_state_type() + * @get_state_hint: the virtual function pointer for g_action_get_state_hint() + * @get_enabled: the virtual function pointer for g_action_get_enabled() + * @get_state: the virtual function pointer for g_action_get_state() + * @set_state: the virtual function pointer for g_action_set_state() + * @activate: the virtual function pointer for g_action_activate(). Note that #GAction does not have an + * 'activate' signal but that implementations of it may have one. + * + * Since: 2.26 + */ +struct _GActionInterface +{ + GTypeInterface g_iface; + + /* virtual functions */ + const gchar * (* get_name) (GAction *action); + const GVariantType * (* get_parameter_type) (GAction *action); + const GVariantType * (* get_state_type) (GAction *action); + GVariant * (* get_state_hint) (GAction *action); + + gboolean (* get_enabled) (GAction *action); + GVariant * (* get_state) (GAction *action); + void (* set_state) (GAction *action, + GVariant *value); + + void (* activate) (GAction *action, + GVariant *parameter); +}; + +GType g_action_get_type (void) G_GNUC_CONST; + +const gchar * g_action_get_name (GAction *action); +const GVariantType * g_action_get_parameter_type (GAction *action); +const GVariantType * g_action_get_state_type (GAction *action); +GVariant * g_action_get_state_hint (GAction *action); + +gboolean g_action_get_enabled (GAction *action); +GVariant * g_action_get_state (GAction *action); +void g_action_set_state (GAction *action, + GVariant *value); + +void g_action_activate (GAction *action, + GVariant *parameter); +G_END_DECLS + +#endif /* __G_ACTION_H__ */ diff --git a/gio/gactiongroup.c b/gio/gactiongroup.c new file mode 100644 index 0000000..735f016 --- /dev/null +++ b/gio/gactiongroup.c @@ -0,0 +1,518 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#include "config.h" +#include "gactiongroup.h" +#include "gaction.h" +#include "gio-marshal.h" +#include "glibintl.h" + +/** + * SECTION:gactiongroup + * @title: GActionGroup + * @short_description: A group of actions + * + * #GActionGroup represents a group of actions. + * + * Each action in the group has a unique name (which is a string). All + * method calls, except g_action_group_list_actions() take the name of + * an action as an argument. + * + * The #GActionGroup API is meant to be the 'public' API to the action + * group. The calls here are exactly the interaction that 'external + * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have + * with actions. 'Internal' APIs (ie: ones meant only to be accessed by + * the action group implementation) are found on subclasses. This is + * why you will find -- for example -- g_action_group_get_enabled() but + * not an equivalent set() call. + * + * Signals are emitted on the action group in response to state changes + * on individual actions. + **/ + +G_DEFINE_INTERFACE (GActionGroup, g_action_group, G_TYPE_OBJECT) + +enum +{ + SIGNAL_ACTION_ADDED, + SIGNAL_ACTION_REMOVED, + SIGNAL_ACTION_ENABLED_CHANGED, + SIGNAL_ACTION_STATE_CHANGED, + NR_SIGNALS +}; + +static guint g_action_group_signals[NR_SIGNALS]; + +static void +g_action_group_default_init (GActionGroupInterface *class) +{ + /** + * GActionGroup::action-added: + * @action_group: the #GActionGroup that changed + * @action_name: the name of the action in @action_group + * + * Signals that a new action was just added to the group. This signal + * is emitted after the action has been added and is now visible. + * + * Since: 2.28 + **/ + g_action_group_signals[SIGNAL_ACTION_ADDED] = + g_signal_new (I_("action-added"), + G_TYPE_ACTION_GROUP, + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (GActionGroupInterface, action_added), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + /** + * GActionGroup::action-removed: + * @action_group: the #GActionGroup that changed + * @action_name: the name of the action in @action_group + * + * Signals that an action is just about to be removed from the group. + * This signal is emitted before the action is removed, so the action + * is still visible and can be queried from the signal handler. + * + * Since: 2.28 + **/ + g_action_group_signals[SIGNAL_ACTION_REMOVED] = + g_signal_new (I_("action-removed"), + G_TYPE_ACTION_GROUP, + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (GActionGroupInterface, action_removed), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + + /** + * GActionGroup::action-enabled-changed: + * @action_group: the #GActionGroup that changed + * @action_name: the name of the action in @action_group + * @enabled: whether the action is enabled or not + * + * Signals that the enabled status of the named action has changed. + * + * Since: 2.28 + **/ + g_action_group_signals[SIGNAL_ACTION_ENABLED_CHANGED] = + g_signal_new (I_("action-enabled-changed"), + G_TYPE_ACTION_GROUP, + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (GActionGroupInterface, + action_enabled_changed), + NULL, NULL, + _gio_marshal_VOID__STRING_BOOLEAN, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_BOOLEAN); + + /** + * GActionGroup::action-state-changed: + * @action_group: the #GActionGroup that changed + * @action_name: the name of the action in @action_group + * @value: the new value of the state + * + * Signals that the state of the named action has changed. + * + * Since: 2.28 + **/ + g_action_group_signals[SIGNAL_ACTION_STATE_CHANGED] = + g_signal_new (I_("action-state-changed"), + G_TYPE_ACTION_GROUP, + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (GActionGroupInterface, + action_state_changed), + NULL, NULL, + _gio_marshal_VOID__STRING_VARIANT, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_VARIANT); +} + +/** + * g_action_group_list_actions: + * @action_group: a #GActionGroup + * + * Lists the actions contained within @action_group. + * + * The caller is responsible for freeing the list with g_strfreev() when + * it is no longer required. + * + * Returns: (transfer full): a %NULL-terminated array of the names of the + * actions in the groupb + * + * Since: 2.28 + **/ +gchar ** +g_action_group_list_actions (GActionGroup *action_group) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), NULL); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->list_actions (action_group); +} + +/** + * g_action_group_has_action: + * @action_group: a #GActionGroup + * @action_name: the name of the action to check for + * + * Checks if the named action exists within @action_group. + * + * Returns: whether the named action exists + * + * Since: 2.28 + **/ +gboolean +g_action_group_has_action (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), FALSE); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->has_action (action_group, action_name); +} + +/** + * g_action_group_get_action_parameter_type: + * @action_group: a #GActionGroup + * @action_name: the name of the action to query + * + * Queries the type of the parameter that must be given when activating + * the named action within @action_group. + * + * When activating the action using g_action_group_activate(), the + * #GVariant given to that function must be of the type returned by this + * function. + * + * In the case that this function returns %NULL, you must not give any + * #GVariant, but %NULL instead. + * + * The parameter type of a particular action will never change but it is + * possible for an action to be removed and for a new action to be added + * with the same name but a different parameter type. + * + * Return value: the parameter type + * + * Since: 2.28 + **/ +const GVariantType * +g_action_group_get_action_parameter_type (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), NULL); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->get_action_parameter_type (action_group, action_name); +} + +/** + * g_action_group_get_action_state_type: + * @action_group: a #GActionGroup + * @action_name: the name of the action to query + * + * Queries the type of the state of the named action within + * @action_group. + * + * If the action is stateful then this function returns the + * #GVariantType of the state. All calls to g_action_group_set_state() + * must give a #GVariant of this type and g_action_group_get_state() + * will return a #GVariant of the same type. + * + * If the action is not stateful then this function will return %NULL. + * In that case, g_action_group_get_state() will return %NULL and you + * must not call g_action_group_set_state(). + * + * The state type of a particular action will never change but it is + * possible for an action to be removed and for a new action to be added + * with the same name but a different state type. + * + * Returns: (transfer full): the state type, if the action is stateful + * + * Since: 2.28 + **/ +const GVariantType * +g_action_group_get_action_state_type (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), NULL); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->get_action_state_type (action_group, action_name); +} + +/** + * g_action_group_get_action_state_hint: + * @action_group: a #GActionGroup + * @action_name: the name of the action to query + * + * Requests a hint about the valid range of values for the state of the + * named action within @action_group. + * + * If %NULL is returned it either means that the action is not stateful + * or that there is no hint about the valid range of values for the + * state of the action. + * + * If a #GVariant array is returned then each item in the array is a + * possible value for the state. If a #GVariant pair (ie: two-tuple) is + * returned then the tuple specifies the inclusive lower and upper bound + * of valid values for the state. + * + * In any case, the information is merely a hint. It may be possible to + * have a state value outside of the hinted range and setting a value + * within the range may fail. + * + * The return value (if non-%NULL) should be freed with + * g_variant_unref() when it is no longer required. + * + * Return value: (transfer full): the state range hint + * + * Since: 2.28 + **/ +GVariant * +g_action_group_get_action_state_hint (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), NULL); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->get_action_state_hint (action_group, action_name); +} + +/** + * g_action_group_get_action_enabled: + * @action_group: a #GActionGroup + * @action_name: the name of the action to query + * + * Checks if the named action within @action_group is currently enabled. + * + * An action must be enabled in order to be activated or in order to + * have its state changed from outside callers. + * + * Return value: whether or not the action is currently enabled + * + * Since: 2.28 + **/ +gboolean +g_action_group_get_action_enabled (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), FALSE); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->get_action_enabled (action_group, action_name); +} + +/** + * g_action_group_get_action_state: + * @action_group: a #GActionGroup + * @action_name: the name of the action to query + * + * Queries the current state of the named action within @action_group. + * + * If the action is not stateful then %NULL will be returned. If the + * action is stateful then the type of the return value is the type + * given by g_action_group_get_state_type(). + * + * The return value (if non-%NULL) should be freed with + * g_variant_unref() when it is no longer required. + * + * Return value: (allow-none): the current state of the action + * + * Since: 2.28 + **/ +GVariant * +g_action_group_get_action_state (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_ACTION_GROUP (action_group), NULL); + + return G_ACTION_GROUP_GET_IFACE (action_group) + ->get_action_state (action_group, action_name); +} + +/** + * g_action_group_change_action_state: + * @action_group: a #GActionGroup + * @action_name: the name of the action to request the change on + * @value: the new state + * + * Request for the state of the named action within @action_group to be + * changed to @value. + * + * The action must be stateful and @value must be of the correct type. + * See g_action_group_get_state_type(). + * + * This call merely requests a change. The action may refuse to change + * its state or may change its state to something other than @value. + * See g_action_group_get_state_hint(). + * + * If the @value GVariant is floating, it is consumed. + * + * Since: 2.28 + **/ +void +g_action_group_change_action_state (GActionGroup *action_group, + const gchar *action_name, + GVariant *value) +{ + g_return_if_fail (G_IS_ACTION_GROUP (action_group)); + g_return_if_fail (action_name != NULL); + g_return_if_fail (value != NULL); + + G_ACTION_GROUP_GET_IFACE (action_group) + ->change_action_state (action_group, action_name, value); +} + +/** + * g_action_group_activate_action: + * @action_group: a #GActionGroup + * @action_name: the name of the action to activate + * @parameter: (allow-none): parameters to the activation + * + * Activate the named action within @action_group. + * + * If the action is expecting a parameter, then the correct type of + * parameter must be given as @parameter. If the action is expecting no + * parameters then @parameter must be %NULL. See + * g_action_group_get_parameter_type(). + * + * Since: 2.28 + **/ +void +g_action_group_activate_action (GActionGroup *action_group, + const gchar *action_name, + GVariant *parameter) +{ + g_return_if_fail (G_IS_ACTION_GROUP (action_group)); + g_return_if_fail (action_name != NULL); + + G_ACTION_GROUP_GET_IFACE (action_group) + ->activate_action (action_group, action_name, parameter); +} + +/** + * g_action_group_action_added: + * @action_group: a #GActionGroup + * @action_name: the name of an action in the group + * + * Emits the #GActionGroup::action-added signal on @action_group. + * + * This function should only be called by #GActionGroup implementations. + * + * Since: 2.28 + **/ +void +g_action_group_action_added (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_if_fail (G_IS_ACTION_GROUP (action_group)); + g_return_if_fail (action_name != NULL); + + g_signal_emit (action_group, + g_action_group_signals[SIGNAL_ACTION_ADDED], + g_quark_try_string (action_name), + action_name); +} + +/** + * g_action_group_action_removed: + * @action_group: a #GActionGroup + * @action_name: the name of an action in the group + * + * Emits the #GActionGroup::action-removed signal on @action_group. + * + * This function should only be called by #GActionGroup implementations. + * + * Since: 2.28 + **/ +void +g_action_group_action_removed (GActionGroup *action_group, + const gchar *action_name) +{ + g_return_if_fail (G_IS_ACTION_GROUP (action_group)); + g_return_if_fail (action_name != NULL); + + g_signal_emit (action_group, + g_action_group_signals[SIGNAL_ACTION_REMOVED], + g_quark_try_string (action_name), + action_name); +} + +/** + * g_action_group_action_enabled_changed: + * @action_group: a #GActionGroup + * @action_name: the name of an action in the group + * @enabled: whether or not the action is now enabled + * + * Emits the #GActionGroup::action-enabled-changed signal on @action_group. + * + * This function should only be called by #GActionGroup implementations. + * + * Since: 2.28 + **/ +void +g_action_group_action_enabled_changed (GActionGroup *action_group, + const gchar *action_name, + gboolean enabled) +{ + g_return_if_fail (G_IS_ACTION_GROUP (action_group)); + g_return_if_fail (action_name != NULL); + + enabled = !!enabled; + + g_signal_emit (action_group, + g_action_group_signals[SIGNAL_ACTION_ENABLED_CHANGED], + g_quark_try_string (action_name), + action_name, + enabled); +} + +/** + * g_action_group_action_state_changed: + * @action_group: a #GActionGroup + * @action_name: the name of an action in the group + * @state: the new state of the named action + * + * Emits the #GActionGroup::action-state-changed signal on @action_group. + * + * This function should only be called by #GActionGroup implementations. + * + * Since: 2.28 + **/ +void +g_action_group_action_state_changed (GActionGroup *action_group, + const gchar *action_name, + GVariant *state) +{ + g_return_if_fail (G_IS_ACTION_GROUP (action_group)); + g_return_if_fail (action_name != NULL); + + g_signal_emit (action_group, + g_action_group_signals[SIGNAL_ACTION_STATE_CHANGED], + g_quark_try_string (action_name), + action_name, + state); +} diff --git a/gio/gactiongroup.h b/gio/gactiongroup.h new file mode 100644 index 0000000..7ad9a9d --- /dev/null +++ b/gio/gactiongroup.h @@ -0,0 +1,158 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_ACTION_GROUP_H__ +#define __G_ACTION_GROUP_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_ACTION_GROUP (g_action_group_get_type ()) +#define G_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_ACTION_GROUP, GActionGroup)) +#define G_IS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_ACTION_GROUP)) +#define G_ACTION_GROUP_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \ + G_TYPE_ACTION_GROUP, GActionGroupInterface)) + +#define G_TYPE_ACTION_GROUP (g_action_group_get_type ()) +#define G_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_ACTION_GROUP, GActionGroup)) +#define G_IS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_ACTION_GROUP)) +#define G_ACTION_GROUP_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \ + G_TYPE_ACTION_GROUP, GActionGroupInterface)) + +typedef struct _GActionGroupInterface GActionGroupInterface; + +/** + * GActionGroupInterface: + * @has_action: the virtual function pointer for g_action_group_has_action() + * @list_actions: the virtual function pointer for g_action_group_list_actions() + * @get_parameter_type: the virtual function pointer for g_action_group_get_parameter_type() + * @get_state_type: the virtual function pointer for g_action_group_get_state_type() + * @get_state_hint: the virtual function pointer for g_action_group_get_state_hint() + * @get_enabled: the virtual function pointer for g_action_group_get_enabled() + * @get_state: the virtual function pointer for g_action_group_get_state() + * @set_state: the virtual function pointer for g_action_group_set_state() + * @activate: the virtual function pointer for g_action_group_activate() + * @action_added: the class closure for the action-added signal + * @action_removed: the class closure for the action-removed signal + * @action_enabled_changed: the class closure for the action-enabled-changed signal + * @action_state_changed: the class closure for the action-enabled-changed signal + * + * The virtual function table for #GActionGroup. + * + * Since: 2.26 + */ +struct _GActionGroupInterface +{ + GTypeInterface g_iface; + + /* virtual functions */ + gboolean (* has_action) (GActionGroup *action_group, + const gchar *action_name); + + gchar ** (* list_actions) (GActionGroup *action_group); + + gboolean (* get_action_enabled) (GActionGroup *action_group, + const gchar *action_name); + + const GVariantType * (* get_action_parameter_type) (GActionGroup *action_group, + const gchar *action_name); + + const GVariantType * (* get_action_state_type) (GActionGroup *action_group, + const gchar *action_name); + + GVariant * (* get_action_state_hint) (GActionGroup *action_group, + const gchar *action_name); + + GVariant * (* get_action_state) (GActionGroup *action_group, + const gchar *action_name); + + void (* change_action_state) (GActionGroup *action_group, + const gchar *action_name, + GVariant *value); + + void (* activate_action) (GActionGroup *action_group, + const gchar *action_name, + GVariant *parameter); + + /* signals */ + void (* action_added) (GActionGroup *action_group, + const gchar *action_name); + void (* action_removed) (GActionGroup *action_group, + const gchar *action_name); + void (* action_enabled_changed) (GActionGroup *action_group, + const gchar *action_name, + gboolean enabled); + void (* action_state_changed) (GActionGroup *action_group, + const gchar *action_name, + GVariant *value); +}; + +GType g_action_group_get_type (void) G_GNUC_CONST; + +gboolean g_action_group_has_action (GActionGroup *action_group, + const gchar *action_name); +gchar ** g_action_group_list_actions (GActionGroup *action_group); + +const GVariantType * g_action_group_get_action_parameter_type (GActionGroup *action_group, + const gchar *action_name); +const GVariantType * g_action_group_get_action_state_type (GActionGroup *action_group, + const gchar *action_name); +GVariant * g_action_group_get_action_state_hint (GActionGroup *action_group, + const gchar *action_name); + +gboolean g_action_group_get_action_enabled (GActionGroup *action_group, + const gchar *action_name); + +GVariant * g_action_group_get_action_state (GActionGroup *action_group, + const gchar *action_name); +void g_action_group_change_action_state (GActionGroup *action_group, + const gchar *action_name, + GVariant *value); + +void g_action_group_activate_action (GActionGroup *action_group, + const gchar *action_name, + GVariant *parameter); + +/* signals */ +void g_action_group_action_added (GActionGroup *action_group, + const gchar *action_name); +void g_action_group_action_removed (GActionGroup *action_group, + const gchar *action_name); +void g_action_group_action_enabled_changed (GActionGroup *action_group, + const gchar *action_name, + gboolean enabled); + +void g_action_group_action_state_changed (GActionGroup *action_group, + const gchar *action_name, + GVariant *state); + +G_END_DECLS + +#endif /* __G_ACTION_GROUP_H__ */ diff --git a/gio/gappinfo.c b/gio/gappinfo.c index 6feec82..6f6375c 100644 --- a/gio/gappinfo.c +++ b/gio/gappinfo.c @@ -26,14 +26,13 @@ #include #include -#include "gioalias.h" /** * SECTION:gappinfo * @short_description: Application information and launch contexts * @include: gio/gio.h * - * #GAppInfo and #GAppLaunchContext are used for describing and launching + * #GAppInfo and #GAppLaunchContext are used for describing and launching * applications installed on the system. * * As of GLib 2.20, URIs will always be converted to POSIX paths @@ -101,7 +100,7 @@ g_app_info_default_init (GAppInfoInterface *iface) * * Creates a duplicate of a #GAppInfo. * - * Returns: a duplicate of @appinfo. + * Returns: (transfer full): a duplicate of @appinfo. **/ GAppInfo * g_app_info_dup (GAppInfo *appinfo) @@ -117,9 +116,9 @@ g_app_info_dup (GAppInfo *appinfo) /** * g_app_info_equal: - * @appinfo1: the first #GAppInfo. + * @appinfo1: the first #GAppInfo. * @appinfo2: the second #GAppInfo. - * + * * Checks if two #GAppInfos are equal. * * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise. @@ -309,6 +308,33 @@ g_app_info_set_as_default_for_type (GAppInfo *appinfo, return (* iface->set_as_default_for_type) (appinfo, content_type, error); } +/** + * g_app_info_set_as_last_used_for_type: + * @appinfo: a #GAppInfo. + * @content_type: the content type. + * @error: a #GError. + * + * Sets the application as the last used application for a given type. + * This will make the application appear as first in the list returned by + * #g_app_info_get_recommended_for_type, regardless of the default application + * for that content type. + * + * Returns: %TRUE on success, %FALSE on error. + **/ +gboolean +g_app_info_set_as_last_used_for_type (GAppInfo *appinfo, + const char *content_type, + GError **error) +{ + GAppInfoIface *iface; + + g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE); + g_return_val_if_fail (content_type != NULL, FALSE); + + iface = G_APP_INFO_GET_IFACE (appinfo); + + return (* iface->set_as_last_used_for_type) (appinfo, content_type, error); +} /** * g_app_info_set_as_default_for_extension: @@ -439,7 +465,7 @@ g_app_info_remove_supports_type (GAppInfo *appinfo, * * Gets the icon for the application. * - * Returns: the default #GIcon for @appinfo. + * Returns: (transfer none): the default #GIcon for @appinfo. **/ GIcon * g_app_info_get_icon (GAppInfo *appinfo) @@ -457,16 +483,16 @@ g_app_info_get_icon (GAppInfo *appinfo) /** * g_app_info_launch: * @appinfo: a #GAppInfo - * @files: a #GList of #GFile objects - * @launch_context: a #GAppLaunchContext or %NULL + * @files: (element-type GFile): a #GList of #GFile objects + * @launch_context: (allow-none): a #GAppLaunchContext or %NULL * @error: a #GError * - * Launches the application. Passes @files to the launched application + * Launches the application. Passes @files to the launched application * as arguments, using the optional @launch_context to get information * about the details of the launcher (like what screen it is on). * On error, @error will be set accordingly. * - * To lauch the application without arguments pass a %NULL @files list. + * To launch the application without arguments pass a %NULL @files list. * * Note that even if the launch is successful the application launched * can fail to start if it runs into problems during startup. There is @@ -476,8 +502,17 @@ g_app_info_get_icon (GAppInfo *appinfo) * unsupported uris with strange formats like mailto:), so if you have * a textual uri you want to pass in as argument, consider using * g_app_info_launch_uris() instead. - * - * Returns: %TRUE on successful launch, %FALSE otherwise. + * + * On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE + * environment variable with the path of the launched desktop file and + * GIO_LAUNCHED_DESKTOP_FILE_PID to the process + * id of the launched process. This can be used to ignore + * GIO_LAUNCHED_DESKTOP_FILE, should it be inherited + * by further processes. The DISPLAY and + * DESKTOP_STARTUP_ID environment variables are also + * set, based on information provided in @launch_context. + * + * Returns: %TRUE on successful launch, %FALSE otherwise. **/ gboolean g_app_info_launch (GAppInfo *appinfo, @@ -540,11 +575,11 @@ g_app_info_supports_files (GAppInfo *appinfo) /** * g_app_info_launch_uris: * @appinfo: a #GAppInfo - * @uris: a #GList containing URIs to launch. - * @launch_context: a #GAppLaunchContext or %NULL + * @uris: (element-type char*): a #GList containing URIs to launch. + * @launch_context: (allow-none): a #GAppLaunchContext or %NULL * @error: a #GError * - * Launches the application. Passes @uris to the launched application + * Launches the application. Passes @uris to the launched application * as arguments, using the optional @launch_context to get information * about the details of the launcher (like what screen it is on). * On error, @error will be set accordingly. @@ -555,7 +590,7 @@ g_app_info_supports_files (GAppInfo *appinfo) * can fail to start if it runs into problems during startup. There is * no way to detect this. * - * Returns: %TRUE on successful launch, %FALSE otherwise. + * Returns: %TRUE on successful launch, %FALSE otherwise. **/ gboolean g_app_info_launch_uris (GAppInfo *appinfo, @@ -600,7 +635,7 @@ g_app_info_should_show (GAppInfo *appinfo) * @launch_context: an optional #GAppLaunchContext. * @error: a #GError. * - * Utility function that launches the default application + * Utility function that launches the default application * registered to handle the specified uri. Synchronous I/O * is done on the uri to detect the type of the file if * required. @@ -673,7 +708,8 @@ g_app_info_can_delete (GAppInfo *appinfo) * On some platforms, there may be a difference between user-defined * #GAppInfos which can be deleted, and system-wide ones which * cannot. See g_app_info_can_delete(). - * + * + * Virtual: do_delete * Returns: %TRUE if @appinfo has been deleted * * Since: 2.20 @@ -724,12 +760,12 @@ g_app_launch_context_init (GAppLaunchContext *launch_context) * g_app_launch_context_get_display: * @context: a #GAppLaunchContext * @info: a #GAppInfo - * @files: a #GList of #GFile objects + * @files: (element-type GFile): a #GList of #GFile objects + * + * Gets the display string for the @context. This is used to ensure new + * applications are started on the same display as the launching + * application, by setting the DISPLAY environment variable. * - * Gets the display string for the display. This is used to ensure new - * applications are started on the same display as the launching - * application. - * * Returns: a display string for the display. **/ char * @@ -754,16 +790,17 @@ g_app_launch_context_get_display (GAppLaunchContext *context, * g_app_launch_context_get_startup_notify_id: * @context: a #GAppLaunchContext * @info: a #GAppInfo - * @files: a #GList of of #GFile objects + * @files: (element-type GFile): a #GList of of #GFile objects * * Initiates startup notification for the application and returns the - * DESKTOP_STARTUP_ID for the launched operation, if supported. + * DESKTOP_STARTUP_ID for the launched operation, + * if supported. * * Startup notification IDs are defined in the * FreeDesktop.Org Startup Notifications standard. * - * Returns: a startup notification ID for the application, or %NULL if + * Returns: a startup notification ID for the application, or %NULL if * not supported. **/ char * @@ -808,7 +845,3 @@ g_app_launch_context_launch_failed (GAppLaunchContext *context, if (class->launch_failed != NULL) class->launch_failed (context, startup_notify_id); } - - -#define __G_APP_INFO_C__ -#include "gioaliasdef.c" diff --git a/gio/gappinfo.h b/gio/gappinfo.h index 3746776..11a4dad 100644 --- a/gio/gappinfo.h +++ b/gio/gappinfo.h @@ -128,6 +128,9 @@ struct _GAppInfoIface gboolean (* do_delete) (GAppInfo *appinfo); const char * (* get_commandline) (GAppInfo *appinfo); const char * (* get_display_name) (GAppInfo *appinfo); + gboolean (* set_as_last_used_for_type) (GAppInfo *appinfo, + const char *content_type, + GError **error); }; GType g_app_info_get_type (void) G_GNUC_CONST; @@ -173,8 +176,15 @@ gboolean g_app_info_remove_supports_type (GAppInfo *appin gboolean g_app_info_can_delete (GAppInfo *appinfo); gboolean g_app_info_delete (GAppInfo *appinfo); +gboolean g_app_info_set_as_last_used_for_type (GAppInfo *appinfo, + const char *content_type, + GError **error); + GList * g_app_info_get_all (void); GList * g_app_info_get_all_for_type (const char *content_type); +GList * g_app_info_get_recommended_for_type (const gchar *content_type); +GList * g_app_info_get_fallback_for_type (const gchar *content_type); + void g_app_info_reset_type_associations (const char *content_type); GAppInfo *g_app_info_get_default_for_type (const char *content_type, gboolean must_support_uris); @@ -186,7 +196,6 @@ gboolean g_app_info_launch_default_for_uri (const char *uri, /** * GAppLaunchContext: - * @parent_instance: The parent instance. * * Integrating the launch with the launching application. This is used to * handle for instance startup notification and launching the new application diff --git a/gio/gapplication.c b/gio/gapplication.c new file mode 100644 index 0000000..6ad23d0 --- /dev/null +++ b/gio/gapplication.c @@ -0,0 +1,1431 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +/* Prologue {{{1 */ +#include "config.h" + +#include "gapplication.h" + +#include "gapplicationcommandline.h" +#include "gapplicationimpl.h" +#include "gactiongroup.h" + +#include "gioenumtypes.h" +#include "gio-marshal.h" +#include "gioenums.h" +#include "gfile.h" + +#include "glibintl.h" + +#include + +/** + * SECTION: gapplication + * @title: GApplication + * @short_description: Core application class + * + * A #GApplication is the foundation of an application, unique for a + * given application identifier. The GApplication class wraps some + * low-level platform-specific services and is intended to act as the + * foundation for higher-level application classes such as + * #GtkApplication or #MxApplication. In general, you should not use + * this class outside of a higher level framework. + * + * One of the core features that GApplication provides is process + * uniqueness, in the context of a "session". The session concept is + * platform-dependent, but corresponds roughly to a graphical desktop + * login. When your application is launched again, its arguments + * are passed through platform communication to the already running + * program. The already running instance of the program is called the + * primary instance. + * + * Before using GApplication, you must choose an "application identifier". + * The expected form of an application identifier is very close to that of + * of a DBus bus name. + * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator". + * For details on valid application identifiers, see + * g_application_id_is_valid(). + * + * GApplication provides convenient life cycle management by maintaining + * a use count for the primary application instance. + * The use count can be changed using g_application_hold() and + * g_application_release(). If it drops to zero, the application exits. + * + * GApplication also implements the #GActionGroup interface and lets you + * easily export actions by adding them with g_application_set_action_group(). + * When invoking an action by calling g_action_group_activate_action() on + * the application, it is always invoked in the primary instance. + * + * There is a number of different entry points into a #GApplication: + * + * via 'Activate' (i.e. just starting the application) + * via 'Open' (i.e. opening some files) + * via activating an action + * + * The #GApplication::startup signal lets you handle the application + * initialization for all of these in a single place. + * + * Opening files with a GApplication + * + * + * FIXME: MISSING XINCLUDE CONTENT + * + * + * + * + * A GApplication with actions + * + * + * FIXME: MISSING XINCLUDE CONTENT + * + * + * + */ + +struct _GApplicationPrivate +{ + GApplicationFlags flags; + gchar *id; + + GActionGroup *actions; + GMainLoop *mainloop; + + guint inactivity_timeout_id; + guint inactivity_timeout; + guint use_count; + + guint is_registered : 1; + guint is_remote : 1; + + GHashTable *remote_actions; /* string -> RemoteActionInfo */ + GApplicationImpl *impl; +}; + +enum +{ + PROP_NONE, + PROP_APPLICATION_ID, + PROP_FLAGS, + PROP_IS_REGISTERED, + PROP_IS_REMOTE, + PROP_INACTIVITY_TIMEOUT, + PROP_ACTION_GROUP +}; + +enum +{ + SIGNAL_STARTUP, + SIGNAL_ACTIVATE, + SIGNAL_OPEN, + SIGNAL_ACTION, + SIGNAL_COMMAND_LINE, + NR_SIGNALS +}; + +static guint g_application_signals[NR_SIGNALS]; + +static void g_application_action_group_iface_init (GActionGroupInterface *); +G_DEFINE_TYPE_WITH_CODE (GApplication, g_application, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, + g_application_action_group_iface_init)) + +/* vfunc defaults {{{1 */ +static void +g_application_real_before_emit (GApplication *application, + GVariant *platform_data) +{ +} + +static void +g_application_real_after_emit (GApplication *application, + GVariant *platform_data) +{ +} + +static void +g_application_real_startup (GApplication *application) +{ +} + +static void +g_application_real_activate (GApplication *application) +{ + if (!g_signal_has_handler_pending (application, + g_application_signals[SIGNAL_ACTIVATE], + 0, TRUE)) + { + static gboolean warned; + + if (warned) + return; + + g_warning ("Your application does not implement " + "g_application_activate() and has no handlers connected " + "to the 'activate' signal. It should do one of these."); + warned = TRUE; + } +} + +static void +g_application_real_open (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint) +{ + if (!g_signal_has_handler_pending (application, + g_application_signals[SIGNAL_OPEN], + 0, TRUE)) + { + static gboolean warned; + + if (warned) + return; + + g_warning ("Your application claims to support opening files " + "but does not implement g_application_open() and has no " + "handlers connected to the 'open' signal."); + warned = TRUE; + } +} + +static int +g_application_real_command_line (GApplication *application, + GApplicationCommandLine *cmdline) +{ + static gboolean warned; + + if (warned) + return 1; + + g_warning ("Your application claims to support custom command line " + "handling but does not implement g_application_command_line() " + "and has no handlers connected to the 'command-line' signal."); + + warned = TRUE; + + return 1; +} + +static gboolean +g_application_real_local_command_line (GApplication *application, + gchar ***arguments, + int *exit_status) +{ + if (application->priv->flags & G_APPLICATION_HANDLES_COMMAND_LINE) + return FALSE; + + else + { + GError *error = NULL; + gint n_args; + + if (!g_application_register (application, NULL, &error)) + { + g_critical ("%s", error->message); + g_error_free (error); + *exit_status = 1; + return TRUE; + } + + n_args = g_strv_length (*arguments); + + if (application->priv->flags & G_APPLICATION_IS_SERVICE) + { + if ((*exit_status = n_args > 1)) + { + g_printerr ("GApplication service mode takes no arguments.\n"); + application->priv->flags &= ~G_APPLICATION_IS_SERVICE; + } + + return TRUE; + } + + if (n_args <= 1) + { + g_application_activate (application); + *exit_status = 0; + } + + else + { + if (~application->priv->flags & G_APPLICATION_HANDLES_OPEN) + { + g_critical ("This application can not open files."); + *exit_status = 1; + } + else + { + GFile **files; + gint n_files; + gint i; + + n_files = n_args - 1; + files = g_new (GFile *, n_files); + + for (i = 0; i < n_files; i++) + files[i] = g_file_new_for_commandline_arg ((*arguments)[i + 1]); + + g_application_open (application, files, n_files, ""); + + for (i = 0; i < n_files; i++) + g_object_unref (files[i]); + g_free (files); + + *exit_status = 0; + } + } + + return TRUE; + } +} + +static void +g_application_real_add_platform_data (GApplication *application, + GVariantBuilder *builder) +{ +} + +static void +g_application_real_quit_mainloop (GApplication *application) +{ + if (application->priv->mainloop != NULL) + g_main_loop_quit (application->priv->mainloop); +} + +static void +g_application_real_run_mainloop (GApplication *application) +{ + if (application->priv->mainloop == NULL) + application->priv->mainloop = g_main_loop_new (NULL, FALSE); + + g_main_loop_run (application->priv->mainloop); +} + +/* GObject implementation stuff {{{1 */ +static void +g_application_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GApplication *application = G_APPLICATION (object); + + switch (prop_id) + { + case PROP_APPLICATION_ID: + g_application_set_application_id (application, + g_value_get_string (value)); + break; + + case PROP_FLAGS: + g_application_set_flags (application, g_value_get_flags (value)); + break; + + case PROP_INACTIVITY_TIMEOUT: + g_application_set_inactivity_timeout (application, + g_value_get_uint (value)); + break; + + case PROP_ACTION_GROUP: + g_application_set_action_group (application, + g_value_get_object (value)); + break; + + default: + g_assert_not_reached (); + } +} + +/** + * g_application_set_action_group: + * @application: a #GApplication + * @action_group: (allow-none): a #GActionGroup, or %NULL + * + * Sets or unsets the group of actions associated with the application. + * + * These actions are the actions that can be remotely invoked. + * + * It is an error to call this function after the application has been + * registered. + * + * Since: 2.28 + **/ +void +g_application_set_action_group (GApplication *application, + GActionGroup *action_group) +{ + g_return_if_fail (G_IS_APPLICATION (application)); + g_return_if_fail (!application->priv->is_registered); + + if (application->priv->actions != NULL) + g_object_unref (application->priv->actions); + + application->priv->actions = action_group; + + if (application->priv->actions != NULL) + g_object_ref (application->priv->actions); +} + +static void +g_application_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GApplication *application = G_APPLICATION (object); + + switch (prop_id) + { + case PROP_APPLICATION_ID: + g_value_set_string (value, + g_application_get_application_id (application)); + break; + + case PROP_FLAGS: + g_value_set_flags (value, + g_application_get_flags (application)); + break; + + case PROP_IS_REGISTERED: + g_value_set_boolean (value, + g_application_get_is_registered (application)); + break; + + case PROP_IS_REMOTE: + g_value_set_boolean (value, + g_application_get_is_remote (application)); + break; + + case PROP_INACTIVITY_TIMEOUT: + g_value_set_uint (value, + g_application_get_inactivity_timeout (application)); + break; + + default: + g_assert_not_reached (); + } +} + +static void +g_application_constructed (GObject *object) +{ + GApplication *application = G_APPLICATION (object); + + g_assert (application->priv->id != NULL); +} + +static void +g_application_finalize (GObject *object) +{ + GApplication *application = G_APPLICATION (object); + + if (application->priv->impl) + g_application_impl_destroy (application->priv->impl); + g_free (application->priv->id); + + if (application->priv->mainloop) + g_main_loop_unref (application->priv->mainloop); + + G_OBJECT_CLASS (g_application_parent_class) + ->finalize (object); +} + +static void +g_application_init (GApplication *application) +{ + application->priv = G_TYPE_INSTANCE_GET_PRIVATE (application, + G_TYPE_APPLICATION, + GApplicationPrivate); +} + +static void +g_application_class_init (GApplicationClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->constructed = g_application_constructed; + object_class->finalize = g_application_finalize; + object_class->get_property = g_application_get_property; + object_class->set_property = g_application_set_property; + + class->before_emit = g_application_real_before_emit; + class->after_emit = g_application_real_after_emit; + class->startup = g_application_real_startup; + class->activate = g_application_real_activate; + class->open = g_application_real_open; + class->command_line = g_application_real_command_line; + class->local_command_line = g_application_real_local_command_line; + class->add_platform_data = g_application_real_add_platform_data; + class->quit_mainloop = g_application_real_quit_mainloop; + class->run_mainloop = g_application_real_run_mainloop; + + g_object_class_install_property (object_class, PROP_APPLICATION_ID, + g_param_spec_string ("application-id", + P_("Application identifier"), + P_("The unique identifier for the application"), + NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_FLAGS, + g_param_spec_flags ("flags", + P_("Application flags"), + P_("Flags specifying the behaviour of the application"), + G_TYPE_APPLICATION_FLAGS, G_APPLICATION_FLAGS_NONE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_IS_REGISTERED, + g_param_spec_boolean ("is-registered", + P_("Is registered"), + P_("If g_application_register() has been called"), + FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_IS_REMOTE, + g_param_spec_boolean ("is-remote", + P_("Is remote"), + P_("If this application instance is remote"), + FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_INACTIVITY_TIMEOUT, + g_param_spec_uint ("inactivity-timeout", + P_("Inactivity timeout"), + P_("Iime (ms) to stay alive after becoming idle"), + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_ACTION_GROUP, + g_param_spec_object ("action-group", + P_("Action group"), + P_("The group of actions that the application exports"), + G_TYPE_ACTION_GROUP, + G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GApplication::startup: + * @application: the application + * + * The ::startup signal is emitted on the primary instance immediately + * after registration. See g_activation_register(). + */ + g_application_signals[SIGNAL_STARTUP] = + g_signal_new ("startup", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GApplicationClass, startup), + NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + /** + * GApplication::activate: + * @application: the application + * + * The ::activate signal is emitted on the primary instance when an + * activation occurs. See g_application_activate(). + */ + g_application_signals[SIGNAL_ACTIVATE] = + g_signal_new ("activate", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GApplicationClass, activate), + NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + + /** + * GApplication::open: + * @application: the application + * @files: (array length=n_files) (element-type GFile): an array of #GFiles + * @n_files: the length of @files + * @hint: a hint provided by the calling instance + * + * The ::open signal is emitted on the primary instance when there are + * files to open. See g_application_open() for more information. + */ + g_application_signals[SIGNAL_OPEN] = + g_signal_new ("open", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GApplicationClass, open), + NULL, NULL, _gio_marshal_VOID__POINTER_INT_STRING, + G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_STRING); + + /** + * GApplication::command-line: + * @application: the application + * @command_line: a #GApplicationCommandLine representing the + * passed commandline + * + * The ::command-line signal is emitted on the primary instance when + * a commandline is not handled locally. See g_application_run() for + * more information. + */ + g_application_signals[SIGNAL_COMMAND_LINE] = + g_signal_new ("command-line", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GApplicationClass, command_line), + g_signal_accumulator_first_wins, NULL, + _gio_marshal_INT__OBJECT, + G_TYPE_INT, 1, G_TYPE_APPLICATION_COMMAND_LINE); + + g_type_class_add_private (class, sizeof (GApplicationPrivate)); +} + +static GVariant * +get_platform_data (GApplication *application) +{ + GVariantBuilder *builder; + GVariant *result; + + builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}")); + + { + gchar *cwd = g_get_current_dir (); + g_variant_builder_add (builder, "{sv}", "cwd", + g_variant_new_bytestring (cwd)); + g_free (cwd); + } + + if (application->priv->flags & G_APPLICATION_SEND_ENVIRONMENT) + { + GVariant *array; + gchar **envp; + + envp = g_get_environ (); + array = g_variant_new_bytestring_array ((const gchar **) envp, -1); + g_strfreev (envp); + + g_variant_builder_add (builder, "{sv}", "environ", array); + } + + G_APPLICATION_GET_CLASS (application)-> + add_platform_data (application, builder); + + result = g_variant_builder_end (builder); + g_variant_builder_unref (builder); + + return result; +} + +/* Application ID validity {{{1 */ + +/** + * g_application_id_is_valid: + * @application_id: a potential application identifier + * @returns: %TRUE if @application_id is valid + * + * Checks if @application_id is a valid application identifier. + * + * A valid ID is required for calls to g_application_new() and + * g_application_set_application_id(). + * + * For convenience, the restrictions on application identifiers are + * reproduced here: + * + * Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-" and must not begin with a digit. + * Application identifiers must contain at least one '.' (period) character (and thus at least two elements). + * Application identifiers must not begin with a '.' (period) character. + * Application identifiers must not contain consecutive '.' (period) characters. + * Application identifiers must not exceed 255 characters. + * + **/ +gboolean +g_application_id_is_valid (const gchar *application_id) +{ + gboolean allow_dot; + + if (strlen (application_id) > 255) + return FALSE; + + if (!g_ascii_isalpha (*application_id)) + return FALSE; + + application_id++; + allow_dot = FALSE; + for (; *application_id; application_id++) + { + if (g_ascii_isalnum (*application_id) || + (*application_id == '-') || + (*application_id == '_')) + allow_dot = TRUE; + else if (allow_dot && *application_id == '.') + allow_dot = FALSE; + else + return FALSE; + } + + return TRUE; +} + +/* Public Constructor {{{1 */ +/** + * g_application_new: + * @application_id: the application id + * @flags: the application flags + * @returns: a new #GApplication instance + * + * Creates a new #GApplication instance. + * + * This function calls g_type_init() for you. + * + * The application id must be valid. See g_application_id_is_valid(). + **/ +GApplication * +g_application_new (const gchar *application_id, + GApplicationFlags flags) +{ + g_return_val_if_fail (g_application_id_is_valid (application_id), NULL); + + g_type_init (); + + return g_object_new (G_TYPE_APPLICATION, + "application-id", application_id, + "flags", flags, + NULL); +} + +/* Simple get/set: application id, flags, inactivity timeout {{{1 */ +/** + * g_application_get_application_id: + * @application: a #GApplication + * @returns: the identifier for @application, owned by @application + * + * Gets the unique identifier for @application. + * + * Since: 2.28 + **/ +const gchar * +g_application_get_application_id (GApplication *application) +{ + g_return_val_if_fail (G_IS_APPLICATION (application), NULL); + + return application->priv->id; +} + +/** + * g_application_set_application_id: + * @application: a #GApplication + * @application_id: the identifier for @application + * + * Sets the unique identifier for @application. + * + * The application id can only be modified if @application has not yet + * been registered. + * + * The application id must be valid. See g_application_id_is_valid(). + * + * Since: 2.28 + **/ +void +g_application_set_application_id (GApplication *application, + const gchar *application_id) +{ + g_return_if_fail (G_IS_APPLICATION (application)); + + if (g_strcmp0 (application->priv->id, application_id) != 0) + { + g_return_if_fail (g_application_id_is_valid (application_id)); + g_return_if_fail (!application->priv->is_registered); + + g_free (application->priv->id); + application->priv->id = g_strdup (application_id); + + g_object_notify (G_OBJECT (application), "application-id"); + } +} + +/** + * g_application_get_flags: + * @application: a #GApplication + * @returns: the flags for @application + * + * Gets the flags for @application. + * + * See #GApplicationFlags. + * + * Since: 2.28 + **/ +GApplicationFlags +g_application_get_flags (GApplication *application) +{ + g_return_val_if_fail (G_IS_APPLICATION (application), 0); + + return application->priv->flags; +} + +/** + * g_application_set_flags: + * @application: a #GApplication + * @flags: the flags for @application + * + * Sets the flags for @application. + * + * The flags can only be modified if @application has not yet been + * registered. + * + * See #GApplicationFlags. + * + * Since: 2.28 + **/ +void +g_application_set_flags (GApplication *application, + GApplicationFlags flags) +{ + g_return_if_fail (G_IS_APPLICATION (application)); + + if (application->priv->flags != flags) + { + g_return_if_fail (!application->priv->is_registered); + + application->priv->flags = flags; + + g_object_notify (G_OBJECT (application), "flags"); + } +} + +/** + * g_application_get_inactivity_timeout: + * @application: a #GApplication + * + * Gets the current inactivity timeout for the application. + * + * This is the amount of time (in milliseconds) after the last call to + * g_application_release() before the application stops running. + * + * Returns: the timeout, in milliseconds + * + * Since: 2.28 + **/ +guint +g_application_get_inactivity_timeout (GApplication *application) +{ + g_return_val_if_fail (G_IS_APPLICATION (application), 0); + + return application->priv->inactivity_timeout; +} + +/** + * g_application_set_inactivity_timeout: + * @application: a #GApplication + * @inactivity_timeout: the timeout, in milliseconds + * + * Sets the current inactivity timeout for the application. + * + * This is the amount of time (in milliseconds) after the last call to + * g_application_release() before the application stops running. + * + * This call has no side effects of its own. The value set here is only + * used for next time g_application_release() drops the use count to + * zero. Any timeouts currently in progress are not impacted. + * + * Returns: the timeout, in milliseconds + * + * Since: 2.28 + **/ +void +g_application_set_inactivity_timeout (GApplication *application, + guint inactivity_timeout) +{ + g_return_if_fail (G_IS_APPLICATION (application)); + + if (application->priv->inactivity_timeout != inactivity_timeout) + { + application->priv->inactivity_timeout = inactivity_timeout; + + g_object_notify (G_OBJECT (application), "inactivity-timeout"); + } +} +/* Read-only property getters (is registered, is remote) {{{1 */ +/** + * g_application_get_is_registered: + * @application: a #GApplication + * @returns: %TRUE if @application is registered + * + * Checks if @application is registered. + * + * An application is registered if g_application_register() has been + * successfully called. + * + * Since: 2.28 + **/ +gboolean +g_application_get_is_registered (GApplication *application) +{ + g_return_val_if_fail (G_IS_APPLICATION (application), FALSE); + + return application->priv->is_registered; +} + +/** + * g_application_get_is_remote: + * @application: a #GApplication + * @returns: %TRUE if @application is remote + * + * Checks if @application is remote. + * + * If @application is remote then it means that another instance of + * application already exists (the 'primary' instance). Calls to + * perform actions on @application will result in the actions being + * performed by the primary instance. + * + * The value of this property can not be accessed before + * g_application_register() has been called. See + * g_application_get_is_registered(). + * + * Since: 2.28 + **/ +gboolean +g_application_get_is_remote (GApplication *application) +{ + g_return_val_if_fail (G_IS_APPLICATION (application), FALSE); + g_return_val_if_fail (application->priv->is_registered, FALSE); + + return application->priv->is_remote; +} + +/* Register {{{1 */ +/** + * g_application_register: + * @application: a #GApplication + * @cancellable: a #GCancellable, or %NULL + * @error: a pointer to a NULL #GError, or %NULL + * @returns: %TRUE if registration succeeded + * + * Attempts registration of the application. + * + * This is the point at which the application discovers if it is the + * primary instance or merely acting as a remote for an already-existing + * primary instance. + * + * If the application has already been registered then %TRUE is + * returned with no work performed. + * + * The #GApplication::startup signal is emitted if registration succeeds + * and @application is the primary instance. + * + * In the event of an error (such as @cancellable being cancelled, or a + * failure to connect to the session bus), %FALSE is returned and @error + * is set appropriately. + * + * Note: the return value of this function is not an indicator that this + * instance is or is not the primary instance of the application. See + * g_application_get_is_remote() for that. + * + * Since: 2.28 + **/ +gboolean +g_application_register (GApplication *application, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (G_IS_APPLICATION (application), FALSE); + + if (!application->priv->is_registered) + { + application->priv->impl = + g_application_impl_register (application, application->priv->id, + application->priv->flags, + &application->priv->remote_actions, + cancellable, error); + + if (application->priv->impl == NULL) + return FALSE; + + application->priv->is_remote = application->priv->remote_actions != NULL; + application->priv->is_registered = TRUE; + + g_object_notify (G_OBJECT (application), "is-registered"); + + if (!application->priv->is_remote) + g_signal_emit (application, g_application_signals[SIGNAL_STARTUP], 0); + } + + return TRUE; +} + +/* Hold/release {{{1 */ +/** + * g_application_hold: + * @application: a #GApplication + * + * Increases the use count of @application. + * + * Use this function to indicate that the application has a reason to + * continue to run. For example, g_application_hold() is called by GTK+ + * when a toplevel window is on the screen. + * + * To cancel the hold, call g_application_release(). + **/ +void +g_application_hold (GApplication *application) +{ + if (application->priv->inactivity_timeout_id) + { + g_source_remove (application->priv->inactivity_timeout_id); + application->priv->inactivity_timeout_id = 0; + } + + application->priv->use_count++; +} + +static gboolean +inactivity_timeout_expired (gpointer data) +{ + GApplication *application = G_APPLICATION (data); + + G_APPLICATION_GET_CLASS (application) + ->quit_mainloop (application); + + return FALSE; +} + + +/** + * g_application_release: + * @application: a #GApplication + * + * Decrease the use count of @application. + * + * When the use count reaches zero, the application will stop running. + * + * Never call this function except to cancel the effect of a previous + * call to g_application_hold(). + **/ +void +g_application_release (GApplication *application) +{ + application->priv->use_count--; + + if (application->priv->use_count == 0) + { + if (application->priv->inactivity_timeout) + application->priv->inactivity_timeout_id = + g_timeout_add (application->priv->inactivity_timeout, + inactivity_timeout_expired, application); + + else + G_APPLICATION_GET_CLASS (application) + ->quit_mainloop (application); + } +} + +/* Activate, Open {{{1 */ +/** + * g_application_activate: + * @application: a #GApplication + * + * Activates the application. + * + * In essence, this results in the #GApplication::activate() signal being + * emitted in the primary instance. + * + * The application must be registered before calling this function. + * + * Since: 2.28 + **/ +void +g_application_activate (GApplication *application) +{ + g_return_if_fail (G_IS_APPLICATION (application)); + g_return_if_fail (application->priv->is_registered); + + if (application->priv->is_remote) + g_application_impl_activate (application->priv->impl, + get_platform_data (application)); + + else + g_signal_emit (application, g_application_signals[SIGNAL_ACTIVATE], 0); +} + +/** + * g_application_open: + * @application: a #GApplication + * @files: (array length=n_files): an array of #GFiles to open + * @n_files: the length of the @files array + * @hint: a hint (or ""), but never %NULL + * + * Opens the given files. + * + * In essence, this results in the #GApplication::open signal being emitted + * in the primary instance. + * + * @n_files must be greater than zero. + * + * @hint is simply passed through to the ::open signal. It is + * intended to be used by applications that have multiple modes for + * opening files (eg: "view" vs "edit", etc). Unless you have a need + * for this functionality, you should use "". + * + * The application must be registered before calling this function + * and it must have the %G_APPLICATION_HANDLES_OPEN flag set. + * + * Since: 2.28 + **/ +void +g_application_open (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint) +{ + g_return_if_fail (G_IS_APPLICATION (application)); + g_return_if_fail (application->priv->flags & + G_APPLICATION_HANDLES_OPEN); + g_return_if_fail (application->priv->is_registered); + + if (application->priv->is_remote) + g_application_impl_open (application->priv->impl, + files, n_files, hint, + get_platform_data (application)); + + else + g_signal_emit (application, g_application_signals[SIGNAL_OPEN], + 0, files, n_files, hint); +} + +/* Run {{{1 */ +/** + * g_application_run: + * @application: a #GApplication + * @argc: the argc from main() + * @argv: (array length=argc): the argv from main() + * @returns: the exit status + * + * Runs the application. + * + * This function is intended to be run from main() and its return value + * is intended to be returned by main(). + * + * First, the local_command_line() virtual function is invoked. This + * function always runs on the local instance. If that function returns + * %FALSE then the application is registered and the #GApplication::command-line + * signal is emitted in the primary instance (which may or may not be + * this instance). + * + * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE + * flag set then the default implementation of local_command_line() + * always returns %FALSE immediately, resulting in the commandline + * always being handled in the primary instance. + * + * Otherwise, the default implementation of local_command_line() tries + * to do a couple of things that are probably reasonable for most + * applications. First, g_application_register() is called to attempt + * to register the application. If that works, then the command line + * arguments are inspected. If no commandline arguments are given, then + * g_application_activate() is called. If commandline arguments are + * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they + * are assumed to be filenames and g_application_open() is called. + * + * If you are interested in doing more complicated local handling of the + * commandline then you should implement your own #GApplication subclass + * and override local_command_line(). See + * for an example. + * + * If, after the above is done, the use count of the application is zero + * then the exit status is returned immediately. If the use count is + * non-zero then the mainloop is run until the use count falls to zero, + * at which point 0 is returned. + * + * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at + * use count of zero is delayed for a while (ie: the instance stays + * around to provide its service to others). + * + * Since: 2.28 + **/ +int +g_application_run (GApplication *application, + int argc, + char **argv) +{ + gchar **arguments; + int status; + gint i; + + g_return_val_if_fail (G_IS_APPLICATION (application), 1); + g_return_val_if_fail (argc == 0 || argv != NULL, 1); + + arguments = g_new (gchar *, argc + 1); + for (i = 0; i < argc; i++) + arguments[i] = g_strdup (argv[i]); + arguments[i] = NULL; + + if (g_get_prgname () == NULL && argc > 0) + { + gchar *prgname; + + prgname = g_path_get_basename (argv[0]); + g_set_prgname (prgname); + g_free (prgname); + } + + if (!G_APPLICATION_GET_CLASS (application) + ->local_command_line (application, &arguments, &status)) + { + GError *error = NULL; + + if (!g_application_register (application, NULL, &error)) + { + g_printerr ("%s", error->message); + g_error_free (error); + return 1; + } + + if (application->priv->is_remote) + { + GVariant *platform_data; + + platform_data = get_platform_data (application); + status = g_application_impl_command_line (application->priv->impl, + arguments, platform_data); + } + else + { + GApplicationCommandLine *cmdline; + GVariant *v; + + v = g_variant_new_bytestring_array ((const gchar **) arguments, -1); + cmdline = g_object_new (G_TYPE_APPLICATION_COMMAND_LINE, + "arguments", v, NULL); + g_signal_emit (application, + g_application_signals[SIGNAL_COMMAND_LINE], + 0, cmdline, &status); + g_object_unref (cmdline); + } + } + + g_strfreev (arguments); + + if (application->priv->flags & G_APPLICATION_IS_SERVICE && + application->priv->is_registered && + !application->priv->use_count && + !application->priv->inactivity_timeout_id) + { + application->priv->inactivity_timeout_id = + g_timeout_add (10000, inactivity_timeout_expired, application); + } + + if (application->priv->use_count || + application->priv->inactivity_timeout_id) + { + G_APPLICATION_GET_CLASS (application) + ->run_mainloop (application); + status = 0; + } + + if (application->priv->impl) + g_application_impl_flush (application->priv->impl); + + return status; +} + +static gboolean +g_application_has_action (GActionGroup *action_group, + const gchar *action_name) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_val_if_fail (application->priv->is_registered, FALSE); + + if (application->priv->remote_actions != NULL) + return g_hash_table_lookup (application->priv->remote_actions, + action_name) != NULL; + + return application->priv->actions && + g_action_group_has_action (application->priv->actions, action_name); +} + +static gchar ** +g_application_list_actions (GActionGroup *action_group) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_val_if_fail (application->priv->is_registered, NULL); + + if (application->priv->remote_actions != NULL) + { + GHashTableIter iter; + gint n, i = 0; + gchar **keys; + gpointer key; + + n = g_hash_table_size (application->priv->remote_actions); + keys = g_new (gchar *, n + 1); + + g_hash_table_iter_init (&iter, application->priv->remote_actions); + while (g_hash_table_iter_next (&iter, &key, NULL)) + keys[i++] = g_strdup (key); + g_assert_cmpint (i, ==, n); + keys[n] = NULL; + + return keys; + } + + else if (application->priv->actions != NULL) + return g_action_group_list_actions (application->priv->actions); + + else + /* empty string array */ + return g_new0 (gchar *, 1); +} + +static gboolean +g_application_get_action_enabled (GActionGroup *action_group, + const gchar *action_name) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_val_if_fail (application->priv->actions != NULL, FALSE); + g_return_val_if_fail (application->priv->is_registered, FALSE); + + if (application->priv->remote_actions) + { + RemoteActionInfo *info; + + info = g_hash_table_lookup (application->priv->remote_actions, + action_name); + + return info && info->enabled; + } + + return g_action_group_get_action_enabled (application->priv->actions, + action_name); +} + +static const GVariantType * +g_application_get_action_parameter_type (GActionGroup *action_group, + const gchar *action_name) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_val_if_fail (application->priv->actions != NULL, NULL); + g_return_val_if_fail (application->priv->is_registered, NULL); + + if (application->priv->remote_actions) + { + RemoteActionInfo *info; + + info = g_hash_table_lookup (application->priv->remote_actions, + action_name); + + if (info) + return info->parameter_type; + else + return NULL; + } + + return g_action_group_get_action_parameter_type (application->priv->actions, + action_name); +} + +static const GVariantType * +g_application_get_action_state_type (GActionGroup *action_group, + const gchar *action_name) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_val_if_fail (application->priv->actions != NULL, NULL); + g_return_val_if_fail (application->priv->is_registered, NULL); + + if (application->priv->remote_actions) + { + RemoteActionInfo *info; + + info = g_hash_table_lookup (application->priv->remote_actions, + action_name); + + if (info && info->state) + return g_variant_get_type (info->state); + else + return NULL; + } + + return g_action_group_get_action_state_type (application->priv->actions, + action_name); +} + +static GVariant * +g_application_get_action_state (GActionGroup *action_group, + const gchar *action_name) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_val_if_fail (application->priv->actions != NULL, NULL); + g_return_val_if_fail (application->priv->is_registered, NULL); + + if (application->priv->remote_actions) + { + RemoteActionInfo *info; + + info = g_hash_table_lookup (application->priv->remote_actions, + action_name); + + if (info && info->state) + return g_variant_ref (info->state); + else + return NULL; + } + + return g_action_group_get_action_state (application->priv->actions, + action_name); +} + +static void +g_application_change_action_state (GActionGroup *action_group, + const gchar *action_name, + GVariant *value) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_if_fail (application->priv->is_registered); + + if (application->priv->is_remote) + g_application_impl_change_action_state (application->priv->impl, + action_name, value, + get_platform_data (application)); + + else + g_action_group_change_action_state (application->priv->actions, + action_name, value); +} + +static void +g_application_activate_action (GActionGroup *action_group, + const gchar *action_name, + GVariant *parameter) +{ + GApplication *application = G_APPLICATION (action_group); + + g_return_if_fail (application->priv->is_registered); + + if (application->priv->is_remote) + g_application_impl_activate_action (application->priv->impl, + action_name, parameter, + get_platform_data (application)); + + else + g_action_group_activate_action (application->priv->actions, + action_name, parameter); +} + +static void +g_application_action_group_iface_init (GActionGroupInterface *iface) +{ + iface->has_action = g_application_has_action; + iface->list_actions = g_application_list_actions; + + iface->get_action_enabled = g_application_get_action_enabled; + iface->get_action_parameter_type = g_application_get_action_parameter_type; + iface->get_action_state_type = g_application_get_action_state_type; + iface->get_action_state = g_application_get_action_state; + iface->change_action_state = g_application_change_action_state; + iface->activate_action = g_application_activate_action; +} + +/* Epilogue {{{1 */ +/* vim:set foldmethod=marker: */ diff --git a/gio/gapplication.h b/gio/gapplication.h new file mode 100644 index 0000000..da9a265 --- /dev/null +++ b/gio/gapplication.h @@ -0,0 +1,165 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_APPLICATION_H__ +#define __G_APPLICATION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_APPLICATION (g_application_get_type ()) +#define G_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_APPLICATION, GApplication)) +#define G_APPLICATION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_APPLICATION, GApplicationClass)) +#define G_IS_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_APPLICATION)) +#define G_IS_APPLICATION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_APPLICATION)) +#define G_APPLICATION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_APPLICATION, GApplicationClass)) + +typedef struct _GApplicationPrivate GApplicationPrivate; +typedef struct _GApplicationClass GApplicationClass; + +/** + * GApplication: + * + * The GApplication structure contains private + * data and should only be accessed using the provided API + * + * Since: 2.26 + */ +struct _GApplication +{ + /*< private >*/ + GObject parent_instance; + + GApplicationPrivate *priv; +}; + +/** + * GApplicationClass: + * @startup: invoked on the primary instance immediately after registration + * @activate: invoked on the primary instance when an activation occurs + * @open: invoked on the primary instance when there are files to open + * @command_line: invoked on the primary instance when a command-line is + * not handled locally + * @local_command_line: invoked (locally) when the process has been invoked + * via commandline execution. The virtual function has the chance to + * inspect (and possibly replace) the list of command line arguments. + * See g_application_run() for more information. + * @before_emit: invoked on the primary instance before 'activate', 'open' or any action invocation + * @after_emit: invoked on the primary instance after 'activate', 'open' or any action invocation + * @add_platform_data: invoked (locally) to add 'platform data' to be sent to the primary instance when + * activating, opening or invoking actions + * @quit_mainloop: invoked on the primary instance when the use count of the application drops to zero (and + * after any inactivity timeout, if requested) + * @run_mainloop: invoked on the primary instance from g_application_run() if the use-count is non-zero + * + * Since: 2.26 + */ +struct _GApplicationClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* signals */ + void (* startup) (GApplication *application); + + void (* activate) (GApplication *application); + + void (* open) (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint); + + int (* command_line) (GApplication *application, + GApplicationCommandLine *command_line); + + /* vfuncs */ + gboolean (* local_command_line) (GApplication *application, + gchar ***arguments, + int *exit_status); + + void (* before_emit) (GApplication *application, + GVariant *platform_data); + void (* after_emit) (GApplication *application, + GVariant *platform_data); + void (* add_platform_data) (GApplication *application, + GVariantBuilder *builder); + void (* quit_mainloop) (GApplication *application); + void (* run_mainloop) (GApplication *application); + + /*< private >*/ + gpointer padding[12]; +}; + +GType g_application_get_type (void) G_GNUC_CONST; + +gboolean g_application_id_is_valid (const gchar *application_id); + +GApplication * g_application_new (const gchar *application_id, + GApplicationFlags flags); + +const gchar * g_application_get_application_id (GApplication *application); +void g_application_set_application_id (GApplication *application, + const gchar *application_id); + +guint g_application_get_inactivity_timeout (GApplication *application); +void g_application_set_inactivity_timeout (GApplication *application, + guint inactivity_timeout); + +GApplicationFlags g_application_get_flags (GApplication *application); +void g_application_set_flags (GApplication *application, + GApplicationFlags flags); + +void g_application_set_action_group (GApplication *application, + GActionGroup *action_group); + +gboolean g_application_get_is_registered (GApplication *application); +gboolean g_application_get_is_remote (GApplication *application); + +gboolean g_application_register (GApplication *application, + GCancellable *cancellable, + GError **error); + +void g_application_hold (GApplication *application); +void g_application_release (GApplication *application); + +void g_application_activate (GApplication *application); + +void g_application_open (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint); + +int g_application_run (GApplication *application, + int argc, + char **argv); + +G_END_DECLS + +#endif /* __G_APPLICATION_H__ */ diff --git a/gio/gapplicationcommandline.c b/gio/gapplicationcommandline.c new file mode 100644 index 0000000..b8d788a --- /dev/null +++ b/gio/gapplicationcommandline.c @@ -0,0 +1,543 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2 of the + * licence or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, + * USA. + * + * Authors: Ryan Lortie + */ + +#include "config.h" + +#include "gapplicationcommandline.h" + +#include "glibintl.h" + +#include +#include + +G_DEFINE_TYPE (GApplicationCommandLine, g_application_command_line, G_TYPE_OBJECT) + +/** + * SECTION:gapplicationcommandline + * @title: GApplicationCommandLine + * @short_description: A command-line invocation of an application + * @see_also: #GApplication + * + * #GApplicationCommandLine represents a command-line invocation of + * an application. It is created by #GApplication and emitted + * in the #GApplication::command-line signal and virtual function. + * + * The class contains the list of arguments that the program was invoked + * with. It is also possible to query if the commandline invocation was + * local (ie: the current process is running in direct response to the + * invocation) or remote (ie: some other process forwarded the + * commandline to this process). + * + * The exit status of the originally-invoked process may be set and + * messages can be printed to stdout or stderr of that process. The + * lifecycle of the originally-invoked process is tied to the lifecycle + * of this object (ie: the process exits when the last reference is + * dropped). + * + * Handling commandline arguments with GApplication + * + * + * FIXME: MISSING XINCLUDE CONTENT + * + * + * + * + * Complicated commandline handling + * + * + * FIXME: MISSING XINCLUDE CONTENT + * + * + * + **/ + +enum +{ + PROP_NONE, + PROP_ARGUMENTS, + PROP_PLATFORM_DATA, + PROP_IS_REMOTE +}; + +struct _GApplicationCommandLinePrivate +{ + GVariant *platform_data; + GVariant *arguments; + GVariant *cwd; + + const gchar **environ; + gint exit_status; +}; + +/* All subclasses represent remote invocations of some kind. */ +#define IS_REMOTE(cmdline) (G_TYPE_FROM_INSTANCE (cmdline) != \ + G_TYPE_APPLICATION_COMMAND_LINE) + +static void +grok_platform_data (GApplicationCommandLine *cmdline) +{ + GVariantIter iter; + const gchar *key; + GVariant *value; + + g_variant_iter_init (&iter, cmdline->priv->platform_data); + + while (g_variant_iter_loop (&iter, "{&sv}", &key, &value)) + if (strcmp (key, "cwd") == 0) + { + if (!cmdline->priv->cwd) + cmdline->priv->cwd = g_variant_ref (value); + } + + else if (strcmp (key, "environ") == 0) + { + if (!cmdline->priv->environ) + cmdline->priv->environ = + g_variant_get_bytestring_array (value, NULL); + } +} + +static void +g_application_command_line_real_print_literal (GApplicationCommandLine *cmdline, + const gchar *message) +{ + g_print ("%s\n", message); +} + +static void +g_application_command_line_real_printerr_literal (GApplicationCommandLine *cmdline, + const gchar *message) +{ + g_printerr ("%s\n", message); +} + +static void +g_application_command_line_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GApplicationCommandLine *cmdline = G_APPLICATION_COMMAND_LINE (object); + + switch (prop_id) + { + case PROP_ARGUMENTS: + g_value_set_variant (value, cmdline->priv->arguments); + break; + + case PROP_PLATFORM_DATA: + g_value_set_variant (value, cmdline->priv->platform_data); + break; + + case PROP_IS_REMOTE: + g_value_set_boolean (value, IS_REMOTE (cmdline)); + break; + + default: + g_assert_not_reached (); + } +} + +static void +g_application_command_line_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GApplicationCommandLine *cmdline = G_APPLICATION_COMMAND_LINE (object); + + switch (prop_id) + { + case PROP_ARGUMENTS: + g_assert (cmdline->priv->arguments == NULL); + cmdline->priv->arguments = g_value_dup_variant (value); + break; + + case PROP_PLATFORM_DATA: + g_assert (cmdline->priv->platform_data == NULL); + cmdline->priv->platform_data = g_value_dup_variant (value); + if (cmdline->priv->platform_data != NULL) + grok_platform_data (cmdline); + break; + + default: + g_assert_not_reached (); + } +} + +static void +g_application_command_line_finalize (GObject *object) +{ + GApplicationCommandLine *cmdline = G_APPLICATION_COMMAND_LINE (object); + + if (cmdline->priv->platform_data) + g_variant_unref (cmdline->priv->platform_data); + if (cmdline->priv->arguments) + g_variant_unref (cmdline->priv->arguments); + if (cmdline->priv->cwd) + g_variant_unref (cmdline->priv->cwd); + + G_OBJECT_CLASS (g_application_command_line_parent_class) + ->finalize (object); +} + +static void +g_application_command_line_init (GApplicationCommandLine *cmdline) +{ + cmdline->priv = + G_TYPE_INSTANCE_GET_PRIVATE (cmdline, + G_TYPE_APPLICATION_COMMAND_LINE, + GApplicationCommandLinePrivate); +} + +static void +g_application_command_line_class_init (GApplicationCommandLineClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->get_property = g_application_command_line_get_property; + object_class->set_property = g_application_command_line_set_property; + object_class->finalize = g_application_command_line_finalize; + class->printerr_literal = g_application_command_line_real_printerr_literal; + class->print_literal = g_application_command_line_real_print_literal; + + g_object_class_install_property (object_class, PROP_ARGUMENTS, + g_param_spec_variant ("arguments", + P_("Commandline arguments"), + P_("The commandline that caused this ::command-line signal emission"), + G_VARIANT_TYPE_BYTESTRING_ARRAY, NULL, + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_PLATFORM_DATA, + g_param_spec_variant ("platform-data", + P_("Platform data"), + P_("Platform-specific data for the commandline"), + G_VARIANT_TYPE ("a{sv}"), NULL, + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_IS_REMOTE, + g_param_spec_boolean ("is-remote", + P_("Is remote"), + P_("TRUE if this is a remote commandline"), + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (class, sizeof (GApplicationCommandLinePrivate)); +} + + +/** + * g_application_command_line_get_arguments: + * @cmdline: a #GApplicationCommandLine + * @argc: (out): the length of the arguments array, or %NULL + * + * Gets the list of arguments that was passed on the command line. + * + * The strings in the array may contain non-utf8 data. + * + * The return value is %NULL-terminated and should be freed using + * g_strfreev(). + * + * Returns: (array length=argc) (transfer full): the string array + * containing the arguments (the argv) + * + * Since: 2.28 + **/ +gchar ** +g_application_command_line_get_arguments (GApplicationCommandLine *cmdline, + int *argc) +{ + gchar **argv; + gsize len; + + g_return_val_if_fail (G_IS_APPLICATION_COMMAND_LINE (cmdline), NULL); + + argv = g_variant_dup_bytestring_array (cmdline->priv->arguments, &len); + + if (argc) + *argc = len; + + return argv; +} + +/** + * g_application_command_line_get_cwd: + * @cmdline: a #GApplicationCommandLine + * + * Gets the working directory of the command line invocation. The + * string may contain non-utf8 data. + * + * It is possible that the remote application did not send a working + * directory, so this may be %NULL. + * + * The return value should not be modified or freed and is valid for as + * long as @cmdline exists. + * + * Returns: the current directory, or %NULL + * + * Since: 2.28 + **/ +const gchar * +g_application_command_line_get_cwd (GApplicationCommandLine *cmdline) +{ + if (cmdline->priv->cwd) + return g_variant_get_bytestring (cmdline->priv->cwd); + else + return NULL; +} + +/** + * g_application_command_line_get_environ: + * @cmdline: a #GApplicationCommandLine + * + * Gets the contents of the 'environ' variable of the command line + * invocation, as would be returned by g_get_environ(). The strings may + * contain non-utf8 data. + * + * The remote application usually does not send an environment. Use + * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag + * set it is possible that the environment is still not available (due + * to invocation messages from other applications). + * + * The return value should not be modified or freed and is valid for as + * long as @cmdline exists. + * + * Returns: (array zero-terminated=1) (transfer none): the environment + * strings, or %NULL if they were not sent + * + * Since: 2.28 + **/ +const gchar * const * +g_application_command_line_get_environ (GApplicationCommandLine *cmdline) +{ + return cmdline->priv->environ; +} + +/** + * g_application_command_line_getenv: + * @cmdline: a #GApplicationCommandLine + * @name: the environment variable to get + * + * Gets the value of a particular environment variable of the command + * line invocation, as would be returned by g_getenv(). The strings may + * contain non-utf8 data. + * + * The remote application usually does not send an environment. Use + * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag + * set it is possible that the environment is still not available (due + * to invocation messages from other applications). + * + * The return value should not be modified or freed and is valid for as + * long as @cmdline exists. + * + * Returns: the value of the variable, or %NULL if unset or unsent + * + * Since: 2.28 + **/ +const gchar * +g_application_command_line_getenv (GApplicationCommandLine *cmdline, + const gchar *name) +{ + gint length = strlen (name); + gint i; + + /* TODO: expand on windows */ + if (cmdline->priv->environ) + for (i = 0; cmdline->priv->environ[i]; i++) + if (strncmp (cmdline->priv->environ[i], name, length) == 0 && + cmdline->priv->environ[i][length] == '=') + return cmdline->priv->environ[i] + length + 1; + + return NULL; +} + +/** + * g_application_command_line_get_is_remote: + * @cmdline: a #GApplicationCommandLine + * + * Determines if @cmdline represents a remote invocation. + * + * Returns: %TRUE if the invocation was remote + * + * Since: 2.28 + **/ +gboolean +g_application_command_line_get_is_remote (GApplicationCommandLine *cmdline) +{ + return IS_REMOTE (cmdline); +} + +/** + * g_application_command_line_print: + * @cmdline: a #GApplicationCommandLine + * @format: a printf-style format string + * @...: arguments, as per @format + * + * Formats a message and prints it using the stdout print handler in the + * invoking process. + * + * If @cmdline is a local invocation then this is exactly equivalent to + * g_print(). If @cmdline is remote then this is equivalent to calling + * g_print() in the invoking process. + * + * Since: 2.28 + **/ +void +g_application_command_line_print (GApplicationCommandLine *cmdline, + const gchar *format, + ...) +{ + gchar *message; + va_list ap; + + g_return_if_fail (G_IS_APPLICATION_COMMAND_LINE (cmdline)); + g_return_if_fail (format != NULL); + + va_start (ap, format); + message = g_strdup_vprintf (format, ap); + va_end (ap); + + G_APPLICATION_COMMAND_LINE_GET_CLASS (cmdline) + ->print_literal (cmdline, message); + g_free (message); +} + +/** + * g_application_command_line_printerr: + * @cmdline: a #GApplicationCommandLine + * @format: a printf-style format string + * @...: arguments, as per @format + * + * Formats a message and prints it using the stderr print handler in the + * invoking process. + * + * If @cmdline is a local invocation then this is exactly equivalent to + * g_printerr(). If @cmdline is remote then this is equivalent to + * calling g_printerr() in the invoking process. + * + * Since: 2.28 + **/ +void +g_application_command_line_printerr (GApplicationCommandLine *cmdline, + const gchar *format, + ...) +{ + gchar *message; + va_list ap; + + g_return_if_fail (G_IS_APPLICATION_COMMAND_LINE (cmdline)); + g_return_if_fail (format != NULL); + + va_start (ap, format); + message = g_strdup_vprintf (format, ap); + va_end (ap); + + G_APPLICATION_COMMAND_LINE_GET_CLASS (cmdline) + ->printerr_literal (cmdline, message); + g_free (message); +} + +/** + * g_application_command_line_set_exit_status: + * @cmdline: a #GApplicationCommandLine + * @exit_status: the exit status + * + * Sets the exit status that will be used when the invoking process + * exits. + * + * The return value of the #GApplication::command-line signal is + * passed to this function when the handler returns. This is the usual + * way of setting the exit status. + * + * In the event that you want the remote invocation to continue running + * and want to decide on the exit status in the future, you can use this + * call. For the case of a remote invocation, the remote process will + * typically exit when the last reference is dropped on @cmdline. The + * exit status of the remote process will be equal to the last value + * that was set with this function. + * + * In the case that the commandline invocation is local, the situation + * is slightly more complicated. If the commandline invocation results + * in the mainloop running (ie: because the use-count of the application + * increased to a non-zero value) then the application is considered to + * have been 'successful' in a certain sense, and the exit status is + * always zero. If the application use count is zero, though, the exit + * status of the local #GApplicationCommandLine is used. + * + * Since: 2.28 + **/ +void +g_application_command_line_set_exit_status (GApplicationCommandLine *cmdline, + int exit_status) +{ + g_return_if_fail (G_IS_APPLICATION_COMMAND_LINE (cmdline)); + + cmdline->priv->exit_status = exit_status; +} + +/** + * g_application_command_line_get_exit_status: + * @cmdline: a #GApplicationCommandLine + * + * Gets the exit status of @cmdline. See + * g_application_command_line_set_exit_status() for more information. + * + * Returns: the exit status + * + * Since: 2.28 + **/ +int +g_application_command_line_get_exit_status (GApplicationCommandLine *cmdline) +{ + g_return_val_if_fail (G_IS_APPLICATION_COMMAND_LINE (cmdline), -1); + + return cmdline->priv->exit_status; +} + +/** + * g_application_command_line_get_platform_data: + * @cmdline: #GApplicationCommandLine + * + * Gets the platform data associated with the invocation of @cmdline. + * + * This is a #GVariant dictionary containing information about the + * context in which the invocation occured. It typically contains + * information like the current working directory and the startup + * notification ID. + * + * For local invocation, it will be %NULL. + * + * Returns: the platform data, or %NULL + * + * Since: 2.28 + **/ +GVariant * +g_application_command_line_get_platform_data (GApplicationCommandLine *cmdline) +{ + g_return_val_if_fail (G_IS_APPLICATION_COMMAND_LINE (cmdline), NULL); + + if (cmdline->priv->platform_data) + return g_variant_ref (cmdline->priv->platform_data); + else + return NULL; +} diff --git a/gio/gapplicationcommandline.h b/gio/gapplicationcommandline.h new file mode 100644 index 0000000..9b4762f --- /dev/null +++ b/gio/gapplicationcommandline.h @@ -0,0 +1,118 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_APPLICATION_COMMAND_LINE_H__ +#define __G_APPLICATION_COMMAND_LINE_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_APPLICATION_COMMAND_LINE (g_application_command_line_get_type ()) +#define G_APPLICATION_COMMAND_LINE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_APPLICATION_COMMAND_LINE, \ + GApplicationCommandLine)) +#define G_APPLICATION_COMMAND_LINE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_APPLICATION_COMMAND_LINE, \ + GApplicationCommandLineClass)) +#define G_IS_APPLICATION_COMMAND_LINE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_APPLICATION_COMMAND_LINE)) +#define G_IS_APPLICATION_COMMAND_LINE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_APPLICATION_COMMAND_LINE)) +#define G_APPLICATION_COMMAND_LINE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_APPLICATION_COMMAND_LINE, \ + GApplicationCommandLineClass)) + +typedef struct _GApplicationCommandLinePrivate GApplicationCommandLinePrivate; +typedef struct _GApplicationCommandLineClass GApplicationCommandLineClass; + +/** + * GApplicationCommandLine: + * + * The GApplicationCommandLine structure contains private + * data and should only be accessed using the provided API + * + * Since: 2.26 + */ +struct _GApplicationCommandLine +{ + /*< private >*/ + GObject parent_instance; + + GApplicationCommandLinePrivate *priv; +}; + +/** + * GApplicationCommandLineClass: + * + * The GApplicationCommandLineClass structure contains + * private data only + * + * Since: 2.26 + */ +struct _GApplicationCommandLineClass +{ + /*< private >*/ + GObjectClass parent_class; + + void (* print_literal) (GApplicationCommandLine *cmdline, + const gchar *message); + void (* printerr_literal) (GApplicationCommandLine *cmdline, + const gchar *message); + + gpointer padding[12]; +}; + +GType g_application_command_line_get_type (void) G_GNUC_CONST; + +gchar ** g_application_command_line_get_arguments (GApplicationCommandLine *cmdline, + int *argc); + +const gchar * const * g_application_command_line_get_environ (GApplicationCommandLine *cmdline); + +const gchar * g_application_command_line_getenv (GApplicationCommandLine *cmdline, + const gchar *name); + +const gchar * g_application_command_line_get_cwd (GApplicationCommandLine *cmdline); + +gboolean g_application_command_line_get_is_remote (GApplicationCommandLine *cmdline); + +void g_application_command_line_print (GApplicationCommandLine *cmdline, + const gchar *format, + ...) G_GNUC_PRINTF(2, 3); +void g_application_command_line_printerr (GApplicationCommandLine *cmdline, + const gchar *format, + ...) G_GNUC_PRINTF(2, 3); + +int g_application_command_line_get_exit_status (GApplicationCommandLine *cmdline); +void g_application_command_line_set_exit_status (GApplicationCommandLine *cmdline, + int exit_status); + +GVariant * g_application_command_line_get_platform_data (GApplicationCommandLine *cmdline); + +G_END_DECLS + +#endif /* __G_APPLICATION_COMMAND_LINE_H__ */ diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c new file mode 100644 index 0000000..ca072ac --- /dev/null +++ b/gio/gapplicationimpl-dbus.c @@ -0,0 +1,1036 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#include "gapplicationimpl.h" + +#include "gactiongroup.h" +#include "gapplication.h" +#include "gfile.h" +#include "gdbusconnection.h" +#include "gdbusintrospection.h" +#include "gdbuserror.h" + +#include +#include + +#include "gapplicationcommandline.h" +#include "gdbusmethodinvocation.h" + +/* DBus Interface definition {{{1 */ +static const GDBusArgInfo platform_data_arg = { -1, (gchar *) "platform_data", (gchar *) "a{sv}" }; + +static const GDBusArgInfo open_uris_arg = { -1, (gchar *) "uris", (gchar *) "as" }; +static const GDBusArgInfo open_hint_arg = { -1, (gchar *) "hint", (gchar *) "s" }; + +static const GDBusArgInfo invoke_action_name_arg = { -1, (gchar *) "name", (gchar *) "s" }; +static const GDBusArgInfo invoke_action_args_arg = { -1, (gchar *) "args", (gchar *) "v" }; + +static const GDBusArgInfo cmdline_path_arg = { -1, (gchar *) "path", (gchar *) "o" }; +static const GDBusArgInfo cmdline_arguments_arg = { -1, (gchar *) "arguments", (gchar *) "aay" }; +static const GDBusArgInfo cmdline_exit_status_arg = { -1, (gchar *) "exit_status", (gchar *) "i" }; + +static const GDBusArgInfo *activate_in[] = { &platform_data_arg, NULL }; +static const GDBusArgInfo *activate_out[] = { NULL }; + +static const GDBusArgInfo *open_in[] = { &open_uris_arg, &open_hint_arg, &platform_data_arg, NULL }; +static const GDBusArgInfo *open_out[] = { NULL }; + +static const GDBusArgInfo *cmdline_in[] = { &cmdline_path_arg, &cmdline_arguments_arg, &platform_data_arg, NULL }; +static const GDBusArgInfo *cmdline_out[] = { &cmdline_exit_status_arg, NULL }; + +static const GDBusMethodInfo activate_method = { + -1, (gchar *) "Activate", + (GDBusArgInfo **) activate_in, + (GDBusArgInfo **) activate_out +}; + +static const GDBusMethodInfo open_method = { + -1, (gchar *) "Open", + (GDBusArgInfo **) open_in, + (GDBusArgInfo **) open_out +}; + +static const GDBusMethodInfo command_line_method = { + -1, (gchar *) "CommandLine", + (GDBusArgInfo **) cmdline_in, + (GDBusArgInfo **) cmdline_out +}; + +static const GDBusMethodInfo *application_methods[] = { + &activate_method, &open_method, &command_line_method, NULL +}; + +const GDBusInterfaceInfo org_gtk_Application = { + -1, (gchar *) "org.gtk.Application", + (GDBusMethodInfo **) application_methods +}; + +static const GDBusArgInfo list_arg = { -1, (gchar *) "list", (gchar *) "a(savbav)" }; +static const GDBusArgInfo *describe_all_out[] = { &list_arg, NULL }; + +static const GDBusArgInfo action_name_arg = { -1, (gchar *) "action_name", (gchar *) "s" }; +static const GDBusArgInfo value_arg = { -1, (gchar *) "value", (gchar *) "v" }; +static const GDBusArgInfo *set_action_state_in[] = { &action_name_arg, &value_arg, &platform_data_arg, NULL }; + +static const GDBusArgInfo parameter_arg = { -1, (gchar *) "parameter", (gchar *) "av" }; +static const GDBusArgInfo *activate_action_in[] = { &action_name_arg, ¶meter_arg, &platform_data_arg, NULL }; + +static const GDBusMethodInfo describe_all_method = { + -1, (gchar *) "DescribeAll", NULL, + (GDBusArgInfo **) describe_all_out +}; + +static const GDBusMethodInfo set_action_state_method = { + -1, (gchar *) "SetState", + (GDBusArgInfo **) set_action_state_in +}; + +static const GDBusMethodInfo activate_action_method = { + -1, (gchar *) "Activate", + (GDBusArgInfo **) activate_action_in +}; + +static const GDBusMethodInfo *actions_methods[] = { + &describe_all_method, &set_action_state_method, &activate_action_method, NULL +}; + +const GDBusInterfaceInfo org_gtk_Actions = { + -1, (gchar *) "org.gtk.Actions", + (GDBusMethodInfo **) actions_methods +}; + +static const GDBusArgInfo message_arg = { -1, (gchar *) "message", (gchar *) "s" }; +static const GDBusArgInfo *print_in[] = { &message_arg, NULL }; +static const GDBusArgInfo *print_out[] = { NULL }; + +static const GDBusMethodInfo stdout_method = { + -1, (gchar *) "Print", + (GDBusArgInfo **) print_in, + (GDBusArgInfo **) print_out +}; + +static const GDBusMethodInfo stderr_method = { + -1, (gchar *) "PrintError", + (GDBusArgInfo **) print_in, + (GDBusArgInfo **) print_out +}; + +static const GDBusMethodInfo *cmdline_methods[] = { + &stdout_method, &stderr_method, NULL +}; + +const GDBusInterfaceInfo org_gtk_private_Cmdline = { + -1, (gchar *) "org.gtk.private.CommandLine", + (GDBusMethodInfo **) cmdline_methods +}; + +/* GApplication implementation {{{1 */ +struct _GApplicationImpl +{ + GDBusConnection *session_bus; + const gchar *bus_name; + gchar *object_path; + guint object_id; + guint action_id; + gpointer app; + + GHashTable *actions; + guint signal_id; +}; + + +static GApplicationCommandLine * +g_dbus_command_line_new (GDBusMethodInvocation *invocation); + + +static void +g_application_impl_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GApplicationImpl *impl = user_data; + GApplicationClass *class; + + class = G_APPLICATION_GET_CLASS (impl->app); + + if (strcmp (method_name, "Activate") == 0) + { + GVariant *platform_data; + + g_variant_get (parameters, "(@a{sv})", &platform_data); + class->before_emit (impl->app, platform_data); + g_signal_emit_by_name (impl->app, "activate"); + class->after_emit (impl->app, platform_data); + g_variant_unref (platform_data); + + g_dbus_method_invocation_return_value (invocation, NULL); + } + + else if (strcmp (method_name, "Open") == 0) + { + GVariant *platform_data; + const gchar *hint; + GVariant *array; + GFile **files; + gint n, i; + + g_variant_get (parameters, "(@ass@a{sv})", + &array, &hint, &platform_data); + + n = g_variant_n_children (array); + files = g_new (GFile *, n + 1); + + for (i = 0; i < n; i++) + { + const gchar *uri; + + g_variant_get_child (array, i, "&s", &uri); + files[i] = g_file_new_for_uri (uri); + } + g_variant_unref (array); + files[n] = NULL; + + class->before_emit (impl->app, platform_data); + g_signal_emit_by_name (impl->app, "open", files, n, hint); + class->after_emit (impl->app, platform_data); + + g_variant_unref (platform_data); + + for (i = 0; i < n; i++) + g_object_unref (files[i]); + g_free (files); + + g_dbus_method_invocation_return_value (invocation, NULL); + } + + else if (strcmp (method_name, "CommandLine") == 0) + { + GApplicationCommandLine *cmdline; + GVariant *platform_data; + int status; + + cmdline = g_dbus_command_line_new (invocation); + platform_data = g_variant_get_child_value (parameters, 2); + class->before_emit (impl->app, platform_data); + g_signal_emit_by_name (impl->app, "command-line", cmdline, &status); + g_application_command_line_set_exit_status (cmdline, status); + class->after_emit (impl->app, platform_data); + g_variant_unref (platform_data); + g_object_unref (cmdline); + } + else + g_assert_not_reached (); +} + +static void +g_application_impl_actions_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GApplicationImpl *impl = user_data; + GActionGroup *action_group; + GApplicationClass *class; + + class = G_APPLICATION_GET_CLASS (impl->app); + action_group = G_ACTION_GROUP (impl->app); + + if (strcmp (method_name, "DescribeAll") == 0) + { + GVariantBuilder builder; + gchar **actions; + gint i; + + actions = g_action_group_list_actions (action_group); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(a(savbav))")); + g_variant_builder_open (&builder, G_VARIANT_TYPE ("a(savbav)")); + + for (i = 0; actions[i]; i++) + { + /* Open */ + g_variant_builder_open (&builder, G_VARIANT_TYPE ("(savbav)")); + + /* Name */ + g_variant_builder_add (&builder, "s", actions[i]); + + /* Parameter type */ + g_variant_builder_open (&builder, G_VARIANT_TYPE ("av")); + { + const GVariantType *type; + + type = g_action_group_get_action_parameter_type (action_group, + actions[i]); + if (type != NULL) + { + GVariantType *array_type; + + array_type = g_variant_type_new_array (type); + g_variant_builder_open (&builder, G_VARIANT_TYPE_VARIANT); + g_variant_builder_open (&builder, array_type); + g_variant_builder_close (&builder); + g_variant_builder_close (&builder); + g_variant_type_free (array_type); + } + } + g_variant_builder_close (&builder); + + /* Enabled */ + { + gboolean enabled = g_action_group_get_action_enabled (action_group, + actions[i]); + g_variant_builder_add (&builder, "b", enabled); + } + + /* State */ + g_variant_builder_open (&builder, G_VARIANT_TYPE ("av")); + { + GVariant *state = g_action_group_get_action_state (action_group, + actions[i]); + if (state != NULL) + { + g_variant_builder_add (&builder, "v", state); + g_variant_unref (state); + } + } + g_variant_builder_close (&builder); + + /* Close */ + g_variant_builder_close (&builder); + } + g_variant_builder_close (&builder); + + g_dbus_method_invocation_return_value (invocation, + g_variant_builder_end (&builder)); + + g_strfreev (actions); + } + + else if (strcmp (method_name, "SetState") == 0) + { + const gchar *action_name; + GVariant *platform_data; + GVariant *state; + + g_variant_get (parameters, "(&sv@a{sv})", + &action_name, &state, &platform_data); + + class->before_emit (impl->app, platform_data); + g_action_group_change_action_state (action_group, action_name, state); + class->after_emit (impl->app, platform_data); + g_variant_unref (platform_data); + g_variant_unref (state); + + g_dbus_method_invocation_return_value (invocation, NULL); + } + + else if (strcmp (method_name, "Activate") == 0) + { + const gchar *action_name; + GVariant *platform_data; + GVariantIter *param; + GVariant *parameter; + GVariant *unboxed_parameter; + + g_variant_get (parameters, "(&sav@a{sv})", + &action_name, ¶m, &platform_data); + parameter = g_variant_iter_next_value (param); + unboxed_parameter = parameter ? g_variant_get_variant (parameter) : NULL; + g_variant_iter_free (param); + + class->before_emit (impl->app, platform_data); + g_action_group_activate_action (action_group, action_name, unboxed_parameter); + class->after_emit (impl->app, platform_data); + g_variant_unref (platform_data); + + if (unboxed_parameter) + g_variant_unref (unboxed_parameter); + if (parameter) + g_variant_unref (parameter); + + g_dbus_method_invocation_return_value (invocation, NULL); + } + + else + g_assert_not_reached (); +} + +static gchar * +application_path_from_appid (const gchar *appid) +{ + gchar *appid_path, *iter; + + appid_path = g_strconcat ("/", appid, NULL); + for (iter = appid_path; *iter; iter++) + { + if (*iter == '.') + *iter = '/'; + } + + return appid_path; +} + +void +g_application_impl_destroy (GApplicationImpl *impl) +{ + if (impl->session_bus) + { + if (impl->object_id) + g_dbus_connection_unregister_object (impl->session_bus, + impl->object_id); + + g_object_unref (impl->session_bus); + g_free (impl->object_path); + } + else + { + g_assert (impl->object_path == NULL); + g_assert (impl->object_id == 0); + } + + g_slice_free (GApplicationImpl, impl); +} + +RemoteActionInfo * +remote_action_info_new_from_iter (GVariantIter *iter) +{ + RemoteActionInfo *info; + const gchar *name; + GVariant *param_type; + gboolean enabled; + GVariant *state; + + if (!g_variant_iter_next (iter, "(s@avb@av)", &name, + ¶m_type, &enabled, &state)) + return NULL; + + info = g_slice_new (RemoteActionInfo); + info->parameter_type = g_variant_type_copy ( + g_variant_type_element ( + g_variant_get_type (param_type))); + info->enabled = enabled; + info->state = state; + + g_variant_unref (param_type); + + return info; +} + +static void +g_application_impl_action_signal (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + GApplicationImpl *impl = user_data; + GActionGroup *action_group; + + action_group = G_ACTION_GROUP (impl->app); + + if (strcmp (signal_name, "Added") == 0 && + g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(a(savbav))"))) + { + RemoteActionInfo *info; + GVariantIter *iter; + + g_variant_get_child (parameters, 0, "a(savbav)", &iter); + + while ((info = remote_action_info_new_from_iter (iter))) + { + g_hash_table_replace (impl->actions, info->name, info); + g_action_group_action_added (action_group, info->name); + } + + g_variant_iter_free (iter); + } + + else if (strcmp (signal_name, "Removed") == 0 && + g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(as)"))) + { + GVariantIter *iter; + const gchar *name; + + g_variant_get_child (parameters, 0, "as", &iter); + while (g_variant_iter_next (iter, "&s", &name)) + if (g_hash_table_remove (impl->actions, name)) + g_action_group_action_removed (action_group, name); + g_variant_iter_free (iter); + } + + else if (strcmp (signal_name, "EnabledChanged") == 0 && + g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(sb)"))) + { + RemoteActionInfo *info; + const gchar *name; + gboolean enabled; + + g_variant_get (parameters, "(&sb)", &name, &enabled); + info = g_hash_table_lookup (impl->actions, name); + + if (info && enabled != info->enabled) + { + info->enabled = enabled; + g_action_group_action_enabled_changed (action_group, + info->name, + enabled); + } + } + + else if (strcmp (signal_name, "StateChanged") == 0 && + g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(sv)"))) + { + RemoteActionInfo *info; + const gchar *name; + GVariant *state; + + g_variant_get (parameters, "(&sv)", &name, &state); + info = g_hash_table_lookup (impl->actions, name); + + if (info && info->state && + g_variant_is_of_type (state, g_variant_get_type (info->state)) && + !g_variant_equal (state, info->state)) + { + g_variant_unref (info->state); + info->state = g_variant_ref (state); + g_action_group_action_state_changed (action_group, + info->name, + state); + } + g_variant_unref (state); + } +} + +GApplicationImpl * +g_application_impl_register (GApplication *application, + const gchar *appid, + GApplicationFlags flags, + GHashTable **remote_actions, + GCancellable *cancellable, + GError **error) +{ + const static GDBusInterfaceVTable vtable = { + g_application_impl_method_call + }; + const static GDBusInterfaceVTable actions_vtable = { + g_application_impl_actions_method_call + }; + GApplicationImpl *impl; + GVariant *reply; + guint32 rval; + + impl = g_slice_new (GApplicationImpl); + + impl->app = application; + impl->bus_name = appid; + + impl->session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, + cancellable, error); + + if (impl->session_bus == NULL) + { + g_slice_free (GApplicationImpl, impl); + return NULL; + } + + impl->object_path = application_path_from_appid (appid); + + /* Only try to be the primary instance if + * G_APPLICATION_IS_LAUNCHER was not specified. + */ + if (~flags & G_APPLICATION_IS_LAUNCHER) + { + /* Attempt to become primary instance. */ + impl->object_id = + g_dbus_connection_register_object (impl->session_bus, + impl->object_path, + (GDBusInterfaceInfo *) + &org_gtk_Application, + &vtable, impl, NULL, error); + + if (impl->object_id == 0) + { + g_object_unref (impl->session_bus); + g_free (impl->object_path); + impl->session_bus = NULL; + impl->object_path = NULL; + + g_slice_free (GApplicationImpl, impl); + return NULL; + } + + impl->action_id = + g_dbus_connection_register_object (impl->session_bus, + impl->object_path, + (GDBusInterfaceInfo *) + &org_gtk_Actions, + &actions_vtable, + impl, NULL, error); + + if (impl->action_id == 0) + { + g_dbus_connection_unregister_object (impl->session_bus, + impl->object_id); + + g_object_unref (impl->session_bus); + g_free (impl->object_path); + impl->session_bus = NULL; + impl->object_path = NULL; + + g_slice_free (GApplicationImpl, impl); + return NULL; + } + + /* DBUS_NAME_FLAG_DO_NOT_QUEUE: 0x4 */ + reply = g_dbus_connection_call_sync (impl->session_bus, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "RequestName", + g_variant_new ("(su)", + impl->bus_name, + 0x4), + G_VARIANT_TYPE ("(u)"), + 0, -1, cancellable, error); + + if (reply == NULL) + { + g_dbus_connection_unregister_object (impl->session_bus, + impl->object_id); + impl->object_id = 0; + + g_object_unref (impl->session_bus); + g_free (impl->object_path); + impl->session_bus = NULL; + impl->object_path = NULL; + + g_slice_free (GApplicationImpl, impl); + return NULL; + } + + g_variant_get (reply, "(u)", &rval); + g_variant_unref (reply); + + /* DBUS_REQUEST_NAME_REPLY_EXISTS: 3 */ + if (rval != 3) + { + /* We are the primary instance. */ + g_dbus_connection_emit_signal (impl->session_bus, + NULL, + impl->object_path, + "org.gtk.Application", + "Hello", + g_variant_new ("(s)", + impl->bus_name), + NULL); + *remote_actions = NULL; + return impl; + } + + /* We didn't make it. Drop our service-side stuff. */ + g_dbus_connection_unregister_object (impl->session_bus, + impl->object_id); + impl->object_id = 0; + + if (flags & G_APPLICATION_IS_SERVICE) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, + "Unable to acquire bus name `%s'", appid); + g_object_unref (impl->session_bus); + g_free (impl->object_path); + + g_slice_free (GApplicationImpl, impl); + impl = NULL; + } + } + + /* We are non-primary. Try to get the primary's list of actions. + * This also serves as a mechanism to ensure that the primary exists + * (ie: DBus service files installed correctly, etc). + */ + impl->signal_id = + g_dbus_connection_signal_subscribe (impl->session_bus, impl->bus_name, + "org.gtk.Actions", NULL, + impl->object_path, NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + g_application_impl_action_signal, + impl, NULL); + + reply = g_dbus_connection_call_sync (impl->session_bus, impl->bus_name, + impl->object_path, "org.gtk.Actions", + "DescribeAll", NULL, + G_VARIANT_TYPE ("(a(savbav))"), + G_DBUS_CALL_FLAGS_NONE, -1, + cancellable, error); + + if (reply == NULL) + { + /* The primary appears not to exist. Fail the registration. */ + g_object_unref (impl->session_bus); + g_free (impl->object_path); + impl->session_bus = NULL; + impl->object_path = NULL; + + g_slice_free (GApplicationImpl, impl); + return NULL; + } + + /* Create and populate the hashtable */ + { + GVariant *descriptions; + GVariantIter iter; + GVariant *param_type; + gboolean enabled; + GVariant *state; + gchar *name; + + *remote_actions = g_hash_table_new (g_str_hash, g_str_equal); + descriptions = g_variant_get_child_value (reply, 0); + g_variant_iter_init (&iter, descriptions); + + while (g_variant_iter_next (&iter, "(s@avb@av)", &name, + ¶m_type, &enabled, &state)) + { + RemoteActionInfo *action; + + action = g_slice_new (RemoteActionInfo); + action->parameter_type = g_variant_type_copy ( + g_variant_type_element ( + g_variant_get_type (param_type))); + action->enabled = enabled; + action->state = state; + + g_hash_table_insert (*remote_actions, name, action); + g_variant_unref (param_type); + } + + g_variant_unref (descriptions); + } + + + return impl; +} + +void +g_application_impl_activate (GApplicationImpl *impl, + GVariant *platform_data) +{ + g_dbus_connection_call (impl->session_bus, + impl->bus_name, + impl->object_path, + "org.gtk.Application", + "Activate", + g_variant_new ("(@a{sv})", platform_data), + NULL, 0, -1, NULL, NULL, NULL); +} + +void +g_application_impl_open (GApplicationImpl *impl, + GFile **files, + gint n_files, + const gchar *hint, + GVariant *platform_data) +{ + GVariantBuilder builder; + gint i; + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(assa{sv})")); + g_variant_builder_open (&builder, G_VARIANT_TYPE_STRING_ARRAY); + for (i = 0; i < n_files; i++) + { + gchar *uri = g_file_get_uri (files[i]); + g_variant_builder_add (&builder, "s", uri); + g_free (uri); + } + g_variant_builder_close (&builder); + g_variant_builder_add (&builder, "s", hint); + g_variant_builder_add_value (&builder, platform_data); + + g_dbus_connection_call (impl->session_bus, + impl->bus_name, + impl->object_path, + "org.gtk.Application", + "Open", + g_variant_builder_end (&builder), + NULL, 0, -1, NULL, NULL, NULL); +} + +static void +g_application_impl_cmdline_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + const gchar *message; + + g_variant_get_child (parameters, 0, "&s", &message); + + if (strcmp (method_name, "Print") == 0) + g_print ("%s", message); + else if (strcmp (method_name, "PrintError") == 0) + g_printerr ("%s", message); + else + g_assert_not_reached (); + + g_dbus_method_invocation_return_value (invocation, NULL); +} + +typedef struct +{ + GMainLoop *loop; + int status; +} CommandLineData; + +static void +g_application_impl_cmdline_done (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + CommandLineData *data = user_data; + GError *error = NULL; + GVariant *reply; + + reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source), + result, &error); + + if (reply != NULL) + { + g_variant_get (reply, "(i)", &data->status); + g_variant_unref (reply); + } + + else + { + g_printerr ("%s\n", error->message); + g_error_free (error); + data->status = 1; + } + + g_main_loop_quit (data->loop); +} + +int +g_application_impl_command_line (GApplicationImpl *impl, + gchar **arguments, + GVariant *platform_data) +{ + const static GDBusInterfaceVTable vtable = { + g_application_impl_cmdline_method_call + }; + const gchar *object_path = "/org/gtk/Application/CommandLine"; + GMainContext *context; + CommandLineData data; + guint object_id; + + context = g_main_context_new (); + data.loop = g_main_loop_new (context, FALSE); + g_main_context_push_thread_default (context); + + object_id = g_dbus_connection_register_object (impl->session_bus, + object_path, + (GDBusInterfaceInfo *) + &org_gtk_private_Cmdline, + &vtable, &data, NULL, NULL); + /* In theory we should try other paths... */ + g_assert (object_id != 0); + + g_dbus_connection_call (impl->session_bus, + impl->bus_name, + impl->object_path, + "org.gtk.Application", + "CommandLine", + g_variant_new ("(o^aay@a{sv})", object_path, + arguments, platform_data), + G_VARIANT_TYPE ("(i)"), 0, G_MAXINT, NULL, + g_application_impl_cmdline_done, &data); + + g_main_loop_run (data.loop); + + g_main_context_pop_thread_default (context); + g_main_context_unref (context); + g_main_loop_unref (data.loop); + + return data.status; +} + +void +g_application_impl_change_action_state (GApplicationImpl *impl, + const gchar *action_name, + GVariant *value, + GVariant *platform_data) +{ + g_dbus_connection_call (impl->session_bus, + impl->bus_name, + impl->object_path, + "org.gtk.Actions", + "SetState", + g_variant_new ("(sv@a{sv})", action_name, + value, platform_data), + NULL, 0, -1, NULL, NULL, NULL); +} + +void +g_application_impl_activate_action (GApplicationImpl *impl, + const gchar *action_name, + GVariant *parameter, + GVariant *platform_data) +{ + GVariant *param; + + if (parameter) + parameter = g_variant_new_variant (parameter); + + param = g_variant_new_array (G_VARIANT_TYPE_VARIANT, + ¶meter, parameter != NULL); + + g_dbus_connection_call (impl->session_bus, + impl->bus_name, + impl->object_path, + "org.gtk.Actions", + "Activate", + g_variant_new ("(s@av@a{sv})", action_name, + param, platform_data), + NULL, 0, -1, NULL, NULL, NULL); +} + +void +g_application_impl_flush (GApplicationImpl *impl) +{ + g_dbus_connection_flush_sync (impl->session_bus, NULL, NULL); +} + + +/* GDBusCommandLine implementation {{{1 */ + +typedef GApplicationCommandLineClass GDBusCommandLineClass; +static GType g_dbus_command_line_get_type (void); +typedef struct +{ + GApplicationCommandLine parent_instance; + GDBusMethodInvocation *invocation; + + GDBusConnection *connection; + const gchar *bus_name; + const gchar *object_path; +} GDBusCommandLine; + + +G_DEFINE_TYPE (GDBusCommandLine, + g_dbus_command_line, + G_TYPE_APPLICATION_COMMAND_LINE) + +static void +g_dbus_command_line_print_literal (GApplicationCommandLine *cmdline, + const gchar *message) +{ + GDBusCommandLine *gdbcl = (GDBusCommandLine *) cmdline; + + g_dbus_connection_call (gdbcl->connection, + gdbcl->bus_name, + gdbcl->object_path, + "org.gtk.private.CommandLine", "Print", + g_variant_new ("(s)", message), + NULL, 0, -1, NULL, NULL, NULL); +} + +static void +g_dbus_command_line_printerr_literal (GApplicationCommandLine *cmdline, + const gchar *message) +{ + GDBusCommandLine *gdbcl = (GDBusCommandLine *) cmdline; + + g_dbus_connection_call (gdbcl->connection, + gdbcl->bus_name, + gdbcl->object_path, + "org.gtk.private.CommandLine", "PrintError", + g_variant_new ("(s)", message), + NULL, 0, -1, NULL, NULL, NULL); +} + +static void +g_dbus_command_line_finalize (GObject *object) +{ + GApplicationCommandLine *cmdline = G_APPLICATION_COMMAND_LINE (object); + GDBusCommandLine *gdbcl = (GDBusCommandLine *) object; + gint status; + + status = g_application_command_line_get_exit_status (cmdline); + + g_dbus_method_invocation_return_value (gdbcl->invocation, + g_variant_new ("(i)", status)); + g_object_unref (gdbcl->invocation); + + G_OBJECT_CLASS (g_dbus_command_line_parent_class) + ->finalize (object); +} + +static void +g_dbus_command_line_init (GDBusCommandLine *gdbcl) +{ +} + +static void +g_dbus_command_line_class_init (GApplicationCommandLineClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = g_dbus_command_line_finalize; + class->printerr_literal = g_dbus_command_line_printerr_literal; + class->print_literal = g_dbus_command_line_print_literal; +} + +static GApplicationCommandLine * +g_dbus_command_line_new (GDBusMethodInvocation *invocation) +{ + GDBusCommandLine *gdbcl; + GVariant *args; + + args = g_dbus_method_invocation_get_parameters (invocation); + + gdbcl = g_object_new (g_dbus_command_line_get_type (), + "arguments", g_variant_get_child_value (args, 1), + "platform-data", g_variant_get_child_value (args, 2), + NULL); + gdbcl->connection = g_dbus_method_invocation_get_connection (invocation); + gdbcl->bus_name = g_dbus_method_invocation_get_sender (invocation); + g_variant_get_child (args, 0, "&o", &gdbcl->object_path); + gdbcl->invocation = g_object_ref (invocation); + + return G_APPLICATION_COMMAND_LINE (gdbcl); +} + +/* Epilogue {{{1 */ + +/* vim:set foldmethod=marker: */ diff --git a/gio/gapplicationimpl.h b/gio/gapplicationimpl.h new file mode 100644 index 0000000..95f0b76 --- /dev/null +++ b/gio/gapplicationimpl.h @@ -0,0 +1,54 @@ +#include "giotypes.h" + +typedef struct _GApplicationImpl GApplicationImpl; + +typedef struct +{ + gchar *name; + + GVariantType *parameter_type; + gboolean enabled; + GVariant *state; +} RemoteActionInfo; + +G_GNUC_INTERNAL +void g_application_impl_destroy (GApplicationImpl *impl); + +G_GNUC_INTERNAL +GApplicationImpl * g_application_impl_register (GApplication *application, + const gchar *appid, + GApplicationFlags flags, + GHashTable **remote_actions, + GCancellable *cancellable, + GError **error); + +G_GNUC_INTERNAL +void g_application_impl_activate (GApplicationImpl *impl, + GVariant *platform_data); + +G_GNUC_INTERNAL +void g_application_impl_open (GApplicationImpl *impl, + GFile **files, + gint n_files, + const gchar *hint, + GVariant *platform_data); + +G_GNUC_INTERNAL +int g_application_impl_command_line (GApplicationImpl *impl, + gchar **arguments, + GVariant *platform_data); + +G_GNUC_INTERNAL +void g_application_impl_change_action_state (GApplicationImpl *impl, + const gchar *action_name, + GVariant *value, + GVariant *platform_data); + +G_GNUC_INTERNAL +void g_application_impl_activate_action (GApplicationImpl *impl, + const gchar *action_name, + GVariant *parameter, + GVariant *platform_data); + +G_GNUC_INTERNAL +void g_application_impl_flush (GApplicationImpl *impl); diff --git a/gio/gasynchelper.c b/gio/gasynchelper.c index 6387bf9..fb3d266 100644 --- a/gio/gasynchelper.c +++ b/gio/gasynchelper.c @@ -24,7 +24,6 @@ #include "gasynchelper.h" -#include "gioalias.h" /** * SECTION:gasynchelper @@ -44,29 +43,22 @@ typedef struct { GSource source; GPollFD pollfd; - GCancellable *cancellable; - gulong cancelled_tag; - GObject *object; } FDSource; static gboolean fd_source_prepare (GSource *source, gint *timeout) { - FDSource *fd_source = (FDSource *)source; *timeout = -1; - - return g_cancellable_is_cancelled (fd_source->cancellable); + return FALSE; } -static gboolean +static gboolean fd_source_check (GSource *source) { FDSource *fd_source = (FDSource *)source; - return - g_cancellable_is_cancelled (fd_source->cancellable) || - fd_source->pollfd.revents != 0; + return fd_source->pollfd.revents != 0; } static gboolean @@ -76,54 +68,84 @@ fd_source_dispatch (GSource *source, { GFDSourceFunc func = (GFDSourceFunc)callback; - GFDSourceObjectFunc func2 = (GFDSourceObjectFunc)callback; FDSource *fd_source = (FDSource *)source; g_warn_if_fail (func != NULL); - if (fd_source->object) - return (*func2) (fd_source->object, fd_source->pollfd.revents, user_data); - else - return (*func) (user_data, fd_source->pollfd.revents, fd_source->pollfd.fd); + return (*func) (fd_source->pollfd.fd, fd_source->pollfd.revents, user_data); } -static void +static void fd_source_finalize (GSource *source) { - FDSource *fd_source = (FDSource *)source; +} + +static gboolean +fd_source_closure_callback (int fd, + GIOCondition condition, + gpointer data) +{ + GClosure *closure = data; + + GValue params[2] = { { 0, }, { 0, } }; + GValue result_value = { 0, }; + gboolean result; - if (fd_source->cancelled_tag) - g_cancellable_disconnect (fd_source->cancellable, - fd_source->cancelled_tag); + g_value_init (&result_value, G_TYPE_BOOLEAN); - if (fd_source->cancellable) - g_object_unref (fd_source->cancellable); + g_value_init (¶ms[0], G_TYPE_INT); + g_value_set_int (¶ms[0], fd); - if (fd_source->object) - g_object_unref (fd_source->object); + g_value_init (¶ms[1], G_TYPE_IO_CONDITION); + g_value_set_flags (¶ms[1], condition); + + g_closure_invoke (closure, &result_value, 2, params, NULL); + + result = g_value_get_boolean (&result_value); + g_value_unset (&result_value); + g_value_unset (¶ms[0]); + g_value_unset (¶ms[1]); + + return result; +} + +static void +fd_source_closure_marshal (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + GFDSourceFunc callback; + GCClosure *cc = (GCClosure*) closure; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 0); + + callback = (GFDSourceFunc) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (g_value_get_int (param_values), + g_value_get_flags (param_values + 1), + closure->data); + + g_value_set_boolean (return_value, v_return); } static GSourceFuncs fd_source_funcs = { fd_source_prepare, fd_source_check, fd_source_dispatch, - fd_source_finalize + fd_source_finalize, + (GSourceFunc)fd_source_closure_callback, + (GSourceDummyMarshal)fd_source_closure_marshal, }; -/* Might be called on another thread */ -static void -fd_source_cancelled_cb (GCancellable *cancellable, - gpointer data) -{ - /* Wake up the mainloop in case we're waiting on async calls with FDSource */ - g_main_context_wakeup (NULL); -} - GSource * -_g_fd_source_new_with_object (GObject *object, - int fd, - gushort events, - GCancellable *cancellable) +_g_fd_source_new (int fd, + gushort events, + GCancellable *cancellable) { GSource *source; FDSource *fd_source; @@ -131,29 +153,18 @@ _g_fd_source_new_with_object (GObject *object, source = g_source_new (&fd_source_funcs, sizeof (FDSource)); fd_source = (FDSource *)source; - if (cancellable) - fd_source->cancellable = g_object_ref (cancellable); - - if (object) - fd_source->object = g_object_ref (object); - fd_source->pollfd.fd = fd; fd_source->pollfd.events = events; g_source_add_poll (source, &fd_source->pollfd); if (cancellable) - fd_source->cancelled_tag = - g_cancellable_connect (cancellable, - (GCallback)fd_source_cancelled_cb, - NULL, NULL); + { + GSource *cancellable_source = g_cancellable_source_new (cancellable); - return source; -} + g_source_set_dummy_callback (cancellable_source); + g_source_add_child_source (source, cancellable_source); + g_source_unref (cancellable_source); + } -GSource * -_g_fd_source_new (int fd, - gushort events, - GCancellable *cancellable) -{ - return _g_fd_source_new_with_object (NULL, fd, events, cancellable); + return source; } diff --git a/gio/gasynchelper.h b/gio/gasynchelper.h index e95b405..cd6d282 100644 --- a/gio/gasynchelper.h +++ b/gio/gasynchelper.h @@ -24,37 +24,16 @@ #define __G_ASYNC_HELPER_H__ #include -#include G_BEGIN_DECLS -typedef struct -{ - gpointer async_object; - GError * error; - gpointer user_data; -} GAsyncResultData; - -typedef gboolean (*GFDSourceFunc) (gpointer user_data, +typedef gboolean (*GFDSourceFunc) (int fd, GIOCondition condition, - int fd); -typedef gboolean (*GFDSourceObjectFunc) (GObject *object, - GIOCondition condition, - gpointer user_data); - -void _g_queue_async_result (GAsyncResultData *result, - gpointer async_object, - GError *error, - gpointer user_data, - GSourceFunc source_func); + gpointer user_data); -GSource *_g_fd_source_new_with_object (GObject *object, - int fd, - gushort events, - GCancellable *cancellable); -GSource *_g_fd_source_new (int fd, - gushort events, - GCancellable *cancellable); +GSource *_g_fd_source_new (int fd, + gushort events, + GCancellable *cancellable); G_END_DECLS diff --git a/gio/gasyncinitable.c b/gio/gasyncinitable.c index c369a4e..e0e756f 100644 --- a/gio/gasyncinitable.c +++ b/gio/gasyncinitable.c @@ -26,7 +26,6 @@ #include "gsimpleasyncresult.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gasyncinitable @@ -46,9 +45,102 @@ * directly, or indirectly via a foo_thing_new_async() wrapper. This will call * g_async_initable_init_async() under the cover, calling back with %NULL and * a set %GError on failure. + * + * A typical implementation might look something like this: + * + * |[ + * enum { + * NOT_INITIALIZED, + * INITIALIZING, + * INITIALIZED + * }; + * + * static void + * _foo_ready_cb (Foo *self) + * { + * GList *l; + * + * self->priv->state = INITIALIZED; + * + * for (l = self->priv->init_results; l != NULL; l = l->next) + * { + * GSimpleAsyncResult *simple = l->data; + * + * if (!self->priv->success) + * g_simple_async_result_set_error (simple, ...); + * + * g_simple_async_result_complete (simple); + * g_object_unref (simple); + * } + * + * g_list_free (self->priv->init_results); + * self->priv->init_results = NULL; + * } + * + * static void + * foo_init_async (GAsyncInitable *initable, + * int io_priority, + * GCancellable *cancellable, + * GAsyncReadyCallback callback, + * gpointer user_data) + * { + * Foo *self = FOO (initable); + * GSimpleAsyncResult *simple; + * + * simple = g_simple_async_result_new (G_OBJECT (initable) + * callback, + * user_data, + * foo_init_async); + * + * switch (self->priv->state) + * { + * case NOT_INITIALIZED: + * _foo_get_ready (self); + * self->priv->init_results = g_list_append (self->priv->init_results, + * simple); + * self->priv->state = INITIALIZING; + * break; + * case INITIALIZING: + * self->priv->init_results = g_list_append (self->priv->init_results, + * simple); + * break; + * case INITIALIZED: + * if (!self->priv->success) + * g_simple_async_result_set_error (simple, ...); + * + * g_simple_async_result_complete_in_idle (simple); + * g_object_unref (simple); + * break; + * } + * } + * + * static gboolean + * foo_init_finish (GAsyncInitable *initable, + * GAsyncResult *result, + * GError **error) + * { + * g_return_val_if_fail (g_simple_async_result_is_valid (result, + * G_OBJECT (initable), foo_init_async), FALSE); + * + * if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), + * error)) + * return FALSE; + * + * return TRUE; + * } + * + * static void + * foo_async_initable_iface_init (gpointer g_iface, + * gpointer data) + * { + * GAsyncInitableIface *iface = g_iface; + * + * iface->init_async = foo_init_async; + * iface->init_finish = foo_init_finish; + * } + * ]| */ -static void g_async_initable_base_init (gpointer g_iface); static void g_async_initable_real_init_async (GAsyncInitable *initable, int io_priority, GCancellable *cancellable, @@ -58,42 +150,14 @@ static gboolean g_async_initable_real_init_finish (GAsyncInitable *initabl GAsyncResult *res, GError **error); -GType -g_async_initable_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - if (g_once_init_enter (&g_define_type_id__volatile)) - { - const GTypeInfo initable_info = - { - sizeof (GAsyncInitableIface), /* class_size */ - g_async_initable_base_init, /* base_init */ - NULL, /* base_finalize */ - NULL, - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL - }; - GType g_define_type_id = - g_type_register_static (G_TYPE_INTERFACE, I_("GAsyncInitable"), - &initable_info, 0); - - g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT); - - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } +typedef GAsyncInitableIface GAsyncInitableInterface; +G_DEFINE_INTERFACE (GAsyncInitable, g_async_initable, G_TYPE_OBJECT) - return g_define_type_id__volatile; -} static void -g_async_initable_base_init (gpointer g_iface) +g_async_initable_default_init (GAsyncInitableInterface *iface) { - GAsyncInitableIface *iface = g_iface; - iface->init_async = g_async_initable_real_init_async; iface->init_finish = g_async_initable_real_init_finish; } @@ -202,10 +266,7 @@ async_init_thread (GSimpleAsyncResult *res, GError *error = NULL; if (!g_initable_init (G_INITABLE (object), cancellable, &error)) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } static void @@ -373,7 +434,7 @@ g_async_initable_new_valist_async (GType object_type, * Finishes the async construction for the various g_async_initable_new calls, * returning the created object or %NULL on error. * - * Returns: a newly created #GObject, or %NULL on error. Free with + * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with * g_object_unref(). * * Since: 2.22 @@ -388,6 +449,3 @@ g_async_initable_new_finish (GAsyncInitable *initable, else return NULL; } - -#define __G_ASYNC_INITABLE_C__ -#include "gioaliasdef.c" diff --git a/gio/gasyncresult.c b/gio/gasyncresult.c index 5af2792..aec48d6 100644 --- a/gio/gasyncresult.c +++ b/gio/gasyncresult.c @@ -24,7 +24,6 @@ #include "gasyncresult.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gasyncresult @@ -123,7 +122,7 @@ g_async_result_default_init (GAsyncResultInterface *iface) * * Gets the user data from a #GAsyncResult. * - * Returns: the user data for @res. + * Returns: (transfer full): the user data for @res. **/ gpointer g_async_result_get_user_data (GAsyncResult *res) @@ -143,7 +142,7 @@ g_async_result_get_user_data (GAsyncResult *res) * * Gets the source object from a #GAsyncResult. * - * Returns: a new reference to the source object for the @res, + * Returns: (transfer full): a new reference to the source object for the @res, * or %NULL if there is none. */ GObject * @@ -157,6 +156,3 @@ g_async_result_get_source_object (GAsyncResult *res) return (* iface->get_source_object) (res); } - -#define __G_ASYNC_RESULT_C__ -#include "gioaliasdef.c" diff --git a/gio/gbufferedinputstream.c b/gio/gbufferedinputstream.c index 50b5d8e..f79787c 100644 --- a/gio/gbufferedinputstream.c +++ b/gio/gbufferedinputstream.c @@ -1,5 +1,5 @@ /* GIO - GLib Input, Output and Streaming Library - * + * * Copyright (C) 2006-2007 Red Hat, Inc. * Copyright (C) 2007 Jürg Billeter * @@ -18,7 +18,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * - * Author: Christian Kellner + * Author: Christian Kellner */ #include "config.h" @@ -31,31 +31,28 @@ #include #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gbufferedinputstream * @short_description: Buffered Input Stream * @include: gio/gio.h * @see_also: #GFilterInputStream, #GInputStream - * - * Buffered input stream implements #GFilterInputStream and provides - * for buffered reads. - * + * + * Buffered input stream implements #GFilterInputStream and provides + * for buffered reads. + * * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes. - * - * To create a buffered input stream, use g_buffered_input_stream_new(), - * or g_buffered_input_stream_new_sized() to specify the buffer's size at + * + * To create a buffered input stream, use g_buffered_input_stream_new(), + * or g_buffered_input_stream_new_sized() to specify the buffer's size at * construction. - * - * To get the size of a buffer within a buffered input stream, use - * g_buffered_input_stream_get_buffer_size(). To change the size of a + * + * To get the size of a buffer within a buffered input stream, use + * g_buffered_input_stream_get_buffer_size(). To change the size of a * buffered input stream's buffer, use - * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size + * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size * cannot be reduced below the size of the data within the buffer. - * - **/ - + */ #define DEFAULT_BUFFER_SIZE 4096 @@ -86,46 +83,46 @@ static void g_buffered_input_stream_finalize (GObject *object); static gssize g_buffered_input_stream_skip (GInputStream *stream, - gsize count, - GCancellable *cancellable, - GError **error); + gsize count, + GCancellable *cancellable, + GError **error); static void g_buffered_input_stream_skip_async (GInputStream *stream, - gsize count, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); + gsize count, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); static gssize g_buffered_input_stream_skip_finish (GInputStream *stream, - GAsyncResult *result, - GError **error); + GAsyncResult *result, + GError **error); static gssize g_buffered_input_stream_read (GInputStream *stream, - void *buffer, - gsize count, - GCancellable *cancellable, - GError **error); + void *buffer, + gsize count, + GCancellable *cancellable, + GError **error); static void g_buffered_input_stream_read_async (GInputStream *stream, - void *buffer, - gsize count, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); + void *buffer, + gsize count, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); static gssize g_buffered_input_stream_read_finish (GInputStream *stream, - GAsyncResult *result, - GError **error); + GAsyncResult *result, + GError **error); static gssize g_buffered_input_stream_real_fill (GBufferedInputStream *stream, - gssize count, - GCancellable *cancellable, - GError **error); + gssize count, + GCancellable *cancellable, + GError **error); static void g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream, - gssize count, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); + gssize count, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); static gssize g_buffered_input_stream_real_fill_finish (GBufferedInputStream *stream, - GAsyncResult *result, - GError **error); + GAsyncResult *result, + GError **error); static void compact_buffer (GBufferedInputStream *stream); @@ -160,7 +157,7 @@ g_buffered_input_stream_class_init (GBufferedInputStreamClass *klass) bstream_class->fill = g_buffered_input_stream_real_fill; bstream_class->fill_async = g_buffered_input_stream_real_fill_async; bstream_class->fill_finish = g_buffered_input_stream_real_fill_finish; - + g_object_class_install_property (object_class, PROP_BUFSIZE, g_param_spec_uint ("buffer-size", @@ -177,12 +174,12 @@ g_buffered_input_stream_class_init (GBufferedInputStreamClass *klass) /** * g_buffered_input_stream_get_buffer_size: - * @stream: #GBufferedInputStream. - * + * @stream: a #GBufferedInputStream + * * Gets the size of the input buffer. - * + * * Returns: the current buffer size. - **/ + */ gsize g_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream) { @@ -193,21 +190,21 @@ g_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream) /** * g_buffered_input_stream_set_buffer_size: - * @stream: #GBufferedInputStream. - * @size: a #gsize. + * @stream: a #GBufferedInputStream + * @size: a #gsize * - * Sets the size of the internal buffer of @stream to @size, or to the - * size of the contents of the buffer. The buffer can never be resized + * Sets the size of the internal buffer of @stream to @size, or to the + * size of the contents of the buffer. The buffer can never be resized * smaller than its current contents. - **/ + */ void -g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream, - gsize size) +g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream, + gsize size) { GBufferedInputStreamPrivate *priv; gsize in_buffer; guint8 *buffer; - + g_return_if_fail (G_IS_BUFFERED_INPUT_STREAM (stream)); priv = stream->priv; @@ -261,7 +258,6 @@ g_buffered_input_stream_set_property (GObject *object, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } - } static void @@ -277,7 +273,7 @@ g_buffered_input_stream_get_property (GObject *object, priv = bstream->priv; switch (prop_id) - { + { case PROP_BUFSIZE: g_value_set_uint (value, priv->len); break; @@ -313,13 +309,13 @@ g_buffered_input_stream_init (GBufferedInputStream *stream) /** * g_buffered_input_stream_new: - * @base_stream: a #GInputStream. - * - * Creates a new #GInputStream from the given @base_stream, with + * @base_stream: a #GInputStream + * + * Creates a new #GInputStream from the given @base_stream, with * a buffer set to the default size (4 kilobytes). * * Returns: a #GInputStream for the given @base_stream. - **/ + */ GInputStream * g_buffered_input_stream_new (GInputStream *base_stream) { @@ -336,14 +332,14 @@ g_buffered_input_stream_new (GInputStream *base_stream) /** * g_buffered_input_stream_new_sized: - * @base_stream: a #GInputStream. - * @size: a #gsize. - * - * Creates a new #GBufferedInputStream from the given @base_stream, + * @base_stream: a #GInputStream + * @size: a #gsize + * + * Creates a new #GBufferedInputStream from the given @base_stream, * with a buffer set to @size. * * Returns: a #GInputStream. - **/ + */ GInputStream * g_buffered_input_stream_new_sized (GInputStream *base_stream, gsize size) @@ -362,14 +358,14 @@ g_buffered_input_stream_new_sized (GInputStream *base_stream, /** * g_buffered_input_stream_fill: - * @stream: #GBufferedInputStream. - * @count: the number of bytes that will be read from the stream. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @error: location to store the error occuring, or %NULL to ignore. + * @stream: a #GBufferedInputStream + * @count: the number of bytes that will be read from the stream + * @cancellable: optional #GCancellable object, %NULL to ignore + * @error: location to store the error occuring, or %NULL to ignore * - * Tries to read @count bytes from the stream into the buffer. + * Tries to read @count bytes from the stream into the buffer. * Will block during this read. - * + * * If @count is zero, returns zero and does nothing. A value of @count * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. * @@ -388,13 +384,13 @@ g_buffered_input_stream_new_sized (GInputStream *base_stream, * partial result will be returned, without an error. * * On error -1 is returned and @error is set accordingly. - * - * For the asynchronous, non-blocking, version of this function, see + * + * For the asynchronous, non-blocking, version of this function, see * g_buffered_input_stream_fill_async(). * - * Returns: the number of bytes read into @stream's buffer, up to @count, + * Returns: the number of bytes read into @stream's buffer, up to @count, * or -1 on error. - **/ + */ gssize g_buffered_input_stream_fill (GBufferedInputStream *stream, gssize count, @@ -406,9 +402,9 @@ g_buffered_input_stream_fill (GBufferedInputStream *stream, gssize res; g_return_val_if_fail (G_IS_BUFFERED_INPUT_STREAM (stream), -1); - + input_stream = G_INPUT_STREAM (stream); - + if (count < -1) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, @@ -421,15 +417,15 @@ g_buffered_input_stream_fill (GBufferedInputStream *stream, if (cancellable) g_cancellable_push_current (cancellable); - + class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); res = class->fill (stream, count, cancellable, error); if (cancellable) g_cancellable_pop_current (cancellable); - + g_input_stream_clear_pending (input_stream); - + return res; } @@ -447,13 +443,13 @@ async_fill_callback_wrapper (GObject *source_object, /** * g_buffered_input_stream_fill_async: - * @stream: #GBufferedInputStream. - * @count: the number of bytes that will be read from the stream. - * @io_priority: the I/O priority - * of the request. + * @stream: a #GBufferedInputStream + * @count: the number of bytes that will be read from the stream + * @io_priority: the I/O priority + * of the request * @cancellable: optional #GCancellable object - * @callback: a #GAsyncReadyCallback. - * @user_data: a #gpointer. + * @callback: a #GAsyncReadyCallback + * @user_data: a #gpointer * * Reads data into @stream's buffer asynchronously, up to @count size. * @io_priority can be used to prioritize reads. For the synchronous @@ -461,7 +457,7 @@ async_fill_callback_wrapper (GObject *source_object, * * If @count is -1 then the attempted read size is equal to the number * of bytes that are required to fill the buffer. - **/ + */ void g_buffered_input_stream_fill_async (GBufferedInputStream *stream, gssize count, @@ -479,37 +475,36 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream, if (count == 0) { simple = g_simple_async_result_new (G_OBJECT (stream), - callback, - user_data, - g_buffered_input_stream_fill_async); + callback, + user_data, + g_buffered_input_stream_fill_async); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); return; } - + if (count < -1) { g_simple_async_report_error_in_idle (G_OBJECT (stream), - callback, - user_data, - G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Too large count value passed to %s"), - G_STRFUNC); + callback, + user_data, + G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Too large count value passed to %s"), + G_STRFUNC); return; } - + if (!g_input_stream_set_pending (G_INPUT_STREAM (stream), &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), - callback, - user_data, - error); - g_error_free (error); + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), + callback, + user_data, + error); return; } - + class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); - + stream->priv->outstanding_callback = callback; g_object_ref (stream); class->fill_async (stream, count, io_priority, cancellable, @@ -518,14 +513,14 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream, /** * g_buffered_input_stream_fill_finish: - * @stream: a #GBufferedInputStream. - * @result: a #GAsyncResult. - * @error: a #GError. + * @stream: a #GBufferedInputStream + * @result: a #GAsyncResult + * @error: a #GError * * Finishes an asynchronous read. - * - * Returns: a #gssize of the read stream, or %-1 on an error. - **/ + * + * Returns: a #gssize of the read stream, or %-1 on an error. + */ gssize g_buffered_input_stream_fill_finish (GBufferedInputStream *stream, GAsyncResult *result, @@ -554,12 +549,12 @@ g_buffered_input_stream_fill_finish (GBufferedInputStream *stream, /** * g_buffered_input_stream_get_available: - * @stream: #GBufferedInputStream. - * + * @stream: #GBufferedInputStream + * * Gets the size of the available data within the stream. - * - * Returns: size of the available stream. - **/ + * + * Returns: size of the available stream. + */ gsize g_buffered_input_stream_get_available (GBufferedInputStream *stream) { @@ -570,16 +565,16 @@ g_buffered_input_stream_get_available (GBufferedInputStream *stream) /** * g_buffered_input_stream_peek: - * @stream: a #GBufferedInputStream. - * @buffer: a pointer to an allocated chunk of memory. - * @offset: a #gsize. - * @count: a #gsize. - * - * Peeks in the buffer, copying data of size @count into @buffer, + * @stream: a #GBufferedInputStream + * @buffer: a pointer to an allocated chunk of memory + * @offset: a #gsize + * @count: a #gsize + * + * Peeks in the buffer, copying data of size @count into @buffer, * offset @offset bytes. - * - * Returns: a #gsize of the number of bytes peeked, or %-1 on error. - **/ + * + * Returns: a #gsize of the number of bytes peeked, or -1 on error. + */ gsize g_buffered_input_stream_peek (GBufferedInputStream *stream, void *buffer, @@ -588,7 +583,7 @@ g_buffered_input_stream_peek (GBufferedInputStream *stream, { gsize available; gsize end; - + g_return_val_if_fail (G_IS_BUFFERED_INPUT_STREAM (stream), -1); g_return_val_if_fail (buffer != NULL, -1); @@ -596,25 +591,25 @@ g_buffered_input_stream_peek (GBufferedInputStream *stream, if (offset > available) return 0; - + end = MIN (offset + count, available); count = end - offset; - + memcpy (buffer, stream->priv->buffer + stream->priv->pos + offset, count); return count; } /** * g_buffered_input_stream_peek_buffer: - * @stream: a #GBufferedInputStream. - * @count: a #gsize to get the number of bytes available in the buffer. + * @stream: a #GBufferedInputStream + * @count: a #gsize to get the number of bytes available in the buffer * * Returns the buffer with the currently available bytes. The returned * buffer must not be modified and will become invalid when reading from * the stream or filling the buffer. * * Returns: read-only buffer - **/ + */ const void* g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream, gsize *count) @@ -625,7 +620,7 @@ g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream, priv = stream->priv; - if (count) + if (count) *count = priv->end - priv->pos; return priv->buffer + priv->pos; @@ -640,9 +635,9 @@ compact_buffer (GBufferedInputStream *stream) priv = stream->priv; current_size = priv->end - priv->pos; - + g_memmove (priv->buffer, priv->buffer + priv->pos, current_size); - + priv->pos = 0; priv->end = current_size; } @@ -662,7 +657,7 @@ g_buffered_input_stream_real_fill (GBufferedInputStream *stream, if (count == -1) count = priv->len; - + in_buffer = priv->end - priv->pos; /* Never fill more than can fit in the buffer */ @@ -681,7 +676,7 @@ g_buffered_input_stream_real_fill (GBufferedInputStream *stream, if (nread > 0) priv->end += nread; - + return nread; } @@ -709,10 +704,10 @@ g_buffered_input_stream_skip (GInputStream *stream, return count; } - /* Full request not available, skip all currently available and - * request refill for more + /* Full request not available, skip all currently available and + * request refill for more */ - + priv->pos = 0; priv->end = 0; bytes_skipped = available; @@ -720,30 +715,30 @@ g_buffered_input_stream_skip (GInputStream *stream, if (bytes_skipped > 0) error = NULL; /* Ignore further errors if we already read some data */ - + if (count > priv->len) { /* Large request, shortcut buffer */ - + base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; nread = g_input_stream_skip (base_stream, count, cancellable, error); - + if (nread < 0 && bytes_skipped == 0) return -1; - + if (nread > 0) bytes_skipped += nread; - + return bytes_skipped; } - + class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); nread = class->fill (bstream, priv->len, cancellable, error); - + if (nread < 0) { if (bytes_skipped == 0) @@ -751,13 +746,13 @@ g_buffered_input_stream_skip (GInputStream *stream, else return bytes_skipped; } - + available = priv->end - priv->pos; count = MIN (count, available); - + bytes_skipped += count; priv->pos += count; - + return bytes_skipped; } @@ -786,9 +781,11 @@ g_buffered_input_stream_read (GInputStream *stream, priv->pos += count; return count; } - - /* Full request not available, read all currently availbile and request refill for more */ - + + /* Full request not available, read all currently available and + * request refill for more + */ + memcpy (buffer, priv->buffer + priv->pos, available); priv->pos = 0; priv->end = 0; @@ -797,28 +794,28 @@ g_buffered_input_stream_read (GInputStream *stream, if (bytes_read > 0) error = NULL; /* Ignore further errors if we already read some data */ - + if (count > priv->len) { /* Large request, shortcut buffer */ - + base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; nread = g_input_stream_read (base_stream, - (char *)buffer + bytes_read, - count, - cancellable, - error); - + (char *)buffer + bytes_read, + count, + cancellable, + error); + if (nread < 0 && bytes_read == 0) return -1; - + if (nread > 0) bytes_read += nread; - + return bytes_read; } - + class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); nread = class->fill (bstream, priv->len, cancellable, error); if (nread < 0) @@ -828,29 +825,29 @@ g_buffered_input_stream_read (GInputStream *stream, else return bytes_read; } - + available = priv->end - priv->pos; count = MIN (count, available); - + memcpy ((char *)buffer + bytes_read, (char *)priv->buffer + priv->pos, count); bytes_read += count; priv->pos += count; - + return bytes_read; } /** * g_buffered_input_stream_read_byte: - * @stream: #GBufferedInputStream. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @error: location to store the error occuring, or %NULL to ignore. + * @stream: a #GBufferedInputStream + * @cancellable: optional #GCancellable object, %NULL to ignore + * @error: location to store the error occuring, or %NULL to ignore * * Tries to read a single byte from the stream or the buffer. Will block * during this read. * * On success, the byte read from the stream is returned. On end of stream * -1 is returned but it's not an exceptional error and @error is not set. - * + * * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an @@ -858,9 +855,9 @@ g_buffered_input_stream_read (GInputStream *stream, * partial result will be returned, without an error. * * On error -1 is returned and @error is set accordingly. - * + * * Returns: the byte read from the @stream, or -1 on end of stream or error. - **/ + */ int g_buffered_input_stream_read_byte (GBufferedInputStream *stream, GCancellable *cancellable, @@ -931,16 +928,15 @@ fill_async_callback (GObject *source_object, GSimpleAsyncResult *simple; simple = user_data; - + error = NULL; res = g_input_stream_read_finish (G_INPUT_STREAM (source_object), - result, &error); + result, &error); g_simple_async_result_set_op_res_gssize (simple, res); if (res == -1) { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); + g_simple_async_result_take_error (simple, error); } else { @@ -955,8 +951,10 @@ fill_async_callback (GObject *source_object, g_object_unref (object); } - - /* Complete immediately, not in idle, since we're already in a mainloop callout */ + + /* Complete immediately, not in idle, since we're already + * in a mainloop callout + */ g_simple_async_result_complete (simple); g_object_unref (simple); } @@ -978,7 +976,7 @@ g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream, if (count == -1) count = priv->len; - + in_buffer = priv->end - priv->pos; /* Never fill more than can fit in the buffer */ @@ -989,41 +987,42 @@ g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream, compact_buffer (stream); simple = g_simple_async_result_new (G_OBJECT (stream), - callback, user_data, - g_buffered_input_stream_real_fill_async); - + callback, user_data, + g_buffered_input_stream_real_fill_async); + base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; g_input_stream_read_async (base_stream, - priv->buffer + priv->end, - count, - io_priority, - cancellable, - fill_async_callback, - simple); + priv->buffer + priv->end, + count, + io_priority, + cancellable, + fill_async_callback, + simple); } static gssize g_buffered_input_stream_real_fill_finish (GBufferedInputStream *stream, - GAsyncResult *result, - GError **error) + GAsyncResult *result, + GError **error) { GSimpleAsyncResult *simple; gssize nread; simple = G_SIMPLE_ASYNC_RESULT (result); g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_real_fill_async); - + nread = g_simple_async_result_get_op_res_gssize (simple); return nread; } -typedef struct { +typedef struct +{ gssize bytes_read; gssize count; void *buffer; } ReadAsyncData; -static void +static void free_read_async_data (gpointer _data) { ReadAsyncData *data = _data; @@ -1032,8 +1031,8 @@ free_read_async_data (gpointer _data) static void large_read_callback (GObject *source_object, - GAsyncResult *result, - gpointer user_data) + GAsyncResult *result, + gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); ReadAsyncData *data; @@ -1041,30 +1040,31 @@ large_read_callback (GObject *source_object, gssize nread; data = g_simple_async_result_get_op_res_gpointer (simple); - + error = NULL; nread = g_input_stream_read_finish (G_INPUT_STREAM (source_object), - result, &error); + result, &error); /* Only report the error if we've not already read some data */ if (nread < 0 && data->bytes_read == 0) - g_simple_async_result_set_from_error (simple, error); - + g_simple_async_result_take_error (simple, error); + else if (error) + g_error_free (error); + if (nread > 0) data->bytes_read += nread; - - if (error) - g_error_free (error); - - /* Complete immediately, not in idle, since we're already in a mainloop callout */ + + /* Complete immediately, not in idle, since we're already + * in a mainloop callout + */ g_simple_async_result_complete (simple); g_object_unref (simple); } static void -read_fill_buffer_callback (GObject *source_object, - GAsyncResult *result, - gpointer user_data) +read_fill_buffer_callback (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); GBufferedInputStream *bstream; @@ -1076,43 +1076,43 @@ read_fill_buffer_callback (GObject *source_object, bstream = G_BUFFERED_INPUT_STREAM (source_object); priv = bstream->priv; - + data = g_simple_async_result_get_op_res_gpointer (simple); - + error = NULL; nread = g_buffered_input_stream_fill_finish (bstream, - result, &error); - - if (nread < 0 && data->bytes_read == 0) - g_simple_async_result_set_from_error (simple, error); + result, &error); + if (nread < 0 && data->bytes_read == 0) + g_simple_async_result_take_error (simple, error); + else if (error) + g_error_free (error); if (nread > 0) { available = priv->end - priv->pos; data->count = MIN (data->count, available); - + memcpy ((char *)data->buffer + data->bytes_read, (char *)priv->buffer + priv->pos, data->count); data->bytes_read += data->count; priv->pos += data->count; } - if (error) - g_error_free (error); - - /* Complete immediately, not in idle, since we're already in a mainloop callout */ + /* Complete immediately, not in idle, since we're already + * in a mainloop callout + */ g_simple_async_result_complete (simple); g_object_unref (simple); } static void -g_buffered_input_stream_read_async (GInputStream *stream, - void *buffer, - gsize count, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +g_buffered_input_stream_read_async (GInputStream *stream, + void *buffer, + gsize count, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { GBufferedInputStream *bstream; GBufferedInputStreamPrivate *priv; @@ -1129,53 +1129,55 @@ g_buffered_input_stream_read_async (GInputStream *stream, data->buffer = buffer; data->bytes_read = 0; simple = g_simple_async_result_new (G_OBJECT (stream), - callback, user_data, - g_buffered_input_stream_read_async); + callback, user_data, + g_buffered_input_stream_read_async); g_simple_async_result_set_op_res_gpointer (simple, data, free_read_async_data); - + available = priv->end - priv->pos; - + if (count <= available) { memcpy (buffer, priv->buffer + priv->pos, count); priv->pos += count; data->bytes_read = count; - + g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); return; } - /* Full request not available, read all currently availbile and request refill for more */ - + /* Full request not available, read all currently available + * and request refill for more + */ + memcpy (buffer, priv->buffer + priv->pos, available); priv->pos = 0; priv->end = 0; - + count -= available; - + data->bytes_read = available; data->count = count; if (count > priv->len) { /* Large request, shortcut buffer */ - + base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; - + g_input_stream_read_async (base_stream, - (char *)buffer + data->bytes_read, - count, - io_priority, cancellable, - large_read_callback, - simple); + (char *)buffer + data->bytes_read, + count, + io_priority, cancellable, + large_read_callback, + simple); } else { class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); class->fill_async (bstream, priv->len, io_priority, cancellable, - read_fill_buffer_callback, simple); + read_fill_buffer_callback, simple); } } @@ -1186,22 +1188,23 @@ g_buffered_input_stream_read_finish (GInputStream *stream, { GSimpleAsyncResult *simple; ReadAsyncData *data; - + simple = G_SIMPLE_ASYNC_RESULT (result); - + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_read_async); data = g_simple_async_result_get_op_res_gpointer (simple); - + return data->bytes_read; } -typedef struct { +typedef struct +{ gssize bytes_skipped; gssize count; } SkipAsyncData; -static void +static void free_skip_async_data (gpointer _data) { SkipAsyncData *data = _data; @@ -1209,9 +1212,9 @@ free_skip_async_data (gpointer _data) } static void -large_skip_callback (GObject *source_object, - GAsyncResult *result, - gpointer user_data) +large_skip_callback (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); SkipAsyncData *data; @@ -1219,30 +1222,31 @@ large_skip_callback (GObject *source_object, gssize nread; data = g_simple_async_result_get_op_res_gpointer (simple); - + error = NULL; nread = g_input_stream_skip_finish (G_INPUT_STREAM (source_object), - result, &error); + result, &error); /* Only report the error if we've not already read some data */ if (nread < 0 && data->bytes_skipped == 0) - g_simple_async_result_set_from_error (simple, error); - + g_simple_async_result_take_error (simple, error); + else if (error) + g_error_free (error); + if (nread > 0) data->bytes_skipped += nread; - - if (error) - g_error_free (error); - - /* Complete immediately, not in idle, since we're already in a mainloop callout */ + + /* Complete immediately, not in idle, since we're already + * in a mainloop callout + */ g_simple_async_result_complete (simple); g_object_unref (simple); } static void -skip_fill_buffer_callback (GObject *source_object, - GAsyncResult *result, - gpointer user_data) +skip_fill_buffer_callback (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); GBufferedInputStream *bstream; @@ -1254,41 +1258,41 @@ skip_fill_buffer_callback (GObject *source_object, bstream = G_BUFFERED_INPUT_STREAM (source_object); priv = bstream->priv; - + data = g_simple_async_result_get_op_res_gpointer (simple); - + error = NULL; nread = g_buffered_input_stream_fill_finish (bstream, - result, &error); - - if (nread < 0 && data->bytes_skipped == 0) - g_simple_async_result_set_from_error (simple, error); + result, &error); + if (nread < 0 && data->bytes_skipped == 0) + g_simple_async_result_take_error (simple, error); + else if (error) + g_error_free (error); if (nread > 0) { available = priv->end - priv->pos; data->count = MIN (data->count, available); - + data->bytes_skipped += data->count; priv->pos += data->count; } - if (error) - g_error_free (error); - - /* Complete immediately, not in idle, since we're already in a mainloop callout */ + /* Complete immediately, not in idle, since we're already + * in a mainloop callout + */ g_simple_async_result_complete (simple); g_object_unref (simple); } static void -g_buffered_input_stream_skip_async (GInputStream *stream, - gsize count, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +g_buffered_input_stream_skip_async (GInputStream *stream, + gsize count, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { GBufferedInputStream *bstream; GBufferedInputStreamPrivate *priv; @@ -1304,50 +1308,51 @@ g_buffered_input_stream_skip_async (GInputStream *stream, data = g_slice_new (SkipAsyncData); data->bytes_skipped = 0; simple = g_simple_async_result_new (G_OBJECT (stream), - callback, user_data, - g_buffered_input_stream_skip_async); + callback, user_data, + g_buffered_input_stream_skip_async); g_simple_async_result_set_op_res_gpointer (simple, data, free_skip_async_data); - + available = priv->end - priv->pos; - + if (count <= available) { priv->pos += count; data->bytes_skipped = count; - + g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); return; } + /* Full request not available, skip all currently available + * and request refill for more + */ - /* Full request not available, skip all currently availbile and request refill for more */ - priv->pos = 0; priv->end = 0; - + count -= available; - + data->bytes_skipped = available; data->count = count; if (count > priv->len) { /* Large request, shortcut buffer */ - + base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; - + g_input_stream_skip_async (base_stream, - count, - io_priority, cancellable, - large_skip_callback, - simple); + count, + io_priority, cancellable, + large_skip_callback, + simple); } else { class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); class->fill_async (bstream, priv->len, io_priority, cancellable, - skip_fill_buffer_callback, simple); + skip_fill_buffer_callback, simple); } } @@ -1358,16 +1363,12 @@ g_buffered_input_stream_skip_finish (GInputStream *stream, { GSimpleAsyncResult *simple; SkipAsyncData *data; - + simple = G_SIMPLE_ASYNC_RESULT (result); - + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_skip_async); data = g_simple_async_result_get_op_res_gpointer (simple); - + return data->bytes_skipped; } - - -#define __G_BUFFERED_INPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gbufferedoutputstream.c b/gio/gbufferedoutputstream.c index ec84a61..ffa8fbd 100644 --- a/gio/gbufferedoutputstream.c +++ b/gio/gbufferedoutputstream.c @@ -27,8 +27,6 @@ #include "string.h" #include "glibintl.h" -#include - /** * SECTION:gbufferedoutputstream * @short_description: Buffered Output Stream @@ -577,10 +575,7 @@ flush_buffer_thread (GSimpleAsyncResult *result, } if (res == FALSE) - { - g_simple_async_result_set_from_error (result, error); - g_error_free (error); - } + g_simple_async_result_take_error (result, error); } typedef struct { @@ -763,6 +758,3 @@ g_buffered_output_stream_close_finish (GOutputStream *stream, return TRUE; } - -#define __G_BUFFERED_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gbufferedoutputstream.h b/gio/gbufferedoutputstream.h index 106bca7..0d84790 100644 --- a/gio/gbufferedoutputstream.h +++ b/gio/gbufferedoutputstream.h @@ -40,7 +40,6 @@ G_BEGIN_DECLS /** * GBufferedOutputStream: - * @parent_class: The parent class. * * An implementation of #GFilterOutputStream with a sized buffer. **/ diff --git a/gio/gcancellable.c b/gio/gcancellable.c index 32d01ae..65e15bc 100644 --- a/gio/gcancellable.c +++ b/gio/gcancellable.c @@ -32,9 +32,9 @@ #include #endif #include "gcancellable.h" +#include "gio-marshal.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gcancellable @@ -334,7 +334,7 @@ g_cancellable_pop_current (GCancellable *cancellable) * * Gets the top cancellable from the stack. * - * Returns: a #GCancellable from the top of the stack, or %NULL + * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL * if the stack is empty. **/ GCancellable * @@ -579,6 +579,9 @@ g_cancellable_release_fd (GCancellable *cancellable) { GCancellablePrivate *priv; + if (cancellable == NULL) + return; + g_return_if_fail (G_IS_CANCELLABLE (cancellable)); g_return_if_fail (cancellable->priv->fd_refcount > 0); @@ -769,5 +772,117 @@ g_cancellable_disconnect (GCancellable *cancellable, G_UNLOCK (cancellable); } -#define __G_CANCELLABLE_C__ -#include "gioaliasdef.c" +typedef struct { + GSource source; + + GCancellable *cancellable; + GPollFD pollfd; +} GCancellableSource; + +static gboolean +cancellable_source_prepare (GSource *source, + gint *timeout) +{ + GCancellableSource *cancellable_source = (GCancellableSource *)source; + + *timeout = -1; + return g_cancellable_is_cancelled (cancellable_source->cancellable); +} + +static gboolean +cancellable_source_check (GSource *source) +{ + GCancellableSource *cancellable_source = (GCancellableSource *)source; + + return g_cancellable_is_cancelled (cancellable_source->cancellable); +} + +static gboolean +cancellable_source_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) +{ + GCancellableSourceFunc func = (GCancellableSourceFunc)callback; + GCancellableSource *cancellable_source = (GCancellableSource *)source; + + return (*func) (cancellable_source->cancellable, user_data); +} + +static void +cancellable_source_finalize (GSource *source) +{ + GCancellableSource *cancellable_source = (GCancellableSource *)source; + + if (cancellable_source->cancellable) + g_object_unref (cancellable_source->cancellable); +} + +static gboolean +cancellable_source_closure_callback (GCancellable *cancellable, + gpointer data) +{ + GClosure *closure = data; + + GValue params = { 0, }; + GValue result_value = { 0, }; + gboolean result; + + g_value_init (&result_value, G_TYPE_BOOLEAN); + + g_value_init (¶ms, G_TYPE_CANCELLABLE); + g_value_set_object (¶ms, cancellable); + + g_closure_invoke (closure, &result_value, 1, ¶ms, NULL); + + result = g_value_get_boolean (&result_value); + g_value_unset (&result_value); + g_value_unset (¶ms); + + return result; +} + +static GSourceFuncs cancellable_source_funcs = +{ + cancellable_source_prepare, + cancellable_source_check, + cancellable_source_dispatch, + cancellable_source_finalize, + (GSourceFunc)cancellable_source_closure_callback, + (GSourceDummyMarshal)_gio_marshal_BOOLEAN__VOID, +}; + +/** + * g_cancellable_source_new: + * @cancellable: a #GCancellable, or %NULL + * + * Creates a source that triggers if @cancellable is cancelled and + * calls its callback of type #GCancellableSourceFunc. This is + * primarily useful for attaching to another (non-cancellable) source + * with g_source_add_child_source() to add cancellability to it. + * + * For convenience, you can call this with a %NULL #GCancellable, + * in which case the source will never trigger. + * + * Return value: the new #GSource. + * + * Since: 2.28 + */ +GSource * +g_cancellable_source_new (GCancellable *cancellable) +{ + GSource *source; + GCancellableSource *cancellable_source; + + source = g_source_new (&cancellable_source_funcs, sizeof (GCancellableSource)); + g_source_set_name (source, "GCancellable"); + cancellable_source = (GCancellableSource *)source; + + if (g_cancellable_make_pollfd (cancellable, + &cancellable_source->pollfd)) + { + cancellable_source->cancellable = g_object_ref (cancellable); + g_source_add_poll (source, &cancellable_source->pollfd); + } + + return source; +} diff --git a/gio/gcancellable.h b/gio/gcancellable.h index dc73ccd..d8fa633 100644 --- a/gio/gcancellable.h +++ b/gio/gcancellable.h @@ -83,6 +83,8 @@ gboolean g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd); void g_cancellable_release_fd (GCancellable *cancellable); +GSource * g_cancellable_source_new (GCancellable *cancellable); + GCancellable *g_cancellable_get_current (void); void g_cancellable_push_current (GCancellable *cancellable); void g_cancellable_pop_current (GCancellable *cancellable); diff --git a/gio/gcharsetconverter.c b/gio/gcharsetconverter.c index 35b0a5a..3ec621f 100644 --- a/gio/gcharsetconverter.c +++ b/gio/gcharsetconverter.c @@ -22,16 +22,15 @@ #include "config.h" +#include "gcharsetconverter.h" + #include #include "gcontenttypeprivate.h" -#include "gcharsetconverter.h" -#include "glib.h" #include "ginitable.h" #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" enum { PROP_0, @@ -452,7 +451,7 @@ g_charset_converter_initable_init (GInitable *initable, conv->iconv = g_iconv_open (conv->to, conv->from); - if (conv->iconv == NULL) + if (conv->iconv == (GIConv)-1) { if (errno == EINVAL) g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, @@ -473,6 +472,3 @@ g_charset_converter_initable_iface_init (GInitableIface *iface) { iface->init = g_charset_converter_initable_init; } - -#define __G_CHARSET_CONVERTER_C__ -#include "gioaliasdef.c" diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c index 925b0a4..dfbe868 100644 --- a/gio/gcontenttype.c +++ b/gio/gcontenttype.c @@ -35,7 +35,6 @@ #include "gfileinfo.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gcontenttype @@ -54,7 +53,7 @@ static char * get_registry_classes_key (const char *subdir, - const wchar_t *key_name) + const wchar_t *key_name) { wchar_t *wc_key; HKEY reg_key = NULL; @@ -67,14 +66,14 @@ get_registry_classes_key (const char *subdir, nbytes = 0; wc_key = g_utf8_to_utf16 (subdir, -1, NULL, NULL, NULL); if (RegOpenKeyExW (HKEY_CLASSES_ROOT, wc_key, 0, - KEY_QUERY_VALUE, ®_key) == ERROR_SUCCESS && + KEY_QUERY_VALUE, ®_key) == ERROR_SUCCESS && RegQueryValueExW (reg_key, key_name, 0, - &key_type, NULL, &nbytes) == ERROR_SUCCESS && + &key_type, NULL, &nbytes) == ERROR_SUCCESS && (key_type == REG_SZ || key_type == REG_EXPAND_SZ)) { wchar_t *wc_temp = g_new (wchar_t, (nbytes+1)/2 + 1); RegQueryValueExW (reg_key, key_name, 0, - &key_type, (LPBYTE) wc_temp, &nbytes); + &key_type, (LPBYTE) wc_temp, &nbytes); wc_temp[nbytes/2] = '\0'; if (key_type == REG_EXPAND_SZ) { @@ -104,8 +103,8 @@ get_registry_classes_key (const char *subdir, } gboolean -g_content_type_equals (const char *type1, - const char *type2) +g_content_type_equals (const gchar *type1, + const gchar *type2) { char *progid1, *progid2; gboolean res; @@ -129,8 +128,8 @@ g_content_type_equals (const char *type1, } gboolean -g_content_type_is_a (const char *type, - const char *supertype) +g_content_type_is_a (const gchar *type, + const gchar *supertype) { gboolean res; char *value_utf8; @@ -151,15 +150,15 @@ g_content_type_is_a (const char *type, } gboolean -g_content_type_is_unknown (const char *type) +g_content_type_is_unknown (const gchar *type) { g_return_val_if_fail (type != NULL, FALSE); return strcmp ("*", type) == 0; } -char * -g_content_type_get_description (const char *type) +gchar * +g_content_type_get_description (const gchar *type) { char *progid; char *description; @@ -173,7 +172,7 @@ g_content_type_get_description (const char *type) g_free (progid); if (description) - return description; + return description; } if (g_content_type_is_unknown (type)) @@ -181,8 +180,8 @@ g_content_type_get_description (const char *type) return g_strdup_printf (_("%s filetype"), type); } -char * -g_content_type_get_mime_type (const char *type) +gchar * +g_content_type_get_mime_type (const gchar *type) { char *mime; @@ -204,7 +203,7 @@ G_LOCK_DEFINE_STATIC (_type_icons); static GHashTable *_type_icons = NULL; GIcon * -g_content_type_get_icon (const char *type) +g_content_type_get_icon (const gchar *type) { GIcon *themed_icon; char *name = NULL; @@ -229,16 +228,16 @@ g_content_type_get_icon (const char *type) key = g_strconcat (type+1, "file\\DefaultIcon", NULL); else { - gchar *key2 = g_strconcat (key, "\\DefaultIcon", NULL); - g_free (key); - key = key2; - } + gchar *key2 = g_strconcat (key, "\\DefaultIcon", NULL); + g_free (key); + key = key2; + } name = get_registry_classes_key (key, NULL); if (name && strcmp (name, "%1") == 0) { - g_free (name); - name = NULL; - } + g_free (name); + name = NULL; + } if (name) g_hash_table_insert (_type_icons, g_strdup (type), g_strdup (name)); g_free (key); @@ -253,7 +252,7 @@ g_content_type_get_icon (const char *type) { /* if not found an icon fall back to gtk-builtins */ name = strcmp (type, "inode/directory") == 0 ? "gtk-directory" : - g_content_type_can_be_executable (type) ? "gtk-execute" : "gtk-file"; + g_content_type_can_be_executable (type) ? "gtk-execute" : "gtk-file"; g_hash_table_insert (_type_icons, g_strdup (type), g_strdup (name)); themed_icon = g_themed_icon_new_with_default_fallbacks (name); } @@ -263,7 +262,7 @@ g_content_type_get_icon (const char *type) } gboolean -g_content_type_can_be_executable (const char *type) +g_content_type_can_be_executable (const gchar *type) { g_return_val_if_fail (type != NULL, FALSE); @@ -296,13 +295,13 @@ looks_like_text (const guchar *data, { c = data[i]; if (g_ascii_iscntrl (c) && !g_ascii_isspace (c) && c != '\b') - return FALSE; + return FALSE; } return TRUE; } -char * -g_content_type_from_mime_type (const char *mime_type) +gchar * +g_content_type_from_mime_type (const gchar *mime_type) { char *key, *content_type; @@ -315,11 +314,11 @@ g_content_type_from_mime_type (const char *mime_type) return content_type; } -char * -g_content_type_guess (const char *filename, - const guchar *data, - gsize data_size, - gboolean *result_uncertain) +gchar * +g_content_type_guess (const gchar *filename, + const guchar *data, + gsize data_size, + gboolean *result_uncertain) { char *basename; char *type; @@ -335,7 +334,7 @@ g_content_type_guess (const char *filename, basename = g_path_get_basename (filename); dot = strrchr (basename, '.'); if (dot) - type = g_strdup (dot); + type = g_strdup (dot); g_free (basename); } @@ -361,22 +360,22 @@ g_content_types_get_registered (void) index = 0; key_len = 256; while (RegEnumKeyExW(HKEY_CLASSES_ROOT, - index, - keyname, - &key_len, - NULL, - NULL, - NULL, - NULL) == ERROR_SUCCESS) + index, + keyname, + &key_len, + NULL, + NULL, + NULL, + NULL) == ERROR_SUCCESS) { key_utf8 = g_utf16_to_utf8 (keyname, -1, NULL, NULL, NULL); if (key_utf8) - { - if (*key_utf8 == '.') - types = g_list_prepend (types, key_utf8); - else - g_free (key_utf8); - } + { + if (*key_utf8 == '.') + types = g_list_prepend (types, key_utf8); + else + g_free (key_utf8); + } index++; key_len = 256; } @@ -384,7 +383,7 @@ g_content_types_get_registered (void) return g_list_reverse (types); } -char ** +gchar ** g_content_type_guess_for_tree (GFile *root) { /* FIXME: implement */ @@ -413,111 +412,111 @@ _g_unix_content_type_get_sniff_len (void) return size; } -char * -_g_unix_content_type_unalias (const char *type) +gchar * +_g_unix_content_type_unalias (const gchar *type) { - char *res; - + gchar *res; + G_LOCK (gio_xdgmime); res = g_strdup (xdg_mime_unalias_mime_type (type)); G_UNLOCK (gio_xdgmime); - + return res; } -char ** -_g_unix_content_type_get_parents (const char *type) +gchar ** +_g_unix_content_type_get_parents (const gchar *type) { - const char *umime; - char **parents; + const gchar *umime; + gchar **parents; GPtrArray *array; int i; array = g_ptr_array_new (); - + G_LOCK (gio_xdgmime); - + umime = xdg_mime_unalias_mime_type (type); - + g_ptr_array_add (array, g_strdup (umime)); - + parents = xdg_mime_list_mime_parents (umime); for (i = 0; parents && parents[i] != NULL; i++) g_ptr_array_add (array, g_strdup (parents[i])); - + free (parents); - + G_UNLOCK (gio_xdgmime); - + g_ptr_array_add (array, NULL); - - return (char **)g_ptr_array_free (array, FALSE); + + return (gchar **)g_ptr_array_free (array, FALSE); } /** * g_content_type_equals: - * @type1: a content type string. - * @type2: a content type string. + * @type1: a content type string + * @type2: a content type string * * Compares two content types for equality. * * Returns: %TRUE if the two strings are identical or equivalent, - * %FALSE otherwise. - **/ + * %FALSE otherwise. + */ gboolean -g_content_type_equals (const char *type1, - const char *type2) +g_content_type_equals (const gchar *type1, + const gchar *type2) { gboolean res; - + g_return_val_if_fail (type1 != NULL, FALSE); g_return_val_if_fail (type2 != NULL, FALSE); - + G_LOCK (gio_xdgmime); res = xdg_mime_mime_type_equal (type1, type2); G_UNLOCK (gio_xdgmime); - + return res; } /** * g_content_type_is_a: - * @type: a content type string. - * @supertype: a string. + * @type: a content type string + * @supertype: a content type string * - * Determines if @type is a subset of @supertype. + * Determines if @type is a subset of @supertype. * * Returns: %TRUE if @type is a kind of @supertype, - * %FALSE otherwise. - **/ + * %FALSE otherwise. + */ gboolean -g_content_type_is_a (const char *type, - const char *supertype) +g_content_type_is_a (const gchar *type, + const gchar *supertype) { gboolean res; - + g_return_val_if_fail (type != NULL, FALSE); g_return_val_if_fail (supertype != NULL, FALSE); - + G_LOCK (gio_xdgmime); res = xdg_mime_mime_type_subclass (type, supertype); G_UNLOCK (gio_xdgmime); - + return res; } /** * g_content_type_is_unknown: - * @type: a content type string. - * + * @type: a content type string + * * Checks if the content type is the generic "unknown" type. - * On unix this is the "application/octet-stream" mimetype, + * On UNIX this is the "application/octet-stream" mimetype, * while on win32 it is "*". - * + * * Returns: %TRUE if the type is the unknown type. - **/ + */ gboolean -g_content_type_is_unknown (const char *type) +g_content_type_is_unknown (const gchar *type) { g_return_val_if_fail (type != NULL, FALSE); @@ -543,65 +542,64 @@ language_level (const char *lang) { const char * const *lang_list; int i; - + /* The returned list is sorted from most desirable to least desirable and always contains the default locale "C". */ lang_list = g_get_language_names (); - + for (i = 0; lang_list[i]; i++) if (strcmp (lang_list[i], lang) == 0) return 1000-i; - + return 0; } static void mime_info_start_element (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - gpointer user_data, - GError **error) + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **error) { int i; const char *lang; MimeParser *parser = user_data; - + if (strcmp (element_name, "comment") == 0) { lang = "C"; for (i = 0; attribute_names[i]; i++) - if (strcmp (attribute_names[i], "xml:lang") == 0) - { - lang = attribute_values[i]; - break; - } - + if (strcmp (attribute_names[i], "xml:lang") == 0) + { + lang = attribute_values[i]; + break; + } + parser->current_lang_level = language_level (lang); parser->current_type = MIME_TAG_TYPE_COMMENT; } else parser->current_type = MIME_TAG_TYPE_OTHER; - } static void mime_info_end_element (GMarkupParseContext *context, - const gchar *element_name, - gpointer user_data, - GError **error) + const gchar *element_name, + gpointer user_data, + GError **error) { MimeParser *parser = user_data; - + parser->current_type = MIME_TAG_TYPE_OTHER; } static void mime_info_text (GMarkupParseContext *context, - const gchar *text, - gsize text_len, - gpointer user_data, - GError **error) + const gchar *text, + gsize text_len, + gpointer user_data, + GError **error) { MimeParser *parser = user_data; @@ -615,7 +613,7 @@ mime_info_text (GMarkupParseContext *context, } static char * -load_comment_for_mime_helper (const char *dir, +load_comment_for_mime_helper (const char *dir, const char *basename) { GMarkupParseContext *context; @@ -630,17 +628,17 @@ load_comment_for_mime_helper (const char *dir, }; filename = g_build_filename (dir, "mime", basename, NULL); - + res = g_file_get_contents (filename, &data, &len, NULL); g_free (filename); if (!res) return NULL; - + context = g_markup_parse_context_new (&parser, 0, &parse_data, NULL); res = g_markup_parse_context_parse (context, data, len, NULL); g_free (data); g_markup_parse_context_free (context); - + if (!res) return NULL; @@ -664,39 +662,40 @@ load_comment_for_mime (const char *mimetype) g_free (basename); return comment; } - + dirs = g_get_system_data_dirs (); for (i = 0; dirs[i] != NULL; i++) { comment = load_comment_for_mime_helper (dirs[i], basename); if (comment) - { - g_free (basename); - return comment; - } + { + g_free (basename); + return comment; + } } g_free (basename); - + return g_strdup_printf (_("%s type"), mimetype); } /** * g_content_type_get_description: - * @type: a content type string. - * + * @type: a content type string + * * Gets the human readable description of the content type. - * - * Returns: a short description of the content type @type. - **/ -char * -g_content_type_get_description (const char *type) + * + * Returns: a short description of the content type @type. Free the + * returned string with g_free() + */ +gchar * +g_content_type_get_description (const gchar *type) { static GHashTable *type_comment_cache = NULL; - char *comment; + gchar *comment; g_return_val_if_fail (type != NULL, NULL); - + G_LOCK (gio_xdgmime); type = xdg_mime_unalias_mime_type (type); @@ -706,16 +705,16 @@ g_content_type_get_description (const char *type) comment = g_hash_table_lookup (type_comment_cache, type); comment = g_strdup (comment); G_UNLOCK (gio_xdgmime); - + if (comment != NULL) return comment; comment = load_comment_for_mime (type); - + G_LOCK (gio_xdgmime); g_hash_table_insert (type_comment_cache, - g_strdup (type), - g_strdup (comment)); + g_strdup (type), + g_strdup (comment)); G_UNLOCK (gio_xdgmime); return comment; @@ -723,12 +722,13 @@ g_content_type_get_description (const char *type) /** * g_content_type_get_mime_type: - * @type: a content type string. - * - * Gets the mime-type for the content type. If one is registered - * - * Returns: the registered mime-type for the given @type, or NULL if unknown. - **/ + * @type: a content type string + * + * Gets the mime type for the content type, if one is registered. + * + * Returns: (allow-none): the registered mime type for the given @type, + * or %NULL if unknown. + */ char * g_content_type_get_mime_type (const char *type) { @@ -739,14 +739,15 @@ g_content_type_get_mime_type (const char *type) /** * g_content_type_get_icon: - * @type: a content type string. - * + * @type: a content type string + * * Gets the icon for a content type. - * - * Returns: #GIcon corresponding to the content type. - **/ + * + * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned + * object with g_object_unref() + */ GIcon * -g_content_type_get_icon (const char *type) +g_content_type_get_icon (const gchar *type) { char *mimetype_icon, *generic_mimetype_icon, *q; char *xdg_mimetype_icon, *legacy_mimetype_icon; @@ -755,31 +756,31 @@ g_content_type_get_icon (const char *type) int n = 0; const char *p; GIcon *themed_icon; - + g_return_val_if_fail (type != NULL, NULL); - + G_LOCK (gio_xdgmime); xdg_mimetype_icon = g_strdup (xdg_mime_get_icon (type)); xdg_mimetype_generic_icon = g_strdup (xdg_mime_get_generic_icon (type)); G_UNLOCK (gio_xdgmime); mimetype_icon = g_strdup (type); - + while ((q = strchr (mimetype_icon, '/')) != NULL) *q = '-'; - + p = strchr (type, '/'); if (p == NULL) p = type + strlen (type); /* Not all icons have migrated to the new icon theme spec, look for old names too */ legacy_mimetype_icon = g_strconcat ("gnome-mime-", mimetype_icon, NULL); - + generic_mimetype_icon = g_malloc (p - type + strlen ("-x-generic") + 1); memcpy (generic_mimetype_icon, type, p - type); memcpy (generic_mimetype_icon + (p - type), "-x-generic", strlen ("-x-generic")); generic_mimetype_icon[(p - type) + strlen ("-x-generic")] = 0; - + if (xdg_mimetype_icon) icon_names[n++] = xdg_mimetype_icon; @@ -790,30 +791,30 @@ g_content_type_get_icon (const char *type) icon_names[n++] = xdg_mimetype_generic_icon; icon_names[n++] = generic_mimetype_icon; - + themed_icon = g_themed_icon_new_from_names (icon_names, n); - + g_free (xdg_mimetype_icon); g_free (xdg_mimetype_generic_icon); g_free (mimetype_icon); g_free (legacy_mimetype_icon); g_free (generic_mimetype_icon); - + return themed_icon; } /** * g_content_type_can_be_executable: - * @type: a content type string. - * + * @type: a content type string + * * Checks if a content type can be executable. Note that for instance * things like text files can be executables (i.e. scripts and batch files). - * + * * Returns: %TRUE if the file type corresponds to a type that - * can be executable, %FALSE otherwise. - **/ + * can be executable, %FALSE otherwise. + */ gboolean -g_content_type_can_be_executable (const char *type) +g_content_type_can_be_executable (const gchar *type) { g_return_val_if_fail (type != NULL, FALSE); @@ -829,31 +830,32 @@ looks_like_text (const guchar *data, gsize data_size) { gsize i; char c; - + for (i = 0; i < data_size; i++) { c = data[i]; - + if (g_ascii_iscntrl (c) && - !g_ascii_isspace (c) && - c != '\b') - return FALSE; + !g_ascii_isspace (c) && + c != '\b') + return FALSE; } return TRUE; } /** * g_content_type_from_mime_type: - * @mime_type: a mime type string. + * @mime_type: a mime type string * * Tries to find a content type based on the mime type name. * - * Returns: Newly allocated string with content type or NULL when does not know. + * Returns: (allow-none): Newly allocated string with content type + * or %NULL. Free with g_free() * * Since: 2.18 **/ -char * -g_content_type_from_mime_type (const char *mime_type) +gchar * +g_content_type_from_mime_type (const gchar *mime_type) { char *umime; @@ -869,24 +871,25 @@ g_content_type_from_mime_type (const char *mime_type) /** * g_content_type_guess: - * @filename: a string, or %NULL - * @data: a stream of data, or %NULL + * @filename: (allow-none): a string, or %NULL + * @data: (allow-none) (array length=data_size): a stream of data, or %NULL * @data_size: the size of @data - * @result_uncertain: a flag indicating the certainty of the result - * - * Guesses the content type based on example data. If the function is + * @result_uncertain: (allow-none) (out): return location for the certainty + * of the result, or %NULL + * + * Guesses the content type based on example data. If the function is * uncertain, @result_uncertain will be set to %TRUE. Either @filename * or @data may be %NULL, in which case the guess will be based solely * on the other argument. - * - * Returns: a string indicating a guessed content type for the - * given data. - **/ -char * -g_content_type_guess (const char *filename, - const guchar *data, - gsize data_size, - gboolean *result_uncertain) + * + * Returns: a string indicating a guessed content type for the + * given data. Free with g_free() + */ +gchar * +g_content_type_guess (const gchar *filename, + const guchar *data, + gsize data_size, + gboolean *result_uncertain) { char *basename; const char *name_mimetypes[10], *sniffed_mimetype; @@ -901,9 +904,9 @@ g_content_type_guess (const char *filename, if (result_uncertain) *result_uncertain = FALSE; - + G_LOCK (gio_xdgmime); - + if (filename) { i = strlen (filename); @@ -929,14 +932,14 @@ g_content_type_guess (const char *filename, G_UNLOCK (gio_xdgmime); return g_strdup (name_mimetypes[0]); } - + if (data) { sniffed_mimetype = xdg_mime_get_mime_type_for_data (data, data_size, &sniffed_prio); if (sniffed_mimetype == XDG_MIME_TYPE_UNKNOWN && - data && - looks_like_text (data, data_size)) - sniffed_mimetype = "text/plain"; + data && + looks_like_text (data, data_size)) + sniffed_mimetype = "text/plain"; /* For security reasons we don't ever want to sniff desktop files * where we know the filename and it doesn't have a .desktop extension. @@ -948,57 +951,60 @@ g_content_type_guess (const char *filename, strcmp (sniffed_mimetype, "application/x-desktop") == 0) sniffed_mimetype = "text/plain"; } - + if (n_name_mimetypes == 0) { if (sniffed_mimetype == XDG_MIME_TYPE_UNKNOWN && - result_uncertain) - *result_uncertain = TRUE; - + result_uncertain) + *result_uncertain = TRUE; + mimetype = g_strdup (sniffed_mimetype); } else { mimetype = NULL; if (sniffed_mimetype != XDG_MIME_TYPE_UNKNOWN) - { - if (sniffed_prio >= 80) /* High priority sniffing match, use that */ - mimetype = g_strdup (sniffed_mimetype); - else - { - /* There are conflicts between the name matches and we have a sniffed - type, use that as a tie breaker. */ - - for (i = 0; i < n_name_mimetypes; i++) - { - if ( xdg_mime_mime_type_subclass (name_mimetypes[i], sniffed_mimetype)) - { - /* This nametype match is derived from (or the same as) the sniffed type). - This is probably it. */ - mimetype = g_strdup (name_mimetypes[i]); - break; - } - } - } - } - + { + if (sniffed_prio >= 80) /* High priority sniffing match, use that */ + mimetype = g_strdup (sniffed_mimetype); + else + { + /* There are conflicts between the name matches and we + * have a sniffed type, use that as a tie breaker. + */ + for (i = 0; i < n_name_mimetypes; i++) + { + if ( xdg_mime_mime_type_subclass (name_mimetypes[i], sniffed_mimetype)) + { + /* This nametype match is derived from (or the same as) + * the sniffed type). This is probably it. + */ + mimetype = g_strdup (name_mimetypes[i]); + break; + } + } + } + } + if (mimetype == NULL) - { - /* Conflicts, and sniffed type was no help or not there. Guess on the first one */ - mimetype = g_strdup (name_mimetypes[0]); - if (result_uncertain) - *result_uncertain = TRUE; - } + { + /* Conflicts, and sniffed type was no help or not there. + * Guess on the first one + */ + mimetype = g_strdup (name_mimetypes[0]); + if (result_uncertain) + *result_uncertain = TRUE; + } } - + G_UNLOCK (gio_xdgmime); return mimetype; } static void -enumerate_mimetypes_subdir (const char *dir, - const char *prefix, +enumerate_mimetypes_subdir (const char *dir, + const char *prefix, GHashTable *mimetypes) { DIR *d; @@ -1009,19 +1015,19 @@ enumerate_mimetypes_subdir (const char *dir, if (d) { while ((ent = readdir (d)) != NULL) - { - if (g_str_has_suffix (ent->d_name, ".xml")) - { - mimetype = g_strdup_printf ("%s/%.*s", prefix, (int) strlen (ent->d_name) - 4, ent->d_name); - g_hash_table_replace (mimetypes, mimetype, NULL); - } - } + { + if (g_str_has_suffix (ent->d_name, ".xml")) + { + mimetype = g_strdup_printf ("%s/%.*s", prefix, (int) strlen (ent->d_name) - 4, ent->d_name); + g_hash_table_replace (mimetypes, mimetype, NULL); + } + } closedir (d); } } static void -enumerate_mimetypes_dir (const char *dir, +enumerate_mimetypes_dir (const char *dir, GHashTable *mimetypes) { DIR *d; @@ -1030,34 +1036,38 @@ enumerate_mimetypes_dir (const char *dir, char *name; mimedir = g_build_filename (dir, "mime", NULL); - + d = opendir (mimedir); if (d) { while ((ent = readdir (d)) != NULL) - { - if (strcmp (ent->d_name, "packages") != 0) - { - name = g_build_filename (mimedir, ent->d_name, NULL); - if (g_file_test (name, G_FILE_TEST_IS_DIR)) - enumerate_mimetypes_subdir (name, ent->d_name, mimetypes); - g_free (name); - } - } + { + if (strcmp (ent->d_name, "packages") != 0) + { + name = g_build_filename (mimedir, ent->d_name, NULL); + if (g_file_test (name, G_FILE_TEST_IS_DIR)) + enumerate_mimetypes_subdir (name, ent->d_name, mimetypes); + g_free (name); + } + } closedir (d); } - + g_free (mimedir); } /** * g_content_types_get_registered: - * + * * Gets a list of strings containing all the registered content types - * known to the system. The list and its data should be freed using - * @g_list_foreach(list, g_free, NULL) and @g_list_free(list) - * Returns: #GList of the registered content types. - **/ + * known to the system. The list and its data should be freed using + * + * g_list_foreach (list, g_free, NULL); + * g_list_free (list); + * + * + * Returns: (element-type utf8) (transfer full): #GList of the registered content types + */ GList * g_content_types_get_registered (void) { @@ -1096,7 +1106,7 @@ static gboolean need_reload = FALSE; G_LOCK_DEFINE_STATIC (gio_treemagic); -typedef struct +typedef struct { gchar *path; GFileType type; @@ -1146,10 +1156,10 @@ parse_header (gchar *line) if (line[0] != '[' || line[len - 1] != ']') return NULL; - + line[len - 1] = 0; s = strchr (line, ':'); - + match = g_slice_new0 (TreeMatch); match->priority = atoi (line + 1); match->contenttype = g_strdup (s + 1); @@ -1158,8 +1168,8 @@ parse_header (gchar *line) } static TreeMatchlet * -parse_match_line (gchar *line, - gint *depth) +parse_match_line (gchar *line, + gint *depth) { gchar *s, *p; TreeMatchlet *matchlet; @@ -1168,17 +1178,17 @@ parse_match_line (gchar *line, matchlet = g_slice_new0 (TreeMatchlet); - if (line[0] == '>') + if (line[0] == '>') { *depth = 0; s = line; } - else + else { *depth = atoi (line); s = strchr (line, '>'); } - s += 2; + s += 2; p = strchr (s, '"'); *p = 0; @@ -1203,7 +1213,7 @@ parse_match_line (gchar *line, matchlet->non_empty = 1; else if (strcmp (parts[i], "on-disc") == 0) matchlet->on_disc = 1; - else + else matchlet->mimetype = g_strdup (parts[i]); } @@ -1228,19 +1238,19 @@ insert_match (TreeMatch *match) } static void -insert_matchlet (TreeMatch *match, - TreeMatchlet *matchlet, +insert_matchlet (TreeMatch *match, + TreeMatchlet *matchlet, gint depth) { - if (depth == 0) + if (depth == 0) match->matches = g_list_append (match->matches, matchlet); - else + else { GList *last; TreeMatchlet *m; last = g_list_last (match->matches); - if (!last) + if (!last) { tree_matchlet_free (matchlet); g_warning ("can't insert tree matchlet at depth %d", depth); @@ -1248,16 +1258,16 @@ insert_matchlet (TreeMatch *match, } m = (TreeMatchlet *) last->data; - while (--depth > 0) + while (--depth > 0) { last = g_list_last (m->matches); - if (!last) + if (!last) { tree_matchlet_free (matchlet); g_warning ("can't insert tree matchlet at depth %d", depth); return; } - + m = (TreeMatchlet *) last->data; } m->matches = g_list_append (m->matches, matchlet); @@ -1278,34 +1288,34 @@ read_tree_magic_from_directory (const gchar *prefix) filename = g_build_filename (prefix, "mime", "treemagic", NULL); - if (g_file_get_contents (filename, &text, &len, NULL)) + if (g_file_get_contents (filename, &text, &len, NULL)) { - if (strcmp (text, "MIME-TreeMagic") == 0) + if (strcmp (text, "MIME-TreeMagic") == 0) { lines = g_strsplit (text + strlen ("MIME-TreeMagic") + 2, "\n", 0); match = NULL; - for (i = 0; lines[i] && lines[i][0]; i++) + for (i = 0; lines[i] && lines[i][0]; i++) { - if (lines[i][0] == '[') + if (lines[i][0] == '[') { match = parse_header (lines[i]); insert_match (match); } - else + else { matchlet = parse_match_line (lines[i], &depth); insert_matchlet (match, matchlet, depth); } } - + g_strfreev (lines); } - else + else g_warning ("%s: header not found, skipping\n", filename); g_free (text); } - + g_free (filename); } @@ -1316,7 +1326,7 @@ xdg_mime_reload (void *user_data) need_reload = TRUE; } -static void +static void tree_magic_shutdown (void) { g_list_foreach (tree_matches, (GFunc)tree_match_free, NULL); @@ -1332,7 +1342,7 @@ tree_magic_init (void) const gchar * const * dirs; int i; - if (!initialized) + if (!initialized) { initialized = TRUE; @@ -1340,7 +1350,7 @@ tree_magic_init (void) need_reload = TRUE; } - if (need_reload) + if (need_reload) { need_reload = FALSE; @@ -1356,7 +1366,7 @@ tree_magic_init (void) /* a filtering enumerator */ -typedef struct +typedef struct { gchar *path; gint depth; @@ -1368,8 +1378,8 @@ typedef struct } Enumerator; static gboolean -component_match (Enumerator *e, - gint depth, +component_match (Enumerator *e, + gint depth, const gchar *name) { gchar *case_folded, *key; @@ -1393,38 +1403,38 @@ component_match (Enumerator *e, } static GFile * -next_match_recurse (Enumerator *e, +next_match_recurse (Enumerator *e, gint depth) { GFile *file; GFileInfo *info; const gchar *name; - while (TRUE) + while (TRUE) { - if (e->enumerators[depth] == NULL) + if (e->enumerators[depth] == NULL) { - if (depth > 0) + if (depth > 0) { file = next_match_recurse (e, depth - 1); - if (file) + if (file) { e->children[depth] = file; e->enumerators[depth] = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, - NULL, - NULL); + NULL, + NULL); } } if (e->enumerators[depth] == NULL) return NULL; } - while ((info = g_file_enumerator_next_file (e->enumerators[depth], NULL, NULL))) + while ((info = g_file_enumerator_next_file (e->enumerators[depth], NULL, NULL))) { name = g_file_info_get_name (info); - if (component_match (e, depth, name)) + if (component_match (e, depth, name)) { file = g_file_get_child (e->children[depth], name); g_object_unref (info); @@ -1448,7 +1458,7 @@ enumerator_next (Enumerator *e) static Enumerator * enumerator_new (GFile *root, - const char *path, + const char *path, gboolean ignore_case) { Enumerator *e; @@ -1461,15 +1471,15 @@ enumerator_new (GFile *root, e->components = g_strsplit (e->path, G_DIR_SEPARATOR_S, -1); e->depth = g_strv_length (e->components); - if (e->ignore_case) + if (e->ignore_case) { e->case_components = g_new0 (char *, e->depth + 1); - for (i = 0; e->components[i]; i++) + for (i = 0; e->components[i]; i++) { case_folded = g_utf8_casefold (e->components[i], -1); e->case_components[i] = g_utf8_collate_key (case_folded, -1); g_free (case_folded); - } + } } e->children = g_new0 (GFile *, e->depth); @@ -1489,9 +1499,9 @@ enumerator_free (Enumerator *e) { gint i; - for (i = 0; i < e->depth; i++) - { - if (e->enumerators[i]) + for (i = 0; i < e->depth; i++) + { + if (e->enumerators[i]) g_object_unref (e->enumerators[i]); if (e->children[i]) g_object_unref (e->children[i]); @@ -1518,13 +1528,13 @@ matchlet_match (TreeMatchlet *matchlet, GList *l; e = enumerator_new (root, matchlet->path, !matchlet->match_case); - - do + + do { file = enumerator_next (e); - if (!file) + if (!file) { - enumerator_free (e); + enumerator_free (e); return FALSE; } @@ -1535,67 +1545,67 @@ matchlet_match (TreeMatchlet *matchlet, else attrs = G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE; - info = g_file_query_info (file, + info = g_file_query_info (file, attrs, G_FILE_QUERY_INFO_NONE, NULL, NULL); - if (info) + if (info) { result = TRUE; if (matchlet->type != G_FILE_TYPE_UNKNOWN && - g_file_info_get_file_type (info) != matchlet->type) + g_file_info_get_file_type (info) != matchlet->type) result = FALSE; if (matchlet->executable && !g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE)) result = FALSE; - } - else + } + else result = FALSE; - if (result && matchlet->non_empty) + if (result && matchlet->non_empty) { GFileEnumerator *child_enum; GFileInfo *child_info; - child_enum = g_file_enumerate_children (file, + child_enum = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, NULL); - - if (child_enum) + + if (child_enum) { child_info = g_file_enumerator_next_file (child_enum, NULL, NULL); if (child_info) g_object_unref (child_info); - else - result = FALSE; + else + result = FALSE; g_object_unref (child_enum); } - else + else result = FALSE; } - - if (result && matchlet->mimetype) + + if (result && matchlet->mimetype) { - if (strcmp (matchlet->mimetype, g_file_info_get_content_type (info)) != 0) + if (strcmp (matchlet->mimetype, g_file_info_get_content_type (info)) != 0) result = FALSE; } - + g_object_unref (info); g_object_unref (file); } while (!result); enumerator_free (e); - - if (!matchlet->matches) + + if (!matchlet->matches) return TRUE; - for (l = matchlet->matches; l; l = l->next) + for (l = matchlet->matches; l; l = l->next) { TreeMatchlet *submatchlet; @@ -1613,11 +1623,11 @@ match_match (TreeMatch *match, GPtrArray *types) { GList *l; - - for (l = match->matches; l; l = l->next) + + for (l = match->matches; l; l = l->next) { TreeMatchlet *matchlet = l->data; - if (matchlet_match (matchlet, root)) + if (matchlet_match (matchlet, root)) { g_ptr_array_add (types, g_strdup (match->contenttype)); break; @@ -1634,18 +1644,19 @@ match_match (TreeMatch *match, * of content types, with the best guess coming first. * * The types returned all have the form x-content/foo, e.g. - * x-content/audio-cdda (for audio CDs) or x-content/image-dcf + * x-content/audio-cdda (for audio CDs) or x-content/image-dcf * (for a camera memory card). See the shared-mime-info * specification for more on x-content types. * - * This function is useful in the implementation of g_mount_guess_content_type(). + * This function is useful in the implementation of + * g_mount_guess_content_type(). * - * Returns: an %NULL-terminated array of zero or more content types, or %NULL. - * Free with g_strfreev() + * Returns: (transfer full): an %NULL-terminated array of zero or more content types, + * or %NULL. Free with g_strfreev() * * Since: 2.18 */ -char ** +gchar ** g_content_type_guess_for_tree (GFile *root) { GPtrArray *types; @@ -1656,7 +1667,7 @@ g_content_type_guess_for_tree (GFile *root) G_LOCK (gio_treemagic); tree_magic_init (); - for (l = tree_matches; l; l = l->next) + for (l = tree_matches; l; l = l->next) { TreeMatch *match = l->data; match_match (match, root, types); @@ -1666,10 +1677,7 @@ g_content_type_guess_for_tree (GFile *root) g_ptr_array_add (types, NULL); - return (char **)g_ptr_array_free (types, FALSE); + return (gchar **)g_ptr_array_free (types, FALSE); } #endif /* Unix version */ - -#define __G_CONTENT_TYPE_C__ -#include "gioaliasdef.c" diff --git a/gio/gcontenttype.h b/gio/gcontenttype.h index 95c9475..959e170 100644 --- a/gio/gcontenttype.h +++ b/gio/gcontenttype.h @@ -31,24 +31,24 @@ G_BEGIN_DECLS -gboolean g_content_type_equals (const char *type1, - const char *type2); -gboolean g_content_type_is_a (const char *type, - const char *supertype); -gboolean g_content_type_is_unknown (const char *type); -char * g_content_type_get_description (const char *type); -char * g_content_type_get_mime_type (const char *type); -GIcon * g_content_type_get_icon (const char *type); -gboolean g_content_type_can_be_executable (const char *type); - -char * g_content_type_from_mime_type (const char *mime_type); - -char * g_content_type_guess (const char *filename, - const guchar *data, - gsize data_size, - gboolean *result_uncertain); - -char ** g_content_type_guess_for_tree (GFile *root); +gboolean g_content_type_equals (const gchar *type1, + const gchar *type2); +gboolean g_content_type_is_a (const gchar *type, + const gchar *supertype); +gboolean g_content_type_is_unknown (const gchar *type); +gchar * g_content_type_get_description (const gchar *type); +gchar * g_content_type_get_mime_type (const gchar *type); +GIcon * g_content_type_get_icon (const gchar *type); +gboolean g_content_type_can_be_executable (const gchar *type); + +gchar * g_content_type_from_mime_type (const gchar *mime_type); + +gchar * g_content_type_guess (const gchar *filename, + const guchar *data, + gsize data_size, + gboolean *result_uncertain); + +gchar ** g_content_type_guess_for_tree (GFile *root); GList * g_content_types_get_registered (void); diff --git a/gio/gconverter.c b/gio/gconverter.c index 8305b00..74e90c2 100644 --- a/gio/gconverter.c +++ b/gio/gconverter.c @@ -24,7 +24,6 @@ #include "gconverter.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gconverter @@ -43,41 +42,12 @@ * Since: 2.24 **/ -static void g_converter_base_init (gpointer g_class); -GType -g_converter_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - const GTypeInfo converter_info = - { - sizeof (GConverterIface), /* class_size */ - g_converter_base_init, /* base_init */ - NULL, /* base_finalize */ - NULL, - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL - }; - GType g_define_type_id = - g_type_register_static (G_TYPE_INTERFACE, I_("GConverter"), - &converter_info, 0); - - g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT); - - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } - - return g_define_type_id__volatile; -} +typedef GConverterIface GConverterInterface; +G_DEFINE_INTERFACE (GConverter, g_converter, G_TYPE_OBJECT) static void -g_converter_base_init (gpointer g_class) +g_converter_default_init (GConverterInterface *iface) { } @@ -229,6 +199,3 @@ g_converter_reset (GConverter *converter) (* iface->reset) (converter); } - -#define __G_CONVERTER_C__ -#include "gioaliasdef.c" diff --git a/gio/gconverterinputstream.c b/gio/gconverterinputstream.c index 5dad35d..d81cd90 100644 --- a/gio/gconverterinputstream.c +++ b/gio/gconverterinputstream.c @@ -31,7 +31,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gconverterinputstream @@ -211,7 +210,7 @@ g_converter_input_stream_new (GInputStream *base_stream, } static gsize -buffer_available (Buffer *buffer) +buffer_data_size (Buffer *buffer) { return buffer->end - buffer->start; } @@ -251,7 +250,7 @@ compact_buffer (Buffer *buffer) { gsize in_buffer; - in_buffer = buffer_available (buffer); + in_buffer = buffer_data_size (buffer); memmove (buffer->data, buffer->data + buffer->start, in_buffer); @@ -271,7 +270,7 @@ grow_buffer (Buffer *buffer) size = buffer->size * 2; data = g_malloc (size); - in_buffer = buffer_available (buffer); + in_buffer = buffer_data_size (buffer); memcpy (data, buffer->data + buffer->start, @@ -283,13 +282,15 @@ grow_buffer (Buffer *buffer) buffer->size = size; } +/* Ensures that the buffer can fit at_least_size bytes, + * *including* the current in-buffer data */ static void buffer_ensure_space (Buffer *buffer, gsize at_least_size) { gsize in_buffer, left_to_fill; - in_buffer = buffer_available (buffer); + in_buffer = buffer_data_size (buffer); if (in_buffer >= at_least_size) return; @@ -364,7 +365,7 @@ g_converter_input_stream_read (GInputStream *stream, cstream = G_CONVERTER_INPUT_STREAM (stream); priv = cstream->priv; - available = buffer_available (&priv->converted_buffer); + available = buffer_data_size (&priv->converted_buffer); if (available > 0 && count <= available) @@ -384,7 +385,7 @@ g_converter_input_stream_read (GInputStream *stream, /* If there is no data to convert, and no pre-converted data, do some i/o for more input */ - if (buffer_available (&priv->input_buffer) == 0 && + if (buffer_data_size (&priv->input_buffer) == 0 && total_bytes_read == 0 && !priv->at_input_end) { @@ -401,7 +402,7 @@ g_converter_input_stream_read (GInputStream *stream, my_error = NULL; res = g_converter_convert (priv->converter, buffer_data (&priv->input_buffer), - buffer_available (&priv->input_buffer), + buffer_data_size (&priv->input_buffer), buffer, count, priv->at_input_end ? G_CONVERTER_INPUT_AT_END : 0, &bytes_read, @@ -438,7 +439,7 @@ g_converter_input_stream_read (GInputStream *stream, /* If there is no more to convert, return EOF */ if (priv->finished) { - g_assert (buffer_available (&priv->converted_buffer) == 0); + g_assert (buffer_data_size (&priv->converted_buffer) == 0); return 0; } @@ -458,7 +459,7 @@ g_converter_input_stream_read (GInputStream *stream, my_error = NULL; res = g_converter_convert (priv->converter, buffer_data (&priv->input_buffer), - buffer_available (&priv->input_buffer), + buffer_data_size (&priv->input_buffer), buffer_data (&priv->converted_buffer), buffer_tailspace (&priv->converted_buffer), priv->at_input_end ? G_CONVERTER_INPUT_AT_END : 0, @@ -471,13 +472,13 @@ g_converter_input_stream_read (GInputStream *stream, buffer_consumed (&priv->input_buffer, bytes_read); /* Maybe we consumed without producing any output */ - if (buffer_available (&priv->converted_buffer) == 0 && res != G_CONVERTER_FINISHED) + if (buffer_data_size (&priv->converted_buffer) == 0 && res != G_CONVERTER_FINISHED) continue; /* Convert more */ if (res == G_CONVERTER_FINISHED) priv->finished = TRUE; - total_bytes_read = MIN (count, buffer_available (&priv->converted_buffer)); + total_bytes_read = MIN (count, buffer_data_size (&priv->converted_buffer)); buffer_read (&priv->converted_buffer, buffer, total_bytes_read); g_assert (priv->finished || total_bytes_read > 0); @@ -495,7 +496,7 @@ g_converter_input_stream_read (GInputStream *stream, /* Need more data */ my_error2 = NULL; res = fill_input_buffer (cstream, - buffer_available (&priv->input_buffer) + 4096, + buffer_data_size (&priv->input_buffer) + 4096, cancellable, &my_error2); if (res < 0) @@ -541,7 +542,7 @@ g_converter_input_stream_read (GInputStream *stream, * * Gets the #GConverter that is used by @converter_stream. * - * Returns: the converter of the converter input stream + * Returns: (transfer none): the converter of the converter input stream * * Since: 2.24 */ @@ -550,6 +551,3 @@ g_converter_input_stream_get_converter (GConverterInputStream *converter_stream) { return converter_stream->priv->converter; } - -#define __G_CONVERTER_INPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gconverterinputstream.h b/gio/gconverterinputstream.h index d2ef887..8e4f1d4 100644 --- a/gio/gconverterinputstream.h +++ b/gio/gconverterinputstream.h @@ -41,7 +41,6 @@ G_BEGIN_DECLS /** * GConverterInputStream: - * @parent_interface: a #GFilterInputStream. * * An implementation of #GFilterInputStream that allows data * conversion. diff --git a/gio/gconverteroutputstream.c b/gio/gconverteroutputstream.c index f59733d..5b1cbec 100644 --- a/gio/gconverteroutputstream.c +++ b/gio/gconverteroutputstream.c @@ -31,7 +31,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gconverteroutputstream @@ -228,7 +227,7 @@ g_converter_output_stream_new (GOutputStream *base_stream, } static gsize -buffer_available (Buffer *buffer) +buffer_data_size (Buffer *buffer) { return buffer->end - buffer->start; } @@ -259,7 +258,7 @@ compact_buffer (Buffer *buffer) { gsize in_buffer; - in_buffer = buffer_available (buffer); + in_buffer = buffer_data_size (buffer); memmove (buffer->data, buffer->data + buffer->start, in_buffer); @@ -279,7 +278,7 @@ grow_buffer (Buffer *buffer) size = buffer->size * 2; data = g_malloc (size); - in_buffer = buffer_available (buffer); + in_buffer = buffer_data_size (buffer); memcpy (data, buffer->data + buffer->start, @@ -291,13 +290,15 @@ grow_buffer (Buffer *buffer) buffer->size = size; } +/* Ensures that the buffer can fit at_least_size bytes, + * *including* the current in-buffer data */ static void buffer_ensure_space (Buffer *buffer, gsize at_least_size) { gsize in_buffer, left_to_fill; - in_buffer = buffer_available (buffer); + in_buffer = buffer_data_size (buffer); if (in_buffer >= at_least_size) return; @@ -330,7 +331,7 @@ buffer_append (Buffer *buffer, gsize data_size) { buffer_ensure_space (buffer, - buffer_available (buffer) + data_size); + buffer_data_size (buffer) + data_size); memcpy (buffer->data + buffer->end, data, data_size); buffer->end += data_size; } @@ -352,7 +353,7 @@ flush_buffer (GConverterOutputStream *stream, base_stream = G_FILTER_OUTPUT_STREAM (stream)->base_stream; - available = buffer_available (&priv->converted_buffer); + available = buffer_data_size (&priv->converted_buffer); if (available > 0) { res = g_output_stream_write_all (base_stream, @@ -398,12 +399,12 @@ g_converter_output_stream_write (GOutputStream *stream, return 0; /* Convert as much as possible */ - if (buffer_available (&priv->output_buffer) > 0) + if (buffer_data_size (&priv->output_buffer) > 0) { converting_from_buffer = TRUE; buffer_append (&priv->output_buffer, buffer, count); to_convert = buffer_data (&priv->output_buffer); - to_convert_size = buffer_available (&priv->output_buffer); + to_convert_size = buffer_data_size (&priv->output_buffer); } else { @@ -427,7 +428,7 @@ g_converter_output_stream_write (GOutputStream *stream, res = g_converter_convert (priv->converter, to_convert + converted_bytes, to_convert_size - converted_bytes, - buffer_data (&priv->converted_buffer) + buffer_available (&priv->converted_buffer), + buffer_data (&priv->converted_buffer) + buffer_data_size (&priv->converted_buffer), buffer_tailspace (&priv->converted_buffer), 0, &bytes_read, @@ -476,6 +477,7 @@ g_converter_output_stream_write (GOutputStream *stream, buffer_append (&priv->output_buffer, buffer, count); /* in the converting_from_buffer case we already appended this */ + g_error_free (my_error); return count; /* consume everything */ } @@ -541,8 +543,8 @@ g_converter_output_stream_flush (GOutputStream *stream, my_error = NULL; res = g_converter_convert (priv->converter, buffer_data (&priv->output_buffer), - buffer_available (&priv->output_buffer), - buffer_data (&priv->converted_buffer) + buffer_available (&priv->converted_buffer), + buffer_data_size (&priv->output_buffer), + buffer_data (&priv->converted_buffer) + buffer_data_size (&priv->converted_buffer), buffer_tailspace (&priv->converted_buffer), is_closing ? G_CONVERTER_INPUT_AT_END : G_CONVERTER_FLUSH, &bytes_read, @@ -560,7 +562,7 @@ g_converter_output_stream_flush (GOutputStream *stream, res == G_CONVERTER_FLUSHED) { /* Should not have retured FLUSHED with input left */ - g_assert (buffer_available (&priv->output_buffer) == 0); + g_assert (buffer_data_size (&priv->output_buffer) == 0); flushed = TRUE; } } @@ -583,7 +585,7 @@ g_converter_output_stream_flush (GOutputStream *stream, /* Any other error, including PARTIAL_INPUT can't be fixed by now and is an error */ g_propagate_error (error, my_error); - return -1; + return FALSE; } } @@ -600,7 +602,7 @@ g_converter_output_stream_flush (GOutputStream *stream, * * Gets the #GConverter that is used by @converter_stream. * - * Returns: the converter of the converter output stream + * Returns: (transfer none): the converter of the converter output stream * * Since: 2.24 */ @@ -609,6 +611,3 @@ g_converter_output_stream_get_converter (GConverterOutputStream *converter_strea { return converter_stream->priv->converter; } - -#define __G_CONVERTER_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gconverteroutputstream.h b/gio/gconverteroutputstream.h index afcb74f..ceac200 100644 --- a/gio/gconverteroutputstream.h +++ b/gio/gconverteroutputstream.h @@ -41,7 +41,6 @@ G_BEGIN_DECLS /** * GConverterOutputStream: - * @parent_instance: a #GFilterOutputStream. * * An implementation of #GFilterOutputStream that allows data * conversion. diff --git a/gio/gcredentials.c b/gio/gcredentials.c new file mode 100644 index 0000000..f54ea24 --- /dev/null +++ b/gio/gcredentials.c @@ -0,0 +1,446 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#ifdef __FreeBSD__ +#include +#include +#include +#endif +#include + +#include + +#include "gcredentials.h" +#include "gnetworkingprivate.h" +#include "gioerror.h" + +#include "glibintl.h" + +/** + * SECTION:gcredentials + * @short_description: An object containing credentials + * @include: gio/gio.h + * + * The #GCredentials type is a reference-counted wrapper for native + * credentials. This information is typically used for identifying, + * authenticating and authorizing other processes. + * + * Some operating systems supports looking up the credentials of the + * remote peer of a communication endpoint - see e.g. + * g_socket_get_credentials(). + * + * Some operating systems supports securely sending and receiving + * credentials over a Unix Domain Socket, see + * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and + * g_unix_connection_receive_credentials() for details. + * + * On Linux, the native credential type is a struct ucred + * - see the + * unix7 + * man page for details. This corresponds to + * %G_CREDENTIALS_TYPE_LINUX_UCRED. + * + * On FreeBSD, the native credential type is a struct cmsgcred. + * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED. + */ + +/** + * GCredentials: + * + * The #GCredentials structure contains only private data and + * should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GCredentials +{ + /*< private >*/ + GObject parent_instance; + +#ifdef __linux__ + struct ucred native; +#elif defined(__FreeBSD__) + struct cmsgcred native; +#else +#ifdef __GNUC__ +#warning Please add GCredentials support for your OS +#endif +#endif +}; + +/** + * GCredentialsClass: + * + * Class structure for #GCredentials. + * + * Since: 2.26 + */ +struct _GCredentialsClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +G_DEFINE_TYPE (GCredentials, g_credentials, G_TYPE_OBJECT); + +static void +g_credentials_finalize (GObject *object) +{ + G_GNUC_UNUSED GCredentials *credentials = G_CREDENTIALS (object); + + if (G_OBJECT_CLASS (g_credentials_parent_class)->finalize != NULL) + G_OBJECT_CLASS (g_credentials_parent_class)->finalize (object); +} + + +static void +g_credentials_class_init (GCredentialsClass *klass) +{ + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = g_credentials_finalize; +} + +static void +g_credentials_init (GCredentials *credentials) +{ +#ifdef __linux__ + credentials->native.pid = getpid (); + credentials->native.uid = geteuid (); + credentials->native.gid = getegid (); +#elif defined(__FreeBSD__) + memset (&credentials->native, 0, sizeof (struct cmsgcred)); + credentials->native.cmcred_pid = getpid (); + credentials->native.cmcred_euid = geteuid (); + credentials->native.cmcred_gid = getegid (); +#endif +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_credentials_new: + * + * Creates a new #GCredentials object with credentials matching the + * the current process. + * + * Returns: A #GCredentials. Free with g_object_unref(). + * + * Since: 2.26 + */ +GCredentials * +g_credentials_new (void) +{ + return g_object_new (G_TYPE_CREDENTIALS, NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_credentials_to_string: + * @credentials: A #GCredentials object. + * + * Creates a human-readable textual representation of @credentials + * that can be used in logging and debug messages. The format of the + * returned string may change in future GLib release. + * + * Returns: A string that should be freed with g_free(). + * + * Since: 2.26 + */ +gchar * +g_credentials_to_string (GCredentials *credentials) +{ + GString *ret; + + g_return_val_if_fail (G_IS_CREDENTIALS (credentials), NULL); + + ret = g_string_new ("GCredentials:"); +#ifdef __linux__ + g_string_append (ret, "linux-ucred:"); + if (credentials->native.pid != -1) + g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.pid); + if (credentials->native.uid != -1) + g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.uid); + if (credentials->native.gid != -1) + g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.gid); + if (ret->str[ret->len - 1] == ',') + ret->str[ret->len - 1] = '\0'; +#elif defined(__FreeBSD__) + g_string_append (ret, "freebsd-cmsgcred:"); + if (credentials->native.cmcred_pid != -1) + g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cmcred_pid); + if (credentials->native.cmcred_euid != -1) + g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cmcred_euid); + if (credentials->native.cmcred_gid != -1) + g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cmcred_gid); +#else + g_string_append (ret, "unknown"); +#endif + + return g_string_free (ret, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_credentials_is_same_user: + * @credentials: A #GCredentials. + * @other_credentials: A #GCredentials. + * @error: Return location for error or %NULL. + * + * Checks if @credentials and @other_credentials is the same user. + * + * This operation can fail if #GCredentials is not supported on the + * the OS. + * + * Returns: %TRUE if @credentials and @other_credentials has the same + * user, %FALSE otherwise or if @error is set. + * + * Since: 2.26 + */ +gboolean +g_credentials_is_same_user (GCredentials *credentials, + GCredentials *other_credentials, + GError **error) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_CREDENTIALS (credentials), FALSE); + g_return_val_if_fail (G_IS_CREDENTIALS (other_credentials), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; +#ifdef __linux__ + if (credentials->native.uid == other_credentials->native.uid) + ret = TRUE; +#elif defined(__FreeBSD__) + if (credentials->native.cmcred_euid == other_credentials->native.cmcred_euid) + ret = TRUE; +#else + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("GCredentials is not implemented on this OS")); +#endif + + return ret; +} + +/** + * g_credentials_get_native: (skip) + * @credentials: A #GCredentials. + * @native_type: The type of native credentials to get. + * + * Gets a pointer to native credentials of type @native_type from + * @credentials. + * + * It is a programming error (which will cause an warning to be + * logged) to use this method if there is no #GCredentials support for + * the OS or if @native_type isn't supported by the OS. + * + * Returns: The pointer to native credentials or %NULL if the + * operation there is no #GCredentials support for the OS or if + * @native_type isn't supported by the OS. Do not free the returned + * data, it is owned by @credentials. + * + * Since: 2.26 + */ +gpointer +g_credentials_get_native (GCredentials *credentials, + GCredentialsType native_type) +{ + gpointer ret; + + g_return_val_if_fail (G_IS_CREDENTIALS (credentials), NULL); + + ret = NULL; + +#ifdef __linux__ + if (native_type != G_CREDENTIALS_TYPE_LINUX_UCRED) + { + g_warning ("g_credentials_get_native: Trying to get credentials of type %d but only " + "G_CREDENTIALS_TYPE_LINUX_UCRED is supported.", + native_type); + } + else + { + ret = &credentials->native; + } +#elif defined(__FreeBSD__) + if (native_type != G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED) + { + g_warning ("g_credentials_get_native: Trying to get credentials of type %d but only " + "G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED is supported.", + native_type); + } + else + { + ret = &credentials->native; + } +#else + g_warning ("g_credentials_get_native: Trying to get credentials but GLib has no support " + "for the native credentials type. Please add support."); +#endif + + return ret; +} + +/** + * g_credentials_set_native: + * @credentials: A #GCredentials. + * @native_type: The type of native credentials to set. + * @native: A pointer to native credentials. + * + * Copies the native credentials of type @native_type from @native + * into @credentials. + * + * It is a programming error (which will cause an warning to be + * logged) to use this method if there is no #GCredentials support for + * the OS or if @native_type isn't supported by the OS. + * + * Since: 2.26 + */ +void +g_credentials_set_native (GCredentials *credentials, + GCredentialsType native_type, + gpointer native) +{ +#ifdef __linux__ + if (native_type != G_CREDENTIALS_TYPE_LINUX_UCRED) + { + g_warning ("g_credentials_set_native: Trying to set credentials of type %d " + "but only G_CREDENTIALS_TYPE_LINUX_UCRED is supported.", + native_type); + } + else + { + memcpy (&credentials->native, native, sizeof (struct ucred)); + } +#elif defined(__FreeBSD__) + if (native_type != G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED) + { + g_warning ("g_credentials_set_native: Trying to set credentials of type %d " + "but only G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED is supported.", + native_type); + } + else + { + memcpy (&credentials->native, native, sizeof (struct cmsgcred)); + } +#else + g_warning ("g_credentials_set_native: Trying to set credentials but GLib has no support " + "for the native credentials type. Please add support."); +#endif +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_UNIX +/** + * g_credentials_get_unix_user: + * @credentials: A #GCredentials + * @error: Return location for error or %NULL. + * + * Tries to get the UNIX user identifier from @credentials. This + * method is only available on UNIX platforms. + * + * This operation can fail if #GCredentials is not supported on the + * OS or if the native credentials type does not contain information + * about the UNIX user. + * + * Returns: The UNIX user identifier or -1 if @error is set. + * + * Since: 2.26 + */ +uid_t +g_credentials_get_unix_user (GCredentials *credentials, + GError **error) +{ + uid_t ret; + + g_return_val_if_fail (G_IS_CREDENTIALS (credentials), -1); + g_return_val_if_fail (error == NULL || *error == NULL, -1); + +#ifdef __linux__ + ret = credentials->native.uid; +#elif defined(__FreeBSD__) + ret = credentials->native.cmcred_euid; +#else + ret = -1; + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("There is no GCredentials support for your platform")); +#endif + + return ret; +} + +/** + * g_credentials_set_unix_user: + * @credentials: A #GCredentials. + * @uid: The UNIX user identifier to set. + * @error: Return location for error or %NULL. + * + * Tries to set the UNIX user identifier on @credentials. This method + * is only available on UNIX platforms. + * + * This operation can fail if #GCredentials is not supported on the + * OS or if the native credentials type does not contain information + * about the UNIX user. + * + * Returns: %TRUE if @uid was set, %FALSE if error is set. + * + * Since: 2.26 + */ +gboolean +g_credentials_set_unix_user (GCredentials *credentials, + uid_t uid, + GError **error) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_CREDENTIALS (credentials), FALSE); + g_return_val_if_fail (uid != -1, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; +#ifdef __linux__ + credentials->native.uid = uid; + ret = TRUE; +#elif defined(__FreeBSD__) + credentials->native.cmcred_euid = uid; + ret = TRUE; +#else + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("GCredentials is not implemented on this OS")); +#endif + + return ret; +} +#endif /* G_OS_UNIX */ diff --git a/gio/gcredentials.h b/gio/gcredentials.h new file mode 100644 index 0000000..8e09f77 --- /dev/null +++ b/gio/gcredentials.h @@ -0,0 +1,76 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_CREDENTIALS_H__ +#define __G_CREDENTIALS_H__ + +#include + +#ifdef G_OS_UNIX +/* To get the uid_t type */ +#include +#include +#endif + +G_BEGIN_DECLS + +#define G_TYPE_CREDENTIALS (g_credentials_get_type ()) +#define G_CREDENTIALS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CREDENTIALS, GCredentials)) +#define G_CREDENTIALS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CREDENTIALS, GCredentialsClass)) +#define G_CREDENTIALS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CREDENTIALS, GCredentialsClass)) +#define G_IS_CREDENTIALS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CREDENTIALS)) +#define G_IS_CREDENTIALS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CREDENTIALS)) + +typedef struct _GCredentialsClass GCredentialsClass; + +GType g_credentials_get_type (void) G_GNUC_CONST; + +GCredentials *g_credentials_new (void); + +gchar *g_credentials_to_string (GCredentials *credentials); + +gpointer g_credentials_get_native (GCredentials *credentials, + GCredentialsType native_type); + +void g_credentials_set_native (GCredentials *credentials, + GCredentialsType native_type, + gpointer native); + +gboolean g_credentials_is_same_user (GCredentials *credentials, + GCredentials *other_credentials, + GError **error); + +#ifdef G_OS_UNIX +uid_t g_credentials_get_unix_user (GCredentials *credentials, + GError **error); +gboolean g_credentials_set_unix_user (GCredentials *credentials, + uid_t uid, + GError **error); +#endif + +G_END_DECLS + +#endif /* __G_DBUS_PROXY_H__ */ diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c index 4a380f7..7a7af9a 100644 --- a/gio/gdatainputstream.c +++ b/gio/gdatainputstream.c @@ -30,7 +30,7 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" +#include /** * SECTION:gdatainputstream @@ -358,7 +358,7 @@ g_data_input_stream_read_byte (GDataInputStream *stream, * Reads a 16-bit/2-byte value from @stream. * * In order to get the correct byte order for this read operation, - * see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). + * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). * * Returns: a signed 16-bit/2-byte value read from @stream or %0 if * an error occurred. @@ -402,7 +402,7 @@ g_data_input_stream_read_int16 (GDataInputStream *stream, * Reads an unsigned 16-bit/2-byte value from @stream. * * In order to get the correct byte order for this read operation, - * see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). + * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). * * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if * an error occurred. @@ -446,7 +446,7 @@ g_data_input_stream_read_uint16 (GDataInputStream *stream, * Reads a signed 32-bit/4-byte value from @stream. * * In order to get the correct byte order for this read operation, - * see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). + * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). * * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation @@ -494,7 +494,7 @@ g_data_input_stream_read_int32 (GDataInputStream *stream, * Reads an unsigned 32-bit/4-byte value from @stream. * * In order to get the correct byte order for this read operation, - * see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). + * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). * * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation @@ -542,7 +542,7 @@ g_data_input_stream_read_uint32 (GDataInputStream *stream, * Reads a 64-bit/8-byte value from @stream. * * In order to get the correct byte order for this read operation, - * see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). + * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). * * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation @@ -590,7 +590,7 @@ g_data_input_stream_read_int64 (GDataInputStream *stream, * Reads an unsigned 64-bit/8-byte value from @stream. * * In order to get the correct byte order for this read operation, - * see g_data_stream_get_byte_order(). + * see g_data_input_stream_get_byte_order(). * * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation @@ -812,7 +812,8 @@ g_data_input_stream_read_line (GDataInputStream *stream, static gssize scan_for_chars (GDataInputStream *stream, gsize *checked_out, - const char *stop_chars) + const char *stop_chars, + gssize stop_chars_len) { GBufferedInputStream *bstream; const char *buffer; @@ -820,8 +821,10 @@ scan_for_chars (GDataInputStream *stream, int i; gsize available, checked; const char *stop_char; + const char *stop_end; bstream = G_BUFFERED_INPUT_STREAM (stream); + stop_end = stop_chars + stop_chars_len; checked = *checked_out; @@ -832,7 +835,7 @@ scan_for_chars (GDataInputStream *stream, for (i = 0; checked < available && i < peeked; i++) { - for (stop_char = stop_chars; *stop_char != '\0'; stop_char++) + for (stop_char = stop_chars; stop_char != stop_end; stop_char++) { if (buffer[i] == *stop_char) return (start + i); @@ -859,6 +862,12 @@ scan_for_chars (GDataInputStream *stream, * Note that, in contrast to g_data_input_stream_read_until_async(), * this function consumes the stop character that it finds. * + * Don't use this function in new code. Its functionality is + * inconsistent with g_data_input_stream_read_until_async(). Both + * functions will be marked as deprecated in a future release. Use + * g_data_input_stream_read_upto() instead, but note that that function + * does not consume the stop character. + * * Returns: a string with the data that was read before encountering * any of the stop characters. Set @length to a #gsize to get the length * of the string. This function will return %NULL on an error. @@ -871,59 +880,24 @@ g_data_input_stream_read_until (GDataInputStream *stream, GError **error) { GBufferedInputStream *bstream; - gsize checked; - gssize found_pos; - gssize res; - int stop_char_len; - char *data_until; - - g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), NULL); + gchar *result; bstream = G_BUFFERED_INPUT_STREAM (stream); - stop_char_len = 1; - checked = 0; + result = g_data_input_stream_read_upto (stream, stop_chars, -1, + length, cancellable, error); - while ((found_pos = scan_for_chars (stream, &checked, stop_chars)) == -1) + /* If we're not at end of stream then we have a stop_char to consume. */ + if (result != NULL && g_buffered_input_stream_get_available (bstream) > 0) { - if (g_buffered_input_stream_get_available (bstream) == - g_buffered_input_stream_get_buffer_size (bstream)) - g_buffered_input_stream_set_buffer_size (bstream, - 2 * g_buffered_input_stream_get_buffer_size (bstream)); + gsize res; + gchar b; - res = g_buffered_input_stream_fill (bstream, -1, cancellable, error); - if (res < 0) - return NULL; - if (res == 0) - { - /* End of stream */ - if (g_buffered_input_stream_get_available (bstream) == 0) - { - if (length) - *length = 0; - return NULL; - } - else - { - found_pos = checked; - stop_char_len = 0; - break; - } - } + res = g_input_stream_read (G_INPUT_STREAM (stream), &b, 1, NULL, NULL); + g_assert (res == 1); } - data_until = g_malloc (found_pos + stop_char_len + 1); - - res = g_input_stream_read (G_INPUT_STREAM (stream), - data_until, - found_pos + stop_char_len, - NULL, NULL); - if (length) - *length = (gsize)found_pos; - g_warn_if_fail (res == found_pos + stop_char_len); - data_until[found_pos] = 0; - - return data_until; + return result; } typedef struct @@ -936,6 +910,7 @@ typedef struct GCancellable *cancellable; gchar *stop_chars; + gssize stop_chars_len; gchar *line; gsize length; } GDataInputStreamReadData; @@ -995,8 +970,7 @@ g_data_input_stream_read_line_ready (GObject *object, if (bytes < 0) /* stream error. */ { - g_simple_async_result_set_from_error (data->simple, error); - g_error_free (error); + g_simple_async_result_take_error (data->simple, error); data->checked = 0; } @@ -1011,7 +985,8 @@ g_data_input_stream_read_line_ready (GObject *object, { found_pos = scan_for_chars (data->stream, &data->checked, - data->stop_chars); + data->stop_chars, + data->stop_chars_len); newline_len = 0; } else @@ -1063,6 +1038,7 @@ g_data_input_stream_read_data_free (gpointer user_data) static void g_data_input_stream_read_async (GDataInputStream *stream, const gchar *stop_chars, + gssize stop_chars_len, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -1076,7 +1052,10 @@ g_data_input_stream_read_async (GDataInputStream *stream, if (cancellable) g_object_ref (cancellable); data->cancellable = cancellable; - data->stop_chars = g_strdup (stop_chars); + if (stop_chars_len == -1) + stop_chars_len = strlen (stop_chars); + data->stop_chars = g_memdup (stop_chars, stop_chars_len); + data->stop_chars_len = stop_chars_len; data->io_priority = io_priority; data->last_saw_cr = FALSE; data->checked = 0; @@ -1143,7 +1122,7 @@ g_data_input_stream_read_line_async (GDataInputStream *stream, g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream)); g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - g_data_input_stream_read_async (stream, NULL, io_priority, + g_data_input_stream_read_async (stream, NULL, 0, io_priority, cancellable, callback, user_data, g_data_input_stream_read_line_async); } @@ -1169,6 +1148,11 @@ g_data_input_stream_read_line_async (GDataInputStream *stream, * can then call g_data_input_stream_read_until_finish() to get * the result of the operation. * + * Don't use this function in new code. Its functionality is + * inconsistent with g_data_input_stream_read_until(). Both functions + * will be marked as deprecated in a future release. Use + * g_data_input_stream_read_upto_async() instead. + * * Since: 2.20 */ void @@ -1183,7 +1167,7 @@ g_data_input_stream_read_until_async (GDataInputStream *stream, g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); g_return_if_fail (stop_chars != NULL); - g_data_input_stream_read_async (stream, stop_chars, io_priority, + g_data_input_stream_read_async (stream, stop_chars, -1, io_priority, cancellable, callback, user_data, g_data_input_stream_read_until_async); } @@ -1247,6 +1231,173 @@ g_data_input_stream_read_until_finish (GDataInputStream *stream, return g_data_input_stream_read_finish (stream, result, length, error); } +/** + * g_data_input_stream_read_upto: + * @stream: a #GDataInputStream + * @stop_chars: characters to terminate the read + * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is + * nul-terminated + * @length: a #gsize to get the length of the data read in + * @cancellable: optional #GCancellable object, %NULL to ignore + * @error: #GError for error reporting + * + * Reads a string from the data input stream, up to the first + * occurrence of any of the stop characters. + * + * In contrast to g_data_input_stream_read_until(), this function + * does not consume the stop character. You have + * to use g_data_input_stream_read_byte() to get it before calling + * g_data_input_stream_read_upto() again. + * + * Note that @stop_chars may contain '\0' if @stop_chars_len is + * specified. + * + * Returns: a string with the data that was read before encountering + * any of the stop characters. Set @length to a #gsize to get the length + * of the string. This function will return %NULL on an error + * + * Since: 2.24 + */ +char * +g_data_input_stream_read_upto (GDataInputStream *stream, + const gchar *stop_chars, + gssize stop_chars_len, + gsize *length, + GCancellable *cancellable, + GError **error) +{ + GBufferedInputStream *bstream; + gsize checked; + gssize found_pos; + gssize res; + char *data_until; + + g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), NULL); + + if (stop_chars_len < 0) + stop_chars_len = strlen (stop_chars); + + bstream = G_BUFFERED_INPUT_STREAM (stream); + + checked = 0; + + while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len)) == -1) + { + if (g_buffered_input_stream_get_available (bstream) == + g_buffered_input_stream_get_buffer_size (bstream)) + g_buffered_input_stream_set_buffer_size (bstream, + 2 * g_buffered_input_stream_get_buffer_size (bstream)); -#define __G_DATA_INPUT_STREAM_C__ -#include "gioaliasdef.c" + res = g_buffered_input_stream_fill (bstream, -1, cancellable, error); + if (res < 0) + return NULL; + if (res == 0) + { + /* End of stream */ + if (g_buffered_input_stream_get_available (bstream) == 0) + { + if (length) + *length = 0; + return NULL; + } + else + { + found_pos = checked; + break; + } + } + } + + data_until = g_malloc (found_pos + 1); + + res = g_input_stream_read (G_INPUT_STREAM (stream), + data_until, + found_pos, + NULL, NULL); + if (length) + *length = (gsize)found_pos; + g_warn_if_fail (res == found_pos); + data_until[found_pos] = 0; + + return data_until; +} + +/** + * g_data_input_stream_read_upto_async: + * @stream: a #GDataInputStream + * @stop_chars: characters to terminate the read + * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is + * nul-terminated + * @io_priority: the I/O priority + * of the request. + * @cancellable: optional #GCancellable object, %NULL to ignore + * @callback: callback to call when the request is satisfied + * @user_data: the data to pass to callback function + * + * The asynchronous version of g_data_input_stream_read_upto(). + * It is an error to have two outstanding calls to this function. + * + * In contrast to g_data_input_stream_read_until(), this function + * does not consume the stop character. You have + * to use g_data_input_stream_read_byte() to get it before calling + * g_data_input_stream_read_upto() again. + * + * Note that @stop_chars may contain '\0' if @stop_chars_len is + * specified. + * + * When the operation is finished, @callback will be called. You + * can then call g_data_input_stream_read_upto_finish() to get + * the result of the operation. + * + * Since: 2.24 + */ +void +g_data_input_stream_read_upto_async (GDataInputStream *stream, + const gchar *stop_chars, + gssize stop_chars_len, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (stop_chars != NULL); + + g_data_input_stream_read_async (stream, stop_chars, stop_chars_len, io_priority, + cancellable, callback, user_data, + g_data_input_stream_read_upto_async); +} + +/** + * g_data_input_stream_read_upto_finish: + * @stream: a #GDataInputStream + * @result: the #GAsyncResult that was provided to the callback + * @length: a #gsize to get the length of the data read in + * @error: #GError for error reporting + * + * Finish an asynchronous call started by + * g_data_input_stream_read_upto_async(). + * + * Note that this function does not consume the + * stop character. You have to use g_data_input_stream_read_byte() to + * get it before calling g_data_input_stream_read_upto_async() again. + * + * Returns: a string with the data that was read before encountering + * any of the stop characters. Set @length to a #gsize to get the length + * of the string. This function will return %NULL on an error. + * + * Since: 2.24 + */ +gchar * +g_data_input_stream_read_upto_finish (GDataInputStream *stream, + GAsyncResult *result, + gsize *length, + GError **error) +{ + g_return_val_if_fail ( + g_simple_async_result_is_valid (result, G_OBJECT (stream), + g_data_input_stream_read_upto_async), NULL); + + return g_data_input_stream_read_finish (stream, result, length, error); +} diff --git a/gio/gdatainputstream.h b/gio/gdatainputstream.h index c01ef87..e5724d5 100644 --- a/gio/gdatainputstream.h +++ b/gio/gdatainputstream.h @@ -40,7 +40,6 @@ G_BEGIN_DECLS /** * GDataInputStream: - * @parent: a #GBufferedInputStream. * * An implementation of #GBufferedInputStream that allows for high-level * data manipulation of arbitrary data (including binary operations). @@ -73,36 +72,36 @@ GType g_data_input_stream_get_type (void) G_GNUC_CO GDataInputStream * g_data_input_stream_new (GInputStream *base_stream); void g_data_input_stream_set_byte_order (GDataInputStream *stream, - GDataStreamByteOrder order); + GDataStreamByteOrder order); GDataStreamByteOrder g_data_input_stream_get_byte_order (GDataInputStream *stream); void g_data_input_stream_set_newline_type (GDataInputStream *stream, - GDataStreamNewlineType type); + GDataStreamNewlineType type); GDataStreamNewlineType g_data_input_stream_get_newline_type (GDataInputStream *stream); guchar g_data_input_stream_read_byte (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); gint16 g_data_input_stream_read_int16 (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); guint16 g_data_input_stream_read_uint16 (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); gint32 g_data_input_stream_read_int32 (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); guint32 g_data_input_stream_read_uint32 (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); gint64 g_data_input_stream_read_int64 (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); guint64 g_data_input_stream_read_uint64 (GDataInputStream *stream, - GCancellable *cancellable, - GError **error); + GCancellable *cancellable, + GError **error); char * g_data_input_stream_read_line (GDataInputStream *stream, - gsize *length, - GCancellable *cancellable, - GError **error); + gsize *length, + GCancellable *cancellable, + GError **error); void g_data_input_stream_read_line_async (GDataInputStream *stream, gint io_priority, GCancellable *cancellable, @@ -113,12 +112,12 @@ char * g_data_input_stream_read_line_finish (GDataInputStrea gsize *length, GError **error); char * g_data_input_stream_read_until (GDataInputStream *stream, - const gchar *stop_chars, - gsize *length, - GCancellable *cancellable, - GError **error); + const gchar *stop_chars, + gsize *length, + GCancellable *cancellable, + GError **error); void g_data_input_stream_read_until_async (GDataInputStream *stream, - const gchar *stop_chars, + const gchar *stop_chars, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -128,6 +127,24 @@ char * g_data_input_stream_read_until_finish (GDataInputStrea gsize *length, GError **error); +char * g_data_input_stream_read_upto (GDataInputStream *stream, + const gchar *stop_chars, + gssize stop_chars_len, + gsize *length, + GCancellable *cancellable, + GError **error); +void g_data_input_stream_read_upto_async (GDataInputStream *stream, + const gchar *stop_chars, + gssize stop_chars_len, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +char * g_data_input_stream_read_upto_finish (GDataInputStream *stream, + GAsyncResult *result, + gsize *length, + GError **error); + G_END_DECLS #endif /* __G_DATA_INPUT_STREAM_H__ */ diff --git a/gio/gdataoutputstream.c b/gio/gdataoutputstream.c index 1dc2dd8..b700523 100644 --- a/gio/gdataoutputstream.c +++ b/gio/gdataoutputstream.c @@ -26,7 +26,6 @@ #include "gioenumtypes.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gdataoutputstream @@ -500,7 +499,4 @@ g_data_output_stream_put_string (GDataOutputStream *stream, str, strlen (str), &bytes_written, cancellable, error); -} - -#define __G_DATA_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" +} diff --git a/gio/gdataoutputstream.h b/gio/gdataoutputstream.h index f864b18..0fb3cbf 100644 --- a/gio/gdataoutputstream.h +++ b/gio/gdataoutputstream.h @@ -40,7 +40,6 @@ G_BEGIN_DECLS /** * GDataOutputStream: - * @parent_instance: a #GBufferedOutputStream. * * An implementation of #GBufferedOutputStream that allows for high-level * data manipulation of arbitrary data (including binary operations). diff --git a/gio/gdbus-bash-completion.sh b/gio/gdbus-bash-completion.sh new file mode 100644 index 0000000..79f4cb4 --- /dev/null +++ b/gio/gdbus-bash-completion.sh @@ -0,0 +1,33 @@ + +# Check for bash +[ -z "$BASH_VERSION" ] && return + +#################################################################################################### + + +__gdbus() { + local IFS=$'\n' + local cur=`_get_cword :` + + local suggestions=$(gdbus complete "${COMP_LINE}" ${COMP_POINT}) + COMPREPLY=($(compgen -W "$suggestions" -- "$cur")) + + # Remove colon-word prefix from COMPREPLY items + case "$cur" in + *:*) + case "$COMP_WORDBREAKS" in + *:*) + local colon_word=${cur%${cur##*:}} + local i=${#COMPREPLY[*]} + while [ $((--i)) -ge 0 ]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} + done + ;; + esac + ;; + esac +} + +#################################################################################################### + +complete -o nospace -F __gdbus gdbus diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c new file mode 100644 index 0000000..dad24a4 --- /dev/null +++ b/gio/gdbus-tool.c @@ -0,0 +1,1795 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include +#include + +#include + +#include + +/* ---------------------------------------------------------------------------------------------------- */ + +G_GNUC_UNUSED static void completion_debug (const gchar *format, ...); + +/* Uncomment to get debug traces in /tmp/gdbus-completion-debug.txt (nice + * to not have it interfere with stdout/stderr) + */ +#if 0 +G_GNUC_UNUSED static void +completion_debug (const gchar *format, ...) +{ + va_list var_args; + gchar *s; + static FILE *f = NULL; + + va_start (var_args, format); + s = g_strdup_vprintf (format, var_args); + if (f == NULL) + { + f = fopen ("/tmp/gdbus-completion-debug.txt", "a+"); + } + fprintf (f, "%s\n", s); + g_free (s); +} +#else +static void +completion_debug (const gchar *format, ...) +{ +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + + +static void +remove_arg (gint num, gint *argc, gchar **argv[]) +{ + gint n; + + g_assert (num <= (*argc)); + + for (n = num; (*argv)[n] != NULL; n++) + (*argv)[n] = (*argv)[n+1]; + (*argv)[n] = NULL; + (*argc) = (*argc) - 1; +} + +static void +usage (gint *argc, gchar **argv[], gboolean use_stdout) +{ + GOptionContext *o; + gchar *s; + gchar *program_name; + + o = g_option_context_new (_("COMMAND")); + g_option_context_set_help_enabled (o, FALSE); + /* Ignore parsing result */ + g_option_context_parse (o, argc, argv, NULL); + program_name = g_path_get_basename ((*argv)[0]); + s = g_strdup_printf (_("Commands:\n" + " help Shows this information\n" + " introspect Introspect a remote object\n" + " monitor Monitor a remote object\n" + " call Invoke a method on a remote object\n" + "\n" + "Use \"%s COMMAND --help\" to get help on each command.\n"), + program_name); + g_free (program_name); + g_option_context_set_description (o, s); + g_free (s); + s = g_option_context_get_help (o, FALSE, NULL); + if (use_stdout) + g_print ("%s", s); + else + g_printerr ("%s", s); + g_free (s); + g_option_context_free (o); +} + +static void +modify_argv0_for_command (gint *argc, gchar **argv[], const gchar *command) +{ + gchar *s; + gchar *program_name; + + /* TODO: + * 1. get a g_set_prgname() ?; or + * 2. save old argv[0] and restore later + */ + + g_assert (g_strcmp0 ((*argv)[1], command) == 0); + remove_arg (1, argc, argv); + + program_name = g_path_get_basename ((*argv)[0]); + s = g_strdup_printf ("%s %s", (*argv)[0], command); + (*argv)[0] = s; + g_free (program_name); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +print_methods (GDBusConnection *c, + const gchar *name, + const gchar *path) +{ + GVariant *result; + GError *error; + const gchar *xml_data; + GDBusNodeInfo *node; + guint n; + guint m; + + error = NULL; + result = g_dbus_connection_call_sync (c, + name, + path, + "org.freedesktop.DBus.Introspectable", + "Introspect", + NULL, + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, /* 3 secs */ + NULL, + &error); + if (result == NULL) + { + g_printerr (_("Error: %s\n"), error->message); + g_error_free (error); + goto out; + } + g_variant_get (result, "(&s)", &xml_data); + + error = NULL; + node = g_dbus_node_info_new_for_xml (xml_data, &error); + g_variant_unref (result); + if (node == NULL) + { + g_printerr (_("Error parsing introspection XML: %s\n"), error->message); + g_error_free (error); + goto out; + } + + for (n = 0; node->interfaces != NULL && node->interfaces[n] != NULL; n++) + { + const GDBusInterfaceInfo *iface = node->interfaces[n]; + for (m = 0; iface->methods != NULL && iface->methods[m] != NULL; m++) + { + const GDBusMethodInfo *method = iface->methods[m]; + g_print ("%s.%s \n", iface->name, method->name); + } + } + g_dbus_node_info_unref (node); + + out: + ; +} + +static void +print_paths (GDBusConnection *c, + const gchar *name, + const gchar *path) +{ + GVariant *result; + GError *error; + const gchar *xml_data; + GDBusNodeInfo *node; + guint n; + + error = NULL; + result = g_dbus_connection_call_sync (c, + name, + path, + "org.freedesktop.DBus.Introspectable", + "Introspect", + NULL, + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, /* 3 secs */ + NULL, + &error); + if (result == NULL) + { + g_printerr (_("Error: %s\n"), error->message); + g_error_free (error); + goto out; + } + g_variant_get (result, "(&s)", &xml_data); + + //g_printerr ("xml=`%s'", xml_data); + + error = NULL; + node = g_dbus_node_info_new_for_xml (xml_data, &error); + g_variant_unref (result); + if (node == NULL) + { + g_printerr (_("Error parsing introspection XML: %s\n"), error->message); + g_error_free (error); + goto out; + } + + //g_printerr ("bar `%s'\n", path); + + if (node->interfaces != NULL) + g_print ("%s \n", path); + + for (n = 0; node->nodes != NULL && node->nodes[n] != NULL; n++) + { + gchar *s; + + //g_printerr ("foo `%s'\n", node->nodes[n].path); + + if (g_strcmp0 (path, "/") == 0) + s = g_strdup_printf ("/%s", node->nodes[n]->path); + else + s = g_strdup_printf ("%s/%s", path, node->nodes[n]->path); + + print_paths (c, name, s); + + g_free (s); + } + g_dbus_node_info_unref (node); + + out: + ; +} + +static void +print_names (GDBusConnection *c, + gboolean include_unique_names) +{ + GVariant *result; + GError *error; + GVariantIter *iter; + gchar *str; + GHashTable *name_set; + GList *keys; + GList *l; + + name_set = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + + error = NULL; + result = g_dbus_connection_call_sync (c, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "ListNames", + NULL, + G_VARIANT_TYPE ("(as)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, /* 3 secs */ + NULL, + &error); + if (result == NULL) + { + g_printerr (_("Error: %s\n"), error->message); + g_error_free (error); + goto out; + } + g_variant_get (result, "(as)", &iter); + while (g_variant_iter_loop (iter, "s", &str)) + g_hash_table_insert (name_set, g_strdup (str), NULL); + g_variant_iter_free (iter); + g_variant_unref (result); + + error = NULL; + result = g_dbus_connection_call_sync (c, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "ListActivatableNames", + NULL, + G_VARIANT_TYPE ("(as)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, /* 3 secs */ + NULL, + &error); + if (result == NULL) + { + g_printerr (_("Error: %s\n"), error->message); + g_error_free (error); + goto out; + } + g_variant_get (result, "(as)", &iter); + while (g_variant_iter_loop (iter, "s", &str)) + g_hash_table_insert (name_set, g_strdup (str), NULL); + g_variant_iter_free (iter); + g_variant_unref (result); + + keys = g_hash_table_get_keys (name_set); + keys = g_list_sort (keys, (GCompareFunc) g_strcmp0); + for (l = keys; l != NULL; l = l->next) + { + const gchar *name = l->data; + if (!include_unique_names && g_str_has_prefix (name, ":")) + continue; + + g_print ("%s \n", name); + } + g_list_free (keys); + + out: + g_hash_table_unref (name_set); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean opt_connection_system = FALSE; +static gboolean opt_connection_session = FALSE; +static gchar *opt_connection_address = NULL; + +static const GOptionEntry connection_entries[] = +{ + { "system", 'y', 0, G_OPTION_ARG_NONE, &opt_connection_system, N_("Connect to the system bus"), NULL}, + { "session", 'e', 0, G_OPTION_ARG_NONE, &opt_connection_session, N_("Connect to the session bus"), NULL}, + { "address", 'a', 0, G_OPTION_ARG_STRING, &opt_connection_address, N_("Connect to given D-Bus address"), NULL}, + { NULL } +}; + +static GOptionGroup * +connection_get_group (void) +{ + static GOptionGroup *g; + + g = g_option_group_new ("connection", + N_("Connection Endpoint Options:"), + N_("Options specifying the connection endpoint"), + NULL, + NULL); + g_option_group_add_entries (g, connection_entries); + return g; +} + +static GDBusConnection * +connection_get_dbus_connection (GError **error) +{ + GDBusConnection *c; + + c = NULL; + + /* First, ensure we have exactly one connect */ + if (!opt_connection_system && !opt_connection_session && opt_connection_address == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("No connection endpoint specified")); + goto out; + } + else if ((opt_connection_system && (opt_connection_session || opt_connection_address != NULL)) || + (opt_connection_session && (opt_connection_system || opt_connection_address != NULL)) || + (opt_connection_address != NULL && (opt_connection_system || opt_connection_session))) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Multiple connection endpoints specified")); + goto out; + } + + if (opt_connection_system) + { + c = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, error); + } + else if (opt_connection_session) + { + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error); + } + else if (opt_connection_address != NULL) + { + c = g_dbus_connection_new_for_address_sync (opt_connection_address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + error); + } + + out: + return c; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GPtrArray * +call_helper_get_method_in_signature (GDBusConnection *c, + const gchar *dest, + const gchar *path, + const gchar *interface_name, + const gchar *method_name, + GError **error) +{ + GPtrArray *ret; + GVariant *result; + GDBusNodeInfo *node_info; + const gchar *xml_data; + GDBusInterfaceInfo *interface_info; + GDBusMethodInfo *method_info; + guint n; + + ret = NULL; + result = NULL; + node_info = NULL; + + result = g_dbus_connection_call_sync (c, + dest, + path, + "org.freedesktop.DBus.Introspectable", + "Introspect", + NULL, + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, /* 3 secs */ + NULL, + error); + if (result == NULL) + goto out; + + g_variant_get (result, "(&s)", &xml_data); + node_info = g_dbus_node_info_new_for_xml (xml_data, error); + if (node_info == NULL) + goto out; + + interface_info = g_dbus_node_info_lookup_interface (node_info, interface_name); + if (interface_info == NULL) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Warning: According to introspection data, interface `%s' does not exist\n"), + interface_name); + goto out; + } + + method_info = g_dbus_interface_info_lookup_method (interface_info, method_name); + if (method_info == NULL) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Warning: According to introspection data, method `%s' does not exist on interface `%s'\n"), + method_name, + interface_name); + goto out; + } + + ret = g_ptr_array_new_with_free_func ((GDestroyNotify) g_variant_type_free); + for (n = 0; method_info->in_args != NULL && method_info->in_args[n] != NULL; n++) + { + g_ptr_array_add (ret, g_variant_type_new (method_info->in_args[n]->signature)); + } + + out: + if (node_info != NULL) + g_dbus_node_info_unref (node_info); + if (result != NULL) + g_variant_unref (result); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GVariant * +_g_variant_parse_me_harder (GVariantType *type, + const gchar *given_str, + GError **error) +{ + GVariant *value; + gchar *s; + guint n; + GString *str; + + str = g_string_new ("\""); + for (n = 0; given_str[n] != '\0'; n++) + { + if (G_UNLIKELY (given_str[n] == '\"')) + g_string_append (str, "\\\""); + else + g_string_append_c (str, given_str[n]); + } + g_string_append_c (str, '"'); + s = g_string_free (str, FALSE); + + value = g_variant_parse (type, + s, + NULL, + NULL, + error); + g_free (s); + + return value; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar *opt_call_dest = NULL; +static gchar *opt_call_object_path = NULL; +static gchar *opt_call_method = NULL; + +static const GOptionEntry call_entries[] = +{ + { "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_call_dest, N_("Destination name to invoke method on"), NULL}, + { "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_call_object_path, N_("Object path to invoke method on"), NULL}, + { "method", 'm', 0, G_OPTION_ARG_STRING, &opt_call_method, N_("Method and interface name"), NULL}, + { NULL } +}; + +static gboolean +handle_call (gint *argc, + gchar **argv[], + gboolean request_completion, + const gchar *completion_cur, + const gchar *completion_prev) +{ + gint ret; + GOptionContext *o; + gchar *s; + GError *error; + GDBusConnection *c; + GVariant *parameters; + gchar *interface_name; + gchar *method_name; + GVariant *result; + GPtrArray *in_signature_types; + gboolean complete_names; + gboolean complete_paths; + gboolean complete_methods; + GVariantBuilder builder; + guint n; + + ret = FALSE; + c = NULL; + parameters = NULL; + interface_name = NULL; + method_name = NULL; + result = NULL; + in_signature_types = NULL; + + modify_argv0_for_command (argc, argv, "call"); + + o = g_option_context_new (NULL); + g_option_context_set_help_enabled (o, FALSE); + g_option_context_set_summary (o, _("Invoke a method on a remote object.")); + g_option_context_add_main_entries (o, call_entries, NULL /* GETTEXT_PACKAGE*/); + g_option_context_add_group (o, connection_get_group ()); + + complete_names = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--dest") == 0) + { + complete_names = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + complete_paths = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--object-path") == 0) + { + complete_paths = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + complete_methods = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--method") == 0) + { + complete_methods = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + if (!g_option_context_parse (o, argc, argv, NULL)) + { + if (!request_completion) + { + s = g_option_context_get_help (o, FALSE, NULL); + g_printerr ("%s", s); + g_free (s); + goto out; + } + } + + error = NULL; + c = connection_get_dbus_connection (&error); + if (c == NULL) + { + if (request_completion) + { + if (g_strcmp0 (completion_prev, "--address") == 0) + { + g_print ("unix:\n" + "tcp:\n" + "nonce-tcp:\n"); + } + else + { + g_print ("--system \n--session \n--address \n"); + } + } + else + { + g_printerr (_("Error connecting: %s\n"), error->message); + g_error_free (error); + } + goto out; + } + + /* validate and complete destination (bus name) */ + if (g_dbus_connection_get_unique_name (c) != NULL) + { + /* this only makes sense on message bus connections */ + if (complete_names) + { + print_names (c, FALSE); + goto out; + } + if (opt_call_dest == NULL) + { + if (request_completion) + g_print ("--dest \n"); + else + g_printerr (_("Error: Destination is not specified\n")); + goto out; + } + if (request_completion && g_strcmp0 ("--dest", completion_prev) == 0) + { + print_names (c, g_str_has_prefix (opt_call_dest, ":")); + goto out; + } + } + + /* validate and complete object path */ + if (complete_paths) + { + print_paths (c, opt_call_dest, "/"); + goto out; + } + if (opt_call_object_path == NULL) + { + if (request_completion) + g_print ("--object-path \n"); + else + g_printerr (_("Error: Object path is not specified\n")); + goto out; + } + if (request_completion && g_strcmp0 ("--object-path", completion_prev) == 0) + { + gchar *p; + s = g_strdup (opt_call_object_path); + p = strrchr (s, '/'); + if (p != NULL) + { + if (p == s) + p++; + *p = '\0'; + } + print_paths (c, opt_call_dest, s); + g_free (s); + goto out; + } + if (!request_completion && !g_variant_is_object_path (opt_call_object_path)) + { + g_printerr (_("Error: %s is not a valid object path\n"), opt_call_object_path); + goto out; + } + + /* validate and complete method (interface + method name) */ + if (complete_methods) + { + print_methods (c, opt_call_dest, opt_call_object_path); + goto out; + } + if (opt_call_method == NULL) + { + if (request_completion) + g_print ("--method \n"); + else + g_printerr (_("Error: Method name is not specified\n")); + goto out; + } + if (request_completion && g_strcmp0 ("--method", completion_prev) == 0) + { + print_methods (c, opt_call_dest, opt_call_object_path); + goto out; + } + s = strrchr (opt_call_method, '.'); + if (!request_completion && s == NULL) + { + g_printerr (_("Error: Method name `%s' is invalid\n"), opt_call_method); + goto out; + } + method_name = g_strdup (s + 1); + interface_name = g_strndup (opt_call_method, s - opt_call_method); + + /* All done with completion now */ + if (request_completion) + goto out; + + /* Introspect, for easy conversion - it's not fatal if we can't do this */ + in_signature_types = call_helper_get_method_in_signature (c, + opt_call_dest, + opt_call_object_path, + interface_name, + method_name, + &error); + if (in_signature_types == NULL) + { + //g_printerr ("Error getting introspection data: %s\n", error->message); + g_error_free (error); + error = NULL; + } + + /* Read parameters */ + g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE); + for (n = 1; n < (guint) *argc; n++) + { + GVariant *value; + GVariantType *type; + + type = NULL; + if (in_signature_types != NULL) + { + if (n - 1 >= in_signature_types->len) + { + /* Only warn for the first param */ + if (n - 1 == in_signature_types->len) + { + g_printerr ("Warning: Introspection data indicates %d parameters but more was passed\n", + in_signature_types->len); + } + } + else + { + type = in_signature_types->pdata[n - 1]; + } + } + + error = NULL; + value = g_variant_parse (type, + (*argv)[n], + NULL, + NULL, + &error); + if (value == NULL) + { + g_error_free (error); + error = NULL; + value = _g_variant_parse_me_harder (type, (*argv)[n], &error); + if (value == NULL) + { + if (type != NULL) + { + s = g_variant_type_dup_string (type); + g_printerr (_("Error parsing parameter %d of type `%s': %s\n"), + n, + s, + error->message); + g_free (s); + } + else + { + g_printerr (_("Error parsing parameter %d: %s\n"), + n, + error->message); + } + g_error_free (error); + g_variant_builder_clear (&builder); + goto out; + } + } + g_variant_builder_add_value (&builder, value); + } + parameters = g_variant_builder_end (&builder); + + if (parameters != NULL) + parameters = g_variant_ref_sink (parameters); + result = g_dbus_connection_call_sync (c, + opt_call_dest, + opt_call_object_path, + interface_name, + method_name, + parameters, + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + if (result == NULL) + { + g_printerr (_("Error: %s\n"), error->message); + g_error_free (error); + if (in_signature_types != NULL) + { + GString *s; + s = g_string_new (NULL); + for (n = 0; n < in_signature_types->len; n++) + { + GVariantType *type = in_signature_types->pdata[n]; + g_string_append_len (s, + g_variant_type_peek_string (type), + g_variant_type_get_string_length (type)); + } + g_printerr ("(According to introspection data, you need to pass `%s')\n", s->str); + g_string_free (s, TRUE); + } + goto out; + } + + s = g_variant_print (result, TRUE); + g_print ("%s\n", s); + g_free (s); + + ret = TRUE; + + out: + if (in_signature_types != NULL) + g_ptr_array_unref (in_signature_types); + if (result != NULL) + g_variant_unref (result); + if (c != NULL) + g_object_unref (c); + if (parameters != NULL) + g_variant_unref (parameters); + g_free (interface_name); + g_free (method_name); + g_option_context_free (o); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* TODO: dump annotations */ + +static void +dump_annotation (const GDBusAnnotationInfo *o, + guint indent, + gboolean ignore_indent) +{ + guint n; + g_print ("%*s@%s(\"%s\")\n", + ignore_indent ? 0 : indent, "", + o->key, + o->value); + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + dump_annotation (o->annotations[n], indent + 2, FALSE); +} + +static void +dump_arg (const GDBusArgInfo *o, + guint indent, + const gchar *direction, + gboolean ignore_indent, + gboolean include_newline) +{ + guint n; + + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + { + dump_annotation (o->annotations[n], indent, ignore_indent); + ignore_indent = FALSE; + } + + g_print ("%*s%s%s %s%s", + ignore_indent ? 0 : indent, "", + direction, + o->signature, + o->name, + include_newline ? ",\n" : ""); +} + +static guint +count_args (GDBusArgInfo **args) +{ + guint n; + n = 0; + if (args == NULL) + goto out; + while (args[n] != NULL) + n++; + out: + return n; +} + +static void +dump_method (const GDBusMethodInfo *o, + guint indent) +{ + guint n; + guint m; + guint name_len; + guint total_num_args; + + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + dump_annotation (o->annotations[n], indent, FALSE); + + g_print ("%*s%s(", indent, "", o->name); + name_len = strlen (o->name); + total_num_args = count_args (o->in_args) + count_args (o->out_args); + for (n = 0, m = 0; o->in_args != NULL && o->in_args[n] != NULL; n++, m++) + { + gboolean ignore_indent = (m == 0); + gboolean include_newline = (m != total_num_args - 1); + + dump_arg (o->in_args[n], + indent + name_len + 1, + "in ", + ignore_indent, + include_newline); + } + for (n = 0; o->out_args != NULL && o->out_args[n] != NULL; n++, m++) + { + gboolean ignore_indent = (m == 0); + gboolean include_newline = (m != total_num_args - 1); + dump_arg (o->out_args[n], + indent + name_len + 1, + "out ", + ignore_indent, + include_newline); + } + g_print (");\n"); +} + +static void +dump_signal (const GDBusSignalInfo *o, + guint indent) +{ + guint n; + guint name_len; + guint total_num_args; + + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + dump_annotation (o->annotations[n], indent, FALSE); + + g_print ("%*s%s(", indent, "", o->name); + name_len = strlen (o->name); + total_num_args = count_args (o->args); + for (n = 0; o->args != NULL && o->args[n] != NULL; n++) + { + gboolean ignore_indent = (n == 0); + gboolean include_newline = (n != total_num_args - 1); + dump_arg (o->args[n], + indent + name_len + 1, + "", + ignore_indent, + include_newline); + } + g_print (");\n"); +} + +static void +dump_property (const GDBusPropertyInfo *o, + guint indent, + GVariant *value) +{ + const gchar *access; + guint n; + + if (o->flags == G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + access = "readonly"; + else if (o->flags == G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE) + access = "writeonly"; + else if (o->flags == (G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE)) + access = "readwrite"; + else + g_assert_not_reached (); + + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + dump_annotation (o->annotations[n], indent, FALSE); + + if (value != NULL) + { + gchar *s = g_variant_print (value, FALSE); + g_print ("%*s%s %s %s = %s;\n", indent, "", access, o->signature, o->name, s); + g_free (s); + } + else + { + g_print ("%*s%s %s %s;\n", indent, "", access, o->signature, o->name); + } +} + +static void +dump_interface (GDBusConnection *c, + const gchar *name, + const GDBusInterfaceInfo *o, + guint indent, + const gchar *object_path) +{ + guint n; + GHashTable *properties; + + properties = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + (GDestroyNotify) g_variant_unref); + + /* Try to get properties */ + if (c != NULL && name != NULL && object_path != NULL && o->properties != NULL) + { + GVariant *result; + result = g_dbus_connection_call_sync (c, + name, + object_path, + "org.freedesktop.DBus.Properties", + "GetAll", + g_variant_new ("(s)", o->name), + NULL, + G_DBUS_CALL_FLAGS_NONE, + 3000, + NULL, + NULL); + if (result != NULL) + { + if (g_variant_is_of_type (result, G_VARIANT_TYPE ("(a{sv})"))) + { + GVariantIter *iter; + GVariant *item; + g_variant_get (result, + "(a{sv})", + &iter); + while ((item = g_variant_iter_next_value (iter))) + { + gchar *key; + GVariant *value; + g_variant_get (item, + "{sv}", + &key, + &value); + + g_hash_table_insert (properties, key, g_variant_ref (value)); + } + } + g_variant_unref (result); + } + else + { + guint n; + for (n = 0; o->properties != NULL && o->properties[n] != NULL; n++) + { + result = g_dbus_connection_call_sync (c, + name, + object_path, + "org.freedesktop.DBus.Properties", + "Get", + g_variant_new ("(ss)", o->name, o->properties[n]->name), + G_VARIANT_TYPE ("(v)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, + NULL, + NULL); + if (result != NULL) + { + GVariant *property_value; + g_variant_get (result, + "(v)", + &property_value); + g_hash_table_insert (properties, + g_strdup (o->properties[n]->name), + g_variant_ref (property_value)); + g_variant_unref (result); + } + } + } + } + + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + dump_annotation (o->annotations[n], indent, FALSE); + + g_print ("%*sinterface %s {\n", indent, "", o->name); + if (o->methods != NULL) + { + g_print ("%*s methods:\n", indent, ""); + for (n = 0; o->methods[n] != NULL; n++) + dump_method (o->methods[n], indent + 4); + } + if (o->signals != NULL) + { + g_print ("%*s signals:\n", indent, ""); + for (n = 0; o->signals[n] != NULL; n++) + dump_signal (o->signals[n], indent + 4); + } + if (o->properties != NULL) + { + g_print ("%*s properties:\n", indent, ""); + for (n = 0; o->properties[n] != NULL; n++) + { + dump_property (o->properties[n], + indent + 4, + g_hash_table_lookup (properties, (o->properties[n])->name)); + } + } + g_print ("%*s};\n", + indent, ""); + + g_hash_table_unref (properties); +} + +static void +dump_node (GDBusConnection *c, + const gchar *name, + const GDBusNodeInfo *o, + guint indent, + const gchar *object_path) +{ + guint n; + const gchar *object_path_to_print; + + object_path_to_print = object_path; + if (o->path != NULL) + object_path_to_print = o->path; + + for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++) + dump_annotation (o->annotations[n], indent, FALSE); + + g_print ("%*snode %s", indent, "", object_path_to_print != NULL ? object_path_to_print : "(not set)"); + if (o->interfaces != NULL || o->nodes != NULL) + { + g_print (" {\n"); + for (n = 0; o->interfaces != NULL && o->interfaces[n] != NULL; n++) + dump_interface (c, name, o->interfaces[n], indent + 2, object_path); + for (n = 0; o->nodes != NULL && o->nodes[n] != NULL; n++) + dump_node (NULL, NULL, o->nodes[n], indent + 2, NULL); + g_print ("%*s};\n", + indent, ""); + } + else + { + g_print ("\n"); + } +} + +static gchar *opt_introspect_dest = NULL; +static gchar *opt_introspect_object_path = NULL; +static gboolean opt_introspect_xml = FALSE; + +static const GOptionEntry introspect_entries[] = +{ + { "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_introspect_dest, N_("Destination name to introspect"), NULL}, + { "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_introspect_object_path, N_("Object path to introspect"), NULL}, + { "xml", 'x', 0, G_OPTION_ARG_NONE, &opt_introspect_xml, N_("Print XML"), NULL}, + { NULL } +}; + +static gboolean +handle_introspect (gint *argc, + gchar **argv[], + gboolean request_completion, + const gchar *completion_cur, + const gchar *completion_prev) +{ + gint ret; + GOptionContext *o; + gchar *s; + GError *error; + GDBusConnection *c; + GVariant *result; + const gchar *xml_data; + GDBusNodeInfo *node; + gboolean complete_names; + gboolean complete_paths; + + ret = FALSE; + c = NULL; + node = NULL; + result = NULL; + + modify_argv0_for_command (argc, argv, "introspect"); + + o = g_option_context_new (NULL); + if (request_completion) + g_option_context_set_ignore_unknown_options (o, TRUE); + g_option_context_set_help_enabled (o, FALSE); + g_option_context_set_summary (o, _("Introspect a remote object.")); + g_option_context_add_main_entries (o, introspect_entries, NULL /* GETTEXT_PACKAGE*/); + g_option_context_add_group (o, connection_get_group ()); + + complete_names = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--dest") == 0) + { + complete_names = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + complete_paths = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--object-path") == 0) + { + complete_paths = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + if (!g_option_context_parse (o, argc, argv, NULL)) + { + if (!request_completion) + { + s = g_option_context_get_help (o, FALSE, NULL); + g_printerr ("%s", s); + g_free (s); + goto out; + } + } + + error = NULL; + c = connection_get_dbus_connection (&error); + if (c == NULL) + { + if (request_completion) + { + if (g_strcmp0 (completion_prev, "--address") == 0) + { + g_print ("unix:\n" + "tcp:\n" + "nonce-tcp:\n"); + } + else + { + g_print ("--system \n--session \n--address \n"); + } + } + else + { + g_printerr (_("Error connecting: %s\n"), error->message); + g_error_free (error); + } + goto out; + } + + if (g_dbus_connection_get_unique_name (c) != NULL) + { + if (complete_names) + { + print_names (c, FALSE); + goto out; + } + /* this only makes sense on message bus connections */ + if (opt_introspect_dest == NULL) + { + if (request_completion) + g_print ("--dest \n"); + else + g_printerr (_("Error: Destination is not specified\n")); + goto out; + } + if (request_completion && g_strcmp0 ("--dest", completion_prev) == 0) + { + print_names (c, g_str_has_prefix (opt_introspect_dest, ":")); + goto out; + } + } + if (complete_paths) + { + print_paths (c, opt_introspect_dest, "/"); + goto out; + } + if (opt_introspect_object_path == NULL) + { + if (request_completion) + g_print ("--object-path \n"); + else + g_printerr (_("Error: Object path is not specified\n")); + goto out; + } + if (request_completion && g_strcmp0 ("--object-path", completion_prev) == 0) + { + gchar *p; + s = g_strdup (opt_introspect_object_path); + p = strrchr (s, '/'); + if (p != NULL) + { + if (p == s) + p++; + *p = '\0'; + } + print_paths (c, opt_introspect_dest, s); + g_free (s); + goto out; + } + if (!request_completion && !g_variant_is_object_path (opt_introspect_object_path)) + { + g_printerr (_("Error: %s is not a valid object path\n"), opt_introspect_object_path); + goto out; + } + + /* All done with completion now */ + if (request_completion) + goto out; + + result = g_dbus_connection_call_sync (c, + opt_introspect_dest, + opt_introspect_object_path, + "org.freedesktop.DBus.Introspectable", + "Introspect", + NULL, + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + 3000, /* 3 sec */ + NULL, + &error); + if (result == NULL) + { + g_printerr (_("Error: %s\n"), error->message); + g_error_free (error); + goto out; + } + g_variant_get (result, "(&s)", &xml_data); + + if (opt_introspect_xml) + { + g_print ("%s", xml_data); + } + else + { + error = NULL; + node = g_dbus_node_info_new_for_xml (xml_data, &error); + if (node == NULL) + { + g_printerr (_("Error parsing introspection XML: %s\n"), error->message); + g_error_free (error); + goto out; + } + + dump_node (c, opt_introspect_dest, node, 0, opt_introspect_object_path); + } + + ret = TRUE; + + out: + if (node != NULL) + g_dbus_node_info_unref (node); + if (result != NULL) + g_variant_unref (result); + if (c != NULL) + g_object_unref (c); + g_option_context_free (o); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar *opt_monitor_dest = NULL; +static gchar *opt_monitor_object_path = NULL; + +static guint monitor_filter_id = 0; + +static void +monitor_signal_cb (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + gchar *s; + s = g_variant_print (parameters, TRUE); + g_print ("%s: %s.%s %s\n", + object_path, + interface_name, + signal_name, + s); + g_free (s); +} + +static void +monitor_on_name_appeared (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data) +{ + g_print ("The name %s is owned by %s\n", name, name_owner); + g_assert (monitor_filter_id == 0); + monitor_filter_id = g_dbus_connection_signal_subscribe (connection, + name_owner, + NULL, /* any interface */ + NULL, /* any member */ + opt_monitor_object_path, + NULL, /* arg0 */ + G_DBUS_SIGNAL_FLAGS_NONE, + monitor_signal_cb, + NULL, /* user_data */ + NULL); /* user_data destroy notify */ +} + +static void +monitor_on_name_vanished (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + g_print ("The name %s does not have an owner\n", name); + + if (monitor_filter_id != 0) + { + g_dbus_connection_signal_unsubscribe (connection, monitor_filter_id); + monitor_filter_id = 0; + } +} + +static const GOptionEntry monitor_entries[] = +{ + { "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_monitor_dest, N_("Destination name to monitor"), NULL}, + { "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_monitor_object_path, N_("Object path to monitor"), NULL}, + { NULL } +}; + +static gboolean +handle_monitor (gint *argc, + gchar **argv[], + gboolean request_completion, + const gchar *completion_cur, + const gchar *completion_prev) +{ + gint ret; + GOptionContext *o; + gchar *s; + GError *error; + GDBusConnection *c; + GVariant *result; + GDBusNodeInfo *node; + gboolean complete_names; + gboolean complete_paths; + GMainLoop *loop; + + ret = FALSE; + c = NULL; + node = NULL; + result = NULL; + + modify_argv0_for_command (argc, argv, "monitor"); + + o = g_option_context_new (NULL); + if (request_completion) + g_option_context_set_ignore_unknown_options (o, TRUE); + g_option_context_set_help_enabled (o, FALSE); + g_option_context_set_summary (o, _("Monitor a remote object.")); + g_option_context_add_main_entries (o, monitor_entries, NULL /* GETTEXT_PACKAGE*/); + g_option_context_add_group (o, connection_get_group ()); + + complete_names = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--dest") == 0) + { + complete_names = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + complete_paths = FALSE; + if (request_completion && *argc > 1 && g_strcmp0 ((*argv)[(*argc)-1], "--object-path") == 0) + { + complete_paths = TRUE; + remove_arg ((*argc) - 1, argc, argv); + } + + if (!g_option_context_parse (o, argc, argv, NULL)) + { + if (!request_completion) + { + s = g_option_context_get_help (o, FALSE, NULL); + g_printerr ("%s", s); + g_free (s); + goto out; + } + } + + error = NULL; + c = connection_get_dbus_connection (&error); + if (c == NULL) + { + if (request_completion) + { + if (g_strcmp0 (completion_prev, "--address") == 0) + { + g_print ("unix:\n" + "tcp:\n" + "nonce-tcp:\n"); + } + else + { + g_print ("--system \n--session \n--address \n"); + } + } + else + { + g_printerr (_("Error connecting: %s\n"), error->message); + g_error_free (error); + } + goto out; + } + + if (g_dbus_connection_get_unique_name (c) != NULL) + { + if (complete_names) + { + print_names (c, FALSE); + goto out; + } + /* this only makes sense on message bus connections */ + if (opt_monitor_dest == NULL) + { + if (request_completion) + g_print ("--dest \n"); + else + g_printerr (_("Error: Destination is not specified\n")); + goto out; + } + if (request_completion && g_strcmp0 ("--dest", completion_prev) == 0) + { + print_names (c, g_str_has_prefix (opt_monitor_dest, ":")); + goto out; + } + } + if (complete_paths) + { + print_paths (c, opt_monitor_dest, "/"); + goto out; + } + if (opt_monitor_object_path == NULL) + { + if (request_completion) + { + g_print ("--object-path \n"); + goto out; + } + /* it's fine to not have an object path */ + } + if (request_completion && g_strcmp0 ("--object-path", completion_prev) == 0) + { + gchar *p; + s = g_strdup (opt_monitor_object_path); + p = strrchr (s, '/'); + if (p != NULL) + { + if (p == s) + p++; + *p = '\0'; + } + print_paths (c, opt_monitor_dest, s); + g_free (s); + goto out; + } + if (!request_completion && (opt_monitor_object_path != NULL && !g_variant_is_object_path (opt_monitor_object_path))) + { + g_printerr (_("Error: %s is not a valid object path\n"), opt_monitor_object_path); + goto out; + } + + /* All done with completion now */ + if (request_completion) + goto out; + + if (opt_monitor_object_path != NULL) + g_print ("Monitoring signals on object %s owned by %s\n", opt_monitor_object_path, opt_monitor_dest); + else + g_print ("Monitoring signals from all objects owned by %s\n", opt_monitor_dest); + + loop = g_main_loop_new (NULL, FALSE); + g_bus_watch_name_on_connection (c, + opt_monitor_dest, + G_BUS_NAME_WATCHER_FLAGS_AUTO_START, + monitor_on_name_appeared, + monitor_on_name_vanished, + NULL, + NULL); + + g_main_loop_run (loop); + g_main_loop_unref (loop); + + ret = TRUE; + + out: + if (node != NULL) + g_dbus_node_info_unref (node); + if (result != NULL) + g_variant_unref (result); + if (c != NULL) + g_object_unref (c); + g_option_context_free (o); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar * +pick_word_at (const gchar *s, + gint cursor, + gint *out_word_begins_at) +{ + gint begin; + gint end; + + if (s[0] == '\0') + { + if (out_word_begins_at != NULL) + *out_word_begins_at = -1; + return NULL; + } + + if (g_ascii_isspace (s[cursor]) && ((cursor > 0 && g_ascii_isspace(s[cursor-1])) || cursor == 0)) + { + if (out_word_begins_at != NULL) + *out_word_begins_at = cursor; + return g_strdup (""); + } + + while (!g_ascii_isspace (s[cursor - 1]) && cursor > 0) + cursor--; + begin = cursor; + + end = begin; + while (!g_ascii_isspace (s[end]) && s[end] != '\0') + end++; + + if (out_word_begins_at != NULL) + *out_word_begins_at = begin; + + return g_strndup (s + begin, end - begin); +} + +gint +main (gint argc, gchar *argv[]) +{ + gint ret; + const gchar *command; + gboolean request_completion; + gchar *completion_cur; + gchar *completion_prev; + + ret = 1; + completion_cur = NULL; + completion_prev = NULL; + + g_type_init (); + + if (argc < 2) + { + usage (&argc, &argv, FALSE); + goto out; + } + + request_completion = FALSE; + + //completion_debug ("---- argc=%d --------------------------------------------------------", argc); + + again: + command = argv[1]; + if (g_strcmp0 (command, "help") == 0) + { + if (request_completion) + { + /* do nothing */ + } + else + { + usage (&argc, &argv, TRUE); + ret = 0; + } + goto out; + } + else if (g_strcmp0 (command, "call") == 0) + { + if (handle_call (&argc, + &argv, + request_completion, + completion_cur, + completion_prev)) + ret = 0; + goto out; + } + else if (g_strcmp0 (command, "introspect") == 0) + { + if (handle_introspect (&argc, + &argv, + request_completion, + completion_cur, + completion_prev)) + ret = 0; + goto out; + } + else if (g_strcmp0 (command, "monitor") == 0) + { + if (handle_monitor (&argc, + &argv, + request_completion, + completion_cur, + completion_prev)) + ret = 0; + goto out; + } + else if (g_strcmp0 (command, "complete") == 0 && argc == 4 && !request_completion) + { + const gchar *completion_line; + gchar **completion_argv; + gint completion_argc; + gint completion_point; + gchar *endp; + gint cur_begin; + + request_completion = TRUE; + + completion_line = argv[2]; + completion_point = strtol (argv[3], &endp, 10); + if (endp == argv[3] || *endp != '\0') + goto out; + +#if 0 + completion_debug ("completion_point=%d", completion_point); + completion_debug ("----"); + completion_debug (" 0123456789012345678901234567890123456789012345678901234567890123456789"); + completion_debug ("`%s'", completion_line); + completion_debug (" %*s^", + completion_point, ""); + completion_debug ("----"); +#endif + + if (!g_shell_parse_argv (completion_line, + &completion_argc, + &completion_argv, + NULL)) + { + /* it's very possible the command line can't be parsed (for + * example, missing quotes etc) - in that case, we just + * don't autocomplete at all + */ + goto out; + } + + /* compute cur and prev */ + completion_prev = NULL; + completion_cur = pick_word_at (completion_line, completion_point, &cur_begin); + if (cur_begin > 0) + { + gint prev_end; + for (prev_end = cur_begin - 1; prev_end >= 0; prev_end--) + { + if (!g_ascii_isspace (completion_line[prev_end])) + { + completion_prev = pick_word_at (completion_line, prev_end, NULL); + break; + } + } + } +#if 0 + completion_debug (" cur=`%s'", completion_cur); + completion_debug ("prev=`%s'", completion_prev); +#endif + + argc = completion_argc; + argv = completion_argv; + + ret = 0; + + goto again; + } + else + { + if (request_completion) + { + g_print ("help \ncall \nintrospect \nmonitor \n"); + ret = 0; + goto out; + } + else + { + g_printerr ("Unknown command `%s'\n", command); + usage (&argc, &argv, FALSE); + goto out; + } + } + + out: + g_free (completion_cur); + g_free (completion_prev); + return ret; +} diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c new file mode 100644 index 0000000..83e7699 --- /dev/null +++ b/gio/gdbusaddress.c @@ -0,0 +1,1289 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include +#include +#include + +#include "gioerror.h" +#include "gdbusutils.h" +#include "gdbusaddress.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" +#include "gnetworkaddress.h" +#include "gsocketclient.h" +#include "giostream.h" +#include "gasyncresult.h" +#include "gsimpleasyncresult.h" +#include "gdbusprivate.h" + +#ifdef G_OS_UNIX +#include +#include +#endif + +#include "glibintl.h" + +/** + * SECTION:gdbusaddress + * @title: D-Bus Addresses + * @short_description: D-Bus connection endpoints + * @include: gio/gio.h + * + * Routines for working with D-Bus addresses. A D-Bus address is a string + * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses + * is explained in detail in the D-Bus specification. + */ + +static gchar *get_session_address_platform_specific (GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_is_address: + * @string: A string. + * + * Checks if @string is a D-Bus address. + * + * This doesn't check if @string is actually supported by #GDBusServer + * or #GDBusConnection - use g_dbus_is_supported_address() to do more + * checks. + * + * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_address (const gchar *string) +{ + guint n; + gchar **a; + gboolean ret; + + ret = FALSE; + + g_return_val_if_fail (string != NULL, FALSE); + + a = g_strsplit (string, ";", 0); + if (a[0] == NULL) + goto out; + + for (n = 0; a[n] != NULL; n++) + { + if (!_g_dbus_address_parse_entry (a[n], + NULL, + NULL, + NULL)) + goto out; + } + + ret = TRUE; + + out: + g_strfreev (a); + return ret; +} + +static gboolean +is_valid_unix (const gchar *address_entry, + GHashTable *key_value_pairs, + GError **error) +{ + gboolean ret; + GList *keys; + GList *l; + const gchar *path; + const gchar *tmpdir; + const gchar *abstract; + + ret = FALSE; + keys = NULL; + path = NULL; + tmpdir = NULL; + abstract = NULL; + + keys = g_hash_table_get_keys (key_value_pairs); + for (l = keys; l != NULL; l = l->next) + { + const gchar *key = l->data; + if (g_strcmp0 (key, "path") == 0) + path = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "tmpdir") == 0) + tmpdir = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "abstract") == 0) + abstract = g_hash_table_lookup (key_value_pairs, key); + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Unsupported key `%s' in address entry `%s'"), + key, + address_entry); + goto out; + } + } + + if (path != NULL) + { + if (tmpdir != NULL || abstract != NULL) + goto meaningless; + } + else if (tmpdir != NULL) + { + if (path != NULL || abstract != NULL) + goto meaningless; + } + else if (abstract != NULL) + { + if (path != NULL || tmpdir != NULL) + goto meaningless; + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Address `%s' is invalid (need exactly one of path, tmpdir or abstract keys)"), + address_entry); + goto out; + } + + + ret= TRUE; + goto out; + + meaningless: + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Meaningless key/value pair combination in address entry `%s'"), + address_entry); + + out: + g_list_free (keys); + + return ret; +} + +static gboolean +is_valid_nonce_tcp (const gchar *address_entry, + GHashTable *key_value_pairs, + GError **error) +{ + gboolean ret; + GList *keys; + GList *l; + const gchar *host; + const gchar *port; + const gchar *family; + const gchar *nonce_file; + gint port_num; + gchar *endp; + + ret = FALSE; + keys = NULL; + host = NULL; + port = NULL; + family = NULL; + nonce_file = NULL; + + keys = g_hash_table_get_keys (key_value_pairs); + for (l = keys; l != NULL; l = l->next) + { + const gchar *key = l->data; + if (g_strcmp0 (key, "host") == 0) + host = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "port") == 0) + port = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "family") == 0) + family = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "noncefile") == 0) + nonce_file = g_hash_table_lookup (key_value_pairs, key); + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Unsupported key `%s' in address entry `%s'"), + key, + address_entry); + goto out; + } + } + + if (port != NULL) + { + port_num = strtol (port, &endp, 10); + if ((*port == '\0' || *endp != '\0') || port_num < 0 || port_num >= 65536) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the port attribute is malformed"), + address_entry); + goto out; + } + } + + if (family != NULL && !(g_strcmp0 (family, "ipv4") == 0 || g_strcmp0 (family, "ipv6") == 0)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the family attribute is malformed"), + address_entry); + goto out; + } + + ret= TRUE; + + out: + g_list_free (keys); + + return ret; +} + +static gboolean +is_valid_tcp (const gchar *address_entry, + GHashTable *key_value_pairs, + GError **error) +{ + gboolean ret; + GList *keys; + GList *l; + const gchar *host; + const gchar *port; + const gchar *family; + gint port_num; + gchar *endp; + + ret = FALSE; + keys = NULL; + host = NULL; + port = NULL; + family = NULL; + + keys = g_hash_table_get_keys (key_value_pairs); + for (l = keys; l != NULL; l = l->next) + { + const gchar *key = l->data; + if (g_strcmp0 (key, "host") == 0) + host = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "port") == 0) + port = g_hash_table_lookup (key_value_pairs, key); + else if (g_strcmp0 (key, "family") == 0) + family = g_hash_table_lookup (key_value_pairs, key); + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Unsupported key `%s' in address entry `%s'"), + key, + address_entry); + goto out; + } + } + + if (port != NULL) + { + port_num = strtol (port, &endp, 10); + if ((*port == '\0' || *endp != '\0') || port_num < 0 || port_num >= 65536) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the port attribute is malformed"), + address_entry); + goto out; + } + } + + if (family != NULL && !(g_strcmp0 (family, "ipv4") == 0 || g_strcmp0 (family, "ipv6") == 0)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the family attribute is malformed"), + address_entry); + goto out; + } + + ret= TRUE; + + out: + g_list_free (keys); + + return ret; +} + +/** + * g_dbus_is_supported_address: + * @string: A string. + * @error: Return location for error or %NULL. + * + * Like g_dbus_is_address() but also checks if the library suppors the + * transports in @string and that key/value pairs for each transport + * are valid. + * + * Returns: %TRUE if @string is a valid D-Bus address that is + * supported by this library, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_supported_address (const gchar *string, + GError **error) +{ + guint n; + gchar **a; + gboolean ret; + + ret = FALSE; + + g_return_val_if_fail (string != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + a = g_strsplit (string, ";", 0); + for (n = 0; a[n] != NULL; n++) + { + gchar *transport_name; + GHashTable *key_value_pairs; + gboolean supported; + + if (!_g_dbus_address_parse_entry (a[n], + &transport_name, + &key_value_pairs, + error)) + goto out; + + supported = FALSE; + if (g_strcmp0 (transport_name, "unix") == 0) + supported = is_valid_unix (a[n], key_value_pairs, error); + else if (g_strcmp0 (transport_name, "tcp") == 0) + supported = is_valid_tcp (a[n], key_value_pairs, error); + else if (g_strcmp0 (transport_name, "nonce-tcp") == 0) + supported = is_valid_nonce_tcp (a[n], key_value_pairs, error); + else if (g_strcmp0 (a[n], "autolaunch:") == 0) + supported = TRUE; + + g_free (transport_name); + g_hash_table_unref (key_value_pairs); + + if (!supported) + goto out; + } + + ret = TRUE; + + out: + g_strfreev (a); + + g_assert (ret || (!ret && (error == NULL || *error != NULL))); + + return ret; +} + +gboolean +_g_dbus_address_parse_entry (const gchar *address_entry, + gchar **out_transport_name, + GHashTable **out_key_value_pairs, + GError **error) +{ + gboolean ret; + GHashTable *key_value_pairs; + gchar *transport_name; + gchar **kv_pairs; + const gchar *s; + guint n; + + ret = FALSE; + kv_pairs = NULL; + transport_name = NULL; + key_value_pairs = NULL; + + s = strchr (address_entry, ':'); + if (s == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Address element `%s', does not contain a colon (:)"), + address_entry); + goto out; + } + + transport_name = g_strndup (address_entry, s - address_entry); + key_value_pairs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + kv_pairs = g_strsplit (s + 1, ",", 0); + for (n = 0; kv_pairs != NULL && kv_pairs[n] != NULL; n++) + { + const gchar *kv_pair = kv_pairs[n]; + gchar *key; + gchar *value; + + s = strchr (kv_pair, '='); + if (s == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Key/Value pair %d, `%s', in address element `%s', does not contain an equal sign"), + n, + kv_pair, + address_entry); + goto out; + } + + key = g_uri_unescape_segment (kv_pair, s, NULL); + value = g_uri_unescape_segment (s + 1, kv_pair + strlen (kv_pair), NULL); + if (key == NULL || value == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error unescaping key or value in Key/Value pair %d, `%s', in address element `%s'"), + n, + kv_pair, + address_entry); + g_free (key); + g_free (value); + goto out; + } + g_hash_table_insert (key_value_pairs, key, value); + } + + ret = TRUE; + +out: + g_strfreev (kv_pairs); + if (ret) + { + if (out_transport_name != NULL) + *out_transport_name = transport_name; + else + g_free (transport_name); + if (out_key_value_pairs != NULL) + *out_key_value_pairs = key_value_pairs; + else if (key_value_pairs != NULL) + g_hash_table_unref (key_value_pairs); + } + else + { + g_free (transport_name); + if (key_value_pairs != NULL) + g_hash_table_unref (key_value_pairs); + } + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GIOStream * +g_dbus_address_try_connect_one (const gchar *address_entry, + gchar **out_guid, + GCancellable *cancellable, + GError **error); + +/* TODO: Declare an extension point called GDBusTransport (or similar) + * and move code below to extensions implementing said extension + * point. That way we can implement a D-Bus transport over X11 without + * making libgio link to libX11... + */ +static GIOStream * +g_dbus_address_connect (const gchar *address_entry, + const gchar *transport_name, + GHashTable *key_value_pairs, + GCancellable *cancellable, + GError **error) +{ + GIOStream *ret; + GSocketConnectable *connectable; + const gchar *nonce_file; + + connectable = NULL; + ret = NULL; + nonce_file = NULL; + + if (FALSE) + { + } +#ifdef G_OS_UNIX + else if (g_strcmp0 (transport_name, "unix") == 0) + { + const gchar *path; + const gchar *abstract; + path = g_hash_table_lookup (key_value_pairs, "path"); + abstract = g_hash_table_lookup (key_value_pairs, "abstract"); + if ((path == NULL && abstract == NULL) || (path != NULL && abstract != NULL)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the unix transport requires exactly one of the " + "keys `path' or `abstract' to be set"), + address_entry); + } + else if (path != NULL) + { + connectable = G_SOCKET_CONNECTABLE (g_unix_socket_address_new (path)); + } + else if (abstract != NULL) + { + connectable = G_SOCKET_CONNECTABLE (g_unix_socket_address_new_with_type (abstract, + -1, + G_UNIX_SOCKET_ADDRESS_ABSTRACT)); + } + else + { + g_assert_not_reached (); + } + } +#endif + else if (g_strcmp0 (transport_name, "tcp") == 0 || g_strcmp0 (transport_name, "nonce-tcp") == 0) + { + const gchar *s; + const gchar *host; + guint port; + gchar *endp; + gboolean is_nonce; + + is_nonce = (g_strcmp0 (transport_name, "nonce-tcp") == 0); + + host = g_hash_table_lookup (key_value_pairs, "host"); + if (host == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the host attribute is missing or malformed"), + address_entry); + goto out; + } + + s = g_hash_table_lookup (key_value_pairs, "port"); + if (s == NULL) + s = "0"; + port = strtol (s, &endp, 10); + if ((*s == '\0' || *endp != '\0') || port < 0 || port >= 65536) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the port attribute is missing or malformed"), + address_entry); + goto out; + } + + + if (is_nonce) + { + nonce_file = g_hash_table_lookup (key_value_pairs, "noncefile"); + if (nonce_file == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error in address `%s' - the noncefile attribute is missing or malformed"), + address_entry); + goto out; + } + } + + /* TODO: deal with family key/value-pair */ + connectable = g_network_address_new (host, port); + } + else if (g_strcmp0 (address_entry, "autolaunch:") == 0) + { + gchar *autolaunch_address; + autolaunch_address = get_session_address_platform_specific (error); + if (autolaunch_address != NULL) + { + ret = g_dbus_address_try_connect_one (autolaunch_address, NULL, cancellable, error); + g_free (autolaunch_address); + goto out; + } + else + { + g_prefix_error (error, _("Error auto-launching: ")); + } + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Unknown or unsupported transport `%s' for address `%s'"), + transport_name, + address_entry); + } + + if (connectable != NULL) + { + GSocketClient *client; + GSocketConnection *connection; + + g_assert (ret == NULL); + client = g_socket_client_new (); + connection = g_socket_client_connect (client, + connectable, + cancellable, + error); + g_object_unref (connectable); + g_object_unref (client); + if (connection == NULL) + goto out; + + ret = G_IO_STREAM (connection); + + if (nonce_file != NULL) + { + gchar nonce_contents[16 + 1]; + size_t num_bytes_read; + FILE *f; + + /* be careful to read only 16 bytes - we also check that the file is only 16 bytes long */ + f = fopen (nonce_file, "rb"); + if (f == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error opening nonce file `%s': %s"), + nonce_file, + g_strerror (errno)); + g_object_unref (ret); + ret = NULL; + goto out; + } + num_bytes_read = fread (nonce_contents, + sizeof (gchar), + 16 + 1, + f); + if (num_bytes_read != 16) + { + if (num_bytes_read == 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error reading from nonce file `%s': %s"), + nonce_file, + g_strerror (errno)); + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error reading from nonce file `%s', expected 16 bytes, got %d"), + nonce_file, + (gint) num_bytes_read); + } + g_object_unref (ret); + ret = NULL; + fclose (f); + goto out; + } + fclose (f); + + if (!g_output_stream_write_all (g_io_stream_get_output_stream (ret), + nonce_contents, + 16, + NULL, + cancellable, + error)) + { + g_prefix_error (error, _("Error writing contents of nonce file `%s' to stream:"), nonce_file); + g_object_unref (ret); + ret = NULL; + goto out; + } + } + } + + out: + + return ret; +} + +static GIOStream * +g_dbus_address_try_connect_one (const gchar *address_entry, + gchar **out_guid, + GCancellable *cancellable, + GError **error) +{ + GIOStream *ret; + GHashTable *key_value_pairs; + gchar *transport_name; + const gchar *guid; + + ret = NULL; + transport_name = NULL; + key_value_pairs = NULL; + + if (!_g_dbus_address_parse_entry (address_entry, + &transport_name, + &key_value_pairs, + error)) + goto out; + + ret = g_dbus_address_connect (address_entry, + transport_name, + key_value_pairs, + cancellable, + error); + if (ret == NULL) + goto out; + + guid = g_hash_table_lookup (key_value_pairs, "guid"); + if (guid != NULL && out_guid != NULL) + *out_guid = g_strdup (guid); + +out: + g_free (transport_name); + if (key_value_pairs != NULL) + g_hash_table_unref (key_value_pairs); + return ret; +} + + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct { + gchar *address; + GIOStream *stream; + gchar *guid; +} GetStreamData; + +static void +get_stream_data_free (GetStreamData *data) +{ + g_free (data->address); + if (data->stream != NULL) + g_object_unref (data->stream); + g_free (data->guid); + g_free (data); +} + +static void +get_stream_thread_func (GSimpleAsyncResult *res, + GObject *object, + GCancellable *cancellable) +{ + GetStreamData *data; + GError *error; + + data = g_simple_async_result_get_op_res_gpointer (res); + + error = NULL; + data->stream = g_dbus_address_get_stream_sync (data->address, + &data->guid, + cancellable, + &error); + if (data->stream == NULL) + g_simple_async_result_take_error (res, error); +} + +/** + * g_dbus_address_get_stream: + * @address: A valid D-Bus address. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: Data to pass to @callback. + * + * Asynchronously connects to an endpoint specified by @address and + * sets up the connection so it is in a state to run the client-side + * of the D-Bus authentication conversation. + * + * When the operation is finished, @callback will be invoked. You can + * then call g_dbus_address_get_stream_finish() to get the result of + * the operation. + * + * This is an asynchronous failable function. See + * g_dbus_address_get_stream_sync() for the synchronous version. + * + * Since: 2.26 + */ +void +g_dbus_address_get_stream (const gchar *address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *res; + GetStreamData *data; + + g_return_if_fail (address != NULL); + + res = g_simple_async_result_new (NULL, + callback, + user_data, + g_dbus_address_get_stream); + data = g_new0 (GetStreamData, 1); + data->address = g_strdup (address); + g_simple_async_result_set_op_res_gpointer (res, + data, + (GDestroyNotify) get_stream_data_free); + g_simple_async_result_run_in_thread (res, + get_stream_thread_func, + G_PRIORITY_DEFAULT, + cancellable); + g_object_unref (res); +} + +/** + * g_dbus_address_get_stream_finish: + * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream(). + * @out_guid: %NULL or return location to store the GUID extracted from @address, if any. + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_address_get_stream(). + * + * Returns: (transfer full): A #GIOStream or %NULL if @error is set. + * + * Since: 2.26 + */ +GIOStream * +g_dbus_address_get_stream_finish (GAsyncResult *res, + gchar **out_guid, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + GetStreamData *data; + GIOStream *ret; + + g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_address_get_stream); + + ret = NULL; + + data = g_simple_async_result_get_op_res_gpointer (simple); + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + ret = g_object_ref (data->stream); + if (out_guid != NULL) + *out_guid = g_strdup (data->guid); + + out: + return ret; +} + +/** + * g_dbus_address_get_stream_sync: + * @address: A valid D-Bus address. + * @out_guid: %NULL or return location to store the GUID extracted from @address, if any. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously connects to an endpoint specified by @address and + * sets up the connection so it is in a state to run the client-side + * of the D-Bus authentication conversation. + * + * This is a synchronous failable function. See + * g_dbus_address_get_stream() for the asynchronous version. + * + * Returns: (transfer full): A #GIOStream or %NULL if @error is set. + * + * Since: 2.26 + */ +GIOStream * +g_dbus_address_get_stream_sync (const gchar *address, + gchar **out_guid, + GCancellable *cancellable, + GError **error) +{ + GIOStream *ret; + gchar **addr_array; + guint n; + GError *last_error; + + g_return_val_if_fail (address != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = NULL; + last_error = NULL; + + addr_array = g_strsplit (address, ";", 0); + if (addr_array[0] == NULL) + { + last_error = g_error_new_literal (G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("The given address is empty")); + goto out; + } + + for (n = 0; addr_array != NULL && addr_array[n] != NULL; n++) + { + const gchar *addr = addr_array[n]; + GError *this_error; + + this_error = NULL; + ret = g_dbus_address_try_connect_one (addr, + out_guid, + cancellable, + &this_error); + if (ret != NULL) + { + goto out; + } + else + { + g_assert (this_error != NULL); + if (last_error != NULL) + g_error_free (last_error); + last_error = this_error; + } + } + + out: + if (ret != NULL) + { + if (last_error != NULL) + g_error_free (last_error); + } + else + { + g_assert (last_error != NULL); + g_propagate_error (error, last_error); + } + + g_strfreev (addr_array); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_UNIX +static gchar * +get_session_address_dbus_launch (GError **error) +{ + gchar *ret; + gchar *machine_id; + gchar *command_line; + gchar *launch_stdout; + gchar *launch_stderr; + gint exit_status; + gchar *old_dbus_verbose; + gboolean restore_dbus_verbose; + + ret = NULL; + machine_id = NULL; + command_line = NULL; + launch_stdout = NULL; + launch_stderr = NULL; + restore_dbus_verbose = FALSE; + old_dbus_verbose = NULL; + + machine_id = _g_dbus_get_machine_id (error); + if (machine_id == NULL) + { + g_prefix_error (error, _("Cannot spawn a message bus without a machine-id: ")); + goto out; + } + + /* We're using private libdbus facilities here. When everything + * (X11, Mac OS X, Windows) is spec'ed out correctly (not even the + * X11 property is correctly documented right now) we should + * consider using the spec instead of dbus-launch. + * + * --autolaunch=MACHINEID + * This option implies that dbus-launch should scan for a previ‐ + * ously-started session and reuse the values found there. If no + * session is found, it will start a new session. The --exit-with- + * session option is implied if --autolaunch is given. This option + * is for the exclusive use of libdbus, you do not want to use it + * manually. It may change in the future. + */ + + /* TODO: maybe provide a variable for where to look for the dbus-launch binary? */ + command_line = g_strdup_printf ("dbus-launch --autolaunch=%s --binary-syntax --close-stderr", machine_id); + + if (G_UNLIKELY (_g_dbus_debug_address ())) + { + _g_dbus_debug_print_lock (); + g_print ("GDBus-debug:Address: Running `%s' to get bus address (possibly autolaunching)\n", command_line); + old_dbus_verbose = g_strdup (g_getenv ("DBUS_VERBOSE")); + restore_dbus_verbose = TRUE; + g_setenv ("DBUS_VERBOSE", "1", TRUE); + _g_dbus_debug_print_unlock (); + } + + if (!g_spawn_command_line_sync (command_line, + &launch_stdout, + &launch_stderr, + &exit_status, + error)) + { + g_prefix_error (error, _("Error spawning command line `%s': "), command_line); + goto out; + } + + if (!WIFEXITED (exit_status)) + { + gchar *escaped_stderr; + escaped_stderr = g_strescape (launch_stderr, ""); + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Abnormal program termination spawning command line `%s': %s"), + command_line, + escaped_stderr); + g_free (escaped_stderr); + goto out; + } + + if (WEXITSTATUS (exit_status) != 0) + { + gchar *escaped_stderr; + escaped_stderr = g_strescape (launch_stderr, ""); + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Command line `%s' exited with non-zero exit status %d: %s"), + command_line, + WEXITSTATUS (exit_status), + escaped_stderr); + g_free (escaped_stderr); + goto out; + } + + /* From the dbus-launch(1) man page: + * + * --binary-syntax Write to stdout a nul-terminated bus address, + * then the bus PID as a binary integer of size sizeof(pid_t), + * then the bus X window ID as a binary integer of size + * sizeof(long). Integers are in the machine's byte order, not + * network byte order or any other canonical byte order. + */ + ret = g_strdup (launch_stdout); + + out: + if (G_UNLIKELY (_g_dbus_debug_address ())) + { + gchar *s; + _g_dbus_debug_print_lock (); + g_print ("GDBus-debug:Address: dbus-launch output:"); + if (launch_stdout != NULL) + { + s = _g_dbus_hexdump (launch_stdout, strlen (launch_stdout) + 1 + sizeof (pid_t) + sizeof (long), 2); + g_print ("\n%s", s); + g_free (s); + } + else + { + g_print (" (none)\n"); + } + g_print ("GDBus-debug:Address: dbus-launch stderr output:"); + if (launch_stderr != NULL) + g_print ("\n%s", launch_stderr); + else + g_print (" (none)\n"); + _g_dbus_debug_print_unlock (); + } + + g_free (machine_id); + g_free (command_line); + g_free (launch_stdout); + g_free (launch_stderr); + if (G_UNLIKELY (restore_dbus_verbose)) + { + if (old_dbus_verbose != NULL) + g_setenv ("DBUS_VERBOSE", old_dbus_verbose, TRUE); + else + g_unsetenv ("DBUS_VERBOSE"); + } + g_free (old_dbus_verbose); + return ret; +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar * +get_session_address_platform_specific (GError **error) +{ + gchar *ret; +#ifdef G_OS_UNIX + /* need to handle OS X in a different way since `dbus-launch --autolaunch' probably won't work there */ + ret = get_session_address_dbus_launch (error); +#else + /* TODO: implement for UNIX, Win32 and OS X */ + ret = NULL; + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Cannot determine session bus address (not implemented for this OS)")); +#endif + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_address_get_for_bus_sync: + * @bus_type: A #GBusType. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously looks up the D-Bus address for the well-known message + * bus instance specified by @bus_type. This may involve using various + * platform specific mechanisms. + * + * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set. + * + * Since: 2.26 + */ +gchar * +g_dbus_address_get_for_bus_sync (GBusType bus_type, + GCancellable *cancellable, + GError **error) +{ + gchar *ret; + const gchar *starter_bus; + GError *local_error; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = NULL; + local_error = NULL; + + if (G_UNLIKELY (_g_dbus_debug_address ())) + { + guint n; + _g_dbus_debug_print_lock (); + g_print ("GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `%s'\n", + _g_dbus_enum_to_string (G_TYPE_BUS_TYPE, bus_type)); + for (n = 0; n < 3; n++) + { + const gchar *k; + const gchar *v; + switch (n) + { + case 0: k = "DBUS_SESSION_BUS_ADDRESS"; break; + case 1: k = "DBUS_SYSTEM_BUS_ADDRESS"; break; + case 2: k = "DBUS_STARTER_BUS_TYPE"; break; + default: g_assert_not_reached (); + } + v = g_getenv (k); + g_print ("GDBus-debug:Address: env var %s", k); + if (v != NULL) + g_print ("=`%s'\n", v); + else + g_print (" is not set\n"); + } + _g_dbus_debug_print_unlock (); + } + + switch (bus_type) + { + case G_BUS_TYPE_SYSTEM: + ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS")); + if (ret == NULL) + { + ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket"); + } + break; + + case G_BUS_TYPE_SESSION: + ret = g_strdup (g_getenv ("DBUS_SESSION_BUS_ADDRESS")); + if (ret == NULL) + { + ret = get_session_address_platform_specific (&local_error); + } + break; + + case G_BUS_TYPE_STARTER: + starter_bus = g_getenv ("DBUS_STARTER_BUS_TYPE"); + if (g_strcmp0 (starter_bus, "session") == 0) + { + ret = g_dbus_address_get_for_bus_sync (G_BUS_TYPE_SESSION, cancellable, &local_error); + goto out; + } + else if (g_strcmp0 (starter_bus, "system") == 0) + { + ret = g_dbus_address_get_for_bus_sync (G_BUS_TYPE_SYSTEM, cancellable, &local_error); + goto out; + } + else + { + if (starter_bus != NULL) + { + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Cannot determine bus address from DBUS_STARTER_BUS_TYPE environment variable" + " - unknown value `%s'"), + starter_bus); + } + else + { + g_set_error_literal (&local_error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Cannot determine bus address because the DBUS_STARTER_BUS_TYPE environment " + "variable is not set")); + } + } + break; + + default: + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Unknown bus type %d"), + bus_type); + break; + } + + out: + if (G_UNLIKELY (_g_dbus_debug_address ())) + { + _g_dbus_debug_print_lock (); + if (ret != NULL) + { + g_print ("GDBus-debug:Address: Returning address `%s' for bus type `%s'\n", + ret, + _g_dbus_enum_to_string (G_TYPE_BUS_TYPE, bus_type)); + } + else + { + g_print ("GDBus-debug:Address: Cannot look-up address bus type `%s': %s\n", + _g_dbus_enum_to_string (G_TYPE_BUS_TYPE, bus_type), + local_error->message); + } + _g_dbus_debug_print_unlock (); + } + + if (local_error != NULL) + g_propagate_error (error, local_error); + + return ret; +} diff --git a/gio/gdbusaddress.h b/gio/gdbusaddress.h new file mode 100644 index 0000000..955c39e --- /dev/null +++ b/gio/gdbusaddress.h @@ -0,0 +1,58 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_ADDRESS_H__ +#define __G_DBUS_ADDRESS_H__ + +#include + +G_BEGIN_DECLS + +gboolean g_dbus_is_address (const gchar *string); +gboolean g_dbus_is_supported_address (const gchar *string, + GError **error); + +void g_dbus_address_get_stream (const gchar *address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +GIOStream *g_dbus_address_get_stream_finish (GAsyncResult *res, + gchar **out_guid, + GError **error); + +GIOStream *g_dbus_address_get_stream_sync (const gchar *address, + gchar **out_guid, + GCancellable *cancellable, + GError **error); + +gchar *g_dbus_address_get_for_bus_sync (GBusType bus_type, + GCancellable *cancellable, + GError **error); + +G_END_DECLS + +#endif /* __G_DBUS_ADDRESS_H__ */ diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c new file mode 100644 index 0000000..eb8ebfd --- /dev/null +++ b/gio/gdbusauth.c @@ -0,0 +1,1357 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include "gdbusauth.h" + +#include "gdbusauthmechanismanon.h" +#include "gdbusauthmechanismexternal.h" +#include "gdbusauthmechanismsha1.h" +#include "gdbusauthobserver.h" + +#include "gdbuserror.h" +#include "gdbusutils.h" +#include "gioenumtypes.h" +#include "gcredentials.h" +#include "gdbusprivate.h" +#include "giostream.h" +#include "gdatainputstream.h" +#include "gdataoutputstream.h" + +#ifdef G_OS_UNIX +#include +#include +#include "gunixconnection.h" +#include "gunixcredentialsmessage.h" +#endif + +#include "glibintl.h" + +static void +debug_print (const gchar *message, ...) +{ + if (G_UNLIKELY (_g_dbus_debug_authentication ())) + { + gchar *s; + GString *str; + va_list var_args; + guint n; + + _g_dbus_debug_print_lock (); + + va_start (var_args, message); + s = g_strdup_vprintf (message, var_args); + va_end (var_args); + + str = g_string_new (NULL); + for (n = 0; s[n] != '\0'; n++) + { + if (G_UNLIKELY (s[n] == '\r')) + g_string_append (str, "\\r"); + else if (G_UNLIKELY (s[n] == '\n')) + g_string_append (str, "\\n"); + else + g_string_append_c (str, s[n]); + } + g_print ("GDBus-debug:Auth: %s\n", str->str); + g_string_free (str, TRUE); + g_free (s); + + _g_dbus_debug_print_unlock (); + } +} + +typedef struct +{ + const gchar *name; + gint priority; + GType gtype; +} Mechanism; + +static void mechanism_free (Mechanism *m); + +struct _GDBusAuthPrivate +{ + GIOStream *stream; + + /* A list of available Mechanism, sorted according to priority */ + GList *available_mechanisms; +}; + +enum +{ + PROP_0, + PROP_STREAM +}; + +G_DEFINE_TYPE (GDBusAuth, _g_dbus_auth, G_TYPE_OBJECT); + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_auth_finalize (GObject *object) +{ + GDBusAuth *auth = G_DBUS_AUTH (object); + + if (auth->priv->stream != NULL) + g_object_unref (auth->priv->stream); + g_list_foreach (auth->priv->available_mechanisms, (GFunc) mechanism_free, NULL); + g_list_free (auth->priv->available_mechanisms); + + if (G_OBJECT_CLASS (_g_dbus_auth_parent_class)->finalize != NULL) + G_OBJECT_CLASS (_g_dbus_auth_parent_class)->finalize (object); +} + +static void +_g_dbus_auth_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GDBusAuth *auth = G_DBUS_AUTH (object); + + switch (prop_id) + { + case PROP_STREAM: + g_value_set_object (value, auth->priv->stream); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +_g_dbus_auth_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GDBusAuth *auth = G_DBUS_AUTH (object); + + switch (prop_id) + { + case PROP_STREAM: + auth->priv->stream = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +_g_dbus_auth_class_init (GDBusAuthClass *klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GDBusAuthPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->get_property = _g_dbus_auth_get_property; + gobject_class->set_property = _g_dbus_auth_set_property; + gobject_class->finalize = _g_dbus_auth_finalize; + + g_object_class_install_property (gobject_class, + PROP_STREAM, + g_param_spec_object ("stream", + P_("IO Stream"), + P_("The underlying GIOStream used for I/O"), + G_TYPE_IO_STREAM, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); +} + +static void +mechanism_free (Mechanism *m) +{ + g_free (m); +} + +static void +add_mechanism (GDBusAuth *auth, + GType mechanism_type) +{ + Mechanism *m; + + m = g_new0 (Mechanism, 1); + m->name = _g_dbus_auth_mechanism_get_name (mechanism_type); + m->priority = _g_dbus_auth_mechanism_get_priority (mechanism_type); + m->gtype = mechanism_type; + + auth->priv->available_mechanisms = g_list_prepend (auth->priv->available_mechanisms, m); +} + +static gint +mech_compare_func (Mechanism *a, Mechanism *b) +{ + gint ret; + /* ensure deterministic order */ + ret = b->priority - a->priority; + if (ret == 0) + ret = g_strcmp0 (b->name, a->name); + return ret; +} + +static void +_g_dbus_auth_init (GDBusAuth *auth) +{ + auth->priv = G_TYPE_INSTANCE_GET_PRIVATE (auth, G_TYPE_DBUS_AUTH, GDBusAuthPrivate); + + /* TODO: trawl extension points */ + add_mechanism (auth, G_TYPE_DBUS_AUTH_MECHANISM_ANON); + add_mechanism (auth, G_TYPE_DBUS_AUTH_MECHANISM_SHA1); + add_mechanism (auth, G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL); + + auth->priv->available_mechanisms = g_list_sort (auth->priv->available_mechanisms, + (GCompareFunc) mech_compare_func); +} + +static GType +find_mech_by_name (GDBusAuth *auth, + const gchar *name) +{ + GType ret; + GList *l; + + ret = (GType) 0; + + for (l = auth->priv->available_mechanisms; l != NULL; l = l->next) + { + Mechanism *m = l->data; + if (g_strcmp0 (name, m->name) == 0) + { + ret = m->gtype; + goto out; + } + } + + out: + return ret; +} + +GDBusAuth * +_g_dbus_auth_new (GIOStream *stream) +{ + return g_object_new (G_TYPE_DBUS_AUTH, + "stream", stream, + NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* like g_data_input_stream_read_line() but sets error if there's no content to read */ +static gchar * +_my_g_data_input_stream_read_line (GDataInputStream *dis, + gsize *out_line_length, + GCancellable *cancellable, + GError **error) +{ + gchar *ret; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = g_data_input_stream_read_line (dis, + out_line_length, + cancellable, + error); + if (ret == NULL && error != NULL && *error == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Unexpected lack of content trying to read a line")); + } + + return ret; +} + +/* This function is to avoid situations like this + * + * BEGIN\r\nl\0\0\1... + * + * e.g. where we read into the first D-Bus message while waiting for + * the final line from the client (TODO: file bug against gio for + * this) + */ +static gchar * +_my_g_input_stream_read_line_safe (GInputStream *i, + gsize *out_line_length, + GCancellable *cancellable, + GError **error) +{ + GString *str; + gchar c; + gssize num_read; + gboolean last_was_cr; + + str = g_string_new (NULL); + + last_was_cr = FALSE; + while (TRUE) + { + num_read = g_input_stream_read (i, + &c, + 1, + cancellable, + error); + if (num_read == -1) + goto fail; + if (num_read == 0) + { + if (error != NULL && *error == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Unexpected lack of content trying to (safely) read a line")); + } + goto fail; + } + + g_string_append_c (str, (gint) c); + if (last_was_cr) + { + if (c == 0x0a) + { + g_assert (str->len >= 2); + g_string_set_size (str, str->len - 2); + goto out; + } + } + last_was_cr = (c == 0x0d); + } + + out: + if (out_line_length != NULL) + *out_line_length = str->len; + return g_string_free (str, FALSE); + + fail: + g_assert (error == NULL || *error != NULL); + g_string_free (str, TRUE); + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +append_nibble (GString *s, gint val) +{ + g_string_append_c (s, val >= 10 ? ('a' + val - 10) : ('0' + val)); +} + +static gchar * +hexdecode (const gchar *str, + gsize *out_len, + GError **error) +{ + gchar *ret; + GString *s; + guint n; + + ret = NULL; + s = g_string_new (NULL); + + for (n = 0; str[n] != '\0'; n += 2) + { + gint upper_nibble; + gint lower_nibble; + guint value; + + upper_nibble = g_ascii_xdigit_value (str[n]); + lower_nibble = g_ascii_xdigit_value (str[n + 1]); + if (upper_nibble == -1 || lower_nibble == -1) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Error hexdecoding string `%s' around position %d", + str, n); + goto out; + } + value = (upper_nibble<<4) | lower_nibble; + g_string_append_c (s, value); + } + + ret = g_string_free (s, FALSE); + s = NULL; + + out: + if (s != NULL) + g_string_free (s, TRUE); + return ret; +} + +/* TODO: take len */ +static gchar * +hexencode (const gchar *str) +{ + guint n; + GString *s; + + s = g_string_new (NULL); + for (n = 0; str[n] != '\0'; n++) + { + gint val; + gint upper_nibble; + gint lower_nibble; + + val = ((const guchar *) str)[n]; + upper_nibble = val >> 4; + lower_nibble = val & 0x0f; + + append_nibble (s, upper_nibble); + append_nibble (s, lower_nibble); + } + + return g_string_free (s, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanism * +client_choose_mech_and_send_initial_response (GDBusAuth *auth, + GCredentials *credentials_that_were_sent, + const gchar* const *supported_auth_mechs, + GPtrArray *attempted_auth_mechs, + GDataOutputStream *dos, + GCancellable *cancellable, + GError **error) +{ + GDBusAuthMechanism *mech; + GType auth_mech_to_use_gtype; + guint n; + guint m; + gchar *initial_response; + gsize initial_response_len; + gchar *encoded; + gchar *s; + + again: + mech = NULL; + + debug_print ("CLIENT: Trying to choose mechanism"); + + /* find an authentication mechanism to try, if any */ + auth_mech_to_use_gtype = (GType) 0; + for (n = 0; supported_auth_mechs[n] != NULL; n++) + { + gboolean attempted_already; + attempted_already = FALSE; + for (m = 0; m < attempted_auth_mechs->len; m++) + { + if (g_strcmp0 (supported_auth_mechs[n], attempted_auth_mechs->pdata[m]) == 0) + { + attempted_already = TRUE; + break; + } + } + if (!attempted_already) + { + auth_mech_to_use_gtype = find_mech_by_name (auth, supported_auth_mechs[n]); + if (auth_mech_to_use_gtype != (GType) 0) + break; + } + } + + if (auth_mech_to_use_gtype == (GType) 0) + { + guint n; + gchar *available; + GString *tried_str; + + debug_print ("CLIENT: Exhausted all available mechanisms"); + + available = g_strjoinv (", ", (gchar **) supported_auth_mechs); + + tried_str = g_string_new (NULL); + for (n = 0; n < attempted_auth_mechs->len; n++) + { + if (n > 0) + g_string_append (tried_str, ", "); + g_string_append (tried_str, attempted_auth_mechs->pdata[n]); + } + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Exhausted all available authentication mechanisms (tried: %s) (available: %s)"), + tried_str->str, + available); + g_string_free (tried_str, TRUE); + g_free (available); + goto out; + } + + /* OK, decided on a mechanism - let's do this thing */ + mech = g_object_new (auth_mech_to_use_gtype, + "stream", auth->priv->stream, + "credentials", credentials_that_were_sent, + NULL); + debug_print ("CLIENT: Trying mechanism `%s'", _g_dbus_auth_mechanism_get_name (auth_mech_to_use_gtype)); + g_ptr_array_add (attempted_auth_mechs, (gpointer) _g_dbus_auth_mechanism_get_name (auth_mech_to_use_gtype)); + + /* the auth mechanism may not be supported + * (for example, EXTERNAL only works if credentials were exchanged) + */ + if (!_g_dbus_auth_mechanism_is_supported (mech)) + { + debug_print ("CLIENT: Mechanism `%s' says it is not supported", _g_dbus_auth_mechanism_get_name (auth_mech_to_use_gtype)); + g_object_unref (mech); + mech = NULL; + goto again; + } + + initial_response_len = -1; + initial_response = _g_dbus_auth_mechanism_client_initiate (mech, + &initial_response_len); +#if 0 + g_printerr ("using auth mechanism with name `%s' of type `%s' with initial response `%s'\n", + _g_dbus_auth_mechanism_get_name (auth_mech_to_use_gtype), + g_type_name (G_TYPE_FROM_INSTANCE (mech)), + initial_response); +#endif + if (initial_response != NULL) + { + //g_printerr ("initial_response = `%s'\n", initial_response); + encoded = hexencode (initial_response); + s = g_strdup_printf ("AUTH %s %s\r\n", + _g_dbus_auth_mechanism_get_name (auth_mech_to_use_gtype), + encoded); + g_free (initial_response); + g_free (encoded); + } + else + { + s = g_strdup_printf ("AUTH %s\r\n", _g_dbus_auth_mechanism_get_name (auth_mech_to_use_gtype)); + } + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_object_unref (mech); + mech = NULL; + g_free (s); + goto out; + } + g_free (s); + + out: + return mech; +} + + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef enum +{ + CLIENT_STATE_WAITING_FOR_DATA, + CLIENT_STATE_WAITING_FOR_OK, + CLIENT_STATE_WAITING_FOR_REJECT, + CLIENT_STATE_WAITING_FOR_AGREE_UNIX_FD +} ClientState; + +gchar * +_g_dbus_auth_run_client (GDBusAuth *auth, + GDBusCapabilityFlags offered_capabilities, + GDBusCapabilityFlags *out_negotiated_capabilities, + GCancellable *cancellable, + GError **error) +{ + gchar *s; + GDataInputStream *dis; + GDataOutputStream *dos; + GCredentials *credentials; + gchar *ret_guid; + gchar *line; + gsize line_length; + gchar **supported_auth_mechs; + GPtrArray *attempted_auth_mechs; + GDBusAuthMechanism *mech; + ClientState state; + GDBusCapabilityFlags negotiated_capabilities; + + debug_print ("CLIENT: initiating"); + + ret_guid = NULL; + supported_auth_mechs = NULL; + attempted_auth_mechs = g_ptr_array_new (); + mech = NULL; + negotiated_capabilities = 0; + credentials = NULL; + + dis = G_DATA_INPUT_STREAM (g_data_input_stream_new (g_io_stream_get_input_stream (auth->priv->stream))); + dos = G_DATA_OUTPUT_STREAM (g_data_output_stream_new (g_io_stream_get_output_stream (auth->priv->stream))); + g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (dis), FALSE); + g_filter_output_stream_set_close_base_stream (G_FILTER_OUTPUT_STREAM (dos), FALSE); + + g_data_input_stream_set_newline_type (dis, G_DATA_STREAM_NEWLINE_TYPE_CR_LF); + +#ifdef G_OS_UNIX + if (G_IS_UNIX_CONNECTION (auth->priv->stream) && g_unix_credentials_message_is_supported ()) + { + credentials = g_credentials_new (); + if (!g_unix_connection_send_credentials (G_UNIX_CONNECTION (auth->priv->stream), + cancellable, + error)) + goto out; + } + else + { + if (!g_data_output_stream_put_byte (dos, '\0', cancellable, error)) + goto out; + } +#else + if (!g_data_output_stream_put_byte (dos, '\0', cancellable, error)) + goto out; +#endif + + if (credentials != NULL) + { + if (G_UNLIKELY (_g_dbus_debug_authentication ())) + { + s = g_credentials_to_string (credentials); + debug_print ("CLIENT: sent credentials `%s'", s); + g_free (s); + } + } + else + { + debug_print ("CLIENT: didn't send any credentials"); + } + + /* TODO: to reduce roundtrips, try to pick an auth mechanism to start with */ + + /* Get list of supported authentication mechanisms */ + s = "AUTH\r\n"; + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + state = CLIENT_STATE_WAITING_FOR_REJECT; + + while (TRUE) + { + switch (state) + { + case CLIENT_STATE_WAITING_FOR_REJECT: + debug_print ("CLIENT: WaitingForReject"); + line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + if (line == NULL) + goto out; + debug_print ("CLIENT: WaitingForReject, read '%s'", line); + foobar: + if (!g_str_has_prefix (line, "REJECTED ")) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "In WaitingForReject: Expected `REJECTED am1 am2 ... amN', got `%s'", + line); + g_free (line); + goto out; + } + if (supported_auth_mechs == NULL) + { + supported_auth_mechs = g_strsplit (line + sizeof ("REJECTED ") - 1, " ", 0); +#if 0 + for (n = 0; supported_auth_mechs != NULL && supported_auth_mechs[n] != NULL; n++) + g_printerr ("supported_auth_mechs[%d] = `%s'\n", n, supported_auth_mechs[n]); +#endif + } + g_free (line); + mech = client_choose_mech_and_send_initial_response (auth, + credentials, + (const gchar* const *) supported_auth_mechs, + attempted_auth_mechs, + dos, + cancellable, + error); + if (mech == NULL) + goto out; + if (_g_dbus_auth_mechanism_client_get_state (mech) == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA) + state = CLIENT_STATE_WAITING_FOR_DATA; + else + state = CLIENT_STATE_WAITING_FOR_OK; + break; + + case CLIENT_STATE_WAITING_FOR_OK: + debug_print ("CLIENT: WaitingForOK"); + line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + if (line == NULL) + goto out; + debug_print ("CLIENT: WaitingForOK, read `%s'", line); + if (g_str_has_prefix (line, "OK ")) + { + if (!g_dbus_is_guid (line + 3)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Invalid OK response `%s'", + line); + g_free (line); + goto out; + } + ret_guid = g_strdup (line + 3); + g_free (line); + + if (offered_capabilities & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING) + { + s = "NEGOTIATE_UNIX_FD\r\n"; + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + state = CLIENT_STATE_WAITING_FOR_AGREE_UNIX_FD; + } + else + { + s = "BEGIN\r\n"; + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + /* and we're done! */ + goto out; + } + } + else if (g_str_has_prefix (line, "REJECTED ")) + { + goto foobar; + } + else + { + /* TODO: handle other valid responses */ + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "In WaitingForOk: unexpected response `%s'", + line); + g_free (line); + goto out; + } + break; + + case CLIENT_STATE_WAITING_FOR_AGREE_UNIX_FD: + debug_print ("CLIENT: WaitingForAgreeUnixFD"); + line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + if (line == NULL) + goto out; + debug_print ("CLIENT: WaitingForAgreeUnixFD, read=`%s'", line); + if (g_strcmp0 (line, "AGREE_UNIX_FD") == 0) + { + g_free (line); + negotiated_capabilities |= G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING; + s = "BEGIN\r\n"; + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + /* and we're done! */ + goto out; + } + else if (g_str_has_prefix (line, "ERROR") && (line[5] == 0 || g_ascii_isspace (line[5]))) + { + //g_strstrip (line + 5); g_debug ("bah, no unix_fd: `%s'", line + 5); + g_free (line); + s = "BEGIN\r\n"; + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + /* and we're done! */ + goto out; + } + else + { + /* TODO: handle other valid responses */ + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "In WaitingForAgreeUnixFd: unexpected response `%s'", + line); + g_free (line); + goto out; + } + break; + + case CLIENT_STATE_WAITING_FOR_DATA: + debug_print ("CLIENT: WaitingForData"); + line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + if (line == NULL) + goto out; + debug_print ("CLIENT: WaitingForData, read=`%s'", line); + if (g_str_has_prefix (line, "DATA ")) + { + gchar *encoded; + gchar *decoded_data; + gsize decoded_data_len = 0; + + encoded = g_strdup (line + 5); + g_free (line); + g_strstrip (encoded); + decoded_data = hexdecode (encoded, &decoded_data_len, error); + g_free (encoded); + if (decoded_data == NULL) + { + g_prefix_error (error, "DATA response is malformed: "); + /* invalid encoding, disconnect! */ + goto out; + } + _g_dbus_auth_mechanism_client_data_receive (mech, decoded_data, decoded_data_len); + g_free (decoded_data); + + if (_g_dbus_auth_mechanism_client_get_state (mech) == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND) + { + gchar *data; + gsize data_len; + gchar *encoded_data; + data = _g_dbus_auth_mechanism_client_data_send (mech, &data_len); + encoded_data = hexencode (data); + s = g_strdup_printf ("DATA %s\r\n", encoded_data); + g_free (encoded_data); + g_free (data); + debug_print ("CLIENT: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_free (s); + goto out; + } + g_free (s); + } + state = CLIENT_STATE_WAITING_FOR_OK; + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "In WaitingForData: unexpected response `%s'", + line); + g_free (line); + goto out; + } + break; + + default: + g_assert_not_reached (); + break; + } + + }; /* main authentication client loop */ + + out: + if (mech != NULL) + g_object_unref (mech); + g_ptr_array_unref (attempted_auth_mechs); + g_strfreev (supported_auth_mechs); + g_object_unref (dis); + g_object_unref (dos); + + /* ensure return value is NULL if error is set */ + if (error != NULL && *error != NULL) + { + g_free (ret_guid); + ret_guid = NULL; + } + + if (ret_guid != NULL) + { + if (out_negotiated_capabilities != NULL) + *out_negotiated_capabilities = negotiated_capabilities; + } + + if (credentials != NULL) + g_object_unref (credentials); + + debug_print ("CLIENT: Done, authenticated=%d", ret_guid != NULL); + + return ret_guid; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar * +get_auth_mechanisms (GDBusAuth *auth, + gboolean allow_anonymous, + const gchar *prefix, + const gchar *suffix, + const gchar *separator) +{ + GList *l; + GString *str; + gboolean need_sep; + + str = g_string_new (prefix); + need_sep = FALSE; + for (l = auth->priv->available_mechanisms; l != NULL; l = l->next) + { + Mechanism *m = l->data; + + if (!allow_anonymous && g_strcmp0 (m->name, "ANONYMOUS") == 0) + continue; + + if (need_sep) + g_string_append (str, separator); + g_string_append (str, m->name); + need_sep = TRUE; + } + + g_string_append (str, suffix); + return g_string_free (str, FALSE); +} + + +typedef enum +{ + SERVER_STATE_WAITING_FOR_AUTH, + SERVER_STATE_WAITING_FOR_DATA, + SERVER_STATE_WAITING_FOR_BEGIN +} ServerState; + +gboolean +_g_dbus_auth_run_server (GDBusAuth *auth, + GDBusAuthObserver *observer, + const gchar *guid, + gboolean allow_anonymous, + GDBusCapabilityFlags offered_capabilities, + GDBusCapabilityFlags *out_negotiated_capabilities, + GCredentials **out_received_credentials, + GCancellable *cancellable, + GError **error) +{ + gboolean ret; + ServerState state; + GDataInputStream *dis; + GDataOutputStream *dos; + GError *local_error; + guchar byte; + gchar *line; + gsize line_length; + GDBusAuthMechanism *mech; + gchar *s; + GDBusCapabilityFlags negotiated_capabilities; + GCredentials *credentials; + + debug_print ("SERVER: initiating"); + + ret = FALSE; + dis = NULL; + dos = NULL; + mech = NULL; + negotiated_capabilities = 0; + credentials = NULL; + + if (!g_dbus_is_guid (guid)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "The given guid `%s' is not valid", + guid); + goto out; + } + + dis = G_DATA_INPUT_STREAM (g_data_input_stream_new (g_io_stream_get_input_stream (auth->priv->stream))); + dos = G_DATA_OUTPUT_STREAM (g_data_output_stream_new (g_io_stream_get_output_stream (auth->priv->stream))); + g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (dis), FALSE); + g_filter_output_stream_set_close_base_stream (G_FILTER_OUTPUT_STREAM (dos), FALSE); + + g_data_input_stream_set_newline_type (dis, G_DATA_STREAM_NEWLINE_TYPE_CR_LF); + + /* first read the NUL-byte (TODO: read credentials if using a unix domain socket) */ +#ifdef G_OS_UNIX + if (G_IS_UNIX_CONNECTION (auth->priv->stream) && g_unix_credentials_message_is_supported ()) + { + local_error = NULL; + credentials = g_unix_connection_receive_credentials (G_UNIX_CONNECTION (auth->priv->stream), + cancellable, + &local_error); + if (credentials == NULL) + { + g_propagate_error (error, local_error); + goto out; + } + } + else + { + local_error = NULL; + byte = g_data_input_stream_read_byte (dis, cancellable, &local_error); + if (local_error != NULL) + { + g_propagate_error (error, local_error); + goto out; + } + } +#else + local_error = NULL; + byte = g_data_input_stream_read_byte (dis, cancellable, &local_error); + if (local_error != NULL) + { + g_propagate_error (error, local_error); + goto out; + } +#endif + if (credentials != NULL) + { + if (G_UNLIKELY (_g_dbus_debug_authentication ())) + { + s = g_credentials_to_string (credentials); + debug_print ("SERVER: received credentials `%s'", s); + g_free (s); + } + } + else + { + debug_print ("SERVER: didn't receive any credentials"); + } + + state = SERVER_STATE_WAITING_FOR_AUTH; + while (TRUE) + { + switch (state) + { + case SERVER_STATE_WAITING_FOR_AUTH: + debug_print ("SERVER: WaitingForAuth"); + line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + debug_print ("SERVER: WaitingForAuth, read `%s'", line); + if (line == NULL) + goto out; + if (g_strcmp0 (line, "AUTH") == 0) + { + s = get_auth_mechanisms (auth, allow_anonymous, "REJECTED ", "\r\n", " "); + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_free (s); + goto out; + } + g_free (s); + g_free (line); + } + else if (g_str_has_prefix (line, "AUTH ")) + { + gchar **tokens; + const gchar *encoded; + const gchar *mech_name; + GType auth_mech_to_use_gtype; + + tokens = g_strsplit (line, " ", 0); + g_free (line); + + switch (g_strv_length (tokens)) + { + case 2: + /* no initial response */ + mech_name = tokens[1]; + encoded = NULL; + break; + + case 3: + /* initial response */ + mech_name = tokens[1]; + encoded = tokens[2]; + break; + + default: + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Unexpected line `%s' while in WaitingForAuth state", + line); + g_strfreev (tokens); + goto out; + } + + /* TODO: record that the client has attempted to use this mechanism */ + //g_debug ("client is trying `%s'", mech_name); + + auth_mech_to_use_gtype = find_mech_by_name (auth, mech_name); + if ((auth_mech_to_use_gtype == (GType) 0) || + (!allow_anonymous && g_strcmp0 (mech_name, "ANONYMOUS") == 0)) + { + /* We don't support this auth mechanism */ + g_strfreev (tokens); + s = get_auth_mechanisms (auth, allow_anonymous, "REJECTED ", "\r\n", " "); + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_free (s); + goto out; + } + g_free (s); + + /* stay in WAITING FOR AUTH */ + state = SERVER_STATE_WAITING_FOR_AUTH; + } + else + { + gchar *initial_response; + gsize initial_response_len; + + mech = g_object_new (auth_mech_to_use_gtype, + "stream", auth->priv->stream, + "credentials", credentials, + NULL); + + initial_response = NULL; + initial_response_len = 0; + if (encoded != NULL) + { + initial_response = hexdecode (encoded, &initial_response_len, error); + if (initial_response == NULL) + { + g_prefix_error (error, "Initial response is malformed: "); + /* invalid encoding, disconnect! */ + g_strfreev (tokens); + goto out; + } + } + + _g_dbus_auth_mechanism_server_initiate (mech, + initial_response, + initial_response_len); + g_free (initial_response); + g_strfreev (tokens); + + change_state: + switch (_g_dbus_auth_mechanism_server_get_state (mech)) + { + case G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED: + if (observer != NULL && + !g_dbus_auth_observer_authorize_authenticated_peer (observer, + auth->priv->stream, + credentials)) + { + /* disconnect */ + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Cancelled via GDBusAuthObserver::authorize-authenticated-peer")); + goto out; + } + else + { + s = g_strdup_printf ("OK %s\r\n", guid); + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_free (s); + goto out; + } + g_free (s); + state = SERVER_STATE_WAITING_FOR_BEGIN; + } + break; + + case G_DBUS_AUTH_MECHANISM_STATE_REJECTED: + s = get_auth_mechanisms (auth, allow_anonymous, "REJECTED ", "\r\n", " "); + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_free (s); + goto out; + } + g_free (s); + state = SERVER_STATE_WAITING_FOR_AUTH; + break; + + case G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA: + state = SERVER_STATE_WAITING_FOR_DATA; + break; + + case G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND: + { + gchar *data; + gsize data_len; + gchar *encoded_data; + data = _g_dbus_auth_mechanism_server_data_send (mech, &data_len); + encoded_data = hexencode (data); + s = g_strdup_printf ("DATA %s\r\n", encoded_data); + g_free (encoded_data); + g_free (data); + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + { + g_free (s); + goto out; + } + g_free (s); + } + goto change_state; + break; + + default: + /* TODO */ + g_assert_not_reached (); + break; + } + } + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Unexpected line `%s' while in WaitingForAuth state", + line); + g_free (line); + goto out; + } + break; + + case SERVER_STATE_WAITING_FOR_DATA: + debug_print ("SERVER: WaitingForData"); + line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error); + debug_print ("SERVER: WaitingForData, read `%s'", line); + if (line == NULL) + goto out; + if (g_str_has_prefix (line, "DATA ")) + { + gchar *encoded; + gchar *decoded_data; + gsize decoded_data_len = 0; + + encoded = g_strdup (line + 5); + g_free (line); + g_strstrip (encoded); + decoded_data = hexdecode (encoded, &decoded_data_len, error); + g_free (encoded); + if (decoded_data == NULL) + { + g_prefix_error (error, "DATA response is malformed: "); + /* invalid encoding, disconnect! */ + goto out; + } + _g_dbus_auth_mechanism_server_data_receive (mech, decoded_data, decoded_data_len); + g_free (decoded_data); + /* oh man, this goto-crap is so ugly.. really need to rewrite the state machine */ + goto change_state; + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Unexpected line `%s' while in WaitingForData state", + line); + g_free (line); + } + goto out; + + case SERVER_STATE_WAITING_FOR_BEGIN: + debug_print ("SERVER: WaitingForBegin"); + /* Use extremely slow (but reliable) line reader - this basically + * does a recvfrom() system call per character + * + * (the problem with using GDataInputStream's read_line is that because of + * buffering it might start reading into the first D-Bus message that + * appears after "BEGIN\r\n"....) + */ + line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream), + &line_length, + cancellable, + error); + debug_print ("SERVER: WaitingForBegin, read `%s'", line); + if (line == NULL) + goto out; + if (g_strcmp0 (line, "BEGIN") == 0) + { + /* YAY, done! */ + ret = TRUE; + g_free (line); + goto out; + } + else if (g_strcmp0 (line, "NEGOTIATE_UNIX_FD") == 0) + { + g_free (line); + if (offered_capabilities & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING) + { + negotiated_capabilities |= G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING; + s = "AGREE_UNIX_FD\r\n"; + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + } + else + { + s = "ERROR \"fd passing not offered\"\r\n"; + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + } + } + else + { + g_debug ("Unexpected line `%s' while in WaitingForBegin state", line); + g_free (line); + s = "ERROR \"Unknown Command\"\r\n"; + debug_print ("SERVER: writing `%s'", s); + if (!g_data_output_stream_put_string (dos, s, cancellable, error)) + goto out; + } + break; + + default: + g_assert_not_reached (); + break; + } + } + + + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Not implemented (server)"); + + out: + if (mech != NULL) + g_object_unref (mech); + if (dis != NULL) + g_object_unref (dis); + if (dos != NULL) + g_object_unref (dos); + + /* ensure return value is FALSE if error is set */ + if (error != NULL && *error != NULL) + { + ret = FALSE; + } + + if (ret) + { + if (out_negotiated_capabilities != NULL) + *out_negotiated_capabilities = negotiated_capabilities; + if (out_received_credentials != NULL) + *out_received_credentials = credentials != NULL ? g_object_ref (credentials) : NULL; + } + + if (credentials != NULL) + g_object_unref (credentials); + + debug_print ("SERVER: Done, authenticated=%d", ret); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusauth.h b/gio/gdbusauth.h new file mode 100644 index 0000000..0395659 --- /dev/null +++ b/gio/gdbusauth.h @@ -0,0 +1,86 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (GIO_COMPILATION) +#error "gdbusauth.h is a private header file." +#endif + +#ifndef __G_DBUS_AUTH_H__ +#define __G_DBUS_AUTH_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_AUTH (_g_dbus_auth_get_type ()) +#define G_DBUS_AUTH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH, GDBusAuth)) +#define G_DBUS_AUTH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_AUTH, GDBusAuthClass)) +#define G_DBUS_AUTH_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_AUTH, GDBusAuthClass)) +#define G_IS_DBUS_AUTH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH)) +#define G_IS_DBUS_AUTH_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_AUTH)) + +typedef struct _GDBusAuth GDBusAuth; +typedef struct _GDBusAuthClass GDBusAuthClass; +typedef struct _GDBusAuthPrivate GDBusAuthPrivate; + +struct _GDBusAuthClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +struct _GDBusAuth +{ + GObject parent_instance; + GDBusAuthPrivate *priv; +}; + +GType _g_dbus_auth_get_type (void) G_GNUC_CONST; +GDBusAuth *_g_dbus_auth_new (GIOStream *stream); + +/* TODO: need a way to set allowed authentication mechanisms */ + +/* TODO: need a way to convey credentials etc. */ + +/* TODO: need a way to convey negotiated features (e.g. returning flags from e.g. GDBusConnectionFeatures) */ + +/* TODO: need to expose encode()/decode() from the AuthMechanism (and whether it is needed at all) */ + +gboolean _g_dbus_auth_run_server (GDBusAuth *auth, + GDBusAuthObserver *observer, + const gchar *guid, + gboolean allow_anonymous, + GDBusCapabilityFlags offered_capabilities, + GDBusCapabilityFlags *out_negotiated_capabilities, + GCredentials **out_received_credentials, + GCancellable *cancellable, + GError **error); + +gchar *_g_dbus_auth_run_client (GDBusAuth *auth, + GDBusCapabilityFlags offered_capabilities, + GDBusCapabilityFlags *out_negotiated_capabilities, + GCancellable *cancellable, + GError **error); + +G_END_DECLS + +#endif /* __G_DBUS_AUTH_H__ */ diff --git a/gio/gdbusauthmechanism.c b/gio/gdbusauthmechanism.c new file mode 100644 index 0000000..c255992 --- /dev/null +++ b/gio/gdbusauthmechanism.c @@ -0,0 +1,341 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include "gdbusauthmechanism.h" +#include "gcredentials.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" +#include "giostream.h" + +#include "glibintl.h" + +/* ---------------------------------------------------------------------------------------------------- */ + +struct _GDBusAuthMechanismPrivate +{ + GIOStream *stream; + GCredentials *credentials; +}; + +enum +{ + PROP_0, + PROP_STREAM, + PROP_CREDENTIALS +}; + +G_DEFINE_ABSTRACT_TYPE (GDBusAuthMechanism, _g_dbus_auth_mechanism, G_TYPE_OBJECT); + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_auth_mechanism_finalize (GObject *object) +{ + GDBusAuthMechanism *mechanism = G_DBUS_AUTH_MECHANISM (object); + + if (mechanism->priv->stream != NULL) + g_object_unref (mechanism->priv->stream); + if (mechanism->priv->credentials != NULL) + g_object_unref (mechanism->priv->credentials); + + G_OBJECT_CLASS (_g_dbus_auth_mechanism_parent_class)->finalize (object); +} + +static void +_g_dbus_auth_mechanism_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GDBusAuthMechanism *mechanism = G_DBUS_AUTH_MECHANISM (object); + + switch (prop_id) + { + case PROP_STREAM: + g_value_set_object (value, mechanism->priv->stream); + break; + + case PROP_CREDENTIALS: + g_value_set_object (value, mechanism->priv->credentials); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +_g_dbus_auth_mechanism_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GDBusAuthMechanism *mechanism = G_DBUS_AUTH_MECHANISM (object); + + switch (prop_id) + { + case PROP_STREAM: + mechanism->priv->stream = g_value_dup_object (value); + break; + + case PROP_CREDENTIALS: + mechanism->priv->credentials = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +_g_dbus_auth_mechanism_class_init (GDBusAuthMechanismClass *klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GDBusAuthMechanismPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->get_property = _g_dbus_auth_mechanism_get_property; + gobject_class->set_property = _g_dbus_auth_mechanism_set_property; + gobject_class->finalize = _g_dbus_auth_mechanism_finalize; + + g_object_class_install_property (gobject_class, + PROP_STREAM, + g_param_spec_object ("stream", + P_("IO Stream"), + P_("The underlying GIOStream used for I/O"), + G_TYPE_IO_STREAM, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusAuthMechanism:credentials: + * + * If authenticating as a server, this property contains the + * received credentials, if any. + * + * If authenticating as a client, the property contains the + * credentials that were sent, if any. + */ + g_object_class_install_property (gobject_class, + PROP_CREDENTIALS, + g_param_spec_object ("credentials", + P_("Credentials"), + P_("The credentials of the remote peer"), + G_TYPE_CREDENTIALS, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); +} + +static void +_g_dbus_auth_mechanism_init (GDBusAuthMechanism *mechanism) +{ + /* not used for now */ + mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism, + G_TYPE_DBUS_AUTH_MECHANISM, + GDBusAuthMechanismPrivate); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +GIOStream * +_g_dbus_auth_mechanism_get_stream (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return mechanism->priv->stream; +} + +GCredentials * +_g_dbus_auth_mechanism_get_credentials (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return mechanism->priv->credentials; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +const gchar * +_g_dbus_auth_mechanism_get_name (GType mechanism_type) +{ + const gchar *name; + GDBusAuthMechanismClass *klass; + + g_return_val_if_fail (g_type_is_a (mechanism_type, G_TYPE_DBUS_AUTH_MECHANISM), NULL); + + klass = g_type_class_ref (mechanism_type); + g_assert (klass != NULL); + name = klass->get_name (); + //g_type_class_unref (klass); + + return name; +} + +gint +_g_dbus_auth_mechanism_get_priority (GType mechanism_type) +{ + gint priority; + GDBusAuthMechanismClass *klass; + + g_return_val_if_fail (g_type_is_a (mechanism_type, G_TYPE_DBUS_AUTH_MECHANISM), 0); + + klass = g_type_class_ref (mechanism_type); + g_assert (klass != NULL); + priority = klass->get_priority (); + //g_type_class_unref (klass); + + return priority; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +gboolean +_g_dbus_auth_mechanism_is_supported (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), FALSE); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->is_supported (mechanism); +} + +gchar * +_g_dbus_auth_mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->encode_data (mechanism, data, data_len, out_data_len); +} + + +gchar * +_g_dbus_auth_mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->decode_data (mechanism, data, data_len, out_data_len); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +GDBusAuthMechanismState +_g_dbus_auth_mechanism_server_get_state (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_get_state (mechanism); +} + +void +_g_dbus_auth_mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len) +{ + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism)); + G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_initiate (mechanism, initial_response, initial_response_len); +} + +void +_g_dbus_auth_mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism)); + G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_data_receive (mechanism, data, data_len); +} + +gchar * +_g_dbus_auth_mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_data_send (mechanism, out_data_len); +} + +gchar * +_g_dbus_auth_mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_get_reject_reason (mechanism); +} + +void +_g_dbus_auth_mechanism_server_shutdown (GDBusAuthMechanism *mechanism) +{ + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism)); + G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_shutdown (mechanism); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +GDBusAuthMechanismState +_g_dbus_auth_mechanism_client_get_state (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_get_state (mechanism); +} + +gchar * +_g_dbus_auth_mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_initiate (mechanism, + out_initial_response_len); +} + +void +_g_dbus_auth_mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism)); + G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_data_receive (mechanism, data, data_len); +} + +gchar * +_g_dbus_auth_mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL); + return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_data_send (mechanism, out_data_len); +} + +void +_g_dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism) +{ + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism)); + G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_shutdown (mechanism); +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusauthmechanism.h b/gio/gdbusauthmechanism.h new file mode 100644 index 0000000..44829c0 --- /dev/null +++ b/gio/gdbusauthmechanism.h @@ -0,0 +1,154 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (GIO_COMPILATION) +#error "gdbusauthmechanism.h is a private header file." +#endif + +#ifndef __G_DBUS_AUTH_MECHANISM_H__ +#define __G_DBUS_AUTH_MECHANISM_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_AUTH_MECHANISM (_g_dbus_auth_mechanism_get_type ()) +#define G_DBUS_AUTH_MECHANISM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH_MECHANISM, GDBusAuthMechanism)) +#define G_DBUS_AUTH_MECHANISM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_AUTH_MECHANISM, GDBusAuthMechanismClass)) +#define G_DBUS_AUTH_MECHANISM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_AUTH_MECHANISM, GDBusAuthMechanismClass)) +#define G_IS_DBUS_AUTH_MECHANISM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH_MECHANISM)) +#define G_IS_DBUS_AUTH_MECHANISM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_AUTH_MECHANISM)) + +typedef struct _GDBusAuthMechanism GDBusAuthMechanism; +typedef struct _GDBusAuthMechanismClass GDBusAuthMechanismClass; +typedef struct _GDBusAuthMechanismPrivate GDBusAuthMechanismPrivate; + +typedef enum { + G_DBUS_AUTH_MECHANISM_STATE_INVALID, + G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA, + G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, + G_DBUS_AUTH_MECHANISM_STATE_REJECTED, + G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED, +} GDBusAuthMechanismState; + +struct _GDBusAuthMechanismClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + + /* VTable */ + + /* TODO: server_initiate and client_initiate probably needs to have a + * GCredentials parameter... + */ + + gint (*get_priority) (void); + const gchar *(*get_name) (void); + + /* functions shared by server/client */ + gboolean (*is_supported) (GDBusAuthMechanism *mechanism); + gchar *(*encode_data) (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); + gchar *(*decode_data) (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); + + /* functions for server-side authentication */ + GDBusAuthMechanismState (*server_get_state) (GDBusAuthMechanism *mechanism); + void (*server_initiate) (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len); + void (*server_data_receive) (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); + gchar *(*server_data_send) (GDBusAuthMechanism *mechanism, + gsize *out_data_len); + gchar *(*server_get_reject_reason) (GDBusAuthMechanism *mechanism); + void (*server_shutdown) (GDBusAuthMechanism *mechanism); + + /* functions for client-side authentication */ + GDBusAuthMechanismState (*client_get_state) (GDBusAuthMechanism *mechanism); + gchar *(*client_initiate) (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len); + void (*client_data_receive) (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); + gchar *(*client_data_send) (GDBusAuthMechanism *mechanism, + gsize *out_data_len); + void (*client_shutdown) (GDBusAuthMechanism *mechanism); +}; + +struct _GDBusAuthMechanism +{ + GObject parent_instance; + GDBusAuthMechanismPrivate *priv; +}; + +GType _g_dbus_auth_mechanism_get_type (void) G_GNUC_CONST; + +gint _g_dbus_auth_mechanism_get_priority (GType mechanism_type); +const gchar *_g_dbus_auth_mechanism_get_name (GType mechanism_type); + +GIOStream *_g_dbus_auth_mechanism_get_stream (GDBusAuthMechanism *mechanism); +GCredentials *_g_dbus_auth_mechanism_get_credentials (GDBusAuthMechanism *mechanism); + +gboolean _g_dbus_auth_mechanism_is_supported (GDBusAuthMechanism *mechanism); +gchar *_g_dbus_auth_mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +gchar *_g_dbus_auth_mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); + +GDBusAuthMechanismState _g_dbus_auth_mechanism_server_get_state (GDBusAuthMechanism *mechanism); +void _g_dbus_auth_mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len); +void _g_dbus_auth_mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +gchar *_g_dbus_auth_mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +gchar *_g_dbus_auth_mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism); +void _g_dbus_auth_mechanism_server_shutdown (GDBusAuthMechanism *mechanism); + +GDBusAuthMechanismState _g_dbus_auth_mechanism_client_get_state (GDBusAuthMechanism *mechanism); +gchar *_g_dbus_auth_mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len); +void _g_dbus_auth_mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +gchar *_g_dbus_auth_mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +void _g_dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism); + + +G_END_DECLS + +#endif /* __G_DBUS_AUTH_MECHANISM_H__ */ diff --git a/gio/gdbusauthmechanismanon.c b/gio/gdbusauthmechanismanon.c new file mode 100644 index 0000000..601200d --- /dev/null +++ b/gio/gdbusauthmechanismanon.c @@ -0,0 +1,327 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include "gdbusauthmechanismanon.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" + +#include "glibintl.h" + +struct _GDBusAuthMechanismAnonPrivate +{ + gboolean is_client; + gboolean is_server; + GDBusAuthMechanismState state; +}; + +static gint mechanism_get_priority (void); +static const gchar *mechanism_get_name (void); + +static gboolean mechanism_is_supported (GDBusAuthMechanism *mechanism); +static gchar *mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +static gchar *mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +static GDBusAuthMechanismState mechanism_server_get_state (GDBusAuthMechanism *mechanism); +static void mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len); +static void mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +static gchar *mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +static gchar *mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism); +static void mechanism_server_shutdown (GDBusAuthMechanism *mechanism); +static GDBusAuthMechanismState mechanism_client_get_state (GDBusAuthMechanism *mechanism); +static gchar *mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len); +static void mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +static gchar *mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +static void mechanism_client_shutdown (GDBusAuthMechanism *mechanism); + +/* ---------------------------------------------------------------------------------------------------- */ + +G_DEFINE_TYPE (GDBusAuthMechanismAnon, _g_dbus_auth_mechanism_anon, G_TYPE_DBUS_AUTH_MECHANISM); + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_auth_mechanism_anon_finalize (GObject *object) +{ + //GDBusAuthMechanismAnon *mechanism = G_DBUS_AUTH_MECHANISM_ANON (object); + + if (G_OBJECT_CLASS (_g_dbus_auth_mechanism_anon_parent_class)->finalize != NULL) + G_OBJECT_CLASS (_g_dbus_auth_mechanism_anon_parent_class)->finalize (object); +} + +static void +_g_dbus_auth_mechanism_anon_class_init (GDBusAuthMechanismAnonClass *klass) +{ + GObjectClass *gobject_class; + GDBusAuthMechanismClass *mechanism_class; + + g_type_class_add_private (klass, sizeof (GDBusAuthMechanismAnonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = _g_dbus_auth_mechanism_anon_finalize; + + mechanism_class = G_DBUS_AUTH_MECHANISM_CLASS (klass); + mechanism_class->get_priority = mechanism_get_priority; + mechanism_class->get_name = mechanism_get_name; + mechanism_class->is_supported = mechanism_is_supported; + mechanism_class->encode_data = mechanism_encode_data; + mechanism_class->decode_data = mechanism_decode_data; + mechanism_class->server_get_state = mechanism_server_get_state; + mechanism_class->server_initiate = mechanism_server_initiate; + mechanism_class->server_data_receive = mechanism_server_data_receive; + mechanism_class->server_data_send = mechanism_server_data_send; + mechanism_class->server_get_reject_reason = mechanism_server_get_reject_reason; + mechanism_class->server_shutdown = mechanism_server_shutdown; + mechanism_class->client_get_state = mechanism_client_get_state; + mechanism_class->client_initiate = mechanism_client_initiate; + mechanism_class->client_data_receive = mechanism_client_data_receive; + mechanism_class->client_data_send = mechanism_client_data_send; + mechanism_class->client_shutdown = mechanism_client_shutdown; +} + +static void +_g_dbus_auth_mechanism_anon_init (GDBusAuthMechanismAnon *mechanism) +{ + mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism, + G_TYPE_DBUS_AUTH_MECHANISM_ANON, + GDBusAuthMechanismAnonPrivate); +} + +/* ---------------------------------------------------------------------------------------------------- */ + + +static gint +mechanism_get_priority (void) +{ + /* We prefer ANONYMOUS to most other mechanism (such as DBUS_COOKIE_SHA1) but not to EXTERNAL */ + return 50; +} + + +static const gchar * +mechanism_get_name (void) +{ + return "ANONYMOUS"; +} + +static gboolean +mechanism_is_supported (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), FALSE); + return TRUE; +} + +static gchar * +mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + return NULL; +} + + +static gchar * +mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanismState +mechanism_server_get_state (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, G_DBUS_AUTH_MECHANISM_STATE_INVALID); + + return m->priv->state; +} + +static void +mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism)); + g_return_if_fail (!m->priv->is_server && !m->priv->is_client); + + if (initial_response != NULL) + g_debug ("ANONYMOUS: initial_response was `%s'", initial_response); + + m->priv->is_server = TRUE; + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; +} + +static void +mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism)); + g_return_if_fail (m->priv->is_server && !m->priv->is_client); + g_return_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA); + + /* can never end up here because we are never in the WAITING_FOR_DATA state */ + g_assert_not_reached (); +} + +static gchar * +mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), NULL); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL); + + /* can never end up here because we are never in the HAVE_DATA_TO_SEND state */ + g_assert_not_reached (); + + return NULL; +} + +static gchar * +mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), NULL); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_REJECTED, NULL); + + /* can never end up here because we are never in the REJECTED state */ + g_assert_not_reached (); + + return NULL; +} + +static void +mechanism_server_shutdown (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism)); + g_return_if_fail (m->priv->is_server && !m->priv->is_client); + + m->priv->is_server = FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanismState +mechanism_client_get_state (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + g_return_val_if_fail (m->priv->is_client && !m->priv->is_server, G_DBUS_AUTH_MECHANISM_STATE_INVALID); + + return m->priv->state; +} + +static gchar * +mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), NULL); + g_return_val_if_fail (!m->priv->is_server && !m->priv->is_client, NULL); + + m->priv->is_client = TRUE; + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; + + *out_initial_response_len = -1; + + /* just return our library name and version */ + return g_strdup ("GDBus 0.1"); +} + +static void +mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism)); + g_return_if_fail (m->priv->is_client && !m->priv->is_server); + g_return_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA); + + /* can never end up here because we are never in the WAITING_FOR_DATA state */ + g_assert_not_reached (); +} + +static gchar * +mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism), NULL); + g_return_val_if_fail (m->priv->is_client && !m->priv->is_server, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL); + + /* can never end up here because we are never in the HAVE_DATA_TO_SEND state */ + g_assert_not_reached (); + + return NULL; +} + +static void +mechanism_client_shutdown (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismAnon *m = G_DBUS_AUTH_MECHANISM_ANON (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_ANON (mechanism)); + g_return_if_fail (m->priv->is_client && !m->priv->is_server); + + m->priv->is_client = FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusauthmechanismanon.h b/gio/gdbusauthmechanismanon.h new file mode 100644 index 0000000..744044e --- /dev/null +++ b/gio/gdbusauthmechanismanon.h @@ -0,0 +1,63 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (GIO_COMPILATION) +#error "gdbusauthmechanismanon.h is a private header file." +#endif + +#ifndef __G_DBUS_AUTH_MECHANISM_ANON_H__ +#define __G_DBUS_AUTH_MECHANISM_ANON_H__ + +#include +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_AUTH_MECHANISM_ANON (_g_dbus_auth_mechanism_anon_get_type ()) +#define G_DBUS_AUTH_MECHANISM_ANON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH_MECHANISM_ANON, GDBusAuthMechanismAnon)) +#define G_DBUS_AUTH_MECHANISM_ANON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_AUTH_MECHANISM_ANON, GDBusAuthMechanismAnonClass)) +#define G_DBUS_AUTH_MECHANISM_ANON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_AUTH_MECHANISM_ANON, GDBusAuthMechanismAnonClass)) +#define G_IS_DBUS_AUTH_MECHANISM_ANON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH_MECHANISM_ANON)) +#define G_IS_DBUS_AUTH_MECHANISM_ANON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_AUTH_MECHANISM_ANON)) + +typedef struct _GDBusAuthMechanismAnon GDBusAuthMechanismAnon; +typedef struct _GDBusAuthMechanismAnonClass GDBusAuthMechanismAnonClass; +typedef struct _GDBusAuthMechanismAnonPrivate GDBusAuthMechanismAnonPrivate; + +struct _GDBusAuthMechanismAnonClass +{ + /*< private >*/ + GDBusAuthMechanismClass parent_class; +}; + +struct _GDBusAuthMechanismAnon +{ + GDBusAuthMechanism parent_instance; + GDBusAuthMechanismAnonPrivate *priv; +}; + +GType _g_dbus_auth_mechanism_anon_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __G_DBUS_AUTH_MECHANISM_ANON_H__ */ diff --git a/gio/gdbusauthmechanismexternal.c b/gio/gdbusauthmechanismexternal.c new file mode 100644 index 0000000..3fcb1ee --- /dev/null +++ b/gio/gdbusauthmechanismexternal.c @@ -0,0 +1,404 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "gdbusauthmechanismexternal.h" +#include "gcredentials.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" + +#include "glibintl.h" + +struct _GDBusAuthMechanismExternalPrivate +{ + gboolean is_client; + gboolean is_server; + GDBusAuthMechanismState state; +}; + +static gint mechanism_get_priority (void); +static const gchar *mechanism_get_name (void); + +static gboolean mechanism_is_supported (GDBusAuthMechanism *mechanism); +static gchar *mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +static gchar *mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +static GDBusAuthMechanismState mechanism_server_get_state (GDBusAuthMechanism *mechanism); +static void mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len); +static void mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +static gchar *mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +static gchar *mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism); +static void mechanism_server_shutdown (GDBusAuthMechanism *mechanism); +static GDBusAuthMechanismState mechanism_client_get_state (GDBusAuthMechanism *mechanism); +static gchar *mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len); +static void mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +static gchar *mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +static void mechanism_client_shutdown (GDBusAuthMechanism *mechanism); + +/* ---------------------------------------------------------------------------------------------------- */ + +G_DEFINE_TYPE (GDBusAuthMechanismExternal, _g_dbus_auth_mechanism_external, G_TYPE_DBUS_AUTH_MECHANISM); + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_auth_mechanism_external_finalize (GObject *object) +{ + //GDBusAuthMechanismExternal *mechanism = G_DBUS_AUTH_MECHANISM_EXTERNAL (object); + + if (G_OBJECT_CLASS (_g_dbus_auth_mechanism_external_parent_class)->finalize != NULL) + G_OBJECT_CLASS (_g_dbus_auth_mechanism_external_parent_class)->finalize (object); +} + +static void +_g_dbus_auth_mechanism_external_class_init (GDBusAuthMechanismExternalClass *klass) +{ + GObjectClass *gobject_class; + GDBusAuthMechanismClass *mechanism_class; + + g_type_class_add_private (klass, sizeof (GDBusAuthMechanismExternalPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = _g_dbus_auth_mechanism_external_finalize; + + mechanism_class = G_DBUS_AUTH_MECHANISM_CLASS (klass); + mechanism_class->get_name = mechanism_get_name; + mechanism_class->get_priority = mechanism_get_priority; + mechanism_class->is_supported = mechanism_is_supported; + mechanism_class->encode_data = mechanism_encode_data; + mechanism_class->decode_data = mechanism_decode_data; + mechanism_class->server_get_state = mechanism_server_get_state; + mechanism_class->server_initiate = mechanism_server_initiate; + mechanism_class->server_data_receive = mechanism_server_data_receive; + mechanism_class->server_data_send = mechanism_server_data_send; + mechanism_class->server_get_reject_reason = mechanism_server_get_reject_reason; + mechanism_class->server_shutdown = mechanism_server_shutdown; + mechanism_class->client_get_state = mechanism_client_get_state; + mechanism_class->client_initiate = mechanism_client_initiate; + mechanism_class->client_data_receive = mechanism_client_data_receive; + mechanism_class->client_data_send = mechanism_client_data_send; + mechanism_class->client_shutdown = mechanism_client_shutdown; +} + +static void +_g_dbus_auth_mechanism_external_init (GDBusAuthMechanismExternal *mechanism) +{ + mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism, + G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL, + GDBusAuthMechanismExternalPrivate); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +mechanism_is_supported (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), FALSE); + /* This mechanism is only available if credentials has been exchanged */ + if (_g_dbus_auth_mechanism_get_credentials (mechanism) != NULL) + return TRUE; + else + return FALSE; +} + +static gint +mechanism_get_priority (void) +{ + /* We prefer EXTERNAL to most other mechanism (DBUS_COOKIE_SHA1 and ANONYMOUS) */ + return 100; +} + +static const gchar * +mechanism_get_name (void) +{ + return "EXTERNAL"; +} + +static gchar * +mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + return NULL; +} + + +static gchar * +mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanismState +mechanism_server_get_state (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, G_DBUS_AUTH_MECHANISM_STATE_INVALID); + + return m->priv->state; +} + +static gboolean +data_matches_credentials (const gchar *data, + GCredentials *credentials) +{ + gboolean match; + + match = FALSE; + + if (credentials == NULL) + goto out; + + if (data == NULL || strlen (data) == 0) + goto out; + +#if defined(G_OS_UNIX) + { + gint64 alleged_uid; + gchar *endp; + + /* on UNIX, this is the uid as a string in base 10 */ + alleged_uid = g_ascii_strtoll (data, &endp, 10); + if (*endp == '\0') + { + if (g_credentials_get_unix_user (credentials, NULL) == alleged_uid) + { + match = TRUE; + } + } + } +#else + /* TODO: Dont know how to compare credentials on this OS. Please implement. */ +#endif + + out: + return match; +} + +static void +mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism)); + g_return_if_fail (!m->priv->is_server && !m->priv->is_client); + + m->priv->is_server = TRUE; + + if (initial_response != NULL) + { + if (data_matches_credentials (initial_response, _g_dbus_auth_mechanism_get_credentials (mechanism))) + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; + } + else + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + } + } + else + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA; + } +} + +static void +mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism)); + g_return_if_fail (m->priv->is_server && !m->priv->is_client); + g_return_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA); + + if (data_matches_credentials (data, _g_dbus_auth_mechanism_get_credentials (mechanism))) + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; + } + else + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + } +} + +static gchar * +mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), NULL); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL); + + /* can never end up here because we are never in the HAVE_DATA_TO_SEND state */ + g_assert_not_reached (); + + return NULL; +} + +static gchar * +mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), NULL); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_REJECTED, NULL); + + /* can never end up here because we are never in the REJECTED state */ + g_assert_not_reached (); + + return NULL; +} + +static void +mechanism_server_shutdown (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism)); + g_return_if_fail (m->priv->is_server && !m->priv->is_client); + + m->priv->is_server = FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanismState +mechanism_client_get_state (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + g_return_val_if_fail (m->priv->is_client && !m->priv->is_server, G_DBUS_AUTH_MECHANISM_STATE_INVALID); + + return m->priv->state; +} + +static gchar * +mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + gchar *initial_response; + GCredentials *credentials; + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), NULL); + g_return_val_if_fail (!m->priv->is_server && !m->priv->is_client, NULL); + + m->priv->is_client = TRUE; + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; + + *out_initial_response_len = -1; + + credentials = _g_dbus_auth_mechanism_get_credentials (mechanism); + g_assert (credentials != NULL); + + /* return the uid */ +#if defined(G_OS_UNIX) + initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) g_credentials_get_unix_user (credentials, NULL)); +#elif defined(G_OS_WIN32) +#ifdef __GNUC__ +#warning Dont know how to send credentials on this OS. The EXTERNAL D-Bus authentication mechanism will not work. +#endif + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; +#endif + return initial_response; +} + +static void +mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism)); + g_return_if_fail (m->priv->is_client && !m->priv->is_server); + g_return_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA); + + /* can never end up here because we are never in the WAITING_FOR_DATA state */ + g_assert_not_reached (); +} + +static gchar * +mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), NULL); + g_return_val_if_fail (m->priv->is_client && !m->priv->is_server, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL); + + /* can never end up here because we are never in the HAVE_DATA_TO_SEND state */ + g_assert_not_reached (); + + return NULL; +} + +static void +mechanism_client_shutdown (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismExternal *m = G_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism)); + g_return_if_fail (m->priv->is_client && !m->priv->is_server); + + m->priv->is_client = FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusauthmechanismexternal.h b/gio/gdbusauthmechanismexternal.h new file mode 100644 index 0000000..ca45136 --- /dev/null +++ b/gio/gdbusauthmechanismexternal.h @@ -0,0 +1,63 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (GIO_COMPILATION) +#error "gdbusauthmechanismexternal.h is a private header file." +#endif + +#ifndef __G_DBUS_AUTH_MECHANISM_EXTERNAL_H__ +#define __G_DBUS_AUTH_MECHANISM_EXTERNAL_H__ + +#include +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL (_g_dbus_auth_mechanism_external_get_type ()) +#define G_DBUS_AUTH_MECHANISM_EXTERNAL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL, GDBusAuthMechanismExternal)) +#define G_DBUS_AUTH_MECHANISM_EXTERNAL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL, GDBusAuthMechanismExternalClass)) +#define G_DBUS_AUTH_MECHANISM_EXTERNAL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL, GDBusAuthMechanismExternalClass)) +#define G_IS_DBUS_AUTH_MECHANISM_EXTERNAL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL)) +#define G_IS_DBUS_AUTH_MECHANISM_EXTERNAL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL)) + +typedef struct _GDBusAuthMechanismExternal GDBusAuthMechanismExternal; +typedef struct _GDBusAuthMechanismExternalClass GDBusAuthMechanismExternalClass; +typedef struct _GDBusAuthMechanismExternalPrivate GDBusAuthMechanismExternalPrivate; + +struct _GDBusAuthMechanismExternalClass +{ + /*< private >*/ + GDBusAuthMechanismClass parent_class; +}; + +struct _GDBusAuthMechanismExternal +{ + GDBusAuthMechanism parent_instance; + GDBusAuthMechanismExternalPrivate *priv; +}; + +GType _g_dbus_auth_mechanism_external_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __G_DBUS_AUTH_MECHANISM_EXTERNAL_H__ */ diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c new file mode 100644 index 0000000..cadcc99 --- /dev/null +++ b/gio/gdbusauthmechanismsha1.c @@ -0,0 +1,1219 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef _WIN32 +#include +#endif + +#include + +#include "gdbusauthmechanismsha1.h" +#include "gcredentials.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" +#include "gioerror.h" +#include "gdbusprivate.h" + +#include "glibintl.h" + +struct _GDBusAuthMechanismSha1Private +{ + gboolean is_client; + gboolean is_server; + GDBusAuthMechanismState state; + + /* used on the client side */ + gchar *to_send; + + /* used on the server side */ + gchar *cookie; + gchar *server_challenge; +}; + +static gint mechanism_get_priority (void); +static const gchar *mechanism_get_name (void); + +static gboolean mechanism_is_supported (GDBusAuthMechanism *mechanism); +static gchar *mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +static gchar *mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len); +static GDBusAuthMechanismState mechanism_server_get_state (GDBusAuthMechanism *mechanism); +static void mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len); +static void mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +static gchar *mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +static gchar *mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism); +static void mechanism_server_shutdown (GDBusAuthMechanism *mechanism); +static GDBusAuthMechanismState mechanism_client_get_state (GDBusAuthMechanism *mechanism); +static gchar *mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len); +static void mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len); +static gchar *mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len); +static void mechanism_client_shutdown (GDBusAuthMechanism *mechanism); + +/* ---------------------------------------------------------------------------------------------------- */ + +G_DEFINE_TYPE (GDBusAuthMechanismSha1, _g_dbus_auth_mechanism_sha1, G_TYPE_DBUS_AUTH_MECHANISM); + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_auth_mechanism_sha1_finalize (GObject *object) +{ + GDBusAuthMechanismSha1 *mechanism = G_DBUS_AUTH_MECHANISM_SHA1 (object); + + g_free (mechanism->priv->to_send); + + g_free (mechanism->priv->cookie); + g_free (mechanism->priv->server_challenge); + + if (G_OBJECT_CLASS (_g_dbus_auth_mechanism_sha1_parent_class)->finalize != NULL) + G_OBJECT_CLASS (_g_dbus_auth_mechanism_sha1_parent_class)->finalize (object); +} + +static void +_g_dbus_auth_mechanism_sha1_class_init (GDBusAuthMechanismSha1Class *klass) +{ + GObjectClass *gobject_class; + GDBusAuthMechanismClass *mechanism_class; + + g_type_class_add_private (klass, sizeof (GDBusAuthMechanismSha1Private)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = _g_dbus_auth_mechanism_sha1_finalize; + + mechanism_class = G_DBUS_AUTH_MECHANISM_CLASS (klass); + mechanism_class->get_priority = mechanism_get_priority; + mechanism_class->get_name = mechanism_get_name; + mechanism_class->is_supported = mechanism_is_supported; + mechanism_class->encode_data = mechanism_encode_data; + mechanism_class->decode_data = mechanism_decode_data; + mechanism_class->server_get_state = mechanism_server_get_state; + mechanism_class->server_initiate = mechanism_server_initiate; + mechanism_class->server_data_receive = mechanism_server_data_receive; + mechanism_class->server_data_send = mechanism_server_data_send; + mechanism_class->server_get_reject_reason = mechanism_server_get_reject_reason; + mechanism_class->server_shutdown = mechanism_server_shutdown; + mechanism_class->client_get_state = mechanism_client_get_state; + mechanism_class->client_initiate = mechanism_client_initiate; + mechanism_class->client_data_receive = mechanism_client_data_receive; + mechanism_class->client_data_send = mechanism_client_data_send; + mechanism_class->client_shutdown = mechanism_client_shutdown; +} + +static void +_g_dbus_auth_mechanism_sha1_init (GDBusAuthMechanismSha1 *mechanism) +{ + mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism, + G_TYPE_DBUS_AUTH_MECHANISM_SHA1, + GDBusAuthMechanismSha1Private); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gint +mechanism_get_priority (void) +{ + return 0; +} + +static const gchar * +mechanism_get_name (void) +{ + return "DBUS_COOKIE_SHA1"; +} + +static gboolean +mechanism_is_supported (GDBusAuthMechanism *mechanism) +{ + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), FALSE); + return TRUE; +} + +static gchar * +mechanism_encode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + return NULL; +} + + +static gchar * +mechanism_decode_data (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len, + gsize *out_data_len) +{ + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gint +random_ascii (void) +{ + gint ret; + ret = g_random_int_range (0, 60); + if (ret < 25) + ret += 'A'; + else if (ret < 50) + ret += 'a' - 25; + else + ret += '0' - 50; + return ret; +} + +static gchar * +random_ascii_string (guint len) +{ + GString *challenge; + guint n; + + challenge = g_string_new (NULL); + for (n = 0; n < len; n++) + g_string_append_c (challenge, random_ascii ()); + return g_string_free (challenge, FALSE); +} + +static gchar * +random_blob (guint len) +{ + GString *challenge; + guint n; + + challenge = g_string_new (NULL); + for (n = 0; n < len; n++) + g_string_append_c (challenge, g_random_int_range (0, 256)); + return g_string_free (challenge, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* ensure keyring dir exists and permissions are correct */ +static gchar * +ensure_keyring_directory (GError **error) +{ + gchar *path; + const gchar *e; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + e = g_getenv ("G_DBUS_COOKIE_SHA1_KEYRING_DIR"); + if (e != NULL) + { + path = g_strdup (e); + } + else + { + path = g_build_filename (g_get_home_dir (), + ".dbus-keyrings", + NULL); + } + + if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) + { + if (g_getenv ("G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION") == NULL) + { +#ifdef G_OS_UNIX + struct stat statbuf; + if (stat (path, &statbuf) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error statting directory `%s': %s"), + path, + strerror (errno)); + g_free (path); + path = NULL; + goto out; + } + if ((statbuf.st_mode & 0777) != 0700) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Permissions on directory `%s' are malformed. Expected mode 0700, got 0%o"), + path, + statbuf.st_mode & 0777); + g_free (path); + path = NULL; + goto out; + } +#else +#ifdef __GNUC__ +#warning Please implement permission checking on this non-UNIX platform +#endif +#endif + } + goto out; + } + + if (g_mkdir (path, 0700) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error creating directory `%s': %s"), + path, + strerror (errno)); + g_free (path); + path = NULL; + goto out; + } + +out: + return path; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +append_nibble (GString *s, gint val) +{ + g_string_append_c (s, val >= 10 ? ('a' + val - 10) : ('0' + val)); +} + +static gchar * +hexencode (const gchar *str, + gssize len) +{ + guint n; + GString *s; + + if (len == -1) + len = strlen (str); + + s = g_string_new (NULL); + for (n = 0; n < len; n++) + { + gint val; + gint upper_nibble; + gint lower_nibble; + + val = ((const guchar *) str)[n]; + upper_nibble = val >> 4; + lower_nibble = val & 0x0f; + + append_nibble (s, upper_nibble); + append_nibble (s, lower_nibble); + } + + return g_string_free (s, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* looks up an entry in the keyring */ +static gchar * +keyring_lookup_entry (const gchar *cookie_context, + gint cookie_id, + GError **error) +{ + gchar *ret; + gchar *keyring_dir; + gchar *contents; + gchar *path; + guint n; + gchar **lines; + + g_return_val_if_fail (cookie_context != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = NULL; + path = NULL; + contents = NULL; + lines = NULL; + + keyring_dir = ensure_keyring_directory (error); + if (keyring_dir == NULL) + goto out; + + path = g_build_filename (keyring_dir, cookie_context, NULL); + + if (!g_file_get_contents (path, + &contents, + NULL, + error)) + { + g_prefix_error (error, + _("Error opening keyring `%s' for reading: "), + path); + goto out; + } + g_assert (contents != NULL); + + lines = g_strsplit (contents, "\n", 0); + for (n = 0; lines[n] != NULL; n++) + { + const gchar *line = lines[n]; + gchar **tokens; + gchar *endp; + gint line_id; + guint64 line_when; + + if (line[0] == '\0') + continue; + + tokens = g_strsplit (line, " ", 0); + if (g_strv_length (tokens) != 3) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Line %d of the keyring at `%s' with content `%s' is malformed"), + n + 1, + path, + line); + g_strfreev (tokens); + goto out; + } + + line_id = g_ascii_strtoll (tokens[0], &endp, 10); + if (*endp != '\0') + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("First token of line %d of the keyring at `%s' with content `%s' is malformed"), + n + 1, + path, + line); + g_strfreev (tokens); + goto out; + } + + line_when = g_ascii_strtoll (tokens[1], &endp, 10); + if (*endp != '\0') + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Second token of line %d of the keyring at `%s' with content `%s' is malformed"), + n + 1, + path, + line); + g_strfreev (tokens); + goto out; + } + + if (line_id == cookie_id) + { + /* YAY, success */ + ret = tokens[2]; /* steal pointer */ + tokens[2] = NULL; + g_strfreev (tokens); + goto out; + } + + g_strfreev (tokens); + } + + /* BOOH, didn't find the cookie */ + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Didn't find cookie with id %d in the keyring at `%s'"), + cookie_id, + path); + + out: + g_free (keyring_dir); + g_free (path); + g_free (contents); + g_strfreev (lines); + return ret; +} + +/* function for logging important events that the system administrator should take notice of */ +static void +_log (const gchar *message, + ...) +{ + gchar *s; + va_list var_args; + + va_start (var_args, message); + s = g_strdup_vprintf (message, var_args); + va_end (var_args); + + /* TODO: might want to send this to syslog instead */ + g_printerr ("GDBus-DBUS_COOKIE_SHA1: %s\n", s); + g_free (s); +} + +static gint +keyring_acquire_lock (const gchar *path, + GError **error) +{ + gchar *lock; + gint ret; + guint num_tries; + guint num_create_tries; + + g_return_val_if_fail (path != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = -1; + lock = g_strdup_printf ("%s.lock", path); + + /* This is what the D-Bus spec says + * + * Create a lockfile name by appending ".lock" to the name of the + * cookie file. The server should attempt to create this file using + * O_CREAT | O_EXCL. If file creation fails, the lock + * fails. Servers should retry for a reasonable period of time, + * then they may choose to delete an existing lock to keep users + * from having to manually delete a stale lock. [1] + * + * [1] : Lockfiles are used instead of real file locking fcntl() because + * real locking implementations are still flaky on network filesystems + */ + + num_create_tries = 0; +#ifdef EEXISTS + again: +#endif + num_tries = 0; + while (g_file_test (lock, G_FILE_TEST_EXISTS)) + { + /* sleep 10ms, then try again */ + g_usleep (1000*10); + num_tries++; + if (num_tries == 50) + { + /* ok, we slept 50*10ms = 0.5 seconds. Conclude that the lock file must be + * stale (nuke the it from orbit) + */ + if (g_unlink (lock) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error deleting stale lock file `%s': %s"), + lock, + strerror (errno)); + goto out; + } + _log ("Deleted stale lock file `%s'", lock); + break; + } + } + + ret = g_open (lock, O_CREAT | +#ifdef O_EXCL + O_EXCL, +#else + 0, +#endif + 0700); + if (ret == -1) + { +#ifdef EEXISTS + /* EEXIST: pathname already exists and O_CREAT and O_EXCL were used. */ + if (errno == EEXISTS) + { + num_create_tries++; + if (num_create_tries < 5) + goto again; + } +#endif + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error creating lock file `%s': %s"), + lock, + strerror (errno)); + goto out; + } + + out: + g_free (lock); + return ret; +} + +static gboolean +keyring_release_lock (const gchar *path, + gint lock_fd, + GError **error) +{ + gchar *lock; + gboolean ret; + + g_return_val_if_fail (path != NULL, FALSE); + g_return_val_if_fail (lock_fd != -1, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; + lock = g_strdup_printf ("%s.lock", path); + if (close (lock_fd) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error closing (unlinked) lock file `%s': %s"), + lock, + strerror (errno)); + goto out; + } + if (g_unlink (lock) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error unlinking lock file `%s': %s"), + lock, + strerror (errno)); + goto out; + } + + ret = TRUE; + + out: + g_free (lock); + return ret; +} + + +/* adds an entry to the keyring, taking care of locking and deleting stale/future entries */ +static gboolean +keyring_generate_entry (const gchar *cookie_context, + gint *out_id, + gchar **out_cookie, + GError **error) +{ + gboolean ret; + gchar *keyring_dir; + gchar *path; + gchar *contents; + GError *local_error; + gchar **lines; + gint max_line_id; + GString *new_contents; + guint64 now; + gboolean have_id; + gint use_id; + gchar *use_cookie; + gboolean changed_file; + gint lock_fd; + + g_return_val_if_fail (cookie_context != NULL, FALSE); + g_return_val_if_fail (out_id != NULL, FALSE); + g_return_val_if_fail (out_cookie != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; + path = NULL; + contents = NULL; + lines = NULL; + new_contents = NULL; + have_id = FALSE; + use_cookie = NULL; + lock_fd = -1; + + keyring_dir = ensure_keyring_directory (error); + if (keyring_dir == NULL) + goto out; + + path = g_build_filename (keyring_dir, cookie_context, NULL); + + lock_fd = keyring_acquire_lock (path, error); + if (lock_fd == -1) + goto out; + + local_error = NULL; + contents = NULL; + if (!g_file_get_contents (path, + &contents, + NULL, + &local_error)) + { + if (local_error->domain == G_FILE_ERROR && local_error->code == G_FILE_ERROR_NOENT) + { + /* file doesn't have to exist */ + g_error_free (local_error); + } + else + { + g_propagate_prefixed_error (error, + local_error, + _("Error opening keyring `%s' for writing: "), + path); + goto out; + } + } + + new_contents = g_string_new (NULL); + now = time (NULL); + changed_file = FALSE; + + max_line_id = 0; + if (contents != NULL) + { + guint n; + lines = g_strsplit (contents, "\n", 0); + for (n = 0; lines[n] != NULL; n++) + { + const gchar *line = lines[n]; + gchar **tokens; + gchar *endp; + gint line_id; + guint64 line_when; + gboolean keep_entry; + + if (line[0] == '\0') + continue; + + tokens = g_strsplit (line, " ", 0); + if (g_strv_length (tokens) != 3) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Line %d of the keyring at `%s' with content `%s' is malformed"), + n + 1, + path, + line); + g_strfreev (tokens); + goto out; + } + + line_id = g_ascii_strtoll (tokens[0], &endp, 10); + if (*endp != '\0') + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("First token of line %d of the keyring at `%s' with content `%s' is malformed"), + n + 1, + path, + line); + g_strfreev (tokens); + goto out; + } + + line_when = g_ascii_strtoll (tokens[1], &endp, 10); + if (*endp != '\0') + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Second token of line %d of the keyring at `%s' with content `%s' is malformed"), + n + 1, + path, + line); + g_strfreev (tokens); + goto out; + } + + /* D-Bus spec says: + * + * Once the lockfile has been created, the server loads the + * cookie file. It should then delete any cookies that are + * old (the timeout can be fairly short), or more than a + * reasonable time in the future (so that cookies never + * accidentally become permanent, if the clock was set far + * into the future at some point). If no recent keys remain, + * the server may generate a new key. + * + */ + keep_entry = TRUE; + if (line_when > now) + { + /* Oddball case: entry is more recent than our current wall-clock time.. + * This is OK, it means that another server on another machine but with + * same $HOME wrote the entry. + * + * So discard the entry if it's more than 1 day in the future ("reasonable + * time in the future"). + */ + if (line_when - now > 24*60*60) + { + keep_entry = FALSE; + _log ("Deleted SHA1 cookie from %" G_GUINT64_FORMAT " seconds in the future", line_when - now); + } + } + else + { + /* Discard entry if it's older than 15 minutes ("can be fairly short") */ + if (now - line_when > 15*60) + { + keep_entry = FALSE; + } + } + + if (!keep_entry) + { + changed_file = FALSE; + } + else + { + g_string_append_printf (new_contents, + "%d %" G_GUINT64_FORMAT " %s\n", + line_id, + line_when, + tokens[2]); + max_line_id = MAX (line_id, max_line_id); + /* Only reuse entry if not older than 10 minutes. + * + * (We need a bit of grace time compared to 15 minutes above.. otherwise + * there's a race where we reuse the 14min59.9 secs old entry and a + * split-second later another server purges the now 15 minute old entry.) + */ + if (now - line_when < 10 * 60) + { + if (!have_id) + { + use_id = line_id; + use_cookie = tokens[2]; /* steal memory */ + tokens[2] = NULL; + have_id = TRUE; + } + } + } + g_strfreev (tokens); + } + } /* for each line */ + + ret = TRUE; + + if (have_id) + { + *out_id = use_id; + *out_cookie = use_cookie; + use_cookie = NULL; + } + else + { + gchar *raw_cookie; + *out_id = max_line_id + 1; + raw_cookie = random_blob (32); + *out_cookie = hexencode (raw_cookie, 32); + g_free (raw_cookie); + + g_string_append_printf (new_contents, + "%d %" G_GUINT64_FORMAT " %s\n", + *out_id, + (guint64) time (NULL), + *out_cookie); + changed_file = TRUE; + } + + /* and now actually write the cookie file if there are changes (this is atomic) */ + if (changed_file) + { + if (!g_file_set_contents (path, + new_contents->str, + -1, + error)) + { + *out_id = 0; + *out_cookie = 0; + g_free (*out_cookie); + ret = FALSE; + goto out; + } + } + + out: + + if (lock_fd != -1) + { + GError *local_error; + local_error = NULL; + if (!keyring_release_lock (path, lock_fd, &local_error)) + { + if (error != NULL) + { + if (*error == NULL) + { + *error = local_error; + } + else + { + g_prefix_error (error, + _("(Additionally, releasing the lock for `%s' also failed: %s) "), + path, + local_error->message); + } + } + else + { + g_error_free (local_error); + } + } + } + + g_free (keyring_dir); + g_free (path); + g_strfreev (lines); + g_free (contents); + if (new_contents != NULL) + g_string_free (new_contents, TRUE); + g_free (use_cookie); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar * +generate_sha1 (const gchar *server_challenge, + const gchar *client_challenge, + const gchar *cookie) +{ + GString *str; + gchar *sha1; + + str = g_string_new (server_challenge); + g_string_append_c (str, ':'); + g_string_append (str, client_challenge); + g_string_append_c (str, ':'); + g_string_append (str, cookie); + sha1 = g_compute_checksum_for_string (G_CHECKSUM_SHA1, str->str, -1); + g_string_free (str, TRUE); + + return sha1; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanismState +mechanism_server_get_state (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, G_DBUS_AUTH_MECHANISM_STATE_INVALID); + + return m->priv->state; +} + +static void +mechanism_server_initiate (GDBusAuthMechanism *mechanism, + const gchar *initial_response, + gsize initial_response_len) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism)); + g_return_if_fail (!m->priv->is_server && !m->priv->is_client); + + m->priv->is_server = TRUE; + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + + if (initial_response != NULL && strlen (initial_response) > 0) + { +#ifdef G_OS_UNIX + gint64 uid; + gchar *endp; + + uid = g_ascii_strtoll (initial_response, &endp, 10); + if (*endp == '\0') + { + if (uid == getuid ()) + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND; + } + } +#elif defined(G_OS_WIN32) + gchar *sid; + sid = _g_dbus_win32_get_user_sid (); + if (g_strcmp0 (initial_response, sid) == 0) + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND; + g_free (sid); +#else +#error Please implement for your OS +#endif + } +} + +static void +mechanism_server_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + gchar **tokens; + const gchar *client_challenge; + const gchar *alleged_sha1; + gchar *sha1; + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism)); + g_return_if_fail (m->priv->is_server && !m->priv->is_client); + g_return_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA); + + tokens = NULL; + sha1 = NULL; + + tokens = g_strsplit (data, " ", 0); + if (g_strv_length (tokens) != 2) + { + g_warning ("Malformed data `%s'", data); + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + goto out; + } + + client_challenge = tokens[0]; + alleged_sha1 = tokens[1]; + + sha1 = generate_sha1 (m->priv->server_challenge, client_challenge, m->priv->cookie); + + if (g_strcmp0 (sha1, alleged_sha1) == 0) + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; + } + else + { + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + } + + out: + g_strfreev (tokens); + g_free (sha1); +} + +static gchar * +mechanism_server_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + gchar *s; + gint cookie_id; + const gchar *cookie_context; + GError *error; + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), NULL); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL); + + s = NULL; + + /* TODO: use GDBusAuthObserver here to get the cookie context to use? */ + cookie_context = "org_gtk_gdbus_general"; + + cookie_id = -1; + error = NULL; + if (!keyring_generate_entry (cookie_context, + &cookie_id, + &m->priv->cookie, + &error)) + { + g_warning ("Error adding entry to keyring: %s", error->message); + g_error_free (error); + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + goto out; + } + + m->priv->server_challenge = random_ascii_string (16); + s = g_strdup_printf ("%s %d %s", + cookie_context, + cookie_id, + m->priv->server_challenge); + + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA; + + out: + return s; +} + +static gchar * +mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), NULL); + g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_REJECTED, NULL); + + /* can never end up here because we are never in the REJECTED state */ + g_assert_not_reached (); + + return NULL; +} + +static void +mechanism_server_shutdown (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism)); + g_return_if_fail (m->priv->is_server && !m->priv->is_client); + + m->priv->is_server = FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAuthMechanismState +mechanism_client_get_state (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID); + g_return_val_if_fail (m->priv->is_client && !m->priv->is_server, G_DBUS_AUTH_MECHANISM_STATE_INVALID); + + return m->priv->state; +} + +static gchar * +mechanism_client_initiate (GDBusAuthMechanism *mechanism, + gsize *out_initial_response_len) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + gchar *initial_response; + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), NULL); + g_return_val_if_fail (!m->priv->is_server && !m->priv->is_client, NULL); + + m->priv->is_client = TRUE; + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA; + + *out_initial_response_len = -1; + +#ifdef G_OS_UNIX + initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) getuid ()); +#elif defined (G_OS_WIN32) +initial_response = _g_dbus_win32_get_user_sid (); +#else +#error Please implement for your OS +#endif + g_assert (initial_response != NULL); + + return initial_response; +} + +static void +mechanism_client_data_receive (GDBusAuthMechanism *mechanism, + const gchar *data, + gsize data_len) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + gchar **tokens; + const gchar *cookie_context; + guint cookie_id; + const gchar *server_challenge; + gchar *client_challenge; + gchar *endp; + gchar *cookie; + GError *error; + gchar *sha1; + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism)); + g_return_if_fail (m->priv->is_client && !m->priv->is_server); + g_return_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA); + + tokens = NULL; + cookie = NULL; + client_challenge = NULL; + + tokens = g_strsplit (data, " ", 0); + if (g_strv_length (tokens) != 3) + { + g_warning ("Malformed data `%s'", data); + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + goto out; + } + + cookie_context = tokens[0]; + cookie_id = g_ascii_strtoll (tokens[1], &endp, 10); + if (*endp != '\0') + { + g_warning ("Malformed cookie_id `%s'", tokens[1]); + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + goto out; + } + server_challenge = tokens[2]; + + error = NULL; + cookie = keyring_lookup_entry (cookie_context, cookie_id, &error); + if (cookie == NULL) + { + g_warning ("Problems looking up entry in keyring: %s", error->message); + g_error_free (error); + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED; + goto out; + } + + client_challenge = random_ascii_string (16); + sha1 = generate_sha1 (server_challenge, client_challenge, cookie); + m->priv->to_send = g_strdup_printf ("%s %s", client_challenge, sha1); + g_free (sha1); + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND; + + out: + g_strfreev (tokens); + g_free (cookie); + g_free (client_challenge); +} + +static gchar * +mechanism_client_data_send (GDBusAuthMechanism *mechanism, + gsize *out_data_len) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism), NULL); + g_return_val_if_fail (m->priv->is_client && !m->priv->is_server, NULL); + g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL); + + g_assert (m->priv->to_send != NULL); + + m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_ACCEPTED; + + return g_strdup (m->priv->to_send); +} + +static void +mechanism_client_shutdown (GDBusAuthMechanism *mechanism) +{ + GDBusAuthMechanismSha1 *m = G_DBUS_AUTH_MECHANISM_SHA1 (mechanism); + + g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM_SHA1 (mechanism)); + g_return_if_fail (m->priv->is_client && !m->priv->is_server); + + m->priv->is_client = FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusauthmechanismsha1.h b/gio/gdbusauthmechanismsha1.h new file mode 100644 index 0000000..6a70afa --- /dev/null +++ b/gio/gdbusauthmechanismsha1.h @@ -0,0 +1,63 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (GIO_COMPILATION) +#error "gdbusauthmechanismsha1.h is a private header file." +#endif + +#ifndef __G_DBUS_AUTH_MECHANISM_SHA1_H__ +#define __G_DBUS_AUTH_MECHANISM_SHA1_H__ + +#include +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_AUTH_MECHANISM_SHA1 (_g_dbus_auth_mechanism_sha1_get_type ()) +#define G_DBUS_AUTH_MECHANISM_SHA1(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH_MECHANISM_SHA1, GDBusAuthMechanismSha1)) +#define G_DBUS_AUTH_MECHANISM_SHA1_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_AUTH_MECHANISM_SHA1, GDBusAuthMechanismSha1Class)) +#define G_DBUS_AUTH_MECHANISM_SHA1_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_AUTH_MECHANISM_SHA1, GDBusAuthMechanismSha1Class)) +#define G_IS_DBUS_AUTH_MECHANISM_SHA1(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH_MECHANISM_SHA1)) +#define G_IS_DBUS_AUTH_MECHANISM_SHA1_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_AUTH_MECHANISM_SHA1)) + +typedef struct _GDBusAuthMechanismSha1 GDBusAuthMechanismSha1; +typedef struct _GDBusAuthMechanismSha1Class GDBusAuthMechanismSha1Class; +typedef struct _GDBusAuthMechanismSha1Private GDBusAuthMechanismSha1Private; + +struct _GDBusAuthMechanismSha1Class +{ + /*< private >*/ + GDBusAuthMechanismClass parent_class; +}; + +struct _GDBusAuthMechanismSha1 +{ + GDBusAuthMechanism parent_instance; + GDBusAuthMechanismSha1Private *priv; +}; + +GType _g_dbus_auth_mechanism_sha1_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __G_DBUS_AUTH_MECHANISM_SHA1_H__ */ diff --git a/gio/gdbusauthobserver.c b/gio/gdbusauthobserver.c new file mode 100644 index 0000000..46af595 --- /dev/null +++ b/gio/gdbusauthobserver.c @@ -0,0 +1,234 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include "gdbusauthobserver.h" +#include "gio-marshal.h" +#include "gcredentials.h" +#include "gioenumtypes.h" +#include "giostream.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusauthobserver + * @short_description: Object used for authenticating connections + * @include: gio/gio.h + * + * The #GDBusAuthObserver type provides a mechanism for participating + * in how a #GDBusServer (or a #GDBusConnection) authenticates remote + * peers. Simply instantiate a #GDBusAuthObserver and connect to the + * signals you are interested in. Note that new signals may be added + * in the future + * + * For example, if you only want to allow D-Bus connections from + * processes owned by the same uid as the server, you would use a + * signal handler like the following: + * Controlling Authentication + * static gboolean + * on_authorize_authenticated_peer (GDBusAuthObserver *observer, + * GIOStream *stream, + * GCredentials *credentials, + * gpointer user_data) + * { + * gboolean authorized; + * + * authorized = FALSE; + * if (credentials != NULL) + * { + * GCredentials *own_credentials; + * own_credentials = g_credentials_new (); + * if (g_credentials_is_same_user (credentials, own_credentials, NULL)) + * authorized = TRUE; + * g_object_unref (own_credentials); + * } + * + * return authorized; + * } + * + */ + +typedef struct _GDBusAuthObserverClass GDBusAuthObserverClass; + +/** + * GDBusAuthObserverClass: + * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal. + * + * Class structure for #GDBusAuthObserverClass. + * + * Since: 2.26 + */ +struct _GDBusAuthObserverClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + + /* Signals */ + gboolean (*authorize_authenticated_peer) (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials); +}; + +/** + * GDBusAuthObserver: + * + * The #GDBusAuthObserver structure contains only private data and + * should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GDBusAuthObserver +{ + GObject parent_instance; +}; + +enum +{ + AUTHORIZE_AUTHENTICATED_PEER_SIGNAL, + LAST_SIGNAL, +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (GDBusAuthObserver, g_dbus_auth_observer, G_TYPE_OBJECT); + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +g_dbus_auth_observer_finalize (GObject *object) +{ + G_OBJECT_CLASS (g_dbus_auth_observer_parent_class)->finalize (object); +} + +static gboolean +g_dbus_auth_observer_authorize_authenticated_peer_real (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials) +{ + return TRUE; +} + +gboolean +_g_signal_accumulator_false_handled (GSignalInvocationHint *ihint, + GValue *return_accu, + const GValue *handler_return, + gpointer dummy) +{ + gboolean continue_emission; + gboolean signal_handled; + + signal_handled = g_value_get_boolean (handler_return); + g_value_set_boolean (return_accu, signal_handled); + continue_emission = signal_handled; + + return continue_emission; +} + +static void +g_dbus_auth_observer_class_init (GDBusAuthObserverClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = g_dbus_auth_observer_finalize; + + klass->authorize_authenticated_peer = g_dbus_auth_observer_authorize_authenticated_peer_real; + + /** + * GDBusAuthObserver::authorize-authenticated-peer: + * @observer: The #GDBusAuthObserver emitting the signal. + * @stream: A #GIOStream for the #GDBusConnection. + * @credentials: Credentials received from the peer or %NULL. + * + * Emitted to check if a peer that is successfully authenticated + * is authorized. + * + * Returns: %TRUE if the peer is authorized, %FALSE if not. + * + * Since: 2.26 + */ + signals[AUTHORIZE_AUTHENTICATED_PEER_SIGNAL] = + g_signal_new ("authorize-authenticated-peer", + G_TYPE_DBUS_AUTH_OBSERVER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GDBusAuthObserverClass, authorize_authenticated_peer), + _g_signal_accumulator_false_handled, + NULL, /* accu_data */ + _gio_marshal_BOOLEAN__OBJECT_OBJECT, + G_TYPE_BOOLEAN, + 2, + G_TYPE_IO_STREAM, + G_TYPE_CREDENTIALS); +} + +static void +g_dbus_auth_observer_init (GDBusAuthObserver *observer) +{ +} + +/** + * g_dbus_auth_observer_new: + * + * Creates a new #GDBusAuthObserver object. + * + * Returns: A #GDBusAuthObserver. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusAuthObserver * +g_dbus_auth_observer_new (void) +{ + return g_object_new (G_TYPE_DBUS_AUTH_OBSERVER, NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_auth_observer_authorize_authenticated_peer: + * @observer: A #GDBusAuthObserver. + * @stream: A #GIOStream for the #GDBusConnection. + * @credentials: Credentials received from the peer or %NULL. + * + * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer. + * + * Returns: %TRUE if the peer is authorized, %FALSE if not. + * + * Since: 2.26 + */ +gboolean +g_dbus_auth_observer_authorize_authenticated_peer (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials) +{ + gboolean denied; + + denied = FALSE; + g_signal_emit (observer, + signals[AUTHORIZE_AUTHENTICATED_PEER_SIGNAL], + 0, + stream, + credentials, + &denied); + return denied; +} diff --git a/gio/gdbusauthobserver.h b/gio/gdbusauthobserver.h new file mode 100644 index 0000000..fb709cd --- /dev/null +++ b/gio/gdbusauthobserver.h @@ -0,0 +1,46 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_AUTH_OBSERVER_H__ +#define __G_DBUS_AUTH_OBSERVER_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_AUTH_OBSERVER (g_dbus_auth_observer_get_type ()) +#define G_DBUS_AUTH_OBSERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH_OBSERVER, GDBusAuthObserver)) +#define G_IS_DBUS_AUTH_OBSERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH_OBSERVER)) + +GType g_dbus_auth_observer_get_type (void) G_GNUC_CONST; +GDBusAuthObserver *g_dbus_auth_observer_new (void); +gboolean g_dbus_auth_observer_authorize_authenticated_peer (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials); + +G_END_DECLS + +#endif /* _G_DBUS_AUTH_OBSERVER_H__ */ diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c new file mode 100644 index 0000000..809f976 --- /dev/null +++ b/gio/gdbusconnection.c @@ -0,0 +1,6406 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +/* + * TODO for GDBus: + * + * - would be nice to expose GDBusAuthMechanism and an extension point + * + * - Need to rewrite GDBusAuth and rework GDBusAuthMechanism. In particular + * the mechanism VFuncs need to be able to set an error. + * + * - Need to document other mechanisms/sources for determining the D-Bus + * address of a well-known bus. + * + * - e.g. on Win32 we need code like from here + * + * http://cgit.freedesktop.org/~david/gdbus-standalone/tree/gdbus/gdbusaddress.c#n900 + * + * that was never copied over here because it originally was copy-paste + * from the GPLv2 / AFL 2.1 libdbus sources. + * + * - on OS X we need to look in launchd for the address + * + * https://bugs.freedesktop.org/show_bug.cgi?id=14259 + * + * - on X11 we need to look in a X11 property on the X server + * - (we can also just use dbus-launch(1) from the D-Bus + * distribution) + * + * - (ideally) this requires D-Bus spec work because none of + * this has never really been specced out properly (excect + * the X11 bits) + * + * - Related to the above, we also need to be able to launch a message bus + * instance.... Since we don't want to write our own bus daemon we should + * launch dbus-daemon(1) (thus: Win32 and OS X need to bundle it) + * + * - probably want a G_DBUS_NONCE_TCP_TMPDIR environment variable + * to specify where the nonce is stored. This will allow people to use + * G_DBUS_NONCE_TCP_TMPDIR=/mnt/secure.company.server/dbus-nonce-dir + * to easily acheive secure RPC via nonce-tcp. + * + * - need to expose an extension point for resolving D-Bus address and + * turning them into GIOStream objects. This will allow us to implement + * e.g. X11 D-Bus transports without dlopen()'ing or linking against + * libX11 from libgio. + * - see g_dbus_address_connect() in gdbusaddress.c + * + * - would be cute to use kernel-specific APIs to resolve fds for + * debug output when using G_DBUS_DEBUG=message, e.g. in addition to + * + * fd 21: dev=8:1,mode=0100644,ino=1171231,uid=0,gid=0,rdev=0:0,size=234,atime=1273070640,mtime=1267126160,ctime=1267126160 + * + * maybe we can show more information about what fd 21 really is. + * Ryan suggests looking in /proc/self/fd for clues / symlinks! + * Initial experiments on Linux 2.6 suggests that the symlink looks + * like this: + * + * 3 -> /proc/18068/fd + * + * e.g. not of much use. + * + * - GDBus High-Level docs + * - Proxy: properties, signals... + * - Connection: IOStream based, ::close, connection setup steps + * mainloop integration, threading + * - Differences from libdbus (extend "Migrating from") + * - the message handling thread + * - Using GVariant instead of GValue + * - Explain why the high-level API is a good thing and what + * kind of pitfalls it avoids + * - Export objects before claiming names + * - Talk about auto-starting services (cf. GBusNameWatcherFlags) + * + * - use abstract sockets in test code + * - right now it doesn't work, dbus-daemon(1) fails with + * + * /gdbus/connection/filter: Failed to start message bus: Failed to bind + * socket "/tmp/g-dbus-tests-pid-28531": Address already in use + * ** WARNING **: Error reading address from dbus daemon, 0 bytes read + * + * or similar. + */ + +#include "config.h" + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "gdbusauth.h" +#include "gdbusutils.h" +#include "gdbusaddress.h" +#include "gdbusmessage.h" +#include "gdbusconnection.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" +#include "gdbusintrospection.h" +#include "gdbusmethodinvocation.h" +#include "gdbusprivate.h" +#include "gdbusauthobserver.h" +#include "gio-marshal.h" +#include "ginitable.h" +#include "gasyncinitable.h" +#include "giostream.h" +#include "gasyncresult.h" +#include "gsimpleasyncresult.h" + +#ifdef G_OS_UNIX +#include "gunixconnection.h" +#include "gunixfdmessage.h" +#endif + +#include "glibintl.h" + +/** + * SECTION:gdbusconnection + * @short_description: D-Bus Connections + * @include: gio/gio.h + * + * The #GDBusConnection type is used for D-Bus connections to remote + * peers such as a message buses. It is a low-level API that offers a + * lot of flexibility. For instance, it lets you establish a connection + * over any transport that can by represented as an #GIOStream. + * + * This class is rarely used directly in D-Bus clients. If you are writing + * an D-Bus client, it is often easier to use the g_bus_own_name(), + * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs. + * + * D-Bus server exampleFIXME: MISSING XINCLUDE CONTENT + * + * D-Bus subtree exampleFIXME: MISSING XINCLUDE CONTENT + * + * D-Bus UNIX File Descriptor exampleFIXME: MISSING XINCLUDE CONTENT + * + * Exporting a GObjectFIXME: MISSING XINCLUDE CONTENT + */ + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct _GDBusConnectionClass GDBusConnectionClass; + +/** + * GDBusConnectionClass: + * @closed: Signal class handler for the #GDBusConnection::closed signal. + * + * Class structure for #GDBusConnection. + * + * Since: 2.26 + */ +struct _GDBusConnectionClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* Signals */ + void (*closed) (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error); +}; + +G_LOCK_DEFINE_STATIC (message_bus_lock); + +static GDBusConnection *the_session_bus = NULL; +static GDBusConnection *the_system_bus = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDestroyNotify callback; + gpointer user_data; + GMainContext *context; +} CallDestroyNotifyData; + +static gboolean +call_destroy_notify_data_in_idle (gpointer user_data) +{ + CallDestroyNotifyData *data = user_data; + data->callback (data->user_data); + return FALSE; +} + +static void +call_destroy_notify_data_free (CallDestroyNotifyData *data) +{ + if (data->context != NULL) + g_main_context_unref (data->context); + g_free (data); +} + +/* + * call_destroy_notify: + * @context: A #GMainContext or %NULL. + * @callback: A #GDestroyNotify or %NULL. + * @user_data: Data to pass to @callback. + * + * Schedules @callback to run in @context. + */ +static void +call_destroy_notify (GMainContext *context, + GDestroyNotify callback, + gpointer user_data) +{ + if (callback == NULL) + goto out; + + if (context == g_main_context_get_thread_default ()) + { + callback (user_data); + } + else + { + GSource *idle_source; + CallDestroyNotifyData *data; + + data = g_new0 (CallDestroyNotifyData, 1); + data->callback = callback; + data->user_data = user_data; + data->context = context; + if (data->context != NULL) + g_main_context_ref (data->context); + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + call_destroy_notify_data_in_idle, + data, + (GDestroyNotify) call_destroy_notify_data_free); + g_source_attach (idle_source, data->context); + g_source_unref (idle_source); + } + + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +_g_strv_has_string (const gchar* const *haystack, + const gchar *needle) +{ + guint n; + + for (n = 0; haystack != NULL && haystack[n] != NULL; n++) + { + if (g_strcmp0 (haystack[n], needle) == 0) + return TRUE; + } + return FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_WIN32 +#define CONNECTION_ENSURE_LOCK(obj) do { ; } while (FALSE) +#else +// TODO: for some reason this doesn't work on Windows +#define CONNECTION_ENSURE_LOCK(obj) do { \ + if (G_UNLIKELY (g_mutex_trylock((obj)->lock))) \ + { \ + g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + "CONNECTION_ENSURE_LOCK: GDBusConnection object lock is not locked"); \ + } \ + } while (FALSE) +#endif + +#define CONNECTION_LOCK(obj) do { \ + g_mutex_lock ((obj)->lock); \ + } while (FALSE) + +#define CONNECTION_UNLOCK(obj) do { \ + g_mutex_unlock ((obj)->lock); \ + } while (FALSE) + +/** + * GDBusConnection: + * + * The #GDBusConnection structure contains only private data and + * should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GDBusConnection +{ + /*< private >*/ + GObject parent_instance; + + /* ------------------------------------------------------------------------ */ + /* -- General object state ------------------------------------------------ */ + /* ------------------------------------------------------------------------ */ + + /* object-wide lock */ + GMutex *lock; + + /* A lock used in the init() method of the GInitable interface - see comments + * in initable_init() for why a separate lock is needed + */ + GMutex *init_lock; + + /* Set (by loading the contents of /var/lib/dbus/machine-id) the first time + * someone calls org.freedesktop.DBus.GetMachineId() + */ + gchar *machine_id; + + /* The underlying stream used for communication */ + GIOStream *stream; + + /* The object used for authentication (if any) */ + GDBusAuth *auth; + + /* Set to TRUE if the connection has been closed */ + gboolean closed; + + /* Last serial used */ + guint32 last_serial; + + /* The object used to send/receive message */ + GDBusWorker *worker; + + /* If connected to a message bus, this contains the unique name assigned to + * us by the bus (e.g. ":1.42") + */ + gchar *bus_unique_name; + + /* The GUID returned by the other side if we authenticed as a client or + * the GUID to use if authenticating as a server + */ + gchar *guid; + + /* set to TRUE exactly when initable_init() has finished running */ + gboolean is_initialized; + + /* If the connection could not be established during initable_init(), this GError will set */ + GError *initialization_error; + + /* The result of g_main_context_get_thread_default() when the object + * was created (the GObject _init() function) - this is used for delivery + * of the :closed GObject signal. + */ + GMainContext *main_context_at_construction; + + /* construct properties */ + gchar *address; + GDBusConnectionFlags flags; + + /* Map used for managing method replies */ + GHashTable *map_method_serial_to_send_message_data; /* guint32 -> SendMessageData* */ + + /* Maps used for managing signal subscription */ + GHashTable *map_rule_to_signal_data; /* match rule (gchar*) -> SignalData */ + GHashTable *map_id_to_signal_data; /* id (guint) -> SignalData */ + GHashTable *map_sender_unique_name_to_signal_data_array; /* unique sender (gchar*) -> GPtrArray* of SignalData */ + + /* Maps used for managing exported objects and subtrees */ + GHashTable *map_object_path_to_eo; /* gchar* -> ExportedObject* */ + GHashTable *map_id_to_ei; /* guint -> ExportedInterface* */ + GHashTable *map_object_path_to_es; /* gchar* -> ExportedSubtree* */ + GHashTable *map_id_to_es; /* guint -> ExportedSubtree* */ + + /* Structure used for message filters */ + GPtrArray *filters; + + /* Whether to exit on close */ + gboolean exit_on_close; + + /* Capabilities negotiated during authentication */ + GDBusCapabilityFlags capabilities; + + GDBusAuthObserver *authentication_observer; + GCredentials *credentials; + + /* set to TRUE when finalizing */ + gboolean finalizing; +}; + +typedef struct ExportedObject ExportedObject; +static void exported_object_free (ExportedObject *eo); + +typedef struct ExportedSubtree ExportedSubtree; +static void exported_subtree_free (ExportedSubtree *es); + +enum +{ + CLOSED_SIGNAL, + LAST_SIGNAL, +}; + +enum +{ + PROP_0, + PROP_STREAM, + PROP_ADDRESS, + PROP_FLAGS, + PROP_GUID, + PROP_UNIQUE_NAME, + PROP_CLOSED, + PROP_EXIT_ON_CLOSE, + PROP_CAPABILITY_FLAGS, + PROP_AUTHENTICATION_OBSERVER, +}; + +static void distribute_signals (GDBusConnection *connection, + GDBusMessage *message); + +static void distribute_method_call (GDBusConnection *connection, + GDBusMessage *message); + +static gboolean handle_generic_unlocked (GDBusConnection *connection, + GDBusMessage *message); + + +static void purge_all_signal_subscriptions (GDBusConnection *connection); +static void purge_all_filters (GDBusConnection *connection); + +#define _G_ENSURE_LOCK(name) do { \ + if (G_UNLIKELY (G_TRYLOCK(name))) \ + { \ + g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + "_G_ENSURE_LOCK: Lock `" #name "' is not locked"); \ + } \ + } while (FALSE) \ + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void initable_iface_init (GInitableIface *initable_iface); +static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); + +G_DEFINE_TYPE_WITH_CODE (GDBusConnection, g_dbus_connection, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init) + ); + +static GHashTable *alive_connections = NULL; + +static void +g_dbus_connection_dispose (GObject *object) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (object); + + G_LOCK (message_bus_lock); + if (connection == the_session_bus) + { + the_session_bus = NULL; + } + else if (connection == the_system_bus) + { + the_system_bus = NULL; + } + CONNECTION_LOCK (connection); + if (connection->worker != NULL) + { + _g_dbus_worker_stop (connection->worker); + connection->worker = NULL; + if (alive_connections != NULL) + g_warn_if_fail (g_hash_table_remove (alive_connections, connection)); + } + else + { + if (alive_connections != NULL) + g_warn_if_fail (g_hash_table_lookup (alive_connections, connection) == NULL); + } + CONNECTION_UNLOCK (connection); + G_UNLOCK (message_bus_lock); + + if (G_OBJECT_CLASS (g_dbus_connection_parent_class)->dispose != NULL) + G_OBJECT_CLASS (g_dbus_connection_parent_class)->dispose (object); +} + +static void +g_dbus_connection_finalize (GObject *object) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (object); + + connection->finalizing = TRUE; + + purge_all_signal_subscriptions (connection); + + purge_all_filters (connection); + g_ptr_array_unref (connection->filters); + + if (connection->authentication_observer != NULL) + g_object_unref (connection->authentication_observer); + + if (connection->auth != NULL) + g_object_unref (connection->auth); + + if (connection->credentials) + g_object_unref (connection->credentials); + + if (connection->stream != NULL) + { + /* We don't really care if closing the stream succeeds or not */ + g_io_stream_close_async (connection->stream, + G_PRIORITY_DEFAULT, + NULL, /* GCancellable */ + NULL, /* GAsyncReadyCallback */ + NULL); /* userdata */ + g_object_unref (connection->stream); + connection->stream = NULL; + } + + g_free (connection->address); + + g_free (connection->guid); + g_free (connection->bus_unique_name); + + if (connection->initialization_error != NULL) + g_error_free (connection->initialization_error); + + g_hash_table_unref (connection->map_method_serial_to_send_message_data); + + g_hash_table_unref (connection->map_rule_to_signal_data); + g_hash_table_unref (connection->map_id_to_signal_data); + g_hash_table_unref (connection->map_sender_unique_name_to_signal_data_array); + + g_hash_table_unref (connection->map_id_to_ei); + g_hash_table_unref (connection->map_object_path_to_eo); + g_hash_table_unref (connection->map_id_to_es); + g_hash_table_unref (connection->map_object_path_to_es); + + if (connection->main_context_at_construction != NULL) + g_main_context_unref (connection->main_context_at_construction); + + g_free (connection->machine_id); + + g_mutex_free (connection->init_lock); + g_mutex_free (connection->lock); + + G_OBJECT_CLASS (g_dbus_connection_parent_class)->finalize (object); +} + +static void +g_dbus_connection_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (object); + + switch (prop_id) + { + case PROP_STREAM: + g_value_set_object (value, g_dbus_connection_get_stream (connection)); + break; + + case PROP_GUID: + g_value_set_string (value, g_dbus_connection_get_guid (connection)); + break; + + case PROP_UNIQUE_NAME: + g_value_set_string (value, g_dbus_connection_get_unique_name (connection)); + break; + + case PROP_CLOSED: + g_value_set_boolean (value, g_dbus_connection_is_closed (connection)); + break; + + case PROP_EXIT_ON_CLOSE: + g_value_set_boolean (value, g_dbus_connection_get_exit_on_close (connection)); + break; + + case PROP_CAPABILITY_FLAGS: + g_value_set_flags (value, g_dbus_connection_get_capabilities (connection)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_connection_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (object); + + switch (prop_id) + { + case PROP_STREAM: + connection->stream = g_value_dup_object (value); + break; + + case PROP_GUID: + connection->guid = g_value_dup_string (value); + break; + + case PROP_ADDRESS: + connection->address = g_value_dup_string (value); + break; + + case PROP_FLAGS: + connection->flags = g_value_get_flags (value); + break; + + case PROP_EXIT_ON_CLOSE: + g_dbus_connection_set_exit_on_close (connection, g_value_get_boolean (value)); + break; + + case PROP_AUTHENTICATION_OBSERVER: + connection->authentication_observer = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_connection_real_closed (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error) +{ + if (remote_peer_vanished && connection->exit_on_close) + { + if (error != NULL) + { + g_print ("%s: Remote peer vanished with error: %s (%s, %d). Exiting.\n", + G_STRFUNC, + error->message, + g_quark_to_string (error->domain), error->code); + } + else + { + g_print ("%s: Remote peer vanished. Exiting.\n", G_STRFUNC); + } + raise (SIGTERM); + } +} + +static void +g_dbus_connection_class_init (GDBusConnectionClass *klass) +{ + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = g_dbus_connection_finalize; + gobject_class->dispose = g_dbus_connection_dispose; + gobject_class->set_property = g_dbus_connection_set_property; + gobject_class->get_property = g_dbus_connection_get_property; + + klass->closed = g_dbus_connection_real_closed; + + /** + * GDBusConnection:stream: + * + * The underlying #GIOStream used for I/O. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_STREAM, + g_param_spec_object ("stream", + P_("IO Stream"), + P_("The underlying streams used for I/O"), + G_TYPE_IO_STREAM, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:address: + * + * A D-Bus address specifying potential endpoints that can be used + * when establishing the connection. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_ADDRESS, + g_param_spec_string ("address", + P_("Address"), + P_("D-Bus address specifying potential socket endpoints"), + NULL, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:flags: + * + * Flags from the #GDBusConnectionFlags enumeration. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_FLAGS, + g_param_spec_flags ("flags", + P_("Flags"), + P_("Flags"), + G_TYPE_DBUS_CONNECTION_FLAGS, + G_DBUS_CONNECTION_FLAGS_NONE, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:guid: + * + * The GUID of the peer performing the role of server when + * authenticating. + * + * If you are constructing a #GDBusConnection and pass + * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the + * #GDBusConnection:flags property then you MUST also set this + * property to a valid guid. + * + * If you are constructing a #GDBusConnection and pass + * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the + * #GDBusConnection:flags property you will be able to read the GUID + * of the other peer here after the connection has been successfully + * initialized. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_GUID, + g_param_spec_string ("guid", + P_("GUID"), + P_("GUID of the server peer"), + NULL, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:unique-name: + * + * The unique name as assigned by the message bus or %NULL if the + * connection is not open or not a message bus connection. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_UNIQUE_NAME, + g_param_spec_string ("unique-name", + P_("unique-name"), + P_("Unique name of bus connection"), + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:closed: + * + * A boolean specifying whether the connection has been closed. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_CLOSED, + g_param_spec_boolean ("closed", + P_("Closed"), + P_("Whether the connection is closed"), + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:exit-on-close: + * + * A boolean specifying whether the process will be terminated (by + * calling raise(SIGTERM)) if the connection + * is closed by the remote peer. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_EXIT_ON_CLOSE, + g_param_spec_boolean ("exit-on-close", + P_("Exit on close"), + P_("Whether the process is terminated when the connection is closed"), + FALSE, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:capabilities: + * + * Flags from the #GDBusCapabilityFlags enumeration + * representing connection features negotiated with the other peer. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_CAPABILITY_FLAGS, + g_param_spec_flags ("capabilities", + P_("Capabilities"), + P_("Capabilities"), + G_TYPE_DBUS_CAPABILITY_FLAGS, + G_DBUS_CAPABILITY_FLAGS_NONE, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection:authentication-observer: + * + * A #GDBusAuthObserver object to assist in the authentication process or %NULL. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_AUTHENTICATION_OBSERVER, + g_param_spec_object ("authentication-observer", + P_("Authentication Observer"), + P_("Object used to assist in the authentication process"), + G_TYPE_DBUS_AUTH_OBSERVER, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusConnection::closed: + * @connection: The #GDBusConnection emitting the signal. + * @remote_peer_vanished: %TRUE if @connection is closed because the + * remote peer closed its end of the connection. + * @error: A #GError with more details about the event or %NULL. + * + * Emitted when the connection is closed. + * + * The cause of this event can be + * + * + * If g_dbus_connection_close() is called. In this case + * @remote_peer_vanished is set to %FALSE and @error is %NULL. + * + * + * If the remote peer closes the connection. In this case + * @remote_peer_vanished is set to %TRUE and @error is set. + * + * + * If the remote peer sends invalid or malformed data. In this + * case @remote_peer_vanished is set to %FALSE and @error + * is set. + * + * + * + * Upon receiving this signal, you should give up your reference to + * @connection. You are guaranteed that this signal is emitted only + * once. + * + * Since: 2.26 + */ + signals[CLOSED_SIGNAL] = g_signal_new ("closed", + G_TYPE_DBUS_CONNECTION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GDBusConnectionClass, closed), + NULL, + NULL, + _gio_marshal_VOID__BOOLEAN_BOXED, + G_TYPE_NONE, + 2, + G_TYPE_BOOLEAN, + G_TYPE_ERROR); +} + +static void +g_dbus_connection_init (GDBusConnection *connection) +{ + connection->lock = g_mutex_new (); + connection->init_lock = g_mutex_new (); + + connection->map_method_serial_to_send_message_data = g_hash_table_new (g_direct_hash, g_direct_equal); + + connection->map_rule_to_signal_data = g_hash_table_new (g_str_hash, + g_str_equal); + connection->map_id_to_signal_data = g_hash_table_new (g_direct_hash, + g_direct_equal); + connection->map_sender_unique_name_to_signal_data_array = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + (GDestroyNotify) g_ptr_array_unref); + + connection->map_object_path_to_eo = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, + (GDestroyNotify) exported_object_free); + + connection->map_id_to_ei = g_hash_table_new (g_direct_hash, + g_direct_equal); + + connection->map_object_path_to_es = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, + (GDestroyNotify) exported_subtree_free); + + connection->map_id_to_es = g_hash_table_new (g_direct_hash, + g_direct_equal); + + connection->main_context_at_construction = g_main_context_get_thread_default (); + if (connection->main_context_at_construction != NULL) + g_main_context_ref (connection->main_context_at_construction); + + connection->filters = g_ptr_array_new (); +} + +/** + * g_dbus_connection_get_stream: + * @connection: a #GDBusConnection + * + * Gets the underlying stream used for IO. + * + * Returns: (transfer none): the stream used for IO + * + * Since: 2.26 + */ +GIOStream * +g_dbus_connection_get_stream (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + return connection->stream; +} + +/** + * g_dbus_connection_start_message_processing: + * @connection: A #GDBusConnection. + * + * If @connection was created with + * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method + * starts processing messages. Does nothing on if @connection wasn't + * created with this flag or if the method has already been called. + * + * Since: 2.26 + */ +void +g_dbus_connection_start_message_processing (GDBusConnection *connection) +{ + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + _g_dbus_worker_unfreeze (connection->worker); +} + +/** + * g_dbus_connection_is_closed: + * @connection: A #GDBusConnection. + * + * Gets whether @connection is closed. + * + * Returns: %TRUE if the connection is closed, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_is_closed (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + return connection->closed; +} + +/** + * g_dbus_connection_get_capabilities: + * @connection: A #GDBusConnection. + * + * Gets the capabilities negotiated with the remote peer + * + * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration. + * + * Since: 2.26 + */ +GDBusCapabilityFlags +g_dbus_connection_get_capabilities (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), G_DBUS_CAPABILITY_FLAGS_NONE); + return connection->capabilities; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +flush_in_thread_func (GSimpleAsyncResult *res, + GObject *object, + GCancellable *cancellable) +{ + GError *error; + + error = NULL; + if (!g_dbus_connection_flush_sync (G_DBUS_CONNECTION (object), + cancellable, + &error)) + g_simple_async_result_take_error (res, error); +} + +/** + * g_dbus_connection_flush: + * @connection: A #GDBusConnection. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't + * care about the result. + * @user_data: The data to pass to @callback. + * + * Asynchronously flushes @connection, that is, writes all queued + * outgoing message to the transport and then flushes the transport + * (using g_output_stream_flush_async()). This is useful in programs + * that wants to emit a D-Bus signal and then exit + * immediately. Without flushing the connection, there is no guarantee + * that the message has been sent to the networking buffers in the OS + * kernel. + * + * This is an asynchronous method. When the operation is finished, + * @callback will be invoked in the thread-default main + * loop of the thread you are calling this method from. You can + * then call g_dbus_connection_flush_finish() to get the result of the + * operation. See g_dbus_connection_flush_sync() for the synchronous + * version. + * + * Since: 2.26 + */ +void +g_dbus_connection_flush (GDBusConnection *connection, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *simple; + + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + + simple = g_simple_async_result_new (G_OBJECT (connection), + callback, + user_data, + g_dbus_connection_flush); + g_simple_async_result_run_in_thread (simple, + flush_in_thread_func, + G_PRIORITY_DEFAULT, + cancellable); + g_object_unref (simple); +} + +/** + * g_dbus_connection_flush_finish: + * @connection: A #GDBusConnection. + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_connection_flush(). + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_flush_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + gboolean ret; + + ret = FALSE; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_connection_flush); + + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + ret = TRUE; + + out: + return ret; +} + +/** + * g_dbus_connection_flush_sync: + * @connection: A #GDBusConnection. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously flushes @connection. The calling thread is blocked + * until this is done. See g_dbus_connection_flush() for the + * asynchronous version of this method and more details about what it + * does. + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_flush_sync (GDBusConnection *connection, + GCancellable *cancellable, + GError **error) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; + + if (connection->closed) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CLOSED, + _("The connection is closed")); + goto out; + } + + ret = _g_dbus_worker_flush_sync (connection->worker, + cancellable, + error); + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusConnection *connection; + GError *error; + gboolean remote_peer_vanished; +} EmitClosedData; + +static void +emit_closed_data_free (EmitClosedData *data) +{ + g_object_unref (data->connection); + if (data->error != NULL) + g_error_free (data->error); + g_free (data); +} + +static gboolean +emit_closed_in_idle (gpointer user_data) +{ + EmitClosedData *data = user_data; + gboolean result; + + g_object_notify (G_OBJECT (data->connection), "closed"); + g_signal_emit (data->connection, + signals[CLOSED_SIGNAL], + 0, + data->remote_peer_vanished, + data->error, + &result); + return FALSE; +} + +/* Can be called from any thread, must hold lock */ +static void +set_closed_unlocked (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error) +{ + GSource *idle_source; + EmitClosedData *data; + + CONNECTION_ENSURE_LOCK (connection); + + g_assert (!connection->closed); + + connection->closed = TRUE; + + data = g_new0 (EmitClosedData, 1); + data->connection = g_object_ref (connection); + data->remote_peer_vanished = remote_peer_vanished; + data->error = error != NULL ? g_error_copy (error) : NULL; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + emit_closed_in_idle, + data, + (GDestroyNotify) emit_closed_data_free); + g_source_attach (idle_source, connection->main_context_at_construction); + g_source_unref (idle_source); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +close_in_thread_func (GSimpleAsyncResult *res, + GObject *object, + GCancellable *cancellable) +{ + GError *error; + + error = NULL; + if (!g_dbus_connection_close_sync (G_DBUS_CONNECTION (object), + cancellable, + &error)) + g_simple_async_result_take_error (res, error); +} + +/** + * g_dbus_connection_close: + * @connection: A #GDBusConnection. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't + * care about the result. + * @user_data: The data to pass to @callback. + * + * Closes @connection. Note that this never causes the process to + * exit (this might only happen if the other end of a shared message + * bus connection disconnects, see #GDBusConnection:exit-on-close). + * + * Once the connection is closed, operations such as sending a message + * will return with the error %G_IO_ERROR_CLOSED. Closing a connection + * will not automatically flush the connection so queued messages may + * be lost. Use g_dbus_connection_flush() if you need such guarantees. + * + * If @connection is already closed, this method fails with + * %G_IO_ERROR_CLOSED. + * + * When @connection has been closed, the #GDBusConnection::closed + * signal is emitted in the thread-default main + * loop of the thread that @connection was constructed in. + * + * This is an asynchronous method. When the operation is finished, + * @callback will be invoked in the thread-default main + * loop of the thread you are calling this method from. You can + * then call g_dbus_connection_close_finish() to get the result of the + * operation. See g_dbus_connection_close_sync() for the synchronous + * version. + * + * Since: 2.26 + */ +void +g_dbus_connection_close (GDBusConnection *connection, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *simple; + + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + + simple = g_simple_async_result_new (G_OBJECT (connection), + callback, + user_data, + g_dbus_connection_close); + g_simple_async_result_run_in_thread (simple, + close_in_thread_func, + G_PRIORITY_DEFAULT, + cancellable); + g_object_unref (simple); +} + +/** + * g_dbus_connection_close_finish: + * @connection: A #GDBusConnection. + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_connection_close(). + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_close_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + gboolean ret; + + ret = FALSE; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_connection_close); + + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + ret = TRUE; + + out: + return ret; +} + +/** + * g_dbus_connection_close_sync: + * @connection: A #GDBusConnection. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously closees @connection. The calling thread is blocked + * until this is done. See g_dbus_connection_close() for the + * asynchronous version of this method and more details about what it + * does. + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_close_sync (GDBusConnection *connection, + GCancellable *cancellable, + GError **error) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; + + CONNECTION_LOCK (connection); + if (!connection->closed) + { + ret = g_io_stream_close (connection->stream, + cancellable, + error); + if (ret) + set_closed_unlocked (connection, FALSE, NULL); + } + else + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CLOSED, + _("The connection is closed")); + } + CONNECTION_UNLOCK (connection); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +g_dbus_connection_send_message_unlocked (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + volatile guint32 *out_serial, + GError **error) +{ + guchar *blob; + gsize blob_size; + guint32 serial_to_use; + gboolean ret; + + CONNECTION_ENSURE_LOCK (connection); + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), FALSE); + + /* TODO: check all necessary headers are present */ + + ret = FALSE; + blob = NULL; + + if (out_serial != NULL) + *out_serial = 0; + + if (connection->closed) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CLOSED, + _("The connection is closed")); + goto out; + } + + blob = g_dbus_message_to_blob (message, + &blob_size, + connection->capabilities, + error); + if (blob == NULL) + goto out; + + if (flags & G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL) + serial_to_use = g_dbus_message_get_serial (message); + else + serial_to_use = ++connection->last_serial; /* TODO: handle overflow */ + + switch (blob[0]) + { + case 'l': + ((guint32 *) blob)[2] = GUINT32_TO_LE (serial_to_use); + break; + case 'B': + ((guint32 *) blob)[2] = GUINT32_TO_BE (serial_to_use); + break; + default: + g_assert_not_reached (); + break; + } + +#if 0 + g_printerr ("Writing message of %" G_GSIZE_FORMAT " bytes (serial %d) on %p:\n", + blob_size, serial_to_use, connection); + g_printerr ("----\n"); + hexdump (blob, blob_size); + g_printerr ("----\n"); +#endif + + /* TODO: use connection->auth to encode the blob */ + + if (out_serial != NULL) + *out_serial = serial_to_use; + + if (!(flags & G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL)) + g_dbus_message_set_serial (message, serial_to_use); + + g_dbus_message_lock (message); + _g_dbus_worker_send_message (connection->worker, + message, + (gchar*) blob, + blob_size); + blob = NULL; /* since _g_dbus_worker_send_message() steals the blob */ + + ret = TRUE; + + out: + g_free (blob); + + return ret; +} + +/** + * g_dbus_connection_send_message: + * @connection: A #GDBusConnection. + * @message: A #GDBusMessage + * @flags: Flags affecting how the message is sent. + * @out_serial: Return location for serial number assigned to @message when sending it or %NULL. + * @error: Return location for error or %NULL. + * + * Asynchronously sends @message to the peer represented by @connection. + * + * Unless @flags contain the + * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number + * will be assigned by @connection and set on @message via + * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the + * serial number used will be written to this location prior to + * submitting the message to the underlying transport. + * + * If @connection is closed then the operation will fail with + * %G_IO_ERROR_CLOSED. If @message is not well-formed, + * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT. + * + * See and for an example of how to use this + * low-level API to send and receive UNIX file descriptors. + * + * Note that @message must be unlocked, unless @flags contain the + * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. + * + * Returns: %TRUE if the message was well-formed and queued for + * transmission, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_send_message (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + volatile guint32 *out_serial, + GError **error) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), FALSE); + g_return_val_if_fail ((flags & G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL) || !g_dbus_message_get_locked (message), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + CONNECTION_LOCK (connection); + ret = g_dbus_connection_send_message_unlocked (connection, message, flags, out_serial, error); + CONNECTION_UNLOCK (connection); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + volatile gint ref_count; + GDBusConnection *connection; + guint32 serial; + GSimpleAsyncResult *simple; + + GMainContext *main_context; + + GCancellable *cancellable; + + gulong cancellable_handler_id; + + GSource *timeout_source; + + gboolean delivered; +} SendMessageData; + +static SendMessageData * +send_message_data_ref (SendMessageData *data) +{ + g_atomic_int_inc (&data->ref_count); + return data; +} + +static void +send_message_data_unref (SendMessageData *data) +{ + if (g_atomic_int_dec_and_test (&data->ref_count)) + { + g_assert (data->timeout_source == NULL); + g_assert (data->simple == NULL); + g_assert (data->cancellable_handler_id == 0); + g_object_unref (data->connection); + if (data->cancellable != NULL) + g_object_unref (data->cancellable); + if (data->main_context != NULL) + g_main_context_unref (data->main_context); + g_free (data); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* can be called from any thread with lock held - caller must have prepared GSimpleAsyncResult already */ +static void +send_message_with_reply_deliver (SendMessageData *data) +{ + CONNECTION_ENSURE_LOCK (data->connection); + + g_assert (!data->delivered); + + data->delivered = TRUE; + + g_simple_async_result_complete_in_idle (data->simple); + g_object_unref (data->simple); + data->simple = NULL; + + if (data->timeout_source != NULL) + { + g_source_destroy (data->timeout_source); + data->timeout_source = NULL; + } + if (data->cancellable_handler_id > 0) + { + g_cancellable_disconnect (data->cancellable, data->cancellable_handler_id); + data->cancellable_handler_id = 0; + } + + g_warn_if_fail (g_hash_table_remove (data->connection->map_method_serial_to_send_message_data, + GUINT_TO_POINTER (data->serial))); + + send_message_data_unref (data); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* must hold lock */ +static void +send_message_data_deliver_reply_unlocked (SendMessageData *data, + GDBusMessage *reply) +{ + if (data->delivered) + goto out; + + g_simple_async_result_set_op_res_gpointer (data->simple, + g_object_ref (reply), + g_object_unref); + + send_message_with_reply_deliver (data); + + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +send_message_with_reply_cancelled_idle_cb (gpointer user_data) +{ + SendMessageData *data = user_data; + + CONNECTION_LOCK (data->connection); + if (data->delivered) + goto out; + + g_simple_async_result_set_error (data->simple, + G_IO_ERROR, + G_IO_ERROR_CANCELLED, + _("Operation was cancelled")); + + send_message_with_reply_deliver (data); + + out: + CONNECTION_UNLOCK (data->connection); + return FALSE; +} + +/* Can be called from any thread with or without lock held */ +static void +send_message_with_reply_cancelled_cb (GCancellable *cancellable, + gpointer user_data) +{ + SendMessageData *data = user_data; + GSource *idle_source; + + /* postpone cancellation to idle handler since we may be called directly + * via g_cancellable_connect() (e.g. holding lock) + */ + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + send_message_with_reply_cancelled_idle_cb, + send_message_data_ref (data), + (GDestroyNotify) send_message_data_unref); + g_source_attach (idle_source, data->main_context); + g_source_unref (idle_source); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +send_message_with_reply_timeout_cb (gpointer user_data) +{ + SendMessageData *data = user_data; + + CONNECTION_LOCK (data->connection); + if (data->delivered) + goto out; + + g_simple_async_result_set_error (data->simple, + G_IO_ERROR, + G_IO_ERROR_TIMED_OUT, + _("Timeout was reached")); + + send_message_with_reply_deliver (data); + + out: + CONNECTION_UNLOCK (data->connection); + + return FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + gint timeout_msec, + volatile guint32 *out_serial, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *simple; + SendMessageData *data; + GError *error; + volatile guint32 serial; + + data = NULL; + + if (out_serial == NULL) + out_serial = &serial; + + if (timeout_msec == -1) + timeout_msec = 25 * 1000; + + simple = g_simple_async_result_new (G_OBJECT (connection), + callback, + user_data, + g_dbus_connection_send_message_with_reply); + + if (g_cancellable_is_cancelled (cancellable)) + { + g_simple_async_result_set_error (simple, + G_IO_ERROR, + G_IO_ERROR_CANCELLED, + _("Operation was cancelled")); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); + goto out; + } + + if (connection->closed) + { + g_simple_async_result_set_error (simple, + G_IO_ERROR, + G_IO_ERROR_CLOSED, + _("The connection is closed")); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); + goto out; + } + + error = NULL; + if (!g_dbus_connection_send_message_unlocked (connection, message, flags, out_serial, &error)) + { + g_simple_async_result_take_error (simple, error); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); + goto out; + } + + data = g_new0 (SendMessageData, 1); + data->ref_count = 1; + data->connection = g_object_ref (connection); + data->simple = simple; + data->serial = *out_serial; + data->main_context = g_main_context_get_thread_default (); + if (data->main_context != NULL) + g_main_context_ref (data->main_context); + + if (cancellable != NULL) + { + data->cancellable = g_object_ref (cancellable); + data->cancellable_handler_id = g_cancellable_connect (cancellable, + G_CALLBACK (send_message_with_reply_cancelled_cb), + send_message_data_ref (data), + (GDestroyNotify) send_message_data_unref); + g_object_set_data_full (G_OBJECT (simple), + "cancellable", + g_object_ref (cancellable), + (GDestroyNotify) g_object_unref); + } + + if (timeout_msec != G_MAXINT) + { + data->timeout_source = g_timeout_source_new (timeout_msec); + g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT); + g_source_set_callback (data->timeout_source, + send_message_with_reply_timeout_cb, + send_message_data_ref (data), + (GDestroyNotify) send_message_data_unref); + g_source_attach (data->timeout_source, data->main_context); + g_source_unref (data->timeout_source); + } + + g_hash_table_insert (connection->map_method_serial_to_send_message_data, + GUINT_TO_POINTER (*out_serial), + data); + + out: + ; +} + +/** + * g_dbus_connection_send_message_with_reply: + * @connection: A #GDBusConnection. + * @message: A #GDBusMessage. + * @flags: Flags affecting how the message is sent. + * @timeout_msec: The timeout in milliseconds, -1 to use the default + * timeout or %G_MAXINT for no timeout. + * @out_serial: Return location for serial number assigned to @message when sending it or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't + * care about the result. + * @user_data: The data to pass to @callback. + * + * Asynchronously sends @message to the peer represented by @connection. + * + * Unless @flags contain the + * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number + * will be assigned by @connection and set on @message via + * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the + * serial number used will be written to this location prior to + * submitting the message to the underlying transport. + * + * If @connection is closed then the operation will fail with + * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will + * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed, + * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT. + * + * This is an asynchronous method. When the operation is finished, @callback will be invoked + * in the thread-default main loop + * of the thread you are calling this method from. You can then call + * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation. + * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version. + * + * Note that @message must be unlocked, unless @flags contain the + * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. + * + * See and for an example of how to use this + * low-level API to send and receive UNIX file descriptors. + * + * Since: 2.26 + */ +void +g_dbus_connection_send_message_with_reply (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + gint timeout_msec, + volatile guint32 *out_serial, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail ((flags & G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL) || !g_dbus_message_get_locked (message)); + g_return_if_fail (timeout_msec >= 0 || timeout_msec == -1); + + CONNECTION_LOCK (connection); + g_dbus_connection_send_message_with_reply_unlocked (connection, + message, + flags, + timeout_msec, + out_serial, + cancellable, + callback, + user_data); + CONNECTION_UNLOCK (connection); +} + +/** + * g_dbus_connection_send_message_with_reply_finish: + * @connection: a #GDBusConnection + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_connection_send_message_with_reply(). + * + * Note that @error is only set if a local in-process error + * occured. That is to say that the returned #GDBusMessage object may + * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use + * g_dbus_message_to_gerror() to transcode this to a #GError. + * + * See and for an example of how to use this + * low-level API to send and receive UNIX file descriptors. + * + * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set. + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_connection_send_message_with_reply_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + GDBusMessage *reply; + GCancellable *cancellable; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + reply = NULL; + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_connection_send_message_with_reply); + + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + reply = g_object_ref (g_simple_async_result_get_op_res_gpointer (simple)); + cancellable = g_object_get_data (G_OBJECT (simple), "cancellable"); + if (cancellable != NULL && g_cancellable_is_cancelled (cancellable)) + { + g_object_unref (reply); + reply = NULL; + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANCELLED, + _("Operation was cancelled")); + } + out: + return reply; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GAsyncResult *res; + GMainContext *context; + GMainLoop *loop; +} SendMessageSyncData; + +static void +send_message_with_reply_sync_cb (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + SendMessageSyncData *data = user_data; + data->res = g_object_ref (res); + g_main_loop_quit (data->loop); +} + +/** + * g_dbus_connection_send_message_with_reply_sync: + * @connection: A #GDBusConnection. + * @message: A #GDBusMessage. + * @flags: Flags affecting how the message is sent. + * @timeout_msec: The timeout in milliseconds, -1 to use the default + * timeout or %G_MAXINT for no timeout. + * @out_serial: Return location for serial number assigned to @message when sending it or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously sends @message to the peer represented by @connection + * and blocks the calling thread until a reply is received or the + * timeout is reached. See g_dbus_connection_send_message_with_reply() + * for the asynchronous version of this method. + * + * Unless @flags contain the + * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number + * will be assigned by @connection and set on @message via + * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the + * serial number used will be written to this location prior to + * submitting the message to the underlying transport. + * + * If @connection is closed then the operation will fail with + * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will + * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed, + * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT. + * + * Note that @error is only set if a local in-process error + * occured. That is to say that the returned #GDBusMessage object may + * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use + * g_dbus_message_to_gerror() to transcode this to a #GError. + * + * See and for an example of how to use this + * low-level API to send and receive UNIX file descriptors. + * + * Note that @message must be unlocked, unless @flags contain the + * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. + * + * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set. + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_connection_send_message_with_reply_sync (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + gint timeout_msec, + volatile guint32 *out_serial, + GCancellable *cancellable, + GError **error) +{ + SendMessageSyncData *data; + GDBusMessage *reply; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + g_return_val_if_fail ((flags & G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL) || !g_dbus_message_get_locked (message), FALSE); + g_return_val_if_fail (timeout_msec >= 0 || timeout_msec == -1, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + data = g_new0 (SendMessageSyncData, 1); + data->context = g_main_context_new (); + data->loop = g_main_loop_new (data->context, FALSE); + + g_main_context_push_thread_default (data->context); + + g_dbus_connection_send_message_with_reply (connection, + message, + flags, + timeout_msec, + out_serial, + cancellable, + (GAsyncReadyCallback) send_message_with_reply_sync_cb, + data); + g_main_loop_run (data->loop); + reply = g_dbus_connection_send_message_with_reply_finish (connection, + data->res, + error); + + g_main_context_pop_thread_default (data->context); + + g_main_context_unref (data->context); + g_main_loop_unref (data->loop); + g_object_unref (data->res); + g_free (data); + + return reply; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusMessageFilterFunction func; + gpointer user_data; +} FilterCallback; + +typedef struct +{ + guint id; + GDBusMessageFilterFunction filter_function; + gpointer user_data; + GDestroyNotify user_data_free_func; +} FilterData; + +/* Called in worker's thread - we must not block */ +static void +on_worker_message_received (GDBusWorker *worker, + GDBusMessage *message, + gpointer user_data) +{ + GDBusConnection *connection; + FilterCallback *filters; + gboolean consumed_by_filter; + gboolean altered_by_filter; + guint num_filters; + guint n; + gboolean alive; + + G_LOCK (message_bus_lock); + alive = (g_hash_table_lookup (alive_connections, user_data) != NULL); + if (!alive) + { + G_UNLOCK (message_bus_lock); + return; + } + connection = G_DBUS_CONNECTION (user_data); + g_object_ref (connection); + G_UNLOCK (message_bus_lock); + + //g_debug ("in on_worker_message_received"); + + g_object_ref (message); + g_dbus_message_lock (message); + + //g_debug ("boo ref_count = %d %p %p", G_OBJECT (connection)->ref_count, connection, connection->worker); + + /* First collect the set of callback functions */ + CONNECTION_LOCK (connection); + num_filters = connection->filters->len; + filters = g_new0 (FilterCallback, num_filters); + for (n = 0; n < num_filters; n++) + { + FilterData *data = connection->filters->pdata[n]; + filters[n].func = data->filter_function; + filters[n].user_data = data->user_data; + } + CONNECTION_UNLOCK (connection); + + /* then call the filters in order (without holding the lock) */ + consumed_by_filter = FALSE; + altered_by_filter = FALSE; + for (n = 0; n < num_filters; n++) + { + message = filters[n].func (connection, + message, + TRUE, + filters[n].user_data); + if (message == NULL) + break; + g_dbus_message_lock (message); + } + + /* Standard dispatch unless the filter ate the message - no need to + * do anything if the message was altered + */ + if (message != NULL) + { + GDBusMessageType message_type; + + message_type = g_dbus_message_get_message_type (message); + if (message_type == G_DBUS_MESSAGE_TYPE_METHOD_RETURN || message_type == G_DBUS_MESSAGE_TYPE_ERROR) + { + guint32 reply_serial; + SendMessageData *send_message_data; + + reply_serial = g_dbus_message_get_reply_serial (message); + CONNECTION_LOCK (connection); + send_message_data = g_hash_table_lookup (connection->map_method_serial_to_send_message_data, + GUINT_TO_POINTER (reply_serial)); + if (send_message_data != NULL) + { + //g_debug ("delivering reply/error for serial %d for %p", reply_serial, connection); + send_message_data_deliver_reply_unlocked (send_message_data, message); + } + else + { + //g_debug ("message reply/error for serial %d but no SendMessageData found for %p", reply_serial, connection); + } + CONNECTION_UNLOCK (connection); + } + else if (message_type == G_DBUS_MESSAGE_TYPE_SIGNAL) + { + CONNECTION_LOCK (connection); + distribute_signals (connection, message); + CONNECTION_UNLOCK (connection); + } + else if (message_type == G_DBUS_MESSAGE_TYPE_METHOD_CALL) + { + CONNECTION_LOCK (connection); + distribute_method_call (connection, message); + CONNECTION_UNLOCK (connection); + } + } + + if (message != NULL) + g_object_unref (message); + g_object_unref (connection); + g_free (filters); +} + +/* Called in worker's thread */ +static GDBusMessage * +on_worker_message_about_to_be_sent (GDBusWorker *worker, + GDBusMessage *message, + gpointer user_data) +{ + GDBusConnection *connection; + FilterCallback *filters; + guint num_filters; + guint n; + gboolean alive; + + G_LOCK (message_bus_lock); + alive = (g_hash_table_lookup (alive_connections, user_data) != NULL); + if (!alive) + { + G_UNLOCK (message_bus_lock); + return message; + } + connection = G_DBUS_CONNECTION (user_data); + g_object_ref (connection); + G_UNLOCK (message_bus_lock); + + //g_debug ("in on_worker_message_about_to_be_sent"); + + /* First collect the set of callback functions */ + CONNECTION_LOCK (connection); + num_filters = connection->filters->len; + filters = g_new0 (FilterCallback, num_filters); + for (n = 0; n < num_filters; n++) + { + FilterData *data = connection->filters->pdata[n]; + filters[n].func = data->filter_function; + filters[n].user_data = data->user_data; + } + CONNECTION_UNLOCK (connection); + + /* then call the filters in order (without holding the lock) */ + for (n = 0; n < num_filters; n++) + { + g_dbus_message_lock (message); + message = filters[n].func (connection, + message, + FALSE, + filters[n].user_data); + if (message == NULL) + break; + } + + g_object_unref (connection); + g_free (filters); + + return message; +} + +/* Called in worker's thread - we must not block */ +static void +on_worker_closed (GDBusWorker *worker, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data) +{ + GDBusConnection *connection; + gboolean alive; + + G_LOCK (message_bus_lock); + alive = (g_hash_table_lookup (alive_connections, user_data) != NULL); + if (!alive) + { + G_UNLOCK (message_bus_lock); + return; + } + connection = G_DBUS_CONNECTION (user_data); + g_object_ref (connection); + G_UNLOCK (message_bus_lock); + + //g_debug ("in on_worker_closed: %s", error->message); + + CONNECTION_LOCK (connection); + if (!connection->closed) + set_closed_unlocked (connection, remote_peer_vanished, error); + CONNECTION_UNLOCK (connection); + + g_object_unref (connection); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* Determines the biggest set of capabilities we can support on this connection */ +static GDBusCapabilityFlags +get_offered_capabilities_max (GDBusConnection *connection) +{ + GDBusCapabilityFlags ret; + ret = G_DBUS_CAPABILITY_FLAGS_NONE; +#ifdef G_OS_UNIX + if (G_IS_UNIX_CONNECTION (connection->stream)) + ret |= G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING; +#endif + return ret; +} + +static gboolean +initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (initable); + gboolean ret; + + /* This method needs to be idempotent to work with the singleton + * pattern. See the docs for g_initable_init(). We implement this by + * locking. + * + * Unfortunately we can't use the main lock since the on_worker_*() + * callbacks above needs the lock during initialization (for message + * bus connections we do a synchronous Hello() call on the bus). + */ + g_mutex_lock (connection->init_lock); + + ret = FALSE; + + if (connection->is_initialized) + { + if (connection->stream != NULL) + ret = TRUE; + else + g_assert (connection->initialization_error != NULL); + goto out; + } + g_assert (connection->initialization_error == NULL); + + /* The user can pass multiple (but mutally exclusive) construct + * properties: + * + * - stream (of type GIOStream) + * - address (of type gchar*) + * + * At the end of the day we end up with a non-NULL GIOStream + * object in connection->stream. + */ + if (connection->address != NULL) + { + g_assert (connection->stream == NULL); + + if ((connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER) || + (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS)) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Unsupported flags encountered when constructing a client-side connection")); + goto out; + } + + connection->stream = g_dbus_address_get_stream_sync (connection->address, + NULL, /* TODO: out_guid */ + cancellable, + &connection->initialization_error); + if (connection->stream == NULL) + goto out; + } + else if (connection->stream != NULL) + { + /* nothing to do */ + } + else + { + g_assert_not_reached (); + } + + /* Authenticate the connection */ + if (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER) + { + g_assert (!(connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT)); + g_assert (connection->guid != NULL); + connection->auth = _g_dbus_auth_new (connection->stream); + if (!_g_dbus_auth_run_server (connection->auth, + connection->authentication_observer, + connection->guid, + (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS), + get_offered_capabilities_max (connection), + &connection->capabilities, + &connection->credentials, + cancellable, + &connection->initialization_error)) + goto out; + } + else if (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT) + { + g_assert (!(connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER)); + g_assert (connection->guid == NULL); + connection->auth = _g_dbus_auth_new (connection->stream); + connection->guid = _g_dbus_auth_run_client (connection->auth, + get_offered_capabilities_max (connection), + &connection->capabilities, + cancellable, + &connection->initialization_error); + if (connection->guid == NULL) + goto out; + } + + if (connection->authentication_observer != NULL) + { + g_object_unref (connection->authentication_observer); + connection->authentication_observer = NULL; + } + + //g_output_stream_flush (G_SOCKET_CONNECTION (connection->stream) + + //g_debug ("haz unix fd passing powers: %d", connection->capabilities & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); + +#ifdef G_OS_UNIX + /* Hack used until + * + * https://bugzilla.gnome.org/show_bug.cgi?id=616458 + * + * has been resolved + */ + if (G_IS_SOCKET_CONNECTION (connection->stream)) + { + g_socket_set_blocking (g_socket_connection_get_socket (G_SOCKET_CONNECTION (connection->stream)), FALSE); + } +#endif + + G_LOCK (message_bus_lock); + if (alive_connections == NULL) + alive_connections = g_hash_table_new (g_direct_hash, g_direct_equal); + g_hash_table_insert (alive_connections, connection, connection); + G_UNLOCK (message_bus_lock); + + connection->worker = _g_dbus_worker_new (connection->stream, + connection->capabilities, + (connection->flags & G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING), + on_worker_message_received, + on_worker_message_about_to_be_sent, + on_worker_closed, + connection); + + /* if a bus connection, call org.freedesktop.DBus.Hello - this is how we're getting a name */ + if (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION) + { + GVariant *hello_result; + + /* we could lift this restriction by adding code in gdbusprivate.c */ + if (connection->flags & G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING) + { + g_set_error_literal (&connection->initialization_error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Cannot use DELAY_MESSAGE_PROCESSING with MESSAGE_BUS_CONNECTION"); + goto out; + } + + hello_result = g_dbus_connection_call_sync (connection, + "org.freedesktop.DBus", /* name */ + "/org/freedesktop/DBus", /* path */ + "org.freedesktop.DBus", /* interface */ + "Hello", + NULL, /* parameters */ + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* TODO: cancellable */ + &connection->initialization_error); + if (hello_result == NULL) + goto out; + + g_variant_get (hello_result, "(s)", &connection->bus_unique_name); + g_variant_unref (hello_result); + //g_debug ("unique name is `%s'", connection->bus_unique_name); + } + + connection->is_initialized = TRUE; + + ret = TRUE; + out: + if (!ret) + { + g_assert (connection->initialization_error != NULL); + g_propagate_error (error, g_error_copy (connection->initialization_error)); + } + + g_mutex_unlock (connection->init_lock); + + return ret; +} + +static void +initable_iface_init (GInitableIface *initable_iface) +{ + initable_iface->init = initable_init; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +async_initable_iface_init (GAsyncInitableIface *async_initable_iface) +{ + /* Use default */ +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_new: + * @stream: A #GIOStream. + * @guid: The GUID to use if a authenticating as a server or %NULL. + * @flags: Flags describing how to make the connection. + * @observer: A #GDBusAuthObserver or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: The data to pass to @callback. + * + * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages + * with the end represented by @stream. + * + * If @observer is not %NULL it may be used to control the + * authentication process. + * + * When the operation is finished, @callback will be invoked. You can + * then call g_dbus_connection_new_finish() to get the result of the + * operation. + * + * This is a asynchronous failable constructor. See + * g_dbus_connection_new_sync() for the synchronous + * version. + * + * Since: 2.26 + */ +void +g_dbus_connection_new (GIOStream *stream, + const gchar *guid, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (G_IS_IO_STREAM (stream)); + g_async_initable_new_async (G_TYPE_DBUS_CONNECTION, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + "stream", stream, + "guid", guid, + "flags", flags, + "authentication-observer", observer, + NULL); +} + +/** + * g_dbus_connection_new_finish: + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_connection_new(). + * + * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusConnection * +g_dbus_connection_new_finish (GAsyncResult *res, + GError **error) +{ + GObject *object; + GObject *source_object; + + g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + source_object = g_async_result_get_source_object (res); + g_assert (source_object != NULL); + object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), + res, + error); + g_object_unref (source_object); + if (object != NULL) + return G_DBUS_CONNECTION (object); + else + return NULL; +} + +/** + * g_dbus_connection_new_sync: + * @stream: A #GIOStream. + * @guid: The GUID to use if a authenticating as a server or %NULL. + * @flags: Flags describing how to make the connection. + * @observer: A #GDBusAuthObserver or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously sets up a D-Bus connection for exchanging D-Bus messages + * with the end represented by @stream. + * + * If @observer is not %NULL it may be used to control the + * authentication process. + * + * This is a synchronous failable constructor. See + * g_dbus_connection_new() for the asynchronous version. + * + * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusConnection * +g_dbus_connection_new_sync (GIOStream *stream, + const gchar *guid, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (G_IS_IO_STREAM (stream), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + return g_initable_new (G_TYPE_DBUS_CONNECTION, + cancellable, + error, + "stream", stream, + "guid", guid, + "flags", flags, + "authentication-observer", observer, + NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_new_for_address: + * @address: A D-Bus address. + * @flags: Flags describing how to make the connection. + * @observer: A #GDBusAuthObserver or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: The data to pass to @callback. + * + * Asynchronously connects and sets up a D-Bus client connection for + * exchanging D-Bus messages with an endpoint specified by @address + * which must be in the D-Bus address format. + * + * This constructor can only be used to initiate client-side + * connections - use g_dbus_connection_new() if you need to act as the + * server. In particular, @flags cannot contain the + * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or + * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags. + * + * When the operation is finished, @callback will be invoked. You can + * then call g_dbus_connection_new_finish() to get the result of the + * operation. + * + * If @observer is not %NULL it may be used to control the + * authentication process. + * + * This is a asynchronous failable constructor. See + * g_dbus_connection_new_for_address_sync() for the synchronous + * version. + * + * Since: 2.26 + */ +void +g_dbus_connection_new_for_address (const gchar *address, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (address != NULL); + g_async_initable_new_async (G_TYPE_DBUS_CONNECTION, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + "address", address, + "flags", flags, + "authentication-observer", observer, + NULL); +} + +/** + * g_dbus_connection_new_for_address_finish: + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_connection_new_for_address(). + * + * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusConnection * +g_dbus_connection_new_for_address_finish (GAsyncResult *res, + GError **error) +{ + GObject *object; + GObject *source_object; + + g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + source_object = g_async_result_get_source_object (res); + g_assert (source_object != NULL); + object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), + res, + error); + g_object_unref (source_object); + if (object != NULL) + return G_DBUS_CONNECTION (object); + else + return NULL; +} + +/** + * g_dbus_connection_new_for_address_sync: + * @address: A D-Bus address. + * @flags: Flags describing how to make the connection. + * @observer: A #GDBusAuthObserver or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously connects and sets up a D-Bus client connection for + * exchanging D-Bus messages with an endpoint specified by @address + * which must be in the D-Bus address format. + * + * This constructor can only be used to initiate client-side + * connections - use g_dbus_connection_new_sync() if you need to act + * as the server. In particular, @flags cannot contain the + * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or + * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags. + * + * This is a synchronous failable constructor. See + * g_dbus_connection_new_for_address() for the asynchronous version. + * + * If @observer is not %NULL it may be used to control the + * authentication process. + * + * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusConnection * +g_dbus_connection_new_for_address_sync (const gchar *address, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (address != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + return g_initable_new (G_TYPE_DBUS_CONNECTION, + cancellable, + error, + "address", address, + "flags", flags, + "authentication-observer", observer, + NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_set_exit_on_close: + * @connection: A #GDBusConnection. + * @exit_on_close: Whether the process should be terminated + * when @connection is closed by the remote peer. + * + * Sets whether the process should be terminated when @connection is + * closed by the remote peer. See #GDBusConnection:exit-on-close for + * more details. + * + * Since: 2.26 + */ +void +g_dbus_connection_set_exit_on_close (GDBusConnection *connection, + gboolean exit_on_close) +{ + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + connection->exit_on_close = exit_on_close; +} + +/** + * g_dbus_connection_get_exit_on_close: + * @connection: A #GDBusConnection. + * + * Gets whether the process is terminated when @connection is + * closed by the remote peer. See + * #GDBusConnection:exit-on-close for more details. + * + * Returns: Whether the process is terminated when @connection is + * closed by the remote peer. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_get_exit_on_close (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + return connection->exit_on_close; +} + +/** + * g_dbus_connection_get_guid: + * @connection: A #GDBusConnection. + * + * The GUID of the peer performing the role of server when + * authenticating. See #GDBusConnection:guid for more details. + * + * Returns: The GUID. Do not free this string, it is owned by + * @connection. + * + * Since: 2.26 + */ +const gchar * +g_dbus_connection_get_guid (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + return connection->guid; +} + +/** + * g_dbus_connection_get_unique_name: + * @connection: A #GDBusConnection. + * + * Gets the unique name of @connection as assigned by the message + * bus. This can also be used to figure out if @connection is a + * message bus connection. + * + * Returns: The unique name or %NULL if @connection is not a message + * bus connection. Do not free this string, it is owned by + * @connection. + * + * Since: 2.26 + */ +const gchar * +g_dbus_connection_get_unique_name (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + return connection->bus_unique_name; +} + +/** + * g_dbus_connection_get_peer_credentials: + * @connection: A #GDBusConnection. + * + * Gets the credentials of the authenticated peer. This will always + * return %NULL unless @connection acted as a server + * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed) + * when set up and the client passed credentials as part of the + * authentication process. + * + * In a message bus setup, the message bus is always the server and + * each application is a client. So this method will always return + * %NULL for message bus clients. + * + * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free + * this object, it is owned by @connection. + * + * Since: 2.26 + */ +GCredentials * +g_dbus_connection_get_peer_credentials (GDBusConnection *connection) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + return connection->credentials; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static guint _global_filter_id = 1; + +/** + * g_dbus_connection_add_filter: + * @connection: A #GDBusConnection. + * @filter_function: A filter function. + * @user_data: User data to pass to @filter_function. + * @user_data_free_func: Function to free @user_data with when filter + * is removed or %NULL. + * + * Adds a message filter. Filters are handlers that are run on all + * incoming and outgoing messages, prior to standard dispatch. Filters + * are run in the order that they were added. The same handler can be + * added as a filter more than once, in which case it will be run more + * than once. Filters added during a filter callback won't be run on + * the message being processed. Filter functions are allowed to modify + * and even drop messages - see the #GDBusMessageFilterResult + * enumeration for details. + * + * Note that filters are run in a dedicated message handling thread so + * they can't block and, generally, can't do anything but signal a + * worker thread. Also note that filters are rarely needed - use API + * such as g_dbus_connection_send_message_with_reply(), + * g_dbus_connection_signal_subscribe() or + * g_dbus_connection_call() instead. + * + * If a filter consumes an incoming message the message is not + * dispatched anywhere else - not even the standard dispatch machinery + * (that API such as g_dbus_connection_signal_subscribe() and + * g_dbus_connection_send_message_with_reply() relies on) will see the + * message. Similary, if a filter consumes an outgoing message, the + * message will not be sent to the other peer. + * + * Returns: A filter identifier that can be used with + * g_dbus_connection_remove_filter(). + * + * Since: 2.26 + */ +guint +g_dbus_connection_add_filter (GDBusConnection *connection, + GDBusMessageFilterFunction filter_function, + gpointer user_data, + GDestroyNotify user_data_free_func) +{ + FilterData *data; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0); + g_return_val_if_fail (filter_function != NULL, 0); + + CONNECTION_LOCK (connection); + data = g_new0 (FilterData, 1); + data->id = _global_filter_id++; /* TODO: overflow etc. */ + data->filter_function = filter_function; + data->user_data = user_data; + data->user_data_free_func = user_data_free_func; + g_ptr_array_add (connection->filters, data); + CONNECTION_UNLOCK (connection); + + return data->id; +} + +/* only called from finalize(), removes all filters */ +static void +purge_all_filters (GDBusConnection *connection) +{ + guint n; + for (n = 0; n < connection->filters->len; n++) + { + FilterData *data = connection->filters->pdata[n]; + if (data->user_data_free_func != NULL) + data->user_data_free_func (data->user_data); + g_free (data); + } +} + +/** + * g_dbus_connection_remove_filter: + * @connection: a #GDBusConnection + * @filter_id: an identifier obtained from g_dbus_connection_add_filter() + * + * Removes a filter. + * + * Since: 2.26 + */ +void +g_dbus_connection_remove_filter (GDBusConnection *connection, + guint filter_id) +{ + guint n; + FilterData *to_destroy; + + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + + CONNECTION_LOCK (connection); + to_destroy = NULL; + for (n = 0; n < connection->filters->len; n++) + { + FilterData *data = connection->filters->pdata[n]; + if (data->id == filter_id) + { + g_ptr_array_remove_index (connection->filters, n); + to_destroy = data; + break; + } + } + CONNECTION_UNLOCK (connection); + + /* do free without holding lock */ + if (to_destroy != NULL) + { + if (to_destroy->user_data_free_func != NULL) + to_destroy->user_data_free_func (to_destroy->user_data); + g_free (to_destroy); + } + else + { + g_warning ("g_dbus_connection_remove_filter: No filter found for filter_id %d", filter_id); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + gchar *rule; + gchar *sender; + gchar *sender_unique_name; /* if sender is unique or org.freedesktop.DBus, then that name... otherwise blank */ + gchar *interface_name; + gchar *member; + gchar *object_path; + gchar *arg0; + GArray *subscribers; +} SignalData; + +typedef struct +{ + GDBusSignalCallback callback; + gpointer user_data; + GDestroyNotify user_data_free_func; + guint id; + GMainContext *context; +} SignalSubscriber; + +static void +signal_data_free (SignalData *signal_data) +{ + g_free (signal_data->rule); + g_free (signal_data->sender); + g_free (signal_data->sender_unique_name); + g_free (signal_data->interface_name); + g_free (signal_data->member); + g_free (signal_data->object_path); + g_free (signal_data->arg0); + g_array_free (signal_data->subscribers, TRUE); + g_free (signal_data); +} + +static gchar * +args_to_rule (const gchar *sender, + const gchar *interface_name, + const gchar *member, + const gchar *object_path, + const gchar *arg0, + gboolean negate) +{ + GString *rule; + + rule = g_string_new ("type='signal'"); + if (negate) + g_string_prepend_c (rule, '-'); + if (sender != NULL) + g_string_append_printf (rule, ",sender='%s'", sender); + if (interface_name != NULL) + g_string_append_printf (rule, ",interface='%s'", interface_name); + if (member != NULL) + g_string_append_printf (rule, ",member='%s'", member); + if (object_path != NULL) + g_string_append_printf (rule, ",path='%s'", object_path); + if (arg0 != NULL) + g_string_append_printf (rule, ",arg0='%s'", arg0); + + return g_string_free (rule, FALSE); +} + +static guint _global_subscriber_id = 1; +static guint _global_registration_id = 1; +static guint _global_subtree_registration_id = 1; + +/* ---------------------------------------------------------------------------------------------------- */ + +/* must hold lock when calling */ +static void +add_match_rule (GDBusConnection *connection, + const gchar *match_rule) +{ + GError *error; + GDBusMessage *message; + + if (match_rule[0] == '-') + return; + + message = g_dbus_message_new_method_call ("org.freedesktop.DBus", /* name */ + "/org/freedesktop/DBus", /* path */ + "org.freedesktop.DBus", /* interface */ + "AddMatch"); + g_dbus_message_set_body (message, g_variant_new ("(s)", match_rule)); + error = NULL; + if (!g_dbus_connection_send_message_unlocked (connection, + message, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + NULL, + &error)) + { + g_critical ("Error while sending AddMatch() message: %s", error->message); + g_error_free (error); + } + g_object_unref (message); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* must hold lock when calling */ +static void +remove_match_rule (GDBusConnection *connection, + const gchar *match_rule) +{ + GError *error; + GDBusMessage *message; + + if (match_rule[0] == '-') + return; + + message = g_dbus_message_new_method_call ("org.freedesktop.DBus", /* name */ + "/org/freedesktop/DBus", /* path */ + "org.freedesktop.DBus", /* interface */ + "RemoveMatch"); + g_dbus_message_set_body (message, g_variant_new ("(s)", match_rule)); + + error = NULL; + if (!g_dbus_connection_send_message_unlocked (connection, + message, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + NULL, + &error)) + { + g_critical ("Error while sending RemoveMatch() message: %s", error->message); + g_error_free (error); + } + g_object_unref (message); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +is_signal_data_for_name_lost_or_acquired (SignalData *signal_data) +{ + return g_strcmp0 (signal_data->sender_unique_name, "org.freedesktop.DBus") == 0 && + g_strcmp0 (signal_data->interface_name, "org.freedesktop.DBus") == 0 && + g_strcmp0 (signal_data->object_path, "/org/freedesktop/DBus") == 0 && + (g_strcmp0 (signal_data->member, "NameLost") == 0 || + g_strcmp0 (signal_data->member, "NameAcquired") == 0); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_signal_subscribe: + * @connection: A #GDBusConnection. + * @sender: Sender name to match on (unique or well-known name) or %NULL to listen from all senders. + * @interface_name: D-Bus interface name to match on or %NULL to match on all interfaces. + * @member: D-Bus signal name to match on or %NULL to match on all signals. + * @object_path: Object path to match on or %NULL to match on all object paths. + * @arg0: Contents of first string argument to match on or %NULL to match on all kinds of arguments. + * @flags: Flags describing how to subscribe to the signal (currently unused). + * @callback: Callback to invoke when there is a signal matching the requested data. + * @user_data: User data to pass to @callback. + * @user_data_free_func: Function to free @user_data with when subscription is removed or %NULL. + * + * Subscribes to signals on @connection and invokes @callback with a + * whenever the signal is received. Note that @callback + * will be invoked in the thread-default main + * loop of the thread you are calling this method from. + * + * If @connection is not a message bus connection, @sender must be + * %NULL. + * + * If @sender is a well-known name note that @callback is invoked with + * the unique name for the owner of @sender, not the well-known name + * as one would expect. This is because the message bus rewrites the + * name. As such, to avoid certain race conditions, users should be + * tracking the name owner of the well-known name and use that when + * processing the received signal. + * + * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe(). + * + * Since: 2.26 + */ +guint +g_dbus_connection_signal_subscribe (GDBusConnection *connection, + const gchar *sender, + const gchar *interface_name, + const gchar *member, + const gchar *object_path, + const gchar *arg0, + GDBusSignalFlags flags, + GDBusSignalCallback callback, + gpointer user_data, + GDestroyNotify user_data_free_func) +{ + gchar *rule; + SignalData *signal_data; + SignalSubscriber subscriber; + GPtrArray *signal_data_array; + const gchar *sender_unique_name; + + /* Right now we abort if AddMatch() fails since it can only fail with the bus being in + * an OOM condition. We might want to change that but that would involve making + * g_dbus_connection_signal_subscribe() asynchronous and having the call sites + * handle that. And there's really no sensible way of handling this short of retrying + * to add the match rule... and then there's the little thing that, hey, maybe there's + * a reason the bus in an OOM condition. + * + * Doable, but not really sure it's worth it... + */ + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0); + g_return_val_if_fail (sender == NULL || (g_dbus_is_name (sender) && (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION)), 0); + g_return_val_if_fail (interface_name == NULL || g_dbus_is_interface_name (interface_name), 0); + g_return_val_if_fail (member == NULL || g_dbus_is_member_name (member), 0); + g_return_val_if_fail (object_path == NULL || g_variant_is_object_path (object_path), 0); + g_return_val_if_fail (callback != NULL, 0); + + CONNECTION_LOCK (connection); + + /* If G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE was specified, we will end up + * with a '-' character to prefix the rule (which will otherwise be + * normal). + * + * This allows us to hash the rule and do our lifecycle tracking in + * the usual way, but the '-' prevents the match rule from ever + * actually being send to the bus (either for add or remove). + */ + rule = args_to_rule (sender, interface_name, member, object_path, arg0, + (flags & G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE) != 0); + + if (sender != NULL && (g_dbus_is_unique_name (sender) || g_strcmp0 (sender, "org.freedesktop.DBus") == 0)) + sender_unique_name = sender; + else + sender_unique_name = ""; + + subscriber.callback = callback; + subscriber.user_data = user_data; + subscriber.user_data_free_func = user_data_free_func; + subscriber.id = _global_subscriber_id++; /* TODO: overflow etc. */ + subscriber.context = g_main_context_get_thread_default (); + if (subscriber.context != NULL) + g_main_context_ref (subscriber.context); + + /* see if we've already have this rule */ + signal_data = g_hash_table_lookup (connection->map_rule_to_signal_data, rule); + if (signal_data != NULL) + { + g_array_append_val (signal_data->subscribers, subscriber); + g_free (rule); + goto out; + } + + signal_data = g_new0 (SignalData, 1); + signal_data->rule = rule; + signal_data->sender = g_strdup (sender); + signal_data->sender_unique_name = g_strdup (sender_unique_name); + signal_data->interface_name = g_strdup (interface_name); + signal_data->member = g_strdup (member); + signal_data->object_path = g_strdup (object_path); + signal_data->arg0 = g_strdup (arg0); + signal_data->subscribers = g_array_new (FALSE, FALSE, sizeof (SignalSubscriber)); + g_array_append_val (signal_data->subscribers, subscriber); + + g_hash_table_insert (connection->map_rule_to_signal_data, + signal_data->rule, + signal_data); + + /* Add the match rule to the bus... + * + * Avoid adding match rules for NameLost and NameAcquired messages - the bus will + * always send such messages to us. + */ + if (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION) + { + if (!is_signal_data_for_name_lost_or_acquired (signal_data)) + add_match_rule (connection, signal_data->rule); + } + + signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array, + signal_data->sender_unique_name); + if (signal_data_array == NULL) + { + signal_data_array = g_ptr_array_new (); + g_hash_table_insert (connection->map_sender_unique_name_to_signal_data_array, + g_strdup (signal_data->sender_unique_name), + signal_data_array); + } + g_ptr_array_add (signal_data_array, signal_data); + + out: + g_hash_table_insert (connection->map_id_to_signal_data, + GUINT_TO_POINTER (subscriber.id), + signal_data); + + CONNECTION_UNLOCK (connection); + + return subscriber.id; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* must hold lock when calling this (except if connection->finalizing is TRUE) */ +static void +unsubscribe_id_internal (GDBusConnection *connection, + guint subscription_id, + GArray *out_removed_subscribers) +{ + SignalData *signal_data; + GPtrArray *signal_data_array; + guint n; + + signal_data = g_hash_table_lookup (connection->map_id_to_signal_data, + GUINT_TO_POINTER (subscription_id)); + if (signal_data == NULL) + { + /* Don't warn here, we may have thrown all subscriptions out when the connection was closed */ + goto out; + } + + for (n = 0; n < signal_data->subscribers->len; n++) + { + SignalSubscriber *subscriber; + + subscriber = &(g_array_index (signal_data->subscribers, SignalSubscriber, n)); + if (subscriber->id != subscription_id) + continue; + + g_warn_if_fail (g_hash_table_remove (connection->map_id_to_signal_data, + GUINT_TO_POINTER (subscription_id))); + g_array_append_val (out_removed_subscribers, *subscriber); + g_array_remove_index (signal_data->subscribers, n); + + if (signal_data->subscribers->len == 0) + { + g_warn_if_fail (g_hash_table_remove (connection->map_rule_to_signal_data, signal_data->rule)); + + signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array, + signal_data->sender_unique_name); + g_warn_if_fail (signal_data_array != NULL); + g_warn_if_fail (g_ptr_array_remove (signal_data_array, signal_data)); + + if (signal_data_array->len == 0) + { + g_warn_if_fail (g_hash_table_remove (connection->map_sender_unique_name_to_signal_data_array, + signal_data->sender_unique_name)); + } + + /* remove the match rule from the bus unless NameLost or NameAcquired (see subscribe()) */ + if (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION) + { + if (!is_signal_data_for_name_lost_or_acquired (signal_data)) + if (!connection->closed && !connection->finalizing) + remove_match_rule (connection, signal_data->rule); + } + signal_data_free (signal_data); + } + + goto out; + } + + g_assert_not_reached (); + + out: + ; +} + +/** + * g_dbus_connection_signal_unsubscribe: + * @connection: A #GDBusConnection. + * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe(). + * + * Unsubscribes from signals. + * + * Since: 2.26 + */ +void +g_dbus_connection_signal_unsubscribe (GDBusConnection *connection, + guint subscription_id) +{ + GArray *subscribers; + guint n; + + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + + subscribers = g_array_new (FALSE, FALSE, sizeof (SignalSubscriber)); + + CONNECTION_LOCK (connection); + unsubscribe_id_internal (connection, + subscription_id, + subscribers); + CONNECTION_UNLOCK (connection); + + /* invariant */ + g_assert (subscribers->len == 0 || subscribers->len == 1); + + /* call GDestroyNotify without lock held */ + for (n = 0; n < subscribers->len; n++) + { + SignalSubscriber *subscriber; + subscriber = &(g_array_index (subscribers, SignalSubscriber, n)); + call_destroy_notify (subscriber->context, + subscriber->user_data_free_func, + subscriber->user_data); + if (subscriber->context != NULL) + g_main_context_unref (subscriber->context); + } + + g_array_free (subscribers, TRUE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + guint subscription_id; + GDBusSignalCallback callback; + gpointer user_data; + GDBusMessage *message; + GDBusConnection *connection; + const gchar *sender; + const gchar *path; + const gchar *interface; + const gchar *member; +} SignalInstance; + +/* called on delivery thread (e.g. where g_dbus_connection_signal_subscribe() was called) with + * no locks held + */ +static gboolean +emit_signal_instance_in_idle_cb (gpointer data) +{ + SignalInstance *signal_instance = data; + GVariant *parameters; + gboolean has_subscription; + + parameters = g_dbus_message_get_body (signal_instance->message); + if (parameters == NULL) + { + parameters = g_variant_new ("()"); + g_variant_ref_sink (parameters); + } + else + { + g_variant_ref_sink (parameters); + } + +#if 0 + g_print ("in emit_signal_instance_in_idle_cb (id=%d sender=%s path=%s interface=%s member=%s params=%s)\n", + signal_instance->subscription_id, + signal_instance->sender, + signal_instance->path, + signal_instance->interface, + signal_instance->member, + g_variant_print (parameters, TRUE)); +#endif + + /* Careful here, don't do the callback if we no longer has the subscription */ + CONNECTION_LOCK (signal_instance->connection); + has_subscription = FALSE; + if (g_hash_table_lookup (signal_instance->connection->map_id_to_signal_data, + GUINT_TO_POINTER (signal_instance->subscription_id)) != NULL) + has_subscription = TRUE; + CONNECTION_UNLOCK (signal_instance->connection); + + if (has_subscription) + signal_instance->callback (signal_instance->connection, + signal_instance->sender, + signal_instance->path, + signal_instance->interface, + signal_instance->member, + parameters, + signal_instance->user_data); + + if (parameters != NULL) + g_variant_unref (parameters); + + return FALSE; +} + +static void +signal_instance_free (SignalInstance *signal_instance) +{ + g_object_unref (signal_instance->message); + g_object_unref (signal_instance->connection); + g_free (signal_instance); +} + +/* called in message handler thread WITH lock held */ +static void +schedule_callbacks (GDBusConnection *connection, + GPtrArray *signal_data_array, + GDBusMessage *message, + const gchar *sender) +{ + guint n, m; + const gchar *interface; + const gchar *member; + const gchar *path; + const gchar *arg0; + + interface = NULL; + member = NULL; + path = NULL; + arg0 = NULL; + + interface = g_dbus_message_get_interface (message); + member = g_dbus_message_get_member (message); + path = g_dbus_message_get_path (message); + arg0 = g_dbus_message_get_arg0 (message); + +#if 0 + g_print ("In schedule_callbacks:\n" + " sender = `%s'\n" + " interface = `%s'\n" + " member = `%s'\n" + " path = `%s'\n" + " arg0 = `%s'\n", + sender, + interface, + member, + path, + arg0); +#endif + + /* TODO: if this is slow, then we can change signal_data_array into + * map_object_path_to_signal_data_array or something. + */ + for (n = 0; n < signal_data_array->len; n++) + { + SignalData *signal_data = signal_data_array->pdata[n]; + + if (signal_data->interface_name != NULL && g_strcmp0 (signal_data->interface_name, interface) != 0) + continue; + + if (signal_data->member != NULL && g_strcmp0 (signal_data->member, member) != 0) + continue; + + if (signal_data->object_path != NULL && g_strcmp0 (signal_data->object_path, path) != 0) + continue; + + if (signal_data->arg0 != NULL && g_strcmp0 (signal_data->arg0, arg0) != 0) + continue; + + for (m = 0; m < signal_data->subscribers->len; m++) + { + SignalSubscriber *subscriber; + GSource *idle_source; + SignalInstance *signal_instance; + + subscriber = &(g_array_index (signal_data->subscribers, SignalSubscriber, m)); + + signal_instance = g_new0 (SignalInstance, 1); + signal_instance->subscription_id = subscriber->id; + signal_instance->callback = subscriber->callback; + signal_instance->user_data = subscriber->user_data; + signal_instance->message = g_object_ref (message); + signal_instance->connection = g_object_ref (connection); + signal_instance->sender = sender; + signal_instance->path = path; + signal_instance->interface = interface; + signal_instance->member = member; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + emit_signal_instance_in_idle_cb, + signal_instance, + (GDestroyNotify) signal_instance_free); + g_source_attach (idle_source, subscriber->context); + g_source_unref (idle_source); + } + } +} + +/* called in message handler thread with lock held */ +static void +distribute_signals (GDBusConnection *connection, + GDBusMessage *message) +{ + GPtrArray *signal_data_array; + const gchar *sender; + + sender = g_dbus_message_get_sender (message); + + if (G_UNLIKELY (_g_dbus_debug_signal ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Signal:\n" + " <<<< RECEIVED SIGNAL %s.%s\n" + " on object %s\n" + " sent by name %s\n", + g_dbus_message_get_interface (message), + g_dbus_message_get_member (message), + g_dbus_message_get_path (message), + sender != NULL ? sender : "(none)"); + _g_dbus_debug_print_unlock (); + } + + /* collect subscribers that match on sender */ + if (sender != NULL) + { + signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array, sender); + if (signal_data_array != NULL) + schedule_callbacks (connection, signal_data_array, message, sender); + } + + /* collect subscribers not matching on sender */ + signal_data_array = g_hash_table_lookup (connection->map_sender_unique_name_to_signal_data_array, ""); + if (signal_data_array != NULL) + schedule_callbacks (connection, signal_data_array, message, sender); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* only called from finalize(), removes all subscriptions */ +static void +purge_all_signal_subscriptions (GDBusConnection *connection) +{ + GHashTableIter iter; + gpointer key; + GArray *ids; + GArray *subscribers; + guint n; + + ids = g_array_new (FALSE, FALSE, sizeof (guint)); + g_hash_table_iter_init (&iter, connection->map_id_to_signal_data); + while (g_hash_table_iter_next (&iter, &key, NULL)) + { + guint subscription_id = GPOINTER_TO_UINT (key); + g_array_append_val (ids, subscription_id); + } + + subscribers = g_array_new (FALSE, FALSE, sizeof (SignalSubscriber)); + for (n = 0; n < ids->len; n++) + { + guint subscription_id = g_array_index (ids, guint, n); + unsubscribe_id_internal (connection, + subscription_id, + subscribers); + } + g_array_free (ids, TRUE); + + /* call GDestroyNotify without lock held */ + for (n = 0; n < subscribers->len; n++) + { + SignalSubscriber *subscriber; + subscriber = &(g_array_index (subscribers, SignalSubscriber, n)); + call_destroy_notify (subscriber->context, + subscriber->user_data_free_func, + subscriber->user_data); + if (subscriber->context != NULL) + g_main_context_unref (subscriber->context); + } + + g_array_free (subscribers, TRUE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusInterfaceVTable * +_g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable) +{ + /* Don't waste memory by copying padding - remember to update this + * when changing struct _GDBusInterfaceVTable in gdbusconnection.h + */ + return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer)); +} + +static void +_g_dbus_interface_vtable_free (GDBusInterfaceVTable *vtable) +{ + g_free (vtable); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusSubtreeVTable * +_g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable) +{ + /* Don't waste memory by copying padding - remember to update this + * when changing struct _GDBusSubtreeVTable in gdbusconnection.h + */ + return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer)); +} + +static void +_g_dbus_subtree_vtable_free (GDBusSubtreeVTable *vtable) +{ + g_free (vtable); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +struct ExportedObject +{ + gchar *object_path; + GDBusConnection *connection; + + /* maps gchar* -> ExportedInterface* */ + GHashTable *map_if_name_to_ei; +}; + +/* only called with lock held */ +static void +exported_object_free (ExportedObject *eo) +{ + g_free (eo->object_path); + g_hash_table_unref (eo->map_if_name_to_ei); + g_free (eo); +} + +typedef struct +{ + ExportedObject *eo; + + guint id; + gchar *interface_name; + GDBusInterfaceVTable *vtable; + GDBusInterfaceInfo *interface_info; + + GMainContext *context; + gpointer user_data; + GDestroyNotify user_data_free_func; +} ExportedInterface; + +/* called with lock held */ +static void +exported_interface_free (ExportedInterface *ei) +{ + g_dbus_interface_info_unref ((GDBusInterfaceInfo *) ei->interface_info); + + call_destroy_notify (ei->context, + ei->user_data_free_func, + ei->user_data); + + if (ei->context != NULL) + g_main_context_unref (ei->context); + + g_free (ei->interface_name); + _g_dbus_interface_vtable_free (ei->vtable); + g_free (ei); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* Convenience function to check if @registration_id (if not zero) or + * @subtree_registration_id (if not zero) has been unregistered. If + * so, returns %TRUE. + * + * Caller must *not* hold lock. + */ +static gboolean +has_object_been_unregistered (GDBusConnection *connection, + guint registration_id, + guint subtree_registration_id) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + + ret = FALSE; + + CONNECTION_LOCK (connection); + if (registration_id != 0 && g_hash_table_lookup (connection->map_id_to_ei, + GUINT_TO_POINTER (registration_id)) == NULL) + { + ret = TRUE; + } + else if (subtree_registration_id != 0 && g_hash_table_lookup (connection->map_id_to_es, + GUINT_TO_POINTER (subtree_registration_id)) == NULL) + { + ret = TRUE; + } + CONNECTION_UNLOCK (connection); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusConnection *connection; + GDBusMessage *message; + gpointer user_data; + const gchar *property_name; + const GDBusInterfaceVTable *vtable; + GDBusInterfaceInfo *interface_info; + const GDBusPropertyInfo *property_info; + guint registration_id; + guint subtree_registration_id; +} PropertyData; + +static void +property_data_free (PropertyData *data) +{ + g_object_unref (data->connection); + g_object_unref (data->message); + g_free (data); +} + +/* called in thread where object was registered - no locks held */ +static gboolean +invoke_get_property_in_idle_cb (gpointer _data) +{ + PropertyData *data = _data; + GVariant *value; + GError *error; + GDBusMessage *reply; + + if (has_object_been_unregistered (data->connection, + data->registration_id, + data->subtree_registration_id)) + { + reply = g_dbus_message_new_method_error (data->message, + "org.freedesktop.DBus.Error.UnknownMethod", + _("No such interface `org.freedesktop.DBus.Properties' on object at path %s"), + g_dbus_message_get_path (data->message)); + g_dbus_connection_send_message (data->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + goto out; + } + + error = NULL; + value = data->vtable->get_property (data->connection, + g_dbus_message_get_sender (data->message), + g_dbus_message_get_path (data->message), + data->interface_info->name, + data->property_name, + &error, + data->user_data); + + + if (value != NULL) + { + g_assert_no_error (error); + + if (g_variant_is_floating (value)) + g_variant_ref_sink (value); + reply = g_dbus_message_new_method_reply (data->message); + g_dbus_message_set_body (reply, g_variant_new ("(v)", value)); + g_dbus_connection_send_message (data->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_variant_unref (value); + g_object_unref (reply); + } + else + { + gchar *dbus_error_name; + g_assert (error != NULL); + dbus_error_name = g_dbus_error_encode_gerror (error); + reply = g_dbus_message_new_method_error_literal (data->message, + dbus_error_name, + error->message); + g_dbus_connection_send_message (data->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_free (dbus_error_name); + g_error_free (error); + g_object_unref (reply); + } + + out: + return FALSE; +} + +/* called in thread where object was registered - no locks held */ +static gboolean +invoke_set_property_in_idle_cb (gpointer _data) +{ + PropertyData *data = _data; + GError *error; + GDBusMessage *reply; + GVariant *value; + + error = NULL; + value = NULL; + + g_variant_get (g_dbus_message_get_body (data->message), + "(ssv)", + NULL, + NULL, + &value); + + /* Fail with org.freedesktop.DBus.Error.InvalidArgs if the type + * of the given value is wrong + */ + if (g_strcmp0 (g_variant_get_type_string (value), data->property_info->signature) != 0) + { + reply = g_dbus_message_new_method_error (data->message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("Error setting property `%s': Expected type `%s' but got `%s'"), + data->property_info->name, + data->property_info->signature, + g_variant_get_type_string (value)); + goto out; + } + + if (!data->vtable->set_property (data->connection, + g_dbus_message_get_sender (data->message), + g_dbus_message_get_path (data->message), + data->interface_info->name, + data->property_name, + value, + &error, + data->user_data)) + { + gchar *dbus_error_name; + g_assert (error != NULL); + dbus_error_name = g_dbus_error_encode_gerror (error); + reply = g_dbus_message_new_method_error_literal (data->message, + dbus_error_name, + error->message); + g_free (dbus_error_name); + g_error_free (error); + } + else + { + reply = g_dbus_message_new_method_reply (data->message); + } + + out: + g_assert (reply != NULL); + g_dbus_connection_send_message (data->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + g_variant_unref (value); + + return FALSE; +} + +/* called with lock held */ +static gboolean +validate_and_maybe_schedule_property_getset (GDBusConnection *connection, + GDBusMessage *message, + guint registration_id, + guint subtree_registration_id, + gboolean is_get, + GDBusInterfaceInfo *interface_info, + const GDBusInterfaceVTable *vtable, + GMainContext *main_context, + gpointer user_data) +{ + gboolean handled; + const char *interface_name; + const char *property_name; + const GDBusPropertyInfo *property_info; + GSource *idle_source; + PropertyData *property_data; + GDBusMessage *reply; + + handled = FALSE; + + if (is_get) + g_variant_get (g_dbus_message_get_body (message), + "(&s&s)", + &interface_name, + &property_name); + else + g_variant_get (g_dbus_message_get_body (message), + "(&s&sv)", + &interface_name, + &property_name, + NULL); + + + if (is_get) + { + if (vtable == NULL || vtable->get_property == NULL) + goto out; + } + else + { + if (vtable == NULL || vtable->set_property == NULL) + goto out; + } + + /* Check that the property exists - if not fail with org.freedesktop.DBus.Error.InvalidArgs + */ + property_info = NULL; + + /* TODO: the cost of this is O(n) - it might be worth caching the result */ + property_info = g_dbus_interface_info_lookup_property (interface_info, property_name); + if (property_info == NULL) + { + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("No such property `%s'"), + property_name); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + + if (is_get && !(property_info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)) + { + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("Property `%s' is not readable"), + property_name); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + else if (!is_get && !(property_info->flags & G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE)) + { + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("Property `%s' is not writable"), + property_name); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + + /* ok, got the property info - call user code in an idle handler */ + property_data = g_new0 (PropertyData, 1); + property_data->connection = g_object_ref (connection); + property_data->message = g_object_ref (message); + property_data->user_data = user_data; + property_data->property_name = property_name; + property_data->vtable = vtable; + property_data->interface_info = interface_info; + property_data->property_info = property_info; + property_data->registration_id = registration_id; + property_data->subtree_registration_id = subtree_registration_id; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + is_get ? invoke_get_property_in_idle_cb : invoke_set_property_in_idle_cb, + property_data, + (GDestroyNotify) property_data_free); + g_source_attach (idle_source, main_context); + g_source_unref (idle_source); + + handled = TRUE; + + out: + return handled; +} + +/* called with lock held */ +static gboolean +handle_getset_property (GDBusConnection *connection, + ExportedObject *eo, + GDBusMessage *message, + gboolean is_get) +{ + ExportedInterface *ei; + gboolean handled; + const char *interface_name; + const char *property_name; + + handled = FALSE; + + if (is_get) + g_variant_get (g_dbus_message_get_body (message), + "(&s&s)", + &interface_name, + &property_name); + else + g_variant_get (g_dbus_message_get_body (message), + "(&s&sv)", + &interface_name, + &property_name, + NULL); + + /* Fail with org.freedesktop.DBus.Error.InvalidArgs if there is + * no such interface registered + */ + ei = g_hash_table_lookup (eo->map_if_name_to_ei, interface_name); + if (ei == NULL) + { + GDBusMessage *reply; + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("No such interface `%s'"), + interface_name); + g_dbus_connection_send_message_unlocked (eo->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + + handled = validate_and_maybe_schedule_property_getset (eo->connection, + message, + ei->id, + 0, + is_get, + ei->interface_info, + ei->vtable, + ei->context, + ei->user_data); + out: + return handled; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusConnection *connection; + GDBusMessage *message; + gpointer user_data; + const GDBusInterfaceVTable *vtable; + GDBusInterfaceInfo *interface_info; + guint registration_id; + guint subtree_registration_id; +} PropertyGetAllData; + +static void +property_get_all_data_free (PropertyData *data) +{ + g_object_unref (data->connection); + g_object_unref (data->message); + g_free (data); +} + +/* called in thread where object was registered - no locks held */ +static gboolean +invoke_get_all_properties_in_idle_cb (gpointer _data) +{ + PropertyGetAllData *data = _data; + GVariantBuilder builder; + GError *error; + GDBusMessage *reply; + guint n; + + if (has_object_been_unregistered (data->connection, + data->registration_id, + data->subtree_registration_id)) + { + reply = g_dbus_message_new_method_error (data->message, + "org.freedesktop.DBus.Error.UnknownMethod", + _("No such interface `org.freedesktop.DBus.Properties' on object at path %s"), + g_dbus_message_get_path (data->message)); + g_dbus_connection_send_message (data->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + goto out; + } + + error = NULL; + + /* TODO: Right now we never fail this call - we just omit values if + * a get_property() call is failing. + * + * We could fail the whole call if just a single get_property() call + * returns an error. We need clarification in the D-Bus spec about this. + */ + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(a{sv})")); + g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); + for (n = 0; data->interface_info->properties != NULL && data->interface_info->properties[n] != NULL; n++) + { + const GDBusPropertyInfo *property_info = data->interface_info->properties[n]; + GVariant *value; + + if (!(property_info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)) + continue; + + value = data->vtable->get_property (data->connection, + g_dbus_message_get_sender (data->message), + g_dbus_message_get_path (data->message), + data->interface_info->name, + property_info->name, + NULL, + data->user_data); + + if (value == NULL) + continue; + + if (g_variant_is_floating (value)) + g_variant_ref_sink (value); + g_variant_builder_add (&builder, + "{sv}", + property_info->name, + value); + g_variant_unref (value); + } + g_variant_builder_close (&builder); + + reply = g_dbus_message_new_method_reply (data->message); + g_dbus_message_set_body (reply, g_variant_builder_end (&builder)); + g_dbus_connection_send_message (data->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + + out: + return FALSE; +} + +/* called with lock held */ +static gboolean +validate_and_maybe_schedule_property_get_all (GDBusConnection *connection, + GDBusMessage *message, + guint registration_id, + guint subtree_registration_id, + GDBusInterfaceInfo *interface_info, + const GDBusInterfaceVTable *vtable, + GMainContext *main_context, + gpointer user_data) +{ + gboolean handled; + const char *interface_name; + GSource *idle_source; + PropertyGetAllData *property_get_all_data; + + handled = FALSE; + + g_variant_get (g_dbus_message_get_body (message), + "(&s)", + &interface_name); + + if (vtable == NULL || vtable->get_property == NULL) + goto out; + + /* ok, got the property info - call user in an idle handler */ + property_get_all_data = g_new0 (PropertyGetAllData, 1); + property_get_all_data->connection = g_object_ref (connection); + property_get_all_data->message = g_object_ref (message); + property_get_all_data->user_data = user_data; + property_get_all_data->vtable = vtable; + property_get_all_data->interface_info = interface_info; + property_get_all_data->registration_id = registration_id; + property_get_all_data->subtree_registration_id = subtree_registration_id; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + invoke_get_all_properties_in_idle_cb, + property_get_all_data, + (GDestroyNotify) property_get_all_data_free); + g_source_attach (idle_source, main_context); + g_source_unref (idle_source); + + handled = TRUE; + + out: + return handled; +} + +/* called with lock held */ +static gboolean +handle_get_all_properties (GDBusConnection *connection, + ExportedObject *eo, + GDBusMessage *message) +{ + ExportedInterface *ei; + gboolean handled; + const char *interface_name; + + handled = FALSE; + + g_variant_get (g_dbus_message_get_body (message), + "(&s)", + &interface_name); + + /* Fail with org.freedesktop.DBus.Error.InvalidArgs if there is + * no such interface registered + */ + ei = g_hash_table_lookup (eo->map_if_name_to_ei, interface_name); + if (ei == NULL) + { + GDBusMessage *reply; + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("No such interface"), + interface_name); + g_dbus_connection_send_message_unlocked (eo->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + + handled = validate_and_maybe_schedule_property_get_all (eo->connection, + message, + ei->id, + 0, + ei->interface_info, + ei->vtable, + ei->context, + ei->user_data); + out: + return handled; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static const gchar introspect_header[] = + "\n" + "\n" + "\n"; + +static const gchar introspect_tail[] = + "\n"; + +static const gchar introspect_standard_interfaces[] = + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n"; + +static void +introspect_append_header (GString *s) +{ + g_string_append (s, introspect_header); +} + +static void +introspect_append_standard_interfaces (GString *s) +{ + g_string_append (s, introspect_standard_interfaces); +} + +static void +maybe_add_path (const gchar *path, gsize path_len, const gchar *object_path, GHashTable *set) +{ + if (g_str_has_prefix (object_path, path) && strlen (object_path) > path_len && object_path[path_len-1] == '/') + { + const gchar *begin; + const gchar *end; + gchar *s; + + begin = object_path + path_len; + end = strchr (begin, '/'); + if (end != NULL) + s = g_strndup (begin, end - begin); + else + s = g_strdup (begin); + + if (g_hash_table_lookup (set, s) == NULL) + g_hash_table_insert (set, s, GUINT_TO_POINTER (1)); + else + g_free (s); + } +} + +/* TODO: we want a nicer public interface for this */ +static gchar ** +g_dbus_connection_list_registered_unlocked (GDBusConnection *connection, + const gchar *path) +{ + GPtrArray *p; + gchar **ret; + GHashTableIter hash_iter; + const gchar *object_path; + gsize path_len; + GHashTable *set; + GList *keys; + GList *l; + + CONNECTION_ENSURE_LOCK (connection); + + path_len = strlen (path); + if (path_len > 1) + path_len++; + + set = g_hash_table_new (g_str_hash, g_str_equal); + + g_hash_table_iter_init (&hash_iter, connection->map_object_path_to_eo); + while (g_hash_table_iter_next (&hash_iter, (gpointer) &object_path, NULL)) + maybe_add_path (path, path_len, object_path, set); + + g_hash_table_iter_init (&hash_iter, connection->map_object_path_to_es); + while (g_hash_table_iter_next (&hash_iter, (gpointer) &object_path, NULL)) + maybe_add_path (path, path_len, object_path, set); + + p = g_ptr_array_new (); + keys = g_hash_table_get_keys (set); + for (l = keys; l != NULL; l = l->next) + g_ptr_array_add (p, l->data); + g_hash_table_unref (set); + g_list_free (keys); + + g_ptr_array_add (p, NULL); + ret = (gchar **) g_ptr_array_free (p, FALSE); + return ret; +} + +static gchar ** +g_dbus_connection_list_registered (GDBusConnection *connection, + const gchar *path) +{ + gchar **ret; + CONNECTION_LOCK (connection); + ret = g_dbus_connection_list_registered_unlocked (connection, path); + CONNECTION_UNLOCK (connection); + return ret; +} + +/* called in message handler thread with lock held */ +static gboolean +handle_introspect (GDBusConnection *connection, + ExportedObject *eo, + GDBusMessage *message) +{ + guint n; + GString *s; + GDBusMessage *reply; + GHashTableIter hash_iter; + ExportedInterface *ei; + gchar **registered; + + /* first the header with the standard interfaces */ + s = g_string_sized_new (sizeof (introspect_header) + + sizeof (introspect_standard_interfaces) + + sizeof (introspect_tail)); + introspect_append_header (s); + introspect_append_standard_interfaces (s); + + /* then include the registered interfaces */ + g_hash_table_iter_init (&hash_iter, eo->map_if_name_to_ei); + while (g_hash_table_iter_next (&hash_iter, NULL, (gpointer) &ei)) + g_dbus_interface_info_generate_xml (ei->interface_info, 2, s); + + /* finally include nodes registered below us */ + registered = g_dbus_connection_list_registered_unlocked (connection, eo->object_path); + for (n = 0; registered != NULL && registered[n] != NULL; n++) + g_string_append_printf (s, " \n", registered[n]); + g_strfreev (registered); + g_string_append (s, introspect_tail); + + reply = g_dbus_message_new_method_reply (message); + g_dbus_message_set_body (reply, g_variant_new ("(s)", s->str)); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + g_string_free (s, TRUE); + + return TRUE; +} + +/* called in thread where object was registered - no locks held */ +static gboolean +call_in_idle_cb (gpointer user_data) +{ + GDBusMethodInvocation *invocation = G_DBUS_METHOD_INVOCATION (user_data); + GDBusInterfaceVTable *vtable; + guint registration_id; + guint subtree_registration_id; + + vtable = g_object_get_data (G_OBJECT (invocation), "g-dbus-interface-vtable"); + g_assert (vtable != NULL && vtable->method_call != NULL); + + registration_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (invocation), "g-dbus-registration-id")); + subtree_registration_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (invocation), "g-dbus-subtree-registration-id")); + + if (has_object_been_unregistered (g_dbus_method_invocation_get_connection (invocation), + registration_id, + subtree_registration_id)) + { + GDBusMessage *reply; + reply = g_dbus_message_new_method_error (g_dbus_method_invocation_get_message (invocation), + "org.freedesktop.DBus.Error.UnknownMethod", + _("No such interface `%s' on object at path %s"), + g_dbus_method_invocation_get_interface_name (invocation), + g_dbus_method_invocation_get_object_path (invocation)); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + goto out; + } + + vtable->method_call (g_dbus_method_invocation_get_connection (invocation), + g_dbus_method_invocation_get_sender (invocation), + g_dbus_method_invocation_get_object_path (invocation), + g_dbus_method_invocation_get_interface_name (invocation), + g_dbus_method_invocation_get_method_name (invocation), + g_dbus_method_invocation_get_parameters (invocation), + g_object_ref (invocation), + g_dbus_method_invocation_get_user_data (invocation)); + + out: + return FALSE; +} + +/* called in message handler thread with lock held */ +static gboolean +validate_and_maybe_schedule_method_call (GDBusConnection *connection, + GDBusMessage *message, + guint registration_id, + guint subtree_registration_id, + GDBusInterfaceInfo *interface_info, + const GDBusInterfaceVTable *vtable, + GMainContext *main_context, + gpointer user_data) +{ + GDBusMethodInvocation *invocation; + const GDBusMethodInfo *method_info; + GDBusMessage *reply; + GVariant *parameters; + GSource *idle_source; + gboolean handled; + GVariantType *in_type; + + handled = FALSE; + + /* TODO: the cost of this is O(n) - it might be worth caching the result */ + method_info = g_dbus_interface_info_lookup_method (interface_info, g_dbus_message_get_member (message)); + + /* if the method doesn't exist, return the org.freedesktop.DBus.Error.UnknownMethod + * error to the caller + */ + if (method_info == NULL) + { + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.UnknownMethod", + _("No such method `%s'"), + g_dbus_message_get_member (message)); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + + parameters = g_dbus_message_get_body (message); + if (parameters == NULL) + { + parameters = g_variant_new ("()"); + g_variant_ref_sink (parameters); + } + else + { + g_variant_ref (parameters); + } + + /* Check that the incoming args are of the right type - if they are not, return + * the org.freedesktop.DBus.Error.InvalidArgs error to the caller + */ + in_type = _g_dbus_compute_complete_signature (method_info->in_args); + if (!g_variant_is_of_type (parameters, in_type)) + { + gchar *type_string; + + type_string = g_variant_type_dup_string (in_type); + + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("Type of message, `%s', does not match expected type `%s'"), + g_variant_get_type_string (parameters), + type_string); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_variant_type_free (in_type); + g_variant_unref (parameters); + g_object_unref (reply); + g_free (type_string); + handled = TRUE; + goto out; + } + g_variant_type_free (in_type); + + /* schedule the call in idle */ + invocation = _g_dbus_method_invocation_new (g_dbus_message_get_sender (message), + g_dbus_message_get_path (message), + g_dbus_message_get_interface (message), + g_dbus_message_get_member (message), + method_info, + connection, + message, + parameters, + user_data); + g_variant_unref (parameters); + + /* TODO: would be nicer with a real MethodData like we already + * have PropertyData and PropertyGetAllData... */ + g_object_set_data (G_OBJECT (invocation), "g-dbus-interface-vtable", (gpointer) vtable); + g_object_set_data (G_OBJECT (invocation), "g-dbus-registration-id", GUINT_TO_POINTER (registration_id)); + g_object_set_data (G_OBJECT (invocation), "g-dbus-subtree-registration-id", GUINT_TO_POINTER (subtree_registration_id)); + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + call_in_idle_cb, + invocation, + g_object_unref); + g_source_attach (idle_source, main_context); + g_source_unref (idle_source); + + handled = TRUE; + + out: + return handled; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* called in message handler thread with lock held */ +static gboolean +obj_message_func (GDBusConnection *connection, + ExportedObject *eo, + GDBusMessage *message) +{ + const gchar *interface_name; + const gchar *member; + const gchar *signature; + gboolean handled; + + handled = FALSE; + + interface_name = g_dbus_message_get_interface (message); + member = g_dbus_message_get_member (message); + signature = g_dbus_message_get_signature (message); + + /* see if we have an interface for handling this call */ + if (interface_name != NULL) + { + ExportedInterface *ei; + ei = g_hash_table_lookup (eo->map_if_name_to_ei, interface_name); + if (ei != NULL) + { + /* we do - invoke the handler in idle in the right thread */ + + /* handle no vtable or handler being present */ + if (ei->vtable == NULL || ei->vtable->method_call == NULL) + goto out; + + handled = validate_and_maybe_schedule_method_call (connection, + message, + ei->id, + 0, + ei->interface_info, + ei->vtable, + ei->context, + ei->user_data); + goto out; + } + } + + if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Introspectable") == 0 && + g_strcmp0 (member, "Introspect") == 0 && + g_strcmp0 (signature, "") == 0) + { + handled = handle_introspect (connection, eo, message); + goto out; + } + else if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Properties") == 0 && + g_strcmp0 (member, "Get") == 0 && + g_strcmp0 (signature, "ss") == 0) + { + handled = handle_getset_property (connection, eo, message, TRUE); + goto out; + } + else if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Properties") == 0 && + g_strcmp0 (member, "Set") == 0 && + g_strcmp0 (signature, "ssv") == 0) + { + handled = handle_getset_property (connection, eo, message, FALSE); + goto out; + } + else if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Properties") == 0 && + g_strcmp0 (member, "GetAll") == 0 && + g_strcmp0 (signature, "s") == 0) + { + handled = handle_get_all_properties (connection, eo, message); + goto out; + } + + out: + return handled; +} + +/** + * g_dbus_connection_register_object: + * @connection: A #GDBusConnection. + * @object_path: The object path to register at. + * @interface_info: Introspection data for the interface. + * @vtable: A #GDBusInterfaceVTable to call into or %NULL. + * @user_data: Data to pass to functions in @vtable. + * @user_data_free_func: Function to call when the object path is unregistered. + * @error: Return location for error or %NULL. + * + * Registers callbacks for exported objects at @object_path with the + * D-Bus interface that is described in @interface_info. + * + * Calls to functions in @vtable (and @user_data_free_func) will + * happen in the thread-default main + * loop of the thread you are calling this method from. + * + * Note that all #GVariant values passed to functions in @vtable will match + * the signature given in @interface_info - if a remote caller passes + * incorrect values, the org.freedesktop.DBus.Error.InvalidArgs + * is returned to the remote caller. + * + * Additionally, if the remote caller attempts to invoke methods or + * access properties not mentioned in @interface_info the + * org.freedesktop.DBus.Error.UnknownMethod resp. + * org.freedesktop.DBus.Error.InvalidArgs errors + * are returned to the caller. + * + * It is considered a programming error if the + * #GDBusInterfaceGetPropertyFunc function in @vtable returns a + * #GVariant of incorrect type. + * + * If an existing callback is already registered at @object_path and + * @interface_name, then @error is set to #G_IO_ERROR_EXISTS. + * + * GDBus automatically implements the standard D-Bus interfaces + * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable + * and org.freedesktop.Peer, so you don't have to implement those for + * the objects you export. You can implement + * org.freedesktop.DBus.Properties yourself, e.g. to handle getting + * and setting of properties asynchronously. + * + * Note that the reference count on @interface_info will be + * incremented by 1 (unless allocated statically, e.g. if the + * reference count is -1, see g_dbus_interface_info_ref()) for as long + * as the object is exported. Also note that @vtable will be copied. + * + * See for an example of how to use this method. + * + * Returns: 0 if @error is set, otherwise a registration id (never 0) + * that can be used with g_dbus_connection_unregister_object() . + * + * Since: 2.26 + */ +guint +g_dbus_connection_register_object (GDBusConnection *connection, + const gchar *object_path, + GDBusInterfaceInfo *interface_info, + const GDBusInterfaceVTable *vtable, + gpointer user_data, + GDestroyNotify user_data_free_func, + GError **error) +{ + ExportedObject *eo; + ExportedInterface *ei; + guint ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0); + g_return_val_if_fail (object_path != NULL && g_variant_is_object_path (object_path), 0); + g_return_val_if_fail (interface_info != NULL, 0); + g_return_val_if_fail (g_dbus_is_interface_name (interface_info->name), 0); + g_return_val_if_fail (error == NULL || *error == NULL, 0); + + ret = 0; + + CONNECTION_LOCK (connection); + + eo = g_hash_table_lookup (connection->map_object_path_to_eo, object_path); + if (eo == NULL) + { + eo = g_new0 (ExportedObject, 1); + eo->object_path = g_strdup (object_path); + eo->connection = connection; + eo->map_if_name_to_ei = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, + (GDestroyNotify) exported_interface_free); + g_hash_table_insert (connection->map_object_path_to_eo, eo->object_path, eo); + } + + ei = g_hash_table_lookup (eo->map_if_name_to_ei, interface_info->name); + if (ei != NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_EXISTS, + _("An object is already exported for the interface %s at %s"), + interface_info->name, + object_path); + goto out; + } + + ei = g_new0 (ExportedInterface, 1); + ei->id = _global_registration_id++; /* TODO: overflow etc. */ + ei->eo = eo; + ei->user_data = user_data; + ei->user_data_free_func = user_data_free_func; + ei->vtable = _g_dbus_interface_vtable_copy (vtable); + ei->interface_info = g_dbus_interface_info_ref (interface_info); + ei->interface_name = g_strdup (interface_info->name); + ei->context = g_main_context_get_thread_default (); + if (ei->context != NULL) + g_main_context_ref (ei->context); + + g_hash_table_insert (eo->map_if_name_to_ei, + (gpointer) ei->interface_name, + ei); + g_hash_table_insert (connection->map_id_to_ei, + GUINT_TO_POINTER (ei->id), + ei); + + ret = ei->id; + + out: + CONNECTION_UNLOCK (connection); + + return ret; +} + +/** + * g_dbus_connection_unregister_object: + * @connection: A #GDBusConnection. + * @registration_id: A registration id obtained from g_dbus_connection_register_object(). + * + * Unregisters an object. + * + * Returns: %TRUE if the object was unregistered, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_unregister_object (GDBusConnection *connection, + guint registration_id) +{ + ExportedInterface *ei; + ExportedObject *eo; + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + + ret = FALSE; + + CONNECTION_LOCK (connection); + + ei = g_hash_table_lookup (connection->map_id_to_ei, + GUINT_TO_POINTER (registration_id)); + if (ei == NULL) + goto out; + + eo = ei->eo; + + g_warn_if_fail (g_hash_table_remove (connection->map_id_to_ei, GUINT_TO_POINTER (ei->id))); + g_warn_if_fail (g_hash_table_remove (eo->map_if_name_to_ei, ei->interface_name)); + /* unregister object path if we have no more exported interfaces */ + if (g_hash_table_size (eo->map_if_name_to_ei) == 0) + g_warn_if_fail (g_hash_table_remove (connection->map_object_path_to_eo, + eo->object_path)); + + ret = TRUE; + + out: + CONNECTION_UNLOCK (connection); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_emit_signal: + * @connection: A #GDBusConnection. + * @destination_bus_name: The unique bus name for the destination for the signal or %NULL to emit to all listeners. + * @object_path: Path of remote object. + * @interface_name: D-Bus interface to emit a signal on. + * @signal_name: The name of the signal to emit. + * @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters. + * @error: Return location for error or %NULL. + * + * Emits a signal. + * + * If the parameters GVariant is floating, it is consumed. + * + * This can only fail if @parameters is not compatible with the D-Bus protocol. + * + * Returns: %TRUE unless @error is set. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_emit_signal (GDBusConnection *connection, + const gchar *destination_bus_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + GError **error) +{ + GDBusMessage *message; + gboolean ret; + + message = NULL; + ret = FALSE; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + g_return_val_if_fail (destination_bus_name == NULL || g_dbus_is_name (destination_bus_name), FALSE); + g_return_val_if_fail (object_path != NULL && g_variant_is_object_path (object_path), FALSE); + g_return_val_if_fail (interface_name != NULL && g_dbus_is_interface_name (interface_name), FALSE); + g_return_val_if_fail (signal_name != NULL && g_dbus_is_member_name (signal_name), FALSE); + g_return_val_if_fail (parameters == NULL || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE), FALSE); + + if (G_UNLIKELY (_g_dbus_debug_emission ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Emission:\n" + " >>>> SIGNAL EMISSION %s.%s()\n" + " on object %s\n" + " destination %s\n", + interface_name, signal_name, + object_path, + destination_bus_name != NULL ? destination_bus_name : "(none)"); + _g_dbus_debug_print_unlock (); + } + + message = g_dbus_message_new_signal (object_path, + interface_name, + signal_name); + + if (destination_bus_name != NULL) + g_dbus_message_set_header (message, + G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION, + g_variant_new_string (destination_bus_name)); + + if (parameters != NULL) + g_dbus_message_set_body (message, parameters); + + ret = g_dbus_connection_send_message (connection, message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, error); + g_object_unref (message); + + return ret; +} + +static void +add_call_flags (GDBusMessage *message, + GDBusCallFlags flags) +{ + if (flags & G_DBUS_CALL_FLAGS_NO_AUTO_START) + g_dbus_message_set_flags (message, G_DBUS_MESSAGE_FLAGS_NO_AUTO_START); +} + +static GVariant * +decode_method_reply (GDBusMessage *reply, + const gchar *method_name, + const GVariantType *reply_type, + GError **error) +{ + GVariant *result; + + result = NULL; + switch (g_dbus_message_get_message_type (reply)) + { + case G_DBUS_MESSAGE_TYPE_METHOD_RETURN: + result = g_dbus_message_get_body (reply); + if (result == NULL) + { + result = g_variant_new ("()"); + g_variant_ref_sink (result); + } + else + { + g_variant_ref (result); + } + + if (!g_variant_is_of_type (result, reply_type)) + { + gchar *type_string = g_variant_type_dup_string (reply_type); + + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Method `%s' returned type `%s', but expected `%s'"), + method_name, g_variant_get_type_string (result), type_string); + + g_variant_unref (result); + g_free (type_string); + result = NULL; + } + break; + + case G_DBUS_MESSAGE_TYPE_ERROR: + g_dbus_message_to_gerror (reply, error); + break; + + default: + g_assert_not_reached (); + break; + } + + return result; +} + + +typedef struct +{ + GSimpleAsyncResult *simple; + GVariantType *reply_type; + gchar *method_name; /* for error message */ + guint32 serial; +} CallState; + +static void +g_dbus_connection_call_done (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (source); + CallState *state = user_data; + GError *error; + GDBusMessage *reply; + GVariant *value; + + error = NULL; + reply = g_dbus_connection_send_message_with_reply_finish (connection, + result, + &error); + + if (G_UNLIKELY (_g_dbus_debug_call ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Call:\n" + " <<<< ASYNC COMPLETE %s() (serial %d)\n" + " ", + state->method_name, + state->serial); + if (reply != NULL) + { + g_print ("SUCCESS\n"); + } + else + { + g_print ("FAILED: %s\n", + error->message); + } + _g_dbus_debug_print_unlock (); + } + + + if (reply != NULL) + { + value = decode_method_reply (reply, state->method_name, + state->reply_type, &error); + g_object_unref (reply); + } + else + value = NULL; + + if (value == NULL) + g_simple_async_result_take_error (state->simple, error); + else + g_simple_async_result_set_op_res_gpointer (state->simple, value, + (GDestroyNotify) g_variant_unref); + + g_simple_async_result_complete (state->simple); + g_variant_type_free (state->reply_type); + g_object_unref (state->simple); + g_free (state->method_name); + + g_slice_free (CallState, state); +} + +/** + * g_dbus_connection_call: + * @connection: A #GDBusConnection. + * @bus_name: A unique or well-known bus name or %NULL if @connection is not a message bus connection. + * @object_path: Path of remote object. + * @interface_name: D-Bus interface to invoke method on. + * @method_name: The name of the method to invoke. + * @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters. + * @reply_type: The expected type of the reply, or %NULL. + * @flags: Flags from the #GDBusCallFlags enumeration. + * @timeout_msec: The timeout in milliseconds, -1 to use the default + * timeout or %G_MAXINT for no timeout. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't + * care about the result of the method invocation. + * @user_data: The data to pass to @callback. + * + * Asynchronously invokes the @method_name method on the + * @interface_name D-Bus interface on the remote object at + * @object_path owned by @bus_name. + * + * If @connection is closed then the operation will fail with + * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will + * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value + * not compatible with the D-Bus protocol, the operation fails with + * %G_IO_ERROR_INVALID_ARGUMENT. + * + * If @reply_type is non-%NULL then the reply will be checked for having this type and an + * error will be raised if it does not match. Said another way, if you give a @reply_type + * then any non-%NULL return value will be of this type. + * + * If the @parameters #GVariant is floating, it is consumed. This allows + * convenient 'inline' use of g_variant_new(), e.g.: + * |[ + * g_dbus_connection_call (connection, + * "org.freedesktop.StringThings", + * "/org/freedesktop/StringThings", + * "org.freedesktop.StringThings", + * "TwoStrings", + * g_variant_new ("(ss)", + * "Thing One", + * "Thing Two"), + * NULL, + * G_DBUS_CALL_FLAGS_NONE, + * -1, + * NULL, + * (GAsyncReadyCallback) two_strings_done, + * NULL); + * ]| + * + * This is an asynchronous method. When the operation is finished, @callback will be invoked + * in the thread-default main loop + * of the thread you are calling this method from. You can then call + * g_dbus_connection_call_finish() to get the result of the operation. + * See g_dbus_connection_call_sync() for the synchronous version of this + * function. + * + * Since: 2.26 + */ +void +g_dbus_connection_call (GDBusConnection *connection, + const gchar *bus_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + const GVariantType *reply_type, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GDBusMessage *message; + CallState *state; + + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + g_return_if_fail (bus_name == NULL || g_dbus_is_name (bus_name)); + g_return_if_fail (object_path != NULL && g_variant_is_object_path (object_path)); + g_return_if_fail (interface_name != NULL && g_dbus_is_interface_name (interface_name)); + g_return_if_fail (method_name != NULL && g_dbus_is_member_name (method_name)); + g_return_if_fail (timeout_msec >= 0 || timeout_msec == -1); + g_return_if_fail ((parameters == NULL) || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE)); + + state = g_slice_new (CallState); + state->simple = g_simple_async_result_new (G_OBJECT (connection), + callback, user_data, + g_dbus_connection_call); + state->method_name = g_strjoin (".", interface_name, method_name, NULL); + + if (reply_type == NULL) + reply_type = G_VARIANT_TYPE_ANY; + + state->reply_type = g_variant_type_copy (reply_type); + + message = g_dbus_message_new_method_call (bus_name, + object_path, + interface_name, + method_name); + add_call_flags (message, flags); + if (parameters != NULL) + g_dbus_message_set_body (message, parameters); + + g_dbus_connection_send_message_with_reply (connection, + message, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + timeout_msec, + &state->serial, + cancellable, + g_dbus_connection_call_done, + state); + + if (G_UNLIKELY (_g_dbus_debug_call ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Call:\n" + " >>>> ASYNC %s.%s()\n" + " on object %s\n" + " owned by name %s (serial %d)\n", + interface_name, + method_name, + object_path, + bus_name != NULL ? bus_name : "(none)", + state->serial); + _g_dbus_debug_print_unlock (); + } + + if (message != NULL) + g_object_unref (message); +} + +/** + * g_dbus_connection_call_finish: + * @connection: A #GDBusConnection. + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_connection_call(). + * + * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with + * return values. Free with g_variant_unref(). + * + * Since: 2.26 + */ +GVariant * +g_dbus_connection_call_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error) +{ + GSimpleAsyncResult *simple; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (connection), + g_dbus_connection_call), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + simple = G_SIMPLE_ASYNC_RESULT (res); + + if (g_simple_async_result_propagate_error (simple, error)) + return NULL; + + return g_variant_ref (g_simple_async_result_get_op_res_gpointer (simple)); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_call_sync: + * @connection: A #GDBusConnection. + * @bus_name: A unique or well-known bus name. + * @object_path: Path of remote object. + * @interface_name: D-Bus interface to invoke method on. + * @method_name: The name of the method to invoke. + * @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters. + * @reply_type: The expected type of the reply, or %NULL. + * @flags: Flags from the #GDBusCallFlags enumeration. + * @timeout_msec: The timeout in milliseconds, -1 to use the default + * timeout or %G_MAXINT for no timeout. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the @method_name method on the + * @interface_name D-Bus interface on the remote object at + * @object_path owned by @bus_name. + * + * If @connection is closed then the operation will fail with + * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the + * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters + * contains a value not compatible with the D-Bus protocol, the operation + * fails with %G_IO_ERROR_INVALID_ARGUMENT. + + * If @reply_type is non-%NULL then the reply will be checked for having + * this type and an error will be raised if it does not match. Said + * another way, if you give a @reply_type then any non-%NULL return + * value will be of this type. + * + * If the @parameters #GVariant is floating, it is consumed. + * This allows convenient 'inline' use of g_variant_new(), e.g.: + * |[ + * g_dbus_connection_call_sync (connection, + * "org.freedesktop.StringThings", + * "/org/freedesktop/StringThings", + * "org.freedesktop.StringThings", + * "TwoStrings", + * g_variant_new ("(ss)", + * "Thing One", + * "Thing Two"), + * NULL, + * G_DBUS_CALL_FLAGS_NONE, + * -1, + * NULL, + * &error); + * ]| + * + * The calling thread is blocked until a reply is received. See + * g_dbus_connection_call() for the asynchronous version of + * this method. + * + * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with + * return values. Free with g_variant_unref(). + * + * Since: 2.26 + */ +GVariant * +g_dbus_connection_call_sync (GDBusConnection *connection, + const gchar *bus_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + const GVariantType *reply_type, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GError **error) +{ + GDBusMessage *message; + GDBusMessage *reply; + GVariant *result; + GError *local_error; + + message = NULL; + reply = NULL; + result = NULL; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (bus_name == NULL || g_dbus_is_name (bus_name), NULL); + g_return_val_if_fail (object_path != NULL && g_variant_is_object_path (object_path), NULL); + g_return_val_if_fail (interface_name != NULL && g_dbus_is_interface_name (interface_name), NULL); + g_return_val_if_fail (method_name != NULL && g_dbus_is_member_name (method_name), NULL); + g_return_val_if_fail (timeout_msec >= 0 || timeout_msec == -1, NULL); + g_return_val_if_fail ((parameters == NULL) || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE), NULL); + + if (reply_type == NULL) + reply_type = G_VARIANT_TYPE_ANY; + + message = g_dbus_message_new_method_call (bus_name, + object_path, + interface_name, + method_name); + add_call_flags (message, flags); + if (parameters != NULL) + g_dbus_message_set_body (message, parameters); + + if (G_UNLIKELY (_g_dbus_debug_call ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Call:\n" + " >>>> SYNC %s.%s()\n" + " on object %s\n" + " owned by name %s\n", + interface_name, + method_name, + object_path, + bus_name != NULL ? bus_name : "(none)"); + _g_dbus_debug_print_unlock (); + } + + local_error = NULL; + reply = g_dbus_connection_send_message_with_reply_sync (connection, + message, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + timeout_msec, + NULL, /* volatile guint32 *out_serial */ + cancellable, + &local_error); + + if (G_UNLIKELY (_g_dbus_debug_call ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Call:\n" + " <<<< SYNC COMPLETE %s.%s()\n" + " ", + interface_name, + method_name); + if (reply != NULL) + { + g_print ("SUCCESS\n"); + } + else + { + g_print ("FAILED: %s\n", + local_error->message); + } + _g_dbus_debug_print_unlock (); + } + + if (reply == NULL) + { + if (error != NULL) + *error = local_error; + else + g_error_free (local_error); + goto out; + } + + result = decode_method_reply (reply, method_name, reply_type, error); + + out: + if (message != NULL) + g_object_unref (message); + if (reply != NULL) + g_object_unref (reply); + + return result; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +struct ExportedSubtree +{ + guint id; + gchar *object_path; + GDBusConnection *connection; + GDBusSubtreeVTable *vtable; + GDBusSubtreeFlags flags; + + GMainContext *context; + gpointer user_data; + GDestroyNotify user_data_free_func; +}; + +static void +exported_subtree_free (ExportedSubtree *es) +{ + call_destroy_notify (es->context, + es->user_data_free_func, + es->user_data); + + if (es->context != NULL) + g_main_context_unref (es->context); + + _g_dbus_subtree_vtable_free (es->vtable); + g_free (es->object_path); + g_free (es); +} + +/* called without lock held */ +static gboolean +handle_subtree_introspect (GDBusConnection *connection, + ExportedSubtree *es, + GDBusMessage *message) +{ + GString *s; + gboolean handled; + GDBusMessage *reply; + gchar **children; + gboolean is_root; + const gchar *sender; + const gchar *requested_object_path; + const gchar *requested_node; + GDBusInterfaceInfo **interfaces; + guint n; + gchar **subnode_paths; + + handled = FALSE; + + requested_object_path = g_dbus_message_get_path (message); + sender = g_dbus_message_get_sender (message); + is_root = (g_strcmp0 (requested_object_path, es->object_path) == 0); + + s = g_string_new (NULL); + introspect_append_header (s); + + /* Strictly we don't need the children in dynamic mode, but we avoid the + * conditionals to preserve code clarity + */ + children = es->vtable->enumerate (es->connection, + sender, + es->object_path, + es->user_data); + + if (!is_root) + { + requested_node = strrchr (requested_object_path, '/') + 1; + + /* Assert existence of object if we are not dynamic */ + if (!(es->flags & G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES) && + !_g_strv_has_string ((const gchar * const *) children, requested_node)) + goto out; + } + else + { + requested_node = NULL; + } + + interfaces = es->vtable->introspect (es->connection, + sender, + es->object_path, + requested_node, + es->user_data); + if (interfaces != NULL) + { + introspect_append_standard_interfaces (s); + + for (n = 0; interfaces[n] != NULL; n++) + { + g_dbus_interface_info_generate_xml (interfaces[n], 2, s); + g_dbus_interface_info_unref (interfaces[n]); + } + g_free (interfaces); + } + + /* then include entries from the Subtree for the root */ + if (is_root) + { + for (n = 0; children != NULL && children[n] != NULL; n++) + g_string_append_printf (s, " \n", children[n]); + } + + /* finally include nodes registered below us */ + subnode_paths = g_dbus_connection_list_registered (es->connection, requested_object_path); + for (n = 0; subnode_paths != NULL && subnode_paths[n] != NULL; n++) + g_string_append_printf (s, " \n", subnode_paths[n]); + g_strfreev (subnode_paths); + + g_string_append (s, "\n"); + + reply = g_dbus_message_new_method_reply (message); + g_dbus_message_set_body (reply, g_variant_new ("(s)", s->str)); + g_dbus_connection_send_message (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + + handled = TRUE; + + out: + g_string_free (s, TRUE); + g_strfreev (children); + return handled; +} + +/* called without lock held */ +static gboolean +handle_subtree_method_invocation (GDBusConnection *connection, + ExportedSubtree *es, + GDBusMessage *message) +{ + gboolean handled; + const gchar *sender; + const gchar *interface_name; + const gchar *member; + const gchar *signature; + const gchar *requested_object_path; + const gchar *requested_node; + gboolean is_root; + GDBusInterfaceInfo *interface_info; + const GDBusInterfaceVTable *interface_vtable; + gpointer interface_user_data; + guint n; + GDBusInterfaceInfo **interfaces; + gboolean is_property_get; + gboolean is_property_set; + gboolean is_property_get_all; + + handled = FALSE; + interfaces = NULL; + + requested_object_path = g_dbus_message_get_path (message); + sender = g_dbus_message_get_sender (message); + interface_name = g_dbus_message_get_interface (message); + member = g_dbus_message_get_member (message); + signature = g_dbus_message_get_signature (message); + is_root = (g_strcmp0 (requested_object_path, es->object_path) == 0); + + is_property_get = FALSE; + is_property_set = FALSE; + is_property_get_all = FALSE; + if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Properties") == 0) + { + if (g_strcmp0 (member, "Get") == 0 && g_strcmp0 (signature, "ss") == 0) + is_property_get = TRUE; + else if (g_strcmp0 (member, "Set") == 0 && g_strcmp0 (signature, "ssv") == 0) + is_property_set = TRUE; + else if (g_strcmp0 (member, "GetAll") == 0 && g_strcmp0 (signature, "s") == 0) + is_property_get_all = TRUE; + } + + if (!is_root) + { + requested_node = strrchr (requested_object_path, '/') + 1; + + if (~es->flags & G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES) + { + /* We don't want to dispatch to unenumerated + * nodes, so ensure that the child exists. + */ + gchar **children; + gboolean exists; + + children = es->vtable->enumerate (es->connection, + sender, + es->object_path, + es->user_data); + + exists = _g_strv_has_string ((const gchar * const *) children, requested_node); + g_strfreev (children); + + if (!exists) + goto out; + } + } + else + { + requested_node = NULL; + } + + /* get introspection data for the node */ + interfaces = es->vtable->introspect (es->connection, + sender, + requested_object_path, + requested_node, + es->user_data); + + if (interfaces == NULL) + goto out; + + interface_info = NULL; + for (n = 0; interfaces[n] != NULL; n++) + { + if (g_strcmp0 (interfaces[n]->name, interface_name) == 0) + interface_info = interfaces[n]; + } + + /* dispatch the call if the user wants to handle it */ + if (interface_info != NULL) + { + /* figure out where to dispatch the method call */ + interface_user_data = NULL; + interface_vtable = es->vtable->dispatch (es->connection, + sender, + es->object_path, + interface_name, + requested_node, + &interface_user_data, + es->user_data); + if (interface_vtable == NULL) + goto out; + + CONNECTION_LOCK (connection); + handled = validate_and_maybe_schedule_method_call (es->connection, + message, + 0, + es->id, + interface_info, + interface_vtable, + es->context, + interface_user_data); + CONNECTION_UNLOCK (connection); + } + /* handle org.freedesktop.DBus.Properties interface if not explicitly handled */ + else if (is_property_get || is_property_set || is_property_get_all) + { + if (is_property_get) + g_variant_get (g_dbus_message_get_body (message), "(&s&s)", &interface_name, NULL); + else if (is_property_set) + g_variant_get (g_dbus_message_get_body (message), "(&s&sv)", &interface_name, NULL, NULL); + else if (is_property_get_all) + g_variant_get (g_dbus_message_get_body (message), "(&s)", &interface_name, NULL, NULL); + else + g_assert_not_reached (); + + /* see if the object supports this interface at all */ + for (n = 0; interfaces[n] != NULL; n++) + { + if (g_strcmp0 (interfaces[n]->name, interface_name) == 0) + interface_info = interfaces[n]; + } + + /* Fail with org.freedesktop.DBus.Error.InvalidArgs if the user-code + * claims it won't support the interface + */ + if (interface_info == NULL) + { + GDBusMessage *reply; + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.InvalidArgs", + _("No such interface `%s'"), + interface_name); + g_dbus_connection_send_message (es->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + handled = TRUE; + goto out; + } + + /* figure out where to dispatch the property get/set/getall calls */ + interface_user_data = NULL; + interface_vtable = es->vtable->dispatch (es->connection, + sender, + es->object_path, + interface_name, + requested_node, + &interface_user_data, + es->user_data); + if (interface_vtable == NULL) + { + g_warning ("The subtree introspection function indicates that '%s' " + "is a valid interface name, but calling the dispatch " + "function on that interface gave us NULL", interface_name); + goto out; + } + + if (is_property_get || is_property_set) + { + CONNECTION_LOCK (connection); + handled = validate_and_maybe_schedule_property_getset (es->connection, + message, + 0, + es->id, + is_property_get, + interface_info, + interface_vtable, + es->context, + interface_user_data); + CONNECTION_UNLOCK (connection); + } + else if (is_property_get_all) + { + CONNECTION_LOCK (connection); + handled = validate_and_maybe_schedule_property_get_all (es->connection, + message, + 0, + es->id, + interface_info, + interface_vtable, + es->context, + interface_user_data); + CONNECTION_UNLOCK (connection); + } + } + + out: + if (interfaces != NULL) + { + for (n = 0; interfaces[n] != NULL; n++) + g_dbus_interface_info_unref (interfaces[n]); + g_free (interfaces); + } + + return handled; +} + +typedef struct +{ + GDBusMessage *message; + ExportedSubtree *es; +} SubtreeDeferredData; + +static void +subtree_deferred_data_free (SubtreeDeferredData *data) +{ + g_object_unref (data->message); + g_free (data); +} + +/* called without lock held in the thread where the caller registered the subtree */ +static gboolean +process_subtree_vtable_message_in_idle_cb (gpointer _data) +{ + SubtreeDeferredData *data = _data; + gboolean handled; + + handled = FALSE; + + if (g_strcmp0 (g_dbus_message_get_interface (data->message), "org.freedesktop.DBus.Introspectable") == 0 && + g_strcmp0 (g_dbus_message_get_member (data->message), "Introspect") == 0 && + g_strcmp0 (g_dbus_message_get_signature (data->message), "") == 0) + handled = handle_subtree_introspect (data->es->connection, + data->es, + data->message); + else + handled = handle_subtree_method_invocation (data->es->connection, + data->es, + data->message); + + if (!handled) + { + CONNECTION_LOCK (data->es->connection); + handled = handle_generic_unlocked (data->es->connection, data->message); + CONNECTION_UNLOCK (data->es->connection); + } + + /* if we couldn't handle the request, just bail with the UnknownMethod error */ + if (!handled) + { + GDBusMessage *reply; + reply = g_dbus_message_new_method_error (data->message, + "org.freedesktop.DBus.Error.UnknownMethod", + _("Method `%s' on interface `%s' with signature `%s' does not exist"), + g_dbus_message_get_member (data->message), + g_dbus_message_get_interface (data->message), + g_dbus_message_get_signature (data->message)); + g_dbus_connection_send_message (data->es->connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + } + + return FALSE; +} + +/* called in message handler thread with lock held */ +static gboolean +subtree_message_func (GDBusConnection *connection, + ExportedSubtree *es, + GDBusMessage *message) +{ + GSource *idle_source; + SubtreeDeferredData *data; + + data = g_new0 (SubtreeDeferredData, 1); + data->message = g_object_ref (message); + data->es = es; + + /* defer this call to an idle handler in the right thread */ + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_HIGH); + g_source_set_callback (idle_source, + process_subtree_vtable_message_in_idle_cb, + data, + (GDestroyNotify) subtree_deferred_data_free); + g_source_attach (idle_source, es->context); + g_source_unref (idle_source); + + /* since we own the entire subtree, handlers for objects not in the subtree have been + * tried already by libdbus-1 - so we just need to ensure that we're always going + * to reply to the message + */ + return TRUE; +} + +/** + * g_dbus_connection_register_subtree: + * @connection: A #GDBusConnection. + * @object_path: The object path to register the subtree at. + * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree. + * @flags: Flags used to fine tune the behavior of the subtree. + * @user_data: Data to pass to functions in @vtable. + * @user_data_free_func: Function to call when the subtree is unregistered. + * @error: Return location for error or %NULL. + * + * Registers a whole subtree of dynamic objects. + * + * The @enumerate and @introspection functions in @vtable are used to + * convey, to remote callers, what nodes exist in the subtree rooted + * by @object_path. + * + * When handling remote calls into any node in the subtree, first the + * @enumerate function is used to check if the node exists. If the node exists + * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set + * the @introspection function is used to check if the node supports the + * requested method. If so, the @dispatch function is used to determine + * where to dispatch the call. The collected #GDBusInterfaceVTable and + * #gpointer will be used to call into the interface vtable for processing + * the request. + * + * All calls into user-provided code will be invoked in the thread-default main + * loop of the thread you are calling this method from. + * + * If an existing subtree is already registered at @object_path or + * then @error is set to #G_IO_ERROR_EXISTS. + * + * Note that it is valid to register regular objects (using + * g_dbus_connection_register_object()) in a subtree registered with + * g_dbus_connection_register_subtree() - if so, the subtree handler + * is tried as the last resort. One way to think about a subtree + * handler is to consider it a fallback handler + * for object paths not registered via g_dbus_connection_register_object() + * or other bindings. + * + * Note that @vtable will be copied so you cannot change it after + * registration. + * + * See for an example of how to use this method. + * + * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) + * that can be used with g_dbus_connection_unregister_subtree() . + * + * Since: 2.26 + */ +guint +g_dbus_connection_register_subtree (GDBusConnection *connection, + const gchar *object_path, + const GDBusSubtreeVTable *vtable, + GDBusSubtreeFlags flags, + gpointer user_data, + GDestroyNotify user_data_free_func, + GError **error) +{ + guint ret; + ExportedSubtree *es; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0); + g_return_val_if_fail (object_path != NULL && g_variant_is_object_path (object_path), 0); + g_return_val_if_fail (vtable != NULL, 0); + g_return_val_if_fail (error == NULL || *error == NULL, 0); + + ret = 0; + + CONNECTION_LOCK (connection); + + es = g_hash_table_lookup (connection->map_object_path_to_es, object_path); + if (es != NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_EXISTS, + _("A subtree is already exported for %s"), + object_path); + goto out; + } + + es = g_new0 (ExportedSubtree, 1); + es->object_path = g_strdup (object_path); + es->connection = connection; + + es->vtable = _g_dbus_subtree_vtable_copy (vtable); + es->flags = flags; + es->id = _global_subtree_registration_id++; /* TODO: overflow etc. */ + es->user_data = user_data; + es->user_data_free_func = user_data_free_func; + es->context = g_main_context_get_thread_default (); + if (es->context != NULL) + g_main_context_ref (es->context); + + g_hash_table_insert (connection->map_object_path_to_es, es->object_path, es); + g_hash_table_insert (connection->map_id_to_es, + GUINT_TO_POINTER (es->id), + es); + + ret = es->id; + + out: + CONNECTION_UNLOCK (connection); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_connection_unregister_subtree: + * @connection: A #GDBusConnection. + * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree(). + * + * Unregisters a subtree. + * + * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_connection_unregister_subtree (GDBusConnection *connection, + guint registration_id) +{ + ExportedSubtree *es; + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); + + ret = FALSE; + + CONNECTION_LOCK (connection); + + es = g_hash_table_lookup (connection->map_id_to_es, + GUINT_TO_POINTER (registration_id)); + if (es == NULL) + goto out; + + g_warn_if_fail (g_hash_table_remove (connection->map_id_to_es, GUINT_TO_POINTER (es->id))); + g_warn_if_fail (g_hash_table_remove (connection->map_object_path_to_es, es->object_path)); + + ret = TRUE; + + out: + CONNECTION_UNLOCK (connection); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* must be called with lock held */ +static void +handle_generic_ping_unlocked (GDBusConnection *connection, + const gchar *object_path, + GDBusMessage *message) +{ + GDBusMessage *reply; + reply = g_dbus_message_new_method_reply (message); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); +} + +/* must be called with lock held */ +static void +handle_generic_get_machine_id_unlocked (GDBusConnection *connection, + const gchar *object_path, + GDBusMessage *message) +{ + GDBusMessage *reply; + + reply = NULL; + if (connection->machine_id == NULL) + { + GError *error; + + error = NULL; + connection->machine_id = _g_dbus_get_machine_id (&error); + if (connection->machine_id == NULL) + { + reply = g_dbus_message_new_method_error_literal (message, + "org.freedesktop.DBus.Error.Failed", + error->message); + g_error_free (error); + } + } + + if (reply == NULL) + { + reply = g_dbus_message_new_method_reply (message); + g_dbus_message_set_body (reply, g_variant_new ("(s)", connection->machine_id)); + } + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); +} + +/* must be called with lock held */ +static void +handle_generic_introspect_unlocked (GDBusConnection *connection, + const gchar *object_path, + GDBusMessage *message) +{ + guint n; + GString *s; + gchar **registered; + GDBusMessage *reply; + + /* first the header */ + s = g_string_new (NULL); + introspect_append_header (s); + + registered = g_dbus_connection_list_registered_unlocked (connection, object_path); + for (n = 0; registered != NULL && registered[n] != NULL; n++) + g_string_append_printf (s, " \n", registered[n]); + g_strfreev (registered); + g_string_append (s, "\n"); + + reply = g_dbus_message_new_method_reply (message); + g_dbus_message_set_body (reply, g_variant_new ("(s)", s->str)); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + g_string_free (s, TRUE); +} + +/* must be called with lock held */ +static gboolean +handle_generic_unlocked (GDBusConnection *connection, + GDBusMessage *message) +{ + gboolean handled; + const gchar *interface_name; + const gchar *member; + const gchar *signature; + const gchar *path; + + CONNECTION_ENSURE_LOCK (connection); + + handled = FALSE; + + interface_name = g_dbus_message_get_interface (message); + member = g_dbus_message_get_member (message); + signature = g_dbus_message_get_signature (message); + path = g_dbus_message_get_path (message); + + if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Introspectable") == 0 && + g_strcmp0 (member, "Introspect") == 0 && + g_strcmp0 (signature, "") == 0) + { + handle_generic_introspect_unlocked (connection, path, message); + handled = TRUE; + } + else if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Peer") == 0 && + g_strcmp0 (member, "Ping") == 0 && + g_strcmp0 (signature, "") == 0) + { + handle_generic_ping_unlocked (connection, path, message); + handled = TRUE; + } + else if (g_strcmp0 (interface_name, "org.freedesktop.DBus.Peer") == 0 && + g_strcmp0 (member, "GetMachineId") == 0 && + g_strcmp0 (signature, "") == 0) + { + handle_generic_get_machine_id_unlocked (connection, path, message); + handled = TRUE; + } + + return handled; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* called in message handler thread with lock held */ +static void +distribute_method_call (GDBusConnection *connection, + GDBusMessage *message) +{ + GDBusMessage *reply; + ExportedObject *eo; + ExportedSubtree *es; + const gchar *object_path; + const gchar *interface_name; + const gchar *member; + const gchar *signature; + const gchar *path; + gchar *subtree_path; + gchar *needle; + + g_assert (g_dbus_message_get_message_type (message) == G_DBUS_MESSAGE_TYPE_METHOD_CALL); + + interface_name = g_dbus_message_get_interface (message); + member = g_dbus_message_get_member (message); + signature = g_dbus_message_get_signature (message); + path = g_dbus_message_get_path (message); + subtree_path = g_strdup (path); + needle = strrchr (subtree_path, '/'); + if (needle != NULL && needle != subtree_path) + { + *needle = '\0'; + } + else + { + g_free (subtree_path); + subtree_path = NULL; + } + + + if (G_UNLIKELY (_g_dbus_debug_incoming ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Incoming:\n" + " <<<< METHOD INVOCATION %s.%s()\n" + " on object %s\n" + " invoked by name %s\n" + " serial %d\n", + interface_name, member, + path, + g_dbus_message_get_sender (message) != NULL ? g_dbus_message_get_sender (message) : "(none)", + g_dbus_message_get_serial (message)); + _g_dbus_debug_print_unlock (); + } + +#if 0 + g_debug ("interface = `%s'", interface_name); + g_debug ("member = `%s'", member); + g_debug ("signature = `%s'", signature); + g_debug ("path = `%s'", path); + g_debug ("subtree_path = `%s'", subtree_path != NULL ? subtree_path : "N/A"); +#endif + + object_path = g_dbus_message_get_path (message); + g_assert (object_path != NULL); + + eo = g_hash_table_lookup (connection->map_object_path_to_eo, object_path); + if (eo != NULL) + { + if (obj_message_func (connection, eo, message)) + goto out; + } + + es = g_hash_table_lookup (connection->map_object_path_to_es, object_path); + if (es != NULL) + { + if (subtree_message_func (connection, es, message)) + goto out; + } + + if (subtree_path != NULL) + { + es = g_hash_table_lookup (connection->map_object_path_to_es, subtree_path); + if (es != NULL) + { + if (subtree_message_func (connection, es, message)) + goto out; + } + } + + if (handle_generic_unlocked (connection, message)) + goto out; + + /* if we end up here, the message has not been not handled - so return an error saying this */ + reply = g_dbus_message_new_method_error (message, + "org.freedesktop.DBus.Error.UnknownMethod", + _("No such interface `%s' on object at path %s"), + interface_name, + object_path); + g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + + out: + g_free (subtree_path); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusConnection ** +message_bus_get_singleton (GBusType bus_type, + GError **error) +{ + GDBusConnection **ret; + const gchar *starter_bus; + + ret = NULL; + + switch (bus_type) + { + case G_BUS_TYPE_SESSION: + ret = &the_session_bus; + break; + + case G_BUS_TYPE_SYSTEM: + ret = &the_system_bus; + break; + + case G_BUS_TYPE_STARTER: + starter_bus = g_getenv ("DBUS_STARTER_BUS_TYPE"); + if (g_strcmp0 (starter_bus, "session") == 0) + { + ret = message_bus_get_singleton (G_BUS_TYPE_SESSION, error); + goto out; + } + else if (g_strcmp0 (starter_bus, "system") == 0) + { + ret = message_bus_get_singleton (G_BUS_TYPE_SYSTEM, error); + goto out; + } + else + { + if (starter_bus != NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Cannot determine bus address from DBUS_STARTER_BUS_TYPE environment variable" + " - unknown value `%s'"), + starter_bus); + } + else + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Cannot determine bus address because the DBUS_STARTER_BUS_TYPE environment " + "variable is not set")); + } + } + break; + + default: + g_assert_not_reached (); + break; + } + + out: + return ret; +} + +static GDBusConnection * +get_uninitialized_connection (GBusType bus_type, + GCancellable *cancellable, + GError **error) +{ + GDBusConnection **singleton; + GDBusConnection *ret; + + ret = NULL; + + G_LOCK (message_bus_lock); + singleton = message_bus_get_singleton (bus_type, error); + if (singleton == NULL) + goto out; + + if (*singleton == NULL) + { + gchar *address; + address = g_dbus_address_get_for_bus_sync (bus_type, cancellable, error); + if (address == NULL) + goto out; + ret = *singleton = g_object_new (G_TYPE_DBUS_CONNECTION, + "address", address, + "flags", G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | + G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, + "exit-on-close", TRUE, + NULL); + g_free (address); + } + else + { + ret = g_object_ref (*singleton); + } + + g_assert (ret != NULL); + + out: + G_UNLOCK (message_bus_lock); + return ret; +} + +/** + * g_bus_get_sync: + * @bus_type: A #GBusType. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously connects to the message bus specified by @bus_type. + * Note that the returned object may shared with other callers, + * e.g. if two separate parts of a process calls this function with + * the same @bus_type, they will share the same object. + * + * This is a synchronous failable function. See g_bus_get() and + * g_bus_get_finish() for the asynchronous version. + * + * The returned object is a singleton, that is, shared with other + * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the + * event that you need a private message bus connection, use + * g_dbus_address_get_for_bus_sync() and + * g_dbus_connection_new_for_address(). + * + * Note that the returned #GDBusConnection object will (usually) have + * the #GDBusConnection:exit-on-close property set to %TRUE. + * + * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusConnection * +g_bus_get_sync (GBusType bus_type, + GCancellable *cancellable, + GError **error) +{ + GDBusConnection *connection; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + connection = get_uninitialized_connection (bus_type, cancellable, error); + if (connection == NULL) + goto out; + + if (!g_initable_init (G_INITABLE (connection), cancellable, error)) + { + g_object_unref (connection); + connection = NULL; + } + + out: + return connection; +} + +static void +bus_get_async_initable_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); + GError *error; + + error = NULL; + if (!g_async_initable_init_finish (G_ASYNC_INITABLE (source_object), + res, + &error)) + { + g_assert (error != NULL); + g_simple_async_result_take_error (simple, error); + g_object_unref (source_object); + } + else + { + g_simple_async_result_set_op_res_gpointer (simple, + source_object, + g_object_unref); + } + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); +} + +/** + * g_bus_get: + * @bus_type: A #GBusType. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: The data to pass to @callback. + * + * Asynchronously connects to the message bus specified by @bus_type. + * + * When the operation is finished, @callback will be invoked. You can + * then call g_bus_get_finish() to get the result of the operation. + * + * This is a asynchronous failable function. See g_bus_get_sync() for + * the synchronous version. + * + * Since: 2.26 + */ +void +g_bus_get (GBusType bus_type, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GDBusConnection *connection; + GSimpleAsyncResult *simple; + GError *error; + + simple = g_simple_async_result_new (NULL, + callback, + user_data, + g_bus_get); + + error = NULL; + connection = get_uninitialized_connection (bus_type, cancellable, &error); + if (connection == NULL) + { + g_assert (error != NULL); + g_simple_async_result_take_error (simple, error); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); + } + else + { + g_async_initable_init_async (G_ASYNC_INITABLE (connection), + G_PRIORITY_DEFAULT, + cancellable, + bus_get_async_initable_cb, + simple); + } +} + +/** + * g_bus_get_finish: + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_bus_get(). + * + * The returned object is a singleton, that is, shared with other + * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the + * event that you need a private message bus connection, use + * g_dbus_address_get_for_bus() and + * g_dbus_connection_new_for_address(). + * + * Note that the returned #GDBusConnection object will (usually) have + * the #GDBusConnection:exit-on-close property set to %TRUE. + * + * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusConnection * +g_bus_get_finish (GAsyncResult *res, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + GObject *object; + GDBusConnection *ret; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_bus_get); + + ret = NULL; + + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + object = g_simple_async_result_get_op_res_gpointer (simple); + g_assert (object != NULL); + ret = g_object_ref (G_DBUS_CONNECTION (object)); + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusconnection.h b/gio/gdbusconnection.h new file mode 100644 index 0000000..eb3e0f3 --- /dev/null +++ b/gio/gdbusconnection.h @@ -0,0 +1,562 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_CONNECTION_H__ +#define __G_DBUS_CONNECTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_CONNECTION (g_dbus_connection_get_type ()) +#define G_DBUS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_CONNECTION, GDBusConnection)) +#define G_IS_DBUS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_CONNECTION)) + +GType g_dbus_connection_get_type (void) G_GNUC_CONST; + +/* ---------------------------------------------------------------------------------------------------- */ + +void g_bus_get (GBusType bus_type, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusConnection *g_bus_get_finish (GAsyncResult *res, + GError **error); +GDBusConnection *g_bus_get_sync (GBusType bus_type, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +void g_dbus_connection_new (GIOStream *stream, + const gchar *guid, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusConnection *g_dbus_connection_new_finish (GAsyncResult *res, + GError **error); +GDBusConnection *g_dbus_connection_new_sync (GIOStream *stream, + const gchar *guid, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GError **error); + +void g_dbus_connection_new_for_address (const gchar *address, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusConnection *g_dbus_connection_new_for_address_finish (GAsyncResult *res, + GError **error); +GDBusConnection *g_dbus_connection_new_for_address_sync (const gchar *address, + GDBusConnectionFlags flags, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +void g_dbus_connection_start_message_processing (GDBusConnection *connection); +gboolean g_dbus_connection_is_closed (GDBusConnection *connection); +GIOStream *g_dbus_connection_get_stream (GDBusConnection *connection); +const gchar *g_dbus_connection_get_guid (GDBusConnection *connection); +const gchar *g_dbus_connection_get_unique_name (GDBusConnection *connection); +GCredentials *g_dbus_connection_get_peer_credentials (GDBusConnection *connection); +gboolean g_dbus_connection_get_exit_on_close (GDBusConnection *connection); +void g_dbus_connection_set_exit_on_close (GDBusConnection *connection, + gboolean exit_on_close); +GDBusCapabilityFlags g_dbus_connection_get_capabilities (GDBusConnection *connection); + +/* ---------------------------------------------------------------------------------------------------- */ + +void g_dbus_connection_close (GDBusConnection *connection, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean g_dbus_connection_close_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error); +gboolean g_dbus_connection_close_sync (GDBusConnection *connection, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +void g_dbus_connection_flush (GDBusConnection *connection, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean g_dbus_connection_flush_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error); +gboolean g_dbus_connection_flush_sync (GDBusConnection *connection, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +gboolean g_dbus_connection_send_message (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + volatile guint32 *out_serial, + GError **error); +void g_dbus_connection_send_message_with_reply (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + gint timeout_msec, + volatile guint32 *out_serial, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusMessage *g_dbus_connection_send_message_with_reply_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error); +GDBusMessage *g_dbus_connection_send_message_with_reply_sync (GDBusConnection *connection, + GDBusMessage *message, + GDBusSendMessageFlags flags, + gint timeout_msec, + volatile guint32 *out_serial, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +gboolean g_dbus_connection_emit_signal (GDBusConnection *connection, + const gchar *destination_bus_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + GError **error); +void g_dbus_connection_call (GDBusConnection *connection, + const gchar *bus_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + const GVariantType *reply_type, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GVariant *g_dbus_connection_call_finish (GDBusConnection *connection, + GAsyncResult *res, + GError **error); +GVariant *g_dbus_connection_call_sync (GDBusConnection *connection, + const gchar *bus_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + const GVariantType *reply_type, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + + +/** + * GDBusInterfaceMethodCallFunc: + * @connection: A #GDBusConnection. + * @sender: The unique bus name of the remote caller. + * @object_path: The object path that the method was invoked on. + * @interface_name: The D-Bus interface name the method was invoked on. + * @method_name: The name of the method that was invoked. + * @parameters: A #GVariant tuple with parameters. + * @invocation: A #GDBusMethodInvocation object that can be used to return a value or error. + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object(). + * + * The type of the @method_call function in #GDBusInterfaceVTable. + * + * Since: 2.26 + */ +typedef void (*GDBusInterfaceMethodCallFunc) (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data); + +/** + * GDBusInterfaceGetPropertyFunc: + * @connection: A #GDBusConnection. + * @sender: The unique bus name of the remote caller. + * @object_path: The object path that the method was invoked on. + * @interface_name: The D-Bus interface name for the property. + * @property_name: The name of the property to get the value of. + * @error: Return location for error. + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object(). + * + * The type of the @get_property function in #GDBusInterfaceVTable. + * + * Returns: A #GVariant with the value for @property_name or %NULL if + * @error is set. If the returned #GVariant is floating, it is + * consumed - otherwise its reference count is decreased by one. + * + * Since: 2.26 + */ +typedef GVariant *(*GDBusInterfaceGetPropertyFunc) (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data); + +/** + * GDBusInterfaceSetPropertyFunc: + * @connection: A #GDBusConnection. + * @sender: The unique bus name of the remote caller. + * @object_path: The object path that the method was invoked on. + * @interface_name: The D-Bus interface name for the property. + * @property_name: The name of the property to get the value of. + * @value: The value to set the property to. + * @error: Return location for error. + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object(). + * + * The type of the @set_property function in #GDBusInterfaceVTable. + * + * Returns: %TRUE if the property was set to @value, %FALSE if @error is set. + * + * Since: 2.26 + */ +typedef gboolean (*GDBusInterfaceSetPropertyFunc) (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *value, + GError **error, + gpointer user_data); + +/** + * GDBusInterfaceVTable: + * @method_call: Function for handling incoming method calls. + * @get_property: Function for getting a property. + * @set_property: Function for setting a property. + * + * Virtual table for handling properties and method calls for a D-Bus + * interface. + * + * If you want to handle getting/setting D-Bus properties asynchronously, simply + * register an object with the org.freedesktop.DBus.Properties + * D-Bus interface using g_dbus_connection_register_object(). + * + * Since: 2.26 + */ +struct _GDBusInterfaceVTable +{ + GDBusInterfaceMethodCallFunc method_call; + GDBusInterfaceGetPropertyFunc get_property; + GDBusInterfaceSetPropertyFunc set_property; + + /*< private >*/ + /* Padding for future expansion - also remember to update + * gdbusconnection.c:_g_dbus_interface_vtable_copy() when + * changing this. + */ + gpointer padding[8]; +}; + +guint g_dbus_connection_register_object (GDBusConnection *connection, + const gchar *object_path, + GDBusInterfaceInfo *interface_info, + const GDBusInterfaceVTable *vtable, + gpointer user_data, + GDestroyNotify user_data_free_func, + GError **error); +gboolean g_dbus_connection_unregister_object (GDBusConnection *connection, + guint registration_id); + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * GDBusSubtreeEnumerateFunc: + * @connection: A #GDBusConnection. + * @sender: The unique bus name of the remote caller. + * @object_path: The object path that was registered with g_dbus_connection_register_subtree(). + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree(). + * + * The type of the @enumerate function in #GDBusSubtreeVTable. + * + * This function is called when generating introspection data and also + * when preparing to dispatch incoming messages in the event that the + * %G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not + * specified (ie: to verify that the object path is valid). + * + * Hierarchies are not supported; the items that you return should not + * contain the '/' character. + * + * The return value will be freed with g_strfreev(). + * + * Returns: A newly allocated array of strings for node names that are children of @object_path. + * + * Since: 2.26 + */ +typedef gchar** (*GDBusSubtreeEnumerateFunc) (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + gpointer user_data); + +/** + * GDBusSubtreeIntrospectFunc: + * @connection: A #GDBusConnection. + * @sender: The unique bus name of the remote caller. + * @object_path: The object path that was registered with g_dbus_connection_register_subtree(). + * @node: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree. + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree(). + * + * The type of the @introspect function in #GDBusSubtreeVTable. + * + * Subtrees are flat. @node, if non-%NULL, is always exactly one + * segment of the object path (ie: it never contains a slash). + * + * This function should return %NULL to indicate that there is no object + * at this node. + * + * If this function returns non-%NULL, the return value is expected to + * be a %NULL-terminated array of pointers to #GDBusInterfaceInfo + * structures describing the interfaces implemented by @node. This + * array will have g_dbus_interface_info_unref() called on each item + * before being freed with g_free(). + * + * The difference between returning %NULL and an array containing zero + * items is that the standard DBus interfaces will returned to the + * remote introspector in the empty array case, but not in the %NULL + * case. + * + * Returns: A %NULL-terminated array of pointers to #GDBusInterfaceInfo, or %NULL. + * + * Since: 2.26 + */ +typedef GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc) (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *node, + gpointer user_data); + +/** + * GDBusSubtreeDispatchFunc: + * @connection: A #GDBusConnection. + * @sender: The unique bus name of the remote caller. + * @object_path: The object path that was registered with g_dbus_connection_register_subtree(). + * @interface_name: The D-Bus interface name that the method call or property access is for. + * @node: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree. + * @out_user_data: Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL). + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree(). + * + * The type of the @dispatch function in #GDBusSubtreeVTable. + * + * Subtrees are flat. @node, if non-%NULL, is always exactly one + * segment of the object path (ie: it never contains a slash). + * + * Returns: A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods. + * + * Since: 2.26 + */ +typedef const GDBusInterfaceVTable * (*GDBusSubtreeDispatchFunc) (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *node, + gpointer *out_user_data, + gpointer user_data); + +/** + * GDBusSubtreeVTable: + * @enumerate: Function for enumerating child nodes. + * @introspect: Function for introspecting a child node. + * @dispatch: Function for dispatching a remote call on a child node. + * + * Virtual table for handling subtrees registered with g_dbus_connection_register_subtree(). + * + * Since: 2.26 + */ +struct _GDBusSubtreeVTable +{ + GDBusSubtreeEnumerateFunc enumerate; + GDBusSubtreeIntrospectFunc introspect; + GDBusSubtreeDispatchFunc dispatch; + + /*< private >*/ + /* Padding for future expansion - also remember to update + * gdbusconnection.c:_g_dbus_subtree_vtable_copy() when + * changing this. + */ + gpointer padding[8]; +}; + +guint g_dbus_connection_register_subtree (GDBusConnection *connection, + const gchar *object_path, + const GDBusSubtreeVTable *vtable, + GDBusSubtreeFlags flags, + gpointer user_data, + GDestroyNotify user_data_free_func, + GError **error); +gboolean g_dbus_connection_unregister_subtree (GDBusConnection *connection, + guint registration_id); + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * GDBusSignalCallback: + * @connection: A #GDBusConnection. + * @sender_name: The unique bus name of the sender of the signal. + * @object_path: The object path that the signal was emitted on. + * @interface_name: The name of the interface. + * @signal_name: The name of the signal. + * @parameters: A #GVariant tuple with parameters for the signal. + * @user_data: User data passed when subscribing to the signal. + * + * Signature for callback function used in g_dbus_connection_signal_subscribe(). + * + * Since: 2.26 + */ +typedef void (*GDBusSignalCallback) (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data); + +guint g_dbus_connection_signal_subscribe (GDBusConnection *connection, + const gchar *sender, + const gchar *interface_name, + const gchar *member, + const gchar *object_path, + const gchar *arg0, + GDBusSignalFlags flags, + GDBusSignalCallback callback, + gpointer user_data, + GDestroyNotify user_data_free_func); +void g_dbus_connection_signal_unsubscribe (GDBusConnection *connection, + guint subscription_id); + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * GDBusMessageFilterFunction: + * @connection: (transfer none): A #GDBusConnection. + * @message: (transfer full): A locked #GDBusMessage that the filter function takes ownership of. + * @incoming: %TRUE if it is a message received from the other peer, %FALSE if it is + * a message to be sent to the other peer. + * @user_data: User data passed when adding the filter. + * + * Signature for function used in g_dbus_connection_add_filter(). + * + * A filter function is passed a #GDBusMessage and expected to return + * a #GDBusMessage too. Passive filter functions that don't modify the + * message can simply return the @message object: + * |[ + * static GDBusMessage * + * passive_filter (GDBusConnection *connection + * GDBusMessage *message, + * gboolean incoming, + * gpointer user_data) + * { + * /* inspect @message */ + * return message; + * } + * ]| + * Filter functions that wants to drop a message can simply return %NULL: + * |[ + * static GDBusMessage * + * drop_filter (GDBusConnection *connection + * GDBusMessage *message, + * gboolean incoming, + * gpointer user_data) + * { + * if (should_drop_message) + * { + * g_object_unref (message); + * message = NULL; + * } + * return message; + * } + * ]| + * Finally, a filter function may modify a message by copying it: + * |[ + * static GDBusMessage * + * modifying_filter (GDBusConnection *connection + * GDBusMessage *message, + * gboolean incoming, + * gpointer user_data) + * { + * GDBusMessage *copy; + * GError *error; + * + * error = NULL; + * copy = g_dbus_message_copy (message, &error); + * /* handle @error being is set */ + * g_object_unref (message); + * + * /* modify @copy */ + * + * return copy; + * } + * ]| + * If the returned #GDBusMessage is different from @message and cannot + * be sent on @connection (it could use features, such as file + * descriptors, not compatible with @connection), then a warning is + * logged to standard error. Applications can + * check this ahead of time using g_dbus_message_to_blob() passing a + * #GDBusCapabilityFlags value obtained from @connection. + * + * Returns: (transfer full) (allow-none): A #GDBusMessage that will be freed with + * g_object_unref() or %NULL to drop the message. Passive filter + * functions can simply return the passed @message object. + * + * Since: 2.26 + */ +typedef GDBusMessage *(*GDBusMessageFilterFunction) (GDBusConnection *connection, + GDBusMessage *message, + gboolean incoming, + gpointer user_data); + +guint g_dbus_connection_add_filter (GDBusConnection *connection, + GDBusMessageFilterFunction filter_function, + gpointer user_data, + GDestroyNotify user_data_free_func); + +void g_dbus_connection_remove_filter (GDBusConnection *connection, + guint filter_id); + +/* ---------------------------------------------------------------------------------------------------- */ + + +G_END_DECLS + +#endif /* __G_DBUS_CONNECTION_H__ */ diff --git a/gio/gdbuserror.c b/gio/gdbuserror.c new file mode 100644 index 0000000..064c67b --- /dev/null +++ b/gio/gdbuserror.c @@ -0,0 +1,872 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include + +#include "gdbuserror.h" +#include "gioenums.h" +#include "gioenumtypes.h" +#include "gioerror.h" +#include "gdbusprivate.h" + +#include "glibintl.h" + +/** + * SECTION:gdbuserror + * @title: GDBusError + * @short_description: Mapping D-Bus errors to and from GError + * @include: gio/gio.h + * + * All facilities that return errors from remote methods (such as + * g_dbus_connection_call_sync()) use #GError to represent both D-Bus + * errors (e.g. errors returned from the other peer) and locally + * in-process generated errors. + * + * To check if a returned #GError is an error from a remote peer, use + * g_dbus_error_is_remote_error(). To get the actual D-Bus error name, + * use g_dbus_error_get_remote_error(). Before presenting an error, + * always use g_dbus_error_strip_remote_error(). + * + * In addition, facilities used to return errors to a remote peer also + * use #GError. See g_dbus_method_invocation_return_error() for + * discussion about how the D-Bus error name is set. + * + * Applications can associate a #GError error domain with a set of D-Bus errors in order to + * automatically map from D-Bus errors to #GError and back. This + * is typically done in the function returning the #GQuark for the + * error domain: + * Error Registration + * /* foo-bar-error.h: */ + * + * #define FOO_BAR_ERROR (foo_bar_error_quark ()) + * GQuark foo_bar_error_quark (void); + * + * typedef enum + * { + * FOO_BAR_ERROR_FAILED, + * FOO_BAR_ERROR_ANOTHER_ERROR, + * FOO_BAR_ERROR_SOME_THIRD_ERROR, + * } FooBarError; + * + * /* foo-bar-error.c: */ + * + * static const GDBusErrorEntry foo_bar_error_entries[] = + * { + * {FOO_BAR_ERROR_FAILED, "org.project.Foo.Bar.Error.Failed"}, + * {FOO_BAR_ERROR_ANOTHER_ERROR, "org.project.Foo.Bar.Error.AnotherError"}, + * {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"}, + * }; + * + * GQuark + * foo_bar_error_quark (void) + * { + * static volatile gsize quark_volatile = 0; + * g_dbus_error_register_error_domain ("foo-bar-error-quark", + * &quark_volatile, + * foo_bar_error_entries, + * G_N_ELEMENTS (foo_bar_error_entries)); + * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) - 1 == FOO_BAR_ERROR_SOME_THIRD_ERROR); + * return (GQuark) quark_volatile; + * } + * + * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and + * other peers will see the D-Bus error name org.project.Foo.Bar.Error.AnotherError. + * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead + * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover + * org.project.Foo.Bar.Error.AnotherError using g_dbus_error_get_remote_error(). + * + * Note that errors in the %G_DBUS_ERROR error domain is intended only + * for returning errors from a remote message bus process. Errors + * generated locally in-process by e.g. #GDBusConnection is from the + * %G_IO_ERROR domain. + */ + +static const GDBusErrorEntry g_dbus_error_entries[] = +{ + {G_DBUS_ERROR_FAILED, "org.freedesktop.DBus.Error.Failed"}, + {G_DBUS_ERROR_NO_MEMORY, "org.freedesktop.DBus.Error.NoMemory"}, + {G_DBUS_ERROR_SERVICE_UNKNOWN, "org.freedesktop.DBus.Error.ServiceUnknown"}, + {G_DBUS_ERROR_NAME_HAS_NO_OWNER, "org.freedesktop.DBus.Error.NameHasNoOwner"}, + {G_DBUS_ERROR_NO_REPLY, "org.freedesktop.DBus.Error.NoReply"}, + {G_DBUS_ERROR_IO_ERROR, "org.freedesktop.DBus.Error.IOError"}, + {G_DBUS_ERROR_BAD_ADDRESS, "org.freedesktop.DBus.Error.BadAddress"}, + {G_DBUS_ERROR_NOT_SUPPORTED, "org.freedesktop.DBus.Error.NotSupported"}, + {G_DBUS_ERROR_LIMITS_EXCEEDED, "org.freedesktop.DBus.Error.LimitsExceeded"}, + {G_DBUS_ERROR_ACCESS_DENIED, "org.freedesktop.DBus.Error.AccessDenied"}, + {G_DBUS_ERROR_AUTH_FAILED, "org.freedesktop.DBus.Error.AuthFailed"}, + {G_DBUS_ERROR_NO_SERVER, "org.freedesktop.DBus.Error.NoServer"}, + {G_DBUS_ERROR_TIMEOUT, "org.freedesktop.DBus.Error.Timeout"}, + {G_DBUS_ERROR_NO_NETWORK, "org.freedesktop.DBus.Error.NoNetwork"}, + {G_DBUS_ERROR_ADDRESS_IN_USE, "org.freedesktop.DBus.Error.AddressInUse"}, + {G_DBUS_ERROR_DISCONNECTED, "org.freedesktop.DBus.Error.Disconnected"}, + {G_DBUS_ERROR_INVALID_ARGS, "org.freedesktop.DBus.Error.InvalidArgs"}, + {G_DBUS_ERROR_FILE_NOT_FOUND, "org.freedesktop.DBus.Error.FileNotFound"}, + {G_DBUS_ERROR_FILE_EXISTS, "org.freedesktop.DBus.Error.FileExists"}, + {G_DBUS_ERROR_UNKNOWN_METHOD, "org.freedesktop.DBus.Error.UnknownMethod"}, + {G_DBUS_ERROR_TIMED_OUT, "org.freedesktop.DBus.Error.TimedOut"}, + {G_DBUS_ERROR_MATCH_RULE_NOT_FOUND, "org.freedesktop.DBus.Error.MatchRuleNotFound"}, + {G_DBUS_ERROR_MATCH_RULE_INVALID, "org.freedesktop.DBus.Error.MatchRuleInvalid"}, + {G_DBUS_ERROR_SPAWN_EXEC_FAILED, "org.freedesktop.DBus.Error.Spawn.ExecFailed"}, + {G_DBUS_ERROR_SPAWN_FORK_FAILED, "org.freedesktop.DBus.Error.Spawn.ForkFailed"}, + {G_DBUS_ERROR_SPAWN_CHILD_EXITED, "org.freedesktop.DBus.Error.Spawn.ChildExited"}, + {G_DBUS_ERROR_SPAWN_CHILD_SIGNALED, "org.freedesktop.DBus.Error.Spawn.ChildSignaled"}, + {G_DBUS_ERROR_SPAWN_FAILED, "org.freedesktop.DBus.Error.Spawn.Failed"}, + {G_DBUS_ERROR_SPAWN_SETUP_FAILED, "org.freedesktop.DBus.Error.Spawn.FailedToSetup"}, + {G_DBUS_ERROR_SPAWN_CONFIG_INVALID, "org.freedesktop.DBus.Error.Spawn.ConfigInvalid"}, + {G_DBUS_ERROR_SPAWN_SERVICE_INVALID, "org.freedesktop.DBus.Error.Spawn.ServiceNotValid"}, + {G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND, "org.freedesktop.DBus.Error.Spawn.ServiceNotFound"}, + {G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID, "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid"}, + {G_DBUS_ERROR_SPAWN_FILE_INVALID, "org.freedesktop.DBus.Error.Spawn.FileInvalid"}, + {G_DBUS_ERROR_SPAWN_NO_MEMORY, "org.freedesktop.DBus.Error.Spawn.NoMemory"}, + {G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN, "org.freedesktop.DBus.Error.UnixProcessIdUnknown"}, + {G_DBUS_ERROR_INVALID_SIGNATURE, "org.freedesktop.DBus.Error.InvalidSignature"}, + {G_DBUS_ERROR_INVALID_FILE_CONTENT, "org.freedesktop.DBus.Error.InvalidFileContent"}, + {G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"}, + {G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, "org.freedesktop.DBus.Error.AdtAuditDataUnknown"}, + {G_DBUS_ERROR_OBJECT_PATH_IN_USE, "org.freedesktop.DBus.Error.ObjectPathInUse"}, +}; + +GQuark +g_dbus_error_quark (void) +{ + G_STATIC_ASSERT (G_N_ELEMENTS (g_dbus_error_entries) - 1 == G_DBUS_ERROR_OBJECT_PATH_IN_USE); + static volatile gsize quark_volatile = 0; + g_dbus_error_register_error_domain ("g-dbus-error-quark", + &quark_volatile, + g_dbus_error_entries, + G_N_ELEMENTS (g_dbus_error_entries)); + return (GQuark) quark_volatile; +} + +/** + * g_dbus_error_register_error_domain: + * @error_domain_quark_name: The error domain name. + * @quark_volatile: A pointer where to store the #GQuark. + * @entries: A pointer to @num_entries #GDBusErrorEntry struct items. + * @num_entries: Number of items to register. + * + * Helper function for associating a #GError error domain with D-Bus error names. + * + * Since: 2.26 + */ +void +g_dbus_error_register_error_domain (const gchar *error_domain_quark_name, + volatile gsize *quark_volatile, + const GDBusErrorEntry *entries, + guint num_entries) +{ + g_return_if_fail (error_domain_quark_name != NULL); + g_return_if_fail (quark_volatile != NULL); + g_return_if_fail (entries != NULL); + g_return_if_fail (num_entries > 0); + + if (g_once_init_enter (quark_volatile)) + { + guint n; + GQuark quark; + + quark = g_quark_from_static_string (error_domain_quark_name); + + for (n = 0; n < num_entries; n++) + { + g_warn_if_fail (g_dbus_error_register_error (quark, + entries[n].error_code, + entries[n].dbus_error_name)); + } + g_once_init_leave (quark_volatile, quark); + } +} + +static gboolean +_g_dbus_error_decode_gerror (const gchar *dbus_name, + GQuark *out_error_domain, + gint *out_error_code) +{ + gboolean ret; + guint n; + GString *s; + gchar *domain_quark_string; + + ret = FALSE; + s = NULL; + + if (g_str_has_prefix (dbus_name, "org.gtk.GDBus.UnmappedGError.Quark._")) + { + s = g_string_new (NULL); + + for (n = sizeof "org.gtk.GDBus.UnmappedGError.Quark._" - 1; + dbus_name[n] != '.' && dbus_name[n] != '\0'; + n++) + { + if (g_ascii_isalnum (dbus_name[n])) + { + g_string_append_c (s, dbus_name[n]); + } + else if (dbus_name[n] == '_') + { + guint nibble_top; + guint nibble_bottom; + + n++; + + nibble_top = dbus_name[n]; + if (nibble_top >= '0' && nibble_top <= '9') + nibble_top -= '0'; + else if (nibble_top >= 'a' && nibble_top <= 'f') + nibble_top -= ('a' - 10); + else + goto not_mapped; + + n++; + + nibble_bottom = dbus_name[n]; + if (nibble_bottom >= '0' && nibble_bottom <= '9') + nibble_bottom -= '0'; + else if (nibble_bottom >= 'a' && nibble_bottom <= 'f') + nibble_bottom -= ('a' - 10); + else + goto not_mapped; + + g_string_append_c (s, (nibble_top<<4) | nibble_bottom); + } + else + { + goto not_mapped; + } + } + + if (!g_str_has_prefix (dbus_name + n, ".Code")) + goto not_mapped; + + domain_quark_string = g_string_free (s, FALSE); + s = NULL; + + if (out_error_domain != NULL) + *out_error_domain = g_quark_from_string (domain_quark_string); + g_free (domain_quark_string); + + if (out_error_code != NULL) + *out_error_code = atoi (dbus_name + n + sizeof ".Code" - 1); + + ret = TRUE; + } + + not_mapped: + + if (s != NULL) + g_string_free (s, TRUE); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GQuark error_domain; + gint error_code; +} QuarkCodePair; + +static guint +quark_code_pair_hash_func (const QuarkCodePair *pair) +{ + gint val; + val = pair->error_domain + pair->error_code; + return g_int_hash (&val); +} + +static gboolean +quark_code_pair_equal_func (const QuarkCodePair *a, + const QuarkCodePair *b) +{ + return (a->error_domain == b->error_domain) && (a->error_code == b->error_code); +} + +typedef struct +{ + QuarkCodePair pair; + gchar *dbus_error_name; +} RegisteredError; + +static void +registered_error_free (RegisteredError *re) +{ + g_free (re->dbus_error_name); + g_free (re); +} + +G_LOCK_DEFINE_STATIC (error_lock); + +/* maps from QuarkCodePair* -> RegisteredError* */ +static GHashTable *quark_code_pair_to_re = NULL; + +/* maps from gchar* -> RegisteredError* */ +static GHashTable *dbus_error_name_to_re = NULL; + +/** + * g_dbus_error_register_error: + * @error_domain: A #GQuark for a error domain. + * @error_code: An error code. + * @dbus_error_name: A D-Bus error name. + * + * Creates an association to map between @dbus_error_name and + * #GErrors specified by @error_domain and @error_code. + * + * This is typically done in the routine that returns the #GQuark for + * an error domain. + * + * Returns: %TRUE if the association was created, %FALSE if it already + * exists. + * + * Since: 2.26 + */ +gboolean +g_dbus_error_register_error (GQuark error_domain, + gint error_code, + const gchar *dbus_error_name) +{ + gboolean ret; + QuarkCodePair pair; + RegisteredError *re; + + g_return_val_if_fail (dbus_error_name != NULL, FALSE); + + ret = FALSE; + + G_LOCK (error_lock); + + if (quark_code_pair_to_re == NULL) + { + g_assert (dbus_error_name_to_re == NULL); /* check invariant */ + quark_code_pair_to_re = g_hash_table_new ((GHashFunc) quark_code_pair_hash_func, + (GEqualFunc) quark_code_pair_equal_func); + dbus_error_name_to_re = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, + (GDestroyNotify) registered_error_free); + } + + if (g_hash_table_lookup (dbus_error_name_to_re, dbus_error_name) != NULL) + goto out; + + pair.error_domain = error_domain; + pair.error_code = error_code; + + if (g_hash_table_lookup (quark_code_pair_to_re, &pair) != NULL) + goto out; + + re = g_new0 (RegisteredError, 1); + re->pair = pair; + re->dbus_error_name = g_strdup (dbus_error_name); + + g_hash_table_insert (quark_code_pair_to_re, &(re->pair), re); + g_hash_table_insert (dbus_error_name_to_re, re->dbus_error_name, re); + + ret = TRUE; + + out: + G_UNLOCK (error_lock); + return ret; +} + +/** + * g_dbus_error_unregister_error: + * @error_domain: A #GQuark for a error domain. + * @error_code: An error code. + * @dbus_error_name: A D-Bus error name. + * + * Destroys an association previously set up with g_dbus_error_register_error(). + * + * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found. + * + * Since: 2.26 + */ +gboolean +g_dbus_error_unregister_error (GQuark error_domain, + gint error_code, + const gchar *dbus_error_name) +{ + gboolean ret; + RegisteredError *re; + guint hash_size; + + g_return_val_if_fail (dbus_error_name != NULL, FALSE); + + ret = FALSE; + + G_LOCK (error_lock); + + if (dbus_error_name_to_re == NULL) + { + g_assert (quark_code_pair_to_re == NULL); /* check invariant */ + goto out; + } + + re = g_hash_table_lookup (dbus_error_name_to_re, dbus_error_name); + if (re == NULL) + { + QuarkCodePair pair; + pair.error_domain = error_domain; + pair.error_code = error_code; + g_warn_if_fail (g_hash_table_lookup (quark_code_pair_to_re, &pair) == NULL); /* check invariant */ + goto out; + } + + ret = TRUE; + + g_warn_if_fail (g_hash_table_lookup (quark_code_pair_to_re, &(re->pair)) == re); /* check invariant */ + + g_warn_if_fail (g_hash_table_remove (quark_code_pair_to_re, &(re->pair))); + g_warn_if_fail (g_hash_table_remove (dbus_error_name_to_re, re->dbus_error_name)); + + /* destroy hashes if empty */ + hash_size = g_hash_table_size (dbus_error_name_to_re); + if (hash_size == 0) + { + g_warn_if_fail (g_hash_table_size (quark_code_pair_to_re) == 0); /* check invariant */ + + g_hash_table_unref (dbus_error_name_to_re); + dbus_error_name_to_re = NULL; + g_hash_table_unref (quark_code_pair_to_re); + quark_code_pair_to_re = NULL; + } + else + { + g_warn_if_fail (g_hash_table_size (quark_code_pair_to_re) == hash_size); /* check invariant */ + } + + out: + G_UNLOCK (error_lock); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_error_is_remote_error: + * @error: A #GError. + * + * Checks if @error represents an error received via D-Bus from a remote peer. If so, + * use g_dbus_error_get_remote_error() to get the name of the error. + * + * Returns: %TRUE if @error represents an error from a remote peer, + * %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_error_is_remote_error (const GError *error) +{ + g_return_val_if_fail (error != NULL, FALSE); + return g_str_has_prefix (error->message, "GDBus.Error:"); +} + + +/** + * g_dbus_error_get_remote_error: + * @error: A #GError. + * + * Gets the D-Bus error name used for @error, if any. + * + * This function is guaranteed to return a D-Bus error name for all + * #GErrors returned from functions handling remote method + * calls (e.g. g_dbus_connection_call_finish()) unless + * g_dbus_error_strip_remote_error() has been used on @error. + * + * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free(). + * + * Since: 2.26 + */ +gchar * +g_dbus_error_get_remote_error (const GError *error) +{ + RegisteredError *re; + gchar *ret; + + g_return_val_if_fail (error != NULL, NULL); + + /* Ensure that e.g. G_DBUS_ERROR is registered using g_dbus_error_register_error() */ + _g_dbus_initialize (); + + ret = NULL; + + G_LOCK (error_lock); + + re = NULL; + if (quark_code_pair_to_re != NULL) + { + QuarkCodePair pair; + pair.error_domain = error->domain; + pair.error_code = error->code; + g_assert (dbus_error_name_to_re != NULL); /* check invariant */ + re = g_hash_table_lookup (quark_code_pair_to_re, &pair); + } + + if (re != NULL) + { + ret = g_strdup (re->dbus_error_name); + } + else + { + if (g_str_has_prefix (error->message, "GDBus.Error:")) + { + const gchar *begin; + const gchar *end; + begin = error->message + sizeof ("GDBus.Error:") -1; + end = strstr (begin, ":"); + if (end != NULL && end[1] == ' ') + { + ret = g_strndup (begin, end - begin); + } + } + } + + G_UNLOCK (error_lock); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_error_new_for_dbus_error: + * @dbus_error_name: D-Bus error name. + * @dbus_error_message: D-Bus error message. + * + * Creates a #GError based on the contents of @dbus_error_name and + * @dbus_error_message. + * + * Errors registered with g_dbus_error_register_error() will be looked + * up using @dbus_error_name and if a match is found, the error domain + * and code is used. Applications can use g_dbus_error_get_remote_error() + * to recover @dbus_error_name. + * + * If a match against a registered error is not found and the D-Bus + * error name is in a form as returned by g_dbus_error_encode_gerror() + * the error domain and code encoded in the name is used to + * create the #GError. Also, @dbus_error_name is added to the error message + * such that it can be recovered with g_dbus_error_get_remote_error(). + * + * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR + * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is + * added to the error message such that it can be recovered with + * g_dbus_error_get_remote_error(). + * + * In all three cases, @dbus_error_name can always be recovered from the + * returned #GError using the g_dbus_error_get_remote_error() function + * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error). + * + * This function is typically only used in object mappings to prepare + * #GError instances for applications. Regular applications should not use + * it. + * + * Returns: An allocated #GError. Free with g_error_free(). + * + * Since: 2.26 + */ +GError * +g_dbus_error_new_for_dbus_error (const gchar *dbus_error_name, + const gchar *dbus_error_message) +{ + GError *error; + RegisteredError *re; + + g_return_val_if_fail (dbus_error_name != NULL, NULL); + g_return_val_if_fail (dbus_error_message != NULL, NULL); + + /* Ensure that e.g. G_DBUS_ERROR is registered using g_dbus_error_register_error() */ + _g_dbus_initialize (); + + G_LOCK (error_lock); + + re = NULL; + if (dbus_error_name_to_re != NULL) + { + g_assert (quark_code_pair_to_re != NULL); /* check invariant */ + re = g_hash_table_lookup (dbus_error_name_to_re, dbus_error_name); + } + + if (re != NULL) + { + error = g_error_new (re->pair.error_domain, + re->pair.error_code, + "GDBus.Error:%s: %s", + dbus_error_name, + dbus_error_message); + } + else + { + GQuark error_domain = 0; + gint error_code = 0; + + if (_g_dbus_error_decode_gerror (dbus_error_name, + &error_domain, + &error_code)) + { + error = g_error_new (error_domain, + error_code, + "GDBus.Error:%s: %s", + dbus_error_name, + dbus_error_message); + } + else + { + error = g_error_new (G_IO_ERROR, + G_IO_ERROR_DBUS_ERROR, + "GDBus.Error:%s: %s", + dbus_error_name, + dbus_error_message); + } + } + + G_UNLOCK (error_lock); + return error; +} + +/** + * g_dbus_error_set_dbus_error: + * @error: A pointer to a #GError or %NULL. + * @dbus_error_name: D-Bus error name. + * @dbus_error_message: D-Bus error message. + * @format: printf()-style format to prepend to @dbus_error_message or %NULL. + * @...: Arguments for @format. + * + * Does nothing if @error is %NULL. Otherwise sets *@error to + * a new #GError created with g_dbus_error_new_for_dbus_error() + * with @dbus_error_message prepend with @format (unless %NULL). + * + * Since: 2.26 + */ +void +g_dbus_error_set_dbus_error (GError **error, + const gchar *dbus_error_name, + const gchar *dbus_error_message, + const gchar *format, + ...) +{ + g_return_if_fail (error == NULL || *error == NULL); + g_return_if_fail (dbus_error_name != NULL); + g_return_if_fail (dbus_error_message != NULL); + + if (error == NULL) + return; + + if (format == NULL) + { + *error = g_dbus_error_new_for_dbus_error (dbus_error_name, dbus_error_message); + } + else + { + va_list var_args; + va_start (var_args, format); + g_dbus_error_set_dbus_error_valist (error, + dbus_error_name, + dbus_error_message, + format, + var_args); + va_end (var_args); + } +} + +/** + * g_dbus_error_set_dbus_error_valist: + * @error: A pointer to a #GError or %NULL. + * @dbus_error_name: D-Bus error name. + * @dbus_error_message: D-Bus error message. + * @format: printf()-style format to prepend to @dbus_error_message or %NULL. + * @var_args: Arguments for @format. + * + * Like g_dbus_error_set_dbus_error() but intended for language bindings. + * + * Since: 2.26 + */ +void +g_dbus_error_set_dbus_error_valist (GError **error, + const gchar *dbus_error_name, + const gchar *dbus_error_message, + const gchar *format, + va_list var_args) +{ + g_return_if_fail (error == NULL || *error == NULL); + g_return_if_fail (dbus_error_name != NULL); + g_return_if_fail (dbus_error_message != NULL); + + if (error == NULL) + return; + + if (format != NULL) + { + gchar *message; + gchar *s; + message = g_strdup_vprintf (format, var_args); + s = g_strdup_printf ("%s: %s", message, dbus_error_message); + *error = g_dbus_error_new_for_dbus_error (dbus_error_name, s); + g_free (s); + g_free (message); + } + else + { + *error = g_dbus_error_new_for_dbus_error (dbus_error_name, dbus_error_message); + } +} + +/** + * g_dbus_error_strip_remote_error: + * @error: A #GError. + * + * Looks for extra information in the error message used to recover + * the D-Bus error name and strips it if found. If stripped, the + * message field in @error will correspond exactly to what was + * received on the wire. + * + * This is typically used when presenting errors to the end user. + * + * Returns: %TRUE if information was stripped, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_error_strip_remote_error (GError *error) +{ + gboolean ret; + + g_return_val_if_fail (error != NULL, FALSE); + + ret = FALSE; + + if (g_str_has_prefix (error->message, "GDBus.Error:")) + { + const gchar *begin; + const gchar *end; + gchar *new_message; + + begin = error->message + sizeof ("GDBus.Error:") -1; + end = strstr (begin, ":"); + if (end != NULL && end[1] == ' ') + { + new_message = g_strdup (end + 2); + g_free (error->message); + error->message = new_message; + ret = TRUE; + } + } + + return ret; +} + +/** + * g_dbus_error_encode_gerror: + * @error: A #GError. + * + * Creates a D-Bus error name to use for @error. If @error matches + * a registered error (cf. g_dbus_error_register_error()), the corresponding + * D-Bus error name will be returned. + * + * Otherwise the a name of the form + * org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE + * will be used. This allows other GDBus applications to map the error + * on the wire back to a #GError using g_dbus_error_new_for_dbus_error(). + * + * This function is typically only used in object mappings to put a + * #GError on the wire. Regular applications should not use it. + * + * Returns: A D-Bus error name (never %NULL). Free with g_free(). + * + * Since: 2.26 + */ +gchar * +g_dbus_error_encode_gerror (const GError *error) +{ + RegisteredError *re; + gchar *error_name; + + g_return_val_if_fail (error != NULL, NULL); + + /* Ensure that e.g. G_DBUS_ERROR is registered using g_dbus_error_register_error() */ + _g_dbus_initialize (); + + error_name = NULL; + + G_LOCK (error_lock); + re = NULL; + if (quark_code_pair_to_re != NULL) + { + QuarkCodePair pair; + pair.error_domain = error->domain; + pair.error_code = error->code; + g_assert (dbus_error_name_to_re != NULL); /* check invariant */ + re = g_hash_table_lookup (quark_code_pair_to_re, &pair); + } + if (re != NULL) + { + error_name = g_strdup (re->dbus_error_name); + G_UNLOCK (error_lock); + } + else + { + const gchar *domain_as_string; + GString *s; + guint n; + + G_UNLOCK (error_lock); + + /* We can't make a lot of assumptions about what domain_as_string + * looks like and D-Bus is extremely picky about error names so + * hex-encode it for transport across the wire. + */ + domain_as_string = g_quark_to_string (error->domain); + s = g_string_new ("org.gtk.GDBus.UnmappedGError.Quark._"); + for (n = 0; domain_as_string[n] != 0; n++) + { + gint c = domain_as_string[n]; + if (g_ascii_isalnum (c)) + { + g_string_append_c (s, c); + } + else + { + guint nibble_top; + guint nibble_bottom; + g_string_append_c (s, '_'); + nibble_top = ((int) domain_as_string[n]) >> 4; + nibble_bottom = ((int) domain_as_string[n]) & 0x0f; + if (nibble_top < 10) + nibble_top += '0'; + else + nibble_top += 'a' - 10; + if (nibble_bottom < 10) + nibble_bottom += '0'; + else + nibble_bottom += 'a' - 10; + g_string_append_c (s, nibble_top); + g_string_append_c (s, nibble_bottom); + } + } + g_string_append_printf (s, ".Code%d", error->code); + error_name = g_string_free (s, FALSE); + } + + return error_name; +} diff --git a/gio/gdbuserror.h b/gio/gdbuserror.h new file mode 100644 index 0000000..85e2f88 --- /dev/null +++ b/gio/gdbuserror.h @@ -0,0 +1,100 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_ERROR_H__ +#define __G_DBUS_ERROR_H__ + +#include + +G_BEGIN_DECLS + +/** + * G_DBUS_ERROR: + * + * Error domain for errors generated by a remote message bus. Errors + * in this domain will be from the #GDBusError enumeration. See + * #GError for more information on error domains. + * + * Note that errors in this error domain is intended only for + * returning errors from a remote message bus process. Errors + * generated locally in-process by e.g. #GDBusConnection is from the + * %G_IO_ERROR domain. + * + * Since: 2.26 + */ +#define G_DBUS_ERROR g_dbus_error_quark() + +GQuark g_dbus_error_quark (void); + +/* Used by applications to check, get and strip the D-Bus error name */ +gboolean g_dbus_error_is_remote_error (const GError *error); +gchar *g_dbus_error_get_remote_error (const GError *error); +gboolean g_dbus_error_strip_remote_error (GError *error); + +/** + * GDBusErrorEntry: + * @error_code: An error code. + * @dbus_error_name: The D-Bus error name to associate with @error_code. + * + * Struct used in g_dbus_error_register_error_domain(). + * + * Since: 2.26 + */ +struct _GDBusErrorEntry +{ + gint error_code; + const gchar *dbus_error_name; +}; + +gboolean g_dbus_error_register_error (GQuark error_domain, + gint error_code, + const gchar *dbus_error_name); +gboolean g_dbus_error_unregister_error (GQuark error_domain, + gint error_code, + const gchar *dbus_error_name); +void g_dbus_error_register_error_domain (const gchar *error_domain_quark_name, + volatile gsize *quark_volatile, + const GDBusErrorEntry *entries, + guint num_entries); + +/* Only used by object mappings to map back and forth to GError */ +GError *g_dbus_error_new_for_dbus_error (const gchar *dbus_error_name, + const gchar *dbus_error_message); +void g_dbus_error_set_dbus_error (GError **error, + const gchar *dbus_error_name, + const gchar *dbus_error_message, + const gchar *format, + ...); +void g_dbus_error_set_dbus_error_valist (GError **error, + const gchar *dbus_error_name, + const gchar *dbus_error_message, + const gchar *format, + va_list var_args); +gchar *g_dbus_error_encode_gerror (const GError *error); + +G_END_DECLS + +#endif /* __G_DBUS_ERROR_H__ */ diff --git a/gio/gdbusintrospection.c b/gio/gdbusintrospection.c new file mode 100644 index 0000000..e79bf95 --- /dev/null +++ b/gio/gdbusintrospection.c @@ -0,0 +1,2065 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include + +#include "gdbusintrospection.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusintrospection + * @title: D-Bus Introspection Data + * @short_description: Node and interface description data structures + * @include: gio/gio.h + * + * Various data structures and convenience routines to parse and + * generate D-Bus introspection XML. Introspection information is + * used when registering objects with g_dbus_connection_register_object(). + * + * The format of D-Bus introspection XML is specified in the + * D-Bus specification. + */ + +/* ---------------------------------------------------------------------------------------------------- */ + +#define _MY_DEFINE_BOXED_TYPE(TypeName, type_name) \ + G_DEFINE_BOXED_TYPE (TypeName, type_name, type_name##_ref, type_name##_unref) + +_MY_DEFINE_BOXED_TYPE (GDBusNodeInfo, g_dbus_node_info); +_MY_DEFINE_BOXED_TYPE (GDBusInterfaceInfo, g_dbus_interface_info); +_MY_DEFINE_BOXED_TYPE (GDBusMethodInfo, g_dbus_method_info); +_MY_DEFINE_BOXED_TYPE (GDBusSignalInfo, g_dbus_signal_info); +_MY_DEFINE_BOXED_TYPE (GDBusPropertyInfo, g_dbus_property_info); +_MY_DEFINE_BOXED_TYPE (GDBusArgInfo, g_dbus_arg_info); +_MY_DEFINE_BOXED_TYPE (GDBusAnnotationInfo, g_dbus_annotation_info); + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + /* stuff we are currently collecting */ + GPtrArray *args; + GPtrArray *out_args; + GPtrArray *methods; + GPtrArray *signals; + GPtrArray *properties; + GPtrArray *interfaces; + GPtrArray *nodes; + GPtrArray *annotations; + + /* A list of GPtrArray's containing annotations */ + GSList *annotations_stack; + + /* A list of GPtrArray's containing interfaces */ + GSList *interfaces_stack; + + /* A list of GPtrArray's containing nodes */ + GSList *nodes_stack; + + /* Whether the direction was "in" for last parsed arg */ + gboolean last_arg_was_in; + + /* Number of args currently being collected; used for assigning + * names to args without a "name" attribute + */ + guint num_args; + +} ParseData; + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_node_info_ref: + * @info: A #GDBusNodeInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusNodeInfo * +g_dbus_node_info_ref (GDBusNodeInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/** + * g_dbus_interface_info_ref: + * @info: A #GDBusInterfaceInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusInterfaceInfo * +g_dbus_interface_info_ref (GDBusInterfaceInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/** + * g_dbus_method_info_ref: + * @info: A #GDBusMethodInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusMethodInfo * +g_dbus_method_info_ref (GDBusMethodInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/** + * g_dbus_signal_info_ref: + * @info: A #GDBusSignalInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusSignalInfo * +g_dbus_signal_info_ref (GDBusSignalInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/** + * g_dbus_property_info_ref: + * @info: A #GDBusPropertyInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusPropertyInfo * +g_dbus_property_info_ref (GDBusPropertyInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/** + * g_dbus_arg_info_ref: + * @info: A #GDBusArgInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusArgInfo * +g_dbus_arg_info_ref (GDBusArgInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/** + * g_dbus_annotation_info_ref: + * @info: A #GDBusNodeInfo + * + * If @info is statically allocated does nothing. Otherwise increases + * the reference count. + * + * Returns: The same @info. + * + * Since: 2.26 + */ +GDBusAnnotationInfo * +g_dbus_annotation_info_ref (GDBusAnnotationInfo *info) +{ + if (info->ref_count == -1) + return info; + g_atomic_int_inc (&info->ref_count); + return info; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +free_null_terminated_array (gpointer array, GDestroyNotify unref_func) +{ + guint n; + gpointer *p = array; + if (p == NULL) + return; + for (n = 0; p[n] != NULL; n++) + unref_func (p[n]); + g_free (p); +} + +/** + * g_dbus_annotation_info_unref: + * @info: A #GDBusAnnotationInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_annotation_info_unref (GDBusAnnotationInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->key); + g_free (info->value); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/** + * g_dbus_arg_info_unref: + * @info: A #GDBusArgInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_arg_info_unref (GDBusArgInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->name); + g_free (info->signature); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/** + * g_dbus_method_info_unref: + * @info: A #GDBusMethodInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_method_info_unref (GDBusMethodInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->name); + free_null_terminated_array (info->in_args, (GDestroyNotify) g_dbus_arg_info_unref); + free_null_terminated_array (info->out_args, (GDestroyNotify) g_dbus_arg_info_unref); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/** + * g_dbus_signal_info_unref: + * @info: A #GDBusSignalInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_signal_info_unref (GDBusSignalInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->name); + free_null_terminated_array (info->args, (GDestroyNotify) g_dbus_arg_info_unref); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/** + * g_dbus_property_info_unref: + * @info: A #GDBusPropertyInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_property_info_unref (GDBusPropertyInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->name); + g_free (info->signature); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/** + * g_dbus_interface_info_unref: + * @info: A #GDBusInterfaceInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_interface_info_unref (GDBusInterfaceInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->name); + free_null_terminated_array (info->methods, (GDestroyNotify) g_dbus_method_info_unref); + free_null_terminated_array (info->signals, (GDestroyNotify) g_dbus_signal_info_unref); + free_null_terminated_array (info->properties, (GDestroyNotify) g_dbus_property_info_unref); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/** + * g_dbus_node_info_unref: + * @info: A #GDBusNodeInfo. + * + * If @info is statically allocated, does nothing. Otherwise decreases + * the reference count of @info. When its reference count drops to 0, + * the memory used is freed. + * + * Since: 2.26 + */ +void +g_dbus_node_info_unref (GDBusNodeInfo *info) +{ + if (info->ref_count == -1) + return; + if (g_atomic_int_dec_and_test (&info->ref_count)) + { + g_free (info->path); + free_null_terminated_array (info->interfaces, (GDestroyNotify) g_dbus_interface_info_unref); + free_null_terminated_array (info->nodes, (GDestroyNotify) g_dbus_node_info_unref); + free_null_terminated_array (info->annotations, (GDestroyNotify) g_dbus_annotation_info_unref); + g_free (info); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +g_dbus_annotation_info_set (ParseData *data, + GDBusAnnotationInfo *info, + const gchar *key, + const gchar *value, + GDBusAnnotationInfo **embedded_annotations) +{ + info->ref_count = 1; + + if (key != NULL) + info->key = g_strdup (key); + + if (value != NULL) + info->value = g_strdup (value); + + if (embedded_annotations != NULL) + info->annotations = embedded_annotations; +} + +static void +g_dbus_arg_info_set (ParseData *data, + GDBusArgInfo *info, + const gchar *name, + const gchar *signature, + GDBusAnnotationInfo **annotations) +{ + info->ref_count = 1; + + /* name may be NULL - TODO: compute name? */ + if (name != NULL) + info->name = g_strdup (name); + + if (signature != NULL) + info->signature = g_strdup (signature); + + if (annotations != NULL) + info->annotations = annotations; +} + +static void +g_dbus_method_info_set (ParseData *data, + GDBusMethodInfo *info, + const gchar *name, + guint in_num_args, + GDBusArgInfo **in_args, + guint out_num_args, + GDBusArgInfo **out_args, + GDBusAnnotationInfo **annotations) +{ + info->ref_count = 1; + + if (name != NULL) + info->name = g_strdup (name); + + if (in_num_args != 0) + { + //info->in_num_args = in_num_args; + info->in_args = in_args; + } + + if (out_num_args != 0) + { + //info->out_num_args = out_num_args; + info->out_args = out_args; + } + + if (annotations != NULL) + info->annotations = annotations; +} + +static void +g_dbus_signal_info_set (ParseData *data, + GDBusSignalInfo *info, + const gchar *name, + guint num_args, + GDBusArgInfo **args, + GDBusAnnotationInfo **annotations) +{ + info->ref_count = 1; + + if (name != NULL) + info->name = g_strdup (name); + + if (num_args != 0) + { + //info->num_args = num_args; + info->args = args; + } + + if (annotations != NULL) + { + info->annotations = annotations; + } +} + +static void +g_dbus_property_info_set (ParseData *data, + GDBusPropertyInfo *info, + const gchar *name, + const gchar *signature, + GDBusPropertyInfoFlags flags, + GDBusAnnotationInfo **annotations) +{ + info->ref_count = 1; + + if (name != NULL) + info->name = g_strdup (name); + + if (flags != G_DBUS_PROPERTY_INFO_FLAGS_NONE) + info->flags = flags; + + if (signature != NULL) + { + info->signature = g_strdup (signature); + } + + if (annotations != NULL) + { + info->annotations = annotations; + } +} + +static void +g_dbus_interface_info_set (ParseData *data, + GDBusInterfaceInfo *info, + const gchar *name, + guint num_methods, + GDBusMethodInfo **methods, + guint num_signals, + GDBusSignalInfo **signals, + guint num_properties, + GDBusPropertyInfo **properties, + GDBusAnnotationInfo **annotations) +{ + info->ref_count = 1; + + if (name != NULL) + { + info->name = g_strdup (name); + } + + if (num_methods != 0) + { + //info->num_methods = num_methods; + info->methods = methods; + } + + if (num_signals != 0) + { + //info->num_signals = num_signals; + info->signals = signals; + } + + if (num_properties != 0) + { + //info->num_properties = num_properties; + info->properties = properties; + } + + if (annotations != NULL) + { + info->annotations = annotations; + } +} + +static void +g_dbus_node_info_set (ParseData *data, + GDBusNodeInfo *info, + const gchar *path, + guint num_interfaces, + GDBusInterfaceInfo **interfaces, + guint num_nodes, + GDBusNodeInfo **nodes, + GDBusAnnotationInfo **annotations) +{ + info->ref_count = 1; + + if (path != NULL) + { + info->path = g_strdup (path); + /* TODO: relative / absolute path snafu */ + } + + if (num_interfaces != 0) + { + //info->num_interfaces = num_interfaces; + info->interfaces = interfaces; + } + + if (num_nodes != 0) + { + //info->num_nodes = num_nodes; + info->nodes = nodes; + } + + if (annotations != NULL) + { + info->annotations = annotations; + } + +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +g_dbus_annotation_info_generate_xml (GDBusAnnotationInfo *info, + guint indent, + GString *string_builder) +{ + guint n; + + g_string_append_printf (string_builder, "%*skey, + info->value); + + if (info->annotations == NULL) + { + g_string_append (string_builder, "/>\n"); + } + else + { + g_string_append (string_builder, ">\n"); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + g_string_append_printf (string_builder, "%*s\n", + indent, ""); + } + +} + +static void +g_dbus_arg_info_generate_xml (GDBusArgInfo *info, + guint indent, + const gchar *extra_attributes, + GString *string_builder) +{ + guint n; + + g_string_append_printf (string_builder, "%*ssignature); + + if (info->name != NULL) + g_string_append_printf (string_builder, " name=\"%s\"", info->name); + + if (extra_attributes != NULL) + g_string_append_printf (string_builder, " %s", extra_attributes); + + if (info->annotations == NULL) + { + g_string_append (string_builder, "/>\n"); + } + else + { + g_string_append (string_builder, ">\n"); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + g_string_append_printf (string_builder, "%*s\n", indent, ""); + } + +} + +static void +g_dbus_method_info_generate_xml (GDBusMethodInfo *info, + guint indent, + GString *string_builder) +{ + guint n; + + g_string_append_printf (string_builder, "%*sname); + + if (info->annotations == NULL && info->in_args == NULL && info->out_args == NULL) + { + g_string_append (string_builder, "/>\n"); + } + else + { + g_string_append (string_builder, ">\n"); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + for (n = 0; info->in_args != NULL && info->in_args[n] != NULL; n++) + g_dbus_arg_info_generate_xml (info->in_args[n], + indent + 2, + "direction=\"in\"", + string_builder); + + for (n = 0; info->out_args != NULL && info->out_args[n] != NULL; n++) + g_dbus_arg_info_generate_xml (info->out_args[n], + indent + 2, + "direction=\"out\"", + string_builder); + + g_string_append_printf (string_builder, "%*s\n", indent, ""); + } +} + +static void +g_dbus_signal_info_generate_xml (GDBusSignalInfo *info, + guint indent, + GString *string_builder) +{ + guint n; + + g_string_append_printf (string_builder, "%*sname); + + if (info->annotations == NULL && info->args == NULL) + { + g_string_append (string_builder, "/>\n"); + } + else + { + g_string_append (string_builder, ">\n"); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + for (n = 0; info->args != NULL && info->args[n] != NULL; n++) + g_dbus_arg_info_generate_xml (info->args[n], + indent + 2, + NULL, + string_builder); + + g_string_append_printf (string_builder, "%*s\n", indent, ""); + } +} + +static void +g_dbus_property_info_generate_xml (GDBusPropertyInfo *info, + guint indent, + GString *string_builder) +{ + guint n; + const gchar *access_string; + + if ((info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) && + (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE)) + { + access_string = "readwrite"; + } + else if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + access_string = "read"; + } + else if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE) + { + access_string = "write"; + } + else + { + g_assert_not_reached (); + } + + g_string_append_printf (string_builder, "%*ssignature, + info->name, + access_string); + + if (info->annotations == NULL) + { + g_string_append (string_builder, "/>\n"); + } + else + { + g_string_append (string_builder, ">\n"); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + g_string_append_printf (string_builder, "%*s\n", indent, ""); + } + +} + +/** + * g_dbus_interface_info_generate_xml: + * @info: A #GDBusNodeInfo + * @indent: Indentation level. + * @string_builder: A #GString to to append XML data to. + * + * Appends an XML representation of @info (and its children) to @string_builder. + * + * This function is typically used for generating introspection XML + * documents at run-time for handling the + * org.freedesktop.DBus.Introspectable.Introspect + * method. + * + * Since: 2.26 + */ +void +g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info, + guint indent, + GString *string_builder) +{ + guint n; + + g_string_append_printf (string_builder, "%*s\n", + indent, "", + info->name); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + for (n = 0; info->methods != NULL && info->methods[n] != NULL; n++) + g_dbus_method_info_generate_xml (info->methods[n], + indent + 2, + string_builder); + + for (n = 0; info->signals != NULL && info->signals[n] != NULL; n++) + g_dbus_signal_info_generate_xml (info->signals[n], + indent + 2, + string_builder); + + for (n = 0; info->properties != NULL && info->properties[n] != NULL; n++) + g_dbus_property_info_generate_xml (info->properties[n], + indent + 2, + string_builder); + + g_string_append_printf (string_builder, "%*s\n", indent, ""); +} + +/** + * g_dbus_node_info_generate_xml: + * @info: A #GDBusNodeInfo. + * @indent: Indentation level. + * @string_builder: A #GString to to append XML data to. + * + * Appends an XML representation of @info (and its children) to @string_builder. + * + * This function is typically used for generating introspection XML documents at run-time for + * handling the org.freedesktop.DBus.Introspectable.Introspect method. + * + * Since: 2.26 + */ +void +g_dbus_node_info_generate_xml (GDBusNodeInfo *info, + guint indent, + GString *string_builder) +{ + guint n; + + g_string_append_printf (string_builder, "%*spath != NULL) + g_string_append_printf (string_builder, " name=\"%s\"", info->path); + + if (info->interfaces == NULL && info->nodes == NULL && info->annotations == NULL) + { + g_string_append (string_builder, "/>\n"); + } + else + { + g_string_append (string_builder, ">\n"); + + for (n = 0; info->annotations != NULL && info->annotations[n] != NULL; n++) + g_dbus_annotation_info_generate_xml (info->annotations[n], + indent + 2, + string_builder); + + for (n = 0; info->interfaces != NULL && info->interfaces[n] != NULL; n++) + g_dbus_interface_info_generate_xml (info->interfaces[n], + indent + 2, + string_builder); + + for (n = 0; info->nodes != NULL && info->nodes[n] != NULL; n++) + g_dbus_node_info_generate_xml (info->nodes[n], + indent + 2, + string_builder); + + g_string_append_printf (string_builder, "%*s\n", indent, ""); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAnnotationInfo ** +parse_data_steal_annotations (ParseData *data, + guint *out_num_elements) +{ + GDBusAnnotationInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->annotations->len; + if (data->annotations == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->annotations, NULL); + ret = (GDBusAnnotationInfo **) g_ptr_array_free (data->annotations, FALSE); + } + data->annotations = g_ptr_array_new (); + return ret; +} + +static GDBusArgInfo ** +parse_data_steal_args (ParseData *data, + guint *out_num_elements) +{ + GDBusArgInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->args->len; + if (data->args == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->args, NULL); + ret = (GDBusArgInfo **) g_ptr_array_free (data->args, FALSE); + } + data->args = g_ptr_array_new (); + return ret; +} + +static GDBusArgInfo ** +parse_data_steal_out_args (ParseData *data, + guint *out_num_elements) +{ + GDBusArgInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->out_args->len; + if (data->out_args == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->out_args, NULL); + ret = (GDBusArgInfo **) g_ptr_array_free (data->out_args, FALSE); + } + data->out_args = g_ptr_array_new (); + return ret; +} + +static GDBusMethodInfo ** +parse_data_steal_methods (ParseData *data, + guint *out_num_elements) +{ + GDBusMethodInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->methods->len; + if (data->methods == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->methods, NULL); + ret = (GDBusMethodInfo **) g_ptr_array_free (data->methods, FALSE); + } + data->methods = g_ptr_array_new (); + return ret; +} + +static GDBusSignalInfo ** +parse_data_steal_signals (ParseData *data, + guint *out_num_elements) +{ + GDBusSignalInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->signals->len; + if (data->signals == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->signals, NULL); + ret = (GDBusSignalInfo **) g_ptr_array_free (data->signals, FALSE); + } + data->signals = g_ptr_array_new (); + return ret; +} + +static GDBusPropertyInfo ** +parse_data_steal_properties (ParseData *data, + guint *out_num_elements) +{ + GDBusPropertyInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->properties->len; + if (data->properties == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->properties, NULL); + ret = (GDBusPropertyInfo **) g_ptr_array_free (data->properties, FALSE); + } + data->properties = g_ptr_array_new (); + return ret; +} + +static GDBusInterfaceInfo ** +parse_data_steal_interfaces (ParseData *data, + guint *out_num_elements) +{ + GDBusInterfaceInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->interfaces->len; + if (data->interfaces == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->interfaces, NULL); + ret = (GDBusInterfaceInfo **) g_ptr_array_free (data->interfaces, FALSE); + } + data->interfaces = g_ptr_array_new (); + return ret; +} + +static GDBusNodeInfo ** +parse_data_steal_nodes (ParseData *data, + guint *out_num_elements) +{ + GDBusNodeInfo **ret; + if (out_num_elements != NULL) + *out_num_elements = data->nodes->len; + if (data->nodes == NULL) + ret = NULL; + else + { + g_ptr_array_add (data->nodes, NULL); + ret = (GDBusNodeInfo **) g_ptr_array_free (data->nodes, FALSE); + } + data->nodes = g_ptr_array_new (); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +parse_data_free_annotations (ParseData *data) +{ + if (data->annotations == NULL) + return; + g_ptr_array_foreach (data->annotations, (GFunc) g_dbus_annotation_info_unref, NULL); + g_ptr_array_free (data->annotations, TRUE); + data->annotations = NULL; +} + +static void +parse_data_free_args (ParseData *data) +{ + if (data->args == NULL) + return; + g_ptr_array_foreach (data->args, (GFunc) g_dbus_arg_info_unref, NULL); + g_ptr_array_free (data->args, TRUE); + data->args = NULL; +} + +static void +parse_data_free_out_args (ParseData *data) +{ + if (data->out_args == NULL) + return; + g_ptr_array_foreach (data->out_args, (GFunc) g_dbus_arg_info_unref, NULL); + g_ptr_array_free (data->out_args, TRUE); + data->out_args = NULL; +} + +static void +parse_data_free_methods (ParseData *data) +{ + if (data->methods == NULL) + return; + g_ptr_array_foreach (data->methods, (GFunc) g_dbus_method_info_unref, NULL); + g_ptr_array_free (data->methods, TRUE); + data->methods = NULL; +} + +static void +parse_data_free_signals (ParseData *data) +{ + if (data->signals == NULL) + return; + g_ptr_array_foreach (data->signals, (GFunc) g_dbus_signal_info_unref, NULL); + g_ptr_array_free (data->signals, TRUE); + data->signals = NULL; +} + +static void +parse_data_free_properties (ParseData *data) +{ + if (data->properties == NULL) + return; + g_ptr_array_foreach (data->properties, (GFunc) g_dbus_property_info_unref, NULL); + g_ptr_array_free (data->properties, TRUE); + data->properties = NULL; +} + +static void +parse_data_free_interfaces (ParseData *data) +{ + if (data->interfaces == NULL) + return; + g_ptr_array_foreach (data->interfaces, (GFunc) g_dbus_interface_info_unref, NULL); + g_ptr_array_free (data->interfaces, TRUE); + data->interfaces = NULL; +} + +static void +parse_data_free_nodes (ParseData *data) +{ + if (data->nodes == NULL) + return; + g_ptr_array_foreach (data->nodes, (GFunc) g_dbus_node_info_unref, NULL); + g_ptr_array_free (data->nodes, TRUE); + data->nodes = NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAnnotationInfo * +parse_data_get_annotation (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->annotations, g_new0 (GDBusAnnotationInfo, 1)); + return data->annotations->pdata[data->annotations->len - 1]; +} + +static GDBusArgInfo * +parse_data_get_arg (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->args, g_new0 (GDBusArgInfo, 1)); + return data->args->pdata[data->args->len - 1]; +} + +static GDBusArgInfo * +parse_data_get_out_arg (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->out_args, g_new0 (GDBusArgInfo, 1)); + return data->out_args->pdata[data->out_args->len - 1]; +} + +static GDBusMethodInfo * +parse_data_get_method (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->methods, g_new0 (GDBusMethodInfo, 1)); + return data->methods->pdata[data->methods->len - 1]; +} + +static GDBusSignalInfo * +parse_data_get_signal (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->signals, g_new0 (GDBusSignalInfo, 1)); + return data->signals->pdata[data->signals->len - 1]; +} + +static GDBusPropertyInfo * +parse_data_get_property (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->properties, g_new0 (GDBusPropertyInfo, 1)); + return data->properties->pdata[data->properties->len - 1]; +} + +static GDBusInterfaceInfo * +parse_data_get_interface (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->interfaces, g_new0 (GDBusInterfaceInfo, 1)); + return data->interfaces->pdata[data->interfaces->len - 1]; +} + +static GDBusNodeInfo * +parse_data_get_node (ParseData *data, + gboolean create_new) +{ + if (create_new) + g_ptr_array_add (data->nodes, g_new0 (GDBusNodeInfo, 1)); + return data->nodes->pdata[data->nodes->len - 1]; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static ParseData * +parse_data_new (void) +{ + ParseData *data; + + data = g_new0 (ParseData, 1); + + /* initialize arrays */ + parse_data_steal_annotations (data, NULL); + parse_data_steal_args (data, NULL); + parse_data_steal_out_args (data, NULL); + parse_data_steal_methods (data, NULL); + parse_data_steal_signals (data, NULL); + parse_data_steal_properties (data, NULL); + parse_data_steal_interfaces (data, NULL); + parse_data_steal_nodes (data, NULL); + + return data; +} + +static void +parse_data_free (ParseData *data) +{ + GSList *l; + + /* free stack of annotation arrays */ + for (l = data->annotations_stack; l != NULL; l = l->next) + { + GPtrArray *annotations = l->data; + g_ptr_array_foreach (annotations, (GFunc) g_dbus_annotation_info_unref, NULL); + g_ptr_array_free (annotations, TRUE); + } + g_slist_free (data->annotations_stack); + + /* free stack of interface arrays */ + for (l = data->interfaces_stack; l != NULL; l = l->next) + { + GPtrArray *interfaces = l->data; + g_ptr_array_foreach (interfaces, (GFunc) g_dbus_interface_info_unref, NULL); + g_ptr_array_free (interfaces, TRUE); + } + g_slist_free (data->interfaces_stack); + + /* free stack of node arrays */ + for (l = data->nodes_stack; l != NULL; l = l->next) + { + GPtrArray *nodes = l->data; + g_ptr_array_foreach (nodes, (GFunc) g_dbus_node_info_unref, NULL); + g_ptr_array_free (nodes, TRUE); + } + g_slist_free (data->nodes_stack); + + /* free arrays (data->annotations, data->interfaces and data->nodes have been freed above) */ + parse_data_free_args (data); + parse_data_free_out_args (data); + parse_data_free_methods (data); + parse_data_free_signals (data); + parse_data_free_properties (data); + + g_free (data); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +parser_start_element (GMarkupParseContext *context, + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **error) +{ + ParseData *data = user_data; + GSList *stack; + const gchar *name; + const gchar *type; + const gchar *access; + const gchar *direction; + const gchar *value; + + name = NULL; + type = NULL; + access = NULL; + direction = NULL; + value = NULL; + + stack = (GSList *) g_markup_parse_context_get_element_stack (context); + + /* ---------------------------------------------------------------------------------------------------- */ + if (strcmp (element_name, "node") == 0) + { + if (!(g_slist_length (stack) >= 1 || strcmp (stack->next->data, "node") != 0)) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be top-level or embedded in other elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "name", &name, + /* some hand-written introspection XML documents use this */ + G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "xmlns:doc", NULL, + G_MARKUP_COLLECT_INVALID)) + goto out; + + g_dbus_node_info_set (data, + parse_data_get_node (data, TRUE), + name, + 0, NULL, + 0, NULL, + NULL); + + /* push the currently retrieved interfaces and nodes on the stack and prepare new arrays */ + data->interfaces_stack = g_slist_prepend (data->interfaces_stack, data->interfaces); + data->interfaces = NULL; + parse_data_steal_interfaces (data, NULL); + + data->nodes_stack = g_slist_prepend (data->nodes_stack, data->nodes); + data->nodes = NULL; + parse_data_steal_nodes (data, NULL); + + } + /* ---------------------------------------------------------------------------------------------------- */ + else if (strcmp (element_name, "interface") == 0) + { + if (g_slist_length (stack) < 2 || strcmp (stack->next->data, "node") != 0) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be embedded in elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING, "name", &name, + G_MARKUP_COLLECT_INVALID)) + goto out; + + g_dbus_interface_info_set (data, + parse_data_get_interface (data, TRUE), + name, + 0, NULL, + 0, NULL, + 0, NULL, + NULL); + + } + /* ---------------------------------------------------------------------------------------------------- */ + else if (strcmp (element_name, "method") == 0) + { + if (g_slist_length (stack) < 2 || strcmp (stack->next->data, "interface") != 0) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be embedded in elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING, "name", &name, + G_MARKUP_COLLECT_INVALID)) + goto out; + + g_dbus_method_info_set (data, + parse_data_get_method (data, TRUE), + name, + 0, NULL, + 0, NULL, + NULL); + + data->num_args = 0; + + } + /* ---------------------------------------------------------------------------------------------------- */ + else if (strcmp (element_name, "signal") == 0) + { + if (g_slist_length (stack) < 2 || strcmp (stack->next->data, "interface") != 0) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be embedded in elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING, "name", &name, + G_MARKUP_COLLECT_INVALID)) + goto out; + + g_dbus_signal_info_set (data, + parse_data_get_signal (data, TRUE), + name, + 0, NULL, + NULL); + + data->num_args = 0; + + } + /* ---------------------------------------------------------------------------------------------------- */ + else if (strcmp (element_name, "property") == 0) + { + GDBusPropertyInfoFlags flags; + + if (g_slist_length (stack) < 2 || strcmp (stack->next->data, "interface") != 0) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be embedded in elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING, "name", &name, + G_MARKUP_COLLECT_STRING, "type", &type, + G_MARKUP_COLLECT_STRING, "access", &access, + G_MARKUP_COLLECT_INVALID)) + goto out; + + if (strcmp (access, "read") == 0) + flags = G_DBUS_PROPERTY_INFO_FLAGS_READABLE; + else if (strcmp (access, "write") == 0) + flags = G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE; + else if (strcmp (access, "readwrite") == 0) + flags = G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE; + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "Unknown value '%s' of access attribute for element ", + access); + goto out; + } + + g_dbus_property_info_set (data, + parse_data_get_property (data, TRUE), + name, + type, + flags, + NULL); + + } + /* ---------------------------------------------------------------------------------------------------- */ + else if (strcmp (element_name, "arg") == 0) + { + gboolean is_in; + gchar *name_to_use; + + if (g_slist_length (stack) < 2 || + (strcmp (stack->next->data, "method") != 0 && + strcmp (stack->next->data, "signal") != 0)) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be embedded in or elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "name", &name, + G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "direction", &direction, + G_MARKUP_COLLECT_STRING, "type", &type, + G_MARKUP_COLLECT_INVALID)) + goto out; + + if (strcmp (stack->next->data, "method") == 0) + is_in = TRUE; + else + is_in = FALSE; + if (direction != NULL) + { + if (strcmp (direction, "in") == 0) + is_in = TRUE; + else if (strcmp (direction, "out") == 0) + is_in = FALSE; + else + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "Unknown value '%s' of direction attribute", + direction); + goto out; + } + } + + if (is_in && strcmp (stack->next->data, "signal") == 0) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "Only direction 'out' is allowed for elements embedded in "); + goto out; + } + + if (name == NULL) + name_to_use = g_strdup_printf ("arg_%d", data->num_args); + else + name_to_use = g_strdup (name); + data->num_args++; + + if (is_in) + { + g_dbus_arg_info_set (data, + parse_data_get_arg (data, TRUE), + name_to_use, + type, + NULL); + data->last_arg_was_in = TRUE; + } + else + { + g_dbus_arg_info_set (data, + parse_data_get_out_arg (data, TRUE), + name_to_use, + type, + NULL); + data->last_arg_was_in = FALSE; + + } + + g_free (name_to_use); + } + /* ---------------------------------------------------------------------------------------------------- */ + else if (strcmp (element_name, "annotation") == 0) + { + if (g_slist_length (stack) < 2 || + (strcmp (stack->next->data, "node") != 0 && + strcmp (stack->next->data, "interface") != 0 && + strcmp (stack->next->data, "signal") != 0 && + strcmp (stack->next->data, "method") != 0 && + strcmp (stack->next->data, "property") != 0 && + strcmp (stack->next->data, "arg") != 0 && + strcmp (stack->next->data, "annotation") != 0)) + { + g_set_error_literal (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " elements can only be embedded in , , , , , or elements"); + goto out; + } + + if (!g_markup_collect_attributes (element_name, + attribute_names, + attribute_values, + error, + G_MARKUP_COLLECT_STRING, "name", &name, + G_MARKUP_COLLECT_STRING, "value", &value, + G_MARKUP_COLLECT_INVALID)) + goto out; + + g_dbus_annotation_info_set (data, + parse_data_get_annotation (data, TRUE), + name, + value, + NULL); + } + /* ---------------------------------------------------------------------------------------------------- */ + else + { + /* don't bail on unknown elements; just ignore them */ + } + /* ---------------------------------------------------------------------------------------------------- */ + + /* push the currently retrieved annotations on the stack and prepare a new one */ + data->annotations_stack = g_slist_prepend (data->annotations_stack, data->annotations); + data->annotations = NULL; + parse_data_steal_annotations (data, NULL); + + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusAnnotationInfo ** +steal_annotations (ParseData *data) +{ + return parse_data_steal_annotations (data, NULL); +} + + +static void +parser_end_element (GMarkupParseContext *context, + const gchar *element_name, + gpointer user_data, + GError **error) +{ + ParseData *data = user_data; + gboolean have_popped_annotations; + + have_popped_annotations = FALSE; + + if (strcmp (element_name, "node") == 0) + { + guint num_nodes; + guint num_interfaces; + GDBusNodeInfo **nodes; + GDBusInterfaceInfo **interfaces; + + nodes = parse_data_steal_nodes (data, &num_nodes); + interfaces = parse_data_steal_interfaces (data, &num_interfaces); + + /* destroy the nodes, interfaces for scope we're exiting and and pop the nodes, interfaces from the + * scope we're reentering + */ + parse_data_free_interfaces (data); + data->interfaces = (GPtrArray *) data->interfaces_stack->data; + data->interfaces_stack = g_slist_remove (data->interfaces_stack, data->interfaces_stack->data); + + parse_data_free_nodes (data); + data->nodes = (GPtrArray *) data->nodes_stack->data; + data->nodes_stack = g_slist_remove (data->nodes_stack, data->nodes_stack->data); + + g_dbus_node_info_set (data, + parse_data_get_node (data, FALSE), + NULL, + num_interfaces, + interfaces, + num_nodes, + nodes, + steal_annotations (data)); + + } + else if (strcmp (element_name, "interface") == 0) + { + guint num_methods; + guint num_signals; + guint num_properties; + GDBusMethodInfo **methods; + GDBusSignalInfo **signals; + GDBusPropertyInfo **properties; + + methods = parse_data_steal_methods (data, &num_methods); + signals = parse_data_steal_signals (data, &num_signals); + properties = parse_data_steal_properties (data, &num_properties); + + g_dbus_interface_info_set (data, + parse_data_get_interface (data, FALSE), + NULL, + num_methods, + methods, + num_signals, + signals, + num_properties, + properties, + steal_annotations (data)); + + } + else if (strcmp (element_name, "method") == 0) + { + guint in_num_args; + guint out_num_args; + GDBusArgInfo **in_args; + GDBusArgInfo **out_args; + + in_args = parse_data_steal_args (data, &in_num_args); + out_args = parse_data_steal_out_args (data, &out_num_args); + + g_dbus_method_info_set (data, + parse_data_get_method (data, FALSE), + NULL, + in_num_args, + in_args, + out_num_args, + out_args, + steal_annotations (data)); + } + else if (strcmp (element_name, "signal") == 0) + { + guint num_args; + GDBusArgInfo **args; + + args = parse_data_steal_out_args (data, &num_args); + + g_dbus_signal_info_set (data, + parse_data_get_signal (data, FALSE), + NULL, + num_args, + args, + steal_annotations (data)); + } + else if (strcmp (element_name, "property") == 0) + { + g_dbus_property_info_set (data, + parse_data_get_property (data, FALSE), + NULL, + NULL, + G_DBUS_PROPERTY_INFO_FLAGS_NONE, + steal_annotations (data)); + } + else if (strcmp (element_name, "arg") == 0) + { + g_dbus_arg_info_set (data, + data->last_arg_was_in ? parse_data_get_arg (data, FALSE) : parse_data_get_out_arg (data, FALSE), + NULL, + NULL, + steal_annotations (data)); + } + else if (strcmp (element_name, "annotation") == 0) + { + GDBusAnnotationInfo **embedded_annotations; + + embedded_annotations = steal_annotations (data); + + /* destroy the annotations for scope we're exiting and and pop the annotations from the scope we're reentering */ + parse_data_free_annotations (data); + data->annotations = (GPtrArray *) data->annotations_stack->data; + data->annotations_stack = g_slist_remove (data->annotations_stack, data->annotations_stack->data); + + have_popped_annotations = TRUE; + + g_dbus_annotation_info_set (data, + parse_data_get_annotation (data, FALSE), + NULL, + NULL, + embedded_annotations); + } + else + { + /* don't bail on unknown elements; just ignore them */ + } + + if (!have_popped_annotations) + { + /* destroy the annotations for scope we're exiting and and pop the annotations from the scope we're reentering */ + parse_data_free_annotations (data); + data->annotations = (GPtrArray *) data->annotations_stack->data; + data->annotations_stack = g_slist_remove (data->annotations_stack, data->annotations_stack->data); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +parser_error (GMarkupParseContext *context, + GError *error, + gpointer user_data) +{ + gint line_number; + gint char_number; + + g_markup_parse_context_get_position (context, &line_number, &char_number); + + g_prefix_error (&error, "%d:%d: ", + line_number, + char_number); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_node_info_new_for_xml: + * @xml_data: Valid D-Bus introspection XML. + * @error: Return location for error. + * + * Parses @xml_data and returns a #GDBusNodeInfo representing the data. + * + * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free + * with g_dbus_node_info_unref(). + * + * Since: 2.26 + */ +GDBusNodeInfo * +g_dbus_node_info_new_for_xml (const gchar *xml_data, + GError **error) +{ + GDBusNodeInfo *ret; + GMarkupParseContext *context; + GMarkupParser *parser; + guint num_nodes; + ParseData *data; + GDBusNodeInfo **ughret; + + ret = NULL; + parser = NULL; + context = NULL; + + parser = g_new0 (GMarkupParser, 1); + parser->start_element = parser_start_element; + parser->end_element = parser_end_element; + parser->error = parser_error; + + data = parse_data_new (); + context = g_markup_parse_context_new (parser, + 0, + data, + (GDestroyNotify) parse_data_free); + + if (!g_markup_parse_context_parse (context, + xml_data, + strlen (xml_data), + error)) + goto out; + + ughret = parse_data_steal_nodes (data, &num_nodes); + + if (num_nodes != 1) + { + guint n; + + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "Expected a single node in introspection XML, found %d", + num_nodes); + + /* clean up */ + for (n = 0; n < num_nodes; n++) + { + for (n = 0; n < num_nodes; n++) + g_dbus_node_info_unref (&(ret[n])); + } + g_free (ret); + ret = NULL; + } + + ret = ughret[0]; + g_free (ughret); + + out: + if (parser != NULL) + g_free (parser); + if (context != NULL) + g_markup_parse_context_free (context); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_annotation_info_lookup: + * @annotations: A %NULL-terminated array of annotations or %NULL. + * @name: The name of the annotation to look up. + * + * Looks up the value of an annotation. + * + * This cost of this function is O(n) in number of annotations. + * + * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations. + * + * Since: 2.26 + */ +const gchar * +g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations, + const gchar *name) +{ + guint n; + const gchar *ret; + + ret = NULL; + for (n = 0; annotations != NULL && annotations[n] != NULL; n++) + { + if (g_strcmp0 (annotations[n]->key, name) == 0) + { + ret = annotations[n]->value; + goto out; + } + } + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_interface_info_lookup_method: + * @info: A #GDBusInterfaceInfo. + * @name: A D-Bus method name (typically in CamelCase) + * + * Looks up information about a method. + * + * This cost of this function is O(n) in number of methods. + * + * Returns: A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info. + * + * Since: 2.26 + */ +GDBusMethodInfo * +g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info, + const gchar *name) +{ + guint n; + GDBusMethodInfo *result; + + for (n = 0; info->methods != NULL && info->methods[n] != NULL; n++) + { + GDBusMethodInfo *i = info->methods[n]; + + if (g_strcmp0 (i->name, name) == 0) + { + result = i; + goto out; + } + } + + result = NULL; + + out: + return result; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_interface_info_lookup_signal: + * @info: A #GDBusInterfaceInfo. + * @name: A D-Bus signal name (typically in CamelCase) + * + * Looks up information about a signal. + * + * This cost of this function is O(n) in number of signals. + * + * Returns: A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info. + * + * Since: 2.26 + */ +GDBusSignalInfo * +g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info, + const gchar *name) +{ + guint n; + GDBusSignalInfo *result; + + for (n = 0; info->signals != NULL && info->signals[n] != NULL; n++) + { + GDBusSignalInfo *i = info->signals[n]; + + if (g_strcmp0 (i->name, name) == 0) + { + result = i; + goto out; + } + } + + result = NULL; + + out: + return result; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_interface_info_lookup_property: + * @info: A #GDBusInterfaceInfo. + * @name: A D-Bus property name (typically in CamelCase). + * + * Looks up information about a property. + * + * This cost of this function is O(n) in number of properties. + * + * Returns: A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info. + * + * Since: 2.26 + */ +GDBusPropertyInfo * +g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info, + const gchar *name) +{ + guint n; + GDBusPropertyInfo *result; + + for (n = 0; info->properties != NULL && info->properties[n] != NULL; n++) + { + GDBusPropertyInfo *i = info->properties[n]; + + if (g_strcmp0 (i->name, name) == 0) + { + result = i; + goto out; + } + } + + result = NULL; + + out: + return result; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_node_info_lookup_interface: + * @info: A #GDBusNodeInfo. + * @name: A D-Bus interface name. + * + * Looks up information about an interface. + * + * This cost of this function is O(n) in number of interfaces. + * + * Returns: A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info. + * + * Since: 2.26 + */ +GDBusInterfaceInfo * +g_dbus_node_info_lookup_interface (GDBusNodeInfo *info, + const gchar *name) +{ + guint n; + GDBusInterfaceInfo *result; + + for (n = 0; info->interfaces != NULL && info->interfaces[n] != NULL; n++) + { + GDBusInterfaceInfo *i = info->interfaces[n]; + + if (g_strcmp0 (i->name, name) == 0) + { + result = i; + goto out; + } + } + + result = NULL; + + out: + return result; +} diff --git a/gio/gdbusintrospection.h b/gio/gdbusintrospection.h new file mode 100644 index 0000000..2c02421 --- /dev/null +++ b/gio/gdbusintrospection.h @@ -0,0 +1,286 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_INTROSPECTION_H__ +#define __G_DBUS_INTROSPECTION_H__ + +#include + +G_BEGIN_DECLS + +/** + * GDBusAnnotationInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @key: The name of the annotation, e.g. "org.freedesktop.DBus.Deprecated". + * @value: The value of the annotation. + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about an annotation. + * + * Since: 2.26 + */ +struct _GDBusAnnotationInfo +{ + volatile gint ref_count; + gchar *key; + gchar *value; + GDBusAnnotationInfo **annotations; +}; + +/** + * GDBusArgInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @name: Name of the argument, e.g. @unix_user_id. + * @signature: D-Bus signature of the argument (a single complete type). + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about an argument for a method or a signal. + * + * Since: 2.26 + */ +struct _GDBusArgInfo +{ + volatile gint ref_count; + gchar *name; + gchar *signature; + GDBusAnnotationInfo **annotations; +}; + +/** + * GDBusMethodInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @name: The name of the D-Bus method, e.g. @RequestName. + * @in_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no in arguments. + * @out_args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no out arguments. + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about a method on an D-Bus interface. + * + * Since: 2.26 + */ +struct _GDBusMethodInfo +{ + volatile gint ref_count; + gchar *name; + GDBusArgInfo **in_args; + GDBusArgInfo **out_args; + GDBusAnnotationInfo **annotations; +}; + +/** + * GDBusSignalInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @name: The name of the D-Bus signal, e.g. "NameOwnerChanged". + * @args: A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no arguments. + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about a signal on a D-Bus interface. + * + * Since: 2.26 + */ +struct _GDBusSignalInfo +{ + volatile gint ref_count; + gchar *name; + GDBusArgInfo **args; + GDBusAnnotationInfo **annotations; +}; + +/** + * GDBusPropertyInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @name: The name of the D-Bus property, e.g. "SupportedFilesystems". + * @signature: The D-Bus signature of the property (a single complete type). + * @flags: Access control flags for the property. + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about a D-Bus property on a D-Bus interface. + * + * Since: 2.26 + */ +struct _GDBusPropertyInfo +{ + volatile gint ref_count; + gchar *name; + gchar *signature; + GDBusPropertyInfoFlags flags; + GDBusAnnotationInfo **annotations; +}; + +/** + * GDBusInterfaceInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @name: The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties". + * @methods: A pointer to a %NULL-terminated array of pointers to #GDBusMethodInfo structures or %NULL if there are no methods. + * @signals: A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals. + * @properties: A pointer to a %NULL-terminated array of pointers to #GDBusPropertyInfo structures or %NULL if there are no properties. + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about a D-Bus interface. + * + * Since: 2.26 + */ +struct _GDBusInterfaceInfo +{ + volatile gint ref_count; + gchar *name; + GDBusMethodInfo **methods; + GDBusSignalInfo **signals; + GDBusPropertyInfo **properties; + GDBusAnnotationInfo **annotations; +}; + +/** + * GDBusNodeInfo: + * @ref_count: The reference count or -1 if statically allocated. + * @path: The path of the node or %NULL if omitted. Note that this may be a relative path. See the D-Bus specification for more details. + * @interfaces: A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces. + * @nodes: A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes. + * @annotations: A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations. + * + * Information about nodes in a remote object hierarchy. + * + * Since: 2.26 + */ +struct _GDBusNodeInfo +{ + volatile gint ref_count; + gchar *path; + GDBusInterfaceInfo **interfaces; + GDBusNodeInfo **nodes; + GDBusAnnotationInfo **annotations; +}; + +const gchar *g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations, + const gchar *name); +GDBusMethodInfo *g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info, + const gchar *name); +GDBusSignalInfo *g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info, + const gchar *name); +GDBusPropertyInfo *g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info, + const gchar *name); +void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info, + guint indent, + GString *string_builder); + +GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data, + GError **error); +GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (GDBusNodeInfo *info, + const gchar *name); +void g_dbus_node_info_generate_xml (GDBusNodeInfo *info, + guint indent, + GString *string_builder); + +GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info); +GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info); +GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info); +GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info); +GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info); +GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info); +GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info); + +void g_dbus_node_info_unref (GDBusNodeInfo *info); +void g_dbus_interface_info_unref (GDBusInterfaceInfo *info); +void g_dbus_method_info_unref (GDBusMethodInfo *info); +void g_dbus_signal_info_unref (GDBusSignalInfo *info); +void g_dbus_property_info_unref (GDBusPropertyInfo *info); +void g_dbus_arg_info_unref (GDBusArgInfo *info); +void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info); + +/** + * G_TYPE_DBUS_NODE_INFO: + * + * The #GType for a boxed type holding a #GDBusNodeInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_NODE_INFO (g_dbus_node_info_get_type ()) + +/** + * G_TYPE_DBUS_INTERFACE_INFO: + * + * The #GType for a boxed type holding a #GDBusInterfaceInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_INTERFACE_INFO (g_dbus_interface_info_get_type ()) + +/** + * G_TYPE_DBUS_METHOD_INFO: + * + * The #GType for a boxed type holding a #GDBusMethodInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_METHOD_INFO (g_dbus_method_info_get_type ()) + +/** + * G_TYPE_DBUS_SIGNAL_INFO: + * + * The #GType for a boxed type holding a #GDBusSignalInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_SIGNAL_INFO (g_dbus_signal_info_get_type ()) + +/** + * G_TYPE_DBUS_PROPERTY_INFO: + * + * The #GType for a boxed type holding a #GDBusPropertyInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_PROPERTY_INFO (g_dbus_property_info_get_type ()) + +/** + * G_TYPE_DBUS_ARG_INFO: + * + * The #GType for a boxed type holding a #GDBusArgInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_ARG_INFO (g_dbus_arg_info_get_type ()) + +/** + * G_TYPE_DBUS_ANNOTATION_INFO: + * + * The #GType for a boxed type holding a #GDBusAnnotationInfo. + * + * Since: 2.26 + */ +#define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ()) + +GType g_dbus_node_info_get_type (void) G_GNUC_CONST; +GType g_dbus_interface_info_get_type (void) G_GNUC_CONST; +GType g_dbus_method_info_get_type (void) G_GNUC_CONST; +GType g_dbus_signal_info_get_type (void) G_GNUC_CONST; +GType g_dbus_property_info_get_type (void) G_GNUC_CONST; +GType g_dbus_arg_info_get_type (void) G_GNUC_CONST; +GType g_dbus_annotation_info_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __G_DBUS_INTROSPECTION_H__ */ diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c new file mode 100644 index 0000000..92ee23a --- /dev/null +++ b/gio/gdbusmessage.c @@ -0,0 +1,3256 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +/* Uncomment to debug serializer code */ +/* #define DEBUG_SERIALIZER */ + +#include "config.h" + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "gdbusutils.h" +#include "gdbusmessage.h" +#include "gdbuserror.h" +#include "gioenumtypes.h" +#include "ginputstream.h" +#include "gdatainputstream.h" +#include "gmemoryinputstream.h" +#include "goutputstream.h" +#include "gdataoutputstream.h" +#include "gmemoryoutputstream.h" +#include "gseekable.h" +#include "gioerror.h" +#include "gdbusprivate.h" + +#ifdef G_OS_UNIX +#include "gunixfdlist.h" +#endif + +#include "glibintl.h" + +/** + * SECTION:gdbusmessage + * @short_description: D-Bus Message + * @include: gio/gio.h + * + * A type for representing D-Bus messages that can be sent or received + * on a #GDBusConnection. + */ + +typedef struct _GDBusMessageClass GDBusMessageClass; + +/** + * GDBusMessageClass: + * + * Class structure for #GDBusMessage. + * + * Since: 2.26 + */ +struct _GDBusMessageClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +/** + * GDBusMessage: + * + * The #GDBusMessage structure contains only private data and should + * only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GDBusMessage +{ + /*< private >*/ + GObject parent_instance; + + GDBusMessageType type; + GDBusMessageFlags flags; + gboolean locked; + GDBusMessageByteOrder byte_order; + guchar major_protocol_version; + guint32 serial; + GHashTable *headers; + GVariant *body; +#ifdef G_OS_UNIX + GUnixFDList *fd_list; +#endif +}; + +enum +{ + PROP_0, + PROP_LOCKED +}; + +G_DEFINE_TYPE (GDBusMessage, g_dbus_message, G_TYPE_OBJECT); + +static void +g_dbus_message_finalize (GObject *object) +{ + GDBusMessage *message = G_DBUS_MESSAGE (object); + + if (message->headers != NULL) + g_hash_table_unref (message->headers); + if (message->body != NULL) + g_variant_unref (message->body); +#ifdef G_OS_UNIX + if (message->fd_list != NULL) + g_object_unref (message->fd_list); +#endif + + if (G_OBJECT_CLASS (g_dbus_message_parent_class)->finalize != NULL) + G_OBJECT_CLASS (g_dbus_message_parent_class)->finalize (object); +} + +static void +g_dbus_message_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GDBusMessage *message = G_DBUS_MESSAGE (object); + + switch (prop_id) + { + case PROP_LOCKED: + g_value_set_boolean (value, g_dbus_message_get_locked (message)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_message_class_init (GDBusMessageClass *klass) +{ + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = g_dbus_message_finalize; + gobject_class->get_property = g_dbus_message_get_property; + + /** + * GDBusConnection:locked: + * + * A boolean specifying whether the message is locked. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_LOCKED, + g_param_spec_boolean ("locked", + P_("Locked"), + P_("Whether the message is locked"), + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); +} + +static void +g_dbus_message_init (GDBusMessage *message) +{ + /* Any D-Bus implementation is supposed to handle both Big and + * Little Endian encodings and the Endianness is part of the D-Bus + * message - we prefer to use Big Endian (since it's Network Byte + * Order and just easier to read for humans) but if the machine is + * Little Endian we use that for performance reasons. + */ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN + message->byte_order = G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN; +#else + /* this could also be G_PDP_ENDIAN */ + message->byte_order = G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN; +#endif + message->headers = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + NULL, + (GDestroyNotify) g_variant_unref); +} + +/** + * g_dbus_message_new: + * + * Creates a new empty #GDBusMessage. + * + * Returns: A #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new (void) +{ + return g_object_new (G_TYPE_DBUS_MESSAGE, NULL); +} + +/** + * g_dbus_message_new_method_call: + * @name: A valid D-Bus name or %NULL. + * @path: A valid object path. + * @interface_: A valid D-Bus interface name or %NULL. + * @method: A valid method name. + * + * Creates a new #GDBusMessage for a method call. + * + * Returns: A #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_method_call (const gchar *name, + const gchar *path, + const gchar *interface_, + const gchar *method) +{ + GDBusMessage *message; + + g_return_val_if_fail (name == NULL || g_dbus_is_name (name), NULL); + g_return_val_if_fail (g_variant_is_object_path (path), NULL); + g_return_val_if_fail (g_dbus_is_member_name (method), NULL); + g_return_val_if_fail (interface_ == NULL || g_dbus_is_interface_name (interface_), NULL); + + message = g_dbus_message_new (); + message->type = G_DBUS_MESSAGE_TYPE_METHOD_CALL; + + if (name != NULL) + g_dbus_message_set_destination (message, name); + g_dbus_message_set_path (message, path); + g_dbus_message_set_member (message, method); + if (interface_ != NULL) + g_dbus_message_set_interface (message, interface_); + + return message; +} + +/** + * g_dbus_message_new_signal: + * @path: A valid object path. + * @interface_: A valid D-Bus interface name. + * @signal: A valid signal name. + * + * Creates a new #GDBusMessage for a signal emission. + * + * Returns: A #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_signal (const gchar *path, + const gchar *interface_, + const gchar *signal) +{ + GDBusMessage *message; + + g_return_val_if_fail (g_variant_is_object_path (path), NULL); + g_return_val_if_fail (g_dbus_is_member_name (signal), NULL); + g_return_val_if_fail (g_dbus_is_interface_name (interface_), NULL); + + message = g_dbus_message_new (); + message->type = G_DBUS_MESSAGE_TYPE_SIGNAL; + message->flags = G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED; + + g_dbus_message_set_path (message, path); + g_dbus_message_set_member (message, signal); + g_dbus_message_set_interface (message, interface_); + + return message; +} + + +/** + * g_dbus_message_new_method_reply: + * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to + * create a reply message to. + * + * Creates a new #GDBusMessage that is a reply to @method_call_message. + * + * Returns: (transfer full): #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_method_reply (GDBusMessage *method_call_message) +{ + GDBusMessage *message; + const gchar *sender; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (method_call_message), NULL); + g_return_val_if_fail (g_dbus_message_get_message_type (method_call_message) == G_DBUS_MESSAGE_TYPE_METHOD_CALL, NULL); + g_return_val_if_fail (g_dbus_message_get_serial (method_call_message) != 0, NULL); + + message = g_dbus_message_new (); + message->type = G_DBUS_MESSAGE_TYPE_METHOD_RETURN; + message->flags = G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED; + /* reply with same endianness */ + message->byte_order = method_call_message->byte_order; + + g_dbus_message_set_reply_serial (message, g_dbus_message_get_serial (method_call_message)); + sender = g_dbus_message_get_sender (method_call_message); + if (sender != NULL) + g_dbus_message_set_destination (message, sender); + + return message; +} + +/** + * g_dbus_message_new_method_error: + * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to + * create a reply message to. + * @error_name: A valid D-Bus error name. + * @error_message_format: The D-Bus error message in a printf() format. + * @...: Arguments for @error_message_format. + * + * Creates a new #GDBusMessage that is an error reply to @method_call_message. + * + * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_method_error (GDBusMessage *method_call_message, + const gchar *error_name, + const gchar *error_message_format, + ...) +{ + GDBusMessage *ret; + va_list var_args; + + va_start (var_args, error_message_format); + ret = g_dbus_message_new_method_error_valist (method_call_message, + error_name, + error_message_format, + var_args); + va_end (var_args); + + return ret; +} + +/** + * g_dbus_message_new_method_error_literal: + * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to + * create a reply message to. + * @error_name: A valid D-Bus error name. + * @error_message: The D-Bus error message. + * + * Creates a new #GDBusMessage that is an error reply to @method_call_message. + * + * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_method_error_literal (GDBusMessage *method_call_message, + const gchar *error_name, + const gchar *error_message) +{ + GDBusMessage *message; + const gchar *sender; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (method_call_message), NULL); + g_return_val_if_fail (g_dbus_message_get_message_type (method_call_message) == G_DBUS_MESSAGE_TYPE_METHOD_CALL, NULL); + g_return_val_if_fail (g_dbus_message_get_serial (method_call_message) != 0, NULL); + g_return_val_if_fail (g_dbus_is_name (error_name), NULL); + g_return_val_if_fail (error_message != NULL, NULL); + + message = g_dbus_message_new (); + message->type = G_DBUS_MESSAGE_TYPE_ERROR; + message->flags = G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED; + /* reply with same endianness */ + message->byte_order = method_call_message->byte_order; + + g_dbus_message_set_reply_serial (message, g_dbus_message_get_serial (method_call_message)); + g_dbus_message_set_error_name (message, error_name); + g_dbus_message_set_body (message, g_variant_new ("(s)", error_message)); + + sender = g_dbus_message_get_sender (method_call_message); + if (sender != NULL) + g_dbus_message_set_destination (message, sender); + + return message; +} + +/** + * g_dbus_message_new_method_error_valist: + * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to + * create a reply message to. + * @error_name: A valid D-Bus error name. + * @error_message_format: The D-Bus error message in a printf() format. + * @var_args: Arguments for @error_message_format. + * + * Like g_dbus_message_new_method_error() but intended for language bindings. + * + * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_method_error_valist (GDBusMessage *method_call_message, + const gchar *error_name, + const gchar *error_message_format, + va_list var_args) +{ + GDBusMessage *ret; + gchar *error_message; + error_message = g_strdup_vprintf (error_message_format, var_args); + ret = g_dbus_message_new_method_error_literal (method_call_message, + error_name, + error_message); + g_free (error_message); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_byte_order: + * @message: A #GDBusMessage. + * + * Gets the byte order of @message. + * + * Returns: The byte order. + */ +GDBusMessageByteOrder +g_dbus_message_get_byte_order (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), (GDBusMessageByteOrder) 0); + return message->byte_order; +} + +/** + * g_dbus_message_set_byte_order: + * @message: A #GDBusMessage. + * @byte_order: The byte order. + * + * Sets the byte order of @message. + */ +void +g_dbus_message_set_byte_order (GDBusMessage *message, + GDBusMessageByteOrder byte_order) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + message->byte_order = byte_order; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* TODO: need GI annotations to specify that any guchar value goes for the type */ + +/** + * g_dbus_message_get_message_type: + * @message: A #GDBusMessage. + * + * Gets the type of @message. + * + * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration). + * + * Since: 2.26 + */ +GDBusMessageType +g_dbus_message_get_message_type (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), G_DBUS_MESSAGE_TYPE_INVALID); + return message->type; +} + +/** + * g_dbus_message_set_message_type: + * @message: A #GDBusMessage. + * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration). + * + * Sets @message to be of @type. + * + * Since: 2.26 + */ +void +g_dbus_message_set_message_type (GDBusMessage *message, + GDBusMessageType type) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (type >=0 && type < 256); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + message->type = type; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* TODO: need GI annotations to specify that any guchar value goes for flags */ + +/** + * g_dbus_message_get_flags: + * @message: A #GDBusMessage. + * + * Gets the flags for @message. + * + * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together). + * + * Since: 2.26 + */ +GDBusMessageFlags +g_dbus_message_get_flags (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), G_DBUS_MESSAGE_FLAGS_NONE); + return message->flags; +} + +/** + * g_dbus_message_set_flags: + * @message: A #GDBusMessage. + * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags + * enumeration bitwise ORed together). + * + * Sets the flags to set on @message. + * + * Since: 2.26 + */ +void +g_dbus_message_set_flags (GDBusMessage *message, + GDBusMessageFlags flags) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (flags >=0 && flags < 256); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + message->flags = flags; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_serial: + * @message: A #GDBusMessage. + * + * Gets the serial for @message. + * + * Returns: A #guint32. + * + * Since: 2.26 + */ +guint32 +g_dbus_message_get_serial (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), 0); + return message->serial; +} + +/** + * g_dbus_message_set_serial: + * @message: A #GDBusMessage. + * @serial: A #guint32. + * + * Sets the serial for @message. + * + * Since: 2.26 + */ +void +g_dbus_message_set_serial (GDBusMessage *message, + guint32 serial) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + message->serial = serial; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* TODO: need GI annotations to specify that any guchar value goes for header_field */ + +/** + * g_dbus_message_get_header: + * @message: A #GDBusMessage. + * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration) + * + * Gets a header field on @message. + * + * Returns: A #GVariant with the value if the header was found, %NULL + * otherwise. Do not free, it is owned by @message. + * + * Since: 2.26 + */ +GVariant * +g_dbus_message_get_header (GDBusMessage *message, + GDBusMessageHeaderField header_field) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + g_return_val_if_fail (header_field >=0 && header_field < 256, NULL); + return g_hash_table_lookup (message->headers, GUINT_TO_POINTER (header_field)); +} + +/** + * g_dbus_message_set_header: + * @message: A #GDBusMessage. + * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration) + * @value: A #GVariant to set the header field or %NULL to clear the header field. + * + * Sets a header field on @message. + * + * If @value is floating, @message assumes ownership of @value. + * + * Since: 2.26 + */ +void +g_dbus_message_set_header (GDBusMessage *message, + GDBusMessageHeaderField header_field, + GVariant *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (header_field >=0 && header_field < 256); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + if (value == NULL) + { + g_hash_table_remove (message->headers, GUINT_TO_POINTER (header_field)); + } + else + { + g_hash_table_insert (message->headers, GUINT_TO_POINTER (header_field), g_variant_ref_sink (value)); + } +} + +/** + * g_dbus_message_get_header_fields: + * @message: A #GDBusMessage. + * + * Gets an array of all header fields on @message that are set. + * + * Returns: An array of header fields terminated by + * %G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element is a + * #guchar. Free with g_free(). + * + * Since: 2.26 + */ +guchar * +g_dbus_message_get_header_fields (GDBusMessage *message) +{ + GList *keys; + guchar *ret; + guint num_keys; + GList *l; + guint n; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + + keys = g_hash_table_get_keys (message->headers); + num_keys = g_list_length (keys); + ret = g_new (guchar, num_keys + 1); + for (l = keys, n = 0; l != NULL; l = l->next, n++) + ret[n] = GPOINTER_TO_UINT (l->data); + g_assert (n == num_keys); + ret[n] = G_DBUS_MESSAGE_HEADER_FIELD_INVALID; + g_list_free (keys); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_body: + * @message: A #GDBusMessage. + * + * Gets the body of a message. + * + * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message. + * + * Since: 2.26 + */ +GVariant * +g_dbus_message_get_body (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return message->body; +} + +/** + * g_dbus_message_set_body: + * @message: A #GDBusMessage. + * @body: Either %NULL or a #GVariant that is a tuple. + * + * Sets the body @message. As a side-effect the + * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the + * type string of @body (or cleared if @body is %NULL). + * + * If @body is floating, @message assumes ownership of @body. + * + * Since: 2.26 + */ +void +g_dbus_message_set_body (GDBusMessage *message, + GVariant *body) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail ((body == NULL) || g_variant_is_of_type (body, G_VARIANT_TYPE_TUPLE)); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + if (message->body != NULL) + g_variant_unref (message->body); + if (body == NULL) + { + message->body = NULL; + g_dbus_message_set_signature (message, NULL); + } + else + { + const gchar *type_string; + gsize type_string_len; + gchar *signature; + + message->body = g_variant_ref_sink (body); + + type_string = g_variant_get_type_string (body); + type_string_len = strlen (type_string); + g_assert (type_string_len >= 2); + signature = g_strndup (type_string + 1, type_string_len - 2); + g_dbus_message_set_signature (message, signature); + g_free (signature); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_UNIX +/** + * g_dbus_message_get_unix_fd_list: + * @message: A #GDBusMessage. + * + * Gets the UNIX file descriptors associated with @message, if any. + * + * This method is only available on UNIX. + * + * Returns: (transfer none):A #GUnixFDList or %NULL if no file descriptors are + * associated. Do not free, this object is owned by @message. + * + * Since: 2.26 + */ +GUnixFDList * +g_dbus_message_get_unix_fd_list (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return message->fd_list; +} + +/** + * g_dbus_message_set_unix_fd_list: + * @message: A #GDBusMessage. + * @fd_list: (allow-none): A #GUnixFDList or %NULL. + * + * Sets the UNIX file descriptors associated with @message. As a + * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header + * field is set to the number of fds in @fd_list (or cleared if + * @fd_list is %NULL). + * + * This method is only available on UNIX. + * + * Since: 2.26 + */ +void +g_dbus_message_set_unix_fd_list (GDBusMessage *message, + GUnixFDList *fd_list) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (fd_list == NULL || G_IS_UNIX_FD_LIST (fd_list)); + + if (message->locked) + { + g_warning ("%s: Attempted to modify a locked message", G_STRFUNC); + return; + } + + if (message->fd_list != NULL) + g_object_unref (message->fd_list); + if (fd_list != NULL) + { + message->fd_list = g_object_ref (fd_list); + g_dbus_message_set_num_unix_fds (message, g_unix_fd_list_get_length (fd_list)); + } + else + { + message->fd_list = NULL; + g_dbus_message_set_num_unix_fds (message, 0); + } +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +validate_headers (GDBusMessage *message, + GError **error) +{ + gboolean ret; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; + + switch (message->type) + { + case G_DBUS_MESSAGE_TYPE_INVALID: + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("type is INVALID")); + goto out; + break; + + case G_DBUS_MESSAGE_TYPE_METHOD_CALL: + if (g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_PATH) == NULL || + g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_MEMBER) == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("METHOD_CALL message: PATH or MEMBER header field is missing")); + goto out; + } + break; + + case G_DBUS_MESSAGE_TYPE_METHOD_RETURN: + if (g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL) == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("METHOD_RETURN message: REPLY_SERIAL header field is missing")); + goto out; + } + break; + + case G_DBUS_MESSAGE_TYPE_ERROR: + if (g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME) == NULL || + g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL) == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("ERROR message: REPLY_SERIAL or ERROR_NAME header field is missing")); + goto out; + } + break; + + case G_DBUS_MESSAGE_TYPE_SIGNAL: + if (g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_PATH) == NULL || + g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE) == NULL || + g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_MEMBER) == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("SIGNAL message: PATH, INTERFACE or MEMBER header field is missing")); + goto out; + } + if (g_strcmp0 (g_dbus_message_get_path (message), "/org/freedesktop/DBus/Local") == 0) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("SIGNAL message: The PATH header field is using the reserved value /org/freedesktop/DBus/Local")); + goto out; + } + if (g_strcmp0 (g_dbus_message_get_interface (message), "org.freedesktop.DBus.Local") == 0) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("SIGNAL message: The INTERFACE header field is using the reserved value org.freedesktop.DBus.Local")); + goto out; + } + break; + + default: + /* hitherto unknown type - nothing to check */ + break; + } + + ret = TRUE; + + out: + g_assert (ret || (error == NULL || *error != NULL)); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +ensure_input_padding (GMemoryInputStream *mis, + gsize padding_size, + GError **error) +{ + gsize offset; + gsize wanted_offset; + + offset = g_seekable_tell (G_SEEKABLE (mis)); + wanted_offset = ((offset + padding_size - 1) / padding_size) * padding_size; + + if (offset != wanted_offset) + { + return g_seekable_seek (G_SEEKABLE (mis), wanted_offset, G_SEEK_SET, NULL, error); + } + else + { + return TRUE; + } +} + +static gchar * +read_string (GMemoryInputStream *mis, + GDataInputStream *dis, + gsize len, + GError **error) +{ + GString *s; + gchar buf[256]; + gsize remaining; + guchar nul; + GError *local_error; + const gchar *end_valid; + + s = g_string_new (NULL); + + remaining = len; + while (remaining > 0) + { + gsize to_read; + gssize num_read; + + to_read = MIN (remaining, sizeof (buf)); + num_read = g_input_stream_read (G_INPUT_STREAM (mis), + buf, + to_read, + NULL, + error); + if (num_read < 0) + goto fail; + if (num_read == 0) + { + /* G_GSIZE_FORMAT doesn't work with gettext, so we use %lu */ + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Wanted to read %lu bytes but got EOF"), + (gulong)to_read); + goto fail; + } + + remaining -= num_read; + g_string_append_len (s, buf, num_read); + } + + local_error = NULL; + nul = g_data_input_stream_read_byte (dis, NULL, &local_error); + if (local_error != NULL) + { + g_propagate_error (error, local_error); + goto fail; + } + if (!g_utf8_validate (s->str, -1, &end_valid)) + { + gint offset; + gchar *valid_str; + offset = (gint) (end_valid - s->str); + valid_str = g_strndup (s->str, offset); + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Expected valid UTF-8 string but found invalid bytes at byte offset %d (length of string is %d). " + "The valid UTF-8 string up until that point was `%s'"), + offset, + (gint) s->len, + valid_str); + g_free (valid_str); + goto fail; + } + if (nul != '\0') + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Expected NUL byte after the string `%s' but found byte %d"), + s->str, nul); + goto fail; + } + + return g_string_free (s, FALSE); + + fail: + g_string_free (s, TRUE); + return NULL; +} + +/* if just_align==TRUE, don't read a value, just align the input stream wrt padding */ + +/* returns a non-floating GVariant! */ +static GVariant * +parse_value_from_blob (GMemoryInputStream *mis, + GDataInputStream *dis, + const GVariantType *type, + gboolean just_align, + guint indent, + GError **error) +{ + GVariant *ret; + GError *local_error; + gboolean is_leaf; + +#ifdef DEBUG_SERIALIZER + if (!just_align) + { + gchar *s; + s = g_variant_type_dup_string (type); + g_print ("%*sReading type %s from offset 0x%04x", + indent, "", + s, + (gint) g_seekable_tell (G_SEEKABLE (mis))); + g_free (s); + } +#endif /* DEBUG_SERIALIZER */ + + ret = NULL; + + is_leaf = TRUE; + local_error = NULL; + if (g_variant_type_equal (type, G_VARIANT_TYPE_BOOLEAN)) + { + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + if (!just_align) + { + gboolean v; + v = g_data_input_stream_read_uint32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_boolean (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_BYTE)) + { + if (!just_align) + { + guchar v; + v = g_data_input_stream_read_byte (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_byte (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT16)) + { + if (!ensure_input_padding (mis, 2, &local_error)) + goto fail; + if (!just_align) + { + gint16 v; + v = g_data_input_stream_read_int16 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_int16 (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT16)) + { + if (!ensure_input_padding (mis, 2, &local_error)) + goto fail; + if (!just_align) + { + guint16 v; + v = g_data_input_stream_read_uint16 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_uint16 (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT32)) + { + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + if (!just_align) + { + gint32 v; + v = g_data_input_stream_read_int32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_int32 (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT32)) + { + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + if (!just_align) + { + guint32 v; + v = g_data_input_stream_read_uint32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_uint32 (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64)) + { + if (!ensure_input_padding (mis, 8, &local_error)) + goto fail; + if (!just_align) + { + gint64 v; + v = g_data_input_stream_read_int64 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_int64 (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64)) + { + if (!ensure_input_padding (mis, 8, &local_error)) + goto fail; + if (!just_align) + { + guint64 v; + v = g_data_input_stream_read_uint64 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_uint64 (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_DOUBLE)) + { + if (!ensure_input_padding (mis, 8, &local_error)) + goto fail; + if (!just_align) + { + guint64 v; + gdouble *encoded; + G_STATIC_ASSERT (sizeof (gdouble) == sizeof (guint64)); + v = g_data_input_stream_read_uint64 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + encoded = (gdouble *) &v; + ret = g_variant_new_double (*encoded); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING)) + { + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + if (!just_align) + { + guint32 len; + gchar *v; + len = g_data_input_stream_read_uint32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + v = read_string (mis, dis, (gsize) len, &local_error); + if (v == NULL) + goto fail; + ret = g_variant_new_string (v); + g_free (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_OBJECT_PATH)) + { + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + if (!just_align) + { + guint32 len; + gchar *v; + len = g_data_input_stream_read_uint32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + v = read_string (mis, dis, (gsize) len, &local_error); + if (v == NULL) + goto fail; + if (!g_variant_is_object_path (v)) + { + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Parsed value `%s' is not a valid D-Bus object path"), + v); + g_free (v); + goto fail; + } + ret = g_variant_new_object_path (v); + g_free (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_SIGNATURE)) + { + if (!just_align) + { + guchar len; + gchar *v; + len = g_data_input_stream_read_byte (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + v = read_string (mis, dis, (gsize) len, &local_error); + if (v == NULL) + goto fail; + if (!g_variant_is_signature (v)) + { + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Parsed value `%s' is not a valid D-Bus signature"), + v); + g_free (v); + goto fail; + } + ret = g_variant_new_signature (v); + g_free (v); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE)) + { + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + if (!just_align) + { + gint32 v; + v = g_data_input_stream_read_int32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + ret = g_variant_new_handle (v); + } + } + else if (g_variant_type_is_array (type)) + { + guint32 array_len; + goffset offset; + goffset target; + const GVariantType *element_type; + GVariantBuilder builder; + + if (!ensure_input_padding (mis, 4, &local_error)) + goto fail; + + if (just_align) + { + array_len = 0; + } + else + { + array_len = g_data_input_stream_read_uint32 (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + + is_leaf = FALSE; +#ifdef DEBUG_SERIALIZER + g_print (": array spans 0x%04x bytes\n", array_len); +#endif /* DEBUG_SERIALIZER */ + + if (array_len > (2<<26)) + { + /* G_GUINT32_FORMAT doesn't work with gettext, so use u */ + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Encountered array of length %u bytes. Maximum length is 2<<26 bytes (64 MiB)."), + array_len); + goto fail; + } + } + + g_variant_builder_init (&builder, type); + element_type = g_variant_type_element (type); + + if (array_len == 0) + { + GVariant *item; + item = parse_value_from_blob (mis, + dis, + element_type, + TRUE, + indent + 2, + &local_error); + g_assert (item == NULL); + } + else + { + /* TODO: optimize array of primitive types */ + offset = g_seekable_tell (G_SEEKABLE (mis)); + target = offset + array_len; + while (offset < target) + { + GVariant *item; + item = parse_value_from_blob (mis, + dis, + element_type, + FALSE, + indent + 2, + &local_error); + if (item == NULL) + { + g_variant_builder_clear (&builder); + goto fail; + } + g_variant_builder_add_value (&builder, item); + g_variant_unref (item); + offset = g_seekable_tell (G_SEEKABLE (mis)); + } + } + + if (!just_align) + { + ret = g_variant_builder_end (&builder); + } + else + { + g_variant_builder_clear (&builder); + } + } + else if (g_variant_type_is_dict_entry (type)) + { + const GVariantType *key_type; + const GVariantType *value_type; + GVariant *key; + GVariant *value; + + if (!ensure_input_padding (mis, 8, &local_error)) + goto fail; + + is_leaf = FALSE; +#ifdef DEBUG_SERIALIZER + g_print ("\n"); +#endif /* DEBUG_SERIALIZER */ + + if (!just_align) + { + key_type = g_variant_type_key (type); + key = parse_value_from_blob (mis, + dis, + key_type, + FALSE, + indent + 2, + &local_error); + if (key == NULL) + goto fail; + value_type = g_variant_type_value (type); + value = parse_value_from_blob (mis, + dis, + value_type, + FALSE, + indent + 2, + &local_error); + if (value == NULL) + { + g_variant_unref (key); + goto fail; + } + ret = g_variant_new_dict_entry (key, value); + g_variant_unref (key); + g_variant_unref (value); + } + } + else if (g_variant_type_is_tuple (type)) + { + if (!ensure_input_padding (mis, 8, &local_error)) + goto fail; + + is_leaf = FALSE; +#ifdef DEBUG_SERIALIZER + g_print ("\n"); +#endif /* DEBUG_SERIALIZER */ + + if (!just_align) + { + const GVariantType *element_type; + GVariantBuilder builder; + + g_variant_builder_init (&builder, type); + element_type = g_variant_type_first (type); + while (element_type != NULL) + { + GVariant *item; + item = parse_value_from_blob (mis, + dis, + element_type, + FALSE, + indent + 2, + &local_error); + if (item == NULL) + { + g_variant_builder_clear (&builder); + goto fail; + } + g_variant_builder_add_value (&builder, item); + g_variant_unref (item); + + element_type = g_variant_type_next (element_type); + } + ret = g_variant_builder_end (&builder); + } + } + else if (g_variant_type_is_variant (type)) + { + is_leaf = FALSE; +#ifdef DEBUG_SERIALIZER + g_print ("\n"); +#endif /* DEBUG_SERIALIZER */ + + if (!just_align) + { + guchar siglen; + gchar *sig; + GVariantType *variant_type; + GVariant *value; + + siglen = g_data_input_stream_read_byte (dis, NULL, &local_error); + if (local_error != NULL) + goto fail; + sig = read_string (mis, dis, (gsize) siglen, &local_error); + if (sig == NULL) + goto fail; + if (!g_variant_is_signature (sig)) + { + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Parsed value `%s' for variant is not a valid D-Bus signature"), + sig); + g_free (sig); + goto fail; + } + variant_type = g_variant_type_new (sig); + g_free (sig); + value = parse_value_from_blob (mis, + dis, + variant_type, + FALSE, + indent + 2, + &local_error); + g_variant_type_free (variant_type); + if (value == NULL) + goto fail; + ret = g_variant_new_variant (value); + g_variant_unref (value); + } + } + else + { + gchar *s; + s = g_variant_type_dup_string (type); + g_set_error (&local_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error deserializing GVariant with type string `%s' from the D-Bus wire format"), + s); + g_free (s); + goto fail; + } + + g_assert ((just_align && ret == NULL) || (!just_align && ret != NULL)); + +#ifdef DEBUG_SERIALIZER + if (ret != NULL) + { + if (is_leaf) + { + gchar *s; + if (g_variant_type_equal (type, G_VARIANT_TYPE_BYTE)) + { + s = g_strdup_printf ("0x%02x '%c'", g_variant_get_byte (ret), g_variant_get_byte (ret)); + } + else + { + s = g_variant_print (ret, FALSE); + } + g_print (": %s\n", s); + g_free (s); + } + } +#endif /* DEBUG_SERIALIZER */ + + /* sink the reference */ + if (ret != NULL) + { + g_assert (g_variant_is_floating (ret)); + g_variant_ref_sink (ret); + } + return ret; + + fail: +#ifdef DEBUG_SERIALIZER + g_print ("\n" + "%*sFAILURE: %s (%s, %d)\n", + indent, "", + local_error->message, + g_quark_to_string (local_error->domain), + local_error->code); +#endif /* DEBUG_SERIALIZER */ + g_propagate_error (error, local_error); + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* message_header must be at least 16 bytes */ + +/** + * g_dbus_message_bytes_needed: + * @blob: A blob represent a binary D-Bus message. + * @blob_len: The length of @blob (must be at least 16). + * @error: Return location for error or %NULL. + * + * Utility function to calculate how many bytes are needed to + * completely deserialize the D-Bus message stored at @blob. + * + * Returns: Number of bytes needed or -1 if @error is set (e.g. if + * @blob contains invalid data or not enough data is available to + * determine the size). + * + * Since: 2.26 + */ +gssize +g_dbus_message_bytes_needed (guchar *blob, + gsize blob_len, + GError **error) +{ + gssize ret; + + ret = -1; + + g_return_val_if_fail (blob != NULL, -1); + g_return_val_if_fail (error == NULL || *error == NULL, -1); + g_return_val_if_fail (blob_len >= 16, -1); + + if (blob[0] == 'l') + { + /* core header (12 bytes) + ARRAY of STRUCT of (BYTE,VARIANT) */ + ret = 12 + 4 + GUINT32_FROM_LE (((guint32 *) blob)[3]); + /* round up so it's a multiple of 8 */ + ret = 8 * ((ret + 7)/8); + /* finally add the body size */ + ret += GUINT32_FROM_LE (((guint32 *) blob)[1]); + } + else if (blob[0] == 'B') + { + /* core header (12 bytes) + ARRAY of STRUCT of (BYTE,VARIANT) */ + ret = 12 + 4 + GUINT32_FROM_BE (((guint32 *) blob)[3]); + /* round up so it's a multiple of 8 */ + ret = 8 * ((ret + 7)/8); + /* finally add the body size */ + ret += GUINT32_FROM_BE (((guint32 *) blob)[1]); + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + "Unable to determine message blob length - given blob is malformed"); + } + + if (ret > (2<<27)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + "Blob indicates that message exceeds maximum message length (128MiB)"); + ret = -1; + } + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_new_from_blob: + * @blob: A blob represent a binary D-Bus message. + * @blob_len: The length of @blob. + * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported. + * @error: Return location for error or %NULL. + * + * Creates a new #GDBusMessage from the data stored at @blob. The byte + * order that the message was in can be retrieved using + * g_dbus_message_get_byte_order(). + * + * Returns: A new #GDBusMessage or %NULL if @error is set. Free with + * g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_new_from_blob (guchar *blob, + gsize blob_len, + GDBusCapabilityFlags capabilities, + GError **error) +{ + gboolean ret; + GMemoryInputStream *mis; + GDataInputStream *dis; + GDBusMessage *message; + guchar endianness; + guchar major_protocol_version; + GDataStreamByteOrder byte_order; + guint32 message_body_len; + GVariant *headers; + GVariant *item; + GVariantIter iter; + GVariant *signature; + + /* TODO: check against @capabilities */ + + ret = FALSE; + + g_return_val_if_fail (blob != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + g_return_val_if_fail (blob_len >= 12, NULL); + + message = g_dbus_message_new (); + + mis = G_MEMORY_INPUT_STREAM (g_memory_input_stream_new_from_data (blob, blob_len, NULL)); + dis = g_data_input_stream_new (G_INPUT_STREAM (mis)); + + endianness = g_data_input_stream_read_byte (dis, NULL, NULL); + switch (endianness) + { + case 'l': + byte_order = G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN; + message->byte_order = G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN; + break; + case 'B': + byte_order = G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN; + message->byte_order = G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN; + break; + default: + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid endianness value. Expected 0x6c ('l') or 0x42 ('B') but found value 0x%02x"), + endianness); + goto out; + } + g_data_input_stream_set_byte_order (dis, byte_order); + + message->type = g_data_input_stream_read_byte (dis, NULL, NULL); + message->flags = g_data_input_stream_read_byte (dis, NULL, NULL); + major_protocol_version = g_data_input_stream_read_byte (dis, NULL, NULL); + if (major_protocol_version != 1) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid major protocol version. Expected 1 but found %d"), + major_protocol_version); + goto out; + } + message_body_len = g_data_input_stream_read_uint32 (dis, NULL, NULL); + message->serial = g_data_input_stream_read_uint32 (dis, NULL, NULL); + +#ifdef DEBUG_SERIALIZER + g_print ("Parsing blob (blob_len = 0x%04x bytes)\n", (gint) blob_len); + { + gchar *s; + s = _g_dbus_hexdump ((const gchar *) blob, blob_len, 2); + g_print ("%s\n", s); + g_free (s); + } +#endif /* DEBUG_SERIALIZER */ + +#ifdef DEBUG_SERIALIZER + g_print ("Parsing headers (blob_len = 0x%04x bytes)\n", (gint) blob_len); +#endif /* DEBUG_SERIALIZER */ + headers = parse_value_from_blob (mis, + dis, + G_VARIANT_TYPE ("a{yv}"), + FALSE, + 2, + error); + if (headers == NULL) + goto out; + g_variant_iter_init (&iter, headers); + while ((item = g_variant_iter_next_value (&iter)) != NULL) + { + guchar header_field; + GVariant *value; + g_variant_get (item, + "{yv}", + &header_field, + &value); + g_dbus_message_set_header (message, header_field, value); + g_variant_unref (value); + g_variant_unref (item); + } + g_variant_unref (headers); + + signature = g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE); + if (signature != NULL) + { + const gchar *signature_str; + gsize signature_str_len; + + signature_str = g_variant_get_string (signature, &signature_str_len); + + /* signature but no body */ + if (message_body_len == 0 && signature_str_len > 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Signature header with signature `%s' found but message body is empty"), + signature_str); + goto out; + } + else if (signature_str_len > 0) + { + GVariantType *variant_type; + gchar *tupled_signature_str; + + if (!g_variant_is_signature (signature_str)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Parsed value `%s' is not a valid D-Bus signature (for body)"), + signature_str); + goto out; + } + tupled_signature_str = g_strdup_printf ("(%s)", signature_str); + variant_type = g_variant_type_new (tupled_signature_str); + g_free (tupled_signature_str); +#ifdef DEBUG_SERIALIZER + g_print ("Parsing body (blob_len = 0x%04x bytes)\n", (gint) blob_len); +#endif /* DEBUG_SERIALIZER */ + message->body = parse_value_from_blob (mis, + dis, + variant_type, + FALSE, + 2, + error); + g_variant_type_free (variant_type); + if (message->body == NULL) + goto out; + } + } + else + { + /* no signature, this is only OK if the body is empty */ + if (message_body_len != 0) + { + /* G_GUINT32_FORMAT doesn't work with gettext, just use %u */ + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("No signature header in message but the message body is %u bytes"), + message_body_len); + goto out; + } + } + + if (!validate_headers (message, error)) + { + g_prefix_error (error, _("Cannot deserialize message: ")); + goto out; + } + + ret = TRUE; + + out: + g_object_unref (dis); + g_object_unref (mis); + + if (ret) + { + return message; + } + else + { + if (message != NULL) + g_object_unref (message); + return NULL; + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gsize +ensure_output_padding (GMemoryOutputStream *mos, + GDataOutputStream *dos, + gsize padding_size) +{ + gsize offset; + gsize wanted_offset; + gsize padding_needed; + guint n; + + offset = g_memory_output_stream_get_data_size (mos); + wanted_offset = ((offset + padding_size - 1) / padding_size) * padding_size; + padding_needed = wanted_offset - offset; + + for (n = 0; n < padding_needed; n++) + g_data_output_stream_put_byte (dos, '\0', NULL, NULL); + + return padding_needed; +} + +/* note that value can be NULL for e.g. empty arrays - type is never NULL */ +static gboolean +append_value_to_blob (GVariant *value, + const GVariantType *type, + GMemoryOutputStream *mos, + GDataOutputStream *dos, + gsize *out_padding_added, + GError **error) +{ + gsize padding_added; + + padding_added = 0; + + if (g_variant_type_equal (type, G_VARIANT_TYPE_BOOLEAN)) + { + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + gboolean v = g_variant_get_boolean (value); + g_data_output_stream_put_uint32 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_BYTE)) + { + if (value != NULL) + { + guint8 v = g_variant_get_byte (value); + g_data_output_stream_put_byte (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT16)) + { + padding_added = ensure_output_padding (mos, dos, 2); + if (value != NULL) + { + gint16 v = g_variant_get_int16 (value); + g_data_output_stream_put_int16 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT16)) + { + padding_added = ensure_output_padding (mos, dos, 2); + if (value != NULL) + { + guint16 v = g_variant_get_uint16 (value); + g_data_output_stream_put_uint16 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT32)) + { + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + gint32 v = g_variant_get_int32 (value); + g_data_output_stream_put_int32 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT32)) + { + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + guint32 v = g_variant_get_uint32 (value); + g_data_output_stream_put_uint32 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64)) + { + padding_added = ensure_output_padding (mos, dos, 8); + if (value != NULL) + { + gint64 v = g_variant_get_int64 (value); + g_data_output_stream_put_int64 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64)) + { + padding_added = ensure_output_padding (mos, dos, 8); + if (value != NULL) + { + guint64 v = g_variant_get_uint64 (value); + g_data_output_stream_put_uint64 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_DOUBLE)) + { + padding_added = ensure_output_padding (mos, dos, 8); + if (value != NULL) + { + guint64 *encoded; + gdouble v = g_variant_get_double (value); + G_STATIC_ASSERT (sizeof (gdouble) == sizeof (guint64)); + encoded = (guint64 *) &v; + g_data_output_stream_put_uint64 (dos, *encoded, NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING)) + { + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + gsize len; + const gchar *v; + const gchar *end; + v = g_variant_get_string (value, &len); + g_assert (g_utf8_validate (v, -1, &end) && (end == v + len)); + g_data_output_stream_put_uint32 (dos, len, NULL, NULL); + g_data_output_stream_put_string (dos, v, NULL, NULL); + g_data_output_stream_put_byte (dos, '\0', NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_OBJECT_PATH)) + { + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + gsize len; + const gchar *v = g_variant_get_string (value, &len); + g_assert (g_variant_is_object_path (v)); + g_data_output_stream_put_uint32 (dos, len, NULL, NULL); + g_data_output_stream_put_string (dos, v, NULL, NULL); + g_data_output_stream_put_byte (dos, '\0', NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_SIGNATURE)) + { + if (value != NULL) + { + gsize len; + const gchar *v = g_variant_get_string (value, &len); + g_assert (g_variant_is_signature (v)); + g_data_output_stream_put_byte (dos, len, NULL, NULL); + g_data_output_stream_put_string (dos, v, NULL, NULL); + g_data_output_stream_put_byte (dos, '\0', NULL, NULL); + } + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE)) + { + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + gint32 v = g_variant_get_handle (value); + g_data_output_stream_put_int32 (dos, v, NULL, NULL); + } + } + else if (g_variant_type_is_array (type)) + { + GVariant *item; + GVariantIter iter; + goffset array_len_offset; + goffset array_payload_begin_offset; + goffset cur_offset; + gsize array_len; + + padding_added = ensure_output_padding (mos, dos, 4); + if (value != NULL) + { + /* array length - will be filled in later */ + array_len_offset = g_memory_output_stream_get_data_size (mos); + g_data_output_stream_put_uint32 (dos, 0xF00DFACE, NULL, NULL); + + /* From the D-Bus spec: + * + * "A UINT32 giving the length of the array data in bytes, + * followed by alignment padding to the alignment boundary of + * the array element type, followed by each array element. The + * array length is from the end of the alignment padding to + * the end of the last element, i.e. it does not include the + * padding after the length, or any padding after the last + * element." + * + * Thus, we need to count how much padding the first element + * contributes and subtract that from the array length. + */ + array_payload_begin_offset = g_memory_output_stream_get_data_size (mos); + + if (g_variant_n_children (value) == 0) + { + gsize padding_added_for_item; + if (!append_value_to_blob (NULL, + g_variant_type_element (type), + mos, + dos, + &padding_added_for_item, + error)) + goto fail; + array_payload_begin_offset += padding_added_for_item; + } + else + { + guint n; + n = 0; + g_variant_iter_init (&iter, value); + while ((item = g_variant_iter_next_value (&iter)) != NULL) + { + gsize padding_added_for_item; + if (!append_value_to_blob (item, + g_variant_get_type (item), + mos, + dos, + &padding_added_for_item, + error)) + { + g_variant_unref (item); + goto fail; + } + g_variant_unref (item); + if (n == 0) + { + array_payload_begin_offset += padding_added_for_item; + } + n++; + } + } + + cur_offset = g_memory_output_stream_get_data_size (mos); + + array_len = cur_offset - array_payload_begin_offset; + + if (!g_seekable_seek (G_SEEKABLE (mos), array_len_offset, G_SEEK_SET, NULL, error)) + goto fail; + + g_data_output_stream_put_uint32 (dos, array_len, NULL, NULL); + + if (!g_seekable_seek (G_SEEKABLE (mos), cur_offset, G_SEEK_SET, NULL, error)) + goto fail; + } + } + else if (g_variant_type_is_dict_entry (type) || g_variant_type_is_tuple (type)) + { + padding_added = ensure_output_padding (mos, dos, 8); + if (value != NULL) + { + GVariant *item; + GVariantIter iter; + g_variant_iter_init (&iter, value); + while ((item = g_variant_iter_next_value (&iter)) != NULL) + { + if (!append_value_to_blob (item, + g_variant_get_type (item), + mos, + dos, + NULL, + error)) + { + g_variant_unref (item); + goto fail; + } + g_variant_unref (item); + } + } + } + else if (g_variant_type_is_variant (type)) + { + if (value != NULL) + { + GVariant *child; + const gchar *signature; + child = g_variant_get_child_value (value, 0); + signature = g_variant_get_type_string (child); + g_data_output_stream_put_byte (dos, strlen (signature), NULL, NULL); + g_data_output_stream_put_string (dos, signature, NULL, NULL); + g_data_output_stream_put_byte (dos, '\0', NULL, NULL); + if (!append_value_to_blob (child, + g_variant_get_type (child), + mos, + dos, + NULL, + error)) + { + g_variant_unref (child); + goto fail; + } + g_variant_unref (child); + } + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Error serializing GVariant with type string `%s' to the D-Bus wire format"), + g_variant_get_type_string (value)); + goto fail; + } + + if (out_padding_added != NULL) + *out_padding_added = padding_added; + + return TRUE; + + fail: + return FALSE; +} + +static gboolean +append_body_to_blob (GVariant *value, + GMemoryOutputStream *mos, + GDataOutputStream *dos, + GError **error) +{ + gboolean ret; + GVariant *item; + GVariantIter iter; + + ret = FALSE; + + if (!g_variant_is_of_type (value, G_VARIANT_TYPE_TUPLE)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + "Expected a tuple for the body of the GDBusMessage."); + goto fail; + } + + g_variant_iter_init (&iter, value); + while ((item = g_variant_iter_next_value (&iter)) != NULL) + { + if (!append_value_to_blob (item, + g_variant_get_type (item), + mos, + dos, + NULL, + error)) + { + g_variant_unref (item); + goto fail; + } + g_variant_unref (item); + } + return TRUE; + + fail: + return FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_to_blob: + * @message: A #GDBusMessage. + * @out_size: Return location for size of generated blob. + * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported. + * @error: Return location for error. + * + * Serializes @message to a blob. The byte order returned by + * g_dbus_message_get_byte_order() will be used. + * + * Returns: A pointer to a valid binary D-Bus message of @out_size bytes + * generated by @message or %NULL if @error is set. Free with g_free(). + * + * Since: 2.26 + */ +guchar * +g_dbus_message_to_blob (GDBusMessage *message, + gsize *out_size, + GDBusCapabilityFlags capabilities, + GError **error) +{ + GMemoryOutputStream *mos; + GDataOutputStream *dos; + guchar *ret; + gsize size; + GDataStreamByteOrder byte_order; + goffset body_len_offset; + goffset body_start_offset; + gsize body_size; + GVariant *header_fields; + GVariantBuilder builder; + GHashTableIter hash_iter; + gpointer key; + GVariant *header_value; + GVariant *signature; + const gchar *signature_str; + gint num_fds_in_message; + gint num_fds_according_to_header; + + /* TODO: check against @capabilities */ + + ret = NULL; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + g_return_val_if_fail (out_size != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + mos = G_MEMORY_OUTPUT_STREAM (g_memory_output_stream_new (NULL, 0, g_realloc, g_free)); + dos = g_data_output_stream_new (G_OUTPUT_STREAM (mos)); + + byte_order = G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN; + switch (message->byte_order) + { + case G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN: + byte_order = G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN; + break; + case G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN: + byte_order = G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN; + break; + } + g_data_output_stream_set_byte_order (dos, byte_order); + + /* Core header */ + g_data_output_stream_put_byte (dos, (guchar) message->byte_order, NULL, NULL); + g_data_output_stream_put_byte (dos, message->type, NULL, NULL); + g_data_output_stream_put_byte (dos, message->flags, NULL, NULL); + g_data_output_stream_put_byte (dos, 1, NULL, NULL); /* major protocol version */ + body_len_offset = g_memory_output_stream_get_data_size (mos); + /* body length - will be filled in later */ + g_data_output_stream_put_uint32 (dos, 0xF00DFACE, NULL, NULL); + g_data_output_stream_put_uint32 (dos, message->serial, NULL, NULL); + + num_fds_in_message = 0; +#ifdef G_OS_UNIX + if (message->fd_list != NULL) + num_fds_in_message = g_unix_fd_list_get_length (message->fd_list); +#endif + num_fds_according_to_header = g_dbus_message_get_num_unix_fds (message); + if (num_fds_in_message != num_fds_according_to_header) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Message has %d fds but the header field indicates %d fds"), + num_fds_in_message, + num_fds_according_to_header); + goto out; + } + + if (!validate_headers (message, error)) + { + g_prefix_error (error, _("Cannot serialize message: ")); + goto out; + } + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{yv}")); + g_hash_table_iter_init (&hash_iter, message->headers); + while (g_hash_table_iter_next (&hash_iter, &key, (gpointer) &header_value)) + { + g_variant_builder_add (&builder, + "{yv}", + (guchar) GPOINTER_TO_UINT (key), + header_value); + } + header_fields = g_variant_builder_end (&builder); + + if (!append_value_to_blob (header_fields, + g_variant_get_type (header_fields), + mos, dos, + NULL, + error)) + { + g_variant_unref (header_fields); + goto out; + } + g_variant_unref (header_fields); + + /* header size must be a multiple of 8 */ + ensure_output_padding (mos, dos, 8); + + body_start_offset = g_memory_output_stream_get_data_size (mos); + + signature = g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE); + signature_str = NULL; + if (signature != NULL) + signature_str = g_variant_get_string (signature, NULL); + if (message->body != NULL) + { + gchar *tupled_signature_str; + tupled_signature_str = g_strdup_printf ("(%s)", signature_str); + if (signature == NULL) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Message body has signature `%s' but there is no signature header"), + signature_str); + g_free (tupled_signature_str); + goto out; + } + else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Message body has type signature `%s' but signature in the header field is `%s'"), + tupled_signature_str, g_variant_get_type_string (message->body)); + g_free (tupled_signature_str); + goto out; + } + g_free (tupled_signature_str); + if (!append_body_to_blob (message->body, mos, dos, error)) + goto out; + } + else + { + if (signature != NULL && strlen (signature_str) > 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Message body is empty but signature in the header field is `(%s)'"), + signature_str); + goto out; + } + } + + /* OK, we're done writing the message - set the body length */ + size = g_memory_output_stream_get_data_size (mos); + body_size = size - body_start_offset; + + if (!g_seekable_seek (G_SEEKABLE (mos), body_len_offset, G_SEEK_SET, NULL, error)) + goto out; + + g_data_output_stream_put_uint32 (dos, body_size, NULL, NULL); + + if (!g_output_stream_close (G_OUTPUT_STREAM (dos), NULL, error)) + goto out; + + *out_size = size; + ret = g_memory_output_stream_steal_data (mos); + + out: + g_object_unref (dos); + g_object_unref (mos); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static guint32 +get_uint32_header (GDBusMessage *message, + GDBusMessageHeaderField header_field) +{ + GVariant *value; + guint32 ret; + + ret = 0; + value = g_hash_table_lookup (message->headers, GUINT_TO_POINTER (header_field)); + if (value != NULL && g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)) + ret = g_variant_get_uint32 (value); + + return ret; +} + +static const gchar * +get_string_header (GDBusMessage *message, + GDBusMessageHeaderField header_field) +{ + GVariant *value; + const gchar *ret; + + ret = NULL; + value = g_hash_table_lookup (message->headers, GUINT_TO_POINTER (header_field)); + if (value != NULL && g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) + ret = g_variant_get_string (value, NULL); + + return ret; +} + +static const gchar * +get_object_path_header (GDBusMessage *message, + GDBusMessageHeaderField header_field) +{ + GVariant *value; + const gchar *ret; + + ret = NULL; + value = g_hash_table_lookup (message->headers, GUINT_TO_POINTER (header_field)); + if (value != NULL && g_variant_is_of_type (value, G_VARIANT_TYPE_OBJECT_PATH)) + ret = g_variant_get_string (value, NULL); + + return ret; +} + +static const gchar * +get_signature_header (GDBusMessage *message, + GDBusMessageHeaderField header_field) +{ + GVariant *value; + const gchar *ret; + + ret = NULL; + value = g_hash_table_lookup (message->headers, GUINT_TO_POINTER (header_field)); + if (value != NULL && g_variant_is_of_type (value, G_VARIANT_TYPE_SIGNATURE)) + ret = g_variant_get_string (value, NULL); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +set_uint32_header (GDBusMessage *message, + GDBusMessageHeaderField header_field, + guint32 value) +{ + g_dbus_message_set_header (message, + header_field, + g_variant_new_uint32 (value)); +} + +static void +set_string_header (GDBusMessage *message, + GDBusMessageHeaderField header_field, + const gchar *value) +{ + g_dbus_message_set_header (message, + header_field, + value == NULL ? NULL : g_variant_new_string (value)); +} + +static void +set_object_path_header (GDBusMessage *message, + GDBusMessageHeaderField header_field, + const gchar *value) +{ + g_dbus_message_set_header (message, + header_field, + value == NULL ? NULL : g_variant_new_object_path (value)); +} + +static void +set_signature_header (GDBusMessage *message, + GDBusMessageHeaderField header_field, + const gchar *value) +{ + g_dbus_message_set_header (message, + header_field, + value == NULL ? NULL : g_variant_new_signature (value)); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_reply_serial: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +guint32 +g_dbus_message_get_reply_serial (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), 0); + return get_uint32_header (message, G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL); +} + +/** + * g_dbus_message_set_reply_serial: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_reply_serial (GDBusMessage *message, + guint32 value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + set_uint32_header (message, G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_interface: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_interface (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return get_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE); +} + +/** + * g_dbus_message_set_interface: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_interface (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_dbus_is_interface_name (value)); + set_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_member: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_member (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return get_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_MEMBER); +} + +/** + * g_dbus_message_set_member: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_member (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_dbus_is_member_name (value)); + set_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_MEMBER, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_path: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_path (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return get_object_path_header (message, G_DBUS_MESSAGE_HEADER_FIELD_PATH); +} + +/** + * g_dbus_message_set_path: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_path (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_variant_is_object_path (value)); + set_object_path_header (message, G_DBUS_MESSAGE_HEADER_FIELD_PATH, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_sender: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_sender (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return get_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SENDER); +} + +/** + * g_dbus_message_set_sender: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_sender (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_dbus_is_name (value)); + set_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SENDER, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_destination: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_destination (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return get_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION); +} + +/** + * g_dbus_message_set_destination: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_destination (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_dbus_is_name (value)); + set_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_error_name: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_error_name (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + return get_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME); +} + +/** + * g_dbus_message_set_error_name: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_error_name (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_dbus_is_interface_name (value)); + set_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_signature: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_signature (GDBusMessage *message) +{ + const gchar *ret; + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + ret = get_signature_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE); + if (ret == NULL) + ret = ""; + return ret; +} + +/** + * g_dbus_message_set_signature: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_signature (GDBusMessage *message, + const gchar *value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (value == NULL || g_variant_is_signature (value)); + set_signature_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_arg0: + * @message: A #GDBusMessage. + * + * Convenience to get the first item in the body of @message. + * + * Returns: The string item or %NULL if the first item in the body of + * @message is not a string. + * + * Since: 2.26 + */ +const gchar * +g_dbus_message_get_arg0 (GDBusMessage *message) +{ + const gchar *ret; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + + ret = NULL; + + if (message->body != NULL && g_variant_is_of_type (message->body, G_VARIANT_TYPE_TUPLE)) + { + GVariant *item; + item = g_variant_get_child_value (message->body, 0); + if (g_variant_is_of_type (item, G_VARIANT_TYPE_STRING)) + ret = g_variant_get_string (item, NULL); + g_variant_unref (item); + } + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_get_num_unix_fds: + * @message: A #GDBusMessage. + * + * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. + * + * Returns: The value. + * + * Since: 2.26 + */ +guint32 +g_dbus_message_get_num_unix_fds (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), 0); + return get_uint32_header (message, G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS); +} + +/** + * g_dbus_message_set_num_unix_fds: + * @message: A #GDBusMessage. + * @value: The value to set. + * + * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. + * + * Since: 2.26 + */ +void +g_dbus_message_set_num_unix_fds (GDBusMessage *message, + guint32 value) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + set_uint32_header (message, G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS, value); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_message_to_gerror: + * @message: A #GDBusMessage. + * @error: The #GError to set. + * + * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does + * nothing and returns %FALSE. + * + * Otherwise this method encodes the error in @message as a #GError + * using g_dbus_error_set_dbus_error() using the information in the + * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as + * well as the first string item in @message's body. + * + * Returns: %TRUE if @error was set, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_message_to_gerror (GDBusMessage *message, + GError **error) +{ + gboolean ret; + const gchar *error_name; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), FALSE); + + ret = FALSE; + if (message->type != G_DBUS_MESSAGE_TYPE_ERROR) + goto out; + + error_name = g_dbus_message_get_error_name (message); + if (error_name != NULL) + { + GVariant *body; + + body = g_dbus_message_get_body (message); + + if (body != NULL && g_variant_is_of_type (body, G_VARIANT_TYPE ("(s)"))) + { + const gchar *error_message; + g_variant_get (body, "(&s)", &error_message); + g_dbus_error_set_dbus_error (error, + error_name, + error_message, + NULL); + } + else + { + /* these two situations are valid, yet pretty rare */ + if (body != NULL) + { + g_dbus_error_set_dbus_error (error, + error_name, + "", + _("Error return with body of type `%s'"), + g_variant_get_type_string (body)); + } + else + { + g_dbus_error_set_dbus_error (error, + error_name, + "", + _("Error return with empty body")); + } + } + } + else + { + /* TOOD: this shouldn't happen - should check this at message serialization + * time and disconnect the peer. + */ + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Error return without error-name header!"); + } + + ret = TRUE; + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar * +flags_to_string (GType flags_type, guint value) +{ + GString *s; + GFlagsClass *klass; + guint n; + + klass = g_type_class_ref (flags_type); + s = g_string_new (NULL); + for (n = 0; n < 32; n++) + { + if ((value & (1<len > 0) + g_string_append_c (s, ','); + if (flags_value != NULL) + g_string_append (s, flags_value->value_nick); + else + g_string_append_printf (s, "unknown (bit %d)", n); + } + } + if (s->len == 0) + g_string_append (s, "none"); + g_type_class_unref (klass); + return g_string_free (s, FALSE); +} + +static gint +_sort_keys_func (gconstpointer a, + gconstpointer b) +{ + gint ia; + gint ib; + + ia = GPOINTER_TO_INT (a); + ib = GPOINTER_TO_INT (b); + + return ia - ib; +} + +/** + * g_dbus_message_print: + * @message: A #GDBusMessage. + * @indent: Indentation level. + * + * Produces a human-readable multi-line description of @message. + * + * The contents of the description has no ABI guarantees, the contents + * and formatting is subject to change at any time. Typical output + * looks something like this: + * + * Type: method-call + * Flags: none + * Version: 0 + * Serial: 4 + * Headers: + * path -> objectpath '/org/gtk/GDBus/TestObject' + * interface -> 'org.gtk.GDBus.TestInterface' + * member -> 'GimmeStdout' + * destination -> ':1.146' + * Body: () + * UNIX File Descriptors: + * (none) + * + * or + * + * Type: method-return + * Flags: no-reply-expected + * Version: 0 + * Serial: 477 + * Headers: + * reply-serial -> uint32 4 + * destination -> ':1.159' + * sender -> ':1.146' + * num-unix-fds -> uint32 1 + * Body: () + * UNIX File Descriptors: + * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635 + * + * + * Returns: A string that should be freed with g_free(). + * + * Since: 2.26 + */ +gchar * +g_dbus_message_print (GDBusMessage *message, + guint indent) +{ + GString *str; + gchar *s; + GList *keys; + GList *l; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + + str = g_string_new (NULL); + + s = _g_dbus_enum_to_string (G_TYPE_DBUS_MESSAGE_TYPE, message->type); + g_string_append_printf (str, "%*sType: %s\n", indent, "", s); + g_free (s); + s = flags_to_string (G_TYPE_DBUS_MESSAGE_FLAGS, message->flags); + g_string_append_printf (str, "%*sFlags: %s\n", indent, "", s); + g_free (s); + g_string_append_printf (str, "%*sVersion: %d\n", indent, "", message->major_protocol_version); + g_string_append_printf (str, "%*sSerial: %d\n", indent, "", message->serial); + + g_string_append_printf (str, "%*sHeaders:\n", indent, ""); + keys = g_hash_table_get_keys (message->headers); + keys = g_list_sort (keys, _sort_keys_func); + if (keys != NULL) + { + for (l = keys; l != NULL; l = l->next) + { + gint key = GPOINTER_TO_INT (l->data); + GVariant *value; + gchar *value_str; + + value = g_hash_table_lookup (message->headers, l->data); + g_assert (value != NULL); + + s = _g_dbus_enum_to_string (G_TYPE_DBUS_MESSAGE_HEADER_FIELD, key); + value_str = g_variant_print (value, TRUE); + g_string_append_printf (str, "%*s %s -> %s\n", indent, "", s, value_str); + g_free (s); + g_free (value_str); + } + } + else + { + g_string_append_printf (str, "%*s (none)\n", indent, ""); + } + g_string_append_printf (str, "%*sBody: ", indent, ""); + if (message->body != NULL) + { + g_variant_print_string (message->body, + str, + TRUE); + } + else + { + g_string_append (str, "()"); + } + g_string_append (str, "\n"); +#ifdef G_OS_UNIX + g_string_append_printf (str, "%*sUNIX File Descriptors:\n", indent, ""); + if (message->fd_list != NULL) + { + gint num_fds; + const gint *fds; + gint n; + + fds = g_unix_fd_list_peek_fds (message->fd_list, &num_fds); + if (num_fds > 0) + { + for (n = 0; n < num_fds; n++) + { + GString *fs; + struct stat statbuf; + fs = g_string_new (NULL); + if (fstat (fds[n], &statbuf) == 0) + { + g_string_append_printf (fs, "%s" "dev=%d:%d", fs->len > 0 ? "," : "", + major (statbuf.st_dev), minor (statbuf.st_dev)); + g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "", + statbuf.st_mode); + g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", + (guint64) statbuf.st_ino); + g_string_append_printf (fs, "%s" "uid=%d", fs->len > 0 ? "," : "", + statbuf.st_uid); + g_string_append_printf (fs, "%s" "gid=%d", fs->len > 0 ? "," : "", + statbuf.st_gid); + g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "", + major (statbuf.st_rdev), minor (statbuf.st_rdev)); + g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", + (guint64) statbuf.st_size); + g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", + (guint64) statbuf.st_atime); + g_string_append_printf (fs, "%s" "mtime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", + (guint64) statbuf.st_mtime); + g_string_append_printf (fs, "%s" "ctime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", + (guint64) statbuf.st_ctime); + } + else + { + g_string_append_printf (fs, "(fstat failed: %s)", strerror (errno)); + } + g_string_append_printf (str, "%*s fd %d: %s\n", indent, "", fds[n], fs->str); + g_string_free (fs, TRUE); + } + } + else + { + g_string_append_printf (str, "%*s (empty)\n", indent, ""); + } + } + else + { + g_string_append_printf (str, "%*s (none)\n", indent, ""); + } +#endif + + return g_string_free (str, FALSE); +} + +/** + * g_dbus_message_get_locked: + * @message: A #GDBusMessage. + * + * Checks whether @message is locked. To monitor changes to this + * value, conncet to the #GObject::notify signal to listen for changes + * on the #GDBusMessage:locked property. + * + * Returns: %TRUE if @message is locked, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_message_get_locked (GDBusMessage *message) +{ + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), FALSE); + return message->locked; +} + +/** + * g_dbus_message_lock: + * @message: A #GDBusMessage. + * + * If @message is locked, does nothing. Otherwise locks the message. + * + * Since: 2.26 + */ +void +g_dbus_message_lock (GDBusMessage *message) +{ + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + + if (message->locked) + goto out; + + message->locked = TRUE; + g_object_notify (G_OBJECT (message), "locked"); + + out: + ; +} + +/** + * g_dbus_message_copy: + * @message: A #GDBusMessage. + * @error: Return location for error or %NULL. + * + * Copies @message. The copy is a deep copy and the returned + * #GDBusMessage is completely identical except that it is guaranteed + * to not be locked. + * + * This operation can fail if e.g. @message contains file descriptors + * and the per-process or system-wide open files limit is reached. + * + * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with + * g_object_unref(). + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_message_copy (GDBusMessage *message, + GError **error) +{ + GDBusMessage *ret; + GHashTableIter iter; + gpointer header_key; + GVariant *header_value; + + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = g_dbus_message_new (); + ret->type = message->type; + ret->flags = message->flags; + ret->byte_order = message->byte_order; + ret->major_protocol_version = message->major_protocol_version; + ret->serial = message->serial; + +#ifdef G_OS_UNIX + if (message->fd_list != NULL) + { + gint n; + gint num_fds; + const gint *fds; + + ret->fd_list = g_unix_fd_list_new (); + fds = g_unix_fd_list_peek_fds (message->fd_list, &num_fds); + for (n = 0; n < num_fds; n++) + { + if (g_unix_fd_list_append (ret->fd_list, + fds[n], + error) == -1) + { + g_object_unref (ret); + ret = NULL; + goto out; + } + } + } +#endif + + /* see https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8 for why it's fine + * to just ref (as opposed to deep-copying) the GVariant instances + */ + ret->body = message->body != NULL ? g_variant_ref (message->body) : NULL; + g_hash_table_iter_init (&iter, message->headers); + while (g_hash_table_iter_next (&iter, &header_key, (gpointer) &header_value)) + g_hash_table_insert (ret->headers, header_key, g_variant_ref (header_value)); + + out: + return ret; +} + diff --git a/gio/gdbusmessage.h b/gio/gdbusmessage.h new file mode 100644 index 0000000..5c4febd --- /dev/null +++ b/gio/gdbusmessage.h @@ -0,0 +1,149 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_MESSAGE_H__ +#define __G_DBUS_MESSAGE_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_MESSAGE (g_dbus_message_get_type ()) +#define G_DBUS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_MESSAGE, GDBusMessage)) +#define G_IS_DBUS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_MESSAGE)) + +GType g_dbus_message_get_type (void) G_GNUC_CONST; +GDBusMessage *g_dbus_message_new (void); +GDBusMessage *g_dbus_message_new_signal (const gchar *path, + const gchar *interface_, + const gchar *signal); +GDBusMessage *g_dbus_message_new_method_call (const gchar *name, + const gchar *path, + const gchar *interface_, + const gchar *method); +GDBusMessage *g_dbus_message_new_method_reply (GDBusMessage *method_call_message); +GDBusMessage *g_dbus_message_new_method_error (GDBusMessage *method_call_message, + const gchar *error_name, + const gchar *error_message_format, + ...); +GDBusMessage *g_dbus_message_new_method_error_valist (GDBusMessage *method_call_message, + const gchar *error_name, + const gchar *error_message_format, + va_list var_args); +GDBusMessage *g_dbus_message_new_method_error_literal (GDBusMessage *method_call_message, + const gchar *error_name, + const gchar *error_message); +gchar *g_dbus_message_print (GDBusMessage *message, + guint indent); +gboolean g_dbus_message_get_locked (GDBusMessage *message); +void g_dbus_message_lock (GDBusMessage *message); +GDBusMessage *g_dbus_message_copy (GDBusMessage *message, + GError **error); +GDBusMessageByteOrder g_dbus_message_get_byte_order (GDBusMessage *message); +void g_dbus_message_set_byte_order (GDBusMessage *message, + GDBusMessageByteOrder byte_order); + +GDBusMessageType g_dbus_message_get_message_type (GDBusMessage *message); +void g_dbus_message_set_message_type (GDBusMessage *message, + GDBusMessageType type); +GDBusMessageFlags g_dbus_message_get_flags (GDBusMessage *message); +void g_dbus_message_set_flags (GDBusMessage *message, + GDBusMessageFlags flags); +guint32 g_dbus_message_get_serial (GDBusMessage *message); +void g_dbus_message_set_serial (GDBusMessage *message, + guint32 serial); +GVariant *g_dbus_message_get_header (GDBusMessage *message, + GDBusMessageHeaderField header_field); +void g_dbus_message_set_header (GDBusMessage *message, + GDBusMessageHeaderField header_field, + GVariant *value); +guchar *g_dbus_message_get_header_fields (GDBusMessage *message); +GVariant *g_dbus_message_get_body (GDBusMessage *message); +void g_dbus_message_set_body (GDBusMessage *message, + GVariant *body); +GUnixFDList *g_dbus_message_get_unix_fd_list (GDBusMessage *message); +void g_dbus_message_set_unix_fd_list (GDBusMessage *message, + GUnixFDList *fd_list); + +guint32 g_dbus_message_get_reply_serial (GDBusMessage *message); +void g_dbus_message_set_reply_serial (GDBusMessage *message, + guint32 value); + +const gchar *g_dbus_message_get_interface (GDBusMessage *message); +void g_dbus_message_set_interface (GDBusMessage *message, + const gchar *value); + +const gchar *g_dbus_message_get_member (GDBusMessage *message); +void g_dbus_message_set_member (GDBusMessage *message, + const gchar *value); + +const gchar *g_dbus_message_get_path (GDBusMessage *message); +void g_dbus_message_set_path (GDBusMessage *message, + const gchar *value); + +const gchar *g_dbus_message_get_sender (GDBusMessage *message); +void g_dbus_message_set_sender (GDBusMessage *message, + const gchar *value); + +const gchar *g_dbus_message_get_destination (GDBusMessage *message); +void g_dbus_message_set_destination (GDBusMessage *message, + const gchar *value); + +const gchar *g_dbus_message_get_error_name (GDBusMessage *message); +void g_dbus_message_set_error_name (GDBusMessage *message, + const gchar *value); + +const gchar *g_dbus_message_get_signature (GDBusMessage *message); +void g_dbus_message_set_signature (GDBusMessage *message, + const gchar *value); + +guint32 g_dbus_message_get_num_unix_fds (GDBusMessage *message); +void g_dbus_message_set_num_unix_fds (GDBusMessage *message, + guint32 value); + +const gchar *g_dbus_message_get_arg0 (GDBusMessage *message); + + +GDBusMessage *g_dbus_message_new_from_blob (guchar *blob, + gsize blob_len, + GDBusCapabilityFlags capabilities, + GError **error); + +gssize g_dbus_message_bytes_needed (guchar *blob, + gsize blob_len, + GError **error); + +guchar *g_dbus_message_to_blob (GDBusMessage *message, + gsize *out_size, + GDBusCapabilityFlags capabilities, + GError **error); + +gboolean g_dbus_message_to_gerror (GDBusMessage *message, + GError **error); + +G_END_DECLS + +#endif /* __G_DBUS_MESSAGE_H__ */ diff --git a/gio/gdbusmethodinvocation.c b/gio/gdbusmethodinvocation.c new file mode 100644 index 0000000..2e6b5e6 --- /dev/null +++ b/gio/gdbusmethodinvocation.c @@ -0,0 +1,607 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include + +#include "gdbusutils.h" +#include "gdbusconnection.h" +#include "gdbusmessage.h" +#include "gdbusmethodinvocation.h" +#include "gdbusintrospection.h" +#include "gdbuserror.h" +#include "gdbusprivate.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusmethodinvocation + * @short_description: Object for handling remote calls + * @include: gio/gio.h + * + * Instances of the #GDBusMethodInvocation class are used when + * handling D-Bus method calls. It provides a way to asynchronously + * return results and errors. + * + * The normal way to obtain a #GDBusMethodInvocation object is to receive + * it as an argument to the handle_method_call() function in a + * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object(). + */ + +typedef struct _GDBusMethodInvocationClass GDBusMethodInvocationClass; + +/** + * GDBusMethodInvocationClass: + * + * Class structure for #GDBusMethodInvocation. + * + * Since: 2.26 + */ +struct _GDBusMethodInvocationClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +/** + * GDBusMethodInvocation: + * + * The #GDBusMethodInvocation structure contains only private data and + * should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GDBusMethodInvocation +{ + /*< private >*/ + GObject parent_instance; + + /* construct-only properties */ + gchar *sender; + gchar *object_path; + gchar *interface_name; + gchar *method_name; + const GDBusMethodInfo *method_info; + GDBusConnection *connection; + GDBusMessage *message; + GVariant *parameters; + gpointer user_data; +}; + +G_DEFINE_TYPE (GDBusMethodInvocation, g_dbus_method_invocation, G_TYPE_OBJECT); + +static void +g_dbus_method_invocation_finalize (GObject *object) +{ + GDBusMethodInvocation *invocation = G_DBUS_METHOD_INVOCATION (object); + + g_free (invocation->sender); + g_free (invocation->object_path); + g_free (invocation->interface_name); + g_free (invocation->method_name); + g_object_unref (invocation->connection); + g_object_unref (invocation->message); + g_variant_unref (invocation->parameters); + + G_OBJECT_CLASS (g_dbus_method_invocation_parent_class)->finalize (object); +} + +static void +g_dbus_method_invocation_class_init (GDBusMethodInvocationClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = g_dbus_method_invocation_finalize; +} + +static void +g_dbus_method_invocation_init (GDBusMethodInvocation *invocation) +{ +} + +/** + * g_dbus_method_invocation_get_sender: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the bus name that invoked the method. + * + * Returns: A string. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +const gchar * +g_dbus_method_invocation_get_sender (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->sender; +} + +/** + * g_dbus_method_invocation_get_object_path: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the object path the method was invoked on. + * + * Returns: A string. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +const gchar * +g_dbus_method_invocation_get_object_path (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->object_path; +} + +/** + * g_dbus_method_invocation_get_interface_name: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the name of the D-Bus interface the method was invoked on. + * + * Returns: A string. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +const gchar * +g_dbus_method_invocation_get_interface_name (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->interface_name; +} + +/** + * g_dbus_method_invocation_get_method_info: + * @invocation: A #GDBusMethodInvocation. + * + * Gets information about the method call, if any. + * + * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +const GDBusMethodInfo * +g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->method_info; +} + +/** + * g_dbus_method_invocation_get_method_name: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the name of the method that was invoked. + * + * Returns: A string. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +const gchar * +g_dbus_method_invocation_get_method_name (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->method_name; +} + +/** + * g_dbus_method_invocation_get_connection: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the #GDBusConnection the method was invoked on. + * + * Returns: (transfer none):A #GDBusConnection. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +GDBusConnection * +g_dbus_method_invocation_get_connection (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->connection; +} + +/** + * g_dbus_method_invocation_get_message: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the #GDBusMessage for the method invocation. This is useful if + * you need to use low-level protocol features, such as UNIX file + * descriptor passing, that cannot be properly expressed in the + * #GVariant API. + * + * See and for an example of how to use this + * low-level API to send and receive UNIX file descriptors. + * + * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +GDBusMessage * +g_dbus_method_invocation_get_message (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->message; +} + +/** + * g_dbus_method_invocation_get_parameters: + * @invocation: A #GDBusMethodInvocation. + * + * Gets the parameters of the method invocation. + * + * Returns: A #GVariant. Do not free, it is owned by @invocation. + * + * Since: 2.26 + */ +GVariant * +g_dbus_method_invocation_get_parameters (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->parameters; +} + +/** + * g_dbus_method_invocation_get_user_data: (skip) + * @invocation: A #GDBusMethodInvocation. + * + * Gets the @user_data #gpointer passed to g_dbus_connection_register_object(). + * + * Returns: A #gpointer. + * + * Since: 2.26 + */ +gpointer +g_dbus_method_invocation_get_user_data (GDBusMethodInvocation *invocation) +{ + g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); + return invocation->user_data; +} + +/* < internal > + * _g_dbus_method_invocation_new: + * @sender: The bus name that invoked the method or %NULL if @connection is not a bus connection. + * @object_path: The object path the method was invoked on. + * @interface_name: The name of the D-Bus interface the method was invoked on. + * @method_name: The name of the method that was invoked. + * @method_info: Information about the method call or %NULL. + * @connection: The #GDBusConnection the method was invoked on. + * @message: The D-Bus message as a #GDBusMessage. + * @parameters: The parameters as a #GVariant tuple. + * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object(). + * + * Creates a new #GDBusMethodInvocation object. + * + * Returns: A #GDBusMethodInvocation. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusMethodInvocation * +_g_dbus_method_invocation_new (const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + const GDBusMethodInfo *method_info, + GDBusConnection *connection, + GDBusMessage *message, + GVariant *parameters, + gpointer user_data) +{ + GDBusMethodInvocation *invocation; + + g_return_val_if_fail (sender == NULL || g_dbus_is_name (sender), NULL); + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + g_return_val_if_fail (interface_name == NULL || g_dbus_is_interface_name (interface_name), NULL); + g_return_val_if_fail (g_dbus_is_member_name (method_name), NULL); + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL); + g_return_val_if_fail (g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE), NULL); + + invocation = G_DBUS_METHOD_INVOCATION (g_object_new (G_TYPE_DBUS_METHOD_INVOCATION, NULL)); + invocation->sender = g_strdup (sender); + invocation->object_path = g_strdup (object_path); + invocation->interface_name = g_strdup (interface_name); + invocation->method_name = g_strdup (method_name); + invocation->method_info = g_dbus_method_info_ref ((GDBusMethodInfo *)method_info); + invocation->connection = g_object_ref (connection); + invocation->message = g_object_ref (message); + invocation->parameters = g_variant_ref (parameters); + invocation->user_data = user_data; + + return invocation; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_method_invocation_return_value: + * @invocation: A #GDBusMethodInvocation. + * @parameters: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters. + * + * Finishes handling a D-Bus method call by returning @parameters. + * If the @parameters GVariant is floating, it is consumed. + * + * It is an error if @parameters is not of the right format. + * + * This method will free @invocation, you cannot use it afterwards. + * + * Since: 2.26 + */ +void +g_dbus_method_invocation_return_value (GDBusMethodInvocation *invocation, + GVariant *parameters) +{ + GDBusMessage *reply; + GError *error; + + g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_return_if_fail ((parameters == NULL) || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE)); + + if (parameters == NULL) + parameters = g_variant_new_tuple (NULL, 0); + + /* if we have introspection data, check that the signature of @parameters is correct */ + if (invocation->method_info != NULL) + { + GVariantType *type; + + type = _g_dbus_compute_complete_signature (invocation->method_info->out_args); + + if (!g_variant_is_of_type (parameters, type)) + { + gchar *type_string = g_variant_type_dup_string (type); + + g_warning (_("Type of return value is incorrect, got `%s', expected `%s'"), + g_variant_get_type_string (parameters), type_string); + g_variant_type_free (type); + g_free (type_string); + goto out; + } + g_variant_type_free (type); + } + + if (G_UNLIKELY (_g_dbus_debug_return ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Return:\n" + " >>>> METHOD RETURN\n" + " in response to %s.%s()\n" + " on object %s\n" + " to name %s\n" + " reply-serial %d\n", + invocation->interface_name, invocation->method_name, + invocation->object_path, + invocation->sender, + g_dbus_message_get_serial (invocation->message)); + _g_dbus_debug_print_unlock (); + } + + reply = g_dbus_message_new_method_reply (invocation->message); + g_dbus_message_set_body (reply, parameters); + error = NULL; + if (!g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, &error)) + { + g_warning (_("Error sending message: %s"), error->message); + g_error_free (error); + } + g_object_unref (reply); + + out: + g_object_unref (invocation); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_method_invocation_return_error: + * @invocation: A #GDBusMethodInvocation. + * @domain: A #GQuark for the #GError error domain. + * @code: The error code. + * @format: printf()-style format. + * @...: Parameters for @format. + * + * Finishes handling a D-Bus method call by returning an error. + * + * See g_dbus_error_encode_gerror() for details about what error name + * will be returned on the wire. In a nutshell, if the given error is + * registered using g_dbus_error_register_error() the name given + * during registration is used. Otherwise, a name of the form + * org.gtk.GDBus.UnmappedGError.Quark... is + * used. This provides transparent mapping of #GError between + * applications using GDBus. + * + * If you are writing an application intended to be portable, + * always register errors with g_dbus_error_register_error() + * or use g_dbus_method_invocation_return_dbus_error(). + * + * This method will free @invocation, you cannot use it afterwards. + * + * Since: 2.26 + */ +void +g_dbus_method_invocation_return_error (GDBusMethodInvocation *invocation, + GQuark domain, + gint code, + const gchar *format, + ...) +{ + va_list var_args; + + g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_return_if_fail (format != NULL); + + va_start (var_args, format); + g_dbus_method_invocation_return_error_valist (invocation, + domain, + code, + format, + var_args); + va_end (var_args); +} + +/** + * g_dbus_method_invocation_return_error_valist: + * @invocation: A #GDBusMethodInvocation. + * @domain: A #GQuark for the #GError error domain. + * @code: The error code. + * @format: printf()-style format. + * @var_args: #va_list of parameters for @format. + * + * Like g_dbus_method_invocation_return_error() but intended for + * language bindings. + * + * This method will free @invocation, you cannot use it afterwards. + * + * Since: 2.26 + */ +void +g_dbus_method_invocation_return_error_valist (GDBusMethodInvocation *invocation, + GQuark domain, + gint code, + const gchar *format, + va_list var_args) +{ + gchar *literal_message; + + g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_return_if_fail (format != NULL); + + literal_message = g_strdup_vprintf (format, var_args); + g_dbus_method_invocation_return_error_literal (invocation, + domain, + code, + literal_message); + g_free (literal_message); +} + +/** + * g_dbus_method_invocation_return_error_literal: + * @invocation: A #GDBusMethodInvocation. + * @domain: A #GQuark for the #GError error domain. + * @code: The error code. + * @message: The error message. + * + * Like g_dbus_method_invocation_return_error() but without printf()-style formatting. + * + * This method will free @invocation, you cannot use it afterwards. + * + * Since: 2.26 + */ +void +g_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation, + GQuark domain, + gint code, + const gchar *message) +{ + GError *error; + + g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_return_if_fail (message != NULL); + + error = g_error_new_literal (domain, code, message); + g_dbus_method_invocation_return_gerror (invocation, error); + g_error_free (error); +} + +/** + * g_dbus_method_invocation_return_gerror: + * @invocation: A #GDBusMethodInvocation. + * @error: A #GError. + * + * Like g_dbus_method_invocation_return_error() but takes a #GError + * instead of the error domain, error code and message. + * + * This method will free @invocation, you cannot use it afterwards. + * + * Since: 2.26 + */ +void +g_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation, + const GError *error) +{ + gchar *dbus_error_name; + + g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_return_if_fail (error != NULL); + + dbus_error_name = g_dbus_error_encode_gerror (error); + + g_dbus_method_invocation_return_dbus_error (invocation, + dbus_error_name, + error->message); + g_free (dbus_error_name); +} + +/** + * g_dbus_method_invocation_return_dbus_error: + * @invocation: A #GDBusMethodInvocation. + * @error_name: A valid D-Bus error name. + * @error_message: A valid D-Bus error message. + * + * Finishes handling a D-Bus method call by returning an error. + * + * This method will free @invocation, you cannot use it afterwards. + * + * Since: 2.26 + */ +void +g_dbus_method_invocation_return_dbus_error (GDBusMethodInvocation *invocation, + const gchar *error_name, + const gchar *error_message) +{ + GDBusMessage *reply; + + g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_return_if_fail (error_name != NULL && g_dbus_is_name (error_name)); + g_return_if_fail (error_message != NULL); + + if (G_UNLIKELY (_g_dbus_debug_return ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Return:\n" + " >>>> METHOD ERROR %s\n" + " message `%s'\n" + " in response to %s.%s()\n" + " on object %s\n" + " to name %s\n" + " reply-serial %d\n", + error_name, + error_message, + invocation->interface_name, invocation->method_name, + invocation->object_path, + invocation->sender, + g_dbus_message_get_serial (invocation->message)); + _g_dbus_debug_print_unlock (); + } + + reply = g_dbus_message_new_method_error_literal (invocation->message, + error_name, + error_message); + g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (reply); + + g_object_unref (invocation); +} diff --git a/gio/gdbusmethodinvocation.h b/gio/gdbusmethodinvocation.h new file mode 100644 index 0000000..550313e --- /dev/null +++ b/gio/gdbusmethodinvocation.h @@ -0,0 +1,73 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_METHOD_INVOCATION_H__ +#define __G_DBUS_METHOD_INVOCATION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_METHOD_INVOCATION (g_dbus_method_invocation_get_type ()) +#define G_DBUS_METHOD_INVOCATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_METHOD_INVOCATION, GDBusMethodInvocation)) +#define G_IS_DBUS_METHOD_INVOCATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_METHOD_INVOCATION)) + +GType g_dbus_method_invocation_get_type (void) G_GNUC_CONST; +const gchar *g_dbus_method_invocation_get_sender (GDBusMethodInvocation *invocation); +const gchar *g_dbus_method_invocation_get_object_path (GDBusMethodInvocation *invocation); +const gchar *g_dbus_method_invocation_get_interface_name (GDBusMethodInvocation *invocation); +const gchar *g_dbus_method_invocation_get_method_name (GDBusMethodInvocation *invocation); +const GDBusMethodInfo *g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation); +GDBusConnection *g_dbus_method_invocation_get_connection (GDBusMethodInvocation *invocation); +GDBusMessage *g_dbus_method_invocation_get_message (GDBusMethodInvocation *invocation); +GVariant *g_dbus_method_invocation_get_parameters (GDBusMethodInvocation *invocation); +gpointer g_dbus_method_invocation_get_user_data (GDBusMethodInvocation *invocation); + +void g_dbus_method_invocation_return_value (GDBusMethodInvocation *invocation, + GVariant *parameters); +void g_dbus_method_invocation_return_error (GDBusMethodInvocation *invocation, + GQuark domain, + gint code, + const gchar *format, + ...); +void g_dbus_method_invocation_return_error_valist (GDBusMethodInvocation *invocation, + GQuark domain, + gint code, + const gchar *format, + va_list var_args); +void g_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation, + GQuark domain, + gint code, + const gchar *message); +void g_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation, + const GError *error); +void g_dbus_method_invocation_return_dbus_error (GDBusMethodInvocation *invocation, + const gchar *error_name, + const gchar *error_message); + +G_END_DECLS + +#endif /* __G_DBUS_METHOD_INVOCATION_H__ */ diff --git a/gio/gdbusnameowning.c b/gio/gdbusnameowning.c new file mode 100644 index 0000000..6a5dc84 --- /dev/null +++ b/gio/gdbusnameowning.c @@ -0,0 +1,923 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include + +#include "gdbusutils.h" +#include "gdbusnameowning.h" +#include "gdbuserror.h" +#include "gdbusprivate.h" +#include "gdbusconnection.h" +#include "gio-marshal.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusnameowning + * @title: Owning Bus Names + * @short_description: Simple API for owning bus names + * @include: gio/gio.h + * + * Convenience API for owning bus names. + * + * Simple application owning a nameFIXME: MISSING XINCLUDE CONTENT + */ + +G_LOCK_DEFINE_STATIC (lock); + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef enum +{ + PREVIOUS_CALL_NONE = 0, + PREVIOUS_CALL_ACQUIRED, + PREVIOUS_CALL_LOST, +} PreviousCall; + +typedef struct +{ + volatile gint ref_count; + guint id; + GBusNameOwnerFlags flags; + gchar *name; + GBusAcquiredCallback bus_acquired_handler; + GBusNameAcquiredCallback name_acquired_handler; + GBusNameLostCallback name_lost_handler; + gpointer user_data; + GDestroyNotify user_data_free_func; + GMainContext *main_context; + + PreviousCall previous_call; + + GDBusConnection *connection; + gulong disconnected_signal_handler_id; + guint name_acquired_subscription_id; + guint name_lost_subscription_id; + + gboolean cancelled; + + gboolean needs_release; +} Client; + +static guint next_global_id = 1; +static GHashTable *map_id_to_client = NULL; + + +static Client * +client_ref (Client *client) +{ + g_atomic_int_inc (&client->ref_count); + return client; +} + +static void +client_unref (Client *client) +{ + if (g_atomic_int_dec_and_test (&client->ref_count)) + { + if (client->connection != NULL) + { + if (client->disconnected_signal_handler_id > 0) + g_signal_handler_disconnect (client->connection, client->disconnected_signal_handler_id); + if (client->name_acquired_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_acquired_subscription_id); + if (client->name_lost_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_lost_subscription_id); + g_object_unref (client->connection); + } + if (client->main_context != NULL) + g_main_context_unref (client->main_context); + g_free (client->name); + if (client->user_data_free_func != NULL) + client->user_data_free_func (client->user_data); + g_free (client); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + + +typedef enum +{ + CALL_TYPE_NAME_ACQUIRED, + CALL_TYPE_NAME_LOST +} CallType; + +typedef struct +{ + Client *client; + + /* keep this separate because client->connection may + * be set to NULL after scheduling the call + */ + GDBusConnection *connection; + + /* set to TRUE to call acquired */ + CallType call_type; +} CallHandlerData; + +static void +call_handler_data_free (CallHandlerData *data) +{ + if (data->connection != NULL) + g_object_unref (data->connection); + client_unref (data->client); + g_free (data); +} + +static void +actually_do_call (Client *client, GDBusConnection *connection, CallType call_type) +{ + switch (call_type) + { + case CALL_TYPE_NAME_ACQUIRED: + if (client->name_acquired_handler != NULL) + { + client->name_acquired_handler (connection, + client->name, + client->user_data); + } + break; + + case CALL_TYPE_NAME_LOST: + if (client->name_lost_handler != NULL) + { + client->name_lost_handler (connection, + client->name, + client->user_data); + } + break; + + default: + g_assert_not_reached (); + break; + } +} + +static gboolean +call_in_idle_cb (gpointer _data) +{ + CallHandlerData *data = _data; + actually_do_call (data->client, data->connection, data->call_type); + return FALSE; +} + +static void +schedule_call_in_idle (Client *client, CallType call_type) +{ + CallHandlerData *data; + GSource *idle_source; + + data = g_new0 (CallHandlerData, 1); + data->client = client_ref (client); + data->connection = client->connection != NULL ? g_object_ref (client->connection) : NULL; + data->call_type = call_type; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_HIGH); + g_source_set_callback (idle_source, + call_in_idle_cb, + data, + (GDestroyNotify) call_handler_data_free); + g_source_attach (idle_source, client->main_context); + g_source_unref (idle_source); +} + +static void +do_call (Client *client, CallType call_type) +{ + /* only schedule in idle if we're not in the right thread */ + if (g_main_context_get_thread_default () != client->main_context) + schedule_call_in_idle (client, call_type); + else + actually_do_call (client, client->connection, call_type); +} + +static void +call_acquired_handler (Client *client) +{ + if (client->previous_call != PREVIOUS_CALL_ACQUIRED) + { + client->previous_call = PREVIOUS_CALL_ACQUIRED; + if (!client->cancelled) + { + do_call (client, CALL_TYPE_NAME_ACQUIRED); + } + } +} + +static void +call_lost_handler (Client *client) +{ + if (client->previous_call != PREVIOUS_CALL_LOST) + { + client->previous_call = PREVIOUS_CALL_LOST; + if (!client->cancelled) + { + do_call (client, CALL_TYPE_NAME_LOST); + } + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_name_lost_or_acquired (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + Client *client = user_data; + const gchar *name; + + if (g_strcmp0 (object_path, "/org/freedesktop/DBus") != 0 || + g_strcmp0 (interface_name, "org.freedesktop.DBus") != 0 || + g_strcmp0 (sender_name, "org.freedesktop.DBus") != 0) + goto out; + + if (g_strcmp0 (signal_name, "NameLost") == 0) + { + g_variant_get (parameters, "(&s)", &name); + if (g_strcmp0 (name, client->name) == 0) + { + call_lost_handler (client); + } + } + else if (g_strcmp0 (signal_name, "NameAcquired") == 0) + { + g_variant_get (parameters, "(&s)", &name); + if (g_strcmp0 (name, client->name) == 0) + { + call_acquired_handler (client); + } + } + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +request_name_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + Client *client = user_data; + GVariant *result; + guint32 request_name_reply; + gboolean subscribe; + + request_name_reply = 0; + result = NULL; + + result = g_dbus_connection_call_finish (client->connection, + res, + NULL); + if (result != NULL) + { + g_variant_get (result, "(u)", &request_name_reply); + g_variant_unref (result); + } + + subscribe = FALSE; + + switch (request_name_reply) + { + case 1: /* DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER */ + /* We got the name - now listen for NameLost and NameAcquired */ + call_acquired_handler (client); + subscribe = TRUE; + client->needs_release = TRUE; + break; + + case 2: /* DBUS_REQUEST_NAME_REPLY_IN_QUEUE */ + /* Waiting in line - listen for NameLost and NameAcquired */ + call_lost_handler (client); + subscribe = TRUE; + client->needs_release = TRUE; + break; + + default: + /* assume we couldn't get the name - explicit fallthrough */ + case 3: /* DBUS_REQUEST_NAME_REPLY_EXISTS */ + case 4: /* DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER */ + /* Some other part of the process is already owning the name */ + call_lost_handler (client); + break; + } + + if (subscribe) + { + /* start listening to NameLost and NameAcquired messages */ + client->name_lost_subscription_id = + g_dbus_connection_signal_subscribe (client->connection, + "org.freedesktop.DBus", + "org.freedesktop.DBus", + "NameLost", + "/org/freedesktop/DBus", + client->name, + G_DBUS_SIGNAL_FLAGS_NONE, + on_name_lost_or_acquired, + client, + NULL); + client->name_acquired_subscription_id = + g_dbus_connection_signal_subscribe (client->connection, + "org.freedesktop.DBus", + "org.freedesktop.DBus", + "NameAcquired", + "/org/freedesktop/DBus", + client->name, + G_DBUS_SIGNAL_FLAGS_NONE, + on_name_lost_or_acquired, + client, + NULL); + } + + client_unref (client); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_connection_disconnected (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data) +{ + Client *client = user_data; + + if (client->disconnected_signal_handler_id > 0) + g_signal_handler_disconnect (client->connection, client->disconnected_signal_handler_id); + if (client->name_acquired_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_acquired_subscription_id); + if (client->name_lost_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_lost_subscription_id); + g_object_unref (client->connection); + client->disconnected_signal_handler_id = 0; + client->name_acquired_subscription_id = 0; + client->name_lost_subscription_id = 0; + client->connection = NULL; + + call_lost_handler (client); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +has_connection (Client *client) +{ + /* listen for disconnection */ + client->disconnected_signal_handler_id = g_signal_connect (client->connection, + "closed", + G_CALLBACK (on_connection_disconnected), + client); + + /* attempt to acquire the name */ + g_dbus_connection_call (client->connection, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "RequestName", /* method name */ + g_variant_new ("(su)", + client->name, + client->flags), + G_VARIANT_TYPE ("(u)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) request_name_cb, + client_ref (client)); +} + + +static void +connection_get_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + Client *client = user_data; + + client->connection = g_bus_get_finish (res, NULL); + if (client->connection == NULL) + { + call_lost_handler (client); + goto out; + } + + /* No need to schedule this in idle as we're already in the thread + * that the user called g_bus_own_name() from. This is because + * g_bus_get() guarantees that. + * + * Also, we need to ensure that the handler is invoked *before* + * we call RequestName(). Otherwise there is a race. + */ + if (client->bus_acquired_handler != NULL) + { + client->bus_acquired_handler (client->connection, + client->name, + client->user_data); + } + + has_connection (client); + + out: + client_unref (client); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_bus_own_name_on_connection: + * @connection: A #GDBusConnection. + * @name: The well-known name to own. + * @flags: A set of flags from the #GBusNameOwnerFlags enumeration. + * @name_acquired_handler: Handler to invoke when @name is acquired or %NULL. + * @name_lost_handler: Handler to invoke when @name is lost or %NULL. + * @user_data: User data to pass to handlers. + * @user_data_free_func: Function for freeing @user_data or %NULL. + * + * Like g_bus_own_name() but takes a #GDBusConnection instead of a + * #GBusType. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unown_name() to stop owning the name. + * + * Since: 2.26 + */ +guint +g_bus_own_name_on_connection (GDBusConnection *connection, + const gchar *name, + GBusNameOwnerFlags flags, + GBusNameAcquiredCallback name_acquired_handler, + GBusNameLostCallback name_lost_handler, + gpointer user_data, + GDestroyNotify user_data_free_func) +{ + Client *client; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0); + g_return_val_if_fail (g_dbus_is_name (name) && !g_dbus_is_unique_name (name), 0); + + G_LOCK (lock); + + client = g_new0 (Client, 1); + client->ref_count = 1; + client->id = next_global_id++; /* TODO: uh oh, handle overflow */ + client->name = g_strdup (name); + client->flags = flags; + client->name_acquired_handler = name_acquired_handler; + client->name_lost_handler = name_lost_handler; + client->user_data = user_data; + client->user_data_free_func = user_data_free_func; + client->main_context = g_main_context_get_thread_default (); + if (client->main_context != NULL) + g_main_context_ref (client->main_context); + + client->connection = g_object_ref (connection); + + if (map_id_to_client == NULL) + { + map_id_to_client = g_hash_table_new (g_direct_hash, g_direct_equal); + } + g_hash_table_insert (map_id_to_client, + GUINT_TO_POINTER (client->id), + client); + + G_UNLOCK (lock); + + has_connection (client); + + return client->id; +} + +/** + * g_bus_own_name: + * @bus_type: The type of bus to own a name on. + * @name: The well-known name to own. + * @flags: A set of flags from the #GBusNameOwnerFlags enumeration. + * @bus_acquired_handler: Handler to invoke when connected to the bus of type @bus_type or %NULL. + * @name_acquired_handler: Handler to invoke when @name is acquired or %NULL. + * @name_lost_handler: Handler to invoke when @name is lost or %NULL. + * @user_data: User data to pass to handlers. + * @user_data_free_func: Function for freeing @user_data or %NULL. + * + * Starts acquiring @name on the bus specified by @bus_type and calls + * @name_acquired_handler and @name_lost_handler when the name is + * acquired respectively lost. Callbacks will be invoked in the thread-default main + * loop of the thread you are calling this function from. + * + * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler + * callbacks will be invoked after calling this function - there are three + * possible cases: + * + * + * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made). + * + * + * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained) + * + * + * @bus_acquired_handler then @name_acquired_handler (if the name was obtained). + * + * + * When you are done owning the name, just call g_bus_unown_name() + * with the owner id this function returns. + * + * If the name is acquired or lost (for example another application + * could acquire the name if you allow replacement or the application + * currently owning the name exits), the handlers are also invoked. If the + * #GDBusConnection that is used for attempting to own the name + * closes, then @name_lost_handler is invoked since it is no + * longer possible for other processes to access the process. + * + * You cannot use g_bus_own_name() several times for the same name (unless + * interleaved with calls to g_bus_unown_name()) - only the first call + * will work. + * + * Another guarantee is that invocations of @name_acquired_handler + * and @name_lost_handler are guaranteed to alternate; that + * is, if @name_acquired_handler is invoked then you are + * guaranteed that the next time one of the handlers is invoked, it + * will be @name_lost_handler. The reverse is also true. + * + * If you plan on exporting objects (using e.g. + * g_dbus_connection_register_object()), note that it is generally too late + * to export the objects in @name_acquired_handler. Instead, you can do this + * in @bus_acquired_handler since you are guaranteed that this will run + * before @name is requested from the bus. + * + * This behavior makes it very simple to write applications that wants + * to own names and export objects, see . + * Simply register objects to be exported in @bus_acquired_handler and + * unregister the objects (if any) in @name_lost_handler. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unown_name() to stop owning the name. + * + * Since: 2.26 + */ +guint +g_bus_own_name (GBusType bus_type, + const gchar *name, + GBusNameOwnerFlags flags, + GBusAcquiredCallback bus_acquired_handler, + GBusNameAcquiredCallback name_acquired_handler, + GBusNameLostCallback name_lost_handler, + gpointer user_data, + GDestroyNotify user_data_free_func) +{ + Client *client; + + g_return_val_if_fail (g_dbus_is_name (name) && !g_dbus_is_unique_name (name), 0); + + G_LOCK (lock); + + client = g_new0 (Client, 1); + client->ref_count = 1; + client->id = next_global_id++; /* TODO: uh oh, handle overflow */ + client->name = g_strdup (name); + client->flags = flags; + client->bus_acquired_handler = bus_acquired_handler; + client->name_acquired_handler = name_acquired_handler; + client->name_lost_handler = name_lost_handler; + client->user_data = user_data; + client->user_data_free_func = user_data_free_func; + client->main_context = g_main_context_get_thread_default (); + if (client->main_context != NULL) + g_main_context_ref (client->main_context); + + if (map_id_to_client == NULL) + { + map_id_to_client = g_hash_table_new (g_direct_hash, g_direct_equal); + } + g_hash_table_insert (map_id_to_client, + GUINT_TO_POINTER (client->id), + client); + + g_bus_get (bus_type, + NULL, + connection_get_cb, + client_ref (client)); + + G_UNLOCK (lock); + + return client->id; +} + +typedef struct { + GClosure *bus_acquired_closure; + GClosure *name_acquired_closure; + GClosure *name_lost_closure; +} OwnNameData; + +static OwnNameData * +own_name_data_new (GClosure *bus_acquired_closure, + GClosure *name_acquired_closure, + GClosure *name_lost_closure) +{ + OwnNameData *data; + + data = g_new0 (OwnNameData, 1); + + if (bus_acquired_closure != NULL) + { + data->bus_acquired_closure = g_closure_ref (bus_acquired_closure); + g_closure_sink (bus_acquired_closure); + if (G_CLOSURE_NEEDS_MARSHAL (bus_acquired_closure)) + g_closure_set_marshal (bus_acquired_closure, _gio_marshal_VOID__STRING); + } + + if (name_acquired_closure != NULL) + { + data->name_acquired_closure = g_closure_ref (name_acquired_closure); + g_closure_sink (name_acquired_closure); + if (G_CLOSURE_NEEDS_MARSHAL (name_acquired_closure)) + g_closure_set_marshal (name_acquired_closure, _gio_marshal_VOID__STRING); + } + + if (name_lost_closure != NULL) + { + data->name_lost_closure = g_closure_ref (name_lost_closure); + g_closure_sink (name_lost_closure); + if (G_CLOSURE_NEEDS_MARSHAL (name_lost_closure)) + g_closure_set_marshal (name_lost_closure, _gio_marshal_VOID__STRING); + } + + return data; +} + +static void +own_with_closures_on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + OwnNameData *data = user_data; + GValue params[2] = { { 0, }, { 0, } }; + + g_value_init (¶ms[0], G_TYPE_DBUS_CONNECTION); + g_value_set_object (¶ms[0], connection); + + g_value_init (¶ms[1], G_TYPE_STRING); + g_value_set_string (¶ms[1], name); + + g_closure_invoke (data->bus_acquired_closure, NULL, 2, params, NULL); + + g_value_unset (params + 0); + g_value_unset (params + 1); +} + +static void +own_with_closures_on_name_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + OwnNameData *data = user_data; + GValue params[2] = { { 0, }, { 0, } }; + + g_value_init (¶ms[0], G_TYPE_DBUS_CONNECTION); + g_value_set_object (¶ms[0], connection); + + g_value_init (¶ms[1], G_TYPE_STRING); + g_value_set_string (¶ms[1], name); + + g_closure_invoke (data->name_acquired_closure, NULL, 2, params, NULL); + + g_value_unset (params + 0); + g_value_unset (params + 1); +} + +static void +own_with_closures_on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + OwnNameData *data = user_data; + GValue params[2] = { { 0, }, { 0, } }; + + g_value_init (¶ms[0], G_TYPE_DBUS_CONNECTION); + g_value_set_object (¶ms[0], connection); + + g_value_init (¶ms[1], G_TYPE_STRING); + g_value_set_string (¶ms[1], name); + + g_closure_invoke (data->name_lost_closure, NULL, 2, params, NULL); + + g_value_unset (params + 0); + g_value_unset (params + 1); +} + +static void +bus_own_name_free_func (gpointer user_data) +{ + OwnNameData *data = user_data; + + if (data->bus_acquired_closure != NULL) + g_closure_unref (data->bus_acquired_closure); + + if (data->name_acquired_closure != NULL) + g_closure_unref (data->name_acquired_closure); + + if (data->name_lost_closure != NULL) + g_closure_unref (data->name_lost_closure); + + g_free (data); +} + +/** + * g_bus_own_name_with_closures: + * @bus_type: The type of bus to own a name on. + * @name: The well-known name to own. + * @flags: A set of flags from the #GBusNameOwnerFlags enumeration. + * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to + * the bus of type @bus_type or %NULL. + * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is + * acquired or %NULL. + * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or + * %NULL. + * + * Version of g_bus_own_name() using closures instead of callbacks for + * easier binding in other languages. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unown_name() to stop owning the name. + * + * Rename to: g_bus_own_name + * + * Since: 2.26 + */ +guint +g_bus_own_name_with_closures (GBusType bus_type, + const gchar *name, + GBusNameOwnerFlags flags, + GClosure *bus_acquired_closure, + GClosure *name_acquired_closure, + GClosure *name_lost_closure) +{ + return g_bus_own_name (bus_type, + name, + flags, + bus_acquired_closure != NULL ? own_with_closures_on_bus_acquired : NULL, + name_acquired_closure != NULL ? own_with_closures_on_name_acquired : NULL, + name_lost_closure != NULL ? own_with_closures_on_name_lost : NULL, + own_name_data_new (bus_acquired_closure, + name_acquired_closure, + name_lost_closure), + bus_own_name_free_func); +} + +/** + * g_bus_own_name_on_connection_with_closures: + * @connection: A #GDBusConnection. + * @name: The well-known name to own. + * @flags: A set of flags from the #GBusNameOwnerFlags enumeration. + * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is + * acquired or %NULL. + * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or + * %NULL. + * + * Version of g_bus_own_name_on_connection() using closures instead of callbacks for + * easier binding in other languages. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unown_name() to stop owning the name. + * + * Rename to: g_bus_own_name_on_connection + * + * Since: 2.26 + */ +guint +g_bus_own_name_on_connection_with_closures (GDBusConnection *connection, + const gchar *name, + GBusNameOwnerFlags flags, + GClosure *name_acquired_closure, + GClosure *name_lost_closure) +{ + return g_bus_own_name_on_connection (connection, + name, + flags, + name_acquired_closure != NULL ? own_with_closures_on_name_acquired : NULL, + name_lost_closure != NULL ? own_with_closures_on_name_lost : NULL, + own_name_data_new (NULL, + name_acquired_closure, + name_lost_closure), + bus_own_name_free_func); +} + +/** + * g_bus_unown_name: + * @owner_id: An identifier obtained from g_bus_own_name() + * + * Stops owning a name. + * + * Since: 2.26 + */ +void +g_bus_unown_name (guint owner_id) +{ + Client *client; + + g_return_if_fail (owner_id > 0); + + client = NULL; + + G_LOCK (lock); + if (owner_id == 0 || map_id_to_client == NULL || + (client = g_hash_table_lookup (map_id_to_client, GUINT_TO_POINTER (owner_id))) == NULL) + { + g_warning ("Invalid id %d passed to g_bus_unown_name()", owner_id); + goto out; + } + + client->cancelled = TRUE; + g_warn_if_fail (g_hash_table_remove (map_id_to_client, GUINT_TO_POINTER (owner_id))); + + out: + G_UNLOCK (lock); + + /* do callback without holding lock */ + if (client != NULL) + { + /* Release the name if needed */ + if (client->needs_release && client->connection != NULL) + { + GVariant *result; + GError *error; + guint32 release_name_reply; + + /* TODO: it kinda sucks having to do a sync call to release the name - but if + * we don't, then a subsequent grab of the name will make the bus daemon return + * IN_QUEUE which will trigger name_lost(). + * + * I believe this is a bug in the bus daemon. + */ + error = NULL; + result = g_dbus_connection_call_sync (client->connection, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "ReleaseName", /* method name */ + g_variant_new ("(s)", client->name), + G_VARIANT_TYPE ("(u)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + if (result == NULL) + { + g_warning ("Error releasing name %s: %s", client->name, error->message); + g_error_free (error); + } + else + { + g_variant_get (result, "(u)", &release_name_reply); + if (release_name_reply != 1 /* DBUS_RELEASE_NAME_REPLY_RELEASED */) + { + g_warning ("Unexpected reply %d when releasing name %s", release_name_reply, client->name); + } + g_variant_unref (result); + } + } + + if (client->disconnected_signal_handler_id > 0) + g_signal_handler_disconnect (client->connection, client->disconnected_signal_handler_id); + if (client->name_acquired_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_acquired_subscription_id); + if (client->name_lost_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_lost_subscription_id); + client->disconnected_signal_handler_id = 0; + client->name_acquired_subscription_id = 0; + client->name_lost_subscription_id = 0; + if (client->connection != NULL) + { + g_object_unref (client->connection); + client->connection = NULL; + } + + client_unref (client); + } +} diff --git a/gio/gdbusnameowning.h b/gio/gdbusnameowning.h new file mode 100644 index 0000000..fc4b92c --- /dev/null +++ b/gio/gdbusnameowning.h @@ -0,0 +1,112 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_NAME_OWNING_H__ +#define __G_DBUS_NAME_OWNING_H__ + +#include + +G_BEGIN_DECLS + +/** + * GBusAcquiredCallback: + * @connection: The #GDBusConnection to a message bus. + * @name: The name that is requested to be owned. + * @user_data: User data passed to g_bus_own_name(). + * + * Invoked when a connection to a message bus has been obtained. + * + * Since: 2.26 + */ +typedef void (*GBusAcquiredCallback) (GDBusConnection *connection, + const gchar *name, + gpointer user_data); + +/** + * GBusNameAcquiredCallback: + * @connection: The #GDBusConnection on which to acquired the name. + * @name: The name being owned. + * @user_data: User data passed to g_bus_own_name() or g_bus_own_name_on_connection(). + * + * Invoked when the name is acquired. + * + * Since: 2.26 + */ +typedef void (*GBusNameAcquiredCallback) (GDBusConnection *connection, + const gchar *name, + gpointer user_data); + +/** + * GBusNameLostCallback: + * @connection: The #GDBusConnection on which to acquire the name or %NULL if + * the connection was disconnected. + * @name: The name being owned. + * @user_data: User data passed to g_bus_own_name() or g_bus_own_name_on_connection(). + * + * Invoked when the name is lost or @connection has been closed. + * + * Since: 2.26 + */ +typedef void (*GBusNameLostCallback) (GDBusConnection *connection, + const gchar *name, + gpointer user_data); + +guint g_bus_own_name (GBusType bus_type, + const gchar *name, + GBusNameOwnerFlags flags, + GBusAcquiredCallback bus_acquired_handler, + GBusNameAcquiredCallback name_acquired_handler, + GBusNameLostCallback name_lost_handler, + gpointer user_data, + GDestroyNotify user_data_free_func); + +guint g_bus_own_name_on_connection (GDBusConnection *connection, + const gchar *name, + GBusNameOwnerFlags flags, + GBusNameAcquiredCallback name_acquired_handler, + GBusNameLostCallback name_lost_handler, + gpointer user_data, + GDestroyNotify user_data_free_func); + +guint g_bus_own_name_with_closures (GBusType bus_type, + const gchar *name, + GBusNameOwnerFlags flags, + GClosure *bus_acquired_closure, + GClosure *name_acquired_closure, + GClosure *name_lost_closure); + +guint g_bus_own_name_on_connection_with_closures ( + GDBusConnection *connection, + const gchar *name, + GBusNameOwnerFlags flags, + GClosure *name_acquired_closure, + GClosure *name_lost_closure); + +void g_bus_unown_name (guint owner_id); + +G_END_DECLS + +#endif /* __G_DBUS_NAME_OWNING_H__ */ diff --git a/gio/gdbusnamewatching.c b/gio/gdbusnamewatching.c new file mode 100644 index 0000000..fc919b1 --- /dev/null +++ b/gio/gdbusnamewatching.c @@ -0,0 +1,853 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include + +#include "gdbusutils.h" +#include "gdbusnamewatching.h" +#include "gdbuserror.h" +#include "gdbusprivate.h" +#include "gdbusconnection.h" +#include "gio-marshal.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusnamewatching + * @title: Watching Bus Names + * @short_description: Simple API for watching bus names + * @include: gio/gio.h + * + * Convenience API for watching bus names. + * + * Simple application watching a nameFIXME: MISSING XINCLUDE CONTENT + */ + +G_LOCK_DEFINE_STATIC (lock); + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef enum +{ + PREVIOUS_CALL_NONE = 0, + PREVIOUS_CALL_APPEARED, + PREVIOUS_CALL_VANISHED, +} PreviousCall; + +typedef struct +{ + volatile gint ref_count; + guint id; + gchar *name; + GBusNameWatcherFlags flags; + gchar *name_owner; + GBusNameAppearedCallback name_appeared_handler; + GBusNameVanishedCallback name_vanished_handler; + gpointer user_data; + GDestroyNotify user_data_free_func; + GMainContext *main_context; + + GDBusConnection *connection; + gulong disconnected_signal_handler_id; + guint name_owner_changed_subscription_id; + + PreviousCall previous_call; + + gboolean cancelled; + gboolean initialized; +} Client; + +static guint next_global_id = 1; +static GHashTable *map_id_to_client = NULL; + +static Client * +client_ref (Client *client) +{ + g_atomic_int_inc (&client->ref_count); + return client; +} + +static void +client_unref (Client *client) +{ + if (g_atomic_int_dec_and_test (&client->ref_count)) + { + if (client->connection != NULL) + { + if (client->name_owner_changed_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_owner_changed_subscription_id); + if (client->disconnected_signal_handler_id > 0) + g_signal_handler_disconnect (client->connection, client->disconnected_signal_handler_id); + g_object_unref (client->connection); + } + g_free (client->name); + g_free (client->name_owner); + if (client->main_context != NULL) + g_main_context_unref (client->main_context); + if (client->user_data_free_func != NULL) + client->user_data_free_func (client->user_data); + g_free (client); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef enum +{ + CALL_TYPE_NAME_APPEARED, + CALL_TYPE_NAME_VANISHED +} CallType; + +typedef struct +{ + Client *client; + + /* keep this separate because client->connection may + * be set to NULL after scheduling the call + */ + GDBusConnection *connection; + + /* ditto */ + gchar *name_owner; + + CallType call_type; +} CallHandlerData; + +static void +call_handler_data_free (CallHandlerData *data) +{ + if (data->connection != NULL) + g_object_unref (data->connection); + g_free (data->name_owner); + client_unref (data->client); + g_free (data); +} + +static void +actually_do_call (Client *client, GDBusConnection *connection, const gchar *name_owner, CallType call_type) +{ + switch (call_type) + { + case CALL_TYPE_NAME_APPEARED: + if (client->name_appeared_handler != NULL) + { + client->name_appeared_handler (connection, + client->name, + name_owner, + client->user_data); + } + break; + + case CALL_TYPE_NAME_VANISHED: + if (client->name_vanished_handler != NULL) + { + client->name_vanished_handler (connection, + client->name, + client->user_data); + } + break; + + default: + g_assert_not_reached (); + break; + } +} + +static gboolean +call_in_idle_cb (gpointer _data) +{ + CallHandlerData *data = _data; + actually_do_call (data->client, data->connection, data->name_owner, data->call_type); + return FALSE; +} + +static void +schedule_call_in_idle (Client *client, CallType call_type) +{ + CallHandlerData *data; + GSource *idle_source; + + data = g_new0 (CallHandlerData, 1); + data->client = client_ref (client); + data->connection = client->connection != NULL ? g_object_ref (client->connection) : NULL; + data->name_owner = g_strdup (client->name_owner); + data->call_type = call_type; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_HIGH); + g_source_set_callback (idle_source, + call_in_idle_cb, + data, + (GDestroyNotify) call_handler_data_free); + g_source_attach (idle_source, client->main_context); + g_source_unref (idle_source); +} + +static void +do_call (Client *client, CallType call_type) +{ + /* only schedule in idle if we're not in the right thread */ + if (g_main_context_get_thread_default () != client->main_context) + schedule_call_in_idle (client, call_type); + else + actually_do_call (client, client->connection, client->name_owner, call_type); +} + +static void +call_appeared_handler (Client *client) +{ + if (client->previous_call != PREVIOUS_CALL_APPEARED) + { + client->previous_call = PREVIOUS_CALL_APPEARED; + if (!client->cancelled && client->name_appeared_handler != NULL) + { + do_call (client, CALL_TYPE_NAME_APPEARED); + } + } +} + +static void +call_vanished_handler (Client *client, + gboolean ignore_cancelled) +{ + if (client->previous_call != PREVIOUS_CALL_VANISHED) + { + client->previous_call = PREVIOUS_CALL_VANISHED; + if (((!client->cancelled) || ignore_cancelled) && client->name_vanished_handler != NULL) + { + do_call (client, CALL_TYPE_NAME_VANISHED); + } + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_connection_disconnected (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data) +{ + Client *client = user_data; + + if (client->name_owner_changed_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (client->connection, client->name_owner_changed_subscription_id); + if (client->disconnected_signal_handler_id > 0) + g_signal_handler_disconnect (client->connection, client->disconnected_signal_handler_id); + g_object_unref (client->connection); + client->disconnected_signal_handler_id = 0; + client->name_owner_changed_subscription_id = 0; + client->connection = NULL; + + call_vanished_handler (client, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_name_owner_changed (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + Client *client = user_data; + const gchar *name; + const gchar *old_owner; + const gchar *new_owner; + + if (!client->initialized) + goto out; + + if (g_strcmp0 (object_path, "/org/freedesktop/DBus") != 0 || + g_strcmp0 (interface_name, "org.freedesktop.DBus") != 0 || + g_strcmp0 (sender_name, "org.freedesktop.DBus") != 0) + goto out; + + g_variant_get (parameters, + "(&s&s&s)", + &name, + &old_owner, + &new_owner); + + /* we only care about a specific name */ + if (g_strcmp0 (name, client->name) != 0) + goto out; + + if ((old_owner != NULL && strlen (old_owner) > 0) && client->name_owner != NULL) + { + g_free (client->name_owner); + client->name_owner = NULL; + call_vanished_handler (client, FALSE); + } + + if (new_owner != NULL && strlen (new_owner) > 0) + { + g_warn_if_fail (client->name_owner == NULL); + g_free (client->name_owner); + client->name_owner = g_strdup (new_owner); + call_appeared_handler (client); + } + + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +get_name_owner_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + Client *client = user_data; + GVariant *result; + const char *name_owner; + + name_owner = NULL; + result = NULL; + + result = g_dbus_connection_call_finish (client->connection, + res, + NULL); + if (result != NULL) + { + g_variant_get (result, "(&s)", &name_owner); + } + + if (name_owner != NULL) + { + g_warn_if_fail (client->name_owner == NULL); + client->name_owner = g_strdup (name_owner); + call_appeared_handler (client); + } + else + { + call_vanished_handler (client, FALSE); + } + + client->initialized = TRUE; + + if (result != NULL) + g_variant_unref (result); + client_unref (client); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +invoke_get_name_owner (Client *client) +{ + g_dbus_connection_call (client->connection, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetNameOwner", /* method name */ + g_variant_new ("(s)", client->name), + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) get_name_owner_cb, + client_ref (client)); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +start_service_by_name_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + Client *client = user_data; + GVariant *result; + + result = NULL; + + result = g_dbus_connection_call_finish (client->connection, + res, + NULL); + if (result != NULL) + { + guint32 start_service_result; + g_variant_get (result, "(u)", &start_service_result); + + if (start_service_result == 1) /* DBUS_START_REPLY_SUCCESS */ + { + invoke_get_name_owner (client); + } + else if (start_service_result == 2) /* DBUS_START_REPLY_ALREADY_RUNNING */ + { + invoke_get_name_owner (client); + } + else + { + g_warning ("Unexpected reply %d from StartServiceByName() method", start_service_result); + call_vanished_handler (client, FALSE); + client->initialized = TRUE; + } + } + else + { + /* Errors are not unexpected; the bus will reply e.g. + * + * org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Epiphany2 + * was not provided by any .service files + * + * This doesn't mean that the name doesn't have an owner, just + * that it's not provided by a .service file. So proceed to + * invoke GetNameOwner(). + */ + invoke_get_name_owner (client); + } + + if (result != NULL) + g_variant_unref (result); + client_unref (client); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +has_connection (Client *client) +{ + /* listen for disconnection */ + client->disconnected_signal_handler_id = g_signal_connect (client->connection, + "closed", + G_CALLBACK (on_connection_disconnected), + client); + + /* start listening to NameOwnerChanged messages immediately */ + client->name_owner_changed_subscription_id = g_dbus_connection_signal_subscribe (client->connection, + "org.freedesktop.DBus", /* name */ + "org.freedesktop.DBus", /* if */ + "NameOwnerChanged", /* signal */ + "/org/freedesktop/DBus", /* path */ + client->name, + G_DBUS_SIGNAL_FLAGS_NONE, + on_name_owner_changed, + client, + NULL); + + if (client->flags & G_BUS_NAME_WATCHER_FLAGS_AUTO_START) + { + g_dbus_connection_call (client->connection, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "StartServiceByName", /* method name */ + g_variant_new ("(su)", client->name, 0), + G_VARIANT_TYPE ("(u)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) start_service_by_name_cb, + client_ref (client)); + } + else + { + /* check owner */ + invoke_get_name_owner (client); + } +} + + +static void +connection_get_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + Client *client = user_data; + + client->connection = g_bus_get_finish (res, NULL); + if (client->connection == NULL) + { + call_vanished_handler (client, FALSE); + goto out; + } + + has_connection (client); + + out: + client_unref (client); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_bus_watch_name: + * @bus_type: The type of bus to watch a name on. + * @name: The name (well-known or unique) to watch. + * @flags: Flags from the #GBusNameWatcherFlags enumeration. + * @name_appeared_handler: Handler to invoke when @name is known to exist or %NULL. + * @name_vanished_handler: Handler to invoke when @name is known to not exist or %NULL. + * @user_data: User data to pass to handlers. + * @user_data_free_func: Function for freeing @user_data or %NULL. + * + * Starts watching @name on the bus specified by @bus_type and calls + * @name_appeared_handler and @name_vanished_handler when the name is + * known to have a owner respectively known to lose its + * owner. Callbacks will be invoked in the thread-default main + * loop of the thread you are calling this function from. + * + * You are guaranteed that one of the handlers will be invoked after + * calling this function. When you are done watching the name, just + * call g_bus_unwatch_name() with the watcher id this function + * returns. + * + * If the name vanishes or appears (for example the application owning + * the name could restart), the handlers are also invoked. If the + * #GDBusConnection that is used for watching the name disconnects, then + * @name_vanished_handler is invoked since it is no longer + * possible to access the name. + * + * Another guarantee is that invocations of @name_appeared_handler + * and @name_vanished_handler are guaranteed to alternate; that + * is, if @name_appeared_handler is invoked then you are + * guaranteed that the next time one of the handlers is invoked, it + * will be @name_vanished_handler. The reverse is also true. + * + * This behavior makes it very simple to write applications that wants + * to take action when a certain name exists, see . Basically, the application + * should create object proxies in @name_appeared_handler and destroy + * them again (if any) in @name_vanished_handler. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unwatch_name() to stop watching the name. + * + * Since: 2.26 + */ +guint +g_bus_watch_name (GBusType bus_type, + const gchar *name, + GBusNameWatcherFlags flags, + GBusNameAppearedCallback name_appeared_handler, + GBusNameVanishedCallback name_vanished_handler, + gpointer user_data, + GDestroyNotify user_data_free_func) +{ + Client *client; + + g_return_val_if_fail (g_dbus_is_name (name), 0); + + G_LOCK (lock); + + client = g_new0 (Client, 1); + client->ref_count = 1; + client->id = next_global_id++; /* TODO: uh oh, handle overflow */ + client->name = g_strdup (name); + client->flags = flags; + client->name_appeared_handler = name_appeared_handler; + client->name_vanished_handler = name_vanished_handler; + client->user_data = user_data; + client->user_data_free_func = user_data_free_func; + client->main_context = g_main_context_get_thread_default (); + if (client->main_context != NULL) + g_main_context_ref (client->main_context); + + if (map_id_to_client == NULL) + { + map_id_to_client = g_hash_table_new (g_direct_hash, g_direct_equal); + } + g_hash_table_insert (map_id_to_client, + GUINT_TO_POINTER (client->id), + client); + + g_bus_get (bus_type, + NULL, + connection_get_cb, + client_ref (client)); + + G_UNLOCK (lock); + + return client->id; +} + +/** + * g_bus_watch_name_on_connection: + * @connection: A #GDBusConnection. + * @name: The name (well-known or unique) to watch. + * @flags: Flags from the #GBusNameWatcherFlags enumeration. + * @name_appeared_handler: Handler to invoke when @name is known to exist or %NULL. + * @name_vanished_handler: Handler to invoke when @name is known to not exist or %NULL. + * @user_data: User data to pass to handlers. + * @user_data_free_func: Function for freeing @user_data or %NULL. + * + * Like g_bus_watch_name() but takes a #GDBusConnection instead of a + * #GBusType. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unwatch_name() to stop watching the name. + * + * Since: 2.26 + */ +guint g_bus_watch_name_on_connection (GDBusConnection *connection, + const gchar *name, + GBusNameWatcherFlags flags, + GBusNameAppearedCallback name_appeared_handler, + GBusNameVanishedCallback name_vanished_handler, + gpointer user_data, + GDestroyNotify user_data_free_func) +{ + Client *client; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0); + g_return_val_if_fail (g_dbus_is_name (name), 0); + + G_LOCK (lock); + + client = g_new0 (Client, 1); + client->ref_count = 1; + client->id = next_global_id++; /* TODO: uh oh, handle overflow */ + client->name = g_strdup (name); + client->flags = flags; + client->name_appeared_handler = name_appeared_handler; + client->name_vanished_handler = name_vanished_handler; + client->user_data = user_data; + client->user_data_free_func = user_data_free_func; + client->main_context = g_main_context_get_thread_default (); + if (client->main_context != NULL) + g_main_context_ref (client->main_context); + + if (map_id_to_client == NULL) + map_id_to_client = g_hash_table_new (g_direct_hash, g_direct_equal); + + g_hash_table_insert (map_id_to_client, + GUINT_TO_POINTER (client->id), + client); + + client->connection = g_object_ref (connection); + G_UNLOCK (lock); + + has_connection (client); + + return client->id; +} + +typedef struct { + GClosure *name_appeared_closure; + GClosure *name_vanished_closure; +} WatchNameData; + +static WatchNameData * +watch_name_data_new (GClosure *name_appeared_closure, + GClosure *name_vanished_closure) +{ + WatchNameData *data; + + data = g_new0 (WatchNameData, 1); + + if (name_appeared_closure != NULL) + { + data->name_appeared_closure = g_closure_ref (name_appeared_closure); + g_closure_sink (name_appeared_closure); + if (G_CLOSURE_NEEDS_MARSHAL (name_appeared_closure)) + g_closure_set_marshal (name_appeared_closure, _gio_marshal_VOID__STRING_STRING); + } + + if (name_vanished_closure != NULL) + { + data->name_vanished_closure = g_closure_ref (name_vanished_closure); + g_closure_sink (name_vanished_closure); + if (G_CLOSURE_NEEDS_MARSHAL (name_vanished_closure)) + g_closure_set_marshal (name_vanished_closure, _gio_marshal_VOID__STRING); + } + + return data; +} + +static void +watch_with_closures_on_name_appeared (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data) +{ + WatchNameData *data = user_data; + GValue params[3] = { { 0, }, { 0, }, { 0, } }; + + g_value_init (¶ms[0], G_TYPE_DBUS_CONNECTION); + g_value_set_object (¶ms[0], connection); + + g_value_init (¶ms[1], G_TYPE_STRING); + g_value_set_string (¶ms[1], name); + + g_value_init (¶ms[2], G_TYPE_STRING); + g_value_set_string (¶ms[2], name_owner); + + g_closure_invoke (data->name_appeared_closure, NULL, 3, params, NULL); + + g_value_unset (params + 0); + g_value_unset (params + 1); + g_value_unset (params + 2); +} + +static void +watch_with_closures_on_name_vanished (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + WatchNameData *data = user_data; + GValue params[2] = { { 0, }, { 0, } }; + + g_value_init (¶ms[0], G_TYPE_DBUS_CONNECTION); + g_value_set_object (¶ms[0], connection); + + g_value_init (¶ms[1], G_TYPE_STRING); + g_value_set_string (¶ms[1], name); + + g_closure_invoke (data->name_vanished_closure, NULL, 2, params, NULL); + + g_value_unset (params + 0); + g_value_unset (params + 1); +} + +static void +bus_watch_name_free_func (gpointer user_data) +{ + WatchNameData *data = user_data; + + if (data->name_appeared_closure != NULL) + g_closure_unref (data->name_appeared_closure); + + if (data->name_vanished_closure != NULL) + g_closure_unref (data->name_vanished_closure); + + g_free (data); +} + +/** + * g_bus_watch_name_with_closures: + * @bus_type: The type of bus to watch a name on. + * @name: The name (well-known or unique) to watch. + * @flags: Flags from the #GBusNameWatcherFlags enumeration. + * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known + * to exist or %NULL. + * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known + * to not exist or %NULL. + * + * Version of g_bus_watch_name() using closures instead of callbacks for + * easier binding in other languages. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unwatch_name() to stop watching the name. + * + * Rename to: g_bus_watch_name + * + * Since: 2.26 + */ +guint +g_bus_watch_name_with_closures (GBusType bus_type, + const gchar *name, + GBusNameWatcherFlags flags, + GClosure *name_appeared_closure, + GClosure *name_vanished_closure) +{ + return g_bus_watch_name (bus_type, + name, + flags, + name_appeared_closure != NULL ? watch_with_closures_on_name_appeared : NULL, + name_vanished_closure != NULL ? watch_with_closures_on_name_vanished : NULL, + watch_name_data_new (name_appeared_closure, name_vanished_closure), + bus_watch_name_free_func); +} + +/** + * g_bus_watch_name_on_connection_with_closures: + * @connection: A #GDBusConnection. + * @name: The name (well-known or unique) to watch. + * @flags: Flags from the #GBusNameWatcherFlags enumeration. + * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known + * to exist or %NULL. + * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known + * to not exist or %NULL. + * + * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for + * easier binding in other languages. + * + * Returns: An identifier (never 0) that an be used with + * g_bus_unwatch_name() to stop watching the name. + * + * Rename to: g_bus_watch_name_on_connection + * + * Since: 2.26 + */ +guint g_bus_watch_name_on_connection_with_closures ( + GDBusConnection *connection, + const gchar *name, + GBusNameWatcherFlags flags, + GClosure *name_appeared_closure, + GClosure *name_vanished_closure) +{ + return g_bus_watch_name_on_connection (connection, + name, + flags, + name_appeared_closure != NULL ? watch_with_closures_on_name_appeared : NULL, + name_vanished_closure != NULL ? watch_with_closures_on_name_vanished : NULL, + watch_name_data_new (name_appeared_closure, name_vanished_closure), + bus_watch_name_free_func); +} + +/** + * g_bus_unwatch_name: + * @watcher_id: An identifier obtained from g_bus_watch_name() + * + * Stops watching a name. + * + * Since: 2.26 + */ +void +g_bus_unwatch_name (guint watcher_id) +{ + Client *client; + + g_return_if_fail (watcher_id > 0); + + client = NULL; + + G_LOCK (lock); + if (watcher_id == 0 || + map_id_to_client == NULL || + (client = g_hash_table_lookup (map_id_to_client, GUINT_TO_POINTER (watcher_id))) == NULL) + { + g_warning ("Invalid id %d passed to g_bus_unwatch_name()", watcher_id); + goto out; + } + + client->cancelled = TRUE; + g_warn_if_fail (g_hash_table_remove (map_id_to_client, GUINT_TO_POINTER (watcher_id))); + + out: + G_UNLOCK (lock); + + /* do callback without holding lock */ + if (client != NULL) + { + client_unref (client); + } +} diff --git a/gio/gdbusnamewatching.h b/gio/gdbusnamewatching.h new file mode 100644 index 0000000..3e3f75a --- /dev/null +++ b/gio/gdbusnamewatching.h @@ -0,0 +1,94 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_NAME_WATCHING_H__ +#define __G_DBUS_NAME_WATCHING_H__ + +#include + +G_BEGIN_DECLS + +/** + * GBusNameAppearedCallback: + * @connection: The #GDBusConnection the name is being watched on. + * @name: The name being watched. + * @name_owner: Unique name of the owner of the name being watched. + * @user_data: User data passed to g_bus_watch_name(). + * + * Invoked when the name being watched is known to have to have a owner. + * + * Since: 2.26 + */ +typedef void (*GBusNameAppearedCallback) (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data); + +/** + * GBusNameVanishedCallback: + * @connection: The #GDBusConnection the name is being watched on. + * @name: The name being watched. + * @user_data: User data passed to g_bus_watch_name(). + * + * Invoked when the name being watched is known not to have to have a owner. + * + * Since: 2.26 + */ +typedef void (*GBusNameVanishedCallback) (GDBusConnection *connection, + const gchar *name, + gpointer user_data); + + +guint g_bus_watch_name (GBusType bus_type, + const gchar *name, + GBusNameWatcherFlags flags, + GBusNameAppearedCallback name_appeared_handler, + GBusNameVanishedCallback name_vanished_handler, + gpointer user_data, + GDestroyNotify user_data_free_func); +guint g_bus_watch_name_on_connection (GDBusConnection *connection, + const gchar *name, + GBusNameWatcherFlags flags, + GBusNameAppearedCallback name_appeared_handler, + GBusNameVanishedCallback name_vanished_handler, + gpointer user_data, + GDestroyNotify user_data_free_func); +guint g_bus_watch_name_with_closures (GBusType bus_type, + const gchar *name, + GBusNameWatcherFlags flags, + GClosure *name_appeared_closure, + GClosure *name_vanished_closure); +guint g_bus_watch_name_on_connection_with_closures ( + GDBusConnection *connection, + const gchar *name, + GBusNameWatcherFlags flags, + GClosure *name_appeared_closure, + GClosure *name_vanished_closure); +void g_bus_unwatch_name (guint watcher_id); + +G_END_DECLS + +#endif /* __G_DBUS_NAME_WATCHING_H__ */ diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c new file mode 100644 index 0000000..5f8f1f4 --- /dev/null +++ b/gio/gdbusprivate.c @@ -0,0 +1,1870 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "giotypes.h" +#include "gsocket.h" +#include "gdbusprivate.h" +#include "gdbusmessage.h" +#include "gdbuserror.h" +#include "gdbusintrospection.h" +#include "gasyncresult.h" +#include "gsimpleasyncresult.h" +#include "ginputstream.h" +#include "gmemoryinputstream.h" +#include "giostream.h" +#include "gsocketcontrolmessage.h" +#include "gsocketconnection.h" +#include "gsocketoutputstream.h" + +#ifdef G_OS_UNIX +#include "gunixfdmessage.h" +#include "gunixconnection.h" +#include "gunixcredentialsmessage.h" +#endif + +#ifdef G_OS_WIN32 +#include +#endif + +#include "glibintl.h" + +/* ---------------------------------------------------------------------------------------------------- */ + +gchar * +_g_dbus_hexdump (const gchar *data, gsize len, guint indent) +{ + guint n, m; + GString *ret; + + ret = g_string_new (NULL); + + for (n = 0; n < len; n += 16) + { + g_string_append_printf (ret, "%*s%04x: ", indent, "", n); + + for (m = n; m < n + 16; m++) + { + if (m > n && (m%4) == 0) + g_string_append_c (ret, ' '); + if (m < len) + g_string_append_printf (ret, "%02x ", (guchar) data[m]); + else + g_string_append (ret, " "); + } + + g_string_append (ret, " "); + + for (m = n; m < len && m < n + 16; m++) + g_string_append_c (ret, g_ascii_isprint (data[m]) ? data[m] : '.'); + + g_string_append_c (ret, '\n'); + } + + return g_string_free (ret, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* Unfortunately ancillary messages are discarded when reading from a + * socket using the GSocketInputStream abstraction. So we provide a + * very GInputStream-ish API that uses GSocket in this case (very + * similar to GSocketInputStream). + */ + +typedef struct +{ + GSocket *socket; + GCancellable *cancellable; + + void *buffer; + gsize count; + + GSocketControlMessage ***messages; + gint *num_messages; + + GSimpleAsyncResult *simple; + + gboolean from_mainloop; +} ReadWithControlData; + +static void +read_with_control_data_free (ReadWithControlData *data) +{ + g_object_unref (data->socket); + if (data->cancellable != NULL) + g_object_unref (data->cancellable); + g_object_unref (data->simple); + g_free (data); +} + +static gboolean +_g_socket_read_with_control_messages_ready (GSocket *socket, + GIOCondition condition, + gpointer user_data) +{ + ReadWithControlData *data = user_data; + GError *error; + gssize result; + GInputVector vector; + + error = NULL; + vector.buffer = data->buffer; + vector.size = data->count; + result = g_socket_receive_message (data->socket, + NULL, /* address */ + &vector, + 1, + data->messages, + data->num_messages, + NULL, + data->cancellable, + &error); + if (result >= 0) + { + g_simple_async_result_set_op_res_gssize (data->simple, result); + } + else + { + g_assert (error != NULL); + g_simple_async_result_take_error (data->simple, error); + } + + if (data->from_mainloop) + g_simple_async_result_complete (data->simple); + else + g_simple_async_result_complete_in_idle (data->simple); + + return FALSE; +} + +static void +_g_socket_read_with_control_messages (GSocket *socket, + void *buffer, + gsize count, + GSocketControlMessage ***messages, + gint *num_messages, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + ReadWithControlData *data; + + data = g_new0 (ReadWithControlData, 1); + data->socket = g_object_ref (socket); + data->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL; + data->buffer = buffer; + data->count = count; + data->messages = messages; + data->num_messages = num_messages; + + data->simple = g_simple_async_result_new (G_OBJECT (socket), + callback, + user_data, + _g_socket_read_with_control_messages); + + if (!g_socket_condition_check (socket, G_IO_IN)) + { + GSource *source; + data->from_mainloop = TRUE; + source = g_socket_create_source (data->socket, + G_IO_IN | G_IO_HUP | G_IO_ERR, + cancellable); + g_source_set_callback (source, + (GSourceFunc) _g_socket_read_with_control_messages_ready, + data, + (GDestroyNotify) read_with_control_data_free); + g_source_attach (source, g_main_context_get_thread_default ()); + g_source_unref (source); + } + else + { + _g_socket_read_with_control_messages_ready (data->socket, G_IO_IN, data); + read_with_control_data_free (data); + } +} + +static gssize +_g_socket_read_with_control_messages_finish (GSocket *socket, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); + + g_return_val_if_fail (G_IS_SOCKET (socket), -1); + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == _g_socket_read_with_control_messages); + + if (g_simple_async_result_propagate_error (simple, error)) + return -1; + else + return g_simple_async_result_get_op_res_gssize (simple); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* Work-around for https://bugzilla.gnome.org/show_bug.cgi?id=627724 */ + +static GPtrArray *ensured_classes = NULL; + +static void +ensure_type (GType gtype) +{ + g_ptr_array_add (ensured_classes, g_type_class_ref (gtype)); +} + +static void +released_required_types (void) +{ + g_ptr_array_foreach (ensured_classes, (GFunc) g_type_class_unref, NULL); + g_ptr_array_unref (ensured_classes); + ensured_classes = NULL; +} + +static void +ensure_required_types (void) +{ + g_assert (ensured_classes == NULL); + ensured_classes = g_ptr_array_new (); + ensure_type (G_TYPE_SIMPLE_ASYNC_RESULT); + ensure_type (G_TYPE_MEMORY_INPUT_STREAM); +} +/* ---------------------------------------------------------------------------------------------------- */ + +G_LOCK_DEFINE_STATIC (shared_thread_lock); + +typedef struct +{ + gint num_users; + GThread *thread; + GMainContext *context; + GMainLoop *loop; +} SharedThreadData; + +static SharedThreadData *shared_thread_data = NULL; + +static gpointer +gdbus_shared_thread_func (gpointer data) +{ + g_main_context_push_thread_default (shared_thread_data->context); + g_main_loop_run (shared_thread_data->loop); + g_main_context_pop_thread_default (shared_thread_data->context); + return NULL; +} + +typedef void (*GDBusSharedThreadFunc) (gpointer user_data); + +typedef struct +{ + GDBusSharedThreadFunc func; + gpointer user_data; + gboolean done; +} CallerData; + +static gboolean +invoke_caller (gpointer user_data) +{ + CallerData *data = user_data; + data->func (data->user_data); + data->done = TRUE; + return FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_shared_thread_ref (GDBusSharedThreadFunc func, + gpointer user_data) +{ + GError *error; + GSource *idle_source; + CallerData *data; + gboolean release_types; + + G_LOCK (shared_thread_lock); + + release_types = FALSE; + + if (shared_thread_data != NULL) + { + shared_thread_data->num_users += 1; + goto have_thread; + } + + shared_thread_data = g_new0 (SharedThreadData, 1); + shared_thread_data->num_users = 1; + + /* Work-around for https://bugzilla.gnome.org/show_bug.cgi?id=627724 */ + ensure_required_types (); + release_types = TRUE; + + error = NULL; + shared_thread_data->context = g_main_context_new (); + shared_thread_data->loop = g_main_loop_new (shared_thread_data->context, FALSE); + shared_thread_data->thread = g_thread_create (gdbus_shared_thread_func, + NULL, + TRUE, + &error); + g_assert_no_error (error); + + have_thread: + + data = g_new0 (CallerData, 1); + data->func = func; + data->user_data = user_data; + data->done = FALSE; + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + invoke_caller, + data, + NULL); + g_source_attach (idle_source, shared_thread_data->context); + g_source_unref (idle_source); + + /* wait for the user code to run.. hmm.. probably use a condition variable instead */ + while (!data->done) + g_thread_yield (); + + if (release_types) + released_required_types (); + + g_free (data); + + G_UNLOCK (shared_thread_lock); +} + +static void +_g_dbus_shared_thread_unref (void) +{ + /* TODO: actually destroy the shared thread here */ +#if 0 + G_LOCK (shared_thread_lock); + g_assert (shared_thread_data != NULL); + shared_thread_data->num_users -= 1; + if (shared_thread_data->num_users == 0) + { + g_main_loop_quit (shared_thread_data->loop); + //g_thread_join (shared_thread_data->thread); + g_main_loop_unref (shared_thread_data->loop); + g_main_context_unref (shared_thread_data->context); + g_free (shared_thread_data); + shared_thread_data = NULL; + G_UNLOCK (shared_thread_lock); + } + else + { + G_UNLOCK (shared_thread_lock); + } +#endif +} + +/* ---------------------------------------------------------------------------------------------------- */ + +struct GDBusWorker +{ + volatile gint ref_count; + + gboolean stopped; + + /* TODO: frozen (e.g. G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING) currently + * only affects messages received from the other peer (since GDBusServer is the + * only user) - we might want it to affect messages sent to the other peer too? + */ + gboolean frozen; + GQueue *received_messages_while_frozen; + + GIOStream *stream; + GDBusCapabilityFlags capabilities; + GCancellable *cancellable; + GDBusWorkerMessageReceivedCallback message_received_callback; + GDBusWorkerMessageAboutToBeSentCallback message_about_to_be_sent_callback; + GDBusWorkerDisconnectedCallback disconnected_callback; + gpointer user_data; + + GThread *thread; + + /* if not NULL, stream is GSocketConnection */ + GSocket *socket; + + /* used for reading */ + GMutex *read_lock; + gchar *read_buffer; + gsize read_buffer_allocated_size; + gsize read_buffer_cur_size; + gsize read_buffer_bytes_wanted; + GUnixFDList *read_fd_list; + GSocketControlMessage **read_ancillary_messages; + gint read_num_ancillary_messages; + + /* used for writing */ + GMutex *write_lock; + GQueue *write_queue; + gint num_writes_pending; + guint64 write_num_messages_written; + GList *write_pending_flushes; + gboolean flush_pending; +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GMutex *mutex; + GCond *cond; + guint64 number_to_wait_for; + GError *error; +} FlushData; + +struct _MessageToWriteData ; +typedef struct _MessageToWriteData MessageToWriteData; + +static void message_to_write_data_free (MessageToWriteData *data); + +static void read_message_print_transport_debug (gssize bytes_read, + GDBusWorker *worker); + +static void write_message_print_transport_debug (gssize bytes_written, + MessageToWriteData *data); + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusWorker * +_g_dbus_worker_ref (GDBusWorker *worker) +{ + g_atomic_int_inc (&worker->ref_count); + return worker; +} + +static void +_g_dbus_worker_unref (GDBusWorker *worker) +{ + if (g_atomic_int_dec_and_test (&worker->ref_count)) + { + g_assert (worker->write_pending_flushes == NULL); + + _g_dbus_shared_thread_unref (); + + g_object_unref (worker->stream); + + g_mutex_free (worker->read_lock); + g_object_unref (worker->cancellable); + if (worker->read_fd_list != NULL) + g_object_unref (worker->read_fd_list); + + g_queue_foreach (worker->received_messages_while_frozen, (GFunc) g_object_unref, NULL); + g_queue_free (worker->received_messages_while_frozen); + + g_mutex_free (worker->write_lock); + g_queue_foreach (worker->write_queue, (GFunc) message_to_write_data_free, NULL); + g_queue_free (worker->write_queue); + + g_free (worker->read_buffer); + + g_free (worker); + } +} + +static void +_g_dbus_worker_emit_disconnected (GDBusWorker *worker, + gboolean remote_peer_vanished, + GError *error) +{ + if (!worker->stopped) + worker->disconnected_callback (worker, remote_peer_vanished, error, worker->user_data); +} + +static void +_g_dbus_worker_emit_message_received (GDBusWorker *worker, + GDBusMessage *message) +{ + if (!worker->stopped) + worker->message_received_callback (worker, message, worker->user_data); +} + +static GDBusMessage * +_g_dbus_worker_emit_message_about_to_be_sent (GDBusWorker *worker, + GDBusMessage *message) +{ + GDBusMessage *ret; + if (!worker->stopped) + ret = worker->message_about_to_be_sent_callback (worker, message, worker->user_data); + else + ret = message; + return ret; +} + +/* can only be called from private thread with read-lock held - takes ownership of @message */ +static void +_g_dbus_worker_queue_or_deliver_received_message (GDBusWorker *worker, + GDBusMessage *message) +{ + if (worker->frozen || g_queue_get_length (worker->received_messages_while_frozen) > 0) + { + /* queue up */ + g_queue_push_tail (worker->received_messages_while_frozen, message); + } + else + { + /* not frozen, nor anything in queue */ + _g_dbus_worker_emit_message_received (worker, message); + g_object_unref (message); + } +} + +/* called in private thread shared by all GDBusConnection instances (without read-lock held) */ +static gboolean +unfreeze_in_idle_cb (gpointer user_data) +{ + GDBusWorker *worker = user_data; + GDBusMessage *message; + + g_mutex_lock (worker->read_lock); + if (worker->frozen) + { + while ((message = g_queue_pop_head (worker->received_messages_while_frozen)) != NULL) + { + _g_dbus_worker_emit_message_received (worker, message); + g_object_unref (message); + } + worker->frozen = FALSE; + } + else + { + g_assert (g_queue_get_length (worker->received_messages_while_frozen) == 0); + } + g_mutex_unlock (worker->read_lock); + return FALSE; +} + +/* can be called from any thread */ +void +_g_dbus_worker_unfreeze (GDBusWorker *worker) +{ + GSource *idle_source; + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + unfreeze_in_idle_cb, + _g_dbus_worker_ref (worker), + (GDestroyNotify) _g_dbus_worker_unref); + g_source_attach (idle_source, shared_thread_data->context); + g_source_unref (idle_source); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void _g_dbus_worker_do_read_unlocked (GDBusWorker *worker); + +/* called in private thread shared by all GDBusConnection instances (without read-lock held) */ +static void +_g_dbus_worker_do_read_cb (GInputStream *input_stream, + GAsyncResult *res, + gpointer user_data) +{ + GDBusWorker *worker = user_data; + GError *error; + gssize bytes_read; + + g_mutex_lock (worker->read_lock); + + /* If already stopped, don't even process the reply */ + if (worker->stopped) + goto out; + + error = NULL; + if (worker->socket == NULL) + bytes_read = g_input_stream_read_finish (g_io_stream_get_input_stream (worker->stream), + res, + &error); + else + bytes_read = _g_socket_read_with_control_messages_finish (worker->socket, + res, + &error); + if (worker->read_num_ancillary_messages > 0) + { + gint n; + for (n = 0; n < worker->read_num_ancillary_messages; n++) + { + GSocketControlMessage *control_message = G_SOCKET_CONTROL_MESSAGE (worker->read_ancillary_messages[n]); + + if (FALSE) + { + } +#ifdef G_OS_UNIX + else if (G_IS_UNIX_FD_MESSAGE (control_message)) + { + GUnixFDMessage *fd_message; + gint *fds; + gint num_fds; + + fd_message = G_UNIX_FD_MESSAGE (control_message); + fds = g_unix_fd_message_steal_fds (fd_message, &num_fds); + if (worker->read_fd_list == NULL) + { + worker->read_fd_list = g_unix_fd_list_new_from_array (fds, num_fds); + } + else + { + gint n; + for (n = 0; n < num_fds; n++) + { + /* TODO: really want a append_steal() */ + g_unix_fd_list_append (worker->read_fd_list, fds[n], NULL); + close (fds[n]); + } + } + g_free (fds); + } + else if (G_IS_UNIX_CREDENTIALS_MESSAGE (control_message)) + { + /* do nothing */ + } +#endif + else + { + if (error == NULL) + { + g_set_error (&error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Unexpected ancillary message of type %s received from peer", + g_type_name (G_TYPE_FROM_INSTANCE (control_message))); + _g_dbus_worker_emit_disconnected (worker, TRUE, error); + g_error_free (error); + g_object_unref (control_message); + n++; + while (n < worker->read_num_ancillary_messages) + g_object_unref (worker->read_ancillary_messages[n++]); + g_free (worker->read_ancillary_messages); + goto out; + } + } + g_object_unref (control_message); + } + g_free (worker->read_ancillary_messages); + } + + if (bytes_read == -1) + { + _g_dbus_worker_emit_disconnected (worker, TRUE, error); + g_error_free (error); + goto out; + } + +#if 0 + g_debug ("read %d bytes (is_closed=%d blocking=%d condition=0x%02x) stream %p, %p", + (gint) bytes_read, + g_socket_is_closed (g_socket_connection_get_socket (G_SOCKET_CONNECTION (worker->stream))), + g_socket_get_blocking (g_socket_connection_get_socket (G_SOCKET_CONNECTION (worker->stream))), + g_socket_condition_check (g_socket_connection_get_socket (G_SOCKET_CONNECTION (worker->stream)), + G_IO_IN | G_IO_OUT | G_IO_HUP), + worker->stream, + worker); +#endif + + /* TODO: hmm, hmm... */ + if (bytes_read == 0) + { + g_set_error (&error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Underlying GIOStream returned 0 bytes on an async read"); + _g_dbus_worker_emit_disconnected (worker, TRUE, error); + g_error_free (error); + goto out; + } + + read_message_print_transport_debug (bytes_read, worker); + + worker->read_buffer_cur_size += bytes_read; + if (worker->read_buffer_bytes_wanted == worker->read_buffer_cur_size) + { + /* OK, got what we asked for! */ + if (worker->read_buffer_bytes_wanted == 16) + { + gssize message_len; + /* OK, got the header - determine how many more bytes are needed */ + error = NULL; + message_len = g_dbus_message_bytes_needed ((guchar *) worker->read_buffer, + 16, + &error); + if (message_len == -1) + { + g_warning ("_g_dbus_worker_do_read_cb: error determing bytes needed: %s", error->message); + _g_dbus_worker_emit_disconnected (worker, FALSE, error); + g_error_free (error); + goto out; + } + + worker->read_buffer_bytes_wanted = message_len; + _g_dbus_worker_do_read_unlocked (worker); + } + else + { + GDBusMessage *message; + error = NULL; + + /* TODO: use connection->priv->auth to decode the message */ + + message = g_dbus_message_new_from_blob ((guchar *) worker->read_buffer, + worker->read_buffer_cur_size, + worker->capabilities, + &error); + if (message == NULL) + { + gchar *s; + s = _g_dbus_hexdump (worker->read_buffer, worker->read_buffer_cur_size, 2); + g_warning ("Error decoding D-Bus message of %" G_GSIZE_FORMAT " bytes\n" + "The error is: %s\n" + "The payload is as follows:\n" + "%s\n", + worker->read_buffer_cur_size, + error->message, + s); + g_free (s); + _g_dbus_worker_emit_disconnected (worker, FALSE, error); + g_error_free (error); + goto out; + } + +#ifdef G_OS_UNIX + if (worker->read_fd_list != NULL) + { + g_dbus_message_set_unix_fd_list (message, worker->read_fd_list); + g_object_unref (worker->read_fd_list); + worker->read_fd_list = NULL; + } +#endif + + if (G_UNLIKELY (_g_dbus_debug_message ())) + { + gchar *s; + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Message:\n" + " <<<< RECEIVED D-Bus message (%" G_GSIZE_FORMAT " bytes)\n", + worker->read_buffer_cur_size); + s = g_dbus_message_print (message, 2); + g_print ("%s", s); + g_free (s); + if (G_UNLIKELY (_g_dbus_debug_payload ())) + { + s = _g_dbus_hexdump (worker->read_buffer, worker->read_buffer_cur_size, 2); + g_print ("%s\n", s); + g_free (s); + } + _g_dbus_debug_print_unlock (); + } + + /* yay, got a message, go deliver it */ + _g_dbus_worker_queue_or_deliver_received_message (worker, message); + + /* start reading another message! */ + worker->read_buffer_bytes_wanted = 0; + worker->read_buffer_cur_size = 0; + _g_dbus_worker_do_read_unlocked (worker); + } + } + else + { + /* didn't get all the bytes we requested - so repeat the request... */ + _g_dbus_worker_do_read_unlocked (worker); + } + + out: + g_mutex_unlock (worker->read_lock); + + /* gives up the reference acquired when calling g_input_stream_read_async() */ + _g_dbus_worker_unref (worker); +} + +/* called in private thread shared by all GDBusConnection instances (with read-lock held) */ +static void +_g_dbus_worker_do_read_unlocked (GDBusWorker *worker) +{ + /* if bytes_wanted is zero, it means start reading a message */ + if (worker->read_buffer_bytes_wanted == 0) + { + worker->read_buffer_cur_size = 0; + worker->read_buffer_bytes_wanted = 16; + } + + /* ensure we have a (big enough) buffer */ + if (worker->read_buffer == NULL || worker->read_buffer_bytes_wanted > worker->read_buffer_allocated_size) + { + /* TODO: 4096 is randomly chosen; might want a better chosen default minimum */ + worker->read_buffer_allocated_size = MAX (worker->read_buffer_bytes_wanted, 4096); + worker->read_buffer = g_realloc (worker->read_buffer, worker->read_buffer_allocated_size); + } + + if (worker->socket == NULL) + g_input_stream_read_async (g_io_stream_get_input_stream (worker->stream), + worker->read_buffer + worker->read_buffer_cur_size, + worker->read_buffer_bytes_wanted - worker->read_buffer_cur_size, + G_PRIORITY_DEFAULT, + worker->cancellable, + (GAsyncReadyCallback) _g_dbus_worker_do_read_cb, + _g_dbus_worker_ref (worker)); + else + { + worker->read_ancillary_messages = NULL; + worker->read_num_ancillary_messages = 0; + _g_socket_read_with_control_messages (worker->socket, + worker->read_buffer + worker->read_buffer_cur_size, + worker->read_buffer_bytes_wanted - worker->read_buffer_cur_size, + &worker->read_ancillary_messages, + &worker->read_num_ancillary_messages, + G_PRIORITY_DEFAULT, + worker->cancellable, + (GAsyncReadyCallback) _g_dbus_worker_do_read_cb, + _g_dbus_worker_ref (worker)); + } +} + +/* called in private thread shared by all GDBusConnection instances (without read-lock held) */ +static void +_g_dbus_worker_do_read (GDBusWorker *worker) +{ + g_mutex_lock (worker->read_lock); + _g_dbus_worker_do_read_unlocked (worker); + g_mutex_unlock (worker->read_lock); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +struct _MessageToWriteData +{ + GDBusWorker *worker; + GDBusMessage *message; + gchar *blob; + gsize blob_size; + + gsize total_written; + GSimpleAsyncResult *simple; + +}; + +static void +message_to_write_data_free (MessageToWriteData *data) +{ + _g_dbus_worker_unref (data->worker); + if (data->message) + g_object_unref (data->message); + g_free (data->blob); + g_free (data); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void write_message_continue_writing (MessageToWriteData *data); + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +write_message_async_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + MessageToWriteData *data = user_data; + GSimpleAsyncResult *simple; + gssize bytes_written; + GError *error; + + /* Note: we can't access data->simple after calling g_async_result_complete () because the + * callback can free @data and we're not completing in idle. So use a copy of the pointer. + */ + simple = data->simple; + + error = NULL; + bytes_written = g_output_stream_write_finish (G_OUTPUT_STREAM (source_object), + res, + &error); + if (bytes_written == -1) + { + g_simple_async_result_take_error (simple, error); + g_simple_async_result_complete (simple); + g_object_unref (simple); + goto out; + } + g_assert (bytes_written > 0); /* zero is never returned */ + + write_message_print_transport_debug (bytes_written, data); + + data->total_written += bytes_written; + g_assert (data->total_written <= data->blob_size); + if (data->total_written == data->blob_size) + { + g_simple_async_result_complete (simple); + g_object_unref (simple); + goto out; + } + + write_message_continue_writing (data); + + out: + ; +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static gboolean +on_socket_ready (GSocket *socket, + GIOCondition condition, + gpointer user_data) +{ + MessageToWriteData *data = user_data; + write_message_continue_writing (data); + return FALSE; /* remove source */ +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +write_message_continue_writing (MessageToWriteData *data) +{ + GOutputStream *ostream; + GSimpleAsyncResult *simple; +#ifdef G_OS_UNIX + GUnixFDList *fd_list; +#endif + + /* Note: we can't access data->simple after calling g_async_result_complete () because the + * callback can free @data and we're not completing in idle. So use a copy of the pointer. + */ + simple = data->simple; + + ostream = g_io_stream_get_output_stream (data->worker->stream); +#ifdef G_OS_UNIX + fd_list = g_dbus_message_get_unix_fd_list (data->message); +#endif + + g_assert (!g_output_stream_has_pending (ostream)); + g_assert_cmpint (data->total_written, <, data->blob_size); + + if (FALSE) + { + } +#ifdef G_OS_UNIX + else if (G_IS_SOCKET_OUTPUT_STREAM (ostream) && data->total_written == 0) + { + GOutputVector vector; + GSocketControlMessage *control_message; + gssize bytes_written; + GError *error; + + vector.buffer = data->blob; + vector.size = data->blob_size; + + control_message = NULL; + if (fd_list != NULL && g_unix_fd_list_get_length (fd_list) > 0) + { + if (!(data->worker->capabilities & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING)) + { + g_simple_async_result_set_error (simple, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Tried sending a file descriptor but remote peer does not support this capability"); + g_simple_async_result_complete (simple); + g_object_unref (simple); + goto out; + } + control_message = g_unix_fd_message_new_with_fd_list (fd_list); + } + + error = NULL; + bytes_written = g_socket_send_message (data->worker->socket, + NULL, /* address */ + &vector, + 1, + control_message != NULL ? &control_message : NULL, + control_message != NULL ? 1 : 0, + G_SOCKET_MSG_NONE, + data->worker->cancellable, + &error); + if (control_message != NULL) + g_object_unref (control_message); + + if (bytes_written == -1) + { + /* Handle WOULD_BLOCK by waiting until there's room in the buffer */ + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) + { + GSource *source; + source = g_socket_create_source (data->worker->socket, + G_IO_OUT | G_IO_HUP | G_IO_ERR, + data->worker->cancellable); + g_source_set_callback (source, + (GSourceFunc) on_socket_ready, + data, + NULL); /* GDestroyNotify */ + g_source_attach (source, g_main_context_get_thread_default ()); + g_source_unref (source); + g_error_free (error); + goto out; + } + g_simple_async_result_take_error (simple, error); + g_simple_async_result_complete (simple); + g_object_unref (simple); + goto out; + } + g_assert (bytes_written > 0); /* zero is never returned */ + + write_message_print_transport_debug (bytes_written, data); + + data->total_written += bytes_written; + g_assert (data->total_written <= data->blob_size); + if (data->total_written == data->blob_size) + { + g_simple_async_result_complete (simple); + g_object_unref (simple); + goto out; + } + + write_message_continue_writing (data); + } +#endif + else + { +#ifdef G_OS_UNIX + if (fd_list != NULL) + { + g_simple_async_result_set_error (simple, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Tried sending a file descriptor on unsupported stream of type %s", + g_type_name (G_TYPE_FROM_INSTANCE (ostream))); + g_simple_async_result_complete (simple); + g_object_unref (simple); + goto out; + } +#endif + + g_output_stream_write_async (ostream, + (const gchar *) data->blob + data->total_written, + data->blob_size - data->total_written, + G_PRIORITY_DEFAULT, + data->worker->cancellable, + write_message_async_cb, + data); + } + out: + ; +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +write_message_async (GDBusWorker *worker, + MessageToWriteData *data, + GAsyncReadyCallback callback, + gpointer user_data) +{ + data->simple = g_simple_async_result_new (NULL, + callback, + user_data, + write_message_async); + data->total_written = 0; + write_message_continue_writing (data); +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static gboolean +write_message_finish (GAsyncResult *res, + GError **error) +{ + g_warn_if_fail (g_simple_async_result_get_source_tag (G_SIMPLE_ASYNC_RESULT (res)) == write_message_async); + if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + return FALSE; + else + return TRUE; +} +/* ---------------------------------------------------------------------------------------------------- */ + +static void maybe_write_next_message (GDBusWorker *worker); + +typedef struct +{ + GDBusWorker *worker; + GList *flushers; +} FlushAsyncData; + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +ostream_flush_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + FlushAsyncData *data = user_data; + GError *error; + GList *l; + + error = NULL; + g_output_stream_flush_finish (G_OUTPUT_STREAM (source_object), + res, + &error); + + if (error == NULL) + { + if (G_UNLIKELY (_g_dbus_debug_transport ())) + { + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Transport:\n" + " ---- FLUSHED stream of type %s\n", + g_type_name (G_TYPE_FROM_INSTANCE (g_io_stream_get_output_stream (data->worker->stream)))); + _g_dbus_debug_print_unlock (); + } + } + + g_assert (data->flushers != NULL); + for (l = data->flushers; l != NULL; l = l->next) + { + FlushData *f = l->data; + + f->error = error != NULL ? g_error_copy (error) : NULL; + + g_mutex_lock (f->mutex); + g_cond_signal (f->cond); + g_mutex_unlock (f->mutex); + } + g_list_free (data->flushers); + + if (error != NULL) + g_error_free (error); + + /* Make sure we tell folks that we don't have additional + flushes pending */ + g_mutex_lock (data->worker->write_lock); + data->worker->flush_pending = FALSE; + g_mutex_unlock (data->worker->write_lock); + + /* OK, cool, finally kick off the next write */ + maybe_write_next_message (data->worker); + + _g_dbus_worker_unref (data->worker); + g_free (data); +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +message_written (GDBusWorker *worker, + MessageToWriteData *message_data) +{ + GList *l; + GList *ll; + GList *flushers; + + /* first log the fact that we wrote a message */ + if (G_UNLIKELY (_g_dbus_debug_message ())) + { + gchar *s; + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Message:\n" + " >>>> SENT D-Bus message (%" G_GSIZE_FORMAT " bytes)\n", + message_data->blob_size); + s = g_dbus_message_print (message_data->message, 2); + g_print ("%s", s); + g_free (s); + if (G_UNLIKELY (_g_dbus_debug_payload ())) + { + s = _g_dbus_hexdump (message_data->blob, message_data->blob_size, 2); + g_print ("%s\n", s); + g_free (s); + } + _g_dbus_debug_print_unlock (); + } + + /* then first wake up pending flushes and, if needed, flush the stream */ + flushers = NULL; + g_mutex_lock (worker->write_lock); + worker->write_num_messages_written += 1; + for (l = worker->write_pending_flushes; l != NULL; l = ll) + { + FlushData *f = l->data; + ll = l->next; + + if (f->number_to_wait_for == worker->write_num_messages_written) + { + flushers = g_list_append (flushers, f); + worker->write_pending_flushes = g_list_delete_link (worker->write_pending_flushes, l); + } + } + if (flushers != NULL) + { + worker->flush_pending = TRUE; + } + g_mutex_unlock (worker->write_lock); + + if (flushers != NULL) + { + FlushAsyncData *data; + data = g_new0 (FlushAsyncData, 1); + data->worker = _g_dbus_worker_ref (worker); + data->flushers = flushers; + /* flush the stream before writing the next message */ + g_output_stream_flush_async (g_io_stream_get_output_stream (worker->stream), + G_PRIORITY_DEFAULT, + worker->cancellable, + ostream_flush_cb, + data); + } + else + { + /* kick off the next write! */ + maybe_write_next_message (worker); + } +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +write_message_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + MessageToWriteData *data = user_data; + GError *error; + + g_mutex_lock (data->worker->write_lock); + data->worker->num_writes_pending -= 1; + g_mutex_unlock (data->worker->write_lock); + + error = NULL; + if (!write_message_finish (res, &error)) + { + /* TODO: handle */ + _g_dbus_worker_emit_disconnected (data->worker, TRUE, error); + g_error_free (error); + } + + /* this function will also kick of the next write (it might need to + * flush so writing the next message might happen much later + * e.g. async) + */ + message_written (data->worker, data); + + message_to_write_data_free (data); +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static void +maybe_write_next_message (GDBusWorker *worker) +{ + MessageToWriteData *data; + + write_next: + + g_mutex_lock (worker->write_lock); + data = g_queue_pop_head (worker->write_queue); + if (data != NULL) + worker->num_writes_pending += 1; + g_mutex_unlock (worker->write_lock); + + /* Note that write_lock is only used for protecting the @write_queue + * and @num_writes_pending fields of the GDBusWorker struct ... which we + * need to modify from arbitrary threads in _g_dbus_worker_send_message(). + * + * Therefore, it's fine to drop it here when calling back into user + * code and then writing the message out onto the GIOStream since this + * function only runs on the worker thread. + */ + if (data != NULL) + { + GDBusMessage *old_message; + guchar *new_blob; + gsize new_blob_size; + GError *error; + + old_message = data->message; + data->message = _g_dbus_worker_emit_message_about_to_be_sent (worker, data->message); + if (data->message == old_message) + { + /* filters had no effect - do nothing */ + } + else if (data->message == NULL) + { + /* filters dropped message */ + g_mutex_lock (worker->write_lock); + worker->num_writes_pending -= 1; + g_mutex_unlock (worker->write_lock); + message_to_write_data_free (data); + goto write_next; + } + else + { + /* filters altered the message -> reencode */ + error = NULL; + new_blob = g_dbus_message_to_blob (data->message, + &new_blob_size, + worker->capabilities, + &error); + if (new_blob == NULL) + { + /* if filter make the GDBusMessage unencodeable, just complain on stderr and send + * the old message instead + */ + g_warning ("Error encoding GDBusMessage with serial %d altered by filter function: %s", + g_dbus_message_get_serial (data->message), + error->message); + g_error_free (error); + } + else + { + g_free (data->blob); + data->blob = (gchar *) new_blob; + data->blob_size = new_blob_size; + } + } + + write_message_async (worker, + data, + write_message_cb, + data); + } +} + +/* called in private thread shared by all GDBusConnection instances (without write-lock held) */ +static gboolean +write_message_in_idle_cb (gpointer user_data) +{ + GDBusWorker *worker = user_data; + if (worker->num_writes_pending == 0 && !worker->flush_pending) + maybe_write_next_message (worker); + return FALSE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* can be called from any thread - steals blob */ +void +_g_dbus_worker_send_message (GDBusWorker *worker, + GDBusMessage *message, + gchar *blob, + gsize blob_len) +{ + MessageToWriteData *data; + + g_return_if_fail (G_IS_DBUS_MESSAGE (message)); + g_return_if_fail (blob != NULL); + g_return_if_fail (blob_len > 16); + + data = g_new0 (MessageToWriteData, 1); + data->worker = _g_dbus_worker_ref (worker); + data->message = g_object_ref (message); + data->blob = blob; /* steal! */ + data->blob_size = blob_len; + + g_mutex_lock (worker->write_lock); + g_queue_push_tail (worker->write_queue, data); + if (worker->num_writes_pending == 0) + { + GSource *idle_source; + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + write_message_in_idle_cb, + _g_dbus_worker_ref (worker), + (GDestroyNotify) _g_dbus_worker_unref); + g_source_attach (idle_source, shared_thread_data->context); + g_source_unref (idle_source); + } + g_mutex_unlock (worker->write_lock); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +_g_dbus_worker_thread_begin_func (gpointer user_data) +{ + GDBusWorker *worker = user_data; + + worker->thread = g_thread_self (); + + /* begin reading */ + _g_dbus_worker_do_read (worker); +} + +GDBusWorker * +_g_dbus_worker_new (GIOStream *stream, + GDBusCapabilityFlags capabilities, + gboolean initially_frozen, + GDBusWorkerMessageReceivedCallback message_received_callback, + GDBusWorkerMessageAboutToBeSentCallback message_about_to_be_sent_callback, + GDBusWorkerDisconnectedCallback disconnected_callback, + gpointer user_data) +{ + GDBusWorker *worker; + + g_return_val_if_fail (G_IS_IO_STREAM (stream), NULL); + g_return_val_if_fail (message_received_callback != NULL, NULL); + g_return_val_if_fail (message_about_to_be_sent_callback != NULL, NULL); + g_return_val_if_fail (disconnected_callback != NULL, NULL); + + worker = g_new0 (GDBusWorker, 1); + worker->ref_count = 1; + + worker->read_lock = g_mutex_new (); + worker->message_received_callback = message_received_callback; + worker->message_about_to_be_sent_callback = message_about_to_be_sent_callback; + worker->disconnected_callback = disconnected_callback; + worker->user_data = user_data; + worker->stream = g_object_ref (stream); + worker->capabilities = capabilities; + worker->cancellable = g_cancellable_new (); + worker->flush_pending = FALSE; + + worker->frozen = initially_frozen; + worker->received_messages_while_frozen = g_queue_new (); + + worker->write_lock = g_mutex_new (); + worker->write_queue = g_queue_new (); + + if (G_IS_SOCKET_CONNECTION (worker->stream)) + worker->socket = g_socket_connection_get_socket (G_SOCKET_CONNECTION (worker->stream)); + + _g_dbus_shared_thread_ref (_g_dbus_worker_thread_begin_func, worker); + + return worker; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* This can be called from any thread - frees worker. Note that + * callbacks might still happen if called from another thread than the + * worker - use your own synchronization primitive in the callbacks. + */ +void +_g_dbus_worker_stop (GDBusWorker *worker) +{ + worker->stopped = TRUE; + g_cancellable_cancel (worker->cancellable); + _g_dbus_worker_unref (worker); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* can be called from any thread (except the worker thread) - blocks + * calling thread until all queued outgoing messages are written and + * the transport has been flushed + */ +gboolean +_g_dbus_worker_flush_sync (GDBusWorker *worker, + GCancellable *cancellable, + GError **error) +{ + gboolean ret; + FlushData *data; + + data = NULL; + ret = TRUE; + + /* if the queue is empty, there's nothing to wait for */ + g_mutex_lock (worker->write_lock); + if (g_queue_get_length (worker->write_queue) > 0) + { + data = g_new0 (FlushData, 1); + data->mutex = g_mutex_new (); + data->cond = g_cond_new (); + data->number_to_wait_for = worker->write_num_messages_written + g_queue_get_length (worker->write_queue); + g_mutex_lock (data->mutex); + worker->write_pending_flushes = g_list_prepend (worker->write_pending_flushes, data); + } + g_mutex_unlock (worker->write_lock); + + if (data != NULL) + { + g_cond_wait (data->cond, data->mutex); + g_mutex_unlock (data->mutex); + + /* note:the element is removed from worker->write_pending_flushes in flush_cb() above */ + g_cond_free (data->cond); + g_mutex_free (data->mutex); + if (data->error != NULL) + { + ret = FALSE; + g_propagate_error (error, data->error); + } + g_free (data); + } + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#define G_DBUS_DEBUG_AUTHENTICATION (1<<0) +#define G_DBUS_DEBUG_TRANSPORT (1<<1) +#define G_DBUS_DEBUG_MESSAGE (1<<2) +#define G_DBUS_DEBUG_PAYLOAD (1<<3) +#define G_DBUS_DEBUG_CALL (1<<4) +#define G_DBUS_DEBUG_SIGNAL (1<<5) +#define G_DBUS_DEBUG_INCOMING (1<<6) +#define G_DBUS_DEBUG_RETURN (1<<7) +#define G_DBUS_DEBUG_EMISSION (1<<8) +#define G_DBUS_DEBUG_ADDRESS (1<<9) + +static gint _gdbus_debug_flags = 0; + +gboolean +_g_dbus_debug_authentication (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_AUTHENTICATION) != 0; +} + +gboolean +_g_dbus_debug_transport (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_TRANSPORT) != 0; +} + +gboolean +_g_dbus_debug_message (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_MESSAGE) != 0; +} + +gboolean +_g_dbus_debug_payload (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_PAYLOAD) != 0; +} + +gboolean +_g_dbus_debug_call (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_CALL) != 0; +} + +gboolean +_g_dbus_debug_signal (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_SIGNAL) != 0; +} + +gboolean +_g_dbus_debug_incoming (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_INCOMING) != 0; +} + +gboolean +_g_dbus_debug_return (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_RETURN) != 0; +} + +gboolean +_g_dbus_debug_emission (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_EMISSION) != 0; +} + +gboolean +_g_dbus_debug_address (void) +{ + _g_dbus_initialize (); + return (_gdbus_debug_flags & G_DBUS_DEBUG_ADDRESS) != 0; +} + +G_LOCK_DEFINE_STATIC (print_lock); + +void +_g_dbus_debug_print_lock (void) +{ + G_LOCK (print_lock); +} + +void +_g_dbus_debug_print_unlock (void) +{ + G_UNLOCK (print_lock); +} + +/* + * _g_dbus_initialize: + * + * Does various one-time init things such as + * + * - registering the G_DBUS_ERROR error domain + * - parses the G_DBUS_DEBUG environment variable + */ +void +_g_dbus_initialize (void) +{ + static volatile gsize initialized = 0; + + if (g_once_init_enter (&initialized)) + { + volatile GQuark g_dbus_error_domain; + const gchar *debug; + + g_dbus_error_domain = G_DBUS_ERROR; + + debug = g_getenv ("G_DBUS_DEBUG"); + if (debug != NULL) + { + const GDebugKey keys[] = { + { "authentication", G_DBUS_DEBUG_AUTHENTICATION }, + { "transport", G_DBUS_DEBUG_TRANSPORT }, + { "message", G_DBUS_DEBUG_MESSAGE }, + { "payload", G_DBUS_DEBUG_PAYLOAD }, + { "call", G_DBUS_DEBUG_CALL }, + { "signal", G_DBUS_DEBUG_SIGNAL }, + { "incoming", G_DBUS_DEBUG_INCOMING }, + { "return", G_DBUS_DEBUG_RETURN }, + { "emission", G_DBUS_DEBUG_EMISSION }, + { "address", G_DBUS_DEBUG_ADDRESS } + }; + + _gdbus_debug_flags = g_parse_debug_string (debug, keys, G_N_ELEMENTS (keys)); + if (_gdbus_debug_flags & G_DBUS_DEBUG_PAYLOAD) + _gdbus_debug_flags |= G_DBUS_DEBUG_MESSAGE; + } + + g_once_init_leave (&initialized, 1); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +GVariantType * +_g_dbus_compute_complete_signature (GDBusArgInfo **args) +{ + const GVariantType *arg_types[256]; + guint n; + + if (args) + for (n = 0; args[n] != NULL; n++) + { + /* DBus places a hard limit of 255 on signature length. + * therefore number of args must be less than 256. + */ + g_assert (n < 256); + + arg_types[n] = G_VARIANT_TYPE (args[n]->signature); + + if G_UNLIKELY (arg_types[n] == NULL) + return NULL; + } + else + n = 0; + + return g_variant_type_new_tuple (arg_types, n); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_WIN32 + +extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid); + +gchar * +_g_dbus_win32_get_user_sid (void) +{ + HANDLE h; + TOKEN_USER *user; + DWORD token_information_len; + PSID psid; + gchar *sid; + gchar *ret; + + ret = NULL; + user = NULL; + h = INVALID_HANDLE_VALUE; + + if (!OpenProcessToken (GetCurrentProcess (), TOKEN_QUERY, &h)) + { + g_warning ("OpenProcessToken failed with error code %d", (gint) GetLastError ()); + goto out; + } + + /* Get length of buffer */ + token_information_len = 0; + if (!GetTokenInformation (h, TokenUser, NULL, 0, &token_information_len)) + { + if (GetLastError () != ERROR_INSUFFICIENT_BUFFER) + { + g_warning ("GetTokenInformation() failed with error code %d", (gint) GetLastError ()); + goto out; + } + } + user = g_malloc (token_information_len); + if (!GetTokenInformation (h, TokenUser, user, token_information_len, &token_information_len)) + { + g_warning ("GetTokenInformation() failed with error code %d", (gint) GetLastError ()); + goto out; + } + + psid = user->User.Sid; + if (!IsValidSid (psid)) + { + g_warning ("Invalid SID"); + goto out; + } + + if (!ConvertSidToStringSidA (psid, &sid)) + { + g_warning ("Invalid SID"); + goto out; + } + + ret = g_strdup (sid); + LocalFree (sid); + +out: + g_free (user); + if (h != INVALID_HANDLE_VALUE) + CloseHandle (h); + return ret; +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +gchar * +_g_dbus_get_machine_id (GError **error) +{ + gchar *ret; + /* TODO: use PACKAGE_LOCALSTATEDIR ? */ + ret = NULL; + if (!g_file_get_contents ("/var/lib/dbus/machine-id", + &ret, + NULL, + error)) + { + g_prefix_error (error, _("Unable to load /var/lib/dbus/machine-id: ")); + } + else + { + /* TODO: validate value */ + g_strstrip (ret); + } + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +gchar * +_g_dbus_enum_to_string (GType enum_type, gint value) +{ + gchar *ret; + GEnumClass *klass; + GEnumValue *enum_value; + + klass = g_type_class_ref (enum_type); + enum_value = g_enum_get_value (klass, value); + if (enum_value != NULL) + ret = g_strdup (enum_value->value_nick); + else + ret = g_strdup_printf ("unknown (value %d)", value); + g_type_class_unref (klass); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +write_message_print_transport_debug (gssize bytes_written, + MessageToWriteData *data) +{ + if (G_LIKELY (!_g_dbus_debug_transport ())) + goto out; + + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Transport:\n" + " >>>> WROTE %" G_GSIZE_FORMAT " bytes of message with serial %d and\n" + " size %" G_GSIZE_FORMAT " from offset %" G_GSIZE_FORMAT " on a %s\n", + bytes_written, + g_dbus_message_get_serial (data->message), + data->blob_size, + data->total_written, + g_type_name (G_TYPE_FROM_INSTANCE (g_io_stream_get_output_stream (data->worker->stream)))); + _g_dbus_debug_print_unlock (); + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +read_message_print_transport_debug (gssize bytes_read, + GDBusWorker *worker) +{ + gsize size; + gint32 serial; + gint32 message_length; + + if (G_LIKELY (!_g_dbus_debug_transport ())) + goto out; + + size = bytes_read + worker->read_buffer_cur_size; + serial = 0; + message_length = 0; + if (size >= 16) + message_length = g_dbus_message_bytes_needed ((guchar *) worker->read_buffer, size, NULL); + if (size >= 1) + { + switch (worker->read_buffer[0]) + { + case 'l': + if (size >= 12) + serial = GUINT32_FROM_LE (((guint32 *) worker->read_buffer)[2]); + break; + case 'B': + if (size >= 12) + serial = GUINT32_FROM_BE (((guint32 *) worker->read_buffer)[2]); + break; + default: + /* an error will be set elsewhere if this happens */ + goto out; + } + } + + _g_dbus_debug_print_lock (); + g_print ("========================================================================\n" + "GDBus-debug:Transport:\n" + " <<<< READ %" G_GSIZE_FORMAT " bytes of message with serial %d and\n" + " size %d to offset %" G_GSIZE_FORMAT " from a %s\n", + bytes_read, + serial, + message_length, + worker->read_buffer_cur_size, + g_type_name (G_TYPE_FROM_INSTANCE (g_io_stream_get_input_stream (worker->stream)))); + _g_dbus_debug_print_unlock (); + out: + ; +} diff --git a/gio/gdbusprivate.h b/gio/gdbusprivate.h new file mode 100644 index 0000000..659e9d4 --- /dev/null +++ b/gio/gdbusprivate.h @@ -0,0 +1,129 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (GIO_COMPILATION) +#error "gdbusprivate.h is a private header file." +#endif + +#ifndef __G_DBUS_PRIVATE_H__ +#define __G_DBUS_PRIVATE_H__ + +#include + +G_BEGIN_DECLS + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct GDBusWorker GDBusWorker; + +typedef void (*GDBusWorkerMessageReceivedCallback) (GDBusWorker *worker, + GDBusMessage *message, + gpointer user_data); + +typedef GDBusMessage *(*GDBusWorkerMessageAboutToBeSentCallback) (GDBusWorker *worker, + GDBusMessage *message, + gpointer user_data); + +typedef void (*GDBusWorkerDisconnectedCallback) (GDBusWorker *worker, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data); + +/* This function may be called from any thread - callbacks will be in the shared private message thread + * and must not block. + */ +GDBusWorker *_g_dbus_worker_new (GIOStream *stream, + GDBusCapabilityFlags capabilities, + gboolean initially_frozen, + GDBusWorkerMessageReceivedCallback message_received_callback, + GDBusWorkerMessageAboutToBeSentCallback message_about_to_be_sent_callback, + GDBusWorkerDisconnectedCallback disconnected_callback, + gpointer user_data); + +/* can be called from any thread - steals blob */ +void _g_dbus_worker_send_message (GDBusWorker *worker, + GDBusMessage *message, + gchar *blob, + gsize blob_len); + +/* can be called from any thread */ +void _g_dbus_worker_stop (GDBusWorker *worker); + +/* can be called from any thread */ +void _g_dbus_worker_unfreeze (GDBusWorker *worker); + +/* can be called from any thread (except the worker thread) */ +gboolean _g_dbus_worker_flush_sync (GDBusWorker *worker, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ + +void _g_dbus_initialize (void); +gboolean _g_dbus_debug_authentication (void); +gboolean _g_dbus_debug_transport (void); +gboolean _g_dbus_debug_message (void); +gboolean _g_dbus_debug_payload (void); +gboolean _g_dbus_debug_call (void); +gboolean _g_dbus_debug_signal (void); +gboolean _g_dbus_debug_incoming (void); +gboolean _g_dbus_debug_return (void); +gboolean _g_dbus_debug_emission (void); +gboolean _g_dbus_debug_address (void); + +void _g_dbus_debug_print_lock (void); +void _g_dbus_debug_print_unlock (void); + +gboolean _g_dbus_address_parse_entry (const gchar *address_entry, + gchar **out_transport_name, + GHashTable **out_key_value_pairs, + GError **error); + +GVariantType * _g_dbus_compute_complete_signature (GDBusArgInfo **args); + +gchar *_g_dbus_hexdump (const gchar *data, gsize len, guint indent); + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_WIN32 +gchar *_g_dbus_win32_get_user_sid (void); +#endif + +gchar *_g_dbus_get_machine_id (GError **error); + +gchar *_g_dbus_enum_to_string (GType enum_type, gint value); + +G_END_DECLS + +/* ---------------------------------------------------------------------------------------------------- */ + +GDBusMethodInvocation *_g_dbus_method_invocation_new (const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + const GDBusMethodInfo *method_info, + GDBusConnection *connection, + GDBusMessage *message, + GVariant *parameters, + gpointer user_data); + +#endif /* __G_DBUS_PRIVATE_H__ */ diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c new file mode 100644 index 0000000..98bd758 --- /dev/null +++ b/gio/gdbusproxy.c @@ -0,0 +1,2496 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include + +#include "gdbusutils.h" +#include "gdbusproxy.h" +#include "gioenumtypes.h" +#include "gdbusconnection.h" +#include "gdbuserror.h" +#include "gdbusprivate.h" +#include "gio-marshal.h" +#include "ginitable.h" +#include "gasyncinitable.h" +#include "gioerror.h" +#include "gasyncresult.h" +#include "gsimpleasyncresult.h" +#include "gcancellable.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusproxy + * @short_description: Client-side proxies + * @include: gio/gio.h + * + * #GDBusProxy is a base class used for proxies to access a D-Bus + * interface on a remote object. A #GDBusProxy can be constructed for + * both well-known and unique names. + * + * By default, #GDBusProxy will cache all properties (and listen to + * changes) of the remote object, and proxy all signals that gets + * emitted. This behaviour can be changed by passing suitable + * #GDBusProxyFlags when the proxy is created. If the proxy is for a + * well-known name, the property cache is flushed when the name owner + * vanishes and reloaded when a name owner appears. + * + * If a #GDBusProxy is used for a well-known name, the owner of the + * name is tracked and can be read from + * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to + * get notified of changes. Additionally, only signals and property + * changes emitted from the current name owner are considered and + * calls are always sent to the current name owner. This avoids a + * number of race conditions when the name is lost by one owner and + * claimed by another. However, if no name owner currently exists, + * then calls will be sent to the well-known name which may result in + * the message bus launching an owner (unless + * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set). + * + * The generic #GDBusProxy::g-properties-changed and #GDBusProxy::g-signal + * signals are not very convenient to work with. Therefore, the recommended + * way of working with proxies is to subclass #GDBusProxy, and have + * more natural properties and signals in your derived class. + * + * See for an example. + * + * GDBusProxy for a well-known-nameFIXME: MISSING XINCLUDE CONTENT + */ + +struct _GDBusProxyPrivate +{ + GBusType bus_type; + GDBusConnection *connection; + + GDBusProxyFlags flags; + gchar *name; + gchar *name_owner; + gchar *object_path; + gchar *interface_name; + gint timeout_msec; + + guint name_owner_changed_subscription_id; + + GCancellable *get_all_cancellable; + + /* gchar* -> GVariant* */ + GHashTable *properties; + + GDBusInterfaceInfo *expected_interface; + + guint properties_changed_subscriber_id; + guint signals_subscriber_id; + + gboolean initialized; +}; + +enum +{ + PROP_0, + PROP_G_CONNECTION, + PROP_G_BUS_TYPE, + PROP_G_NAME, + PROP_G_NAME_OWNER, + PROP_G_FLAGS, + PROP_G_OBJECT_PATH, + PROP_G_INTERFACE_NAME, + PROP_G_DEFAULT_TIMEOUT, + PROP_G_INTERFACE_INFO +}; + +enum +{ + PROPERTIES_CHANGED_SIGNAL, + SIGNAL_SIGNAL, + LAST_SIGNAL, +}; + +guint signals[LAST_SIGNAL] = {0}; + +static void initable_iface_init (GInitableIface *initable_iface); +static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); + +G_DEFINE_TYPE_WITH_CODE (GDBusProxy, g_dbus_proxy, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init) + ); + +static void +g_dbus_proxy_finalize (GObject *object) +{ + GDBusProxy *proxy = G_DBUS_PROXY (object); + + g_warn_if_fail (proxy->priv->get_all_cancellable == NULL); + + if (proxy->priv->name_owner_changed_subscription_id > 0) + g_dbus_connection_signal_unsubscribe (proxy->priv->connection, + proxy->priv->name_owner_changed_subscription_id); + + if (proxy->priv->properties_changed_subscriber_id > 0) + g_dbus_connection_signal_unsubscribe (proxy->priv->connection, + proxy->priv->properties_changed_subscriber_id); + + if (proxy->priv->signals_subscriber_id > 0) + g_dbus_connection_signal_unsubscribe (proxy->priv->connection, + proxy->priv->signals_subscriber_id); + + g_object_unref (proxy->priv->connection); + g_free (proxy->priv->name); + g_free (proxy->priv->name_owner); + g_free (proxy->priv->object_path); + g_free (proxy->priv->interface_name); + if (proxy->priv->properties != NULL) + g_hash_table_unref (proxy->priv->properties); + + if (proxy->priv->expected_interface != NULL) + g_dbus_interface_info_unref (proxy->priv->expected_interface); + + G_OBJECT_CLASS (g_dbus_proxy_parent_class)->finalize (object); +} + +static void +g_dbus_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GDBusProxy *proxy = G_DBUS_PROXY (object); + + switch (prop_id) + { + case PROP_G_CONNECTION: + g_value_set_object (value, proxy->priv->connection); + break; + + case PROP_G_FLAGS: + g_value_set_flags (value, proxy->priv->flags); + break; + + case PROP_G_NAME: + g_value_set_string (value, proxy->priv->name); + break; + + case PROP_G_NAME_OWNER: + g_value_set_string (value, proxy->priv->name_owner); + break; + + case PROP_G_OBJECT_PATH: + g_value_set_string (value, proxy->priv->object_path); + break; + + case PROP_G_INTERFACE_NAME: + g_value_set_string (value, proxy->priv->interface_name); + break; + + case PROP_G_DEFAULT_TIMEOUT: + g_value_set_int (value, proxy->priv->timeout_msec); + break; + + case PROP_G_INTERFACE_INFO: + g_value_set_boxed (value, g_dbus_proxy_get_interface_info (proxy)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GDBusProxy *proxy = G_DBUS_PROXY (object); + + switch (prop_id) + { + case PROP_G_CONNECTION: + proxy->priv->connection = g_value_dup_object (value); + break; + + case PROP_G_FLAGS: + proxy->priv->flags = g_value_get_flags (value); + break; + + case PROP_G_NAME: + proxy->priv->name = g_value_dup_string (value); + break; + + case PROP_G_OBJECT_PATH: + proxy->priv->object_path = g_value_dup_string (value); + break; + + case PROP_G_INTERFACE_NAME: + proxy->priv->interface_name = g_value_dup_string (value); + break; + + case PROP_G_DEFAULT_TIMEOUT: + g_dbus_proxy_set_default_timeout (proxy, g_value_get_int (value)); + break; + + case PROP_G_INTERFACE_INFO: + g_dbus_proxy_set_interface_info (proxy, g_value_get_boxed (value)); + break; + + case PROP_G_BUS_TYPE: + proxy->priv->bus_type = g_value_get_enum (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_proxy_class_init (GDBusProxyClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = g_dbus_proxy_finalize; + gobject_class->set_property = g_dbus_proxy_set_property; + gobject_class->get_property = g_dbus_proxy_get_property; + + /* Note that all property names are prefixed to avoid collisions with D-Bus property names + * in derived classes */ + + /** + * GDBusProxy:g-interface-info: + * + * Ensure that interactions with this proxy conform to the given + * interface. For example, when completing a method call, if the + * type signature of the message isn't what's expected, the given + * #GError is set. Signals that have a type signature mismatch are + * simply dropped. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_INTERFACE_INFO, + g_param_spec_boxed ("g-interface-info", + P_("Interface Information"), + P_("Interface Information"), + G_TYPE_DBUS_INTERFACE_INFO, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-connection: + * + * The #GDBusConnection the proxy is for. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_CONNECTION, + g_param_spec_object ("g-connection", + P_("g-connection"), + P_("The connection the proxy is for"), + G_TYPE_DBUS_CONNECTION, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-bus-type: + * + * If this property is not %G_BUS_TYPE_NONE, then + * #GDBusProxy:g-connection must be %NULL and will be set to the + * #GDBusConnection obtained by calling g_bus_get() with the value + * of this property. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_BUS_TYPE, + g_param_spec_enum ("g-bus-type", + P_("Bus Type"), + P_("The bus to connect to, if any"), + G_TYPE_BUS_TYPE, + G_BUS_TYPE_NONE, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-flags: + * + * Flags from the #GDBusProxyFlags enumeration. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_FLAGS, + g_param_spec_flags ("g-flags", + P_("g-flags"), + P_("Flags for the proxy"), + G_TYPE_DBUS_PROXY_FLAGS, + G_DBUS_PROXY_FLAGS_NONE, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-name: + * + * The well-known or unique name that the proxy is for. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_NAME, + g_param_spec_string ("g-name", + P_("g-name"), + P_("The well-known or unique name that the proxy is for"), + NULL, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-name-owner: + * + * The unique name that owns #GDBusProxy:name or %NULL if no-one + * currently owns that name. You may connect to #GObject::notify signal to + * track changes to this property. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_NAME_OWNER, + g_param_spec_string ("g-name-owner", + P_("g-name-owner"), + P_("The unique name for the owner"), + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-object-path: + * + * The object path the proxy is for. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_OBJECT_PATH, + g_param_spec_string ("g-object-path", + P_("g-object-path"), + P_("The object path the proxy is for"), + NULL, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-interface-name: + * + * The D-Bus interface name the proxy is for. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_INTERFACE_NAME, + g_param_spec_string ("g-interface-name", + P_("g-interface-name"), + P_("The D-Bus interface name the proxy is for"), + NULL, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy:g-default-timeout: + * + * The timeout to use if -1 (specifying default timeout) is passed + * as @timeout_msec in the g_dbus_proxy_call() and + * g_dbus_proxy_call_sync() functions. + * + * This allows applications to set a proxy-wide timeout for all + * remote method invocations on the proxy. If this property is -1, + * the default timeout (typically 25 seconds) is used. If set to + * %G_MAXINT, then no timeout is used. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_G_DEFAULT_TIMEOUT, + g_param_spec_int ("g-default-timeout", + P_("Default Timeout"), + P_("Timeout for remote method invocation"), + -1, + G_MAXINT, + -1, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusProxy::g-properties-changed: + * @proxy: The #GDBusProxy emitting the signal. + * @changed_properties: A #GVariant containing the properties that changed + * @invalidated_properties: A %NULL terminated array of properties that was invalidated + * + * Emitted when one or more D-Bus properties on @proxy changes. The + * local cache has already been updated when this signal fires. Note + * that both @changed_properties and @invalidated_properties are + * guaranteed to never be %NULL (either may be empty though). + * + * This signal corresponds to the + * PropertiesChanged D-Bus signal on the + * org.freedesktop.DBus.Properties interface. + * + * Since: 2.26 + */ + signals[PROPERTIES_CHANGED_SIGNAL] = g_signal_new ("g-properties-changed", + G_TYPE_DBUS_PROXY, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GDBusProxyClass, g_properties_changed), + NULL, + NULL, + _gio_marshal_VOID__VARIANT_BOXED, + G_TYPE_NONE, + 2, + G_TYPE_VARIANT, + G_TYPE_STRV | G_SIGNAL_TYPE_STATIC_SCOPE); + + /** + * GDBusProxy::g-signal: + * @proxy: The #GDBusProxy emitting the signal. + * @sender_name: The sender of the signal or %NULL if the connection is not a bus connection. + * @signal_name: The name of the signal. + * @parameters: A #GVariant tuple with parameters for the signal. + * + * Emitted when a signal from the remote object and interface that @proxy is for, has been received. + * + * Since: 2.26 + */ + signals[SIGNAL_SIGNAL] = g_signal_new ("g-signal", + G_TYPE_DBUS_PROXY, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GDBusProxyClass, g_signal), + NULL, + NULL, + _gio_marshal_VOID__STRING_STRING_VARIANT, + G_TYPE_NONE, + 3, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_VARIANT); + + + g_type_class_add_private (klass, sizeof (GDBusProxyPrivate)); +} + +static void +g_dbus_proxy_init (GDBusProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, G_TYPE_DBUS_PROXY, GDBusProxyPrivate); + proxy->priv->properties = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + (GDestroyNotify) g_variant_unref); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gint +property_name_sort_func (const gchar **a, + const gchar **b) +{ + return g_strcmp0 (*a, *b); +} + +/** + * g_dbus_proxy_get_cached_property_names: + * @proxy: A #GDBusProxy. + * + * Gets the names of all cached properties on @proxy. + * + * Returns: A %NULL-terminated array of strings or %NULL if @proxy has + * no cached properties. Free the returned array with g_strfreev(). + * + * Since: 2.26 + */ +gchar ** +g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy) +{ + gchar **names; + GPtrArray *p; + GHashTableIter iter; + const gchar *key; + + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + + names = NULL; + if (g_hash_table_size (proxy->priv->properties) == 0) + goto out; + + p = g_ptr_array_new (); + + g_hash_table_iter_init (&iter, proxy->priv->properties); + while (g_hash_table_iter_next (&iter, (gpointer) &key, NULL)) + g_ptr_array_add (p, g_strdup (key)); + g_ptr_array_sort (p, (GCompareFunc) property_name_sort_func); + g_ptr_array_add (p, NULL); + + names = (gchar **) g_ptr_array_free (p, FALSE); + + out: + return names; +} + +static const GDBusPropertyInfo * +lookup_property_info_or_warn (GDBusProxy *proxy, + const gchar *property_name) +{ + const GDBusPropertyInfo *info; + + if (proxy->priv->expected_interface == NULL) + return NULL; + + info = g_dbus_interface_info_lookup_property (proxy->priv->expected_interface, property_name); + if (info == NULL) + { + g_warning ("Trying to lookup property %s which isn't in expected interface %s", + property_name, + proxy->priv->expected_interface->name); + } + + return info; +} + +/** + * g_dbus_proxy_get_cached_property: + * @proxy: A #GDBusProxy. + * @property_name: Property name. + * + * Looks up the value for a property from the cache. This call does no + * blocking IO. + * + * If @proxy has an expected interface (see + * #GDBusProxy:g-interface-info), then @property_name (for existence) + * is checked against it. + * + * Returns: A reference to the #GVariant instance that holds the value + * for @property_name or %NULL if the value is not in the cache. The + * returned reference must be freed with g_variant_unref(). + * + * Since: 2.26 + */ +GVariant * +g_dbus_proxy_get_cached_property (GDBusProxy *proxy, + const gchar *property_name) +{ + GVariant *value; + + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + g_return_val_if_fail (property_name != NULL, NULL); + + value = g_hash_table_lookup (proxy->priv->properties, property_name); + if (value == NULL) + { + const GDBusPropertyInfo *info; + info = lookup_property_info_or_warn (proxy, property_name); + /* no difference */ + goto out; + } + + g_variant_ref (value); + + out: + return value; +} + +/** + * g_dbus_proxy_set_cached_property: + * @proxy: A #GDBusProxy + * @property_name: Property name. + * @value: Value for the property or %NULL to remove it from the cache. + * + * If @value is not %NULL, sets the cached value for the property with + * name @property_name to the value in @value. + * + * If @value is %NULL, then the cached value is removed from the + * property cache. + * + * If @proxy has an expected interface (see + * #GDBusProxy:g-interface-info), then @property_name (for existence) + * and @value (for the type) is checked against it. + * + * If the @value #GVariant is floating, it is consumed. This allows + * convenient 'inline' use of g_variant_new(), e.g. + * |[ + * g_dbus_proxy_set_cached_property (proxy, + * "SomeProperty", + * g_variant_new ("(si)", + * "A String", + * 42)); + * ]| + * + * Normally you will not need to use this method since @proxy is + * tracking changes using the + * org.freedesktop.DBus.Properties.PropertiesChanged + * D-Bus signal. However, for performance reasons an object may decide + * to not use this signal for some properties and instead use a + * proprietary out-of-band mechanism to transmit changes. + * + * As a concrete example, consider an object with a property + * ChatroomParticipants which is an array of + * strings. Instead of transmitting the same (long) array every time + * the property changes, it is more efficient to only transmit the + * delta using e.g. signals ChatroomParticipantJoined(String + * name) and ChatroomParticipantParted(String + * name). + * + * Since: 2.26 + */ +void +g_dbus_proxy_set_cached_property (GDBusProxy *proxy, + const gchar *property_name, + GVariant *value) +{ + const GDBusPropertyInfo *info; + + g_return_if_fail (G_IS_DBUS_PROXY (proxy)); + g_return_if_fail (property_name != NULL); + + if (value != NULL) + { + info = lookup_property_info_or_warn (proxy, property_name); + if (info != NULL) + { + if (g_strcmp0 (info->signature, g_variant_get_type_string (value)) != 0) + { + g_warning (_("Trying to set property %s of type %s but according to the expected " + "interface the type is %s"), + property_name, + g_variant_get_type_string (value), + info->signature); + goto out; + } + } + g_hash_table_insert (proxy->priv->properties, + g_strdup (property_name), + g_variant_ref_sink (value)); + } + else + { + g_hash_table_remove (proxy->priv->properties, property_name); + } + + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_signal_received (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + GDBusProxy *proxy = G_DBUS_PROXY (user_data); + + if (!proxy->priv->initialized) + goto out; + + if (proxy->priv->name_owner != NULL && g_strcmp0 (sender_name, proxy->priv->name_owner) != 0) + goto out; + + g_signal_emit (proxy, + signals[SIGNAL_SIGNAL], + 0, + sender_name, + signal_name, + parameters); + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_properties_changed (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + GDBusProxy *proxy = G_DBUS_PROXY (user_data); + GError *error; + const gchar *interface_name_for_signal; + GVariant *changed_properties; + gchar **invalidated_properties; + GVariantIter iter; + gchar *key; + GVariant *value; + guint n; + + error = NULL; + changed_properties = NULL; + invalidated_properties = NULL; + + if (!proxy->priv->initialized) + goto out; + + if (proxy->priv->name_owner != NULL && g_strcmp0 (sender_name, proxy->priv->name_owner) != 0) + goto out; + + if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(sa{sv}as)"))) + { + g_warning ("Value for PropertiesChanged signal with type `%s' does not match `(sa{sv}as)'", + g_variant_get_type_string (parameters)); + goto out; + } + + g_variant_get (parameters, + "(&s@a{sv}^a&s)", + &interface_name_for_signal, + &changed_properties, + &invalidated_properties); + + if (g_strcmp0 (interface_name_for_signal, proxy->priv->interface_name) != 0) + goto out; + + g_variant_iter_init (&iter, changed_properties); + while (g_variant_iter_next (&iter, "{sv}", &key, &value)) + { + g_hash_table_insert (proxy->priv->properties, + key, /* adopts string */ + value); /* adopts value */ + } + + for (n = 0; invalidated_properties[n] != NULL; n++) + { + g_hash_table_remove (proxy->priv->properties, invalidated_properties[n]); + } + + /* emit signal */ + g_signal_emit (proxy, signals[PROPERTIES_CHANGED_SIGNAL], + 0, + changed_properties, + invalidated_properties); + + out: + if (changed_properties != NULL) + g_variant_unref (changed_properties); + g_free (invalidated_properties); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +process_get_all_reply (GDBusProxy *proxy, + GVariant *result) +{ + GVariantIter *iter; + gchar *key; + GVariant *value; + + if (!g_variant_is_of_type (result, G_VARIANT_TYPE ("(a{sv})"))) + { + g_warning ("Value for GetAll reply with type `%s' does not match `(a{sv})'", + g_variant_get_type_string (result)); + goto out; + } + + g_variant_get (result, "(a{sv})", &iter); + while (g_variant_iter_next (iter, "{sv}", &key, &value)) + { + g_hash_table_insert (proxy->priv->properties, + key, /* adopts string */ + value); /* adopts value */ + } + g_variant_iter_free (iter); + + /* Synthesize ::g-properties-changed changed */ + if (g_hash_table_size (proxy->priv->properties) > 0) + { + GVariant *changed_properties; + const gchar *invalidated_properties[1] = {NULL}; + + g_variant_get (result, + "(@a{sv})", + &changed_properties); + g_signal_emit (proxy, signals[PROPERTIES_CHANGED_SIGNAL], + 0, + changed_properties, + invalidated_properties); + g_variant_unref (changed_properties); + } + + out: + ; +} + +typedef struct +{ + GDBusProxy *proxy; + GCancellable *cancellable; + gchar *name_owner; +} LoadPropertiesOnNameOwnerChangedData; + +static void +on_name_owner_changed_get_all_cb (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + LoadPropertiesOnNameOwnerChangedData *data = user_data; + GVariant *result; + GError *error; + gboolean cancelled; + + cancelled = FALSE; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + if (result == NULL) + { + if (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_CANCELLED) + cancelled = TRUE; + /* We just ignore if GetAll() is failing. Because this might happen + * if the object has no properties at all. Or if the caller is + * not authorized to see the properties. + * + * Either way, apps can know about this by using + * get_cached_property_names() or get_cached_property(). + * + * TODO: handle G_DBUS_DEBUG flag 'proxy' and, if enabled, log the + * fact that GetAll() failed + */ + //g_debug ("error: %d %d %s", error->domain, error->code, error->message); + g_error_free (error); + } + + /* and finally we can notify */ + if (!cancelled) + { + g_free (data->proxy->priv->name_owner); + data->proxy->priv->name_owner = data->name_owner; + data->name_owner = NULL; /* to avoid an extra copy, we steal the string */ + + g_hash_table_remove_all (data->proxy->priv->properties); + if (result != NULL) + { + process_get_all_reply (data->proxy, result); + g_variant_unref (result); + } + + g_object_notify (G_OBJECT (data->proxy), "g-name-owner"); + } + + if (data->cancellable == data->proxy->priv->get_all_cancellable) + data->proxy->priv->get_all_cancellable = NULL; + + g_object_unref (data->proxy); + g_object_unref (data->cancellable); + g_free (data->name_owner); + g_free (data); +} + +static void +on_name_owner_changed (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + GDBusProxy *proxy = G_DBUS_PROXY (user_data); + const gchar *old_owner; + const gchar *new_owner; + + /* if we are already trying to load properties, cancel that */ + if (proxy->priv->get_all_cancellable != NULL) + { + g_cancellable_cancel (proxy->priv->get_all_cancellable); + proxy->priv->get_all_cancellable = NULL; + } + + g_variant_get (parameters, + "(&s&s&s)", + NULL, + &old_owner, + &new_owner); + + if (strlen (new_owner) == 0) + { + g_free (proxy->priv->name_owner); + proxy->priv->name_owner = NULL; + + /* Synthesize ::g-properties-changed changed */ + if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES) && + g_hash_table_size (proxy->priv->properties) > 0) + { + GVariantBuilder builder; + GVariant *changed_properties; + GPtrArray *invalidated_properties; + GHashTableIter iter; + const gchar *key; + + /* Build changed_properties (always empty) and invalidated_properties ... */ + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + changed_properties = g_variant_builder_end (&builder); + invalidated_properties = g_ptr_array_new_with_free_func (g_free); + g_hash_table_iter_init (&iter, proxy->priv->properties); + while (g_hash_table_iter_next (&iter, (gpointer) &key, NULL)) + g_ptr_array_add (invalidated_properties, g_strdup (key)); + g_ptr_array_add (invalidated_properties, NULL); + + /* ... throw out the properties ... */ + g_hash_table_remove_all (proxy->priv->properties); + + /* ... and finally emit the ::g-properties-changed signal */ + g_signal_emit (proxy, signals[PROPERTIES_CHANGED_SIGNAL], + 0, + changed_properties, + (const gchar* const *) invalidated_properties->pdata); + g_variant_unref (changed_properties); + g_ptr_array_unref (invalidated_properties); + } + g_object_notify (G_OBJECT (proxy), "g-name-owner"); + } + else + { + /* ignore duplicates - this can happen when activating the service */ + if (g_strcmp0 (new_owner, proxy->priv->name_owner) == 0) + goto out; + + if (proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES) + { + g_free (proxy->priv->name_owner); + proxy->priv->name_owner = g_strdup (new_owner); + g_hash_table_remove_all (proxy->priv->properties); + g_object_notify (G_OBJECT (proxy), "g-name-owner"); + } + else + { + LoadPropertiesOnNameOwnerChangedData *data; + + /* start loading properties.. only then emit notify::g-name-owner .. we + * need to be able to cancel this in the event another NameOwnerChanged + * signal suddenly happens + */ + + g_assert (proxy->priv->get_all_cancellable == NULL); + proxy->priv->get_all_cancellable = g_cancellable_new (); + data = g_new0 (LoadPropertiesOnNameOwnerChangedData, 1); + data->proxy = g_object_ref (proxy); + data->cancellable = proxy->priv->get_all_cancellable; + data->name_owner = g_strdup (new_owner); + g_dbus_connection_call (proxy->priv->connection, + data->name_owner, + proxy->priv->object_path, + "org.freedesktop.DBus.Properties", + "GetAll", + g_variant_new ("(s)", proxy->priv->interface_name), + G_VARIANT_TYPE ("(a{sv})"), + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + proxy->priv->get_all_cancellable, + (GAsyncReadyCallback) on_name_owner_changed_get_all_cb, + data); + } + } + + out: + ; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusProxy *proxy; + GCancellable *cancellable; + GSimpleAsyncResult *simple; +} AsyncInitData; + +static void +async_init_data_free (AsyncInitData *data) +{ + g_object_unref (data->proxy); + if (data->cancellable != NULL) + g_object_unref (data->cancellable); + g_object_unref (data->simple); + g_free (data); +} + +static void +async_init_get_all_cb (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + AsyncInitData *data = user_data; + GVariant *result; + GError *error; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + if (result == NULL) + { + /* We just ignore if GetAll() is failing. Because this might happen + * if the object has no properties at all. Or if the caller is + * not authorized to see the properties. + * + * Either way, apps can know about this by using + * get_cached_property_names() or get_cached_property(). + * + * TODO: handle G_DBUS_DEBUG flag 'proxy' and, if enabled, log the + * fact that GetAll() failed + */ + //g_debug ("error: %d %d %s", error->domain, error->code, error->message); + g_error_free (error); + } + else + { + g_simple_async_result_set_op_res_gpointer (data->simple, + result, + (GDestroyNotify) g_variant_unref); + } + + g_simple_async_result_complete_in_idle (data->simple); + async_init_data_free (data); +} + + +static void +async_init_get_name_owner_cb (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + AsyncInitData *data = user_data; + + if (res != NULL) + { + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + if (result == NULL) + { + if (error->domain == G_DBUS_ERROR && + error->code == G_DBUS_ERROR_NAME_HAS_NO_OWNER) + { + g_error_free (error); + } + else + { + g_simple_async_result_take_error (data->simple, error); + g_simple_async_result_complete_in_idle (data->simple); + async_init_data_free (data); + goto out; + } + } + else + { + g_variant_get (result, + "(s)", + &data->proxy->priv->name_owner); + g_variant_unref (result); + } + } + + if (!(data->proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES)) + { + /* load all properties asynchronously */ + g_dbus_connection_call (data->proxy->priv->connection, + data->proxy->priv->name_owner, + data->proxy->priv->object_path, + "org.freedesktop.DBus.Properties", + "GetAll", + g_variant_new ("(s)", data->proxy->priv->interface_name), + G_VARIANT_TYPE ("(a{sv})"), + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + data->cancellable, + (GAsyncReadyCallback) async_init_get_all_cb, + data); + } + else + { + g_simple_async_result_complete_in_idle (data->simple); + async_init_data_free (data); + } + + out: + ; +} + +static void +async_init_call_get_name_owner (AsyncInitData *data) +{ + g_dbus_connection_call (data->proxy->priv->connection, + "org.freedesktop.DBus", /* name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface */ + "GetNameOwner", + g_variant_new ("(s)", + data->proxy->priv->name), + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + data->cancellable, + (GAsyncReadyCallback) async_init_get_name_owner_cb, + data); +} + +static void +async_init_start_service_by_name_cb (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + AsyncInitData *data = user_data; + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + if (result == NULL) + { + /* Errors are not unexpected; the bus will reply e.g. + * + * org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Epiphany2 + * was not provided by any .service files + * + * This doesn't mean that the name doesn't have an owner, just + * that it's not provided by a .service file. So just proceed to + * invoke GetNameOwner() if dealing with that error. + */ + if (error->domain == G_DBUS_ERROR && + error->code == G_DBUS_ERROR_SERVICE_UNKNOWN) + { + g_error_free (error); + } + else + { + g_prefix_error (&error, + _("Error calling StartServiceByName for %s: "), + data->proxy->priv->name); + goto failed; + } + } + else + { + guint32 start_service_result; + g_variant_get (result, + "(u)", + &start_service_result); + g_variant_unref (result); + if (start_service_result == 1 || /* DBUS_START_REPLY_SUCCESS */ + start_service_result == 2) /* DBUS_START_REPLY_ALREADY_RUNNING */ + { + /* continue to invoke GetNameOwner() */ + } + else + { + error = g_error_new (G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Unexpected reply %d from StartServiceByName(\"%s\") method"), + start_service_result, + data->proxy->priv->name); + goto failed; + } + } + + async_init_call_get_name_owner (data); + return; + + failed: + g_warn_if_fail (error != NULL); + g_simple_async_result_take_error (data->simple, error); + g_simple_async_result_complete_in_idle (data->simple); + async_init_data_free (data); +} + +static void +async_init_call_start_service_by_name (AsyncInitData *data) +{ + g_dbus_connection_call (data->proxy->priv->connection, + "org.freedesktop.DBus", /* name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface */ + "StartServiceByName", + g_variant_new ("(su)", + data->proxy->priv->name, + 0), + G_VARIANT_TYPE ("(u)"), + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + data->cancellable, + (GAsyncReadyCallback) async_init_start_service_by_name_cb, + data); +} + +static void +async_initable_init_second_async (GAsyncInitable *initable, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GDBusProxy *proxy = G_DBUS_PROXY (initable); + AsyncInitData *data; + + data = g_new0 (AsyncInitData, 1); + data->proxy = g_object_ref (proxy); + data->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL; + data->simple = g_simple_async_result_new (G_OBJECT (proxy), + callback, + user_data, + NULL); + + /* Check name ownership asynchronously - possibly also start the service */ + if (proxy->priv->name == NULL) + { + /* Do nothing */ + async_init_get_name_owner_cb (proxy->priv->connection, NULL, data); + } + else if (g_dbus_is_unique_name (proxy->priv->name)) + { + proxy->priv->name_owner = g_strdup (proxy->priv->name); + async_init_get_name_owner_cb (proxy->priv->connection, NULL, data); + } + else + { + if (proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START) + { + async_init_call_get_name_owner (data); + } + else + { + async_init_call_start_service_by_name (data); + } + } +} + +static gboolean +async_initable_init_second_finish (GAsyncInitable *initable, + GAsyncResult *res, + GError **error) +{ + GDBusProxy *proxy = G_DBUS_PROXY (initable); + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + GVariant *result; + gboolean ret; + + ret = FALSE; + + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + result = g_simple_async_result_get_op_res_gpointer (simple); + if (result != NULL) + { + process_get_all_reply (proxy, result); + } + + ret = TRUE; + + out: + proxy->priv->initialized = TRUE; + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +async_initable_init_first (GAsyncInitable *initable) +{ + GDBusProxy *proxy = G_DBUS_PROXY (initable); + + if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES)) + { + /* subscribe to PropertiesChanged() */ + proxy->priv->properties_changed_subscriber_id = + g_dbus_connection_signal_subscribe (proxy->priv->connection, + proxy->priv->name, + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + proxy->priv->object_path, + proxy->priv->interface_name, + G_DBUS_SIGNAL_FLAGS_NONE, + on_properties_changed, + proxy, + NULL); + } + + if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS)) + { + /* subscribe to all signals for the object */ + proxy->priv->signals_subscriber_id = + g_dbus_connection_signal_subscribe (proxy->priv->connection, + proxy->priv->name, + proxy->priv->interface_name, + NULL, /* member */ + proxy->priv->object_path, + NULL, /* arg0 */ + G_DBUS_SIGNAL_FLAGS_NONE, + on_signal_received, + proxy, + NULL); + } + + if (proxy->priv->name != NULL && !g_dbus_is_unique_name (proxy->priv->name)) + { + proxy->priv->name_owner_changed_subscription_id = + g_dbus_connection_signal_subscribe (proxy->priv->connection, + "org.freedesktop.DBus", /* name */ + "org.freedesktop.DBus", /* interface */ + "NameOwnerChanged", /* signal name */ + "/org/freedesktop/DBus", /* path */ + proxy->priv->name, /* arg0 */ + G_DBUS_SIGNAL_FLAGS_NONE, + on_name_owner_changed, + proxy, + NULL); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* initialization is split into two parts - the first is the + * non-blocing part that requires the callers GMainContext - the + * second is a blocking part async part that doesn't require the + * callers GMainContext.. we do this split so the code can be reused + * in the GInitable implementation below. + * + * Note that obtaining a GDBusConnection is not shared between the two + * paths. + */ + +typedef struct +{ + GDBusProxy *proxy; + gint io_priority; + GCancellable *cancellable; + GAsyncReadyCallback callback; + gpointer user_data; +} GetConnectionData; + +static void +get_connection_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + GetConnectionData *data = user_data; + GError *error; + + error = NULL; + data->proxy->priv->connection = g_bus_get_finish (res, &error); + if (data->proxy->priv->connection == NULL) + { + GSimpleAsyncResult *simple; + simple = g_simple_async_result_new (G_OBJECT (data->proxy), + data->callback, + data->user_data, + NULL); + g_simple_async_result_take_error (simple, error); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); + } + else + { + async_initable_init_first (G_ASYNC_INITABLE (data->proxy)); + async_initable_init_second_async (G_ASYNC_INITABLE (data->proxy), + data->io_priority, + data->cancellable, + data->callback, + data->user_data); + } + + if (data->cancellable != NULL) + g_object_unref (data->cancellable); + if (data->proxy != NULL) + g_object_unref (data->proxy); + g_free (data); +} + +static void +async_initable_init_async (GAsyncInitable *initable, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GDBusProxy *proxy = G_DBUS_PROXY (initable); + + if (proxy->priv->bus_type != G_BUS_TYPE_NONE) + { + GetConnectionData *data; + + g_assert (proxy->priv->connection == NULL); + + data = g_new0 (GetConnectionData, 1); + data->proxy = g_object_ref (proxy); + data->io_priority = io_priority; + data->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL; + data->callback = callback; + data->user_data = user_data; + g_bus_get (proxy->priv->bus_type, + cancellable, + get_connection_cb, + data); + } + else + { + async_initable_init_first (initable); + async_initable_init_second_async (initable, io_priority, cancellable, callback, user_data); + } +} + +static gboolean +async_initable_init_finish (GAsyncInitable *initable, + GAsyncResult *res, + GError **error) +{ + return async_initable_init_second_finish (initable, res, error); +} + +static void +async_initable_iface_init (GAsyncInitableIface *async_initable_iface) +{ + async_initable_iface->init_async = async_initable_init_async; + async_initable_iface->init_finish = async_initable_init_finish; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GMainContext *context; + GMainLoop *loop; + GAsyncResult *res; +} InitableAsyncInitableData; + +static void +async_initable_init_async_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + InitableAsyncInitableData *data = user_data; + data->res = g_object_ref (res); + g_main_loop_quit (data->loop); +} + +/* Simply reuse the GAsyncInitable implementation but run the first + * part (that is non-blocking and requires the callers GMainContext) + * with the callers GMainContext.. and the second with a private + * GMainContext (bug 621310 is slightly related). + * + * Note that obtaining a GDBusConnection is not shared between the two + * paths. + */ +static gboolean +initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + GDBusProxy *proxy = G_DBUS_PROXY (initable); + InitableAsyncInitableData *data; + gboolean ret; + + ret = FALSE; + + if (proxy->priv->bus_type != G_BUS_TYPE_NONE) + { + g_assert (proxy->priv->connection == NULL); + proxy->priv->connection = g_bus_get_sync (proxy->priv->bus_type, + cancellable, + error); + if (proxy->priv->connection == NULL) + goto out; + } + + async_initable_init_first (G_ASYNC_INITABLE (initable)); + + data = g_new0 (InitableAsyncInitableData, 1); + data->context = g_main_context_new (); + data->loop = g_main_loop_new (data->context, FALSE); + + g_main_context_push_thread_default (data->context); + + async_initable_init_second_async (G_ASYNC_INITABLE (initable), + G_PRIORITY_DEFAULT, + cancellable, + async_initable_init_async_cb, + data); + + g_main_loop_run (data->loop); + + ret = async_initable_init_second_finish (G_ASYNC_INITABLE (initable), + data->res, + error); + + g_main_context_pop_thread_default (data->context); + + g_main_context_unref (data->context); + g_main_loop_unref (data->loop); + g_object_unref (data->res); + g_free (data); + + out: + + return ret; +} + +static void +initable_iface_init (GInitableIface *initable_iface) +{ + initable_iface->init = initable_init; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags used when constructing the proxy. + * @info: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL. + * @name: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @interface_name: A D-Bus interface name. + * @cancellable: A #GCancellable or %NULL. + * @callback: Callback function to invoke when the proxy is ready. + * @user_data: User data to pass to @callback. + * + * Creates a proxy for accessing @interface_name on the remote object + * at @object_path owned by @name at @connection and asynchronously + * loads D-Bus properties unless the + * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to + * the #GDBusProxy::g-properties-changed signal to get notified about + * property changes. + * + * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up + * match rules for signals. Connect to the #GDBusProxy::g-signal signal + * to handle signals from the remote object. + * + * If @name is a well-known name and the + * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name + * owner currently exists, the message bus will be requested to launch + * a name owner for the name. + * + * This is a failable asynchronous constructor - when the proxy is + * ready, @callback will be invoked and you can use + * g_dbus_proxy_new_finish() to get the result. + * + * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor. + * + * See for an example of how #GDBusProxy can be used. + * + * Since: 2.26 + */ +void +g_dbus_proxy_new (GDBusConnection *connection, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); + g_return_if_fail ((name == NULL && g_dbus_connection_get_unique_name (connection) == NULL) || g_dbus_is_name (name)); + g_return_if_fail (g_variant_is_object_path (object_path)); + g_return_if_fail (g_dbus_is_interface_name (interface_name)); + + g_async_initable_new_async (G_TYPE_DBUS_PROXY, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + "g-flags", flags, + "g-interface-info", info, + "g-name", name, + "g-connection", connection, + "g-object-path", object_path, + "g-interface-name", interface_name, + NULL); +} + +/** + * g_dbus_proxy_new_finish: + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new(). + * @error: Return location for error or %NULL. + * + * Finishes creating a #GDBusProxy. + * + * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusProxy * +g_dbus_proxy_new_finish (GAsyncResult *res, + GError **error) +{ + GObject *object; + GObject *source_object; + + source_object = g_async_result_get_source_object (res); + g_assert (source_object != NULL); + + object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), + res, + error); + g_object_unref (source_object); + + if (object != NULL) + return G_DBUS_PROXY (object); + else + return NULL; +} + +/** + * g_dbus_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags used when constructing the proxy. + * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @interface_name: A D-Bus interface name. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: (allow-none): Return location for error or %NULL. + * + * Creates a proxy for accessing @interface_name on the remote object + * at @object_path owned by @name at @connection and synchronously + * loads D-Bus properties unless the + * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. + * + * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up + * match rules for signals. Connect to the #GDBusProxy::g-signal signal + * to handle signals from the remote object. + * + * If @name is a well-known name and the + * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name + * owner currently exists, the message bus will be requested to launch + * a name owner for the name. + * + * This is a synchronous failable constructor. See g_dbus_proxy_new() + * and g_dbus_proxy_new_finish() for the asynchronous version. + * + * See for an example of how #GDBusProxy can be used. + * + * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusProxy * +g_dbus_proxy_new_sync (GDBusConnection *connection, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GError **error) +{ + GInitable *initable; + + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail ((name == NULL && g_dbus_connection_get_unique_name (connection) == NULL) || + g_dbus_is_name (name), NULL); + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + g_return_val_if_fail (g_dbus_is_interface_name (interface_name), NULL); + + initable = g_initable_new (G_TYPE_DBUS_PROXY, + cancellable, + error, + "g-flags", flags, + "g-interface-info", info, + "g-name", name, + "g-connection", connection, + "g-object-path", object_path, + "g-interface-name", interface_name, + NULL); + if (initable != NULL) + return G_DBUS_PROXY (initable); + else + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags used when constructing the proxy. + * @info: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @interface_name: A D-Bus interface name. + * @cancellable: A #GCancellable or %NULL. + * @callback: Callback function to invoke when the proxy is ready. + * @user_data: User data to pass to @callback. + * + * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * See for an example of how #GDBusProxy can be used. + * + * Since: 2.26 + */ +void +g_dbus_proxy_new_for_bus (GBusType bus_type, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (g_dbus_is_name (name)); + g_return_if_fail (g_variant_is_object_path (object_path)); + g_return_if_fail (g_dbus_is_interface_name (interface_name)); + + g_async_initable_new_async (G_TYPE_DBUS_PROXY, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + "g-flags", flags, + "g-interface-info", info, + "g-name", name, + "g-bus-type", bus_type, + "g-object-path", object_path, + "g-interface-name", interface_name, + NULL); +} + +/** + * g_dbus_proxy_new_for_bus_finish: + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus(). + * @error: Return location for error or %NULL. + * + * Finishes creating a #GDBusProxy. + * + * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusProxy * +g_dbus_proxy_new_for_bus_finish (GAsyncResult *res, + GError **error) +{ + return g_dbus_proxy_new_finish (res, error); +} + +/** + * g_dbus_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags used when constructing the proxy. + * @info: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @interface_name: A D-Bus interface name. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * See for an example of how #GDBusProxy can be used. + * + * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref(). + * + * Since: 2.26 + */ +GDBusProxy * +g_dbus_proxy_new_for_bus_sync (GBusType bus_type, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GError **error) +{ + GInitable *initable; + + g_return_val_if_fail (g_dbus_is_name (name), NULL); + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + g_return_val_if_fail (g_dbus_is_interface_name (interface_name), NULL); + + initable = g_initable_new (G_TYPE_DBUS_PROXY, + cancellable, + error, + "g-flags", flags, + "g-interface-info", info, + "g-name", name, + "g-bus-type", bus_type, + "g-object-path", object_path, + "g-interface-name", interface_name, + NULL); + if (initable != NULL) + return G_DBUS_PROXY (initable); + else + return NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_dbus_proxy_get_connection: + * @proxy: A #GDBusProxy. + * + * Gets the connection @proxy is for. + * + * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free. + * + * Since: 2.26 + */ +GDBusConnection * +g_dbus_proxy_get_connection (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + return proxy->priv->connection; +} + +/** + * g_dbus_proxy_get_flags: + * @proxy: A #GDBusProxy. + * + * Gets the flags that @proxy was constructed with. + * + * Returns: Flags from the #GDBusProxyFlags enumeration. + * + * Since: 2.26 + */ +GDBusProxyFlags +g_dbus_proxy_get_flags (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), 0); + return proxy->priv->flags; +} + +/** + * g_dbus_proxy_get_name: + * @proxy: A #GDBusProxy. + * + * Gets the name that @proxy was constructed for. + * + * Returns: A string owned by @proxy. Do not free. + * + * Since: 2.26 + */ +const gchar * +g_dbus_proxy_get_name (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + return proxy->priv->name; +} + +/** + * g_dbus_proxy_get_name_owner: + * @proxy: A #GDBusProxy. + * + * The unique name that owns the name that @proxy is for or %NULL if + * no-one currently owns that name. You may connect to the + * #GObject::notify signal to track changes to the + * #GDBusProxy:g-name-owner property. + * + * Returns: The name owner or %NULL if no name owner exists. Free with g_free(). + * + * Since: 2.26 + */ +gchar * +g_dbus_proxy_get_name_owner (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + return g_strdup (proxy->priv->name_owner); +} + +/** + * g_dbus_proxy_get_object_path: + * @proxy: A #GDBusProxy. + * + * Gets the object path @proxy is for. + * + * Returns: A string owned by @proxy. Do not free. + * + * Since: 2.26 + */ +const gchar * +g_dbus_proxy_get_object_path (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + return proxy->priv->object_path; +} + +/** + * g_dbus_proxy_get_interface_name: + * @proxy: A #GDBusProxy. + * + * Gets the D-Bus interface name @proxy is for. + * + * Returns: A string owned by @proxy. Do not free. + * + * Since: 2.26 + */ +const gchar * +g_dbus_proxy_get_interface_name (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + return proxy->priv->interface_name; +} + +/** + * g_dbus_proxy_get_default_timeout: + * @proxy: A #GDBusProxy. + * + * Gets the timeout to use if -1 (specifying default timeout) is + * passed as @timeout_msec in the g_dbus_proxy_call() and + * g_dbus_proxy_call_sync() functions. + * + * See the #GDBusProxy:g-default-timeout property for more details. + * + * Returns: Timeout to use for @proxy. + * + * Since: 2.26 + */ +gint +g_dbus_proxy_get_default_timeout (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), -1); + return proxy->priv->timeout_msec; +} + +/** + * g_dbus_proxy_set_default_timeout: + * @proxy: A #GDBusProxy. + * @timeout_msec: Timeout in milliseconds. + * + * Sets the timeout to use if -1 (specifying default timeout) is + * passed as @timeout_msec in the g_dbus_proxy_call() and + * g_dbus_proxy_call_sync() functions. + * + * See the #GDBusProxy:g-default-timeout property for more details. + * + * Since: 2.26 + */ +void +g_dbus_proxy_set_default_timeout (GDBusProxy *proxy, + gint timeout_msec) +{ + g_return_if_fail (G_IS_DBUS_PROXY (proxy)); + g_return_if_fail (timeout_msec == -1 || timeout_msec >= 0); + + /* TODO: locking? */ + if (proxy->priv->timeout_msec != timeout_msec) + { + proxy->priv->timeout_msec = timeout_msec; + g_object_notify (G_OBJECT (proxy), "g-default-timeout"); + } +} + +/** + * g_dbus_proxy_get_interface_info: + * @proxy: A #GDBusProxy + * + * Returns the #GDBusInterfaceInfo, if any, specifying the minimal + * interface that @proxy conforms to. + * + * See the #GDBusProxy:g-interface-info property for more details. + * + * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned + * object, it is owned by @proxy. + * + * Since: 2.26 + */ +GDBusInterfaceInfo * +g_dbus_proxy_get_interface_info (GDBusProxy *proxy) +{ + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + return proxy->priv->expected_interface; +} + +/** + * g_dbus_proxy_set_interface_info: + * @proxy: A #GDBusProxy + * @info: Minimum interface this proxy conforms to or %NULL to unset. + * + * Ensure that interactions with @proxy conform to the given + * interface. For example, when completing a method call, if the type + * signature of the message isn't what's expected, the given #GError + * is set. Signals that have a type signature mismatch are simply + * dropped. + * + * See the #GDBusProxy:g-interface-info property for more details. + * + * Since: 2.26 + */ +void +g_dbus_proxy_set_interface_info (GDBusProxy *proxy, + GDBusInterfaceInfo *info) +{ + g_return_if_fail (G_IS_DBUS_PROXY (proxy)); + if (proxy->priv->expected_interface != NULL) + g_dbus_interface_info_unref (proxy->priv->expected_interface); + proxy->priv->expected_interface = info != NULL ? g_dbus_interface_info_ref (info) : NULL; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +maybe_split_method_name (const gchar *method_name, + gchar **out_interface_name, + const gchar **out_method_name) +{ + gboolean was_split; + + was_split = FALSE; + g_assert (out_interface_name != NULL); + g_assert (out_method_name != NULL); + *out_interface_name = NULL; + *out_method_name = NULL; + + if (strchr (method_name, '.') != NULL) + { + gchar *p; + gchar *last_dot; + + p = g_strdup (method_name); + last_dot = strrchr (p, '.'); + *last_dot = '\0'; + + *out_interface_name = p; + *out_method_name = last_dot + 1; + + was_split = TRUE; + } + + return was_split; +} + + +static void +reply_cb (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); + GVariant *value; + GError *error; + + error = NULL; + value = g_dbus_connection_call_finish (connection, + res, + &error); + if (error != NULL) + { + g_simple_async_result_take_error (simple, error); + } + else + { + g_simple_async_result_set_op_res_gpointer (simple, + value, + (GDestroyNotify) g_variant_unref); + } + + /* no need to complete in idle since the method GDBusConnection already does */ + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + +static const GDBusMethodInfo * +lookup_method_info_or_warn (GDBusProxy *proxy, + const gchar *method_name) +{ + const GDBusMethodInfo *info; + + if (proxy->priv->expected_interface == NULL) + return NULL; + + info = g_dbus_interface_info_lookup_method (proxy->priv->expected_interface, method_name); + if (info == NULL) + { + g_warning ("Trying to invoke method %s which isn't in expected interface %s", + method_name, proxy->priv->expected_interface->name); + } + + return info; +} + +static const gchar * +get_destination_for_call (GDBusProxy *proxy) +{ + const gchar *ret; + + ret = NULL; + + /* If proxy->priv->name is a unique name, then proxy->priv->name_owner + * is never NULL and always the same as proxy->priv->name. We use this + * knowledge to avoid checking if proxy->priv->name is a unique or + * well-known name. + */ + ret = proxy->priv->name_owner; + if (ret != NULL) + goto out; + + if (proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START) + goto out; + + ret = proxy->priv->name; + + out: + return ret; +} + +/** + * g_dbus_proxy_call: + * @proxy: A #GDBusProxy. + * @method_name: Name of method to invoke. + * @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters. + * @flags: Flags from the #GDBusCallFlags enumeration. + * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning + * "infinite") or -1 to use the proxy default timeout. + * @cancellable: A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't + * care about the result of the method invocation. + * @user_data: The data to pass to @callback. + * + * Asynchronously invokes the @method_name method on @proxy. + * + * If @method_name contains any dots, then @name is split into interface and + * method name parts. This allows using @proxy for invoking methods on + * other interfaces. + * + * If the #GDBusConnection associated with @proxy is closed then + * the operation will fail with %G_IO_ERROR_CLOSED. If + * @cancellable is canceled, the operation will fail with + * %G_IO_ERROR_CANCELLED. If @parameters contains a value not + * compatible with the D-Bus protocol, the operation fails with + * %G_IO_ERROR_INVALID_ARGUMENT. + * + * If the @parameters #GVariant is floating, it is consumed. This allows + * convenient 'inline' use of g_variant_new(), e.g.: + * |[ + * g_dbus_proxy_call (proxy, + * "TwoStrings", + * g_variant_new ("(ss)", + * "Thing One", + * "Thing Two"), + * G_DBUS_CALL_FLAGS_NONE, + * -1, + * NULL, + * (GAsyncReadyCallback) two_strings_done, + * &data); + * ]| + * + * This is an asynchronous method. When the operation is finished, + * @callback will be invoked in the + * thread-default + * main loop of the thread you are calling this method from. + * You can then call g_dbus_proxy_call_finish() to get the result of + * the operation. See g_dbus_proxy_call_sync() for the synchronous + * version of this method. + * + * Since: 2.26 + */ +void +g_dbus_proxy_call (GDBusProxy *proxy, + const gchar *method_name, + GVariant *parameters, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *simple; + gboolean was_split; + gchar *split_interface_name; + const gchar *split_method_name; + const gchar *target_method_name; + const gchar *target_interface_name; + const gchar *destination; + GVariantType *reply_type; + + g_return_if_fail (G_IS_DBUS_PROXY (proxy)); + g_return_if_fail (g_dbus_is_member_name (method_name) || g_dbus_is_interface_name (method_name)); + g_return_if_fail (parameters == NULL || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE)); + g_return_if_fail (timeout_msec == -1 || timeout_msec >= 0); + + reply_type = NULL; + split_interface_name = NULL; + + simple = g_simple_async_result_new (G_OBJECT (proxy), + callback, + user_data, + g_dbus_proxy_call); + + was_split = maybe_split_method_name (method_name, &split_interface_name, &split_method_name); + target_method_name = was_split ? split_method_name : method_name; + target_interface_name = was_split ? split_interface_name : proxy->priv->interface_name; + + /* Warn if method is unexpected (cf. :g-interface-info) */ + if (!was_split) + { + const GDBusMethodInfo *expected_method_info; + expected_method_info = lookup_method_info_or_warn (proxy, target_method_name); + if (expected_method_info != NULL) + reply_type = _g_dbus_compute_complete_signature (expected_method_info->out_args); + } + + destination = NULL; + if (proxy->priv->name != NULL) + { + destination = get_destination_for_call (proxy); + if (destination == NULL) + { + g_simple_async_result_set_error (simple, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag")); + goto out; + } + } + + g_dbus_connection_call (proxy->priv->connection, + destination, + proxy->priv->object_path, + target_interface_name, + target_method_name, + parameters, + reply_type, + flags, + timeout_msec == -1 ? proxy->priv->timeout_msec : timeout_msec, + cancellable, + (GAsyncReadyCallback) reply_cb, + simple); + + out: + if (reply_type != NULL) + g_variant_type_free (reply_type); + + g_free (split_interface_name); +} + +/** + * g_dbus_proxy_call_finish: + * @proxy: A #GDBusProxy. + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_proxy_call(). + * + * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with + * return values. Free with g_variant_unref(). + * + * Since: 2.26 + */ +GVariant * +g_dbus_proxy_call_finish (GDBusProxy *proxy, + GAsyncResult *res, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); + GVariant *value; + + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_proxy_call); + + value = NULL; + + if (g_simple_async_result_propagate_error (simple, error)) + goto out; + + value = g_variant_ref (g_simple_async_result_get_op_res_gpointer (simple)); + + out: + return value; +} + +/** + * g_dbus_proxy_call_sync: + * @proxy: A #GDBusProxy. + * @method_name: Name of method to invoke. + * @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters. + * @flags: Flags from the #GDBusCallFlags enumeration. + * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning + * "infinite") or -1 to use the proxy default timeout. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the @method_name method on @proxy. + * + * If @method_name contains any dots, then @name is split into interface and + * method name parts. This allows using @proxy for invoking methods on + * other interfaces. + * + * If the #GDBusConnection associated with @proxy is disconnected then + * the operation will fail with %G_IO_ERROR_CLOSED. If + * @cancellable is canceled, the operation will fail with + * %G_IO_ERROR_CANCELLED. If @parameters contains a value not + * compatible with the D-Bus protocol, the operation fails with + * %G_IO_ERROR_INVALID_ARGUMENT. + * + * If the @parameters #GVariant is floating, it is consumed. This allows + * convenient 'inline' use of g_variant_new(), e.g.: + * |[ + * g_dbus_proxy_call_sync (proxy, + * "TwoStrings", + * g_variant_new ("(ss)", + * "Thing One", + * "Thing Two"), + * G_DBUS_CALL_FLAGS_NONE, + * -1, + * NULL, + * &error); + * ]| + * + * The calling thread is blocked until a reply is received. See + * g_dbus_proxy_call() for the asynchronous version of this + * method. + * + * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with + * return values. Free with g_variant_unref(). + * + * Since: 2.26 + */ +GVariant * +g_dbus_proxy_call_sync (GDBusProxy *proxy, + const gchar *method_name, + GVariant *parameters, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GError **error) +{ + GVariant *ret; + gboolean was_split; + gchar *split_interface_name; + const gchar *split_method_name; + const gchar *target_method_name; + const gchar *target_interface_name; + const gchar *destination; + GVariantType *reply_type; + + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL); + g_return_val_if_fail (g_dbus_is_member_name (method_name) || g_dbus_is_interface_name (method_name), NULL); + g_return_val_if_fail (parameters == NULL || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE), NULL); + g_return_val_if_fail (timeout_msec == -1 || timeout_msec >= 0, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + reply_type = NULL; + + was_split = maybe_split_method_name (method_name, &split_interface_name, &split_method_name); + target_method_name = was_split ? split_method_name : method_name; + target_interface_name = was_split ? split_interface_name : proxy->priv->interface_name; + + /* Warn if method is unexpected (cf. :g-interface-info) */ + if (!was_split) + { + const GDBusMethodInfo *expected_method_info; + expected_method_info = lookup_method_info_or_warn (proxy, target_method_name); + if (expected_method_info != NULL) + reply_type = _g_dbus_compute_complete_signature (expected_method_info->out_args); + } + + destination = NULL; + if (proxy->priv->name != NULL) + { + destination = get_destination_for_call (proxy); + if (destination == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag")); + ret = NULL; + goto out; + } + } + + ret = g_dbus_connection_call_sync (proxy->priv->connection, + destination, + proxy->priv->object_path, + target_interface_name, + target_method_name, + parameters, + reply_type, + flags, + timeout_msec == -1 ? proxy->priv->timeout_msec : timeout_msec, + cancellable, + error); + + out: + if (reply_type != NULL) + g_variant_type_free (reply_type); + + g_free (split_interface_name); + + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusproxy.h b/gio/gdbusproxy.h new file mode 100644 index 0000000..d9858c1 --- /dev/null +++ b/gio/gdbusproxy.h @@ -0,0 +1,167 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_PROXY_H__ +#define __G_DBUS_PROXY_H__ + +#include +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_PROXY (g_dbus_proxy_get_type ()) +#define G_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_PROXY, GDBusProxy)) +#define G_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_PROXY, GDBusProxyClass)) +#define G_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_PROXY, GDBusProxyClass)) +#define G_IS_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_PROXY)) +#define G_IS_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_PROXY)) + +typedef struct _GDBusProxyClass GDBusProxyClass; +typedef struct _GDBusProxyPrivate GDBusProxyPrivate; + +/** + * GDBusProxy: + * + * The #GDBusProxy structure contains only private data and + * should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GDBusProxy +{ + /*< private >*/ + GObject parent_instance; + GDBusProxyPrivate *priv; +}; + +/** + * GDBusProxyClass: + * @g_properties_changed: Signal class handler for the #GDBusProxy::g-properties-changed signal. + * @g_signal: Signal class handler for the #GDBusProxy::g-signal signal. + * + * Class structure for #GDBusProxy. + * + * Since: 2.26 + */ +struct _GDBusProxyClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* Signals */ + void (*g_properties_changed) (GDBusProxy *proxy, + GVariant *changed_properties, + const gchar* const *invalidated_properties); + void (*g_signal) (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters); + + /*< private >*/ + /* Padding for future expansion */ + gpointer padding[32]; +}; + +GType g_dbus_proxy_get_type (void) G_GNUC_CONST; +void g_dbus_proxy_new (GDBusConnection *connection, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusProxy *g_dbus_proxy_new_finish (GAsyncResult *res, + GError **error); +GDBusProxy *g_dbus_proxy_new_sync (GDBusConnection *connection, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GError **error); +void g_dbus_proxy_new_for_bus (GBusType bus_type, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusProxy *g_dbus_proxy_new_for_bus_finish (GAsyncResult *res, + GError **error); +GDBusProxy *g_dbus_proxy_new_for_bus_sync (GBusType bus_type, + GDBusProxyFlags flags, + GDBusInterfaceInfo *info, + const gchar *name, + const gchar *object_path, + const gchar *interface_name, + GCancellable *cancellable, + GError **error); +GDBusConnection *g_dbus_proxy_get_connection (GDBusProxy *proxy); +GDBusProxyFlags g_dbus_proxy_get_flags (GDBusProxy *proxy); +const gchar *g_dbus_proxy_get_name (GDBusProxy *proxy); +gchar *g_dbus_proxy_get_name_owner (GDBusProxy *proxy); +const gchar *g_dbus_proxy_get_object_path (GDBusProxy *proxy); +const gchar *g_dbus_proxy_get_interface_name (GDBusProxy *proxy); +gint g_dbus_proxy_get_default_timeout (GDBusProxy *proxy); +void g_dbus_proxy_set_default_timeout (GDBusProxy *proxy, + gint timeout_msec); +GDBusInterfaceInfo *g_dbus_proxy_get_interface_info (GDBusProxy *proxy); +void g_dbus_proxy_set_interface_info (GDBusProxy *proxy, + GDBusInterfaceInfo *info); +GVariant *g_dbus_proxy_get_cached_property (GDBusProxy *proxy, + const gchar *property_name); +void g_dbus_proxy_set_cached_property (GDBusProxy *proxy, + const gchar *property_name, + GVariant *value); +gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy); +void g_dbus_proxy_call (GDBusProxy *proxy, + const gchar *method_name, + GVariant *parameters, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GVariant *g_dbus_proxy_call_finish (GDBusProxy *proxy, + GAsyncResult *res, + GError **error); +GVariant *g_dbus_proxy_call_sync (GDBusProxy *proxy, + const gchar *method_name, + GVariant *parameters, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GError **error); + +G_END_DECLS + +#endif /* __G_DBUS_PROXY_H__ */ diff --git a/gio/gdbusserver.c b/gio/gdbusserver.c new file mode 100644 index 0000000..299aca3 --- /dev/null +++ b/gio/gdbusserver.c @@ -0,0 +1,1133 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef _WIN32 +#include +#endif + +#include "giotypes.h" +#include "gioerror.h" +#include "gdbusaddress.h" +#include "gdbusutils.h" +#include "gdbusconnection.h" +#include "gdbusserver.h" +#include "gioenumtypes.h" +#include "gdbusprivate.h" +#include "gdbusauthobserver.h" +#include "gio-marshal.h" +#include "ginitable.h" +#include "gsocketservice.h" +#include "gthreadedsocketservice.h" +#include "gresolver.h" +#include "ginetaddress.h" +#include "ginetsocketaddress.h" +#include "ginputstream.h" +#include "giostream.h" + +#ifdef G_OS_UNIX +#include "gunixsocketaddress.h" +#endif + +#include "glibintl.h" + +/** + * SECTION:gdbusserver + * @short_description: Helper for accepting connections + * @include: gio/gio.h + * + * #GDBusServer is a helper for listening to and accepting D-Bus + * connections. + * + * D-Bus peer-to-peer exampleFIXME: MISSING XINCLUDE CONTENT + */ + +/** + * GDBusServer: + * + * The #GDBusServer structure contains only private data and + * should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GDBusServer +{ + /*< private >*/ + GObject parent_instance; + + GDBusServerFlags flags; + gchar *address; + gchar *guid; + + guchar *nonce; + gchar *nonce_file; + + gchar *client_address; + + GSocketListener *listener; + gboolean is_using_listener; + gulong run_signal_handler_id; + + /* The result of g_main_context_get_thread_default() when the object + * was created (the GObject _init() function) - this is used for delivery + * of the :new-connection GObject signal. + */ + GMainContext *main_context_at_construction; + + gboolean active; + + GDBusAuthObserver *authentication_observer; +}; + +typedef struct _GDBusServerClass GDBusServerClass; + +/** + * GDBusServerClass: + * @new_connection: Signal class handler for the #GDBusServer::new-connection signal. + * + * Class structure for #GDBusServer. + * + * Since: 2.26 + */ +struct _GDBusServerClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* Signals */ + gboolean (*new_connection) (GDBusServer *server, + GDBusConnection *connection); +}; + +enum +{ + PROP_0, + PROP_ADDRESS, + PROP_CLIENT_ADDRESS, + PROP_FLAGS, + PROP_GUID, + PROP_ACTIVE, + PROP_AUTHENTICATION_OBSERVER, +}; + +enum +{ + NEW_CONNECTION_SIGNAL, + LAST_SIGNAL, +}; + +guint _signals[LAST_SIGNAL] = {0}; + +static void initable_iface_init (GInitableIface *initable_iface); + +G_DEFINE_TYPE_WITH_CODE (GDBusServer, g_dbus_server, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init) + ); + +static void +g_dbus_server_finalize (GObject *object) +{ + GDBusServer *server = G_DBUS_SERVER (object); + + if (server->authentication_observer != NULL) + g_object_unref (server->authentication_observer); + + if (server->run_signal_handler_id > 0) + g_signal_handler_disconnect (server->listener, server->run_signal_handler_id); + + if (server->listener != NULL) + g_object_unref (server->listener); + + g_free (server->address); + g_free (server->guid); + g_free (server->client_address); + if (server->nonce != NULL) + { + memset (server->nonce, '\0', 16); + g_free (server->nonce); + } + /* we could unlink the nonce file but I don't + * think it's really worth the effort/risk + */ + g_free (server->nonce_file); + + if (server->main_context_at_construction != NULL) + g_main_context_unref (server->main_context_at_construction); + + G_OBJECT_CLASS (g_dbus_server_parent_class)->finalize (object); +} + +static void +g_dbus_server_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GDBusServer *server = G_DBUS_SERVER (object); + + switch (prop_id) + { + case PROP_FLAGS: + g_value_set_flags (value, server->flags); + break; + + case PROP_GUID: + g_value_set_string (value, server->guid); + break; + + case PROP_ADDRESS: + g_value_set_string (value, server->address); + break; + + case PROP_CLIENT_ADDRESS: + g_value_set_string (value, server->client_address); + break; + + case PROP_ACTIVE: + g_value_set_boolean (value, server->active); + break; + + case PROP_AUTHENTICATION_OBSERVER: + g_value_set_object (value, server->authentication_observer); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_server_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GDBusServer *server = G_DBUS_SERVER (object); + + switch (prop_id) + { + case PROP_FLAGS: + server->flags = g_value_get_flags (value); + break; + + case PROP_GUID: + server->guid = g_value_dup_string (value); + break; + + case PROP_ADDRESS: + server->address = g_value_dup_string (value); + break; + + case PROP_AUTHENTICATION_OBSERVER: + server->authentication_observer = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_dbus_server_class_init (GDBusServerClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = g_dbus_server_finalize; + gobject_class->set_property = g_dbus_server_set_property; + gobject_class->get_property = g_dbus_server_get_property; + + /** + * GDBusServer:flags: + * + * Flags from the #GDBusServerFlags enumeration. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_FLAGS, + g_param_spec_flags ("flags", + P_("Flags"), + P_("Flags for the server"), + G_TYPE_DBUS_SERVER_FLAGS, + G_DBUS_SERVER_FLAGS_NONE, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusServer:guid: + * + * The guid of the server. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_GUID, + g_param_spec_string ("guid", + P_("GUID"), + P_("The guid of the server"), + NULL, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusServer:address: + * + * The D-Bus address to listen on. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_ADDRESS, + g_param_spec_string ("address", + P_("Address"), + P_("The address to listen on"), + NULL, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusServer:client-address: + * + * The D-Bus address that clients can use. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_CLIENT_ADDRESS, + g_param_spec_string ("client-address", + P_("Client Address"), + P_("The address clients can use"), + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusServer:active: + * + * Whether the server is currently active. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_ACTIVE, + g_param_spec_boolean ("active", + P_("Active"), + P_("Whether the server is currently active"), + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusServer:authentication-observer: + * + * A #GDBusAuthObserver object to assist in the authentication process or %NULL. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_AUTHENTICATION_OBSERVER, + g_param_spec_object ("authentication-observer", + P_("Authentication Observer"), + P_("Object used to assist in the authentication process"), + G_TYPE_DBUS_AUTH_OBSERVER, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + + /** + * GDBusServer::new-connection: + * @server: The #GDBusServer emitting the signal. + * @connection: A #GDBusConnection for the new connection. + * + * Emitted when a new authenticated connection has been made. Use + * g_dbus_connection_get_peer_credentials() to figure out what + * identity (if any), was authenticated. + * + * If you want to accept the connection, take a reference to the + * @connection object and return %TRUE. When you are done with the + * connection call g_dbus_connection_close() and give up your + * reference. Note that the other peer may disconnect at any time - + * a typical thing to do when accepting a connection is to listen to + * the #GDBusConnection::closed signal. + * + * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD + * then the signal is emitted in a new thread dedicated to the + * connection. Otherwise the signal is emitted in the thread-default main + * loop of the thread that @server was constructed in. + * + * You are guaranteed that signal handlers for this signal runs + * before incoming messages on @connection are processed. This means + * that it's suitable to call g_dbus_connection_register_object() or + * similar from the signal handler. + * + * Returns: %TRUE to claim @connection, %FALSE to let other handlers + * run. + * + * Since: 2.26 + */ + _signals[NEW_CONNECTION_SIGNAL] = g_signal_new ("new-connection", + G_TYPE_DBUS_SERVER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GDBusServerClass, new_connection), + g_signal_accumulator_true_handled, + NULL, /* accu_data */ + _gio_marshal_BOOLEAN__OBJECT, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_CONNECTION); +} + +static void +g_dbus_server_init (GDBusServer *server) +{ + server->main_context_at_construction = g_main_context_get_thread_default (); + if (server->main_context_at_construction != NULL) + g_main_context_ref (server->main_context_at_construction); +} + +static gboolean +on_run (GSocketService *service, + GSocketConnection *socket_connection, + GObject *source_object, + gpointer user_data); + +/** + * g_dbus_server_new_sync: + * @address: A D-Bus address. + * @flags: Flags from the #GDBusServerFlags enumeration. + * @guid: A D-Bus GUID. + * @observer: A #GDBusAuthObserver or %NULL. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for server or %NULL. + * + * Creates a new D-Bus server that listens on the first address in + * @address that works. + * + * Once constructed, you can use g_dbus_server_get_client_address() to + * get a D-Bus address string that clients can use to connect. + * + * Connect to the #GDBusServer::new-connection signal to handle + * incoming connections. + * + * The returned #GDBusServer isn't active - you have to start it with + * g_dbus_server_start(). + * + * See for how #GDBusServer can + * be used. + * + * This is a synchronous failable constructor. See + * g_dbus_server_new() for the asynchronous version. + * + * Returns: A #GDBusServer or %NULL if @error is set. Free with + * g_object_unref(). + * + * Since: 2.26 + */ +GDBusServer * +g_dbus_server_new_sync (const gchar *address, + GDBusServerFlags flags, + const gchar *guid, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GError **error) +{ + GDBusServer *server; + + g_return_val_if_fail (address != NULL, NULL); + g_return_val_if_fail (g_dbus_is_guid (guid), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + server = g_initable_new (G_TYPE_DBUS_SERVER, + cancellable, + error, + "address", address, + "flags", flags, + "guid", guid, + "authentication-observer", observer, + NULL); + if (server != NULL) + { + /* Right now we don't have any transport not using the listener... */ + g_assert (server->is_using_listener); + server->run_signal_handler_id = g_signal_connect (G_SOCKET_SERVICE (server->listener), + "run", + G_CALLBACK (on_run), + server); + } + + return server; +} + +/** + * g_dbus_server_get_client_address: + * @server: A #GDBusServer. + * + * Gets a D-Bus address string that can be used by clients to connect + * to @server. + * + * Returns: A D-Bus address string. Do not free, the string is owned + * by @server. + * + * Since: 2.26 + */ +const gchar * +g_dbus_server_get_client_address (GDBusServer *server) +{ + g_return_val_if_fail (G_IS_DBUS_SERVER (server), NULL); + return server->client_address; +} + +/** + * g_dbus_server_get_guid: + * @server: A #GDBusServer. + * + * Gets the GUID for @server. + * + * Returns: A D-Bus GUID. Do not free this string, it is owned by @server. + * + * Since: 2.26 + */ +const gchar * +g_dbus_server_get_guid (GDBusServer *server) +{ + g_return_val_if_fail (G_IS_DBUS_SERVER (server), NULL); + return server->guid; +} + +/** + * g_dbus_server_get_flags: + * @server: A #GDBusServer. + * + * Gets the flags for @server. + * + * Returns: A set of flags from the #GDBusServerFlags enumeration. + * + * Since: 2.26 + */ +GDBusServerFlags +g_dbus_server_get_flags (GDBusServer *server) +{ + g_return_val_if_fail (G_IS_DBUS_SERVER (server), G_DBUS_SERVER_FLAGS_NONE); + return server->flags; +} + +/** + * g_dbus_server_is_active: + * @server: A #GDBusServer. + * + * Gets whether @server is active. + * + * Returns: %TRUE if server is active, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_server_is_active (GDBusServer *server) +{ + g_return_val_if_fail (G_IS_DBUS_SERVER (server), G_DBUS_SERVER_FLAGS_NONE); + return server->active; +} + +/** + * g_dbus_server_start: + * @server: A #GDBusServer. + * + * Starts @server. + * + * Since: 2.26 + */ +void +g_dbus_server_start (GDBusServer *server) +{ + g_return_if_fail (G_IS_DBUS_SERVER (server)); + if (server->active) + return; + /* Right now we don't have any transport not using the listener... */ + g_assert (server->is_using_listener); + g_socket_service_start (G_SOCKET_SERVICE (server->listener)); + server->active = TRUE; + g_object_notify (G_OBJECT (server), "active"); +} + +/** + * g_dbus_server_stop: + * @server: A #GDBusServer. + * + * Stops @server. + * + * Since: 2.26 + */ +void +g_dbus_server_stop (GDBusServer *server) +{ + g_return_if_fail (G_IS_DBUS_SERVER (server)); + if (!server->active) + return; + /* Right now we don't have any transport not using the listener... */ + g_assert (server->is_using_listener); + g_assert (server->run_signal_handler_id > 0); + g_signal_handler_disconnect (server->listener, server->run_signal_handler_id); + server->run_signal_handler_id = 0; + g_socket_service_stop (G_SOCKET_SERVICE (server->listener)); + server->active = FALSE; + g_object_notify (G_OBJECT (server), "active"); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_UNIX + +static gint +random_ascii (void) +{ + gint ret; + ret = g_random_int_range (0, 60); + if (ret < 25) + ret += 'A'; + else if (ret < 50) + ret += 'a' - 25; + else + ret += '0' - 50; + return ret; +} + +/* note that address_entry has already been validated => exactly one of path, tmpdir or abstract keys are set */ +static gboolean +try_unix (GDBusServer *server, + const gchar *address_entry, + GHashTable *key_value_pairs, + GError **error) +{ + gboolean ret; + const gchar *path; + const gchar *tmpdir; + const gchar *abstract; + GSocketAddress *address; + + ret = FALSE; + address = NULL; + + path = g_hash_table_lookup (key_value_pairs, "path"); + tmpdir = g_hash_table_lookup (key_value_pairs, "tmpdir"); + abstract = g_hash_table_lookup (key_value_pairs, "abstract"); + + if (path != NULL) + { + address = g_unix_socket_address_new (path); + } + else if (tmpdir != NULL) + { + gint n; + GString *s; + GError *local_error; + + retry: + s = g_string_new (tmpdir); + g_string_append (s, "/dbus-"); + for (n = 0; n < 8; n++) + g_string_append_c (s, random_ascii ()); + + /* prefer abstract namespace if available */ + if (g_unix_socket_address_abstract_names_supported ()) + address = g_unix_socket_address_new_with_type (s->str, + -1, + G_UNIX_SOCKET_ADDRESS_ABSTRACT); + else + address = g_unix_socket_address_new (s->str); + g_string_free (s, TRUE); + + local_error = NULL; + if (!g_socket_listener_add_address (server->listener, + address, + G_SOCKET_TYPE_STREAM, + G_SOCKET_PROTOCOL_DEFAULT, + NULL, /* source_object */ + NULL, /* effective_address */ + &local_error)) + { + if (local_error->domain == G_IO_ERROR && local_error->code == G_IO_ERROR_ADDRESS_IN_USE) + { + g_error_free (local_error); + goto retry; + } + g_propagate_error (error, local_error); + goto out; + } + ret = TRUE; + goto out; + } + else if (abstract != NULL) + { + if (!g_unix_socket_address_abstract_names_supported ()) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Abstract name space not supported")); + goto out; + } + address = g_unix_socket_address_new_with_type (abstract, + -1, + G_UNIX_SOCKET_ADDRESS_ABSTRACT); + } + else + { + g_assert_not_reached (); + } + + if (!g_socket_listener_add_address (server->listener, + address, + G_SOCKET_TYPE_STREAM, + G_SOCKET_PROTOCOL_DEFAULT, + NULL, /* source_object */ + NULL, /* effective_address */ + error)) + goto out; + + ret = TRUE; + + out: + + if (address != NULL) + { + /* Fill out client_address if the connection attempt worked */ + if (ret) + { + server->is_using_listener = TRUE; + + switch (g_unix_socket_address_get_address_type (G_UNIX_SOCKET_ADDRESS (address))) + { + case G_UNIX_SOCKET_ADDRESS_ABSTRACT: + server->client_address = g_strdup_printf ("unix:abstract=%s", + g_unix_socket_address_get_path (G_UNIX_SOCKET_ADDRESS (address))); + break; + + case G_UNIX_SOCKET_ADDRESS_PATH: + server->client_address = g_strdup_printf ("unix:path=%s", + g_unix_socket_address_get_path (G_UNIX_SOCKET_ADDRESS (address))); + break; + + default: + g_assert_not_reached (); + break; + } + } + g_object_unref (address); + } + return ret; +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +/* note that address_entry has already been validated => + * both host and port (guranteed to be a number in [0, 65535]) are set (family is optional) + */ +static gboolean +try_tcp (GDBusServer *server, + const gchar *address_entry, + GHashTable *key_value_pairs, + gboolean do_nonce, + GError **error) +{ + gboolean ret; + const gchar *host; + const gchar *port; + const gchar *family; + gint port_num; + GSocketAddress *address; + GResolver *resolver; + GList *resolved_addresses; + GList *l; + + ret = FALSE; + address = NULL; + resolver = NULL; + resolved_addresses = NULL; + + host = g_hash_table_lookup (key_value_pairs, "host"); + port = g_hash_table_lookup (key_value_pairs, "port"); + family = g_hash_table_lookup (key_value_pairs, "family"); + if (g_hash_table_lookup (key_value_pairs, "noncefile") != NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Cannot specify nonce file when creating a server")); + goto out; + } + + if (host == NULL) + host = "localhost"; + if (port == NULL) + port = "0"; + port_num = strtol (port, NULL, 10); + + resolver = g_resolver_get_default (); + resolved_addresses = g_resolver_lookup_by_name (resolver, + host, + NULL, + error); + if (resolved_addresses == NULL) + goto out; + + /* TODO: handle family */ + for (l = resolved_addresses; l != NULL; l = l->next) + { + GInetAddress *address = G_INET_ADDRESS (l->data); + GSocketAddress *socket_address; + GSocketAddress *effective_address; + + socket_address = g_inet_socket_address_new (address, port_num); + if (!g_socket_listener_add_address (server->listener, + socket_address, + G_SOCKET_TYPE_STREAM, + G_SOCKET_PROTOCOL_TCP, + NULL, /* GObject *source_object */ + &effective_address, + error)) + { + g_object_unref (socket_address); + goto out; + } + if (port_num == 0) + /* make sure we allocate the same port number for other listeners */ + port_num = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (effective_address)); + + g_object_unref (effective_address); + g_object_unref (socket_address); + } + + if (do_nonce) + { + gint fd; + guint n; + gsize bytes_written; + gsize bytes_remaining; + + server->nonce = g_new0 (guchar, 16); + for (n = 0; n < 16; n++) + server->nonce[n] = g_random_int_range (0, 256); + fd = g_file_open_tmp ("gdbus-nonce-file-XXXXXX", + &server->nonce_file, + error); + if (fd == -1) + { + g_socket_listener_close (server->listener); + goto out; + } + again: + bytes_written = 0; + bytes_remaining = 16; + while (bytes_remaining > 0) + { + gssize ret; + ret = write (fd, server->nonce + bytes_written, bytes_remaining); + if (ret == -1) + { + if (errno == EINTR) + goto again; + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error writing nonce file at `%s': %s"), + server->nonce_file, + strerror (errno)); + goto out; + } + bytes_written += ret; + bytes_remaining -= ret; + } + close (fd); + server->client_address = g_strdup_printf ("nonce-tcp:host=%s,port=%d,noncefile=%s", + host, + port_num, + server->nonce_file); + } + else + { + server->client_address = g_strdup_printf ("tcp:host=%s,port=%d", host, port_num); + } + server->is_using_listener = TRUE; + ret = TRUE; + + out: + g_list_foreach (resolved_addresses, (GFunc) g_object_unref, NULL); + g_list_free (resolved_addresses); + g_object_unref (resolver); + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusServer *server; + GDBusConnection *connection; +} EmitIdleData; + +static void +emit_idle_data_free (EmitIdleData *data) +{ + g_object_unref (data->server); + g_object_unref (data->connection); + g_free (data); +} + +static gboolean +emit_new_connection_in_idle (gpointer user_data) +{ + EmitIdleData *data = user_data; + gboolean claimed; + + claimed = FALSE; + g_signal_emit (data->server, + _signals[NEW_CONNECTION_SIGNAL], + 0, + data->connection, + &claimed); + + if (claimed) + g_dbus_connection_start_message_processing (data->connection); + g_object_unref (data->connection); + + return FALSE; +} + +/* Called in new thread */ +static gboolean +on_run (GSocketService *service, + GSocketConnection *socket_connection, + GObject *source_object, + gpointer user_data) +{ + GDBusServer *server = G_DBUS_SERVER (user_data); + GDBusConnection *connection; + GDBusConnectionFlags connection_flags; + + if (server->nonce != NULL) + { + gchar buf[16]; + gsize bytes_read; + + if (!g_input_stream_read_all (g_io_stream_get_input_stream (G_IO_STREAM (socket_connection)), + buf, + 16, + &bytes_read, + NULL, /* GCancellable */ + NULL)) /* GError */ + goto out; + + if (bytes_read != 16) + goto out; + + if (memcmp (buf, server->nonce, 16) != 0) + goto out; + } + + connection_flags = + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER | + G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING; + if (server->flags & G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS) + connection_flags |= G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS; + + connection = g_dbus_connection_new_sync (G_IO_STREAM (socket_connection), + server->guid, + connection_flags, + server->authentication_observer, + NULL, /* GCancellable */ + NULL); /* GError */ + if (connection == NULL) + goto out; + + if (server->flags & G_DBUS_SERVER_FLAGS_RUN_IN_THREAD) + { + g_signal_emit (server, + _signals[NEW_CONNECTION_SIGNAL], + 0, + connection); + g_dbus_connection_start_message_processing (connection); + g_object_unref (connection); + } + else + { + GSource *idle_source; + EmitIdleData *data; + + data = g_new0 (EmitIdleData, 1); + data->server = g_object_ref (server); + data->connection = g_object_ref (connection); + + idle_source = g_idle_source_new (); + g_source_set_priority (idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (idle_source, + emit_new_connection_in_idle, + data, + (GDestroyNotify) emit_idle_data_free); + g_source_attach (idle_source, server->main_context_at_construction); + g_source_unref (idle_source); + } + + out: + return TRUE; +} + +static gboolean +initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + GDBusServer *server = G_DBUS_SERVER (initable); + gboolean ret; + guint n; + gchar **addr_array; + GError *last_error; + + ret = FALSE; + addr_array = NULL; + last_error = NULL; + + if (!g_dbus_is_guid (server->guid)) + { + g_set_error (&last_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("The string `%s' is not a valid D-Bus GUID"), + server->guid); + goto out; + } + + server->listener = G_SOCKET_LISTENER (g_threaded_socket_service_new (-1)); + + addr_array = g_strsplit (server->address, ";", 0); + last_error = NULL; + for (n = 0; addr_array != NULL && addr_array[n] != NULL; n++) + { + const gchar *address_entry = addr_array[n]; + GHashTable *key_value_pairs; + gchar *transport_name; + GError *this_error; + + this_error = NULL; + if (g_dbus_is_supported_address (address_entry, + &this_error) && + _g_dbus_address_parse_entry (address_entry, + &transport_name, + &key_value_pairs, + &this_error)) + { + + if (FALSE) + { + } +#ifdef G_OS_UNIX + else if (g_strcmp0 (transport_name, "unix") == 0) + ret = try_unix (server, address_entry, key_value_pairs, &this_error); +#endif + else if (g_strcmp0 (transport_name, "tcp") == 0) + ret = try_tcp (server, address_entry, key_value_pairs, FALSE, &this_error); + else if (g_strcmp0 (transport_name, "nonce-tcp") == 0) + ret = try_tcp (server, address_entry, key_value_pairs, TRUE, &this_error); + else + g_set_error (&this_error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Cannot listen on unsupported transport `%s'"), + transport_name); + + g_free (transport_name); + if (key_value_pairs != NULL) + g_hash_table_unref (key_value_pairs); + + if (ret) + { + g_assert (this_error == NULL); + goto out; + } + } + + if (this_error != NULL) + { + if (last_error != NULL) + g_error_free (last_error); + last_error = this_error; + } + } + + if (!ret) + goto out; + + out: + + g_strfreev (addr_array); + + if (ret) + { + if (last_error != NULL) + g_error_free (last_error); + } + else + { + g_assert (last_error != NULL); + g_propagate_error (error, last_error); + } + return ret; +} + + +static void +initable_iface_init (GInitableIface *initable_iface) +{ + initable_iface->init = initable_init; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusserver.h b/gio/gdbusserver.h new file mode 100644 index 0000000..3d10c1b --- /dev/null +++ b/gio/gdbusserver.h @@ -0,0 +1,54 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_SERVER_H__ +#define __G_DBUS_SERVER_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DBUS_SERVER (g_dbus_server_get_type ()) +#define G_DBUS_SERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_SERVER, GDBusServer)) +#define G_IS_DBUS_SERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_SERVER)) + +GType g_dbus_server_get_type (void) G_GNUC_CONST; +GDBusServer *g_dbus_server_new_sync (const gchar *address, + GDBusServerFlags flags, + const gchar *guid, + GDBusAuthObserver *observer, + GCancellable *cancellable, + GError **error); +const gchar *g_dbus_server_get_client_address (GDBusServer *server); +const gchar *g_dbus_server_get_guid (GDBusServer *server); +GDBusServerFlags g_dbus_server_get_flags (GDBusServer *server); +void g_dbus_server_start (GDBusServer *server); +void g_dbus_server_stop (GDBusServer *server); +gboolean g_dbus_server_is_active (GDBusServer *server); + +G_END_DECLS + +#endif /* __G_DBUS_SERVER_H__ */ diff --git a/gio/gdbusutils.c b/gio/gdbusutils.c new file mode 100644 index 0000000..6ac9dfc --- /dev/null +++ b/gio/gdbusutils.c @@ -0,0 +1,357 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include "config.h" + +#include +#include + +#include "gdbusutils.h" + +#include "glibintl.h" + +/** + * SECTION:gdbusutils + * @title: D-Bus Utilities + * @short_description: Various utilities related to D-Bus. + * @include: gio/gio.h + * + * Various utility routines related to D-Bus. + */ + +static gboolean +is_valid_bus_name_character (gint c, + gboolean allow_hyphen) +{ + return + (c >= '0' && c <= '9') || + (c >= 'A' && c <= 'Z') || + (c >= 'a' && c <= 'z') || + (c == '_') || + (allow_hyphen && c == '-'); +} + +static gboolean +is_valid_initial_bus_name_character (gint c, + gboolean allow_initial_digit, + gboolean allow_hyphen) +{ + if (allow_initial_digit) + return is_valid_bus_name_character (c, allow_hyphen); + else + return + (c >= 'A' && c <= 'Z') || + (c >= 'a' && c <= 'z') || + (c == '_') || + (allow_hyphen && c == '-'); +} + +static gboolean +is_valid_name (const gchar *start, + guint len, + gboolean allow_initial_digit, + gboolean allow_hyphen) +{ + gboolean ret; + const gchar *s; + const gchar *end; + gboolean has_dot; + + ret = FALSE; + + if (len == 0) + goto out; + + s = start; + end = s + len; + has_dot = FALSE; + while (s != end) + { + if (*s == '.') + { + s += 1; + if (G_UNLIKELY (!is_valid_initial_bus_name_character (*s, allow_initial_digit, allow_hyphen))) + goto out; + has_dot = TRUE; + } + else if (G_UNLIKELY (!is_valid_bus_name_character (*s, allow_hyphen))) + { + goto out; + } + s += 1; + } + + if (G_UNLIKELY (!has_dot)) + goto out; + + ret = TRUE; + + out: + return ret; +} + +/** + * g_dbus_is_name: + * @string: The string to check. + * + * Checks if @string is a valid D-Bus bus name (either unique or well-known). + * + * Returns: %TRUE if valid, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_name (const gchar *string) +{ + guint len; + gboolean ret; + const gchar *s; + const gchar *end; + + g_return_val_if_fail (string != NULL, FALSE); + + ret = FALSE; + + len = strlen (string); + if (G_UNLIKELY (len == 0 || len > 255)) + goto out; + + s = string; + end = s + len; + if (*s == ':') + { + /* handle unique name */ + if (!is_valid_name (s + 1, len - 1, TRUE, TRUE)) + goto out; + ret = TRUE; + goto out; + } + else if (G_UNLIKELY (*s == '.')) + { + /* can't start with a . */ + goto out; + } + else if (G_UNLIKELY (!is_valid_initial_bus_name_character (*s, FALSE, TRUE))) + goto out; + + ret = is_valid_name (s + 1, len - 1, FALSE, TRUE); + + out: + return ret; +} + +/** + * g_dbus_is_unique_name: + * @string: The string to check. + * + * Checks if @string is a valid D-Bus unique bus name. + * + * Returns: %TRUE if valid, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_unique_name (const gchar *string) +{ + gboolean ret; + guint len; + + g_return_val_if_fail (string != NULL, FALSE); + + ret = FALSE; + + len = strlen (string); + if (G_UNLIKELY (len == 0 || len > 255)) + goto out; + + if (G_UNLIKELY (*string != ':')) + goto out; + + if (G_UNLIKELY (!is_valid_name (string + 1, len - 1, TRUE, TRUE))) + goto out; + + ret = TRUE; + + out: + return ret; +} + +/** + * g_dbus_is_member_name: + * @string: The string to check. + * + * Checks if @string is a valid D-Bus member (e.g. signal or method) name. + * + * Returns: %TRUE if valid, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_member_name (const gchar *string) +{ + gboolean ret; + guint n; + + ret = FALSE; + if (G_UNLIKELY (string == NULL)) + goto out; + + if (G_UNLIKELY (!is_valid_initial_bus_name_character (string[0], FALSE, FALSE))) + goto out; + + for (n = 1; string[n] != '\0'; n++) + { + if (G_UNLIKELY (!is_valid_bus_name_character (string[n], FALSE))) + { + goto out; + } + } + + ret = TRUE; + + out: + return ret; +} + +/** + * g_dbus_is_interface_name: + * @string: The string to check. + * + * Checks if @string is a valid D-Bus interface name. + * + * Returns: %TRUE if valid, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_interface_name (const gchar *string) +{ + guint len; + gboolean ret; + const gchar *s; + const gchar *end; + + g_return_val_if_fail (string != NULL, FALSE); + + ret = FALSE; + + len = strlen (string); + if (G_UNLIKELY (len == 0 || len > 255)) + goto out; + + s = string; + end = s + len; + if (G_UNLIKELY (*s == '.')) + { + /* can't start with a . */ + goto out; + } + else if (G_UNLIKELY (!is_valid_initial_bus_name_character (*s, FALSE, FALSE))) + goto out; + + ret = is_valid_name (s + 1, len - 1, FALSE, FALSE); + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* TODO: maybe move to glib? if so, it should conform to http://en.wikipedia.org/wiki/Guid and/or + * http://tools.ietf.org/html/rfc4122 - specifically it should have hyphens then. + */ + +/** + * g_dbus_generate_guid: + * + * Generate a D-Bus GUID that can be used with + * e.g. g_dbus_connection_new(). + * + * See the D-Bus specification regarding what strings are valid D-Bus + * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant). + * + * Returns: A valid D-Bus GUID. Free with g_free(). + * + * Since: 2.26 + */ +gchar * +g_dbus_generate_guid (void) +{ + GString *s; + GTimeVal now; + guint32 r1; + guint32 r2; + guint32 r3; + + s = g_string_new (NULL); + + r1 = g_random_int (); + r2 = g_random_int (); + r3 = g_random_int (); + g_get_current_time (&now); + + g_string_append_printf (s, "%08x", r1); + g_string_append_printf (s, "%08x", r2); + g_string_append_printf (s, "%08x", r3); + g_string_append_printf (s, "%08x", (guint32) now.tv_sec); + + return g_string_free (s, FALSE); +} + +/** + * g_dbus_is_guid: + * @string: The string to check. + * + * Checks if @string is a D-Bus GUID. + * + * See the D-Bus specification regarding what strings are valid D-Bus + * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant). + * + * Returns: %TRUE if @string is a guid, %FALSE otherwise. + * + * Since: 2.26 + */ +gboolean +g_dbus_is_guid (const gchar *string) +{ + gboolean ret; + guint n; + + g_return_val_if_fail (string != NULL, FALSE); + + ret = FALSE; + + for (n = 0; n < 32; n++) + { + if (!g_ascii_isxdigit (string[n])) + goto out; + } + if (string[32] != '\0') + goto out; + + ret = TRUE; + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/gdbusutils.h b/gio/gdbusutils.h new file mode 100644 index 0000000..b31dc75 --- /dev/null +++ b/gio/gdbusutils.h @@ -0,0 +1,44 @@ +/* GDBus - GLib D-Bus Library + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DBUS_UTILS_H__ +#define __G_DBUS_UTILS_H__ + +#include + +G_BEGIN_DECLS + +gboolean g_dbus_is_guid (const gchar *string); +gchar *g_dbus_generate_guid (void); + +gboolean g_dbus_is_name (const gchar *string); +gboolean g_dbus_is_unique_name (const gchar *string); +gboolean g_dbus_is_member_name (const gchar *string); +gboolean g_dbus_is_interface_name (const gchar *string); + +G_END_DECLS + +#endif /* __G_DBUS_UTILS_H__ */ diff --git a/gio/gdelayedsettingsbackend.c b/gio/gdelayedsettingsbackend.c new file mode 100644 index 0000000..dce1d7d --- /dev/null +++ b/gio/gdelayedsettingsbackend.c @@ -0,0 +1,485 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "config.h" + +#include "gdelayedsettingsbackend.h" +#include "gsettingsbackendinternal.h" + +#include + + +struct _GDelayedSettingsBackendPrivate +{ + GSettingsBackend *backend; + GStaticMutex lock; + GTree *delayed; + + GMainContext *owner_context; + gpointer owner; +}; + +G_DEFINE_TYPE (GDelayedSettingsBackend, + g_delayed_settings_backend, + G_TYPE_SETTINGS_BACKEND) + +static gboolean +invoke_notify_unapplied (gpointer data) +{ + g_object_notify (data, "has-unapplied"); + g_object_unref (data); + + return FALSE; +} + +static void +g_delayed_settings_backend_notify_unapplied (GDelayedSettingsBackend *delayed) +{ + GMainContext *target_context; + GObject *target; + + g_static_mutex_lock (&delayed->priv->lock); + if (delayed->priv->owner) + { + target_context = delayed->priv->owner_context; + target = g_object_ref (delayed->priv->owner); + } + else + { + target_context = NULL; + target = NULL; + } + g_static_mutex_unlock (&delayed->priv->lock); + + if (target != NULL) + g_main_context_invoke (target_context, invoke_notify_unapplied, target); +} + + +static GVariant * +g_delayed_settings_backend_read (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + gpointer result = NULL; + + if (!default_value) + { + g_static_mutex_lock (&delayed->priv->lock); + if (g_tree_lookup_extended (delayed->priv->delayed, key, NULL, &result)) + { + /* NULL in the tree means we should consult the default value */ + if (result != NULL) + g_variant_ref (result); + else + default_value = TRUE; + } + g_static_mutex_unlock (&delayed->priv->lock); + } + + if (result == NULL) + result = g_settings_backend_read (delayed->priv->backend, key, + expected_type, default_value); + + return result; +} + +static gboolean +g_delayed_settings_backend_write (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + gboolean was_empty; + + g_static_mutex_lock (&delayed->priv->lock); + was_empty = g_tree_nnodes (delayed->priv->delayed) == 0; + g_tree_insert (delayed->priv->delayed, g_strdup (key), + g_variant_ref_sink (value)); + g_static_mutex_unlock (&delayed->priv->lock); + + g_settings_backend_changed (backend, key, origin_tag); + + if (was_empty) + g_delayed_settings_backend_notify_unapplied (delayed); + + return TRUE; +} + +static gboolean +add_to_tree (gpointer key, + gpointer value, + gpointer user_data) +{ + g_tree_insert (user_data, g_strdup (key), g_variant_ref (value)); + return FALSE; +} + +static gboolean +g_delayed_settings_backend_write_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + gboolean was_empty; + + g_static_mutex_lock (&delayed->priv->lock); + was_empty = g_tree_nnodes (delayed->priv->delayed) == 0; + + g_tree_foreach (tree, add_to_tree, delayed->priv->delayed); + g_static_mutex_unlock (&delayed->priv->lock); + + g_settings_backend_changed_tree (backend, tree, origin_tag); + + if (was_empty) + g_delayed_settings_backend_notify_unapplied (delayed); + + return TRUE; +} + +static gboolean +g_delayed_settings_backend_get_writable (GSettingsBackend *backend, + const gchar *name) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + + return g_settings_backend_get_writable (delayed->priv->backend, name); +} + +static void +g_delayed_settings_backend_reset (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + gboolean was_empty; + + g_static_mutex_lock (&delayed->priv->lock); + was_empty = g_tree_nnodes (delayed->priv->delayed) == 0; + g_tree_insert (delayed->priv->delayed, g_strdup (key), NULL); + g_static_mutex_unlock (&delayed->priv->lock); + + if (was_empty) + g_delayed_settings_backend_notify_unapplied (delayed); +} + +static void +g_delayed_settings_backend_subscribe (GSettingsBackend *backend, + const char *name) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + + g_settings_backend_subscribe (delayed->priv->backend, name); +} + +static void +g_delayed_settings_backend_unsubscribe (GSettingsBackend *backend, + const char *name) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + + g_settings_backend_unsubscribe (delayed->priv->backend, name); +} + +static GPermission * +g_delayed_settings_backend_get_permission (GSettingsBackend *backend, + const gchar *path) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (backend); + + return g_settings_backend_get_permission (delayed->priv->backend, path); +} + + +/* method calls */ +gboolean +g_delayed_settings_backend_get_has_unapplied (GDelayedSettingsBackend *delayed) +{ + /* we don't need to lock for this... */ + + return g_tree_nnodes (delayed->priv->delayed) > 0; +} + +void +g_delayed_settings_backend_apply (GDelayedSettingsBackend *delayed) +{ + if (g_tree_nnodes (delayed->priv->delayed) > 0) + { + gboolean success; + GTree *tmp; + + g_static_mutex_lock (&delayed->priv->lock); + tmp = delayed->priv->delayed; + delayed->priv->delayed = g_settings_backend_create_tree (); + success = g_settings_backend_write_tree (delayed->priv->backend, + tmp, delayed->priv); + g_static_mutex_unlock (&delayed->priv->lock); + + if (!success) + g_settings_backend_changed_tree (G_SETTINGS_BACKEND (delayed), + tmp, NULL); + + g_tree_unref (tmp); + + g_delayed_settings_backend_notify_unapplied (delayed); + } +} + +void +g_delayed_settings_backend_revert (GDelayedSettingsBackend *delayed) +{ + if (g_tree_nnodes (delayed->priv->delayed) > 0) + { + GTree *tmp; + + g_static_mutex_lock (&delayed->priv->lock); + tmp = delayed->priv->delayed; + delayed->priv->delayed = g_settings_backend_create_tree (); + g_static_mutex_unlock (&delayed->priv->lock); + g_settings_backend_changed_tree (G_SETTINGS_BACKEND (delayed), tmp, NULL); + g_tree_unref (tmp); + + g_delayed_settings_backend_notify_unapplied (delayed); + } +} + +/* change notification */ +static void +delayed_backend_changed (GObject *target, + GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (target); + + if (origin_tag != delayed->priv) + g_settings_backend_changed (G_SETTINGS_BACKEND (delayed), + key, origin_tag); +} + +static void +delayed_backend_keys_changed (GObject *target, + GSettingsBackend *backend, + const gchar *path, + const gchar * const *items, + gpointer origin_tag) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (target); + + if (origin_tag != delayed->priv) + g_settings_backend_keys_changed (G_SETTINGS_BACKEND (delayed), + path, items, origin_tag); +} + +static void +delayed_backend_path_changed (GObject *target, + GSettingsBackend *backend, + const gchar *path, + gpointer origin_tag) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (target); + + if (origin_tag != delayed->priv) + g_settings_backend_path_changed (G_SETTINGS_BACKEND (delayed), + path, origin_tag); +} + +static void +delayed_backend_writable_changed (GObject *target, + GSettingsBackend *backend, + const gchar *key) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (target); + gboolean last_one = FALSE; + + g_static_mutex_lock (&delayed->priv->lock); + + if (g_tree_lookup (delayed->priv->delayed, key) && + !g_settings_backend_get_writable (delayed->priv->backend, key)) + { + /* drop the key from our changeset if it just became read-only. + * no need to signal since the writable change below implies it. + */ + g_tree_remove (delayed->priv->delayed, key); + + /* if that was the only key... */ + last_one = g_tree_nnodes (delayed->priv->delayed) == 0; + } + + g_static_mutex_unlock (&delayed->priv->lock); + + if (last_one) + g_delayed_settings_backend_notify_unapplied (delayed); + + g_settings_backend_writable_changed (G_SETTINGS_BACKEND (delayed), key); +} + +/* slow method until we get foreach-with-remove in GTree + */ +typedef struct +{ + const gchar *path; + const gchar **keys; + gsize index; +} CheckPrefixState; + +static gboolean +check_prefix (gpointer key, + gpointer value, + gpointer data) +{ + CheckPrefixState *state = data; + + if (g_str_has_prefix (key, state->path)) + state->keys[state->index++] = key; + + return FALSE; +} + +static void +delayed_backend_path_writable_changed (GObject *target, + GSettingsBackend *backend, + const gchar *path) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (target); + gboolean last_one = FALSE; + gsize n_keys; + + g_static_mutex_lock (&delayed->priv->lock); + + n_keys = g_tree_nnodes (delayed->priv->delayed); + + if (n_keys > 0) + { + CheckPrefixState state = { path, g_new (const gchar *, n_keys) }; + gsize i; + + /* collect a list of possibly-affected keys (ie: matching the path) */ + g_tree_foreach (delayed->priv->delayed, check_prefix, &state); + + /* drop the keys that have been affected */ + for (i = 0; i < state.index; i++) + if (!g_settings_backend_get_writable (delayed->priv->backend, + state.keys[i])) + g_tree_remove (delayed->priv->delayed, state.keys[i]); + + g_free (state.keys); + + last_one = g_tree_nnodes (delayed->priv->delayed) == 0; + } + + g_static_mutex_unlock (&delayed->priv->lock); + + if (last_one) + g_delayed_settings_backend_notify_unapplied (delayed); + + g_settings_backend_path_writable_changed (G_SETTINGS_BACKEND (delayed), + path); +} + +static void +g_delayed_settings_backend_finalize (GObject *object) +{ + GDelayedSettingsBackend *delayed = G_DELAYED_SETTINGS_BACKEND (object); + + g_static_mutex_free (&delayed->priv->lock); + g_object_unref (delayed->priv->backend); + g_tree_unref (delayed->priv->delayed); + + /* if our owner is still alive, why are we finalizing? */ + g_assert (delayed->priv->owner == NULL); + + G_OBJECT_CLASS (g_delayed_settings_backend_parent_class) + ->finalize (object); +} + +static void +g_delayed_settings_backend_class_init (GDelayedSettingsBackendClass *class) +{ + GSettingsBackendClass *backend_class = G_SETTINGS_BACKEND_CLASS (class); + GObjectClass *object_class = G_OBJECT_CLASS (class); + + g_type_class_add_private (class, sizeof (GDelayedSettingsBackendPrivate)); + + backend_class->read = g_delayed_settings_backend_read; + backend_class->write = g_delayed_settings_backend_write; + backend_class->write_tree = g_delayed_settings_backend_write_tree; + backend_class->reset = g_delayed_settings_backend_reset; + backend_class->get_writable = g_delayed_settings_backend_get_writable; + backend_class->subscribe = g_delayed_settings_backend_subscribe; + backend_class->unsubscribe = g_delayed_settings_backend_unsubscribe; + backend_class->get_permission = g_delayed_settings_backend_get_permission; + + object_class->finalize = g_delayed_settings_backend_finalize; +} + +static void +g_delayed_settings_backend_init (GDelayedSettingsBackend *delayed) +{ + delayed->priv = + G_TYPE_INSTANCE_GET_PRIVATE (delayed, G_TYPE_DELAYED_SETTINGS_BACKEND, + GDelayedSettingsBackendPrivate); + + delayed->priv->delayed = g_settings_backend_create_tree (); + g_static_mutex_init (&delayed->priv->lock); +} + +static void +g_delayed_settings_backend_disown (gpointer data, + GObject *where_the_object_was) +{ + GDelayedSettingsBackend *delayed = data; + + g_static_mutex_lock (&delayed->priv->lock); + delayed->priv->owner_context = NULL; + delayed->priv->owner = NULL; + g_static_mutex_unlock (&delayed->priv->lock); +} + +GDelayedSettingsBackend * +g_delayed_settings_backend_new (GSettingsBackend *backend, + gpointer owner, + GMainContext *owner_context) +{ + static GSettingsListenerVTable vtable = { + delayed_backend_changed, + delayed_backend_path_changed, + delayed_backend_keys_changed, + delayed_backend_writable_changed, + delayed_backend_path_writable_changed + }; + GDelayedSettingsBackend *delayed; + + delayed = g_object_new (G_TYPE_DELAYED_SETTINGS_BACKEND, NULL); + delayed->priv->backend = g_object_ref (backend); + delayed->priv->owner_context = owner_context; + delayed->priv->owner = owner; + + g_object_weak_ref (owner, g_delayed_settings_backend_disown, delayed); + + g_settings_backend_watch (delayed->priv->backend, + &vtable, G_OBJECT (delayed), NULL); + + return delayed; +} diff --git a/gio/gdelayedsettingsbackend.h b/gio/gdelayedsettingsbackend.h new file mode 100644 index 0000000..34ec3ef --- /dev/null +++ b/gio/gdelayedsettingsbackend.h @@ -0,0 +1,72 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#ifndef __G_DELAYED_SETTINGS_BACKEND_H__ +#define __G_DELAYED_SETTINGS_BACKEND_H__ + +#include + +#include + +#define G_TYPE_DELAYED_SETTINGS_BACKEND (g_delayed_settings_backend_get_type ()) +#define G_DELAYED_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_DELAYED_SETTINGS_BACKEND, \ + GDelayedSettingsBackend)) +#define G_DELAYED_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_DELAYED_SETTINGS_BACKEND, \ + GDelayedSettingsBackendClass)) +#define G_IS_DELAYED_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_DELAYED_SETTINGS_BACKEND)) +#define G_IS_DELAYED_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_DELAYED_SETTINGS_BACKEND)) +#define G_DELAYED_SETTINGS_BACKEND_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_DELAYED_SETTINGS_BACKEND, \ + GDelayedSettingsBackendClass)) + +typedef struct _GDelayedSettingsBackendPrivate GDelayedSettingsBackendPrivate; +typedef struct _GDelayedSettingsBackendClass GDelayedSettingsBackendClass; +typedef struct _GDelayedSettingsBackend GDelayedSettingsBackend; + +struct _GDelayedSettingsBackendClass +{ + GSettingsBackendClass parent_class; +}; + +struct _GDelayedSettingsBackend +{ + GSettingsBackend parent_instance; + GDelayedSettingsBackendPrivate *priv; +}; + +G_GNUC_INTERNAL +GType g_delayed_settings_backend_get_type (void); +G_GNUC_INTERNAL +GDelayedSettingsBackend * g_delayed_settings_backend_new (GSettingsBackend *backend, + gpointer owner, + GMainContext *owner_context); +G_GNUC_INTERNAL +void g_delayed_settings_backend_revert (GDelayedSettingsBackend *delayed); +G_GNUC_INTERNAL +void g_delayed_settings_backend_apply (GDelayedSettingsBackend *delayed); +G_GNUC_INTERNAL +gboolean g_delayed_settings_backend_get_has_unapplied (GDelayedSettingsBackend *delayed); + +#endif /* __G_DELAYED_SETTINGS_BACKEND_H__ */ diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 97ffee5..a9de892 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -32,6 +32,8 @@ #include #endif +#undef G_DISABLE_DEPRECATED + #include "gcontenttypeprivate.h" #include "gdesktopappinfo.h" #include "gfile.h" @@ -43,30 +45,32 @@ #include "giomodule-priv.h" #include "gappinfo.h" -#include "gioalias.h" /** * SECTION:gdesktopappinfo + * @title: GDesktopAppInfo * @short_description: Application information from desktop files - * @include: gio/gdesktopappinfo.h - * + * @include: gio/gdesktopappinfo.h + * * #GDesktopAppInfo is an implementation of #GAppInfo based on * desktop files. - * - * Note that <gio/gdesktopappinfo.h> belongs to - * the UNIX-specific GIO interfaces, thus you have to use the + * + * Note that <gio/gdesktopappinfo.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the * gio-unix-2.0.pc pkg-config file when using it. */ -#define DEFAULT_APPLICATIONS_GROUP "Default Applications" -#define ADDED_ASSOCIATIONS_GROUP "Added Associations" -#define REMOVED_ASSOCIATIONS_GROUP "Removed Associations" +#define DEFAULT_APPLICATIONS_GROUP "Default Applications" +#define ADDED_ASSOCIATIONS_GROUP "Added Associations" +#define REMOVED_ASSOCIATIONS_GROUP "Removed Associations" #define MIME_CACHE_GROUP "MIME Cache" #define FULL_NAME_KEY "X-GNOME-FullName" static void g_desktop_app_info_iface_init (GAppInfoIface *iface); static GList * get_all_desktop_entries_for_mime_type (const char *base_mime_type, - const char **except); + const char **except, + gboolean include_fallback, + char **explicit_default); static void mime_info_cache_reload (const char *dir); static gboolean g_desktop_app_info_ensure_saved (GDesktopAppInfo *info, GError **error); @@ -104,6 +108,14 @@ struct _GDesktopAppInfo /* FIXME: what about StartupWMClass ? */ }; +typedef enum { + UPDATE_MIME_NONE = 1 << 0, + UPDATE_MIME_SET_DEFAULT = 1 << 1, + UPDATE_MIME_SET_NON_DEFAULT = 1 << 2, + UPDATE_MIME_REMOVE = 1 << 3, + UPDATE_MIME_SET_LAST_USED = 1 << 4, +} UpdateMimeFlags; + G_DEFINE_TYPE_WITH_CODE (GDesktopAppInfo, g_desktop_app_info, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_APP_INFO, g_desktop_app_info_iface_init)) @@ -699,18 +711,28 @@ expand_macro (char macro, if (info->icon_name) { g_string_append (exec, "--icon "); - g_string_append (exec, info->icon_name); + expanded = g_shell_quote (info->icon_name); + g_string_append (exec, expanded); + g_free (expanded); } break; case 'c': if (info->name) - g_string_append (exec, info->name); + { + expanded = g_shell_quote (info->name); + g_string_append (exec, expanded); + g_free (expanded); + } break; case 'k': if (info->filename) - g_string_append (exec, info->filename); + { + expanded = g_shell_quote (info->filename); + g_string_append (exec, expanded); + g_free (expanded); + } break; case 'm': /* deprecated */ @@ -879,6 +901,7 @@ typedef struct { char *display; char *sn_id; + char *desktop_file; } ChildSetupData; static void @@ -891,6 +914,16 @@ child_setup (gpointer user_data) if (data->sn_id) g_setenv ("DESKTOP_STARTUP_ID", data->sn_id, TRUE); + + if (data->desktop_file) + { + gchar pid[20]; + + g_setenv ("GIO_LAUNCHED_DESKTOP_FILE", data->desktop_file, TRUE); + + g_snprintf (pid, 20, "%ld", (long)getpid ()); + g_setenv ("GIO_LAUNCHED_DESKTOP_FILE_PID", pid, TRUE); + } } static gboolean @@ -927,6 +960,7 @@ g_desktop_app_info_launch_uris (GAppInfo *appinfo, data.display = NULL; data.sn_id = NULL; + data.desktop_file = info->filename; if (launch_context) { @@ -1144,25 +1178,24 @@ ensure_dir (DirType type, static gboolean update_mimeapps_list (const char *desktop_id, - const char *content_type, - gboolean add_as_default, - gboolean add_non_default, - gboolean remove, + const char *content_type, + UpdateMimeFlags flags, GError **error) { - char *dirname, *filename; + char *dirname, *filename, *string; GKeyFile *key_file; - gboolean load_succeeded, res; + gboolean load_succeeded, res, explicit_default; char **old_list, **list; - GList *system_list, *l; + GList *system_list; gsize length, data_size; char *data; int i, j, k; char **content_types; /* Don't add both at start and end */ - g_assert (!(add_as_default && add_non_default)); - + g_assert (!((flags & UPDATE_MIME_SET_DEFAULT) && + (flags & UPDATE_MIME_SET_NON_DEFAULT))); + dirname = ensure_dir (APP_DIR, error); if (!dirname) return FALSE; @@ -1186,9 +1219,57 @@ update_mimeapps_list (const char *desktop_id, } else { - content_types = g_key_file_get_keys (key_file, ADDED_ASSOCIATIONS_GROUP, NULL, NULL); + content_types = g_key_file_get_keys (key_file, DEFAULT_APPLICATIONS_GROUP, NULL, NULL); + } + + explicit_default = FALSE; + + for (k = 0; content_types && content_types[k]; k++) + { + /* set as default, if requested so */ + string = g_key_file_get_string (key_file, + DEFAULT_APPLICATIONS_GROUP, + content_types[k], + NULL); + + if (g_strcmp0 (string, desktop_id) != 0 && + (flags & UPDATE_MIME_SET_DEFAULT)) + { + g_free (string); + string = g_strdup (desktop_id); + + /* add in the non-default list too, if it's not already there */ + flags |= UPDATE_MIME_SET_NON_DEFAULT; + } + + if (string == NULL || desktop_id == NULL) + g_key_file_remove_key (key_file, + DEFAULT_APPLICATIONS_GROUP, + content_types[k], + NULL); + else + { + g_key_file_set_string (key_file, + DEFAULT_APPLICATIONS_GROUP, + content_types[k], + string); + + explicit_default = TRUE; + } + + g_free (string); } + if (content_type) + { + /* reuse the list from above */ + } + else + { + g_strfreev (content_types); + content_types = g_key_file_get_keys (key_file, ADDED_ASSOCIATIONS_GROUP, NULL, NULL); + } + for (k = 0; content_types && content_types[k]; k++) { /* Add to the right place in the list */ @@ -1200,48 +1281,41 @@ update_mimeapps_list (const char *desktop_id, list = g_new (char *, 1 + length + 1); i = 0; - if (add_as_default) - list[i++] = g_strdup (desktop_id); + + /* if we're adding a last-used hint, just put the application in front of the list */ + if (flags & UPDATE_MIME_SET_LAST_USED) + { + /* avoid adding this again as non-default later */ + if (flags & UPDATE_MIME_SET_NON_DEFAULT) + flags ^= UPDATE_MIME_SET_NON_DEFAULT; + + list[i++] = g_strdup (desktop_id); + } + if (old_list) { for (j = 0; old_list[j] != NULL; j++) { if (g_strcmp0 (old_list[j], desktop_id) != 0) - list[i++] = g_strdup (old_list[j]); - else if (add_non_default) + { + /* rewrite other entries if they're different from the new one */ + list[i++] = g_strdup (old_list[j]); + } + else if (flags & UPDATE_MIME_SET_NON_DEFAULT) { - /* If adding as non-default, and it's already in, - don't change order of desktop ids */ - add_non_default = FALSE; + /* we encountered an old entry which is equal to the one we're adding as non-default, + * don't change its position in the list. + */ + flags ^= UPDATE_MIME_SET_NON_DEFAULT; list[i++] = g_strdup (old_list[j]); } } } - - if (add_non_default) - { - /* We're adding as non-default, and it wasn't already in the list, - so we add at the end. But to avoid listing the app before the - current system default (thus changing the default) we have to - add the current list of (not yet listed) apps before it. */ - list[i] = NULL; /* Terminate current list so we can use it */ - system_list = get_all_desktop_entries_for_mime_type (content_type, (const char **)list); - - list = g_renew (char *, list, 1 + length + g_list_length (system_list) + 1); - - for (l = system_list; l != NULL; l = l->next) - { - list[i++] = l->data; /* no strdup, taking ownership */ - if (g_strcmp0 (l->data, desktop_id) == 0) - add_non_default = FALSE; - } - g_list_free (system_list); - - if (add_non_default) - list[i++] = g_strdup (desktop_id); - } - + /* add it at the end of the list */ + if (flags & UPDATE_MIME_SET_NON_DEFAULT) + list[i++] = g_strdup (desktop_id); + list[i] = NULL; g_strfreev (old_list); @@ -1252,10 +1326,32 @@ update_mimeapps_list (const char *desktop_id, content_types[k], NULL); else - g_key_file_set_string_list (key_file, - ADDED_ASSOCIATIONS_GROUP, - content_types[k], - (const char * const *)list, i); + { + g_key_file_set_string_list (key_file, + ADDED_ASSOCIATIONS_GROUP, + content_types[k], + (const char * const *)list, i); + + /* if we had no explicit default set, we should add the system default to the + * list, to avoid overriding it with applications from this list. + */ + if (!explicit_default) + { + system_list = get_all_desktop_entries_for_mime_type (content_type, (const char **) list, FALSE, NULL); + + if (system_list != NULL) + { + string = system_list->data; + + g_key_file_set_string (key_file, + DEFAULT_APPLICATIONS_GROUP, + content_types[k], + string); + } + + g_list_free_full (system_list, g_free); + } + } g_strfreev (list); } @@ -1281,7 +1377,7 @@ update_mimeapps_list (const char *desktop_id, list = g_new (char *, 1 + length + 1); i = 0; - if (remove) + if (flags & UPDATE_MIME_REMOVE) list[i++] = g_strdup (desktop_id); if (old_list) { @@ -1308,7 +1404,7 @@ update_mimeapps_list (const char *desktop_id, g_strfreev (list); } - + g_strfreev (content_types); data = g_key_file_to_data (key_file, &data_size, error); @@ -1325,6 +1421,23 @@ update_mimeapps_list (const char *desktop_id, } static gboolean +g_desktop_app_info_set_as_last_used_for_type (GAppInfo *appinfo, + const char *content_type, + GError **error) +{ + GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo); + + if (!g_desktop_app_info_ensure_saved (info, error)) + return FALSE; + + /* both add support for the content type and set as last used */ + return update_mimeapps_list (info->desktop_id, content_type, + UPDATE_MIME_SET_NON_DEFAULT | + UPDATE_MIME_SET_LAST_USED, + error); +} + +static gboolean g_desktop_app_info_set_as_default_for_type (GAppInfo *appinfo, const char *content_type, GError **error) @@ -1334,7 +1447,9 @@ g_desktop_app_info_set_as_default_for_type (GAppInfo *appinfo, if (!g_desktop_app_info_ensure_saved (info, error)) return FALSE; - return update_mimeapps_list (info->desktop_id, content_type, TRUE, FALSE, FALSE, error); + return update_mimeapps_list (info->desktop_id, content_type, + UPDATE_MIME_SET_DEFAULT, + error); } static void @@ -1451,7 +1566,9 @@ g_desktop_app_info_add_supports_type (GAppInfo *appinfo, if (!g_desktop_app_info_ensure_saved (G_DESKTOP_APP_INFO (info), error)) return FALSE; - return update_mimeapps_list (info->desktop_id, content_type, FALSE, TRUE, FALSE, error); + return update_mimeapps_list (info->desktop_id, content_type, + UPDATE_MIME_SET_NON_DEFAULT, + error); } static gboolean @@ -1470,7 +1587,9 @@ g_desktop_app_info_remove_supports_type (GAppInfo *appinfo, if (!g_desktop_app_info_ensure_saved (G_DESKTOP_APP_INFO (info), error)) return FALSE; - return update_mimeapps_list (info->desktop_id, content_type, FALSE, FALSE, TRUE, error); + return update_mimeapps_list (info->desktop_id, content_type, + UPDATE_MIME_REMOVE, + error); } static gboolean @@ -1591,7 +1710,9 @@ g_desktop_app_info_delete (GAppInfo *appinfo) { if (g_remove (info->filename) == 0) { - update_mimeapps_list (info->desktop_id, NULL, FALSE, FALSE, FALSE, NULL); + update_mimeapps_list (info->desktop_id, NULL, + UPDATE_MIME_NONE, + NULL); g_free (info->filename); info->filename = NULL; @@ -1608,13 +1729,13 @@ g_desktop_app_info_delete (GAppInfo *appinfo) /** * g_app_info_create_from_commandline: * @commandline: the commandline to use - * @application_name: the application name, or %NULL to use @commandline + * @application_name: (allow-none): the application name, or %NULL to use @commandline * @flags: flags that can specify details of the created #GAppInfo * @error: a #GError location to store the error occuring, %NULL to ignore. * * Creates a new #GAppInfo from the given information. * - * Returns: new #GAppInfo for given command. + * Returns: (transfer full): new #GAppInfo for given command. **/ GAppInfo * g_app_info_create_from_commandline (const char *commandline, @@ -1634,7 +1755,7 @@ g_app_info_create_from_commandline (const char *commandline, info->desktop_id = NULL; info->terminal = flags & G_APP_INFO_CREATE_NEEDS_TERMINAL; - info->startup_notify = FALSE; + info->startup_notify = flags & G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION; info->hidden = FALSE; if (flags & G_APP_INFO_CREATE_SUPPORTS_URIS) info->exec = g_strconcat (commandline, " %u", NULL); @@ -1684,6 +1805,7 @@ g_desktop_app_info_iface_init (GAppInfoIface *iface) iface->do_delete = g_desktop_app_info_delete; iface->get_commandline = g_desktop_app_info_get_commandline; iface->get_display_name = g_desktop_app_info_get_display_name; + iface->set_as_last_used_for_type = g_desktop_app_info_set_as_last_used_for_type; } static gboolean @@ -1699,28 +1821,135 @@ app_info_in_list (GAppInfo *info, return FALSE; } +/** + * g_app_info_get_recommended_for_type: + * @content_type: the content type to find a #GAppInfo for + * + * Gets a list of recommended #GAppInfos for a given content type, i.e. + * those applications which claim to support the given content type exactly, + * and not by MIME type subclassing. + * Note that the first application of the list is the last used one, i.e. + * the last one for which #g_app_info_set_as_last_used_for_type has been + * called. + * + * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos + * for given @content_type or %NULL on error. + * + * Since: 2.28 + **/ +GList * +g_app_info_get_recommended_for_type (const gchar *content_type) +{ + GList *desktop_entries, *l; + GList *infos; + GDesktopAppInfo *info; + + g_return_val_if_fail (content_type != NULL, NULL); + + desktop_entries = get_all_desktop_entries_for_mime_type (content_type, NULL, FALSE, NULL); + + infos = NULL; + for (l = desktop_entries; l != NULL; l = l->next) + { + char *desktop_entry = l->data; + + info = g_desktop_app_info_new (desktop_entry); + if (info) + { + if (app_info_in_list (G_APP_INFO (info), infos)) + g_object_unref (info); + else + infos = g_list_prepend (infos, info); + } + g_free (desktop_entry); + } + + g_list_free (desktop_entries); + + return g_list_reverse (infos); +} + +/** + * g_app_info_get_fallback_for_type: + * @content_type: the content type to find a #GAppInfo for + * + * Gets a list of fallback #GAppInfos for a given content type, i.e. + * those applications which claim to support the given content type + * by MIME type subclassing and not directly. + * + * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos + * for given @content_type or %NULL on error. + * + * Since: 2.28 + **/ +GList * +g_app_info_get_fallback_for_type (const gchar *content_type) +{ + GList *desktop_entries, *l; + GList *infos, *recommended_infos; + GDesktopAppInfo *info; + + g_return_val_if_fail (content_type != NULL, NULL); + + desktop_entries = get_all_desktop_entries_for_mime_type (content_type, NULL, TRUE, NULL); + recommended_infos = g_app_info_get_recommended_for_type (content_type); + + infos = NULL; + for (l = desktop_entries; l != NULL; l = l->next) + { + char *desktop_entry = l->data; + + info = g_desktop_app_info_new (desktop_entry); + if (info) + { + if (app_info_in_list (G_APP_INFO (info), infos) || + app_info_in_list (G_APP_INFO (info), recommended_infos)) + g_object_unref (info); + else + infos = g_list_prepend (infos, info); + } + g_free (desktop_entry); + } + + g_list_free (desktop_entries); + g_list_free_full (recommended_infos, g_object_unref); + + return g_list_reverse (infos); +} /** * g_app_info_get_all_for_type: * @content_type: the content type to find a #GAppInfo for * - * Gets a list of all #GAppInfos for a given content type. + * Gets a list of all #GAppInfos for a given content type. * - * Returns: #GList of #GAppInfos for given @content_type - * or %NULL on error. + * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos + * for given @content_type or %NULL on error. **/ GList * g_app_info_get_all_for_type (const char *content_type) { GList *desktop_entries, *l; GList *infos; + char *user_default = NULL; GDesktopAppInfo *info; g_return_val_if_fail (content_type != NULL, NULL); - desktop_entries = get_all_desktop_entries_for_mime_type (content_type, NULL); - + desktop_entries = get_all_desktop_entries_for_mime_type (content_type, NULL, TRUE, &user_default); infos = NULL; + + /* put the user default in front of the list, for compatibility */ + if (user_default != NULL) + { + info = g_desktop_app_info_new (user_default); + + if (info != NULL) + infos = g_list_prepend (infos, info); + } + + g_free (user_default); + for (l = desktop_entries; l != NULL; l = l->next) { char *desktop_entry = l->data; @@ -1755,7 +1984,9 @@ g_app_info_get_all_for_type (const char *content_type) void g_app_info_reset_type_associations (const char *content_type) { - update_mimeapps_list (NULL, content_type, FALSE, FALSE, FALSE, NULL); + update_mimeapps_list (NULL, content_type, + UPDATE_MIME_NONE, + NULL); } /** @@ -1773,13 +2004,40 @@ g_app_info_get_default_for_type (const char *content_type, gboolean must_support_uris) { GList *desktop_entries, *l; + char *user_default = NULL; GAppInfo *info; g_return_val_if_fail (content_type != NULL, NULL); - desktop_entries = get_all_desktop_entries_for_mime_type (content_type, NULL); + desktop_entries = get_all_desktop_entries_for_mime_type (content_type, NULL, TRUE, &user_default); info = NULL; + + if (user_default != NULL) + { + info = (GAppInfo *) g_desktop_app_info_new (user_default); + + if (info) + { + if (must_support_uris && !g_app_info_supports_uris (info)) + { + g_object_unref (info); + info = NULL; + } + } + } + + g_free (user_default); + + if (info != NULL) + { + g_list_free_full (desktop_entries, g_free); + return info; + } + + /* pick the first from the other list that matches our URI + * requirements. + */ for (l = desktop_entries; l != NULL; l = l->next) { char *desktop_entry = l->data; @@ -1797,9 +2055,8 @@ g_app_info_get_default_for_type (const char *content_type, } } - g_list_foreach (desktop_entries, (GFunc)g_free, NULL); - g_list_free (desktop_entries); - + g_list_free_full (desktop_entries, g_free); + return info; } @@ -1817,57 +2074,18 @@ g_app_info_get_default_for_type (const char *content_type, GAppInfo * g_app_info_get_default_for_uri_scheme (const char *uri_scheme) { - static gsize lookup = 0; - - if (g_once_init_enter (&lookup)) - { - gsize setup_value = 1; - GDesktopAppInfoLookup *lookup_instance; - const char *use_this; - GIOExtensionPoint *ep; - GIOExtension *extension; - GList *l; - - use_this = g_getenv ("GIO_USE_URI_ASSOCIATION"); - - /* Ensure vfs in modules loaded */ - _g_io_modules_ensure_loaded (); - - ep = g_io_extension_point_lookup (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME); - - lookup_instance = NULL; - if (use_this) - { - extension = g_io_extension_point_get_extension_by_name (ep, use_this); - if (extension) - lookup_instance = g_object_new (g_io_extension_get_type (extension), NULL); - } - - if (lookup_instance == NULL) - { - for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next) - { - extension = l->data; - lookup_instance = g_object_new (g_io_extension_get_type (extension), NULL); - if (lookup_instance != NULL) - break; - } - } - - if (lookup_instance != NULL) - setup_value = (gsize)lookup_instance; - - g_once_init_leave (&lookup, setup_value); - } + GAppInfo *app_info; + char *content_type, *scheme_down; - if (lookup == 1) - return NULL; + scheme_down = g_ascii_strdown (uri_scheme, -1); + content_type = g_strdup_printf ("x-scheme-handler/%s", scheme_down); + g_free (scheme_down); + app_info = g_app_info_get_default_for_type (content_type, FALSE); + g_free (content_type); - return g_desktop_app_info_lookup_get_default_for_uri_scheme (G_DESKTOP_APP_INFO_LOOKUP (lookup), - uri_scheme); + return app_info; } - static void get_apps_from_dir (GHashTable *apps, const char *dirname, @@ -1945,7 +2163,7 @@ get_apps_from_dir (GHashTable *apps, * The returned list does not include applications which have * the Hidden key set. * - * Returns: a newly allocated #GList of references to #GAppInfos. + * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfos. **/ GList * g_app_info_get_all (void) @@ -1988,6 +2206,7 @@ typedef struct { GHashTable *defaults_list_map; GHashTable *mimeapps_list_added_map; GHashTable *mimeapps_list_removed_map; + GHashTable *mimeapps_list_defaults_map; time_t mime_info_cache_timestamp; time_t defaults_list_timestamp; time_t mimeapps_list_timestamp; @@ -2240,6 +2459,7 @@ mime_info_cache_dir_init_mimeapps_list (MimeInfoCacheDir *dir) gchar *filename, **mime_types; char *unaliased_type; char **desktop_file_ids; + char *desktop_id; int i; struct stat buf; @@ -2261,6 +2481,11 @@ mime_info_cache_dir_init_mimeapps_list (MimeInfoCacheDir *dir) dir->mimeapps_list_removed_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_strfreev); + if (dir->mimeapps_list_defaults_map != NULL) + g_hash_table_destroy (dir->mimeapps_list_defaults_map); + dir->mimeapps_list_defaults_map = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, g_free); + key_file = g_key_file_new (); filename = g_build_filename (dir->path, "mimeapps.list", NULL); @@ -2325,6 +2550,28 @@ mime_info_cache_dir_init_mimeapps_list (MimeInfoCacheDir *dir) g_strfreev (mime_types); } + mime_types = g_key_file_get_keys (key_file, DEFAULT_APPLICATIONS_GROUP, + NULL, NULL); + if (mime_types != NULL) + { + for (i = 0; mime_types[i] != NULL; i++) + { + desktop_id = g_key_file_get_string (key_file, + DEFAULT_APPLICATIONS_GROUP, + mime_types[i], + NULL); + if (desktop_id == NULL) + continue; + + unaliased_type = _g_unix_content_type_unalias (mime_types[i]); + g_hash_table_replace (dir->mimeapps_list_defaults_map, + unaliased_type, + desktop_id); + } + + g_strfreev (mime_types); + } + g_key_file_free (key_file); return; @@ -2380,7 +2627,13 @@ mime_info_cache_dir_free (MimeInfoCacheDir *dir) g_hash_table_destroy (dir->mimeapps_list_removed_map); dir->mimeapps_list_removed_map = NULL; } - + + if (dir->mimeapps_list_defaults_map != NULL) + { + g_hash_table_destroy (dir->mimeapps_list_defaults_map); + dir->mimeapps_list_defaults_map = NULL; + } + g_free (dir); } @@ -2557,12 +2810,15 @@ append_desktop_entry (GList *list, * to handle @mime_type. */ static GList * -get_all_desktop_entries_for_mime_type (const char *base_mime_type, - const char **except) +get_all_desktop_entries_for_mime_type (const char *base_mime_type, + const char **except, + gboolean include_fallback, + char **explicit_default) { GList *desktop_entries, *removed_entries, *list, *dir_list, *tmp; MimeInfoCacheDir *dir; - char *mime_type; + char *mime_type, *default_entry = NULL; + const char *entry; char **mime_types; char **default_entries; char **removed_associations; @@ -2572,29 +2828,38 @@ get_all_desktop_entries_for_mime_type (const char *base_mime_type, mime_info_cache_init (); - /* collect all ancestors */ - mime_types = _g_unix_content_type_get_parents (base_mime_type); - array = g_ptr_array_new (); - for (i = 0; mime_types[i]; i++) - g_ptr_array_add (array, mime_types[i]); - g_free (mime_types); - for (i = 0; i < array->len; i++) + if (include_fallback) { - anc = _g_unix_content_type_get_parents (g_ptr_array_index (array, i)); - for (j = 0; anc[j]; j++) - { - for (k = 0; k < array->len; k++) - { - if (strcmp (anc[j], g_ptr_array_index (array, k)) == 0) - break; - } - if (k == array->len) /* not found */ - g_ptr_array_add (array, g_strdup (anc[j])); - } - g_strfreev (anc); + /* collect all ancestors */ + mime_types = _g_unix_content_type_get_parents (base_mime_type); + array = g_ptr_array_new (); + for (i = 0; mime_types[i]; i++) + g_ptr_array_add (array, mime_types[i]); + g_free (mime_types); + for (i = 0; i < array->len; i++) + { + anc = _g_unix_content_type_get_parents (g_ptr_array_index (array, i)); + for (j = 0; anc[j]; j++) + { + for (k = 0; k < array->len; k++) + { + if (strcmp (anc[j], g_ptr_array_index (array, k)) == 0) + break; + } + if (k == array->len) /* not found */ + g_ptr_array_add (array, g_strdup (anc[j])); + } + g_strfreev (anc); + } + g_ptr_array_add (array, NULL); + mime_types = (char **)g_ptr_array_free (array, FALSE); + } + else + { + mime_types = g_malloc0 (2 * sizeof (gchar *)); + mime_types[0] = g_strdup (base_mime_type); + mime_types[1] = NULL; } - g_ptr_array_add (array, NULL); - mime_types = (char **)g_ptr_array_free (array, FALSE); G_LOCK (mime_info_cache); @@ -2608,17 +2873,27 @@ get_all_desktop_entries_for_mime_type (const char *base_mime_type, { mime_type = mime_types[i]; - /* Go through all apps listed as defaults */ + /* Go through all apps listed in user and system dirs */ for (dir_list = mime_info_cache->dirs; dir_list != NULL; dir_list = dir_list->next) { dir = dir_list->data; - /* First added associations from mimeapps.list */ + /* Pick the explicit default application */ + entry = g_hash_table_lookup (dir->mimeapps_list_defaults_map, mime_type); + + if (entry != NULL) + { + /* Save the default entry if it's the first one we encounter */ + if (default_entry == NULL) + default_entry = g_strdup (entry); + } + + /* Then added associations from mimeapps.list */ default_entries = g_hash_table_lookup (dir->mimeapps_list_added_map, mime_type); for (j = 0; default_entries != NULL && default_entries[j] != NULL; j++) - desktop_entries = append_desktop_entry (desktop_entries, default_entries[j], removed_entries); + desktop_entries = append_desktop_entry (desktop_entries, default_entries[j], removed_entries); /* Then removed associations from mimeapps.list */ removed_associations = g_hash_table_lookup (dir->mimeapps_list_removed_map, mime_type); @@ -2648,9 +2923,14 @@ get_all_desktop_entries_for_mime_type (const char *base_mime_type, g_strfreev (mime_types); + if (explicit_default != NULL) + *explicit_default = default_entry; + else + g_free (default_entry); + g_list_foreach (removed_entries, (GFunc)g_free, NULL); g_list_free (removed_entries); - + desktop_entries = g_list_reverse (desktop_entries); return desktop_entries; @@ -2680,7 +2960,9 @@ g_desktop_app_info_lookup_default_init (GDesktopAppInfoLookupInterface *iface) * in a GIO module. There is no reason for applications to use it * directly. Applications should use g_app_info_get_default_for_uri_scheme(). * - * Returns: #GAppInfo for given @uri_scheme or %NULL on error. + * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error. + * + * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio. */ GAppInfo * g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup, @@ -2694,6 +2976,3 @@ g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *loo return (* iface->get_default_for_uri_scheme) (lookup, uri_scheme); } - -#define __G_DESKTOP_APP_INFO_C__ -#include "gioaliasdef.c" diff --git a/gio/gdesktopappinfo.h b/gio/gdesktopappinfo.h index 48c9693..6be9369 100644 --- a/gio/gdesktopappinfo.h +++ b/gio/gdesktopappinfo.h @@ -56,6 +56,8 @@ gboolean g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info); void g_desktop_app_info_set_desktop_env (const char *desktop_env); +#ifndef G_DISABLE_DEPRECATED + #define G_TYPE_DESKTOP_APP_INFO_LOOKUP (g_desktop_app_info_lookup_get_type ()) #define G_DESKTOP_APP_INFO_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP, GDesktopAppInfoLookup)) #define G_IS_DESKTOP_APP_INFO_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP)) @@ -91,6 +93,8 @@ GType g_desktop_app_info_lookup_get_type (void) G_GNUC_CON GAppInfo *g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup, const char *uri_scheme); +#endif /* G_DISABLE_DEPRECATED */ + G_END_DECLS #endif /* __G_DESKTOP_APP_INFO_H__ */ diff --git a/gio/gdrive.c b/gio/gdrive.c index 4a45dff..5d6efdc 100644 --- a/gio/gdrive.c +++ b/gio/gdrive.c @@ -28,7 +28,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gdrive @@ -160,7 +159,7 @@ g_drive_get_name (GDrive *drive) * * Gets the icon for @drive. * - * Returns: #GIcon for the @drive. + * Returns: (transfer full): #GIcon for the @drive. * Free the returned object with g_object_unref(). **/ GIcon * @@ -204,7 +203,7 @@ g_drive_has_volumes (GDrive *drive) * The returned list should be freed with g_list_free(), after * its elements have been unreffed with g_object_unref(). * - * Returns: #GList containing any #GVolume objects on the given @drive. + * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive. **/ GList * g_drive_get_volumes (GDrive *drive) @@ -595,7 +594,7 @@ g_drive_get_identifier (GDrive *drive, * Use g_drive_get_identifer() to obtain the identifiers * themselves. * - * Returns: a %NULL-terminated array of strings containing + * Returns: (transfer full): a %NULL-terminated array of strings containing * kinds of identifiers. Use g_strfreev() to free. */ char ** @@ -866,6 +865,3 @@ g_drive_stop_finish (GDrive *drive, return (* iface->stop_finish) (drive, result, error); } - -#define __G_DRIVE_C__ -#include "gioaliasdef.c" diff --git a/gio/gdummyfile.c b/gio/gdummyfile.c index 3e28b47..4546e3c 100644 --- a/gio/gdummyfile.c +++ b/gio/gdummyfile.c @@ -35,7 +35,6 @@ #include "gdummyfile.h" #include "gfile.h" -#include "gioalias.h" static void g_dummy_file_file_iface_init (GFileIface *iface); diff --git a/gio/gdummyproxyresolver.c b/gio/gdummyproxyresolver.c new file mode 100644 index 0000000..e3ba2b5 --- /dev/null +++ b/gio/gdummyproxyresolver.c @@ -0,0 +1,155 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#include "config.h" + +#include "gdummyproxyresolver.h" + +#include + +#include "gasyncresult.h" +#include "gcancellable.h" +#include "gproxyresolver.h" +#include "gsimpleasyncresult.h" + +#include "giomodule.h" +#include "giomodule-priv.h" + +struct _GDummyProxyResolver { + GObject parent_instance; +}; + +static void g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface); + +#define g_dummy_proxy_resolver_get_type _g_dummy_proxy_resolver_get_type +G_DEFINE_TYPE_WITH_CODE (GDummyProxyResolver, g_dummy_proxy_resolver, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_PROXY_RESOLVER, + g_dummy_proxy_resolver_iface_init) + _g_io_modules_ensure_extension_points_registered (); + g_io_extension_point_implement (G_PROXY_RESOLVER_EXTENSION_POINT_NAME, + g_define_type_id, + "dummy", + -100)) + +static void +g_dummy_proxy_resolver_finalize (GObject *object) +{ + /* must chain up */ + G_OBJECT_CLASS (g_dummy_proxy_resolver_parent_class)->finalize (object); +} + +static void +g_dummy_proxy_resolver_init (GDummyProxyResolver *resolver) +{ +} + +static gboolean +g_dummy_proxy_resolver_is_supported (GProxyResolver *resolver) +{ + return TRUE; +} + +static gchar ** +g_dummy_proxy_resolver_lookup (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GError **error) +{ + gchar **proxies; + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return NULL; + + proxies = g_new0 (gchar *, 2); + proxies[0] = g_strdup ("direct://"); + + return proxies; +} + +static void +g_dummy_proxy_resolver_lookup_async (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GError *error = NULL; + GSimpleAsyncResult *simple; + gchar **proxies; + + proxies = g_dummy_proxy_resolver_lookup (resolver, uri, cancellable, &error); + + + simple = g_simple_async_result_new (G_OBJECT (resolver), + callback, user_data, + g_dummy_proxy_resolver_lookup_async); + + if (proxies == NULL) + { + g_simple_async_result_take_error (simple, error); + } + else + { + g_simple_async_result_set_op_res_gpointer (simple, + proxies, + NULL); + } + + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); +} + +static gchar ** +g_dummy_proxy_resolver_lookup_finish (GProxyResolver *resolver, + GAsyncResult *result, + GError **error) +{ + if (G_IS_SIMPLE_ASYNC_RESULT (result)) + { + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); + + if (g_simple_async_result_propagate_error (simple, error)) + return NULL; + + return g_simple_async_result_get_op_res_gpointer (simple); + } + + return NULL; +} + +static void +g_dummy_proxy_resolver_class_init (GDummyProxyResolverClass *resolver_class) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (resolver_class); + object_class->finalize = g_dummy_proxy_resolver_finalize; +} + +static void +g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface) +{ + iface->is_supported = g_dummy_proxy_resolver_is_supported; + iface->lookup = g_dummy_proxy_resolver_lookup; + iface->lookup_async = g_dummy_proxy_resolver_lookup_async; + iface->lookup_finish = g_dummy_proxy_resolver_lookup_finish; +} diff --git a/gio/gdummyproxyresolver.h b/gio/gdummyproxyresolver.h new file mode 100644 index 0000000..75bab7b --- /dev/null +++ b/gio/gdummyproxyresolver.h @@ -0,0 +1,54 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DUMMY_PROXY_RESOLVER_H__ +#define __G_DUMMY_PROXY_RESOLVER_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DUMMY_PROXY_RESOLVER (_g_dummy_proxy_resolver_get_type ()) +#define G_DUMMY_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DUMMY_PROXY_RESOLVER, GDummyProxyResolver)) +#define G_DUMMY_PROXY_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DUMMY_PROXY_RESOLVER, GDummyProxyResolverClass)) +#define G_IS_DUMMY_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DUMMY_PROXY_RESOLVER)) +#define G_IS_DUMMY_PROXY_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DUMMY_PROXY_RESOLVER)) +#define G_DUMMY_PROXY_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DUMMY_PROXY_RESOLVER, GDummyProxyResolverClass)) + +typedef struct _GDummyProxyResolver GDummyProxyResolver; +typedef struct _GDummyProxyResolverClass GDummyProxyResolverClass; + + +struct _GDummyProxyResolverClass { + GObjectClass parent_class; +}; + +GType _g_dummy_proxy_resolver_get_type (void); + + +G_END_DECLS + +#endif /* __G_DUMMY_PROXY_RESOLVER_H__ */ diff --git a/gio/gdummytlsbackend.c b/gio/gdummytlsbackend.c new file mode 100644 index 0000000..0202f27 --- /dev/null +++ b/gio/gdummytlsbackend.c @@ -0,0 +1,277 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gdummytlsbackend.h" + +#include + +#include "gasyncresult.h" +#include "gcancellable.h" +#include "ginitable.h" +#include "gtlsbackend.h" +#include "gtlscertificate.h" +#include "gtlsclientconnection.h" +#include "gtlsserverconnection.h" +#include "gsimpleasyncresult.h" + +#include "giomodule.h" +#include "giomodule-priv.h" + +#include "glibintl.h" + +static GType _g_dummy_tls_certificate_get_type (void); +static GType _g_dummy_tls_connection_get_type (void); + +struct _GDummyTlsBackend { + GObject parent_instance; +}; + +static void g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface); + +#define g_dummy_tls_backend_get_type _g_dummy_tls_backend_get_type +G_DEFINE_TYPE_WITH_CODE (GDummyTlsBackend, g_dummy_tls_backend, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_TLS_BACKEND, + g_dummy_tls_backend_iface_init) + _g_io_modules_ensure_extension_points_registered (); + g_io_extension_point_implement (G_TLS_BACKEND_EXTENSION_POINT_NAME, + g_define_type_id, + "dummy", + -100)) + +static void +g_dummy_tls_backend_init (GDummyTlsBackend *backend) +{ +} + +static void +g_dummy_tls_backend_class_init (GDummyTlsBackendClass *backend_class) +{ +} + +static void +g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface) +{ + iface->get_certificate_type = _g_dummy_tls_certificate_get_type; + iface->get_client_connection_type = _g_dummy_tls_connection_get_type; + iface->get_server_connection_type = _g_dummy_tls_connection_get_type; +} + +/* Dummy certificate type */ + +typedef struct _GDummyTlsCertificate GDummyTlsCertificate; +typedef struct _GDummyTlsCertificateClass GDummyTlsCertificateClass; + +struct _GDummyTlsCertificate { + GTlsCertificate parent_instance; +}; + +struct _GDummyTlsCertificateClass { + GTlsCertificateClass parent_class; +}; + +enum +{ + PROP_CERTIFICATE_0, + + PROP_CERTIFICATE, + PROP_CERTIFICATE_PEM, + PROP_PRIVATE_KEY, + PROP_PRIVATE_KEY_PEM, + PROP_ISSUER +}; + +static void g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface); + +#define g_dummy_tls_certificate_get_type _g_dummy_tls_certificate_get_type +G_DEFINE_TYPE_WITH_CODE (GDummyTlsCertificate, g_dummy_tls_certificate, G_TYPE_TLS_CERTIFICATE, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, + g_dummy_tls_certificate_initable_iface_init);) + +static void +g_dummy_tls_certificate_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + /* We need to define this method to make GObject happy, but it will + * never be possible to construct a working GDummyTlsCertificate, so + * it doesn't have to do anything useful. + */ +} + +static void +g_dummy_tls_certificate_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + /* Just ignore all attempts to set properties. */ +} + +static void +g_dummy_tls_certificate_class_init (GDummyTlsCertificateClass *certificate_class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (certificate_class); + + gobject_class->get_property = g_dummy_tls_certificate_get_property; + gobject_class->set_property = g_dummy_tls_certificate_set_property; + + g_object_class_override_property (gobject_class, PROP_CERTIFICATE, "certificate"); + g_object_class_override_property (gobject_class, PROP_CERTIFICATE_PEM, "certificate-pem"); + g_object_class_override_property (gobject_class, PROP_PRIVATE_KEY, "private-key"); + g_object_class_override_property (gobject_class, PROP_PRIVATE_KEY_PEM, "private-key-pem"); + g_object_class_override_property (gobject_class, PROP_ISSUER, "issuer"); +} + +static void +g_dummy_tls_certificate_init (GDummyTlsCertificate *certificate) +{ +} + +static gboolean +g_dummy_tls_certificate_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_UNAVAILABLE, + _("TLS support is not available")); + return FALSE; +} + +static void +g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface) +{ + iface->init = g_dummy_tls_certificate_initable_init; +} + +/* Dummy connection type; since GTlsClientConnection and + * GTlsServerConnection are just interfaces, we can implement them + * both on a single object. + */ + +typedef struct _GDummyTlsConnection GDummyTlsConnection; +typedef struct _GDummyTlsConnectionClass GDummyTlsConnectionClass; + +struct _GDummyTlsConnection { + GTlsConnection parent_instance; +}; + +struct _GDummyTlsConnectionClass { + GTlsConnectionClass parent_class; +}; + +enum +{ + PROP_CONNECTION_0, + + PROP_BASE_IO_STREAM, + PROP_REQUIRE_CLOSE_NOTIFY, + PROP_REHANDSHAKE_MODE, + PROP_USE_SYSTEM_CERTDB, + PROP_VALIDATION_FLAGS, + PROP_SERVER_IDENTITY, + PROP_USE_SSL3, + PROP_ACCEPTED_CAS, + PROP_AUTHENTICATION_MODE +}; + +static void g_dummy_tls_connection_initable_iface_init (GInitableIface *iface); + +#define g_dummy_tls_connection_get_type _g_dummy_tls_connection_get_type +G_DEFINE_TYPE_WITH_CODE (GDummyTlsConnection, g_dummy_tls_connection, G_TYPE_TLS_CONNECTION, + G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION, NULL); + G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION, NULL); + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, + g_dummy_tls_connection_initable_iface_init);) + +static void +g_dummy_tls_connection_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +g_dummy_tls_connection_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static gboolean +g_dummy_tls_connection_close (GIOStream *stream, + GCancellable *cancellable, + GError **error) +{ + return TRUE; +} + +static void +g_dummy_tls_connection_class_init (GDummyTlsConnectionClass *connection_class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (connection_class); + GIOStreamClass *io_stream_class = G_IO_STREAM_CLASS (connection_class); + + gobject_class->get_property = g_dummy_tls_connection_get_property; + gobject_class->set_property = g_dummy_tls_connection_set_property; + + /* Need to override this because when initable_init fails it will + * dispose the connection, which will close it, which would + * otherwise try to close its input/output streams, which don't + * exist. + */ + io_stream_class->close_fn = g_dummy_tls_connection_close; + + g_object_class_override_property (gobject_class, PROP_BASE_IO_STREAM, "base-io-stream"); + g_object_class_override_property (gobject_class, PROP_REQUIRE_CLOSE_NOTIFY, "require-close-notify"); + g_object_class_override_property (gobject_class, PROP_REHANDSHAKE_MODE, "rehandshake-mode"); + g_object_class_override_property (gobject_class, PROP_USE_SYSTEM_CERTDB, "use-system-certdb"); + g_object_class_override_property (gobject_class, PROP_VALIDATION_FLAGS, "validation-flags"); + g_object_class_override_property (gobject_class, PROP_SERVER_IDENTITY, "server-identity"); + g_object_class_override_property (gobject_class, PROP_USE_SSL3, "use-ssl3"); + g_object_class_override_property (gobject_class, PROP_ACCEPTED_CAS, "accepted-cas"); + g_object_class_override_property (gobject_class, PROP_AUTHENTICATION_MODE, "authentication-mode"); +} + +static void +g_dummy_tls_connection_init (GDummyTlsConnection *connection) +{ +} + +static gboolean +g_dummy_tls_connection_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_UNAVAILABLE, + _("TLS support is not available")); + return FALSE; +} + +static void +g_dummy_tls_connection_initable_iface_init (GInitableIface *iface) +{ + iface->init = g_dummy_tls_connection_initable_init; +} + diff --git a/gio/gdummytlsbackend.h b/gio/gdummytlsbackend.h new file mode 100644 index 0000000..40b5038 --- /dev/null +++ b/gio/gdummytlsbackend.h @@ -0,0 +1,46 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __G_DUMMY_TLS_BACKEND_H__ +#define __G_DUMMY_TLS_BACKEND_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_DUMMY_TLS_BACKEND (_g_dummy_tls_backend_get_type ()) +#define G_DUMMY_TLS_BACKEND(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DUMMY_TLS_BACKEND, GDummyTlsBackend)) +#define G_DUMMY_TLS_BACKEND_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DUMMY_TLS_BACKEND, GDummyTlsBackendClass)) +#define G_IS_DUMMY_TLS_BACKEND(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DUMMY_TLS_BACKEND)) +#define G_IS_DUMMY_TLS_BACKEND_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DUMMY_TLS_BACKEND)) +#define G_DUMMY_TLS_BACKEND_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DUMMY_TLS_BACKEND, GDummyTlsBackendClass)) + +typedef struct _GDummyTlsBackend GDummyTlsBackend; +typedef struct _GDummyTlsBackendClass GDummyTlsBackendClass; + +struct _GDummyTlsBackendClass { + GObjectClass parent_class; +}; + +GType _g_dummy_tls_backend_get_type (void); + +G_END_DECLS + +#endif /* __G_DUMMY_TLS_BACKEND_H__ */ diff --git a/gio/gemblem.c b/gio/gemblem.c index 461fe29..68afbab 100644 --- a/gio/gemblem.c +++ b/gio/gemblem.c @@ -29,7 +29,6 @@ #include #include -#include "gioalias.h" /** * SECTION:gemblem @@ -221,7 +220,7 @@ g_emblem_new_with_origin (GIcon *icon, * * Gives back the icon from @emblem. * - * Returns: a #GIcon. The returned object belongs to the emblem + * Returns: (transfer full): a #GIcon. The returned object belongs to the emblem * and should not be modified or freed. * * Since: 2.18 @@ -358,6 +357,3 @@ g_emblem_iface_init (GIconIface *iface) iface->to_tokens = g_emblem_to_tokens; iface->from_tokens = g_emblem_from_tokens; } - -#define __G_EMBLEM_C__ -#include "gioaliasdef.c" diff --git a/gio/gemblemedicon.c b/gio/gemblemedicon.c index abfcf0c..89be5c3 100644 --- a/gio/gemblemedicon.c +++ b/gio/gemblemedicon.c @@ -31,7 +31,6 @@ #include "glibintl.h" #include "gioerror.h" -#include "gioalias.h" /** * SECTION:gemblemedicon @@ -47,20 +46,19 @@ * of the emblems. See also #GEmblem for more information. **/ -static void g_emblemed_icon_icon_iface_init (GIconIface *iface); - -struct _GEmblemedIcon -{ - GObject parent_instance; +enum { + PROP_GICON = 1, + NUM_PROPERTIES +}; +struct _GEmblemedIconPrivate { GIcon *icon; GList *emblems; }; -struct _GEmblemedIconClass -{ - GObjectClass parent_class; -}; +static GParamSpec *properties[NUM_PROPERTIES] = { NULL, }; + +static void g_emblemed_icon_icon_iface_init (GIconIface *iface); G_DEFINE_TYPE_WITH_CODE (GEmblemedIcon, g_emblemed_icon, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_ICON, @@ -74,33 +72,88 @@ g_emblemed_icon_finalize (GObject *object) emblemed = G_EMBLEMED_ICON (object); - g_object_unref (emblemed->icon); - g_list_foreach (emblemed->emblems, (GFunc) g_object_unref, NULL); - g_list_free (emblemed->emblems); + g_object_unref (emblemed->priv->icon); + g_list_foreach (emblemed->priv->emblems, (GFunc) g_object_unref, NULL); + g_list_free (emblemed->priv->emblems); (*G_OBJECT_CLASS (g_emblemed_icon_parent_class)->finalize) (object); } static void +g_emblemed_icon_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GEmblemedIcon *self = G_EMBLEMED_ICON (object); + + switch (property_id) + { + case PROP_GICON: + self->priv->icon = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +g_emblemed_icon_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GEmblemedIcon *self = G_EMBLEMED_ICON (object); + + switch (property_id) + { + case PROP_GICON: + g_value_set_object (value, self->priv->icon); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void g_emblemed_icon_class_init (GEmblemedIconClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = g_emblemed_icon_finalize; + gobject_class->set_property = g_emblemed_icon_set_property; + gobject_class->get_property = g_emblemed_icon_get_property; + + properties[PROP_GICON] = + g_param_spec_object ("gicon", + P_("The base GIcon"), + P_("The GIcon to attach emblems to"), + G_TYPE_ICON, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (gobject_class, NUM_PROPERTIES, properties); + + g_type_class_add_private (klass, sizeof (GEmblemedIconPrivate)); } static void g_emblemed_icon_init (GEmblemedIcon *emblemed) { + emblemed->priv = + G_TYPE_INSTANCE_GET_PRIVATE (emblemed, G_TYPE_EMBLEMED_ICON, + GEmblemedIconPrivate); } /** * g_emblemed_icon_new: * @icon: a #GIcon - * @emblem: a #GEmblem + * @emblem: (allow-none): a #GEmblem, or %NULL * * Creates a new emblemed icon for @icon with the emblem @emblem. * - * Returns: a new #GIcon + * Returns: (transfer full): a new #GIcon * * Since: 2.18 **/ @@ -112,12 +165,13 @@ g_emblemed_icon_new (GIcon *icon, g_return_val_if_fail (G_IS_ICON (icon), NULL); g_return_val_if_fail (!G_IS_EMBLEM (icon), NULL); - g_return_val_if_fail (G_IS_EMBLEM (emblem), NULL); - emblemed = G_EMBLEMED_ICON (g_object_new (G_TYPE_EMBLEMED_ICON, NULL)); - emblemed->icon = g_object_ref (icon); - - g_emblemed_icon_add_emblem (emblemed, emblem); + emblemed = G_EMBLEMED_ICON (g_object_new (G_TYPE_EMBLEMED_ICON, + "gicon", icon, + NULL)); + + if (emblem != NULL) + g_emblemed_icon_add_emblem (emblemed, emblem); return G_ICON (emblemed); } @@ -129,7 +183,7 @@ g_emblemed_icon_new (GIcon *icon, * * Gets the main icon for @emblemed. * - * Returns: a #GIcon that is owned by @emblemed + * Returns: (transfer none): a #GIcon that is owned by @emblemed * * Since: 2.18 **/ @@ -138,7 +192,7 @@ g_emblemed_icon_get_icon (GEmblemedIcon *emblemed) { g_return_val_if_fail (G_IS_EMBLEMED_ICON (emblemed), NULL); - return emblemed->icon; + return emblemed->priv->icon; } /** @@ -147,7 +201,8 @@ g_emblemed_icon_get_icon (GEmblemedIcon *emblemed) * * Gets the list of emblems for the @icon. * - * Returns: a #GList of #GEmblem s that is owned by @emblemed + * Returns: (element-type utf8) (transfer none): a #GList of #GEmblem s that + * is owned by @emblemed * * Since: 2.18 **/ @@ -157,9 +212,44 @@ g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed) { g_return_val_if_fail (G_IS_EMBLEMED_ICON (emblemed), NULL); - return emblemed->emblems; + return emblemed->priv->emblems; } +/** + * g_emblemed_icon_clear_emblems: + * @emblemed: a #GEmblemedIcon + * + * Removes all the emblems from @icon. + * + * Since: 2.28 + **/ +void +g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed) +{ + g_return_if_fail (G_IS_EMBLEMED_ICON (emblemed)); + + if (emblemed->priv->emblems == NULL) + return; + + g_list_free_full (emblemed->priv->emblems, g_object_unref); + emblemed->priv->emblems = NULL; +} + +static gint +g_emblem_comp (GEmblem *a, + GEmblem *b) +{ + guint hash_a = g_icon_hash (G_ICON (a)); + guint hash_b = g_icon_hash (G_ICON (b)); + + if(hash_a < hash_b) + return -1; + + if(hash_a == hash_b) + return 0; + + return 1; +} /** * g_emblemed_icon_add_emblem: @@ -178,7 +268,8 @@ g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed, g_return_if_fail (G_IS_EMBLEM (emblem)); g_object_ref (emblem); - emblemed->emblems = g_list_append (emblemed->emblems, emblem); + emblemed->priv->emblems = g_list_insert_sorted (emblemed->priv->emblems, emblem, + (GCompareFunc) g_emblem_comp); } static guint @@ -186,30 +277,14 @@ g_emblemed_icon_hash (GIcon *icon) { GEmblemedIcon *emblemed = G_EMBLEMED_ICON (icon); GList *list; - guint hash = g_icon_hash (emblemed->icon); + guint hash = g_icon_hash (emblemed->priv->icon); - for (list = emblemed->emblems; list != NULL; list = list->next) + for (list = emblemed->priv->emblems; list != NULL; list = list->next) hash ^= g_icon_hash (G_ICON (list->data)); return hash; } -static gint -g_emblem_comp (GEmblem *a, - GEmblem *b) -{ - guint hash_a = g_icon_hash (G_ICON (a)); - guint hash_b = g_icon_hash (G_ICON (b)); - - if(hash_a < hash_b) - return -1; - - if(hash_a == hash_b) - return 0; - - return 1; -} - static gboolean g_emblemed_icon_equal (GIcon *icon1, GIcon *icon2) @@ -218,14 +293,11 @@ g_emblemed_icon_equal (GIcon *icon1, GEmblemedIcon *emblemed2 = G_EMBLEMED_ICON (icon2); GList *list1, *list2; - if (!g_icon_equal (emblemed1->icon, emblemed2->icon)) + if (!g_icon_equal (emblemed1->priv->icon, emblemed2->priv->icon)) return FALSE; - list1 = emblemed1->emblems; - list2 = emblemed2->emblems; - - list1 = g_list_sort (list1, (GCompareFunc) g_emblem_comp); - list2 = g_list_sort (list2, (GCompareFunc) g_emblem_comp); + list1 = emblemed1->priv->emblems; + list2 = emblemed2->priv->emblems; while (list1 && list2) { @@ -257,13 +329,13 @@ g_emblemed_icon_to_tokens (GIcon *icon, *out_version = 0; - s = g_icon_to_string (emblemed_icon->icon); + s = g_icon_to_string (emblemed_icon->priv->icon); if (s == NULL) return FALSE; g_ptr_array_add (tokens, s); - for (l = emblemed_icon->emblems; l != NULL; l = l->next) + for (l = emblemed_icon->priv->emblems; l != NULL; l = l->next) { GIcon *emblem_icon = G_ICON (l->data); @@ -309,8 +381,8 @@ g_emblemed_icon_from_tokens (gchar **tokens, } emblemed_icon = g_object_new (G_TYPE_EMBLEMED_ICON, NULL); - emblemed_icon->icon = g_icon_new_for_string (tokens[0], error); - if (emblemed_icon->icon == NULL) + emblemed_icon->priv->icon = g_icon_new_for_string (tokens[0], error); + if (emblemed_icon->priv->icon == NULL) goto fail; for (n = 1; n < num_tokens; n++) @@ -331,7 +403,7 @@ g_emblemed_icon_from_tokens (gchar **tokens, goto fail; } - emblemed_icon->emblems = g_list_append (emblemed_icon->emblems, emblem); + emblemed_icon->priv->emblems = g_list_append (emblemed_icon->priv->emblems, emblem); } return G_ICON (emblemed_icon); @@ -350,6 +422,3 @@ g_emblemed_icon_icon_iface_init (GIconIface *iface) iface->to_tokens = g_emblemed_icon_to_tokens; iface->from_tokens = g_emblemed_icon_from_tokens; } - -#define __G_EMBLEMED_ICON_C__ -#include "gioaliasdef.c" diff --git a/gio/gemblemedicon.h b/gio/gemblemedicon.h index 7a5dc4d..ded6928 100644 --- a/gio/gemblemedicon.h +++ b/gio/gemblemedicon.h @@ -47,6 +47,20 @@ G_BEGIN_DECLS **/ typedef struct _GEmblemedIcon GEmblemedIcon; typedef struct _GEmblemedIconClass GEmblemedIconClass; +typedef struct _GEmblemedIconPrivate GEmblemedIconPrivate; + +struct _GEmblemedIcon +{ + GObject parent_instance; + + /*< private >*/ + GEmblemedIconPrivate *priv; +}; + +struct _GEmblemedIconClass +{ + GObjectClass parent_class; +}; GType g_emblemed_icon_get_type (void) G_GNUC_CONST; @@ -56,6 +70,7 @@ GIcon *g_emblemed_icon_get_icon (GEmblemedIcon *emblemed); GList *g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed); void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed, GEmblem *emblem); +void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed); G_END_DECLS diff --git a/gio/gfile.c b/gio/gfile.c index b694ef3..da3477b 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -50,7 +50,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfile @@ -522,7 +521,7 @@ g_file_get_parse_name (GFile *file) * * This call does no blocking i/o. * - * Returns: a new #GFile that is a duplicate of the given #GFile. + * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile. **/ GFile * g_file_dup (GFile *file) @@ -543,7 +542,8 @@ g_file_dup (GFile *file) * Creates a hash value for a #GFile. * * This call does no blocking i/o. - * + * + * Virtual: hash * Returns: 0 if @file is not a valid #GFile, otherwise an * integer that can be used as hash value for the #GFile. * This function is intended for easily hashing a #GFile to @@ -604,7 +604,7 @@ g_file_equal (GFile *file1, * * This call does no blocking i/o. * - * Returns: a #GFile structure to the parent of the given + * Returns: (transfer full): a #GFile structure to the parent of the given * #GFile or %NULL if there is no parent. * Free the returned object with g_object_unref(). **/ @@ -676,7 +676,7 @@ g_file_has_parent (GFile *file, * * This call does no blocking i/o. * - * Returns: a #GFile to a child specified by @name. + * Returns: (transfer full): a #GFile to a child specified by @name. * Free the returned object with g_object_unref(). **/ GFile * @@ -703,7 +703,7 @@ g_file_get_child (GFile *file, * * This call does no blocking i/o. * - * Returns: a #GFile to the specified child, or + * Returns: (transfer full): a #GFile to the specified child, or * %NULL if the display name couldn't be converted. * Free the returned object with g_object_unref(). **/ @@ -737,6 +737,7 @@ g_file_get_child_for_display_name (GFile *file, * filesystem point of view), because the prefix of @file is an alias * of @prefix. * + * Virtual: prefix_matches * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix. * %FALSE otherwise. **/ @@ -798,7 +799,7 @@ g_file_get_relative_path (GFile *parent, * * This call does no blocking i/o. * - * Returns: #GFile to the resolved path. %NULL if @relative_path + * Returns: (transfer full): #GFile to the resolved path. %NULL if @relative_path * is %NULL or if @file is invalid. * Free the returned object with g_object_unref(). **/ @@ -821,17 +822,17 @@ g_file_resolve_relative_path (GFile *file, * @file: input #GFile. * @attributes: an attribute query string. * @flags: a set of #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: #GError for error reporting. * * Gets the requested information about the files in a directory. The result * is a #GFileEnumerator object that will give out #GFileInfo objects for * all the files in the directory. * - * The @attribute value is a string that specifies the file attributes that + * The @attributes value is a string that specifies the file attributes that * should be gathered. It is not an error if it's not possible to read a particular - * requested attribute from a file - it just won't be set. @attribute should - * be a comma-separated list of attribute or attribute wildcards. The wildcard "*" + * requested attribute from a file - it just won't be set. @attributes should + * be a comma-separated list of attributes or attribute wildcards. The wildcard "*" * means all attributes, and a wildcard like "standard::*" means all attributes in the standard * namespace. An example attribute query be "standard::*,owner::user". * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME. @@ -844,7 +845,7 @@ g_file_resolve_relative_path (GFile *file, * If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned. * Other errors are possible too. * - * Returns: A #GFileEnumerator if successful, %NULL on error. + * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. * Free the returned object with g_object_unref(). **/ GFileEnumerator * @@ -883,9 +884,10 @@ g_file_enumerate_children (GFile *file, * @flags: a set of #GFileQueryInfoFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the + * request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously gets the requested information about the files in a directory. The result * is a #GFileEnumerator object that will give out #GFileInfo objects for @@ -929,7 +931,7 @@ g_file_enumerate_children_async (GFile *file, * Finishes an async enumerate children operation. * See g_file_enumerate_children_async(). * - * Returns: a #GFileEnumerator or %NULL if an error occurred. + * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. * Free the returned object with g_object_unref(). **/ GFileEnumerator * @@ -956,7 +958,7 @@ g_file_enumerate_children_finish (GFile *file, /** * g_file_query_exists: * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * * Utility function to check if a particular file exists. This is * implemented using g_file_query_info() and as such does blocking I/O. @@ -1006,7 +1008,7 @@ g_file_query_exists (GFile *file, * g_file_query_file_type: * @file: input #GFile. * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info(). - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * * Utility function to inspect the #GFileType of a file. This is * implemented using g_file_query_info() and as such does blocking I/O. @@ -1046,17 +1048,17 @@ g_file_query_file_type (GFile *file, * @file: input #GFile. * @attributes: an attribute query string. * @flags: a set of #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError. * * Gets the requested information about specified @file. The result * is a #GFileInfo object that contains key-value attributes (such as * the type or size of the file). * - * The @attribute value is a string that specifies the file attributes that + * The @attributes value is a string that specifies the file attributes that * should be gathered. It is not an error if it's not possible to read a particular - * requested attribute from a file - it just won't be set. @attribute should - * be a comma-separated list of attribute or attribute wildcards. The wildcard "*" + * requested attribute from a file - it just won't be set. @attributes should + * be a comma-separated list of attributes or attribute wildcards. The wildcard "*" * means all attributes, and a wildcard like "standard::*" means all attributes in the standard * namespace. An example attribute query be "standard::*,owner::user". * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME. @@ -1075,7 +1077,7 @@ g_file_query_file_type (GFile *file, * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. * Other errors are possible too, and depend on what kind of filesystem the file is on. * - * Returns: a #GFileInfo for the given @file, or %NULL on error. + * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileInfo * @@ -1112,9 +1114,9 @@ g_file_query_info (GFile *file, * @flags: a set of #GFileQueryInfoFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously gets the requested information about specified @file. The result * is a #GFileInfo object that contains key-value attributes (such as type or size @@ -1158,7 +1160,7 @@ g_file_query_info_async (GFile *file, * Finishes an asynchronous file info query. * See g_file_query_info_async(). * - * Returns: #GFileInfo for given @file or %NULL on error. + * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileInfo * @@ -1186,7 +1188,7 @@ g_file_query_info_finish (GFile *file, * g_file_query_filesystem_info: * @file: input #GFile. * @attributes: an attribute query string. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError. * * Similar to g_file_query_info(), but obtains information @@ -1194,10 +1196,10 @@ g_file_query_info_finish (GFile *file, * For instance the amount of space available and the type of * the filesystem. * - * The @attribute value is a string that specifies the file attributes that + * The @attributes value is a string that specifies the file attributes that * should be gathered. It is not an error if it's not possible to read a particular - * requested attribute from a file - it just won't be set. @attribute should - * be a comma-separated list of attribute or attribute wildcards. The wildcard "*" + * requested attribute from a file - it just won't be set. @attributes should + * be a comma-separated list of attributes or attribute wildcards. The wildcard "*" * means all attributes, and a wildcard like "fs:*" means all attributes in the fs * namespace. The standard namespace for filesystem attributes is "fs". * Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE @@ -1211,7 +1213,7 @@ g_file_query_info_finish (GFile *file, * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. * Other errors are possible too, and depend on what kind of filesystem the file is on. * - * Returns: a #GFileInfo or %NULL if there was an error. + * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. * Free the returned object with g_object_unref(). **/ GFileInfo * @@ -1246,9 +1248,9 @@ g_file_query_filesystem_info (GFile *file, * @attributes: an attribute query string. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously gets the requested information about the filesystem * that the specified @file is on. The result is a #GFileInfo object @@ -1292,7 +1294,7 @@ g_file_query_filesystem_info_async (GFile *file, * Finishes an asynchronous filesystem info query. See * g_file_query_filesystem_info_async(). * - * Returns: #GFileInfo for given @file or %NULL on error. + * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileInfo * @@ -1319,7 +1321,7 @@ g_file_query_filesystem_info_finish (GFile *file, /** * g_file_find_enclosing_mount: * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError. * * Gets a #GMount for the #GFile. @@ -1332,7 +1334,7 @@ g_file_query_filesystem_info_finish (GFile *file, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GMount where the @file is located or %NULL on error. + * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. * Free the returned object with g_object_unref(). **/ GMount * @@ -1366,9 +1368,9 @@ g_file_find_enclosing_mount (GFile *file, * @file: a #GFile * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously gets the mount for the file. * @@ -1406,7 +1408,7 @@ g_file_find_enclosing_mount_async (GFile *file, * Finishes an asynchronous find mount request. * See g_file_find_enclosing_mount_async(). * - * Returns: #GMount for given @file or %NULL on error. + * Returns: (transfer full): #GMount for given @file or %NULL on error. * Free the returned object with g_object_unref(). **/ GMount * @@ -1434,7 +1436,7 @@ g_file_find_enclosing_mount_finish (GFile *file, /** * g_file_read: * @file: #GFile to read. - * @cancellable: a #GCancellable + * @cancellable: (allow-none): a #GCancellable * @error: a #GError, or %NULL * * Opens a file for reading. The result is a #GFileInputStream that @@ -1448,7 +1450,8 @@ g_file_find_enclosing_mount_finish (GFile *file, * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned. * Other errors are possible too, and depend on what kind of filesystem the file is on. * - * Returns: #GFileInputStream or %NULL on error. + * Virtual: read_fn + * Returns: (transfer full): #GFileInputStream or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileInputStream * @@ -1480,7 +1483,7 @@ g_file_read (GFile *file, * g_file_append_to: * @file: input #GFile. * @flags: a set of #GFileCreateFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Gets an output stream for appending data to the file. If @@ -1501,7 +1504,7 @@ g_file_read (GFile *file, * returned. Other errors are possible too, and depend on what kind of * filesystem the file is on. * - * Returns: a #GFileOutputStream, or %NULL on error. + * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileOutputStream * @@ -1534,7 +1537,7 @@ g_file_append_to (GFile *file, * g_file_create: * @file: input #GFile. * @flags: a set of #GFileCreateFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Creates a new file and returns an output stream for writing to it. @@ -1557,7 +1560,7 @@ g_file_append_to (GFile *file, * Other errors are possible too, and depend on what kind of * filesystem the file is on. * - * Returns: a #GFileOutputStream for the newly created file, or + * Returns: (transfer full): a #GFileOutputStream for the newly created file, or * %NULL on error. * Free the returned object with g_object_unref(). **/ @@ -1590,11 +1593,11 @@ g_file_create (GFile *file, /** * g_file_replace: * @file: input #GFile. - * @etag: an optional entity tag for the + * @etag: (allow-none): an optional entity tag for the * current #GFile, or #NULL to ignore. * @make_backup: %TRUE if a backup should be created. * @flags: a set of #GFileCreateFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Returns an output stream for overwriting the file, possibly @@ -1639,7 +1642,7 @@ g_file_create (GFile *file, * Other errors are possible too, and depend on what kind of * filesystem the file is on. * - * Returns: a #GFileOutputStream or %NULL on error. + * Returns: (transfer full): a #GFileOutputStream or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileOutputStream * @@ -1678,7 +1681,7 @@ g_file_replace (GFile *file, /** * g_file_open_readwrite: * @file: #GFile to open - * @cancellable: a #GCancellable + * @cancellable: (allow-none): a #GCancellable * @error: a #GError, or %NULL * * Opens an existing file for reading and writing. The result is @@ -1695,7 +1698,7 @@ g_file_replace (GFile *file, * so make sure you really need to do read and write streaming, rather than * just opening for reading or writing. * - * Returns: #GFileIOStream or %NULL on error. + * Returns: (transfer full): #GFileIOStream or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -1729,7 +1732,7 @@ g_file_open_readwrite (GFile *file, * g_file_create_readwrite: * @file: a #GFile * @flags: a set of #GFileCreateFlags - * @cancellable: optional #GCancellable object, %NULL to ignore + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore * @error: return location for a #GError, or %NULL * * Creates a new file and returns a stream for reading and writing to it. @@ -1754,7 +1757,7 @@ g_file_open_readwrite (GFile *file, * supported, so make sure you really need to do read and write streaming, * rather than just opening for reading or writing. * - * Returns: a #GFileIOStream for the newly created file, or %NULL on error. + * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -1788,11 +1791,11 @@ g_file_create_readwrite (GFile *file, /** * g_file_replace_readwrite: * @file: a #GFile - * @etag: an optional entity tag for the + * @etag: (allow-none): an optional entity tag for the * current #GFile, or #NULL to ignore * @make_backup: %TRUE if a backup should be created * @flags: a set of #GFileCreateFlags - * @cancellable: optional #GCancellable object, %NULL to ignore + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore * @error: return location for a #GError, or %NULL * * Returns an output stream for overwriting the file in readwrite mode, @@ -1806,7 +1809,7 @@ g_file_create_readwrite (GFile *file, * supported, so make sure you really need to do read and write streaming, * rather than just opening for reading or writing. * - * Returns: a #GFileIOStream or %NULL on error. + * Returns: (transfer full): a #GFileIOStream or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -1844,9 +1847,9 @@ g_file_replace_readwrite (GFile *file, * @file: input #GFile * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously opens @file for reading. * @@ -1884,7 +1887,7 @@ g_file_read_async (GFile *file, * Finishes an asynchronous file read operation started with * g_file_read_async(). * - * Returns: a #GFileInputStream or %NULL on error. + * Returns: (transfer full): a #GFileInputStream or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileInputStream * @@ -1914,9 +1917,9 @@ g_file_read_finish (GFile *file, * @flags: a set of #GFileCreateFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously opens @file for appending. * @@ -1956,7 +1959,7 @@ g_file_append_to_async (GFile *file, * Finishes an asynchronous file append operation started with * g_file_append_to_async(). * - * Returns: a valid #GFileOutputStream or %NULL on error. + * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileOutputStream * @@ -1986,9 +1989,9 @@ g_file_append_to_finish (GFile *file, * @flags: a set of #GFileCreateFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously creates a new file and returns an output stream for writing to it. * The file must not already exist. @@ -2029,7 +2032,7 @@ g_file_create_async (GFile *file, * Finishes an asynchronous file create operation started with * g_file_create_async(). * - * Returns: a #GFileOutputStream or %NULL on error. + * Returns: (transfer full): a #GFileOutputStream or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileOutputStream * @@ -2056,15 +2059,15 @@ g_file_create_finish (GFile *file, /** * g_file_replace_async: * @file: input #GFile. - * @etag: an entity tag for the + * @etag: (allow-none): an entity tag for the * current #GFile, or NULL to ignore. * @make_backup: %TRUE if a backup should be created. * @flags: a set of #GFileCreateFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously overwrites the file, replacing the contents, possibly * creating a backup copy of the file first. @@ -2109,7 +2112,7 @@ g_file_replace_async (GFile *file, * Finishes an asynchronous file replace operation started with * g_file_replace_async(). * - * Returns: a #GFileOutputStream, or %NULL on error. + * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileOutputStream * @@ -2139,9 +2142,9 @@ g_file_replace_finish (GFile *file, * @file: input #GFile. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously opens @file for reading and writing. * @@ -2181,7 +2184,7 @@ g_file_open_readwrite_async (GFile *file, * Finishes an asynchronous file read operation started with * g_file_open_readwrite_async(). * - * Returns: a #GFileIOStream or %NULL on error. + * Returns: (transfer full): a #GFileIOStream or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -2214,9 +2217,9 @@ g_file_open_readwrite_finish (GFile *file, * @flags: a set of #GFileCreateFlags * @io_priority: the I/O priority * of the request - * @cancellable: optional #GCancellable object, %NULL to ignore - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously creates a new file and returns a stream for reading and * writing to it. The file must not already exist. @@ -2259,7 +2262,7 @@ g_file_create_readwrite_async (GFile *file, * Finishes an asynchronous file create operation started with * g_file_create_readwrite_async(). * - * Returns: a #GFileIOStream or %NULL on error. + * Returns: (transfer full): a #GFileIOStream or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -2288,15 +2291,15 @@ g_file_create_readwrite_finish (GFile *file, /** * g_file_replace_readwrite_async: * @file: input #GFile. - * @etag: an entity tag for the + * @etag: (allow-none): an entity tag for the * current #GFile, or NULL to ignore. * @make_backup: %TRUE if a backup should be created. * @flags: a set of #GFileCreateFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously overwrites the file in read-write mode, replacing the * contents, possibly creating a backup copy of the file first. @@ -2343,7 +2346,7 @@ g_file_replace_readwrite_async (GFile *file, * Finishes an asynchronous file replace operation started with * g_file_replace_readwrite_async(). * - * Returns: a #GFileIOStream, or %NULL on error. + * Returns: (transfer full): a #GFileIOStream, or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -2456,7 +2459,8 @@ open_source_for_copy (GFile *source, info = g_file_query_info (destination, G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, cancellable, &my_error); - if (info != NULL) + if (info != NULL && + g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_TYPE)) { file_type = g_file_info_get_file_type (info); g_object_unref (info); @@ -2483,12 +2487,12 @@ open_source_for_copy (GFile *source, /* Error getting info from target, return that error * (except for NOT_FOUND, which is no error here) */ - if (my_error->domain != G_IO_ERROR && my_error->code != G_IO_ERROR_NOT_FOUND) + if (my_error != NULL && !g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { g_propagate_error (error, my_error); return NULL; } - g_error_free (my_error); + g_clear_error (&my_error); } g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_RECURSE, @@ -2567,7 +2571,7 @@ build_attribute_list_for_copy (GFileAttributeInfoList *attributes, * @source: a #GFile with attributes. * @destination: a #GFile to copy attributes to. * @flags: a set of #GFileCopyFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, %NULL to ignore. * * Copies the file attributes from @source to @destination. @@ -2985,9 +2989,9 @@ file_copy_fallback (GFile *source, * @source: input #GFile. * @destination: destination #GFile * @flags: set of #GFileCopyFlags - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @progress_callback: function to callback with progress information - * @progress_callback_data: user data to pass to @progress_callback + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @progress_callback: (scope call): function to callback with progress information + * @progress_callback_data: (closure): user data to pass to @progress_callback * @error: #GError to set on error, or %NULL * * Copies the file @source to the location specified by @destination. @@ -3102,7 +3106,7 @@ g_file_copy (GFile *source, } /** - * g_file_copy_async: + * g_file_copy_async: (skip) * @source: input #GFile. * @destination: destination #GFile * @flags: set of #GFileCopyFlags @@ -3190,9 +3194,9 @@ g_file_copy_finish (GFile *file, * @source: #GFile pointing to the source location. * @destination: #GFile pointing to the destination location. * @flags: set of #GFileCopyFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @progress_callback: #GFileProgressCallback function for updates. - * @progress_callback_data: gpointer to user data for the callback function. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @progress_callback: (scope call): #GFileProgressCallback function for updates. + * @progress_callback_data: (closure): gpointer to user data for the callback function. * @error: #GError for returning error conditions, or %NULL * * @@ -3317,7 +3321,7 @@ g_file_move (GFile *source, /** * g_file_make_directory * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Creates a directory. Note that this will only create a child directory of @@ -3365,7 +3369,7 @@ g_file_make_directory (GFile *file, /** * g_file_make_directory_with_parents: * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Creates a directory and any parent directories that may not exist similar to @@ -3445,19 +3449,20 @@ g_file_make_directory_with_parents (GFile *file, /** * g_file_make_symbolic_link: - * @file: input #GFile. - * @symlink_value: a string with the value of the new symlink. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @error: a #GError. - * - * Creates a symbolic link. + * @file: a #GFile with the name of the symlink to create + * @symlink_value: a string with the path for the target of the new symlink + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @error: a #GError. + * + * Creates a symbolic link named @file which contains the string + * @symlink_value. * * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation - * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. - * + * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. + * * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise. - **/ + */ gboolean g_file_make_symbolic_link (GFile *file, const char *symlink_value, @@ -3496,7 +3501,7 @@ g_file_make_symbolic_link (GFile *file, /** * g_file_delete: * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Deletes a file. If the @file is a directory, it will only be deleted if it @@ -3505,7 +3510,8 @@ g_file_make_symbolic_link (GFile *file, * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. - * + * + * Virtual: delete_file * Returns: %TRUE if the file was deleted. %FALSE otherwise. **/ gboolean @@ -3536,7 +3542,7 @@ g_file_delete (GFile *file, /** * g_file_trash: * @file: #GFile to send to trash. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sends @file to the "Trashcan", if possible. This is similar to @@ -3580,7 +3586,7 @@ g_file_trash (GFile *file, * g_file_set_display_name: * @file: input #GFile. * @display_name: a string. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Renames @file to the specified display name. @@ -3598,7 +3604,7 @@ g_file_trash (GFile *file, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GFile specifying what @file was renamed to, or %NULL + * Returns: (transfer full): a #GFile specifying what @file was renamed to, or %NULL * if there was an error. * Free the returned object with g_object_unref(). **/ @@ -3636,9 +3642,9 @@ g_file_set_display_name (GFile *file, * @display_name: a string. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously sets the display name for a given #GFile. * @@ -3679,7 +3685,7 @@ g_file_set_display_name_async (GFile *file, * Finishes setting a display name started with * g_file_set_display_name_async(). * - * Returns: a #GFile or %NULL on error. + * Returns: (transfer full): a #GFile or %NULL on error. * Free the returned object with g_object_unref(). **/ GFile * @@ -3706,7 +3712,7 @@ g_file_set_display_name_finish (GFile *file, /** * g_file_query_settable_attributes: * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Obtain the list of settable attributes for the file. @@ -3762,7 +3768,7 @@ g_file_query_settable_attributes (GFile *file, /** * g_file_query_writable_namespaces: * @file: input #GFile. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Obtain the list of attribute namespaces where new attributes @@ -3819,7 +3825,7 @@ g_file_query_writable_namespaces (GFile *file, * @type: The type of the attribute * @value_p: a pointer to the value (or the pointer itself if the type is a pointer type) * @flags: a set of #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets an attribute in the file with attribute name @attribute to @value. @@ -3865,7 +3871,7 @@ g_file_set_attribute (GFile *file, * @file: input #GFile. * @info: a #GFileInfo. * @flags: #GFileQueryInfoFlags - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Tries to set all attributes in the #GFileInfo on the target values, @@ -3958,9 +3964,9 @@ g_file_real_set_attributes_from_info (GFile *file, * @flags: a #GFileQueryInfoFlags. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback. - * @user_data: a #gpointer. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback. + * @user_data: (closure): a #gpointer. * * Asynchronously sets the attributes of @file with @info. * @@ -3998,7 +4004,7 @@ g_file_set_attributes_async (GFile *file, * g_file_set_attributes_finish: * @file: input #GFile. * @result: a #GAsyncResult. - * @info: a #GFileInfo. + * @info: (out) (transfer full): a #GFileInfo. * @error: a #GError, or %NULL * * Finishes setting an attribute started in g_file_set_attributes_async(). @@ -4029,7 +4035,7 @@ g_file_set_attributes_finish (GFile *file, * @attribute: a string containing the attribute's name. * @value: a string containing the attribute's value. * @flags: #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value. @@ -4060,7 +4066,7 @@ g_file_set_attribute_string (GFile *file, * @attribute: a string containing the attribute's name. * @value: a string containing the attribute's new value. * @flags: a #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value. @@ -4093,7 +4099,7 @@ g_file_set_attribute_byte_string (GFile *file, * @attribute: a string containing the attribute's name. * @value: a #guint32 containing the attribute's new value. * @flags: a #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value. @@ -4125,7 +4131,7 @@ g_file_set_attribute_uint32 (GFile *file, * @attribute: a string containing the attribute's name. * @value: a #gint32 containing the attribute's new value. * @flags: a #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value. @@ -4157,7 +4163,7 @@ g_file_set_attribute_int32 (GFile *file, * @attribute: a string containing the attribute's name. * @value: a #guint64 containing the attribute's new value. * @flags: a #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value. @@ -4189,7 +4195,7 @@ g_file_set_attribute_uint64 (GFile *file, * @attribute: a string containing the attribute's name. * @value: a #guint64 containing the attribute's new value. * @flags: a #GFileQueryInfoFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL * * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value. @@ -4219,9 +4225,9 @@ g_file_set_attribute_int64 (GFile *file, * @file: input #GFile. * @flags: flags affecting the operation * @mount_operation: a #GMountOperation, or %NULL to avoid user interaction. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. + * @user_data: (closure): the data to pass to callback function * * Mounts a file of type G_FILE_TYPE_MOUNTABLE. * Using @mount_operation, you can request callbacks when, for instance, @@ -4278,7 +4284,7 @@ g_file_mount_mountable (GFile *file, * Finish an asynchronous mount operation that was started * with g_file_mount_mountable(). * - * Returns: a #GFile or %NULL on error. + * Returns: (transfer full): a #GFile or %NULL on error. * Free the returned object with g_object_unref(). **/ GFile * @@ -4306,9 +4312,9 @@ g_file_mount_mountable_finish (GFile *file, * g_file_unmount_mountable: * @file: input #GFile. * @flags: flags affecting the operation - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. + * @user_data: (closure): the data to pass to callback function * * Unmounts a file of type G_FILE_TYPE_MOUNTABLE. * @@ -4394,9 +4400,9 @@ g_file_unmount_mountable_finish (GFile *file, * @file: input #GFile. * @flags: flags affecting the operation * @mount_operation: a #GMountOperation, or %NULL to avoid user interaction. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. + * @user_data: (closure): the data to pass to callback function * * Unmounts a file of type G_FILE_TYPE_MOUNTABLE. * @@ -4493,9 +4499,9 @@ g_file_unmount_mountable_with_operation_finish (GFile *file, * g_file_eject_mountable: * @file: input #GFile. * @flags: flags affecting the operation - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. + * @user_data: (closure): the data to pass to callback function * * Starts an asynchronous eject on a mountable. * When this operation has completed, @callback will be called with @@ -4579,9 +4585,9 @@ g_file_eject_mountable_finish (GFile *file, * @file: input #GFile. * @flags: flags affecting the operation * @mount_operation: a #GMountOperation, or %NULL to avoid user interaction. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. + * @user_data: (closure): the data to pass to callback function * * Starts an asynchronous eject on a mountable. * When this operation has completed, @callback will be called with @@ -4676,7 +4682,7 @@ g_file_eject_mountable_with_operation_finish (GFile *file, * g_file_monitor_directory: * @file: input #GFile. * @flags: a set of #GFileMonitorFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL. * * Obtains a directory monitor for the given file. @@ -4685,8 +4691,9 @@ g_file_eject_mountable_with_operation_finish (GFile *file, * If @cancellable is not %NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. - * - * Returns: a #GFileMonitor for the given @file, or %NULL on error. + * + * Virtual: monitor_dir + * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileMonitor* @@ -4719,7 +4726,7 @@ g_file_monitor_directory (GFile *file, * g_file_monitor_file: * @file: input #GFile. * @flags: a set of #GFileMonitorFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, or %NULL. * * Obtains a file monitor for the given file. If no file notification @@ -4729,7 +4736,7 @@ g_file_monitor_directory (GFile *file, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GFileMonitor for the given @file, or %NULL on error. + * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. * Free the returned object with g_object_unref(). **/ GFileMonitor* @@ -4764,7 +4771,7 @@ g_file_monitor_file (GFile *file, * g_file_monitor: * @file: input #GFile * @flags: a set of #GFileMonitorFlags - * @cancellable: optional #GCancellable object, %NULL to ignore + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore * @error: a #GError, or %NULL * * Obtains a file or directory monitor for the given file, depending @@ -4774,7 +4781,7 @@ g_file_monitor_file (GFile *file, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GFileMonitor for the given @file, or %NULL on error. + * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.18 @@ -4824,10 +4831,7 @@ query_info_async_thread (GSimpleAsyncResult *res, info = g_file_query_info (G_FILE (object), data->attributes, data->flags, cancellable, &error); if (info == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->info = info; } @@ -4900,10 +4904,7 @@ query_filesystem_info_async_thread (GSimpleAsyncResult *res, info = g_file_query_filesystem_info (G_FILE (object), data->attributes, cancellable, &error); if (info == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->info = info; } @@ -4975,10 +4976,7 @@ enumerate_children_async_thread (GSimpleAsyncResult *res, enumerator = g_file_enumerate_children (G_FILE (object), data->attributes, data->flags, cancellable, &error); if (enumerator == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->enumerator = enumerator; } @@ -5040,8 +5038,7 @@ open_read_async_thread (GSimpleAsyncResult *res, G_IO_ERROR_NOT_SUPPORTED, _("Operation not supported")); - g_simple_async_result_set_from_error (res, error); - g_error_free (error); + g_simple_async_result_take_error (res, error); return; } @@ -5049,10 +5046,7 @@ open_read_async_thread (GSimpleAsyncResult *res, stream = iface->read_fn (G_FILE (object), cancellable, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else g_simple_async_result_set_op_res_gpointer (res, stream, g_object_unref); } @@ -5106,10 +5100,7 @@ append_to_async_thread (GSimpleAsyncResult *res, stream = iface->append_to (G_FILE (object), *data, cancellable, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else g_simple_async_result_set_op_res_gpointer (res, stream, g_object_unref); } @@ -5169,10 +5160,7 @@ create_async_thread (GSimpleAsyncResult *res, stream = iface->create (G_FILE (object), *data, cancellable, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else g_simple_async_result_set_op_res_gpointer (res, stream, g_object_unref); } @@ -5253,10 +5241,7 @@ replace_async_thread (GSimpleAsyncResult *res, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->stream = stream; } @@ -5320,8 +5305,7 @@ open_readwrite_async_thread (GSimpleAsyncResult *res, G_IO_ERROR_NOT_SUPPORTED, _("Operation not supported")); - g_simple_async_result_set_from_error (res, error); - g_error_free (error); + g_simple_async_result_take_error (res, error); return; } @@ -5329,10 +5313,7 @@ open_readwrite_async_thread (GSimpleAsyncResult *res, stream = iface->open_readwrite (G_FILE (object), cancellable, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else g_simple_async_result_set_op_res_gpointer (res, stream, g_object_unref); } @@ -5389,8 +5370,7 @@ create_readwrite_async_thread (GSimpleAsyncResult *res, G_IO_ERROR_NOT_SUPPORTED, _("Operation not supported")); - g_simple_async_result_set_from_error (res, error); - g_error_free (error); + g_simple_async_result_take_error (res, error); return; } @@ -5398,10 +5378,7 @@ create_readwrite_async_thread (GSimpleAsyncResult *res, stream = iface->create_readwrite (G_FILE (object), *data, cancellable, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else g_simple_async_result_set_op_res_gpointer (res, stream, g_object_unref); } @@ -5482,10 +5459,7 @@ replace_readwrite_async_thread (GSimpleAsyncResult *res, &error); if (stream == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->stream = stream; } @@ -5560,10 +5534,7 @@ set_display_name_async_thread (GSimpleAsyncResult *res, file = g_file_set_display_name (G_FILE (object), data->name, cancellable, &error); if (file == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->file = file; } @@ -5696,10 +5667,7 @@ find_enclosing_mount_async_thread (GSimpleAsyncResult *res, mount = g_file_find_enclosing_mount (G_FILE (object), cancellable, &error); if (mount == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else g_simple_async_result_set_op_res_gpointer (res, mount, (GDestroyNotify)g_object_unref); } @@ -5828,10 +5796,7 @@ copy_async_thread (GIOSchedulerJob *job, NULL, NULL); if (!result) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); g_simple_async_result_complete_in_idle (res); @@ -5881,13 +5846,14 @@ g_file_real_copy_finish (GFile *file, /** * g_file_new_for_path: - * @path: a string containing a relative or absolute path. + * @path: a string containing a relative or absolute path. The string + * must be encoded in the glib filename encoding. * * Constructs a #GFile for a given path. This operation never * fails, but the returned object might not support any I/O * operation if @path is malformed. * - * Returns: a new #GFile for the given @path. + * Returns: (transfer full): a new #GFile for the given @path. **/ GFile * g_file_new_for_path (const char *path) @@ -5899,14 +5865,14 @@ g_file_new_for_path (const char *path) /** * g_file_new_for_uri: - * @uri: a string containing a URI. + * @uri: a UTF8 string containing a URI. * * Constructs a #GFile for a given URI. This operation never * fails, but the returned object might not support any I/O * operation if @uri is malformed or if the uri type is * not supported. * - * Returns: a #GFile for the given @uri. + * Returns: (transfer full): a #GFile for the given @uri. **/ GFile * g_file_new_for_uri (const char *uri) @@ -5924,7 +5890,7 @@ g_file_new_for_uri (const char *uri) * This operation never fails, but the returned object might not support any I/O * operation if the @parse_name cannot be parsed. * - * Returns: a new #GFile. + * Returns: (transfer full): a new #GFile. **/ GFile * g_file_parse_name (const char *parse_name) @@ -5970,7 +5936,7 @@ has_valid_scheme (const char *uri) * This operation never fails, but the returned object might not support any * I/O operation if @arg points to a malformed path. * - * Returns: a new #GFile. + * Returns: (transfer full): a new #GFile. **/ GFile * g_file_new_for_commandline_arg (const char *arg) @@ -6095,7 +6061,7 @@ g_file_mount_enclosing_volume_finish (GFile *location, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GAppInfo if the handle was found, %NULL if there were errors. + * Returns: (transfer full): a #GAppInfo if the handle was found, %NULL if there were errors. * When you are done with it, release it with g_object_unref() **/ GAppInfo * @@ -6158,10 +6124,10 @@ g_file_query_default_handler (GFile *file, * g_file_load_contents: * @file: input #GFile. * @cancellable: optional #GCancellable object, %NULL to ignore. - * @contents: a location to place the contents of the file. - * @length: a location to place the length of the contents of the file, + * @contents: (out) (transfer full): a location to place the contents of the file. + * @length: (out) (allow-none): a location to place the length of the contents of the file, * or %NULL if the length is not needed - * @etag_out: a location to place the current entity tag for the file, + * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, * or %NULL if the entity tag is not needed * @error: a #GError, or %NULL * @@ -6403,19 +6369,18 @@ load_contents_open_callback (GObject *obj, } else { - res = g_simple_async_result_new_from_error (G_OBJECT (data->file), + res = g_simple_async_result_new_take_error (G_OBJECT (data->file), data->callback, data->user_data, error); g_simple_async_result_complete (res); - g_error_free (error); load_contents_data_free (data); g_object_unref (res); } } /** - * g_file_load_partial_contents_async: + * g_file_load_partial_contents_async: (skip) * @file: input #GFile. * @cancellable: optional #GCancellable object, %NULL to ignore. * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read. @@ -6466,10 +6431,10 @@ g_file_load_partial_contents_async (GFile *file, * g_file_load_partial_contents_finish: * @file: input #GFile. * @res: a #GAsyncResult. - * @contents: a location to place the contents of the file. - * @length: a location to place the length of the contents of the file, + * @contents: (out) (transfer full): a location to place the contents of the file. + * @length: (out) (allow-none): a location to place the length of the contents of the file, * or %NULL if the length is not needed - * @etag_out: a location to place the current entity tag for the file, + * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, * or %NULL if the entity tag is not needed * @error: a #GError, or %NULL * @@ -6572,10 +6537,10 @@ g_file_load_contents_async (GFile *file, * g_file_load_contents_finish: * @file: input #GFile. * @res: a #GAsyncResult. - * @contents: a location to place the contents of the file. - * @length: a location to place the length of the contents of the file, + * @contents: (out) (transfer full): a location to place the contents of the file. + * @length: (out) (allow-none): a location to place the length of the contents of the file, * or %NULL if the length is not needed - * @etag_out: a location to place the current entity tag for the file, + * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, * or %NULL if the entity tag is not needed * @error: a #GError, or %NULL * @@ -6609,11 +6574,11 @@ g_file_load_contents_finish (GFile *file, * @file: input #GFile. * @contents: a string containing the new contents for @file. * @length: the length of @contents in bytes. - * @etag: the old entity tag + * @etag: (allow-none): the old entity tag * for the document, or %NULL * @make_backup: %TRUE if a backup should be created. * @flags: a set of #GFileCreateFlags. - * @new_etag: a location to a new entity tag + * @new_etag: (allow-none) (out): a location to a new entity tag * for the document. This should be freed with g_free() when no longer * needed, or %NULL * @cancellable: optional #GCancellable object, %NULL to ignore. @@ -6807,12 +6772,11 @@ replace_contents_open_callback (GObject *obj, } else { - res = g_simple_async_result_new_from_error (G_OBJECT (data->file), + res = g_simple_async_result_new_take_error (G_OBJECT (data->file), data->callback, data->user_data, error); g_simple_async_result_complete (res); - g_error_free (error); replace_contents_data_free (data); g_object_unref (res); } @@ -6823,7 +6787,7 @@ replace_contents_open_callback (GObject *obj, * @file: input #GFile. * @contents: string of contents to replace the file with. * @length: the length of @contents in bytes. - * @etag: a new entity tag for the @file, or %NULL + * @etag: (allow-none): a new entity tag for the @file, or %NULL * @make_backup: %TRUE if a backup should be created. * @flags: a set of #GFileCreateFlags. * @cancellable: optional #GCancellable object, %NULL to ignore. @@ -6886,7 +6850,7 @@ g_file_replace_contents_async (GFile *file, * g_file_replace_contents_finish: * @file: input #GFile. * @res: a #GAsyncResult. - * @new_etag: a location of a new entity tag + * @new_etag: (out) (allow-none): a location of a new entity tag * for the document. This should be freed with g_free() when it is no * longer needed, or %NULL * @error: a #GError, or %NULL @@ -7225,6 +7189,3 @@ g_file_supports_thread_contexts (GFile *file) iface = G_FILE_GET_IFACE (file); return iface->supports_thread_contexts; } - -#define __G_FILE_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c index 0aad1a7..47b9425 100644 --- a/gio/gfileattribute.c +++ b/gio/gfileattribute.c @@ -29,7 +29,6 @@ #include #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfileattribute @@ -337,23 +336,9 @@ _g_file_attribute_value_dup (const GFileAttributeValue *other) return attr; } -GType -g_file_attribute_info_list_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - GType g_define_type_id = - g_boxed_type_register_static (I_("GFileAttributeInfoList"), - (GBoxedCopyFunc) g_file_attribute_info_list_dup, - (GBoxedFreeFunc) g_file_attribute_info_list_unref); - - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } - - return g_define_type_id__volatile; -} +G_DEFINE_BOXED_TYPE (GFileAttributeInfoList, g_file_attribute_info_list, + g_file_attribute_info_list_dup, + g_file_attribute_info_list_unref) static gboolean valid_char (char c) @@ -1068,6 +1053,3 @@ g_file_attribute_info_list_add (GFileAttributeInfoList *list, list_update_public (priv); } - -#define __G_FILE_ATTRIBUTE_C__ -#include "gioaliasdef.c" diff --git a/gio/gfiledescriptorbased.c b/gio/gfiledescriptorbased.c index c19da44..6d4ef13 100644 --- a/gio/gfiledescriptorbased.c +++ b/gio/gfiledescriptorbased.c @@ -24,17 +24,20 @@ #include "gfiledescriptorbased.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfiledescriptorbased * @short_description: Interface for file descriptor based IO - * @include: gio/gio.h + * @include: gio/gfiledescriptorbased.h * @see_also: #GInputStream, #GOutputStream * * #GFileDescriptorBased is implemented by streams (implementations of * #GInputStream or #GOutputStream) that are based on file descriptors. * + * Note that <gio/gfiledescriptorbased.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. + * * Since: 2.24 * **/ @@ -68,7 +71,3 @@ g_file_descriptor_based_get_fd (GFileDescriptorBased *fd_based) return (* iface->get_fd) (fd_based); } - - -#define __G_FILE_DESCRIPTOR_BASED_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c index f97ce91..ac7a724 100644 --- a/gio/gfileenumerator.c +++ b/gio/gfileenumerator.c @@ -30,7 +30,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfileenumerator @@ -186,7 +185,7 @@ g_file_enumerator_init (GFileEnumerator *enumerator) * enumerator is at the end, %NULL will be returned and @error will * be unset. * - * Return value: A #GFileInfo or %NULL on error or end of enumerator. + * Return value: (transfer full): A #GFileInfo or %NULL on error or end of enumerator. * Free the returned object with g_object_unref() when no longer needed. **/ GFileInfo * @@ -391,7 +390,7 @@ g_file_enumerator_next_files_async (GFileEnumerator *enumerator, * * Finishes the asynchronous operation started with g_file_enumerator_next_files_async(). * - * Returns: a #GList of #GFileInfos. You must free the list with + * Returns: (transfer full) (element-type Gio.FileInfo): a #GList of #GFileInfos. You must free the list with * g_list_free() and unref the infos with g_object_unref() when you're * done with them. **/ @@ -587,7 +586,7 @@ g_file_enumerator_set_pending (GFileEnumerator *enumerator, * * Get the #GFile container which is being enumerated. * - * Returns: the #GFile which is being enumerated. + * Returns: (transfer full): the #GFile which is being enumerated. * * Since: 2.18 */ @@ -719,10 +718,7 @@ close_async_thread (GSimpleAsyncResult *res, class = G_FILE_ENUMERATOR_GET_CLASS (object); result = class->close_fn (G_FILE_ENUMERATOR (object), cancellable, &error); if (!result) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } @@ -759,6 +755,3 @@ g_file_enumerator_real_close_finish (GFileEnumerator *enumerator, g_file_enumerator_real_close_async); return TRUE; } - -#define __G_FILE_ENUMERATOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileenumerator.h b/gio/gfileenumerator.h index 1214b49..a0cfaaf 100644 --- a/gio/gfileenumerator.h +++ b/gio/gfileenumerator.h @@ -40,7 +40,6 @@ G_BEGIN_DECLS /** * GFileEnumerator: - * @parent_instance: The parent class. * * A per matched file iterator. **/ diff --git a/gio/gfileicon.c b/gio/gfileicon.c index 4842fb6..74d75b8 100644 --- a/gio/gfileicon.c +++ b/gio/gfileicon.c @@ -31,7 +31,6 @@ #include "gsimpleasyncresult.h" #include "gioerror.h" -#include "gioalias.h" /** * SECTION:gfileicon @@ -159,7 +158,7 @@ g_file_icon_init (GFileIcon *file) * * Creates a new icon for a file. * - * Returns: a #GIcon for the given @file, or %NULL on error. + * Returns: (transfer full): a #GIcon for the given @file, or %NULL on error. **/ GIcon * g_file_icon_new (GFile *file) @@ -175,7 +174,7 @@ g_file_icon_new (GFile *file) * * Gets the #GFile associated with the given @icon. * - * Returns: a #GFile, or %NULL. + * Returns: (transfer none): a #GFile, or %NULL. **/ GFile * g_file_icon_get_file (GFileIcon *icon) @@ -310,11 +309,10 @@ load_async_callback (GObject *source_object, if (stream == NULL) { - simple = g_simple_async_result_new_from_error (G_OBJECT (data->icon), + simple = g_simple_async_result_new_take_error (G_OBJECT (data->icon), data->callback, data->user_data, error); - g_error_free (error); } else { @@ -383,6 +381,3 @@ g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface) iface->load_async = g_file_icon_load_async; iface->load_finish = g_file_icon_load_finish; } - -#define __G_FILE_ICON_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c index 23cc888..073937b 100644 --- a/gio/gfileinfo.c +++ b/gio/gfileinfo.c @@ -62,7 +62,6 @@ #include "gicon.h" #include "glibintl.h" -#include "gioalias.h" /* We use this nasty thing, because NULL is a valid attribute matcher (matches nothing) */ #define NO_ATTRIBUTE_MASK ((GFileAttributeMatcher *)1) @@ -408,7 +407,7 @@ g_file_info_copy_into (GFileInfo *src_info, * * Duplicates a file info structure. * - * Returns: a duplicate #GFileInfo of @other. + * Returns: (transfer full): a duplicate #GFileInfo of @other. **/ GFileInfo * g_file_info_dup (GFileInfo *other) @@ -618,7 +617,7 @@ g_file_info_has_namespace (GFileInfo *info, * * Lists the file info structure's attributes. * - * Returns: a null-terminated array of strings of all of the + * Returns: (array zero-terminated=1) (transfer full): a null-terminated array of strings of all of the * possible attribute types for the given @name_space, or * %NULL on error. **/ @@ -709,13 +708,13 @@ g_file_info_remove_attribute (GFileInfo *info, * g_file_info_get_attribute_data: * @info: a #GFileInfo * @attribute: a file attribute key - * @type: return location for the attribute type, or %NULL - * @value_pp: return location for the attribute value, or %NULL - * @status: return location for the attribute status, or %NULL + * @type: (out) (allow-none): return location for the attribute type, or %NULL + * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL + * @status: (out) (allow-none): return location for the attribute status, or %NULL * * Gets the attribute type, value and status for an attribute key. * - * Returns: %TRUE if @info has an attribute named @attribute, + * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, * %FALSE otherwise. */ gboolean @@ -794,8 +793,8 @@ g_file_info_set_attribute_status (GFileInfo *info, { GFileAttributeValue *val; - g_return_val_if_fail (G_IS_FILE_INFO (info), 0); - g_return_val_if_fail (attribute != NULL && *attribute != '\0', 0); + g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE); + g_return_val_if_fail (attribute != NULL && *attribute != '\0', FALSE); val = g_file_info_find_value_by_name (info, attribute); if (val) @@ -850,7 +849,7 @@ g_file_info_get_attribute_as_string (GFileInfo *info, * Gets the value of a #GObject attribute. If the attribute does * not contain a #GObject, %NULL will be returned. * - * Returns: a #GObject associated with the given @attribute, or + * Returns: (transfer none): a #GObject associated with the given @attribute, or * %NULL otherwise. **/ GObject * @@ -922,7 +921,7 @@ g_file_info_get_attribute_byte_string (GFileInfo *info, * Gets the value of a stringv attribute. If the attribute does * not contain a stringv, %NULL will be returned. * - * Returns: the contents of the @attribute value as a stringv, or + * Returns: (transfer none): the contents of the @attribute value as a stringv, or * %NULL otherwise. Do not free. * * Since: 2.22 @@ -1604,7 +1603,7 @@ g_file_info_get_edit_name (GFileInfo *info) * * Gets the icon for a file. * - * Returns: #GIcon for the given @info. + * Returns: (transfer none): #GIcon for the given @info. **/ GIcon * g_file_info_get_icon (GFileInfo *info) @@ -2148,6 +2147,10 @@ matcher_add (GFileAttributeMatcher *matcher, g_array_append_val (matcher->more_sub_matchers, s); } +G_DEFINE_BOXED_TYPE (GFileAttributeMatcher, g_file_attribute_matcher, + g_file_attribute_matcher_ref, + g_file_attribute_matcher_unref) + /** * g_file_attribute_matcher_new: * @attributes: an attribute string to match. @@ -2481,6 +2484,3 @@ g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher) return get_attribute_for_id (sub_matcher->id); } } - -#define __G_FILE_INFO_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileinfo.h b/gio/gfileinfo.h index 2b5110f..90188eb 100644 --- a/gio/gfileinfo.h +++ b/gio/gfileinfo.h @@ -935,6 +935,7 @@ void g_file_info_set_symlink_target (GFileInfo *info, void g_file_info_set_sort_order (GFileInfo *info, gint32 sort_order); +GType g_file_attribute_matcher_get_type (void) G_GNUC_CONST; GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes); GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher); void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher); diff --git a/gio/gfileinputstream.c b/gio/gfileinputstream.c index 502584b..42942b4 100644 --- a/gio/gfileinputstream.c +++ b/gio/gfileinputstream.c @@ -31,7 +31,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfileinputstream @@ -113,7 +112,7 @@ g_file_input_stream_init (GFileInputStream *stream) * g_file_input_stream_query_info: * @stream: a #GFileInputStream. * @attributes: a file attribute query string. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError location to store the error occuring, or %NULL to * ignore. * @@ -123,7 +122,7 @@ g_file_input_stream_init (GFileInputStream *stream) * stream is blocked, the stream will set the pending flag internally, and * any other operations on the stream will fail with %G_IO_ERROR_PENDING. * - * Returns: a #GFileInfo, or %NULL on error. + * Returns: (transfer full): a #GFileInfo, or %NULL on error. **/ GFileInfo * g_file_input_stream_query_info (GFileInputStream *stream, @@ -181,9 +180,9 @@ async_ready_callback_wrapper (GObject *source_object, * @attributes: a file attribute query string. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Queries the stream information asynchronously. * When the operation is finished @callback will be called. @@ -216,11 +215,10 @@ g_file_input_stream_query_info_async (GFileInputStream *stream, if (!g_input_stream_set_pending (input_stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -241,7 +239,7 @@ g_file_input_stream_query_info_async (GFileInputStream *stream, * * Finishes an asynchronous info query operation. * - * Returns: #GFileInfo. + * Returns: (transfer full): #GFileInfo. **/ GFileInfo * g_file_input_stream_query_info_finish (GFileInputStream *stream, @@ -422,10 +420,7 @@ query_info_async_thread (GSimpleAsyncResult *res, _("Stream doesn't support query_info")); if (info == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->info = info; } @@ -467,7 +462,3 @@ g_file_input_stream_real_query_info_finish (GFileInputStream *stream, return NULL; } - -#define __G_FILE_INPUT_STREAM_C__ -#include "gioaliasdef.c" - diff --git a/gio/gfileinputstream.h b/gio/gfileinputstream.h index 3c162c7..08c056e 100644 --- a/gio/gfileinputstream.h +++ b/gio/gfileinputstream.h @@ -79,7 +79,7 @@ struct _GFileInputStreamClass GAsyncReadyCallback callback, gpointer user_data); GFileInfo * (* query_info_finish) (GFileInputStream *stream, - GAsyncResult *res, + GAsyncResult *result, GError **error); /*< private >*/ diff --git a/gio/gfileiostream.c b/gio/gfileiostream.c index d7bff9d..85a8dd9 100644 --- a/gio/gfileiostream.c +++ b/gio/gfileiostream.c @@ -32,7 +32,6 @@ #include "gfileoutputstream.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfileiostream @@ -116,7 +115,7 @@ g_file_io_stream_init (GFileIOStream *stream) * g_file_io_stream_query_info: * @stream: a #GFileIOStream. * @attributes: a file attribute query string. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError, %NULL to ignore. * * Queries a file io stream for the given @attributes. @@ -137,7 +136,7 @@ g_file_io_stream_init (GFileIOStream *stream) * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will * be returned. * - * Returns: a #GFileInfo for the @stream, or %NULL on error. + * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error. * * Since: 2.22 **/ @@ -197,9 +196,9 @@ async_ready_callback_wrapper (GObject *source_object, * @attributes: a file attribute query string. * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Asynchronously queries the @stream for a #GFileInfo. When completed, * @callback will be called with a #GAsyncResult which can be used to @@ -228,11 +227,10 @@ g_file_io_stream_query_info_async (GFileIOStream *stream, if (!g_io_stream_set_pending (io_stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -253,7 +251,7 @@ g_file_io_stream_query_info_async (GFileIOStream *stream, * Finalizes the asynchronous query started * by g_file_io_stream_query_info_async(). * - * Returns: A #GFileInfo for the finished query. + * Returns: (transfer full): A #GFileInfo for the finished query. * * Since: 2.22 **/ @@ -672,6 +670,3 @@ g_file_io_stream_class_init (GFileIOStreamClass *klass) klass->query_info_finish = g_file_io_stream_real_query_info_finish; klass->get_etag = g_file_io_stream_real_get_etag; } - -#define __G_FILE_IO_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileiostream.h b/gio/gfileiostream.h index 09c9922..31497e3 100644 --- a/gio/gfileiostream.h +++ b/gio/gfileiostream.h @@ -84,7 +84,7 @@ struct _GFileIOStreamClass GAsyncReadyCallback callback, gpointer user_data); GFileInfo * (* query_info_finish) (GFileIOStream *stream, - GAsyncResult *res, + GAsyncResult *result, GError **error); char * (* get_etag) (GFileIOStream *stream); diff --git a/gio/gfilemonitor.c b/gio/gfilemonitor.c index a470baa..f7a87b6 100644 --- a/gio/gfilemonitor.c +++ b/gio/gfilemonitor.c @@ -30,7 +30,6 @@ #include "gvfs.h" #include "glibintl.h" -#include "gioalias.h" struct _FileChange; typedef struct _FileChange FileChange; @@ -225,10 +224,16 @@ g_file_monitor_class_init (GFileMonitorClass *klass) * GFileMonitor::changed: * @monitor: a #GFileMonitor. * @file: a #GFile. - * @other_file: a #GFile. + * @other_file: a #GFile or #NULL. * @event_type: a #GFileMonitorEvent. - * - * Emitted when a file has been changed. + * + * Emitted when @file has been changed. + * + * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is + * #G_FILE_MONITOR_SEND_MOVED, @file will be set to a #GFile containing the + * old path, and @other_file will be set to a #GFile containing the new path. + * + * In all the other cases, @other_file will be set to #NULL. **/ signals[CHANGED] = g_signal_new (I_("changed"), @@ -328,21 +333,21 @@ g_file_monitor_cancel (GFileMonitor* monitor) /** * g_file_monitor_set_rate_limit: * @monitor: a #GFileMonitor. - * @limit_msecs: a integer with the limit in milliseconds to - * poll for changes. + * @limit_msecs: a non-negative integer with the limit in milliseconds + * to poll for changes * * Sets the rate limit to which the @monitor will report - * consecutive change events to the same file. - * - **/ + * consecutive change events to the same file. + */ void g_file_monitor_set_rate_limit (GFileMonitor *monitor, - int limit_msecs) + gint limit_msecs) { GFileMonitorPrivate *priv; - + g_return_if_fail (G_IS_FILE_MONITOR (monitor)); - + g_return_if_fail (limit_msecs >= 0); + priv = monitor->priv; if (priv->rate_limit_msec != limit_msecs) { @@ -726,6 +731,3 @@ g_file_monitor_emit_event (GFileMonitor *monitor, update_rate_limiter_timeout (monitor, limiter->send_virtual_changes_done_at); } } - -#define __G_FILE_MONITOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gfilemonitor.h b/gio/gfilemonitor.h index cf6f6be..8e27d22 100644 --- a/gio/gfilemonitor.h +++ b/gio/gfilemonitor.h @@ -81,7 +81,7 @@ GType g_file_monitor_get_type (void) G_GNUC_CONST; gboolean g_file_monitor_cancel (GFileMonitor *monitor); gboolean g_file_monitor_is_cancelled (GFileMonitor *monitor); void g_file_monitor_set_rate_limit (GFileMonitor *monitor, - int limit_msecs); + gint limit_msecs); /* For implementations */ diff --git a/gio/gfilenamecompleter.c b/gio/gfilenamecompleter.c index 5247677..e84b17f 100644 --- a/gio/gfilenamecompleter.c +++ b/gio/gfilenamecompleter.c @@ -30,7 +30,6 @@ #include #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfilenamecompleter @@ -465,7 +464,7 @@ g_filename_completer_get_completion_suffix (GFilenameCompleter *completer, * * Gets an array of completion strings for a given initial text. * - * Returns: array of strings with possible completions for @initial_text. + * Returns: (array zero-terminated=1) (transfer full): array of strings with possible completions for @initial_text. * This array must be freed by g_strfreev() when finished. **/ char ** @@ -515,6 +514,3 @@ g_filename_completer_set_dirs_only (GFilenameCompleter *completer, completer->dirs_only = dirs_only; } - -#define __G_FILENAME_COMPLETER_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileoutputstream.c b/gio/gfileoutputstream.c index 832042e..ce09eb8 100644 --- a/gio/gfileoutputstream.c +++ b/gio/gfileoutputstream.c @@ -31,7 +31,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfileoutputstream @@ -138,7 +137,7 @@ g_file_output_stream_init (GFileOutputStream *stream) * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will * be returned. * - * Returns: a #GFileInfo for the @stream, or %NULL on error. + * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error. **/ GFileInfo * g_file_output_stream_query_info (GFileOutputStream *stream, @@ -226,11 +225,10 @@ g_file_output_stream_query_info_async (GFileOutputStream *stream, if (!g_output_stream_set_pending (output_stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -251,7 +249,7 @@ g_file_output_stream_query_info_async (GFileOutputStream *stream, * Finalizes the asynchronous query started * by g_file_output_stream_query_info_async(). * - * Returns: A #GFileInfo for the finished query. + * Returns: (transfer full): A #GFileInfo for the finished query. **/ GFileInfo * g_file_output_stream_query_info_finish (GFileOutputStream *stream, @@ -525,10 +523,7 @@ query_info_async_thread (GSimpleAsyncResult *res, _("Stream doesn't support query_info")); if (info == NULL) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); else data->info = info; } @@ -570,6 +565,3 @@ g_file_output_stream_real_query_info_finish (GFileOutputStream *stream, return NULL; } - -#define __G_FILE_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gfileoutputstream.h b/gio/gfileoutputstream.h index b2c27f5..3b5f85d 100644 --- a/gio/gfileoutputstream.h +++ b/gio/gfileoutputstream.h @@ -84,7 +84,7 @@ struct _GFileOutputStreamClass GAsyncReadyCallback callback, gpointer user_data); GFileInfo * (* query_info_finish) (GFileOutputStream *stream, - GAsyncResult *res, + GAsyncResult *result, GError **error); char * (* get_etag) (GFileOutputStream *stream); diff --git a/gio/gfilterinputstream.c b/gio/gfilterinputstream.c index 53e305a..ec8472c 100644 --- a/gio/gfilterinputstream.c +++ b/gio/gfilterinputstream.c @@ -26,13 +26,16 @@ #include "gsimpleasyncresult.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfilterinputstream * @short_description: Filter Input Stream * @include: gio/gio.h * + * Base class for input stream implementations that perform some + * kind of filtering operation on a base stream. Typical examples + * of filtering operations are character set conversion, compression + * and byte order flipping. **/ enum { @@ -66,7 +69,7 @@ static gboolean g_filter_input_stream_close (GInputStream *stream GCancellable *cancellable, GError **error); -G_DEFINE_TYPE (GFilterInputStream, g_filter_input_stream, G_TYPE_INPUT_STREAM) +G_DEFINE_ABSTRACT_TYPE (GFilterInputStream, g_filter_input_stream, G_TYPE_INPUT_STREAM) #define GET_PRIVATE(inst) G_TYPE_INSTANCE_GET_PRIVATE (inst, \ G_TYPE_FILTER_INPUT_STREAM, GFilterInputStreamPrivate) @@ -195,7 +198,7 @@ g_filter_input_stream_init (GFilterInputStream *stream) * * Gets the base stream for the filter stream. * - * Returns: a #GInputStream. + * Returns: (transfer none): a #GInputStream. **/ GInputStream * g_filter_input_stream_get_base_stream (GFilterInputStream *stream) @@ -313,6 +316,3 @@ g_filter_input_stream_close (GInputStream *stream, return res; } - -#define __G_FILTER_INPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gfilteroutputstream.c b/gio/gfilteroutputstream.c index 606f669..7755b9e 100644 --- a/gio/gfilteroutputstream.c +++ b/gio/gfilteroutputstream.c @@ -26,14 +26,17 @@ #include "goutputstream.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gfilteroutputstream * @short_description: Filter Output Stream * @include: gio/gio.h * - **/ + * Base class for output stream implementations that perform some + * kind of filtering operation on a base stream. Typical examples + * of filtering operations are character set conversion, compression + * and byte order flipping. + */ enum { PROP_0, @@ -65,7 +68,7 @@ static gboolean g_filter_output_stream_close (GOutputStream *stream, GCancellable *cancellable, GError **error); -G_DEFINE_TYPE (GFilterOutputStream, g_filter_output_stream, G_TYPE_OUTPUT_STREAM) +G_DEFINE_ABSTRACT_TYPE (GFilterOutputStream, g_filter_output_stream, G_TYPE_OUTPUT_STREAM) #define GET_PRIVATE(inst) G_TYPE_INSTANCE_GET_PRIVATE (inst, \ G_TYPE_FILTER_OUTPUT_STREAM, GFilterOutputStreamPrivate) @@ -196,7 +199,7 @@ g_filter_output_stream_init (GFilterOutputStream *stream) * * Gets the base stream for the filter stream. * - * Returns: a #GOutputStream. + * Returns: (transfer none): a #GOutputStream. **/ GOutputStream * g_filter_output_stream_get_base_stream (GFilterOutputStream *stream) @@ -307,6 +310,3 @@ g_filter_output_stream_close (GOutputStream *stream, return res; } - -#define __G_FILTER_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gicon.c b/gio/gicon.c index 5c0083e..115a3f5 100644 --- a/gio/gicon.c +++ b/gio/gicon.c @@ -33,7 +33,6 @@ #include "glibintl.h" -#include "gioalias.h" /* There versioning of this is implicit, version 1 would be ".1 " */ #define G_ICON_SERIALIZATION_MAGIC0 ". " @@ -76,7 +75,8 @@ g_icon_default_init (GIconInterface *iface) * @icon: #gconstpointer to an icon object. * * Gets a hash for an icon. - * + * + * Virtual: hash * Returns: a #guint containing a hash for the @icon, suitable for * use in a #GHashTable or similar data structure. **/ @@ -199,6 +199,7 @@ g_icon_to_string_tokenized (GIcon *icon, GString *s) * * * + * Virtual: to_tokens * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't * be serialized. Use g_free() to free. * @@ -450,7 +451,3 @@ g_icon_new_for_string (const gchar *str, return icon; } - - -#define __G_ICON_C__ -#include "gioaliasdef.c" diff --git a/gio/ginetaddress.c b/gio/ginetaddress.c index f6c5d5b..429cac2 100644 --- a/gio/ginetaddress.c +++ b/gio/ginetaddress.c @@ -33,7 +33,6 @@ #include "glibintl.h" #include "gnetworkingprivate.h" -#include "gioalias.h" /** * SECTION:ginetaddress @@ -866,6 +865,3 @@ g_inet_address_get_is_mc_site_local (GInetAddress *address) else return IN6_IS_ADDR_MC_SITELOCAL (&address->priv->addr.ipv6); } - -#define __G_INET_ADDRESS_C__ -#include "gioaliasdef.c" diff --git a/gio/ginetsocketaddress.c b/gio/ginetsocketaddress.c index 3fc584a..3f0935b 100644 --- a/gio/ginetsocketaddress.c +++ b/gio/ginetsocketaddress.c @@ -31,7 +31,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:ginetsocketaddress @@ -167,7 +166,7 @@ g_inet_socket_address_to_native (GSocketAddress *address, GInetSocketAddress *addr; GSocketFamily family; - g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (address), 0); + g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (address), FALSE); addr = G_INET_SOCKET_ADDRESS (address); family = g_inet_address_get_family (addr->priv->address); @@ -290,7 +289,7 @@ g_inet_socket_address_new (GInetAddress *address, * * Gets @address's #GInetAddress. * - * Returns: the #GInetAddress for @address, which must be + * Returns: (transfer full): the #GInetAddress for @address, which must be * g_object_ref()'d if it will be stored * * Since: 2.22 @@ -320,6 +319,3 @@ g_inet_socket_address_get_port (GInetSocketAddress *address) return address->priv->port; } - -#define __G_INET_SOCKET_ADDRESS_C__ -#include "gioaliasdef.c" diff --git a/gio/ginitable.c b/gio/ginitable.c index f243b73..0fdbe76 100644 --- a/gio/ginitable.c +++ b/gio/ginitable.c @@ -24,7 +24,6 @@ #include "ginitable.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:ginitable @@ -52,35 +51,12 @@ * an exception on failure. */ -GType -g_initable_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - const GTypeInfo initable_info = - { - sizeof (GInitableIface), /* class_size */ - NULL, /* base_init */ - NULL, /* base_finalize */ - NULL, - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL - }; - GType g_define_type_id = - g_type_register_static (G_TYPE_INTERFACE, I_("GInitable"), - &initable_info, 0); - - g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT); - - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } +typedef GInitableIface GInitableInterface; +G_DEFINE_INTERFACE (GInitable, g_initable, G_TYPE_OBJECT) - return g_define_type_id__volatile; +static void +g_initable_default_init (GInitableInterface *iface) +{ } /** @@ -144,7 +120,7 @@ g_initable_init (GInitable *initable, * similar to g_object_new() but also initializes the object * and returns %NULL, setting an error on failure. * - * Return value: a newly allocated #GObject, or %NULL on error + * Return value: (transfer full): a newly allocated #GObject, or %NULL on error * * Since: 2.22 */ @@ -180,7 +156,7 @@ g_initable_new (GType object_type, * similar to g_object_newv() but also initializes the object * and returns %NULL, setting an error on failure. * - * Return value: a newly allocated #GObject, or %NULL on error + * Return value: (transfer full): a newly allocated #GObject, or %NULL on error * * Since: 2.22 */ @@ -220,7 +196,7 @@ g_initable_newv (GType object_type, * similar to g_object_new_valist() but also initializes the object * and returns %NULL, setting an error on failure. * - * Return value: a newly allocated #GObject, or %NULL on error + * Return value: (transfer full): a newly allocated #GObject, or %NULL on error * * Since: 2.22 */ @@ -247,6 +223,3 @@ g_initable_new_valist (GType object_type, return obj; } - -#define __G_INITABLE_C__ -#include "gioaliasdef.c" diff --git a/gio/ginputstream.c b/gio/ginputstream.c index 215d6ac..53e84a0 100644 --- a/gio/ginputstream.c +++ b/gio/ginputstream.c @@ -31,7 +31,6 @@ #include "gsimpleasyncresult.h" #include "gioerror.h" -#include "gioalias.h" /** * SECTION:ginputstream @@ -48,7 +47,7 @@ * All of these functions have async variants too. **/ -G_DEFINE_TYPE (GInputStream, g_input_stream, G_TYPE_OBJECT); +G_DEFINE_ABSTRACT_TYPE (GInputStream, g_input_stream, G_TYPE_OBJECT); struct _GInputStreamPrivate { guint closed : 1; @@ -140,7 +139,7 @@ g_input_stream_init (GInputStream *stream) * @stream: a #GInputStream. * @buffer: a buffer to read data into (which should be at least count bytes long). * @count: the number of bytes that will be read from the stream - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: location to store the error occuring, or %NULL to ignore * * Tries to read @count bytes from the stream into the buffer starting at @@ -217,8 +216,8 @@ g_input_stream_read (GInputStream *stream, * @stream: a #GInputStream. * @buffer: a buffer to read data into (which should be at least count bytes long). * @count: the number of bytes that will be read from the stream - * @bytes_read: location to store the number of bytes that was read from the stream - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @bytes_read: (out): location to store the number of bytes that was read from the stream + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: location to store the error occuring, or %NULL to ignore * * Tries to read @count bytes from the stream into the buffer starting at @@ -278,7 +277,7 @@ g_input_stream_read_all (GInputStream *stream, * g_input_stream_skip: * @stream: a #GInputStream. * @count: the number of bytes that will be skipped from the stream - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: location to store the error occuring, or %NULL to ignore * * Tries to skip @count bytes from the stream. Will block during the operation. @@ -394,7 +393,7 @@ g_input_stream_real_skip (GInputStream *stream, /** * g_input_stream_close: * @stream: A #GInputStream. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: location to store the error occuring, or %NULL to ignore * * Closes the stream, releasing resources related to it. @@ -493,9 +492,9 @@ async_ready_close_callback_wrapper (GObject *source_object, * @count: the number of bytes that will be read from the stream * @io_priority: the I/O priority * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Request an asynchronous read of @count bytes from the stream into the buffer * starting at @buffer. When the operation is finished @callback will be called. @@ -561,11 +560,10 @@ g_input_stream_read_async (GInputStream *stream, if (!g_input_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -617,35 +615,35 @@ g_input_stream_read_finish (GInputStream *stream, * g_input_stream_skip_async: * @stream: A #GInputStream. * @count: the number of bytes that will be skipped from the stream - * @io_priority: the I/O priority - * of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @io_priority: the I/O priority + * of the request. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Request an asynchronous skip of @count bytes from the stream. - * When the operation is finished @callback will be called. - * You can then call g_input_stream_skip_finish() to get the result of the - * operation. + * When the operation is finished @callback will be called. + * You can then call g_input_stream_skip_finish() to get the result + * of the operation. * - * During an async request no other sync and async calls are allowed, and will - * result in %G_IO_ERROR_PENDING errors. + * During an async request no other sync and async calls are allowed, + * and will result in %G_IO_ERROR_PENDING errors. * * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. * - * On success, the number of bytes skipped will be passed to the - * callback. It is not an error if this is not the same as the requested size, as it + * On success, the number of bytes skipped will be passed to the callback. + * It is not an error if this is not the same as the requested size, as it * can happen e.g. near the end of a file, but generally we try to skip * as many bytes as requested. Zero is returned on end of file * (or if @count is zero), but never otherwise. * - * Any outstanding i/o request with higher priority (lower numerical value) will - * be executed before an outstanding request with lower priority. Default - * priority is %G_PRIORITY_DEFAULT. + * Any outstanding i/o request with higher priority (lower numerical value) + * will be executed before an outstanding request with lower priority. + * Default priority is %G_PRIORITY_DEFAULT. * - * The asyncronous methods have a default fallback that uses threads to implement - * asynchronicity, so they are optional for inheriting classes. However, if you - * override one you must override all. + * The asynchronous methods have a default fallback that uses threads to + * implement asynchronicity, so they are optional for inheriting classes. + * However, if you override one, you must override all. **/ void g_input_stream_skip_async (GInputStream *stream, @@ -686,11 +684,10 @@ g_input_stream_skip_async (GInputStream *stream, if (!g_input_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -743,9 +740,9 @@ g_input_stream_skip_finish (GInputStream *stream, * @stream: A #GInputStream. * @io_priority: the I/O priority * of the request. - * @cancellable: optional cancellable object - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional cancellable object + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Requests an asynchronous closes of the stream, releasing resources related to it. * When the operation is finished @callback will be called. @@ -785,11 +782,10 @@ g_input_stream_close_async (GInputStream *stream, if (!g_input_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -948,10 +944,7 @@ read_async_thread (GSimpleAsyncResult *res, op->buffer, op->count_requested, cancellable, &error); if (op->count_read == -1) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } static void @@ -1013,10 +1006,7 @@ skip_async_thread (GSimpleAsyncResult *res, op->count_requested, cancellable, &error); if (op->count_skipped == -1) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } typedef struct { @@ -1067,13 +1057,12 @@ skip_callback_wrapper (GObject *source_object, if (ret == -1) { - if (data->count_skipped && - error->domain == G_IO_ERROR && - error->code == G_IO_ERROR_CANCELLED) - { /* No error, return partial read */ } + if (data->count_skipped && + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + /* No error, return partial read */ + g_error_free (error); else - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); + g_simple_async_result_take_error (simple, error); } /* Complete immediately, not in idle, since we're already in a mainloop callout */ @@ -1165,10 +1154,7 @@ close_async_thread (GSimpleAsyncResult *res, { result = class->close_fn (G_INPUT_STREAM (object), cancellable, &error); if (!result) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } } @@ -1204,6 +1190,3 @@ g_input_stream_real_close_finish (GInputStream *stream, g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async); return TRUE; } - -#define __G_INPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gio-marshal.c b/gio/gio-marshal.c index 5928c5c..b6a5d67 100644 --- a/gio/gio-marshal.c +++ b/gio/gio-marshal.c @@ -22,6 +22,7 @@ #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) +#define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the @@ -45,6 +46,7 @@ #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ @@ -126,7 +128,44 @@ _gio_marshal_VOID__STRING_BOXED (GClosure *closure, data2); } -/* VOID:BOOLEAN,POINTER (./gio-marshal.list:3) */ +/* VOID:STRING,VARIANT (./gio-marshal.list:3) */ +void +_gio_marshal_VOID__STRING_VARIANT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_VARIANT) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__STRING_VARIANT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_VARIANT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_variant (param_values + 2), + data2); +} + +/* VOID:BOOLEAN,POINTER (./gio-marshal.list:4) */ void _gio_marshal_VOID__BOOLEAN_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -163,7 +202,7 @@ _gio_marshal_VOID__BOOLEAN_POINTER (GClosure *closure, data2); } -/* VOID:OBJECT,OBJECT,ENUM (./gio-marshal.list:4) */ +/* VOID:OBJECT,OBJECT,ENUM (./gio-marshal.list:5) */ void _gio_marshal_VOID__OBJECT_OBJECT_ENUM (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -202,7 +241,7 @@ _gio_marshal_VOID__OBJECT_OBJECT_ENUM (GClosure *closure, data2); } -/* BOOLEAN:OBJECT,OBJECT (./gio-marshal.list:5) */ +/* BOOLEAN:OBJECT,OBJECT (./gio-marshal.list:6) */ void _gio_marshal_BOOLEAN__OBJECT_OBJECT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -243,7 +282,7 @@ _gio_marshal_BOOLEAN__OBJECT_OBJECT (GClosure *closure, g_value_set_boolean (return_value, v_return); } -/* VOID:STRING,BOXED,BOXED (./gio-marshal.list:6) */ +/* VOID:STRING,BOXED,BOXED (./gio-marshal.list:7) */ void _gio_marshal_VOID__STRING_BOXED_BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -282,3 +321,841 @@ _gio_marshal_VOID__STRING_BOXED_BOXED (GClosure *closure, data2); } +/* BOOL:POINTER,INT (./gio-marshal.list:8) */ +void +_gio_marshal_BOOLEAN__POINTER_INT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_INT) (gpointer data1, + gpointer arg_1, + gint arg_2, + gpointer data2); + register GMarshalFunc_BOOLEAN__POINTER_INT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__POINTER_INT) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_pointer (param_values + 1), + g_marshal_value_peek_int (param_values + 2), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* BOOL:UINT (./gio-marshal.list:9) */ +void +_gio_marshal_BOOLEAN__UINT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__UINT) (gpointer data1, + guint arg_1, + gpointer data2); + register GMarshalFunc_BOOLEAN__UINT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__UINT) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_uint (param_values + 1), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* BOOL:VARIANT (./gio-marshal.list:10) */ +void +_gio_marshal_BOOLEAN__VARIANT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__VARIANT) (gpointer data1, + gpointer arg_1, + gpointer data2); + register GMarshalFunc_BOOLEAN__VARIANT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__VARIANT) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_variant (param_values + 1), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* BOOL:VOID (./gio-marshal.list:11) */ +void +_gio_marshal_BOOLEAN__VOID (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, + gpointer data2); + register GMarshalFunc_BOOLEAN__VOID callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 1); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* VOID:STRING,STRING,BOXED (./gio-marshal.list:12) */ +void +_gio_marshal_VOID__STRING_STRING_BOXED (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_STRING_BOXED) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer arg_3, + gpointer data2); + register GMarshalFunc_VOID__STRING_STRING_BOXED callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_STRING_BOXED) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_string (param_values + 2), + g_marshal_value_peek_boxed (param_values + 3), + data2); +} + +/* VOID:BOOL,BOXED (./gio-marshal.list:13) */ +void +_gio_marshal_VOID__BOOLEAN_BOXED (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__BOOLEAN_BOXED) (gpointer data1, + gboolean arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__BOOLEAN_BOXED callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__BOOLEAN_BOXED) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_boolean (param_values + 1), + g_marshal_value_peek_boxed (param_values + 2), + data2); +} + +/* VOID:VARIANT,VARIANT (./gio-marshal.list:14) */ +void +_gio_marshal_VOID__VARIANT_VARIANT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__VARIANT_VARIANT) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__VARIANT_VARIANT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__VARIANT_VARIANT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_variant (param_values + 1), + g_marshal_value_peek_variant (param_values + 2), + data2); +} + +/* VOID:INT (./gio-marshal.list:15) */ + +/* VOID:STRING,INT (./gio-marshal.list:16) */ +void +_gio_marshal_VOID__STRING_INT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_INT) (gpointer data1, + gpointer arg_1, + gint arg_2, + gpointer data2); + register GMarshalFunc_VOID__STRING_INT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_INT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_int (param_values + 2), + data2); +} + +/* VOID:STRING,UINT (./gio-marshal.list:17) */ +void +_gio_marshal_VOID__STRING_UINT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_UINT) (gpointer data1, + gpointer arg_1, + guint arg_2, + gpointer data2); + register GMarshalFunc_VOID__STRING_UINT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_UINT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_uint (param_values + 2), + data2); +} + +/* VOID:BOXED,BOXED (./gio-marshal.list:18) */ +void +_gio_marshal_VOID__BOXED_BOXED (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__BOXED_BOXED) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__BOXED_BOXED callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__BOXED_BOXED) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_boxed (param_values + 1), + g_marshal_value_peek_boxed (param_values + 2), + data2); +} + +/* VOID:VARIANT,BOXED (./gio-marshal.list:19) */ +void +_gio_marshal_VOID__VARIANT_BOXED (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__VARIANT_BOXED) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__VARIANT_BOXED callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__VARIANT_BOXED) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_variant (param_values + 1), + g_marshal_value_peek_boxed (param_values + 2), + data2); +} + +/* VOID:STRING,STRING,VARIANT (./gio-marshal.list:20) */ +void +_gio_marshal_VOID__STRING_STRING_VARIANT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_STRING_VARIANT) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer arg_3, + gpointer data2); + register GMarshalFunc_VOID__STRING_STRING_VARIANT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_STRING_VARIANT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_string (param_values + 2), + g_marshal_value_peek_variant (param_values + 3), + data2); +} + +/* VOID:STRING (./gio-marshal.list:21) */ + +/* VOID:STRING,STRING (./gio-marshal.list:22) */ +void +_gio_marshal_VOID__STRING_STRING (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__STRING_STRING callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_STRING) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_string (param_values + 2), + data2); +} + +/* VOID:STRING,BOOLEAN (./gio-marshal.list:23) */ +void +_gio_marshal_VOID__STRING_BOOLEAN (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer data1, + gpointer arg_1, + gboolean arg_2, + gpointer data2); + register GMarshalFunc_VOID__STRING_BOOLEAN callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_boolean (param_values + 2), + data2); +} + +/* VOID:POINTER,INT,STRING (./gio-marshal.list:24) */ +void +_gio_marshal_VOID__POINTER_INT_STRING (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__POINTER_INT_STRING) (gpointer data1, + gpointer arg_1, + gint arg_2, + gpointer arg_3, + gpointer data2); + register GMarshalFunc_VOID__POINTER_INT_STRING callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__POINTER_INT_STRING) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_pointer (param_values + 1), + g_marshal_value_peek_int (param_values + 2), + g_marshal_value_peek_string (param_values + 3), + data2); +} + +/* BOOLEAN:OBJECT (./gio-marshal.list:25) */ +void +_gio_marshal_BOOLEAN__OBJECT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT) (gpointer data1, + gpointer arg_1, + gpointer data2); + register GMarshalFunc_BOOLEAN__OBJECT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__OBJECT) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_object (param_values + 1), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* INT:OBJECT (./gio-marshal.list:26) */ +void +_gio_marshal_INT__OBJECT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gint (*GMarshalFunc_INT__OBJECT) (gpointer data1, + gpointer arg_1, + gpointer data2); + register GMarshalFunc_INT__OBJECT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gint v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_INT__OBJECT) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_object (param_values + 1), + data2); + + g_value_set_int (return_value, v_return); +} + +/* VOID:INT64 (./gio-marshal.list:27) */ +void +_gio_marshal_VOID__INT64 (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, + gint64 arg_1, + gpointer data2); + register GMarshalFunc_VOID__INT64 callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_int64 (param_values + 1), + data2); +} + +/* VOID:UINT64 (./gio-marshal.list:28) */ +void +_gio_marshal_VOID__UINT64 (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__UINT64) (gpointer data1, + guint64 arg_1, + gpointer data2); + register GMarshalFunc_VOID__UINT64 callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__UINT64) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_uint64 (param_values + 1), + data2); +} + +/* BOOLEAN:FLAGS (./gio-marshal.list:29) */ +void +_gio_marshal_BOOLEAN__FLAGS (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__FLAGS) (gpointer data1, + guint arg_1, + gpointer data2); + register GMarshalFunc_BOOLEAN__FLAGS callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__FLAGS) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_flags (param_values + 1), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* BOOLEAN:OBJECT,FLAGS (./gio-marshal.list:30) */ +void +_gio_marshal_BOOLEAN__OBJECT_FLAGS (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_FLAGS) (gpointer data1, + gpointer arg_1, + guint arg_2, + gpointer data2); + register GMarshalFunc_BOOLEAN__OBJECT_FLAGS callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__OBJECT_FLAGS) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_object (param_values + 1), + g_marshal_value_peek_flags (param_values + 2), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* OBJECT:VOID (./gio-marshal.list:31) */ +void +_gio_marshal_OBJECT__VOID (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef GObject* (*GMarshalFunc_OBJECT__VOID) (gpointer data1, + gpointer data2); + register GMarshalFunc_OBJECT__VOID callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + GObject* v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 1); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_OBJECT__VOID) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + data2); + + g_value_take_object (return_value, v_return); +} + diff --git a/gio/gio-marshal.h b/gio/gio-marshal.h index ecb85e1..892681e 100644 --- a/gio/gio-marshal.h +++ b/gio/gio-marshal.h @@ -22,7 +22,15 @@ G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_BOXED (GClosure *closure, gpointer invocation_hint, gpointer marshal_data); -/* VOID:BOOLEAN,POINTER (./gio-marshal.list:3) */ +/* VOID:STRING,VARIANT (./gio-marshal.list:3) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_VARIANT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:BOOLEAN,POINTER (./gio-marshal.list:4) */ G_GNUC_INTERNAL void _gio_marshal_VOID__BOOLEAN_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, @@ -30,7 +38,7 @@ G_GNUC_INTERNAL void _gio_marshal_VOID__BOOLEAN_POINTER (GClosure *closure, gpointer invocation_hint, gpointer marshal_data); -/* VOID:OBJECT,OBJECT,ENUM (./gio-marshal.list:4) */ +/* VOID:OBJECT,OBJECT,ENUM (./gio-marshal.list:5) */ G_GNUC_INTERNAL void _gio_marshal_VOID__OBJECT_OBJECT_ENUM (GClosure *closure, GValue *return_value, guint n_param_values, @@ -38,7 +46,7 @@ G_GNUC_INTERNAL void _gio_marshal_VOID__OBJECT_OBJECT_ENUM (GClosure *closur gpointer invocation_hint, gpointer marshal_data); -/* BOOLEAN:OBJECT,OBJECT (./gio-marshal.list:5) */ +/* BOOLEAN:OBJECT,OBJECT (./gio-marshal.list:6) */ G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, @@ -46,7 +54,7 @@ G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__OBJECT_OBJECT (GClosure *closure, gpointer invocation_hint, gpointer marshal_data); -/* VOID:STRING,BOXED,BOXED (./gio-marshal.list:6) */ +/* VOID:STRING,BOXED,BOXED (./gio-marshal.list:7) */ G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_BOXED_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, @@ -54,6 +62,193 @@ G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_BOXED_BOXED (GClosure *closur gpointer invocation_hint, gpointer marshal_data); +/* BOOL:POINTER,INT (./gio-marshal.list:8) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__POINTER_INT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +#define _gio_marshal_BOOL__POINTER_INT _gio_marshal_BOOLEAN__POINTER_INT + +/* BOOL:UINT (./gio-marshal.list:9) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__UINT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +#define _gio_marshal_BOOL__UINT _gio_marshal_BOOLEAN__UINT + +/* BOOL:VARIANT (./gio-marshal.list:10) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__VARIANT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +#define _gio_marshal_BOOL__VARIANT _gio_marshal_BOOLEAN__VARIANT + +/* BOOL:VOID (./gio-marshal.list:11) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__VOID (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +#define _gio_marshal_BOOL__VOID _gio_marshal_BOOLEAN__VOID + +/* VOID:STRING,STRING,BOXED (./gio-marshal.list:12) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_STRING_BOXED (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:BOOL,BOXED (./gio-marshal.list:13) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__BOOLEAN_BOXED (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); +#define _gio_marshal_VOID__BOOL_BOXED _gio_marshal_VOID__BOOLEAN_BOXED + +/* VOID:VARIANT,VARIANT (./gio-marshal.list:14) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__VARIANT_VARIANT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:INT (./gio-marshal.list:15) */ +#define _gio_marshal_VOID__INT g_cclosure_marshal_VOID__INT + +/* VOID:STRING,INT (./gio-marshal.list:16) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_INT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:STRING,UINT (./gio-marshal.list:17) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_UINT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:BOXED,BOXED (./gio-marshal.list:18) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__BOXED_BOXED (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:VARIANT,BOXED (./gio-marshal.list:19) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__VARIANT_BOXED (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:STRING,STRING,VARIANT (./gio-marshal.list:20) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_STRING_VARIANT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:STRING (./gio-marshal.list:21) */ +#define _gio_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING + +/* VOID:STRING,STRING (./gio-marshal.list:22) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:STRING,BOOLEAN (./gio-marshal.list:23) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__STRING_BOOLEAN (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:POINTER,INT,STRING (./gio-marshal.list:24) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__POINTER_INT_STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* BOOLEAN:OBJECT (./gio-marshal.list:25) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__OBJECT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* INT:OBJECT (./gio-marshal.list:26) */ +G_GNUC_INTERNAL void _gio_marshal_INT__OBJECT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:INT64 (./gio-marshal.list:27) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__INT64 (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:UINT64 (./gio-marshal.list:28) */ +G_GNUC_INTERNAL void _gio_marshal_VOID__UINT64 (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* BOOLEAN:FLAGS (./gio-marshal.list:29) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__FLAGS (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* BOOLEAN:OBJECT,FLAGS (./gio-marshal.list:30) */ +G_GNUC_INTERNAL void _gio_marshal_BOOLEAN__OBJECT_FLAGS (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* OBJECT:VOID (./gio-marshal.list:31) */ +G_GNUC_INTERNAL void _gio_marshal_OBJECT__VOID (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + G_END_DECLS #endif /* ___gio_marshal_MARSHAL_H__ */ diff --git a/gio/gio-marshal.list b/gio/gio-marshal.list index 269ec35..8a42ad7 100644 --- a/gio/gio-marshal.list +++ b/gio/gio-marshal.list @@ -1,6 +1,31 @@ VOID:STRING,STRING,STRING,FLAGS VOID:STRING,BOXED +VOID:STRING,VARIANT VOID:BOOLEAN,POINTER VOID:OBJECT,OBJECT,ENUM BOOLEAN:OBJECT,OBJECT VOID:STRING,BOXED,BOXED +BOOL:POINTER,INT +BOOL:UINT +BOOL:VARIANT +BOOL:VOID +VOID:STRING,STRING,BOXED +VOID:BOOL,BOXED +VOID:VARIANT,VARIANT +VOID:INT +VOID:STRING,INT +VOID:STRING,UINT +VOID:BOXED,BOXED +VOID:VARIANT,BOXED +VOID:STRING,STRING,VARIANT +VOID:STRING +VOID:STRING,STRING +VOID:STRING,BOOLEAN +VOID:POINTER,INT,STRING +BOOLEAN:OBJECT +INT:OBJECT +VOID:INT64 +VOID:UINT64 +BOOLEAN:FLAGS +BOOLEAN:OBJECT,FLAGS +OBJECT:VOID diff --git a/gio/gio.h b/gio/gio.h index 861f172..6dcccfe 100644 --- a/gio/gio.h +++ b/gio/gio.h @@ -28,26 +28,46 @@ #include #include -#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include +#include #include #include #include #include -#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include #include #include +#include #include #include #include +#include #include #include #include @@ -56,15 +76,14 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include -#include #include #include #include @@ -74,22 +93,37 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include -#include -#include +#include #include +#include #include #include #include #include +#include #include #include -#include -#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -99,3 +133,4 @@ #undef __GIO_GIO_H_INSIDE__ #endif /* __G_IO_H__ */ + diff --git a/gio/gio.rc b/gio/gio.rc index 5867045..52cf32d 100644 --- a/gio/gio.rc +++ b/gio/gio.rc @@ -1,8 +1,8 @@ #include VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,24,2,0 - PRODUCTVERSION 2,24,2,0 + FILEVERSION 2,27,5,0 + PRODUCTVERSION 2,27,5,0 FILEFLAGSMASK 0 FILEFLAGS 0 FILEOS VOS__WINDOWS32 @@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO BEGIN VALUE "CompanyName", "The GLib developer community" VALUE "FileDescription", "Gio" - VALUE "FileVersion", "2.24.2.0" + VALUE "FileVersion", "2.27.5.0" VALUE "InternalName", "libgio-2.0-0" VALUE "LegalCopyright", "Copyright © 2006-2010 Red Hat, Inc. and others." VALUE "OriginalFilename", "libgio-2.0-0.dll" VALUE "ProductName", "GLib" - VALUE "ProductVersion", "2.24.2" + VALUE "ProductVersion", "2.27.5" END END BLOCK "VarFileInfo" diff --git a/gio/gio.symbols b/gio/gio.symbols index 62a99d7..dc03066 100644 --- a/gio/gio.symbols +++ b/gio/gio.symbols @@ -1,7 +1,5 @@ /* This file lists all exported symbols. It is used to generate - * the gio.def file used to control exports on Windows and the - * gioalias.h/gioaliasdef.c files used to avoid PLT entries for - * internal uses of exported functions (see makegioalias.pl). + * the gio.def file used to control exports on Windows. * * Every symbol must be included in the right * #ifdef IN_HEADER(sym) #endif and @@ -26,6 +24,46 @@ g_vfs_get_local #endif #endif +#if IN_HEADER(__G_APPLICATION_H__) +#if IN_FILE(__G_APPLICATION_C__) +g_application_get_type G_GNUC_CONST +g_application_activate +g_application_flags_get_type +g_application_get_application_id +g_application_get_flags +g_application_get_inactivity_timeout +g_application_get_is_registered +g_application_get_is_remote +g_application_hold +g_application_id_is_valid +g_application_new +g_application_open +g_application_register +g_application_release +g_application_run +g_application_set_action_group +g_application_set_application_id +g_application_set_flags +g_application_set_inactivity_timeout +#endif +#endif + +#if IN_HEADER(__G_APPLICATION_COMMAND_LINE_H__) +#if IN_FILE(__G_APPLICATION_COMMAND_LINE_C__) +g_application_command_line_get_arguments +g_application_command_line_get_cwd +g_application_command_line_get_environ +g_application_command_line_getenv +g_application_command_line_get_exit_status +g_application_command_line_get_is_remote +g_application_command_line_get_platform_data +g_application_command_line_get_type +g_application_command_line_print +g_application_command_line_printerr +g_application_command_line_set_exit_status +#endif +#endif + #if IN_HEADER(__G_APP_INFO_H__) #if IN_FILE(__G_APP_INFO_C__) g_app_info_get_type G_GNUC_CONST @@ -46,6 +84,7 @@ g_app_info_launch_uris g_app_info_should_show g_app_info_set_as_default_for_type g_app_info_set_as_default_for_extension +g_app_info_set_as_last_used_for_type g_app_info_add_supports_type g_app_info_can_remove_supports_type g_app_info_remove_supports_type @@ -59,6 +98,22 @@ g_app_launch_context_launch_failed #endif #if IN_FILE(__G_DESKTOP_APP_INFO_C__) +#ifdef G_OS_UNIX +g_app_info_create_from_commandline +g_app_info_get_all +g_app_info_get_all_for_type +g_app_info_get_default_for_type +g_app_info_get_default_for_uri_scheme +g_app_info_get_fallback_for_type +g_app_info_get_recommended_for_type +g_app_info_reset_type_associations +#endif +#endif +#endif + + +#if IN_FILE(__G_WIN32_APP_INFO_C__) +#ifdef G_OS_WIN32 g_app_info_create_from_commandline g_app_info_get_all g_app_info_get_all_for_type @@ -139,6 +194,7 @@ g_cancellable_reset g_cancellable_cancel g_cancellable_connect g_cancellable_disconnect +g_cancellable_source_new #endif #endif @@ -213,6 +269,9 @@ g_data_input_stream_read_line_finish g_data_input_stream_read_until g_data_input_stream_read_until_async g_data_input_stream_read_until_finish +g_data_input_stream_read_upto +g_data_input_stream_read_upto_async +g_data_input_stream_read_upto_finish #endif #endif @@ -485,6 +544,7 @@ g_file_info_set_size g_file_info_set_modification_time g_file_info_set_symlink_target g_file_info_set_sort_order +g_file_attribute_matcher_get_type G_GNUC_CONST g_file_attribute_matcher_new g_file_attribute_matcher_ref g_file_attribute_matcher_unref @@ -604,6 +664,8 @@ g_io_stream_is_closed g_io_stream_has_pending g_io_stream_set_pending g_io_stream_clear_pending +g_io_stream_splice_async +g_io_stream_splice_finish #endif #endif @@ -611,6 +673,9 @@ g_io_stream_clear_pending #if IN_FILE(__G_IO_ERROR_C__) g_io_error_quark g_io_error_from_errno +#ifdef G_OS_WIN32 +g_io_error_from_win32_error +#endif #endif #endif @@ -668,6 +733,7 @@ g_memory_output_stream_new g_memory_output_stream_get_data g_memory_output_stream_get_data_size g_memory_output_stream_get_size +g_memory_output_stream_steal_data #endif #endif @@ -732,6 +798,7 @@ g_simple_async_result_get_type G_GNUC_CONST g_simple_async_result_new g_simple_async_result_new_error g_simple_async_result_new_from_error +g_simple_async_result_new_take_error g_simple_async_result_set_op_res_gpointer g_simple_async_result_get_op_res_gpointer g_simple_async_result_set_op_res_gssize @@ -744,12 +811,14 @@ g_simple_async_result_complete g_simple_async_result_complete_in_idle g_simple_async_result_run_in_thread g_simple_async_result_set_from_error +g_simple_async_result_take_error g_simple_async_result_propagate_error g_simple_async_result_set_error g_simple_async_result_set_error_va g_simple_async_result_is_valid g_simple_async_report_error_in_idle g_simple_async_report_gerror_in_idle +g_simple_async_report_take_gerror_in_idle #endif #endif @@ -827,6 +896,30 @@ g_unix_output_stream_get_fd #endif #endif +#if IN_HEADER(__G_WIN32_INPUT_STREAM_H__) +#if IN_FILE(__G_WIN32_INPUT_STREAM_C__) +#ifdef G_OS_WIN32 +g_win32_input_stream_get_type G_GNUC_CONST +g_win32_input_stream_new +g_win32_input_stream_set_close_handle +g_win32_input_stream_get_close_handle +g_win32_input_stream_get_handle +#endif /* G_OS_WIN32 */ +#endif +#endif + +#if IN_HEADER(__G_WIN32_OUTPUT_STREAM_H__) +#if IN_FILE(__G_WIN32_OUTPUT_STREAM_C__) +#ifdef G_OS_WIN32 +g_win32_output_stream_get_type G_GNUC_CONST +g_win32_output_stream_new +g_win32_output_stream_set_close_handle +g_win32_output_stream_get_close_handle +g_win32_output_stream_get_handle +#endif /* G_OS_WIN32 */ +#endif +#endif + #if IN_HEADER(__G_MOUNT_H__) #if IN_FILE(__G_MOUNT_C__) g_mount_get_type G_GNUC_CONST @@ -943,6 +1036,7 @@ g_file_query_info_flags_get_type G_GNUC_CONST g_file_type_get_type G_GNUC_CONST g_filesystem_preview_type_get_type G_GNUC_CONST g_io_error_enum_get_type G_GNUC_CONST +g_io_stream_splice_flags_get_type G_GNUC_CONST g_mount_mount_flags_get_type G_GNUC_CONST g_mount_operation_result_get_type G_GNUC_CONST g_drive_start_flags_get_type G_GNUC_CONST @@ -955,8 +1049,31 @@ g_socket_family_get_type G_GNUC_CONST g_socket_type_get_type G_GNUC_CONST g_socket_protocol_get_type G_GNUC_CONST g_socket_msg_flags_get_type G_GNUC_CONST +g_unix_socket_address_type_get_type G_GNUC_CONST g_resolver_error_get_type G_GNUC_CONST g_zlib_compressor_format_get_type +g_settings_bind_flags_get_type +g_dbus_error_get_type G_GNUC_CONST +g_bus_type_get_type G_GNUC_CONST +g_bus_name_owner_flags_get_type G_GNUC_CONST +g_bus_name_watcher_flags_get_type G_GNUC_CONST +g_dbus_proxy_flags_get_type G_GNUC_CONST +g_dbus_connection_flags_get_type G_GNUC_CONST +g_dbus_capability_flags_get_type G_GNUC_CONST +g_dbus_call_flags_get_type G_GNUC_CONST +g_dbus_message_type_get_type G_GNUC_CONST +g_dbus_message_flags_get_type G_GNUC_CONST +g_dbus_message_header_field_get_type G_GNUC_CONST +g_dbus_property_info_flags_get_type G_GNUC_CONST +g_dbus_subtree_flags_get_type G_GNUC_CONST +g_dbus_server_flags_get_type G_GNUC_CONST +g_dbus_signal_flags_get_type G_GNUC_CONST +g_dbus_send_message_flags_get_type G_GNUC_CONST +g_credentials_type_get_type G_GNUC_CONST +g_dbus_message_byte_order_get_type G_GNUC_CONST +g_tls_authentication_mode_get_type G_GNUC_CONST +g_tls_certificate_flags_get_type G_GNUC_CONST +g_tls_rehandshake_mode_get_type G_GNUC_CONST #endif #endif @@ -968,6 +1085,7 @@ g_emblemed_icon_new g_emblemed_icon_get_icon g_emblemed_icon_get_emblems g_emblemed_icon_add_emblem +g_emblemed_icon_clear_emblems #endif #endif @@ -1019,9 +1137,15 @@ g_inet_socket_address_new #ifdef G_OS_UNIX g_unix_socket_address_get_type G_GNUC_CONST g_unix_socket_address_new +#ifndef G_DISABLE_DEPRECATED g_unix_socket_address_new_abstract +#endif +g_unix_socket_address_new_with_type g_unix_socket_address_abstract_names_supported +#ifndef G_DISABLE_DEPRECATED g_unix_socket_address_get_is_abstract +#endif +g_unix_socket_address_get_address_type g_unix_socket_address_get_path g_unix_socket_address_get_path_len #endif @@ -1038,6 +1162,46 @@ g_socket_address_to_native #endif #endif +#if IN_HEADER(__G_PROXY_H__) +#if IN_FILE(__G_PROXY_C__) +g_proxy_get_type +g_proxy_get_default_for_protocol +g_proxy_connect +g_proxy_connect_async +g_proxy_connect_finish +g_proxy_supports_hostname +#endif +#endif + +#if IN_HEADER(__G_PROXY_RESOLVER_H__) +#if IN_FILE(__G_PROXY_RESOLVER_C__) +g_proxy_resolver_get_default +g_proxy_resolver_get_type +g_proxy_resolver_is_supported +g_proxy_resolver_lookup +g_proxy_resolver_lookup_async +g_proxy_resolver_lookup_finish +#endif +#endif + +#if IN_HEADER(__G_PROXY_ADDRESS_H__) +#if IN_FILE(__G_PROXY_ADDRESS_C__) +g_proxy_address_get_type +g_proxy_address_new +g_proxy_address_get_protocol +g_proxy_address_get_destination_hostname +g_proxy_address_get_destination_port +g_proxy_address_get_username +g_proxy_address_get_password +#endif +#endif + +#if IN_HEADER(__G_PROXY_ADDRESS_ENUMERATOR_H__) +#if IN_FILE(__G_PROXY_ADDRESS_ENUMERATOR_C__) +g_proxy_address_enumerator_get_type +#endif +#endif + #if IN_HEADER(__G_RESOLVER_H__) #if IN_FILE(__G_RESOLVER_C__) g_resolver_error_quark @@ -1099,8 +1263,10 @@ g_srv_target_list_sort g_network_address_get_type G_GNUC_CONST g_network_address_get_hostname g_network_address_get_port +g_network_address_get_scheme g_network_address_new g_network_address_parse +g_network_address_parse_uri #endif #endif @@ -1110,14 +1276,17 @@ g_network_service_get_type G_GNUC_CONST g_network_service_get_service g_network_service_get_protocol g_network_service_get_domain +g_network_service_get_scheme +g_network_service_set_scheme g_network_service_new #endif #endif #if IN_HEADER(__G_SOCKET_CONNECTABLE_H__) #if IN_FILE(__G_SOCKET_CONNECTABLE_C__) -g_socket_connectable_enumerate g_socket_connectable_get_type G_GNUC_CONST +g_socket_connectable_enumerate +g_socket_connectable_proxy_enumerate #endif #endif @@ -1167,6 +1336,7 @@ g_socket_create_source g_socket_get_blocking g_socket_get_family g_socket_get_fd +g_socket_get_timeout g_socket_get_keepalive g_socket_get_listen_backlog g_socket_get_local_address @@ -1181,13 +1351,17 @@ g_socket_new_from_fd g_socket_receive g_socket_receive_from g_socket_receive_message +g_socket_receive_with_blocking g_socket_send g_socket_send_message g_socket_send_to +g_socket_send_with_blocking g_socket_set_blocking +g_socket_set_timeout g_socket_set_keepalive g_socket_set_listen_backlog g_socket_speaks_ipv4 +g_socket_get_credentials #endif #endif @@ -1205,6 +1379,7 @@ g_socket_control_message_serialize #if IN_HEADER(__G_SOCKET_CLIENT_H__) #if IN_FILE(__G_SOCKET_CLIENT_C__) g_socket_client_get_type G_GNUC_CONST +g_socket_client_add_application_proxy g_socket_client_connect g_socket_client_connect_async g_socket_client_connect_finish @@ -1214,15 +1389,26 @@ g_socket_client_connect_to_host_finish g_socket_client_connect_to_service g_socket_client_connect_to_service_async g_socket_client_connect_to_service_finish +g_socket_client_connect_to_uri +g_socket_client_connect_to_uri_async +g_socket_client_connect_to_uri_finish +g_socket_client_get_enable_proxy g_socket_client_get_family g_socket_client_get_local_address g_socket_client_get_protocol g_socket_client_get_socket_type +g_socket_client_get_timeout +g_socket_client_get_tls +g_socket_client_get_tls_validation_flags g_socket_client_new +g_socket_client_set_enable_proxy g_socket_client_set_family g_socket_client_set_local_address g_socket_client_set_protocol g_socket_client_set_socket_type +g_socket_client_set_timeout +g_socket_client_set_tls +g_socket_client_set_tls_validation_flags #endif #endif @@ -1288,6 +1474,8 @@ g_tcp_connection_get_graceful_disconnect g_unix_connection_get_type G_GNUC_CONST g_unix_connection_receive_fd g_unix_connection_send_fd +g_unix_connection_receive_credentials +g_unix_connection_send_credentials #endif #endif #endif @@ -1324,6 +1512,8 @@ g_unix_fd_list_steal_fds #if IN_FILE(__G_ZLIB_COMPRESSOR_C__) g_zlib_compressor_get_type G_GNUC_CONST g_zlib_compressor_new +g_zlib_compressor_get_file_info +g_zlib_compressor_set_file_info #endif #endif @@ -1331,12 +1521,547 @@ g_zlib_compressor_new #if IN_FILE(__G_ZLIB_DECOMPRESSOR_C__) g_zlib_decompressor_get_type G_GNUC_CONST g_zlib_decompressor_new +g_zlib_decompressor_get_file_info #endif #endif #if IN_HEADER(__G_FILE_DESCRIPTOR_BASED_H__) #if IN_FILE(__G_FILE_DESCRIPTOR_BASED_C__) +#ifdef G_OS_UNIX g_file_descriptor_based_get_type G_GNUC_CONST g_file_descriptor_based_get_fd #endif #endif +#endif + +#if IN_HEADER(__G_SETTINGS_BACKEND_H__) +#if IN_FILE(__G_SETTINGS_BACKEND_C__) +g_settings_backend_get_type +g_settings_backend_changed +g_settings_backend_flatten_tree +g_settings_backend_keys_changed +g_settings_backend_path_changed +g_settings_backend_path_writable_changed +g_settings_backend_writable_changed +g_settings_backend_changed_tree +#endif +#endif + +#if IN_HEADER(__G_SETTINGS_BACKEND_H__) +#if IN_FILE(__G_KEYFILE_SETTINGS_BACKEND_C__) +g_keyfile_settings_backend_new +#endif +#endif + +#if IN_HEADER(__G_SETTINGS_H__) +#if IN_FILE(__G_SETTINGS_SCHEMA_C__) +g_settings_list_schemas +g_settings_list_relocatable_schemas +#endif + +#if IN_FILE(__G_SETTINGS_C__) +g_settings_apply +g_settings_bind +g_settings_bind_writable +g_settings_bind_with_mapping +g_settings_delay +g_settings_get +g_settings_get_child +g_settings_get_has_unapplied +g_settings_get_type +g_settings_get_value +g_settings_is_writable +g_settings_new +g_settings_new_with_backend +g_settings_new_with_backend_and_path +g_settings_new_with_path +g_settings_revert +g_settings_reset +g_settings_set +g_settings_set_value +g_settings_unbind +g_settings_get_int +g_settings_set_int +g_settings_get_string +g_settings_set_string +g_settings_get_strv +g_settings_set_strv +g_settings_get_double +g_settings_set_double +g_settings_get_boolean +g_settings_set_boolean +g_settings_get_enum +g_settings_set_enum +g_settings_get_flags +g_settings_set_flags +g_settings_sync +g_settings_list_keys +g_settings_list_children +g_settings_get_mapped +g_settings_get_range +g_settings_range_check +#endif +#endif + +#if IN_HEADER(__G_CREDENTIALS_H__) +#if IN_FILE(__G_CREDENTIALS_C__) +g_credentials_get_type G_GNUC_CONST +g_credentials_new +g_credentials_to_string +g_credentials_get_native +g_credentials_set_native +g_credentials_is_same_user +#ifdef G_OS_UNIX +g_credentials_get_unix_user +g_credentials_set_unix_user +#endif +#endif +#endif + +#if IN_HEADER(__G_DBUS_ADDRESS_H__) +#if IN_FILE(__G_DBUS_ADDRESS_C__) +g_dbus_is_address +g_dbus_is_supported_address +g_dbus_address_get_for_bus_sync +g_dbus_address_get_stream +g_dbus_address_get_stream_finish +g_dbus_address_get_stream_sync +#endif +#endif + +#if IN_HEADER(__G_DBUS_AUTH_OBSERVER_H__) +#if IN_FILE(__G_DBUS_AUTH_OBSERVER_C__) +g_dbus_auth_observer_get_type G_GNUC_CONST +g_dbus_auth_observer_new +g_dbus_auth_observer_authorize_authenticated_peer +#endif +#endif + +#if IN_HEADER(__G_DBUS_CONNECTION_H__) +#if IN_FILE(__G_DBUS_CONNECTION_C__) +g_dbus_connection_get_type G_GNUC_CONST +g_bus_get +g_bus_get_finish +g_bus_get_sync +g_dbus_connection_new +g_dbus_connection_new_finish +g_dbus_connection_new_for_address +g_dbus_connection_new_for_address_finish +g_dbus_connection_new_for_address_sync +g_dbus_connection_new_sync +g_dbus_connection_start_message_processing +g_dbus_connection_get_capabilities +g_dbus_connection_get_exit_on_close +g_dbus_connection_get_guid +g_dbus_connection_get_peer_credentials +g_dbus_connection_get_stream +g_dbus_connection_get_unique_name +g_dbus_connection_is_closed +g_dbus_connection_set_exit_on_close +g_dbus_connection_close +g_dbus_connection_close_finish +g_dbus_connection_close_sync +g_dbus_connection_flush +g_dbus_connection_flush_finish +g_dbus_connection_flush_sync +g_dbus_connection_emit_signal +g_dbus_connection_call +g_dbus_connection_call_finish +g_dbus_connection_call_sync +g_dbus_connection_signal_subscribe +g_dbus_connection_signal_unsubscribe +g_dbus_connection_add_filter +g_dbus_connection_remove_filter +g_dbus_connection_send_message +g_dbus_connection_send_message_with_reply +g_dbus_connection_send_message_with_reply_finish +g_dbus_connection_send_message_with_reply_sync +g_dbus_connection_register_object +g_dbus_connection_unregister_object +g_dbus_connection_register_subtree +g_dbus_connection_unregister_subtree +#endif +#endif + +#if IN_HEADER(__G_DBUS_ERROR_H__) +#if IN_FILE(__G_DBUS_ERROR_C__) +g_dbus_error_quark +g_dbus_error_new_for_dbus_error +g_dbus_error_is_remote_error +g_dbus_error_get_remote_error +g_dbus_error_strip_remote_error +g_dbus_error_encode_gerror +g_dbus_error_register_error +g_dbus_error_register_error_domain +g_dbus_error_set_dbus_error +g_dbus_error_set_dbus_error_valist +g_dbus_error_unregister_error +#endif +#endif + +#if IN_HEADER(__G_DBUS_INTROSPECTION_H__) +#if IN_FILE(__G_DBUS_INTROSPECTION_C__) +g_dbus_annotation_info_get_type G_GNUC_CONST +g_dbus_arg_info_get_type G_GNUC_CONST +g_dbus_property_info_get_type G_GNUC_CONST +g_dbus_interface_info_get_type G_GNUC_CONST +g_dbus_method_info_get_type G_GNUC_CONST +g_dbus_signal_info_get_type G_GNUC_CONST +g_dbus_node_info_get_type G_GNUC_CONST +g_dbus_annotation_info_lookup +g_dbus_annotation_info_ref +g_dbus_annotation_info_unref +g_dbus_interface_info_generate_xml +g_dbus_interface_info_lookup_method +g_dbus_interface_info_lookup_property +g_dbus_interface_info_lookup_signal +g_dbus_node_info_new_for_xml +g_dbus_node_info_generate_xml +g_dbus_node_info_lookup_interface +g_dbus_arg_info_ref +g_dbus_arg_info_unref +g_dbus_property_info_ref +g_dbus_property_info_unref +g_dbus_signal_info_ref +g_dbus_signal_info_unref +g_dbus_method_info_ref +g_dbus_method_info_unref +g_dbus_interface_info_ref +g_dbus_interface_info_unref +g_dbus_node_info_ref +g_dbus_node_info_unref +#endif +#endif + +#if IN_HEADER(__G_DBUS_MESSAGE_H__) +#if IN_FILE(__G_DBUS_MESSAGE_C__) +g_dbus_message_get_type G_GNUC_CONST +g_dbus_message_new +g_dbus_message_new_from_blob +g_dbus_message_new_method_call +g_dbus_message_new_method_error +g_dbus_message_new_method_error_literal +g_dbus_message_new_method_error_valist +g_dbus_message_new_method_reply +g_dbus_message_new_signal +g_dbus_message_bytes_needed +g_dbus_message_get_locked +g_dbus_message_lock +g_dbus_message_copy +g_dbus_message_get_arg0 +g_dbus_message_get_body +g_dbus_message_get_byte_order +g_dbus_message_get_destination +g_dbus_message_get_error_name +g_dbus_message_get_flags +g_dbus_message_get_header +g_dbus_message_get_header_fields +g_dbus_message_get_interface +g_dbus_message_get_member +g_dbus_message_get_num_unix_fds +g_dbus_message_get_path +g_dbus_message_get_reply_serial +g_dbus_message_get_sender +g_dbus_message_get_serial +g_dbus_message_get_signature +g_dbus_message_get_message_type +g_dbus_message_print +g_dbus_message_set_body +g_dbus_message_set_byte_order +g_dbus_message_set_destination +g_dbus_message_set_error_name +g_dbus_message_set_flags +g_dbus_message_set_header +g_dbus_message_set_interface +g_dbus_message_set_member +g_dbus_message_set_num_unix_fds +g_dbus_message_set_path +g_dbus_message_set_reply_serial +g_dbus_message_set_sender +g_dbus_message_set_serial +g_dbus_message_set_signature +g_dbus_message_set_message_type +g_dbus_message_to_blob +g_dbus_message_to_gerror +#ifdef G_OS_UNIX +g_dbus_message_get_unix_fd_list +g_dbus_message_set_unix_fd_list +#endif +#endif +#endif + +#if IN_HEADER(__G_DBUS_METHOD_INVOCATION_H__) +#if IN_FILE(__G_DBUS_METHOD_INVOCATION_C__) +g_dbus_method_invocation_get_type G_GNUC_CONST +g_dbus_method_invocation_get_connection +g_dbus_method_invocation_get_interface_name +g_dbus_method_invocation_get_message +g_dbus_method_invocation_get_method_info +g_dbus_method_invocation_get_method_name +g_dbus_method_invocation_get_object_path +g_dbus_method_invocation_get_parameters +g_dbus_method_invocation_get_sender +g_dbus_method_invocation_get_user_data +g_dbus_method_invocation_return_dbus_error +g_dbus_method_invocation_return_error +g_dbus_method_invocation_return_error_literal +g_dbus_method_invocation_return_error_valist +g_dbus_method_invocation_return_gerror +g_dbus_method_invocation_return_value +#endif +#endif + +#if IN_HEADER(__G_DBUS_NAME_OWNING_H__) +#if IN_FILE(__G_DBUS_NAME_OWNING_C__) +g_bus_own_name +g_bus_own_name_on_connection +g_bus_unown_name +g_bus_own_name_with_closures +g_bus_own_name_on_connection_with_closures +#endif +#endif + +#if IN_HEADER(__G_DBUS_NAME_WATCHING_H__) +#if IN_FILE(__G_DBUS_NAME_WATCHING_C__) +g_bus_watch_name +g_bus_watch_name_on_connection +g_bus_unwatch_name +g_bus_watch_name_with_closures +g_bus_watch_name_on_connection_with_closures +#endif +#endif + +#if IN_HEADER(__G_DBUS_PROXY_H__) +#if IN_FILE(__G_DBUS_PROXY_C__) +g_dbus_proxy_get_type G_GNUC_CONST +g_dbus_proxy_new +g_dbus_proxy_new_finish +g_dbus_proxy_new_sync +g_dbus_proxy_new_for_bus +g_dbus_proxy_new_for_bus_finish +g_dbus_proxy_new_for_bus_sync +g_dbus_proxy_get_cached_property +g_dbus_proxy_set_cached_property +g_dbus_proxy_get_cached_property_names +g_dbus_proxy_get_connection +g_dbus_proxy_get_default_timeout +g_dbus_proxy_get_flags +g_dbus_proxy_get_interface_info +g_dbus_proxy_get_interface_name +g_dbus_proxy_get_object_path +g_dbus_proxy_get_name +g_dbus_proxy_get_name_owner +g_dbus_proxy_set_default_timeout +g_dbus_proxy_set_interface_info +g_dbus_proxy_call +g_dbus_proxy_call_finish +g_dbus_proxy_call_sync +#endif +#endif + +#if IN_HEADER(__G_DBUS_SERVER_H__) +#if IN_FILE(__G_DBUS_SERVER_C__) +g_dbus_server_get_type G_GNUC_CONST +g_dbus_server_new_sync +g_dbus_server_is_active +g_dbus_server_start +g_dbus_server_stop +g_dbus_server_get_client_address +g_dbus_server_get_flags +g_dbus_server_get_guid +#endif +#endif + +#if IN_HEADER(__G_DBUS_UTILS_H__) +#if IN_FILE(__G_DBUS_UTILS_C__) +g_dbus_generate_guid +g_dbus_is_guid +g_dbus_is_interface_name +g_dbus_is_member_name +g_dbus_is_name +g_dbus_is_unique_name +#endif +#endif + +#if IN_HEADER(__G_UNIX_CREDENTIALS_MESSAGE_H__) +#if IN_FILE(__G_UNIX_CREDENTIALS_MESSAGE_C__) +#ifdef G_OS_UNIX +g_unix_credentials_message_get_type G_GNUC_CONST +g_unix_credentials_message_new +g_unix_credentials_message_new_with_credentials +g_unix_credentials_message_get_credentials +g_unix_credentials_message_is_supported +#endif +#endif +#endif + +#if IN_HEADER(__G_PERMISSION_H__) +#if IN_FILE(__G_PERMISSION_C__) +g_permission_acquire +g_permission_acquire_async +g_permission_acquire_finish +g_permission_get_allowed +g_permission_get_can_acquire +g_permission_get_can_release +g_permission_get_type +g_permission_impl_update +g_permission_release +g_permission_release_async +g_permission_release_finish +#endif +#endif + +#if IN_HEADER(__G_SIMPLE_PERMISSION_H__) +#if IN_FILE(__G_SIMPLE_PERMISSION_C__) +g_simple_permission_get_type +g_simple_permission_new +#endif +#endif + +#if IN_HEADER(__G_ACTION_GROUP_H__) +#if IN_FILE(__G_ACTION_GROUP_C__) +g_action_group_action_added +g_action_group_action_enabled_changed +g_action_group_action_removed +g_action_group_action_state_changed +g_action_group_activate_action +g_action_group_get_action_enabled +g_action_group_get_action_parameter_type +g_action_group_get_action_state +g_action_group_get_action_state_hint +g_action_group_get_action_state_type +g_action_group_get_type +g_action_group_has_action +g_action_group_list_actions +g_action_group_change_action_state +#endif +#endif + +#if IN_HEADER(__G_ACTION_H__) +#if IN_FILE(__G_ACTION_C__) +g_action_activate +g_action_get_enabled +g_action_get_name +g_action_get_parameter_type +g_action_get_state +g_action_get_state_hint +g_action_get_state_type +g_action_get_type +g_action_set_state +#endif +#endif + +#if IN_HEADER(__G_SIMPLE_ACTION_GROUP_H__) +#if IN_FILE(__G_SIMPLE_ACTION_GROUP_C__) +g_simple_action_group_get_type G_GNUC_CONST +g_simple_action_group_insert +g_simple_action_group_lookup +g_simple_action_group_new +g_simple_action_group_remove +#endif +#endif + +#if IN_HEADER(__G_SIMPLE_ACTION_H__) +#if IN_FILE(__G_SIMPLE_ACTION_C__) +g_simple_action_get_parameter_type +g_simple_action_get_type +g_simple_action_new +g_simple_action_new_stateful +g_simple_action_set_enabled +#endif +#endif + +#if IN_HEADER(__G_POLLABLE_INPUT_STREAM_H__) +#if IN_FILE(__G_POLLABLE_INPUT_STREAM_C__) +g_pollable_input_stream_get_type G_GNUC_CONST +g_pollable_input_stream_can_poll +g_pollable_input_stream_create_source +g_pollable_input_stream_is_readable +g_pollable_input_stream_read_nonblocking +g_pollable_source_new +#endif +#endif + +#if IN_HEADER(__G_POLLABLE_OUTPUT_STREAM_H__) +#if IN_FILE(__G_POLLABLE_OUTPUT_STREAM_C__) +g_pollable_output_stream_get_type G_GNUC_CONST +g_pollable_output_stream_can_poll +g_pollable_output_stream_create_source +g_pollable_output_stream_is_writable +g_pollable_output_stream_write_nonblocking +#endif +#endif + +#if IN_HEADER(__G_TCP_WRAPPER_CONNECTION_H__) +#if IN_FILE(__G_TCP_WRAPPER_CONNECTION_C__) +g_tcp_wrapper_connection_get_type G_GNUC_CONST +g_tcp_wrapper_connection_get_base_io_stream +g_tcp_wrapper_connection_new +#endif +#endif + +#if IN_HEADER(__G_TLS_BACKEND_H__) +#if IN_FILE(__G_TLS_BACKEND_C__) +g_tls_backend_get_certificate_type +g_tls_backend_get_client_connection_type +g_tls_backend_get_default +g_tls_backend_get_server_connection_type +g_tls_backend_get_type G_GNUC_CONST +g_tls_backend_supports_tls +g_tls_error_get_type G_GNUC_CONST +g_tls_error_quark +#endif +#endif + +#if IN_HEADER(__G_TLS_CERTIFICATE_H__) +#if IN_FILE(__G_TLS_CERTIFICATE_C__) +g_tls_certificate_get_issuer +g_tls_certificate_get_type G_GNUC_CONST +g_tls_certificate_list_new_from_file +g_tls_certificate_new_from_file +g_tls_certificate_new_from_files +g_tls_certificate_new_from_pem +g_tls_certificate_verify +#endif +#endif + +#if IN_HEADER(__G_TLS_CONNECTION_H__) +#if IN_FILE(__G_TLS_CONNECTION_C__) +g_tls_connection_emit_accept_certificate +g_tls_connection_get_certificate +g_tls_connection_get_peer_certificate +g_tls_connection_get_peer_certificate_errors +g_tls_connection_get_rehandshake_mode +g_tls_connection_get_require_close_notify +g_tls_connection_get_use_system_certdb +g_tls_connection_get_type G_GNUC_CONST +g_tls_connection_handshake +g_tls_connection_handshake_async +g_tls_connection_handshake_finish +g_tls_connection_set_certificate +g_tls_connection_set_rehandshake_mode +g_tls_connection_set_require_close_notify +g_tls_connection_set_use_system_certdb +#endif +#endif + +#if IN_HEADER(__G_TLS_CLIENT_CONNECTION_H__) +#if IN_FILE(__G_TLS_CLIENT_CONNECTION_C__) +g_tls_client_connection_get_accepted_cas +g_tls_client_connection_get_server_identity +g_tls_client_connection_get_type G_GNUC_CONST +g_tls_client_connection_get_use_ssl3 +g_tls_client_connection_get_validation_flags +g_tls_client_connection_new +g_tls_client_connection_set_server_identity +g_tls_client_connection_set_use_ssl3 +g_tls_client_connection_set_validation_flags +#endif +#endif + +#if IN_HEADER(__G_TLS_SERVER_CONNECTION_H__) +#if IN_FILE(__G_TLS_SERVER_CONNECTION_C__) +g_tls_server_connection_get_type G_GNUC_CONST +g_tls_server_connection_new +#endif +#endif diff --git a/gio/gioalias.h b/gio/gioalias.h deleted file mode 100644 index 989a0fd..0000000 --- a/gio/gioalias.h +++ /dev/null @@ -1,3008 +0,0 @@ -/* Generated by makegioalias.pl */ - -#ifndef DISABLE_VISIBILITY - -#include "glib.h" - -#ifdef G_HAVE_GNUC_VISIBILITY - -#define IN_FILE(x) 1 -#define IN_HEADER defined - -#if IN_HEADER(__G_VFS_H__) -#if IN_FILE(__G_VFS_C__) -extern __typeof (g_vfs_get_type) IA__g_vfs_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_vfs_get_type IA__g_vfs_get_type - -extern __typeof (g_vfs_is_active) IA__g_vfs_is_active __attribute((visibility("hidden"))); -#define g_vfs_is_active IA__g_vfs_is_active - -extern __typeof (g_vfs_get_file_for_path) IA__g_vfs_get_file_for_path __attribute((visibility("hidden"))); -#define g_vfs_get_file_for_path IA__g_vfs_get_file_for_path - -extern __typeof (g_vfs_get_file_for_uri) IA__g_vfs_get_file_for_uri __attribute((visibility("hidden"))); -#define g_vfs_get_file_for_uri IA__g_vfs_get_file_for_uri - -extern __typeof (g_vfs_get_supported_uri_schemes) IA__g_vfs_get_supported_uri_schemes __attribute((visibility("hidden"))); -#define g_vfs_get_supported_uri_schemes IA__g_vfs_get_supported_uri_schemes - -extern __typeof (g_vfs_parse_name) IA__g_vfs_parse_name __attribute((visibility("hidden"))); -#define g_vfs_parse_name IA__g_vfs_parse_name - -extern __typeof (g_vfs_get_default) IA__g_vfs_get_default __attribute((visibility("hidden"))); -#define g_vfs_get_default IA__g_vfs_get_default - -extern __typeof (g_vfs_get_local) IA__g_vfs_get_local __attribute((visibility("hidden"))); -#define g_vfs_get_local IA__g_vfs_get_local - -#endif -#endif -#if IN_HEADER(__G_APP_INFO_H__) -#if IN_FILE(__G_APP_INFO_C__) -extern __typeof (g_app_info_get_type) IA__g_app_info_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_app_info_get_type IA__g_app_info_get_type - -extern __typeof (g_app_launch_context_get_type) IA__g_app_launch_context_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_app_launch_context_get_type IA__g_app_launch_context_get_type - -extern __typeof (g_app_info_dup) IA__g_app_info_dup __attribute((visibility("hidden"))); -#define g_app_info_dup IA__g_app_info_dup - -extern __typeof (g_app_info_equal) IA__g_app_info_equal __attribute((visibility("hidden"))); -#define g_app_info_equal IA__g_app_info_equal - -extern __typeof (g_app_info_get_id) IA__g_app_info_get_id __attribute((visibility("hidden"))); -#define g_app_info_get_id IA__g_app_info_get_id - -extern __typeof (g_app_info_get_name) IA__g_app_info_get_name __attribute((visibility("hidden"))); -#define g_app_info_get_name IA__g_app_info_get_name - -extern __typeof (g_app_info_get_display_name) IA__g_app_info_get_display_name __attribute((visibility("hidden"))); -#define g_app_info_get_display_name IA__g_app_info_get_display_name - -extern __typeof (g_app_info_get_description) IA__g_app_info_get_description __attribute((visibility("hidden"))); -#define g_app_info_get_description IA__g_app_info_get_description - -extern __typeof (g_app_info_get_executable) IA__g_app_info_get_executable __attribute((visibility("hidden"))); -#define g_app_info_get_executable IA__g_app_info_get_executable - -extern __typeof (g_app_info_get_commandline) IA__g_app_info_get_commandline __attribute((visibility("hidden"))); -#define g_app_info_get_commandline IA__g_app_info_get_commandline - -extern __typeof (g_app_info_get_icon) IA__g_app_info_get_icon __attribute((visibility("hidden"))); -#define g_app_info_get_icon IA__g_app_info_get_icon - -extern __typeof (g_app_info_launch) IA__g_app_info_launch __attribute((visibility("hidden"))); -#define g_app_info_launch IA__g_app_info_launch - -extern __typeof (g_app_info_supports_uris) IA__g_app_info_supports_uris __attribute((visibility("hidden"))); -#define g_app_info_supports_uris IA__g_app_info_supports_uris - -extern __typeof (g_app_info_supports_files) IA__g_app_info_supports_files __attribute((visibility("hidden"))); -#define g_app_info_supports_files IA__g_app_info_supports_files - -extern __typeof (g_app_info_launch_uris) IA__g_app_info_launch_uris __attribute((visibility("hidden"))); -#define g_app_info_launch_uris IA__g_app_info_launch_uris - -extern __typeof (g_app_info_should_show) IA__g_app_info_should_show __attribute((visibility("hidden"))); -#define g_app_info_should_show IA__g_app_info_should_show - -extern __typeof (g_app_info_set_as_default_for_type) IA__g_app_info_set_as_default_for_type __attribute((visibility("hidden"))); -#define g_app_info_set_as_default_for_type IA__g_app_info_set_as_default_for_type - -extern __typeof (g_app_info_set_as_default_for_extension) IA__g_app_info_set_as_default_for_extension __attribute((visibility("hidden"))); -#define g_app_info_set_as_default_for_extension IA__g_app_info_set_as_default_for_extension - -extern __typeof (g_app_info_add_supports_type) IA__g_app_info_add_supports_type __attribute((visibility("hidden"))); -#define g_app_info_add_supports_type IA__g_app_info_add_supports_type - -extern __typeof (g_app_info_can_remove_supports_type) IA__g_app_info_can_remove_supports_type __attribute((visibility("hidden"))); -#define g_app_info_can_remove_supports_type IA__g_app_info_can_remove_supports_type - -extern __typeof (g_app_info_remove_supports_type) IA__g_app_info_remove_supports_type __attribute((visibility("hidden"))); -#define g_app_info_remove_supports_type IA__g_app_info_remove_supports_type - -extern __typeof (g_app_info_launch_default_for_uri) IA__g_app_info_launch_default_for_uri __attribute((visibility("hidden"))); -#define g_app_info_launch_default_for_uri IA__g_app_info_launch_default_for_uri - -extern __typeof (g_app_info_can_delete) IA__g_app_info_can_delete __attribute((visibility("hidden"))); -#define g_app_info_can_delete IA__g_app_info_can_delete - -extern __typeof (g_app_info_delete) IA__g_app_info_delete __attribute((visibility("hidden"))); -#define g_app_info_delete IA__g_app_info_delete - -extern __typeof (g_app_launch_context_new) IA__g_app_launch_context_new __attribute((visibility("hidden"))); -#define g_app_launch_context_new IA__g_app_launch_context_new - -extern __typeof (g_app_launch_context_get_display) IA__g_app_launch_context_get_display __attribute((visibility("hidden"))); -#define g_app_launch_context_get_display IA__g_app_launch_context_get_display - -extern __typeof (g_app_launch_context_get_startup_notify_id) IA__g_app_launch_context_get_startup_notify_id __attribute((visibility("hidden"))); -#define g_app_launch_context_get_startup_notify_id IA__g_app_launch_context_get_startup_notify_id - -extern __typeof (g_app_launch_context_launch_failed) IA__g_app_launch_context_launch_failed __attribute((visibility("hidden"))); -#define g_app_launch_context_launch_failed IA__g_app_launch_context_launch_failed - -#endif -#if IN_FILE(__G_DESKTOP_APP_INFO_C__) -extern __typeof (g_app_info_create_from_commandline) IA__g_app_info_create_from_commandline __attribute((visibility("hidden"))); -#define g_app_info_create_from_commandline IA__g_app_info_create_from_commandline - -extern __typeof (g_app_info_get_all) IA__g_app_info_get_all __attribute((visibility("hidden"))); -#define g_app_info_get_all IA__g_app_info_get_all - -extern __typeof (g_app_info_get_all_for_type) IA__g_app_info_get_all_for_type __attribute((visibility("hidden"))); -#define g_app_info_get_all_for_type IA__g_app_info_get_all_for_type - -extern __typeof (g_app_info_get_default_for_type) IA__g_app_info_get_default_for_type __attribute((visibility("hidden"))); -#define g_app_info_get_default_for_type IA__g_app_info_get_default_for_type - -extern __typeof (g_app_info_get_default_for_uri_scheme) IA__g_app_info_get_default_for_uri_scheme __attribute((visibility("hidden"))); -#define g_app_info_get_default_for_uri_scheme IA__g_app_info_get_default_for_uri_scheme - -extern __typeof (g_app_info_reset_type_associations) IA__g_app_info_reset_type_associations __attribute((visibility("hidden"))); -#define g_app_info_reset_type_associations IA__g_app_info_reset_type_associations - -#endif -#endif -#if IN_HEADER(__G_DESKTOP_APP_INFO_H__) -#if IN_FILE(__G_DESKTOP_APP_INFO_C__) -#ifdef G_OS_UNIX -extern __typeof (g_desktop_app_info_new_from_filename) IA__g_desktop_app_info_new_from_filename __attribute((visibility("hidden"))); -#define g_desktop_app_info_new_from_filename IA__g_desktop_app_info_new_from_filename - -extern __typeof (g_desktop_app_info_new_from_keyfile) IA__g_desktop_app_info_new_from_keyfile __attribute((visibility("hidden"))); -#define g_desktop_app_info_new_from_keyfile IA__g_desktop_app_info_new_from_keyfile - -extern __typeof (g_desktop_app_info_new) IA__g_desktop_app_info_new __attribute((visibility("hidden"))); -#define g_desktop_app_info_new IA__g_desktop_app_info_new - -extern __typeof (g_desktop_app_info_get_filename) IA__g_desktop_app_info_get_filename __attribute((visibility("hidden"))); -#define g_desktop_app_info_get_filename IA__g_desktop_app_info_get_filename - -extern __typeof (g_desktop_app_info_get_type) IA__g_desktop_app_info_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_desktop_app_info_get_type IA__g_desktop_app_info_get_type - -extern __typeof (g_desktop_app_info_get_is_hidden) IA__g_desktop_app_info_get_is_hidden __attribute((visibility("hidden"))); -#define g_desktop_app_info_get_is_hidden IA__g_desktop_app_info_get_is_hidden - -extern __typeof (g_desktop_app_info_set_desktop_env) IA__g_desktop_app_info_set_desktop_env __attribute((visibility("hidden"))); -#define g_desktop_app_info_set_desktop_env IA__g_desktop_app_info_set_desktop_env - -extern __typeof (g_desktop_app_info_lookup_get_type) IA__g_desktop_app_info_lookup_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_desktop_app_info_lookup_get_type IA__g_desktop_app_info_lookup_get_type - -extern __typeof (g_desktop_app_info_lookup_get_default_for_uri_scheme) IA__g_desktop_app_info_lookup_get_default_for_uri_scheme __attribute((visibility("hidden"))); -#define g_desktop_app_info_lookup_get_default_for_uri_scheme IA__g_desktop_app_info_lookup_get_default_for_uri_scheme - -#endif -#endif -#endif -#if IN_HEADER(__G_ASYNC_RESULT_H__) -#if IN_FILE(__G_ASYNC_RESULT_C__) -extern __typeof (g_async_result_get_type) IA__g_async_result_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_async_result_get_type IA__g_async_result_get_type - -extern __typeof (g_async_result_get_user_data) IA__g_async_result_get_user_data __attribute((visibility("hidden"))); -#define g_async_result_get_user_data IA__g_async_result_get_user_data - -extern __typeof (g_async_result_get_source_object) IA__g_async_result_get_source_object __attribute((visibility("hidden"))); -#define g_async_result_get_source_object IA__g_async_result_get_source_object - -#endif -#endif -#if IN_HEADER(__G_BUFFERED_INPUT_STREAM_H__) -#if IN_FILE(__G_BUFFERED_INPUT_STREAM_C__) -extern __typeof (g_buffered_input_stream_get_type) IA__g_buffered_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_buffered_input_stream_get_type IA__g_buffered_input_stream_get_type - -extern __typeof (g_buffered_input_stream_new) IA__g_buffered_input_stream_new __attribute((visibility("hidden"))); -#define g_buffered_input_stream_new IA__g_buffered_input_stream_new - -extern __typeof (g_buffered_input_stream_new_sized) IA__g_buffered_input_stream_new_sized __attribute((visibility("hidden"))); -#define g_buffered_input_stream_new_sized IA__g_buffered_input_stream_new_sized - -extern __typeof (g_buffered_input_stream_get_buffer_size) IA__g_buffered_input_stream_get_buffer_size __attribute((visibility("hidden"))); -#define g_buffered_input_stream_get_buffer_size IA__g_buffered_input_stream_get_buffer_size - -extern __typeof (g_buffered_input_stream_set_buffer_size) IA__g_buffered_input_stream_set_buffer_size __attribute((visibility("hidden"))); -#define g_buffered_input_stream_set_buffer_size IA__g_buffered_input_stream_set_buffer_size - -extern __typeof (g_buffered_input_stream_get_available) IA__g_buffered_input_stream_get_available __attribute((visibility("hidden"))); -#define g_buffered_input_stream_get_available IA__g_buffered_input_stream_get_available - -extern __typeof (g_buffered_input_stream_peek) IA__g_buffered_input_stream_peek __attribute((visibility("hidden"))); -#define g_buffered_input_stream_peek IA__g_buffered_input_stream_peek - -extern __typeof (g_buffered_input_stream_peek_buffer) IA__g_buffered_input_stream_peek_buffer __attribute((visibility("hidden"))); -#define g_buffered_input_stream_peek_buffer IA__g_buffered_input_stream_peek_buffer - -extern __typeof (g_buffered_input_stream_fill) IA__g_buffered_input_stream_fill __attribute((visibility("hidden"))); -#define g_buffered_input_stream_fill IA__g_buffered_input_stream_fill - -extern __typeof (g_buffered_input_stream_fill_async) IA__g_buffered_input_stream_fill_async __attribute((visibility("hidden"))); -#define g_buffered_input_stream_fill_async IA__g_buffered_input_stream_fill_async - -extern __typeof (g_buffered_input_stream_fill_finish) IA__g_buffered_input_stream_fill_finish __attribute((visibility("hidden"))); -#define g_buffered_input_stream_fill_finish IA__g_buffered_input_stream_fill_finish - -extern __typeof (g_buffered_input_stream_read_byte) IA__g_buffered_input_stream_read_byte __attribute((visibility("hidden"))); -#define g_buffered_input_stream_read_byte IA__g_buffered_input_stream_read_byte - -#endif -#endif -#if IN_HEADER(__G_BUFFERED_OUTPUT_STREAM_H__) -#if IN_FILE(__G_BUFFERED_OUTPUT_STREAM_C__) -extern __typeof (g_buffered_output_stream_get_type) IA__g_buffered_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST;; -#define g_buffered_output_stream_get_type IA__g_buffered_output_stream_get_type - -extern __typeof (g_buffered_output_stream_new) IA__g_buffered_output_stream_new __attribute((visibility("hidden"))); -#define g_buffered_output_stream_new IA__g_buffered_output_stream_new - -extern __typeof (g_buffered_output_stream_new_sized) IA__g_buffered_output_stream_new_sized __attribute((visibility("hidden"))); -#define g_buffered_output_stream_new_sized IA__g_buffered_output_stream_new_sized - -extern __typeof (g_buffered_output_stream_get_buffer_size) IA__g_buffered_output_stream_get_buffer_size __attribute((visibility("hidden"))); -#define g_buffered_output_stream_get_buffer_size IA__g_buffered_output_stream_get_buffer_size - -extern __typeof (g_buffered_output_stream_set_buffer_size) IA__g_buffered_output_stream_set_buffer_size __attribute((visibility("hidden"))); -#define g_buffered_output_stream_set_buffer_size IA__g_buffered_output_stream_set_buffer_size - -extern __typeof (g_buffered_output_stream_get_auto_grow) IA__g_buffered_output_stream_get_auto_grow __attribute((visibility("hidden"))); -#define g_buffered_output_stream_get_auto_grow IA__g_buffered_output_stream_get_auto_grow - -extern __typeof (g_buffered_output_stream_set_auto_grow) IA__g_buffered_output_stream_set_auto_grow __attribute((visibility("hidden"))); -#define g_buffered_output_stream_set_auto_grow IA__g_buffered_output_stream_set_auto_grow - -#endif -#endif -#if IN_HEADER(__G_CANCELLABLE_H__) -#if IN_FILE(__G_CANCELLABLE_C__) -extern __typeof (g_cancellable_get_type) IA__g_cancellable_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_cancellable_get_type IA__g_cancellable_get_type - -extern __typeof (g_cancellable_new) IA__g_cancellable_new __attribute((visibility("hidden"))); -#define g_cancellable_new IA__g_cancellable_new - -extern __typeof (g_cancellable_is_cancelled) IA__g_cancellable_is_cancelled __attribute((visibility("hidden"))); -#define g_cancellable_is_cancelled IA__g_cancellable_is_cancelled - -extern __typeof (g_cancellable_set_error_if_cancelled) IA__g_cancellable_set_error_if_cancelled __attribute((visibility("hidden"))); -#define g_cancellable_set_error_if_cancelled IA__g_cancellable_set_error_if_cancelled - -extern __typeof (g_cancellable_get_fd) IA__g_cancellable_get_fd __attribute((visibility("hidden"))); -#define g_cancellable_get_fd IA__g_cancellable_get_fd - -extern __typeof (g_cancellable_make_pollfd) IA__g_cancellable_make_pollfd __attribute((visibility("hidden"))); -#define g_cancellable_make_pollfd IA__g_cancellable_make_pollfd - -extern __typeof (g_cancellable_release_fd) IA__g_cancellable_release_fd __attribute((visibility("hidden"))); -#define g_cancellable_release_fd IA__g_cancellable_release_fd - -extern __typeof (g_cancellable_get_current) IA__g_cancellable_get_current __attribute((visibility("hidden"))); -#define g_cancellable_get_current IA__g_cancellable_get_current - -extern __typeof (g_cancellable_push_current) IA__g_cancellable_push_current __attribute((visibility("hidden"))); -#define g_cancellable_push_current IA__g_cancellable_push_current - -extern __typeof (g_cancellable_pop_current) IA__g_cancellable_pop_current __attribute((visibility("hidden"))); -#define g_cancellable_pop_current IA__g_cancellable_pop_current - -extern __typeof (g_cancellable_reset) IA__g_cancellable_reset __attribute((visibility("hidden"))); -#define g_cancellable_reset IA__g_cancellable_reset - -extern __typeof (g_cancellable_cancel) IA__g_cancellable_cancel __attribute((visibility("hidden"))); -#define g_cancellable_cancel IA__g_cancellable_cancel - -extern __typeof (g_cancellable_connect) IA__g_cancellable_connect __attribute((visibility("hidden"))); -#define g_cancellable_connect IA__g_cancellable_connect - -extern __typeof (g_cancellable_disconnect) IA__g_cancellable_disconnect __attribute((visibility("hidden"))); -#define g_cancellable_disconnect IA__g_cancellable_disconnect - -#endif -#endif -#if IN_HEADER(__G_CONTENT_TYPE_H__) -#if IN_FILE(__G_CONTENT_TYPE_C__) -extern __typeof (g_content_type_equals) IA__g_content_type_equals __attribute((visibility("hidden"))); -#define g_content_type_equals IA__g_content_type_equals - -extern __typeof (g_content_type_is_a) IA__g_content_type_is_a __attribute((visibility("hidden"))); -#define g_content_type_is_a IA__g_content_type_is_a - -extern __typeof (g_content_type_is_unknown) IA__g_content_type_is_unknown __attribute((visibility("hidden"))); -#define g_content_type_is_unknown IA__g_content_type_is_unknown - -extern __typeof (g_content_type_get_description) IA__g_content_type_get_description __attribute((visibility("hidden"))); -#define g_content_type_get_description IA__g_content_type_get_description - -extern __typeof (g_content_type_get_mime_type) IA__g_content_type_get_mime_type __attribute((visibility("hidden"))); -#define g_content_type_get_mime_type IA__g_content_type_get_mime_type - -extern __typeof (g_content_type_get_icon) IA__g_content_type_get_icon __attribute((visibility("hidden"))); -#define g_content_type_get_icon IA__g_content_type_get_icon - -extern __typeof (g_content_type_can_be_executable) IA__g_content_type_can_be_executable __attribute((visibility("hidden"))); -#define g_content_type_can_be_executable IA__g_content_type_can_be_executable - -extern __typeof (g_content_type_from_mime_type) IA__g_content_type_from_mime_type __attribute((visibility("hidden"))); -#define g_content_type_from_mime_type IA__g_content_type_from_mime_type - -extern __typeof (g_content_type_guess) IA__g_content_type_guess __attribute((visibility("hidden"))); -#define g_content_type_guess IA__g_content_type_guess - -extern __typeof (g_content_type_guess_for_tree) IA__g_content_type_guess_for_tree __attribute((visibility("hidden"))); -#define g_content_type_guess_for_tree IA__g_content_type_guess_for_tree - -extern __typeof (g_content_types_get_registered) IA__g_content_types_get_registered __attribute((visibility("hidden"))); -#define g_content_types_get_registered IA__g_content_types_get_registered - -#endif -#endif -#if IN_HEADER(__G_CONVERTER_H__) -#if IN_FILE(__G_CONVERTER_C__) -extern __typeof (g_converter_get_type) IA__g_converter_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_converter_get_type IA__g_converter_get_type - -extern __typeof (g_converter_reset) IA__g_converter_reset __attribute((visibility("hidden"))); -#define g_converter_reset IA__g_converter_reset - -extern __typeof (g_converter_convert) IA__g_converter_convert __attribute((visibility("hidden"))); -#define g_converter_convert IA__g_converter_convert - -#endif -#endif -#if IN_HEADER(__G_CONVERTER_INPUT_STREAM_H__) -#if IN_FILE(__G_CONVERTER_INPUT_STREAM_C__) -extern __typeof (g_converter_input_stream_get_type) IA__g_converter_input_stream_get_type __attribute((visibility("hidden"))); -#define g_converter_input_stream_get_type IA__g_converter_input_stream_get_type - -extern __typeof (g_converter_input_stream_new) IA__g_converter_input_stream_new __attribute((visibility("hidden"))); -#define g_converter_input_stream_new IA__g_converter_input_stream_new - -extern __typeof (g_converter_input_stream_get_converter) IA__g_converter_input_stream_get_converter __attribute((visibility("hidden"))); -#define g_converter_input_stream_get_converter IA__g_converter_input_stream_get_converter - -#endif -#endif -#if IN_HEADER(__G_CONVERTER_OUTPUT_STREAM_H__) -#if IN_FILE(__G_CONVERTER_OUTPUT_STREAM_C__) -extern __typeof (g_converter_output_stream_get_type) IA__g_converter_output_stream_get_type __attribute((visibility("hidden"))); -#define g_converter_output_stream_get_type IA__g_converter_output_stream_get_type - -extern __typeof (g_converter_output_stream_new) IA__g_converter_output_stream_new __attribute((visibility("hidden"))); -#define g_converter_output_stream_new IA__g_converter_output_stream_new - -extern __typeof (g_converter_output_stream_get_converter) IA__g_converter_output_stream_get_converter __attribute((visibility("hidden"))); -#define g_converter_output_stream_get_converter IA__g_converter_output_stream_get_converter - -#endif -#endif -#if IN_HEADER(__G_CHARSET_CONVERTER_H__) -#if IN_FILE(__G_CHARSET_CONVERTER_C__) -extern __typeof (g_charset_converter_get_type) IA__g_charset_converter_get_type __attribute((visibility("hidden"))); -#define g_charset_converter_get_type IA__g_charset_converter_get_type - -extern __typeof (g_charset_converter_new) IA__g_charset_converter_new __attribute((visibility("hidden"))); -#define g_charset_converter_new IA__g_charset_converter_new - -extern __typeof (g_charset_converter_get_num_fallbacks) IA__g_charset_converter_get_num_fallbacks __attribute((visibility("hidden"))); -#define g_charset_converter_get_num_fallbacks IA__g_charset_converter_get_num_fallbacks - -extern __typeof (g_charset_converter_get_use_fallback) IA__g_charset_converter_get_use_fallback __attribute((visibility("hidden"))); -#define g_charset_converter_get_use_fallback IA__g_charset_converter_get_use_fallback - -extern __typeof (g_charset_converter_set_use_fallback) IA__g_charset_converter_set_use_fallback __attribute((visibility("hidden"))); -#define g_charset_converter_set_use_fallback IA__g_charset_converter_set_use_fallback - -#endif -#endif -#if IN_HEADER(__G_DATA_INPUT_STREAM_H__) -#if IN_FILE(__G_DATA_INPUT_STREAM_C__) -extern __typeof (g_data_input_stream_get_type) IA__g_data_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_data_input_stream_get_type IA__g_data_input_stream_get_type - -extern __typeof (g_data_input_stream_new) IA__g_data_input_stream_new __attribute((visibility("hidden"))); -#define g_data_input_stream_new IA__g_data_input_stream_new - -extern __typeof (g_data_input_stream_set_byte_order) IA__g_data_input_stream_set_byte_order __attribute((visibility("hidden"))); -#define g_data_input_stream_set_byte_order IA__g_data_input_stream_set_byte_order - -extern __typeof (g_data_input_stream_get_byte_order) IA__g_data_input_stream_get_byte_order __attribute((visibility("hidden"))); -#define g_data_input_stream_get_byte_order IA__g_data_input_stream_get_byte_order - -extern __typeof (g_data_input_stream_set_newline_type) IA__g_data_input_stream_set_newline_type __attribute((visibility("hidden"))); -#define g_data_input_stream_set_newline_type IA__g_data_input_stream_set_newline_type - -extern __typeof (g_data_input_stream_get_newline_type) IA__g_data_input_stream_get_newline_type __attribute((visibility("hidden"))); -#define g_data_input_stream_get_newline_type IA__g_data_input_stream_get_newline_type - -extern __typeof (g_data_input_stream_read_byte) IA__g_data_input_stream_read_byte __attribute((visibility("hidden"))); -#define g_data_input_stream_read_byte IA__g_data_input_stream_read_byte - -extern __typeof (g_data_input_stream_read_int16) IA__g_data_input_stream_read_int16 __attribute((visibility("hidden"))); -#define g_data_input_stream_read_int16 IA__g_data_input_stream_read_int16 - -extern __typeof (g_data_input_stream_read_uint16) IA__g_data_input_stream_read_uint16 __attribute((visibility("hidden"))); -#define g_data_input_stream_read_uint16 IA__g_data_input_stream_read_uint16 - -extern __typeof (g_data_input_stream_read_int32) IA__g_data_input_stream_read_int32 __attribute((visibility("hidden"))); -#define g_data_input_stream_read_int32 IA__g_data_input_stream_read_int32 - -extern __typeof (g_data_input_stream_read_uint32) IA__g_data_input_stream_read_uint32 __attribute((visibility("hidden"))); -#define g_data_input_stream_read_uint32 IA__g_data_input_stream_read_uint32 - -extern __typeof (g_data_input_stream_read_int64) IA__g_data_input_stream_read_int64 __attribute((visibility("hidden"))); -#define g_data_input_stream_read_int64 IA__g_data_input_stream_read_int64 - -extern __typeof (g_data_input_stream_read_uint64) IA__g_data_input_stream_read_uint64 __attribute((visibility("hidden"))); -#define g_data_input_stream_read_uint64 IA__g_data_input_stream_read_uint64 - -extern __typeof (g_data_input_stream_read_line) IA__g_data_input_stream_read_line __attribute((visibility("hidden"))); -#define g_data_input_stream_read_line IA__g_data_input_stream_read_line - -extern __typeof (g_data_input_stream_read_line_async) IA__g_data_input_stream_read_line_async __attribute((visibility("hidden"))); -#define g_data_input_stream_read_line_async IA__g_data_input_stream_read_line_async - -extern __typeof (g_data_input_stream_read_line_finish) IA__g_data_input_stream_read_line_finish __attribute((visibility("hidden"))); -#define g_data_input_stream_read_line_finish IA__g_data_input_stream_read_line_finish - -extern __typeof (g_data_input_stream_read_until) IA__g_data_input_stream_read_until __attribute((visibility("hidden"))); -#define g_data_input_stream_read_until IA__g_data_input_stream_read_until - -extern __typeof (g_data_input_stream_read_until_async) IA__g_data_input_stream_read_until_async __attribute((visibility("hidden"))); -#define g_data_input_stream_read_until_async IA__g_data_input_stream_read_until_async - -extern __typeof (g_data_input_stream_read_until_finish) IA__g_data_input_stream_read_until_finish __attribute((visibility("hidden"))); -#define g_data_input_stream_read_until_finish IA__g_data_input_stream_read_until_finish - -#endif -#endif -#if IN_HEADER(__G_DATA_OUTPUT_STREAM_H__) -#if IN_FILE(__G_DATA_OUTPUT_STREAM_C__) -extern __typeof (g_data_output_stream_get_type) IA__g_data_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_data_output_stream_get_type IA__g_data_output_stream_get_type - -extern __typeof (g_data_output_stream_new) IA__g_data_output_stream_new __attribute((visibility("hidden"))); -#define g_data_output_stream_new IA__g_data_output_stream_new - -extern __typeof (g_data_output_stream_set_byte_order) IA__g_data_output_stream_set_byte_order __attribute((visibility("hidden"))); -#define g_data_output_stream_set_byte_order IA__g_data_output_stream_set_byte_order - -extern __typeof (g_data_output_stream_get_byte_order) IA__g_data_output_stream_get_byte_order __attribute((visibility("hidden"))); -#define g_data_output_stream_get_byte_order IA__g_data_output_stream_get_byte_order - -extern __typeof (g_data_output_stream_put_byte) IA__g_data_output_stream_put_byte __attribute((visibility("hidden"))); -#define g_data_output_stream_put_byte IA__g_data_output_stream_put_byte - -extern __typeof (g_data_output_stream_put_int16) IA__g_data_output_stream_put_int16 __attribute((visibility("hidden"))); -#define g_data_output_stream_put_int16 IA__g_data_output_stream_put_int16 - -extern __typeof (g_data_output_stream_put_uint16) IA__g_data_output_stream_put_uint16 __attribute((visibility("hidden"))); -#define g_data_output_stream_put_uint16 IA__g_data_output_stream_put_uint16 - -extern __typeof (g_data_output_stream_put_int32) IA__g_data_output_stream_put_int32 __attribute((visibility("hidden"))); -#define g_data_output_stream_put_int32 IA__g_data_output_stream_put_int32 - -extern __typeof (g_data_output_stream_put_uint32) IA__g_data_output_stream_put_uint32 __attribute((visibility("hidden"))); -#define g_data_output_stream_put_uint32 IA__g_data_output_stream_put_uint32 - -extern __typeof (g_data_output_stream_put_int64) IA__g_data_output_stream_put_int64 __attribute((visibility("hidden"))); -#define g_data_output_stream_put_int64 IA__g_data_output_stream_put_int64 - -extern __typeof (g_data_output_stream_put_uint64) IA__g_data_output_stream_put_uint64 __attribute((visibility("hidden"))); -#define g_data_output_stream_put_uint64 IA__g_data_output_stream_put_uint64 - -extern __typeof (g_data_output_stream_put_string) IA__g_data_output_stream_put_string __attribute((visibility("hidden"))); -#define g_data_output_stream_put_string IA__g_data_output_stream_put_string - -#endif -#endif -#if IN_HEADER(__G_DRIVE_H__) -#if IN_FILE(__G_DRIVE_C__) -extern __typeof (g_drive_get_type) IA__g_drive_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_drive_get_type IA__g_drive_get_type - -extern __typeof (g_drive_get_name) IA__g_drive_get_name __attribute((visibility("hidden"))); -#define g_drive_get_name IA__g_drive_get_name - -extern __typeof (g_drive_get_icon) IA__g_drive_get_icon __attribute((visibility("hidden"))); -#define g_drive_get_icon IA__g_drive_get_icon - -extern __typeof (g_drive_has_volumes) IA__g_drive_has_volumes __attribute((visibility("hidden"))); -#define g_drive_has_volumes IA__g_drive_has_volumes - -extern __typeof (g_drive_get_volumes) IA__g_drive_get_volumes __attribute((visibility("hidden"))); -#define g_drive_get_volumes IA__g_drive_get_volumes - -extern __typeof (g_drive_is_media_removable) IA__g_drive_is_media_removable __attribute((visibility("hidden"))); -#define g_drive_is_media_removable IA__g_drive_is_media_removable - -extern __typeof (g_drive_has_media) IA__g_drive_has_media __attribute((visibility("hidden"))); -#define g_drive_has_media IA__g_drive_has_media - -extern __typeof (g_drive_is_media_check_automatic) IA__g_drive_is_media_check_automatic __attribute((visibility("hidden"))); -#define g_drive_is_media_check_automatic IA__g_drive_is_media_check_automatic - -extern __typeof (g_drive_can_poll_for_media) IA__g_drive_can_poll_for_media __attribute((visibility("hidden"))); -#define g_drive_can_poll_for_media IA__g_drive_can_poll_for_media - -extern __typeof (g_drive_can_eject) IA__g_drive_can_eject __attribute((visibility("hidden"))); -#define g_drive_can_eject IA__g_drive_can_eject - -extern __typeof (g_drive_eject_with_operation) IA__g_drive_eject_with_operation __attribute((visibility("hidden"))); -#define g_drive_eject_with_operation IA__g_drive_eject_with_operation - -extern __typeof (g_drive_eject_with_operation_finish) IA__g_drive_eject_with_operation_finish __attribute((visibility("hidden"))); -#define g_drive_eject_with_operation_finish IA__g_drive_eject_with_operation_finish - -extern __typeof (g_drive_poll_for_media) IA__g_drive_poll_for_media __attribute((visibility("hidden"))); -#define g_drive_poll_for_media IA__g_drive_poll_for_media - -extern __typeof (g_drive_poll_for_media_finish) IA__g_drive_poll_for_media_finish __attribute((visibility("hidden"))); -#define g_drive_poll_for_media_finish IA__g_drive_poll_for_media_finish - -extern __typeof (g_drive_get_identifier) IA__g_drive_get_identifier __attribute((visibility("hidden"))); -#define g_drive_get_identifier IA__g_drive_get_identifier - -extern __typeof (g_drive_enumerate_identifiers) IA__g_drive_enumerate_identifiers __attribute((visibility("hidden"))); -#define g_drive_enumerate_identifiers IA__g_drive_enumerate_identifiers - -extern __typeof (g_drive_get_start_stop_type) IA__g_drive_get_start_stop_type __attribute((visibility("hidden"))); -#define g_drive_get_start_stop_type IA__g_drive_get_start_stop_type - -extern __typeof (g_drive_can_start) IA__g_drive_can_start __attribute((visibility("hidden"))); -#define g_drive_can_start IA__g_drive_can_start - -extern __typeof (g_drive_can_start_degraded) IA__g_drive_can_start_degraded __attribute((visibility("hidden"))); -#define g_drive_can_start_degraded IA__g_drive_can_start_degraded - -extern __typeof (g_drive_start) IA__g_drive_start __attribute((visibility("hidden"))); -#define g_drive_start IA__g_drive_start - -extern __typeof (g_drive_start_finish) IA__g_drive_start_finish __attribute((visibility("hidden"))); -#define g_drive_start_finish IA__g_drive_start_finish - -extern __typeof (g_drive_can_stop) IA__g_drive_can_stop __attribute((visibility("hidden"))); -#define g_drive_can_stop IA__g_drive_can_stop - -extern __typeof (g_drive_stop) IA__g_drive_stop __attribute((visibility("hidden"))); -#define g_drive_stop IA__g_drive_stop - -extern __typeof (g_drive_stop_finish) IA__g_drive_stop_finish __attribute((visibility("hidden"))); -#define g_drive_stop_finish IA__g_drive_stop_finish - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_drive_eject) IA__g_drive_eject __attribute((visibility("hidden"))); -#define g_drive_eject IA__g_drive_eject - -extern __typeof (g_drive_eject_finish) IA__g_drive_eject_finish __attribute((visibility("hidden"))); -#define g_drive_eject_finish IA__g_drive_eject_finish - -#endif -#endif -#endif -#if IN_HEADER(__G_FILE_ATTRIBUTE_H__) -#if IN_FILE(__G_FILE_ATTRIBUTE_C__) -extern __typeof (g_file_attribute_info_list_new) IA__g_file_attribute_info_list_new __attribute((visibility("hidden"))); -#define g_file_attribute_info_list_new IA__g_file_attribute_info_list_new - -extern __typeof (g_file_attribute_info_list_ref) IA__g_file_attribute_info_list_ref __attribute((visibility("hidden"))); -#define g_file_attribute_info_list_ref IA__g_file_attribute_info_list_ref - -extern __typeof (g_file_attribute_info_list_unref) IA__g_file_attribute_info_list_unref __attribute((visibility("hidden"))); -#define g_file_attribute_info_list_unref IA__g_file_attribute_info_list_unref - -extern __typeof (g_file_attribute_info_list_dup) IA__g_file_attribute_info_list_dup __attribute((visibility("hidden"))); -#define g_file_attribute_info_list_dup IA__g_file_attribute_info_list_dup - -extern __typeof (g_file_attribute_info_list_get_type) IA__g_file_attribute_info_list_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_attribute_info_list_get_type IA__g_file_attribute_info_list_get_type - -extern __typeof (g_file_attribute_info_list_lookup) IA__g_file_attribute_info_list_lookup __attribute((visibility("hidden"))); -#define g_file_attribute_info_list_lookup IA__g_file_attribute_info_list_lookup - -extern __typeof (g_file_attribute_info_list_add) IA__g_file_attribute_info_list_add __attribute((visibility("hidden"))); -#define g_file_attribute_info_list_add IA__g_file_attribute_info_list_add - -#endif -#endif -#if IN_HEADER(__G_FILE_H__) -#if IN_FILE(__G_FILE_C__) -extern __typeof (g_file_get_type) IA__g_file_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_get_type IA__g_file_get_type - -extern __typeof (g_file_new_for_path) IA__g_file_new_for_path __attribute((visibility("hidden"))); -#define g_file_new_for_path IA__g_file_new_for_path - -extern __typeof (g_file_new_for_uri) IA__g_file_new_for_uri __attribute((visibility("hidden"))); -#define g_file_new_for_uri IA__g_file_new_for_uri - -extern __typeof (g_file_new_for_commandline_arg) IA__g_file_new_for_commandline_arg __attribute((visibility("hidden"))); -#define g_file_new_for_commandline_arg IA__g_file_new_for_commandline_arg - -extern __typeof (g_file_parse_name) IA__g_file_parse_name __attribute((visibility("hidden"))); -#define g_file_parse_name IA__g_file_parse_name - -extern __typeof (g_file_dup) IA__g_file_dup __attribute((visibility("hidden"))); -#define g_file_dup IA__g_file_dup - -extern __typeof (g_file_hash) IA__g_file_hash __attribute((visibility("hidden"))); -#define g_file_hash IA__g_file_hash - -extern __typeof (g_file_equal) IA__g_file_equal __attribute((visibility("hidden"))); -#define g_file_equal IA__g_file_equal - -extern __typeof (g_file_get_basename) IA__g_file_get_basename __attribute((visibility("hidden"))); -#define g_file_get_basename IA__g_file_get_basename - -extern __typeof (g_file_get_path) IA__g_file_get_path __attribute((visibility("hidden"))); -#define g_file_get_path IA__g_file_get_path - -extern __typeof (g_file_get_uri) IA__g_file_get_uri __attribute((visibility("hidden"))); -#define g_file_get_uri IA__g_file_get_uri - -extern __typeof (g_file_get_parse_name) IA__g_file_get_parse_name __attribute((visibility("hidden"))); -#define g_file_get_parse_name IA__g_file_get_parse_name - -extern __typeof (g_file_get_parent) IA__g_file_get_parent __attribute((visibility("hidden"))); -#define g_file_get_parent IA__g_file_get_parent - -extern __typeof (g_file_has_parent) IA__g_file_has_parent __attribute((visibility("hidden"))); -#define g_file_has_parent IA__g_file_has_parent - -extern __typeof (g_file_get_child) IA__g_file_get_child __attribute((visibility("hidden"))); -#define g_file_get_child IA__g_file_get_child - -extern __typeof (g_file_get_child_for_display_name) IA__g_file_get_child_for_display_name __attribute((visibility("hidden"))); -#define g_file_get_child_for_display_name IA__g_file_get_child_for_display_name - -extern __typeof (g_file_has_prefix) IA__g_file_has_prefix __attribute((visibility("hidden"))); -#define g_file_has_prefix IA__g_file_has_prefix - -extern __typeof (g_file_get_relative_path) IA__g_file_get_relative_path __attribute((visibility("hidden"))); -#define g_file_get_relative_path IA__g_file_get_relative_path - -extern __typeof (g_file_resolve_relative_path) IA__g_file_resolve_relative_path __attribute((visibility("hidden"))); -#define g_file_resolve_relative_path IA__g_file_resolve_relative_path - -extern __typeof (g_file_is_native) IA__g_file_is_native __attribute((visibility("hidden"))); -#define g_file_is_native IA__g_file_is_native - -extern __typeof (g_file_has_uri_scheme) IA__g_file_has_uri_scheme __attribute((visibility("hidden"))); -#define g_file_has_uri_scheme IA__g_file_has_uri_scheme - -extern __typeof (g_file_get_uri_scheme) IA__g_file_get_uri_scheme __attribute((visibility("hidden"))); -#define g_file_get_uri_scheme IA__g_file_get_uri_scheme - -extern __typeof (g_file_read) IA__g_file_read __attribute((visibility("hidden"))); -#define g_file_read IA__g_file_read - -extern __typeof (g_file_read_async) IA__g_file_read_async __attribute((visibility("hidden"))); -#define g_file_read_async IA__g_file_read_async - -extern __typeof (g_file_read_finish) IA__g_file_read_finish __attribute((visibility("hidden"))); -#define g_file_read_finish IA__g_file_read_finish - -extern __typeof (g_file_append_to) IA__g_file_append_to __attribute((visibility("hidden"))); -#define g_file_append_to IA__g_file_append_to - -extern __typeof (g_file_create) IA__g_file_create __attribute((visibility("hidden"))); -#define g_file_create IA__g_file_create - -extern __typeof (g_file_replace) IA__g_file_replace __attribute((visibility("hidden"))); -#define g_file_replace IA__g_file_replace - -extern __typeof (g_file_append_to_async) IA__g_file_append_to_async __attribute((visibility("hidden"))); -#define g_file_append_to_async IA__g_file_append_to_async - -extern __typeof (g_file_append_to_finish) IA__g_file_append_to_finish __attribute((visibility("hidden"))); -#define g_file_append_to_finish IA__g_file_append_to_finish - -extern __typeof (g_file_create_async) IA__g_file_create_async __attribute((visibility("hidden"))); -#define g_file_create_async IA__g_file_create_async - -extern __typeof (g_file_create_finish) IA__g_file_create_finish __attribute((visibility("hidden"))); -#define g_file_create_finish IA__g_file_create_finish - -extern __typeof (g_file_replace_async) IA__g_file_replace_async __attribute((visibility("hidden"))); -#define g_file_replace_async IA__g_file_replace_async - -extern __typeof (g_file_replace_finish) IA__g_file_replace_finish __attribute((visibility("hidden"))); -#define g_file_replace_finish IA__g_file_replace_finish - -extern __typeof (g_file_query_exists) IA__g_file_query_exists __attribute((visibility("hidden"))); -#define g_file_query_exists IA__g_file_query_exists - -extern __typeof (g_file_query_info) IA__g_file_query_info __attribute((visibility("hidden"))); -#define g_file_query_info IA__g_file_query_info - -extern __typeof (g_file_query_info_async) IA__g_file_query_info_async __attribute((visibility("hidden"))); -#define g_file_query_info_async IA__g_file_query_info_async - -extern __typeof (g_file_query_info_finish) IA__g_file_query_info_finish __attribute((visibility("hidden"))); -#define g_file_query_info_finish IA__g_file_query_info_finish - -extern __typeof (g_file_query_file_type) IA__g_file_query_file_type __attribute((visibility("hidden"))); -#define g_file_query_file_type IA__g_file_query_file_type - -extern __typeof (g_file_query_filesystem_info) IA__g_file_query_filesystem_info __attribute((visibility("hidden"))); -#define g_file_query_filesystem_info IA__g_file_query_filesystem_info - -extern __typeof (g_file_query_filesystem_info_async) IA__g_file_query_filesystem_info_async __attribute((visibility("hidden"))); -#define g_file_query_filesystem_info_async IA__g_file_query_filesystem_info_async - -extern __typeof (g_file_query_filesystem_info_finish) IA__g_file_query_filesystem_info_finish __attribute((visibility("hidden"))); -#define g_file_query_filesystem_info_finish IA__g_file_query_filesystem_info_finish - -extern __typeof (g_file_find_enclosing_mount) IA__g_file_find_enclosing_mount __attribute((visibility("hidden"))); -#define g_file_find_enclosing_mount IA__g_file_find_enclosing_mount - -extern __typeof (g_file_find_enclosing_mount_async) IA__g_file_find_enclosing_mount_async __attribute((visibility("hidden"))); -#define g_file_find_enclosing_mount_async IA__g_file_find_enclosing_mount_async - -extern __typeof (g_file_find_enclosing_mount_finish) IA__g_file_find_enclosing_mount_finish __attribute((visibility("hidden"))); -#define g_file_find_enclosing_mount_finish IA__g_file_find_enclosing_mount_finish - -extern __typeof (g_file_enumerate_children) IA__g_file_enumerate_children __attribute((visibility("hidden"))); -#define g_file_enumerate_children IA__g_file_enumerate_children - -extern __typeof (g_file_enumerate_children_async) IA__g_file_enumerate_children_async __attribute((visibility("hidden"))); -#define g_file_enumerate_children_async IA__g_file_enumerate_children_async - -extern __typeof (g_file_enumerate_children_finish) IA__g_file_enumerate_children_finish __attribute((visibility("hidden"))); -#define g_file_enumerate_children_finish IA__g_file_enumerate_children_finish - -extern __typeof (g_file_set_display_name) IA__g_file_set_display_name __attribute((visibility("hidden"))); -#define g_file_set_display_name IA__g_file_set_display_name - -extern __typeof (g_file_set_display_name_async) IA__g_file_set_display_name_async __attribute((visibility("hidden"))); -#define g_file_set_display_name_async IA__g_file_set_display_name_async - -extern __typeof (g_file_set_display_name_finish) IA__g_file_set_display_name_finish __attribute((visibility("hidden"))); -#define g_file_set_display_name_finish IA__g_file_set_display_name_finish - -extern __typeof (g_file_delete) IA__g_file_delete __attribute((visibility("hidden"))); -#define g_file_delete IA__g_file_delete - -extern __typeof (g_file_trash) IA__g_file_trash __attribute((visibility("hidden"))); -#define g_file_trash IA__g_file_trash - -extern __typeof (g_file_copy) IA__g_file_copy __attribute((visibility("hidden"))); -#define g_file_copy IA__g_file_copy - -extern __typeof (g_file_copy_async) IA__g_file_copy_async __attribute((visibility("hidden"))); -#define g_file_copy_async IA__g_file_copy_async - -extern __typeof (g_file_copy_finish) IA__g_file_copy_finish __attribute((visibility("hidden"))); -#define g_file_copy_finish IA__g_file_copy_finish - -extern __typeof (g_file_move) IA__g_file_move __attribute((visibility("hidden"))); -#define g_file_move IA__g_file_move - -extern __typeof (g_file_make_directory) IA__g_file_make_directory __attribute((visibility("hidden"))); -#define g_file_make_directory IA__g_file_make_directory - -extern __typeof (g_file_make_directory_with_parents) IA__g_file_make_directory_with_parents __attribute((visibility("hidden"))); -#define g_file_make_directory_with_parents IA__g_file_make_directory_with_parents - -extern __typeof (g_file_make_symbolic_link) IA__g_file_make_symbolic_link __attribute((visibility("hidden"))); -#define g_file_make_symbolic_link IA__g_file_make_symbolic_link - -extern __typeof (g_file_query_settable_attributes) IA__g_file_query_settable_attributes __attribute((visibility("hidden"))); -#define g_file_query_settable_attributes IA__g_file_query_settable_attributes - -extern __typeof (g_file_query_writable_namespaces) IA__g_file_query_writable_namespaces __attribute((visibility("hidden"))); -#define g_file_query_writable_namespaces IA__g_file_query_writable_namespaces - -extern __typeof (g_file_set_attribute) IA__g_file_set_attribute __attribute((visibility("hidden"))); -#define g_file_set_attribute IA__g_file_set_attribute - -extern __typeof (g_file_set_attributes_from_info) IA__g_file_set_attributes_from_info __attribute((visibility("hidden"))); -#define g_file_set_attributes_from_info IA__g_file_set_attributes_from_info - -extern __typeof (g_file_set_attributes_async) IA__g_file_set_attributes_async __attribute((visibility("hidden"))); -#define g_file_set_attributes_async IA__g_file_set_attributes_async - -extern __typeof (g_file_set_attributes_finish) IA__g_file_set_attributes_finish __attribute((visibility("hidden"))); -#define g_file_set_attributes_finish IA__g_file_set_attributes_finish - -extern __typeof (g_file_set_attribute_string) IA__g_file_set_attribute_string __attribute((visibility("hidden"))); -#define g_file_set_attribute_string IA__g_file_set_attribute_string - -extern __typeof (g_file_set_attribute_byte_string) IA__g_file_set_attribute_byte_string __attribute((visibility("hidden"))); -#define g_file_set_attribute_byte_string IA__g_file_set_attribute_byte_string - -extern __typeof (g_file_set_attribute_uint32) IA__g_file_set_attribute_uint32 __attribute((visibility("hidden"))); -#define g_file_set_attribute_uint32 IA__g_file_set_attribute_uint32 - -extern __typeof (g_file_set_attribute_int32) IA__g_file_set_attribute_int32 __attribute((visibility("hidden"))); -#define g_file_set_attribute_int32 IA__g_file_set_attribute_int32 - -extern __typeof (g_file_set_attribute_uint64) IA__g_file_set_attribute_uint64 __attribute((visibility("hidden"))); -#define g_file_set_attribute_uint64 IA__g_file_set_attribute_uint64 - -extern __typeof (g_file_set_attribute_int64) IA__g_file_set_attribute_int64 __attribute((visibility("hidden"))); -#define g_file_set_attribute_int64 IA__g_file_set_attribute_int64 - -extern __typeof (g_file_mount_enclosing_volume) IA__g_file_mount_enclosing_volume __attribute((visibility("hidden"))); -#define g_file_mount_enclosing_volume IA__g_file_mount_enclosing_volume - -extern __typeof (g_file_mount_enclosing_volume_finish) IA__g_file_mount_enclosing_volume_finish __attribute((visibility("hidden"))); -#define g_file_mount_enclosing_volume_finish IA__g_file_mount_enclosing_volume_finish - -extern __typeof (g_file_mount_mountable) IA__g_file_mount_mountable __attribute((visibility("hidden"))); -#define g_file_mount_mountable IA__g_file_mount_mountable - -extern __typeof (g_file_mount_mountable_finish) IA__g_file_mount_mountable_finish __attribute((visibility("hidden"))); -#define g_file_mount_mountable_finish IA__g_file_mount_mountable_finish - -extern __typeof (g_file_unmount_mountable_with_operation) IA__g_file_unmount_mountable_with_operation __attribute((visibility("hidden"))); -#define g_file_unmount_mountable_with_operation IA__g_file_unmount_mountable_with_operation - -extern __typeof (g_file_unmount_mountable_with_operation_finish) IA__g_file_unmount_mountable_with_operation_finish __attribute((visibility("hidden"))); -#define g_file_unmount_mountable_with_operation_finish IA__g_file_unmount_mountable_with_operation_finish - -extern __typeof (g_file_eject_mountable_with_operation) IA__g_file_eject_mountable_with_operation __attribute((visibility("hidden"))); -#define g_file_eject_mountable_with_operation IA__g_file_eject_mountable_with_operation - -extern __typeof (g_file_eject_mountable_with_operation_finish) IA__g_file_eject_mountable_with_operation_finish __attribute((visibility("hidden"))); -#define g_file_eject_mountable_with_operation_finish IA__g_file_eject_mountable_with_operation_finish - -extern __typeof (g_file_copy_attributes) IA__g_file_copy_attributes __attribute((visibility("hidden"))); -#define g_file_copy_attributes IA__g_file_copy_attributes - -extern __typeof (g_file_monitor_directory) IA__g_file_monitor_directory __attribute((visibility("hidden"))); -#define g_file_monitor_directory IA__g_file_monitor_directory - -extern __typeof (g_file_monitor_file) IA__g_file_monitor_file __attribute((visibility("hidden"))); -#define g_file_monitor_file IA__g_file_monitor_file - -extern __typeof (g_file_monitor) IA__g_file_monitor __attribute((visibility("hidden"))); -#define g_file_monitor IA__g_file_monitor - -extern __typeof (g_file_query_default_handler) IA__g_file_query_default_handler __attribute((visibility("hidden"))); -#define g_file_query_default_handler IA__g_file_query_default_handler - -extern __typeof (g_file_load_contents) IA__g_file_load_contents __attribute((visibility("hidden"))); -#define g_file_load_contents IA__g_file_load_contents - -extern __typeof (g_file_load_contents_async) IA__g_file_load_contents_async __attribute((visibility("hidden"))); -#define g_file_load_contents_async IA__g_file_load_contents_async - -extern __typeof (g_file_load_contents_finish) IA__g_file_load_contents_finish __attribute((visibility("hidden"))); -#define g_file_load_contents_finish IA__g_file_load_contents_finish - -extern __typeof (g_file_load_partial_contents_async) IA__g_file_load_partial_contents_async __attribute((visibility("hidden"))); -#define g_file_load_partial_contents_async IA__g_file_load_partial_contents_async - -extern __typeof (g_file_load_partial_contents_finish) IA__g_file_load_partial_contents_finish __attribute((visibility("hidden"))); -#define g_file_load_partial_contents_finish IA__g_file_load_partial_contents_finish - -extern __typeof (g_file_replace_contents) IA__g_file_replace_contents __attribute((visibility("hidden"))); -#define g_file_replace_contents IA__g_file_replace_contents - -extern __typeof (g_file_replace_contents_async) IA__g_file_replace_contents_async __attribute((visibility("hidden"))); -#define g_file_replace_contents_async IA__g_file_replace_contents_async - -extern __typeof (g_file_replace_contents_finish) IA__g_file_replace_contents_finish __attribute((visibility("hidden"))); -#define g_file_replace_contents_finish IA__g_file_replace_contents_finish - -extern __typeof (g_file_create_readwrite) IA__g_file_create_readwrite __attribute((visibility("hidden"))); -#define g_file_create_readwrite IA__g_file_create_readwrite - -extern __typeof (g_file_create_readwrite_async) IA__g_file_create_readwrite_async __attribute((visibility("hidden"))); -#define g_file_create_readwrite_async IA__g_file_create_readwrite_async - -extern __typeof (g_file_create_readwrite_finish) IA__g_file_create_readwrite_finish __attribute((visibility("hidden"))); -#define g_file_create_readwrite_finish IA__g_file_create_readwrite_finish - -extern __typeof (g_file_open_readwrite) IA__g_file_open_readwrite __attribute((visibility("hidden"))); -#define g_file_open_readwrite IA__g_file_open_readwrite - -extern __typeof (g_file_open_readwrite_async) IA__g_file_open_readwrite_async __attribute((visibility("hidden"))); -#define g_file_open_readwrite_async IA__g_file_open_readwrite_async - -extern __typeof (g_file_open_readwrite_finish) IA__g_file_open_readwrite_finish __attribute((visibility("hidden"))); -#define g_file_open_readwrite_finish IA__g_file_open_readwrite_finish - -extern __typeof (g_file_replace_readwrite) IA__g_file_replace_readwrite __attribute((visibility("hidden"))); -#define g_file_replace_readwrite IA__g_file_replace_readwrite - -extern __typeof (g_file_replace_readwrite_async) IA__g_file_replace_readwrite_async __attribute((visibility("hidden"))); -#define g_file_replace_readwrite_async IA__g_file_replace_readwrite_async - -extern __typeof (g_file_replace_readwrite_finish) IA__g_file_replace_readwrite_finish __attribute((visibility("hidden"))); -#define g_file_replace_readwrite_finish IA__g_file_replace_readwrite_finish - -extern __typeof (g_file_start_mountable) IA__g_file_start_mountable __attribute((visibility("hidden"))); -#define g_file_start_mountable IA__g_file_start_mountable - -extern __typeof (g_file_start_mountable_finish) IA__g_file_start_mountable_finish __attribute((visibility("hidden"))); -#define g_file_start_mountable_finish IA__g_file_start_mountable_finish - -extern __typeof (g_file_stop_mountable) IA__g_file_stop_mountable __attribute((visibility("hidden"))); -#define g_file_stop_mountable IA__g_file_stop_mountable - -extern __typeof (g_file_stop_mountable_finish) IA__g_file_stop_mountable_finish __attribute((visibility("hidden"))); -#define g_file_stop_mountable_finish IA__g_file_stop_mountable_finish - -extern __typeof (g_file_supports_thread_contexts) IA__g_file_supports_thread_contexts __attribute((visibility("hidden"))); -#define g_file_supports_thread_contexts IA__g_file_supports_thread_contexts - -extern __typeof (g_file_poll_mountable) IA__g_file_poll_mountable __attribute((visibility("hidden"))); -#define g_file_poll_mountable IA__g_file_poll_mountable - -extern __typeof (g_file_poll_mountable_finish) IA__g_file_poll_mountable_finish __attribute((visibility("hidden"))); -#define g_file_poll_mountable_finish IA__g_file_poll_mountable_finish - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_file_unmount_mountable) IA__g_file_unmount_mountable __attribute((visibility("hidden"))); -#define g_file_unmount_mountable IA__g_file_unmount_mountable - -extern __typeof (g_file_unmount_mountable_finish) IA__g_file_unmount_mountable_finish __attribute((visibility("hidden"))); -#define g_file_unmount_mountable_finish IA__g_file_unmount_mountable_finish - -extern __typeof (g_file_eject_mountable) IA__g_file_eject_mountable __attribute((visibility("hidden"))); -#define g_file_eject_mountable IA__g_file_eject_mountable - -extern __typeof (g_file_eject_mountable_finish) IA__g_file_eject_mountable_finish __attribute((visibility("hidden"))); -#define g_file_eject_mountable_finish IA__g_file_eject_mountable_finish - -#endif -#endif -#endif -#if IN_HEADER(__G_FILE_ENUMERATOR_H__) -#if IN_FILE(__G_FILE_ENUMERATOR_C__) -extern __typeof (g_file_enumerator_get_type) IA__g_file_enumerator_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_enumerator_get_type IA__g_file_enumerator_get_type - -extern __typeof (g_file_enumerator_next_file) IA__g_file_enumerator_next_file __attribute((visibility("hidden"))); -#define g_file_enumerator_next_file IA__g_file_enumerator_next_file - -extern __typeof (g_file_enumerator_close) IA__g_file_enumerator_close __attribute((visibility("hidden"))); -#define g_file_enumerator_close IA__g_file_enumerator_close - -extern __typeof (g_file_enumerator_next_files_async) IA__g_file_enumerator_next_files_async __attribute((visibility("hidden"))); -#define g_file_enumerator_next_files_async IA__g_file_enumerator_next_files_async - -extern __typeof (g_file_enumerator_next_files_finish) IA__g_file_enumerator_next_files_finish __attribute((visibility("hidden"))); -#define g_file_enumerator_next_files_finish IA__g_file_enumerator_next_files_finish - -extern __typeof (g_file_enumerator_close_async) IA__g_file_enumerator_close_async __attribute((visibility("hidden"))); -#define g_file_enumerator_close_async IA__g_file_enumerator_close_async - -extern __typeof (g_file_enumerator_close_finish) IA__g_file_enumerator_close_finish __attribute((visibility("hidden"))); -#define g_file_enumerator_close_finish IA__g_file_enumerator_close_finish - -extern __typeof (g_file_enumerator_is_closed) IA__g_file_enumerator_is_closed __attribute((visibility("hidden"))); -#define g_file_enumerator_is_closed IA__g_file_enumerator_is_closed - -extern __typeof (g_file_enumerator_has_pending) IA__g_file_enumerator_has_pending __attribute((visibility("hidden"))); -#define g_file_enumerator_has_pending IA__g_file_enumerator_has_pending - -extern __typeof (g_file_enumerator_set_pending) IA__g_file_enumerator_set_pending __attribute((visibility("hidden"))); -#define g_file_enumerator_set_pending IA__g_file_enumerator_set_pending - -extern __typeof (g_file_enumerator_get_container) IA__g_file_enumerator_get_container __attribute((visibility("hidden"))); -#define g_file_enumerator_get_container IA__g_file_enumerator_get_container - -#endif -#endif -#if IN_HEADER(__G_FILE_ICON_H__) -#if IN_FILE(__G_FILE_ICON_C__) -extern __typeof (g_file_icon_get_type) IA__g_file_icon_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_icon_get_type IA__g_file_icon_get_type - -extern __typeof (g_file_icon_new) IA__g_file_icon_new __attribute((visibility("hidden"))); -#define g_file_icon_new IA__g_file_icon_new - -extern __typeof (g_file_icon_get_file) IA__g_file_icon_get_file __attribute((visibility("hidden"))); -#define g_file_icon_get_file IA__g_file_icon_get_file - -#endif -#endif -#if IN_HEADER(__G_FILE_INFO_H__) -#if IN_FILE(__G_FILE_INFO_C__) -extern __typeof (g_file_info_get_type) IA__g_file_info_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_info_get_type IA__g_file_info_get_type - -extern __typeof (g_file_info_new) IA__g_file_info_new __attribute((visibility("hidden"))); -#define g_file_info_new IA__g_file_info_new - -extern __typeof (g_file_info_dup) IA__g_file_info_dup __attribute((visibility("hidden"))); -#define g_file_info_dup IA__g_file_info_dup - -extern __typeof (g_file_info_copy_into) IA__g_file_info_copy_into __attribute((visibility("hidden"))); -#define g_file_info_copy_into IA__g_file_info_copy_into - -extern __typeof (g_file_info_has_attribute) IA__g_file_info_has_attribute __attribute((visibility("hidden"))); -#define g_file_info_has_attribute IA__g_file_info_has_attribute - -extern __typeof (g_file_info_has_namespace) IA__g_file_info_has_namespace __attribute((visibility("hidden"))); -#define g_file_info_has_namespace IA__g_file_info_has_namespace - -extern __typeof (g_file_info_list_attributes) IA__g_file_info_list_attributes __attribute((visibility("hidden"))); -#define g_file_info_list_attributes IA__g_file_info_list_attributes - -extern __typeof (g_file_info_get_attribute_type) IA__g_file_info_get_attribute_type __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_type IA__g_file_info_get_attribute_type - -extern __typeof (g_file_info_remove_attribute) IA__g_file_info_remove_attribute __attribute((visibility("hidden"))); -#define g_file_info_remove_attribute IA__g_file_info_remove_attribute - -extern __typeof (g_file_info_get_attribute_status) IA__g_file_info_get_attribute_status __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_status IA__g_file_info_get_attribute_status - -extern __typeof (g_file_info_get_attribute_data) IA__g_file_info_get_attribute_data __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_data IA__g_file_info_get_attribute_data - -extern __typeof (g_file_info_get_attribute_as_string) IA__g_file_info_get_attribute_as_string __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_as_string IA__g_file_info_get_attribute_as_string - -extern __typeof (g_file_info_get_attribute_string) IA__g_file_info_get_attribute_string __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_string IA__g_file_info_get_attribute_string - -extern __typeof (g_file_info_get_attribute_byte_string) IA__g_file_info_get_attribute_byte_string __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_byte_string IA__g_file_info_get_attribute_byte_string - -extern __typeof (g_file_info_get_attribute_boolean) IA__g_file_info_get_attribute_boolean __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_boolean IA__g_file_info_get_attribute_boolean - -extern __typeof (g_file_info_get_attribute_uint32) IA__g_file_info_get_attribute_uint32 __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_uint32 IA__g_file_info_get_attribute_uint32 - -extern __typeof (g_file_info_get_attribute_int32) IA__g_file_info_get_attribute_int32 __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_int32 IA__g_file_info_get_attribute_int32 - -extern __typeof (g_file_info_get_attribute_uint64) IA__g_file_info_get_attribute_uint64 __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_uint64 IA__g_file_info_get_attribute_uint64 - -extern __typeof (g_file_info_get_attribute_int64) IA__g_file_info_get_attribute_int64 __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_int64 IA__g_file_info_get_attribute_int64 - -extern __typeof (g_file_info_get_attribute_object) IA__g_file_info_get_attribute_object __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_object IA__g_file_info_get_attribute_object - -extern __typeof (g_file_info_get_attribute_stringv) IA__g_file_info_get_attribute_stringv __attribute((visibility("hidden"))); -#define g_file_info_get_attribute_stringv IA__g_file_info_get_attribute_stringv - -extern __typeof (g_file_info_set_attribute_status) IA__g_file_info_set_attribute_status __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_status IA__g_file_info_set_attribute_status - -extern __typeof (g_file_info_set_attribute) IA__g_file_info_set_attribute __attribute((visibility("hidden"))); -#define g_file_info_set_attribute IA__g_file_info_set_attribute - -extern __typeof (g_file_info_set_attribute_string) IA__g_file_info_set_attribute_string __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_string IA__g_file_info_set_attribute_string - -extern __typeof (g_file_info_set_attribute_byte_string) IA__g_file_info_set_attribute_byte_string __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_byte_string IA__g_file_info_set_attribute_byte_string - -extern __typeof (g_file_info_set_attribute_boolean) IA__g_file_info_set_attribute_boolean __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_boolean IA__g_file_info_set_attribute_boolean - -extern __typeof (g_file_info_set_attribute_uint32) IA__g_file_info_set_attribute_uint32 __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_uint32 IA__g_file_info_set_attribute_uint32 - -extern __typeof (g_file_info_set_attribute_int32) IA__g_file_info_set_attribute_int32 __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_int32 IA__g_file_info_set_attribute_int32 - -extern __typeof (g_file_info_set_attribute_uint64) IA__g_file_info_set_attribute_uint64 __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_uint64 IA__g_file_info_set_attribute_uint64 - -extern __typeof (g_file_info_set_attribute_int64) IA__g_file_info_set_attribute_int64 __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_int64 IA__g_file_info_set_attribute_int64 - -extern __typeof (g_file_info_set_attribute_object) IA__g_file_info_set_attribute_object __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_object IA__g_file_info_set_attribute_object - -extern __typeof (g_file_info_set_attribute_stringv) IA__g_file_info_set_attribute_stringv __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_stringv IA__g_file_info_set_attribute_stringv - -extern __typeof (g_file_info_clear_status) IA__g_file_info_clear_status __attribute((visibility("hidden"))); -#define g_file_info_clear_status IA__g_file_info_clear_status - -extern __typeof (g_file_info_get_file_type) IA__g_file_info_get_file_type __attribute((visibility("hidden"))); -#define g_file_info_get_file_type IA__g_file_info_get_file_type - -extern __typeof (g_file_info_get_is_hidden) IA__g_file_info_get_is_hidden __attribute((visibility("hidden"))); -#define g_file_info_get_is_hidden IA__g_file_info_get_is_hidden - -extern __typeof (g_file_info_get_is_backup) IA__g_file_info_get_is_backup __attribute((visibility("hidden"))); -#define g_file_info_get_is_backup IA__g_file_info_get_is_backup - -extern __typeof (g_file_info_get_is_symlink) IA__g_file_info_get_is_symlink __attribute((visibility("hidden"))); -#define g_file_info_get_is_symlink IA__g_file_info_get_is_symlink - -extern __typeof (g_file_info_get_name) IA__g_file_info_get_name __attribute((visibility("hidden"))); -#define g_file_info_get_name IA__g_file_info_get_name - -extern __typeof (g_file_info_get_display_name) IA__g_file_info_get_display_name __attribute((visibility("hidden"))); -#define g_file_info_get_display_name IA__g_file_info_get_display_name - -extern __typeof (g_file_info_get_edit_name) IA__g_file_info_get_edit_name __attribute((visibility("hidden"))); -#define g_file_info_get_edit_name IA__g_file_info_get_edit_name - -extern __typeof (g_file_info_get_icon) IA__g_file_info_get_icon __attribute((visibility("hidden"))); -#define g_file_info_get_icon IA__g_file_info_get_icon - -extern __typeof (g_file_info_get_content_type) IA__g_file_info_get_content_type __attribute((visibility("hidden"))); -#define g_file_info_get_content_type IA__g_file_info_get_content_type - -extern __typeof (g_file_info_get_size) IA__g_file_info_get_size __attribute((visibility("hidden"))); -#define g_file_info_get_size IA__g_file_info_get_size - -extern __typeof (g_file_info_get_modification_time) IA__g_file_info_get_modification_time __attribute((visibility("hidden"))); -#define g_file_info_get_modification_time IA__g_file_info_get_modification_time - -extern __typeof (g_file_info_get_symlink_target) IA__g_file_info_get_symlink_target __attribute((visibility("hidden"))); -#define g_file_info_get_symlink_target IA__g_file_info_get_symlink_target - -extern __typeof (g_file_info_get_etag) IA__g_file_info_get_etag __attribute((visibility("hidden"))); -#define g_file_info_get_etag IA__g_file_info_get_etag - -extern __typeof (g_file_info_get_sort_order) IA__g_file_info_get_sort_order __attribute((visibility("hidden"))); -#define g_file_info_get_sort_order IA__g_file_info_get_sort_order - -extern __typeof (g_file_info_set_attribute_mask) IA__g_file_info_set_attribute_mask __attribute((visibility("hidden"))); -#define g_file_info_set_attribute_mask IA__g_file_info_set_attribute_mask - -extern __typeof (g_file_info_unset_attribute_mask) IA__g_file_info_unset_attribute_mask __attribute((visibility("hidden"))); -#define g_file_info_unset_attribute_mask IA__g_file_info_unset_attribute_mask - -extern __typeof (g_file_info_set_file_type) IA__g_file_info_set_file_type __attribute((visibility("hidden"))); -#define g_file_info_set_file_type IA__g_file_info_set_file_type - -extern __typeof (g_file_info_set_is_hidden) IA__g_file_info_set_is_hidden __attribute((visibility("hidden"))); -#define g_file_info_set_is_hidden IA__g_file_info_set_is_hidden - -extern __typeof (g_file_info_set_is_symlink) IA__g_file_info_set_is_symlink __attribute((visibility("hidden"))); -#define g_file_info_set_is_symlink IA__g_file_info_set_is_symlink - -extern __typeof (g_file_info_set_name) IA__g_file_info_set_name __attribute((visibility("hidden"))); -#define g_file_info_set_name IA__g_file_info_set_name - -extern __typeof (g_file_info_set_display_name) IA__g_file_info_set_display_name __attribute((visibility("hidden"))); -#define g_file_info_set_display_name IA__g_file_info_set_display_name - -extern __typeof (g_file_info_set_edit_name) IA__g_file_info_set_edit_name __attribute((visibility("hidden"))); -#define g_file_info_set_edit_name IA__g_file_info_set_edit_name - -extern __typeof (g_file_info_set_icon) IA__g_file_info_set_icon __attribute((visibility("hidden"))); -#define g_file_info_set_icon IA__g_file_info_set_icon - -extern __typeof (g_file_info_set_content_type) IA__g_file_info_set_content_type __attribute((visibility("hidden"))); -#define g_file_info_set_content_type IA__g_file_info_set_content_type - -extern __typeof (g_file_info_set_size) IA__g_file_info_set_size __attribute((visibility("hidden"))); -#define g_file_info_set_size IA__g_file_info_set_size - -extern __typeof (g_file_info_set_modification_time) IA__g_file_info_set_modification_time __attribute((visibility("hidden"))); -#define g_file_info_set_modification_time IA__g_file_info_set_modification_time - -extern __typeof (g_file_info_set_symlink_target) IA__g_file_info_set_symlink_target __attribute((visibility("hidden"))); -#define g_file_info_set_symlink_target IA__g_file_info_set_symlink_target - -extern __typeof (g_file_info_set_sort_order) IA__g_file_info_set_sort_order __attribute((visibility("hidden"))); -#define g_file_info_set_sort_order IA__g_file_info_set_sort_order - -extern __typeof (g_file_attribute_matcher_new) IA__g_file_attribute_matcher_new __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_new IA__g_file_attribute_matcher_new - -extern __typeof (g_file_attribute_matcher_ref) IA__g_file_attribute_matcher_ref __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_ref IA__g_file_attribute_matcher_ref - -extern __typeof (g_file_attribute_matcher_unref) IA__g_file_attribute_matcher_unref __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_unref IA__g_file_attribute_matcher_unref - -extern __typeof (g_file_attribute_matcher_matches) IA__g_file_attribute_matcher_matches __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_matches IA__g_file_attribute_matcher_matches - -extern __typeof (g_file_attribute_matcher_matches_only) IA__g_file_attribute_matcher_matches_only __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_matches_only IA__g_file_attribute_matcher_matches_only - -extern __typeof (g_file_attribute_matcher_enumerate_namespace) IA__g_file_attribute_matcher_enumerate_namespace __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_enumerate_namespace IA__g_file_attribute_matcher_enumerate_namespace - -extern __typeof (g_file_attribute_matcher_enumerate_next) IA__g_file_attribute_matcher_enumerate_next __attribute((visibility("hidden"))); -#define g_file_attribute_matcher_enumerate_next IA__g_file_attribute_matcher_enumerate_next - -#endif -#endif -#if IN_HEADER(__G_FILE_INPUT_STREAM_H__) -#if IN_FILE(__G_FILE_INPUT_STREAM_C__) -extern __typeof (g_file_input_stream_get_type) IA__g_file_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_input_stream_get_type IA__g_file_input_stream_get_type - -extern __typeof (g_file_input_stream_query_info) IA__g_file_input_stream_query_info __attribute((visibility("hidden"))); -#define g_file_input_stream_query_info IA__g_file_input_stream_query_info - -extern __typeof (g_file_input_stream_query_info_async) IA__g_file_input_stream_query_info_async __attribute((visibility("hidden"))); -#define g_file_input_stream_query_info_async IA__g_file_input_stream_query_info_async - -extern __typeof (g_file_input_stream_query_info_finish) IA__g_file_input_stream_query_info_finish __attribute((visibility("hidden"))); -#define g_file_input_stream_query_info_finish IA__g_file_input_stream_query_info_finish - -#endif -#endif -#if IN_HEADER(__G_FILE_MONITOR_H__) -#if IN_FILE(__G_FILE_MONITOR_C__) -extern __typeof (g_file_monitor_get_type) IA__g_file_monitor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_monitor_get_type IA__g_file_monitor_get_type - -extern __typeof (g_file_monitor_cancel) IA__g_file_monitor_cancel __attribute((visibility("hidden"))); -#define g_file_monitor_cancel IA__g_file_monitor_cancel - -extern __typeof (g_file_monitor_is_cancelled) IA__g_file_monitor_is_cancelled __attribute((visibility("hidden"))); -#define g_file_monitor_is_cancelled IA__g_file_monitor_is_cancelled - -extern __typeof (g_file_monitor_set_rate_limit) IA__g_file_monitor_set_rate_limit __attribute((visibility("hidden"))); -#define g_file_monitor_set_rate_limit IA__g_file_monitor_set_rate_limit - -extern __typeof (g_file_monitor_emit_event) IA__g_file_monitor_emit_event __attribute((visibility("hidden"))); -#define g_file_monitor_emit_event IA__g_file_monitor_emit_event - -#endif -#endif -#if IN_HEADER(__G_FILENAME_COMPLETER_H__) -#if IN_FILE(__G_FILENAME_COMPLETER_C__) -extern __typeof (g_filename_completer_get_type) IA__g_filename_completer_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_filename_completer_get_type IA__g_filename_completer_get_type - -extern __typeof (g_filename_completer_new) IA__g_filename_completer_new __attribute((visibility("hidden"))); -#define g_filename_completer_new IA__g_filename_completer_new - -extern __typeof (g_filename_completer_get_completion_suffix) IA__g_filename_completer_get_completion_suffix __attribute((visibility("hidden"))); -#define g_filename_completer_get_completion_suffix IA__g_filename_completer_get_completion_suffix - -extern __typeof (g_filename_completer_get_completions) IA__g_filename_completer_get_completions __attribute((visibility("hidden"))); -#define g_filename_completer_get_completions IA__g_filename_completer_get_completions - -extern __typeof (g_filename_completer_set_dirs_only) IA__g_filename_completer_set_dirs_only __attribute((visibility("hidden"))); -#define g_filename_completer_set_dirs_only IA__g_filename_completer_set_dirs_only - -#endif -#endif -#if IN_HEADER(__G_FILE_OUTPUT_STREAM_H__) -#if IN_FILE(__G_FILE_OUTPUT_STREAM_C__) -extern __typeof (g_file_output_stream_get_type) IA__g_file_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_output_stream_get_type IA__g_file_output_stream_get_type - -extern __typeof (g_file_output_stream_query_info) IA__g_file_output_stream_query_info __attribute((visibility("hidden"))); -#define g_file_output_stream_query_info IA__g_file_output_stream_query_info - -extern __typeof (g_file_output_stream_query_info_async) IA__g_file_output_stream_query_info_async __attribute((visibility("hidden"))); -#define g_file_output_stream_query_info_async IA__g_file_output_stream_query_info_async - -extern __typeof (g_file_output_stream_query_info_finish) IA__g_file_output_stream_query_info_finish __attribute((visibility("hidden"))); -#define g_file_output_stream_query_info_finish IA__g_file_output_stream_query_info_finish - -extern __typeof (g_file_output_stream_get_etag) IA__g_file_output_stream_get_etag __attribute((visibility("hidden"))); -#define g_file_output_stream_get_etag IA__g_file_output_stream_get_etag - -#endif -#endif -#if IN_HEADER(__G_FILE_IO_STREAM_H__) -#if IN_FILE(__G_FILE_IO_STREAM_C__) -extern __typeof (g_file_io_stream_get_type) IA__g_file_io_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_io_stream_get_type IA__g_file_io_stream_get_type - -extern __typeof (g_file_io_stream_query_info) IA__g_file_io_stream_query_info __attribute((visibility("hidden"))); -#define g_file_io_stream_query_info IA__g_file_io_stream_query_info - -extern __typeof (g_file_io_stream_query_info_async) IA__g_file_io_stream_query_info_async __attribute((visibility("hidden"))); -#define g_file_io_stream_query_info_async IA__g_file_io_stream_query_info_async - -extern __typeof (g_file_io_stream_query_info_finish) IA__g_file_io_stream_query_info_finish __attribute((visibility("hidden"))); -#define g_file_io_stream_query_info_finish IA__g_file_io_stream_query_info_finish - -extern __typeof (g_file_io_stream_get_etag) IA__g_file_io_stream_get_etag __attribute((visibility("hidden"))); -#define g_file_io_stream_get_etag IA__g_file_io_stream_get_etag - -#endif -#endif -#if IN_HEADER(__G_FILTER_INPUT_STREAM_H__) -#if IN_FILE(__G_FILTER_INPUT_STREAM_C__) -extern __typeof (g_filter_input_stream_get_type) IA__g_filter_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_filter_input_stream_get_type IA__g_filter_input_stream_get_type - -extern __typeof (g_filter_input_stream_get_base_stream) IA__g_filter_input_stream_get_base_stream __attribute((visibility("hidden"))); -#define g_filter_input_stream_get_base_stream IA__g_filter_input_stream_get_base_stream - -extern __typeof (g_filter_input_stream_get_close_base_stream) IA__g_filter_input_stream_get_close_base_stream __attribute((visibility("hidden"))); -#define g_filter_input_stream_get_close_base_stream IA__g_filter_input_stream_get_close_base_stream - -extern __typeof (g_filter_input_stream_set_close_base_stream) IA__g_filter_input_stream_set_close_base_stream __attribute((visibility("hidden"))); -#define g_filter_input_stream_set_close_base_stream IA__g_filter_input_stream_set_close_base_stream - -#endif -#endif -#if IN_HEADER(__G_FILTER_OUTPUT_STREAM_H__) -#if IN_FILE(__G_FILTER_OUTPUT_STREAM_C__) -extern __typeof (g_filter_output_stream_get_type) IA__g_filter_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_filter_output_stream_get_type IA__g_filter_output_stream_get_type - -extern __typeof (g_filter_output_stream_get_base_stream) IA__g_filter_output_stream_get_base_stream __attribute((visibility("hidden"))); -#define g_filter_output_stream_get_base_stream IA__g_filter_output_stream_get_base_stream - -extern __typeof (g_filter_output_stream_get_close_base_stream) IA__g_filter_output_stream_get_close_base_stream __attribute((visibility("hidden"))); -#define g_filter_output_stream_get_close_base_stream IA__g_filter_output_stream_get_close_base_stream - -extern __typeof (g_filter_output_stream_set_close_base_stream) IA__g_filter_output_stream_set_close_base_stream __attribute((visibility("hidden"))); -#define g_filter_output_stream_set_close_base_stream IA__g_filter_output_stream_set_close_base_stream - -#endif -#endif -#if IN_HEADER(__G_ICON_H__) -#if IN_FILE(__G_ICON_C__) -extern __typeof (g_icon_get_type) IA__g_icon_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_icon_get_type IA__g_icon_get_type - -extern __typeof (g_icon_hash) IA__g_icon_hash __attribute((visibility("hidden"))); -#define g_icon_hash IA__g_icon_hash - -extern __typeof (g_icon_equal) IA__g_icon_equal __attribute((visibility("hidden"))); -#define g_icon_equal IA__g_icon_equal - -extern __typeof (g_icon_to_string) IA__g_icon_to_string __attribute((visibility("hidden"))); -#define g_icon_to_string IA__g_icon_to_string - -extern __typeof (g_icon_new_for_string) IA__g_icon_new_for_string __attribute((visibility("hidden"))); -#define g_icon_new_for_string IA__g_icon_new_for_string - -#endif -#endif -#if IN_HEADER(__G_INPUT_STREAM_H__) -#if IN_FILE(__G_INPUT_STREAM_C__) -extern __typeof (g_input_stream_get_type) IA__g_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_input_stream_get_type IA__g_input_stream_get_type - -extern __typeof (g_input_stream_read) IA__g_input_stream_read __attribute((visibility("hidden"))); -#define g_input_stream_read IA__g_input_stream_read - -extern __typeof (g_input_stream_read_all) IA__g_input_stream_read_all __attribute((visibility("hidden"))); -#define g_input_stream_read_all IA__g_input_stream_read_all - -extern __typeof (g_input_stream_skip) IA__g_input_stream_skip __attribute((visibility("hidden"))); -#define g_input_stream_skip IA__g_input_stream_skip - -extern __typeof (g_input_stream_close) IA__g_input_stream_close __attribute((visibility("hidden"))); -#define g_input_stream_close IA__g_input_stream_close - -extern __typeof (g_input_stream_read_async) IA__g_input_stream_read_async __attribute((visibility("hidden"))); -#define g_input_stream_read_async IA__g_input_stream_read_async - -extern __typeof (g_input_stream_read_finish) IA__g_input_stream_read_finish __attribute((visibility("hidden"))); -#define g_input_stream_read_finish IA__g_input_stream_read_finish - -extern __typeof (g_input_stream_skip_async) IA__g_input_stream_skip_async __attribute((visibility("hidden"))); -#define g_input_stream_skip_async IA__g_input_stream_skip_async - -extern __typeof (g_input_stream_skip_finish) IA__g_input_stream_skip_finish __attribute((visibility("hidden"))); -#define g_input_stream_skip_finish IA__g_input_stream_skip_finish - -extern __typeof (g_input_stream_close_async) IA__g_input_stream_close_async __attribute((visibility("hidden"))); -#define g_input_stream_close_async IA__g_input_stream_close_async - -extern __typeof (g_input_stream_close_finish) IA__g_input_stream_close_finish __attribute((visibility("hidden"))); -#define g_input_stream_close_finish IA__g_input_stream_close_finish - -extern __typeof (g_input_stream_is_closed) IA__g_input_stream_is_closed __attribute((visibility("hidden"))); -#define g_input_stream_is_closed IA__g_input_stream_is_closed - -extern __typeof (g_input_stream_has_pending) IA__g_input_stream_has_pending __attribute((visibility("hidden"))); -#define g_input_stream_has_pending IA__g_input_stream_has_pending - -extern __typeof (g_input_stream_set_pending) IA__g_input_stream_set_pending __attribute((visibility("hidden"))); -#define g_input_stream_set_pending IA__g_input_stream_set_pending - -extern __typeof (g_input_stream_clear_pending) IA__g_input_stream_clear_pending __attribute((visibility("hidden"))); -#define g_input_stream_clear_pending IA__g_input_stream_clear_pending - -#endif -#endif -#if IN_HEADER(__G_IO_STREAM_H__) -#if IN_FILE(__G_IO_STREAM_C__) -extern __typeof (g_io_stream_get_type) IA__g_io_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_io_stream_get_type IA__g_io_stream_get_type - -extern __typeof (g_io_stream_get_input_stream) IA__g_io_stream_get_input_stream __attribute((visibility("hidden"))); -#define g_io_stream_get_input_stream IA__g_io_stream_get_input_stream - -extern __typeof (g_io_stream_get_output_stream) IA__g_io_stream_get_output_stream __attribute((visibility("hidden"))); -#define g_io_stream_get_output_stream IA__g_io_stream_get_output_stream - -extern __typeof (g_io_stream_close) IA__g_io_stream_close __attribute((visibility("hidden"))); -#define g_io_stream_close IA__g_io_stream_close - -extern __typeof (g_io_stream_close_async) IA__g_io_stream_close_async __attribute((visibility("hidden"))); -#define g_io_stream_close_async IA__g_io_stream_close_async - -extern __typeof (g_io_stream_close_finish) IA__g_io_stream_close_finish __attribute((visibility("hidden"))); -#define g_io_stream_close_finish IA__g_io_stream_close_finish - -extern __typeof (g_io_stream_is_closed) IA__g_io_stream_is_closed __attribute((visibility("hidden"))); -#define g_io_stream_is_closed IA__g_io_stream_is_closed - -extern __typeof (g_io_stream_has_pending) IA__g_io_stream_has_pending __attribute((visibility("hidden"))); -#define g_io_stream_has_pending IA__g_io_stream_has_pending - -extern __typeof (g_io_stream_set_pending) IA__g_io_stream_set_pending __attribute((visibility("hidden"))); -#define g_io_stream_set_pending IA__g_io_stream_set_pending - -extern __typeof (g_io_stream_clear_pending) IA__g_io_stream_clear_pending __attribute((visibility("hidden"))); -#define g_io_stream_clear_pending IA__g_io_stream_clear_pending - -#endif -#endif -#if IN_HEADER(__G_IO_ERROR_H__) -#if IN_FILE(__G_IO_ERROR_C__) -extern __typeof (g_io_error_quark) IA__g_io_error_quark __attribute((visibility("hidden"))); -#define g_io_error_quark IA__g_io_error_quark - -extern __typeof (g_io_error_from_errno) IA__g_io_error_from_errno __attribute((visibility("hidden"))); -#define g_io_error_from_errno IA__g_io_error_from_errno - -#endif -#endif -#if IN_HEADER(__G_IO_MODULE_H__) -#if IN_FILE(__G_IO_MODULE_C__) -extern __typeof (g_io_module_get_type) IA__g_io_module_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_io_module_get_type IA__g_io_module_get_type - -extern __typeof (g_io_module_new) IA__g_io_module_new __attribute((visibility("hidden"))); -#define g_io_module_new IA__g_io_module_new - -extern __typeof (g_io_modules_scan_all_in_directory) IA__g_io_modules_scan_all_in_directory __attribute((visibility("hidden"))); -#define g_io_modules_scan_all_in_directory IA__g_io_modules_scan_all_in_directory - -extern __typeof (g_io_modules_load_all_in_directory) IA__g_io_modules_load_all_in_directory __attribute((visibility("hidden"))); -#define g_io_modules_load_all_in_directory IA__g_io_modules_load_all_in_directory - -extern __typeof (g_io_extension_point_register) IA__g_io_extension_point_register __attribute((visibility("hidden"))); -#define g_io_extension_point_register IA__g_io_extension_point_register - -extern __typeof (g_io_extension_point_lookup) IA__g_io_extension_point_lookup __attribute((visibility("hidden"))); -#define g_io_extension_point_lookup IA__g_io_extension_point_lookup - -extern __typeof (g_io_extension_point_set_required_type) IA__g_io_extension_point_set_required_type __attribute((visibility("hidden"))); -#define g_io_extension_point_set_required_type IA__g_io_extension_point_set_required_type - -extern __typeof (g_io_extension_point_get_required_type) IA__g_io_extension_point_get_required_type __attribute((visibility("hidden"))); -#define g_io_extension_point_get_required_type IA__g_io_extension_point_get_required_type - -extern __typeof (g_io_extension_point_get_extensions) IA__g_io_extension_point_get_extensions __attribute((visibility("hidden"))); -#define g_io_extension_point_get_extensions IA__g_io_extension_point_get_extensions - -extern __typeof (g_io_extension_point_get_extension_by_name) IA__g_io_extension_point_get_extension_by_name __attribute((visibility("hidden"))); -#define g_io_extension_point_get_extension_by_name IA__g_io_extension_point_get_extension_by_name - -extern __typeof (g_io_extension_point_implement) IA__g_io_extension_point_implement __attribute((visibility("hidden"))); -#define g_io_extension_point_implement IA__g_io_extension_point_implement - -extern __typeof (g_io_extension_get_type) IA__g_io_extension_get_type __attribute((visibility("hidden"))); -#define g_io_extension_get_type IA__g_io_extension_get_type - -extern __typeof (g_io_extension_get_name) IA__g_io_extension_get_name __attribute((visibility("hidden"))); -#define g_io_extension_get_name IA__g_io_extension_get_name - -extern __typeof (g_io_extension_get_priority) IA__g_io_extension_get_priority __attribute((visibility("hidden"))); -#define g_io_extension_get_priority IA__g_io_extension_get_priority - -extern __typeof (g_io_extension_ref_class) IA__g_io_extension_ref_class __attribute((visibility("hidden"))); -#define g_io_extension_ref_class IA__g_io_extension_ref_class - -#endif -#endif -#if IN_HEADER(__G_IO_SCHEDULER_H__) -#if IN_FILE(__G_IO_SCHEDULER_C__) -extern __typeof (g_io_scheduler_push_job) IA__g_io_scheduler_push_job __attribute((visibility("hidden"))); -#define g_io_scheduler_push_job IA__g_io_scheduler_push_job - -extern __typeof (g_io_scheduler_cancel_all_jobs) IA__g_io_scheduler_cancel_all_jobs __attribute((visibility("hidden"))); -#define g_io_scheduler_cancel_all_jobs IA__g_io_scheduler_cancel_all_jobs - -extern __typeof (g_io_scheduler_job_send_to_mainloop) IA__g_io_scheduler_job_send_to_mainloop __attribute((visibility("hidden"))); -#define g_io_scheduler_job_send_to_mainloop IA__g_io_scheduler_job_send_to_mainloop - -extern __typeof (g_io_scheduler_job_send_to_mainloop_async) IA__g_io_scheduler_job_send_to_mainloop_async __attribute((visibility("hidden"))); -#define g_io_scheduler_job_send_to_mainloop_async IA__g_io_scheduler_job_send_to_mainloop_async - -#endif -#endif -#if IN_HEADER(__G_LOADABLE_ICON_H__) -#if IN_FILE(__G_LOADABLE_ICON_C__) -extern __typeof (g_loadable_icon_get_type) IA__g_loadable_icon_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_loadable_icon_get_type IA__g_loadable_icon_get_type - -extern __typeof (g_loadable_icon_load) IA__g_loadable_icon_load __attribute((visibility("hidden"))); -#define g_loadable_icon_load IA__g_loadable_icon_load - -extern __typeof (g_loadable_icon_load_async) IA__g_loadable_icon_load_async __attribute((visibility("hidden"))); -#define g_loadable_icon_load_async IA__g_loadable_icon_load_async - -extern __typeof (g_loadable_icon_load_finish) IA__g_loadable_icon_load_finish __attribute((visibility("hidden"))); -#define g_loadable_icon_load_finish IA__g_loadable_icon_load_finish - -#endif -#endif -#if IN_HEADER(__G_MEMORY_INPUT_STREAM_H__) -#if IN_FILE(__G_MEMORY_INPUT_STREAM_C__) -extern __typeof (g_memory_input_stream_get_type) IA__g_memory_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_memory_input_stream_get_type IA__g_memory_input_stream_get_type - -extern __typeof (g_memory_input_stream_new) IA__g_memory_input_stream_new __attribute((visibility("hidden"))); -#define g_memory_input_stream_new IA__g_memory_input_stream_new - -extern __typeof (g_memory_input_stream_new_from_data) IA__g_memory_input_stream_new_from_data __attribute((visibility("hidden"))); -#define g_memory_input_stream_new_from_data IA__g_memory_input_stream_new_from_data - -extern __typeof (g_memory_input_stream_add_data) IA__g_memory_input_stream_add_data __attribute((visibility("hidden"))); -#define g_memory_input_stream_add_data IA__g_memory_input_stream_add_data - -#endif -#endif -#if IN_HEADER(__G_MEMORY_OUTPUT_STREAM_H__) -#if IN_FILE(__G_MEMORY_OUTPUT_STREAM_C__) -extern __typeof (g_memory_output_stream_get_type) IA__g_memory_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_memory_output_stream_get_type IA__g_memory_output_stream_get_type - -extern __typeof (g_memory_output_stream_new) IA__g_memory_output_stream_new __attribute((visibility("hidden"))); -#define g_memory_output_stream_new IA__g_memory_output_stream_new - -extern __typeof (g_memory_output_stream_get_data) IA__g_memory_output_stream_get_data __attribute((visibility("hidden"))); -#define g_memory_output_stream_get_data IA__g_memory_output_stream_get_data - -extern __typeof (g_memory_output_stream_get_data_size) IA__g_memory_output_stream_get_data_size __attribute((visibility("hidden"))); -#define g_memory_output_stream_get_data_size IA__g_memory_output_stream_get_data_size - -extern __typeof (g_memory_output_stream_get_size) IA__g_memory_output_stream_get_size __attribute((visibility("hidden"))); -#define g_memory_output_stream_get_size IA__g_memory_output_stream_get_size - -#endif -#endif -#if IN_HEADER(__G_MOUNT_OPERATION_H__) -#if IN_FILE(__G_MOUNT_OPERATION_C__) -extern __typeof (g_mount_operation_get_type) IA__g_mount_operation_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_mount_operation_get_type IA__g_mount_operation_get_type - -extern __typeof (g_mount_operation_new) IA__g_mount_operation_new __attribute((visibility("hidden"))); -#define g_mount_operation_new IA__g_mount_operation_new - -extern __typeof (g_mount_operation_get_username) IA__g_mount_operation_get_username __attribute((visibility("hidden"))); -#define g_mount_operation_get_username IA__g_mount_operation_get_username - -extern __typeof (g_mount_operation_set_username) IA__g_mount_operation_set_username __attribute((visibility("hidden"))); -#define g_mount_operation_set_username IA__g_mount_operation_set_username - -extern __typeof (g_mount_operation_get_password) IA__g_mount_operation_get_password __attribute((visibility("hidden"))); -#define g_mount_operation_get_password IA__g_mount_operation_get_password - -extern __typeof (g_mount_operation_set_password) IA__g_mount_operation_set_password __attribute((visibility("hidden"))); -#define g_mount_operation_set_password IA__g_mount_operation_set_password - -extern __typeof (g_mount_operation_get_anonymous) IA__g_mount_operation_get_anonymous __attribute((visibility("hidden"))); -#define g_mount_operation_get_anonymous IA__g_mount_operation_get_anonymous - -extern __typeof (g_mount_operation_set_anonymous) IA__g_mount_operation_set_anonymous __attribute((visibility("hidden"))); -#define g_mount_operation_set_anonymous IA__g_mount_operation_set_anonymous - -extern __typeof (g_mount_operation_get_domain) IA__g_mount_operation_get_domain __attribute((visibility("hidden"))); -#define g_mount_operation_get_domain IA__g_mount_operation_get_domain - -extern __typeof (g_mount_operation_set_domain) IA__g_mount_operation_set_domain __attribute((visibility("hidden"))); -#define g_mount_operation_set_domain IA__g_mount_operation_set_domain - -extern __typeof (g_mount_operation_get_password_save) IA__g_mount_operation_get_password_save __attribute((visibility("hidden"))); -#define g_mount_operation_get_password_save IA__g_mount_operation_get_password_save - -extern __typeof (g_mount_operation_set_password_save) IA__g_mount_operation_set_password_save __attribute((visibility("hidden"))); -#define g_mount_operation_set_password_save IA__g_mount_operation_set_password_save - -extern __typeof (g_mount_operation_get_choice) IA__g_mount_operation_get_choice __attribute((visibility("hidden"))); -#define g_mount_operation_get_choice IA__g_mount_operation_get_choice - -extern __typeof (g_mount_operation_set_choice) IA__g_mount_operation_set_choice __attribute((visibility("hidden"))); -#define g_mount_operation_set_choice IA__g_mount_operation_set_choice - -extern __typeof (g_mount_operation_reply) IA__g_mount_operation_reply __attribute((visibility("hidden"))); -#define g_mount_operation_reply IA__g_mount_operation_reply - -#endif -#endif -#if IN_HEADER(__G_OUTPUT_STREAM_H__) -#if IN_FILE(__G_OUTPUT_STREAM_C__) -extern __typeof (g_output_stream_get_type) IA__g_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_output_stream_get_type IA__g_output_stream_get_type - -extern __typeof (g_output_stream_write) IA__g_output_stream_write __attribute((visibility("hidden"))); -#define g_output_stream_write IA__g_output_stream_write - -extern __typeof (g_output_stream_write_all) IA__g_output_stream_write_all __attribute((visibility("hidden"))); -#define g_output_stream_write_all IA__g_output_stream_write_all - -extern __typeof (g_output_stream_splice) IA__g_output_stream_splice __attribute((visibility("hidden"))); -#define g_output_stream_splice IA__g_output_stream_splice - -extern __typeof (g_output_stream_flush) IA__g_output_stream_flush __attribute((visibility("hidden"))); -#define g_output_stream_flush IA__g_output_stream_flush - -extern __typeof (g_output_stream_close) IA__g_output_stream_close __attribute((visibility("hidden"))); -#define g_output_stream_close IA__g_output_stream_close - -extern __typeof (g_output_stream_write_async) IA__g_output_stream_write_async __attribute((visibility("hidden"))); -#define g_output_stream_write_async IA__g_output_stream_write_async - -extern __typeof (g_output_stream_write_finish) IA__g_output_stream_write_finish __attribute((visibility("hidden"))); -#define g_output_stream_write_finish IA__g_output_stream_write_finish - -extern __typeof (g_output_stream_splice_async) IA__g_output_stream_splice_async __attribute((visibility("hidden"))); -#define g_output_stream_splice_async IA__g_output_stream_splice_async - -extern __typeof (g_output_stream_splice_finish) IA__g_output_stream_splice_finish __attribute((visibility("hidden"))); -#define g_output_stream_splice_finish IA__g_output_stream_splice_finish - -extern __typeof (g_output_stream_flush_async) IA__g_output_stream_flush_async __attribute((visibility("hidden"))); -#define g_output_stream_flush_async IA__g_output_stream_flush_async - -extern __typeof (g_output_stream_flush_finish) IA__g_output_stream_flush_finish __attribute((visibility("hidden"))); -#define g_output_stream_flush_finish IA__g_output_stream_flush_finish - -extern __typeof (g_output_stream_close_async) IA__g_output_stream_close_async __attribute((visibility("hidden"))); -#define g_output_stream_close_async IA__g_output_stream_close_async - -extern __typeof (g_output_stream_close_finish) IA__g_output_stream_close_finish __attribute((visibility("hidden"))); -#define g_output_stream_close_finish IA__g_output_stream_close_finish - -extern __typeof (g_output_stream_is_closed) IA__g_output_stream_is_closed __attribute((visibility("hidden"))); -#define g_output_stream_is_closed IA__g_output_stream_is_closed - -extern __typeof (g_output_stream_is_closing) IA__g_output_stream_is_closing __attribute((visibility("hidden"))); -#define g_output_stream_is_closing IA__g_output_stream_is_closing - -extern __typeof (g_output_stream_has_pending) IA__g_output_stream_has_pending __attribute((visibility("hidden"))); -#define g_output_stream_has_pending IA__g_output_stream_has_pending - -extern __typeof (g_output_stream_set_pending) IA__g_output_stream_set_pending __attribute((visibility("hidden"))); -#define g_output_stream_set_pending IA__g_output_stream_set_pending - -extern __typeof (g_output_stream_clear_pending) IA__g_output_stream_clear_pending __attribute((visibility("hidden"))); -#define g_output_stream_clear_pending IA__g_output_stream_clear_pending - -#endif -#endif -#if IN_HEADER(__G_SEEKABLE_H__) -#if IN_FILE(__G_SEEKABLE_C__) -extern __typeof (g_seekable_get_type) IA__g_seekable_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_seekable_get_type IA__g_seekable_get_type - -extern __typeof (g_seekable_tell) IA__g_seekable_tell __attribute((visibility("hidden"))); -#define g_seekable_tell IA__g_seekable_tell - -extern __typeof (g_seekable_can_seek) IA__g_seekable_can_seek __attribute((visibility("hidden"))); -#define g_seekable_can_seek IA__g_seekable_can_seek - -extern __typeof (g_seekable_seek) IA__g_seekable_seek __attribute((visibility("hidden"))); -#define g_seekable_seek IA__g_seekable_seek - -extern __typeof (g_seekable_can_truncate) IA__g_seekable_can_truncate __attribute((visibility("hidden"))); -#define g_seekable_can_truncate IA__g_seekable_can_truncate - -extern __typeof (g_seekable_truncate) IA__g_seekable_truncate __attribute((visibility("hidden"))); -#define g_seekable_truncate IA__g_seekable_truncate - -#endif -#endif -#if IN_HEADER(__G_SIMPLE_ASYNC_RESULT_H__) -#if IN_FILE(__G_SIMPLE_ASYNC_RESULT_C__) -extern __typeof (g_simple_async_result_get_type) IA__g_simple_async_result_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_simple_async_result_get_type IA__g_simple_async_result_get_type - -extern __typeof (g_simple_async_result_new) IA__g_simple_async_result_new __attribute((visibility("hidden"))); -#define g_simple_async_result_new IA__g_simple_async_result_new - -extern __typeof (g_simple_async_result_new_error) IA__g_simple_async_result_new_error __attribute((visibility("hidden"))); -#define g_simple_async_result_new_error IA__g_simple_async_result_new_error - -extern __typeof (g_simple_async_result_new_from_error) IA__g_simple_async_result_new_from_error __attribute((visibility("hidden"))); -#define g_simple_async_result_new_from_error IA__g_simple_async_result_new_from_error - -extern __typeof (g_simple_async_result_set_op_res_gpointer) IA__g_simple_async_result_set_op_res_gpointer __attribute((visibility("hidden"))); -#define g_simple_async_result_set_op_res_gpointer IA__g_simple_async_result_set_op_res_gpointer - -extern __typeof (g_simple_async_result_get_op_res_gpointer) IA__g_simple_async_result_get_op_res_gpointer __attribute((visibility("hidden"))); -#define g_simple_async_result_get_op_res_gpointer IA__g_simple_async_result_get_op_res_gpointer - -extern __typeof (g_simple_async_result_set_op_res_gssize) IA__g_simple_async_result_set_op_res_gssize __attribute((visibility("hidden"))); -#define g_simple_async_result_set_op_res_gssize IA__g_simple_async_result_set_op_res_gssize - -extern __typeof (g_simple_async_result_get_op_res_gssize) IA__g_simple_async_result_get_op_res_gssize __attribute((visibility("hidden"))); -#define g_simple_async_result_get_op_res_gssize IA__g_simple_async_result_get_op_res_gssize - -extern __typeof (g_simple_async_result_set_op_res_gboolean) IA__g_simple_async_result_set_op_res_gboolean __attribute((visibility("hidden"))); -#define g_simple_async_result_set_op_res_gboolean IA__g_simple_async_result_set_op_res_gboolean - -extern __typeof (g_simple_async_result_get_op_res_gboolean) IA__g_simple_async_result_get_op_res_gboolean __attribute((visibility("hidden"))); -#define g_simple_async_result_get_op_res_gboolean IA__g_simple_async_result_get_op_res_gboolean - -extern __typeof (g_simple_async_result_get_source_tag) IA__g_simple_async_result_get_source_tag __attribute((visibility("hidden"))); -#define g_simple_async_result_get_source_tag IA__g_simple_async_result_get_source_tag - -extern __typeof (g_simple_async_result_set_handle_cancellation) IA__g_simple_async_result_set_handle_cancellation __attribute((visibility("hidden"))); -#define g_simple_async_result_set_handle_cancellation IA__g_simple_async_result_set_handle_cancellation - -extern __typeof (g_simple_async_result_complete) IA__g_simple_async_result_complete __attribute((visibility("hidden"))); -#define g_simple_async_result_complete IA__g_simple_async_result_complete - -extern __typeof (g_simple_async_result_complete_in_idle) IA__g_simple_async_result_complete_in_idle __attribute((visibility("hidden"))); -#define g_simple_async_result_complete_in_idle IA__g_simple_async_result_complete_in_idle - -extern __typeof (g_simple_async_result_run_in_thread) IA__g_simple_async_result_run_in_thread __attribute((visibility("hidden"))); -#define g_simple_async_result_run_in_thread IA__g_simple_async_result_run_in_thread - -extern __typeof (g_simple_async_result_set_from_error) IA__g_simple_async_result_set_from_error __attribute((visibility("hidden"))); -#define g_simple_async_result_set_from_error IA__g_simple_async_result_set_from_error - -extern __typeof (g_simple_async_result_propagate_error) IA__g_simple_async_result_propagate_error __attribute((visibility("hidden"))); -#define g_simple_async_result_propagate_error IA__g_simple_async_result_propagate_error - -extern __typeof (g_simple_async_result_set_error) IA__g_simple_async_result_set_error __attribute((visibility("hidden"))); -#define g_simple_async_result_set_error IA__g_simple_async_result_set_error - -extern __typeof (g_simple_async_result_set_error_va) IA__g_simple_async_result_set_error_va __attribute((visibility("hidden"))); -#define g_simple_async_result_set_error_va IA__g_simple_async_result_set_error_va - -extern __typeof (g_simple_async_result_is_valid) IA__g_simple_async_result_is_valid __attribute((visibility("hidden"))); -#define g_simple_async_result_is_valid IA__g_simple_async_result_is_valid - -extern __typeof (g_simple_async_report_error_in_idle) IA__g_simple_async_report_error_in_idle __attribute((visibility("hidden"))); -#define g_simple_async_report_error_in_idle IA__g_simple_async_report_error_in_idle - -extern __typeof (g_simple_async_report_gerror_in_idle) IA__g_simple_async_report_gerror_in_idle __attribute((visibility("hidden"))); -#define g_simple_async_report_gerror_in_idle IA__g_simple_async_report_gerror_in_idle - -#endif -#endif -#if IN_HEADER(__G_THEMED_ICON_H__) -#if IN_FILE(__G_THEMED_ICON_C__) -extern __typeof (g_themed_icon_get_type) IA__g_themed_icon_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_themed_icon_get_type IA__g_themed_icon_get_type - -extern __typeof (g_themed_icon_new) IA__g_themed_icon_new __attribute((visibility("hidden"))); -#define g_themed_icon_new IA__g_themed_icon_new - -extern __typeof (g_themed_icon_new_with_default_fallbacks) IA__g_themed_icon_new_with_default_fallbacks __attribute((visibility("hidden"))); -#define g_themed_icon_new_with_default_fallbacks IA__g_themed_icon_new_with_default_fallbacks - -extern __typeof (g_themed_icon_new_from_names) IA__g_themed_icon_new_from_names __attribute((visibility("hidden"))); -#define g_themed_icon_new_from_names IA__g_themed_icon_new_from_names - -extern __typeof (g_themed_icon_get_names) IA__g_themed_icon_get_names __attribute((visibility("hidden"))); -#define g_themed_icon_get_names IA__g_themed_icon_get_names - -extern __typeof (g_themed_icon_prepend_name) IA__g_themed_icon_prepend_name __attribute((visibility("hidden"))); -#define g_themed_icon_prepend_name IA__g_themed_icon_prepend_name - -extern __typeof (g_themed_icon_append_name) IA__g_themed_icon_append_name __attribute((visibility("hidden"))); -#define g_themed_icon_append_name IA__g_themed_icon_append_name - -#endif -#endif -#if IN_HEADER(__G_UNIX_MOUNTS_H__) -#if IN_FILE(__G_UNIX_MOUNTS_C__) -#ifdef G_OS_UNIX -extern __typeof (g_unix_mount_free) IA__g_unix_mount_free __attribute((visibility("hidden"))); -#define g_unix_mount_free IA__g_unix_mount_free - -extern __typeof (g_unix_mount_point_free) IA__g_unix_mount_point_free __attribute((visibility("hidden"))); -#define g_unix_mount_point_free IA__g_unix_mount_point_free - -extern __typeof (g_unix_mount_compare) IA__g_unix_mount_compare __attribute((visibility("hidden"))); -#define g_unix_mount_compare IA__g_unix_mount_compare - -extern __typeof (g_unix_mount_get_mount_path) IA__g_unix_mount_get_mount_path __attribute((visibility("hidden"))); -#define g_unix_mount_get_mount_path IA__g_unix_mount_get_mount_path - -extern __typeof (g_unix_mount_get_device_path) IA__g_unix_mount_get_device_path __attribute((visibility("hidden"))); -#define g_unix_mount_get_device_path IA__g_unix_mount_get_device_path - -extern __typeof (g_unix_mount_get_fs_type) IA__g_unix_mount_get_fs_type __attribute((visibility("hidden"))); -#define g_unix_mount_get_fs_type IA__g_unix_mount_get_fs_type - -extern __typeof (g_unix_mount_is_readonly) IA__g_unix_mount_is_readonly __attribute((visibility("hidden"))); -#define g_unix_mount_is_readonly IA__g_unix_mount_is_readonly - -extern __typeof (g_unix_mount_is_system_internal) IA__g_unix_mount_is_system_internal __attribute((visibility("hidden"))); -#define g_unix_mount_is_system_internal IA__g_unix_mount_is_system_internal - -extern __typeof (g_unix_mount_guess_can_eject) IA__g_unix_mount_guess_can_eject __attribute((visibility("hidden"))); -#define g_unix_mount_guess_can_eject IA__g_unix_mount_guess_can_eject - -extern __typeof (g_unix_mount_guess_should_display) IA__g_unix_mount_guess_should_display __attribute((visibility("hidden"))); -#define g_unix_mount_guess_should_display IA__g_unix_mount_guess_should_display - -extern __typeof (g_unix_mount_guess_name) IA__g_unix_mount_guess_name __attribute((visibility("hidden"))); -#define g_unix_mount_guess_name IA__g_unix_mount_guess_name - -extern __typeof (g_unix_mount_guess_icon) IA__g_unix_mount_guess_icon __attribute((visibility("hidden"))); -#define g_unix_mount_guess_icon IA__g_unix_mount_guess_icon - -extern __typeof (g_unix_mount_point_compare) IA__g_unix_mount_point_compare __attribute((visibility("hidden"))); -#define g_unix_mount_point_compare IA__g_unix_mount_point_compare - -extern __typeof (g_unix_mount_point_get_mount_path) IA__g_unix_mount_point_get_mount_path __attribute((visibility("hidden"))); -#define g_unix_mount_point_get_mount_path IA__g_unix_mount_point_get_mount_path - -extern __typeof (g_unix_mount_point_get_device_path) IA__g_unix_mount_point_get_device_path __attribute((visibility("hidden"))); -#define g_unix_mount_point_get_device_path IA__g_unix_mount_point_get_device_path - -extern __typeof (g_unix_mount_point_get_fs_type) IA__g_unix_mount_point_get_fs_type __attribute((visibility("hidden"))); -#define g_unix_mount_point_get_fs_type IA__g_unix_mount_point_get_fs_type - -extern __typeof (g_unix_mount_point_is_readonly) IA__g_unix_mount_point_is_readonly __attribute((visibility("hidden"))); -#define g_unix_mount_point_is_readonly IA__g_unix_mount_point_is_readonly - -extern __typeof (g_unix_mount_point_is_user_mountable) IA__g_unix_mount_point_is_user_mountable __attribute((visibility("hidden"))); -#define g_unix_mount_point_is_user_mountable IA__g_unix_mount_point_is_user_mountable - -extern __typeof (g_unix_mount_point_is_loopback) IA__g_unix_mount_point_is_loopback __attribute((visibility("hidden"))); -#define g_unix_mount_point_is_loopback IA__g_unix_mount_point_is_loopback - -extern __typeof (g_unix_mount_point_guess_can_eject) IA__g_unix_mount_point_guess_can_eject __attribute((visibility("hidden"))); -#define g_unix_mount_point_guess_can_eject IA__g_unix_mount_point_guess_can_eject - -extern __typeof (g_unix_mount_point_guess_name) IA__g_unix_mount_point_guess_name __attribute((visibility("hidden"))); -#define g_unix_mount_point_guess_name IA__g_unix_mount_point_guess_name - -extern __typeof (g_unix_mount_point_guess_icon) IA__g_unix_mount_point_guess_icon __attribute((visibility("hidden"))); -#define g_unix_mount_point_guess_icon IA__g_unix_mount_point_guess_icon - -extern __typeof (g_unix_mount_points_get) IA__g_unix_mount_points_get __attribute((visibility("hidden"))); -#define g_unix_mount_points_get IA__g_unix_mount_points_get - -extern __typeof (g_unix_mounts_get) IA__g_unix_mounts_get __attribute((visibility("hidden"))); -#define g_unix_mounts_get IA__g_unix_mounts_get - -extern __typeof (g_unix_mount_at) IA__g_unix_mount_at __attribute((visibility("hidden"))); -#define g_unix_mount_at IA__g_unix_mount_at - -extern __typeof (g_unix_mounts_changed_since) IA__g_unix_mounts_changed_since __attribute((visibility("hidden"))); -#define g_unix_mounts_changed_since IA__g_unix_mounts_changed_since - -extern __typeof (g_unix_mount_points_changed_since) IA__g_unix_mount_points_changed_since __attribute((visibility("hidden"))); -#define g_unix_mount_points_changed_since IA__g_unix_mount_points_changed_since - -extern __typeof (g_unix_mount_monitor_get_type) IA__g_unix_mount_monitor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_mount_monitor_get_type IA__g_unix_mount_monitor_get_type - -extern __typeof (g_unix_mount_monitor_new) IA__g_unix_mount_monitor_new __attribute((visibility("hidden"))); -#define g_unix_mount_monitor_new IA__g_unix_mount_monitor_new - -extern __typeof (g_unix_mount_monitor_set_rate_limit) IA__g_unix_mount_monitor_set_rate_limit __attribute((visibility("hidden"))); -#define g_unix_mount_monitor_set_rate_limit IA__g_unix_mount_monitor_set_rate_limit - -extern __typeof (g_unix_is_mount_path_system_internal) IA__g_unix_is_mount_path_system_internal __attribute((visibility("hidden"))); -#define g_unix_is_mount_path_system_internal IA__g_unix_is_mount_path_system_internal - -#endif /* G_OS_UNIX */ -#endif -#endif -#if IN_HEADER(__G_UNIX_INPUT_STREAM_H__) -#if IN_FILE(__G_UNIX_INPUT_STREAM_C__) -#ifdef G_OS_UNIX -extern __typeof (g_unix_input_stream_get_type) IA__g_unix_input_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_input_stream_get_type IA__g_unix_input_stream_get_type - -extern __typeof (g_unix_input_stream_new) IA__g_unix_input_stream_new __attribute((visibility("hidden"))); -#define g_unix_input_stream_new IA__g_unix_input_stream_new - -extern __typeof (g_unix_input_stream_set_close_fd) IA__g_unix_input_stream_set_close_fd __attribute((visibility("hidden"))); -#define g_unix_input_stream_set_close_fd IA__g_unix_input_stream_set_close_fd - -extern __typeof (g_unix_input_stream_get_close_fd) IA__g_unix_input_stream_get_close_fd __attribute((visibility("hidden"))); -#define g_unix_input_stream_get_close_fd IA__g_unix_input_stream_get_close_fd - -extern __typeof (g_unix_input_stream_get_fd) IA__g_unix_input_stream_get_fd __attribute((visibility("hidden"))); -#define g_unix_input_stream_get_fd IA__g_unix_input_stream_get_fd - -#endif /* G_OS_UNIX */ -#endif -#endif -#if IN_HEADER(__G_UNIX_OUTPUT_STREAM_H__) -#if IN_FILE(__G_UNIX_OUTPUT_STREAM_C__) -#ifdef G_OS_UNIX -extern __typeof (g_unix_output_stream_get_type) IA__g_unix_output_stream_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_output_stream_get_type IA__g_unix_output_stream_get_type - -extern __typeof (g_unix_output_stream_new) IA__g_unix_output_stream_new __attribute((visibility("hidden"))); -#define g_unix_output_stream_new IA__g_unix_output_stream_new - -extern __typeof (g_unix_output_stream_set_close_fd) IA__g_unix_output_stream_set_close_fd __attribute((visibility("hidden"))); -#define g_unix_output_stream_set_close_fd IA__g_unix_output_stream_set_close_fd - -extern __typeof (g_unix_output_stream_get_close_fd) IA__g_unix_output_stream_get_close_fd __attribute((visibility("hidden"))); -#define g_unix_output_stream_get_close_fd IA__g_unix_output_stream_get_close_fd - -extern __typeof (g_unix_output_stream_get_fd) IA__g_unix_output_stream_get_fd __attribute((visibility("hidden"))); -#define g_unix_output_stream_get_fd IA__g_unix_output_stream_get_fd - -#endif /* G_OS_UNIX */ -#endif -#endif -#if IN_HEADER(__G_MOUNT_H__) -#if IN_FILE(__G_MOUNT_C__) -extern __typeof (g_mount_get_type) IA__g_mount_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_mount_get_type IA__g_mount_get_type - -extern __typeof (g_mount_get_root) IA__g_mount_get_root __attribute((visibility("hidden"))); -#define g_mount_get_root IA__g_mount_get_root - -extern __typeof (g_mount_get_name) IA__g_mount_get_name __attribute((visibility("hidden"))); -#define g_mount_get_name IA__g_mount_get_name - -extern __typeof (g_mount_get_icon) IA__g_mount_get_icon __attribute((visibility("hidden"))); -#define g_mount_get_icon IA__g_mount_get_icon - -extern __typeof (g_mount_get_uuid) IA__g_mount_get_uuid __attribute((visibility("hidden"))); -#define g_mount_get_uuid IA__g_mount_get_uuid - -extern __typeof (g_mount_get_volume) IA__g_mount_get_volume __attribute((visibility("hidden"))); -#define g_mount_get_volume IA__g_mount_get_volume - -extern __typeof (g_mount_get_drive) IA__g_mount_get_drive __attribute((visibility("hidden"))); -#define g_mount_get_drive IA__g_mount_get_drive - -extern __typeof (g_mount_can_unmount) IA__g_mount_can_unmount __attribute((visibility("hidden"))); -#define g_mount_can_unmount IA__g_mount_can_unmount - -extern __typeof (g_mount_can_eject) IA__g_mount_can_eject __attribute((visibility("hidden"))); -#define g_mount_can_eject IA__g_mount_can_eject - -extern __typeof (g_mount_unmount_with_operation) IA__g_mount_unmount_with_operation __attribute((visibility("hidden"))); -#define g_mount_unmount_with_operation IA__g_mount_unmount_with_operation - -extern __typeof (g_mount_unmount_with_operation_finish) IA__g_mount_unmount_with_operation_finish __attribute((visibility("hidden"))); -#define g_mount_unmount_with_operation_finish IA__g_mount_unmount_with_operation_finish - -extern __typeof (g_mount_eject_with_operation) IA__g_mount_eject_with_operation __attribute((visibility("hidden"))); -#define g_mount_eject_with_operation IA__g_mount_eject_with_operation - -extern __typeof (g_mount_eject_with_operation_finish) IA__g_mount_eject_with_operation_finish __attribute((visibility("hidden"))); -#define g_mount_eject_with_operation_finish IA__g_mount_eject_with_operation_finish - -extern __typeof (g_mount_get_default_location) IA__g_mount_get_default_location __attribute((visibility("hidden"))); -#define g_mount_get_default_location IA__g_mount_get_default_location - -extern __typeof (g_mount_remount) IA__g_mount_remount __attribute((visibility("hidden"))); -#define g_mount_remount IA__g_mount_remount - -extern __typeof (g_mount_remount_finish) IA__g_mount_remount_finish __attribute((visibility("hidden"))); -#define g_mount_remount_finish IA__g_mount_remount_finish - -extern __typeof (g_mount_guess_content_type) IA__g_mount_guess_content_type __attribute((visibility("hidden"))); -#define g_mount_guess_content_type IA__g_mount_guess_content_type - -extern __typeof (g_mount_guess_content_type_finish) IA__g_mount_guess_content_type_finish __attribute((visibility("hidden"))); -#define g_mount_guess_content_type_finish IA__g_mount_guess_content_type_finish - -extern __typeof (g_mount_guess_content_type_sync) IA__g_mount_guess_content_type_sync __attribute((visibility("hidden"))); -#define g_mount_guess_content_type_sync IA__g_mount_guess_content_type_sync - -extern __typeof (g_mount_is_shadowed) IA__g_mount_is_shadowed __attribute((visibility("hidden"))); -#define g_mount_is_shadowed IA__g_mount_is_shadowed - -extern __typeof (g_mount_shadow) IA__g_mount_shadow __attribute((visibility("hidden"))); -#define g_mount_shadow IA__g_mount_shadow - -extern __typeof (g_mount_unshadow) IA__g_mount_unshadow __attribute((visibility("hidden"))); -#define g_mount_unshadow IA__g_mount_unshadow - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_mount_unmount) IA__g_mount_unmount __attribute((visibility("hidden"))); -#define g_mount_unmount IA__g_mount_unmount - -extern __typeof (g_mount_unmount_finish) IA__g_mount_unmount_finish __attribute((visibility("hidden"))); -#define g_mount_unmount_finish IA__g_mount_unmount_finish - -extern __typeof (g_mount_eject) IA__g_mount_eject __attribute((visibility("hidden"))); -#define g_mount_eject IA__g_mount_eject - -extern __typeof (g_mount_eject_finish) IA__g_mount_eject_finish __attribute((visibility("hidden"))); -#define g_mount_eject_finish IA__g_mount_eject_finish - -#endif -#endif -#endif -#if IN_HEADER(__G_VOLUME_H__) -#if IN_FILE(__G_VOLUME_C__) -extern __typeof (g_volume_get_type) IA__g_volume_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_volume_get_type IA__g_volume_get_type - -extern __typeof (g_volume_get_name) IA__g_volume_get_name __attribute((visibility("hidden"))); -#define g_volume_get_name IA__g_volume_get_name - -extern __typeof (g_volume_get_icon) IA__g_volume_get_icon __attribute((visibility("hidden"))); -#define g_volume_get_icon IA__g_volume_get_icon - -extern __typeof (g_volume_get_uuid) IA__g_volume_get_uuid __attribute((visibility("hidden"))); -#define g_volume_get_uuid IA__g_volume_get_uuid - -extern __typeof (g_volume_get_drive) IA__g_volume_get_drive __attribute((visibility("hidden"))); -#define g_volume_get_drive IA__g_volume_get_drive - -extern __typeof (g_volume_get_mount) IA__g_volume_get_mount __attribute((visibility("hidden"))); -#define g_volume_get_mount IA__g_volume_get_mount - -extern __typeof (g_volume_should_automount) IA__g_volume_should_automount __attribute((visibility("hidden"))); -#define g_volume_should_automount IA__g_volume_should_automount - -extern __typeof (g_volume_can_mount) IA__g_volume_can_mount __attribute((visibility("hidden"))); -#define g_volume_can_mount IA__g_volume_can_mount - -extern __typeof (g_volume_can_eject) IA__g_volume_can_eject __attribute((visibility("hidden"))); -#define g_volume_can_eject IA__g_volume_can_eject - -extern __typeof (g_volume_mount) IA__g_volume_mount __attribute((visibility("hidden"))); -#define g_volume_mount IA__g_volume_mount - -extern __typeof (g_volume_mount_finish) IA__g_volume_mount_finish __attribute((visibility("hidden"))); -#define g_volume_mount_finish IA__g_volume_mount_finish - -extern __typeof (g_volume_eject_with_operation) IA__g_volume_eject_with_operation __attribute((visibility("hidden"))); -#define g_volume_eject_with_operation IA__g_volume_eject_with_operation - -extern __typeof (g_volume_eject_with_operation_finish) IA__g_volume_eject_with_operation_finish __attribute((visibility("hidden"))); -#define g_volume_eject_with_operation_finish IA__g_volume_eject_with_operation_finish - -extern __typeof (g_volume_get_identifier) IA__g_volume_get_identifier __attribute((visibility("hidden"))); -#define g_volume_get_identifier IA__g_volume_get_identifier - -extern __typeof (g_volume_enumerate_identifiers) IA__g_volume_enumerate_identifiers __attribute((visibility("hidden"))); -#define g_volume_enumerate_identifiers IA__g_volume_enumerate_identifiers - -extern __typeof (g_volume_get_activation_root) IA__g_volume_get_activation_root __attribute((visibility("hidden"))); -#define g_volume_get_activation_root IA__g_volume_get_activation_root - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_volume_eject) IA__g_volume_eject __attribute((visibility("hidden"))); -#define g_volume_eject IA__g_volume_eject - -extern __typeof (g_volume_eject_finish) IA__g_volume_eject_finish __attribute((visibility("hidden"))); -#define g_volume_eject_finish IA__g_volume_eject_finish - -#endif -#endif -#endif -#if IN_HEADER(__G_VOLUME_MONITOR_H__) -#if IN_FILE(__G_VOLUME_MONITOR_C__) -extern __typeof (g_volume_monitor_get_type) IA__g_volume_monitor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_volume_monitor_get_type IA__g_volume_monitor_get_type - -extern __typeof (g_volume_monitor_get_connected_drives) IA__g_volume_monitor_get_connected_drives __attribute((visibility("hidden"))); -#define g_volume_monitor_get_connected_drives IA__g_volume_monitor_get_connected_drives - -extern __typeof (g_volume_monitor_get_volume_for_uuid) IA__g_volume_monitor_get_volume_for_uuid __attribute((visibility("hidden"))); -#define g_volume_monitor_get_volume_for_uuid IA__g_volume_monitor_get_volume_for_uuid - -extern __typeof (g_volume_monitor_get_volumes) IA__g_volume_monitor_get_volumes __attribute((visibility("hidden"))); -#define g_volume_monitor_get_volumes IA__g_volume_monitor_get_volumes - -extern __typeof (g_volume_monitor_get_mounts) IA__g_volume_monitor_get_mounts __attribute((visibility("hidden"))); -#define g_volume_monitor_get_mounts IA__g_volume_monitor_get_mounts - -extern __typeof (g_volume_monitor_get_mount_for_uuid) IA__g_volume_monitor_get_mount_for_uuid __attribute((visibility("hidden"))); -#define g_volume_monitor_get_mount_for_uuid IA__g_volume_monitor_get_mount_for_uuid - -#endif -#if IN_FILE(__G_UNION_VOLUME_MONITOR_C__) -extern __typeof (g_volume_monitor_get) IA__g_volume_monitor_get __attribute((visibility("hidden"))); -#define g_volume_monitor_get IA__g_volume_monitor_get - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_volume_monitor_adopt_orphan_mount) IA__g_volume_monitor_adopt_orphan_mount __attribute((visibility("hidden"))); -#define g_volume_monitor_adopt_orphan_mount IA__g_volume_monitor_adopt_orphan_mount - -#endif -#endif -#endif -#if IN_HEADER(__G_NATIVE_VOLUME_MONITOR_H__) -#if IN_FILE(__G_NATIVE_VOLUME_MONITOR_C__) -extern __typeof (g_native_volume_monitor_get_type) IA__g_native_volume_monitor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_native_volume_monitor_get_type IA__g_native_volume_monitor_get_type - -#endif -#endif -#if IN_HEADER(__G_LOCAL_FILE_MONITOR_H__) -#if IN_FILE(__G_LOCAL_FILE_MONITOR_C__) -#ifdef G_OS_UNIX -extern __typeof (g_local_file_monitor_get_type) IA__g_local_file_monitor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_local_file_monitor_get_type IA__g_local_file_monitor_get_type - -#endif -#endif -#endif -#if IN_HEADER(__G_LOCAL_DIRECTORY_MONITOR_H__) -#if IN_FILE(__G_LOCAL_DIRECTORY_MONITOR_C__) -#ifdef G_OS_UNIX -extern __typeof (g_local_directory_monitor_get_type) IA__g_local_directory_monitor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_local_directory_monitor_get_type IA__g_local_directory_monitor_get_type - -#endif -#endif -#endif -#if IN_HEADER(__GIO_ENUM_TYPES_H__) -#if IN_FILE(__GIO_ENUM_TYPES_C__) -extern __typeof (g_mount_unmount_flags_get_type) IA__g_mount_unmount_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_mount_unmount_flags_get_type IA__g_mount_unmount_flags_get_type - -extern __typeof (g_app_info_create_flags_get_type) IA__g_app_info_create_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_app_info_create_flags_get_type IA__g_app_info_create_flags_get_type - -extern __typeof (g_converter_flags_get_type) IA__g_converter_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_converter_flags_get_type IA__g_converter_flags_get_type - -extern __typeof (g_converter_result_get_type) IA__g_converter_result_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_converter_result_get_type IA__g_converter_result_get_type - -extern __typeof (g_data_stream_byte_order_get_type) IA__g_data_stream_byte_order_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_data_stream_byte_order_get_type IA__g_data_stream_byte_order_get_type - -extern __typeof (g_data_stream_newline_type_get_type) IA__g_data_stream_newline_type_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_data_stream_newline_type_get_type IA__g_data_stream_newline_type_get_type - -extern __typeof (g_file_attribute_info_flags_get_type) IA__g_file_attribute_info_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_attribute_info_flags_get_type IA__g_file_attribute_info_flags_get_type - -extern __typeof (g_file_attribute_status_get_type) IA__g_file_attribute_status_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_attribute_status_get_type IA__g_file_attribute_status_get_type - -extern __typeof (g_file_attribute_type_get_type) IA__g_file_attribute_type_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_attribute_type_get_type IA__g_file_attribute_type_get_type - -extern __typeof (g_file_copy_flags_get_type) IA__g_file_copy_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_copy_flags_get_type IA__g_file_copy_flags_get_type - -extern __typeof (g_file_create_flags_get_type) IA__g_file_create_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_create_flags_get_type IA__g_file_create_flags_get_type - -extern __typeof (g_file_monitor_event_get_type) IA__g_file_monitor_event_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_monitor_event_get_type IA__g_file_monitor_event_get_type - -extern __typeof (g_file_monitor_flags_get_type) IA__g_file_monitor_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_monitor_flags_get_type IA__g_file_monitor_flags_get_type - -extern __typeof (g_file_query_info_flags_get_type) IA__g_file_query_info_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_query_info_flags_get_type IA__g_file_query_info_flags_get_type - -extern __typeof (g_file_type_get_type) IA__g_file_type_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_type_get_type IA__g_file_type_get_type - -extern __typeof (g_filesystem_preview_type_get_type) IA__g_filesystem_preview_type_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_filesystem_preview_type_get_type IA__g_filesystem_preview_type_get_type - -extern __typeof (g_io_error_enum_get_type) IA__g_io_error_enum_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_io_error_enum_get_type IA__g_io_error_enum_get_type - -extern __typeof (g_mount_mount_flags_get_type) IA__g_mount_mount_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_mount_mount_flags_get_type IA__g_mount_mount_flags_get_type - -extern __typeof (g_mount_operation_result_get_type) IA__g_mount_operation_result_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_mount_operation_result_get_type IA__g_mount_operation_result_get_type - -extern __typeof (g_drive_start_flags_get_type) IA__g_drive_start_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_drive_start_flags_get_type IA__g_drive_start_flags_get_type - -extern __typeof (g_drive_start_stop_type_get_type) IA__g_drive_start_stop_type_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_drive_start_stop_type_get_type IA__g_drive_start_stop_type_get_type - -extern __typeof (g_output_stream_splice_flags_get_type) IA__g_output_stream_splice_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_output_stream_splice_flags_get_type IA__g_output_stream_splice_flags_get_type - -extern __typeof (g_ask_password_flags_get_type) IA__g_ask_password_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_ask_password_flags_get_type IA__g_ask_password_flags_get_type - -extern __typeof (g_password_save_get_type) IA__g_password_save_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_password_save_get_type IA__g_password_save_get_type - -extern __typeof (g_emblem_origin_get_type) IA__g_emblem_origin_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_emblem_origin_get_type IA__g_emblem_origin_get_type - -extern __typeof (g_socket_family_get_type) IA__g_socket_family_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_family_get_type IA__g_socket_family_get_type - -extern __typeof (g_socket_type_get_type) IA__g_socket_type_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_type_get_type IA__g_socket_type_get_type - -extern __typeof (g_socket_protocol_get_type) IA__g_socket_protocol_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_protocol_get_type IA__g_socket_protocol_get_type - -extern __typeof (g_socket_msg_flags_get_type) IA__g_socket_msg_flags_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_msg_flags_get_type IA__g_socket_msg_flags_get_type - -extern __typeof (g_resolver_error_get_type) IA__g_resolver_error_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_resolver_error_get_type IA__g_resolver_error_get_type - -extern __typeof (g_zlib_compressor_format_get_type) IA__g_zlib_compressor_format_get_type __attribute((visibility("hidden"))); -#define g_zlib_compressor_format_get_type IA__g_zlib_compressor_format_get_type - -#endif -#endif -#if IN_HEADER(__G_EMBLEMED_ICON_H__) -#if IN_FILE(__G_EMBLEMED_ICON_C__) -extern __typeof (g_emblemed_icon_get_type) IA__g_emblemed_icon_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_emblemed_icon_get_type IA__g_emblemed_icon_get_type - -extern __typeof (g_emblemed_icon_new) IA__g_emblemed_icon_new __attribute((visibility("hidden"))); -#define g_emblemed_icon_new IA__g_emblemed_icon_new - -extern __typeof (g_emblemed_icon_get_icon) IA__g_emblemed_icon_get_icon __attribute((visibility("hidden"))); -#define g_emblemed_icon_get_icon IA__g_emblemed_icon_get_icon - -extern __typeof (g_emblemed_icon_get_emblems) IA__g_emblemed_icon_get_emblems __attribute((visibility("hidden"))); -#define g_emblemed_icon_get_emblems IA__g_emblemed_icon_get_emblems - -extern __typeof (g_emblemed_icon_add_emblem) IA__g_emblemed_icon_add_emblem __attribute((visibility("hidden"))); -#define g_emblemed_icon_add_emblem IA__g_emblemed_icon_add_emblem - -#endif -#endif -#if IN_HEADER(__G_EMBLEM_H__) -#if IN_FILE(__G_EMBLEM_C__) -extern __typeof (g_emblem_get_type) IA__g_emblem_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_emblem_get_type IA__g_emblem_get_type - -extern __typeof (g_emblem_new) IA__g_emblem_new __attribute((visibility("hidden"))); -#define g_emblem_new IA__g_emblem_new - -extern __typeof (g_emblem_new_with_origin) IA__g_emblem_new_with_origin __attribute((visibility("hidden"))); -#define g_emblem_new_with_origin IA__g_emblem_new_with_origin - -extern __typeof (g_emblem_get_icon) IA__g_emblem_get_icon __attribute((visibility("hidden"))); -#define g_emblem_get_icon IA__g_emblem_get_icon - -extern __typeof (g_emblem_get_origin) IA__g_emblem_get_origin __attribute((visibility("hidden"))); -#define g_emblem_get_origin IA__g_emblem_get_origin - -#endif -#endif -#if IN_HEADER(__G_INET_ADDRESS_H__) -#if IN_FILE(__G_INET_ADDRESS_C__) -extern __typeof (g_inet_address_new_from_string) IA__g_inet_address_new_from_string __attribute((visibility("hidden"))); -#define g_inet_address_new_from_string IA__g_inet_address_new_from_string - -extern __typeof (g_inet_address_new_from_bytes) IA__g_inet_address_new_from_bytes __attribute((visibility("hidden"))); -#define g_inet_address_new_from_bytes IA__g_inet_address_new_from_bytes - -extern __typeof (g_inet_address_new_any) IA__g_inet_address_new_any __attribute((visibility("hidden"))); -#define g_inet_address_new_any IA__g_inet_address_new_any - -extern __typeof (g_inet_address_new_loopback) IA__g_inet_address_new_loopback __attribute((visibility("hidden"))); -#define g_inet_address_new_loopback IA__g_inet_address_new_loopback - -extern __typeof (g_inet_address_get_family) IA__g_inet_address_get_family __attribute((visibility("hidden"))); -#define g_inet_address_get_family IA__g_inet_address_get_family - -extern __typeof (g_inet_address_get_type) IA__g_inet_address_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_inet_address_get_type IA__g_inet_address_get_type - -extern __typeof (g_inet_address_get_is_any) IA__g_inet_address_get_is_any __attribute((visibility("hidden"))); -#define g_inet_address_get_is_any IA__g_inet_address_get_is_any - -extern __typeof (g_inet_address_get_is_link_local) IA__g_inet_address_get_is_link_local __attribute((visibility("hidden"))); -#define g_inet_address_get_is_link_local IA__g_inet_address_get_is_link_local - -extern __typeof (g_inet_address_get_is_loopback) IA__g_inet_address_get_is_loopback __attribute((visibility("hidden"))); -#define g_inet_address_get_is_loopback IA__g_inet_address_get_is_loopback - -extern __typeof (g_inet_address_get_is_mc_global) IA__g_inet_address_get_is_mc_global __attribute((visibility("hidden"))); -#define g_inet_address_get_is_mc_global IA__g_inet_address_get_is_mc_global - -extern __typeof (g_inet_address_get_is_mc_link_local) IA__g_inet_address_get_is_mc_link_local __attribute((visibility("hidden"))); -#define g_inet_address_get_is_mc_link_local IA__g_inet_address_get_is_mc_link_local - -extern __typeof (g_inet_address_get_is_mc_node_local) IA__g_inet_address_get_is_mc_node_local __attribute((visibility("hidden"))); -#define g_inet_address_get_is_mc_node_local IA__g_inet_address_get_is_mc_node_local - -extern __typeof (g_inet_address_get_is_mc_org_local) IA__g_inet_address_get_is_mc_org_local __attribute((visibility("hidden"))); -#define g_inet_address_get_is_mc_org_local IA__g_inet_address_get_is_mc_org_local - -extern __typeof (g_inet_address_get_is_mc_site_local) IA__g_inet_address_get_is_mc_site_local __attribute((visibility("hidden"))); -#define g_inet_address_get_is_mc_site_local IA__g_inet_address_get_is_mc_site_local - -extern __typeof (g_inet_address_get_is_multicast) IA__g_inet_address_get_is_multicast __attribute((visibility("hidden"))); -#define g_inet_address_get_is_multicast IA__g_inet_address_get_is_multicast - -extern __typeof (g_inet_address_get_is_site_local) IA__g_inet_address_get_is_site_local __attribute((visibility("hidden"))); -#define g_inet_address_get_is_site_local IA__g_inet_address_get_is_site_local - -extern __typeof (g_inet_address_to_bytes) IA__g_inet_address_to_bytes __attribute((visibility("hidden"))); -#define g_inet_address_to_bytes IA__g_inet_address_to_bytes - -extern __typeof (g_inet_address_get_native_size) IA__g_inet_address_get_native_size __attribute((visibility("hidden"))); -#define g_inet_address_get_native_size IA__g_inet_address_get_native_size - -extern __typeof (g_inet_address_to_string) IA__g_inet_address_to_string __attribute((visibility("hidden"))); -#define g_inet_address_to_string IA__g_inet_address_to_string - -#endif -#endif -#if IN_HEADER(__G_INET_SOCKET_ADDRESS_H__) -#if IN_FILE(__G_INET_SOCKET_ADDRESS_C__) -extern __typeof (g_inet_socket_address_get_address) IA__g_inet_socket_address_get_address __attribute((visibility("hidden"))); -#define g_inet_socket_address_get_address IA__g_inet_socket_address_get_address - -extern __typeof (g_inet_socket_address_get_port) IA__g_inet_socket_address_get_port __attribute((visibility("hidden"))); -#define g_inet_socket_address_get_port IA__g_inet_socket_address_get_port - -extern __typeof (g_inet_socket_address_get_type) IA__g_inet_socket_address_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_inet_socket_address_get_type IA__g_inet_socket_address_get_type - -extern __typeof (g_inet_socket_address_new) IA__g_inet_socket_address_new __attribute((visibility("hidden"))); -#define g_inet_socket_address_new IA__g_inet_socket_address_new - -#endif -#endif -#if IN_HEADER(__G_UNIX_SOCKET_ADDRESS_H__) -#if IN_FILE(__G_UNIX_SOCKET_ADDRESS_C__) -#ifdef G_OS_UNIX -extern __typeof (g_unix_socket_address_get_type) IA__g_unix_socket_address_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_socket_address_get_type IA__g_unix_socket_address_get_type - -extern __typeof (g_unix_socket_address_new) IA__g_unix_socket_address_new __attribute((visibility("hidden"))); -#define g_unix_socket_address_new IA__g_unix_socket_address_new - -extern __typeof (g_unix_socket_address_new_abstract) IA__g_unix_socket_address_new_abstract __attribute((visibility("hidden"))); -#define g_unix_socket_address_new_abstract IA__g_unix_socket_address_new_abstract - -extern __typeof (g_unix_socket_address_abstract_names_supported) IA__g_unix_socket_address_abstract_names_supported __attribute((visibility("hidden"))); -#define g_unix_socket_address_abstract_names_supported IA__g_unix_socket_address_abstract_names_supported - -extern __typeof (g_unix_socket_address_get_is_abstract) IA__g_unix_socket_address_get_is_abstract __attribute((visibility("hidden"))); -#define g_unix_socket_address_get_is_abstract IA__g_unix_socket_address_get_is_abstract - -extern __typeof (g_unix_socket_address_get_path) IA__g_unix_socket_address_get_path __attribute((visibility("hidden"))); -#define g_unix_socket_address_get_path IA__g_unix_socket_address_get_path - -extern __typeof (g_unix_socket_address_get_path_len) IA__g_unix_socket_address_get_path_len __attribute((visibility("hidden"))); -#define g_unix_socket_address_get_path_len IA__g_unix_socket_address_get_path_len - -#endif -#endif -#endif -#if IN_HEADER(__G_SOCKET_ADDRESS_H__) -#if IN_FILE(__G_SOCKET_ADDRESS_C__) -extern __typeof (g_socket_address_new_from_native) IA__g_socket_address_new_from_native __attribute((visibility("hidden"))); -#define g_socket_address_new_from_native IA__g_socket_address_new_from_native - -extern __typeof (g_socket_address_get_type) IA__g_socket_address_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_address_get_type IA__g_socket_address_get_type - -extern __typeof (g_socket_address_get_family) IA__g_socket_address_get_family __attribute((visibility("hidden"))); -#define g_socket_address_get_family IA__g_socket_address_get_family - -extern __typeof (g_socket_address_get_native_size) IA__g_socket_address_get_native_size __attribute((visibility("hidden"))); -#define g_socket_address_get_native_size IA__g_socket_address_get_native_size - -extern __typeof (g_socket_address_to_native) IA__g_socket_address_to_native __attribute((visibility("hidden"))); -#define g_socket_address_to_native IA__g_socket_address_to_native - -#endif -#endif -#if IN_HEADER(__G_RESOLVER_H__) -#if IN_FILE(__G_RESOLVER_C__) -extern __typeof (g_resolver_error_quark) IA__g_resolver_error_quark __attribute((visibility("hidden"))); -#define g_resolver_error_quark IA__g_resolver_error_quark - -extern __typeof (g_resolver_free_addresses) IA__g_resolver_free_addresses __attribute((visibility("hidden"))); -#define g_resolver_free_addresses IA__g_resolver_free_addresses - -extern __typeof (g_resolver_free_targets) IA__g_resolver_free_targets __attribute((visibility("hidden"))); -#define g_resolver_free_targets IA__g_resolver_free_targets - -extern __typeof (g_resolver_get_type) IA__g_resolver_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_resolver_get_type IA__g_resolver_get_type - -extern __typeof (g_resolver_get_default) IA__g_resolver_get_default __attribute((visibility("hidden"))); -#define g_resolver_get_default IA__g_resolver_get_default - -extern __typeof (g_resolver_set_default) IA__g_resolver_set_default __attribute((visibility("hidden"))); -#define g_resolver_set_default IA__g_resolver_set_default - -extern __typeof (g_resolver_lookup_by_name) IA__g_resolver_lookup_by_name __attribute((visibility("hidden"))); -#define g_resolver_lookup_by_name IA__g_resolver_lookup_by_name - -extern __typeof (g_resolver_lookup_by_name_async) IA__g_resolver_lookup_by_name_async __attribute((visibility("hidden"))); -#define g_resolver_lookup_by_name_async IA__g_resolver_lookup_by_name_async - -extern __typeof (g_resolver_lookup_by_name_finish) IA__g_resolver_lookup_by_name_finish __attribute((visibility("hidden"))); -#define g_resolver_lookup_by_name_finish IA__g_resolver_lookup_by_name_finish - -extern __typeof (g_resolver_lookup_by_address) IA__g_resolver_lookup_by_address __attribute((visibility("hidden"))); -#define g_resolver_lookup_by_address IA__g_resolver_lookup_by_address - -extern __typeof (g_resolver_lookup_by_address_async) IA__g_resolver_lookup_by_address_async __attribute((visibility("hidden"))); -#define g_resolver_lookup_by_address_async IA__g_resolver_lookup_by_address_async - -extern __typeof (g_resolver_lookup_by_address_finish) IA__g_resolver_lookup_by_address_finish __attribute((visibility("hidden"))); -#define g_resolver_lookup_by_address_finish IA__g_resolver_lookup_by_address_finish - -extern __typeof (g_resolver_lookup_service) IA__g_resolver_lookup_service __attribute((visibility("hidden"))); -#define g_resolver_lookup_service IA__g_resolver_lookup_service - -extern __typeof (g_resolver_lookup_service_async) IA__g_resolver_lookup_service_async __attribute((visibility("hidden"))); -#define g_resolver_lookup_service_async IA__g_resolver_lookup_service_async - -extern __typeof (g_resolver_lookup_service_finish) IA__g_resolver_lookup_service_finish __attribute((visibility("hidden"))); -#define g_resolver_lookup_service_finish IA__g_resolver_lookup_service_finish - -#endif -#endif -#if IN_HEADER(__G_THREADED_RESOLVER_H__) -#if IN_FILE(__G_THREADED_RESOLVER_C__) -extern __typeof (g_threaded_resolver_get_type) IA__g_threaded_resolver_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_threaded_resolver_get_type IA__g_threaded_resolver_get_type - -#endif -#endif -#if IN_HEADER(__G_UNIX_RESOLVER_H__) -#if IN_FILE(__G_UNIX_RESOLVER_C__) -#ifdef G_OS_UNIX -extern __typeof (g_unix_resolver_get_type) IA__g_unix_resolver_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_resolver_get_type IA__g_unix_resolver_get_type - -#endif -#endif -#endif -#if IN_HEADER(__G_WIN32_RESOLVER_H__) -#if IN_FILE(__G_WIN32_RESOLVER_C__) -#ifdef G_OS_WIN32 -extern __typeof (g_win32_resolver_get_type) IA__g_win32_resolver_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_win32_resolver_get_type IA__g_win32_resolver_get_type - -#endif -#endif -#endif -#if IN_HEADER(__G_SRV_TARGET_H__) -#if IN_FILE(__G_SRV_TARGET_C__) -extern __typeof (g_srv_target_get_type) IA__g_srv_target_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_srv_target_get_type IA__g_srv_target_get_type - -extern __typeof (g_srv_target_new) IA__g_srv_target_new __attribute((visibility("hidden"))); -#define g_srv_target_new IA__g_srv_target_new - -extern __typeof (g_srv_target_copy) IA__g_srv_target_copy __attribute((visibility("hidden"))); -#define g_srv_target_copy IA__g_srv_target_copy - -extern __typeof (g_srv_target_free) IA__g_srv_target_free __attribute((visibility("hidden"))); -#define g_srv_target_free IA__g_srv_target_free - -extern __typeof (g_srv_target_get_hostname) IA__g_srv_target_get_hostname __attribute((visibility("hidden"))); -#define g_srv_target_get_hostname IA__g_srv_target_get_hostname - -extern __typeof (g_srv_target_get_port) IA__g_srv_target_get_port __attribute((visibility("hidden"))); -#define g_srv_target_get_port IA__g_srv_target_get_port - -extern __typeof (g_srv_target_get_priority) IA__g_srv_target_get_priority __attribute((visibility("hidden"))); -#define g_srv_target_get_priority IA__g_srv_target_get_priority - -extern __typeof (g_srv_target_get_weight) IA__g_srv_target_get_weight __attribute((visibility("hidden"))); -#define g_srv_target_get_weight IA__g_srv_target_get_weight - -extern __typeof (g_srv_target_list_sort) IA__g_srv_target_list_sort __attribute((visibility("hidden"))); -#define g_srv_target_list_sort IA__g_srv_target_list_sort - -#endif -#endif -#if IN_HEADER(__G_NETWORK_ADDRESS_H__) -#if IN_FILE(__G_NETWORK_ADDRESS_C__) -extern __typeof (g_network_address_get_type) IA__g_network_address_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_network_address_get_type IA__g_network_address_get_type - -extern __typeof (g_network_address_get_hostname) IA__g_network_address_get_hostname __attribute((visibility("hidden"))); -#define g_network_address_get_hostname IA__g_network_address_get_hostname - -extern __typeof (g_network_address_get_port) IA__g_network_address_get_port __attribute((visibility("hidden"))); -#define g_network_address_get_port IA__g_network_address_get_port - -extern __typeof (g_network_address_new) IA__g_network_address_new __attribute((visibility("hidden"))); -#define g_network_address_new IA__g_network_address_new - -extern __typeof (g_network_address_parse) IA__g_network_address_parse __attribute((visibility("hidden"))); -#define g_network_address_parse IA__g_network_address_parse - -#endif -#endif -#if IN_HEADER(__G_NETWORK_SERVICE_H__) -#if IN_FILE(__G_NETWORK_SERVICE_C__) -extern __typeof (g_network_service_get_type) IA__g_network_service_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_network_service_get_type IA__g_network_service_get_type - -extern __typeof (g_network_service_get_service) IA__g_network_service_get_service __attribute((visibility("hidden"))); -#define g_network_service_get_service IA__g_network_service_get_service - -extern __typeof (g_network_service_get_protocol) IA__g_network_service_get_protocol __attribute((visibility("hidden"))); -#define g_network_service_get_protocol IA__g_network_service_get_protocol - -extern __typeof (g_network_service_get_domain) IA__g_network_service_get_domain __attribute((visibility("hidden"))); -#define g_network_service_get_domain IA__g_network_service_get_domain - -extern __typeof (g_network_service_new) IA__g_network_service_new __attribute((visibility("hidden"))); -#define g_network_service_new IA__g_network_service_new - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CONNECTABLE_H__) -#if IN_FILE(__G_SOCKET_CONNECTABLE_C__) -extern __typeof (g_socket_connectable_enumerate) IA__g_socket_connectable_enumerate __attribute((visibility("hidden"))); -#define g_socket_connectable_enumerate IA__g_socket_connectable_enumerate - -extern __typeof (g_socket_connectable_get_type) IA__g_socket_connectable_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_connectable_get_type IA__g_socket_connectable_get_type - -#endif -#endif -#if IN_HEADER(__G_SOCKET_ADDRESS_ENUMERATOR_H__) -#if IN_FILE(__G_SOCKET_ADDRESS_ENUMERATOR_C__) -extern __typeof (g_socket_address_enumerator_get_type) IA__g_socket_address_enumerator_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_address_enumerator_get_type IA__g_socket_address_enumerator_get_type - -extern __typeof (g_socket_address_enumerator_next) IA__g_socket_address_enumerator_next __attribute((visibility("hidden"))); -#define g_socket_address_enumerator_next IA__g_socket_address_enumerator_next - -extern __typeof (g_socket_address_enumerator_next_async) IA__g_socket_address_enumerator_next_async __attribute((visibility("hidden"))); -#define g_socket_address_enumerator_next_async IA__g_socket_address_enumerator_next_async - -extern __typeof (g_socket_address_enumerator_next_finish) IA__g_socket_address_enumerator_next_finish __attribute((visibility("hidden"))); -#define g_socket_address_enumerator_next_finish IA__g_socket_address_enumerator_next_finish - -#endif -#endif -#if IN_HEADER(__G_ASYNC_INITABLE_H__) -#if IN_FILE(__G_ASYNC_INITABLE_C__) -extern __typeof (g_async_initable_get_type) IA__g_async_initable_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_async_initable_get_type IA__g_async_initable_get_type - -extern __typeof (g_async_initable_init_async) IA__g_async_initable_init_async __attribute((visibility("hidden"))); -#define g_async_initable_init_async IA__g_async_initable_init_async - -extern __typeof (g_async_initable_init_finish) IA__g_async_initable_init_finish __attribute((visibility("hidden"))); -#define g_async_initable_init_finish IA__g_async_initable_init_finish - -extern __typeof (g_async_initable_new_async) IA__g_async_initable_new_async __attribute((visibility("hidden"))); -#define g_async_initable_new_async IA__g_async_initable_new_async - -extern __typeof (g_async_initable_new_finish) IA__g_async_initable_new_finish __attribute((visibility("hidden"))); -#define g_async_initable_new_finish IA__g_async_initable_new_finish - -extern __typeof (g_async_initable_new_valist_async) IA__g_async_initable_new_valist_async __attribute((visibility("hidden"))); -#define g_async_initable_new_valist_async IA__g_async_initable_new_valist_async - -extern __typeof (g_async_initable_newv_async) IA__g_async_initable_newv_async __attribute((visibility("hidden"))); -#define g_async_initable_newv_async IA__g_async_initable_newv_async - -#endif -#endif -#if IN_HEADER(__G_INITABLE_H__) -#if IN_FILE(__G_INITABLE_C__) -extern __typeof (g_initable_get_type) IA__g_initable_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_initable_get_type IA__g_initable_get_type - -extern __typeof (g_initable_init) IA__g_initable_init __attribute((visibility("hidden"))); -#define g_initable_init IA__g_initable_init - -extern __typeof (g_initable_new) IA__g_initable_new __attribute((visibility("hidden"))); -#define g_initable_new IA__g_initable_new - -extern __typeof (g_initable_newv) IA__g_initable_newv __attribute((visibility("hidden"))); -#define g_initable_newv IA__g_initable_newv - -extern __typeof (g_initable_new_valist) IA__g_initable_new_valist __attribute((visibility("hidden"))); -#define g_initable_new_valist IA__g_initable_new_valist - -#endif -#endif -#if IN_HEADER(__G_SOCKET_H__) -#if IN_FILE(__G_SOCKET_C__) -extern __typeof (g_socket_get_type) IA__g_socket_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_get_type IA__g_socket_get_type - -extern __typeof (g_socket_accept) IA__g_socket_accept __attribute((visibility("hidden"))); -#define g_socket_accept IA__g_socket_accept - -extern __typeof (g_socket_bind) IA__g_socket_bind __attribute((visibility("hidden"))); -#define g_socket_bind IA__g_socket_bind - -extern __typeof (g_socket_check_connect_result) IA__g_socket_check_connect_result __attribute((visibility("hidden"))); -#define g_socket_check_connect_result IA__g_socket_check_connect_result - -extern __typeof (g_socket_close) IA__g_socket_close __attribute((visibility("hidden"))); -#define g_socket_close IA__g_socket_close - -extern __typeof (g_socket_shutdown) IA__g_socket_shutdown __attribute((visibility("hidden"))); -#define g_socket_shutdown IA__g_socket_shutdown - -extern __typeof (g_socket_condition_check) IA__g_socket_condition_check __attribute((visibility("hidden"))); -#define g_socket_condition_check IA__g_socket_condition_check - -extern __typeof (g_socket_condition_wait) IA__g_socket_condition_wait __attribute((visibility("hidden"))); -#define g_socket_condition_wait IA__g_socket_condition_wait - -extern __typeof (g_socket_connect) IA__g_socket_connect __attribute((visibility("hidden"))); -#define g_socket_connect IA__g_socket_connect - -extern __typeof (g_socket_create_source) IA__g_socket_create_source __attribute((visibility("hidden"))); -#define g_socket_create_source IA__g_socket_create_source - -extern __typeof (g_socket_get_blocking) IA__g_socket_get_blocking __attribute((visibility("hidden"))); -#define g_socket_get_blocking IA__g_socket_get_blocking - -extern __typeof (g_socket_get_family) IA__g_socket_get_family __attribute((visibility("hidden"))); -#define g_socket_get_family IA__g_socket_get_family - -extern __typeof (g_socket_get_fd) IA__g_socket_get_fd __attribute((visibility("hidden"))); -#define g_socket_get_fd IA__g_socket_get_fd - -extern __typeof (g_socket_get_keepalive) IA__g_socket_get_keepalive __attribute((visibility("hidden"))); -#define g_socket_get_keepalive IA__g_socket_get_keepalive - -extern __typeof (g_socket_get_listen_backlog) IA__g_socket_get_listen_backlog __attribute((visibility("hidden"))); -#define g_socket_get_listen_backlog IA__g_socket_get_listen_backlog - -extern __typeof (g_socket_get_local_address) IA__g_socket_get_local_address __attribute((visibility("hidden"))); -#define g_socket_get_local_address IA__g_socket_get_local_address - -extern __typeof (g_socket_get_protocol) IA__g_socket_get_protocol __attribute((visibility("hidden"))); -#define g_socket_get_protocol IA__g_socket_get_protocol - -extern __typeof (g_socket_get_remote_address) IA__g_socket_get_remote_address __attribute((visibility("hidden"))); -#define g_socket_get_remote_address IA__g_socket_get_remote_address - -extern __typeof (g_socket_get_socket_type) IA__g_socket_get_socket_type __attribute((visibility("hidden"))); -#define g_socket_get_socket_type IA__g_socket_get_socket_type - -extern __typeof (g_socket_is_closed) IA__g_socket_is_closed __attribute((visibility("hidden"))); -#define g_socket_is_closed IA__g_socket_is_closed - -extern __typeof (g_socket_is_connected) IA__g_socket_is_connected __attribute((visibility("hidden"))); -#define g_socket_is_connected IA__g_socket_is_connected - -extern __typeof (g_socket_listen) IA__g_socket_listen __attribute((visibility("hidden"))); -#define g_socket_listen IA__g_socket_listen - -extern __typeof (g_socket_new) IA__g_socket_new __attribute((visibility("hidden"))); -#define g_socket_new IA__g_socket_new - -extern __typeof (g_socket_new_from_fd) IA__g_socket_new_from_fd __attribute((visibility("hidden"))); -#define g_socket_new_from_fd IA__g_socket_new_from_fd - -extern __typeof (g_socket_receive) IA__g_socket_receive __attribute((visibility("hidden"))); -#define g_socket_receive IA__g_socket_receive - -extern __typeof (g_socket_receive_from) IA__g_socket_receive_from __attribute((visibility("hidden"))); -#define g_socket_receive_from IA__g_socket_receive_from - -extern __typeof (g_socket_receive_message) IA__g_socket_receive_message __attribute((visibility("hidden"))); -#define g_socket_receive_message IA__g_socket_receive_message - -extern __typeof (g_socket_send) IA__g_socket_send __attribute((visibility("hidden"))); -#define g_socket_send IA__g_socket_send - -extern __typeof (g_socket_send_message) IA__g_socket_send_message __attribute((visibility("hidden"))); -#define g_socket_send_message IA__g_socket_send_message - -extern __typeof (g_socket_send_to) IA__g_socket_send_to __attribute((visibility("hidden"))); -#define g_socket_send_to IA__g_socket_send_to - -extern __typeof (g_socket_set_blocking) IA__g_socket_set_blocking __attribute((visibility("hidden"))); -#define g_socket_set_blocking IA__g_socket_set_blocking - -extern __typeof (g_socket_set_keepalive) IA__g_socket_set_keepalive __attribute((visibility("hidden"))); -#define g_socket_set_keepalive IA__g_socket_set_keepalive - -extern __typeof (g_socket_set_listen_backlog) IA__g_socket_set_listen_backlog __attribute((visibility("hidden"))); -#define g_socket_set_listen_backlog IA__g_socket_set_listen_backlog - -extern __typeof (g_socket_speaks_ipv4) IA__g_socket_speaks_ipv4 __attribute((visibility("hidden"))); -#define g_socket_speaks_ipv4 IA__g_socket_speaks_ipv4 - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CONTROL_MESSAGE_H__) -#if IN_FILE(__G_SOCKET_CONTROL_MESSAGE_C__) -extern __typeof (g_socket_control_message_get_type) IA__g_socket_control_message_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_control_message_get_type IA__g_socket_control_message_get_type - -extern __typeof (g_socket_control_message_deserialize) IA__g_socket_control_message_deserialize __attribute((visibility("hidden"))); -#define g_socket_control_message_deserialize IA__g_socket_control_message_deserialize - -extern __typeof (g_socket_control_message_get_level) IA__g_socket_control_message_get_level __attribute((visibility("hidden"))); -#define g_socket_control_message_get_level IA__g_socket_control_message_get_level - -extern __typeof (g_socket_control_message_get_msg_type) IA__g_socket_control_message_get_msg_type __attribute((visibility("hidden"))); -#define g_socket_control_message_get_msg_type IA__g_socket_control_message_get_msg_type - -extern __typeof (g_socket_control_message_get_size) IA__g_socket_control_message_get_size __attribute((visibility("hidden"))); -#define g_socket_control_message_get_size IA__g_socket_control_message_get_size - -extern __typeof (g_socket_control_message_serialize) IA__g_socket_control_message_serialize __attribute((visibility("hidden"))); -#define g_socket_control_message_serialize IA__g_socket_control_message_serialize - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CLIENT_H__) -#if IN_FILE(__G_SOCKET_CLIENT_C__) -extern __typeof (g_socket_client_get_type) IA__g_socket_client_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_client_get_type IA__g_socket_client_get_type - -extern __typeof (g_socket_client_connect) IA__g_socket_client_connect __attribute((visibility("hidden"))); -#define g_socket_client_connect IA__g_socket_client_connect - -extern __typeof (g_socket_client_connect_async) IA__g_socket_client_connect_async __attribute((visibility("hidden"))); -#define g_socket_client_connect_async IA__g_socket_client_connect_async - -extern __typeof (g_socket_client_connect_finish) IA__g_socket_client_connect_finish __attribute((visibility("hidden"))); -#define g_socket_client_connect_finish IA__g_socket_client_connect_finish - -extern __typeof (g_socket_client_connect_to_host) IA__g_socket_client_connect_to_host __attribute((visibility("hidden"))); -#define g_socket_client_connect_to_host IA__g_socket_client_connect_to_host - -extern __typeof (g_socket_client_connect_to_host_async) IA__g_socket_client_connect_to_host_async __attribute((visibility("hidden"))); -#define g_socket_client_connect_to_host_async IA__g_socket_client_connect_to_host_async - -extern __typeof (g_socket_client_connect_to_host_finish) IA__g_socket_client_connect_to_host_finish __attribute((visibility("hidden"))); -#define g_socket_client_connect_to_host_finish IA__g_socket_client_connect_to_host_finish - -extern __typeof (g_socket_client_connect_to_service) IA__g_socket_client_connect_to_service __attribute((visibility("hidden"))); -#define g_socket_client_connect_to_service IA__g_socket_client_connect_to_service - -extern __typeof (g_socket_client_connect_to_service_async) IA__g_socket_client_connect_to_service_async __attribute((visibility("hidden"))); -#define g_socket_client_connect_to_service_async IA__g_socket_client_connect_to_service_async - -extern __typeof (g_socket_client_connect_to_service_finish) IA__g_socket_client_connect_to_service_finish __attribute((visibility("hidden"))); -#define g_socket_client_connect_to_service_finish IA__g_socket_client_connect_to_service_finish - -extern __typeof (g_socket_client_get_family) IA__g_socket_client_get_family __attribute((visibility("hidden"))); -#define g_socket_client_get_family IA__g_socket_client_get_family - -extern __typeof (g_socket_client_get_local_address) IA__g_socket_client_get_local_address __attribute((visibility("hidden"))); -#define g_socket_client_get_local_address IA__g_socket_client_get_local_address - -extern __typeof (g_socket_client_get_protocol) IA__g_socket_client_get_protocol __attribute((visibility("hidden"))); -#define g_socket_client_get_protocol IA__g_socket_client_get_protocol - -extern __typeof (g_socket_client_get_socket_type) IA__g_socket_client_get_socket_type __attribute((visibility("hidden"))); -#define g_socket_client_get_socket_type IA__g_socket_client_get_socket_type - -extern __typeof (g_socket_client_new) IA__g_socket_client_new __attribute((visibility("hidden"))); -#define g_socket_client_new IA__g_socket_client_new - -extern __typeof (g_socket_client_set_family) IA__g_socket_client_set_family __attribute((visibility("hidden"))); -#define g_socket_client_set_family IA__g_socket_client_set_family - -extern __typeof (g_socket_client_set_local_address) IA__g_socket_client_set_local_address __attribute((visibility("hidden"))); -#define g_socket_client_set_local_address IA__g_socket_client_set_local_address - -extern __typeof (g_socket_client_set_protocol) IA__g_socket_client_set_protocol __attribute((visibility("hidden"))); -#define g_socket_client_set_protocol IA__g_socket_client_set_protocol - -extern __typeof (g_socket_client_set_socket_type) IA__g_socket_client_set_socket_type __attribute((visibility("hidden"))); -#define g_socket_client_set_socket_type IA__g_socket_client_set_socket_type - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CONNECTION_H__) -#if IN_FILE(__G_SOCKET_CONNECTION_C__) -extern __typeof (g_socket_connection_get_type) IA__g_socket_connection_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_connection_get_type IA__g_socket_connection_get_type - -extern __typeof (g_socket_connection_factory_create_connection) IA__g_socket_connection_factory_create_connection __attribute((visibility("hidden"))); -#define g_socket_connection_factory_create_connection IA__g_socket_connection_factory_create_connection - -extern __typeof (g_socket_connection_factory_lookup_type) IA__g_socket_connection_factory_lookup_type __attribute((visibility("hidden"))); -#define g_socket_connection_factory_lookup_type IA__g_socket_connection_factory_lookup_type - -extern __typeof (g_socket_connection_factory_register_type) IA__g_socket_connection_factory_register_type __attribute((visibility("hidden"))); -#define g_socket_connection_factory_register_type IA__g_socket_connection_factory_register_type - -extern __typeof (g_socket_connection_get_local_address) IA__g_socket_connection_get_local_address __attribute((visibility("hidden"))); -#define g_socket_connection_get_local_address IA__g_socket_connection_get_local_address - -extern __typeof (g_socket_connection_get_remote_address) IA__g_socket_connection_get_remote_address __attribute((visibility("hidden"))); -#define g_socket_connection_get_remote_address IA__g_socket_connection_get_remote_address - -extern __typeof (g_socket_connection_get_socket) IA__g_socket_connection_get_socket __attribute((visibility("hidden"))); -#define g_socket_connection_get_socket IA__g_socket_connection_get_socket - -#endif -#endif -#if IN_HEADER(__G_SOCKET_LISTENER_H__) -#if IN_FILE(__G_SOCKET_LISTENER_C__) -extern __typeof (g_socket_listener_get_type) IA__g_socket_listener_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_listener_get_type IA__g_socket_listener_get_type - -extern __typeof (g_socket_listener_accept) IA__g_socket_listener_accept __attribute((visibility("hidden"))); -#define g_socket_listener_accept IA__g_socket_listener_accept - -extern __typeof (g_socket_listener_accept_async) IA__g_socket_listener_accept_async __attribute((visibility("hidden"))); -#define g_socket_listener_accept_async IA__g_socket_listener_accept_async - -extern __typeof (g_socket_listener_accept_finish) IA__g_socket_listener_accept_finish __attribute((visibility("hidden"))); -#define g_socket_listener_accept_finish IA__g_socket_listener_accept_finish - -extern __typeof (g_socket_listener_accept_socket) IA__g_socket_listener_accept_socket __attribute((visibility("hidden"))); -#define g_socket_listener_accept_socket IA__g_socket_listener_accept_socket - -extern __typeof (g_socket_listener_accept_socket_async) IA__g_socket_listener_accept_socket_async __attribute((visibility("hidden"))); -#define g_socket_listener_accept_socket_async IA__g_socket_listener_accept_socket_async - -extern __typeof (g_socket_listener_accept_socket_finish) IA__g_socket_listener_accept_socket_finish __attribute((visibility("hidden"))); -#define g_socket_listener_accept_socket_finish IA__g_socket_listener_accept_socket_finish - -extern __typeof (g_socket_listener_add_address) IA__g_socket_listener_add_address __attribute((visibility("hidden"))); -#define g_socket_listener_add_address IA__g_socket_listener_add_address - -extern __typeof (g_socket_listener_add_inet_port) IA__g_socket_listener_add_inet_port __attribute((visibility("hidden"))); -#define g_socket_listener_add_inet_port IA__g_socket_listener_add_inet_port - -extern __typeof (g_socket_listener_add_any_inet_port) IA__g_socket_listener_add_any_inet_port __attribute((visibility("hidden"))); -#define g_socket_listener_add_any_inet_port IA__g_socket_listener_add_any_inet_port - -extern __typeof (g_socket_listener_add_socket) IA__g_socket_listener_add_socket __attribute((visibility("hidden"))); -#define g_socket_listener_add_socket IA__g_socket_listener_add_socket - -extern __typeof (g_socket_listener_close) IA__g_socket_listener_close __attribute((visibility("hidden"))); -#define g_socket_listener_close IA__g_socket_listener_close - -extern __typeof (g_socket_listener_new) IA__g_socket_listener_new __attribute((visibility("hidden"))); -#define g_socket_listener_new IA__g_socket_listener_new - -extern __typeof (g_socket_listener_set_backlog) IA__g_socket_listener_set_backlog __attribute((visibility("hidden"))); -#define g_socket_listener_set_backlog IA__g_socket_listener_set_backlog - -#endif -#endif -#if IN_HEADER(__G_SOCKET_SERVICE_H__) -#if IN_FILE(__G_SOCKET_SERVICE_C__) -extern __typeof (g_socket_service_get_type) IA__g_socket_service_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_socket_service_get_type IA__g_socket_service_get_type - -extern __typeof (g_socket_service_is_active) IA__g_socket_service_is_active __attribute((visibility("hidden"))); -#define g_socket_service_is_active IA__g_socket_service_is_active - -extern __typeof (g_socket_service_new) IA__g_socket_service_new __attribute((visibility("hidden"))); -#define g_socket_service_new IA__g_socket_service_new - -extern __typeof (g_socket_service_start) IA__g_socket_service_start __attribute((visibility("hidden"))); -#define g_socket_service_start IA__g_socket_service_start - -extern __typeof (g_socket_service_stop) IA__g_socket_service_stop __attribute((visibility("hidden"))); -#define g_socket_service_stop IA__g_socket_service_stop - -#endif -#endif -#if IN_HEADER(__G_THREADED_SOCKET_SERVICE_H__) -#if IN_FILE(__G_THREADED_SOCKET_SERVICE_C__) -extern __typeof (g_threaded_socket_service_get_type) IA__g_threaded_socket_service_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_threaded_socket_service_get_type IA__g_threaded_socket_service_get_type - -extern __typeof (g_threaded_socket_service_new) IA__g_threaded_socket_service_new __attribute((visibility("hidden"))); -#define g_threaded_socket_service_new IA__g_threaded_socket_service_new - -#endif -#endif -#if IN_HEADER(__G_TCP_CONNECTION_H__) -#if IN_FILE(__G_TCP_CONNECTION_C__) -extern __typeof (g_tcp_connection_get_type) IA__g_tcp_connection_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_tcp_connection_get_type IA__g_tcp_connection_get_type - -extern __typeof (g_tcp_connection_set_graceful_disconnect) IA__g_tcp_connection_set_graceful_disconnect __attribute((visibility("hidden"))); -#define g_tcp_connection_set_graceful_disconnect IA__g_tcp_connection_set_graceful_disconnect - -extern __typeof (g_tcp_connection_get_graceful_disconnect) IA__g_tcp_connection_get_graceful_disconnect __attribute((visibility("hidden"))); -#define g_tcp_connection_get_graceful_disconnect IA__g_tcp_connection_get_graceful_disconnect - -#endif -#endif -#if IN_HEADER(__G_UNIX_CONNECTION_H__) -#if IN_FILE(__G_UNIX_CONNECTION_C__) -#ifndef G_OS_WIN32 -extern __typeof (g_unix_connection_get_type) IA__g_unix_connection_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_connection_get_type IA__g_unix_connection_get_type - -extern __typeof (g_unix_connection_receive_fd) IA__g_unix_connection_receive_fd __attribute((visibility("hidden"))); -#define g_unix_connection_receive_fd IA__g_unix_connection_receive_fd - -extern __typeof (g_unix_connection_send_fd) IA__g_unix_connection_send_fd __attribute((visibility("hidden"))); -#define g_unix_connection_send_fd IA__g_unix_connection_send_fd - -#endif -#endif -#endif -#if IN_HEADER(__G_UNIX_FD_MESSAGE_H__) -#if IN_FILE(__G_UNIX_FD_MESSAGE_C__) -#ifndef G_OS_WIN32 -extern __typeof (g_unix_fd_message_get_type) IA__g_unix_fd_message_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_fd_message_get_type IA__g_unix_fd_message_get_type - -extern __typeof (g_unix_fd_message_append_fd) IA__g_unix_fd_message_append_fd __attribute((visibility("hidden"))); -#define g_unix_fd_message_append_fd IA__g_unix_fd_message_append_fd - -extern __typeof (g_unix_fd_message_new) IA__g_unix_fd_message_new __attribute((visibility("hidden"))); -#define g_unix_fd_message_new IA__g_unix_fd_message_new - -extern __typeof (g_unix_fd_message_steal_fds) IA__g_unix_fd_message_steal_fds __attribute((visibility("hidden"))); -#define g_unix_fd_message_steal_fds IA__g_unix_fd_message_steal_fds - -extern __typeof (g_unix_fd_message_get_fd_list) IA__g_unix_fd_message_get_fd_list __attribute((visibility("hidden"))); -#define g_unix_fd_message_get_fd_list IA__g_unix_fd_message_get_fd_list - -extern __typeof (g_unix_fd_message_new_with_fd_list) IA__g_unix_fd_message_new_with_fd_list __attribute((visibility("hidden"))); -#define g_unix_fd_message_new_with_fd_list IA__g_unix_fd_message_new_with_fd_list - -#endif -#endif -#endif -#if IN_HEADER(__G_UNIX_FD_LIST_H__) -#if IN_FILE(__G_UNIX_FD_LIST_C__) -#ifndef G_OS_WIN32 -extern __typeof (g_unix_fd_list_append) IA__g_unix_fd_list_append __attribute((visibility("hidden"))); -#define g_unix_fd_list_append IA__g_unix_fd_list_append - -extern __typeof (g_unix_fd_list_get) IA__g_unix_fd_list_get __attribute((visibility("hidden"))); -#define g_unix_fd_list_get IA__g_unix_fd_list_get - -extern __typeof (g_unix_fd_list_get_length) IA__g_unix_fd_list_get_length __attribute((visibility("hidden"))); -#define g_unix_fd_list_get_length IA__g_unix_fd_list_get_length - -extern __typeof (g_unix_fd_list_get_type) IA__g_unix_fd_list_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unix_fd_list_get_type IA__g_unix_fd_list_get_type - -extern __typeof (g_unix_fd_list_new) IA__g_unix_fd_list_new __attribute((visibility("hidden"))); -#define g_unix_fd_list_new IA__g_unix_fd_list_new - -extern __typeof (g_unix_fd_list_new_from_array) IA__g_unix_fd_list_new_from_array __attribute((visibility("hidden"))); -#define g_unix_fd_list_new_from_array IA__g_unix_fd_list_new_from_array - -extern __typeof (g_unix_fd_list_peek_fds) IA__g_unix_fd_list_peek_fds __attribute((visibility("hidden"))); -#define g_unix_fd_list_peek_fds IA__g_unix_fd_list_peek_fds - -extern __typeof (g_unix_fd_list_steal_fds) IA__g_unix_fd_list_steal_fds __attribute((visibility("hidden"))); -#define g_unix_fd_list_steal_fds IA__g_unix_fd_list_steal_fds - -#endif -#endif -#endif -#if IN_HEADER(__G_ZLIB_COMPRESSOR_H__) -#if IN_FILE(__G_ZLIB_COMPRESSOR_C__) -extern __typeof (g_zlib_compressor_get_type) IA__g_zlib_compressor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_zlib_compressor_get_type IA__g_zlib_compressor_get_type - -extern __typeof (g_zlib_compressor_new) IA__g_zlib_compressor_new __attribute((visibility("hidden"))); -#define g_zlib_compressor_new IA__g_zlib_compressor_new - -#endif -#endif -#if IN_HEADER(__G_ZLIB_DECOMPRESSOR_H__) -#if IN_FILE(__G_ZLIB_DECOMPRESSOR_C__) -extern __typeof (g_zlib_decompressor_get_type) IA__g_zlib_decompressor_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_zlib_decompressor_get_type IA__g_zlib_decompressor_get_type - -extern __typeof (g_zlib_decompressor_new) IA__g_zlib_decompressor_new __attribute((visibility("hidden"))); -#define g_zlib_decompressor_new IA__g_zlib_decompressor_new - -#endif -#endif -#if IN_HEADER(__G_FILE_DESCRIPTOR_BASED_H__) -#if IN_FILE(__G_FILE_DESCRIPTOR_BASED_C__) -extern __typeof (g_file_descriptor_based_get_type) IA__g_file_descriptor_based_get_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_file_descriptor_based_get_type IA__g_file_descriptor_based_get_type - -extern __typeof (g_file_descriptor_based_get_fd) IA__g_file_descriptor_based_get_fd __attribute((visibility("hidden"))); -#define g_file_descriptor_based_get_fd IA__g_file_descriptor_based_get_fd - -#endif -#endif - -#endif /* G_HAVE_GNUC_VISIBILITY */ -#endif /* DISABLE_VISIBILITY */ diff --git a/gio/gioaliasdef.c b/gio/gioaliasdef.c deleted file mode 100644 index 6af8b5f..0000000 --- a/gio/gioaliasdef.c +++ /dev/null @@ -1,3011 +0,0 @@ -/* Generated by makegioalias.pl */ - -#ifndef DISABLE_VISIBILITY - -#include "glib.h" - -#ifdef G_HAVE_GNUC_VISIBILITY - -#undef IN_FILE -#define IN_FILE defined - -#undef IN_HEADER -#define IN_HEADER(x) 1 - -#if IN_HEADER(__G_VFS_H__) -#if IN_FILE(__G_VFS_C__) -#undef g_vfs_get_type -extern __typeof (g_vfs_get_type) g_vfs_get_type __attribute((alias("IA__g_vfs_get_type"), visibility("default"))); - -#undef g_vfs_is_active -extern __typeof (g_vfs_is_active) g_vfs_is_active __attribute((alias("IA__g_vfs_is_active"), visibility("default"))); - -#undef g_vfs_get_file_for_path -extern __typeof (g_vfs_get_file_for_path) g_vfs_get_file_for_path __attribute((alias("IA__g_vfs_get_file_for_path"), visibility("default"))); - -#undef g_vfs_get_file_for_uri -extern __typeof (g_vfs_get_file_for_uri) g_vfs_get_file_for_uri __attribute((alias("IA__g_vfs_get_file_for_uri"), visibility("default"))); - -#undef g_vfs_get_supported_uri_schemes -extern __typeof (g_vfs_get_supported_uri_schemes) g_vfs_get_supported_uri_schemes __attribute((alias("IA__g_vfs_get_supported_uri_schemes"), visibility("default"))); - -#undef g_vfs_parse_name -extern __typeof (g_vfs_parse_name) g_vfs_parse_name __attribute((alias("IA__g_vfs_parse_name"), visibility("default"))); - -#undef g_vfs_get_default -extern __typeof (g_vfs_get_default) g_vfs_get_default __attribute((alias("IA__g_vfs_get_default"), visibility("default"))); - -#undef g_vfs_get_local -extern __typeof (g_vfs_get_local) g_vfs_get_local __attribute((alias("IA__g_vfs_get_local"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_APP_INFO_H__) -#if IN_FILE(__G_APP_INFO_C__) -#undef g_app_info_get_type -extern __typeof (g_app_info_get_type) g_app_info_get_type __attribute((alias("IA__g_app_info_get_type"), visibility("default"))); - -#undef g_app_launch_context_get_type -extern __typeof (g_app_launch_context_get_type) g_app_launch_context_get_type __attribute((alias("IA__g_app_launch_context_get_type"), visibility("default"))); - -#undef g_app_info_dup -extern __typeof (g_app_info_dup) g_app_info_dup __attribute((alias("IA__g_app_info_dup"), visibility("default"))); - -#undef g_app_info_equal -extern __typeof (g_app_info_equal) g_app_info_equal __attribute((alias("IA__g_app_info_equal"), visibility("default"))); - -#undef g_app_info_get_id -extern __typeof (g_app_info_get_id) g_app_info_get_id __attribute((alias("IA__g_app_info_get_id"), visibility("default"))); - -#undef g_app_info_get_name -extern __typeof (g_app_info_get_name) g_app_info_get_name __attribute((alias("IA__g_app_info_get_name"), visibility("default"))); - -#undef g_app_info_get_display_name -extern __typeof (g_app_info_get_display_name) g_app_info_get_display_name __attribute((alias("IA__g_app_info_get_display_name"), visibility("default"))); - -#undef g_app_info_get_description -extern __typeof (g_app_info_get_description) g_app_info_get_description __attribute((alias("IA__g_app_info_get_description"), visibility("default"))); - -#undef g_app_info_get_executable -extern __typeof (g_app_info_get_executable) g_app_info_get_executable __attribute((alias("IA__g_app_info_get_executable"), visibility("default"))); - -#undef g_app_info_get_commandline -extern __typeof (g_app_info_get_commandline) g_app_info_get_commandline __attribute((alias("IA__g_app_info_get_commandline"), visibility("default"))); - -#undef g_app_info_get_icon -extern __typeof (g_app_info_get_icon) g_app_info_get_icon __attribute((alias("IA__g_app_info_get_icon"), visibility("default"))); - -#undef g_app_info_launch -extern __typeof (g_app_info_launch) g_app_info_launch __attribute((alias("IA__g_app_info_launch"), visibility("default"))); - -#undef g_app_info_supports_uris -extern __typeof (g_app_info_supports_uris) g_app_info_supports_uris __attribute((alias("IA__g_app_info_supports_uris"), visibility("default"))); - -#undef g_app_info_supports_files -extern __typeof (g_app_info_supports_files) g_app_info_supports_files __attribute((alias("IA__g_app_info_supports_files"), visibility("default"))); - -#undef g_app_info_launch_uris -extern __typeof (g_app_info_launch_uris) g_app_info_launch_uris __attribute((alias("IA__g_app_info_launch_uris"), visibility("default"))); - -#undef g_app_info_should_show -extern __typeof (g_app_info_should_show) g_app_info_should_show __attribute((alias("IA__g_app_info_should_show"), visibility("default"))); - -#undef g_app_info_set_as_default_for_type -extern __typeof (g_app_info_set_as_default_for_type) g_app_info_set_as_default_for_type __attribute((alias("IA__g_app_info_set_as_default_for_type"), visibility("default"))); - -#undef g_app_info_set_as_default_for_extension -extern __typeof (g_app_info_set_as_default_for_extension) g_app_info_set_as_default_for_extension __attribute((alias("IA__g_app_info_set_as_default_for_extension"), visibility("default"))); - -#undef g_app_info_add_supports_type -extern __typeof (g_app_info_add_supports_type) g_app_info_add_supports_type __attribute((alias("IA__g_app_info_add_supports_type"), visibility("default"))); - -#undef g_app_info_can_remove_supports_type -extern __typeof (g_app_info_can_remove_supports_type) g_app_info_can_remove_supports_type __attribute((alias("IA__g_app_info_can_remove_supports_type"), visibility("default"))); - -#undef g_app_info_remove_supports_type -extern __typeof (g_app_info_remove_supports_type) g_app_info_remove_supports_type __attribute((alias("IA__g_app_info_remove_supports_type"), visibility("default"))); - -#undef g_app_info_launch_default_for_uri -extern __typeof (g_app_info_launch_default_for_uri) g_app_info_launch_default_for_uri __attribute((alias("IA__g_app_info_launch_default_for_uri"), visibility("default"))); - -#undef g_app_info_can_delete -extern __typeof (g_app_info_can_delete) g_app_info_can_delete __attribute((alias("IA__g_app_info_can_delete"), visibility("default"))); - -#undef g_app_info_delete -extern __typeof (g_app_info_delete) g_app_info_delete __attribute((alias("IA__g_app_info_delete"), visibility("default"))); - -#undef g_app_launch_context_new -extern __typeof (g_app_launch_context_new) g_app_launch_context_new __attribute((alias("IA__g_app_launch_context_new"), visibility("default"))); - -#undef g_app_launch_context_get_display -extern __typeof (g_app_launch_context_get_display) g_app_launch_context_get_display __attribute((alias("IA__g_app_launch_context_get_display"), visibility("default"))); - -#undef g_app_launch_context_get_startup_notify_id -extern __typeof (g_app_launch_context_get_startup_notify_id) g_app_launch_context_get_startup_notify_id __attribute((alias("IA__g_app_launch_context_get_startup_notify_id"), visibility("default"))); - -#undef g_app_launch_context_launch_failed -extern __typeof (g_app_launch_context_launch_failed) g_app_launch_context_launch_failed __attribute((alias("IA__g_app_launch_context_launch_failed"), visibility("default"))); - -#endif -#if IN_FILE(__G_DESKTOP_APP_INFO_C__) -#undef g_app_info_create_from_commandline -extern __typeof (g_app_info_create_from_commandline) g_app_info_create_from_commandline __attribute((alias("IA__g_app_info_create_from_commandline"), visibility("default"))); - -#undef g_app_info_get_all -extern __typeof (g_app_info_get_all) g_app_info_get_all __attribute((alias("IA__g_app_info_get_all"), visibility("default"))); - -#undef g_app_info_get_all_for_type -extern __typeof (g_app_info_get_all_for_type) g_app_info_get_all_for_type __attribute((alias("IA__g_app_info_get_all_for_type"), visibility("default"))); - -#undef g_app_info_get_default_for_type -extern __typeof (g_app_info_get_default_for_type) g_app_info_get_default_for_type __attribute((alias("IA__g_app_info_get_default_for_type"), visibility("default"))); - -#undef g_app_info_get_default_for_uri_scheme -extern __typeof (g_app_info_get_default_for_uri_scheme) g_app_info_get_default_for_uri_scheme __attribute((alias("IA__g_app_info_get_default_for_uri_scheme"), visibility("default"))); - -#undef g_app_info_reset_type_associations -extern __typeof (g_app_info_reset_type_associations) g_app_info_reset_type_associations __attribute((alias("IA__g_app_info_reset_type_associations"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DESKTOP_APP_INFO_H__) -#if IN_FILE(__G_DESKTOP_APP_INFO_C__) -#ifdef G_OS_UNIX -#undef g_desktop_app_info_new_from_filename -extern __typeof (g_desktop_app_info_new_from_filename) g_desktop_app_info_new_from_filename __attribute((alias("IA__g_desktop_app_info_new_from_filename"), visibility("default"))); - -#undef g_desktop_app_info_new_from_keyfile -extern __typeof (g_desktop_app_info_new_from_keyfile) g_desktop_app_info_new_from_keyfile __attribute((alias("IA__g_desktop_app_info_new_from_keyfile"), visibility("default"))); - -#undef g_desktop_app_info_new -extern __typeof (g_desktop_app_info_new) g_desktop_app_info_new __attribute((alias("IA__g_desktop_app_info_new"), visibility("default"))); - -#undef g_desktop_app_info_get_filename -extern __typeof (g_desktop_app_info_get_filename) g_desktop_app_info_get_filename __attribute((alias("IA__g_desktop_app_info_get_filename"), visibility("default"))); - -#undef g_desktop_app_info_get_type -extern __typeof (g_desktop_app_info_get_type) g_desktop_app_info_get_type __attribute((alias("IA__g_desktop_app_info_get_type"), visibility("default"))); - -#undef g_desktop_app_info_get_is_hidden -extern __typeof (g_desktop_app_info_get_is_hidden) g_desktop_app_info_get_is_hidden __attribute((alias("IA__g_desktop_app_info_get_is_hidden"), visibility("default"))); - -#undef g_desktop_app_info_set_desktop_env -extern __typeof (g_desktop_app_info_set_desktop_env) g_desktop_app_info_set_desktop_env __attribute((alias("IA__g_desktop_app_info_set_desktop_env"), visibility("default"))); - -#undef g_desktop_app_info_lookup_get_type -extern __typeof (g_desktop_app_info_lookup_get_type) g_desktop_app_info_lookup_get_type __attribute((alias("IA__g_desktop_app_info_lookup_get_type"), visibility("default"))); - -#undef g_desktop_app_info_lookup_get_default_for_uri_scheme -extern __typeof (g_desktop_app_info_lookup_get_default_for_uri_scheme) g_desktop_app_info_lookup_get_default_for_uri_scheme __attribute((alias("IA__g_desktop_app_info_lookup_get_default_for_uri_scheme"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_ASYNC_RESULT_H__) -#if IN_FILE(__G_ASYNC_RESULT_C__) -#undef g_async_result_get_type -extern __typeof (g_async_result_get_type) g_async_result_get_type __attribute((alias("IA__g_async_result_get_type"), visibility("default"))); - -#undef g_async_result_get_user_data -extern __typeof (g_async_result_get_user_data) g_async_result_get_user_data __attribute((alias("IA__g_async_result_get_user_data"), visibility("default"))); - -#undef g_async_result_get_source_object -extern __typeof (g_async_result_get_source_object) g_async_result_get_source_object __attribute((alias("IA__g_async_result_get_source_object"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_BUFFERED_INPUT_STREAM_H__) -#if IN_FILE(__G_BUFFERED_INPUT_STREAM_C__) -#undef g_buffered_input_stream_get_type -extern __typeof (g_buffered_input_stream_get_type) g_buffered_input_stream_get_type __attribute((alias("IA__g_buffered_input_stream_get_type"), visibility("default"))); - -#undef g_buffered_input_stream_new -extern __typeof (g_buffered_input_stream_new) g_buffered_input_stream_new __attribute((alias("IA__g_buffered_input_stream_new"), visibility("default"))); - -#undef g_buffered_input_stream_new_sized -extern __typeof (g_buffered_input_stream_new_sized) g_buffered_input_stream_new_sized __attribute((alias("IA__g_buffered_input_stream_new_sized"), visibility("default"))); - -#undef g_buffered_input_stream_get_buffer_size -extern __typeof (g_buffered_input_stream_get_buffer_size) g_buffered_input_stream_get_buffer_size __attribute((alias("IA__g_buffered_input_stream_get_buffer_size"), visibility("default"))); - -#undef g_buffered_input_stream_set_buffer_size -extern __typeof (g_buffered_input_stream_set_buffer_size) g_buffered_input_stream_set_buffer_size __attribute((alias("IA__g_buffered_input_stream_set_buffer_size"), visibility("default"))); - -#undef g_buffered_input_stream_get_available -extern __typeof (g_buffered_input_stream_get_available) g_buffered_input_stream_get_available __attribute((alias("IA__g_buffered_input_stream_get_available"), visibility("default"))); - -#undef g_buffered_input_stream_peek -extern __typeof (g_buffered_input_stream_peek) g_buffered_input_stream_peek __attribute((alias("IA__g_buffered_input_stream_peek"), visibility("default"))); - -#undef g_buffered_input_stream_peek_buffer -extern __typeof (g_buffered_input_stream_peek_buffer) g_buffered_input_stream_peek_buffer __attribute((alias("IA__g_buffered_input_stream_peek_buffer"), visibility("default"))); - -#undef g_buffered_input_stream_fill -extern __typeof (g_buffered_input_stream_fill) g_buffered_input_stream_fill __attribute((alias("IA__g_buffered_input_stream_fill"), visibility("default"))); - -#undef g_buffered_input_stream_fill_async -extern __typeof (g_buffered_input_stream_fill_async) g_buffered_input_stream_fill_async __attribute((alias("IA__g_buffered_input_stream_fill_async"), visibility("default"))); - -#undef g_buffered_input_stream_fill_finish -extern __typeof (g_buffered_input_stream_fill_finish) g_buffered_input_stream_fill_finish __attribute((alias("IA__g_buffered_input_stream_fill_finish"), visibility("default"))); - -#undef g_buffered_input_stream_read_byte -extern __typeof (g_buffered_input_stream_read_byte) g_buffered_input_stream_read_byte __attribute((alias("IA__g_buffered_input_stream_read_byte"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_BUFFERED_OUTPUT_STREAM_H__) -#if IN_FILE(__G_BUFFERED_OUTPUT_STREAM_C__) -#undef g_buffered_output_stream_get_type -extern __typeof (g_buffered_output_stream_get_type) g_buffered_output_stream_get_type __attribute((alias("IA__g_buffered_output_stream_get_type"), visibility("default"))); - -#undef g_buffered_output_stream_new -extern __typeof (g_buffered_output_stream_new) g_buffered_output_stream_new __attribute((alias("IA__g_buffered_output_stream_new"), visibility("default"))); - -#undef g_buffered_output_stream_new_sized -extern __typeof (g_buffered_output_stream_new_sized) g_buffered_output_stream_new_sized __attribute((alias("IA__g_buffered_output_stream_new_sized"), visibility("default"))); - -#undef g_buffered_output_stream_get_buffer_size -extern __typeof (g_buffered_output_stream_get_buffer_size) g_buffered_output_stream_get_buffer_size __attribute((alias("IA__g_buffered_output_stream_get_buffer_size"), visibility("default"))); - -#undef g_buffered_output_stream_set_buffer_size -extern __typeof (g_buffered_output_stream_set_buffer_size) g_buffered_output_stream_set_buffer_size __attribute((alias("IA__g_buffered_output_stream_set_buffer_size"), visibility("default"))); - -#undef g_buffered_output_stream_get_auto_grow -extern __typeof (g_buffered_output_stream_get_auto_grow) g_buffered_output_stream_get_auto_grow __attribute((alias("IA__g_buffered_output_stream_get_auto_grow"), visibility("default"))); - -#undef g_buffered_output_stream_set_auto_grow -extern __typeof (g_buffered_output_stream_set_auto_grow) g_buffered_output_stream_set_auto_grow __attribute((alias("IA__g_buffered_output_stream_set_auto_grow"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CANCELLABLE_H__) -#if IN_FILE(__G_CANCELLABLE_C__) -#undef g_cancellable_get_type -extern __typeof (g_cancellable_get_type) g_cancellable_get_type __attribute((alias("IA__g_cancellable_get_type"), visibility("default"))); - -#undef g_cancellable_new -extern __typeof (g_cancellable_new) g_cancellable_new __attribute((alias("IA__g_cancellable_new"), visibility("default"))); - -#undef g_cancellable_is_cancelled -extern __typeof (g_cancellable_is_cancelled) g_cancellable_is_cancelled __attribute((alias("IA__g_cancellable_is_cancelled"), visibility("default"))); - -#undef g_cancellable_set_error_if_cancelled -extern __typeof (g_cancellable_set_error_if_cancelled) g_cancellable_set_error_if_cancelled __attribute((alias("IA__g_cancellable_set_error_if_cancelled"), visibility("default"))); - -#undef g_cancellable_get_fd -extern __typeof (g_cancellable_get_fd) g_cancellable_get_fd __attribute((alias("IA__g_cancellable_get_fd"), visibility("default"))); - -#undef g_cancellable_make_pollfd -extern __typeof (g_cancellable_make_pollfd) g_cancellable_make_pollfd __attribute((alias("IA__g_cancellable_make_pollfd"), visibility("default"))); - -#undef g_cancellable_release_fd -extern __typeof (g_cancellable_release_fd) g_cancellable_release_fd __attribute((alias("IA__g_cancellable_release_fd"), visibility("default"))); - -#undef g_cancellable_get_current -extern __typeof (g_cancellable_get_current) g_cancellable_get_current __attribute((alias("IA__g_cancellable_get_current"), visibility("default"))); - -#undef g_cancellable_push_current -extern __typeof (g_cancellable_push_current) g_cancellable_push_current __attribute((alias("IA__g_cancellable_push_current"), visibility("default"))); - -#undef g_cancellable_pop_current -extern __typeof (g_cancellable_pop_current) g_cancellable_pop_current __attribute((alias("IA__g_cancellable_pop_current"), visibility("default"))); - -#undef g_cancellable_reset -extern __typeof (g_cancellable_reset) g_cancellable_reset __attribute((alias("IA__g_cancellable_reset"), visibility("default"))); - -#undef g_cancellable_cancel -extern __typeof (g_cancellable_cancel) g_cancellable_cancel __attribute((alias("IA__g_cancellable_cancel"), visibility("default"))); - -#undef g_cancellable_connect -extern __typeof (g_cancellable_connect) g_cancellable_connect __attribute((alias("IA__g_cancellable_connect"), visibility("default"))); - -#undef g_cancellable_disconnect -extern __typeof (g_cancellable_disconnect) g_cancellable_disconnect __attribute((alias("IA__g_cancellable_disconnect"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CONTENT_TYPE_H__) -#if IN_FILE(__G_CONTENT_TYPE_C__) -#undef g_content_type_equals -extern __typeof (g_content_type_equals) g_content_type_equals __attribute((alias("IA__g_content_type_equals"), visibility("default"))); - -#undef g_content_type_is_a -extern __typeof (g_content_type_is_a) g_content_type_is_a __attribute((alias("IA__g_content_type_is_a"), visibility("default"))); - -#undef g_content_type_is_unknown -extern __typeof (g_content_type_is_unknown) g_content_type_is_unknown __attribute((alias("IA__g_content_type_is_unknown"), visibility("default"))); - -#undef g_content_type_get_description -extern __typeof (g_content_type_get_description) g_content_type_get_description __attribute((alias("IA__g_content_type_get_description"), visibility("default"))); - -#undef g_content_type_get_mime_type -extern __typeof (g_content_type_get_mime_type) g_content_type_get_mime_type __attribute((alias("IA__g_content_type_get_mime_type"), visibility("default"))); - -#undef g_content_type_get_icon -extern __typeof (g_content_type_get_icon) g_content_type_get_icon __attribute((alias("IA__g_content_type_get_icon"), visibility("default"))); - -#undef g_content_type_can_be_executable -extern __typeof (g_content_type_can_be_executable) g_content_type_can_be_executable __attribute((alias("IA__g_content_type_can_be_executable"), visibility("default"))); - -#undef g_content_type_from_mime_type -extern __typeof (g_content_type_from_mime_type) g_content_type_from_mime_type __attribute((alias("IA__g_content_type_from_mime_type"), visibility("default"))); - -#undef g_content_type_guess -extern __typeof (g_content_type_guess) g_content_type_guess __attribute((alias("IA__g_content_type_guess"), visibility("default"))); - -#undef g_content_type_guess_for_tree -extern __typeof (g_content_type_guess_for_tree) g_content_type_guess_for_tree __attribute((alias("IA__g_content_type_guess_for_tree"), visibility("default"))); - -#undef g_content_types_get_registered -extern __typeof (g_content_types_get_registered) g_content_types_get_registered __attribute((alias("IA__g_content_types_get_registered"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CONVERTER_H__) -#if IN_FILE(__G_CONVERTER_C__) -#undef g_converter_get_type -extern __typeof (g_converter_get_type) g_converter_get_type __attribute((alias("IA__g_converter_get_type"), visibility("default"))); - -#undef g_converter_reset -extern __typeof (g_converter_reset) g_converter_reset __attribute((alias("IA__g_converter_reset"), visibility("default"))); - -#undef g_converter_convert -extern __typeof (g_converter_convert) g_converter_convert __attribute((alias("IA__g_converter_convert"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CONVERTER_INPUT_STREAM_H__) -#if IN_FILE(__G_CONVERTER_INPUT_STREAM_C__) -#undef g_converter_input_stream_get_type -extern __typeof (g_converter_input_stream_get_type) g_converter_input_stream_get_type __attribute((alias("IA__g_converter_input_stream_get_type"), visibility("default"))); - -#undef g_converter_input_stream_new -extern __typeof (g_converter_input_stream_new) g_converter_input_stream_new __attribute((alias("IA__g_converter_input_stream_new"), visibility("default"))); - -#undef g_converter_input_stream_get_converter -extern __typeof (g_converter_input_stream_get_converter) g_converter_input_stream_get_converter __attribute((alias("IA__g_converter_input_stream_get_converter"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CONVERTER_OUTPUT_STREAM_H__) -#if IN_FILE(__G_CONVERTER_OUTPUT_STREAM_C__) -#undef g_converter_output_stream_get_type -extern __typeof (g_converter_output_stream_get_type) g_converter_output_stream_get_type __attribute((alias("IA__g_converter_output_stream_get_type"), visibility("default"))); - -#undef g_converter_output_stream_new -extern __typeof (g_converter_output_stream_new) g_converter_output_stream_new __attribute((alias("IA__g_converter_output_stream_new"), visibility("default"))); - -#undef g_converter_output_stream_get_converter -extern __typeof (g_converter_output_stream_get_converter) g_converter_output_stream_get_converter __attribute((alias("IA__g_converter_output_stream_get_converter"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CHARSET_CONVERTER_H__) -#if IN_FILE(__G_CHARSET_CONVERTER_C__) -#undef g_charset_converter_get_type -extern __typeof (g_charset_converter_get_type) g_charset_converter_get_type __attribute((alias("IA__g_charset_converter_get_type"), visibility("default"))); - -#undef g_charset_converter_new -extern __typeof (g_charset_converter_new) g_charset_converter_new __attribute((alias("IA__g_charset_converter_new"), visibility("default"))); - -#undef g_charset_converter_get_num_fallbacks -extern __typeof (g_charset_converter_get_num_fallbacks) g_charset_converter_get_num_fallbacks __attribute((alias("IA__g_charset_converter_get_num_fallbacks"), visibility("default"))); - -#undef g_charset_converter_get_use_fallback -extern __typeof (g_charset_converter_get_use_fallback) g_charset_converter_get_use_fallback __attribute((alias("IA__g_charset_converter_get_use_fallback"), visibility("default"))); - -#undef g_charset_converter_set_use_fallback -extern __typeof (g_charset_converter_set_use_fallback) g_charset_converter_set_use_fallback __attribute((alias("IA__g_charset_converter_set_use_fallback"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DATA_INPUT_STREAM_H__) -#if IN_FILE(__G_DATA_INPUT_STREAM_C__) -#undef g_data_input_stream_get_type -extern __typeof (g_data_input_stream_get_type) g_data_input_stream_get_type __attribute((alias("IA__g_data_input_stream_get_type"), visibility("default"))); - -#undef g_data_input_stream_new -extern __typeof (g_data_input_stream_new) g_data_input_stream_new __attribute((alias("IA__g_data_input_stream_new"), visibility("default"))); - -#undef g_data_input_stream_set_byte_order -extern __typeof (g_data_input_stream_set_byte_order) g_data_input_stream_set_byte_order __attribute((alias("IA__g_data_input_stream_set_byte_order"), visibility("default"))); - -#undef g_data_input_stream_get_byte_order -extern __typeof (g_data_input_stream_get_byte_order) g_data_input_stream_get_byte_order __attribute((alias("IA__g_data_input_stream_get_byte_order"), visibility("default"))); - -#undef g_data_input_stream_set_newline_type -extern __typeof (g_data_input_stream_set_newline_type) g_data_input_stream_set_newline_type __attribute((alias("IA__g_data_input_stream_set_newline_type"), visibility("default"))); - -#undef g_data_input_stream_get_newline_type -extern __typeof (g_data_input_stream_get_newline_type) g_data_input_stream_get_newline_type __attribute((alias("IA__g_data_input_stream_get_newline_type"), visibility("default"))); - -#undef g_data_input_stream_read_byte -extern __typeof (g_data_input_stream_read_byte) g_data_input_stream_read_byte __attribute((alias("IA__g_data_input_stream_read_byte"), visibility("default"))); - -#undef g_data_input_stream_read_int16 -extern __typeof (g_data_input_stream_read_int16) g_data_input_stream_read_int16 __attribute((alias("IA__g_data_input_stream_read_int16"), visibility("default"))); - -#undef g_data_input_stream_read_uint16 -extern __typeof (g_data_input_stream_read_uint16) g_data_input_stream_read_uint16 __attribute((alias("IA__g_data_input_stream_read_uint16"), visibility("default"))); - -#undef g_data_input_stream_read_int32 -extern __typeof (g_data_input_stream_read_int32) g_data_input_stream_read_int32 __attribute((alias("IA__g_data_input_stream_read_int32"), visibility("default"))); - -#undef g_data_input_stream_read_uint32 -extern __typeof (g_data_input_stream_read_uint32) g_data_input_stream_read_uint32 __attribute((alias("IA__g_data_input_stream_read_uint32"), visibility("default"))); - -#undef g_data_input_stream_read_int64 -extern __typeof (g_data_input_stream_read_int64) g_data_input_stream_read_int64 __attribute((alias("IA__g_data_input_stream_read_int64"), visibility("default"))); - -#undef g_data_input_stream_read_uint64 -extern __typeof (g_data_input_stream_read_uint64) g_data_input_stream_read_uint64 __attribute((alias("IA__g_data_input_stream_read_uint64"), visibility("default"))); - -#undef g_data_input_stream_read_line -extern __typeof (g_data_input_stream_read_line) g_data_input_stream_read_line __attribute((alias("IA__g_data_input_stream_read_line"), visibility("default"))); - -#undef g_data_input_stream_read_line_async -extern __typeof (g_data_input_stream_read_line_async) g_data_input_stream_read_line_async __attribute((alias("IA__g_data_input_stream_read_line_async"), visibility("default"))); - -#undef g_data_input_stream_read_line_finish -extern __typeof (g_data_input_stream_read_line_finish) g_data_input_stream_read_line_finish __attribute((alias("IA__g_data_input_stream_read_line_finish"), visibility("default"))); - -#undef g_data_input_stream_read_until -extern __typeof (g_data_input_stream_read_until) g_data_input_stream_read_until __attribute((alias("IA__g_data_input_stream_read_until"), visibility("default"))); - -#undef g_data_input_stream_read_until_async -extern __typeof (g_data_input_stream_read_until_async) g_data_input_stream_read_until_async __attribute((alias("IA__g_data_input_stream_read_until_async"), visibility("default"))); - -#undef g_data_input_stream_read_until_finish -extern __typeof (g_data_input_stream_read_until_finish) g_data_input_stream_read_until_finish __attribute((alias("IA__g_data_input_stream_read_until_finish"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DATA_OUTPUT_STREAM_H__) -#if IN_FILE(__G_DATA_OUTPUT_STREAM_C__) -#undef g_data_output_stream_get_type -extern __typeof (g_data_output_stream_get_type) g_data_output_stream_get_type __attribute((alias("IA__g_data_output_stream_get_type"), visibility("default"))); - -#undef g_data_output_stream_new -extern __typeof (g_data_output_stream_new) g_data_output_stream_new __attribute((alias("IA__g_data_output_stream_new"), visibility("default"))); - -#undef g_data_output_stream_set_byte_order -extern __typeof (g_data_output_stream_set_byte_order) g_data_output_stream_set_byte_order __attribute((alias("IA__g_data_output_stream_set_byte_order"), visibility("default"))); - -#undef g_data_output_stream_get_byte_order -extern __typeof (g_data_output_stream_get_byte_order) g_data_output_stream_get_byte_order __attribute((alias("IA__g_data_output_stream_get_byte_order"), visibility("default"))); - -#undef g_data_output_stream_put_byte -extern __typeof (g_data_output_stream_put_byte) g_data_output_stream_put_byte __attribute((alias("IA__g_data_output_stream_put_byte"), visibility("default"))); - -#undef g_data_output_stream_put_int16 -extern __typeof (g_data_output_stream_put_int16) g_data_output_stream_put_int16 __attribute((alias("IA__g_data_output_stream_put_int16"), visibility("default"))); - -#undef g_data_output_stream_put_uint16 -extern __typeof (g_data_output_stream_put_uint16) g_data_output_stream_put_uint16 __attribute((alias("IA__g_data_output_stream_put_uint16"), visibility("default"))); - -#undef g_data_output_stream_put_int32 -extern __typeof (g_data_output_stream_put_int32) g_data_output_stream_put_int32 __attribute((alias("IA__g_data_output_stream_put_int32"), visibility("default"))); - -#undef g_data_output_stream_put_uint32 -extern __typeof (g_data_output_stream_put_uint32) g_data_output_stream_put_uint32 __attribute((alias("IA__g_data_output_stream_put_uint32"), visibility("default"))); - -#undef g_data_output_stream_put_int64 -extern __typeof (g_data_output_stream_put_int64) g_data_output_stream_put_int64 __attribute((alias("IA__g_data_output_stream_put_int64"), visibility("default"))); - -#undef g_data_output_stream_put_uint64 -extern __typeof (g_data_output_stream_put_uint64) g_data_output_stream_put_uint64 __attribute((alias("IA__g_data_output_stream_put_uint64"), visibility("default"))); - -#undef g_data_output_stream_put_string -extern __typeof (g_data_output_stream_put_string) g_data_output_stream_put_string __attribute((alias("IA__g_data_output_stream_put_string"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DRIVE_H__) -#if IN_FILE(__G_DRIVE_C__) -#undef g_drive_get_type -extern __typeof (g_drive_get_type) g_drive_get_type __attribute((alias("IA__g_drive_get_type"), visibility("default"))); - -#undef g_drive_get_name -extern __typeof (g_drive_get_name) g_drive_get_name __attribute((alias("IA__g_drive_get_name"), visibility("default"))); - -#undef g_drive_get_icon -extern __typeof (g_drive_get_icon) g_drive_get_icon __attribute((alias("IA__g_drive_get_icon"), visibility("default"))); - -#undef g_drive_has_volumes -extern __typeof (g_drive_has_volumes) g_drive_has_volumes __attribute((alias("IA__g_drive_has_volumes"), visibility("default"))); - -#undef g_drive_get_volumes -extern __typeof (g_drive_get_volumes) g_drive_get_volumes __attribute((alias("IA__g_drive_get_volumes"), visibility("default"))); - -#undef g_drive_is_media_removable -extern __typeof (g_drive_is_media_removable) g_drive_is_media_removable __attribute((alias("IA__g_drive_is_media_removable"), visibility("default"))); - -#undef g_drive_has_media -extern __typeof (g_drive_has_media) g_drive_has_media __attribute((alias("IA__g_drive_has_media"), visibility("default"))); - -#undef g_drive_is_media_check_automatic -extern __typeof (g_drive_is_media_check_automatic) g_drive_is_media_check_automatic __attribute((alias("IA__g_drive_is_media_check_automatic"), visibility("default"))); - -#undef g_drive_can_poll_for_media -extern __typeof (g_drive_can_poll_for_media) g_drive_can_poll_for_media __attribute((alias("IA__g_drive_can_poll_for_media"), visibility("default"))); - -#undef g_drive_can_eject -extern __typeof (g_drive_can_eject) g_drive_can_eject __attribute((alias("IA__g_drive_can_eject"), visibility("default"))); - -#undef g_drive_eject_with_operation -extern __typeof (g_drive_eject_with_operation) g_drive_eject_with_operation __attribute((alias("IA__g_drive_eject_with_operation"), visibility("default"))); - -#undef g_drive_eject_with_operation_finish -extern __typeof (g_drive_eject_with_operation_finish) g_drive_eject_with_operation_finish __attribute((alias("IA__g_drive_eject_with_operation_finish"), visibility("default"))); - -#undef g_drive_poll_for_media -extern __typeof (g_drive_poll_for_media) g_drive_poll_for_media __attribute((alias("IA__g_drive_poll_for_media"), visibility("default"))); - -#undef g_drive_poll_for_media_finish -extern __typeof (g_drive_poll_for_media_finish) g_drive_poll_for_media_finish __attribute((alias("IA__g_drive_poll_for_media_finish"), visibility("default"))); - -#undef g_drive_get_identifier -extern __typeof (g_drive_get_identifier) g_drive_get_identifier __attribute((alias("IA__g_drive_get_identifier"), visibility("default"))); - -#undef g_drive_enumerate_identifiers -extern __typeof (g_drive_enumerate_identifiers) g_drive_enumerate_identifiers __attribute((alias("IA__g_drive_enumerate_identifiers"), visibility("default"))); - -#undef g_drive_get_start_stop_type -extern __typeof (g_drive_get_start_stop_type) g_drive_get_start_stop_type __attribute((alias("IA__g_drive_get_start_stop_type"), visibility("default"))); - -#undef g_drive_can_start -extern __typeof (g_drive_can_start) g_drive_can_start __attribute((alias("IA__g_drive_can_start"), visibility("default"))); - -#undef g_drive_can_start_degraded -extern __typeof (g_drive_can_start_degraded) g_drive_can_start_degraded __attribute((alias("IA__g_drive_can_start_degraded"), visibility("default"))); - -#undef g_drive_start -extern __typeof (g_drive_start) g_drive_start __attribute((alias("IA__g_drive_start"), visibility("default"))); - -#undef g_drive_start_finish -extern __typeof (g_drive_start_finish) g_drive_start_finish __attribute((alias("IA__g_drive_start_finish"), visibility("default"))); - -#undef g_drive_can_stop -extern __typeof (g_drive_can_stop) g_drive_can_stop __attribute((alias("IA__g_drive_can_stop"), visibility("default"))); - -#undef g_drive_stop -extern __typeof (g_drive_stop) g_drive_stop __attribute((alias("IA__g_drive_stop"), visibility("default"))); - -#undef g_drive_stop_finish -extern __typeof (g_drive_stop_finish) g_drive_stop_finish __attribute((alias("IA__g_drive_stop_finish"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_drive_eject -extern __typeof (g_drive_eject) g_drive_eject __attribute((alias("IA__g_drive_eject"), visibility("default"))); - -#undef g_drive_eject_finish -extern __typeof (g_drive_eject_finish) g_drive_eject_finish __attribute((alias("IA__g_drive_eject_finish"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_FILE_ATTRIBUTE_H__) -#if IN_FILE(__G_FILE_ATTRIBUTE_C__) -#undef g_file_attribute_info_list_new -extern __typeof (g_file_attribute_info_list_new) g_file_attribute_info_list_new __attribute((alias("IA__g_file_attribute_info_list_new"), visibility("default"))); - -#undef g_file_attribute_info_list_ref -extern __typeof (g_file_attribute_info_list_ref) g_file_attribute_info_list_ref __attribute((alias("IA__g_file_attribute_info_list_ref"), visibility("default"))); - -#undef g_file_attribute_info_list_unref -extern __typeof (g_file_attribute_info_list_unref) g_file_attribute_info_list_unref __attribute((alias("IA__g_file_attribute_info_list_unref"), visibility("default"))); - -#undef g_file_attribute_info_list_dup -extern __typeof (g_file_attribute_info_list_dup) g_file_attribute_info_list_dup __attribute((alias("IA__g_file_attribute_info_list_dup"), visibility("default"))); - -#undef g_file_attribute_info_list_get_type -extern __typeof (g_file_attribute_info_list_get_type) g_file_attribute_info_list_get_type __attribute((alias("IA__g_file_attribute_info_list_get_type"), visibility("default"))); - -#undef g_file_attribute_info_list_lookup -extern __typeof (g_file_attribute_info_list_lookup) g_file_attribute_info_list_lookup __attribute((alias("IA__g_file_attribute_info_list_lookup"), visibility("default"))); - -#undef g_file_attribute_info_list_add -extern __typeof (g_file_attribute_info_list_add) g_file_attribute_info_list_add __attribute((alias("IA__g_file_attribute_info_list_add"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_H__) -#if IN_FILE(__G_FILE_C__) -#undef g_file_get_type -extern __typeof (g_file_get_type) g_file_get_type __attribute((alias("IA__g_file_get_type"), visibility("default"))); - -#undef g_file_new_for_path -extern __typeof (g_file_new_for_path) g_file_new_for_path __attribute((alias("IA__g_file_new_for_path"), visibility("default"))); - -#undef g_file_new_for_uri -extern __typeof (g_file_new_for_uri) g_file_new_for_uri __attribute((alias("IA__g_file_new_for_uri"), visibility("default"))); - -#undef g_file_new_for_commandline_arg -extern __typeof (g_file_new_for_commandline_arg) g_file_new_for_commandline_arg __attribute((alias("IA__g_file_new_for_commandline_arg"), visibility("default"))); - -#undef g_file_parse_name -extern __typeof (g_file_parse_name) g_file_parse_name __attribute((alias("IA__g_file_parse_name"), visibility("default"))); - -#undef g_file_dup -extern __typeof (g_file_dup) g_file_dup __attribute((alias("IA__g_file_dup"), visibility("default"))); - -#undef g_file_hash -extern __typeof (g_file_hash) g_file_hash __attribute((alias("IA__g_file_hash"), visibility("default"))); - -#undef g_file_equal -extern __typeof (g_file_equal) g_file_equal __attribute((alias("IA__g_file_equal"), visibility("default"))); - -#undef g_file_get_basename -extern __typeof (g_file_get_basename) g_file_get_basename __attribute((alias("IA__g_file_get_basename"), visibility("default"))); - -#undef g_file_get_path -extern __typeof (g_file_get_path) g_file_get_path __attribute((alias("IA__g_file_get_path"), visibility("default"))); - -#undef g_file_get_uri -extern __typeof (g_file_get_uri) g_file_get_uri __attribute((alias("IA__g_file_get_uri"), visibility("default"))); - -#undef g_file_get_parse_name -extern __typeof (g_file_get_parse_name) g_file_get_parse_name __attribute((alias("IA__g_file_get_parse_name"), visibility("default"))); - -#undef g_file_get_parent -extern __typeof (g_file_get_parent) g_file_get_parent __attribute((alias("IA__g_file_get_parent"), visibility("default"))); - -#undef g_file_has_parent -extern __typeof (g_file_has_parent) g_file_has_parent __attribute((alias("IA__g_file_has_parent"), visibility("default"))); - -#undef g_file_get_child -extern __typeof (g_file_get_child) g_file_get_child __attribute((alias("IA__g_file_get_child"), visibility("default"))); - -#undef g_file_get_child_for_display_name -extern __typeof (g_file_get_child_for_display_name) g_file_get_child_for_display_name __attribute((alias("IA__g_file_get_child_for_display_name"), visibility("default"))); - -#undef g_file_has_prefix -extern __typeof (g_file_has_prefix) g_file_has_prefix __attribute((alias("IA__g_file_has_prefix"), visibility("default"))); - -#undef g_file_get_relative_path -extern __typeof (g_file_get_relative_path) g_file_get_relative_path __attribute((alias("IA__g_file_get_relative_path"), visibility("default"))); - -#undef g_file_resolve_relative_path -extern __typeof (g_file_resolve_relative_path) g_file_resolve_relative_path __attribute((alias("IA__g_file_resolve_relative_path"), visibility("default"))); - -#undef g_file_is_native -extern __typeof (g_file_is_native) g_file_is_native __attribute((alias("IA__g_file_is_native"), visibility("default"))); - -#undef g_file_has_uri_scheme -extern __typeof (g_file_has_uri_scheme) g_file_has_uri_scheme __attribute((alias("IA__g_file_has_uri_scheme"), visibility("default"))); - -#undef g_file_get_uri_scheme -extern __typeof (g_file_get_uri_scheme) g_file_get_uri_scheme __attribute((alias("IA__g_file_get_uri_scheme"), visibility("default"))); - -#undef g_file_read -extern __typeof (g_file_read) g_file_read __attribute((alias("IA__g_file_read"), visibility("default"))); - -#undef g_file_read_async -extern __typeof (g_file_read_async) g_file_read_async __attribute((alias("IA__g_file_read_async"), visibility("default"))); - -#undef g_file_read_finish -extern __typeof (g_file_read_finish) g_file_read_finish __attribute((alias("IA__g_file_read_finish"), visibility("default"))); - -#undef g_file_append_to -extern __typeof (g_file_append_to) g_file_append_to __attribute((alias("IA__g_file_append_to"), visibility("default"))); - -#undef g_file_create -extern __typeof (g_file_create) g_file_create __attribute((alias("IA__g_file_create"), visibility("default"))); - -#undef g_file_replace -extern __typeof (g_file_replace) g_file_replace __attribute((alias("IA__g_file_replace"), visibility("default"))); - -#undef g_file_append_to_async -extern __typeof (g_file_append_to_async) g_file_append_to_async __attribute((alias("IA__g_file_append_to_async"), visibility("default"))); - -#undef g_file_append_to_finish -extern __typeof (g_file_append_to_finish) g_file_append_to_finish __attribute((alias("IA__g_file_append_to_finish"), visibility("default"))); - -#undef g_file_create_async -extern __typeof (g_file_create_async) g_file_create_async __attribute((alias("IA__g_file_create_async"), visibility("default"))); - -#undef g_file_create_finish -extern __typeof (g_file_create_finish) g_file_create_finish __attribute((alias("IA__g_file_create_finish"), visibility("default"))); - -#undef g_file_replace_async -extern __typeof (g_file_replace_async) g_file_replace_async __attribute((alias("IA__g_file_replace_async"), visibility("default"))); - -#undef g_file_replace_finish -extern __typeof (g_file_replace_finish) g_file_replace_finish __attribute((alias("IA__g_file_replace_finish"), visibility("default"))); - -#undef g_file_query_exists -extern __typeof (g_file_query_exists) g_file_query_exists __attribute((alias("IA__g_file_query_exists"), visibility("default"))); - -#undef g_file_query_info -extern __typeof (g_file_query_info) g_file_query_info __attribute((alias("IA__g_file_query_info"), visibility("default"))); - -#undef g_file_query_info_async -extern __typeof (g_file_query_info_async) g_file_query_info_async __attribute((alias("IA__g_file_query_info_async"), visibility("default"))); - -#undef g_file_query_info_finish -extern __typeof (g_file_query_info_finish) g_file_query_info_finish __attribute((alias("IA__g_file_query_info_finish"), visibility("default"))); - -#undef g_file_query_file_type -extern __typeof (g_file_query_file_type) g_file_query_file_type __attribute((alias("IA__g_file_query_file_type"), visibility("default"))); - -#undef g_file_query_filesystem_info -extern __typeof (g_file_query_filesystem_info) g_file_query_filesystem_info __attribute((alias("IA__g_file_query_filesystem_info"), visibility("default"))); - -#undef g_file_query_filesystem_info_async -extern __typeof (g_file_query_filesystem_info_async) g_file_query_filesystem_info_async __attribute((alias("IA__g_file_query_filesystem_info_async"), visibility("default"))); - -#undef g_file_query_filesystem_info_finish -extern __typeof (g_file_query_filesystem_info_finish) g_file_query_filesystem_info_finish __attribute((alias("IA__g_file_query_filesystem_info_finish"), visibility("default"))); - -#undef g_file_find_enclosing_mount -extern __typeof (g_file_find_enclosing_mount) g_file_find_enclosing_mount __attribute((alias("IA__g_file_find_enclosing_mount"), visibility("default"))); - -#undef g_file_find_enclosing_mount_async -extern __typeof (g_file_find_enclosing_mount_async) g_file_find_enclosing_mount_async __attribute((alias("IA__g_file_find_enclosing_mount_async"), visibility("default"))); - -#undef g_file_find_enclosing_mount_finish -extern __typeof (g_file_find_enclosing_mount_finish) g_file_find_enclosing_mount_finish __attribute((alias("IA__g_file_find_enclosing_mount_finish"), visibility("default"))); - -#undef g_file_enumerate_children -extern __typeof (g_file_enumerate_children) g_file_enumerate_children __attribute((alias("IA__g_file_enumerate_children"), visibility("default"))); - -#undef g_file_enumerate_children_async -extern __typeof (g_file_enumerate_children_async) g_file_enumerate_children_async __attribute((alias("IA__g_file_enumerate_children_async"), visibility("default"))); - -#undef g_file_enumerate_children_finish -extern __typeof (g_file_enumerate_children_finish) g_file_enumerate_children_finish __attribute((alias("IA__g_file_enumerate_children_finish"), visibility("default"))); - -#undef g_file_set_display_name -extern __typeof (g_file_set_display_name) g_file_set_display_name __attribute((alias("IA__g_file_set_display_name"), visibility("default"))); - -#undef g_file_set_display_name_async -extern __typeof (g_file_set_display_name_async) g_file_set_display_name_async __attribute((alias("IA__g_file_set_display_name_async"), visibility("default"))); - -#undef g_file_set_display_name_finish -extern __typeof (g_file_set_display_name_finish) g_file_set_display_name_finish __attribute((alias("IA__g_file_set_display_name_finish"), visibility("default"))); - -#undef g_file_delete -extern __typeof (g_file_delete) g_file_delete __attribute((alias("IA__g_file_delete"), visibility("default"))); - -#undef g_file_trash -extern __typeof (g_file_trash) g_file_trash __attribute((alias("IA__g_file_trash"), visibility("default"))); - -#undef g_file_copy -extern __typeof (g_file_copy) g_file_copy __attribute((alias("IA__g_file_copy"), visibility("default"))); - -#undef g_file_copy_async -extern __typeof (g_file_copy_async) g_file_copy_async __attribute((alias("IA__g_file_copy_async"), visibility("default"))); - -#undef g_file_copy_finish -extern __typeof (g_file_copy_finish) g_file_copy_finish __attribute((alias("IA__g_file_copy_finish"), visibility("default"))); - -#undef g_file_move -extern __typeof (g_file_move) g_file_move __attribute((alias("IA__g_file_move"), visibility("default"))); - -#undef g_file_make_directory -extern __typeof (g_file_make_directory) g_file_make_directory __attribute((alias("IA__g_file_make_directory"), visibility("default"))); - -#undef g_file_make_directory_with_parents -extern __typeof (g_file_make_directory_with_parents) g_file_make_directory_with_parents __attribute((alias("IA__g_file_make_directory_with_parents"), visibility("default"))); - -#undef g_file_make_symbolic_link -extern __typeof (g_file_make_symbolic_link) g_file_make_symbolic_link __attribute((alias("IA__g_file_make_symbolic_link"), visibility("default"))); - -#undef g_file_query_settable_attributes -extern __typeof (g_file_query_settable_attributes) g_file_query_settable_attributes __attribute((alias("IA__g_file_query_settable_attributes"), visibility("default"))); - -#undef g_file_query_writable_namespaces -extern __typeof (g_file_query_writable_namespaces) g_file_query_writable_namespaces __attribute((alias("IA__g_file_query_writable_namespaces"), visibility("default"))); - -#undef g_file_set_attribute -extern __typeof (g_file_set_attribute) g_file_set_attribute __attribute((alias("IA__g_file_set_attribute"), visibility("default"))); - -#undef g_file_set_attributes_from_info -extern __typeof (g_file_set_attributes_from_info) g_file_set_attributes_from_info __attribute((alias("IA__g_file_set_attributes_from_info"), visibility("default"))); - -#undef g_file_set_attributes_async -extern __typeof (g_file_set_attributes_async) g_file_set_attributes_async __attribute((alias("IA__g_file_set_attributes_async"), visibility("default"))); - -#undef g_file_set_attributes_finish -extern __typeof (g_file_set_attributes_finish) g_file_set_attributes_finish __attribute((alias("IA__g_file_set_attributes_finish"), visibility("default"))); - -#undef g_file_set_attribute_string -extern __typeof (g_file_set_attribute_string) g_file_set_attribute_string __attribute((alias("IA__g_file_set_attribute_string"), visibility("default"))); - -#undef g_file_set_attribute_byte_string -extern __typeof (g_file_set_attribute_byte_string) g_file_set_attribute_byte_string __attribute((alias("IA__g_file_set_attribute_byte_string"), visibility("default"))); - -#undef g_file_set_attribute_uint32 -extern __typeof (g_file_set_attribute_uint32) g_file_set_attribute_uint32 __attribute((alias("IA__g_file_set_attribute_uint32"), visibility("default"))); - -#undef g_file_set_attribute_int32 -extern __typeof (g_file_set_attribute_int32) g_file_set_attribute_int32 __attribute((alias("IA__g_file_set_attribute_int32"), visibility("default"))); - -#undef g_file_set_attribute_uint64 -extern __typeof (g_file_set_attribute_uint64) g_file_set_attribute_uint64 __attribute((alias("IA__g_file_set_attribute_uint64"), visibility("default"))); - -#undef g_file_set_attribute_int64 -extern __typeof (g_file_set_attribute_int64) g_file_set_attribute_int64 __attribute((alias("IA__g_file_set_attribute_int64"), visibility("default"))); - -#undef g_file_mount_enclosing_volume -extern __typeof (g_file_mount_enclosing_volume) g_file_mount_enclosing_volume __attribute((alias("IA__g_file_mount_enclosing_volume"), visibility("default"))); - -#undef g_file_mount_enclosing_volume_finish -extern __typeof (g_file_mount_enclosing_volume_finish) g_file_mount_enclosing_volume_finish __attribute((alias("IA__g_file_mount_enclosing_volume_finish"), visibility("default"))); - -#undef g_file_mount_mountable -extern __typeof (g_file_mount_mountable) g_file_mount_mountable __attribute((alias("IA__g_file_mount_mountable"), visibility("default"))); - -#undef g_file_mount_mountable_finish -extern __typeof (g_file_mount_mountable_finish) g_file_mount_mountable_finish __attribute((alias("IA__g_file_mount_mountable_finish"), visibility("default"))); - -#undef g_file_unmount_mountable_with_operation -extern __typeof (g_file_unmount_mountable_with_operation) g_file_unmount_mountable_with_operation __attribute((alias("IA__g_file_unmount_mountable_with_operation"), visibility("default"))); - -#undef g_file_unmount_mountable_with_operation_finish -extern __typeof (g_file_unmount_mountable_with_operation_finish) g_file_unmount_mountable_with_operation_finish __attribute((alias("IA__g_file_unmount_mountable_with_operation_finish"), visibility("default"))); - -#undef g_file_eject_mountable_with_operation -extern __typeof (g_file_eject_mountable_with_operation) g_file_eject_mountable_with_operation __attribute((alias("IA__g_file_eject_mountable_with_operation"), visibility("default"))); - -#undef g_file_eject_mountable_with_operation_finish -extern __typeof (g_file_eject_mountable_with_operation_finish) g_file_eject_mountable_with_operation_finish __attribute((alias("IA__g_file_eject_mountable_with_operation_finish"), visibility("default"))); - -#undef g_file_copy_attributes -extern __typeof (g_file_copy_attributes) g_file_copy_attributes __attribute((alias("IA__g_file_copy_attributes"), visibility("default"))); - -#undef g_file_monitor_directory -extern __typeof (g_file_monitor_directory) g_file_monitor_directory __attribute((alias("IA__g_file_monitor_directory"), visibility("default"))); - -#undef g_file_monitor_file -extern __typeof (g_file_monitor_file) g_file_monitor_file __attribute((alias("IA__g_file_monitor_file"), visibility("default"))); - -#undef g_file_monitor -extern __typeof (g_file_monitor) g_file_monitor __attribute((alias("IA__g_file_monitor"), visibility("default"))); - -#undef g_file_query_default_handler -extern __typeof (g_file_query_default_handler) g_file_query_default_handler __attribute((alias("IA__g_file_query_default_handler"), visibility("default"))); - -#undef g_file_load_contents -extern __typeof (g_file_load_contents) g_file_load_contents __attribute((alias("IA__g_file_load_contents"), visibility("default"))); - -#undef g_file_load_contents_async -extern __typeof (g_file_load_contents_async) g_file_load_contents_async __attribute((alias("IA__g_file_load_contents_async"), visibility("default"))); - -#undef g_file_load_contents_finish -extern __typeof (g_file_load_contents_finish) g_file_load_contents_finish __attribute((alias("IA__g_file_load_contents_finish"), visibility("default"))); - -#undef g_file_load_partial_contents_async -extern __typeof (g_file_load_partial_contents_async) g_file_load_partial_contents_async __attribute((alias("IA__g_file_load_partial_contents_async"), visibility("default"))); - -#undef g_file_load_partial_contents_finish -extern __typeof (g_file_load_partial_contents_finish) g_file_load_partial_contents_finish __attribute((alias("IA__g_file_load_partial_contents_finish"), visibility("default"))); - -#undef g_file_replace_contents -extern __typeof (g_file_replace_contents) g_file_replace_contents __attribute((alias("IA__g_file_replace_contents"), visibility("default"))); - -#undef g_file_replace_contents_async -extern __typeof (g_file_replace_contents_async) g_file_replace_contents_async __attribute((alias("IA__g_file_replace_contents_async"), visibility("default"))); - -#undef g_file_replace_contents_finish -extern __typeof (g_file_replace_contents_finish) g_file_replace_contents_finish __attribute((alias("IA__g_file_replace_contents_finish"), visibility("default"))); - -#undef g_file_create_readwrite -extern __typeof (g_file_create_readwrite) g_file_create_readwrite __attribute((alias("IA__g_file_create_readwrite"), visibility("default"))); - -#undef g_file_create_readwrite_async -extern __typeof (g_file_create_readwrite_async) g_file_create_readwrite_async __attribute((alias("IA__g_file_create_readwrite_async"), visibility("default"))); - -#undef g_file_create_readwrite_finish -extern __typeof (g_file_create_readwrite_finish) g_file_create_readwrite_finish __attribute((alias("IA__g_file_create_readwrite_finish"), visibility("default"))); - -#undef g_file_open_readwrite -extern __typeof (g_file_open_readwrite) g_file_open_readwrite __attribute((alias("IA__g_file_open_readwrite"), visibility("default"))); - -#undef g_file_open_readwrite_async -extern __typeof (g_file_open_readwrite_async) g_file_open_readwrite_async __attribute((alias("IA__g_file_open_readwrite_async"), visibility("default"))); - -#undef g_file_open_readwrite_finish -extern __typeof (g_file_open_readwrite_finish) g_file_open_readwrite_finish __attribute((alias("IA__g_file_open_readwrite_finish"), visibility("default"))); - -#undef g_file_replace_readwrite -extern __typeof (g_file_replace_readwrite) g_file_replace_readwrite __attribute((alias("IA__g_file_replace_readwrite"), visibility("default"))); - -#undef g_file_replace_readwrite_async -extern __typeof (g_file_replace_readwrite_async) g_file_replace_readwrite_async __attribute((alias("IA__g_file_replace_readwrite_async"), visibility("default"))); - -#undef g_file_replace_readwrite_finish -extern __typeof (g_file_replace_readwrite_finish) g_file_replace_readwrite_finish __attribute((alias("IA__g_file_replace_readwrite_finish"), visibility("default"))); - -#undef g_file_start_mountable -extern __typeof (g_file_start_mountable) g_file_start_mountable __attribute((alias("IA__g_file_start_mountable"), visibility("default"))); - -#undef g_file_start_mountable_finish -extern __typeof (g_file_start_mountable_finish) g_file_start_mountable_finish __attribute((alias("IA__g_file_start_mountable_finish"), visibility("default"))); - -#undef g_file_stop_mountable -extern __typeof (g_file_stop_mountable) g_file_stop_mountable __attribute((alias("IA__g_file_stop_mountable"), visibility("default"))); - -#undef g_file_stop_mountable_finish -extern __typeof (g_file_stop_mountable_finish) g_file_stop_mountable_finish __attribute((alias("IA__g_file_stop_mountable_finish"), visibility("default"))); - -#undef g_file_supports_thread_contexts -extern __typeof (g_file_supports_thread_contexts) g_file_supports_thread_contexts __attribute((alias("IA__g_file_supports_thread_contexts"), visibility("default"))); - -#undef g_file_poll_mountable -extern __typeof (g_file_poll_mountable) g_file_poll_mountable __attribute((alias("IA__g_file_poll_mountable"), visibility("default"))); - -#undef g_file_poll_mountable_finish -extern __typeof (g_file_poll_mountable_finish) g_file_poll_mountable_finish __attribute((alias("IA__g_file_poll_mountable_finish"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_file_unmount_mountable -extern __typeof (g_file_unmount_mountable) g_file_unmount_mountable __attribute((alias("IA__g_file_unmount_mountable"), visibility("default"))); - -#undef g_file_unmount_mountable_finish -extern __typeof (g_file_unmount_mountable_finish) g_file_unmount_mountable_finish __attribute((alias("IA__g_file_unmount_mountable_finish"), visibility("default"))); - -#undef g_file_eject_mountable -extern __typeof (g_file_eject_mountable) g_file_eject_mountable __attribute((alias("IA__g_file_eject_mountable"), visibility("default"))); - -#undef g_file_eject_mountable_finish -extern __typeof (g_file_eject_mountable_finish) g_file_eject_mountable_finish __attribute((alias("IA__g_file_eject_mountable_finish"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_FILE_ENUMERATOR_H__) -#if IN_FILE(__G_FILE_ENUMERATOR_C__) -#undef g_file_enumerator_get_type -extern __typeof (g_file_enumerator_get_type) g_file_enumerator_get_type __attribute((alias("IA__g_file_enumerator_get_type"), visibility("default"))); - -#undef g_file_enumerator_next_file -extern __typeof (g_file_enumerator_next_file) g_file_enumerator_next_file __attribute((alias("IA__g_file_enumerator_next_file"), visibility("default"))); - -#undef g_file_enumerator_close -extern __typeof (g_file_enumerator_close) g_file_enumerator_close __attribute((alias("IA__g_file_enumerator_close"), visibility("default"))); - -#undef g_file_enumerator_next_files_async -extern __typeof (g_file_enumerator_next_files_async) g_file_enumerator_next_files_async __attribute((alias("IA__g_file_enumerator_next_files_async"), visibility("default"))); - -#undef g_file_enumerator_next_files_finish -extern __typeof (g_file_enumerator_next_files_finish) g_file_enumerator_next_files_finish __attribute((alias("IA__g_file_enumerator_next_files_finish"), visibility("default"))); - -#undef g_file_enumerator_close_async -extern __typeof (g_file_enumerator_close_async) g_file_enumerator_close_async __attribute((alias("IA__g_file_enumerator_close_async"), visibility("default"))); - -#undef g_file_enumerator_close_finish -extern __typeof (g_file_enumerator_close_finish) g_file_enumerator_close_finish __attribute((alias("IA__g_file_enumerator_close_finish"), visibility("default"))); - -#undef g_file_enumerator_is_closed -extern __typeof (g_file_enumerator_is_closed) g_file_enumerator_is_closed __attribute((alias("IA__g_file_enumerator_is_closed"), visibility("default"))); - -#undef g_file_enumerator_has_pending -extern __typeof (g_file_enumerator_has_pending) g_file_enumerator_has_pending __attribute((alias("IA__g_file_enumerator_has_pending"), visibility("default"))); - -#undef g_file_enumerator_set_pending -extern __typeof (g_file_enumerator_set_pending) g_file_enumerator_set_pending __attribute((alias("IA__g_file_enumerator_set_pending"), visibility("default"))); - -#undef g_file_enumerator_get_container -extern __typeof (g_file_enumerator_get_container) g_file_enumerator_get_container __attribute((alias("IA__g_file_enumerator_get_container"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_ICON_H__) -#if IN_FILE(__G_FILE_ICON_C__) -#undef g_file_icon_get_type -extern __typeof (g_file_icon_get_type) g_file_icon_get_type __attribute((alias("IA__g_file_icon_get_type"), visibility("default"))); - -#undef g_file_icon_new -extern __typeof (g_file_icon_new) g_file_icon_new __attribute((alias("IA__g_file_icon_new"), visibility("default"))); - -#undef g_file_icon_get_file -extern __typeof (g_file_icon_get_file) g_file_icon_get_file __attribute((alias("IA__g_file_icon_get_file"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_INFO_H__) -#if IN_FILE(__G_FILE_INFO_C__) -#undef g_file_info_get_type -extern __typeof (g_file_info_get_type) g_file_info_get_type __attribute((alias("IA__g_file_info_get_type"), visibility("default"))); - -#undef g_file_info_new -extern __typeof (g_file_info_new) g_file_info_new __attribute((alias("IA__g_file_info_new"), visibility("default"))); - -#undef g_file_info_dup -extern __typeof (g_file_info_dup) g_file_info_dup __attribute((alias("IA__g_file_info_dup"), visibility("default"))); - -#undef g_file_info_copy_into -extern __typeof (g_file_info_copy_into) g_file_info_copy_into __attribute((alias("IA__g_file_info_copy_into"), visibility("default"))); - -#undef g_file_info_has_attribute -extern __typeof (g_file_info_has_attribute) g_file_info_has_attribute __attribute((alias("IA__g_file_info_has_attribute"), visibility("default"))); - -#undef g_file_info_has_namespace -extern __typeof (g_file_info_has_namespace) g_file_info_has_namespace __attribute((alias("IA__g_file_info_has_namespace"), visibility("default"))); - -#undef g_file_info_list_attributes -extern __typeof (g_file_info_list_attributes) g_file_info_list_attributes __attribute((alias("IA__g_file_info_list_attributes"), visibility("default"))); - -#undef g_file_info_get_attribute_type -extern __typeof (g_file_info_get_attribute_type) g_file_info_get_attribute_type __attribute((alias("IA__g_file_info_get_attribute_type"), visibility("default"))); - -#undef g_file_info_remove_attribute -extern __typeof (g_file_info_remove_attribute) g_file_info_remove_attribute __attribute((alias("IA__g_file_info_remove_attribute"), visibility("default"))); - -#undef g_file_info_get_attribute_status -extern __typeof (g_file_info_get_attribute_status) g_file_info_get_attribute_status __attribute((alias("IA__g_file_info_get_attribute_status"), visibility("default"))); - -#undef g_file_info_get_attribute_data -extern __typeof (g_file_info_get_attribute_data) g_file_info_get_attribute_data __attribute((alias("IA__g_file_info_get_attribute_data"), visibility("default"))); - -#undef g_file_info_get_attribute_as_string -extern __typeof (g_file_info_get_attribute_as_string) g_file_info_get_attribute_as_string __attribute((alias("IA__g_file_info_get_attribute_as_string"), visibility("default"))); - -#undef g_file_info_get_attribute_string -extern __typeof (g_file_info_get_attribute_string) g_file_info_get_attribute_string __attribute((alias("IA__g_file_info_get_attribute_string"), visibility("default"))); - -#undef g_file_info_get_attribute_byte_string -extern __typeof (g_file_info_get_attribute_byte_string) g_file_info_get_attribute_byte_string __attribute((alias("IA__g_file_info_get_attribute_byte_string"), visibility("default"))); - -#undef g_file_info_get_attribute_boolean -extern __typeof (g_file_info_get_attribute_boolean) g_file_info_get_attribute_boolean __attribute((alias("IA__g_file_info_get_attribute_boolean"), visibility("default"))); - -#undef g_file_info_get_attribute_uint32 -extern __typeof (g_file_info_get_attribute_uint32) g_file_info_get_attribute_uint32 __attribute((alias("IA__g_file_info_get_attribute_uint32"), visibility("default"))); - -#undef g_file_info_get_attribute_int32 -extern __typeof (g_file_info_get_attribute_int32) g_file_info_get_attribute_int32 __attribute((alias("IA__g_file_info_get_attribute_int32"), visibility("default"))); - -#undef g_file_info_get_attribute_uint64 -extern __typeof (g_file_info_get_attribute_uint64) g_file_info_get_attribute_uint64 __attribute((alias("IA__g_file_info_get_attribute_uint64"), visibility("default"))); - -#undef g_file_info_get_attribute_int64 -extern __typeof (g_file_info_get_attribute_int64) g_file_info_get_attribute_int64 __attribute((alias("IA__g_file_info_get_attribute_int64"), visibility("default"))); - -#undef g_file_info_get_attribute_object -extern __typeof (g_file_info_get_attribute_object) g_file_info_get_attribute_object __attribute((alias("IA__g_file_info_get_attribute_object"), visibility("default"))); - -#undef g_file_info_get_attribute_stringv -extern __typeof (g_file_info_get_attribute_stringv) g_file_info_get_attribute_stringv __attribute((alias("IA__g_file_info_get_attribute_stringv"), visibility("default"))); - -#undef g_file_info_set_attribute_status -extern __typeof (g_file_info_set_attribute_status) g_file_info_set_attribute_status __attribute((alias("IA__g_file_info_set_attribute_status"), visibility("default"))); - -#undef g_file_info_set_attribute -extern __typeof (g_file_info_set_attribute) g_file_info_set_attribute __attribute((alias("IA__g_file_info_set_attribute"), visibility("default"))); - -#undef g_file_info_set_attribute_string -extern __typeof (g_file_info_set_attribute_string) g_file_info_set_attribute_string __attribute((alias("IA__g_file_info_set_attribute_string"), visibility("default"))); - -#undef g_file_info_set_attribute_byte_string -extern __typeof (g_file_info_set_attribute_byte_string) g_file_info_set_attribute_byte_string __attribute((alias("IA__g_file_info_set_attribute_byte_string"), visibility("default"))); - -#undef g_file_info_set_attribute_boolean -extern __typeof (g_file_info_set_attribute_boolean) g_file_info_set_attribute_boolean __attribute((alias("IA__g_file_info_set_attribute_boolean"), visibility("default"))); - -#undef g_file_info_set_attribute_uint32 -extern __typeof (g_file_info_set_attribute_uint32) g_file_info_set_attribute_uint32 __attribute((alias("IA__g_file_info_set_attribute_uint32"), visibility("default"))); - -#undef g_file_info_set_attribute_int32 -extern __typeof (g_file_info_set_attribute_int32) g_file_info_set_attribute_int32 __attribute((alias("IA__g_file_info_set_attribute_int32"), visibility("default"))); - -#undef g_file_info_set_attribute_uint64 -extern __typeof (g_file_info_set_attribute_uint64) g_file_info_set_attribute_uint64 __attribute((alias("IA__g_file_info_set_attribute_uint64"), visibility("default"))); - -#undef g_file_info_set_attribute_int64 -extern __typeof (g_file_info_set_attribute_int64) g_file_info_set_attribute_int64 __attribute((alias("IA__g_file_info_set_attribute_int64"), visibility("default"))); - -#undef g_file_info_set_attribute_object -extern __typeof (g_file_info_set_attribute_object) g_file_info_set_attribute_object __attribute((alias("IA__g_file_info_set_attribute_object"), visibility("default"))); - -#undef g_file_info_set_attribute_stringv -extern __typeof (g_file_info_set_attribute_stringv) g_file_info_set_attribute_stringv __attribute((alias("IA__g_file_info_set_attribute_stringv"), visibility("default"))); - -#undef g_file_info_clear_status -extern __typeof (g_file_info_clear_status) g_file_info_clear_status __attribute((alias("IA__g_file_info_clear_status"), visibility("default"))); - -#undef g_file_info_get_file_type -extern __typeof (g_file_info_get_file_type) g_file_info_get_file_type __attribute((alias("IA__g_file_info_get_file_type"), visibility("default"))); - -#undef g_file_info_get_is_hidden -extern __typeof (g_file_info_get_is_hidden) g_file_info_get_is_hidden __attribute((alias("IA__g_file_info_get_is_hidden"), visibility("default"))); - -#undef g_file_info_get_is_backup -extern __typeof (g_file_info_get_is_backup) g_file_info_get_is_backup __attribute((alias("IA__g_file_info_get_is_backup"), visibility("default"))); - -#undef g_file_info_get_is_symlink -extern __typeof (g_file_info_get_is_symlink) g_file_info_get_is_symlink __attribute((alias("IA__g_file_info_get_is_symlink"), visibility("default"))); - -#undef g_file_info_get_name -extern __typeof (g_file_info_get_name) g_file_info_get_name __attribute((alias("IA__g_file_info_get_name"), visibility("default"))); - -#undef g_file_info_get_display_name -extern __typeof (g_file_info_get_display_name) g_file_info_get_display_name __attribute((alias("IA__g_file_info_get_display_name"), visibility("default"))); - -#undef g_file_info_get_edit_name -extern __typeof (g_file_info_get_edit_name) g_file_info_get_edit_name __attribute((alias("IA__g_file_info_get_edit_name"), visibility("default"))); - -#undef g_file_info_get_icon -extern __typeof (g_file_info_get_icon) g_file_info_get_icon __attribute((alias("IA__g_file_info_get_icon"), visibility("default"))); - -#undef g_file_info_get_content_type -extern __typeof (g_file_info_get_content_type) g_file_info_get_content_type __attribute((alias("IA__g_file_info_get_content_type"), visibility("default"))); - -#undef g_file_info_get_size -extern __typeof (g_file_info_get_size) g_file_info_get_size __attribute((alias("IA__g_file_info_get_size"), visibility("default"))); - -#undef g_file_info_get_modification_time -extern __typeof (g_file_info_get_modification_time) g_file_info_get_modification_time __attribute((alias("IA__g_file_info_get_modification_time"), visibility("default"))); - -#undef g_file_info_get_symlink_target -extern __typeof (g_file_info_get_symlink_target) g_file_info_get_symlink_target __attribute((alias("IA__g_file_info_get_symlink_target"), visibility("default"))); - -#undef g_file_info_get_etag -extern __typeof (g_file_info_get_etag) g_file_info_get_etag __attribute((alias("IA__g_file_info_get_etag"), visibility("default"))); - -#undef g_file_info_get_sort_order -extern __typeof (g_file_info_get_sort_order) g_file_info_get_sort_order __attribute((alias("IA__g_file_info_get_sort_order"), visibility("default"))); - -#undef g_file_info_set_attribute_mask -extern __typeof (g_file_info_set_attribute_mask) g_file_info_set_attribute_mask __attribute((alias("IA__g_file_info_set_attribute_mask"), visibility("default"))); - -#undef g_file_info_unset_attribute_mask -extern __typeof (g_file_info_unset_attribute_mask) g_file_info_unset_attribute_mask __attribute((alias("IA__g_file_info_unset_attribute_mask"), visibility("default"))); - -#undef g_file_info_set_file_type -extern __typeof (g_file_info_set_file_type) g_file_info_set_file_type __attribute((alias("IA__g_file_info_set_file_type"), visibility("default"))); - -#undef g_file_info_set_is_hidden -extern __typeof (g_file_info_set_is_hidden) g_file_info_set_is_hidden __attribute((alias("IA__g_file_info_set_is_hidden"), visibility("default"))); - -#undef g_file_info_set_is_symlink -extern __typeof (g_file_info_set_is_symlink) g_file_info_set_is_symlink __attribute((alias("IA__g_file_info_set_is_symlink"), visibility("default"))); - -#undef g_file_info_set_name -extern __typeof (g_file_info_set_name) g_file_info_set_name __attribute((alias("IA__g_file_info_set_name"), visibility("default"))); - -#undef g_file_info_set_display_name -extern __typeof (g_file_info_set_display_name) g_file_info_set_display_name __attribute((alias("IA__g_file_info_set_display_name"), visibility("default"))); - -#undef g_file_info_set_edit_name -extern __typeof (g_file_info_set_edit_name) g_file_info_set_edit_name __attribute((alias("IA__g_file_info_set_edit_name"), visibility("default"))); - -#undef g_file_info_set_icon -extern __typeof (g_file_info_set_icon) g_file_info_set_icon __attribute((alias("IA__g_file_info_set_icon"), visibility("default"))); - -#undef g_file_info_set_content_type -extern __typeof (g_file_info_set_content_type) g_file_info_set_content_type __attribute((alias("IA__g_file_info_set_content_type"), visibility("default"))); - -#undef g_file_info_set_size -extern __typeof (g_file_info_set_size) g_file_info_set_size __attribute((alias("IA__g_file_info_set_size"), visibility("default"))); - -#undef g_file_info_set_modification_time -extern __typeof (g_file_info_set_modification_time) g_file_info_set_modification_time __attribute((alias("IA__g_file_info_set_modification_time"), visibility("default"))); - -#undef g_file_info_set_symlink_target -extern __typeof (g_file_info_set_symlink_target) g_file_info_set_symlink_target __attribute((alias("IA__g_file_info_set_symlink_target"), visibility("default"))); - -#undef g_file_info_set_sort_order -extern __typeof (g_file_info_set_sort_order) g_file_info_set_sort_order __attribute((alias("IA__g_file_info_set_sort_order"), visibility("default"))); - -#undef g_file_attribute_matcher_new -extern __typeof (g_file_attribute_matcher_new) g_file_attribute_matcher_new __attribute((alias("IA__g_file_attribute_matcher_new"), visibility("default"))); - -#undef g_file_attribute_matcher_ref -extern __typeof (g_file_attribute_matcher_ref) g_file_attribute_matcher_ref __attribute((alias("IA__g_file_attribute_matcher_ref"), visibility("default"))); - -#undef g_file_attribute_matcher_unref -extern __typeof (g_file_attribute_matcher_unref) g_file_attribute_matcher_unref __attribute((alias("IA__g_file_attribute_matcher_unref"), visibility("default"))); - -#undef g_file_attribute_matcher_matches -extern __typeof (g_file_attribute_matcher_matches) g_file_attribute_matcher_matches __attribute((alias("IA__g_file_attribute_matcher_matches"), visibility("default"))); - -#undef g_file_attribute_matcher_matches_only -extern __typeof (g_file_attribute_matcher_matches_only) g_file_attribute_matcher_matches_only __attribute((alias("IA__g_file_attribute_matcher_matches_only"), visibility("default"))); - -#undef g_file_attribute_matcher_enumerate_namespace -extern __typeof (g_file_attribute_matcher_enumerate_namespace) g_file_attribute_matcher_enumerate_namespace __attribute((alias("IA__g_file_attribute_matcher_enumerate_namespace"), visibility("default"))); - -#undef g_file_attribute_matcher_enumerate_next -extern __typeof (g_file_attribute_matcher_enumerate_next) g_file_attribute_matcher_enumerate_next __attribute((alias("IA__g_file_attribute_matcher_enumerate_next"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_INPUT_STREAM_H__) -#if IN_FILE(__G_FILE_INPUT_STREAM_C__) -#undef g_file_input_stream_get_type -extern __typeof (g_file_input_stream_get_type) g_file_input_stream_get_type __attribute((alias("IA__g_file_input_stream_get_type"), visibility("default"))); - -#undef g_file_input_stream_query_info -extern __typeof (g_file_input_stream_query_info) g_file_input_stream_query_info __attribute((alias("IA__g_file_input_stream_query_info"), visibility("default"))); - -#undef g_file_input_stream_query_info_async -extern __typeof (g_file_input_stream_query_info_async) g_file_input_stream_query_info_async __attribute((alias("IA__g_file_input_stream_query_info_async"), visibility("default"))); - -#undef g_file_input_stream_query_info_finish -extern __typeof (g_file_input_stream_query_info_finish) g_file_input_stream_query_info_finish __attribute((alias("IA__g_file_input_stream_query_info_finish"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_MONITOR_H__) -#if IN_FILE(__G_FILE_MONITOR_C__) -#undef g_file_monitor_get_type -extern __typeof (g_file_monitor_get_type) g_file_monitor_get_type __attribute((alias("IA__g_file_monitor_get_type"), visibility("default"))); - -#undef g_file_monitor_cancel -extern __typeof (g_file_monitor_cancel) g_file_monitor_cancel __attribute((alias("IA__g_file_monitor_cancel"), visibility("default"))); - -#undef g_file_monitor_is_cancelled -extern __typeof (g_file_monitor_is_cancelled) g_file_monitor_is_cancelled __attribute((alias("IA__g_file_monitor_is_cancelled"), visibility("default"))); - -#undef g_file_monitor_set_rate_limit -extern __typeof (g_file_monitor_set_rate_limit) g_file_monitor_set_rate_limit __attribute((alias("IA__g_file_monitor_set_rate_limit"), visibility("default"))); - -#undef g_file_monitor_emit_event -extern __typeof (g_file_monitor_emit_event) g_file_monitor_emit_event __attribute((alias("IA__g_file_monitor_emit_event"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILENAME_COMPLETER_H__) -#if IN_FILE(__G_FILENAME_COMPLETER_C__) -#undef g_filename_completer_get_type -extern __typeof (g_filename_completer_get_type) g_filename_completer_get_type __attribute((alias("IA__g_filename_completer_get_type"), visibility("default"))); - -#undef g_filename_completer_new -extern __typeof (g_filename_completer_new) g_filename_completer_new __attribute((alias("IA__g_filename_completer_new"), visibility("default"))); - -#undef g_filename_completer_get_completion_suffix -extern __typeof (g_filename_completer_get_completion_suffix) g_filename_completer_get_completion_suffix __attribute((alias("IA__g_filename_completer_get_completion_suffix"), visibility("default"))); - -#undef g_filename_completer_get_completions -extern __typeof (g_filename_completer_get_completions) g_filename_completer_get_completions __attribute((alias("IA__g_filename_completer_get_completions"), visibility("default"))); - -#undef g_filename_completer_set_dirs_only -extern __typeof (g_filename_completer_set_dirs_only) g_filename_completer_set_dirs_only __attribute((alias("IA__g_filename_completer_set_dirs_only"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_OUTPUT_STREAM_H__) -#if IN_FILE(__G_FILE_OUTPUT_STREAM_C__) -#undef g_file_output_stream_get_type -extern __typeof (g_file_output_stream_get_type) g_file_output_stream_get_type __attribute((alias("IA__g_file_output_stream_get_type"), visibility("default"))); - -#undef g_file_output_stream_query_info -extern __typeof (g_file_output_stream_query_info) g_file_output_stream_query_info __attribute((alias("IA__g_file_output_stream_query_info"), visibility("default"))); - -#undef g_file_output_stream_query_info_async -extern __typeof (g_file_output_stream_query_info_async) g_file_output_stream_query_info_async __attribute((alias("IA__g_file_output_stream_query_info_async"), visibility("default"))); - -#undef g_file_output_stream_query_info_finish -extern __typeof (g_file_output_stream_query_info_finish) g_file_output_stream_query_info_finish __attribute((alias("IA__g_file_output_stream_query_info_finish"), visibility("default"))); - -#undef g_file_output_stream_get_etag -extern __typeof (g_file_output_stream_get_etag) g_file_output_stream_get_etag __attribute((alias("IA__g_file_output_stream_get_etag"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_IO_STREAM_H__) -#if IN_FILE(__G_FILE_IO_STREAM_C__) -#undef g_file_io_stream_get_type -extern __typeof (g_file_io_stream_get_type) g_file_io_stream_get_type __attribute((alias("IA__g_file_io_stream_get_type"), visibility("default"))); - -#undef g_file_io_stream_query_info -extern __typeof (g_file_io_stream_query_info) g_file_io_stream_query_info __attribute((alias("IA__g_file_io_stream_query_info"), visibility("default"))); - -#undef g_file_io_stream_query_info_async -extern __typeof (g_file_io_stream_query_info_async) g_file_io_stream_query_info_async __attribute((alias("IA__g_file_io_stream_query_info_async"), visibility("default"))); - -#undef g_file_io_stream_query_info_finish -extern __typeof (g_file_io_stream_query_info_finish) g_file_io_stream_query_info_finish __attribute((alias("IA__g_file_io_stream_query_info_finish"), visibility("default"))); - -#undef g_file_io_stream_get_etag -extern __typeof (g_file_io_stream_get_etag) g_file_io_stream_get_etag __attribute((alias("IA__g_file_io_stream_get_etag"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILTER_INPUT_STREAM_H__) -#if IN_FILE(__G_FILTER_INPUT_STREAM_C__) -#undef g_filter_input_stream_get_type -extern __typeof (g_filter_input_stream_get_type) g_filter_input_stream_get_type __attribute((alias("IA__g_filter_input_stream_get_type"), visibility("default"))); - -#undef g_filter_input_stream_get_base_stream -extern __typeof (g_filter_input_stream_get_base_stream) g_filter_input_stream_get_base_stream __attribute((alias("IA__g_filter_input_stream_get_base_stream"), visibility("default"))); - -#undef g_filter_input_stream_get_close_base_stream -extern __typeof (g_filter_input_stream_get_close_base_stream) g_filter_input_stream_get_close_base_stream __attribute((alias("IA__g_filter_input_stream_get_close_base_stream"), visibility("default"))); - -#undef g_filter_input_stream_set_close_base_stream -extern __typeof (g_filter_input_stream_set_close_base_stream) g_filter_input_stream_set_close_base_stream __attribute((alias("IA__g_filter_input_stream_set_close_base_stream"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILTER_OUTPUT_STREAM_H__) -#if IN_FILE(__G_FILTER_OUTPUT_STREAM_C__) -#undef g_filter_output_stream_get_type -extern __typeof (g_filter_output_stream_get_type) g_filter_output_stream_get_type __attribute((alias("IA__g_filter_output_stream_get_type"), visibility("default"))); - -#undef g_filter_output_stream_get_base_stream -extern __typeof (g_filter_output_stream_get_base_stream) g_filter_output_stream_get_base_stream __attribute((alias("IA__g_filter_output_stream_get_base_stream"), visibility("default"))); - -#undef g_filter_output_stream_get_close_base_stream -extern __typeof (g_filter_output_stream_get_close_base_stream) g_filter_output_stream_get_close_base_stream __attribute((alias("IA__g_filter_output_stream_get_close_base_stream"), visibility("default"))); - -#undef g_filter_output_stream_set_close_base_stream -extern __typeof (g_filter_output_stream_set_close_base_stream) g_filter_output_stream_set_close_base_stream __attribute((alias("IA__g_filter_output_stream_set_close_base_stream"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_ICON_H__) -#if IN_FILE(__G_ICON_C__) -#undef g_icon_get_type -extern __typeof (g_icon_get_type) g_icon_get_type __attribute((alias("IA__g_icon_get_type"), visibility("default"))); - -#undef g_icon_hash -extern __typeof (g_icon_hash) g_icon_hash __attribute((alias("IA__g_icon_hash"), visibility("default"))); - -#undef g_icon_equal -extern __typeof (g_icon_equal) g_icon_equal __attribute((alias("IA__g_icon_equal"), visibility("default"))); - -#undef g_icon_to_string -extern __typeof (g_icon_to_string) g_icon_to_string __attribute((alias("IA__g_icon_to_string"), visibility("default"))); - -#undef g_icon_new_for_string -extern __typeof (g_icon_new_for_string) g_icon_new_for_string __attribute((alias("IA__g_icon_new_for_string"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_INPUT_STREAM_H__) -#if IN_FILE(__G_INPUT_STREAM_C__) -#undef g_input_stream_get_type -extern __typeof (g_input_stream_get_type) g_input_stream_get_type __attribute((alias("IA__g_input_stream_get_type"), visibility("default"))); - -#undef g_input_stream_read -extern __typeof (g_input_stream_read) g_input_stream_read __attribute((alias("IA__g_input_stream_read"), visibility("default"))); - -#undef g_input_stream_read_all -extern __typeof (g_input_stream_read_all) g_input_stream_read_all __attribute((alias("IA__g_input_stream_read_all"), visibility("default"))); - -#undef g_input_stream_skip -extern __typeof (g_input_stream_skip) g_input_stream_skip __attribute((alias("IA__g_input_stream_skip"), visibility("default"))); - -#undef g_input_stream_close -extern __typeof (g_input_stream_close) g_input_stream_close __attribute((alias("IA__g_input_stream_close"), visibility("default"))); - -#undef g_input_stream_read_async -extern __typeof (g_input_stream_read_async) g_input_stream_read_async __attribute((alias("IA__g_input_stream_read_async"), visibility("default"))); - -#undef g_input_stream_read_finish -extern __typeof (g_input_stream_read_finish) g_input_stream_read_finish __attribute((alias("IA__g_input_stream_read_finish"), visibility("default"))); - -#undef g_input_stream_skip_async -extern __typeof (g_input_stream_skip_async) g_input_stream_skip_async __attribute((alias("IA__g_input_stream_skip_async"), visibility("default"))); - -#undef g_input_stream_skip_finish -extern __typeof (g_input_stream_skip_finish) g_input_stream_skip_finish __attribute((alias("IA__g_input_stream_skip_finish"), visibility("default"))); - -#undef g_input_stream_close_async -extern __typeof (g_input_stream_close_async) g_input_stream_close_async __attribute((alias("IA__g_input_stream_close_async"), visibility("default"))); - -#undef g_input_stream_close_finish -extern __typeof (g_input_stream_close_finish) g_input_stream_close_finish __attribute((alias("IA__g_input_stream_close_finish"), visibility("default"))); - -#undef g_input_stream_is_closed -extern __typeof (g_input_stream_is_closed) g_input_stream_is_closed __attribute((alias("IA__g_input_stream_is_closed"), visibility("default"))); - -#undef g_input_stream_has_pending -extern __typeof (g_input_stream_has_pending) g_input_stream_has_pending __attribute((alias("IA__g_input_stream_has_pending"), visibility("default"))); - -#undef g_input_stream_set_pending -extern __typeof (g_input_stream_set_pending) g_input_stream_set_pending __attribute((alias("IA__g_input_stream_set_pending"), visibility("default"))); - -#undef g_input_stream_clear_pending -extern __typeof (g_input_stream_clear_pending) g_input_stream_clear_pending __attribute((alias("IA__g_input_stream_clear_pending"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_IO_STREAM_H__) -#if IN_FILE(__G_IO_STREAM_C__) -#undef g_io_stream_get_type -extern __typeof (g_io_stream_get_type) g_io_stream_get_type __attribute((alias("IA__g_io_stream_get_type"), visibility("default"))); - -#undef g_io_stream_get_input_stream -extern __typeof (g_io_stream_get_input_stream) g_io_stream_get_input_stream __attribute((alias("IA__g_io_stream_get_input_stream"), visibility("default"))); - -#undef g_io_stream_get_output_stream -extern __typeof (g_io_stream_get_output_stream) g_io_stream_get_output_stream __attribute((alias("IA__g_io_stream_get_output_stream"), visibility("default"))); - -#undef g_io_stream_close -extern __typeof (g_io_stream_close) g_io_stream_close __attribute((alias("IA__g_io_stream_close"), visibility("default"))); - -#undef g_io_stream_close_async -extern __typeof (g_io_stream_close_async) g_io_stream_close_async __attribute((alias("IA__g_io_stream_close_async"), visibility("default"))); - -#undef g_io_stream_close_finish -extern __typeof (g_io_stream_close_finish) g_io_stream_close_finish __attribute((alias("IA__g_io_stream_close_finish"), visibility("default"))); - -#undef g_io_stream_is_closed -extern __typeof (g_io_stream_is_closed) g_io_stream_is_closed __attribute((alias("IA__g_io_stream_is_closed"), visibility("default"))); - -#undef g_io_stream_has_pending -extern __typeof (g_io_stream_has_pending) g_io_stream_has_pending __attribute((alias("IA__g_io_stream_has_pending"), visibility("default"))); - -#undef g_io_stream_set_pending -extern __typeof (g_io_stream_set_pending) g_io_stream_set_pending __attribute((alias("IA__g_io_stream_set_pending"), visibility("default"))); - -#undef g_io_stream_clear_pending -extern __typeof (g_io_stream_clear_pending) g_io_stream_clear_pending __attribute((alias("IA__g_io_stream_clear_pending"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_IO_ERROR_H__) -#if IN_FILE(__G_IO_ERROR_C__) -#undef g_io_error_quark -extern __typeof (g_io_error_quark) g_io_error_quark __attribute((alias("IA__g_io_error_quark"), visibility("default"))); - -#undef g_io_error_from_errno -extern __typeof (g_io_error_from_errno) g_io_error_from_errno __attribute((alias("IA__g_io_error_from_errno"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_IO_MODULE_H__) -#if IN_FILE(__G_IO_MODULE_C__) -#undef g_io_module_get_type -extern __typeof (g_io_module_get_type) g_io_module_get_type __attribute((alias("IA__g_io_module_get_type"), visibility("default"))); - -#undef g_io_module_new -extern __typeof (g_io_module_new) g_io_module_new __attribute((alias("IA__g_io_module_new"), visibility("default"))); - -#undef g_io_modules_scan_all_in_directory -extern __typeof (g_io_modules_scan_all_in_directory) g_io_modules_scan_all_in_directory __attribute((alias("IA__g_io_modules_scan_all_in_directory"), visibility("default"))); - -#undef g_io_modules_load_all_in_directory -extern __typeof (g_io_modules_load_all_in_directory) g_io_modules_load_all_in_directory __attribute((alias("IA__g_io_modules_load_all_in_directory"), visibility("default"))); - -#undef g_io_extension_point_register -extern __typeof (g_io_extension_point_register) g_io_extension_point_register __attribute((alias("IA__g_io_extension_point_register"), visibility("default"))); - -#undef g_io_extension_point_lookup -extern __typeof (g_io_extension_point_lookup) g_io_extension_point_lookup __attribute((alias("IA__g_io_extension_point_lookup"), visibility("default"))); - -#undef g_io_extension_point_set_required_type -extern __typeof (g_io_extension_point_set_required_type) g_io_extension_point_set_required_type __attribute((alias("IA__g_io_extension_point_set_required_type"), visibility("default"))); - -#undef g_io_extension_point_get_required_type -extern __typeof (g_io_extension_point_get_required_type) g_io_extension_point_get_required_type __attribute((alias("IA__g_io_extension_point_get_required_type"), visibility("default"))); - -#undef g_io_extension_point_get_extensions -extern __typeof (g_io_extension_point_get_extensions) g_io_extension_point_get_extensions __attribute((alias("IA__g_io_extension_point_get_extensions"), visibility("default"))); - -#undef g_io_extension_point_get_extension_by_name -extern __typeof (g_io_extension_point_get_extension_by_name) g_io_extension_point_get_extension_by_name __attribute((alias("IA__g_io_extension_point_get_extension_by_name"), visibility("default"))); - -#undef g_io_extension_point_implement -extern __typeof (g_io_extension_point_implement) g_io_extension_point_implement __attribute((alias("IA__g_io_extension_point_implement"), visibility("default"))); - -#undef g_io_extension_get_type -extern __typeof (g_io_extension_get_type) g_io_extension_get_type __attribute((alias("IA__g_io_extension_get_type"), visibility("default"))); - -#undef g_io_extension_get_name -extern __typeof (g_io_extension_get_name) g_io_extension_get_name __attribute((alias("IA__g_io_extension_get_name"), visibility("default"))); - -#undef g_io_extension_get_priority -extern __typeof (g_io_extension_get_priority) g_io_extension_get_priority __attribute((alias("IA__g_io_extension_get_priority"), visibility("default"))); - -#undef g_io_extension_ref_class -extern __typeof (g_io_extension_ref_class) g_io_extension_ref_class __attribute((alias("IA__g_io_extension_ref_class"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_IO_SCHEDULER_H__) -#if IN_FILE(__G_IO_SCHEDULER_C__) -#undef g_io_scheduler_push_job -extern __typeof (g_io_scheduler_push_job) g_io_scheduler_push_job __attribute((alias("IA__g_io_scheduler_push_job"), visibility("default"))); - -#undef g_io_scheduler_cancel_all_jobs -extern __typeof (g_io_scheduler_cancel_all_jobs) g_io_scheduler_cancel_all_jobs __attribute((alias("IA__g_io_scheduler_cancel_all_jobs"), visibility("default"))); - -#undef g_io_scheduler_job_send_to_mainloop -extern __typeof (g_io_scheduler_job_send_to_mainloop) g_io_scheduler_job_send_to_mainloop __attribute((alias("IA__g_io_scheduler_job_send_to_mainloop"), visibility("default"))); - -#undef g_io_scheduler_job_send_to_mainloop_async -extern __typeof (g_io_scheduler_job_send_to_mainloop_async) g_io_scheduler_job_send_to_mainloop_async __attribute((alias("IA__g_io_scheduler_job_send_to_mainloop_async"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_LOADABLE_ICON_H__) -#if IN_FILE(__G_LOADABLE_ICON_C__) -#undef g_loadable_icon_get_type -extern __typeof (g_loadable_icon_get_type) g_loadable_icon_get_type __attribute((alias("IA__g_loadable_icon_get_type"), visibility("default"))); - -#undef g_loadable_icon_load -extern __typeof (g_loadable_icon_load) g_loadable_icon_load __attribute((alias("IA__g_loadable_icon_load"), visibility("default"))); - -#undef g_loadable_icon_load_async -extern __typeof (g_loadable_icon_load_async) g_loadable_icon_load_async __attribute((alias("IA__g_loadable_icon_load_async"), visibility("default"))); - -#undef g_loadable_icon_load_finish -extern __typeof (g_loadable_icon_load_finish) g_loadable_icon_load_finish __attribute((alias("IA__g_loadable_icon_load_finish"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_MEMORY_INPUT_STREAM_H__) -#if IN_FILE(__G_MEMORY_INPUT_STREAM_C__) -#undef g_memory_input_stream_get_type -extern __typeof (g_memory_input_stream_get_type) g_memory_input_stream_get_type __attribute((alias("IA__g_memory_input_stream_get_type"), visibility("default"))); - -#undef g_memory_input_stream_new -extern __typeof (g_memory_input_stream_new) g_memory_input_stream_new __attribute((alias("IA__g_memory_input_stream_new"), visibility("default"))); - -#undef g_memory_input_stream_new_from_data -extern __typeof (g_memory_input_stream_new_from_data) g_memory_input_stream_new_from_data __attribute((alias("IA__g_memory_input_stream_new_from_data"), visibility("default"))); - -#undef g_memory_input_stream_add_data -extern __typeof (g_memory_input_stream_add_data) g_memory_input_stream_add_data __attribute((alias("IA__g_memory_input_stream_add_data"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_MEMORY_OUTPUT_STREAM_H__) -#if IN_FILE(__G_MEMORY_OUTPUT_STREAM_C__) -#undef g_memory_output_stream_get_type -extern __typeof (g_memory_output_stream_get_type) g_memory_output_stream_get_type __attribute((alias("IA__g_memory_output_stream_get_type"), visibility("default"))); - -#undef g_memory_output_stream_new -extern __typeof (g_memory_output_stream_new) g_memory_output_stream_new __attribute((alias("IA__g_memory_output_stream_new"), visibility("default"))); - -#undef g_memory_output_stream_get_data -extern __typeof (g_memory_output_stream_get_data) g_memory_output_stream_get_data __attribute((alias("IA__g_memory_output_stream_get_data"), visibility("default"))); - -#undef g_memory_output_stream_get_data_size -extern __typeof (g_memory_output_stream_get_data_size) g_memory_output_stream_get_data_size __attribute((alias("IA__g_memory_output_stream_get_data_size"), visibility("default"))); - -#undef g_memory_output_stream_get_size -extern __typeof (g_memory_output_stream_get_size) g_memory_output_stream_get_size __attribute((alias("IA__g_memory_output_stream_get_size"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_MOUNT_OPERATION_H__) -#if IN_FILE(__G_MOUNT_OPERATION_C__) -#undef g_mount_operation_get_type -extern __typeof (g_mount_operation_get_type) g_mount_operation_get_type __attribute((alias("IA__g_mount_operation_get_type"), visibility("default"))); - -#undef g_mount_operation_new -extern __typeof (g_mount_operation_new) g_mount_operation_new __attribute((alias("IA__g_mount_operation_new"), visibility("default"))); - -#undef g_mount_operation_get_username -extern __typeof (g_mount_operation_get_username) g_mount_operation_get_username __attribute((alias("IA__g_mount_operation_get_username"), visibility("default"))); - -#undef g_mount_operation_set_username -extern __typeof (g_mount_operation_set_username) g_mount_operation_set_username __attribute((alias("IA__g_mount_operation_set_username"), visibility("default"))); - -#undef g_mount_operation_get_password -extern __typeof (g_mount_operation_get_password) g_mount_operation_get_password __attribute((alias("IA__g_mount_operation_get_password"), visibility("default"))); - -#undef g_mount_operation_set_password -extern __typeof (g_mount_operation_set_password) g_mount_operation_set_password __attribute((alias("IA__g_mount_operation_set_password"), visibility("default"))); - -#undef g_mount_operation_get_anonymous -extern __typeof (g_mount_operation_get_anonymous) g_mount_operation_get_anonymous __attribute((alias("IA__g_mount_operation_get_anonymous"), visibility("default"))); - -#undef g_mount_operation_set_anonymous -extern __typeof (g_mount_operation_set_anonymous) g_mount_operation_set_anonymous __attribute((alias("IA__g_mount_operation_set_anonymous"), visibility("default"))); - -#undef g_mount_operation_get_domain -extern __typeof (g_mount_operation_get_domain) g_mount_operation_get_domain __attribute((alias("IA__g_mount_operation_get_domain"), visibility("default"))); - -#undef g_mount_operation_set_domain -extern __typeof (g_mount_operation_set_domain) g_mount_operation_set_domain __attribute((alias("IA__g_mount_operation_set_domain"), visibility("default"))); - -#undef g_mount_operation_get_password_save -extern __typeof (g_mount_operation_get_password_save) g_mount_operation_get_password_save __attribute((alias("IA__g_mount_operation_get_password_save"), visibility("default"))); - -#undef g_mount_operation_set_password_save -extern __typeof (g_mount_operation_set_password_save) g_mount_operation_set_password_save __attribute((alias("IA__g_mount_operation_set_password_save"), visibility("default"))); - -#undef g_mount_operation_get_choice -extern __typeof (g_mount_operation_get_choice) g_mount_operation_get_choice __attribute((alias("IA__g_mount_operation_get_choice"), visibility("default"))); - -#undef g_mount_operation_set_choice -extern __typeof (g_mount_operation_set_choice) g_mount_operation_set_choice __attribute((alias("IA__g_mount_operation_set_choice"), visibility("default"))); - -#undef g_mount_operation_reply -extern __typeof (g_mount_operation_reply) g_mount_operation_reply __attribute((alias("IA__g_mount_operation_reply"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_OUTPUT_STREAM_H__) -#if IN_FILE(__G_OUTPUT_STREAM_C__) -#undef g_output_stream_get_type -extern __typeof (g_output_stream_get_type) g_output_stream_get_type __attribute((alias("IA__g_output_stream_get_type"), visibility("default"))); - -#undef g_output_stream_write -extern __typeof (g_output_stream_write) g_output_stream_write __attribute((alias("IA__g_output_stream_write"), visibility("default"))); - -#undef g_output_stream_write_all -extern __typeof (g_output_stream_write_all) g_output_stream_write_all __attribute((alias("IA__g_output_stream_write_all"), visibility("default"))); - -#undef g_output_stream_splice -extern __typeof (g_output_stream_splice) g_output_stream_splice __attribute((alias("IA__g_output_stream_splice"), visibility("default"))); - -#undef g_output_stream_flush -extern __typeof (g_output_stream_flush) g_output_stream_flush __attribute((alias("IA__g_output_stream_flush"), visibility("default"))); - -#undef g_output_stream_close -extern __typeof (g_output_stream_close) g_output_stream_close __attribute((alias("IA__g_output_stream_close"), visibility("default"))); - -#undef g_output_stream_write_async -extern __typeof (g_output_stream_write_async) g_output_stream_write_async __attribute((alias("IA__g_output_stream_write_async"), visibility("default"))); - -#undef g_output_stream_write_finish -extern __typeof (g_output_stream_write_finish) g_output_stream_write_finish __attribute((alias("IA__g_output_stream_write_finish"), visibility("default"))); - -#undef g_output_stream_splice_async -extern __typeof (g_output_stream_splice_async) g_output_stream_splice_async __attribute((alias("IA__g_output_stream_splice_async"), visibility("default"))); - -#undef g_output_stream_splice_finish -extern __typeof (g_output_stream_splice_finish) g_output_stream_splice_finish __attribute((alias("IA__g_output_stream_splice_finish"), visibility("default"))); - -#undef g_output_stream_flush_async -extern __typeof (g_output_stream_flush_async) g_output_stream_flush_async __attribute((alias("IA__g_output_stream_flush_async"), visibility("default"))); - -#undef g_output_stream_flush_finish -extern __typeof (g_output_stream_flush_finish) g_output_stream_flush_finish __attribute((alias("IA__g_output_stream_flush_finish"), visibility("default"))); - -#undef g_output_stream_close_async -extern __typeof (g_output_stream_close_async) g_output_stream_close_async __attribute((alias("IA__g_output_stream_close_async"), visibility("default"))); - -#undef g_output_stream_close_finish -extern __typeof (g_output_stream_close_finish) g_output_stream_close_finish __attribute((alias("IA__g_output_stream_close_finish"), visibility("default"))); - -#undef g_output_stream_is_closed -extern __typeof (g_output_stream_is_closed) g_output_stream_is_closed __attribute((alias("IA__g_output_stream_is_closed"), visibility("default"))); - -#undef g_output_stream_is_closing -extern __typeof (g_output_stream_is_closing) g_output_stream_is_closing __attribute((alias("IA__g_output_stream_is_closing"), visibility("default"))); - -#undef g_output_stream_has_pending -extern __typeof (g_output_stream_has_pending) g_output_stream_has_pending __attribute((alias("IA__g_output_stream_has_pending"), visibility("default"))); - -#undef g_output_stream_set_pending -extern __typeof (g_output_stream_set_pending) g_output_stream_set_pending __attribute((alias("IA__g_output_stream_set_pending"), visibility("default"))); - -#undef g_output_stream_clear_pending -extern __typeof (g_output_stream_clear_pending) g_output_stream_clear_pending __attribute((alias("IA__g_output_stream_clear_pending"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SEEKABLE_H__) -#if IN_FILE(__G_SEEKABLE_C__) -#undef g_seekable_get_type -extern __typeof (g_seekable_get_type) g_seekable_get_type __attribute((alias("IA__g_seekable_get_type"), visibility("default"))); - -#undef g_seekable_tell -extern __typeof (g_seekable_tell) g_seekable_tell __attribute((alias("IA__g_seekable_tell"), visibility("default"))); - -#undef g_seekable_can_seek -extern __typeof (g_seekable_can_seek) g_seekable_can_seek __attribute((alias("IA__g_seekable_can_seek"), visibility("default"))); - -#undef g_seekable_seek -extern __typeof (g_seekable_seek) g_seekable_seek __attribute((alias("IA__g_seekable_seek"), visibility("default"))); - -#undef g_seekable_can_truncate -extern __typeof (g_seekable_can_truncate) g_seekable_can_truncate __attribute((alias("IA__g_seekable_can_truncate"), visibility("default"))); - -#undef g_seekable_truncate -extern __typeof (g_seekable_truncate) g_seekable_truncate __attribute((alias("IA__g_seekable_truncate"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SIMPLE_ASYNC_RESULT_H__) -#if IN_FILE(__G_SIMPLE_ASYNC_RESULT_C__) -#undef g_simple_async_result_get_type -extern __typeof (g_simple_async_result_get_type) g_simple_async_result_get_type __attribute((alias("IA__g_simple_async_result_get_type"), visibility("default"))); - -#undef g_simple_async_result_new -extern __typeof (g_simple_async_result_new) g_simple_async_result_new __attribute((alias("IA__g_simple_async_result_new"), visibility("default"))); - -#undef g_simple_async_result_new_error -extern __typeof (g_simple_async_result_new_error) g_simple_async_result_new_error __attribute((alias("IA__g_simple_async_result_new_error"), visibility("default"))); - -#undef g_simple_async_result_new_from_error -extern __typeof (g_simple_async_result_new_from_error) g_simple_async_result_new_from_error __attribute((alias("IA__g_simple_async_result_new_from_error"), visibility("default"))); - -#undef g_simple_async_result_set_op_res_gpointer -extern __typeof (g_simple_async_result_set_op_res_gpointer) g_simple_async_result_set_op_res_gpointer __attribute((alias("IA__g_simple_async_result_set_op_res_gpointer"), visibility("default"))); - -#undef g_simple_async_result_get_op_res_gpointer -extern __typeof (g_simple_async_result_get_op_res_gpointer) g_simple_async_result_get_op_res_gpointer __attribute((alias("IA__g_simple_async_result_get_op_res_gpointer"), visibility("default"))); - -#undef g_simple_async_result_set_op_res_gssize -extern __typeof (g_simple_async_result_set_op_res_gssize) g_simple_async_result_set_op_res_gssize __attribute((alias("IA__g_simple_async_result_set_op_res_gssize"), visibility("default"))); - -#undef g_simple_async_result_get_op_res_gssize -extern __typeof (g_simple_async_result_get_op_res_gssize) g_simple_async_result_get_op_res_gssize __attribute((alias("IA__g_simple_async_result_get_op_res_gssize"), visibility("default"))); - -#undef g_simple_async_result_set_op_res_gboolean -extern __typeof (g_simple_async_result_set_op_res_gboolean) g_simple_async_result_set_op_res_gboolean __attribute((alias("IA__g_simple_async_result_set_op_res_gboolean"), visibility("default"))); - -#undef g_simple_async_result_get_op_res_gboolean -extern __typeof (g_simple_async_result_get_op_res_gboolean) g_simple_async_result_get_op_res_gboolean __attribute((alias("IA__g_simple_async_result_get_op_res_gboolean"), visibility("default"))); - -#undef g_simple_async_result_get_source_tag -extern __typeof (g_simple_async_result_get_source_tag) g_simple_async_result_get_source_tag __attribute((alias("IA__g_simple_async_result_get_source_tag"), visibility("default"))); - -#undef g_simple_async_result_set_handle_cancellation -extern __typeof (g_simple_async_result_set_handle_cancellation) g_simple_async_result_set_handle_cancellation __attribute((alias("IA__g_simple_async_result_set_handle_cancellation"), visibility("default"))); - -#undef g_simple_async_result_complete -extern __typeof (g_simple_async_result_complete) g_simple_async_result_complete __attribute((alias("IA__g_simple_async_result_complete"), visibility("default"))); - -#undef g_simple_async_result_complete_in_idle -extern __typeof (g_simple_async_result_complete_in_idle) g_simple_async_result_complete_in_idle __attribute((alias("IA__g_simple_async_result_complete_in_idle"), visibility("default"))); - -#undef g_simple_async_result_run_in_thread -extern __typeof (g_simple_async_result_run_in_thread) g_simple_async_result_run_in_thread __attribute((alias("IA__g_simple_async_result_run_in_thread"), visibility("default"))); - -#undef g_simple_async_result_set_from_error -extern __typeof (g_simple_async_result_set_from_error) g_simple_async_result_set_from_error __attribute((alias("IA__g_simple_async_result_set_from_error"), visibility("default"))); - -#undef g_simple_async_result_propagate_error -extern __typeof (g_simple_async_result_propagate_error) g_simple_async_result_propagate_error __attribute((alias("IA__g_simple_async_result_propagate_error"), visibility("default"))); - -#undef g_simple_async_result_set_error -extern __typeof (g_simple_async_result_set_error) g_simple_async_result_set_error __attribute((alias("IA__g_simple_async_result_set_error"), visibility("default"))); - -#undef g_simple_async_result_set_error_va -extern __typeof (g_simple_async_result_set_error_va) g_simple_async_result_set_error_va __attribute((alias("IA__g_simple_async_result_set_error_va"), visibility("default"))); - -#undef g_simple_async_result_is_valid -extern __typeof (g_simple_async_result_is_valid) g_simple_async_result_is_valid __attribute((alias("IA__g_simple_async_result_is_valid"), visibility("default"))); - -#undef g_simple_async_report_error_in_idle -extern __typeof (g_simple_async_report_error_in_idle) g_simple_async_report_error_in_idle __attribute((alias("IA__g_simple_async_report_error_in_idle"), visibility("default"))); - -#undef g_simple_async_report_gerror_in_idle -extern __typeof (g_simple_async_report_gerror_in_idle) g_simple_async_report_gerror_in_idle __attribute((alias("IA__g_simple_async_report_gerror_in_idle"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_THEMED_ICON_H__) -#if IN_FILE(__G_THEMED_ICON_C__) -#undef g_themed_icon_get_type -extern __typeof (g_themed_icon_get_type) g_themed_icon_get_type __attribute((alias("IA__g_themed_icon_get_type"), visibility("default"))); - -#undef g_themed_icon_new -extern __typeof (g_themed_icon_new) g_themed_icon_new __attribute((alias("IA__g_themed_icon_new"), visibility("default"))); - -#undef g_themed_icon_new_with_default_fallbacks -extern __typeof (g_themed_icon_new_with_default_fallbacks) g_themed_icon_new_with_default_fallbacks __attribute((alias("IA__g_themed_icon_new_with_default_fallbacks"), visibility("default"))); - -#undef g_themed_icon_new_from_names -extern __typeof (g_themed_icon_new_from_names) g_themed_icon_new_from_names __attribute((alias("IA__g_themed_icon_new_from_names"), visibility("default"))); - -#undef g_themed_icon_get_names -extern __typeof (g_themed_icon_get_names) g_themed_icon_get_names __attribute((alias("IA__g_themed_icon_get_names"), visibility("default"))); - -#undef g_themed_icon_prepend_name -extern __typeof (g_themed_icon_prepend_name) g_themed_icon_prepend_name __attribute((alias("IA__g_themed_icon_prepend_name"), visibility("default"))); - -#undef g_themed_icon_append_name -extern __typeof (g_themed_icon_append_name) g_themed_icon_append_name __attribute((alias("IA__g_themed_icon_append_name"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNIX_MOUNTS_H__) -#if IN_FILE(__G_UNIX_MOUNTS_C__) -#ifdef G_OS_UNIX -#undef g_unix_mount_free -extern __typeof (g_unix_mount_free) g_unix_mount_free __attribute((alias("IA__g_unix_mount_free"), visibility("default"))); - -#undef g_unix_mount_point_free -extern __typeof (g_unix_mount_point_free) g_unix_mount_point_free __attribute((alias("IA__g_unix_mount_point_free"), visibility("default"))); - -#undef g_unix_mount_compare -extern __typeof (g_unix_mount_compare) g_unix_mount_compare __attribute((alias("IA__g_unix_mount_compare"), visibility("default"))); - -#undef g_unix_mount_get_mount_path -extern __typeof (g_unix_mount_get_mount_path) g_unix_mount_get_mount_path __attribute((alias("IA__g_unix_mount_get_mount_path"), visibility("default"))); - -#undef g_unix_mount_get_device_path -extern __typeof (g_unix_mount_get_device_path) g_unix_mount_get_device_path __attribute((alias("IA__g_unix_mount_get_device_path"), visibility("default"))); - -#undef g_unix_mount_get_fs_type -extern __typeof (g_unix_mount_get_fs_type) g_unix_mount_get_fs_type __attribute((alias("IA__g_unix_mount_get_fs_type"), visibility("default"))); - -#undef g_unix_mount_is_readonly -extern __typeof (g_unix_mount_is_readonly) g_unix_mount_is_readonly __attribute((alias("IA__g_unix_mount_is_readonly"), visibility("default"))); - -#undef g_unix_mount_is_system_internal -extern __typeof (g_unix_mount_is_system_internal) g_unix_mount_is_system_internal __attribute((alias("IA__g_unix_mount_is_system_internal"), visibility("default"))); - -#undef g_unix_mount_guess_can_eject -extern __typeof (g_unix_mount_guess_can_eject) g_unix_mount_guess_can_eject __attribute((alias("IA__g_unix_mount_guess_can_eject"), visibility("default"))); - -#undef g_unix_mount_guess_should_display -extern __typeof (g_unix_mount_guess_should_display) g_unix_mount_guess_should_display __attribute((alias("IA__g_unix_mount_guess_should_display"), visibility("default"))); - -#undef g_unix_mount_guess_name -extern __typeof (g_unix_mount_guess_name) g_unix_mount_guess_name __attribute((alias("IA__g_unix_mount_guess_name"), visibility("default"))); - -#undef g_unix_mount_guess_icon -extern __typeof (g_unix_mount_guess_icon) g_unix_mount_guess_icon __attribute((alias("IA__g_unix_mount_guess_icon"), visibility("default"))); - -#undef g_unix_mount_point_compare -extern __typeof (g_unix_mount_point_compare) g_unix_mount_point_compare __attribute((alias("IA__g_unix_mount_point_compare"), visibility("default"))); - -#undef g_unix_mount_point_get_mount_path -extern __typeof (g_unix_mount_point_get_mount_path) g_unix_mount_point_get_mount_path __attribute((alias("IA__g_unix_mount_point_get_mount_path"), visibility("default"))); - -#undef g_unix_mount_point_get_device_path -extern __typeof (g_unix_mount_point_get_device_path) g_unix_mount_point_get_device_path __attribute((alias("IA__g_unix_mount_point_get_device_path"), visibility("default"))); - -#undef g_unix_mount_point_get_fs_type -extern __typeof (g_unix_mount_point_get_fs_type) g_unix_mount_point_get_fs_type __attribute((alias("IA__g_unix_mount_point_get_fs_type"), visibility("default"))); - -#undef g_unix_mount_point_is_readonly -extern __typeof (g_unix_mount_point_is_readonly) g_unix_mount_point_is_readonly __attribute((alias("IA__g_unix_mount_point_is_readonly"), visibility("default"))); - -#undef g_unix_mount_point_is_user_mountable -extern __typeof (g_unix_mount_point_is_user_mountable) g_unix_mount_point_is_user_mountable __attribute((alias("IA__g_unix_mount_point_is_user_mountable"), visibility("default"))); - -#undef g_unix_mount_point_is_loopback -extern __typeof (g_unix_mount_point_is_loopback) g_unix_mount_point_is_loopback __attribute((alias("IA__g_unix_mount_point_is_loopback"), visibility("default"))); - -#undef g_unix_mount_point_guess_can_eject -extern __typeof (g_unix_mount_point_guess_can_eject) g_unix_mount_point_guess_can_eject __attribute((alias("IA__g_unix_mount_point_guess_can_eject"), visibility("default"))); - -#undef g_unix_mount_point_guess_name -extern __typeof (g_unix_mount_point_guess_name) g_unix_mount_point_guess_name __attribute((alias("IA__g_unix_mount_point_guess_name"), visibility("default"))); - -#undef g_unix_mount_point_guess_icon -extern __typeof (g_unix_mount_point_guess_icon) g_unix_mount_point_guess_icon __attribute((alias("IA__g_unix_mount_point_guess_icon"), visibility("default"))); - -#undef g_unix_mount_points_get -extern __typeof (g_unix_mount_points_get) g_unix_mount_points_get __attribute((alias("IA__g_unix_mount_points_get"), visibility("default"))); - -#undef g_unix_mounts_get -extern __typeof (g_unix_mounts_get) g_unix_mounts_get __attribute((alias("IA__g_unix_mounts_get"), visibility("default"))); - -#undef g_unix_mount_at -extern __typeof (g_unix_mount_at) g_unix_mount_at __attribute((alias("IA__g_unix_mount_at"), visibility("default"))); - -#undef g_unix_mounts_changed_since -extern __typeof (g_unix_mounts_changed_since) g_unix_mounts_changed_since __attribute((alias("IA__g_unix_mounts_changed_since"), visibility("default"))); - -#undef g_unix_mount_points_changed_since -extern __typeof (g_unix_mount_points_changed_since) g_unix_mount_points_changed_since __attribute((alias("IA__g_unix_mount_points_changed_since"), visibility("default"))); - -#undef g_unix_mount_monitor_get_type -extern __typeof (g_unix_mount_monitor_get_type) g_unix_mount_monitor_get_type __attribute((alias("IA__g_unix_mount_monitor_get_type"), visibility("default"))); - -#undef g_unix_mount_monitor_new -extern __typeof (g_unix_mount_monitor_new) g_unix_mount_monitor_new __attribute((alias("IA__g_unix_mount_monitor_new"), visibility("default"))); - -#undef g_unix_mount_monitor_set_rate_limit -extern __typeof (g_unix_mount_monitor_set_rate_limit) g_unix_mount_monitor_set_rate_limit __attribute((alias("IA__g_unix_mount_monitor_set_rate_limit"), visibility("default"))); - -#undef g_unix_is_mount_path_system_internal -extern __typeof (g_unix_is_mount_path_system_internal) g_unix_is_mount_path_system_internal __attribute((alias("IA__g_unix_is_mount_path_system_internal"), visibility("default"))); - -#endif /* G_OS_UNIX */ -#endif -#endif -#if IN_HEADER(__G_UNIX_INPUT_STREAM_H__) -#if IN_FILE(__G_UNIX_INPUT_STREAM_C__) -#ifdef G_OS_UNIX -#undef g_unix_input_stream_get_type -extern __typeof (g_unix_input_stream_get_type) g_unix_input_stream_get_type __attribute((alias("IA__g_unix_input_stream_get_type"), visibility("default"))); - -#undef g_unix_input_stream_new -extern __typeof (g_unix_input_stream_new) g_unix_input_stream_new __attribute((alias("IA__g_unix_input_stream_new"), visibility("default"))); - -#undef g_unix_input_stream_set_close_fd -extern __typeof (g_unix_input_stream_set_close_fd) g_unix_input_stream_set_close_fd __attribute((alias("IA__g_unix_input_stream_set_close_fd"), visibility("default"))); - -#undef g_unix_input_stream_get_close_fd -extern __typeof (g_unix_input_stream_get_close_fd) g_unix_input_stream_get_close_fd __attribute((alias("IA__g_unix_input_stream_get_close_fd"), visibility("default"))); - -#undef g_unix_input_stream_get_fd -extern __typeof (g_unix_input_stream_get_fd) g_unix_input_stream_get_fd __attribute((alias("IA__g_unix_input_stream_get_fd"), visibility("default"))); - -#endif /* G_OS_UNIX */ -#endif -#endif -#if IN_HEADER(__G_UNIX_OUTPUT_STREAM_H__) -#if IN_FILE(__G_UNIX_OUTPUT_STREAM_C__) -#ifdef G_OS_UNIX -#undef g_unix_output_stream_get_type -extern __typeof (g_unix_output_stream_get_type) g_unix_output_stream_get_type __attribute((alias("IA__g_unix_output_stream_get_type"), visibility("default"))); - -#undef g_unix_output_stream_new -extern __typeof (g_unix_output_stream_new) g_unix_output_stream_new __attribute((alias("IA__g_unix_output_stream_new"), visibility("default"))); - -#undef g_unix_output_stream_set_close_fd -extern __typeof (g_unix_output_stream_set_close_fd) g_unix_output_stream_set_close_fd __attribute((alias("IA__g_unix_output_stream_set_close_fd"), visibility("default"))); - -#undef g_unix_output_stream_get_close_fd -extern __typeof (g_unix_output_stream_get_close_fd) g_unix_output_stream_get_close_fd __attribute((alias("IA__g_unix_output_stream_get_close_fd"), visibility("default"))); - -#undef g_unix_output_stream_get_fd -extern __typeof (g_unix_output_stream_get_fd) g_unix_output_stream_get_fd __attribute((alias("IA__g_unix_output_stream_get_fd"), visibility("default"))); - -#endif /* G_OS_UNIX */ -#endif -#endif -#if IN_HEADER(__G_MOUNT_H__) -#if IN_FILE(__G_MOUNT_C__) -#undef g_mount_get_type -extern __typeof (g_mount_get_type) g_mount_get_type __attribute((alias("IA__g_mount_get_type"), visibility("default"))); - -#undef g_mount_get_root -extern __typeof (g_mount_get_root) g_mount_get_root __attribute((alias("IA__g_mount_get_root"), visibility("default"))); - -#undef g_mount_get_name -extern __typeof (g_mount_get_name) g_mount_get_name __attribute((alias("IA__g_mount_get_name"), visibility("default"))); - -#undef g_mount_get_icon -extern __typeof (g_mount_get_icon) g_mount_get_icon __attribute((alias("IA__g_mount_get_icon"), visibility("default"))); - -#undef g_mount_get_uuid -extern __typeof (g_mount_get_uuid) g_mount_get_uuid __attribute((alias("IA__g_mount_get_uuid"), visibility("default"))); - -#undef g_mount_get_volume -extern __typeof (g_mount_get_volume) g_mount_get_volume __attribute((alias("IA__g_mount_get_volume"), visibility("default"))); - -#undef g_mount_get_drive -extern __typeof (g_mount_get_drive) g_mount_get_drive __attribute((alias("IA__g_mount_get_drive"), visibility("default"))); - -#undef g_mount_can_unmount -extern __typeof (g_mount_can_unmount) g_mount_can_unmount __attribute((alias("IA__g_mount_can_unmount"), visibility("default"))); - -#undef g_mount_can_eject -extern __typeof (g_mount_can_eject) g_mount_can_eject __attribute((alias("IA__g_mount_can_eject"), visibility("default"))); - -#undef g_mount_unmount_with_operation -extern __typeof (g_mount_unmount_with_operation) g_mount_unmount_with_operation __attribute((alias("IA__g_mount_unmount_with_operation"), visibility("default"))); - -#undef g_mount_unmount_with_operation_finish -extern __typeof (g_mount_unmount_with_operation_finish) g_mount_unmount_with_operation_finish __attribute((alias("IA__g_mount_unmount_with_operation_finish"), visibility("default"))); - -#undef g_mount_eject_with_operation -extern __typeof (g_mount_eject_with_operation) g_mount_eject_with_operation __attribute((alias("IA__g_mount_eject_with_operation"), visibility("default"))); - -#undef g_mount_eject_with_operation_finish -extern __typeof (g_mount_eject_with_operation_finish) g_mount_eject_with_operation_finish __attribute((alias("IA__g_mount_eject_with_operation_finish"), visibility("default"))); - -#undef g_mount_get_default_location -extern __typeof (g_mount_get_default_location) g_mount_get_default_location __attribute((alias("IA__g_mount_get_default_location"), visibility("default"))); - -#undef g_mount_remount -extern __typeof (g_mount_remount) g_mount_remount __attribute((alias("IA__g_mount_remount"), visibility("default"))); - -#undef g_mount_remount_finish -extern __typeof (g_mount_remount_finish) g_mount_remount_finish __attribute((alias("IA__g_mount_remount_finish"), visibility("default"))); - -#undef g_mount_guess_content_type -extern __typeof (g_mount_guess_content_type) g_mount_guess_content_type __attribute((alias("IA__g_mount_guess_content_type"), visibility("default"))); - -#undef g_mount_guess_content_type_finish -extern __typeof (g_mount_guess_content_type_finish) g_mount_guess_content_type_finish __attribute((alias("IA__g_mount_guess_content_type_finish"), visibility("default"))); - -#undef g_mount_guess_content_type_sync -extern __typeof (g_mount_guess_content_type_sync) g_mount_guess_content_type_sync __attribute((alias("IA__g_mount_guess_content_type_sync"), visibility("default"))); - -#undef g_mount_is_shadowed -extern __typeof (g_mount_is_shadowed) g_mount_is_shadowed __attribute((alias("IA__g_mount_is_shadowed"), visibility("default"))); - -#undef g_mount_shadow -extern __typeof (g_mount_shadow) g_mount_shadow __attribute((alias("IA__g_mount_shadow"), visibility("default"))); - -#undef g_mount_unshadow -extern __typeof (g_mount_unshadow) g_mount_unshadow __attribute((alias("IA__g_mount_unshadow"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_mount_unmount -extern __typeof (g_mount_unmount) g_mount_unmount __attribute((alias("IA__g_mount_unmount"), visibility("default"))); - -#undef g_mount_unmount_finish -extern __typeof (g_mount_unmount_finish) g_mount_unmount_finish __attribute((alias("IA__g_mount_unmount_finish"), visibility("default"))); - -#undef g_mount_eject -extern __typeof (g_mount_eject) g_mount_eject __attribute((alias("IA__g_mount_eject"), visibility("default"))); - -#undef g_mount_eject_finish -extern __typeof (g_mount_eject_finish) g_mount_eject_finish __attribute((alias("IA__g_mount_eject_finish"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_VOLUME_H__) -#if IN_FILE(__G_VOLUME_C__) -#undef g_volume_get_type -extern __typeof (g_volume_get_type) g_volume_get_type __attribute((alias("IA__g_volume_get_type"), visibility("default"))); - -#undef g_volume_get_name -extern __typeof (g_volume_get_name) g_volume_get_name __attribute((alias("IA__g_volume_get_name"), visibility("default"))); - -#undef g_volume_get_icon -extern __typeof (g_volume_get_icon) g_volume_get_icon __attribute((alias("IA__g_volume_get_icon"), visibility("default"))); - -#undef g_volume_get_uuid -extern __typeof (g_volume_get_uuid) g_volume_get_uuid __attribute((alias("IA__g_volume_get_uuid"), visibility("default"))); - -#undef g_volume_get_drive -extern __typeof (g_volume_get_drive) g_volume_get_drive __attribute((alias("IA__g_volume_get_drive"), visibility("default"))); - -#undef g_volume_get_mount -extern __typeof (g_volume_get_mount) g_volume_get_mount __attribute((alias("IA__g_volume_get_mount"), visibility("default"))); - -#undef g_volume_should_automount -extern __typeof (g_volume_should_automount) g_volume_should_automount __attribute((alias("IA__g_volume_should_automount"), visibility("default"))); - -#undef g_volume_can_mount -extern __typeof (g_volume_can_mount) g_volume_can_mount __attribute((alias("IA__g_volume_can_mount"), visibility("default"))); - -#undef g_volume_can_eject -extern __typeof (g_volume_can_eject) g_volume_can_eject __attribute((alias("IA__g_volume_can_eject"), visibility("default"))); - -#undef g_volume_mount -extern __typeof (g_volume_mount) g_volume_mount __attribute((alias("IA__g_volume_mount"), visibility("default"))); - -#undef g_volume_mount_finish -extern __typeof (g_volume_mount_finish) g_volume_mount_finish __attribute((alias("IA__g_volume_mount_finish"), visibility("default"))); - -#undef g_volume_eject_with_operation -extern __typeof (g_volume_eject_with_operation) g_volume_eject_with_operation __attribute((alias("IA__g_volume_eject_with_operation"), visibility("default"))); - -#undef g_volume_eject_with_operation_finish -extern __typeof (g_volume_eject_with_operation_finish) g_volume_eject_with_operation_finish __attribute((alias("IA__g_volume_eject_with_operation_finish"), visibility("default"))); - -#undef g_volume_get_identifier -extern __typeof (g_volume_get_identifier) g_volume_get_identifier __attribute((alias("IA__g_volume_get_identifier"), visibility("default"))); - -#undef g_volume_enumerate_identifiers -extern __typeof (g_volume_enumerate_identifiers) g_volume_enumerate_identifiers __attribute((alias("IA__g_volume_enumerate_identifiers"), visibility("default"))); - -#undef g_volume_get_activation_root -extern __typeof (g_volume_get_activation_root) g_volume_get_activation_root __attribute((alias("IA__g_volume_get_activation_root"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_volume_eject -extern __typeof (g_volume_eject) g_volume_eject __attribute((alias("IA__g_volume_eject"), visibility("default"))); - -#undef g_volume_eject_finish -extern __typeof (g_volume_eject_finish) g_volume_eject_finish __attribute((alias("IA__g_volume_eject_finish"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_VOLUME_MONITOR_H__) -#if IN_FILE(__G_VOLUME_MONITOR_C__) -#undef g_volume_monitor_get_type -extern __typeof (g_volume_monitor_get_type) g_volume_monitor_get_type __attribute((alias("IA__g_volume_monitor_get_type"), visibility("default"))); - -#undef g_volume_monitor_get_connected_drives -extern __typeof (g_volume_monitor_get_connected_drives) g_volume_monitor_get_connected_drives __attribute((alias("IA__g_volume_monitor_get_connected_drives"), visibility("default"))); - -#undef g_volume_monitor_get_volume_for_uuid -extern __typeof (g_volume_monitor_get_volume_for_uuid) g_volume_monitor_get_volume_for_uuid __attribute((alias("IA__g_volume_monitor_get_volume_for_uuid"), visibility("default"))); - -#undef g_volume_monitor_get_volumes -extern __typeof (g_volume_monitor_get_volumes) g_volume_monitor_get_volumes __attribute((alias("IA__g_volume_monitor_get_volumes"), visibility("default"))); - -#undef g_volume_monitor_get_mounts -extern __typeof (g_volume_monitor_get_mounts) g_volume_monitor_get_mounts __attribute((alias("IA__g_volume_monitor_get_mounts"), visibility("default"))); - -#undef g_volume_monitor_get_mount_for_uuid -extern __typeof (g_volume_monitor_get_mount_for_uuid) g_volume_monitor_get_mount_for_uuid __attribute((alias("IA__g_volume_monitor_get_mount_for_uuid"), visibility("default"))); - -#endif -#if IN_FILE(__G_UNION_VOLUME_MONITOR_C__) -#undef g_volume_monitor_get -extern __typeof (g_volume_monitor_get) g_volume_monitor_get __attribute((alias("IA__g_volume_monitor_get"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_volume_monitor_adopt_orphan_mount -extern __typeof (g_volume_monitor_adopt_orphan_mount) g_volume_monitor_adopt_orphan_mount __attribute((alias("IA__g_volume_monitor_adopt_orphan_mount"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_NATIVE_VOLUME_MONITOR_H__) -#if IN_FILE(__G_NATIVE_VOLUME_MONITOR_C__) -#undef g_native_volume_monitor_get_type -extern __typeof (g_native_volume_monitor_get_type) g_native_volume_monitor_get_type __attribute((alias("IA__g_native_volume_monitor_get_type"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_LOCAL_FILE_MONITOR_H__) -#if IN_FILE(__G_LOCAL_FILE_MONITOR_C__) -#ifdef G_OS_UNIX -#undef g_local_file_monitor_get_type -extern __typeof (g_local_file_monitor_get_type) g_local_file_monitor_get_type __attribute((alias("IA__g_local_file_monitor_get_type"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_LOCAL_DIRECTORY_MONITOR_H__) -#if IN_FILE(__G_LOCAL_DIRECTORY_MONITOR_C__) -#ifdef G_OS_UNIX -#undef g_local_directory_monitor_get_type -extern __typeof (g_local_directory_monitor_get_type) g_local_directory_monitor_get_type __attribute((alias("IA__g_local_directory_monitor_get_type"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__GIO_ENUM_TYPES_H__) -#if IN_FILE(__GIO_ENUM_TYPES_C__) -#undef g_mount_unmount_flags_get_type -extern __typeof (g_mount_unmount_flags_get_type) g_mount_unmount_flags_get_type __attribute((alias("IA__g_mount_unmount_flags_get_type"), visibility("default"))); - -#undef g_app_info_create_flags_get_type -extern __typeof (g_app_info_create_flags_get_type) g_app_info_create_flags_get_type __attribute((alias("IA__g_app_info_create_flags_get_type"), visibility("default"))); - -#undef g_converter_flags_get_type -extern __typeof (g_converter_flags_get_type) g_converter_flags_get_type __attribute((alias("IA__g_converter_flags_get_type"), visibility("default"))); - -#undef g_converter_result_get_type -extern __typeof (g_converter_result_get_type) g_converter_result_get_type __attribute((alias("IA__g_converter_result_get_type"), visibility("default"))); - -#undef g_data_stream_byte_order_get_type -extern __typeof (g_data_stream_byte_order_get_type) g_data_stream_byte_order_get_type __attribute((alias("IA__g_data_stream_byte_order_get_type"), visibility("default"))); - -#undef g_data_stream_newline_type_get_type -extern __typeof (g_data_stream_newline_type_get_type) g_data_stream_newline_type_get_type __attribute((alias("IA__g_data_stream_newline_type_get_type"), visibility("default"))); - -#undef g_file_attribute_info_flags_get_type -extern __typeof (g_file_attribute_info_flags_get_type) g_file_attribute_info_flags_get_type __attribute((alias("IA__g_file_attribute_info_flags_get_type"), visibility("default"))); - -#undef g_file_attribute_status_get_type -extern __typeof (g_file_attribute_status_get_type) g_file_attribute_status_get_type __attribute((alias("IA__g_file_attribute_status_get_type"), visibility("default"))); - -#undef g_file_attribute_type_get_type -extern __typeof (g_file_attribute_type_get_type) g_file_attribute_type_get_type __attribute((alias("IA__g_file_attribute_type_get_type"), visibility("default"))); - -#undef g_file_copy_flags_get_type -extern __typeof (g_file_copy_flags_get_type) g_file_copy_flags_get_type __attribute((alias("IA__g_file_copy_flags_get_type"), visibility("default"))); - -#undef g_file_create_flags_get_type -extern __typeof (g_file_create_flags_get_type) g_file_create_flags_get_type __attribute((alias("IA__g_file_create_flags_get_type"), visibility("default"))); - -#undef g_file_monitor_event_get_type -extern __typeof (g_file_monitor_event_get_type) g_file_monitor_event_get_type __attribute((alias("IA__g_file_monitor_event_get_type"), visibility("default"))); - -#undef g_file_monitor_flags_get_type -extern __typeof (g_file_monitor_flags_get_type) g_file_monitor_flags_get_type __attribute((alias("IA__g_file_monitor_flags_get_type"), visibility("default"))); - -#undef g_file_query_info_flags_get_type -extern __typeof (g_file_query_info_flags_get_type) g_file_query_info_flags_get_type __attribute((alias("IA__g_file_query_info_flags_get_type"), visibility("default"))); - -#undef g_file_type_get_type -extern __typeof (g_file_type_get_type) g_file_type_get_type __attribute((alias("IA__g_file_type_get_type"), visibility("default"))); - -#undef g_filesystem_preview_type_get_type -extern __typeof (g_filesystem_preview_type_get_type) g_filesystem_preview_type_get_type __attribute((alias("IA__g_filesystem_preview_type_get_type"), visibility("default"))); - -#undef g_io_error_enum_get_type -extern __typeof (g_io_error_enum_get_type) g_io_error_enum_get_type __attribute((alias("IA__g_io_error_enum_get_type"), visibility("default"))); - -#undef g_mount_mount_flags_get_type -extern __typeof (g_mount_mount_flags_get_type) g_mount_mount_flags_get_type __attribute((alias("IA__g_mount_mount_flags_get_type"), visibility("default"))); - -#undef g_mount_operation_result_get_type -extern __typeof (g_mount_operation_result_get_type) g_mount_operation_result_get_type __attribute((alias("IA__g_mount_operation_result_get_type"), visibility("default"))); - -#undef g_drive_start_flags_get_type -extern __typeof (g_drive_start_flags_get_type) g_drive_start_flags_get_type __attribute((alias("IA__g_drive_start_flags_get_type"), visibility("default"))); - -#undef g_drive_start_stop_type_get_type -extern __typeof (g_drive_start_stop_type_get_type) g_drive_start_stop_type_get_type __attribute((alias("IA__g_drive_start_stop_type_get_type"), visibility("default"))); - -#undef g_output_stream_splice_flags_get_type -extern __typeof (g_output_stream_splice_flags_get_type) g_output_stream_splice_flags_get_type __attribute((alias("IA__g_output_stream_splice_flags_get_type"), visibility("default"))); - -#undef g_ask_password_flags_get_type -extern __typeof (g_ask_password_flags_get_type) g_ask_password_flags_get_type __attribute((alias("IA__g_ask_password_flags_get_type"), visibility("default"))); - -#undef g_password_save_get_type -extern __typeof (g_password_save_get_type) g_password_save_get_type __attribute((alias("IA__g_password_save_get_type"), visibility("default"))); - -#undef g_emblem_origin_get_type -extern __typeof (g_emblem_origin_get_type) g_emblem_origin_get_type __attribute((alias("IA__g_emblem_origin_get_type"), visibility("default"))); - -#undef g_socket_family_get_type -extern __typeof (g_socket_family_get_type) g_socket_family_get_type __attribute((alias("IA__g_socket_family_get_type"), visibility("default"))); - -#undef g_socket_type_get_type -extern __typeof (g_socket_type_get_type) g_socket_type_get_type __attribute((alias("IA__g_socket_type_get_type"), visibility("default"))); - -#undef g_socket_protocol_get_type -extern __typeof (g_socket_protocol_get_type) g_socket_protocol_get_type __attribute((alias("IA__g_socket_protocol_get_type"), visibility("default"))); - -#undef g_socket_msg_flags_get_type -extern __typeof (g_socket_msg_flags_get_type) g_socket_msg_flags_get_type __attribute((alias("IA__g_socket_msg_flags_get_type"), visibility("default"))); - -#undef g_resolver_error_get_type -extern __typeof (g_resolver_error_get_type) g_resolver_error_get_type __attribute((alias("IA__g_resolver_error_get_type"), visibility("default"))); - -#undef g_zlib_compressor_format_get_type -extern __typeof (g_zlib_compressor_format_get_type) g_zlib_compressor_format_get_type __attribute((alias("IA__g_zlib_compressor_format_get_type"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_EMBLEMED_ICON_H__) -#if IN_FILE(__G_EMBLEMED_ICON_C__) -#undef g_emblemed_icon_get_type -extern __typeof (g_emblemed_icon_get_type) g_emblemed_icon_get_type __attribute((alias("IA__g_emblemed_icon_get_type"), visibility("default"))); - -#undef g_emblemed_icon_new -extern __typeof (g_emblemed_icon_new) g_emblemed_icon_new __attribute((alias("IA__g_emblemed_icon_new"), visibility("default"))); - -#undef g_emblemed_icon_get_icon -extern __typeof (g_emblemed_icon_get_icon) g_emblemed_icon_get_icon __attribute((alias("IA__g_emblemed_icon_get_icon"), visibility("default"))); - -#undef g_emblemed_icon_get_emblems -extern __typeof (g_emblemed_icon_get_emblems) g_emblemed_icon_get_emblems __attribute((alias("IA__g_emblemed_icon_get_emblems"), visibility("default"))); - -#undef g_emblemed_icon_add_emblem -extern __typeof (g_emblemed_icon_add_emblem) g_emblemed_icon_add_emblem __attribute((alias("IA__g_emblemed_icon_add_emblem"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_EMBLEM_H__) -#if IN_FILE(__G_EMBLEM_C__) -#undef g_emblem_get_type -extern __typeof (g_emblem_get_type) g_emblem_get_type __attribute((alias("IA__g_emblem_get_type"), visibility("default"))); - -#undef g_emblem_new -extern __typeof (g_emblem_new) g_emblem_new __attribute((alias("IA__g_emblem_new"), visibility("default"))); - -#undef g_emblem_new_with_origin -extern __typeof (g_emblem_new_with_origin) g_emblem_new_with_origin __attribute((alias("IA__g_emblem_new_with_origin"), visibility("default"))); - -#undef g_emblem_get_icon -extern __typeof (g_emblem_get_icon) g_emblem_get_icon __attribute((alias("IA__g_emblem_get_icon"), visibility("default"))); - -#undef g_emblem_get_origin -extern __typeof (g_emblem_get_origin) g_emblem_get_origin __attribute((alias("IA__g_emblem_get_origin"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_INET_ADDRESS_H__) -#if IN_FILE(__G_INET_ADDRESS_C__) -#undef g_inet_address_new_from_string -extern __typeof (g_inet_address_new_from_string) g_inet_address_new_from_string __attribute((alias("IA__g_inet_address_new_from_string"), visibility("default"))); - -#undef g_inet_address_new_from_bytes -extern __typeof (g_inet_address_new_from_bytes) g_inet_address_new_from_bytes __attribute((alias("IA__g_inet_address_new_from_bytes"), visibility("default"))); - -#undef g_inet_address_new_any -extern __typeof (g_inet_address_new_any) g_inet_address_new_any __attribute((alias("IA__g_inet_address_new_any"), visibility("default"))); - -#undef g_inet_address_new_loopback -extern __typeof (g_inet_address_new_loopback) g_inet_address_new_loopback __attribute((alias("IA__g_inet_address_new_loopback"), visibility("default"))); - -#undef g_inet_address_get_family -extern __typeof (g_inet_address_get_family) g_inet_address_get_family __attribute((alias("IA__g_inet_address_get_family"), visibility("default"))); - -#undef g_inet_address_get_type -extern __typeof (g_inet_address_get_type) g_inet_address_get_type __attribute((alias("IA__g_inet_address_get_type"), visibility("default"))); - -#undef g_inet_address_get_is_any -extern __typeof (g_inet_address_get_is_any) g_inet_address_get_is_any __attribute((alias("IA__g_inet_address_get_is_any"), visibility("default"))); - -#undef g_inet_address_get_is_link_local -extern __typeof (g_inet_address_get_is_link_local) g_inet_address_get_is_link_local __attribute((alias("IA__g_inet_address_get_is_link_local"), visibility("default"))); - -#undef g_inet_address_get_is_loopback -extern __typeof (g_inet_address_get_is_loopback) g_inet_address_get_is_loopback __attribute((alias("IA__g_inet_address_get_is_loopback"), visibility("default"))); - -#undef g_inet_address_get_is_mc_global -extern __typeof (g_inet_address_get_is_mc_global) g_inet_address_get_is_mc_global __attribute((alias("IA__g_inet_address_get_is_mc_global"), visibility("default"))); - -#undef g_inet_address_get_is_mc_link_local -extern __typeof (g_inet_address_get_is_mc_link_local) g_inet_address_get_is_mc_link_local __attribute((alias("IA__g_inet_address_get_is_mc_link_local"), visibility("default"))); - -#undef g_inet_address_get_is_mc_node_local -extern __typeof (g_inet_address_get_is_mc_node_local) g_inet_address_get_is_mc_node_local __attribute((alias("IA__g_inet_address_get_is_mc_node_local"), visibility("default"))); - -#undef g_inet_address_get_is_mc_org_local -extern __typeof (g_inet_address_get_is_mc_org_local) g_inet_address_get_is_mc_org_local __attribute((alias("IA__g_inet_address_get_is_mc_org_local"), visibility("default"))); - -#undef g_inet_address_get_is_mc_site_local -extern __typeof (g_inet_address_get_is_mc_site_local) g_inet_address_get_is_mc_site_local __attribute((alias("IA__g_inet_address_get_is_mc_site_local"), visibility("default"))); - -#undef g_inet_address_get_is_multicast -extern __typeof (g_inet_address_get_is_multicast) g_inet_address_get_is_multicast __attribute((alias("IA__g_inet_address_get_is_multicast"), visibility("default"))); - -#undef g_inet_address_get_is_site_local -extern __typeof (g_inet_address_get_is_site_local) g_inet_address_get_is_site_local __attribute((alias("IA__g_inet_address_get_is_site_local"), visibility("default"))); - -#undef g_inet_address_to_bytes -extern __typeof (g_inet_address_to_bytes) g_inet_address_to_bytes __attribute((alias("IA__g_inet_address_to_bytes"), visibility("default"))); - -#undef g_inet_address_get_native_size -extern __typeof (g_inet_address_get_native_size) g_inet_address_get_native_size __attribute((alias("IA__g_inet_address_get_native_size"), visibility("default"))); - -#undef g_inet_address_to_string -extern __typeof (g_inet_address_to_string) g_inet_address_to_string __attribute((alias("IA__g_inet_address_to_string"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_INET_SOCKET_ADDRESS_H__) -#if IN_FILE(__G_INET_SOCKET_ADDRESS_C__) -#undef g_inet_socket_address_get_address -extern __typeof (g_inet_socket_address_get_address) g_inet_socket_address_get_address __attribute((alias("IA__g_inet_socket_address_get_address"), visibility("default"))); - -#undef g_inet_socket_address_get_port -extern __typeof (g_inet_socket_address_get_port) g_inet_socket_address_get_port __attribute((alias("IA__g_inet_socket_address_get_port"), visibility("default"))); - -#undef g_inet_socket_address_get_type -extern __typeof (g_inet_socket_address_get_type) g_inet_socket_address_get_type __attribute((alias("IA__g_inet_socket_address_get_type"), visibility("default"))); - -#undef g_inet_socket_address_new -extern __typeof (g_inet_socket_address_new) g_inet_socket_address_new __attribute((alias("IA__g_inet_socket_address_new"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNIX_SOCKET_ADDRESS_H__) -#if IN_FILE(__G_UNIX_SOCKET_ADDRESS_C__) -#ifdef G_OS_UNIX -#undef g_unix_socket_address_get_type -extern __typeof (g_unix_socket_address_get_type) g_unix_socket_address_get_type __attribute((alias("IA__g_unix_socket_address_get_type"), visibility("default"))); - -#undef g_unix_socket_address_new -extern __typeof (g_unix_socket_address_new) g_unix_socket_address_new __attribute((alias("IA__g_unix_socket_address_new"), visibility("default"))); - -#undef g_unix_socket_address_new_abstract -extern __typeof (g_unix_socket_address_new_abstract) g_unix_socket_address_new_abstract __attribute((alias("IA__g_unix_socket_address_new_abstract"), visibility("default"))); - -#undef g_unix_socket_address_abstract_names_supported -extern __typeof (g_unix_socket_address_abstract_names_supported) g_unix_socket_address_abstract_names_supported __attribute((alias("IA__g_unix_socket_address_abstract_names_supported"), visibility("default"))); - -#undef g_unix_socket_address_get_is_abstract -extern __typeof (g_unix_socket_address_get_is_abstract) g_unix_socket_address_get_is_abstract __attribute((alias("IA__g_unix_socket_address_get_is_abstract"), visibility("default"))); - -#undef g_unix_socket_address_get_path -extern __typeof (g_unix_socket_address_get_path) g_unix_socket_address_get_path __attribute((alias("IA__g_unix_socket_address_get_path"), visibility("default"))); - -#undef g_unix_socket_address_get_path_len -extern __typeof (g_unix_socket_address_get_path_len) g_unix_socket_address_get_path_len __attribute((alias("IA__g_unix_socket_address_get_path_len"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_SOCKET_ADDRESS_H__) -#if IN_FILE(__G_SOCKET_ADDRESS_C__) -#undef g_socket_address_new_from_native -extern __typeof (g_socket_address_new_from_native) g_socket_address_new_from_native __attribute((alias("IA__g_socket_address_new_from_native"), visibility("default"))); - -#undef g_socket_address_get_type -extern __typeof (g_socket_address_get_type) g_socket_address_get_type __attribute((alias("IA__g_socket_address_get_type"), visibility("default"))); - -#undef g_socket_address_get_family -extern __typeof (g_socket_address_get_family) g_socket_address_get_family __attribute((alias("IA__g_socket_address_get_family"), visibility("default"))); - -#undef g_socket_address_get_native_size -extern __typeof (g_socket_address_get_native_size) g_socket_address_get_native_size __attribute((alias("IA__g_socket_address_get_native_size"), visibility("default"))); - -#undef g_socket_address_to_native -extern __typeof (g_socket_address_to_native) g_socket_address_to_native __attribute((alias("IA__g_socket_address_to_native"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_RESOLVER_H__) -#if IN_FILE(__G_RESOLVER_C__) -#undef g_resolver_error_quark -extern __typeof (g_resolver_error_quark) g_resolver_error_quark __attribute((alias("IA__g_resolver_error_quark"), visibility("default"))); - -#undef g_resolver_free_addresses -extern __typeof (g_resolver_free_addresses) g_resolver_free_addresses __attribute((alias("IA__g_resolver_free_addresses"), visibility("default"))); - -#undef g_resolver_free_targets -extern __typeof (g_resolver_free_targets) g_resolver_free_targets __attribute((alias("IA__g_resolver_free_targets"), visibility("default"))); - -#undef g_resolver_get_type -extern __typeof (g_resolver_get_type) g_resolver_get_type __attribute((alias("IA__g_resolver_get_type"), visibility("default"))); - -#undef g_resolver_get_default -extern __typeof (g_resolver_get_default) g_resolver_get_default __attribute((alias("IA__g_resolver_get_default"), visibility("default"))); - -#undef g_resolver_set_default -extern __typeof (g_resolver_set_default) g_resolver_set_default __attribute((alias("IA__g_resolver_set_default"), visibility("default"))); - -#undef g_resolver_lookup_by_name -extern __typeof (g_resolver_lookup_by_name) g_resolver_lookup_by_name __attribute((alias("IA__g_resolver_lookup_by_name"), visibility("default"))); - -#undef g_resolver_lookup_by_name_async -extern __typeof (g_resolver_lookup_by_name_async) g_resolver_lookup_by_name_async __attribute((alias("IA__g_resolver_lookup_by_name_async"), visibility("default"))); - -#undef g_resolver_lookup_by_name_finish -extern __typeof (g_resolver_lookup_by_name_finish) g_resolver_lookup_by_name_finish __attribute((alias("IA__g_resolver_lookup_by_name_finish"), visibility("default"))); - -#undef g_resolver_lookup_by_address -extern __typeof (g_resolver_lookup_by_address) g_resolver_lookup_by_address __attribute((alias("IA__g_resolver_lookup_by_address"), visibility("default"))); - -#undef g_resolver_lookup_by_address_async -extern __typeof (g_resolver_lookup_by_address_async) g_resolver_lookup_by_address_async __attribute((alias("IA__g_resolver_lookup_by_address_async"), visibility("default"))); - -#undef g_resolver_lookup_by_address_finish -extern __typeof (g_resolver_lookup_by_address_finish) g_resolver_lookup_by_address_finish __attribute((alias("IA__g_resolver_lookup_by_address_finish"), visibility("default"))); - -#undef g_resolver_lookup_service -extern __typeof (g_resolver_lookup_service) g_resolver_lookup_service __attribute((alias("IA__g_resolver_lookup_service"), visibility("default"))); - -#undef g_resolver_lookup_service_async -extern __typeof (g_resolver_lookup_service_async) g_resolver_lookup_service_async __attribute((alias("IA__g_resolver_lookup_service_async"), visibility("default"))); - -#undef g_resolver_lookup_service_finish -extern __typeof (g_resolver_lookup_service_finish) g_resolver_lookup_service_finish __attribute((alias("IA__g_resolver_lookup_service_finish"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_THREADED_RESOLVER_H__) -#if IN_FILE(__G_THREADED_RESOLVER_C__) -#undef g_threaded_resolver_get_type -extern __typeof (g_threaded_resolver_get_type) g_threaded_resolver_get_type __attribute((alias("IA__g_threaded_resolver_get_type"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNIX_RESOLVER_H__) -#if IN_FILE(__G_UNIX_RESOLVER_C__) -#ifdef G_OS_UNIX -#undef g_unix_resolver_get_type -extern __typeof (g_unix_resolver_get_type) g_unix_resolver_get_type __attribute((alias("IA__g_unix_resolver_get_type"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_WIN32_RESOLVER_H__) -#if IN_FILE(__G_WIN32_RESOLVER_C__) -#ifdef G_OS_WIN32 -#undef g_win32_resolver_get_type -extern __typeof (g_win32_resolver_get_type) g_win32_resolver_get_type __attribute((alias("IA__g_win32_resolver_get_type"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_SRV_TARGET_H__) -#if IN_FILE(__G_SRV_TARGET_C__) -#undef g_srv_target_get_type -extern __typeof (g_srv_target_get_type) g_srv_target_get_type __attribute((alias("IA__g_srv_target_get_type"), visibility("default"))); - -#undef g_srv_target_new -extern __typeof (g_srv_target_new) g_srv_target_new __attribute((alias("IA__g_srv_target_new"), visibility("default"))); - -#undef g_srv_target_copy -extern __typeof (g_srv_target_copy) g_srv_target_copy __attribute((alias("IA__g_srv_target_copy"), visibility("default"))); - -#undef g_srv_target_free -extern __typeof (g_srv_target_free) g_srv_target_free __attribute((alias("IA__g_srv_target_free"), visibility("default"))); - -#undef g_srv_target_get_hostname -extern __typeof (g_srv_target_get_hostname) g_srv_target_get_hostname __attribute((alias("IA__g_srv_target_get_hostname"), visibility("default"))); - -#undef g_srv_target_get_port -extern __typeof (g_srv_target_get_port) g_srv_target_get_port __attribute((alias("IA__g_srv_target_get_port"), visibility("default"))); - -#undef g_srv_target_get_priority -extern __typeof (g_srv_target_get_priority) g_srv_target_get_priority __attribute((alias("IA__g_srv_target_get_priority"), visibility("default"))); - -#undef g_srv_target_get_weight -extern __typeof (g_srv_target_get_weight) g_srv_target_get_weight __attribute((alias("IA__g_srv_target_get_weight"), visibility("default"))); - -#undef g_srv_target_list_sort -extern __typeof (g_srv_target_list_sort) g_srv_target_list_sort __attribute((alias("IA__g_srv_target_list_sort"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_NETWORK_ADDRESS_H__) -#if IN_FILE(__G_NETWORK_ADDRESS_C__) -#undef g_network_address_get_type -extern __typeof (g_network_address_get_type) g_network_address_get_type __attribute((alias("IA__g_network_address_get_type"), visibility("default"))); - -#undef g_network_address_get_hostname -extern __typeof (g_network_address_get_hostname) g_network_address_get_hostname __attribute((alias("IA__g_network_address_get_hostname"), visibility("default"))); - -#undef g_network_address_get_port -extern __typeof (g_network_address_get_port) g_network_address_get_port __attribute((alias("IA__g_network_address_get_port"), visibility("default"))); - -#undef g_network_address_new -extern __typeof (g_network_address_new) g_network_address_new __attribute((alias("IA__g_network_address_new"), visibility("default"))); - -#undef g_network_address_parse -extern __typeof (g_network_address_parse) g_network_address_parse __attribute((alias("IA__g_network_address_parse"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_NETWORK_SERVICE_H__) -#if IN_FILE(__G_NETWORK_SERVICE_C__) -#undef g_network_service_get_type -extern __typeof (g_network_service_get_type) g_network_service_get_type __attribute((alias("IA__g_network_service_get_type"), visibility("default"))); - -#undef g_network_service_get_service -extern __typeof (g_network_service_get_service) g_network_service_get_service __attribute((alias("IA__g_network_service_get_service"), visibility("default"))); - -#undef g_network_service_get_protocol -extern __typeof (g_network_service_get_protocol) g_network_service_get_protocol __attribute((alias("IA__g_network_service_get_protocol"), visibility("default"))); - -#undef g_network_service_get_domain -extern __typeof (g_network_service_get_domain) g_network_service_get_domain __attribute((alias("IA__g_network_service_get_domain"), visibility("default"))); - -#undef g_network_service_new -extern __typeof (g_network_service_new) g_network_service_new __attribute((alias("IA__g_network_service_new"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CONNECTABLE_H__) -#if IN_FILE(__G_SOCKET_CONNECTABLE_C__) -#undef g_socket_connectable_enumerate -extern __typeof (g_socket_connectable_enumerate) g_socket_connectable_enumerate __attribute((alias("IA__g_socket_connectable_enumerate"), visibility("default"))); - -#undef g_socket_connectable_get_type -extern __typeof (g_socket_connectable_get_type) g_socket_connectable_get_type __attribute((alias("IA__g_socket_connectable_get_type"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_ADDRESS_ENUMERATOR_H__) -#if IN_FILE(__G_SOCKET_ADDRESS_ENUMERATOR_C__) -#undef g_socket_address_enumerator_get_type -extern __typeof (g_socket_address_enumerator_get_type) g_socket_address_enumerator_get_type __attribute((alias("IA__g_socket_address_enumerator_get_type"), visibility("default"))); - -#undef g_socket_address_enumerator_next -extern __typeof (g_socket_address_enumerator_next) g_socket_address_enumerator_next __attribute((alias("IA__g_socket_address_enumerator_next"), visibility("default"))); - -#undef g_socket_address_enumerator_next_async -extern __typeof (g_socket_address_enumerator_next_async) g_socket_address_enumerator_next_async __attribute((alias("IA__g_socket_address_enumerator_next_async"), visibility("default"))); - -#undef g_socket_address_enumerator_next_finish -extern __typeof (g_socket_address_enumerator_next_finish) g_socket_address_enumerator_next_finish __attribute((alias("IA__g_socket_address_enumerator_next_finish"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_ASYNC_INITABLE_H__) -#if IN_FILE(__G_ASYNC_INITABLE_C__) -#undef g_async_initable_get_type -extern __typeof (g_async_initable_get_type) g_async_initable_get_type __attribute((alias("IA__g_async_initable_get_type"), visibility("default"))); - -#undef g_async_initable_init_async -extern __typeof (g_async_initable_init_async) g_async_initable_init_async __attribute((alias("IA__g_async_initable_init_async"), visibility("default"))); - -#undef g_async_initable_init_finish -extern __typeof (g_async_initable_init_finish) g_async_initable_init_finish __attribute((alias("IA__g_async_initable_init_finish"), visibility("default"))); - -#undef g_async_initable_new_async -extern __typeof (g_async_initable_new_async) g_async_initable_new_async __attribute((alias("IA__g_async_initable_new_async"), visibility("default"))); - -#undef g_async_initable_new_finish -extern __typeof (g_async_initable_new_finish) g_async_initable_new_finish __attribute((alias("IA__g_async_initable_new_finish"), visibility("default"))); - -#undef g_async_initable_new_valist_async -extern __typeof (g_async_initable_new_valist_async) g_async_initable_new_valist_async __attribute((alias("IA__g_async_initable_new_valist_async"), visibility("default"))); - -#undef g_async_initable_newv_async -extern __typeof (g_async_initable_newv_async) g_async_initable_newv_async __attribute((alias("IA__g_async_initable_newv_async"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_INITABLE_H__) -#if IN_FILE(__G_INITABLE_C__) -#undef g_initable_get_type -extern __typeof (g_initable_get_type) g_initable_get_type __attribute((alias("IA__g_initable_get_type"), visibility("default"))); - -#undef g_initable_init -extern __typeof (g_initable_init) g_initable_init __attribute((alias("IA__g_initable_init"), visibility("default"))); - -#undef g_initable_new -extern __typeof (g_initable_new) g_initable_new __attribute((alias("IA__g_initable_new"), visibility("default"))); - -#undef g_initable_newv -extern __typeof (g_initable_newv) g_initable_newv __attribute((alias("IA__g_initable_newv"), visibility("default"))); - -#undef g_initable_new_valist -extern __typeof (g_initable_new_valist) g_initable_new_valist __attribute((alias("IA__g_initable_new_valist"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_H__) -#if IN_FILE(__G_SOCKET_C__) -#undef g_socket_get_type -extern __typeof (g_socket_get_type) g_socket_get_type __attribute((alias("IA__g_socket_get_type"), visibility("default"))); - -#undef g_socket_accept -extern __typeof (g_socket_accept) g_socket_accept __attribute((alias("IA__g_socket_accept"), visibility("default"))); - -#undef g_socket_bind -extern __typeof (g_socket_bind) g_socket_bind __attribute((alias("IA__g_socket_bind"), visibility("default"))); - -#undef g_socket_check_connect_result -extern __typeof (g_socket_check_connect_result) g_socket_check_connect_result __attribute((alias("IA__g_socket_check_connect_result"), visibility("default"))); - -#undef g_socket_close -extern __typeof (g_socket_close) g_socket_close __attribute((alias("IA__g_socket_close"), visibility("default"))); - -#undef g_socket_shutdown -extern __typeof (g_socket_shutdown) g_socket_shutdown __attribute((alias("IA__g_socket_shutdown"), visibility("default"))); - -#undef g_socket_condition_check -extern __typeof (g_socket_condition_check) g_socket_condition_check __attribute((alias("IA__g_socket_condition_check"), visibility("default"))); - -#undef g_socket_condition_wait -extern __typeof (g_socket_condition_wait) g_socket_condition_wait __attribute((alias("IA__g_socket_condition_wait"), visibility("default"))); - -#undef g_socket_connect -extern __typeof (g_socket_connect) g_socket_connect __attribute((alias("IA__g_socket_connect"), visibility("default"))); - -#undef g_socket_create_source -extern __typeof (g_socket_create_source) g_socket_create_source __attribute((alias("IA__g_socket_create_source"), visibility("default"))); - -#undef g_socket_get_blocking -extern __typeof (g_socket_get_blocking) g_socket_get_blocking __attribute((alias("IA__g_socket_get_blocking"), visibility("default"))); - -#undef g_socket_get_family -extern __typeof (g_socket_get_family) g_socket_get_family __attribute((alias("IA__g_socket_get_family"), visibility("default"))); - -#undef g_socket_get_fd -extern __typeof (g_socket_get_fd) g_socket_get_fd __attribute((alias("IA__g_socket_get_fd"), visibility("default"))); - -#undef g_socket_get_keepalive -extern __typeof (g_socket_get_keepalive) g_socket_get_keepalive __attribute((alias("IA__g_socket_get_keepalive"), visibility("default"))); - -#undef g_socket_get_listen_backlog -extern __typeof (g_socket_get_listen_backlog) g_socket_get_listen_backlog __attribute((alias("IA__g_socket_get_listen_backlog"), visibility("default"))); - -#undef g_socket_get_local_address -extern __typeof (g_socket_get_local_address) g_socket_get_local_address __attribute((alias("IA__g_socket_get_local_address"), visibility("default"))); - -#undef g_socket_get_protocol -extern __typeof (g_socket_get_protocol) g_socket_get_protocol __attribute((alias("IA__g_socket_get_protocol"), visibility("default"))); - -#undef g_socket_get_remote_address -extern __typeof (g_socket_get_remote_address) g_socket_get_remote_address __attribute((alias("IA__g_socket_get_remote_address"), visibility("default"))); - -#undef g_socket_get_socket_type -extern __typeof (g_socket_get_socket_type) g_socket_get_socket_type __attribute((alias("IA__g_socket_get_socket_type"), visibility("default"))); - -#undef g_socket_is_closed -extern __typeof (g_socket_is_closed) g_socket_is_closed __attribute((alias("IA__g_socket_is_closed"), visibility("default"))); - -#undef g_socket_is_connected -extern __typeof (g_socket_is_connected) g_socket_is_connected __attribute((alias("IA__g_socket_is_connected"), visibility("default"))); - -#undef g_socket_listen -extern __typeof (g_socket_listen) g_socket_listen __attribute((alias("IA__g_socket_listen"), visibility("default"))); - -#undef g_socket_new -extern __typeof (g_socket_new) g_socket_new __attribute((alias("IA__g_socket_new"), visibility("default"))); - -#undef g_socket_new_from_fd -extern __typeof (g_socket_new_from_fd) g_socket_new_from_fd __attribute((alias("IA__g_socket_new_from_fd"), visibility("default"))); - -#undef g_socket_receive -extern __typeof (g_socket_receive) g_socket_receive __attribute((alias("IA__g_socket_receive"), visibility("default"))); - -#undef g_socket_receive_from -extern __typeof (g_socket_receive_from) g_socket_receive_from __attribute((alias("IA__g_socket_receive_from"), visibility("default"))); - -#undef g_socket_receive_message -extern __typeof (g_socket_receive_message) g_socket_receive_message __attribute((alias("IA__g_socket_receive_message"), visibility("default"))); - -#undef g_socket_send -extern __typeof (g_socket_send) g_socket_send __attribute((alias("IA__g_socket_send"), visibility("default"))); - -#undef g_socket_send_message -extern __typeof (g_socket_send_message) g_socket_send_message __attribute((alias("IA__g_socket_send_message"), visibility("default"))); - -#undef g_socket_send_to -extern __typeof (g_socket_send_to) g_socket_send_to __attribute((alias("IA__g_socket_send_to"), visibility("default"))); - -#undef g_socket_set_blocking -extern __typeof (g_socket_set_blocking) g_socket_set_blocking __attribute((alias("IA__g_socket_set_blocking"), visibility("default"))); - -#undef g_socket_set_keepalive -extern __typeof (g_socket_set_keepalive) g_socket_set_keepalive __attribute((alias("IA__g_socket_set_keepalive"), visibility("default"))); - -#undef g_socket_set_listen_backlog -extern __typeof (g_socket_set_listen_backlog) g_socket_set_listen_backlog __attribute((alias("IA__g_socket_set_listen_backlog"), visibility("default"))); - -#undef g_socket_speaks_ipv4 -extern __typeof (g_socket_speaks_ipv4) g_socket_speaks_ipv4 __attribute((alias("IA__g_socket_speaks_ipv4"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CONTROL_MESSAGE_H__) -#if IN_FILE(__G_SOCKET_CONTROL_MESSAGE_C__) -#undef g_socket_control_message_get_type -extern __typeof (g_socket_control_message_get_type) g_socket_control_message_get_type __attribute((alias("IA__g_socket_control_message_get_type"), visibility("default"))); - -#undef g_socket_control_message_deserialize -extern __typeof (g_socket_control_message_deserialize) g_socket_control_message_deserialize __attribute((alias("IA__g_socket_control_message_deserialize"), visibility("default"))); - -#undef g_socket_control_message_get_level -extern __typeof (g_socket_control_message_get_level) g_socket_control_message_get_level __attribute((alias("IA__g_socket_control_message_get_level"), visibility("default"))); - -#undef g_socket_control_message_get_msg_type -extern __typeof (g_socket_control_message_get_msg_type) g_socket_control_message_get_msg_type __attribute((alias("IA__g_socket_control_message_get_msg_type"), visibility("default"))); - -#undef g_socket_control_message_get_size -extern __typeof (g_socket_control_message_get_size) g_socket_control_message_get_size __attribute((alias("IA__g_socket_control_message_get_size"), visibility("default"))); - -#undef g_socket_control_message_serialize -extern __typeof (g_socket_control_message_serialize) g_socket_control_message_serialize __attribute((alias("IA__g_socket_control_message_serialize"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CLIENT_H__) -#if IN_FILE(__G_SOCKET_CLIENT_C__) -#undef g_socket_client_get_type -extern __typeof (g_socket_client_get_type) g_socket_client_get_type __attribute((alias("IA__g_socket_client_get_type"), visibility("default"))); - -#undef g_socket_client_connect -extern __typeof (g_socket_client_connect) g_socket_client_connect __attribute((alias("IA__g_socket_client_connect"), visibility("default"))); - -#undef g_socket_client_connect_async -extern __typeof (g_socket_client_connect_async) g_socket_client_connect_async __attribute((alias("IA__g_socket_client_connect_async"), visibility("default"))); - -#undef g_socket_client_connect_finish -extern __typeof (g_socket_client_connect_finish) g_socket_client_connect_finish __attribute((alias("IA__g_socket_client_connect_finish"), visibility("default"))); - -#undef g_socket_client_connect_to_host -extern __typeof (g_socket_client_connect_to_host) g_socket_client_connect_to_host __attribute((alias("IA__g_socket_client_connect_to_host"), visibility("default"))); - -#undef g_socket_client_connect_to_host_async -extern __typeof (g_socket_client_connect_to_host_async) g_socket_client_connect_to_host_async __attribute((alias("IA__g_socket_client_connect_to_host_async"), visibility("default"))); - -#undef g_socket_client_connect_to_host_finish -extern __typeof (g_socket_client_connect_to_host_finish) g_socket_client_connect_to_host_finish __attribute((alias("IA__g_socket_client_connect_to_host_finish"), visibility("default"))); - -#undef g_socket_client_connect_to_service -extern __typeof (g_socket_client_connect_to_service) g_socket_client_connect_to_service __attribute((alias("IA__g_socket_client_connect_to_service"), visibility("default"))); - -#undef g_socket_client_connect_to_service_async -extern __typeof (g_socket_client_connect_to_service_async) g_socket_client_connect_to_service_async __attribute((alias("IA__g_socket_client_connect_to_service_async"), visibility("default"))); - -#undef g_socket_client_connect_to_service_finish -extern __typeof (g_socket_client_connect_to_service_finish) g_socket_client_connect_to_service_finish __attribute((alias("IA__g_socket_client_connect_to_service_finish"), visibility("default"))); - -#undef g_socket_client_get_family -extern __typeof (g_socket_client_get_family) g_socket_client_get_family __attribute((alias("IA__g_socket_client_get_family"), visibility("default"))); - -#undef g_socket_client_get_local_address -extern __typeof (g_socket_client_get_local_address) g_socket_client_get_local_address __attribute((alias("IA__g_socket_client_get_local_address"), visibility("default"))); - -#undef g_socket_client_get_protocol -extern __typeof (g_socket_client_get_protocol) g_socket_client_get_protocol __attribute((alias("IA__g_socket_client_get_protocol"), visibility("default"))); - -#undef g_socket_client_get_socket_type -extern __typeof (g_socket_client_get_socket_type) g_socket_client_get_socket_type __attribute((alias("IA__g_socket_client_get_socket_type"), visibility("default"))); - -#undef g_socket_client_new -extern __typeof (g_socket_client_new) g_socket_client_new __attribute((alias("IA__g_socket_client_new"), visibility("default"))); - -#undef g_socket_client_set_family -extern __typeof (g_socket_client_set_family) g_socket_client_set_family __attribute((alias("IA__g_socket_client_set_family"), visibility("default"))); - -#undef g_socket_client_set_local_address -extern __typeof (g_socket_client_set_local_address) g_socket_client_set_local_address __attribute((alias("IA__g_socket_client_set_local_address"), visibility("default"))); - -#undef g_socket_client_set_protocol -extern __typeof (g_socket_client_set_protocol) g_socket_client_set_protocol __attribute((alias("IA__g_socket_client_set_protocol"), visibility("default"))); - -#undef g_socket_client_set_socket_type -extern __typeof (g_socket_client_set_socket_type) g_socket_client_set_socket_type __attribute((alias("IA__g_socket_client_set_socket_type"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_CONNECTION_H__) -#if IN_FILE(__G_SOCKET_CONNECTION_C__) -#undef g_socket_connection_get_type -extern __typeof (g_socket_connection_get_type) g_socket_connection_get_type __attribute((alias("IA__g_socket_connection_get_type"), visibility("default"))); - -#undef g_socket_connection_factory_create_connection -extern __typeof (g_socket_connection_factory_create_connection) g_socket_connection_factory_create_connection __attribute((alias("IA__g_socket_connection_factory_create_connection"), visibility("default"))); - -#undef g_socket_connection_factory_lookup_type -extern __typeof (g_socket_connection_factory_lookup_type) g_socket_connection_factory_lookup_type __attribute((alias("IA__g_socket_connection_factory_lookup_type"), visibility("default"))); - -#undef g_socket_connection_factory_register_type -extern __typeof (g_socket_connection_factory_register_type) g_socket_connection_factory_register_type __attribute((alias("IA__g_socket_connection_factory_register_type"), visibility("default"))); - -#undef g_socket_connection_get_local_address -extern __typeof (g_socket_connection_get_local_address) g_socket_connection_get_local_address __attribute((alias("IA__g_socket_connection_get_local_address"), visibility("default"))); - -#undef g_socket_connection_get_remote_address -extern __typeof (g_socket_connection_get_remote_address) g_socket_connection_get_remote_address __attribute((alias("IA__g_socket_connection_get_remote_address"), visibility("default"))); - -#undef g_socket_connection_get_socket -extern __typeof (g_socket_connection_get_socket) g_socket_connection_get_socket __attribute((alias("IA__g_socket_connection_get_socket"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_LISTENER_H__) -#if IN_FILE(__G_SOCKET_LISTENER_C__) -#undef g_socket_listener_get_type -extern __typeof (g_socket_listener_get_type) g_socket_listener_get_type __attribute((alias("IA__g_socket_listener_get_type"), visibility("default"))); - -#undef g_socket_listener_accept -extern __typeof (g_socket_listener_accept) g_socket_listener_accept __attribute((alias("IA__g_socket_listener_accept"), visibility("default"))); - -#undef g_socket_listener_accept_async -extern __typeof (g_socket_listener_accept_async) g_socket_listener_accept_async __attribute((alias("IA__g_socket_listener_accept_async"), visibility("default"))); - -#undef g_socket_listener_accept_finish -extern __typeof (g_socket_listener_accept_finish) g_socket_listener_accept_finish __attribute((alias("IA__g_socket_listener_accept_finish"), visibility("default"))); - -#undef g_socket_listener_accept_socket -extern __typeof (g_socket_listener_accept_socket) g_socket_listener_accept_socket __attribute((alias("IA__g_socket_listener_accept_socket"), visibility("default"))); - -#undef g_socket_listener_accept_socket_async -extern __typeof (g_socket_listener_accept_socket_async) g_socket_listener_accept_socket_async __attribute((alias("IA__g_socket_listener_accept_socket_async"), visibility("default"))); - -#undef g_socket_listener_accept_socket_finish -extern __typeof (g_socket_listener_accept_socket_finish) g_socket_listener_accept_socket_finish __attribute((alias("IA__g_socket_listener_accept_socket_finish"), visibility("default"))); - -#undef g_socket_listener_add_address -extern __typeof (g_socket_listener_add_address) g_socket_listener_add_address __attribute((alias("IA__g_socket_listener_add_address"), visibility("default"))); - -#undef g_socket_listener_add_inet_port -extern __typeof (g_socket_listener_add_inet_port) g_socket_listener_add_inet_port __attribute((alias("IA__g_socket_listener_add_inet_port"), visibility("default"))); - -#undef g_socket_listener_add_any_inet_port -extern __typeof (g_socket_listener_add_any_inet_port) g_socket_listener_add_any_inet_port __attribute((alias("IA__g_socket_listener_add_any_inet_port"), visibility("default"))); - -#undef g_socket_listener_add_socket -extern __typeof (g_socket_listener_add_socket) g_socket_listener_add_socket __attribute((alias("IA__g_socket_listener_add_socket"), visibility("default"))); - -#undef g_socket_listener_close -extern __typeof (g_socket_listener_close) g_socket_listener_close __attribute((alias("IA__g_socket_listener_close"), visibility("default"))); - -#undef g_socket_listener_new -extern __typeof (g_socket_listener_new) g_socket_listener_new __attribute((alias("IA__g_socket_listener_new"), visibility("default"))); - -#undef g_socket_listener_set_backlog -extern __typeof (g_socket_listener_set_backlog) g_socket_listener_set_backlog __attribute((alias("IA__g_socket_listener_set_backlog"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SOCKET_SERVICE_H__) -#if IN_FILE(__G_SOCKET_SERVICE_C__) -#undef g_socket_service_get_type -extern __typeof (g_socket_service_get_type) g_socket_service_get_type __attribute((alias("IA__g_socket_service_get_type"), visibility("default"))); - -#undef g_socket_service_is_active -extern __typeof (g_socket_service_is_active) g_socket_service_is_active __attribute((alias("IA__g_socket_service_is_active"), visibility("default"))); - -#undef g_socket_service_new -extern __typeof (g_socket_service_new) g_socket_service_new __attribute((alias("IA__g_socket_service_new"), visibility("default"))); - -#undef g_socket_service_start -extern __typeof (g_socket_service_start) g_socket_service_start __attribute((alias("IA__g_socket_service_start"), visibility("default"))); - -#undef g_socket_service_stop -extern __typeof (g_socket_service_stop) g_socket_service_stop __attribute((alias("IA__g_socket_service_stop"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_THREADED_SOCKET_SERVICE_H__) -#if IN_FILE(__G_THREADED_SOCKET_SERVICE_C__) -#undef g_threaded_socket_service_get_type -extern __typeof (g_threaded_socket_service_get_type) g_threaded_socket_service_get_type __attribute((alias("IA__g_threaded_socket_service_get_type"), visibility("default"))); - -#undef g_threaded_socket_service_new -extern __typeof (g_threaded_socket_service_new) g_threaded_socket_service_new __attribute((alias("IA__g_threaded_socket_service_new"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_TCP_CONNECTION_H__) -#if IN_FILE(__G_TCP_CONNECTION_C__) -#undef g_tcp_connection_get_type -extern __typeof (g_tcp_connection_get_type) g_tcp_connection_get_type __attribute((alias("IA__g_tcp_connection_get_type"), visibility("default"))); - -#undef g_tcp_connection_set_graceful_disconnect -extern __typeof (g_tcp_connection_set_graceful_disconnect) g_tcp_connection_set_graceful_disconnect __attribute((alias("IA__g_tcp_connection_set_graceful_disconnect"), visibility("default"))); - -#undef g_tcp_connection_get_graceful_disconnect -extern __typeof (g_tcp_connection_get_graceful_disconnect) g_tcp_connection_get_graceful_disconnect __attribute((alias("IA__g_tcp_connection_get_graceful_disconnect"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNIX_CONNECTION_H__) -#if IN_FILE(__G_UNIX_CONNECTION_C__) -#ifndef G_OS_WIN32 -#undef g_unix_connection_get_type -extern __typeof (g_unix_connection_get_type) g_unix_connection_get_type __attribute((alias("IA__g_unix_connection_get_type"), visibility("default"))); - -#undef g_unix_connection_receive_fd -extern __typeof (g_unix_connection_receive_fd) g_unix_connection_receive_fd __attribute((alias("IA__g_unix_connection_receive_fd"), visibility("default"))); - -#undef g_unix_connection_send_fd -extern __typeof (g_unix_connection_send_fd) g_unix_connection_send_fd __attribute((alias("IA__g_unix_connection_send_fd"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_UNIX_FD_MESSAGE_H__) -#if IN_FILE(__G_UNIX_FD_MESSAGE_C__) -#ifndef G_OS_WIN32 -#undef g_unix_fd_message_get_type -extern __typeof (g_unix_fd_message_get_type) g_unix_fd_message_get_type __attribute((alias("IA__g_unix_fd_message_get_type"), visibility("default"))); - -#undef g_unix_fd_message_append_fd -extern __typeof (g_unix_fd_message_append_fd) g_unix_fd_message_append_fd __attribute((alias("IA__g_unix_fd_message_append_fd"), visibility("default"))); - -#undef g_unix_fd_message_new -extern __typeof (g_unix_fd_message_new) g_unix_fd_message_new __attribute((alias("IA__g_unix_fd_message_new"), visibility("default"))); - -#undef g_unix_fd_message_steal_fds -extern __typeof (g_unix_fd_message_steal_fds) g_unix_fd_message_steal_fds __attribute((alias("IA__g_unix_fd_message_steal_fds"), visibility("default"))); - -#undef g_unix_fd_message_get_fd_list -extern __typeof (g_unix_fd_message_get_fd_list) g_unix_fd_message_get_fd_list __attribute((alias("IA__g_unix_fd_message_get_fd_list"), visibility("default"))); - -#undef g_unix_fd_message_new_with_fd_list -extern __typeof (g_unix_fd_message_new_with_fd_list) g_unix_fd_message_new_with_fd_list __attribute((alias("IA__g_unix_fd_message_new_with_fd_list"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_UNIX_FD_LIST_H__) -#if IN_FILE(__G_UNIX_FD_LIST_C__) -#ifndef G_OS_WIN32 -#undef g_unix_fd_list_append -extern __typeof (g_unix_fd_list_append) g_unix_fd_list_append __attribute((alias("IA__g_unix_fd_list_append"), visibility("default"))); - -#undef g_unix_fd_list_get -extern __typeof (g_unix_fd_list_get) g_unix_fd_list_get __attribute((alias("IA__g_unix_fd_list_get"), visibility("default"))); - -#undef g_unix_fd_list_get_length -extern __typeof (g_unix_fd_list_get_length) g_unix_fd_list_get_length __attribute((alias("IA__g_unix_fd_list_get_length"), visibility("default"))); - -#undef g_unix_fd_list_get_type -extern __typeof (g_unix_fd_list_get_type) g_unix_fd_list_get_type __attribute((alias("IA__g_unix_fd_list_get_type"), visibility("default"))); - -#undef g_unix_fd_list_new -extern __typeof (g_unix_fd_list_new) g_unix_fd_list_new __attribute((alias("IA__g_unix_fd_list_new"), visibility("default"))); - -#undef g_unix_fd_list_new_from_array -extern __typeof (g_unix_fd_list_new_from_array) g_unix_fd_list_new_from_array __attribute((alias("IA__g_unix_fd_list_new_from_array"), visibility("default"))); - -#undef g_unix_fd_list_peek_fds -extern __typeof (g_unix_fd_list_peek_fds) g_unix_fd_list_peek_fds __attribute((alias("IA__g_unix_fd_list_peek_fds"), visibility("default"))); - -#undef g_unix_fd_list_steal_fds -extern __typeof (g_unix_fd_list_steal_fds) g_unix_fd_list_steal_fds __attribute((alias("IA__g_unix_fd_list_steal_fds"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_ZLIB_COMPRESSOR_H__) -#if IN_FILE(__G_ZLIB_COMPRESSOR_C__) -#undef g_zlib_compressor_get_type -extern __typeof (g_zlib_compressor_get_type) g_zlib_compressor_get_type __attribute((alias("IA__g_zlib_compressor_get_type"), visibility("default"))); - -#undef g_zlib_compressor_new -extern __typeof (g_zlib_compressor_new) g_zlib_compressor_new __attribute((alias("IA__g_zlib_compressor_new"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_ZLIB_DECOMPRESSOR_H__) -#if IN_FILE(__G_ZLIB_DECOMPRESSOR_C__) -#undef g_zlib_decompressor_get_type -extern __typeof (g_zlib_decompressor_get_type) g_zlib_decompressor_get_type __attribute((alias("IA__g_zlib_decompressor_get_type"), visibility("default"))); - -#undef g_zlib_decompressor_new -extern __typeof (g_zlib_decompressor_new) g_zlib_decompressor_new __attribute((alias("IA__g_zlib_decompressor_new"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILE_DESCRIPTOR_BASED_H__) -#if IN_FILE(__G_FILE_DESCRIPTOR_BASED_C__) -#undef g_file_descriptor_based_get_type -extern __typeof (g_file_descriptor_based_get_type) g_file_descriptor_based_get_type __attribute((alias("IA__g_file_descriptor_based_get_type"), visibility("default"))); - -#undef g_file_descriptor_based_get_fd -extern __typeof (g_file_descriptor_based_get_fd) g_file_descriptor_based_get_fd __attribute((alias("IA__g_file_descriptor_based_get_fd"), visibility("default"))); - -#endif -#endif - -#endif /* G_HAVE_GNUC_VISIBILITY */ -#endif /* DISABLE_VISIBILITY */ diff --git a/gio/gioenums.h b/gio/gioenums.h index 12242a8..0b2c576 100644 --- a/gio/gioenums.h +++ b/gio/gioenums.h @@ -37,13 +37,15 @@ G_BEGIN_DECLS * @G_APP_INFO_CREATE_NONE: No flags. * @G_APP_INFO_CREATE_NEEDS_TERMINAL: Application opens in a terminal window. * @G_APP_INFO_CREATE_SUPPORTS_URIS: Application supports URI arguments. + * @G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION: Application supports startup notification. Since 2.26 * * Flags used when creating a #GAppInfo. */ typedef enum { - G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ - G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0), /*< nick=needs-terminal >*/ - G_APP_INFO_CREATE_SUPPORTS_URIS = (1 << 1) /*< nick=supports-uris >*/ + G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ + G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0), /*< nick=needs-terminal >*/ + G_APP_INFO_CREATE_SUPPORTS_URIS = (1 << 1), /*< nick=supports-uris >*/ + G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION = (1 << 2) /*< nick=supports-startup-notification >*/ } GAppInfoCreateFlags; /** @@ -195,7 +197,7 @@ typedef enum { * @G_FILE_CREATE_REPLACE_DESTINATION: Replace the destination * as if it didn't exist before. Don't try to keep any old * permissions, replace instead of following links. This - * is generally useful if you're doing a "copy over" + * is generally useful if you're doing a "copy over" * rather than a "save new version of" replace operation. * You can think of it as "unlink destination" before * writing to it, although the implementation may not @@ -420,15 +422,28 @@ typedef enum { * @G_IO_ERROR_WOULD_BLOCK: Operation would block. * @G_IO_ERROR_HOST_NOT_FOUND: Host couldn't be found (remote operations). * @G_IO_ERROR_WOULD_MERGE: Operation would merge files. - * @G_IO_ERROR_FAILED_HANDLED: Operation failed and a helper program has + * @G_IO_ERROR_FAILED_HANDLED: Operation failed and a helper program has * already interacted with the user. Do not display any error dialog. - * @G_IO_ERROR_TOO_MANY_OPEN_FILES: The current process has too many files - * open and can't open any more. Duplicate descriptors do count toward + * @G_IO_ERROR_TOO_MANY_OPEN_FILES: The current process has too many files + * open and can't open any more. Duplicate descriptors do count toward * this limit. Since 2.20 * @G_IO_ERROR_NOT_INITIALIZED: The object has not been initialized. Since 2.22 * @G_IO_ERROR_ADDRESS_IN_USE: The requested address is already in use. Since 2.22 * @G_IO_ERROR_PARTIAL_INPUT: Need more input to finish operation. Since 2.24 * @G_IO_ERROR_INVALID_DATA: There input data was invalid. Since 2.24 + * @G_IO_ERROR_DBUS_ERROR: A remote object generated an error that + * doesn't correspond to a locally registered #GError error + * domain. Use g_dbus_error_get_remote_error() to extract the D-Bus + * error name and g_dbus_error_strip_remote_error() to fix up the + * message so it matches what was received on the wire. Since 2.26. + * @G_IO_ERROR_HOST_UNREACHABLE: Host unreachable. Since 2.26 + * @G_IO_ERROR_NETWORK_UNREACHABLE: Network unreachable. Since 2.26 + * @G_IO_ERROR_CONNECTION_REFUSED: Connection refused. Since 2.26 + * @G_IO_ERROR_PROXY_FAILED: Connection to proxy server failed. Since 2.26 + * @G_IO_ERROR_PROXY_AUTH_FAILED: Proxy authentication failed. Since 2.26 + * @G_IO_ERROR_PROXY_NEED_AUTH: Proxy server needs authentication. Since 2.26 + * @G_IO_ERROR_PROXY_NOT_ALLOWED: Proxy connection is not allowed by ruleset. + * Since 2.26 * * Error codes returned by GIO functions. * @@ -469,7 +484,15 @@ typedef enum { G_IO_ERROR_NOT_INITIALIZED, G_IO_ERROR_ADDRESS_IN_USE, G_IO_ERROR_PARTIAL_INPUT, - G_IO_ERROR_INVALID_DATA + G_IO_ERROR_INVALID_DATA, + G_IO_ERROR_DBUS_ERROR, + G_IO_ERROR_HOST_UNREACHABLE, + G_IO_ERROR_NETWORK_UNREACHABLE, + G_IO_ERROR_CONNECTION_REFUSED, + G_IO_ERROR_PROXY_FAILED, + G_IO_ERROR_PROXY_AUTH_FAILED, + G_IO_ERROR_PROXY_NEED_AUTH, + G_IO_ERROR_PROXY_NOT_ALLOWED } GIOErrorEnum; @@ -549,6 +572,27 @@ typedef enum { /** + * GIOStreamSpliceFlags: + * @G_IO_STREAM_SPLICE_NONE: Do not close either stream. + * @G_IO_STREAM_SPLICE_CLOSE_STREAM1: Close the first stream after + * the splice. + * @G_IO_STREAM_SPLICE_CLOSE_STREAM2: Close the second stream after + * the splice. + * @G_IO_STREAM_SPLICE_WAIT_FOR_BOTH: Wait for both splice operations to finish + * before calling the callback. + * + * GIOStreamSpliceFlags determine how streams should be spliced. + * + * Since: 2.28 + **/ +typedef enum { + G_IO_STREAM_SPLICE_NONE = 0, + G_IO_STREAM_SPLICE_CLOSE_STREAM1 = (1 << 0), + G_IO_STREAM_SPLICE_CLOSE_STREAM2 = (1 << 1), + G_IO_STREAM_SPLICE_WAIT_FOR_BOTH = (1 << 2) +} GIOStreamSpliceFlags; + +/** * GEmblemOrigin: * @G_EMBLEM_ORIGIN_UNKNOWN: Emblem of unknown origin * @G_EMBLEM_ORIGIN_DEVICE: Emblem adds device-specific information @@ -698,6 +742,636 @@ typedef enum { G_ZLIB_COMPRESSOR_FORMAT_RAW } GZlibCompressorFormat; +/** + * GUnixSocketAddressType: + * @G_UNIX_SOCKET_ADDRESS_INVALID: invalid + * @G_UNIX_SOCKET_ADDRESS_ANONYMOUS: anonymous + * @G_UNIX_SOCKET_ADDRESS_PATH: a filesystem path + * @G_UNIX_SOCKET_ADDRESS_ABSTRACT: an abstract name + * @G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED: an abstract name, 0-padded + * to the full length of a unix socket name + * + * The type of name used by a #GUnixSocketAddress. + * %G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain + * socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS + * indicates a socket not bound to any name (eg, a client-side socket, + * or a socket created with socketpair()). + * + * For abstract sockets, there are two incompatible ways of naming + * them: the man pages suggest using the entire struct + * sockaddr_un as the name, padding the unused parts of the + * %sun_path field with zeroes; this corresponds to + * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. However, many programs + * instead just use a portion of %sun_path, and pass an appropriate + * smaller length to bind() or connect(). This is + * %G_UNIX_SOCKET_ADDRESS_ABSTRACT. + * + * Since: 2.26 + */ +typedef enum { + G_UNIX_SOCKET_ADDRESS_INVALID, + G_UNIX_SOCKET_ADDRESS_ANONYMOUS, + G_UNIX_SOCKET_ADDRESS_PATH, + G_UNIX_SOCKET_ADDRESS_ABSTRACT, + G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED +} GUnixSocketAddressType; + +/** + * GBusType: + * @G_BUS_TYPE_STARTER: An alias for the message bus that activated the process, if any. + * @G_BUS_TYPE_NONE: Not a message bus. + * @G_BUS_TYPE_SYSTEM: The system-wide message bus. + * @G_BUS_TYPE_SESSION: The login session message bus. + * + * An enumeration for well-known message buses. + * + * Since: 2.26 + */ +typedef enum +{ + G_BUS_TYPE_STARTER = -1, + G_BUS_TYPE_NONE = 0, + G_BUS_TYPE_SYSTEM = 1, + G_BUS_TYPE_SESSION = 2 +} GBusType; + +/** + * GBusNameOwnerFlags: + * @G_BUS_NAME_OWNER_FLAGS_NONE: No flags set. + * @G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT: Allow another message bus connection to claim the the name. + * @G_BUS_NAME_OWNER_FLAGS_REPLACE: If another message bus connection owns the name and have + * specified #G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection. + * + * Flags used in g_bus_own_name(). + * + * Since: 2.26 + */ +typedef enum +{ + G_BUS_NAME_OWNER_FLAGS_NONE = 0, /*< nick=none >*/ + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT = (1<<0), /*< nick=allow-replacement >*/ + G_BUS_NAME_OWNER_FLAGS_REPLACE = (1<<1) /*< nick=replace >*/ +} GBusNameOwnerFlags; + +/** + * GBusNameWatcherFlags: + * @G_BUS_NAME_WATCHER_FLAGS_NONE: No flags set. + * @G_BUS_NAME_WATCHER_FLAGS_AUTO_START: If no-one owns the name when + * beginning to watch the name, ask the bus to launch an owner for the + * name. + * + * Flags used in g_bus_watch_name(). + * + * Since: 2.26 + */ +typedef enum +{ + G_BUS_NAME_WATCHER_FLAGS_NONE = 0, + G_BUS_NAME_WATCHER_FLAGS_AUTO_START = (1<<0) +} GBusNameWatcherFlags; + +/** + * GDBusProxyFlags: + * @G_DBUS_PROXY_FLAGS_NONE: No flags set. + * @G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES: Don't load properties. + * @G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS: Don't connect to signals on the remote object. + * @G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START: If not set and the proxy if for a well-known name, + * then request the bus to launch an owner for the name if no-one owns the name. This flag can + * only be used in proxies for well-known names. + * + * Flags used when constructing an instance of a #GDBusProxy derived class. + * + * Since: 2.26 + */ +typedef enum +{ + G_DBUS_PROXY_FLAGS_NONE = 0, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES = (1<<0), + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS = (1<<1), + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START = (1<<2) +} GDBusProxyFlags; + +/** + * GDBusError: + * @G_DBUS_ERROR_FAILED: + * A generic error; "something went wrong" - see the error message for + * more. + * @G_DBUS_ERROR_NO_MEMORY: + * There was not enough memory to complete an operation. + * @G_DBUS_ERROR_SERVICE_UNKNOWN: + * The bus doesn't know how to launch a service to supply the bus name + * you wanted. + * @G_DBUS_ERROR_NAME_HAS_NO_OWNER: + * The bus name you referenced doesn't exist (i.e. no application owns + * it). + * @G_DBUS_ERROR_NO_REPLY: + * No reply to a message expecting one, usually means a timeout occurred. + * @G_DBUS_ERROR_IO_ERROR: + * Something went wrong reading or writing to a socket, for example. + * @G_DBUS_ERROR_BAD_ADDRESS: + * A D-Bus bus address was malformed. + * @G_DBUS_ERROR_NOT_SUPPORTED: + * Requested operation isn't supported (like ENOSYS on UNIX). + * @G_DBUS_ERROR_LIMITS_EXCEEDED: + * Some limited resource is exhausted. + * @G_DBUS_ERROR_ACCESS_DENIED: + * Security restrictions don't allow doing what you're trying to do. + * @G_DBUS_ERROR_AUTH_FAILED: + * Authentication didn't work. + * @G_DBUS_ERROR_NO_SERVER: + * Unable to connect to server (probably caused by ECONNREFUSED on a + * socket). + * @G_DBUS_ERROR_TIMEOUT: + * Certain timeout errors, possibly ETIMEDOUT on a socket. Note that + * %G_DBUS_ERROR_NO_REPLY is used for message reply timeouts. Warning: + * this is confusingly-named given that %G_DBUS_ERROR_TIMED_OUT also + * exists. We can't fix it for compatibility reasons so just be + * careful. + * @G_DBUS_ERROR_NO_NETWORK: + * No network access (probably ENETUNREACH on a socket). + * @G_DBUS_ERROR_ADDRESS_IN_USE: + * Can't bind a socket since its address is in use (i.e. EADDRINUSE). + * @G_DBUS_ERROR_DISCONNECTED: + * The connection is disconnected and you're trying to use it. + * @G_DBUS_ERROR_INVALID_ARGS: + * Invalid arguments passed to a method call. + * @G_DBUS_ERROR_FILE_NOT_FOUND: + * Missing file. + * @G_DBUS_ERROR_FILE_EXISTS: + * Existing file and the operation you're using does not silently overwrite. + * @G_DBUS_ERROR_UNKNOWN_METHOD: + * Method name you invoked isn't known by the object you invoked it on. + * @G_DBUS_ERROR_TIMED_OUT: + * Certain timeout errors, e.g. while starting a service. Warning: this is + * confusingly-named given that %G_DBUS_ERROR_TIMEOUT also exists. We + * can't fix it for compatibility reasons so just be careful. + * @G_DBUS_ERROR_MATCH_RULE_NOT_FOUND: + * Tried to remove or modify a match rule that didn't exist. + * @G_DBUS_ERROR_MATCH_RULE_INVALID: + * The match rule isn't syntactically valid. + * @G_DBUS_ERROR_SPAWN_EXEC_FAILED: + * While starting a new process, the exec() call failed. + * @G_DBUS_ERROR_SPAWN_FORK_FAILED: + * While starting a new process, the fork() call failed. + * @G_DBUS_ERROR_SPAWN_CHILD_EXITED: + * While starting a new process, the child exited with a status code. + * @G_DBUS_ERROR_SPAWN_CHILD_SIGNALED: + * While starting a new process, the child exited on a signal. + * @G_DBUS_ERROR_SPAWN_FAILED: + * While starting a new process, something went wrong. + * @G_DBUS_ERROR_SPAWN_SETUP_FAILED: + * We failed to setup the environment correctly. + * @G_DBUS_ERROR_SPAWN_CONFIG_INVALID: + * We failed to setup the config parser correctly. + * @G_DBUS_ERROR_SPAWN_SERVICE_INVALID: + * Bus name was not valid. + * @G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND: + * Service file not found in system-services directory. + * @G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID: + * Permissions are incorrect on the setuid helper. + * @G_DBUS_ERROR_SPAWN_FILE_INVALID: + * Service file invalid (Name, User or Exec missing). + * @G_DBUS_ERROR_SPAWN_NO_MEMORY: + * Tried to get a UNIX process ID and it wasn't available. + * @G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN: + * Tried to get a UNIX process ID and it wasn't available. + * @G_DBUS_ERROR_INVALID_SIGNATURE: + * A type signature is not valid. + * @G_DBUS_ERROR_INVALID_FILE_CONTENT: + * A file contains invalid syntax or is otherwise broken. + * @G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN: + * Asked for SELinux security context and it wasn't available. + * @G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN: + * Asked for ADT audit data and it wasn't available. + * @G_DBUS_ERROR_OBJECT_PATH_IN_USE: + * There's already an object with the requested object path. + * + * Error codes for the %G_DBUS_ERROR error domain. + * + * Since: 2.26 + */ +typedef enum +{ + /* Well-known errors in the org.freedesktop.DBus.Error namespace */ + G_DBUS_ERROR_FAILED, /* org.freedesktop.DBus.Error.Failed */ + G_DBUS_ERROR_NO_MEMORY, /* org.freedesktop.DBus.Error.NoMemory */ + G_DBUS_ERROR_SERVICE_UNKNOWN, /* org.freedesktop.DBus.Error.ServiceUnknown */ + G_DBUS_ERROR_NAME_HAS_NO_OWNER, /* org.freedesktop.DBus.Error.NameHasNoOwner */ + G_DBUS_ERROR_NO_REPLY, /* org.freedesktop.DBus.Error.NoReply */ + G_DBUS_ERROR_IO_ERROR, /* org.freedesktop.DBus.Error.IOError */ + G_DBUS_ERROR_BAD_ADDRESS, /* org.freedesktop.DBus.Error.BadAddress */ + G_DBUS_ERROR_NOT_SUPPORTED, /* org.freedesktop.DBus.Error.NotSupported */ + G_DBUS_ERROR_LIMITS_EXCEEDED, /* org.freedesktop.DBus.Error.LimitsExceeded */ + G_DBUS_ERROR_ACCESS_DENIED, /* org.freedesktop.DBus.Error.AccessDenied */ + G_DBUS_ERROR_AUTH_FAILED, /* org.freedesktop.DBus.Error.AuthFailed */ + G_DBUS_ERROR_NO_SERVER, /* org.freedesktop.DBus.Error.NoServer */ + G_DBUS_ERROR_TIMEOUT, /* org.freedesktop.DBus.Error.Timeout */ + G_DBUS_ERROR_NO_NETWORK, /* org.freedesktop.DBus.Error.NoNetwork */ + G_DBUS_ERROR_ADDRESS_IN_USE, /* org.freedesktop.DBus.Error.AddressInUse */ + G_DBUS_ERROR_DISCONNECTED, /* org.freedesktop.DBus.Error.Disconnected */ + G_DBUS_ERROR_INVALID_ARGS, /* org.freedesktop.DBus.Error.InvalidArgs */ + G_DBUS_ERROR_FILE_NOT_FOUND, /* org.freedesktop.DBus.Error.FileNotFound */ + G_DBUS_ERROR_FILE_EXISTS, /* org.freedesktop.DBus.Error.FileExists */ + G_DBUS_ERROR_UNKNOWN_METHOD, /* org.freedesktop.DBus.Error.UnknownMethod */ + G_DBUS_ERROR_TIMED_OUT, /* org.freedesktop.DBus.Error.TimedOut */ + G_DBUS_ERROR_MATCH_RULE_NOT_FOUND, /* org.freedesktop.DBus.Error.MatchRuleNotFound */ + G_DBUS_ERROR_MATCH_RULE_INVALID, /* org.freedesktop.DBus.Error.MatchRuleInvalid */ + G_DBUS_ERROR_SPAWN_EXEC_FAILED, /* org.freedesktop.DBus.Error.Spawn.ExecFailed */ + G_DBUS_ERROR_SPAWN_FORK_FAILED, /* org.freedesktop.DBus.Error.Spawn.ForkFailed */ + G_DBUS_ERROR_SPAWN_CHILD_EXITED, /* org.freedesktop.DBus.Error.Spawn.ChildExited */ + G_DBUS_ERROR_SPAWN_CHILD_SIGNALED, /* org.freedesktop.DBus.Error.Spawn.ChildSignaled */ + G_DBUS_ERROR_SPAWN_FAILED, /* org.freedesktop.DBus.Error.Spawn.Failed */ + G_DBUS_ERROR_SPAWN_SETUP_FAILED, /* org.freedesktop.DBus.Error.Spawn.FailedToSetup */ + G_DBUS_ERROR_SPAWN_CONFIG_INVALID, /* org.freedesktop.DBus.Error.Spawn.ConfigInvalid */ + G_DBUS_ERROR_SPAWN_SERVICE_INVALID, /* org.freedesktop.DBus.Error.Spawn.ServiceNotValid */ + G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND, /* org.freedesktop.DBus.Error.Spawn.ServiceNotFound */ + G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID, /* org.freedesktop.DBus.Error.Spawn.PermissionsInvalid */ + G_DBUS_ERROR_SPAWN_FILE_INVALID, /* org.freedesktop.DBus.Error.Spawn.FileInvalid */ + G_DBUS_ERROR_SPAWN_NO_MEMORY, /* org.freedesktop.DBus.Error.Spawn.NoMemory */ + G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN, /* org.freedesktop.DBus.Error.UnixProcessIdUnknown */ + G_DBUS_ERROR_INVALID_SIGNATURE, /* org.freedesktop.DBus.Error.InvalidSignature */ + G_DBUS_ERROR_INVALID_FILE_CONTENT, /* org.freedesktop.DBus.Error.InvalidFileContent */ + G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, /* org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown */ + G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, /* org.freedesktop.DBus.Error.AdtAuditDataUnknown */ + G_DBUS_ERROR_OBJECT_PATH_IN_USE /* org.freedesktop.DBus.Error.ObjectPathInUse */ +} GDBusError; +/* Remember to update g_dbus_error_quark() in gdbuserror.c if you extend this enumeration */ + +/** + * GDBusConnectionFlags: + * @G_DBUS_CONNECTION_FLAGS_NONE: No flags set. + * @G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT: Perform authentication against server. + * @G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER: Perform authentication against client. + * @G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS: When + * authenticating as a server, allow the anonymous authentication + * method. + * @G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION: Pass this flag if connecting to a peer that is a + * message bus. This means that the Hello() method will be invoked as part of the connection setup. + * @G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING: If set, processing of D-Bus messages is + * delayed until g_dbus_connection_start_message_processing() is called. + * + * Flags used when creating a new #GDBusConnection. + * + * Since: 2.26 + */ +typedef enum { + G_DBUS_CONNECTION_FLAGS_NONE = 0, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT = (1<<0), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER = (1<<1), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<2), + G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION = (1<<3), + G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING = (1<<4) +} GDBusConnectionFlags; + +/** + * GDBusCapabilityFlags: + * @G_DBUS_CAPABILITY_FLAGS_NONE: No flags set. + * @G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING: The connection + * supports exchanging UNIX file descriptors with the remote peer. + * + * Capabilities negotiated with the remote peer. + * + * Since: 2.26 + */ +typedef enum { + G_DBUS_CAPABILITY_FLAGS_NONE = 0, + G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING = (1<<0) +} GDBusCapabilityFlags; + +/** + * GDBusCallFlags: + * @G_DBUS_CALL_FLAGS_NONE: No flags set. + * @G_DBUS_CALL_FLAGS_NO_AUTO_START: The bus must not launch + * an owner for the destination name in response to this method + * invocation. + * + * Flags used in g_dbus_connection_call() and similar APIs. + * + * Since: 2.26 + */ +typedef enum { + G_DBUS_CALL_FLAGS_NONE = 0, + G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0) +} GDBusCallFlags; + +/** + * GDBusMessageType: + * @G_DBUS_MESSAGE_TYPE_INVALID: Message is of invalid type. + * @G_DBUS_MESSAGE_TYPE_METHOD_CALL: Method call. + * @G_DBUS_MESSAGE_TYPE_METHOD_RETURN: Method reply. + * @G_DBUS_MESSAGE_TYPE_ERROR: Error reply. + * @G_DBUS_MESSAGE_TYPE_SIGNAL: Signal emission. + * + * Message types used in #GDBusMessage. + * + * Since: 2.26 + */ +typedef enum { + G_DBUS_MESSAGE_TYPE_INVALID, + G_DBUS_MESSAGE_TYPE_METHOD_CALL, + G_DBUS_MESSAGE_TYPE_METHOD_RETURN, + G_DBUS_MESSAGE_TYPE_ERROR, + G_DBUS_MESSAGE_TYPE_SIGNAL +} GDBusMessageType; + +/** + * GDBusMessageFlags: + * @G_DBUS_MESSAGE_FLAGS_NONE: No flags set. + * @G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED: A reply is not expected. + * @G_DBUS_MESSAGE_FLAGS_NO_AUTO_START: The bus must not launch an + * owner for the destination name in response to this message. + * + * Message flags used in #GDBusMessage. + * + * Since: 2.26 + */ +typedef enum { + G_DBUS_MESSAGE_FLAGS_NONE = 0, + G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED = (1<<0), + G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1) +} GDBusMessageFlags; + +/** + * GDBusMessageHeaderField: + * @G_DBUS_MESSAGE_HEADER_FIELD_INVALID: Not a valid header field. + * @G_DBUS_MESSAGE_HEADER_FIELD_PATH: The object path. + * @G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE: The interface name. + * @G_DBUS_MESSAGE_HEADER_FIELD_MEMBER: The method or signal name. + * @G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME: The name of the error that occurred. + * @G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL: The serial number the message is a reply to. + * @G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION: The name the message is intended for. + * @G_DBUS_MESSAGE_HEADER_FIELD_SENDER: Unique name of the sender of the message (filled in by the bus). + * @G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE: The signature of the message body. + * @G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS: The number of UNIX file descriptors that accompany the message. + * + * Header fields used in #GDBusMessage. + * + * Since: 2.26 + */ +typedef enum { + G_DBUS_MESSAGE_HEADER_FIELD_INVALID, + G_DBUS_MESSAGE_HEADER_FIELD_PATH, + G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE, + G_DBUS_MESSAGE_HEADER_FIELD_MEMBER, + G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME, + G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL, + G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION, + G_DBUS_MESSAGE_HEADER_FIELD_SENDER, + G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE, + G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS +} GDBusMessageHeaderField; + +/** + * GDBusPropertyInfoFlags: + * @G_DBUS_PROPERTY_INFO_FLAGS_NONE: No flags set. + * @G_DBUS_PROPERTY_INFO_FLAGS_READABLE: Property is readable. + * @G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE: Property is writable. + * + * Flags describing the access control of a D-Bus property. + * + * Since: 2.26 + */ +typedef enum +{ + G_DBUS_PROPERTY_INFO_FLAGS_NONE = 0, + G_DBUS_PROPERTY_INFO_FLAGS_READABLE = (1<<0), + G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE = (1<<1) +} GDBusPropertyInfoFlags; + +/** + * GDBusSubtreeFlags: + * @G_DBUS_SUBTREE_FLAGS_NONE: No flags set. + * @G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES: Method calls to objects not in the enumerated range + * will still be dispatched. This is useful if you want + * to dynamically spawn objects in the subtree. + * + * Flags passed to g_dbus_connection_register_subtree(). + * + * Since: 2.26 + */ +typedef enum +{ + G_DBUS_SUBTREE_FLAGS_NONE = 0, + G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES = (1<<0) +} GDBusSubtreeFlags; + +/** + * GDBusServerFlags: + * @G_DBUS_SERVER_FLAGS_NONE: No flags set. + * @G_DBUS_SERVER_FLAGS_RUN_IN_THREAD: All #GDBusServer::new-connection + * signals will run in separated dedicated threads (see signal for + * details). + * @G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS: Allow the anonymous + * authentication method. + * + * Flags used when creating a #GDBusServer. + * + * Since: 2.26 + */ +typedef enum +{ + G_DBUS_SERVER_FLAGS_NONE = 0, + G_DBUS_SERVER_FLAGS_RUN_IN_THREAD = (1<<0), + G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<1) +} GDBusServerFlags; + +/** + * GDBusSignalFlags: + * @G_DBUS_SIGNAL_FLAGS_NONE: No flags set. + * @G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE: Don't actually send the AddMatch + * DBus call for this signal subscription. This gives you more control + * over which match rules you add (but you must add them manually). + * + * Flags used when subscribing to signals via g_dbus_connection_signal_subscribe(). + * + * Since: 2.26 + */ +typedef enum /*< flags >*/ +{ + G_DBUS_SIGNAL_FLAGS_NONE = 0, + G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE = (1<<0) +} GDBusSignalFlags; + +/** + * GDBusSendMessageFlags: + * @G_DBUS_SEND_MESSAGE_FLAGS_NONE: No flags set. + * @G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL: Do not automatically + * assign a serial number from the #GDBusConnection object when + * sending a message. + * + * Flags used when sending #GDBusMessages on a #GDBusConnection. + * + * Since: 2.26 + */ +typedef enum +{ + G_DBUS_SEND_MESSAGE_FLAGS_NONE = 0, + G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL = (1<<0) +} GDBusSendMessageFlags; + +/** + * GCredentialsType: + * @G_CREDENTIALS_TYPE_INVALID: Indicates an invalid native credential type. + * @G_CREDENTIALS_TYPE_LINUX_UCRED: The native credentials type is a struct ucred. + * @G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED: The native credentials type is a struct cmsgcred. + * + * Enumeration describing different kinds of native credential types. + * + * Since: 2.26 + */ +typedef enum +{ + G_CREDENTIALS_TYPE_INVALID, + G_CREDENTIALS_TYPE_LINUX_UCRED, + G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED +} GCredentialsType; + +/** + * GDBusMessageByteOrder: + * @G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN: The byte order is big endian. + * @G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN: The byte order is little endian. + * + * Enumeration used to describe the byte order of a D-Bus message. + * + * Since: 2.26 + */ +typedef enum +{ + G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN = 'B', + G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN = 'l' +} GDBusMessageByteOrder; + +/** + * GApplicationFlags: + * @G_APPLICATION_FLAGS_NONE: Default + * @G_APPLICATION_IS_SERVICE: Run as a service. In this mode, registration + * fails if the service is already running, and the application will + * stay around for a while when the use count falls to zero. + * @G_APPLICATION_IS_LAUNCHER: Don't try to become the primary instance. + * @G_APPLICATION_HANDLES_OPEN: This application handles opening files (in the + * primary instance) + * @G_APPLICATION_HANDLES_COMMAND_LINE: This application handles command line + * arguments (in the primary instance) + * @G_APPLICATION_SEND_ENVIRONMENT: Send the environment of the + * launching process to the primary instance + * + * Flags used to define the behaviour of a #GApplication. + * + * Since: 2.26 + **/ +typedef enum +{ + G_APPLICATION_FLAGS_NONE, + G_APPLICATION_IS_SERVICE = (1 << 0), + G_APPLICATION_IS_LAUNCHER = (1 << 1), + + G_APPLICATION_HANDLES_OPEN = (1 << 2), + G_APPLICATION_HANDLES_COMMAND_LINE = (1 << 3), + G_APPLICATION_SEND_ENVIRONMENT = (1 << 4) +} GApplicationFlags; + +/** + * GTlsError: + * @G_TLS_ERROR_UNAVAILABLE: No TLS provider is available + * @G_TLS_ERROR_MISC: Miscellaneous TLS error + * @G_TLS_ERROR_BAD_CERTIFICATE: A certificate could not be parsed + * @G_TLS_ERROR_NOT_TLS: The TLS handshake failed because the + * peer does not seem to be a TLS server. + * @G_TLS_ERROR_HANDSHAKE: The TLS handshake failed because the + * peer's certificate was not acceptable. + * @G_TLS_ERROR_CERTIFICATE_REQUIRED: The TLS handshake failed because + * the server requested a client-side certificate, but none was + * provided. See g_tls_connection_set_certificate(). + * @G_TLS_ERROR_EOF: The TLS connection was closed without proper + * notice, which may indicate an attack. See + * g_tls_connection_set_require_close_notify(). + * + * An error code used with %G_TLS_ERROR in a #GError returned from a + * TLS-related routine. + * + * Since: 2.28 + */ +typedef enum { + G_TLS_ERROR_UNAVAILABLE, + G_TLS_ERROR_MISC, + G_TLS_ERROR_BAD_CERTIFICATE, + G_TLS_ERROR_NOT_TLS, + G_TLS_ERROR_HANDSHAKE, + G_TLS_ERROR_CERTIFICATE_REQUIRED, + G_TLS_ERROR_EOF +} GTlsError; + +/** + * GTlsCertificateFlags: + * @G_TLS_CERTIFICATE_UNKNOWN_CA: The signing certificate authority is + * not known. + * @G_TLS_CERTIFICATE_BAD_IDENTITY: The certificate does not match the + * expected identity of the site that it was retrieved from. + * @G_TLS_CERTIFICATE_NOT_ACTIVATED: The certificate's activation time + * is still in the future + * @G_TLS_CERTIFICATE_EXPIRED: The certificate has expired + * @G_TLS_CERTIFICATE_REVOKED: The certificate has been revoked + * according to the #GTlsContext's certificate revocation list. + * @G_TLS_CERTIFICATE_INSECURE: The certificate's algorithm is + * considered insecure. + * @G_TLS_CERTIFICATE_GENERIC_ERROR: Some other error occurred validating + * the certificate + * @G_TLS_CERTIFICATE_VALIDATE_ALL: the combination of all of the above + * flags + * + * A set of flags describing TLS certification validation. This can be + * used to set which validation steps to perform (eg, with + * g_tls_client_connection_set_validation_flags()), or to describe why + * a particular certificate was rejected (eg, in + * #GTlsConnection::accept-certificate). + * + * Since: 2.28 + */ +typedef enum { + G_TLS_CERTIFICATE_UNKNOWN_CA = (1 << 0), + G_TLS_CERTIFICATE_BAD_IDENTITY = (1 << 1), + G_TLS_CERTIFICATE_NOT_ACTIVATED = (1 << 2), + G_TLS_CERTIFICATE_EXPIRED = (1 << 3), + G_TLS_CERTIFICATE_REVOKED = (1 << 4), + G_TLS_CERTIFICATE_INSECURE = (1 << 5), + G_TLS_CERTIFICATE_GENERIC_ERROR = (1 << 6), + + G_TLS_CERTIFICATE_VALIDATE_ALL = 0x007f +} GTlsCertificateFlags; + +/** + * GTlsAuthenticationMode: + * @G_TLS_AUTHENTICATION_NONE: client authentication not required + * @G_TLS_AUTHENTICATION_REQUESTED: client authentication is requested + * @G_TLS_AUTHENTICATION_REQUIRED: client authentication is required + * + * The client authentication mode for a #GTlsServerConnection. + * + * Since: 2.28 + */ +typedef enum { + G_TLS_AUTHENTICATION_NONE, + G_TLS_AUTHENTICATION_REQUESTED, + G_TLS_AUTHENTICATION_REQUIRED +} GTlsAuthenticationMode; + +/** + * GTlsRehandshakeMode: + * @G_TLS_REHANDSHAKE_NEVER: Never allow rehandshaking + * @G_TLS_REHANDSHAKE_SAFELY: Allow safe rehandshaking only + * @G_TLS_REHANDSHAKE_UNSAFELY: Allow unsafe rehandshaking + * + * When to allow rehandshaking. See + * g_tls_connection_set_rehandshake_mode(). + * + * Since: 2.28 + */ +typedef enum { + G_TLS_REHANDSHAKE_NEVER, + G_TLS_REHANDSHAKE_SAFELY, + G_TLS_REHANDSHAKE_UNSAFELY +} GTlsRehandshakeMode; + G_END_DECLS #endif /* __GIO_ENUMS_H__ */ diff --git a/gio/gioenumtypes.c b/gio/gioenumtypes.c index 86e89cc..d848037 100644 --- a/gio/gioenumtypes.c +++ b/gio/gioenumtypes.c @@ -2,7 +2,6 @@ /* Generated data (by glib-mkenums) */ #include -#include "gioalias.h" /* enumerations from "gioenums.h" */ GType @@ -16,6 +15,7 @@ g_app_info_create_flags_get_type (void) { G_APP_INFO_CREATE_NONE, "G_APP_INFO_CREATE_NONE", "none" }, { G_APP_INFO_CREATE_NEEDS_TERMINAL, "G_APP_INFO_CREATE_NEEDS_TERMINAL", "needs-terminal" }, { G_APP_INFO_CREATE_SUPPORTS_URIS, "G_APP_INFO_CREATE_SUPPORTS_URIS", "supports-uris" }, + { G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION, "G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION", "supports-startup-notification" }, { 0, NULL, NULL } }; GType g_define_type_id = @@ -466,6 +466,14 @@ g_io_error_enum_get_type (void) { G_IO_ERROR_ADDRESS_IN_USE, "G_IO_ERROR_ADDRESS_IN_USE", "address-in-use" }, { G_IO_ERROR_PARTIAL_INPUT, "G_IO_ERROR_PARTIAL_INPUT", "partial-input" }, { G_IO_ERROR_INVALID_DATA, "G_IO_ERROR_INVALID_DATA", "invalid-data" }, + { G_IO_ERROR_DBUS_ERROR, "G_IO_ERROR_DBUS_ERROR", "dbus-error" }, + { G_IO_ERROR_HOST_UNREACHABLE, "G_IO_ERROR_HOST_UNREACHABLE", "host-unreachable" }, + { G_IO_ERROR_NETWORK_UNREACHABLE, "G_IO_ERROR_NETWORK_UNREACHABLE", "network-unreachable" }, + { G_IO_ERROR_CONNECTION_REFUSED, "G_IO_ERROR_CONNECTION_REFUSED", "connection-refused" }, + { G_IO_ERROR_PROXY_FAILED, "G_IO_ERROR_PROXY_FAILED", "proxy-failed" }, + { G_IO_ERROR_PROXY_AUTH_FAILED, "G_IO_ERROR_PROXY_AUTH_FAILED", "proxy-auth-failed" }, + { G_IO_ERROR_PROXY_NEED_AUTH, "G_IO_ERROR_PROXY_NEED_AUTH", "proxy-need-auth" }, + { G_IO_ERROR_PROXY_NOT_ALLOWED, "G_IO_ERROR_PROXY_NOT_ALLOWED", "proxy-not-allowed" }, { 0, NULL, NULL } }; GType g_define_type_id = @@ -563,6 +571,28 @@ g_output_stream_splice_flags_get_type (void) } GType +g_io_stream_splice_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_IO_STREAM_SPLICE_NONE, "G_IO_STREAM_SPLICE_NONE", "none" }, + { G_IO_STREAM_SPLICE_CLOSE_STREAM1, "G_IO_STREAM_SPLICE_CLOSE_STREAM1", "close-stream1" }, + { G_IO_STREAM_SPLICE_CLOSE_STREAM2, "G_IO_STREAM_SPLICE_CLOSE_STREAM2", "close-stream2" }, + { G_IO_STREAM_SPLICE_WAIT_FOR_BOTH, "G_IO_STREAM_SPLICE_WAIT_FOR_BOTH", "wait-for-both" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GIOStreamSpliceFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType g_emblem_origin_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -715,8 +745,594 @@ g_zlib_compressor_format_get_type (void) return g_define_type_id__volatile; } -#define __GIO_ENUM_TYPES_C__ -#include "gioaliasdef.c" +GType +g_unix_socket_address_type_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_UNIX_SOCKET_ADDRESS_INVALID, "G_UNIX_SOCKET_ADDRESS_INVALID", "invalid" }, + { G_UNIX_SOCKET_ADDRESS_ANONYMOUS, "G_UNIX_SOCKET_ADDRESS_ANONYMOUS", "anonymous" }, + { G_UNIX_SOCKET_ADDRESS_PATH, "G_UNIX_SOCKET_ADDRESS_PATH", "path" }, + { G_UNIX_SOCKET_ADDRESS_ABSTRACT, "G_UNIX_SOCKET_ADDRESS_ABSTRACT", "abstract" }, + { G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, "G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED", "abstract-padded" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GUnixSocketAddressType"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_bus_type_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_BUS_TYPE_STARTER, "G_BUS_TYPE_STARTER", "starter" }, + { G_BUS_TYPE_NONE, "G_BUS_TYPE_NONE", "none" }, + { G_BUS_TYPE_SYSTEM, "G_BUS_TYPE_SYSTEM", "system" }, + { G_BUS_TYPE_SESSION, "G_BUS_TYPE_SESSION", "session" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GBusType"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_bus_name_owner_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_BUS_NAME_OWNER_FLAGS_NONE, "G_BUS_NAME_OWNER_FLAGS_NONE", "none" }, + { G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, "G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT", "allow-replacement" }, + { G_BUS_NAME_OWNER_FLAGS_REPLACE, "G_BUS_NAME_OWNER_FLAGS_REPLACE", "replace" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GBusNameOwnerFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_bus_name_watcher_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_BUS_NAME_WATCHER_FLAGS_NONE, "G_BUS_NAME_WATCHER_FLAGS_NONE", "none" }, + { G_BUS_NAME_WATCHER_FLAGS_AUTO_START, "G_BUS_NAME_WATCHER_FLAGS_AUTO_START", "auto-start" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GBusNameWatcherFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_proxy_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_PROXY_FLAGS_NONE, "G_DBUS_PROXY_FLAGS_NONE", "none" }, + { G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES", "do-not-load-properties" }, + { G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, "G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS", "do-not-connect-signals" }, + { G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START", "do-not-auto-start" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusProxyFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_error_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_DBUS_ERROR_FAILED, "G_DBUS_ERROR_FAILED", "failed" }, + { G_DBUS_ERROR_NO_MEMORY, "G_DBUS_ERROR_NO_MEMORY", "no-memory" }, + { G_DBUS_ERROR_SERVICE_UNKNOWN, "G_DBUS_ERROR_SERVICE_UNKNOWN", "service-unknown" }, + { G_DBUS_ERROR_NAME_HAS_NO_OWNER, "G_DBUS_ERROR_NAME_HAS_NO_OWNER", "name-has-no-owner" }, + { G_DBUS_ERROR_NO_REPLY, "G_DBUS_ERROR_NO_REPLY", "no-reply" }, + { G_DBUS_ERROR_IO_ERROR, "G_DBUS_ERROR_IO_ERROR", "io-error" }, + { G_DBUS_ERROR_BAD_ADDRESS, "G_DBUS_ERROR_BAD_ADDRESS", "bad-address" }, + { G_DBUS_ERROR_NOT_SUPPORTED, "G_DBUS_ERROR_NOT_SUPPORTED", "not-supported" }, + { G_DBUS_ERROR_LIMITS_EXCEEDED, "G_DBUS_ERROR_LIMITS_EXCEEDED", "limits-exceeded" }, + { G_DBUS_ERROR_ACCESS_DENIED, "G_DBUS_ERROR_ACCESS_DENIED", "access-denied" }, + { G_DBUS_ERROR_AUTH_FAILED, "G_DBUS_ERROR_AUTH_FAILED", "auth-failed" }, + { G_DBUS_ERROR_NO_SERVER, "G_DBUS_ERROR_NO_SERVER", "no-server" }, + { G_DBUS_ERROR_TIMEOUT, "G_DBUS_ERROR_TIMEOUT", "timeout" }, + { G_DBUS_ERROR_NO_NETWORK, "G_DBUS_ERROR_NO_NETWORK", "no-network" }, + { G_DBUS_ERROR_ADDRESS_IN_USE, "G_DBUS_ERROR_ADDRESS_IN_USE", "address-in-use" }, + { G_DBUS_ERROR_DISCONNECTED, "G_DBUS_ERROR_DISCONNECTED", "disconnected" }, + { G_DBUS_ERROR_INVALID_ARGS, "G_DBUS_ERROR_INVALID_ARGS", "invalid-args" }, + { G_DBUS_ERROR_FILE_NOT_FOUND, "G_DBUS_ERROR_FILE_NOT_FOUND", "file-not-found" }, + { G_DBUS_ERROR_FILE_EXISTS, "G_DBUS_ERROR_FILE_EXISTS", "file-exists" }, + { G_DBUS_ERROR_UNKNOWN_METHOD, "G_DBUS_ERROR_UNKNOWN_METHOD", "unknown-method" }, + { G_DBUS_ERROR_TIMED_OUT, "G_DBUS_ERROR_TIMED_OUT", "timed-out" }, + { G_DBUS_ERROR_MATCH_RULE_NOT_FOUND, "G_DBUS_ERROR_MATCH_RULE_NOT_FOUND", "match-rule-not-found" }, + { G_DBUS_ERROR_MATCH_RULE_INVALID, "G_DBUS_ERROR_MATCH_RULE_INVALID", "match-rule-invalid" }, + { G_DBUS_ERROR_SPAWN_EXEC_FAILED, "G_DBUS_ERROR_SPAWN_EXEC_FAILED", "spawn-exec-failed" }, + { G_DBUS_ERROR_SPAWN_FORK_FAILED, "G_DBUS_ERROR_SPAWN_FORK_FAILED", "spawn-fork-failed" }, + { G_DBUS_ERROR_SPAWN_CHILD_EXITED, "G_DBUS_ERROR_SPAWN_CHILD_EXITED", "spawn-child-exited" }, + { G_DBUS_ERROR_SPAWN_CHILD_SIGNALED, "G_DBUS_ERROR_SPAWN_CHILD_SIGNALED", "spawn-child-signaled" }, + { G_DBUS_ERROR_SPAWN_FAILED, "G_DBUS_ERROR_SPAWN_FAILED", "spawn-failed" }, + { G_DBUS_ERROR_SPAWN_SETUP_FAILED, "G_DBUS_ERROR_SPAWN_SETUP_FAILED", "spawn-setup-failed" }, + { G_DBUS_ERROR_SPAWN_CONFIG_INVALID, "G_DBUS_ERROR_SPAWN_CONFIG_INVALID", "spawn-config-invalid" }, + { G_DBUS_ERROR_SPAWN_SERVICE_INVALID, "G_DBUS_ERROR_SPAWN_SERVICE_INVALID", "spawn-service-invalid" }, + { G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND, "G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND", "spawn-service-not-found" }, + { G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID, "G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID", "spawn-permissions-invalid" }, + { G_DBUS_ERROR_SPAWN_FILE_INVALID, "G_DBUS_ERROR_SPAWN_FILE_INVALID", "spawn-file-invalid" }, + { G_DBUS_ERROR_SPAWN_NO_MEMORY, "G_DBUS_ERROR_SPAWN_NO_MEMORY", "spawn-no-memory" }, + { G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN, "G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN", "unix-process-id-unknown" }, + { G_DBUS_ERROR_INVALID_SIGNATURE, "G_DBUS_ERROR_INVALID_SIGNATURE", "invalid-signature" }, + { G_DBUS_ERROR_INVALID_FILE_CONTENT, "G_DBUS_ERROR_INVALID_FILE_CONTENT", "invalid-file-content" }, + { G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, "G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN", "selinux-security-context-unknown" }, + { G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, "G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN", "adt-audit-data-unknown" }, + { G_DBUS_ERROR_OBJECT_PATH_IN_USE, "G_DBUS_ERROR_OBJECT_PATH_IN_USE", "object-path-in-use" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GDBusError"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_connection_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_CONNECTION_FLAGS_NONE, "G_DBUS_CONNECTION_FLAGS_NONE", "none" }, + { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT", "authentication-client" }, + { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER", "authentication-server" }, + { G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS, "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS", "authentication-allow-anonymous" }, + { G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, "G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION", "message-bus-connection" }, + { G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, "G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING", "delay-message-processing" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusConnectionFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_capability_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_CAPABILITY_FLAGS_NONE, "G_DBUS_CAPABILITY_FLAGS_NONE", "none" }, + { G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING, "G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING", "unix-fd-passing" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusCapabilityFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_call_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_CALL_FLAGS_NONE, "G_DBUS_CALL_FLAGS_NONE", "none" }, + { G_DBUS_CALL_FLAGS_NO_AUTO_START, "G_DBUS_CALL_FLAGS_NO_AUTO_START", "no-auto-start" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusCallFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_message_type_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_DBUS_MESSAGE_TYPE_INVALID, "G_DBUS_MESSAGE_TYPE_INVALID", "invalid" }, + { G_DBUS_MESSAGE_TYPE_METHOD_CALL, "G_DBUS_MESSAGE_TYPE_METHOD_CALL", "method-call" }, + { G_DBUS_MESSAGE_TYPE_METHOD_RETURN, "G_DBUS_MESSAGE_TYPE_METHOD_RETURN", "method-return" }, + { G_DBUS_MESSAGE_TYPE_ERROR, "G_DBUS_MESSAGE_TYPE_ERROR", "error" }, + { G_DBUS_MESSAGE_TYPE_SIGNAL, "G_DBUS_MESSAGE_TYPE_SIGNAL", "signal" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GDBusMessageType"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_message_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_MESSAGE_FLAGS_NONE, "G_DBUS_MESSAGE_FLAGS_NONE", "none" }, + { G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED, "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED", "no-reply-expected" }, + { G_DBUS_MESSAGE_FLAGS_NO_AUTO_START, "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START", "no-auto-start" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusMessageFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_message_header_field_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_DBUS_MESSAGE_HEADER_FIELD_INVALID, "G_DBUS_MESSAGE_HEADER_FIELD_INVALID", "invalid" }, + { G_DBUS_MESSAGE_HEADER_FIELD_PATH, "G_DBUS_MESSAGE_HEADER_FIELD_PATH", "path" }, + { G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE, "G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE", "interface" }, + { G_DBUS_MESSAGE_HEADER_FIELD_MEMBER, "G_DBUS_MESSAGE_HEADER_FIELD_MEMBER", "member" }, + { G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME, "G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME", "error-name" }, + { G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL, "G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL", "reply-serial" }, + { G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION, "G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION", "destination" }, + { G_DBUS_MESSAGE_HEADER_FIELD_SENDER, "G_DBUS_MESSAGE_HEADER_FIELD_SENDER", "sender" }, + { G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE, "G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE", "signature" }, + { G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS, "G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS", "num-unix-fds" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GDBusMessageHeaderField"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_property_info_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_PROPERTY_INFO_FLAGS_NONE, "G_DBUS_PROPERTY_INFO_FLAGS_NONE", "none" }, + { G_DBUS_PROPERTY_INFO_FLAGS_READABLE, "G_DBUS_PROPERTY_INFO_FLAGS_READABLE", "readable" }, + { G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, "G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE", "writable" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusPropertyInfoFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_subtree_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_SUBTREE_FLAGS_NONE, "G_DBUS_SUBTREE_FLAGS_NONE", "none" }, + { G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES, "G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES", "dispatch-to-unenumerated-nodes" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusSubtreeFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_server_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_SERVER_FLAGS_NONE, "G_DBUS_SERVER_FLAGS_NONE", "none" }, + { G_DBUS_SERVER_FLAGS_RUN_IN_THREAD, "G_DBUS_SERVER_FLAGS_RUN_IN_THREAD", "run-in-thread" }, + { G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS, "G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS", "authentication-allow-anonymous" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusServerFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_signal_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_SIGNAL_FLAGS_NONE, "G_DBUS_SIGNAL_FLAGS_NONE", "none" }, + { G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE", "no-match-rule" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusSignalFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_send_message_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_DBUS_SEND_MESSAGE_FLAGS_NONE, "G_DBUS_SEND_MESSAGE_FLAGS_NONE", "none" }, + { G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL, "G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL", "preserve-serial" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GDBusSendMessageFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_credentials_type_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_CREDENTIALS_TYPE_INVALID, "G_CREDENTIALS_TYPE_INVALID", "invalid" }, + { G_CREDENTIALS_TYPE_LINUX_UCRED, "G_CREDENTIALS_TYPE_LINUX_UCRED", "linux-ucred" }, + { G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED, "G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED", "freebsd-cmsgcred" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GCredentialsType"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_dbus_message_byte_order_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN, "G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN", "big-endian" }, + { G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN, "G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN", "little-endian" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GDBusMessageByteOrder"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_application_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_APPLICATION_FLAGS_NONE, "G_APPLICATION_FLAGS_NONE", "flags-none" }, + { G_APPLICATION_IS_SERVICE, "G_APPLICATION_IS_SERVICE", "is-service" }, + { G_APPLICATION_IS_LAUNCHER, "G_APPLICATION_IS_LAUNCHER", "is-launcher" }, + { G_APPLICATION_HANDLES_OPEN, "G_APPLICATION_HANDLES_OPEN", "handles-open" }, + { G_APPLICATION_HANDLES_COMMAND_LINE, "G_APPLICATION_HANDLES_COMMAND_LINE", "handles-command-line" }, + { G_APPLICATION_SEND_ENVIRONMENT, "G_APPLICATION_SEND_ENVIRONMENT", "send-environment" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GApplicationFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_tls_error_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_TLS_ERROR_UNAVAILABLE, "G_TLS_ERROR_UNAVAILABLE", "unavailable" }, + { G_TLS_ERROR_MISC, "G_TLS_ERROR_MISC", "misc" }, + { G_TLS_ERROR_BAD_CERTIFICATE, "G_TLS_ERROR_BAD_CERTIFICATE", "bad-certificate" }, + { G_TLS_ERROR_NOT_TLS, "G_TLS_ERROR_NOT_TLS", "not-tls" }, + { G_TLS_ERROR_HANDSHAKE, "G_TLS_ERROR_HANDSHAKE", "handshake" }, + { G_TLS_ERROR_CERTIFICATE_REQUIRED, "G_TLS_ERROR_CERTIFICATE_REQUIRED", "certificate-required" }, + { G_TLS_ERROR_EOF, "G_TLS_ERROR_EOF", "eof" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GTlsError"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_tls_certificate_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_TLS_CERTIFICATE_UNKNOWN_CA, "G_TLS_CERTIFICATE_UNKNOWN_CA", "unknown-ca" }, + { G_TLS_CERTIFICATE_BAD_IDENTITY, "G_TLS_CERTIFICATE_BAD_IDENTITY", "bad-identity" }, + { G_TLS_CERTIFICATE_NOT_ACTIVATED, "G_TLS_CERTIFICATE_NOT_ACTIVATED", "not-activated" }, + { G_TLS_CERTIFICATE_EXPIRED, "G_TLS_CERTIFICATE_EXPIRED", "expired" }, + { G_TLS_CERTIFICATE_REVOKED, "G_TLS_CERTIFICATE_REVOKED", "revoked" }, + { G_TLS_CERTIFICATE_INSECURE, "G_TLS_CERTIFICATE_INSECURE", "insecure" }, + { G_TLS_CERTIFICATE_GENERIC_ERROR, "G_TLS_CERTIFICATE_GENERIC_ERROR", "generic-error" }, + { G_TLS_CERTIFICATE_VALIDATE_ALL, "G_TLS_CERTIFICATE_VALIDATE_ALL", "validate-all" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GTlsCertificateFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_tls_authentication_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_TLS_AUTHENTICATION_NONE, "G_TLS_AUTHENTICATION_NONE", "none" }, + { G_TLS_AUTHENTICATION_REQUESTED, "G_TLS_AUTHENTICATION_REQUESTED", "requested" }, + { G_TLS_AUTHENTICATION_REQUIRED, "G_TLS_AUTHENTICATION_REQUIRED", "required" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GTlsAuthenticationMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +GType +g_tls_rehandshake_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { G_TLS_REHANDSHAKE_NEVER, "G_TLS_REHANDSHAKE_NEVER", "never" }, + { G_TLS_REHANDSHAKE_SAFELY, "G_TLS_REHANDSHAKE_SAFELY", "safely" }, + { G_TLS_REHANDSHAKE_UNSAFELY, "G_TLS_REHANDSHAKE_UNSAFELY", "unsafely" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("GTlsRehandshakeMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +/* enumerations from "gsettings.h" */ +GType +g_settings_bind_flags_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { G_SETTINGS_BIND_DEFAULT, "G_SETTINGS_BIND_DEFAULT", "default" }, + { G_SETTINGS_BIND_GET, "G_SETTINGS_BIND_GET", "get" }, + { G_SETTINGS_BIND_SET, "G_SETTINGS_BIND_SET", "set" }, + { G_SETTINGS_BIND_NO_SENSITIVITY, "G_SETTINGS_BIND_NO_SENSITIVITY", "no-sensitivity" }, + { G_SETTINGS_BIND_GET_NO_CHANGES, "G_SETTINGS_BIND_GET_NO_CHANGES", "get-no-changes" }, + { G_SETTINGS_BIND_INVERT_BOOLEAN, "G_SETTINGS_BIND_INVERT_BOOLEAN", "invert-boolean" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("GSettingsBindFlags"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + /* Generated data ends here */ diff --git a/gio/gioenumtypes.c.template b/gio/gioenumtypes.c.template index 46db905..ac2c391 100644 --- a/gio/gioenumtypes.c.template +++ b/gio/gioenumtypes.c.template @@ -1,6 +1,5 @@ /*** BEGIN file-header ***/ #include -#include "gioalias.h" /*** END file-header ***/ @@ -35,8 +34,3 @@ GType } /*** END value-tail ***/ - -/*** BEGIN file-tail ***/ -#define __GIO_ENUM_TYPES_C__ -#include "gioaliasdef.c" -/*** END file-tail ***/ diff --git a/gio/gioenumtypes.h b/gio/gioenumtypes.h index 1b81c4b..2e17b00 100644 --- a/gio/gioenumtypes.h +++ b/gio/gioenumtypes.h @@ -57,6 +57,8 @@ GType g_mount_operation_result_get_type (void) G_GNUC_CONST; #define G_TYPE_MOUNT_OPERATION_RESULT (g_mount_operation_result_get_type ()) GType g_output_stream_splice_flags_get_type (void) G_GNUC_CONST; #define G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS (g_output_stream_splice_flags_get_type ()) +GType g_io_stream_splice_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_IO_STREAM_SPLICE_FLAGS (g_io_stream_splice_flags_get_type ()) GType g_emblem_origin_get_type (void) G_GNUC_CONST; #define G_TYPE_EMBLEM_ORIGIN (g_emblem_origin_get_type ()) GType g_resolver_error_get_type (void) G_GNUC_CONST; @@ -71,6 +73,58 @@ GType g_socket_protocol_get_type (void) G_GNUC_CONST; #define G_TYPE_SOCKET_PROTOCOL (g_socket_protocol_get_type ()) GType g_zlib_compressor_format_get_type (void) G_GNUC_CONST; #define G_TYPE_ZLIB_COMPRESSOR_FORMAT (g_zlib_compressor_format_get_type ()) +GType g_unix_socket_address_type_get_type (void) G_GNUC_CONST; +#define G_TYPE_UNIX_SOCKET_ADDRESS_TYPE (g_unix_socket_address_type_get_type ()) +GType g_bus_type_get_type (void) G_GNUC_CONST; +#define G_TYPE_BUS_TYPE (g_bus_type_get_type ()) +GType g_bus_name_owner_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_BUS_NAME_OWNER_FLAGS (g_bus_name_owner_flags_get_type ()) +GType g_bus_name_watcher_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_BUS_NAME_WATCHER_FLAGS (g_bus_name_watcher_flags_get_type ()) +GType g_dbus_proxy_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_PROXY_FLAGS (g_dbus_proxy_flags_get_type ()) +GType g_dbus_error_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_ERROR (g_dbus_error_get_type ()) +GType g_dbus_connection_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_CONNECTION_FLAGS (g_dbus_connection_flags_get_type ()) +GType g_dbus_capability_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_CAPABILITY_FLAGS (g_dbus_capability_flags_get_type ()) +GType g_dbus_call_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_CALL_FLAGS (g_dbus_call_flags_get_type ()) +GType g_dbus_message_type_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_MESSAGE_TYPE (g_dbus_message_type_get_type ()) +GType g_dbus_message_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_MESSAGE_FLAGS (g_dbus_message_flags_get_type ()) +GType g_dbus_message_header_field_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_MESSAGE_HEADER_FIELD (g_dbus_message_header_field_get_type ()) +GType g_dbus_property_info_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_PROPERTY_INFO_FLAGS (g_dbus_property_info_flags_get_type ()) +GType g_dbus_subtree_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_SUBTREE_FLAGS (g_dbus_subtree_flags_get_type ()) +GType g_dbus_server_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_SERVER_FLAGS (g_dbus_server_flags_get_type ()) +GType g_dbus_signal_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_SIGNAL_FLAGS (g_dbus_signal_flags_get_type ()) +GType g_dbus_send_message_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_SEND_MESSAGE_FLAGS (g_dbus_send_message_flags_get_type ()) +GType g_credentials_type_get_type (void) G_GNUC_CONST; +#define G_TYPE_CREDENTIALS_TYPE (g_credentials_type_get_type ()) +GType g_dbus_message_byte_order_get_type (void) G_GNUC_CONST; +#define G_TYPE_DBUS_MESSAGE_BYTE_ORDER (g_dbus_message_byte_order_get_type ()) +GType g_application_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_APPLICATION_FLAGS (g_application_flags_get_type ()) +GType g_tls_error_get_type (void) G_GNUC_CONST; +#define G_TYPE_TLS_ERROR (g_tls_error_get_type ()) +GType g_tls_certificate_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_TLS_CERTIFICATE_FLAGS (g_tls_certificate_flags_get_type ()) +GType g_tls_authentication_mode_get_type (void) G_GNUC_CONST; +#define G_TYPE_TLS_AUTHENTICATION_MODE (g_tls_authentication_mode_get_type ()) +GType g_tls_rehandshake_mode_get_type (void) G_GNUC_CONST; +#define G_TYPE_TLS_REHANDSHAKE_MODE (g_tls_rehandshake_mode_get_type ()) + +/* enumerations from "gsettings.h" */ +GType g_settings_bind_flags_get_type (void) G_GNUC_CONST; +#define G_TYPE_SETTINGS_BIND_FLAGS (g_settings_bind_flags_get_type ()) G_END_DECLS #endif /* __GIO_ENUM_TYPES_H__ */ diff --git a/gio/gioerror.c b/gio/gioerror.c index 287cb2b..dda802d 100644 --- a/gio/gioerror.c +++ b/gio/gioerror.c @@ -24,7 +24,6 @@ #include #include "gioerror.h" -#include "gioalias.h" /** * SECTION:gioerror @@ -200,11 +199,53 @@ g_io_error_from_errno (gint err_no) break; #endif +#ifdef EHOSTUNREACH + case EHOSTUNREACH: + return G_IO_ERROR_HOST_UNREACHABLE; + break; +#endif + +#ifdef ENETUNREACH + case ENETUNREACH: + return G_IO_ERROR_NETWORK_UNREACHABLE; + break; +#endif + +#ifdef ECONNREFUSED + case ECONNREFUSED: + return G_IO_ERROR_CONNECTION_REFUSED; + break; +#endif + default: return G_IO_ERROR_FAILED; break; } } -#define __G_IO_ERROR_C__ -#include "gioaliasdef.c" +#ifdef G_OS_WIN32 + +/** + * g_io_error_from_win32_error: + * @error_code: Windows error number. + * + * Converts some common error codes into GIO error codes. The + * fallback value G_IO_ERROR_FAILED is returned for error codes not + * handled. + * + * Returns: #GIOErrorEnum value for the given error number. + * + * Since: 2.26 + **/ +GIOErrorEnum +g_io_error_from_win32_error (gint error_code) +{ + switch (error_code) + { + default: + return G_IO_ERROR_FAILED; + break; + } +} + +#endif diff --git a/gio/gioerror.h b/gio/gioerror.h index c1dc377..12c2b06 100644 --- a/gio/gioerror.h +++ b/gio/gioerror.h @@ -43,6 +43,10 @@ G_BEGIN_DECLS GQuark g_io_error_quark (void); GIOErrorEnum g_io_error_from_errno (gint err_no); +#ifdef G_OS_WIN32 +GIOErrorEnum g_io_error_from_win32_error (gint error_code); +#endif + G_END_DECLS #endif /* __G_IO_ERROR_H__ */ diff --git a/gio/giomodule.c b/gio/giomodule.c index 1f2e0bc..cb05270 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -26,15 +26,27 @@ #include "giomodule.h" #include "giomodule-priv.h" +#include "gmemorysettingsbackend.h" #include "glocalfilemonitor.h" #include "glocaldirectorymonitor.h" #include "gnativevolumemonitor.h" +#include "gproxyresolver.h" +#include "gproxy.h" +#include "gsocks4proxy.h" +#include "gsocks4aproxy.h" +#include "gsocks5proxy.h" +#include "gtlsbackend.h" #include "gvfs.h" +#ifdef G_OS_WIN32 +#include "gregistrysettingsbackend.h" +#endif +#include + +#undef G_DISABLE_DEPRECATED + #ifdef G_OS_UNIX #include "gdesktopappinfo.h" #endif -#include "gioalias.h" -#include /** * SECTION:giomodule @@ -89,7 +101,13 @@ * it uses the implementations that have been associated with it. * Depending on the use case, it may use all implementations, or * only the one with the highest priority, or pick a specific - * one by name. + * one by name. + * + * To avoid opening all modules just to find out what extension + * points they implement, GIO makes use of a caching mechanism, + * see gio-querymodules. + * You are expected to run this command after installing a + * GIO module. */ struct _GIOModule { GTypeModule parent_instance; @@ -260,7 +278,7 @@ is_valid_module_name (const gchar *basename) * g_io_extension_point_get_extension_by_name(). * * If you need to guarantee that all types are loaded in all the modules, - * use g_io_modules_scan_all_in_directory(). + * use g_io_modules_load_all_in_directory(). * * Since: 2.24 **/ @@ -270,11 +288,7 @@ g_io_modules_scan_all_in_directory (const char *dirname) const gchar *name; char *filename; GDir *dir; -#ifdef G_OS_WIN32 - struct _g_stat_struct statbuf; -#else - struct stat statbuf; -#endif + GStatBuf statbuf; char *data; time_t cache_mtime; GHashTable *cache; @@ -401,7 +415,8 @@ g_io_modules_scan_all_in_directory (const char *dirname) * all gtypes) then you can use g_io_modules_scan_all_in_directory() * which allows delayed/lazy loading of modules. * - * Returns: a list of #GIOModules loaded from the directory, + * Returns: (element-type GIOModule) (transfer full): a list of #GIOModules loaded + * from the directory, * All the modules are loaded into memory, if you want to * unload them (enabling on-demand loading) you must call * g_type_module_unuse() on all the modules. Free the list @@ -465,6 +480,9 @@ extern GType _g_win32_volume_monitor_get_type (void); extern GType g_win32_directory_monitor_get_type (void); extern GType _g_winhttp_vfs_get_type (void); +extern GType _g_dummy_proxy_resolver_get_type (void); +extern GType _g_dummy_tls_backend_get_type (void); + #ifdef G_PLATFORM_WIN32 #include @@ -511,9 +529,11 @@ _g_io_modules_ensure_extension_points_registered (void) registered_extensions = TRUE; #ifdef G_OS_UNIX +#if !GLIB_CHECK_VERSION (3, 0, 0) ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME); g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP); #endif +#endif ep = g_io_extension_point_register (G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME); g_io_extension_point_set_required_type (ep, G_TYPE_LOCAL_DIRECTORY_MONITOR); @@ -532,6 +552,15 @@ _g_io_modules_ensure_extension_points_registered (void) ep = g_io_extension_point_register ("gsettings-backend"); g_io_extension_point_set_required_type (ep, G_TYPE_OBJECT); + + ep = g_io_extension_point_register (G_PROXY_RESOLVER_EXTENSION_POINT_NAME); + g_io_extension_point_set_required_type (ep, G_TYPE_PROXY_RESOLVER); + + ep = g_io_extension_point_register (G_PROXY_EXTENSION_POINT_NAME); + g_io_extension_point_set_required_type (ep, G_TYPE_PROXY); + + ep = g_io_extension_point_register (G_TLS_BACKEND_EXTENSION_POINT_NAME); + g_io_extension_point_set_required_type (ep, G_TYPE_TLS_BACKEND); } G_UNLOCK (registered_extensions); @@ -569,6 +598,7 @@ _g_io_modules_ensure_loaded (void) } /* Initialize types from built-in "modules" */ + g_memory_settings_backend_get_type (); #if defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_LINUX_INOTIFY_H) _g_inotify_directory_monitor_get_type (); _g_inotify_file_monitor_get_type (); @@ -580,6 +610,7 @@ _g_io_modules_ensure_loaded (void) #ifdef G_OS_WIN32 _g_win32_volume_monitor_get_type (); g_win32_directory_monitor_get_type (); + g_registry_backend_get_type (); #endif #ifdef G_OS_UNIX _g_unix_volume_monitor_get_type (); @@ -588,6 +619,11 @@ _g_io_modules_ensure_loaded (void) _g_winhttp_vfs_get_type (); #endif _g_local_vfs_get_type (); + _g_dummy_proxy_resolver_get_type (); + _g_socks4a_proxy_get_type (); + _g_socks4_proxy_get_type (); + _g_socks5_proxy_get_type (); + _g_dummy_tls_backend_get_type (); } G_UNLOCK (loaded_dirs); @@ -720,9 +756,10 @@ lazy_load_modules (GIOExtensionPoint *extension_point) * * Gets a list of all extensions that implement this extension point. * The list is sorted by priority, beginning with the highest priority. - * - * Returns: a #GList of #GIOExtensions. The list is owned by - * GIO and should not be modified + * + * Returns: (element-type GIOExtension) (transfer none): a #GList of + * #GIOExtensions. The list is owned by GIO and should not be + * modified. */ GList * g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point) @@ -738,7 +775,7 @@ g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point) * * Finds a #GIOExtension for an extension point by name. * - * Returns: the #GIOExtension for @extension_point that has the + * Returns: (transfer none): the #GIOExtension for @extension_point that has the * given name, or %NULL if there is no extension with that name */ GIOExtension * @@ -766,7 +803,13 @@ extension_prio_compare (gconstpointer a, { const GIOExtension *extension_a = a, *extension_b = b; - return extension_b->priority - extension_a->priority; + if (extension_a->priority > extension_b->priority) + return -1; + + if (extension_b->priority > extension_a->priority) + return 1; + + return 0; } /** @@ -840,7 +883,7 @@ g_io_extension_point_implement (const char *extension_point_name, * Gets a reference to the class for the type that is * associated with @extension. * - * Returns: the #GTypeClass for the type of @extension + * Returns: (transfer full): the #GTypeClass for the type of @extension */ GTypeClass * g_io_extension_ref_class (GIOExtension *extension) @@ -892,6 +935,3 @@ g_io_extension_get_priority (GIOExtension *extension) { return extension->priority; } - -#define __G_IO_MODULE_C__ -#include "gioaliasdef.c" diff --git a/gio/giomodule.h b/gio/giomodule.h index 035059a..89619c8 100644 --- a/gio/giomodule.h +++ b/gio/giomodule.h @@ -119,7 +119,7 @@ void g_io_module_unload (GIOModule *module); * run gio-querymodules in order to build the cache files required for * lazy loading. * - * Returns: A %NULL-terminated array of strings, listing the supported + * Returns: (transfer full): A %NULL-terminated array of strings, listing the supported * extension points of the module. The array must be suitable for * freeing with g_strfreev(). * diff --git a/gio/gioscheduler.c b/gio/gioscheduler.c index 1787266..61e1afc 100644 --- a/gio/gioscheduler.c +++ b/gio/gioscheduler.c @@ -25,7 +25,6 @@ #include "gioscheduler.h" #include "gcancellable.h" -#include "gioalias.h" /** * SECTION:gioscheduler @@ -460,7 +459,3 @@ g_io_scheduler_job_send_to_mainloop_async (GIOSchedulerJob *job, g_source_attach (source, job->context); g_source_unref (source); } - - -#define __G_IO_SCHEDULER_C__ -#include "gioaliasdef.c" diff --git a/gio/giostream.c b/gio/giostream.c index d785011..db3cd92 100644 --- a/gio/giostream.c +++ b/gio/giostream.c @@ -30,9 +30,8 @@ #include #include -#include "gioalias.h" -G_DEFINE_TYPE (GIOStream, g_io_stream, G_TYPE_OBJECT); +G_DEFINE_ABSTRACT_TYPE (GIOStream, g_io_stream, G_TYPE_OBJECT); /** * SECTION:giostream @@ -223,7 +222,8 @@ g_io_stream_is_closed (GIOStream *stream) * Gets the input stream for this object. This is used * for reading. * - * Returns: a #GInputStream, owned by the #GIOStream. Do not free. + * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. + * Do not free. * * Since: 2.22 */ @@ -246,7 +246,8 @@ g_io_stream_get_input_stream (GIOStream *stream) * Gets the output stream for this object. This is used for * writing. * - * Returns: a #GOutputStream, owned by the #GIOStream. Do not free. + * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. + * Do not free. * * Since: 2.22 */ @@ -360,7 +361,7 @@ g_io_stream_real_close (GIOStream *stream, /** * g_io_stream_close: * @stream: a #GIOStream - * @cancellable: optional #GCancellable object, %NULL to ignore + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore * @error: location to store the error occuring, or %NULL to ignore * * Closes the stream, releasing resources related to it. This will also @@ -453,9 +454,9 @@ async_ready_close_callback_wrapper (GObject *source_object, * g_io_stream_close_async: * @stream: a #GIOStream * @io_priority: the io priority of the request - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function - * @cancellable: optional cancellable object + * @cancellable: (allow-none): optional cancellable object + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Requests an asynchronous close of the stream, releasing resources * related to it. When the operation is finished @callback will be @@ -496,11 +497,10 @@ g_io_stream_close_async (GIOStream *stream, if (!g_io_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -569,10 +569,7 @@ close_async_thread (GSimpleAsyncResult *res, { result = class->close_fn (G_IO_STREAM (object), cancellable, &error); if (!result) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } } @@ -610,5 +607,254 @@ g_io_stream_real_close_finish (GIOStream *stream, return TRUE; } -#define __G_IO_STREAM_C__ -#include "gioaliasdef.c" +typedef struct +{ + GIOStream *stream1; + GIOStream *stream2; + GIOStreamSpliceFlags flags; + gint io_priority; + GCancellable *cancellable; + gulong cancelled_id; + GCancellable *op1_cancellable; + GCancellable *op2_cancellable; + guint completed; + GError *error; +} SpliceContext; + +static void +splice_context_free (SpliceContext *ctx) +{ + g_object_unref (ctx->stream1); + g_object_unref (ctx->stream2); + if (ctx->cancellable != NULL) + g_object_unref (ctx->cancellable); + g_object_unref (ctx->op1_cancellable); + g_object_unref (ctx->op2_cancellable); + g_clear_error (&ctx->error); + g_slice_free (SpliceContext, ctx); +} + +static void +splice_complete (GSimpleAsyncResult *simple, + SpliceContext *ctx) +{ + if (ctx->cancelled_id != 0) + g_cancellable_disconnect (ctx->cancellable, ctx->cancelled_id); + ctx->cancelled_id = 0; + + if (ctx->error != NULL) + g_simple_async_result_set_from_error (simple, ctx->error); + g_simple_async_result_complete (simple); +} + +static void +splice_close_cb (GObject *iostream, + GAsyncResult *res, + gpointer user_data) +{ + GSimpleAsyncResult *simple = user_data; + SpliceContext *ctx; + GError *error = NULL; + + g_io_stream_close_finish (G_IO_STREAM (iostream), res, &error); + + ctx = g_simple_async_result_get_op_res_gpointer (simple); + ctx->completed++; + + /* Keep the first error that occured */ + if (error != NULL && ctx->error == NULL) + ctx->error = error; + else + g_clear_error (&error); + + /* If all operations are done, complete now */ + if (ctx->completed == 4) + splice_complete (simple, ctx); + + g_object_unref (simple); +} + +static void +splice_cb (GObject *ostream, + GAsyncResult *res, + gpointer user_data) +{ + GSimpleAsyncResult *simple = user_data; + SpliceContext *ctx; + GError *error = NULL; + + g_output_stream_splice_finish (G_OUTPUT_STREAM (ostream), res, &error); + + ctx = g_simple_async_result_get_op_res_gpointer (simple); + ctx->completed++; + + /* ignore cancellation error if it was not requested by the user */ + if (error != NULL && + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && + (ctx->cancellable == NULL || + !g_cancellable_is_cancelled (ctx->cancellable))) + g_clear_error (&error); + + /* Keep the first error that occured */ + if (error != NULL && ctx->error == NULL) + ctx->error = error; + else + g_clear_error (&error); + + if (ctx->completed == 1 && + (ctx->flags & G_IO_STREAM_SPLICE_WAIT_FOR_BOTH) == 0) + { + /* We don't want to wait for the 2nd operation to finish, cancel it */ + g_cancellable_cancel (ctx->op1_cancellable); + g_cancellable_cancel (ctx->op2_cancellable); + } + else if (ctx->completed == 2) + { + if (ctx->cancellable == NULL || + !g_cancellable_is_cancelled (ctx->cancellable)) + { + g_cancellable_reset (ctx->op1_cancellable); + g_cancellable_reset (ctx->op2_cancellable); + } + + /* Close the IO streams if needed */ + if ((ctx->flags & G_IO_STREAM_SPLICE_CLOSE_STREAM1) != 0) + g_io_stream_close_async (ctx->stream1, ctx->io_priority, + ctx->op1_cancellable, splice_close_cb, g_object_ref (simple)); + else + ctx->completed++; + + if ((ctx->flags & G_IO_STREAM_SPLICE_CLOSE_STREAM2) != 0) + g_io_stream_close_async (ctx->stream2, ctx->io_priority, + ctx->op2_cancellable, splice_close_cb, g_object_ref (simple)); + else + ctx->completed++; + + /* If all operations are done, complete now */ + if (ctx->completed == 4) + splice_complete (simple, ctx); + } + + g_object_unref (simple); +} + +static void +splice_cancelled_cb (GCancellable *cancellable, + GSimpleAsyncResult *simple) +{ + SpliceContext *ctx; + + ctx = g_simple_async_result_get_op_res_gpointer (simple); + g_cancellable_cancel (ctx->op1_cancellable); + g_cancellable_cancel (ctx->op2_cancellable); +} + +/** + * g_io_stream_splice_async: + * @stream1: a #GIOStream. + * @stream2: a #GIOStream. + * @flags: a set of #GIOStreamSpliceFlags. + * @io_priority: the io priority of the request. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback. + * @user_data: (closure): user data passed to @callback. + * + * Asyncronously splice the output stream of @stream1 to the input stream of + * @stream2, and splice the output stream of @stream2 to the input stream of + * @stream1. + * + * When the operation is finished @callback will be called. + * You can then call g_io_stream_splice_finish() to get the + * result of the operation. + * + * Since: 2.28 + **/ +void +g_io_stream_splice_async (GIOStream *stream1, + GIOStream *stream2, + GIOStreamSpliceFlags flags, + gint io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *simple; + SpliceContext *ctx; + GInputStream *istream; + GOutputStream *ostream; + + if (cancellable != NULL && g_cancellable_is_cancelled (cancellable)) + { + g_simple_async_report_error_in_idle (NULL, callback, + user_data, G_IO_ERROR, G_IO_ERROR_CANCELLED, + "Operation has been cancelled"); + return; + } + + ctx = g_slice_new0 (SpliceContext); + ctx->stream1 = g_object_ref (stream1); + ctx->stream2 = g_object_ref (stream2); + ctx->flags = flags; + ctx->io_priority = io_priority; + ctx->op1_cancellable = g_cancellable_new (); + ctx->op2_cancellable = g_cancellable_new (); + ctx->completed = 0; + + simple = g_simple_async_result_new (NULL, callback, user_data, + g_io_stream_splice_finish); + g_simple_async_result_set_op_res_gpointer (simple, ctx, + (GDestroyNotify) splice_context_free); + + if (cancellable != NULL) + { + ctx->cancellable = g_object_ref (cancellable); + ctx->cancelled_id = g_cancellable_connect (cancellable, + G_CALLBACK (splice_cancelled_cb), g_object_ref (simple), + g_object_unref); + } + + istream = g_io_stream_get_input_stream (stream1); + ostream = g_io_stream_get_output_stream (stream2); + g_output_stream_splice_async (ostream, istream, G_OUTPUT_STREAM_SPLICE_NONE, + io_priority, ctx->op1_cancellable, splice_cb, + g_object_ref (simple)); + + istream = g_io_stream_get_input_stream (stream2); + ostream = g_io_stream_get_output_stream (stream1); + g_output_stream_splice_async (ostream, istream, G_OUTPUT_STREAM_SPLICE_NONE, + io_priority, ctx->op2_cancellable, splice_cb, + g_object_ref (simple)); + + g_object_unref (simple); +} + +/** + * g_io_stream_splice_finish: + * @result: a #GAsyncResult. + * @error: a #GError location to store the error occuring, or %NULL to + * ignore. + * + * Finishes an asynchronous io stream splice operation. + * + * Returns: %TRUE on success, %FALSE otherwise. + * + * Since: 2.28 + **/ +gboolean +g_io_stream_splice_finish (GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple; + + g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE); + + simple = G_SIMPLE_ASYNC_RESULT (result); + + if (g_simple_async_result_propagate_error (simple, error)) + return FALSE; + + g_return_val_if_fail (g_simple_async_result_is_valid (result, NULL, + g_io_stream_splice_finish), FALSE); + + return TRUE; +} diff --git a/gio/giostream.h b/gio/giostream.h index 048fd4f..90283dd 100644 --- a/gio/giostream.h +++ b/gio/giostream.h @@ -88,6 +88,17 @@ GType g_io_stream_get_type (void) G_GNUC_CONST; GInputStream * g_io_stream_get_input_stream (GIOStream *stream); GOutputStream *g_io_stream_get_output_stream (GIOStream *stream); +void g_io_stream_splice_async (GIOStream *stream1, + GIOStream *stream2, + GIOStreamSpliceFlags flags, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean g_io_stream_splice_finish (GAsyncResult *result, + GError **error); + gboolean g_io_stream_close (GIOStream *stream, GCancellable *cancellable, GError **error); diff --git a/gio/giotypes.h b/gio/giotypes.h index 2abc87d..1c35083 100644 --- a/gio/giotypes.h +++ b/gio/giotypes.h @@ -43,9 +43,20 @@ typedef struct _GConverter GConverter; typedef struct _GConverterInputStream GConverterInputStream; typedef struct _GConverterOutputStream GConverterOutputStream; typedef struct _GDataInputStream GDataInputStream; +typedef struct _GSimplePermission GSimplePermission; typedef struct _GZlibCompressor GZlibCompressor; typedef struct _GZlibDecompressor GZlibDecompressor; +typedef struct _GSimpleActionGroup GSimpleActionGroup; +typedef struct _GActionGroup GActionGroup; +typedef struct _GSimpleAction GSimpleAction; +typedef struct _GAction GAction; +typedef struct _GApplication GApplication; +typedef struct _GApplicationCommandLine GApplicationCommandLine; +typedef struct _GSettingsBackend GSettingsBackend; +typedef struct _GSettings GSettings; +typedef struct _GPermission GPermission; + /** * GDrive: * @@ -98,6 +109,7 @@ typedef struct _GIOExtension GIOExtension; * Opaque class for definining and scheduling IO jobs. **/ typedef struct _GIOSchedulerJob GIOSchedulerJob; +typedef struct _GIOStreamAdapter GIOStreamAdapter; typedef struct _GLoadableIcon GLoadableIcon; /* Dummy typedef */ typedef struct _GMemoryInputStream GMemoryInputStream; typedef struct _GMemoryOutputStream GMemoryOutputStream; @@ -113,6 +125,8 @@ typedef struct _GNetworkAddress GNetworkAddress; typedef struct _GNetworkService GNetworkService; typedef struct _GOutputStream GOutputStream; typedef struct _GIOStream GIOStream; +typedef struct _GPollableInputStream GPollableInputStream; /* Dummy typedef */ +typedef struct _GPollableOutputStream GPollableOutputStream; /* Dummy typedef */ typedef struct _GResolver GResolver; typedef struct _GSeekable GSeekable; typedef struct _GSimpleAsyncResult GSimpleAsyncResult; @@ -178,6 +192,7 @@ typedef struct _GSrvTarget GSrvTarget; * Since: 2.22 **/ typedef struct _GTcpConnection GTcpConnection; +typedef struct _GTcpWrapperConnection GTcpWrapperConnection; /** * GThreadedSocketService: * @@ -188,9 +203,28 @@ typedef struct _GTcpConnection GTcpConnection; **/ typedef struct _GThreadedSocketService GThreadedSocketService; typedef struct _GThemedIcon GThemedIcon; +typedef struct _GTlsCertificate GTlsCertificate; +typedef struct _GTlsClientConnection GTlsClientConnection; /* Dummy typedef */ +typedef struct _GTlsClientContext GTlsClientContext; /* Dummy typedef */ +typedef struct _GTlsConnection GTlsConnection; +typedef struct _GTlsContext GTlsContext; +typedef struct _GTlsServerConnection GTlsServerConnection; /* Dummy typedef */ +typedef struct _GTlsServerContext GTlsServerContext; /* Dummy typedef */ typedef struct _GVfs GVfs; /* Dummy typedef */ /** + * GProxyResolver: + * + * A helper class to enumerate proxies base on URI. + * + * Since: 2.26 + **/ +typedef struct _GProxyResolver GProxyResolver; +typedef struct _GProxy GProxy; +typedef struct _GProxyAddress GProxyAddress; +typedef struct _GProxyAddressEnumerator GProxyAddressEnumerator; + +/** * GVolume: * * Opaque mountable volume object. @@ -333,6 +367,56 @@ struct _GOutputVector { gsize size; }; +typedef struct _GCredentials GCredentials; +typedef struct _GUnixCredentialsMessage GUnixCredentialsMessage; +typedef struct _GUnixFDList GUnixFDList; +typedef struct _GDBusMessage GDBusMessage; +typedef struct _GDBusConnection GDBusConnection; +typedef struct _GDBusProxy GDBusProxy; +typedef struct _GDBusMethodInvocation GDBusMethodInvocation; +typedef struct _GDBusServer GDBusServer; +typedef struct _GDBusAuthObserver GDBusAuthObserver; +typedef struct _GDBusErrorEntry GDBusErrorEntry; +typedef struct _GDBusInterfaceVTable GDBusInterfaceVTable; +typedef struct _GDBusSubtreeVTable GDBusSubtreeVTable; +typedef struct _GDBusAnnotationInfo GDBusAnnotationInfo; +typedef struct _GDBusArgInfo GDBusArgInfo; +typedef struct _GDBusMethodInfo GDBusMethodInfo; +typedef struct _GDBusSignalInfo GDBusSignalInfo; +typedef struct _GDBusPropertyInfo GDBusPropertyInfo; +typedef struct _GDBusInterfaceInfo GDBusInterfaceInfo; +typedef struct _GDBusNodeInfo GDBusNodeInfo; + +/** + * GCancellableSourceFunc: + * @cancellable: the #GCancellable + * @user_data: data passed in by the user. + * + * This is the function type of the callback used for the #GSource + * returned by g_cancellable_source_new(). + * + * Returns: it should return %FALSE if the source should be removed. + * + * Since: 2.28 + */ +typedef gboolean (*GCancellableSourceFunc) (GCancellable *cancellable, + gpointer user_data); + +/** + * GPollableSourceFunc: + * @pollable_stream: the #GPollableInputStream or #GPollableOutputStream + * @user_data: data passed in by the user. + * + * This is the function type of the callback used for the #GSource + * returned by g_pollable_input_stream_create_source() and + * g_pollable_output_stream_create_source(). + * + * Returns: it should return %FALSE if the source should be removed. + * + * Since: 2.28 + */ +typedef gboolean (*GPollableSourceFunc) (GObject *pollable_stream, + gpointer user_data); G_END_DECLS diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c new file mode 100644 index 0000000..f61bb8b --- /dev/null +++ b/gio/gkeyfilesettingsbackend.c @@ -0,0 +1,665 @@ +/* + * Copyright © 2010 Codethink Limited + * Copyright © 2010 Novell, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Vincent Untz + * Ryan Lortie + */ + +#include "config.h" + +#include +#include + +#include "gfile.h" +#include "gfileinfo.h" +#include "gfilemonitor.h" +#include "gsimplepermission.h" +#include "gsettingsbackend.h" + + +#define G_TYPE_KEYFILE_SETTINGS_BACKEND (g_keyfile_settings_backend_get_type ()) +#define G_KEYFILE_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_KEYFILE_SETTINGS_BACKEND, \ + GKeyfileSettingsBackend)) +#define G_IS_KEYFILE_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_KEYFILE_SETTINGS_BACKEND)) + + +typedef GSettingsBackendClass GKeyfileSettingsBackendClass; + +typedef struct +{ + GSettingsBackend parent_instance; + + GKeyFile *keyfile; + GPermission *permission; + gboolean writable; + + gchar *prefix; + gint prefix_len; + gchar *root_group; + gint root_group_len; + + GFile *file; + GFileMonitor *file_monitor; + guint8 digest[32]; + GFile *dir; + GFileMonitor *dir_monitor; +} GKeyfileSettingsBackend; + +static GType g_keyfile_settings_backend_get_type (void); +G_DEFINE_TYPE (GKeyfileSettingsBackend, + g_keyfile_settings_backend, + G_TYPE_SETTINGS_BACKEND) + +static void +compute_checksum (guint8 *digest, + gconstpointer contents, + gsize length) +{ + GChecksum *checksum; + gsize len = 32; + + checksum = g_checksum_new (G_CHECKSUM_SHA256); + g_checksum_update (checksum, contents, length); + g_checksum_get_digest (checksum, digest, &len); + g_checksum_free (checksum); + g_assert (len == 32); +} + +static void +g_keyfile_settings_backend_keyfile_write (GKeyfileSettingsBackend *kfsb) +{ + gchar *contents; + gsize length; + + contents = g_key_file_to_data (kfsb->keyfile, &length, NULL); + g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE, + G_FILE_CREATE_REPLACE_DESTINATION, + NULL, NULL, NULL); + + compute_checksum (kfsb->digest, contents, length); + g_free (contents); +} + +static gboolean +group_name_matches (const gchar *group_name, + const gchar *prefix) +{ + /* sort of like g_str_has_prefix() except that it must be an exact + * match or the prefix followed by '/'. + * + * for example 'a' is a prefix of 'a' and 'a/b' but not 'ab'. + */ + gint i; + + for (i = 0; prefix[i]; i++) + if (prefix[i] != group_name[i]) + return FALSE; + + return group_name[i] == '\0' || group_name[i] == '/'; +} + +static gboolean +convert_path (GKeyfileSettingsBackend *kfsb, + const gchar *key, + gchar **group, + gchar **basename) +{ + gint key_len = strlen (key); + gint i; + + if (key_len < kfsb->prefix_len || + memcmp (key, kfsb->prefix, kfsb->prefix_len) != 0) + return FALSE; + + key_len -= kfsb->prefix_len; + key += kfsb->prefix_len; + + for (i = key_len; i >= 0; i--) + if (key[i] == '/') + break; + + if (kfsb->root_group) + { + /* if a root_group was specified, make sure the user hasn't given + * a path that ghosts that group name + */ + if (i == kfsb->root_group_len && memcmp (key, kfsb->root_group, i) == 0) + return FALSE; + } + else + { + /* if no root_group was given, ensure that the user gave a path */ + if (i == -1) + return FALSE; + } + + if (group) + { + if (i >= 0) + { + *group = g_memdup (key, i + 1); + (*group)[i] = '\0'; + } + else + *group = g_strdup (kfsb->root_group); + } + + if (basename) + *basename = g_memdup (key + i + 1, key_len - i); + + return TRUE; +} + +gboolean +path_is_valid (GKeyfileSettingsBackend *kfsb, + const gchar *path) +{ + return convert_path (kfsb, path, NULL, NULL); +} + +static GVariant * +get_from_keyfile (GKeyfileSettingsBackend *kfsb, + const GVariantType *type, + const gchar *key) +{ + GVariant *return_value = NULL; + gchar *group, *name; + + if (convert_path (kfsb, key, &group, &name)) + { + gchar *str; + + g_assert (*name); + + str = g_key_file_get_value (kfsb->keyfile, group, name, NULL); + + if (str) + { + return_value = g_variant_parse (type, str, NULL, NULL, NULL); + g_free (str); + } + + g_free (group); + g_free (name); + } + + return return_value; +} + +static gboolean +set_to_keyfile (GKeyfileSettingsBackend *kfsb, + const gchar *key, + GVariant *value) +{ + gchar *group, *name; + + if (convert_path (kfsb, key, &group, &name)) + { + if (value) + { + gchar *str = g_variant_print (value, FALSE); + g_key_file_set_value (kfsb->keyfile, group, name, str); + g_variant_unref (g_variant_ref_sink (value)); + g_free (str); + } + else + { + if (*name == '\0') + { + gchar **groups; + gint i; + + groups = g_key_file_get_groups (kfsb->keyfile, NULL); + + for (i = 0; groups[i]; i++) + if (group_name_matches (groups[i], group)) + g_key_file_remove_group (kfsb->keyfile, groups[i], NULL); + + g_strfreev (groups); + } + else + g_key_file_remove_key (kfsb->keyfile, group, name, NULL); + } + + g_free (group); + g_free (name); + + return TRUE; + } + + return FALSE; +} + +static GVariant * +g_keyfile_settings_backend_read (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value) +{ + GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend); + + if (default_value) + return NULL; + + return get_from_keyfile (kfsb, expected_type, key); +} + +typedef struct +{ + GKeyfileSettingsBackend *kfsb; + gboolean failed; +} WriteManyData; + +static gboolean +g_keyfile_settings_backend_write_one (gpointer key, + gpointer value, + gpointer user_data) +{ + WriteManyData *data = user_data; + gboolean success; + + success = set_to_keyfile (data->kfsb, key, value); + g_assert (success); + + return FALSE; +} + +static gboolean +g_keyfile_settings_backend_check_one (gpointer key, + gpointer value, + gpointer user_data) +{ + WriteManyData *data = user_data; + + return data->failed = !path_is_valid (data->kfsb, key); +} + +static gboolean +g_keyfile_settings_backend_write_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag) +{ + WriteManyData data = { G_KEYFILE_SETTINGS_BACKEND (backend) }; + + if (!data.kfsb->writable) + return FALSE; + + g_tree_foreach (tree, g_keyfile_settings_backend_check_one, &data); + + if (data.failed) + return FALSE; + + g_tree_foreach (tree, g_keyfile_settings_backend_write_one, &data); + g_keyfile_settings_backend_keyfile_write (data.kfsb); + + g_settings_backend_changed_tree (backend, tree, origin_tag); + + return TRUE; +} + +static gboolean +g_keyfile_settings_backend_write (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag) +{ + GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend); + gboolean success; + + if (!kfsb->writable) + return FALSE; + + success = set_to_keyfile (kfsb, key, value); + + if (success) + { + g_settings_backend_changed (backend, key, origin_tag); + g_keyfile_settings_backend_keyfile_write (kfsb); + } + + return success; +} + +static void +g_keyfile_settings_backend_reset (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend); + + if (set_to_keyfile (kfsb, key, NULL)) + g_keyfile_settings_backend_keyfile_write (kfsb); + + g_settings_backend_changed (backend, key, origin_tag); +} + +static gboolean +g_keyfile_settings_backend_get_writable (GSettingsBackend *backend, + const gchar *name) +{ + GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend); + + return kfsb->writable && path_is_valid (kfsb, name); +} + +static GPermission * +g_keyfile_settings_backend_get_permission (GSettingsBackend *backend, + const gchar *path) +{ + GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend); + + return g_object_ref (kfsb->permission); +} + +static void +keyfile_to_tree (GKeyfileSettingsBackend *kfsb, + GTree *tree, + GKeyFile *keyfile, + gboolean dup_check) +{ + gchar **groups; + gint i; + + groups = g_key_file_get_groups (keyfile, NULL); + for (i = 0; groups[i]; i++) + { + gboolean is_root_group; + gchar **keys; + gint j; + + is_root_group = g_strcmp0 (kfsb->root_group, groups[i]) == 0; + + /* reject group names that will form invalid key names */ + if (!is_root_group && + (g_str_has_prefix (groups[i], "/") || + g_str_has_suffix (groups[i], "/") || strstr (groups[i], "//"))) + continue; + + keys = g_key_file_get_keys (keyfile, groups[i], NULL, NULL); + + for (j = 0; keys[j]; j++) + { + gchar *path, *value; + + /* reject key names with slashes in them */ + if (strchr (keys[j], '/')) + continue; + + if (is_root_group) + path = g_strdup_printf ("%s%s", kfsb->prefix, keys[j]); + else + path = g_strdup_printf ("%s%s/%s", kfsb->prefix, groups[i], keys[j]); + + value = g_key_file_get_value (keyfile, groups[i], keys[j], NULL); + + if (dup_check && g_strcmp0 (g_tree_lookup (tree, path), value) == 0) + { + g_tree_remove (tree, path); + g_free (value); + g_free (path); + } + else + g_tree_insert (tree, path, value); + } + + g_strfreev (keys); + } + g_strfreev (groups); +} + +static void +g_keyfile_settings_backend_keyfile_reload (GKeyfileSettingsBackend *kfsb) +{ + guint8 digest[32]; + gchar *contents; + gsize length; + + contents = NULL; + length = 0; + + g_file_load_contents (kfsb->file, NULL, &contents, &length, NULL, NULL); + compute_checksum (digest, contents, length); + + if (memcmp (kfsb->digest, digest, sizeof digest) != 0) + { + GKeyFile *keyfiles[2]; + GTree *tree; + + tree = g_tree_new_full ((GCompareDataFunc) strcmp, NULL, + g_free, g_free); + + keyfiles[0] = kfsb->keyfile; + keyfiles[1] = g_key_file_new (); + + if (length > 0) + g_key_file_load_from_data (keyfiles[1], contents, length, + G_KEY_FILE_KEEP_COMMENTS | + G_KEY_FILE_KEEP_TRANSLATIONS, NULL); + + keyfile_to_tree (kfsb, tree, keyfiles[0], FALSE); + keyfile_to_tree (kfsb, tree, keyfiles[1], TRUE); + g_key_file_free (keyfiles[0]); + kfsb->keyfile = keyfiles[1]; + + if (g_tree_nnodes (tree) > 0) + g_settings_backend_changed_tree (&kfsb->parent_instance, tree, NULL); + + g_tree_unref (tree); + + memcpy (kfsb->digest, digest, sizeof digest); + } + + g_free (contents); +} + +static void +g_keyfile_settings_backend_keyfile_writable (GKeyfileSettingsBackend *kfsb) +{ + GFileInfo *fileinfo; + gboolean writable; + + fileinfo = g_file_query_info (kfsb->dir, "access::*", 0, NULL, NULL); + + if (fileinfo) + { + writable = + g_file_info_get_attribute_boolean (fileinfo, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE) && + g_file_info_get_attribute_boolean (fileinfo, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE); + g_object_unref (fileinfo); + } + else + writable = FALSE; + + if (writable != kfsb->writable) + { + kfsb->writable = writable; + g_settings_backend_path_writable_changed (&kfsb->parent_instance, "/"); + } +} + +static void +g_keyfile_settings_backend_finalize (GObject *object) +{ + GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object); + + g_key_file_free (kfsb->keyfile); + g_object_unref (kfsb->permission); + + g_file_monitor_cancel (kfsb->file_monitor); + g_object_unref (kfsb->file_monitor); + g_object_unref (kfsb->file); + + g_file_monitor_cancel (kfsb->dir_monitor); + g_object_unref (kfsb->dir_monitor); + g_object_unref (kfsb->dir); + + g_free (kfsb->root_group); + g_free (kfsb->prefix); + + G_OBJECT_CLASS (g_keyfile_settings_backend_parent_class) + ->finalize (object); +} + +static void +g_keyfile_settings_backend_init (GKeyfileSettingsBackend *kfsb) +{ +} + +static void +g_keyfile_settings_backend_class_init (GKeyfileSettingsBackendClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = g_keyfile_settings_backend_finalize; + + class->read = g_keyfile_settings_backend_read; + class->write = g_keyfile_settings_backend_write; + class->write_tree = g_keyfile_settings_backend_write_tree; + class->reset = g_keyfile_settings_backend_reset; + class->get_writable = g_keyfile_settings_backend_get_writable; + class->get_permission = g_keyfile_settings_backend_get_permission; + /* No need to implement subscribed/unsubscribe: the only point would be to + * stop monitoring the file when there's no GSettings anymore, which is no + * big win. */ +} + +static void +file_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + GKeyfileSettingsBackend *kfsb = user_data; + + g_keyfile_settings_backend_keyfile_reload (kfsb); +} + +static void +dir_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + GKeyfileSettingsBackend *kfsb = user_data; + + g_keyfile_settings_backend_keyfile_writable (kfsb); +} + +/** + * g_keyfile_settings_backend_new: + * @filename: the filename of the keyfile + * @root_path: the path under which all settings keys appear + * @root_group: (allow-none): the group name corresponding to + * @root_path, or %NULL + * @returns: (transfer full): a keyfile-backed #GSettingsBackend + * + * Creates a keyfile-backed #GSettingsBackend. + * + * The filename of the keyfile to use is given by @filename. + * + * All settings read to or written from the backend must fall under the + * path given in @root_path (which must start and end with a slash and + * not contain two consecutive slashes). @root_path may be "/". + * + * If @root_group is non-%NULL then it specifies the name of the keyfile + * group used for keys that are written directly below @root_path. For + * example, if @root_path is "/apps/example/" and @root_group is + * "toplevel", then settings the key "/apps/example/enabled" to a value + * of %TRUE will cause the following to appear in the keyfile: + * + * |[ + * [toplevel] + * enabled=true + * ]| + * + * If @root_group is %NULL then it is not permitted to store keys + * directly below the @root_path. + * + * For keys not stored directly below @root_path (ie: in a sub-path), + * the name of the subpath (with the final slash stripped) is used as + * the name of the keyfile group. To continue the example, if + * "/apps/example/profiles/default/font-size" were set to + * 12 then the following would appear in the keyfile: + * + * |[ + * [profiles/default] + * font-size=12 + * ]| + * + * The backend will refuse writes (and return writability as being + * %FALSE) for keys outside of @root_path and, in the event that + * @root_group is %NULL, also for keys directly under @root_path. + * Writes will also be refused if the backend detects that it has the + * inability to rewrite the keyfile (ie: the containing directory is not + * writable). + * + * There is no checking done for your key namespace clashing with the + * syntax of the key file format. For example, if you have '[' or ']' + * characters in your path names or '=' in your key names you may be in + * trouble. + **/ +GSettingsBackend * +g_keyfile_settings_backend_new (const gchar *filename, + const gchar *root_path, + const gchar *root_group) +{ + GKeyfileSettingsBackend *kfsb; + + g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (root_path != NULL, NULL); + g_return_val_if_fail (g_str_has_prefix (root_path, "/"), NULL); + g_return_val_if_fail (g_str_has_suffix (root_path, "/"), NULL); + g_return_val_if_fail (strstr (root_path, "//") == NULL, NULL); + + kfsb = g_object_new (G_TYPE_KEYFILE_SETTINGS_BACKEND, NULL); + kfsb->keyfile = g_key_file_new (); + kfsb->permission = g_simple_permission_new (TRUE); + + kfsb->file = g_file_new_for_path (filename); + kfsb->dir = g_file_get_parent (kfsb->file); + g_file_make_directory_with_parents (kfsb->dir, NULL, NULL); + + kfsb->file_monitor = g_file_monitor_file (kfsb->file, 0, NULL, NULL); + kfsb->dir_monitor = g_file_monitor_file (kfsb->dir, 0, NULL, NULL); + + kfsb->prefix_len = strlen (root_path); + kfsb->prefix = g_strdup (root_path); + + if (root_group) + { + kfsb->root_group_len = strlen (root_group); + kfsb->root_group = g_strdup (root_group); + } + + compute_checksum (kfsb->digest, NULL, 0); + + g_signal_connect (kfsb->file_monitor, "changed", + G_CALLBACK (file_changed), kfsb); + g_signal_connect (kfsb->dir_monitor, "changed", + G_CALLBACK (dir_changed), kfsb); + + g_keyfile_settings_backend_keyfile_writable (kfsb); + g_keyfile_settings_backend_keyfile_reload (kfsb); + + return G_SETTINGS_BACKEND (kfsb); +} diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c new file mode 100644 index 0000000..a00e45d --- /dev/null +++ b/gio/glib-compile-schemas.c @@ -0,0 +1,2015 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +/* Prologue {{{1 */ +#define _GNU_SOURCE +#include "config.h" + +#include +#include +#include +#include +#include + +#include + +#include "gvdb/gvdb-builder.h" +#include "strinfo.c" + +/* Handling of {{{1 */ +typedef struct +{ + GString *strinfo; + + gboolean is_flags; +} EnumState; + +static void +enum_state_free (gpointer data) +{ + EnumState *state = data; + + g_string_free (state->strinfo, TRUE); + g_slice_free (EnumState, state); +} + +EnumState * +enum_state_new (gboolean is_flags) +{ + EnumState *state; + + state = g_slice_new (EnumState); + state->strinfo = g_string_new (NULL); + state->is_flags = is_flags; + + return state; +} + +static void +enum_state_add_value (EnumState *state, + const gchar *nick, + const gchar *valuestr, + GError **error) +{ + gint64 value; + gchar *end; + + if (nick[0] == '\0' || nick[1] == '\0') + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "nick must be a minimum of 2 characters"); + return; + } + + value = g_ascii_strtoll (valuestr, &end, 0); + if (*end || state->is_flags ? + (value > G_MAXUINT32 || value < 0) : + (value > G_MAXINT32 || value < G_MININT32)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "invalid numeric value"); + return; + } + + if (strinfo_builder_contains (state->strinfo, nick)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " already specified", nick); + return; + } + + if (strinfo_builder_contains_value (state->strinfo, value)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "value='%s' already specified", valuestr); + return; + } + + /* Silently drop the null case if it is mentioned. + * It is properly denoted with an empty array. + */ + if (state->is_flags && value == 0) + return; + + if (state->is_flags && (value & (value - 1))) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "flags values must have at most 1 bit set"); + return; + } + + /* Since we reject exact duplicates of value='' and we only allow one + * bit to be set, it's not possible to have overlaps. + * + * If we loosen the one-bit-set restriction we need an overlap check. + */ + + strinfo_builder_append_item (state->strinfo, nick, value); +} + +static void +enum_state_end (EnumState **state_ptr, + GError **error) +{ + EnumState *state; + + state = *state_ptr; + *state_ptr = NULL; + + if (state->strinfo->len == 0) + g_set_error (error, + G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "<%s> must contain at least one ", + state->is_flags ? "flags" : "enum"); +} + +/* Handling of {{{1 */ +typedef struct +{ + /* for , @child_schema will be set. + * for , everything else will be set. + */ + gchar *child_schema; + + + GVariantType *type; + gboolean have_gettext_domain; + + gchar l10n; + gchar *l10n_context; + GString *unparsed_default_value; + GVariant *default_value; + + GString *strinfo; + gboolean is_enum; + gboolean is_flags; + + GVariant *minimum; + GVariant *maximum; + + gboolean has_choices; + gboolean has_aliases; + gboolean is_override; + + gboolean checked; + GVariant *serialised; +} KeyState; + +static KeyState * +key_state_new (const gchar *type_string, + const gchar *gettext_domain, + gboolean is_enum, + gboolean is_flags, + GString *strinfo) +{ + KeyState *state; + + state = g_slice_new0 (KeyState); + state->type = g_variant_type_new (type_string); + state->have_gettext_domain = gettext_domain != NULL; + state->is_enum = is_enum; + state->is_flags = is_flags; + + if (strinfo) + state->strinfo = g_string_new_len (strinfo->str, strinfo->len); + else + state->strinfo = g_string_new (NULL); + + return state; +} + +static KeyState * +key_state_override (KeyState *state, + const gchar *gettext_domain) +{ + KeyState *copy; + + copy = g_slice_new0 (KeyState); + copy->type = g_variant_type_copy (state->type); + copy->have_gettext_domain = gettext_domain != NULL; + copy->strinfo = g_string_new_len (state->strinfo->str, + state->strinfo->len); + copy->is_enum = state->is_enum; + copy->is_flags = state->is_flags; + copy->is_override = TRUE; + + if (state->minimum) + { + copy->minimum = g_variant_ref (state->minimum); + copy->maximum = g_variant_ref (state->maximum); + } + + return copy; +} + +static KeyState * +key_state_new_child (const gchar *child_schema) +{ + KeyState *state; + + state = g_slice_new0 (KeyState); + state->child_schema = g_strdup (child_schema); + + return state; +} + +static gboolean +is_valid_choices (GVariant *variant, + GString *strinfo) +{ + switch (g_variant_classify (variant)) + { + case G_VARIANT_CLASS_MAYBE: + case G_VARIANT_CLASS_ARRAY: + { + gboolean valid = TRUE; + GVariantIter iter; + + g_variant_iter_init (&iter, variant); + + while (valid && (variant = g_variant_iter_next_value (&iter))) + { + valid = is_valid_choices (variant, strinfo); + g_variant_unref (variant); + } + + return valid; + } + + case G_VARIANT_CLASS_STRING: + return strinfo_is_string_valid ((const guint32 *) strinfo->str, + strinfo->len / 4, + g_variant_get_string (variant, NULL)); + + default: + g_assert_not_reached (); + } +} + + +/* Gets called at or to check for + * validity of the default value so that any inconsistency is + * reported as soon as it is encountered. + */ +static void +key_state_check_range (KeyState *state, + GError **error) +{ + if (state->default_value) + { + const gchar *tag; + + tag = state->is_override ? "override" : "default"; + + if (state->minimum) + { + if (g_variant_compare (state->default_value, state->minimum) < 0 || + g_variant_compare (state->default_value, state->maximum) > 0) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "<%s> is not contained in " + "the specified range", tag); + } + } + + else if (state->strinfo->len) + { + if (!is_valid_choices (state->default_value, state->strinfo)) + { + if (state->is_enum) + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "<%s> is not a valid member of " + "the specified enumerated type", tag); + + else if (state->is_flags) + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "<%s> contains string not in the " + "specified flags type", tag); + + else + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "<%s> contains string not in " + "", tag); + } + } + } +} + +static void +key_state_set_range (KeyState *state, + const gchar *min_str, + const gchar *max_str, + GError **error) +{ + if (state->minimum) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " already specified for this key"); + return; + } + + if (strchr ("ynqiuxtd", *(char *) state->type) == NULL) + { + gchar *type = g_variant_type_dup_string (state->type); + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " not allowed for keys of type '%s'", type); + g_free (type); + return; + } + + state->minimum = g_variant_parse (state->type, min_str, NULL, NULL, error); + if (state->minimum == NULL) + return; + + state->maximum = g_variant_parse (state->type, max_str, NULL, NULL, error); + if (state->maximum == NULL) + return; + + if (g_variant_compare (state->minimum, state->maximum) > 0) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " specified minimum is greater than maxmimum"); + return; + } + + key_state_check_range (state, error); +} + +static GString * +key_state_start_default (KeyState *state, + const gchar *l10n, + const gchar *context, + GError **error) +{ + if (l10n != NULL) + { + if (strcmp (l10n, "messages") == 0) + state->l10n = 'm'; + + else if (strcmp (l10n, "time") == 0) + state->l10n = 't'; + + else + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "unsupported l10n category: %s", l10n); + return NULL; + } + + if (!state->have_gettext_domain) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "l10n requested, but no " + "gettext domain given"); + return NULL; + } + + state->l10n_context = g_strdup (context); + } + + else if (context != NULL) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "translation context given for " + " value without l10n enabled"); + return NULL; + } + + return g_string_new (NULL); +} + +static void +key_state_end_default (KeyState *state, + GString **string, + GError **error) +{ + state->unparsed_default_value = *string; + *string = NULL; + + state->default_value = g_variant_parse (state->type, + state->unparsed_default_value->str, + NULL, NULL, error); + key_state_check_range (state, error); +} + +static void +key_state_start_choices (KeyState *state, + GError **error) +{ + const GVariantType *type = state->type; + + if (state->is_enum) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " can not be specified for keys " + "tagged as having an enumerated type"); + return; + } + + if (state->has_choices) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " already specified for this key"); + return; + } + + while (g_variant_type_is_maybe (type) || g_variant_type_is_array (type)) + type = g_variant_type_element (type); + + if (!g_variant_type_equal (type, G_VARIANT_TYPE_STRING)) + { + gchar *type_string = g_variant_type_dup_string (state->type); + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " not allowed for keys of type '%s'", + type_string); + g_free (type_string); + return; + } +} + +static void +key_state_add_choice (KeyState *state, + const gchar *choice, + GError **error) +{ + if (strinfo_builder_contains (state->strinfo, choice)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " already given", choice); + return; + } + + strinfo_builder_append_item (state->strinfo, choice, 0); + state->has_choices = TRUE; +} + +static void +key_state_end_choices (KeyState *state, + GError **error) +{ + if (!state->has_choices) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + " must contain at least one "); + return; + } + + key_state_check_range (state, error); +} + +static void +key_state_start_aliases (KeyState *state, + GError **error) +{ + if (state->has_aliases) + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " already specified for this key"); + else if (!state->is_flags && !state->is_enum && !state->has_choices) + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " can only be specified for keys with " + "enumerated or flags types or after "); +} + +static void +key_state_add_alias (KeyState *state, + const gchar *alias, + const gchar *target, + GError **error) +{ + if (strinfo_builder_contains (state->strinfo, alias)) + { + if (strinfo_is_string_valid ((guint32 *) state->strinfo->str, + state->strinfo->len / 4, + alias)) + { + if (state->is_enum) + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " given when '%s' is already " + "a member of the enumerated type", alias, alias); + + else + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " given when " + " was already given", + alias, alias); + } + + else + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + " already specified", alias); + + return; + } + + if (!strinfo_builder_append_alias (state->strinfo, alias, target)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "alias target '%s' is not in %s", target, + state->is_enum ? "enumerated type" : ""); + return; + } + + state->has_aliases = TRUE; +} + +static void +key_state_end_aliases (KeyState *state, + GError **error) +{ + if (!state->has_aliases) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + " must contain at least one "); + return; + } +} + +static gboolean +key_state_check (KeyState *state, + GError **error) +{ + if (state->checked) + return TRUE; + + return state->checked = TRUE; +} + +static GVariant * +key_state_serialise (KeyState *state) +{ + if (state->serialised == NULL) + { + if (state->child_schema) + { + state->serialised = g_variant_new_string (state->child_schema); + } + + else + { + GVariantBuilder builder; + + g_assert (key_state_check (state, NULL)); + + g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE); + + /* default value */ + g_variant_builder_add_value (&builder, state->default_value); + + /* translation */ + if (state->l10n) + { + if (state->l10n_context) + { + gint len; + + /* Contextified messages are supported by prepending + * the context, followed by '\004' to the start of the + * message string. We do that here to save GSettings + * the work later on. + */ + len = strlen (state->l10n_context); + state->l10n_context[len] = '\004'; + g_string_prepend_len (state->unparsed_default_value, + state->l10n_context, len + 1); + g_free (state->l10n_context); + state->l10n_context = NULL; + } + + g_variant_builder_add (&builder, "(y(y&s))", 'l', state->l10n, + state->unparsed_default_value->str); + g_string_free (state->unparsed_default_value, TRUE); + state->unparsed_default_value = NULL; + } + + /* choice, aliases, enums */ + if (state->strinfo->len) + { + GVariant *array; + guint32 *words; + gpointer data; + gsize size; + gint i; + + data = state->strinfo->str; + size = state->strinfo->len; + + words = data; + for (i = 0; i < size / sizeof (guint32); i++) + words[i] = GUINT32_TO_LE (words[i]); + + array = g_variant_new_from_data (G_VARIANT_TYPE ("au"), + data, size, TRUE, + g_free, data); + + g_string_free (state->strinfo, FALSE); + state->strinfo = NULL; + + g_variant_builder_add (&builder, "(y@au)", + state->is_flags ? 'f' : + state->is_enum ? 'e' : 'c', + array); + } + + /* range */ + if (state->minimum || state->maximum) + g_variant_builder_add (&builder, "(y(**))", 'r', + state->minimum, state->maximum); + + state->serialised = g_variant_builder_end (&builder); + } + + g_variant_ref_sink (state->serialised); + } + + return g_variant_ref (state->serialised); +} + +static void +key_state_free (gpointer data) +{ + KeyState *state = data; + + if (state->type) + g_variant_type_free (state->type); + + g_free (state->l10n_context); + + if (state->unparsed_default_value) + g_string_free (state->unparsed_default_value, TRUE); + + if (state->default_value) + g_variant_unref (state->default_value); + + if (state->strinfo) + g_string_free (state->strinfo, TRUE); + + if (state->minimum) + g_variant_unref (state->minimum); + + if (state->maximum) + g_variant_unref (state->maximum); + + if (state->serialised) + g_variant_unref (state->serialised); + + g_slice_free (KeyState, state); +} + +/* Key name validity {{{1 */ +static gboolean allow_any_name = FALSE; + +static gboolean +is_valid_keyname (const gchar *key, + GError **error) +{ + gint i; + + if (key[0] == '\0') + { + g_set_error_literal (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("empty names are not permitted")); + return FALSE; + } + + if (allow_any_name) + return TRUE; + + if (!g_ascii_islower (key[0])) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("invalid name '%s': names must begin " + "with a lowercase letter"), key); + return FALSE; + } + + for (i = 1; key[i]; i++) + { + if (key[i] != '-' && + !g_ascii_islower (key[i]) && + !g_ascii_isdigit (key[i])) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("invalid name '%s': invalid character '%c'; " + "only lowercase letters, numbers and dash ('-') " + "are permitted."), key, key[i]); + return FALSE; + } + + if (key[i] == '-' && key[i + 1] == '-') + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("invalid name '%s': two successive dashes ('--') " + "are not permitted."), key); + return FALSE; + } + } + + if (key[i - 1] == '-') + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("invalid name '%s': the last character may not be a " + "dash ('-')."), key); + return FALSE; + } + + if (i > 32) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("invalid name '%s': maximum length is 32"), key); + return FALSE; + } + + return TRUE; +} + +/* Handling of {{{1 */ +typedef struct _SchemaState SchemaState; +struct _SchemaState +{ + SchemaState *extends; + + gchar *path; + gchar *gettext_domain; + gchar *extends_name; + gchar *list_of; + + GHashTable *keys; +}; + +static SchemaState * +schema_state_new (const gchar *path, + const gchar *gettext_domain, + SchemaState *extends, + const gchar *extends_name, + const gchar *list_of) +{ + SchemaState *state; + + state = g_slice_new (SchemaState); + state->path = g_strdup (path); + state->gettext_domain = g_strdup (gettext_domain); + state->extends = extends; + state->extends_name = g_strdup (extends_name); + state->list_of = g_strdup (list_of); + state->keys = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, key_state_free); + + return state; +} + +static void +schema_state_free (gpointer data) +{ + SchemaState *state = data; + + g_free (state->path); + g_free (state->gettext_domain); + g_hash_table_unref (state->keys); +} + +static void +schema_state_add_child (SchemaState *state, + const gchar *name, + const gchar *schema, + GError **error) +{ + gchar *childname; + + if (!is_valid_keyname (name, error)) + return; + + childname = g_strconcat (name, "/", NULL); + + if (g_hash_table_lookup (state->keys, childname)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" already specified"), name); + return; + } + + g_hash_table_insert (state->keys, childname, + key_state_new_child (schema)); +} + +static KeyState * +schema_state_add_key (SchemaState *state, + GHashTable *enum_table, + GHashTable *flags_table, + const gchar *name, + const gchar *type_string, + const gchar *enum_type, + const gchar *flags_type, + GError **error) +{ + SchemaState *node; + GString *strinfo; + KeyState *key; + + if (state->list_of) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("can not add keys to a 'list-of' schema")); + return NULL; + } + + if (!is_valid_keyname (name, error)) + return NULL; + + if (g_hash_table_lookup (state->keys, name)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" already specified"), name); + return NULL; + } + + for (node = state; node; node = node->extends) + if (node->extends) + { + KeyState *shadow; + + shadow = g_hash_table_lookup (node->extends->keys, name); + + /* in case of make sure we report the + * location of the original , not the . + */ + if (shadow && !shadow->is_override) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" shadows in " + "; use to modify value"), + name, name, node->extends_name); + return NULL; + } + } + + if ((type_string != NULL) + (enum_type != NULL) + (flags_type != NULL) != 1) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_MISSING_ATTRIBUTE, + _("exactly one of 'type', 'enum' or 'flags' must " + "be specified as an attribute to ")); + return NULL; + } + + if (type_string == NULL) /* flags or enums was specified */ + { + EnumState *enum_state; + + if (enum_type) + enum_state = g_hash_table_lookup (enum_table, enum_type); + else + enum_state = g_hash_table_lookup (flags_table, flags_type); + + + if (enum_state == NULL) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("<%s id='%s'> not (yet) defined."), + flags_type ? "flags" : "enum", + flags_type ? flags_type : enum_type); + return NULL; + } + + type_string = flags_type ? "as" : "s"; + strinfo = enum_state->strinfo; + } + else + { + if (!g_variant_type_string_is_valid (type_string)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("invalid GVariant type string '%s'"), type_string); + return NULL; + } + + strinfo = NULL; + } + + key = key_state_new (type_string, state->gettext_domain, + enum_type != NULL, flags_type != NULL, strinfo); + g_hash_table_insert (state->keys, g_strdup (name), key); + + return key; +} + +static void +schema_state_add_override (SchemaState *state, + KeyState **key_state, + GString **string, + const gchar *key, + const gchar *l10n, + const gchar *context, + GError **error) +{ + SchemaState *parent; + KeyState *original; + + if (state->extends == NULL) + { + g_set_error_literal (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" given but schema isn't " + "extending anything")); + return; + } + + for (parent = state->extends; parent; parent = parent->extends) + if ((original = g_hash_table_lookup (parent->keys, key))) + break; + + if (original == NULL) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("no to override"), key); + return; + } + + if (g_hash_table_lookup (state->keys, key)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" already specified"), key); + return; + } + + *key_state = key_state_override (original, state->gettext_domain); + *string = key_state_start_default (*key_state, l10n, context, error); + g_hash_table_insert (state->keys, g_strdup (key), *key_state); +} + +static void +override_state_end (KeyState **key_state, + GString **string, + GError **error) +{ + key_state_end_default (*key_state, string, error); + *key_state = NULL; +} + +/* Handling of toplevel state {{{1 */ +typedef struct +{ + GHashTable *schema_table; /* string -> SchemaState */ + GHashTable *flags_table; /* string -> EnumState */ + GHashTable *enum_table; /* string -> EnumState */ + + GSList *this_file_schemas; /* strings: s in this file */ + GSList *this_file_flagss; /* strings: s in this file */ + GSList *this_file_enums; /* strings: s in this file */ + + gchar *schemalist_domain; /* the gettext domain */ + + SchemaState *schema_state; /* non-NULL when inside */ + KeyState *key_state; /* non-NULL when inside */ + EnumState *enum_state; /* non-NULL when inside */ + + GString *string; /* non-NULL when accepting text */ +} ParseState; + +static gboolean +is_subclass (const gchar *class_name, + const gchar *possible_parent, + GHashTable *schema_table) +{ + SchemaState *class; + + if (strcmp (class_name, possible_parent) == 0) + return TRUE; + + class = g_hash_table_lookup (schema_table, class_name); + g_assert (class != NULL); + + return class->extends_name && + is_subclass (class->extends_name, possible_parent, schema_table); +} + +static void +parse_state_start_schema (ParseState *state, + const gchar *id, + const gchar *path, + const gchar *gettext_domain, + const gchar *extends_name, + const gchar *list_of, + GError **error) +{ + SchemaState *extends; + gchar *my_id; + + if (g_hash_table_lookup (state->schema_table, id)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" already specified"), id); + return; + } + + if (extends_name) + { + extends = g_hash_table_lookup (state->schema_table, extends_name); + + if (extends == NULL) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" extends not yet " + "existing schema '%s'"), id, extends_name); + return; + } + } + else + extends = NULL; + + if (list_of) + { + SchemaState *tmp; + + if (!(tmp = g_hash_table_lookup (state->schema_table, list_of))) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" is list of not yet " + "existing schema '%s'"), id, list_of); + return; + } + + if (tmp->path) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("Can not be a list of a schema with a path")); + return; + } + } + + if (extends) + { + if (extends->path) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("Can not extend a schema with a path")); + return; + } + + if (list_of) + { + if (extends->list_of == NULL) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" is a list, extending " + " which is not a list"), + id, extends_name); + return; + } + + if (!is_subclass (list_of, extends->list_of, state->schema_table)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _(" extends but '%s' does not " + "extend '%s'"), id, list_of, extends_name, + extends->list_of, list_of, extends->list_of); + return; + } + } + else + /* by default we are a list of the same thing that the schema + * we are extending is a list of (which might be nothing) + */ + list_of = extends->list_of; + } + + if (path && !(g_str_has_prefix (path, "/") && g_str_has_suffix (path, "/"))) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("a path, if given, must begin and end with a slash")); + return; + } + + if (path && list_of && !g_str_has_suffix (path, ":/")) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("the path of a list must end with ':/'")); + return; + } + + state->schema_state = schema_state_new (path, gettext_domain, + extends, extends_name, list_of); + + my_id = g_strdup (id); + state->this_file_schemas = g_slist_prepend (state->this_file_schemas, my_id); + g_hash_table_insert (state->schema_table, my_id, state->schema_state); +} + +static void +parse_state_start_enum (ParseState *state, + const gchar *id, + gboolean is_flags, + GError **error) +{ + GSList **list = is_flags ? &state->this_file_flagss : &state->this_file_enums; + GHashTable *table = is_flags ? state->flags_table : state->enum_table; + gchar *my_id; + + if (g_hash_table_lookup (table, id)) + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("<%s id='%s'> already specified"), + is_flags ? "flags" : "enum", id); + return; + } + + state->enum_state = enum_state_new (is_flags); + + my_id = g_strdup (id); + *list = g_slist_prepend (*list, my_id); + g_hash_table_insert (table, my_id, state->enum_state); +} + +/* GMarkup Parser Functions {{{1 */ + +/* Start element {{{2 */ +static void +start_element (GMarkupParseContext *context, + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **error) +{ + ParseState *state = user_data; + const GSList *element_stack; + const gchar *container; + + element_stack = g_markup_parse_context_get_element_stack (context); + container = element_stack->next ? element_stack->next->data : NULL; + +#define COLLECT(first, ...) \ + g_markup_collect_attributes (element_name, \ + attribute_names, attribute_values, error, \ + first, __VA_ARGS__, G_MARKUP_COLLECT_INVALID) +#define OPTIONAL G_MARKUP_COLLECT_OPTIONAL +#define STRDUP G_MARKUP_COLLECT_STRDUP +#define STRING G_MARKUP_COLLECT_STRING +#define NO_ATTRS() COLLECT (G_MARKUP_COLLECT_INVALID, NULL) + + /* Toplevel items {{{3 */ + if (container == NULL) + { + if (strcmp (element_name, "schemalist") == 0) + { + COLLECT (OPTIONAL | STRDUP, + "gettext-domain", + &state->schemalist_domain); + return; + } + } + + + /* children of {{{3 */ + else if (strcmp (container, "schemalist") == 0) + { + if (strcmp (element_name, "schema") == 0) + { + const gchar *id, *path, *gettext_domain, *extends, *list_of; + if (COLLECT (STRING, "id", &id, + OPTIONAL | STRING, "path", &path, + OPTIONAL | STRING, "gettext-domain", &gettext_domain, + OPTIONAL | STRING, "extends", &extends, + OPTIONAL | STRING, "list-of", &list_of)) + parse_state_start_schema (state, id, path, + gettext_domain ? gettext_domain + : state->schemalist_domain, + extends, list_of, error); + return; + } + + else if (strcmp (element_name, "enum") == 0) + { + const gchar *id; + if (COLLECT (STRING, "id", &id)) + parse_state_start_enum (state, id, FALSE, error); + return; + } + + else if (strcmp (element_name, "flags") == 0) + { + const gchar *id; + if (COLLECT (STRING, "id", &id)) + parse_state_start_enum (state, id, TRUE, error); + return; + } + } + + + /* children of {{{3 */ + else if (strcmp (container, "schema") == 0) + { + if (strcmp (element_name, "key") == 0) + { + const gchar *name, *type_string, *enum_type, *flags_type; + + if (COLLECT (STRING, "name", &name, + OPTIONAL | STRING, "type", &type_string, + OPTIONAL | STRING, "enum", &enum_type, + OPTIONAL | STRING, "flags", &flags_type)) + + state->key_state = schema_state_add_key (state->schema_state, + state->enum_table, + state->flags_table, + name, type_string, + enum_type, flags_type, + error); + return; + } + else if (strcmp (element_name, "child") == 0) + { + const gchar *name, *schema; + + if (COLLECT (STRING, "name", &name, STRING, "schema", &schema)) + schema_state_add_child (state->schema_state, + name, schema, error); + return; + } + else if (strcmp (element_name, "override") == 0) + { + const gchar *name, *l10n, *context; + + if (COLLECT (STRING, "name", &name, + OPTIONAL | STRING, "l10n", &l10n, + OPTIONAL | STRING, "context", &context)) + schema_state_add_override (state->schema_state, + &state->key_state, &state->string, + name, l10n, context, error); + return; + } + } + + /* children of {{{3 */ + else if (strcmp (container, "key") == 0) + { + if (strcmp (element_name, "default") == 0) + { + const gchar *l10n, *context; + if (COLLECT (STRING | OPTIONAL, "l10n", &l10n, + STRING | OPTIONAL, "context", &context)) + state->string = key_state_start_default (state->key_state, + l10n, context, error); + return; + } + + else if (strcmp (element_name, "summary") == 0 || + strcmp (element_name, "description") == 0) + { + if (NO_ATTRS ()) + state->string = g_string_new (NULL); + return; + } + + else if (strcmp (element_name, "range") == 0) + { + const gchar *min, *max; + if (COLLECT (STRING, "min", &min, STRING, "max", &max)) + key_state_set_range (state->key_state, min, max, error); + return; + } + + else if (strcmp (element_name, "choices") == 0) + { + if (NO_ATTRS ()) + key_state_start_choices (state->key_state, error); + return; + } + + else if (strcmp (element_name, "aliases") == 0) + { + if (NO_ATTRS ()) + key_state_start_aliases (state->key_state, error); + return; + } + } + + + /* children of {{{3 */ + else if (strcmp (container, "choices") == 0) + { + if (strcmp (element_name, "choice") == 0) + { + const gchar *value; + if (COLLECT (STRING, "value", &value)) + key_state_add_choice (state->key_state, value, error); + return; + } + } + + + /* children of {{{3 */ + else if (strcmp (container, "aliases") == 0) + { + if (strcmp (element_name, "alias") == 0) + { + const gchar *value, *target; + if (COLLECT (STRING, "value", &value, STRING, "target", &target)) + key_state_add_alias (state->key_state, value, target, error); + return; + } + } + + + /* children of {{{3 */ + else if (strcmp (container, "enum") == 0 || + strcmp (container, "flags") == 0) + { + if (strcmp (element_name, "value") == 0) + { + const gchar *nick, *valuestr; + if (COLLECT (STRING, "nick", &nick, + STRING, "value", &valuestr)) + enum_state_add_value (state->enum_state, nick, valuestr, error); + return; + } + } + /* 3}}} */ + + if (container) + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, + _("Element <%s> not allowed inside <%s>"), + element_name, container); + else + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, + _("Element <%s> not allowed at toplevel"), element_name); +} +/* 2}}} */ +/* End element {{{2 */ + +static void +key_state_end (KeyState **state_ptr, + GError **error) +{ + KeyState *state; + + state = *state_ptr; + *state_ptr = NULL; + + if (state->default_value == NULL) + { + g_set_error_literal (error, + G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "element is required in "); + return; + } +} + +static void +schema_state_end (SchemaState **state_ptr, + GError **error) +{ + SchemaState *state; + + state = *state_ptr; + *state_ptr = NULL; +} + +static void +end_element (GMarkupParseContext *context, + const gchar *element_name, + gpointer user_data, + GError **error) +{ + ParseState *state = user_data; + + if (strcmp (element_name, "schemalist") == 0) + { + g_free (state->schemalist_domain); + state->schemalist_domain = NULL; + } + + else if (strcmp (element_name, "enum") == 0 || + strcmp (element_name, "flags") == 0) + enum_state_end (&state->enum_state, error); + + else if (strcmp (element_name, "schema") == 0) + schema_state_end (&state->schema_state, error); + + else if (strcmp (element_name, "override") == 0) + override_state_end (&state->key_state, &state->string, error); + + else if (strcmp (element_name, "key") == 0) + key_state_end (&state->key_state, error); + + else if (strcmp (element_name, "default") == 0) + key_state_end_default (state->key_state, &state->string, error); + + else if (strcmp (element_name, "choices") == 0) + key_state_end_choices (state->key_state, error); + + else if (strcmp (element_name, "aliases") == 0) + key_state_end_aliases (state->key_state, error); + + if (state->string) + { + g_string_free (state->string, TRUE); + state->string = NULL; + } +} +/* Text {{{2 */ +static void +text (GMarkupParseContext *context, + const gchar *text, + gsize text_len, + gpointer user_data, + GError **error) +{ + ParseState *state = user_data; + gsize i; + + for (i = 0; i < text_len; i++) + if (!g_ascii_isspace (text[i])) + { + if (state->string) + g_string_append_len (state->string, text, text_len); + + else + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + _("text may not appear inside <%s>"), + g_markup_parse_context_get_element (context)); + + break; + } +} + +/* Write to GVDB {{{1 */ +typedef struct +{ + GHashTable *table; + GvdbItem *root; +} GvdbPair; + +static void +gvdb_pair_init (GvdbPair *pair) +{ + pair->table = gvdb_hash_table_new (NULL, NULL); + pair->root = gvdb_hash_table_insert (pair->table, ""); +} + +typedef struct +{ + GvdbPair pair; + gboolean l10n; +} OutputSchemaData; + +static void +output_key (gpointer key, + gpointer value, + gpointer user_data) +{ + OutputSchemaData *data; + const gchar *name; + KeyState *state; + GvdbItem *item; + + name = key; + state = value; + data = user_data; + + item = gvdb_hash_table_insert (data->pair.table, name); + gvdb_item_set_parent (item, data->pair.root); + gvdb_item_set_value (item, key_state_serialise (state)); + + if (state->l10n) + data->l10n = TRUE; +} + +static void +output_schema (gpointer key, + gpointer value, + gpointer user_data) +{ + OutputSchemaData data; + GvdbPair *root_pair; + SchemaState *state; + const gchar *id; + GvdbItem *item; + + id = key; + state = value; + root_pair = user_data; + + gvdb_pair_init (&data.pair); + data.l10n = FALSE; + + item = gvdb_hash_table_insert (root_pair->table, id); + gvdb_item_set_parent (item, root_pair->root); + gvdb_item_set_hash_table (item, data.pair.table); + + g_hash_table_foreach (state->keys, output_key, &data); + + if (state->path) + gvdb_hash_table_insert_string (data.pair.table, ".path", state->path); + + if (state->extends_name) + gvdb_hash_table_insert_string (data.pair.table, ".extends", + state->extends_name); + + if (state->list_of) + gvdb_hash_table_insert_string (data.pair.table, ".list-of", + state->extends_name); + + if (data.l10n) + gvdb_hash_table_insert_string (data.pair.table, + ".gettext-domain", + state->gettext_domain); +} + +static gboolean +write_to_file (GHashTable *schema_table, + const gchar *filename, + GError **error) +{ + gboolean success; + GvdbPair pair; + + gvdb_pair_init (&pair); + + g_hash_table_foreach (schema_table, output_schema, &pair); + + success = gvdb_table_write_contents (pair.table, filename, + G_BYTE_ORDER != G_LITTLE_ENDIAN, + error); + g_hash_table_unref (pair.table); + + return success; +} + +/* Parser driver {{{1 */ +static GHashTable * +parse_gschema_files (gchar **files, + gboolean strict) +{ + GMarkupParser parser = { start_element, end_element, text }; + ParseState state = { 0, }; + const gchar *filename; + GError *error = NULL; + + state.enum_table = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, enum_state_free); + + state.flags_table = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, enum_state_free); + + state.schema_table = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, schema_state_free); + + while ((filename = *files++) != NULL) + { + GMarkupParseContext *context; + gchar *contents; + gsize size; + + if (!g_file_get_contents (filename, &contents, &size, &error)) + { + fprintf (stderr, "%s\n", error->message); + g_clear_error (&error); + continue; + } + + context = g_markup_parse_context_new (&parser, + G_MARKUP_PREFIX_ERROR_POSITION, + &state, NULL); + + + if (!g_markup_parse_context_parse (context, contents, size, &error) || + !g_markup_parse_context_end_parse (context, &error)) + { + GSList *item; + + /* back out any changes from this file */ + for (item = state.this_file_schemas; item; item = item->next) + g_hash_table_remove (state.schema_table, item->data); + + for (item = state.this_file_flagss; item; item = item->next) + g_hash_table_remove (state.flags_table, item->data); + + for (item = state.this_file_enums; item; item = item->next) + g_hash_table_remove (state.enum_table, item->data); + + /* let them know */ + fprintf (stderr, "%s: %s. ", filename, error->message); + g_clear_error (&error); + + if (strict) + { + /* Translators: Do not translate "--strict". */ + fprintf (stderr, _("--strict was specified; exiting.\n")); + g_hash_table_unref (state.schema_table); + g_hash_table_unref (state.flags_table); + g_hash_table_unref (state.enum_table); + + return NULL; + } + else + fprintf (stderr, _("This entire file has been ignored.\n")); + } + + /* cleanup */ + g_markup_parse_context_free (context); + g_slist_free (state.this_file_schemas); + g_slist_free (state.this_file_flagss); + g_slist_free (state.this_file_enums); + state.this_file_schemas = NULL; + state.this_file_flagss = NULL; + state.this_file_enums = NULL; + } + + g_hash_table_unref (state.flags_table); + g_hash_table_unref (state.enum_table); + + return state.schema_table; +} + +static gint +compare_strings (gconstpointer a, + gconstpointer b) +{ + gchar *one = *(gchar **) a; + gchar *two = *(gchar **) b; + gint cmp; + + cmp = g_str_has_suffix (two, ".enums.xml") - + g_str_has_suffix (one, ".enums.xml"); + + if (!cmp) + cmp = strcmp (one, two); + + return cmp; +} + +static gboolean +set_overrides (GHashTable *schema_table, + gchar **files, + gboolean strict) +{ + const gchar *filename; + GError *error = NULL; + + while ((filename = *files++)) + { + GKeyFile *key_file; + gchar **groups; + gint i; + + key_file = g_key_file_new (); + if (!g_key_file_load_from_file (key_file, filename, 0, &error)) + { + fprintf (stderr, "%s: %s. ", filename, error->message); + g_key_file_free (key_file); + g_clear_error (&error); + + if (!strict) + { + fprintf (stderr, _("Ignoring this file.\n")); + continue; + } + + fprintf (stderr, _("--strict was specified; exiting.\n")); + return FALSE; + } + + groups = g_key_file_get_groups (key_file, NULL); + + for (i = 0; groups[i]; i++) + { + const gchar *group = groups[i]; + SchemaState *schema; + gchar **keys; + gint j; + + schema = g_hash_table_lookup (schema_table, group); + + if (schema == NULL) + /* Having the schema not be installed is expected to be a + * common case. Don't even emit an error message about + * that. + */ + continue; + + keys = g_key_file_get_keys (key_file, group, NULL, NULL); + g_assert (keys != NULL); + + for (j = 0; keys[j]; j++) + { + const gchar *key = keys[j]; + KeyState *state; + GVariant *value; + gchar *string; + + state = g_hash_table_lookup (schema->keys, key); + + if (state == NULL) + { + fprintf (stderr, _("No such key `%s' in schema `%s' as " + "specified in override file `%s'"), + key, group, filename); + + if (!strict) + { + fprintf (stderr, _("; ignoring override for this key.\n")); + continue; + } + + fprintf (stderr, _(" and --strict was specified; exiting.\n")); + g_key_file_free (key_file); + g_strfreev (groups); + g_strfreev (keys); + + return FALSE; + } + + string = g_key_file_get_value (key_file, group, key, NULL); + g_assert (string != NULL); + + value = g_variant_parse (state->type, string, + NULL, NULL, &error); + + if (value == NULL) + { + fprintf (stderr, _("error parsing key `%s' in schema `%s' " + "as specified in override file `%s': " + "%s. "), + key, group, filename, error->message); + + g_clear_error (&error); + g_free (string); + + if (!strict) + { + fprintf (stderr, _("Ignoring override for this key.\n")); + continue; + } + + fprintf (stderr, _("--strict was specified; exiting.\n")); + g_key_file_free (key_file); + g_strfreev (groups); + g_strfreev (keys); + + return FALSE; + } + + if (state->minimum) + { + if (g_variant_compare (value, state->minimum) < 0 || + g_variant_compare (value, state->maximum) > 0) + { + fprintf (stderr, + _("override for key `%s' in schema `%s' in " + "override file `%s' is out of the range " + "given in the schema"), + key, group, filename); + + g_variant_unref (value); + g_free (string); + + if (!strict) + { + fprintf (stderr, _("; ignoring override for this key.\n")); + continue; + } + + fprintf (stderr, _(" and --strict was specified; exiting.\n")); + g_key_file_free (key_file); + g_strfreev (groups); + g_strfreev (keys); + + return FALSE; + } + } + + else if (state->strinfo->len) + { + if (!is_valid_choices (value, state->strinfo)) + { + fprintf (stderr, + _("override for key `%s' in schema `%s' in " + "override file `%s' is not in the list " + "of valid choices"), + key, group, filename); + + g_variant_unref (value); + g_free (string); + + if (!strict) + { + fprintf (stderr, _("; ignoring override for this key.\n")); + continue; + } + + fprintf (stderr, _(" and --strict was specified; exiting.\n")); + g_key_file_free (key_file); + g_strfreev (groups); + g_strfreev (keys); + + return FALSE; + } + } + + g_variant_unref (state->default_value); + state->default_value = value; + g_free (string); + } + + g_strfreev (keys); + } + + g_strfreev (groups); + } + + return TRUE; +} + +int +main (int argc, char **argv) +{ + GError *error; + GHashTable *table; + GDir *dir; + const gchar *file; + gchar *srcdir; + gchar *targetdir = NULL; + gchar *target; + gboolean uninstall = FALSE; + gboolean dry_run = FALSE; + gboolean strict = FALSE; + gchar **schema_files = NULL; + gchar **override_files = NULL; + GOptionContext *context; + GOptionEntry entries[] = { + { "targetdir", 0, 0, G_OPTION_ARG_FILENAME, &targetdir, N_("where to store the gschemas.compiled file"), N_("DIRECTORY") }, + { "strict", 0, 0, G_OPTION_ARG_NONE, &strict, N_("Abort on any errors in schemas"), NULL }, + { "dry-run", 0, 0, G_OPTION_ARG_NONE, &dry_run, N_("Do not write the gschema.compiled file"), NULL }, + { "uninstall", 0, 0, G_OPTION_ARG_NONE, &uninstall, N_("This option will be removed soon.") }, + { "allow-any-name", 0, 0, G_OPTION_ARG_NONE, &allow_any_name, N_("Do not enforce key name restrictions") }, + + /* These options are only for use in the gschema-compile tests */ + { "schema-file", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME_ARRAY, &schema_files, NULL, NULL }, + { NULL } + }; + + setlocale (LC_ALL, ""); + + context = g_option_context_new (N_("DIRECTORY")); + g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); + g_option_context_set_summary (context, + N_("Compile all GSettings schema files into a schema cache.\n" + "Schema files are required to have the extension .gschema.xml,\n" + "and the cache file is called gschemas.compiled.")); + g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); + + error = NULL; + if (!g_option_context_parse (context, &argc, &argv, &error)) + { + fprintf (stderr, "%s\n", error->message); + return 1; + } + + g_option_context_free (context); + + if (!schema_files && argc != 2) + { + fprintf (stderr, _("You should give exactly one directory name\n")); + return 1; + } + + srcdir = argv[1]; + + if (targetdir == NULL) + targetdir = srcdir; + + target = g_build_filename (targetdir, "gschemas.compiled", NULL); + + if (!schema_files) + { + GPtrArray *overrides; + GPtrArray *files; + + files = g_ptr_array_new (); + overrides = g_ptr_array_new (); + + dir = g_dir_open (srcdir, 0, &error); + if (dir == NULL) + { + fprintf (stderr, "%s\n", error->message); + return 1; + } + + while ((file = g_dir_read_name (dir)) != NULL) + { + if (g_str_has_suffix (file, ".gschema.xml") || + g_str_has_suffix (file, ".enums.xml")) + g_ptr_array_add (files, g_build_filename (srcdir, file, NULL)); + + else if (g_str_has_suffix (file, ".gschema.override")) + g_ptr_array_add (overrides, + g_build_filename (srcdir, file, NULL)); + } + + if (files->len == 0) + { + fprintf (stderr, _("No schema files found: ")); + + if (g_unlink (target)) + fprintf (stderr, _("doing nothing.\n")); + + else + fprintf (stderr, _("removed existing output file.\n")); + + return 0; + } + g_ptr_array_sort (files, compare_strings); + g_ptr_array_add (files, NULL); + + g_ptr_array_sort (overrides, compare_strings); + g_ptr_array_add (overrides, NULL); + + schema_files = (char **) g_ptr_array_free (files, FALSE); + override_files = (gchar **) g_ptr_array_free (overrides, FALSE); + } + + if ((table = parse_gschema_files (schema_files, strict)) == NULL) + { + g_free (target); + return 1; + } + + if (override_files != NULL && + !set_overrides (table, override_files, strict)) + { + g_free (target); + return 1; + } + + if (!dry_run && !write_to_file (table, target, &error)) + { + fprintf (stderr, "%s\n", error->message); + g_free (target); + return 1; + } + + g_free (target); + + return 0; +} + +/* Epilogue {{{1 */ + +/* vim:set foldmethod=marker: */ diff --git a/gio/gloadableicon.c b/gio/gloadableicon.c index 9221d35..1cad7fc 100644 --- a/gio/gloadableicon.c +++ b/gio/gloadableicon.c @@ -27,7 +27,6 @@ #include "gloadableicon.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gloadableicon @@ -71,7 +70,7 @@ g_loadable_icon_default_init (GLoadableIconIface *iface) * Loads a loadable icon. For the asynchronous version of this function, * see g_loadable_icon_load_async(). * - * Returns: a #GInputStream to read the icon from. + * Returns: (transfer full): a #GInputStream to read the icon from. **/ GInputStream * g_loadable_icon_load (GLoadableIcon *icon, @@ -127,7 +126,7 @@ g_loadable_icon_load_async (GLoadableIcon *icon, * * Finishes an asynchronous icon load started in g_loadable_icon_load_async(). * - * Returns: a #GInputStream to read the icon from. + * Returns: (transfer full): a #GInputStream to read the icon from. **/ GInputStream * g_loadable_icon_load_finish (GLoadableIcon *icon, @@ -189,8 +188,7 @@ load_async_thread (GSimpleAsyncResult *res, if (stream == NULL) { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); + g_simple_async_result_take_error (res, error); } else { @@ -239,6 +237,3 @@ g_loadable_icon_real_load_finish (GLoadableIcon *icon, return g_object_ref (data->stream); } - -#define __G_LOADABLE_ICON_C__ -#include "gioaliasdef.c" diff --git a/gio/glocaldirectorymonitor.c b/gio/glocaldirectorymonitor.c index 6aea9a0..0266dc0 100644 --- a/gio/glocaldirectorymonitor.c +++ b/gio/glocaldirectorymonitor.c @@ -31,7 +31,6 @@ #include -#include "gioalias.h" enum { @@ -313,6 +312,3 @@ g_local_directory_monitor_cancel (GFileMonitor *monitor) return TRUE; } - -#define __G_LOCAL_DIRECTORY_MONITOR_C__ -#include "gioaliasdef.c" diff --git a/gio/glocalfile.c b/gio/glocalfile.c index ec290e7..4641f2e 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -105,12 +105,6 @@ #endif #endif -#include "gioalias.h" - -/* See gstdio.h */ -#ifndef G_OS_WIN32 -#define _g_stat_struct stat -#endif static void g_local_file_file_iface_init (GFileIface *iface); @@ -741,7 +735,7 @@ get_mount_info (GFileInfo *fs_info, const char *path, GFileAttributeMatcher *matcher) { - struct _g_stat_struct buf; + GStatBuf buf; gboolean got_info; gpointer info_as_ptr; guint mount_info; @@ -1052,7 +1046,7 @@ g_local_file_find_enclosing_mount (GFile *file, GError **error) { GLocalFile *local = G_LOCAL_FILE (file); - struct _g_stat_struct buf; + GStatBuf buf; char *mountpoint; GMount *mount; @@ -1098,7 +1092,7 @@ g_local_file_set_display_name (GFile *file, { GLocalFile *local, *new_local; GFile *new_file, *parent; - struct _g_stat_struct statbuf; + GStatBuf statbuf; GVfsClass *class; GVfs *vfs; int errsv; @@ -1459,6 +1453,8 @@ g_local_file_delete (GFile *file, return TRUE; } +#ifndef G_OS_WIN32 + static char * strip_trailing_slashes (const char *path) { @@ -1516,7 +1512,7 @@ get_parent (const char *path, dev_t *parent_dev) { char *parent, *tmp; - struct _g_stat_struct parent_stat; + GStatBuf parent_stat; int num_recursions; char *path_copy; @@ -1583,8 +1579,6 @@ expand_all_symlinks (const char *path) return res; } -#ifndef G_OS_WIN32 - static char * find_mountpoint_for (const char *file, dev_t dev) @@ -1725,12 +1719,12 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev) char *topdir, *globaldir, *trashdir, *tmpname; uid_t uid; char uid_str[32]; - struct _g_stat_struct global_stat, trash_stat; + GStatBuf global_stat, trash_stat; gboolean res; if (g_once_init_enter (&home_dev_set)) { - struct _g_stat_struct home_stat; + GStatBuf home_stat; g_stat (g_get_home_dir (), &home_stat); home_dev = home_stat.st_dev; @@ -1792,7 +1786,7 @@ g_local_file_trash (GFile *file, GError **error) { GLocalFile *local = G_LOCAL_FILE (file); - struct _g_stat_struct file_stat, home_stat; + GStatBuf file_stat, home_stat; const char *homedir; char *trashdir, *topdir, *infodir, *filesdir; char *basename, *trashname, *trashfile, *infoname, *infofile; @@ -1802,7 +1796,7 @@ g_local_file_trash (GFile *file, gboolean is_homedir_trash; char delete_time[32]; int fd; - struct _g_stat_struct trash_stat, global_stat; + GStatBuf trash_stat, global_stat; char *dirname, *globaldir; GVfsClass *class; GVfs *vfs; @@ -2207,7 +2201,7 @@ g_local_file_move (GFile *source, GError **error) { GLocalFile *local_source, *local_destination; - struct _g_stat_struct statbuf; + GStatBuf statbuf; gboolean destination_exist, source_is_dir; char *backup_name; int res; diff --git a/gio/glocalfileenumerator.c b/gio/glocalfileenumerator.c index e39c050..882824a 100644 --- a/gio/glocalfileenumerator.c +++ b/gio/glocalfileenumerator.c @@ -31,7 +31,6 @@ #include #include "glibintl.h" -#include "gioalias.h" #define CHUNK_SIZE 1000 @@ -328,7 +327,7 @@ g_local_file_enumerator_next_file (GFileEnumerator *enumerator, _g_local_file_info_get_parent_info (local->filename, local->matcher, &local->parent_info); local->got_parent_info = TRUE; } - + next_file: #ifdef USE_GDIR @@ -355,8 +354,7 @@ g_local_file_enumerator_next_file (GFileEnumerator *enumerator, /* If the file does not exist there might have been a race where * the file was removed between the readdir and the stat, so we * ignore the file. */ - if (my_error->domain == G_IO_ERROR && - my_error->code == G_IO_ERROR_NOT_FOUND) + if (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { g_error_free (my_error); goto next_file; @@ -387,5 +385,3 @@ g_local_file_enumerator_close (GFileEnumerator *enumerator, return TRUE; } - - diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index a913e82..30ea97b 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -94,12 +94,6 @@ #include "gcontenttype.h" #include "gcontenttypeprivate.h" -#include "gioalias.h" - -/* See gstdio.h */ -#ifndef G_OS_WIN32 -#define _g_stat_struct stat -#endif struct ThumbMD5Context { guint32 buf[4]; @@ -125,18 +119,18 @@ static GHashTable *gid_cache = NULL; char * _g_local_file_info_create_etag (GLocalFileStat *statbuf) { - GTimeVal tv; - - tv.tv_sec = statbuf->st_mtime; + glong sec, usec; + + sec = statbuf->st_mtime; #if defined (HAVE_STRUCT_STAT_ST_MTIMENSEC) - tv.tv_usec = statbuf->st_mtimensec / 1000; + usec = statbuf->st_mtimensec / 1000; #elif defined (HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) - tv.tv_usec = statbuf->st_mtim.tv_nsec / 1000; + usec = statbuf->st_mtim.tv_nsec / 1000; #else - tv.tv_usec = 0; + usec = 0; #endif - return g_strdup_printf ("%lu:%lu", tv.tv_sec, tv.tv_usec); + return g_strdup_printf ("%lu:%lu", sec, usec); } static char * @@ -793,7 +787,7 @@ _g_local_file_info_get_parent_info (const char *dir, GFileAttributeMatcher *attribute_matcher, GLocalParentFileInfo *parent_info) { - struct _g_stat_struct statbuf; + GStatBuf statbuf; int res; parent_info->extra_data = NULL; @@ -1221,19 +1215,19 @@ get_content_type (const char *basename, { if (is_symlink && (symlink_broken || (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS))) - return g_strdup ("inode/symlink"); - else if (S_ISDIR(statbuf->st_mode)) + return g_strdup ("inode/symlink"); + else if (statbuf != NULL && S_ISDIR(statbuf->st_mode)) return g_strdup ("inode/directory"); #ifndef G_OS_WIN32 - else if (S_ISCHR(statbuf->st_mode)) + else if (statbuf != NULL && S_ISCHR(statbuf->st_mode)) return g_strdup ("inode/chardevice"); - else if (S_ISBLK(statbuf->st_mode)) + else if (statbuf != NULL && S_ISBLK(statbuf->st_mode)) return g_strdup ("inode/blockdevice"); - else if (S_ISFIFO(statbuf->st_mode)) + else if (statbuf != NULL && S_ISFIFO(statbuf->st_mode)) return g_strdup ("inode/fifo"); #endif #ifdef S_ISSOCK - else if (S_ISSOCK(statbuf->st_mode)) + else if (statbuf != NULL && S_ISSOCK(statbuf->st_mode)) return g_strdup ("inode/socket"); #endif else @@ -1427,6 +1421,7 @@ _g_local_file_info_get (const char *basename, struct stat statbuf2; #endif int res; + gboolean stat_ok; gboolean is_symlink, symlink_broken; #ifdef G_OS_WIN32 DWORD dos_attributes; @@ -1477,20 +1472,31 @@ _g_local_file_info_get (const char *basename, if (res == -1) { int errsv = errno; - char *display_name = g_filename_display_name (path); - g_object_unref (info); - g_set_error (error, G_IO_ERROR, - g_io_error_from_errno (errsv), - _("Error stating file '%s': %s"), - display_name, g_strerror (errsv)); - g_free (display_name); - return NULL; + + /* Don't bail out if we get Permission denied (SELinux?) */ + if (errsv != EACCES) + { + char *display_name = g_filename_display_name (path); + g_object_unref (info); + g_set_error (error, G_IO_ERROR, + g_io_error_from_errno (errsv), + _("Error stating file '%s': %s"), + display_name, g_strerror (errsv)); + g_free (display_name); + return NULL; + } } - device = statbuf.st_dev; + /* Even if stat() fails, try to get as much as other attributes possible */ + stat_ok = res != -1; + + if (stat_ok) + device = statbuf.st_dev; + else + device = 0; #ifdef S_ISLNK - is_symlink = S_ISLNK (statbuf.st_mode); + is_symlink = stat_ok && S_ISLNK (statbuf.st_mode); #else is_symlink = FALSE; #endif @@ -1505,23 +1511,27 @@ _g_local_file_info_get (const char *basename, { res = stat (path, &statbuf2); - /* Report broken links as symlinks */ + /* Report broken links as symlinks */ if (res != -1) - statbuf = statbuf2; + { + statbuf = statbuf2; + stat_ok = TRUE; + } else symlink_broken = TRUE; } } #endif - set_info_from_stat (info, &statbuf, attribute_matcher); - + if (stat_ok) + set_info_from_stat (info, &statbuf, attribute_matcher); + #ifndef G_OS_WIN32 if (basename != NULL && basename[0] == '.') g_file_info_set_is_hidden (info, TRUE); if (basename != NULL && basename[strlen (basename) -1] == '~' && - S_ISREG (statbuf.st_mode)) + (stat_ok && S_ISREG (statbuf.st_mode))) _g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_STANDARD_IS_BACKUP, TRUE); #else if (dos_attributes & FILE_ATTRIBUTE_HIDDEN) @@ -1584,7 +1594,7 @@ _g_local_file_info_get (const char *basename, _g_file_attribute_matcher_matches_id (attribute_matcher, G_FILE_ATTRIBUTE_ID_STANDARD_ICON)) { - char *content_type = get_content_type (basename, path, &statbuf, is_symlink, symlink_broken, flags, FALSE); + char *content_type = get_content_type (basename, path, stat_ok ? &statbuf : NULL, is_symlink, symlink_broken, flags, FALSE); if (content_type) { @@ -1641,7 +1651,7 @@ _g_local_file_info_get (const char *basename, if (_g_file_attribute_matcher_matches_id (attribute_matcher, G_FILE_ATTRIBUTE_ID_STANDARD_FAST_CONTENT_TYPE)) { - char *content_type = get_content_type (basename, path, &statbuf, is_symlink, symlink_broken, flags, TRUE); + char *content_type = get_content_type (basename, path, stat_ok ? &statbuf : NULL, is_symlink, symlink_broken, flags, TRUE); if (content_type) { @@ -1658,7 +1668,8 @@ _g_local_file_info_get (const char *basename, #ifdef G_OS_WIN32 win32_get_file_user_info (path, NULL, &name, NULL); #else - name = get_username_from_uid (statbuf.st_uid); + if (stat_ok) + name = get_username_from_uid (statbuf.st_uid); #endif if (name) _g_file_info_set_attribute_string_by_id (info, G_FILE_ATTRIBUTE_ID_OWNER_USER, name); @@ -1672,7 +1683,8 @@ _g_local_file_info_get (const char *basename, #ifdef G_OS_WIN32 win32_get_file_user_info (path, NULL, NULL, &name); #else - name = get_realname_from_uid (statbuf.st_uid); + if (stat_ok) + name = get_realname_from_uid (statbuf.st_uid); #endif if (name) _g_file_info_set_attribute_string_by_id (info, G_FILE_ATTRIBUTE_ID_OWNER_USER_REAL, name); @@ -1686,19 +1698,21 @@ _g_local_file_info_get (const char *basename, #ifdef G_OS_WIN32 win32_get_file_user_info (path, &name, NULL, NULL); #else - name = get_groupname_from_gid (statbuf.st_gid); + if (stat_ok) + name = get_groupname_from_gid (statbuf.st_gid); #endif if (name) _g_file_info_set_attribute_string_by_id (info, G_FILE_ATTRIBUTE_ID_OWNER_GROUP, name); g_free (name); } - if (parent_info && parent_info->device != 0 && + if (stat_ok && parent_info && parent_info->device != 0 && _g_file_attribute_matcher_matches_id (attribute_matcher, G_FILE_ATTRIBUTE_ID_UNIX_IS_MOUNTPOINT) && statbuf.st_dev != parent_info->device) _g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_UNIX_IS_MOUNTPOINT, TRUE); - get_access_rights (attribute_matcher, info, path, &statbuf, parent_info); + if (stat_ok) + get_access_rights (attribute_matcher, info, path, &statbuf, parent_info); #ifdef HAVE_SELINUX get_selinux_context (path, info, attribute_matcher, (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0); diff --git a/gio/glocalfileinputstream.c b/gio/glocalfileinputstream.c index 2411ceb..5aa436d 100644 --- a/gio/glocalfileinputstream.c +++ b/gio/glocalfileinputstream.c @@ -33,24 +33,34 @@ #include #include #include "gcancellable.h" -#include "gfiledescriptorbased.h" #include "gioerror.h" #include "glocalfileinputstream.h" #include "glocalfileinfo.h" #include "glibintl.h" +#ifdef G_OS_UNIX +#include "gfiledescriptorbased.h" +#endif + #ifdef G_OS_WIN32 #include #endif -#include "gioalias.h" +#ifdef G_OS_UNIX static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); +#endif + #define g_local_file_input_stream_get_type _g_local_file_input_stream_get_type +#ifdef G_OS_UNIX G_DEFINE_TYPE_WITH_CODE (GLocalFileInputStream, g_local_file_input_stream, G_TYPE_FILE_INPUT_STREAM, G_IMPLEMENT_INTERFACE (G_TYPE_FILE_DESCRIPTOR_BASED, - g_file_descriptor_based_iface_init)); + g_file_descriptor_based_iface_init) +); +#else +G_DEFINE_TYPE_WITH_CODE (GLocalFileInputStream, g_local_file_input_stream, G_TYPE_FILE_INPUT_STREAM,); +#endif struct _GLocalFileInputStreamPrivate { int fd; @@ -80,7 +90,9 @@ static GFileInfo *g_local_file_input_stream_query_info (GFileInputStream *strea const char *attributes, GCancellable *cancellable, GError **error); +#ifdef G_OS_UNIX static int g_local_file_input_stream_get_fd (GFileDescriptorBased *stream); +#endif static void g_local_file_input_stream_finalize (GObject *object) @@ -115,11 +127,13 @@ g_local_file_input_stream_class_init (GLocalFileInputStreamClass *klass) file_stream_class->query_info = g_local_file_input_stream_query_info; } +#ifdef G_OS_UNIX static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) { iface->get_fd = g_local_file_input_stream_get_fd; } +#endif static void g_local_file_input_stream_init (GLocalFileInputStream *info) @@ -349,10 +363,11 @@ g_local_file_input_stream_query_info (GFileInputStream *stream, error); } +#ifdef G_OS_UNIX static int g_local_file_input_stream_get_fd (GFileDescriptorBased *fd_based) { GLocalFileInputStream *stream = G_LOCAL_FILE_INPUT_STREAM (fd_based); return stream->priv->fd; } - +#endif diff --git a/gio/glocalfileiostream.c b/gio/glocalfileiostream.c index e1f295c..5e4792b 100644 --- a/gio/glocalfileiostream.c +++ b/gio/glocalfileiostream.c @@ -27,12 +27,14 @@ #include "glibintl.h" #include "gioerror.h" #include "gcancellable.h" -#include "gfiledescriptorbased.h" #include "glocalfileiostream.h" #include "glocalfileinputstream.h" #include "glocalfileinfo.h" -#include "gioalias.h" +#ifdef G_OS_UNIX +#include "gfiledescriptorbased.h" +#endif + #define g_local_file_io_stream_get_type _g_local_file_io_stream_get_type G_DEFINE_TYPE (GLocalFileIOStream, g_local_file_io_stream, G_TYPE_FILE_IO_STREAM); @@ -59,8 +61,9 @@ _g_local_file_io_stream_new (GLocalFileOutputStream *output_stream) stream = g_object_new (G_TYPE_LOCAL_FILE_IO_STREAM, NULL); stream->output_stream = g_object_ref (output_stream); _g_local_file_output_stream_set_do_close (output_stream, FALSE); - fd = g_file_descriptor_based_get_fd (G_FILE_DESCRIPTOR_BASED (output_stream)); + fd = _g_local_file_output_stream_get_fd (output_stream); stream->input_stream = (GInputStream *)_g_local_file_input_stream_new (fd); + _g_local_file_input_stream_set_do_close (G_LOCAL_FILE_INPUT_STREAM (stream->input_stream), FALSE); diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c index 8405d3a..91d524f 100644 --- a/gio/glocalfilemonitor.c +++ b/gio/glocalfilemonitor.c @@ -30,7 +30,6 @@ #include -#include "gioalias.h" enum { @@ -223,6 +222,3 @@ _g_local_file_monitor_new (const char *pathname, return monitor; } - -#define __G_LOCAL_FILE_MONITOR_C__ -#include "gioaliasdef.c" diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c index f870d7b..40576a9 100644 --- a/gio/glocalfileoutputstream.c +++ b/gio/glocalfileoutputstream.c @@ -36,10 +36,13 @@ #include "glibintl.h" #include "gioerror.h" #include "gcancellable.h" -#include "gfiledescriptorbased.h" #include "glocalfileoutputstream.h" #include "glocalfileinfo.h" +#ifdef G_OS_UNIX +#include "gfiledescriptorbased.h" +#endif + #ifdef G_OS_WIN32 #include #ifndef S_ISDIR @@ -54,13 +57,20 @@ #define O_BINARY 0 #endif -#include "gioalias.h" +#ifdef G_OS_UNIX static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); +#endif + #define g_local_file_output_stream_get_type _g_local_file_output_stream_get_type +#ifdef G_OS_UNIX G_DEFINE_TYPE_WITH_CODE (GLocalFileOutputStream, g_local_file_output_stream, G_TYPE_FILE_OUTPUT_STREAM, G_IMPLEMENT_INTERFACE (G_TYPE_FILE_DESCRIPTOR_BASED, - g_file_descriptor_based_iface_init)); + g_file_descriptor_based_iface_init) + ); +#else +G_DEFINE_TYPE_WITH_CODE (GLocalFileOutputStream, g_local_file_output_stream, G_TYPE_FILE_OUTPUT_STREAM,); +#endif /* Some of the file replacement code was based on the code from gedit, @@ -104,7 +114,9 @@ static gboolean g_local_file_output_stream_truncate (GFileOutputStream *s goffset size, GCancellable *cancellable, GError **error); +#ifdef G_OS_UNIX static int g_local_file_output_stream_get_fd (GFileDescriptorBased *stream); +#endif static void g_local_file_output_stream_finalize (GObject *object) @@ -144,11 +156,13 @@ g_local_file_output_stream_class_init (GLocalFileOutputStreamClass *klass) file_stream_class->truncate_fn = g_local_file_output_stream_truncate; } +#ifdef G_OS_UNIX static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) { iface->get_fd = g_local_file_output_stream_get_fd; } +#endif static void g_local_file_output_stream_init (GLocalFileOutputStream *stream) @@ -1159,11 +1173,18 @@ _g_local_file_output_stream_replace (const char *filename, return G_FILE_OUTPUT_STREAM (stream); } +gint +_g_local_file_output_stream_get_fd (GLocalFileOutputStream *stream) +{ + g_return_val_if_fail (G_IS_LOCAL_FILE_OUTPUT_STREAM (stream), -1); + return stream->priv->fd; +} + +#ifdef G_OS_UNIX static int g_local_file_output_stream_get_fd (GFileDescriptorBased *fd_based) { GLocalFileOutputStream *stream = G_LOCAL_FILE_OUTPUT_STREAM (fd_based); - - return stream->priv->fd; + return _g_local_file_output_stream_get_fd (stream); } - +#endif diff --git a/gio/glocalfileoutputstream.h b/gio/glocalfileoutputstream.h index a8ec736..831c37f 100644 --- a/gio/glocalfileoutputstream.h +++ b/gio/glocalfileoutputstream.h @@ -80,6 +80,12 @@ GFileOutputStream * _g_local_file_output_stream_replace (const char *file GCancellable *cancellable, GError **error); +/* Hack to get the fd since GFileDescriptorBased (which is how you + * _should_ get the fd) is only available on UNIX but things like + * win32 needs this as well + */ +gint _g_local_file_output_stream_get_fd (GLocalFileOutputStream *output_stream); + G_END_DECLS #endif /* __G_LOCAL_FILE_OUTPUT_STREAM_H__ */ diff --git a/gio/glocalvfs.c b/gio/glocalvfs.c index cd535e3..f2eaea2 100644 --- a/gio/glocalvfs.c +++ b/gio/glocalvfs.c @@ -33,7 +33,6 @@ #endif #include -#include "gioalias.h" struct _GLocalVfs { diff --git a/gio/gmemoryinputstream.c b/gio/gmemoryinputstream.c index bb6001b..397c6a5 100644 --- a/gio/gmemoryinputstream.c +++ b/gio/gmemoryinputstream.c @@ -29,7 +29,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gmemoryinputstream @@ -521,6 +520,3 @@ g_memory_input_stream_truncate (GSeekable *seekable, _("Cannot truncate GMemoryInputStream")); return FALSE; } - -#define __G_MEMORY_INPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gmemoryoutputstream.c b/gio/gmemoryoutputstream.c index 6b20c0a..3291be4 100644 --- a/gio/gmemoryoutputstream.c +++ b/gio/gmemoryoutputstream.c @@ -31,7 +31,6 @@ #include "string.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gmemoryoutputstream @@ -377,7 +376,7 @@ g_memory_output_stream_new (gpointer data, } /** - * g_memory_output_stream_get_data: + * g_memory_output_stream_get_data: (skip) * @ostream: a #GMemoryOutputStream * * Gets any loaded data from the @ostream. @@ -441,6 +440,35 @@ g_memory_output_stream_get_data_size (GMemoryOutputStream *ostream) return ostream->priv->valid_len; } +/** + * g_memory_output_stream_steal_data: + * @ostream: a #GMemoryOutputStream + * + * Gets any loaded data from the @ostream. Ownership of the data + * is transferred to the caller; when no longer needed it must be + * freed using the free function set in @ostream's + * #GMemoryOutputStream:destroy-function property. + * + * @ostream must be closed before calling this function. + * + * Returns: (transfer full): the stream's data + * + * Since: 2.26 + **/ +gpointer +g_memory_output_stream_steal_data (GMemoryOutputStream *ostream) +{ + gpointer data; + + g_return_val_if_fail (G_IS_MEMORY_OUTPUT_STREAM (ostream), NULL); + g_return_val_if_fail (g_output_stream_is_closed (G_OUTPUT_STREAM (ostream)), NULL); + + data = ostream->priv->data; + ostream->priv->data = NULL; + + return data; +} + static gboolean array_resize (GMemoryOutputStream *ostream, gsize size, @@ -768,6 +796,3 @@ g_memory_output_stream_truncate (GSeekable *seekable, return TRUE; } - -#define __G_MEMORY_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gmemoryoutputstream.h b/gio/gmemoryoutputstream.h index ddb4051..bcdc164 100644 --- a/gio/gmemoryoutputstream.h +++ b/gio/gmemoryoutputstream.h @@ -91,6 +91,7 @@ GOutputStream *g_memory_output_stream_new (gpointer data, gpointer g_memory_output_stream_get_data (GMemoryOutputStream *ostream); gsize g_memory_output_stream_get_size (GMemoryOutputStream *ostream); gsize g_memory_output_stream_get_data_size (GMemoryOutputStream *ostream); +gpointer g_memory_output_stream_steal_data (GMemoryOutputStream *ostream); G_END_DECLS diff --git a/gio/gmemorysettingsbackend.c b/gio/gmemorysettingsbackend.c new file mode 100644 index 0000000..6b60058 --- /dev/null +++ b/gio/gmemorysettingsbackend.c @@ -0,0 +1,176 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "config.h" + +#include "gmemorysettingsbackend.h" +#include "gsimplepermission.h" +#include "gsettingsbackend.h" +#include "giomodule.h" + + +#define G_TYPE_MEMORY_SETTINGS_BACKEND (g_memory_settings_backend_get_type()) +#define G_MEMORY_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_MEMORY_SETTINGS_BACKEND, \ + GMemorySettingsBackend)) + +typedef GSettingsBackendClass GMemorySettingsBackendClass; +typedef struct +{ + GSettingsBackend parent_instance; + GHashTable *table; +} GMemorySettingsBackend; + +G_DEFINE_TYPE_WITH_CODE (GMemorySettingsBackend, + g_memory_settings_backend, + G_TYPE_SETTINGS_BACKEND, + g_io_extension_point_implement (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME, + g_define_type_id, "memory", 10)) + +static GVariant * +g_memory_settings_backend_read (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value) +{ + GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (backend); + GVariant *value; + + if (default_value) + return NULL; + + value = g_hash_table_lookup (memory->table, key); + + if (value != NULL) + g_variant_ref (value); + + return value; +} + +static gboolean +g_memory_settings_backend_write (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag) +{ + GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (backend); + GVariant *old_value; + + old_value = g_hash_table_lookup (memory->table, key); + g_variant_ref_sink (value); + + if (old_value == NULL || !g_variant_equal (value, old_value)) + { + g_hash_table_insert (memory->table, g_strdup (key), value); + g_settings_backend_changed (backend, key, origin_tag); + } + else + g_variant_unref (value); + + return TRUE; +} + +static gboolean +g_memory_settings_backend_write_one (gpointer key, + gpointer value, + gpointer data) +{ + GMemorySettingsBackend *memory = data; + + if (value != NULL) + g_hash_table_insert (memory->table, g_strdup (key), g_variant_ref (value)); + else + g_hash_table_remove (memory->table, key); + + return FALSE; +} + +static gboolean +g_memory_settings_backend_write_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag) +{ + g_tree_foreach (tree, g_memory_settings_backend_write_one, backend); + g_settings_backend_changed_tree (backend, tree, origin_tag); + + return TRUE; +} + +static void +g_memory_settings_backend_reset (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (backend); + + if (g_hash_table_lookup (memory->table, key)) + { + g_hash_table_remove (memory->table, key); + g_settings_backend_changed (backend, key, origin_tag); + } +} + +static gboolean +g_memory_settings_backend_get_writable (GSettingsBackend *backend, + const gchar *name) +{ + return TRUE; +} + +static GPermission * +g_memory_settings_backend_get_permission (GSettingsBackend *backend, + const gchar *path) +{ + return g_simple_permission_new (TRUE); +} + +static void +g_memory_settings_backend_finalize (GObject *object) +{ + GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (object); + + g_hash_table_unref (memory->table); + + G_OBJECT_CLASS (g_memory_settings_backend_parent_class) + ->finalize (object); +} + +static void +g_memory_settings_backend_init (GMemorySettingsBackend *memory) +{ + memory->table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + (GDestroyNotify) g_variant_unref); +} + +static void +g_memory_settings_backend_class_init (GMemorySettingsBackendClass *class) +{ + GSettingsBackendClass *backend_class = G_SETTINGS_BACKEND_CLASS (class); + GObjectClass *object_class = G_OBJECT_CLASS (class); + + backend_class->read = g_memory_settings_backend_read; + backend_class->write = g_memory_settings_backend_write; + backend_class->write_tree = g_memory_settings_backend_write_tree; + backend_class->reset = g_memory_settings_backend_reset; + backend_class->get_writable = g_memory_settings_backend_get_writable; + backend_class->get_permission = g_memory_settings_backend_get_permission; + object_class->finalize = g_memory_settings_backend_finalize; +} diff --git a/gio/gmemorysettingsbackend.h b/gio/gmemorysettingsbackend.h new file mode 100644 index 0000000..9b7756c --- /dev/null +++ b/gio/gmemorysettingsbackend.h @@ -0,0 +1,30 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#ifndef __GMEMORY_SETTINGS_BACKEND_H__ +#define __GMEMORY_SETTINGS_BACKEND_H__ + +#include + +G_GNUC_INTERNAL +GType g_memory_settings_backend_get_type (void); + +#endif /* __G_MEMORY_SETTINGS_BACKEND_H__ */ diff --git a/gio/gmount.c b/gio/gmount.c index 3e80dfb..983a9fe 100644 --- a/gio/gmount.c +++ b/gio/gmount.c @@ -34,13 +34,12 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gmount * @short_description: Mount management * @include: gio/gio.h - * @see also: GVolume, GUnixMount + * @see_also: GVolume, GUnixMount * * The #GMount interface represents user-visible mounts. Note, when * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume. @@ -123,7 +122,7 @@ g_mount_default_init (GMountInterface *iface) * * Gets the root directory on @mount. * - * Returns: a #GFile. + * Returns: (transfer full): a #GFile. * The returned object should be unreffed with * g_object_unref() when no longer needed. **/ @@ -147,7 +146,7 @@ g_mount_get_root (GMount *mount) * @mount is a path that reflects the main entry point for the user (e.g. * the home directory, or the root of the volume). * - * Returns: a #GFile. + * Returns: (transfer full): a #GFile. * The returned object should be unreffed with * g_object_unref() when no longer needed. **/ @@ -198,7 +197,7 @@ g_mount_get_name (GMount *mount) * * Gets the icon for @mount. * - * Returns: a #GIcon. + * Returns: (transfer full): a #GIcon. * The returned object should be unreffed with * g_object_unref() when no longer needed. **/ @@ -245,7 +244,7 @@ g_mount_get_uuid (GMount *mount) * * Gets the volume for the @mount. * - * Returns: a #GVolume or %NULL if @mount is not associated with a volume. + * Returns: (transfer full): a #GVolume or %NULL if @mount is not associated with a volume. * The returned object should be unreffed with * g_object_unref() when no longer needed. **/ @@ -270,7 +269,7 @@ g_mount_get_volume (GMount *mount) * This is a convenience method for getting the #GVolume and then * using that object to get the #GDrive. * - * Returns: a #GDrive or %NULL if @mount is not associated with a volume or a drive. + * Returns: (transfer full): a #GDrive or %NULL if @mount is not associated with a volume or a drive. * The returned object should be unreffed with * g_object_unref() when no longer needed. **/ @@ -801,7 +800,7 @@ g_mount_guess_content_type (GMount *mount, * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content * guessing. * - * Returns: a %NULL-terminated array of content types or %NULL on error. + * Returns: (transfer full) (element-type utf8): a %NULL-terminated array of content types or %NULL on error. * Caller should free this array with g_strfreev() when done with it. * * Since: 2.18 @@ -813,14 +812,14 @@ g_mount_guess_content_type_finish (GMount *mount, { GMountIface *iface; - g_return_val_if_fail (G_IS_MOUNT (mount), FALSE); - g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE); + g_return_val_if_fail (G_IS_MOUNT (mount), NULL); + g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL); if (G_IS_SIMPLE_ASYNC_RESULT (result)) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) - return FALSE; + return NULL; } iface = G_MOUNT_GET_IFACE (mount); @@ -845,7 +844,7 @@ g_mount_guess_content_type_finish (GMount *mount, * This is an synchronous operation and as such may block doing IO; * see g_mount_guess_content_type() for the asynchronous version. * - * Returns: a %NULL-terminated array of content types or %NULL on error. + * Returns: (transfer full) (element-type utf8): a %NULL-terminated array of content types or %NULL on error. * Caller should free this array with g_strfreev() when done with it. * * Since: 2.18 @@ -1010,6 +1009,3 @@ g_mount_unshadow (GMount *mount) g_warning ("Shadow ref count on GMount is negative"); G_UNLOCK (priv_lock); } - -#define __G_MOUNT_C__ -#include "gioaliasdef.c" diff --git a/gio/gmountoperation.c b/gio/gmountoperation.c index 35927d4..a6bac9b 100644 --- a/gio/gmountoperation.c +++ b/gio/gmountoperation.c @@ -29,7 +29,6 @@ #include "gio-marshal.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gmountoperation @@ -708,6 +707,3 @@ g_mount_operation_reply (GMountOperation *op, g_return_if_fail (G_IS_MOUNT_OPERATION (op)); g_signal_emit (op, signals[REPLY], 0, result); } - -#define __G_MOUNT_OPERATION_C__ -#include "gioaliasdef.c" diff --git a/gio/gnativevolumemonitor.c b/gio/gnativevolumemonitor.c index 71c0c5a..71e8936 100644 --- a/gio/gnativevolumemonitor.c +++ b/gio/gnativevolumemonitor.c @@ -27,7 +27,6 @@ #include #include "gnativevolumemonitor.h" -#include "gioalias.h" G_DEFINE_ABSTRACT_TYPE (GNativeVolumeMonitor, g_native_volume_monitor, G_TYPE_VOLUME_MONITOR); @@ -51,6 +50,3 @@ static void g_native_volume_monitor_init (GNativeVolumeMonitor *native_monitor) { } - -#define __G_NATIVE_VOLUME_MONITOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gnetworkaddress.c b/gio/gnetworkaddress.c index 16af7f5..3a58325 100644 --- a/gio/gnetworkaddress.c +++ b/gio/gnetworkaddress.c @@ -30,6 +30,7 @@ #include "ginetaddress.h" #include "ginetsocketaddress.h" #include "gnetworkingprivate.h" +#include "gproxyaddressenumerator.h" #include "gresolver.h" #include "gsimpleasyncresult.h" #include "gsocketaddressenumerator.h" @@ -38,7 +39,6 @@ #include -#include "gioalias.h" /** * SECTION:gnetworkaddress @@ -64,12 +64,14 @@ struct _GNetworkAddressPrivate { gchar *hostname; guint16 port; GList *sockaddrs; + gchar *scheme; }; enum { PROP_0, PROP_HOSTNAME, PROP_PORT, + PROP_SCHEME, }; static void g_network_address_set_property (GObject *object, @@ -81,8 +83,9 @@ static void g_network_address_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void g_network_address_connectable_iface_init (GSocketConnectableIface *iface); -static GSocketAddressEnumerator *g_network_address_connectable_enumerate (GSocketConnectable *connectable); +static void g_network_address_connectable_iface_init (GSocketConnectableIface *iface); +static GSocketAddressEnumerator *g_network_address_connectable_enumerate (GSocketConnectable *connectable); +static GSocketAddressEnumerator *g_network_address_connectable_proxy_enumerate (GSocketConnectable *connectable); G_DEFINE_TYPE_WITH_CODE (GNetworkAddress, g_network_address, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_SOCKET_CONNECTABLE, @@ -94,6 +97,7 @@ g_network_address_finalize (GObject *object) GNetworkAddress *addr = G_NETWORK_ADDRESS (object); g_free (addr->priv->hostname); + g_free (addr->priv->scheme); if (addr->priv->sockaddrs) { @@ -134,12 +138,22 @@ g_network_address_class_init (GNetworkAddressClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_SCHEME, + g_param_spec_string ("scheme", + P_("Scheme"), + P_("URI Scheme"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); } static void g_network_address_connectable_iface_init (GSocketConnectableIface *connectable_iface) { connectable_iface->enumerate = g_network_address_connectable_enumerate; + connectable_iface->proxy_enumerate = g_network_address_connectable_proxy_enumerate; } static void @@ -160,8 +174,7 @@ g_network_address_set_property (GObject *object, switch (prop_id) { case PROP_HOSTNAME: - if (addr->priv->hostname) - g_free (addr->priv->hostname); + g_free (addr->priv->hostname); addr->priv->hostname = g_value_dup_string (value); break; @@ -169,6 +182,12 @@ g_network_address_set_property (GObject *object, addr->priv->port = g_value_get_uint (value); break; + case PROP_SCHEME: + if (addr->priv->scheme) + g_free (addr->priv->scheme); + addr->priv->scheme = g_value_dup_string (value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -194,6 +213,10 @@ g_network_address_get_property (GObject *object, g_value_set_uint (value, addr->priv->port); break; + case PROP_SCHEME: + g_value_set_string (value, addr->priv->scheme); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -228,7 +251,7 @@ g_network_address_set_addresses (GNetworkAddress *addr, * Creates a new #GSocketConnectable for connecting to the given * @hostname and @port. * - * Return value: the new #GNetworkAddress + * Return value: (transfer full): the new #GNetworkAddress * * Since: 2.22 */ @@ -252,7 +275,7 @@ g_network_address_new (const gchar *hostname, * @hostname and @port. May fail and return %NULL in case * parsing @host_and_port fails. * - * @host_and_port may be in any of a number of recognised formats: an IPv6 + * @host_and_port may be in any of a number of recognised formats; an IPv6 * address, an IPv4 address, or a domain name (in which case a DNS * lookup is performed). Quoting with [] is supported for all address * types. A port override may be specified in the usual way with a @@ -266,7 +289,7 @@ g_network_address_new (const gchar *hostname, * (allowing them to give the hostname, and a port overide if necessary) * and @default_port is expected to be provided by the application. * - * Return value: the new #GNetworkAddress, or %NULL on error + * Return value: (transfer full): the new #GNetworkAddress, or %NULL on error * * Since: 2.22 */ @@ -398,6 +421,304 @@ g_network_address_parse (const gchar *host_and_port, return connectable; } +/* Allowed characters outside alphanumeric for unreserved. */ +#define G_URI_OTHER_UNRESERVED "-._~" + +/* This or something equivalent will eventually go into glib/guri.h */ +gboolean +_g_uri_parse_authority (const char *uri, + char **host, + guint16 *port, + char **userinfo) +{ + char *tmp_str; + const char *start, *p; + char c; + + g_return_val_if_fail (uri != NULL, FALSE); + + if (host) + *host = NULL; + + if (port) + *port = 0; + + if (userinfo) + *userinfo = NULL; + + /* From RFC 3986 Decodes: + * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] + * hier-part = "//" authority path-abempty + * path-abempty = *( "/" segment ) + * authority = [ userinfo "@" ] host [ ":" port ] + */ + + /* Check we have a valid scheme */ + tmp_str = g_uri_parse_scheme (uri); + + if (tmp_str == NULL) + return FALSE; + + g_free (tmp_str); + + /* Decode hier-part: + * hier-part = "//" authority path-abempty + */ + p = uri; + start = strstr (p, "//"); + + if (start == NULL) + return FALSE; + + start += 2; + p = strchr (start, '@'); + + if (p != NULL) + { + /* Decode userinfo: + * userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + */ + while (1) + { + c = *p++; + + if (c == '@') + break; + + /* pct-encoded */ + if (c == '%') + { + if (!(g_ascii_isxdigit (p[0]) || + g_ascii_isxdigit (p[1]))) + return FALSE; + + p++; + + continue; + } + + /* unreserved / sub-delims / : */ + if (!(g_ascii_isalnum(c) || + strchr (G_URI_OTHER_UNRESERVED, c) || + strchr (G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS, c) || + c == ':')) + return FALSE; + } + + if (userinfo) + *userinfo = g_strndup (start, p - start - 1); + + start = p; + } + else + { + p = start; + } + + + /* decode host: + * host = IP-literal / IPv4address / reg-name + * reg-name = *( unreserved / pct-encoded / sub-delims ) + */ + + /* If IPv6 or IPvFuture */ + if (*p == '[') + { + start++; + p++; + while (1) + { + c = *p++; + + if (c == ']') + break; + + /* unreserved / sub-delims */ + if (!(g_ascii_isalnum(c) || + strchr (G_URI_OTHER_UNRESERVED, c) || + strchr (G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS, c) || + c == ':' || + c == '.')) + goto error; + } + } + else + { + while (1) + { + c = *p++; + + if (c == ':' || + c == '/' || + c == '?' || + c == '#' || + c == '\0') + break; + + /* pct-encoded */ + if (c == '%') + { + if (!(g_ascii_isxdigit (p[0]) || + g_ascii_isxdigit (p[1]))) + goto error; + + p++; + + continue; + } + + /* unreserved / sub-delims */ + if (!(g_ascii_isalnum(c) || + strchr (G_URI_OTHER_UNRESERVED, c) || + strchr (G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS, c))) + goto error; + } + } + + if (host) + *host = g_uri_unescape_segment (start, p - 1, NULL); + + if (c == ':') + { + /* Decode pot: + * port = *DIGIT + */ + guint tmp = 0; + + while (1) + { + c = *p++; + + if (c == '/' || + c == '?' || + c == '#' || + c == '\0') + break; + + if (!g_ascii_isdigit (c)) + goto error; + + tmp = (tmp * 10) + (c - '0'); + + if (tmp > 65535) + goto error; + } + if (port) + *port = (guint16) tmp; + } + + return TRUE; + +error: + if (host && *host) + { + g_free (*host); + *host = NULL; + } + + if (userinfo && *userinfo) + { + g_free (*userinfo); + *userinfo = NULL; + } + + return FALSE; +} + +gchar * +_g_uri_from_authority (const gchar *protocol, + const gchar *host, + guint port, + const gchar *userinfo) +{ + GString *uri; + + uri = g_string_new (protocol); + g_string_append (uri, "://"); + + if (userinfo) + { + g_string_append_uri_escaped (uri, userinfo, G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO, FALSE); + g_string_append_c (uri, '@'); + } + + if (g_hostname_is_non_ascii (host)) + { + gchar *ace_encoded = g_hostname_to_ascii (host); + + if (!ace_encoded) + { + g_string_free (uri, TRUE); + return NULL; + } + g_string_append (uri, ace_encoded); + g_free (ace_encoded); + } + else if (strchr (host, ':')) + g_string_append_printf (uri, "[%s]", host); + else + g_string_append (uri, host); + + if (port != 0) + g_string_append_printf (uri, ":%u", port); + + return g_string_free (uri, FALSE); +} + +/** + * g_network_address_parse_uri: + * @uri: the hostname and optionally a port + * @default_port: The default port if none is found in the URI + * @error: a pointer to a #GError, or %NULL + * + * Creates a new #GSocketConnectable for connecting to the given + * @uri. May fail and return %NULL in case parsing @uri fails. + * + * Using this rather than g_network_address_new() or + * g_network_address_parse_host() allows #GSocketClient to determine + * when to use application-specific proxy protocols. + * + * Return value: (transfer full): the new #GNetworkAddress, or %NULL on error + * + * Since: 2.26 + */ +GSocketConnectable * +g_network_address_parse_uri (const gchar *uri, + guint16 default_port, + GError **error) +{ + GSocketConnectable *conn; + gchar *scheme; + gchar *hostname; + guint16 port; + + if (!_g_uri_parse_authority (uri, &hostname, &port, NULL)) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Invalid URI '%s'", + uri); + return NULL; + } + + if (port == 0) + port = default_port; + + scheme = g_uri_parse_scheme (uri); + + conn = g_object_new (G_TYPE_NETWORK_ADDRESS, + "hostname", hostname, + "port", port, + "scheme", scheme, + NULL); + + g_free (scheme); + g_free (hostname); + + return conn; +} + /** * g_network_address_get_hostname: * @addr: a #GNetworkAddress @@ -435,6 +756,24 @@ g_network_address_get_port (GNetworkAddress *addr) return addr->priv->port; } +/** + * g_network_address_get_scheme: + * @addr: a #GNetworkAddress + * + * Gets @addr's scheme + * + * Return value: @addr's scheme (%NULL if not built from URI) + * + * Since: 2.26 + */ +const gchar * +g_network_address_get_scheme (GNetworkAddress *addr) +{ + g_return_val_if_fail (G_IS_NETWORK_ADDRESS (addr), NULL); + + return addr->priv->scheme; +} + #define G_TYPE_NETWORK_ADDRESS_ADDRESS_ENUMERATOR (_g_network_address_address_enumerator_get_type ()) #define G_NETWORK_ADDRESS_ADDRESS_ENUMERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_NETWORK_ADDRESS_ADDRESS_ENUMERATOR, GNetworkAddressAddressEnumerator)) @@ -442,7 +781,8 @@ typedef struct { GSocketAddressEnumerator parent_instance; GNetworkAddress *addr; - GList *a; + GList *addresses; + GList *next; } GNetworkAddressAddressEnumerator; typedef struct { @@ -472,31 +812,34 @@ g_network_address_address_enumerator_next (GSocketAddressEnumerator *enumerator G_NETWORK_ADDRESS_ADDRESS_ENUMERATOR (enumerator); GSocketAddress *sockaddr; - if (!addr_enum->addr->priv->sockaddrs) + if (addr_enum->addresses == NULL) { - GResolver *resolver = g_resolver_get_default (); - GList *addresses; + if (!addr_enum->addr->priv->sockaddrs) + { + GResolver *resolver = g_resolver_get_default (); + GList *addresses; - addresses = g_resolver_lookup_by_name (resolver, - addr_enum->addr->priv->hostname, - cancellable, error); - g_object_unref (resolver); + addresses = g_resolver_lookup_by_name (resolver, + addr_enum->addr->priv->hostname, + cancellable, error); + g_object_unref (resolver); - if (!addresses) - return NULL; + if (!addresses) + return NULL; - g_network_address_set_addresses (addr_enum->addr, addresses); - addr_enum->a = addr_enum->addr->priv->sockaddrs; + g_network_address_set_addresses (addr_enum->addr, addresses); + } + + addr_enum->addresses = addr_enum->addr->priv->sockaddrs; + addr_enum->next = addr_enum->addresses; } - if (!addr_enum->a) + if (addr_enum->next == NULL) return NULL; - else - { - sockaddr = addr_enum->a->data; - addr_enum->a = addr_enum->a->next; - return g_object_ref (sockaddr); - } + + sockaddr = addr_enum->next->data; + addr_enum->next = addr_enum->next->next; + return g_object_ref (sockaddr); } static void @@ -511,25 +854,21 @@ got_addresses (GObject *source_object, GList *addresses; GError *error = NULL; - addresses = g_resolver_lookup_by_name_finish (resolver, result, &error); if (!addr_enum->addr->priv->sockaddrs) { + addresses = g_resolver_lookup_by_name_finish (resolver, result, &error); + if (error) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); else - { - g_network_address_set_addresses (addr_enum->addr, addresses); - addr_enum->a = addr_enum->addr->priv->sockaddrs; - } + g_network_address_set_addresses (addr_enum->addr, addresses); } - else if (error) - g_error_free (error); g_object_unref (resolver); + addr_enum->addresses = addr_enum->addr->priv->sockaddrs; + addr_enum->next = addr_enum->addresses; + g_simple_async_result_complete (simple); g_object_unref (simple); } @@ -548,21 +887,26 @@ g_network_address_address_enumerator_next_async (GSocketAddressEnumerator *enum callback, user_data, g_network_address_address_enumerator_next_async); - if (!addr_enum->addr->priv->sockaddrs) + if (addr_enum->addresses == NULL) { - GResolver *resolver = g_resolver_get_default (); + if (!addr_enum->addr->priv->sockaddrs) + { + GResolver *resolver = g_resolver_get_default (); + + g_simple_async_result_set_op_res_gpointer (simple, g_object_ref (addr_enum), g_object_unref); + g_resolver_lookup_by_name_async (resolver, + addr_enum->addr->priv->hostname, + cancellable, + got_addresses, simple); + return; + } - g_simple_async_result_set_op_res_gpointer (simple, g_object_ref (addr_enum), g_object_unref); - g_resolver_lookup_by_name_async (resolver, - addr_enum->addr->priv->hostname, - cancellable, - got_addresses, simple); - } - else - { - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + addr_enum->addresses = addr_enum->addr->priv->sockaddrs; + addr_enum->next = addr_enum->addresses; } + + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); } static GSocketAddress * @@ -577,12 +921,12 @@ g_network_address_address_enumerator_next_finish (GSocketAddressEnumerator *enu if (g_simple_async_result_propagate_error (simple, error)) return NULL; - else if (!addr_enum->a) + else if (!addr_enum->next) return NULL; else { - sockaddr = addr_enum->a->data; - addr_enum->a = addr_enum->a->next; + sockaddr = addr_enum->next->data; + addr_enum->next = addr_enum->next->next; return g_object_ref (sockaddr); } } @@ -616,5 +960,24 @@ g_network_address_connectable_enumerate (GSocketConnectable *connectable) return (GSocketAddressEnumerator *)addr_enum; } -#define __G_NETWORK_ADDRESS_C__ -#include "gioaliasdef.c" +static GSocketAddressEnumerator * +g_network_address_connectable_proxy_enumerate (GSocketConnectable *connectable) +{ + GNetworkAddress *self = G_NETWORK_ADDRESS (connectable); + GSocketAddressEnumerator *proxy_enum; + gchar *uri; + + uri = _g_uri_from_authority (self->priv->scheme ? self->priv->scheme : "none", + self->priv->hostname, + self->priv->port, + NULL); + + proxy_enum = g_object_new (G_TYPE_PROXY_ADDRESS_ENUMERATOR, + "connectable", connectable, + "uri", uri, + NULL); + + g_free (uri); + + return proxy_enum; +} diff --git a/gio/gnetworkaddress.h b/gio/gnetworkaddress.h index 0111f70..af16321 100644 --- a/gio/gnetworkaddress.h +++ b/gio/gnetworkaddress.h @@ -60,8 +60,12 @@ GSocketConnectable *g_network_address_new (const gchar *hostname, GSocketConnectable *g_network_address_parse (const gchar *host_and_port, guint16 default_port, GError **error); +GSocketConnectable *g_network_address_parse_uri (const gchar *uri, + guint16 default_port, + GError **error); const gchar *g_network_address_get_hostname (GNetworkAddress *addr); guint16 g_network_address_get_port (GNetworkAddress *addr); +const gchar *g_network_address_get_scheme (GNetworkAddress *addr); G_END_DECLS diff --git a/gio/gnetworkingprivate.h b/gio/gnetworkingprivate.h index 4477032..92d2645 100644 --- a/gio/gnetworkingprivate.h +++ b/gio/gnetworkingprivate.h @@ -40,6 +40,14 @@ #else /* !G_OS_WIN32 */ +/* need this for struct ucred on Linux */ +#ifdef __linux__ +#define __USE_GNU +#include +#include +#undef __USE_GNU +#endif + #include #include #include @@ -68,6 +76,18 @@ #define _PATH_RESCONF "/etc/resolv.conf" #endif +#ifndef CMSG_LEN +/* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on + * some older platforms. + */ +#define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len)) + +/* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR() + * adds. We overestimate here. + */ +#define ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1)) +#define CMSG_SPACE(len) ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr) +#endif #endif G_BEGIN_DECLS @@ -100,6 +120,15 @@ GList *_g_resolver_targets_from_DnsQuery (const gchar *rrname, GError **error); #endif +gboolean _g_uri_parse_authority (const char *uri, + char **host, + guint16 *port, + char **userinfo); +gchar * _g_uri_from_authority (const gchar *protocol, + const gchar *host, + guint port, + const gchar *userinfo); + G_END_DECLS #endif /* __G_NETWORKINGPRIVATE_H__ */ diff --git a/gio/gnetworkservice.c b/gio/gnetworkservice.c index 31bbf6a..a31433d 100644 --- a/gio/gnetworkservice.c +++ b/gio/gnetworkservice.c @@ -25,9 +25,13 @@ #include "glibintl.h" #include "gnetworkservice.h" + #include "gcancellable.h" #include "ginetaddress.h" #include "ginetsocketaddress.h" +#include "gioerror.h" +#include "gnetworkaddress.h" +#include "gnetworkingprivate.h" #include "gresolver.h" #include "gsimpleasyncresult.h" #include "gsocketaddressenumerator.h" @@ -37,7 +41,6 @@ #include #include -#include "gioalias.h" /** * SECTION:gnetworkservice @@ -64,7 +67,7 @@ struct _GNetworkServicePrivate { - gchar *service, *protocol, *domain; + gchar *service, *protocol, *domain, *scheme; GList *targets; }; @@ -73,6 +76,7 @@ enum { PROP_SERVICE, PROP_PROTOCOL, PROP_DOMAIN, + PROP_SCHEME }; static void g_network_service_set_property (GObject *object, @@ -84,8 +88,9 @@ static void g_network_service_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void g_network_service_connectable_iface_init (GSocketConnectableIface *iface); -static GSocketAddressEnumerator *g_network_service_connectable_enumerate (GSocketConnectable *connectable); +static void g_network_service_connectable_iface_init (GSocketConnectableIface *iface); +static GSocketAddressEnumerator *g_network_service_connectable_enumerate (GSocketConnectable *connectable); +static GSocketAddressEnumerator *g_network_service_connectable_proxy_enumerate (GSocketConnectable *connectable); G_DEFINE_TYPE_WITH_CODE (GNetworkService, g_network_service, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_SOCKET_CONNECTABLE, @@ -99,6 +104,7 @@ g_network_service_finalize (GObject *object) g_free (srv->priv->service); g_free (srv->priv->protocol); g_free (srv->priv->domain); + g_free (srv->priv->scheme); if (srv->priv->targets) g_resolver_free_targets (srv->priv->targets); @@ -141,12 +147,21 @@ g_network_service_class_init (GNetworkServiceClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_DOMAIN, + g_param_spec_string ("scheme", + P_("Scheme"), + P_("Network scheme (default is to use service)"), + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + } static void g_network_service_connectable_iface_init (GSocketConnectableIface *connectable_iface) { connectable_iface->enumerate = g_network_service_connectable_enumerate; + connectable_iface->proxy_enumerate = g_network_service_connectable_proxy_enumerate; } static void @@ -178,6 +193,10 @@ g_network_service_set_property (GObject *object, srv->priv->domain = g_value_dup_string (value); break; + case PROP_SCHEME: + g_network_service_set_scheme (srv, g_value_get_string (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -206,6 +225,10 @@ g_network_service_get_property (GObject *object, g_value_set_string (value, g_network_service_get_domain (srv)); break; + case PROP_SCHEME: + g_value_set_string (value, g_network_service_get_scheme (srv)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -222,7 +245,7 @@ g_network_service_get_property (GObject *object, * @protocol, and @domain. This will initially be unresolved; use the * #GSocketConnectable interface to resolve it. * - * Return value: a new #GNetworkService + * Return value: (transfer full): a new #GNetworkService * * Since: 2.22 */ @@ -293,6 +316,71 @@ g_network_service_get_domain (GNetworkService *srv) return srv->priv->domain; } +/** + * g_network_service_get_scheme: + * @srv: a #GNetworkService + * + * Get's the URI scheme used to resolve proxies. By default, the service name + * is used as scheme. + * + * Return value: @srv's scheme name + * + * Since: 2.26 + */ +const gchar * +g_network_service_get_scheme (GNetworkService *srv) +{ + g_return_val_if_fail (G_IS_NETWORK_SERVICE (srv), NULL); + + if (srv->priv->scheme) + return srv->priv->scheme; + else + return srv->priv->service; +} + +/** + * g_network_service_set_scheme: + * @srv: a #GNetworkService + * @scheme: a URI scheme + * + * Set's the URI scheme used to resolve proxies. By default, the service name + * is used as scheme. + * + * Since: 2.26 + */ +void +g_network_service_set_scheme (GNetworkService *srv, + const gchar *scheme) +{ + g_return_if_fail (G_IS_NETWORK_SERVICE (srv)); + + if (srv->priv->scheme) + g_free (srv->priv->scheme); + srv->priv->scheme = g_strdup (scheme); + + g_object_notify (G_OBJECT (srv), "scheme"); +} + +static GList * +g_network_service_fallback_targets (GNetworkService *srv) +{ + GSrvTarget *target; + struct servent *entry; + guint16 port; + + entry = getservbyname (srv->priv->service, "tcp"); + port = entry ? g_ntohs (entry->s_port) : 0; +#ifdef HAVE_ENDSERVENT + endservent (); +#endif + + if (entry == NULL) + return NULL; + + target = g_srv_target_new (srv->priv->domain, port, 0, 0); + return g_list_append (NULL, target); +} + #define G_TYPE_NETWORK_SERVICE_ADDRESS_ENUMERATOR (_g_network_service_address_enumerator_get_type ()) #define G_NETWORK_SERVICE_ADDRESS_ENUMERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_NETWORK_SERVICE_ADDRESS_ENUMERATOR, GNetworkServiceAddressEnumerator)) @@ -301,7 +389,9 @@ typedef struct { GResolver *resolver; GNetworkService *srv; - GList *addrs, *a, *t; + GSocketAddressEnumerator *addr_enum; + GList *t; + gboolean use_proxy; GError *error; @@ -317,29 +407,6 @@ typedef struct { G_DEFINE_TYPE (GNetworkServiceAddressEnumerator, _g_network_service_address_enumerator, G_TYPE_SOCKET_ADDRESS_ENUMERATOR) -static void -g_network_service_address_enumerator_finalize (GObject *object) -{ - GNetworkServiceAddressEnumerator *srv_enum = - G_NETWORK_SERVICE_ADDRESS_ENUMERATOR (object); - - g_object_unref (srv_enum->srv); - if (srv_enum->addrs) - { - while (srv_enum->a) - { - g_object_unref (srv_enum->a->data); - srv_enum->a = srv_enum->a->next; - } - g_list_free (srv_enum->addrs); - } - g_object_unref (srv_enum->resolver); - if (srv_enum->error) - g_error_free (srv_enum->error); - - G_OBJECT_CLASS (_g_network_service_address_enumerator_parent_class)->finalize (object); -} - static GSocketAddress * g_network_service_address_enumerator_next (GSocketAddressEnumerator *enumerator, GCancellable *cancellable, @@ -347,107 +414,129 @@ g_network_service_address_enumerator_next (GSocketAddressEnumerator *enumerator { GNetworkServiceAddressEnumerator *srv_enum = G_NETWORK_SERVICE_ADDRESS_ENUMERATOR (enumerator); - GSrvTarget *target; - GSocketAddress *sockaddr; + GSocketAddress *ret = NULL; /* If we haven't yet resolved srv, do that */ if (!srv_enum->srv->priv->targets) { GList *targets; + GError *my_error = NULL; targets = g_resolver_lookup_service (srv_enum->resolver, srv_enum->srv->priv->service, srv_enum->srv->priv->protocol, srv_enum->srv->priv->domain, - cancellable, error); - if (!targets) - return NULL; + cancellable, &my_error); + if (!targets && g_error_matches (my_error, G_RESOLVER_ERROR, + G_RESOLVER_ERROR_NOT_FOUND)) + { + targets = g_network_service_fallback_targets (srv_enum->srv); + if (targets) + g_clear_error (&my_error); + } + + if (my_error) + { + g_propagate_error (error, my_error); + return NULL; + } - if (!srv_enum->srv->priv->targets) - srv_enum->srv->priv->targets = targets; + srv_enum->srv->priv->targets = targets; srv_enum->t = srv_enum->srv->priv->targets; } - /* Make sure we have a set of resolved addresses for the current - * target. When resolving the first target, we save the GError, if - * any. If any later target succeeds, we'll free the earlier error, - * but if we get to the last target without any of them resolving, - * we return that initial error. - */ + /* Delegate to GNetworkAddress */ do { - /* Return if we're out of targets. */ - if (!srv_enum->t) + if (srv_enum->addr_enum == NULL && srv_enum->t) { - if (srv_enum->error) + GError *error = NULL; + gchar *uri; + gchar *hostname; + GSocketConnectable *addr; + GSrvTarget *target = srv_enum->t->data; + + srv_enum->t = g_list_next (srv_enum->t); + + hostname = g_hostname_to_ascii (g_srv_target_get_hostname (target)); + + if (hostname == NULL) { - g_propagate_error (error, srv_enum->error); - srv_enum->error = NULL; + if (srv_enum->error == NULL) + srv_enum->error = + g_error_new (G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Received invalid hostname '%s' from GSrvTarget", + g_srv_target_get_hostname (target)); + continue; } - return NULL; + + uri = _g_uri_from_authority (g_network_service_get_scheme (srv_enum->srv), + hostname, + g_srv_target_get_port (target), + NULL); + g_free (hostname); + + addr = g_network_address_parse_uri (uri, + g_srv_target_get_port (target), + &error); + g_free (uri); + + if (addr == NULL) + { + if (srv_enum->error == NULL) + srv_enum->error = error; + continue; + } + + if (srv_enum->use_proxy) + srv_enum->addr_enum = g_socket_connectable_proxy_enumerate (addr); + else + srv_enum->addr_enum = g_socket_connectable_enumerate (addr); + g_object_unref (addr); } - target = srv_enum->t->data; - /* If we haven't resolved the addrs for the current target, do that */ - if (!srv_enum->addrs) + if (srv_enum->addr_enum) { - GError **error_p; + GError *error = NULL; - error_p = (srv_enum->t == srv_enum->srv->priv->targets) ? &srv_enum->error : NULL; - srv_enum->addrs = g_resolver_lookup_by_name (srv_enum->resolver, - g_srv_target_get_hostname (target), - cancellable, error_p); - if (g_cancellable_set_error_if_cancelled (cancellable, error)) - return NULL; + ret = g_socket_address_enumerator_next (srv_enum->addr_enum, + cancellable, + &error); - if (srv_enum->addrs) + if (error) { - srv_enum->a = srv_enum->addrs; - if (srv_enum->error) - { - g_error_free (srv_enum->error); - srv_enum->error = NULL; - } + if (srv_enum->error == NULL) + srv_enum->error = error; + else + g_error_free (error); } - else + + if (!ret) { - /* Try the next target */ - srv_enum->t = srv_enum->t->next; + g_object_unref (srv_enum->addr_enum); + srv_enum->addr_enum = NULL; } } } - while (!srv_enum->addrs); - - /* Return the next address for this target. If it's the last one, - * advance the target counter. - */ - sockaddr = g_inet_socket_address_new (srv_enum->a->data, - g_srv_target_get_port (target)); - g_object_unref (srv_enum->a->data); - srv_enum->a = srv_enum->a->next; + while (srv_enum->addr_enum == NULL && srv_enum->t); - if (!srv_enum->a) + if (ret == NULL && srv_enum->error) { - g_list_free (srv_enum->addrs); - srv_enum->addrs = NULL; - srv_enum->t = srv_enum->t->next; + g_propagate_error (error, srv_enum->error); + srv_enum->error = NULL; } - return sockaddr; + return ret; } static void next_async_resolved_targets (GObject *source_object, GAsyncResult *result, gpointer user_data); static void next_async_have_targets (GNetworkServiceAddressEnumerator *srv_enum); -static void next_async_resolved_addresses (GObject *source_object, +static void next_async_have_address (GObject *source_object, GAsyncResult *result, gpointer user_data); -static void next_async_have_addresses (GNetworkServiceAddressEnumerator *srv_enum); -/* The async version is basically the same as the sync, except we have - * to split it into multiple functions. - */ static void g_network_service_address_enumerator_next_async (GSocketAddressEnumerator *enumerator, GCancellable *cancellable, @@ -462,7 +551,9 @@ g_network_service_address_enumerator_next_async (GSocketAddressEnumerator *enum srv_enum->result = g_simple_async_result_new (G_OBJECT (enumerator), callback, user_data, g_network_service_address_enumerator_next_async); - srv_enum->cancellable = cancellable; + + if (cancellable) + srv_enum->cancellable = g_object_ref (cancellable); /* If we haven't yet resolved srv, do that */ if (!srv_enum->srv->priv->targets) @@ -485,135 +576,121 @@ next_async_resolved_targets (GObject *source_object, gpointer user_data) { GNetworkServiceAddressEnumerator *srv_enum = user_data; - GList *targets; GError *error = NULL; + GList *targets; - targets = g_resolver_lookup_service_finish (srv_enum->resolver, result, &error); - if (!srv_enum->srv->priv->targets) - { - if (error) - { - GSimpleAsyncResult *simple = srv_enum->result; - - srv_enum->result = NULL; - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } + targets = g_resolver_lookup_service_finish (srv_enum->resolver, + result, &error); - srv_enum->srv->priv->targets = targets; - srv_enum->t = srv_enum->srv->priv->targets; + if (!targets && g_error_matches (error, G_RESOLVER_ERROR, + G_RESOLVER_ERROR_NOT_FOUND)) + { + targets = g_network_service_fallback_targets (srv_enum->srv); + if (targets) + g_clear_error (&error); } - next_async_have_targets (srv_enum); + if (error) + { + GSimpleAsyncResult *simple = srv_enum->result; + + srv_enum->result = NULL; + g_simple_async_result_take_error (simple, error); + g_simple_async_result_complete (simple); + g_object_unref (simple); + } + else + { + srv_enum->t = srv_enum->srv->priv->targets = targets; + next_async_have_targets (srv_enum); + } } static void next_async_have_targets (GNetworkServiceAddressEnumerator *srv_enum) { - GSrvTarget *target; + /* Delegate to GNetworkAddress */ + if (srv_enum->addr_enum == NULL && srv_enum->t) + { + GSocketConnectable *addr; + GSrvTarget *target = srv_enum->t->data; + + srv_enum->t = g_list_next (srv_enum->t); + addr = g_network_address_new (g_srv_target_get_hostname (target), + (guint16) g_srv_target_get_port (target)); + + if (srv_enum->use_proxy) + srv_enum->addr_enum = g_socket_connectable_proxy_enumerate (addr); + else + srv_enum->addr_enum = g_socket_connectable_enumerate (addr); + + g_object_unref (addr); + } - /* Get the current target, check if we're already done. */ - if (!srv_enum->t) + if (srv_enum->addr_enum) + { + g_socket_address_enumerator_next_async (srv_enum->addr_enum, + srv_enum->cancellable, + next_async_have_address, + srv_enum); + } + else { + GSimpleAsyncResult *simple = srv_enum->result; + srv_enum->result = NULL; + if (srv_enum->error) { - g_simple_async_result_set_from_error (srv_enum->result, srv_enum->error); - g_error_free (srv_enum->error); + g_simple_async_result_take_error (simple, srv_enum->error); srv_enum->error = NULL; } - g_simple_async_result_complete_in_idle (srv_enum->result); - g_object_unref (srv_enum->result); - srv_enum->result = NULL; - return; - } - target = srv_enum->t->data; - /* If we haven't resolved the addrs for the current target, do that */ - if (!srv_enum->addrs) - { - g_resolver_lookup_by_name_async (srv_enum->resolver, - g_srv_target_get_hostname (target), - srv_enum->cancellable, - next_async_resolved_addresses, - srv_enum); + g_simple_async_result_complete (simple); + g_object_unref (simple); } - else - next_async_have_addresses (srv_enum); } static void -next_async_resolved_addresses (GObject *source_object, - GAsyncResult *result, - gpointer user_data) +next_async_have_address (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { GNetworkServiceAddressEnumerator *srv_enum = user_data; + GSocketAddress *address; GError *error = NULL; + + address = g_socket_address_enumerator_next_finish (srv_enum->addr_enum, + result, + &error); - srv_enum->addrs = g_resolver_lookup_by_name_finish (srv_enum->resolver, result, &error); - if (srv_enum->addrs) + if (error) { - srv_enum->a = srv_enum->addrs; - if (srv_enum->error) - { - g_error_free (srv_enum->error); - srv_enum->error = NULL; - } - next_async_have_addresses (srv_enum); + if (srv_enum->error == NULL) + srv_enum->error = error; + else + g_error_free (error); } - else - { - if (g_cancellable_is_cancelled (srv_enum->cancellable)) - { - GSimpleAsyncResult *simple = srv_enum->result; - srv_enum->result = NULL; - g_simple_async_result_set_from_error (srv_enum->result, error); - g_error_free (error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - } - else - { - if (srv_enum->t == srv_enum->srv->priv->targets) - srv_enum->error = error; - else - g_error_free (error); + if (!address) + { + g_object_unref (srv_enum->addr_enum); + srv_enum->addr_enum = NULL; - /* Try the next target */ - srv_enum->t = srv_enum->t->next; - next_async_have_targets (srv_enum); - } + next_async_have_targets (srv_enum); } -} + else + { + GSimpleAsyncResult *simple = srv_enum->result; -static void -next_async_have_addresses (GNetworkServiceAddressEnumerator *srv_enum) -{ - GSocketAddress *sockaddr; - GSimpleAsyncResult *simple = srv_enum->result; + srv_enum->result = NULL; - /* Return the next address for this target. If it's the last one, - * advance the target counter. - */ - sockaddr = g_inet_socket_address_new (srv_enum->a->data, - g_srv_target_get_port (srv_enum->t->data)); - g_object_unref (srv_enum->a->data); + if (address) + g_simple_async_result_set_op_res_gpointer (simple, + address, g_object_unref); - srv_enum->a = srv_enum->a->next; - if (!srv_enum->a) - { - g_list_free (srv_enum->addrs); - srv_enum->addrs = NULL; - srv_enum->t = srv_enum->t->next; + g_simple_async_result_complete (simple); + g_object_unref (simple); } - - srv_enum->result = NULL; - g_simple_async_result_set_op_res_gpointer (simple, sockaddr, NULL); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); } static GSocketAddress * @@ -637,15 +714,43 @@ _g_network_service_address_enumerator_init (GNetworkServiceAddressEnumerator *en } static void -_g_network_service_address_enumerator_class_init (GNetworkServiceAddressEnumeratorClass *addrenum_class) +g_network_service_address_enumerator_finalize (GObject *object) +{ + GNetworkServiceAddressEnumerator *srv_enum = + G_NETWORK_SERVICE_ADDRESS_ENUMERATOR (object); + + if (srv_enum->srv) + g_object_unref (srv_enum->srv); + + if (srv_enum->addr_enum) + g_object_unref (srv_enum->addr_enum); + + if (srv_enum->resolver) + g_object_unref (srv_enum->resolver); + + if (srv_enum->result) + g_object_unref (srv_enum->result); + + if (srv_enum->cancellable) + g_object_unref (srv_enum->cancellable); + + if (srv_enum->error) + g_error_free (srv_enum->error); + + G_OBJECT_CLASS (_g_network_service_address_enumerator_parent_class)->finalize (object); +} + +static void +_g_network_service_address_enumerator_class_init (GNetworkServiceAddressEnumeratorClass *srvenum_class) { - GObjectClass *object_class = G_OBJECT_CLASS (addrenum_class); + GObjectClass *object_class = G_OBJECT_CLASS (srvenum_class); GSocketAddressEnumeratorClass *enumerator_class = - G_SOCKET_ADDRESS_ENUMERATOR_CLASS (addrenum_class); + G_SOCKET_ADDRESS_ENUMERATOR_CLASS (srvenum_class); - enumerator_class->next = g_network_service_address_enumerator_next; - enumerator_class->next_async = g_network_service_address_enumerator_next_async; + enumerator_class->next = g_network_service_address_enumerator_next; + enumerator_class->next_async = g_network_service_address_enumerator_next_async; enumerator_class->next_finish = g_network_service_address_enumerator_next_finish; + object_class->finalize = g_network_service_address_enumerator_finalize; } @@ -657,9 +762,20 @@ g_network_service_connectable_enumerate (GSocketConnectable *connectable) srv_enum = g_object_new (G_TYPE_NETWORK_SERVICE_ADDRESS_ENUMERATOR, NULL); srv_enum->srv = g_object_ref (connectable); srv_enum->resolver = g_resolver_get_default (); + srv_enum->use_proxy = FALSE; - return (GSocketAddressEnumerator *)srv_enum; + return G_SOCKET_ADDRESS_ENUMERATOR (srv_enum); } -#define __G_NETWORK_SERVICE_C__ -#include "gioaliasdef.c" +static GSocketAddressEnumerator * +g_network_service_connectable_proxy_enumerate (GSocketConnectable *connectable) +{ + GSocketAddressEnumerator *addr_enum; + GNetworkServiceAddressEnumerator *srv_enum; + + addr_enum = g_network_service_connectable_enumerate (connectable); + srv_enum = G_NETWORK_SERVICE_ADDRESS_ENUMERATOR (addr_enum); + srv_enum->use_proxy = TRUE; + + return addr_enum; +} diff --git a/gio/gnetworkservice.h b/gio/gnetworkservice.h index b1a754b..1f6dbea 100644 --- a/gio/gnetworkservice.h +++ b/gio/gnetworkservice.h @@ -62,6 +62,8 @@ GSocketConnectable *g_network_service_new (const gchar *service, const gchar *g_network_service_get_service (GNetworkService *srv); const gchar *g_network_service_get_protocol (GNetworkService *srv); const gchar *g_network_service_get_domain (GNetworkService *srv); +const gchar *g_network_service_get_scheme (GNetworkService *srv); +void g_network_service_set_scheme (GNetworkService *srv, const gchar *scheme); G_END_DECLS diff --git a/gio/gnullsettingsbackend.c b/gio/gnullsettingsbackend.c new file mode 100644 index 0000000..a2bead0 --- /dev/null +++ b/gio/gnullsettingsbackend.c @@ -0,0 +1,111 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "config.h" + +#include "gnullsettingsbackend.h" +#include "gsimplepermission.h" + + +#define G_TYPE_NULL_SETTINGS_BACKEND (g_null_settings_backend_get_type ()) +#define G_NULL_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_NULL_SETTINGS_BACKEND, \ + GNullSettingsBackend)) + + +typedef GSettingsBackendClass GNullSettingsBackendClass; +typedef GSettingsBackend GNullSettingsBackend; + +static GType g_null_settings_backend_get_type (void); +G_DEFINE_TYPE (GNullSettingsBackend, + g_null_settings_backend, + G_TYPE_SETTINGS_BACKEND) + +static GVariant * +g_null_settings_backend_read (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value) +{ + return NULL; +} + +static gboolean +g_null_settings_backend_write (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag) +{ + return FALSE; +} + +static gboolean +g_null_settings_backend_write_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag) +{ + return FALSE; +} + +static void +g_null_settings_backend_reset (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ +} + +static gboolean +g_null_settings_backend_get_writable (GSettingsBackend *backend, + const gchar *name) +{ + return FALSE; +} + +static GPermission * +g_null_settings_backend_get_permission (GSettingsBackend *backend, + const gchar *path) +{ + return g_simple_permission_new (FALSE); +} + +static void +g_null_settings_backend_init (GNullSettingsBackend *memory) +{ +} + +static void +g_null_settings_backend_class_init (GNullSettingsBackendClass *class) +{ + GSettingsBackendClass *backend_class = G_SETTINGS_BACKEND_CLASS (class); + + backend_class->read = g_null_settings_backend_read; + backend_class->write = g_null_settings_backend_write; + backend_class->write_tree = g_null_settings_backend_write_tree; + backend_class->reset = g_null_settings_backend_reset; + backend_class->get_writable = g_null_settings_backend_get_writable; + backend_class->get_permission = g_null_settings_backend_get_permission; +} + +GSettingsBackend * +g_null_settings_backend_new (void) +{ + return g_object_new (G_TYPE_NULL_SETTINGS_BACKEND, NULL); +} diff --git a/gio/gnullsettingsbackend.h b/gio/gnullsettingsbackend.h new file mode 100644 index 0000000..ea07f52 --- /dev/null +++ b/gio/gnullsettingsbackend.h @@ -0,0 +1,30 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#ifndef __G_NULL_SETTINGS_BACKEND_H__ +#define __G_NULL_SETTINGS_BACKEND_H__ + +#include + +G_GNUC_INTERNAL +GSettingsBackend * g_null_settings_backend_new (void); + +#endif /* __G_NULL_SETTINGS_BACKEND_H__ */ diff --git a/gio/goutputstream.c b/gio/goutputstream.c index 38d5419..02f013e 100644 --- a/gio/goutputstream.c +++ b/gio/goutputstream.c @@ -29,7 +29,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:goutputstream @@ -46,7 +45,7 @@ * All of these functions have async variants too. **/ -G_DEFINE_TYPE (GOutputStream, g_output_stream, G_TYPE_OBJECT); +G_DEFINE_ABSTRACT_TYPE (GOutputStream, g_output_stream, G_TYPE_OBJECT); struct _GOutputStreamPrivate { guint closed : 1; @@ -149,26 +148,27 @@ g_output_stream_init (GOutputStream *stream) /** * g_output_stream_write: * @stream: a #GOutputStream. - * @buffer: the buffer containing the data to write. + * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write. * @count: the number of bytes to write - * @cancellable: optional cancellable object + * @cancellable: (allow-none): optional cancellable object * @error: location to store the error occuring, or %NULL to ignore * * Tries to write @count bytes from @buffer into the stream. Will block * during the operation. * - * If count is zero returns zero and does nothing. A value of @count + * If count is 0, returns 0 and does nothing. A value of @count * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. * * On success, the number of bytes written to the stream is returned. * It is not an error if this is not the same as the requested size, as it - * can happen e.g. on a partial i/o error, or if there is not enough - * storage in the stream. All writes either block until at least one byte - * is written, so zero is never returned (unless @count is zero). + * can happen e.g. on a partial I/O error, or if there is not enough + * storage in the stream. All writes block until at least one byte + * is written or an error occurs; 0 is never returned (unless + * @count is 0). * * If @cancellable is not NULL, then the operation can be cancelled by * triggering the cancellable object from another thread. If the operation - * was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an + * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an * operation was partially finished when the operation was cancelled the * partial result will be returned, without an error. * @@ -227,11 +227,11 @@ g_output_stream_write (GOutputStream *stream, /** * g_output_stream_write_all: * @stream: a #GOutputStream. - * @buffer: the buffer containing the data to write. + * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write. * @count: the number of bytes to write - * @bytes_written: location to store the number of bytes that was + * @bytes_written: (out): location to store the number of bytes that was * written to the stream - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: location to store the error occuring, or %NULL to ignore * * Tries to write @count bytes from @buffer into the stream. Will block @@ -290,7 +290,7 @@ g_output_stream_write_all (GOutputStream *stream, /** * g_output_stream_flush: * @stream: a #GOutputStream. - * @cancellable: optional cancellable object + * @cancellable: (allow-none): optional cancellable object * @error: location to store the error occuring, or %NULL to ignore * * Flushed any outstanding buffers in the stream. Will block during @@ -341,7 +341,7 @@ g_output_stream_flush (GOutputStream *stream, * @stream: a #GOutputStream. * @source: a #GInputStream. * @flags: a set of #GOutputStreamSpliceFlags. - * @cancellable: optional #GCancellable object, %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @error: a #GError location to store the error occuring, or %NULL to * ignore. * @@ -468,7 +468,7 @@ g_output_stream_real_splice (GOutputStream *stream, /** * g_output_stream_close: * @stream: A #GOutputStream. - * @cancellable: optional cancellable object + * @cancellable: (allow-none): optional cancellable object * @error: location to store the error occuring, or %NULL to ignore * * Closes the stream, releasing resources related to it. @@ -569,30 +569,95 @@ async_ready_callback_wrapper (GObject *source_object, g_object_unref (stream); } +typedef struct { + gint io_priority; + GCancellable *cancellable; + GError *flush_error; + gpointer user_data; +} CloseUserData; + static void async_ready_close_callback_wrapper (GObject *source_object, GAsyncResult *res, gpointer user_data) { GOutputStream *stream = G_OUTPUT_STREAM (source_object); + CloseUserData *data = user_data; stream->priv->closing = FALSE; stream->priv->closed = TRUE; + g_output_stream_clear_pending (stream); + if (stream->priv->outstanding_callback) - (*stream->priv->outstanding_callback) (source_object, res, user_data); + { + if (data->flush_error != NULL) + { + GSimpleAsyncResult *err; + + err = g_simple_async_result_new_take_error (source_object, + stream->priv->outstanding_callback, + data->user_data, + data->flush_error); + data->flush_error = NULL; + + (*stream->priv->outstanding_callback) (source_object, + G_ASYNC_RESULT (err), + data->user_data); + g_object_unref (err); + } + else + { + (*stream->priv->outstanding_callback) (source_object, + res, + data->user_data); + } + } + g_object_unref (stream); + + if (data->cancellable) + g_object_unref (data->cancellable); + + if (data->flush_error) + g_error_free (data->flush_error); + + g_slice_free (CloseUserData, data); +} + +static void +async_ready_close_flushed_callback_wrapper (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + GOutputStream *stream = G_OUTPUT_STREAM (source_object); + GOutputStreamClass *class; + CloseUserData *data = user_data; + GSimpleAsyncResult *simple; + + /* propagate the possible error */ + if (G_IS_SIMPLE_ASYNC_RESULT (res)) + { + simple = G_SIMPLE_ASYNC_RESULT (res); + g_simple_async_result_propagate_error (simple, &data->flush_error); + } + + class = G_OUTPUT_STREAM_GET_CLASS (stream); + + /* we still close, even if there was a flush error */ + class->close_async (stream, data->io_priority, data->cancellable, + async_ready_close_callback_wrapper, user_data); } /** * g_output_stream_write_async: * @stream: A #GOutputStream. - * @buffer: the buffer containing the data to write. + * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write. * @count: the number of bytes to write * @io_priority: the io priority of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Request an asynchronous write of @count bytes from @buffer into * the stream. When the operation is finished @callback will be called. @@ -610,6 +675,10 @@ async_ready_close_callback_wrapper (GObject *source_object, * requested size, as it can happen e.g. on a partial I/O error, * but generally we try to write as many bytes as requested. * + * You are guaranteed that this method will never fail with + * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the + * method will just wait until this changes. + * * Any outstanding I/O request with higher priority (lower numerical * value) will be executed before an outstanding request with lower * priority. Default priority is %G_PRIORITY_DEFAULT. @@ -661,11 +730,10 @@ g_output_stream_write_async (GOutputStream *stream, if (!g_output_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -744,9 +812,9 @@ async_ready_splice_callback_wrapper (GObject *source_object, * @source: a #GInputStream. * @flags: a set of #GOutputStreamSpliceFlags. * @io_priority: the io priority of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback. - * @user_data: user data passed to @callback. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback. + * @user_data: (closure): user data passed to @callback. * * Splices a stream asynchronously. * When the operation is finished @callback will be called. @@ -784,11 +852,10 @@ g_output_stream_splice_async (GOutputStream *stream, if (!g_output_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -841,9 +908,9 @@ g_output_stream_splice_finish (GOutputStream *stream, * g_output_stream_flush_async: * @stream: a #GOutputStream. * @io_priority: the io priority of the request. - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @callback: a #GAsyncReadyCallback to call when the request is satisfied - * @user_data: the data to pass to callback function + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Flushes a stream asynchronously. * For behaviour details see g_output_stream_flush(). @@ -867,11 +934,10 @@ g_output_stream_flush_async (GOutputStream *stream, if (!g_output_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -937,9 +1003,9 @@ g_output_stream_flush_finish (GOutputStream *stream, * g_output_stream_close_async: * @stream: A #GOutputStream. * @io_priority: the io priority of the request. - * @callback: callback to call when the request is satisfied - * @user_data: the data to pass to callback function - * @cancellable: optional cancellable object + * @cancellable: (allow-none): optional cancellable object + * @callback: (scope async): callback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function * * Requests an asynchronous close of the stream, releasing resources * related to it. When the operation is finished @callback will be @@ -962,6 +1028,7 @@ g_output_stream_close_async (GOutputStream *stream, GOutputStreamClass *class; GSimpleAsyncResult *simple; GError *error = NULL; + CloseUserData *data; g_return_if_fail (G_IS_OUTPUT_STREAM (stream)); @@ -978,11 +1045,10 @@ g_output_stream_close_async (GOutputStream *stream, if (!g_output_stream_set_pending (stream, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -990,8 +1056,31 @@ g_output_stream_close_async (GOutputStream *stream, stream->priv->closing = TRUE; stream->priv->outstanding_callback = callback; g_object_ref (stream); - class->close_async (stream, io_priority, cancellable, - async_ready_close_callback_wrapper, user_data); + + data = g_slice_new0 (CloseUserData); + + if (cancellable != NULL) + data->cancellable = g_object_ref (cancellable); + + data->io_priority = io_priority; + data->user_data = user_data; + + /* Call close_async directly if there is no need to flush, or if the flush + can be done sync (in the output stream async close thread) */ + if (class->flush_async == NULL || + (class->flush_async == g_output_stream_real_flush_async && + (class->flush == NULL || class->close_async == g_output_stream_real_close_async))) + { + class->close_async (stream, io_priority, cancellable, + async_ready_close_callback_wrapper, data); + } + else + { + /* First do an async flush, then do the async close in the callback + wrapper (see async_ready_close_flushed_callback_wrapper) */ + class->flush_async (stream, io_priority, cancellable, + async_ready_close_flushed_callback_wrapper, data); + } } /** @@ -1162,10 +1251,7 @@ write_async_thread (GSimpleAsyncResult *res, op->count_written = class->write_fn (G_OUTPUT_STREAM (object), op->buffer, op->count_requested, cancellable, &error); if (op->count_written == -1) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } static void @@ -1229,10 +1315,7 @@ splice_async_thread (GSimpleAsyncResult *result, cancellable, &error); if (op->bytes_copied == -1) - { - g_simple_async_result_set_from_error (result, error); - g_error_free (error); - } + g_simple_async_result_take_error (result, error); } static void @@ -1289,10 +1372,7 @@ flush_async_thread (GSimpleAsyncResult *res, result = class->flush (G_OUTPUT_STREAM (object), cancellable, &error); if (!result) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + g_simple_async_result_take_error (res, error); } static void @@ -1325,22 +1405,34 @@ close_async_thread (GSimpleAsyncResult *res, { GOutputStreamClass *class; GError *error = NULL; - gboolean result; + gboolean result = TRUE; + + class = G_OUTPUT_STREAM_GET_CLASS (object); + + /* Do a flush here if there is a flush function, and we did not have to do + an async flush before (see g_output_stream_close_async) */ + if (class->flush != NULL && + (class->flush_async == NULL || + class->flush_async == g_output_stream_real_flush_async)) + { + result = class->flush (G_OUTPUT_STREAM (object), cancellable, &error); + } /* Auto handling of cancelation disabled, and ignore cancellation, since we want to close things anyway, although possibly in a quick-n-dirty way. At least we never want to leak open handles */ - - class = G_OUTPUT_STREAM_GET_CLASS (object); + if (class->close_fn) { - result = class->close_fn (G_OUTPUT_STREAM (object), cancellable, &error); + /* Make sure to close, even if the flush failed (see sync close) */ if (!result) - { - g_simple_async_result_set_from_error (res, error); - g_error_free (error); - } + class->close_fn (G_OUTPUT_STREAM (object), cancellable, NULL); + else + result = class->close_fn (G_OUTPUT_STREAM (object), cancellable, &error); + + if (!result) + g_simple_async_result_take_error (res, error); } } @@ -1370,6 +1462,3 @@ g_output_stream_real_close_finish (GOutputStream *stream, g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_close_async); return TRUE; } - -#define __G_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/goutputstream.h b/gio/goutputstream.h index e28bded..995d0dd 100644 --- a/gio/goutputstream.h +++ b/gio/goutputstream.h @@ -100,7 +100,7 @@ struct _GOutputStreamClass int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer data); + gpointer user_data); gssize (* splice_finish) (GOutputStream *stream, GAsyncResult *result, GError **error); diff --git a/gio/gpermission.c b/gio/gpermission.c new file mode 100644 index 0000000..97a4fd9 --- /dev/null +++ b/gio/gpermission.c @@ -0,0 +1,415 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "config.h" + +#include "gpermission.h" +#include "glibintl.h" + + +/** + * SECTION:gpermission + * @title: GPermission + * @short_description: An object representing the permission to perform + * a certain action + * + * A #GPermission represents the status of the caller's permission to + * perform a certain action. + * + * You can query if the action is currently allowed and if it is + * possible to acquire the permission so that the action will be allowed + * in the future. + * + * There is also an API to actually acquire the permission and one to + * release it. + * + * As an example, a #GPermission might represent the ability for the + * user to write to a #GSettings object. This #GPermission object could + * then be used to decide if it is appropriate to show a "Click here to + * unlock" button in a dialog and to provide the mechanism to invoke + * when that button is clicked. + **/ + +/** + * GPermission: + * + * #GPermission is an opaque data structure and can only be accessed + * using the following functions. + **/ + +G_DEFINE_ABSTRACT_TYPE (GPermission, g_permission, G_TYPE_OBJECT) + +struct _GPermissionPrivate +{ + gboolean allowed; + gboolean can_acquire; + gboolean can_release; +}; + +enum { + PROP_NONE, + PROP_ALLOWED, + PROP_CAN_ACQUIRE, + PROP_CAN_RELEASE +}; + +/** + * g_permission_acquire: + * @permission: a #GPermission instance + * @cancellable: a #GCancellable, or %NULL + * @error: a pointer to a %NULL #GError, or %NULL + * @returns: %TRUE if the permission was successfully acquired + * + * Attempts to acquire the permission represented by @permission. + * + * The precise method by which this happens depends on the permission + * and the underlying authentication mechanism. A simple example is + * that a dialog may appear asking the user to enter their password. + * + * You should check with g_permission_get_can_acquire() before calling + * this function. + * + * If the permission is acquired then %TRUE is returned. Otherwise, + * %FALSE is returned and @error is set appropriately. + * + * This call is blocking, likely for a very long time (in the case that + * user interaction is required). See g_permission_acquire_async() for + * the non-blocking version. + * + * Since: 2.26 + */ +gboolean +g_permission_acquire (GPermission *permission, + GCancellable *cancellable, + GError **error) +{ + return G_PERMISSION_GET_CLASS (permission) + ->acquire (permission, cancellable, error); +} + +/** + * g_permission_acquire_async: + * @permission: a #GPermission instance + * @cancellable: a #GCancellable, or %NULL + * @callback: the #GAsyncReadyCallback to call when done + * @user_data: the user data to pass to @callback + * + * Attempts to acquire the permission represented by @permission. + * + * This is the first half of the asynchronous version of + * g_permission_acquire(). + * + * Since: 2.26 + **/ +void +g_permission_acquire_async (GPermission *permission, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + G_PERMISSION_GET_CLASS (permission) + ->acquire_async (permission, cancellable, callback, user_data); +} + +/** + * g_permission_acquire_finish: + * @permission: a #GPermission instance + * @result: the #GAsyncResult given to the #GAsyncReadyCallback + * @error: a pointer to a %NULL #GError, or %NULL + * @returns: %TRUE if the permission was successfully acquired + * + * Collects the result of attempting to acquire the permission + * represented by @permission. + * + * This is the second half of the asynchronous version of + * g_permission_acquire(). + * + * Since: 2.26 + **/ +gboolean +g_permission_acquire_finish (GPermission *permission, + GAsyncResult *result, + GError **error) +{ + return G_PERMISSION_GET_CLASS (permission) + ->acquire_finish (permission, result, error); +} + +/** + * g_permission_release: + * @permission: a #GPermission instance + * @cancellable: a #GCancellable, or %NULL + * @error: a pointer to a %NULL #GError, or %NULL + * @returns: %TRUE if the permission was successfully released + * + * Attempts to release the permission represented by @permission. + * + * The precise method by which this happens depends on the permission + * and the underlying authentication mechanism. In most cases the + * permission will be dropped immediately without further action. + * + * You should check with g_permission_get_can_release() before calling + * this function. + * + * If the permission is released then %TRUE is returned. Otherwise, + * %FALSE is returned and @error is set appropriately. + * + * This call is blocking, likely for a very long time (in the case that + * user interaction is required). See g_permission_release_async() for + * the non-blocking version. + * + * Since: 2.26 + **/ +gboolean +g_permission_release (GPermission *permission, + GCancellable *cancellable, + GError **error) +{ + return G_PERMISSION_GET_CLASS (permission) + ->release (permission, cancellable, error); +} + +/** + * g_permission_release_async: + * @permission: a #GPermission instance + * @cancellable: a #GCancellable, or %NULL + * @callback: the #GAsyncReadyCallback to call when done + * @user_data: the user data to pass to @callback + * + * Attempts to release the permission represented by @permission. + * + * This is the first half of the asynchronous version of + * g_permission_release(). + * + * Since: 2.26 + **/ +void +g_permission_release_async (GPermission *permission, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + G_PERMISSION_GET_CLASS (permission) + ->release_async (permission, cancellable, callback, user_data); +} + +/** + * g_permission_release_finish: + * @permission: a #GPermission instance + * @result: the #GAsyncResult given to the #GAsyncReadyCallback + * @error: a pointer to a %NULL #GError, or %NULL + * @returns: %TRUE if the permission was successfully released + * + * Collects the result of attempting to release the permission + * represented by @permission. + * + * This is the second half of the asynchronous version of + * g_permission_release(). + * + * Since: 2.26 + **/ +gboolean +g_permission_release_finish (GPermission *permission, + GAsyncResult *result, + GError **error) +{ + return G_PERMISSION_GET_CLASS (permission) + ->release_finish (permission, result, error); +} + +/** + * g_permission_get_allowed: + * @permission: a #GPermission instance + * @returns: the value of the 'allowed' property + * + * Gets the value of the 'allowed' property. This property is %TRUE if + * the caller currently has permission to perform the action that + * @permission represents the permission to perform. + * + * Since: 2.26 + **/ +gboolean +g_permission_get_allowed (GPermission *permission) +{ + return permission->priv->allowed; +} + +/** + * g_permission_get_can_acquire: + * @permission: a #GPermission instance + * @returns: the value of the 'can-acquire' property + * + * Gets the value of the 'can-acquire' property. This property is %TRUE + * if it is generally possible to acquire the permission by calling + * g_permission_acquire(). + * + * Since: 2.26 + **/ +gboolean +g_permission_get_can_acquire (GPermission *permission) +{ + return permission->priv->can_acquire; +} + +/** + * g_permission_get_can_release: + * @permission: a #GPermission instance + * @returns: the value of the 'can-release' property + * + * Gets the value of the 'can-release' property. This property is %TRUE + * if it is generally possible to release the permission by calling + * g_permission_release(). + * + * Since: 2.26 + **/ +gboolean +g_permission_get_can_release (GPermission *permission) +{ + return permission->priv->can_release; +} + +/** + * g_permission_impl_update: + * @permission: a #GPermission instance + * @allowed: the new value for the 'allowed' property + * @can_acquire: the new value for the 'can-acquire' property + * @can_release: the new value for the 'can-release' property + * + * This function is called by the #GPermission implementation to update + * the properties of the permission. You should never call this + * function except from a #GPermission implementation. + * + * GObject notify signals are generated, as appropriate. + * + * Since: 2.26 + **/ +void +g_permission_impl_update (GPermission *permission, + gboolean allowed, + gboolean can_acquire, + gboolean can_release) +{ + GObject *object = G_OBJECT (permission); + + g_object_freeze_notify (object); + + if (allowed != permission->priv->allowed) + { + permission->priv->allowed = !!allowed; + g_object_notify (object, "allowed"); + } + + if (can_acquire != permission->priv->can_acquire) + { + permission->priv->can_acquire = !!can_acquire; + g_object_notify (object, "can-acquire"); + } + + if (can_release != permission->priv->can_release) + { + permission->priv->can_release = !!can_release; + g_object_notify (object, "can-release"); + } + + g_object_thaw_notify (object); +} + +static void +g_permission_get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + GPermission *permission = G_PERMISSION (object); + + switch (prop_id) + { + case PROP_ALLOWED: + g_value_set_boolean (value, permission->priv->allowed); + break; + + case PROP_CAN_ACQUIRE: + g_value_set_boolean (value, permission->priv->can_acquire); + break; + + case PROP_CAN_RELEASE: + g_value_set_boolean (value, permission->priv->can_release); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_permission_init (GPermission *permission) +{ + permission->priv = G_TYPE_INSTANCE_GET_PRIVATE (permission, + G_TYPE_PERMISSION, + GPermissionPrivate); +} + +static void +g_permission_class_init (GPermissionClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->get_property = g_permission_get_property; + + /** + * GPermission:allowed: + * + * %TRUE if the caller currently has permission to perform the action that + * @permission represents the permission to perform. + */ + g_object_class_install_property (object_class, PROP_ALLOWED, + g_param_spec_boolean ("allowed", + P_("Is allowed"), + P_("If the caller is allowed to perform the action"), + FALSE, + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); + + /** + * GPermission:can-acquire: + * + * %TRUE if it is generally possible to acquire the permission by calling + * g_permission_acquire(). + */ + g_object_class_install_property (object_class, PROP_CAN_ACQUIRE, + g_param_spec_boolean ("can-acquire", + P_("Can acquire"), + P_("If calling g_permission_acquire() makes sense"), + FALSE, + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); + + /** + * GPermission:can-release: + * + * %TRUE if it is generally possible to release the permission by calling + * g_permission_release(). + */ + g_object_class_install_property (object_class, PROP_CAN_RELEASE, + g_param_spec_boolean ("can-release", + P_("Can release"), + P_("If calling g_permission_release() makes sense"), + FALSE, + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); + + g_type_class_add_private (class, sizeof (GPermissionPrivate)); +} diff --git a/gio/gpermission.h b/gio/gpermission.h new file mode 100644 index 0000000..3f74257 --- /dev/null +++ b/gio/gpermission.h @@ -0,0 +1,118 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_PERMISSION_H__ +#define __G_PERMISSION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_PERMISSION (g_permission_get_type ()) +#define G_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_PERMISSION, GPermission)) +#define G_PERMISSION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_PERMISSION, GPermissionClass)) +#define G_IS_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_PERMISSION)) +#define G_IS_PERMISSION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_PERMISSION)) +#define G_PERMISSION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_PERMISSION, GPermissionClass)) + +typedef struct _GPermissionPrivate GPermissionPrivate; +typedef struct _GPermissionClass GPermissionClass; + +struct _GPermission +{ + GObject parent_instance; + + /*< private >*/ + GPermissionPrivate *priv; +}; + +struct _GPermissionClass { + GObjectClass parent_class; + + gboolean (*acquire) (GPermission *permission, + GCancellable *cancellable, + GError **error); + void (*acquire_async) (GPermission *permission, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*acquire_finish) (GPermission *permission, + GAsyncResult *result, + GError **error); + + gboolean (*release) (GPermission *permission, + GCancellable *cancellable, + GError **error); + void (*release_async) (GPermission *permission, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*release_finish) (GPermission *permission, + GAsyncResult *result, + GError **error); + + gpointer reserved[16]; +}; + +GType g_permission_get_type (void); +gboolean g_permission_acquire (GPermission *permission, + GCancellable *cancellable, + GError **error); +void g_permission_acquire_async (GPermission *permission, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean g_permission_acquire_finish (GPermission *permission, + GAsyncResult *result, + GError **error); + +gboolean g_permission_release (GPermission *permission, + GCancellable *cancellable, + GError **error); +void g_permission_release_async (GPermission *permission, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean g_permission_release_finish (GPermission *permission, + GAsyncResult *result, + GError **error); + +gboolean g_permission_get_allowed (GPermission *permission); +gboolean g_permission_get_can_acquire (GPermission *permission); +gboolean g_permission_get_can_release (GPermission *permission); + +void g_permission_impl_update (GPermission *permission, + gboolean allowed, + gboolean can_acquire, + gboolean can_release); + +G_END_DECLS + +#endif /* __G_PERMISSION_H__ */ diff --git a/gio/gpollableinputstream.c b/gio/gpollableinputstream.c new file mode 100644 index 0000000..d6937d8 --- /dev/null +++ b/gio/gpollableinputstream.c @@ -0,0 +1,303 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include "gpollableinputstream.h" +#include "gasynchelper.h" +#include "gio-marshal.h" +#include "glibintl.h" + +/** + * SECTION:gpollableinputstream + * @short_description: Interface for pollable input streams + * @include: gio/gio.h + * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased + * + * #GPollableInputStream is implemented by #GInputStreams that + * can be polled for readiness to read. This can be used when + * interfacing with a non-GIO API that expects + * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style. + * + * Since: 2.28 + */ + +G_DEFINE_INTERFACE (GPollableInputStream, g_pollable_input_stream, G_TYPE_INPUT_STREAM) + +static gboolean g_pollable_input_stream_default_can_poll (GPollableInputStream *stream); +static gssize g_pollable_input_stream_default_read_nonblocking (GPollableInputStream *stream, + void *buffer, + gsize size, + GError **error); + +static void +g_pollable_input_stream_default_init (GPollableInputStreamInterface *iface) +{ + iface->can_poll = g_pollable_input_stream_default_can_poll; + iface->read_nonblocking = g_pollable_input_stream_default_read_nonblocking; +} + +static gboolean +g_pollable_input_stream_default_can_poll (GPollableInputStream *stream) +{ + return TRUE; +} + +/** + * g_pollable_input_stream_can_poll: + * @stream: a #GPollableInputStream. + * + * Checks if @stream is actually pollable. Some classes may implement + * #GPollableInputStream but have only certain instances of that class + * be pollable. If this method returns %FALSE, then the behavior of + * other #GPollableInputStream methods is undefined. + * + * For any given stream, the value returned by this method is constant; + * a stream cannot switch from pollable to non-pollable or vice versa. + * + * Returns: %TRUE if @stream is pollable, %FALSE if not. + * + * Since: 2.28 + */ +gboolean +g_pollable_input_stream_can_poll (GPollableInputStream *stream) +{ + g_return_val_if_fail (G_IS_POLLABLE_INPUT_STREAM (stream), FALSE); + + return G_POLLABLE_INPUT_STREAM_GET_INTERFACE (stream)->can_poll (stream); +} + +/** + * g_pollable_input_stream_is_readable: + * @stream: a #GPollableInputStream. + * + * Checks if @stream can be read. + * + * Note that some stream types may not be able to implement this 100% + * reliably, and it is possible that a call to g_input_stream_read() + * after this returns %TRUE would still block. To guarantee + * non-blocking behavior, you should always use + * g_pollable_input_stream_read_nonblocking(), which will return a + * %G_IO_ERROR_WOULD_BLOCK error rather than blocking. + * + * Returns: %TRUE if @stream is readable, %FALSE if not. If an error + * has occurred on @stream, this will result in + * g_pollable_input_stream_is_readable() returning %TRUE, and the + * next attempt to read will return the error. + * + * Since: 2.28 + */ +gboolean +g_pollable_input_stream_is_readable (GPollableInputStream *stream) +{ + g_return_val_if_fail (G_IS_POLLABLE_INPUT_STREAM (stream), FALSE); + + return G_POLLABLE_INPUT_STREAM_GET_INTERFACE (stream)->is_readable (stream); +} + +/** + * g_pollable_input_stream_create_source: + * @stream: a #GPollableInputStream. + * @cancellable: a #GCancellable, or %NULL + * + * Creates a #GSource that triggers when @stream can be read, or + * @cancellable is triggered or an error occurs. The callback on the + * source is of the #GPollableSourceFunc type. + * + * As with g_pollable_input_stream_is_readable(), it is possible that + * the stream may not actually be readable even after the source + * triggers, so you should use g_pollable_input_stream_read_nonblocking() + * rather than g_input_stream_read() from the callback. + * + * Returns: a new #GSource + * + * Since: 2.28 + */ +GSource * +g_pollable_input_stream_create_source (GPollableInputStream *stream, + GCancellable *cancellable) +{ + g_return_val_if_fail (G_IS_POLLABLE_INPUT_STREAM (stream), NULL); + + return G_POLLABLE_INPUT_STREAM_GET_INTERFACE (stream)-> + create_source (stream, cancellable); +} + +static gssize +g_pollable_input_stream_default_read_nonblocking (GPollableInputStream *stream, + void *buffer, + gsize size, + GError **error) +{ + if (!g_pollable_input_stream_is_readable (stream)) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK, + g_strerror (EAGAIN)); + return -1; + } + + return g_input_stream_read (G_INPUT_STREAM (stream), buffer, size, + NULL, error); +} + +/** + * g_pollable_input_stream_read_nonblocking: + * @stream: a #GPollableInputStream + * @buffer: a buffer to read data into (which should be at least @size + * bytes long). + * @size: the number of bytes you want to read + * @cancellable: a #GCancellable, or %NULL + * @error: #GError for error reporting, or %NULL to ignore. + * + * Attempts to read up to @size bytes from @stream into @buffer, as + * with g_input_stream_read(). If @stream is not currently readable, + * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can + * use g_pollable_input_stream_create_source() to create a #GSource + * that will be triggered when @stream is readable. + * + * Note that since this method never blocks, you cannot actually + * use @cancellable to cancel it. However, it will return an error + * if @cancellable has already been cancelled when you call, which + * may happen if you call this method after a source triggers due + * to having been cancelled. + * + * Return value: the number of bytes read, or -1 on error (including + * %G_IO_ERROR_WOULD_BLOCK). + */ +gssize +g_pollable_input_stream_read_nonblocking (GPollableInputStream *stream, + void *buffer, + gsize size, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (G_IS_POLLABLE_INPUT_STREAM (stream), -1); + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return -1; + + return G_POLLABLE_INPUT_STREAM_GET_INTERFACE (stream)-> + read_nonblocking (stream, buffer, size, error); +} + +/* GPollableSource */ + +typedef struct { + GSource source; + + GObject *stream; +} GPollableSource; + +static gboolean +pollable_source_prepare (GSource *source, + gint *timeout) +{ + *timeout = -1; + return FALSE; +} + +static gboolean +pollable_source_check (GSource *source) +{ + return FALSE; +} + +static gboolean +pollable_source_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) +{ + GPollableSourceFunc func = (GPollableSourceFunc)callback; + GPollableSource *pollable_source = (GPollableSource *)source; + + return (*func) (pollable_source->stream, user_data); +} + +static void +pollable_source_finalize (GSource *source) +{ + GPollableSource *pollable_source = (GPollableSource *)source; + + g_object_unref (pollable_source->stream); +} + +static gboolean +pollable_source_closure_callback (GObject *stream, + gpointer data) +{ + GClosure *closure = data; + + GValue param = { 0, }; + GValue result_value = { 0, }; + gboolean result; + + g_value_init (&result_value, G_TYPE_BOOLEAN); + + g_value_init (¶m, G_TYPE_OBJECT); + g_value_set_object (¶m, stream); + + g_closure_invoke (closure, &result_value, 1, ¶m, NULL); + + result = g_value_get_boolean (&result_value); + g_value_unset (&result_value); + g_value_unset (¶m); + + return result; +} + +static GSourceFuncs pollable_source_funcs = +{ + pollable_source_prepare, + pollable_source_check, + pollable_source_dispatch, + pollable_source_finalize, + (GSourceFunc)pollable_source_closure_callback, + (GSourceDummyMarshal)_gio_marshal_BOOLEAN__VOID, +}; + +/** + * g_pollable_source_new: + * @pollable_stream: the stream associated with the new source + * + * Utility method for #GPollableInputStream and #GPollableOutputStream + * implementations. Creates a new #GSource that expects a callback of + * type #GPollableSourceFunc. The new source does not actually do + * anything on its own; use g_source_add_child_source() to add other + * sources to it to cause it to trigger. + * + * Return value: the new #GSource. + * + * Since: 2.28 + */ +GSource * +g_pollable_source_new (GObject *pollable_stream) +{ + GSource *source; + GPollableSource *pollable_source; + + source = g_source_new (&pollable_source_funcs, sizeof (GPollableSource)); + g_source_set_name (source, "GPollableSource"); + pollable_source = (GPollableSource *)source; + pollable_source->stream = g_object_ref (pollable_stream); + + return source; +} diff --git a/gio/gpollableinputstream.h b/gio/gpollableinputstream.h new file mode 100644 index 0000000..3b57460 --- /dev/null +++ b/gio/gpollableinputstream.h @@ -0,0 +1,101 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __G_POLLABLE_INPUT_STREAM_H__ +#define __G_POLLABLE_INPUT_STREAM_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_POLLABLE_INPUT_STREAM (g_pollable_input_stream_get_type ()) +#define G_POLLABLE_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_POLLABLE_INPUT_STREAM, GPollableInputStream)) +#define G_IS_POLLABLE_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_POLLABLE_INPUT_STREAM)) +#define G_POLLABLE_INPUT_STREAM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_POLLABLE_INPUT_STREAM, GPollableInputStreamInterface)) + +/** + * GPollableInputStream: + * + * An interface for a #GInputStream that can be polled for readability. + * + * Since: 2.28 + */ +typedef struct _GPollableInputStreamInterface GPollableInputStreamInterface; + +/** + * GPollableInputStreamInterface: + * @g_iface: The parent interface. + * @can_poll: Checks if the #GPollableInputStream instance is actually pollable + * @is_readable: Checks if the stream is readable + * @create_source: Creates a #GSource to poll the stream + * @read_nonblocking: Does a non-blocking read or returns + * %G_IO_ERROR_WOULD_BLOCK + * + * The interface for pollable input streams. + * + * The default implementation of @can_poll always returns %TRUE. + * + * The default implementation of @read_nonblocking calls + * g_pollable_input_stream_is_readable(), and then calls + * g_input_stream_read() if it returns %TRUE. This means you only need + * to override it if it is possible that your @is_readable + * implementation may return %TRUE when the stream is not actually + * readable. + * + * Since: 2.28 + */ +struct _GPollableInputStreamInterface +{ + GTypeInterface g_iface; + + /* Virtual Table */ + gboolean (*can_poll) (GPollableInputStream *stream); + + gboolean (*is_readable) (GPollableInputStream *stream); + GSource * (*create_source) (GPollableInputStream *stream, + GCancellable *cancellable); + gssize (*read_nonblocking) (GPollableInputStream *stream, + void *buffer, + gsize size, + GError **error); +}; + +GType g_pollable_input_stream_get_type (void) G_GNUC_CONST; + +gboolean g_pollable_input_stream_can_poll (GPollableInputStream *stream); + +gboolean g_pollable_input_stream_is_readable (GPollableInputStream *stream); +GSource *g_pollable_input_stream_create_source (GPollableInputStream *stream, + GCancellable *cancellable); + +gssize g_pollable_input_stream_read_nonblocking (GPollableInputStream *stream, + void *buffer, + gsize size, + GCancellable *cancellable, + GError **error); + +/* Helper method for stream implementations */ +GSource *g_pollable_source_new (GObject *pollable_stream); + +G_END_DECLS + + +#endif /* __G_POLLABLE_INPUT_STREAM_H__ */ + diff --git a/gio/gpollableoutputstream.c b/gio/gpollableoutputstream.c new file mode 100644 index 0000000..b4efb3f --- /dev/null +++ b/gio/gpollableoutputstream.c @@ -0,0 +1,200 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include "gpollableoutputstream.h" +#include "gasynchelper.h" +#include "gfiledescriptorbased.h" +#include "gio-marshal.h" +#include "glibintl.h" + +/** + * SECTION:gpollableoutputstream + * @short_description: Interface for pollable output streams + * @include: gio/gio.h + * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream + * + * #GPollableOutputStream is implemented by #GOutputStreams that + * can be polled for readiness to write. This can be used when + * interfacing with a non-GIO API that expects + * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style. + * + * Since: 2.28 + */ + +G_DEFINE_INTERFACE (GPollableOutputStream, g_pollable_output_stream, G_TYPE_OUTPUT_STREAM) + +static gboolean g_pollable_output_stream_default_can_poll (GPollableOutputStream *stream); +static gssize g_pollable_output_stream_default_write_nonblocking (GPollableOutputStream *stream, + const void *buffer, + gsize size, + GError **error); + +static void +g_pollable_output_stream_default_init (GPollableOutputStreamInterface *iface) +{ + iface->can_poll = g_pollable_output_stream_default_can_poll; + iface->write_nonblocking = g_pollable_output_stream_default_write_nonblocking; +} + +static gboolean +g_pollable_output_stream_default_can_poll (GPollableOutputStream *stream) +{ + return TRUE; +} + +/** + * g_pollable_output_stream_can_poll: + * @stream: a #GPollableOutputStream. + * + * Checks if @stream is actually pollable. Some classes may implement + * #GPollableOutputStream but have only certain instances of that + * class be pollable. If this method returns %FALSE, then the behavior + * of other #GPollableOutputStream methods is undefined. + * + * For any given stream, the value returned by this method is constant; + * a stream cannot switch from pollable to non-pollable or vice versa. + * + * Returns: %TRUE if @stream is pollable, %FALSE if not. + * + * Since: 2.28 + */ +gboolean +g_pollable_output_stream_can_poll (GPollableOutputStream *stream) +{ + g_return_val_if_fail (G_IS_POLLABLE_OUTPUT_STREAM (stream), FALSE); + + return G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE (stream)->can_poll (stream); +} + +/** + * g_pollable_output_stream_is_writable: + * @stream: a #GPollableOutputStream. + * + * Checks if @stream can be written. + * + * Note that some stream types may not be able to implement this 100% + * reliably, and it is possible that a call to g_output_stream_write() + * after this returns %TRUE would still block. To guarantee + * non-blocking behavior, you should always use + * g_pollable_output_stream_write_nonblocking(), which will return a + * %G_IO_ERROR_WOULD_BLOCK error rather than blocking. + * + * Returns: %TRUE if @stream is writable, %FALSE if not. If an error + * has occurred on @stream, this will result in + * g_pollable_output_stream_is_writable() returning %TRUE, and the + * next attempt to write will return the error. + * + * Since: 2.28 + */ +gboolean +g_pollable_output_stream_is_writable (GPollableOutputStream *stream) +{ + g_return_val_if_fail (G_IS_POLLABLE_OUTPUT_STREAM (stream), FALSE); + + return G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE (stream)->is_writable (stream); +} + +/** + * g_pollable_output_stream_create_source: + * @stream: a #GPollableOutputStream. + * @cancellable: a #GCancellable, or %NULL + * + * Creates a #GSource that triggers when @stream can be written, or + * @cancellable is triggered or an error occurs. The callback on the + * source is of the #GPollableSourceFunc type. + * + * As with g_pollable_output_stream_is_writable(), it is possible that + * the stream may not actually be writable even after the source + * triggers, so you should use g_pollable_output_stream_write_nonblocking() + * rather than g_output_stream_write() from the callback. + * + * Returns: a new #GSource + * + * Since: 2.28 + */ +GSource * +g_pollable_output_stream_create_source (GPollableOutputStream *stream, + GCancellable *cancellable) +{ + g_return_val_if_fail (G_IS_POLLABLE_OUTPUT_STREAM (stream), NULL); + + return G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE (stream)-> + create_source (stream, cancellable); +} + +static gssize +g_pollable_output_stream_default_write_nonblocking (GPollableOutputStream *stream, + const void *buffer, + gsize size, + GError **error) +{ + if (!g_pollable_output_stream_is_writable (stream)) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK, + g_strerror (EAGAIN)); + return -1; + } + + return g_output_stream_write (G_OUTPUT_STREAM (stream), buffer, size, + NULL, error); +} + +/** + * g_pollable_output_stream_write_nonblocking: + * @stream: a #GPollableOutputStream + * @buffer: a buffer to write data from + * @size: the number of bytes you want to write + * @cancellable: a #GCancellable, or %NULL + * @error: #GError for error reporting, or %NULL to ignore. + * + * Attempts to write up to @size bytes from @buffer to @stream, as + * with g_output_stream_write(). If @stream is not currently writable, + * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can + * use g_pollable_output_stream_create_source() to create a #GSource + * that will be triggered when @stream is writable. + * + * Note that since this method never blocks, you cannot actually + * use @cancellable to cancel it. However, it will return an error + * if @cancellable has already been cancelled when you call, which + * may happen if you call this method after a source triggers due + * to having been cancelled. + * + * Return value: the number of bytes written, or -1 on error (including + * %G_IO_ERROR_WOULD_BLOCK). + */ +gssize +g_pollable_output_stream_write_nonblocking (GPollableOutputStream *stream, + const void *buffer, + gsize size, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (G_IS_POLLABLE_OUTPUT_STREAM (stream), -1); + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return -1; + + return G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE (stream)-> + write_nonblocking (stream, buffer, size, error); +} diff --git a/gio/gpollableoutputstream.h b/gio/gpollableoutputstream.h new file mode 100644 index 0000000..abef0ed --- /dev/null +++ b/gio/gpollableoutputstream.h @@ -0,0 +1,98 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __G_POLLABLE_OUTPUT_STREAM_H__ +#define __G_POLLABLE_OUTPUT_STREAM_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_POLLABLE_OUTPUT_STREAM (g_pollable_output_stream_get_type ()) +#define G_POLLABLE_OUTPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_POLLABLE_OUTPUT_STREAM, GPollableOutputStream)) +#define G_IS_POLLABLE_OUTPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_POLLABLE_OUTPUT_STREAM)) +#define G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_POLLABLE_OUTPUT_STREAM, GPollableOutputStreamInterface)) + +/** + * GPollableOutputStream: + * + * An interface for a #GOutputStream that can be polled for readability. + * + * Since: 2.28 + */ +typedef struct _GPollableOutputStreamInterface GPollableOutputStreamInterface; + +/** + * GPollableOutputStreamInterface: + * @g_iface: The parent interface. + * @can_poll: Checks if the #GPollableOutputStream instance is actually pollable + * @is_writable: Checks if the stream is writable + * @create_source: Creates a #GSource to poll the stream + * @write_nonblocking: Does a non-blocking write or returns + * %G_IO_ERROR_WOULD_BLOCK + * + * The interface for pollable output streams. + * + * The default implementation of @can_poll always returns %TRUE. + * + * The default implementation of @write_nonblocking calls + * g_pollable_output_stream_is_writable(), and then calls + * g_output_stream_write() if it returns %TRUE. This means you only + * need to override it if it is possible that your @is_writable + * implementation may return %TRUE when the stream is not actually + * writable. + * + * Since: 2.28 + */ +struct _GPollableOutputStreamInterface +{ + GTypeInterface g_iface; + + /* Virtual Table */ + gboolean (*can_poll) (GPollableOutputStream *stream); + + gboolean (*is_writable) (GPollableOutputStream *stream); + GSource * (*create_source) (GPollableOutputStream *stream, + GCancellable *cancellable); + gssize (*write_nonblocking) (GPollableOutputStream *stream, + const void *buffer, + gsize size, + GError **error); +}; + +GType g_pollable_output_stream_get_type (void) G_GNUC_CONST; + +gboolean g_pollable_output_stream_can_poll (GPollableOutputStream *stream); + +gboolean g_pollable_output_stream_is_writable (GPollableOutputStream *stream); +GSource *g_pollable_output_stream_create_source (GPollableOutputStream *stream, + GCancellable *cancellable); + +gssize g_pollable_output_stream_write_nonblocking (GPollableOutputStream *stream, + const void *buffer, + gsize size, + GCancellable *cancellable, + GError **error); + +G_END_DECLS + + +#endif /* __G_POLLABLE_OUTPUT_STREAM_H__ */ + diff --git a/gio/gpollfilemonitor.c b/gio/gpollfilemonitor.c index 51d04ef..c516bbd 100644 --- a/gio/gpollfilemonitor.c +++ b/gio/gpollfilemonitor.c @@ -28,7 +28,6 @@ #include "gfilemonitor.h" #include "gfileinfo.h" -#include "gioalias.h" static gboolean g_poll_file_monitor_cancel (GFileMonitor* monitor); static void schedule_poll_timeout (GPollFileMonitor* poll_monitor); diff --git a/gio/gproxy.c b/gio/gproxy.c new file mode 100644 index 0000000..b40e23c --- /dev/null +++ b/gio/gproxy.c @@ -0,0 +1,208 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#include "config.h" + +#include "gproxy.h" + +#include "giomodule.h" +#include "giomodule-priv.h" +#include "glibintl.h" + +/** + * SECTION:gproxy + * @short_description: Interface for proxy handling + * + * A #GProxy handles connecting to a remote host via a given type of + * proxy server. It is implemented by the 'gio-proxy' extension point. + * The extensions are named after their proxy protocol name. As an + * example, a SOCKS5 proxy implementation can be retrieved with the + * name 'socks5' using the function + * g_io_extension_point_get_extension_by_name(). + * + * Since: 2.26 + **/ + +G_DEFINE_INTERFACE (GProxy, g_proxy, G_TYPE_OBJECT) + +static void +g_proxy_default_init (GProxyInterface *iface) +{ +} + +/** + * g_proxy_get_default_for_protocol: + * @protocol: the proxy protocol name (e.g. http, socks, etc) + * + * Lookup "gio-proxy" extension point for a proxy implementation that supports + * specified protocol. + * + * Return value: return a #GProxy or NULL if protocol is not supported. + * + * Since: 2.26 + **/ +GProxy * +g_proxy_get_default_for_protocol (const gchar *protocol) +{ + GIOExtensionPoint *ep; + GIOExtension *extension; + + /* Ensure proxy modules loaded */ + _g_io_modules_ensure_loaded (); + + ep = g_io_extension_point_lookup (G_PROXY_EXTENSION_POINT_NAME); + + extension = g_io_extension_point_get_extension_by_name (ep, protocol); + + if (extension) + return g_object_new (g_io_extension_get_type (extension), NULL); + + return NULL; +} + +/** + * g_proxy_connect: + * @proxy: a #GProxy + * @connection: a #GIOStream + * @proxy_address: a #GProxyAddress + * @cancellable: a #GCancellable + * @error: return #GError + * + * Given @connection to communicate with a proxy (eg, a + * #GSocketConnection that is connected to the proxy server), this + * does the necessary handshake to connect to @proxy_address, and if + * required, wraps the #GIOStream to handle proxy payload. + * + * Return value: (transfer full): a #GIOStream that will replace @connection. This might + * be the same as @connection, in which case a reference + * will be added. + * + * Since: 2.26 + */ +GIOStream * +g_proxy_connect (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GError **error) +{ + GProxyInterface *iface; + + g_return_val_if_fail (G_IS_PROXY (proxy), NULL); + + iface = G_PROXY_GET_IFACE (proxy); + + return (* iface->connect) (proxy, + connection, + proxy_address, + cancellable, + error); +} + +/** + * g_proxy_connect_async: + * @proxy: a #GProxy + * @connection: a #GIOStream + * @proxy_address: a #GProxyAddress + * @cancellable: a #GCancellable + * @callback: a #GAsyncReadyCallback + * @user_data: callback data + * + * Asynchronous version of g_proxy_connect(). + * + * Since: 2.26 + */ +void +g_proxy_connect_async (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GProxyInterface *iface; + + g_return_if_fail (G_IS_PROXY (proxy)); + + iface = G_PROXY_GET_IFACE (proxy); + + (* iface->connect_async) (proxy, + connection, + proxy_address, + cancellable, + callback, + user_data); +} + +/** + * g_proxy_connect_finish: + * @proxy: a #GProxy + * @result: a #GAsyncRetult + * @error: return #GError + * + * See g_proxy_connect(). + * + * Return value: (transfer full): a #GIOStream. + * + * Since: 2.26 + */ +GIOStream * +g_proxy_connect_finish (GProxy *proxy, + GAsyncResult *result, + GError **error) +{ + GProxyInterface *iface; + + g_return_val_if_fail (G_IS_PROXY (proxy), NULL); + + iface = G_PROXY_GET_IFACE (proxy); + + return (* iface->connect_finish) (proxy, result, error); +} + +/** + * g_proxy_supports_hostname: + * @proxy: a #GProxy + * + * Some proxy protocols expect to be passed a hostname, which they + * will resolve to an IP address themselves. Others, like SOCKS4, do + * not allow this. This function will return %FALSE if @proxy is + * implementing such a protocol. When %FALSE is returned, the caller + * should resolve the destination hostname first, and then pass a + * #GProxyAddress containing the stringified IP address to + * g_proxy_connect() or g_proxy_connect_async(). + * + * Return value: %TRUE if hostname resolution is supported. + * + * Since: 2.26 + */ +gboolean +g_proxy_supports_hostname (GProxy *proxy) +{ + GProxyInterface *iface; + + g_return_val_if_fail (G_IS_PROXY (proxy), FALSE); + + iface = G_PROXY_GET_IFACE (proxy); + + return (* iface->supports_hostname) (proxy); +} diff --git a/gio/gproxy.h b/gio/gproxy.h new file mode 100644 index 0000000..626e0ee --- /dev/null +++ b/gio/gproxy.h @@ -0,0 +1,123 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_PROXY_H__ +#define __G_PROXY_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_PROXY (g_proxy_get_type ()) +#define G_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY, GProxy)) +#define G_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY)) +#define G_PROXY_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_PROXY, GProxyInterface)) + +/** + * G_PROXY_EXTENSION_POINT_NAME: + * + * Extension point for proxy functionality. + * See Extending GIO. + * + * Since: 2.26 + */ +#define G_PROXY_EXTENSION_POINT_NAME "gio-proxy" + +/** + * GProxy: + * + * Interface that handles proxy connection and payload. + * + * Since: 2.26 + */ +typedef struct _GProxyInterface GProxyInterface; + +/** + * GProxyInterface: + * @g_iface: The parent interface. + * @connect: Connect to proxy server and wrap (if required) the #connection + * to handle payload. + * @connect_async: Same has connect() but asynchronous. + * @connect_finish: Returns the result of connect_async() + * + * Provides an interface for handling proxy connection and payload. + * + * Since: 2.26 + */ +struct _GProxyInterface +{ + GTypeInterface g_iface; + + /* Virtual Table */ + + GIOStream * (* connect) (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GError **error); + + void (* connect_async) (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + + GIOStream * (* connect_finish) (GProxy *proxy, + GAsyncResult *result, + GError **error); + + gboolean (* supports_hostname) (GProxy *proxy); +}; + +GType g_proxy_get_type (void) G_GNUC_CONST; + +GProxy *g_proxy_get_default_for_protocol (const gchar *protocol); + +GIOStream *g_proxy_connect (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GError **error); + +void g_proxy_connect_async (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +GIOStream *g_proxy_connect_finish (GProxy *proxy, + GAsyncResult *result, + GError **error); + +gboolean g_proxy_supports_hostname (GProxy *proxy); + +G_END_DECLS + +#endif /* __G_PROXY_H__ */ diff --git a/gio/gproxyaddress.c b/gio/gproxyaddress.c new file mode 100644 index 0000000..61dfc7d --- /dev/null +++ b/gio/gproxyaddress.c @@ -0,0 +1,345 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Nicolas Dufresne + */ + +#include +#include +#include + +#include + +#include "gproxyaddress.h" +#include "glibintl.h" + +/** + * SECTION:gproxyaddress + * @short_description: An internet address with proxy information + * + * Support for proxied #GInetSocketAddress. + */ + +/** + * GProxyAddress: + * + * A #GInetSocketAddress representing a connection via a proxy server + * + * Since: 2.26 + **/ +G_DEFINE_TYPE (GProxyAddress, g_proxy_address, G_TYPE_INET_SOCKET_ADDRESS); + +enum +{ + PROP_0, + PROP_PROTOCOL, + PROP_DESTINATION_HOSTNAME, + PROP_DESTINATION_PORT, + PROP_USERNAME, + PROP_PASSWORD +}; + +struct _GProxyAddressPrivate +{ + gchar *protocol; + gchar *username; + gchar *password; + gchar *dest_hostname; + guint16 dest_port; +}; + +static void +g_proxy_address_finalize (GObject *object) +{ + GProxyAddress *proxy = G_PROXY_ADDRESS (object); + + g_free (proxy->priv->protocol); + g_free (proxy->priv->username); + g_free (proxy->priv->password); + g_free (proxy->priv->dest_hostname); + + G_OBJECT_CLASS (g_proxy_address_parent_class)->finalize (object); +} + +static void +g_proxy_address_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GProxyAddress *proxy = G_PROXY_ADDRESS (object); + + switch (prop_id) + { + case PROP_PROTOCOL: + g_free (proxy->priv->protocol); + proxy->priv->protocol = g_value_dup_string (value); + break; + + case PROP_DESTINATION_HOSTNAME: + g_free (proxy->priv->dest_hostname); + proxy->priv->dest_hostname = g_value_dup_string (value); + break; + + case PROP_DESTINATION_PORT: + proxy->priv->dest_port = g_value_get_uint (value); + break; + + case PROP_USERNAME: + g_free (proxy->priv->username); + proxy->priv->username = g_value_dup_string (value); + break; + + case PROP_PASSWORD: + g_free (proxy->priv->password); + proxy->priv->password = g_value_dup_string (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_proxy_address_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GProxyAddress *proxy = G_PROXY_ADDRESS (object); + + switch (prop_id) + { + case PROP_PROTOCOL: + g_value_set_string (value, proxy->priv->protocol); + break; + + case PROP_DESTINATION_HOSTNAME: + g_value_set_string (value, proxy->priv->dest_hostname); + break; + + case PROP_DESTINATION_PORT: + g_value_set_uint (value, proxy->priv->dest_port); + break; + + case PROP_USERNAME: + g_value_set_string (value, proxy->priv->username); + break; + + case PROP_PASSWORD: + g_value_set_string (value, proxy->priv->password); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_proxy_address_class_init (GProxyAddressClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GProxyAddressPrivate)); + + gobject_class->finalize = g_proxy_address_finalize; + gobject_class->set_property = g_proxy_address_set_property; + gobject_class->get_property = g_proxy_address_get_property; + + g_object_class_install_property (gobject_class, + PROP_PROTOCOL, + g_param_spec_string ("protocol", + P_("Protocol"), + P_("The proxy protocol"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + PROP_USERNAME, + g_param_spec_string ("username", + P_("Username"), + P_("The proxy username"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + PROP_PASSWORD, + g_param_spec_string ("password", + P_("Password"), + P_("The proxy password"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + PROP_DESTINATION_HOSTNAME, + g_param_spec_string ("destination-hostname", + P_("Destination Hostname"), + P_("The proxy destination hostname"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + PROP_DESTINATION_PORT, + g_param_spec_uint ("destination-port", + P_("Destination Port"), + P_("The proxy destination port"), + 0, 65535, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +} + +static void +g_proxy_address_init (GProxyAddress *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, + G_TYPE_PROXY_ADDRESS, + GProxyAddressPrivate); + proxy->priv->protocol = NULL; + proxy->priv->username = NULL; + proxy->priv->password = NULL; + proxy->priv->dest_hostname = NULL; + proxy->priv->dest_port = 0; +} + +/** + * g_proxy_address_new: + * @inetaddr: The proxy server #GInetAddress. + * @port: The proxy server port. + * @protocol: The proxy protocol to support, in lower case (e.g. socks, http). + * @dest_hostname: The destination hostname the the proxy should tunnel to. + * @dest_port: The destination port to tunnel to. + * @username: The username to authenticate to the proxy server (or %NULL). + * @password: The password to authenticate to the proxy server (or %NULL). + * + * Creates a new #GProxyAddress for @inetaddr with @protocol that should + * tunnel through @dest_hostname and @dest_port. + * + * Returns: a new #GProxyAddress + * + * Since: 2.26 + */ +GSocketAddress * +g_proxy_address_new (GInetAddress *inetaddr, + guint16 port, + const gchar *protocol, + const gchar *dest_hostname, + guint16 dest_port, + const gchar *username, + const gchar *password) +{ + return g_object_new (G_TYPE_PROXY_ADDRESS, + "address", inetaddr, + "port", port, + "protocol", protocol, + "destination-hostname", dest_hostname, + "destination-port", dest_port, + "username", username, + "password", password, + NULL); +} + + +/** + * g_proxy_address_get_protocol: + * @proxy: a #GProxyAddress + * + * Gets @proxy's protocol. + * + * Returns: the @proxy's protocol + * + * Since: 2.26 + */ +const gchar * +g_proxy_address_get_protocol (GProxyAddress *proxy) +{ + return proxy->priv->protocol; +} + +/** + * g_proxy_address_get_destination_hostname + * @proxy: a #GProxyAddress + * + * Gets @proxy's destination hostname. + * + * Returns: the @proxy's destination hostname + * + * Since: 2.26 + */ +const gchar * +g_proxy_address_get_destination_hostname (GProxyAddress *proxy) +{ + return proxy->priv->dest_hostname; +} + +/** + * g_proxy_address_get_destination_port + * @proxy: a #GProxyAddress + * + * Gets @proxy's destination port. + * + * Returns: the @proxy's destination port + * + * Since: 2.26 + */ +guint16 +g_proxy_address_get_destination_port (GProxyAddress *proxy) +{ + return proxy->priv->dest_port; +} + +/** + * g_proxy_address_get_username + * @proxy: a #GProxyAddress + * + * Gets @proxy's username. + * + * Returns: the @proxy's username + * + * Since: 2.26 + */ +const gchar * +g_proxy_address_get_username (GProxyAddress *proxy) +{ + return proxy->priv->username; +} + +/** + * g_proxy_address_get_password + * @proxy: a #GProxyAddress + * + * Gets @proxy's password. + * + * Returns: the @proxy's password + * + * Since: 2.26 + */ +const gchar * +g_proxy_address_get_password (GProxyAddress *proxy) +{ + return proxy->priv->password; +} diff --git a/gio/gproxyaddress.h b/gio/gproxyaddress.h new file mode 100644 index 0000000..cc4594d --- /dev/null +++ b/gio/gproxyaddress.h @@ -0,0 +1,76 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Nicolas Dufresne + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_PROXY_ADDRESS_H__ +#define __G_PROXY_ADDRESS_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_PROXY_ADDRESS (g_proxy_address_get_type ()) +#define G_PROXY_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY_ADDRESS, GProxyAddress)) +#define G_PROXY_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_PROXY_ADDRESS, GProxyAddressClass)) +#define G_IS_PROXY_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY_ADDRESS)) +#define G_IS_PROXY_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_PROXY_ADDRESS)) +#define G_PROXY_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_PROXY_ADDRESS, GProxyAddressClass)) + +typedef struct _GProxyAddressClass GProxyAddressClass; +typedef struct _GProxyAddressPrivate GProxyAddressPrivate; + +struct _GProxyAddress +{ + GInetSocketAddress parent_instance; + + /*< private >*/ + GProxyAddressPrivate *priv; +}; + +struct _GProxyAddressClass +{ + GInetSocketAddressClass parent_class; +}; + + +GType g_proxy_address_get_type (void) G_GNUC_CONST; + +GSocketAddress *g_proxy_address_new (GInetAddress *inetaddr, + guint16 port, + const gchar *protocol, + const gchar *dest_hostname, + guint16 dest_port, + const gchar *username, + const gchar *password); + +const gchar *g_proxy_address_get_protocol (GProxyAddress *proxy); +const gchar *g_proxy_address_get_destination_hostname (GProxyAddress *proxy); +guint16 g_proxy_address_get_destination_port (GProxyAddress *proxy); +const gchar *g_proxy_address_get_username (GProxyAddress *proxy); +const gchar *g_proxy_address_get_password (GProxyAddress *proxy); + +G_END_DECLS + +#endif /* __G_PROXY_ADDRESS_H__ */ diff --git a/gio/gproxyaddressenumerator.c b/gio/gproxyaddressenumerator.c new file mode 100644 index 0000000..460c30c --- /dev/null +++ b/gio/gproxyaddressenumerator.c @@ -0,0 +1,722 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#include "config.h" +#include "gproxyaddressenumerator.h" + +#include + +#include "gasyncresult.h" +#include "ginetaddress.h" +#include "glibintl.h" +#include "gnetworkaddress.h" +#include "gnetworkingprivate.h" +#include "gproxy.h" +#include "gproxyaddress.h" +#include "gproxyresolver.h" +#include "gsimpleasyncresult.h" +#include "gresolver.h" +#include "gsocketaddress.h" +#include "gsocketaddressenumerator.h" +#include "gsocketconnectable.h" + +G_DEFINE_TYPE (GProxyAddressEnumerator, g_proxy_address_enumerator, G_TYPE_SOCKET_ADDRESS_ENUMERATOR); + +#define GET_PRIVATE(o) (G_PROXY_ADDRESS_ENUMERATOR (o)->priv) + +enum +{ + PROP_0, + PROP_URI, + PROP_CONNECTABLE +}; + +struct _GProxyAddressEnumeratorPrivate +{ + /* Destination address */ + GSocketConnectable *connectable; + gchar *dest_uri; + gchar *dest_hostname; + guint16 dest_port; + GList *dest_ips; + + /* Proxy enumeration */ + gchar **proxies; + gchar **next_proxy; + GSocketAddressEnumerator *addr_enum; + GSocketAddress *proxy_address; + gchar *proxy_type; + gchar *proxy_username; + gchar *proxy_password; + gboolean supports_hostname; + GList *next_dest_ip; + + /* Async attributes */ + GSimpleAsyncResult *simple; + GCancellable *cancellable; +}; + +static void +save_userinfo (GProxyAddressEnumeratorPrivate *priv, + const gchar *proxy) +{ + gchar *userinfo; + + if (priv->proxy_username) + { + g_free (priv->proxy_username); + priv->proxy_username = NULL; + } + + if (priv->proxy_password) + { + g_free (priv->proxy_password); + priv->proxy_password = NULL; + } + + if (_g_uri_parse_authority (proxy, NULL, NULL, &userinfo)) + { + if (userinfo) + { + gchar **split = g_strsplit (userinfo, ":", 2); + + if (split[0] != NULL) + { + priv->proxy_username = g_uri_unescape_string (split[0], NULL); + if (split[1] != NULL) + priv->proxy_password = g_uri_unescape_string (split[1], NULL); + } + + g_strfreev (split); + g_free (userinfo); + } + } +} + +static void +next_enumerator (GProxyAddressEnumeratorPrivate *priv) +{ + if (priv->proxy_address) + return; + + while (priv->addr_enum == NULL && *priv->next_proxy) + { + GSocketConnectable *connectable = NULL; + const gchar *proxy_uri; + GProxy *proxy; + + proxy_uri = *priv->next_proxy++; + g_free (priv->proxy_type); + priv->proxy_type = g_uri_parse_scheme (proxy_uri); + + if (priv->proxy_type == NULL) + continue; + + /* Assumes hostnames are supported for unkown protocols */ + priv->supports_hostname = TRUE; + proxy = g_proxy_get_default_for_protocol (priv->proxy_type); + if (proxy) + { + priv->supports_hostname = g_proxy_supports_hostname (proxy); + g_object_unref (proxy); + } + + if (strcmp ("direct", priv->proxy_type) == 0) + { + if (priv->connectable) + connectable = g_object_ref (priv->connectable); + else + connectable = g_network_address_new (priv->dest_hostname, + priv->dest_port); + } + else + { + GError *error = NULL; + + connectable = g_network_address_parse_uri (proxy_uri, 0, &error); + + if (error) + { + g_warning ("Invalid proxy URI '%s': %s", + proxy_uri, error->message); + g_error_free (error); + } + + save_userinfo (priv, proxy_uri); + } + + if (connectable) + { + priv->addr_enum = g_socket_connectable_enumerate (connectable); + g_object_unref (connectable); + } + } +} + +static GSocketAddress * +g_proxy_address_enumerator_next (GSocketAddressEnumerator *enumerator, + GCancellable *cancellable, + GError **error) +{ + GProxyAddressEnumeratorPrivate *priv = GET_PRIVATE (enumerator); + GSocketAddress *result = NULL; + GError *first_error = NULL; + + if (priv->proxies == NULL) + { + GProxyResolver *resolver = g_proxy_resolver_get_default (); + priv->proxies = g_proxy_resolver_lookup (resolver, + priv->dest_uri, + cancellable, + error); + priv->next_proxy = priv->proxies; + + if (priv->proxies == NULL) + return NULL; + } + + while (result == NULL && (*priv->next_proxy || priv->addr_enum)) + { + gchar *dest_hostname; + GInetSocketAddress *inetsaddr; + GInetAddress *inetaddr; + guint16 port; + + next_enumerator (priv); + + if (!priv->addr_enum) + continue; + + if (priv->proxy_address == NULL) + { + priv->proxy_address = g_socket_address_enumerator_next ( + priv->addr_enum, + cancellable, + first_error ? NULL : &first_error); + } + + if (priv->proxy_address == NULL) + { + g_object_unref (priv->addr_enum); + priv->addr_enum = NULL; + + if (priv->dest_ips) + { + g_resolver_free_addresses (priv->dest_ips); + priv->dest_ips = NULL; + } + + continue; + } + + if (strcmp ("direct", priv->proxy_type) == 0) + { + result = priv->proxy_address; + priv->proxy_address = NULL; + continue; + } + + if (!priv->supports_hostname) + { + GInetAddress *dest_ip; + + if (!priv->dest_ips) + { + GResolver *resolver; + + resolver = g_resolver_get_default(); + priv->dest_ips = g_resolver_lookup_by_name (resolver, + priv->dest_hostname, + cancellable, + first_error ? NULL : &first_error); + g_object_unref (resolver); + + if (!priv->dest_ips) + { + g_object_unref (priv->proxy_address); + priv->proxy_address = NULL; + continue; + } + } + + if (!priv->next_dest_ip) + priv->next_dest_ip = priv->dest_ips; + + dest_ip = G_INET_ADDRESS (priv->next_dest_ip->data); + dest_hostname = g_inet_address_to_string (dest_ip); + + priv->next_dest_ip = g_list_next (priv->next_dest_ip); + } + else + { + dest_hostname = g_strdup (priv->dest_hostname); + } + + + g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address), + NULL); + + inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address); + inetaddr = g_inet_socket_address_get_address (inetsaddr); + port = g_inet_socket_address_get_port (inetsaddr); + + result = g_proxy_address_new (inetaddr, port, + priv->proxy_type, + dest_hostname, priv->dest_port, + priv->proxy_username, + priv->proxy_password); + + g_free (dest_hostname); + + if (priv->supports_hostname || priv->next_dest_ip == NULL) + { + g_object_unref (priv->proxy_address); + priv->proxy_address = NULL; + } + } + + if (result == NULL && first_error) + g_propagate_error (error, first_error); + else if (first_error) + g_error_free (first_error); + + return result; +} + + + +static void +complete_async (GProxyAddressEnumeratorPrivate *priv) +{ + GSimpleAsyncResult *simple = priv->simple; + + if (priv->cancellable) + { + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + } + + priv->simple = NULL; + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + +static void +save_result (GProxyAddressEnumeratorPrivate *priv) +{ + GSocketAddress *result; + + if (strcmp ("direct", priv->proxy_type) == 0) + { + result = priv->proxy_address; + priv->proxy_address = NULL; + } + else + { + gchar *dest_hostname; + GInetSocketAddress *inetsaddr; + GInetAddress *inetaddr; + guint16 port; + + if (!priv->supports_hostname) + { + GInetAddress *dest_ip; + + if (!priv->next_dest_ip) + priv->next_dest_ip = priv->dest_ips; + + dest_ip = G_INET_ADDRESS (priv->next_dest_ip->data); + dest_hostname = g_inet_address_to_string (dest_ip); + + priv->next_dest_ip = g_list_next (priv->next_dest_ip); + } + else + { + dest_hostname = g_strdup (priv->dest_hostname); + } + + g_return_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)); + + inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address); + inetaddr = g_inet_socket_address_get_address (inetsaddr); + port = g_inet_socket_address_get_port (inetsaddr); + + result = g_proxy_address_new (inetaddr, port, + priv->proxy_type, + dest_hostname, priv->dest_port, + priv->proxy_username, + priv->proxy_password); + + g_free (dest_hostname); + + if (priv->supports_hostname || priv->next_dest_ip == NULL) + { + g_object_unref (priv->proxy_address); + priv->proxy_address = NULL; + } + } + + g_simple_async_result_set_op_res_gpointer (priv->simple, + result, + g_object_unref); +} + +static void +dest_hostname_lookup_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + GProxyAddressEnumeratorPrivate *priv = user_data; + GSimpleAsyncResult *simple = priv->simple; + + priv->dest_ips = g_resolver_lookup_by_name_finish (G_RESOLVER (object), + result, + &error); + if (priv->dest_ips) + save_result (priv); + else + g_simple_async_result_take_error (simple, error); + + complete_async (priv); +} + +static void +address_enumerate_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + GProxyAddressEnumeratorPrivate *priv = user_data; + GSimpleAsyncResult *simple = priv->simple; + + priv->proxy_address = + g_socket_address_enumerator_next_finish (priv->addr_enum, + result, + &error); + if (priv->proxy_address) + { + if (!priv->supports_hostname && !priv->dest_ips) + { + GResolver *resolver; + resolver = g_resolver_get_default(); + g_resolver_lookup_by_name_async (resolver, + priv->dest_hostname, + priv->cancellable, + dest_hostname_lookup_cb, + priv); + g_object_unref (resolver); + return; + } + + save_result (priv); + } + else if (*priv->next_proxy) + { + g_object_unref (priv->addr_enum); + priv->addr_enum = NULL; + + if (priv->dest_ips) + { + g_resolver_free_addresses (priv->dest_ips); + priv->dest_ips = NULL; + } + + next_enumerator (priv); + + if (priv->addr_enum) + { + g_socket_address_enumerator_next_async (priv->addr_enum, + priv->cancellable, + address_enumerate_cb, + priv); + return; + } + } + + if (error) + g_simple_async_result_take_error (simple, error); + + complete_async (priv); +} + +static void +proxy_lookup_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + GProxyAddressEnumeratorPrivate *priv = user_data; + GSimpleAsyncResult *simple = priv->simple; + + priv->proxies = g_proxy_resolver_lookup_finish (G_PROXY_RESOLVER (object), + result, + &error); + priv->next_proxy = priv->proxies; + + if (error) + { + g_simple_async_result_take_error (simple, error); + } + else + { + next_enumerator (priv); + if (priv->addr_enum) + { + g_socket_address_enumerator_next_async (priv->addr_enum, + priv->cancellable, + address_enumerate_cb, + priv); + return; + } + } + + complete_async (priv); +} + +static void +g_proxy_address_enumerator_next_async (GSocketAddressEnumerator *enumerator, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GProxyAddressEnumeratorPrivate *priv = GET_PRIVATE (enumerator); + + g_return_if_fail (priv->simple == NULL); + g_return_if_fail (priv->cancellable == NULL); + + priv->simple = g_simple_async_result_new (G_OBJECT (enumerator), + callback, user_data, + g_proxy_address_enumerator_next_async); + + priv->cancellable = cancellable ? g_object_ref (cancellable) : NULL; + + if (priv->proxies == NULL) + { + GProxyResolver *resolver = g_proxy_resolver_get_default (); + g_proxy_resolver_lookup_async (resolver, + priv->dest_uri, + cancellable, + proxy_lookup_cb, + priv); + return; + } + + if (priv->addr_enum) + { + if (priv->proxy_address) + { + save_result (priv); + } + else + { + g_socket_address_enumerator_next_async (priv->addr_enum, + cancellable, + address_enumerate_cb, + priv); + return; + } + } + + g_simple_async_result_complete_in_idle (priv->simple); + + g_object_unref (priv->simple); + priv->simple = NULL; + + if (priv->cancellable) + { + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + } +} + +static GSocketAddress * +g_proxy_address_enumerator_next_finish (GSocketAddressEnumerator *enumerator, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); + GSocketAddress *address; + + if (g_simple_async_result_propagate_error (simple, error)) + return NULL; + + address = g_simple_async_result_get_op_res_gpointer (simple); + if (address) + g_object_ref (address); + + return address; +} + +static void +g_proxy_address_enumerator_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GProxyAddressEnumeratorPrivate *priv = GET_PRIVATE (object); + switch (property_id) + { + case PROP_URI: + g_value_set_string (value, priv->dest_uri); + break; + + case PROP_CONNECTABLE: + g_value_set_object (value, priv->connectable); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +g_proxy_address_enumerator_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GProxyAddressEnumeratorPrivate *priv = GET_PRIVATE (object); + switch (property_id) + { + case PROP_URI: + { + const gchar *uri; + + g_free (priv->dest_hostname); + priv->dest_hostname = NULL; + priv->dest_port = 0; + + g_free (priv->dest_uri); + priv->dest_uri = NULL; + + uri = g_value_get_string (value); + + if (uri) + { + GSocketConnectable *conn; + + conn = g_network_address_parse_uri (uri, 0, NULL); + if (conn) + { + guint port; + + priv->dest_uri = g_strdup (uri); + + g_object_get (conn, + "hostname", &priv->dest_hostname, + "port", &port, + NULL); + + priv->dest_port = port; + g_object_unref (conn); + } + else + g_warning ("Invalid URI '%s'", uri); + } + + break; + } + + case PROP_CONNECTABLE: + priv->connectable = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +g_proxy_address_enumerator_finalize (GObject *object) +{ + GProxyAddressEnumeratorPrivate *priv = GET_PRIVATE (object); + + if (priv->connectable) + g_object_unref (priv->connectable); + + g_free (priv->dest_uri); + g_free (priv->dest_hostname); + + if (priv->dest_ips) + g_resolver_free_addresses (priv->dest_ips); + + g_strfreev (priv->proxies); + + if (priv->addr_enum) + g_object_unref (priv->addr_enum); + + g_free (priv->proxy_type); + g_free (priv->proxy_username); + g_free (priv->proxy_password); + + if (priv->cancellable) + g_object_unref (priv->cancellable); + + G_OBJECT_CLASS (g_proxy_address_enumerator_parent_class)->finalize (object); +} + +static void +g_proxy_address_enumerator_init (GProxyAddressEnumerator *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + G_TYPE_PROXY_ADDRESS_ENUMERATOR, + GProxyAddressEnumeratorPrivate); +} + +static void +g_proxy_address_enumerator_class_init (GProxyAddressEnumeratorClass *proxy_enumerator_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (proxy_enumerator_class); + GSocketAddressEnumeratorClass *enumerator_class = G_SOCKET_ADDRESS_ENUMERATOR_CLASS (proxy_enumerator_class); + + g_type_class_add_private (enumerator_class, + sizeof (GProxyAddressEnumeratorPrivate)); + + object_class->set_property = g_proxy_address_enumerator_set_property; + object_class->get_property = g_proxy_address_enumerator_get_property; + object_class->finalize = g_proxy_address_enumerator_finalize; + + enumerator_class->next = g_proxy_address_enumerator_next; + enumerator_class->next_async = g_proxy_address_enumerator_next_async; + enumerator_class->next_finish = g_proxy_address_enumerator_next_finish; + + g_object_class_install_property (object_class, + PROP_URI, + g_param_spec_string ("uri", + P_("URI"), + P_("The destination URI, use none:// for generic socket"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_CONNECTABLE, + g_param_spec_object ("connectable", + P_("Connectable"), + P_("The connectable being enumerated."), + G_TYPE_SOCKET_CONNECTABLE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +} diff --git a/gio/gproxyaddressenumerator.h b/gio/gproxyaddressenumerator.h new file mode 100644 index 0000000..b38045f --- /dev/null +++ b/gio/gproxyaddressenumerator.h @@ -0,0 +1,75 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_PROXY_ADDRESS_ENUMERATOR_H__ +#define __G_PROXY_ADDRESS_ENUMERATOR_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_PROXY_ADDRESS_ENUMERATOR (g_proxy_address_enumerator_get_type ()) +#define G_PROXY_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY_ADDRESS_ENUMERATOR, GProxyAddressEnumerator)) +#define G_PROXY_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_PROXY_ADDRESS_ENUMERATOR, GProxyAddressEnumeratorClass)) +#define G_IS_PROXY_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY_ADDRESS_ENUMERATOR)) +#define G_IS_PROXY_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_PROXY_ADDRESS_ENUMERATOR)) +#define G_PROXY_ADDRESS_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_PROXY_ADDRESS_ENUMERATOR, GProxyAddressEnumeratorClass)) + +/** + * GProxyAddressEnumerator: + * + * A subclass of #GSocketAddressEnumerator that takes another address + * enumerator and wraps its results in #GProxyAddresses as + * directed by the default #GProxyResolver. + */ + +typedef struct _GProxyAddressEnumeratorClass GProxyAddressEnumeratorClass; +typedef struct _GProxyAddressEnumeratorPrivate GProxyAddressEnumeratorPrivate; + +struct _GProxyAddressEnumerator +{ + GSocketAddressEnumerator parent_instance; + GProxyAddressEnumeratorPrivate *priv; +}; + +struct _GProxyAddressEnumeratorClass +{ + GSocketAddressEnumeratorClass parent_class; + + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); + void (*_g_reserved6) (void); + void (*_g_reserved7) (void); +}; + +GType g_proxy_address_enumerator_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __G_PROXY_ADDRESS_ENUMERATOR_H__ */ diff --git a/gio/gproxyresolver.c b/gio/gproxyresolver.c new file mode 100644 index 0000000..f6b6001 --- /dev/null +++ b/gio/gproxyresolver.c @@ -0,0 +1,241 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#include "config.h" + +#include "gproxyresolver.h" + +#include +#include "glibintl.h" + +#include "gasyncresult.h" +#include "gcancellable.h" +#include "giomodule.h" +#include "giomodule-priv.h" +#include "gsimpleasyncresult.h" + +/** + * SECTION:gproxyresolver + * @short_description: Asynchronous and cancellable network proxy resolver + * @include: gio/gio.h + * + * #GProxyResolver provides synchronous and asynchronous network proxy + * resolution. #GProxyResolver is used within #GClientSocket through + * the method g_socket_connectable_proxy_enumerate(). + */ + +G_DEFINE_INTERFACE (GProxyResolver, g_proxy_resolver, G_TYPE_OBJECT) + +static void +g_proxy_resolver_default_init (GProxyResolverInterface *iface) +{ +} + +static gpointer +get_default_proxy_resolver (gpointer arg) +{ + const gchar *use_this; + GProxyResolver *resolver; + GList *l; + GIOExtensionPoint *ep; + GIOExtension *extension; + + + use_this = g_getenv ("GIO_USE_PROXY_RESOLVER"); + + /* Ensure proxy-resolver modules loaded */ + _g_io_modules_ensure_loaded (); + + ep = g_io_extension_point_lookup (G_PROXY_RESOLVER_EXTENSION_POINT_NAME); + + if (use_this) + { + extension = g_io_extension_point_get_extension_by_name (ep, use_this); + if (extension) + { + resolver = g_object_new (g_io_extension_get_type (extension), NULL); + + if (g_proxy_resolver_is_supported (resolver)) + return resolver; + + g_object_unref (resolver); + } + } + + for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next) + { + extension = l->data; + + resolver = g_object_new (g_io_extension_get_type (extension), NULL); + + if (g_proxy_resolver_is_supported (resolver)) + return resolver; + + g_object_unref (resolver); + } + + return NULL; +} + +/** + * g_proxy_resolver_get_default: + * + * Gets the default #GProxyResolver for the system. + * + * Return value: (transfer none): the default #GProxyResolver. + * + * Since: 2.26 + */ +GProxyResolver * +g_proxy_resolver_get_default (void) +{ + static GOnce once_init = G_ONCE_INIT; + + return g_once (&once_init, get_default_proxy_resolver, NULL); +} + +/** + * g_proxy_resolver_is_supported: + * @resolver: a #GProxyResolver + * + * Checks if @resolver can be used on this system. (This is used + * internally; g_proxy_resolver_get_default() will only return a proxy + * resolver that returns %TRUE for this method.) + * + * Return value: %TRUE if @resolver is supported. + * + * Since: 2.26 + */ +gboolean +g_proxy_resolver_is_supported (GProxyResolver *resolver) +{ + GProxyResolverInterface *iface; + + g_return_val_if_fail (G_IS_PROXY_RESOLVER (resolver), FALSE); + + iface = G_PROXY_RESOLVER_GET_IFACE (resolver); + + return (* iface->is_supported) (resolver); +} + +/** + * g_proxy_resolver_lookup: + * @resolver: a #GProxyResolver + * @uri: a URI representing the destination to connect to + * @cancellable: a #GCancellable, or %NULL + * @error: return location for a #GError, or %NULL + * + * Looks into the system proxy configuration to determine what proxy, + * if any, to use to connect to @uri. The returned proxy URIs are of the + * form <protocol>://[user[:password]@]host:port + * or direct://, where <protocol> could be + * http, rtsp, socks or other proxying protocol. + * + * If you don't know what network protocol is being used on the + * socket, you should use none as the URI protocol. + * In this case, the resolver might still return a generic proxy type + * (such as SOCKS), but would not return protocol-specific proxy types + * (such as http). + * + * direct:// is used when no proxy is needed. + * Direct connection should not be attempted unless it is part of the + * returned array of proxies. + * + * Return value: (transfer full) (element-type utf8): A NULL-terminated array of proxy URIs. Must be freed with + * g_strfreev(). + * + * Since: 2.26 + */ +gchar ** +g_proxy_resolver_lookup (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GError **error) +{ + GProxyResolverInterface *iface; + + g_return_val_if_fail (G_IS_PROXY_RESOLVER (resolver), NULL); + g_return_val_if_fail (uri != NULL, NULL); + + iface = G_PROXY_RESOLVER_GET_IFACE (resolver); + + return (* iface->lookup) (resolver, uri, cancellable, error); +} + +/** + * g_proxy_resolver_lookup_async: + * @resolver: a #GProxyResolver + * @uri: a URI representing the destination to connect to + * @cancellable: a #GCancellable, or %NULL + * @callback: callback to call after resolution completes + * @user_data: data for @callback + * + * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more + * details. + * + * Since: 2.26 + */ +void +g_proxy_resolver_lookup_async (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GProxyResolverInterface *iface; + + g_return_if_fail (G_IS_PROXY_RESOLVER (resolver)); + g_return_if_fail (uri != NULL); + + iface = G_PROXY_RESOLVER_GET_IFACE (resolver); + + (* iface->lookup_async) (resolver, uri, cancellable, callback, user_data); +} + +/** + * g_proxy_resolver_lookup_finish: + * @resolver: a #GProxyResolver + * @result: the result passed to your #GAsyncReadyCallback + * @error: return location for a #GError, or %NULL + * + * Call this function to obtain the array of proxy URIs when + * g_proxy_resolver_lookup_async() is complete. See + * g_proxy_resolver_lookup() for more details. + * + * Return value: (transfer full) (element-type utf8): A NULL-terminated array of proxy URIs. Must be freed with + * g_strfreev(). + * + * Since: 2.26 + */ +gchar ** +g_proxy_resolver_lookup_finish (GProxyResolver *resolver, + GAsyncResult *result, + GError **error) +{ + GProxyResolverInterface *iface; + + g_return_val_if_fail (G_IS_PROXY_RESOLVER (resolver), NULL); + + iface = G_PROXY_RESOLVER_GET_IFACE (resolver); + + return (* iface->lookup_finish) (resolver, result, error); +} diff --git a/gio/gproxyresolver.h b/gio/gproxyresolver.h new file mode 100644 index 0000000..391f902 --- /dev/null +++ b/gio/gproxyresolver.h @@ -0,0 +1,96 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_PROXY_RESOLVER_H__ +#define __G_PROXY_RESOLVER_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_PROXY_RESOLVER (g_proxy_resolver_get_type ()) +#define G_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY_RESOLVER, GProxyResolver)) +#define G_IS_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY_RESOLVER)) +#define G_PROXY_RESOLVER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_PROXY_RESOLVER, GProxyResolverInterface)) + +/** + * G_PROXY_RESOLVER_EXTENSION_POINT_NAME: + * + * Extension point for proxy resolving functionality. + * See Extending GIO. + */ +#define G_PROXY_RESOLVER_EXTENSION_POINT_NAME "gio-proxy-resolver" + +/** + * GProxyResolver: + * + * Interface that can be used to resolve proxy address. + */ +typedef struct _GProxyResolverInterface GProxyResolverInterface; + +struct _GProxyResolverInterface { + GTypeInterface g_iface; + + /* Virtual Table */ + gboolean (* is_supported) (GProxyResolver *resolver); + + gchar ** (* lookup) (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GError **error); + + void (* lookup_async) (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + + gchar ** (* lookup_finish) (GProxyResolver *resolver, + GAsyncResult *result, + GError **error); +}; + +GType g_proxy_resolver_get_type (void) G_GNUC_CONST; +GProxyResolver *g_proxy_resolver_get_default (void); + +gboolean g_proxy_resolver_is_supported (GProxyResolver *resolver); +gchar **g_proxy_resolver_lookup (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GError **error); +void g_proxy_resolver_lookup_async (GProxyResolver *resolver, + const gchar *uri, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gchar **g_proxy_resolver_lookup_finish (GProxyResolver *resolver, + GAsyncResult *result, + GError **error); + + +G_END_DECLS + +#endif /* __G_PROXY_RESOLVER_H__ */ diff --git a/gio/gregistrysettingsbackend.c b/gio/gregistrysettingsbackend.c new file mode 100644 index 0000000..3b3f20a --- /dev/null +++ b/gio/gregistrysettingsbackend.c @@ -0,0 +1,1973 @@ +/* + * Copyright © 2009-10 Sam Thursfield + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Sam Thursfield + */ + +/* GRegistryBackend implementation notes: + * + * - All settings are stored under the path: + * HKEY_CURRENT_USER\Software\GSettings\ + * This means all settings are per-user. Permissions and system-wide + * defaults are not implemented and will probably always be out of scope of + * the Windows port of GLib. + * + * - The registry type system is limited. Most GVariant types are stored as + * literals via g_variant_print/parse(). Strings are stored without the + * quotes that GVariant requires. Integer types are stored as native + * REG_DWORD or REG_QWORD. The REG_MULTI_SZ (string array) type could be + * used to avoid flattening container types. + * + * - Notifications are handled; the change event is watched for in a separate + * thread (Windows does not provide a callback API) which sends them with + * g_idle_add to the GLib main loop. The threading is done using Windows + * API functions, so there is no dependence on GThread. + * + * - Windows doesn't tell us which value has changed. This means we have to + * maintain a cache of every stored value so we can play spot the + * difference. This should not be a performance issue because if you are + * storing thousands of values in GSettings, you are probably using it + * wrong. + * + * - The cache stores the value as a registry type. Because many variants are + * stored as string representations, values which have changed equality but + * not equivalence may trigger spurious change notifications. GSettings + * users must already deal with this possibility and converting all data to + * GVariant values would be more effort. + * + * - Because we have to cache every registry value locally, reads are done + * from the cache rather than directly from the registry. Writes update + * both. This means that the backend will not work if the watch thread is + * not running. A GSettings object always subscribes to changes so we can + * be sure that the watch thread will be running, but if for some reason + * the backend is being used directly you should bear that in mind. + * + * - The registry is totally user-editable, so we are very forgiving about + * errors in the data we get. + * + * - The registry uses backslashes as path separators. GSettings keys only + * allow [A-Za-z\-] so no escaping is needed. No attempt is made to solve + * clashes between keys differing only in case. + * + * - RegCreateKeyA is used - Windows can also handle UTF16LE strings. + * GSettings doesn't pay any attention to encoding, so by using ANSI we + * hopefully avoid passing any invalid Unicode. + * + * - The Windows registry has the following limitations: a key may not exceed + * 255 characters, an entry's value may not exceed 16,383 characters, and + * all the values of a key may not exceed 65,535 characters. + * + * - Terminology: + * * in GSettings, a 'key' is eg. /desktop/gnome/background/primary-color + * * in the registry, the 'key' is path, which contains some 'values'. + * * in this file, any GSettings key is a 'key', while a registry key is + * termed a 'path', which contains 'values'. + * + * - My set of tests for this backend are currently at: + * http://gitorious.org/gsettings-gtk/gsettings-test.git + * + * - There is an undocumented function in ntdll.dll which might be more + * than RegNotifyChangeKeyValue(), NtNotifyChangeKey: + * http://source.winehq.org/source/dlls/ntdll/reg.c#L618 + * http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/Key/NtNotifyChangeKey.html + * + * - If updating the cache ever becomes a performance issue it may make sense + * to use a red-black tree, but I don't currently think it's worth the time + */ + +#include "config.h" + +#include "gregistrysettingsbackend.h" +#include "gsimplepermission.h" +#include "gsettingsbackend.h" +#include "giomodule.h" + + +#define _WIN32_WINNT 0x0500 +#define WIN32_LEAN_AND_MEAN +#include + +//#define TRACE + +/* GSettings' limit */ +#define MAX_KEY_NAME_LENGTH 32 + +/* Testing (on Windows XP SP3) shows that WaitForMultipleObjects fails with + * "The parameter is incorrect" after 64 watches. We need one for the + * message_sent cond, which is allowed for in the way the watches_remaining + * variable is used. + */ +#define MAX_WATCHES 64 + +/* A watch on one registry path and its subkeys */ +typedef struct +{ + HANDLE event; + HKEY hpath; + char *prefix; + GNode *cache_node; +} RegistryWatch; + + +/* Simple message passing for the watch thread. Not enough traffic to + * justify a queue. + */ +typedef enum +{ + WATCH_THREAD_NONE, + WATCH_THREAD_ADD_WATCH, + WATCH_THREAD_REMOVE_WATCH, + WATCH_THREAD_STOP +} WatchThreadMessageType; + +typedef struct +{ + WatchThreadMessageType type; + RegistryWatch watch; +} WatchThreadMessage; + + +typedef struct +{ + GSettingsBackend *owner; + HANDLE *thread; + + /* Details of the things we are watching. */ + int watches_remaining; + GPtrArray *events, *handles, *prefixes, *cache_nodes; + + /* Communication with the main thread. Only one message is stored at a time, + * to make sure that messages are acknowledged before being overwritten we + * create two events - one is signalled when a new message is set, the + * other is signalled by the thread when it has processed the message. + */ + WatchThreadMessage message; + CRITICAL_SECTION *message_lock; + HANDLE message_sent_event, message_received_event; +} WatchThreadState; + + +#define G_TYPE_REGISTRY_BACKEND (g_registry_backend_get_type ()) +#define G_REGISTRY_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_REGISTRY_BACKEND, GRegistryBackend)) +#define G_IS_REGISTRY_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_REGISTRY_BACKEND)) + + +typedef GSettingsBackendClass GRegistryBackendClass; + +typedef struct { + GSettingsBackend parent_instance; + + char *base_path; + + /* A stored copy of the whole tree being watched. When we receive a change notification + * we have to check against this to see what has changed ... every time ...*/ + CRITICAL_SECTION *cache_lock; + GNode *cache_root; + + WatchThreadState *watch; +} GRegistryBackend; + +G_DEFINE_TYPE_WITH_CODE (GRegistryBackend, + g_registry_backend, + G_TYPE_SETTINGS_BACKEND, + g_io_extension_point_implement (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME, + g_define_type_id, "registry", 90)) + + +/********************************************************************************** + * Utility functions + **********************************************************************************/ + +#include +static void +trace (const char *format, ...) +{ + #ifdef TRACE + va_list va; va_start (va, format); + vprintf (format, va); fflush (stdout); + va_end (va); + #endif +}; + +/* g_message including a windows error message. It is not useful to have an + * equivalent function for g_warning because none of the registry errors can + * result from programmer error (Microsoft programmers don't count), instead + * they will mostly occur from people messing with the registry by hand. */ +static void +g_message_win32_error (DWORD result_code, + const gchar *format, + ...) +{ + va_list va; + gint pos; + gchar win32_message[1024]; + + if (result_code == 0) + result_code = GetLastError (); + + va_start (va, format); + pos = g_vsnprintf (win32_message, 512, format, va); + + win32_message[pos++] = ':'; win32_message[pos++] = ' '; + + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, result_code, 0, (LPTSTR)(win32_message+pos), + 1023 - pos, NULL); + + if (result_code == ERROR_KEY_DELETED) + trace ("(%s)", win32_message); + else + g_message (win32_message); +}; + + +/* Make gsettings key into a registry path & value pair. + * + * Note that the return value *only* needs freeing - registry_value_name + * is a pointer to further inside the same block of memory. + */ +static gchar * +parse_key (const gchar *key_name, + const gchar *registry_prefix, + gchar **value_name) +{ + gchar *path_name, *c; + + /* All key paths are treated as absolute; gsettings doesn't seem to enforce a + * preceeding /. + */ + if (key_name[0] == '/') + key_name ++; + + if (registry_prefix == NULL) + path_name = g_strdup (key_name); + else + path_name = g_strjoin ("/", registry_prefix, key_name, NULL); + + /* Prefix is expected to be in registry format (\ separators) so don't escape that. */ + for (c=path_name+(registry_prefix?strlen(registry_prefix):0); *c!=0; c++) + if (*c == '/') + { + *c = '\\'; + (*value_name) = c; + } + + **value_name = 0; (*value_name)++; + return path_name; +}; + + +static DWORD +g_variant_get_as_dword (GVariant *variant) +{ + switch (g_variant_get_type_string (variant)[0]) + { + case 'b': return g_variant_get_boolean (variant); + case 'y': return g_variant_get_byte (variant); + case 'n': return g_variant_get_int16 (variant); + case 'q': return g_variant_get_uint16 (variant); + case 'i': return g_variant_get_int32 (variant); + case 'u': return g_variant_get_uint32 (variant); + default: g_warn_if_reached (); + } + return 0; +} + +static DWORDLONG +g_variant_get_as_qword (GVariant *variant) +{ + switch (g_variant_get_type_string (variant)[0]) + { + case 'x': return g_variant_get_int64 (variant); + case 't': return g_variant_get_uint64 (variant); + default: g_warn_if_reached (); + } + return 0; +} + + +static void +handle_read_error (LONG result, + const gchar *path_name, + const gchar *value_name) +{ + /* file not found means key value not set, this isn't an error for us. */ + if (result != ERROR_FILE_NOT_FOUND) + g_message_win32_error (result, "Unable to query value %s/%s: %s.\n", + path_name, value_name); +} + +/*************************************************************************** + * Cache of registry values + ***************************************************************************/ + +/* Generic container for registry values */ +typedef struct { + DWORD type; + + union { + gint dword; /* FIXME: could inline QWORD on 64-bit systems too */ + void *ptr; + }; +} RegistryValue; + +static char * +registry_value_dump (RegistryValue value) +{ + if (value.type == REG_DWORD) + return g_strdup_printf ("%i", value.dword); + else if (value.type == REG_QWORD) + return g_strdup_printf ("%I64i", value.ptr==NULL? 0: *(DWORDLONG *)value.ptr); + else if (value.type == REG_SZ) + return g_strdup_printf ("%s", (char *)value.ptr); + else if (value.type == REG_NONE) + return g_strdup_printf (""); + else + return g_strdup_printf (""); +} + +static void +registry_value_free (RegistryValue value) +{ + if (value.type == REG_SZ || value.type == REG_QWORD) + g_free (value.ptr); + value.type = REG_NONE; + value.ptr = NULL; +} + + +/* The registry cache is stored as a tree, for easy traversal. Right now we + * don't sort it in a clever way. Each node corresponds to a path element + * ('key' in registry terms) or a value. + * + * Each subscription uses the same cache. Because GSettings can subscribe to + * the tree at any node any number of times, we need to reference count the + * nodes. + */ +typedef struct +{ + /* Component of path that this node represents */ + gchar *name; + + /* If a watch is subscribed at this point (subscription_count > 0) we can + * block its next notification. This is useful because if two watches cover + * the same path, both will trigger when it changes. It also allows changes + * done by the application to be ignored by the watch thread. + */ + gint32 block_count : 8; + + /* Number of times g_settings_subscribe has been called for this location + * (I guess you can't subscribe more than 16383 times) */ + gint32 subscription_count : 14; + + gint32 ref_count : 9; + + gint32 touched : 1; + RegistryValue value; +} RegistryCacheItem; + + + +static GNode * +registry_cache_add_item (GNode *parent, + gchar *name, + RegistryValue value, + gint ref_count) +{ + RegistryCacheItem *item = g_slice_new (RegistryCacheItem); + GNode *cache_node; + + g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (parent != NULL, NULL); + + /* Ref count should be the number of watch points above this node */ + item->ref_count = ref_count; + + item->name = g_strdup (name); + item->value = value; + item->subscription_count = 0; + item->block_count = 0; + item->touched = FALSE; + trace ("\treg cache: adding %s to %s\n", name, ((RegistryCacheItem *)parent->data)->name); + + cache_node = g_node_new (item); + g_node_append (parent, cache_node); + return cache_node; +} + +/* The reference counting of cache tree nodes works like this: when a node is + * subscribed to (GSettings wants us to watch that path and everything below + * it) the reference count of that node and everything below is increased, as + * well as each parent up to the root. + */ + + +static void +_ref_down (GNode *node) +{ + RegistryCacheItem *item = node->data; + g_node_children_foreach (node, G_TRAVERSE_ALL, + (GNodeForeachFunc)_ref_down, NULL); + item->ref_count ++; +} +static void +registry_cache_ref_tree (GNode *tree) +{ + RegistryCacheItem *item = tree->data; + GNode *node = tree->parent; + + g_return_if_fail (tree != NULL); + + item->ref_count ++; + + g_node_children_foreach (tree, G_TRAVERSE_ALL, + (GNodeForeachFunc)_ref_down, NULL); + + for (node=tree->parent; node; node=node->parent) + { + item = node->data; + item->ref_count ++; + } +} + +static void +_free_cache_item (RegistryCacheItem *item) +{ + trace ("\t -- Free node %s\n", item->name); + g_free (item->name); + registry_value_free (item->value); + g_slice_free (RegistryCacheItem, item); +} + +/* Unreferencing has to be done bottom-up */ +static void +_unref_node (GNode *node) +{ + RegistryCacheItem *item = node->data; + + item->ref_count --; + + g_warn_if_fail (item->ref_count >= 0); + + if (item->ref_count == 0) + { + _free_cache_item (item); + g_node_destroy (node); + } +} + +static void +_unref_down (GNode *node) +{ + g_node_children_foreach (node, G_TRAVERSE_ALL, + (GNodeForeachFunc)_unref_down, NULL); + _unref_node (node); +} + +static void +registry_cache_unref_tree (GNode *tree) +{ + GNode *parent = tree->parent, *next_parent; + + _unref_down (tree); + + while (parent) + { + next_parent = parent->parent; + _unref_node (parent); + parent = next_parent; + } +} + + +static void +registry_cache_dump (GNode *cache_node, + gpointer data) +{ + RegistryCacheItem *item = cache_node->data; + + int depth = GPOINTER_TO_INT(data), + new_depth = depth+1, + i; + + g_return_if_fail (cache_node != NULL); + + for (i=0; iname, item->ref_count, (guint)cache_node, + registry_value_dump (item->value)); + g_node_children_foreach (cache_node, G_TRAVERSE_ALL, registry_cache_dump, + GINT_TO_POINTER (new_depth)); +} + + +typedef struct +{ + gchar *name; + GNode *result; +} RegistryCacheSearch; + +static gboolean +registry_cache_find_compare (GNode *node, + gpointer data) +{ + RegistryCacheSearch *search = data; + RegistryCacheItem *item = node->data; + + if (item == NULL) /* root node */ + return FALSE; + + g_return_val_if_fail (search->name != NULL, FALSE); + g_return_val_if_fail (item->name != NULL, FALSE); + + if (strcmp (search->name, item->name) == 0) + { + search->result = node; + return TRUE; + } + return FALSE; +} + +static GNode * +registry_cache_find_immediate_child (GNode *node, + gchar *name) +{ + RegistryCacheSearch search; + search.result = NULL; + search.name = name; + g_node_traverse (node, G_POST_ORDER, G_TRAVERSE_ALL, 2, + registry_cache_find_compare, &search); + return search.result; +} + + +static GNode * +registry_cache_get_node_for_key_recursive (GNode *node, + gchar *key_name, + gboolean create_if_not_found, + gint n_parent_watches) +{ + RegistryCacheItem *item; + gchar *component = key_name, + *c = strchr (component, '/'); + GNode *child; + + if (c != NULL) + *c = 0; + + /* We count up how many watch points we travel through finding this node, + * because a new node should have as many references as there are watches at + * points above it in the tree. + */ + item = node->data; + if (item->subscription_count > 0) + n_parent_watches ++; + + child = registry_cache_find_immediate_child (node, component); + if (child == NULL && create_if_not_found) + { + item = g_slice_new (RegistryCacheItem); + item->name = g_strdup (component); + item->value.type = REG_NONE; + item->value.ptr = NULL; + item->ref_count = n_parent_watches; + child = g_node_new (item); + g_node_append (node, child); + trace ("\tget node for key recursive: new %x = %s.\n", node, item->name); + } + + /* We are done if there are no more path components. Allow for a trailing /. */ + if (child==NULL || c == NULL || *(c+1)==0) + return child; + else + { + trace ("get node for key recursive: next: %s.\n", c+1); + return registry_cache_get_node_for_key_recursive + (child, c+1, create_if_not_found, n_parent_watches); + } +} + +/* Look up a GSettings key in the cache. */ +static GNode * +registry_cache_get_node_for_key (GNode *root, + const gchar *key_name, + gboolean create_if_not_found) +{ + GNode *child = NULL, + *result = NULL; + gchar *component, *c; + + g_return_val_if_fail (key_name != NULL, NULL); + + if (key_name[0] == '/') + key_name ++; + + /* Ignore preceeding / */ + component = g_strdup (key_name); + c = strchr (component, '/'); + if (c != NULL) + *c = 0; + + child = registry_cache_find_immediate_child (root, component); + if (child == NULL && create_if_not_found) + { + /* Reference count is set to 0, tree should be referenced by the caller */ + RegistryCacheItem *item = g_slice_new (RegistryCacheItem); + item->value.type = REG_NONE; + item->value.ptr = NULL; + item->name = g_strdup (component); + item->ref_count = 0; + trace ("get_node_for_key: New node for component '%s'\n", item->name); + child = g_node_new (item); + g_node_append (root, child); + } + + if (c == NULL) + result = root; + else if (*(c+1)==0) + result = child; + else if (child != NULL) + result = registry_cache_get_node_for_key_recursive (child, c+1, create_if_not_found, 0); + + g_free (component); + + return result; +} + +/* Check the cache node against the registry key it represents. Return TRUE if + * they differ, and update the cache with the new value. + */ +static gboolean +registry_cache_update_node (GNode *cache_node, + RegistryValue registry_value) +{ + RegistryCacheItem *cache_item = cache_node->data; + + g_return_val_if_fail (cache_node != NULL, FALSE); + g_return_val_if_fail (cache_item != NULL, FALSE); + + if (registry_value.type != cache_item->value.type) + { + /* The type has changed. Update cache item and register it as changed. + * Either the schema has changed and this is entirely legitimate, or + * whenever the app reads the key it will get the default value due to + * the type mismatch. + */ + cache_item->value = registry_value; + return TRUE; + } + + switch (registry_value.type) + { + case REG_DWORD: + { + if (cache_item->value.dword == registry_value.dword) + return FALSE; + else + { + cache_item->value.dword = registry_value.dword; + return TRUE; + } + } + case REG_QWORD: + { + g_return_val_if_fail (registry_value.ptr != NULL && + cache_item->value.ptr != NULL, FALSE); + + if (memcmp (registry_value.ptr, cache_item->value.ptr, 8)==0) + { + g_free (registry_value.ptr); + return FALSE; + } + else + { + g_free (cache_item->value.ptr); + cache_item->value.ptr = registry_value.ptr; + return TRUE; + } + } + case REG_SZ: + { + /* Value should not exist if it is NULL, an empty string is "" */ + g_return_val_if_fail (cache_item->value.ptr != NULL, FALSE); + g_return_val_if_fail (registry_value.ptr != NULL, FALSE); + + if (strcmp (registry_value.ptr, cache_item->value.ptr) == 0) + { + g_free (registry_value.ptr); + return FALSE; + } + else + { + g_free (cache_item->value.ptr); + cache_item->value.ptr = registry_value.ptr; + return TRUE; + } + } + default: + g_warning ("gregistrybackend: registry_cache_update_node: Unhandled value type :("); + return FALSE; + } +} + +/* Blocking notifications is a useful optimisation. When a change is made + * through GSettings we update the cache manually, but a notifcation is + * triggered as well. This function is also used for nested notifications, + * eg. if /test and /test/foo are watched, and /test/foo/value is changed then + * we will get notified both for /test/foo and /test and it is helpful to block + * the second. + */ +static void +registry_cache_block_notification (GNode *node) +{ + RegistryCacheItem *item = node->data; + + g_return_if_fail (node != NULL); + + if (item->subscription_count > 0) + item->block_count ++; + + if (node->parent != NULL) + registry_cache_block_notification (node->parent); +} + +static void +registry_cache_destroy_tree (GNode *node, + WatchThreadState *self); + +/*************************************************************************** + * Reading and writing + ***************************************************************************/ + +static gboolean +registry_read (HKEY hpath, + const gchar *path_name, + const gchar *value_name, + RegistryValue *p_value) +{ + LONG result; + DWORD value_data_size; + gpointer *buffer; + + g_return_val_if_fail (p_value != NULL, FALSE); + + p_value->type = REG_NONE; + p_value->ptr = NULL; + + result = RegQueryValueExA (hpath, value_name, 0, &p_value->type, NULL, &value_data_size); + if (result != ERROR_SUCCESS) + { + handle_read_error (result, path_name, value_name); + return FALSE; + } + + if (p_value->type == REG_SZ && value_data_size == 0) + { + p_value->ptr = g_strdup (""); + return TRUE; + } + + if (p_value->type == REG_DWORD) + /* REG_DWORD is inlined */ + buffer = (void *)&p_value->dword; + else + buffer = p_value->ptr = g_malloc (value_data_size); + + result = RegQueryValueExA (hpath, value_name, 0, NULL, (LPBYTE)buffer, &value_data_size); + if (result != ERROR_SUCCESS) + { + handle_read_error (result, path_name, value_name); + return FALSE; + } + + return TRUE; +} + + +static GVariant * +g_registry_backend_read (GSettingsBackend *backend, + const gchar *key_name, + const GVariantType *expected_type, + gboolean default_value) +{ + GRegistryBackend *self = G_REGISTRY_BACKEND (backend); + + GNode *cache_node; + RegistryValue registry_value; + GVariant *gsettings_value = NULL; + gchar *gsettings_type; + + g_return_val_if_fail (expected_type != NULL, NULL); + + if (default_value) + return NULL; + + /* Simply read from the cache, which is updated from the registry by the + * watch thread as soon as changes can propagate. Any changes not yet in the + * cache will have the 'changed' signal emitted after this function returns. + */ + EnterCriticalSection (self->cache_lock); + cache_node = registry_cache_get_node_for_key (self->cache_root, key_name, FALSE); + LeaveCriticalSection (self->cache_lock); + + trace ("Reading key %s, cache node %x\n", key_name, cache_node); + + /* Maybe it's not set, we can return to default */ + if (cache_node == NULL) + return NULL; + + trace ("\t- cached value %s\n", registry_value_dump (((RegistryCacheItem *)cache_node->data)->value)); + + registry_value = ((RegistryCacheItem *)cache_node->data)->value; + + gsettings_type = g_variant_type_dup_string (expected_type); + + /* The registry is user-editable, so we need to be fault-tolerant here. */ + switch (gsettings_type[0]) + { + case 'b': case 'y': case 'n': case 'q': case 'i': case 'u': + if (registry_value.type == REG_DWORD) + gsettings_value = g_variant_new (gsettings_type, registry_value.dword); + break; + + case 't': case 'x': + if (registry_value.type == REG_QWORD) + { + DWORDLONG qword_value = *(DWORDLONG *)registry_value.ptr; + gsettings_value = g_variant_new (gsettings_type, qword_value); + } + break; + + default: + if (registry_value.type == REG_SZ) + { + if (gsettings_type[0]=='s') + gsettings_value = g_variant_new_string ((char *)registry_value.ptr); + else + { + GError *error = NULL; + gsettings_value = g_variant_parse (expected_type, registry_value.ptr, NULL, NULL, &error); + + if (error != NULL) + g_message ("gregistrysettingsbackend: error parsing key %s: %s\n", + key_name, error->message); + } + } + break; + } + + g_free (gsettings_type); + + return gsettings_value; +} + + +typedef struct +{ + GRegistryBackend *self; + HKEY hroot; +} RegistryWrite; + +static gboolean +g_registry_backend_write_one (const char *key_name, + GVariant *variant, + gpointer user_data) +{ + GRegistryBackend *self; + RegistryWrite *action; + RegistryValue value; + + HKEY hroot, hpath; + gchar *path_name, *value_name = NULL; + DWORD value_data_size; + LPVOID value_data; + LONG result; + + GNode *node; + gboolean changed; + + const gchar *type_string = g_variant_get_type_string (variant); + + action = user_data; + self = G_REGISTRY_BACKEND (action->self); + hroot = action->hroot; + + value.type = REG_NONE; + value.ptr = NULL; + + switch (type_string[0]) + { + case 'b': case 'y': case 'n': case 'q': case 'i': case 'u': + value.type = REG_DWORD; + value.dword = g_variant_get_as_dword (variant); + value_data_size = 4; + value_data = &value.dword; + break; + + case 'x': case 't': + value.type = REG_QWORD; + value.ptr = g_malloc (8); + *(DWORDLONG *)value.ptr = g_variant_get_as_qword (variant); + value_data_size = 8; + value_data = value.ptr; + break; + + default: + value.type = REG_SZ; + if (type_string[0]=='s') + { + gsize length; + value.ptr = g_strdup (g_variant_get_string (variant, &length)); + value_data_size = length + 1; + value_data = value.ptr; + } + else + { + GString *value_string; + value_string = g_variant_print_string (variant, NULL, FALSE); + value_data_size = value_string->len+1; + value.ptr = value_data = g_string_free (value_string, FALSE); + } + break; + } + + /* First update the cache, because the value may not have changed and we can + * save a write. + * + * If 'value' has changed then its memory will not be freed by update_node(), + * because it will be stored in the node. + */ + EnterCriticalSection (self->cache_lock); + node = registry_cache_get_node_for_key (self->cache_root, key_name, TRUE); + changed = registry_cache_update_node (node, value); + LeaveCriticalSection (self->cache_lock); + + if (!changed) + return FALSE; + + /* Block the next notification to any watch points above this location, + * because they will each get triggered on a change that is already updated + * in the cache. + */ + registry_cache_block_notification (node); + + path_name = parse_key (key_name, NULL, &value_name); + + trace ("Set key: %s / %s\n", path_name, value_name); + + /* Store the value in the registry */ + result = RegCreateKeyExA (hroot, path_name, 0, NULL, 0, KEY_WRITE, NULL, &hpath, NULL); + if (result != ERROR_SUCCESS) + { + g_message_win32_error (result, "gregistrybackend: opening key %s failed", path_name+1); + registry_value_free (value); + g_free (path_name); + return FALSE; + } + + result = RegSetValueExA (hpath, value_name, 0, value.type, value_data, value_data_size); + if (result != ERROR_SUCCESS) + g_message_win32_error (result, "gregistrybackend: setting value %s\\%s\\%s failed.\n", + self->base_path, path_name, value_name); + + /* If the write fails then it will seem like the value has changed until the + * next execution (because we wrote to the cache first). There's no reason + * for it to fail unless something is weirdly broken, however. + */ + + RegCloseKey (hpath); + g_free (path_name); + + return FALSE; +}; + +/* The dconf write policy is to do the write while making out it succeeded, + * and then backtrack if it didn't. The registry functions are synchronous so + * we can't do that. */ + +static gboolean +g_registry_backend_write (GSettingsBackend *backend, + const gchar *key_name, + GVariant *value, + gpointer origin_tag) +{ + GRegistryBackend *self = G_REGISTRY_BACKEND (backend); + LONG result; + HKEY hroot; + RegistryWrite action; + + result = RegCreateKeyExA (HKEY_CURRENT_USER, self->base_path, 0, NULL, 0, + KEY_WRITE, NULL, &hroot, NULL); + if (result != ERROR_SUCCESS) { + trace ("Error opening/creating key %s.\n", self->base_path); + return FALSE; + } + + action.self = self; + action.hroot = hroot; + g_registry_backend_write_one (key_name, value, &action); + g_settings_backend_changed (backend, key_name, origin_tag); + + RegCloseKey (hroot); + + return TRUE; +} + +static gboolean +g_registry_backend_write_tree (GSettingsBackend *backend, + GTree *values, + gpointer origin_tag) +{ + GRegistryBackend *self = G_REGISTRY_BACKEND (backend); + LONG result; + HKEY hroot; + RegistryWrite action; + + result = RegCreateKeyExA (HKEY_CURRENT_USER, self->base_path, 0, NULL, 0, + KEY_WRITE, NULL, &hroot, NULL); + if (result != ERROR_SUCCESS) { + trace ("Error opening/creating key %s.\n", self->base_path); + return FALSE; + } + + action.self = self; + action.hroot = hroot; + g_tree_foreach (values, (GTraverseFunc)g_registry_backend_write_one, + &action); + + g_settings_backend_changed_tree (backend, values, origin_tag); + RegCloseKey (hroot); + + return TRUE; +} + +static void +g_registry_backend_reset (GSettingsBackend *backend, + const gchar *key_name, + gpointer origin_tag) +{ + GRegistryBackend *self = G_REGISTRY_BACKEND (backend); + gchar *path_name, *value_name = NULL; + GNode *cache_node; + LONG result; + HKEY hpath; + + /* Remove from cache */ + EnterCriticalSection (self->cache_lock); + cache_node = registry_cache_get_node_for_key (self->cache_root, key_name, FALSE); + if (cache_node) + registry_cache_destroy_tree (cache_node, self->watch); + LeaveCriticalSection (self->cache_lock); + + /* Remove from the registry */ + path_name = parse_key (key_name, self->base_path, &value_name); + + result = RegOpenKeyExA (HKEY_CURRENT_USER, path_name, 0, KEY_SET_VALUE, &hpath); + if (result != ERROR_SUCCESS) + { + g_message_win32_error (result, "Registry: resetting key '%s'", path_name); + g_free (path_name); + return; + } + + result = RegDeleteValueA (hpath, value_name); + RegCloseKey (hpath); + + if (result != ERROR_SUCCESS) + { + g_message_win32_error (result, "Registry: resetting key '%s'", path_name); + g_free (path_name); + return; + } + + g_free (path_name); + + + g_settings_backend_changed (backend, key_name, origin_tag); +} + +/* Not implemented and probably beyond the scope of this backend */ +static gboolean +g_registry_backend_get_writable (GSettingsBackend *backend, + const gchar *key_name) +{ + return TRUE; +} + +static GPermission * +g_registry_backend_get_permission (GSettingsBackend *backend, + const gchar *key_name) +{ + return g_simple_permission_new (TRUE); +} + + +/******************************************************************************** + * Spot-the-difference engine + ********************************************************************************/ + +static void +_free_watch (WatchThreadState *self, + gint index, + GNode *cache_node); + +static void +registry_cache_item_reset_touched (GNode *node, + gpointer data) +{ + RegistryCacheItem *item = node->data; + item->touched = FALSE; +} + +/* Delete a node and any children, for when it has been deleted from the registry */ +static void +registry_cache_destroy_tree (GNode *node, + WatchThreadState *self) +{ + RegistryCacheItem *item = node->data; + + g_node_children_foreach (node, G_TRAVERSE_ALL, + (GNodeForeachFunc)registry_cache_destroy_tree, self); + + if (item->subscription_count > 0) + { + gint i; + /* There must be some watches active if this node is a watch point */ + g_warn_if_fail (self->cache_nodes->len > 1); + + /* This is a watch point that has been deleted. Let's free the watch! */ + for (i=1; icache_nodes->len; i++) + if (g_ptr_array_index (self->cache_nodes, i) == node) + break; + if (i >= self->cache_nodes->len) + g_warning ("watch thread: a watch point was deleted, but unable to " + "find '%s' in the list of %i watch nodes\n", item->name, + self->cache_nodes->len-1); + else + { + _free_watch (self, i, node); + g_atomic_int_inc (&self->watches_remaining); + } + } + _free_cache_item (node->data); + g_node_destroy (node); +} + +static void +registry_cache_remove_deleted (GNode *node, + gpointer data) +{ + RegistryCacheItem *item = node->data; + + if (!item->touched) + registry_cache_destroy_tree (node, data); +} + +/* Update cache from registry, and optionally report on the changes. + * + * This function is sometimes called from the watch thread, with no locking. It + * does call g_registry_backend functions, but this is okay because they only + * access self->base which is constant. + * + * When looking at this code bear in mind the terminology: in the registry, keys + * are containers that contain values, and other keys. Keys have a 'default' + * value which we always ignore. + * + * n_parent_watches: a counter used to set the reference count of any new nodes + * that are created - they should have as many references as + * there are notifications that are watching them. + */ +static void +registry_cache_update (GRegistryBackend *self, + HKEY hpath, + const gchar *prefix, + const gchar *partial_key_name, + GNode *cache_node, + int n_watches, + GPtrArray *changes) +{ + gchar buffer[MAX_KEY_NAME_LENGTH + 1]; + gchar *key_name; + gint i; + LONG result; + + RegistryCacheItem *item = cache_node->data; + + if (item->subscription_count > 0) + n_watches ++; + + /* prefix is the level that all changes occur below; partial_key_name should + * be NULL on the first call to this function */ + key_name = g_build_path ("/", prefix, partial_key_name, NULL); + + trace ("registry cache update: %s. Node %x has %i children\n", key_name, + cache_node, g_node_n_children (cache_node)); + + /* Start by zeroing 'touched' flag. When the registry traversal is done, any untouched nodes + * must have been deleted from the registry. + */ + g_node_children_foreach (cache_node, G_TRAVERSE_ALL, + registry_cache_item_reset_touched, NULL); + + /* Recurse into each subpath at the current level, if any */ + i = 0; + while (1) + { + DWORD buffer_size = MAX_KEY_NAME_LENGTH; + HKEY hsubpath; + + result = RegEnumKeyEx (hpath, i++, buffer, &buffer_size, NULL, NULL, NULL, NULL); + if (result != ERROR_SUCCESS) + break; + + result = RegOpenKeyEx (hpath, buffer, 0, KEY_READ, &hsubpath); + if (result == ERROR_SUCCESS) + { + GNode *subkey_node; + RegistryCacheItem *child_item; + + subkey_node = registry_cache_find_immediate_child (cache_node, buffer); + if (subkey_node == NULL) + { + RegistryValue null_value = {REG_NONE, {0}}; + subkey_node = registry_cache_add_item (cache_node, buffer, + null_value, n_watches); + } + + + registry_cache_update (self, hsubpath, prefix, buffer, subkey_node, + n_watches, changes); + child_item = subkey_node->data; + child_item->touched = TRUE; + } + RegCloseKey (hsubpath); + } + + if (result != ERROR_NO_MORE_ITEMS) + g_message_win32_error (result, "gregistrybackend: error enumerating subkeys for cache."); + + /* Enumerate each value at 'path' and check if it has changed */ + i = 0; + while (1) + { + DWORD buffer_size = MAX_KEY_NAME_LENGTH; + GNode *cache_child_node; + RegistryCacheItem *child_item; + RegistryValue value; + gboolean changed = FALSE; + + result = RegEnumValue (hpath, i++, buffer, &buffer_size, NULL, NULL, NULL, NULL); + if (result != ERROR_SUCCESS) + break; + + if (buffer[0]==0) + /* This is the key's 'default' value, for which we have no use. */ + continue; + + cache_child_node = registry_cache_find_immediate_child (cache_node, buffer); + + if (!registry_read (hpath, key_name, buffer, &value)) + continue; + + trace ("\tgot value %s for %s, node %x\n", registry_value_dump (value), buffer, cache_child_node); + + if (cache_child_node == NULL) + { + /* This is a new value */ + cache_child_node = registry_cache_add_item (cache_node, buffer, value, + n_watches); + changed = TRUE; + } + else + { + /* For efficiency, instead of converting every value back to a GVariant to + * compare it, we compare them as registry values (integers, or string + * representations of the variant). The spurious change notifications that may + * result should not be a big issue. + * + * Note that 'value' is swallowed or freed. + */ + changed = registry_cache_update_node (cache_child_node, value); + } + + child_item = cache_child_node->data; + child_item->touched = TRUE; + if (changed == TRUE && changes != NULL) + { + gchar *item; + if (partial_key_name == NULL) + item = g_strdup (buffer); + else + item = g_build_path ("/", partial_key_name, buffer, NULL); + g_ptr_array_add (changes, item); + } + } + + if (result != ERROR_NO_MORE_ITEMS) + g_message_win32_error (result, "gregistrybackend: error enumerating values for cache"); + + /* Any nodes now left untouched must have been deleted, remove them from cache */ + g_node_children_foreach (cache_node, G_TRAVERSE_ALL, + registry_cache_remove_deleted, self->watch); + + trace ("registry cache update complete.\n"); + g_free (key_name); +}; + + + +/*********************************************************************************** + * Thread to watch for registry change events + ***********************************************************************************/ + +/* Called by watch thread. Apply for notifications on a registry key and its subkeys. */ +static DWORD +registry_watch_key (HKEY hpath, HANDLE event) +{ + return RegNotifyChangeKeyValue (hpath, TRUE, + REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_LAST_SET, + event, TRUE); +} + + +/* One of these is sent down the pipe when something happens in the registry. */ +typedef struct +{ + GRegistryBackend *self; + gchar *prefix; /* prefix is a gsettings path, all items are subkeys of this. */ + GPtrArray *items; /* each item is a subkey below prefix that has changed. */ +} RegistryEvent; + +/* This handler runs in the main thread to emit the changed signals */ +static gboolean +watch_handler (RegistryEvent *event) +{ + gint i; + trace ("Watch handler: got event in %s, items %i.\n", event->prefix, event->items->len); + + /* GSettings requires us to NULL-terminate the array. */ + g_ptr_array_add (event->items, NULL); + g_settings_backend_keys_changed (G_SETTINGS_BACKEND (event->self), event->prefix, + (gchar const **)event->items->pdata, NULL); + + for (i=0; iitems->len; i++) + g_free (g_ptr_array_index (event->items, i)); + g_ptr_array_free (event->items, TRUE); + + g_free (event->prefix); + g_object_unref (event->self); + + g_slice_free (RegistryEvent, event); + return FALSE; +}; + + +static void +_free_watch (WatchThreadState *self, + gint index, + GNode *cache_node) +{ + HKEY hpath; + HANDLE cond; + gchar *prefix; + + g_return_if_fail (index > 0 && index < self->events->len); + + cond = g_ptr_array_index (self->events, index); + hpath = g_ptr_array_index (self->handles, index); + prefix = g_ptr_array_index (self->prefixes, index); + + trace ("Freeing watch %i [%s]\n", index, prefix); + + /* These can be NULL if the watch was already dead, this can happen when eg. + * a key is deleted but GSettings is still subscribed to it - the watch is + * kept alive so that the unsubscribe function works properly, but does not + * do anything. + */ + if (hpath != NULL) + RegCloseKey (hpath); + + if (cache_node != NULL) + { + //registry_cache_dump (G_REGISTRY_BACKEND (self->owner)->cache_root, NULL); + registry_cache_unref_tree (cache_node); + } + + CloseHandle (cond); + g_free (prefix); + + /* As long as we remove from each array at the same time, it doesn't matter that + * their orders get messed up - they all get messed up the same. + */ + g_ptr_array_remove_index_fast (self->handles, index); + g_ptr_array_remove_index_fast (self->events, index); + g_ptr_array_remove_index_fast (self->prefixes, index); + g_ptr_array_remove_index_fast (self->cache_nodes, index); +} + +static void +watch_thread_handle_message (WatchThreadState *self) +{ + switch (self->message.type) + { + case WATCH_THREAD_NONE: + trace ("watch thread: you woke me up for nothin', man!"); + break; + + case WATCH_THREAD_ADD_WATCH: + { + RegistryWatch *watch = &self->message.watch; + LONG result; + result = registry_watch_key (watch->hpath, watch->event); + if (result == ERROR_SUCCESS) + { + g_ptr_array_add (self->events, watch->event); + g_ptr_array_add (self->handles, watch->hpath); + g_ptr_array_add (self->prefixes, watch->prefix); + g_ptr_array_add (self->cache_nodes, watch->cache_node); + trace ("watch thread: new watch on %s, %i total\n", watch->prefix, + self->events->len); + } + else + { + g_message_win32_error (result, "watch thread: could not watch %s", watch->prefix); + CloseHandle (watch->event); + RegCloseKey (watch->hpath); + g_free (watch->prefix); + registry_cache_unref_tree (watch->cache_node); + } + break; + } + + case WATCH_THREAD_REMOVE_WATCH: + { + GNode *cache_node; + RegistryCacheItem *cache_item; + gint i; + + for (i=1; iprefixes->len; i++) + if (strcmp (g_ptr_array_index (self->prefixes, i), + self->message.watch.prefix) == 0) + break; + + if (i >= self->prefixes->len) + { + /* Don't make a fuss if the prefix is not being watched because + * maybe the path was deleted so we removed the watch. + */ + trace ("unsubscribe: prefix %s is not being watched [%i things are]!\n", + self->message.watch.prefix, self->prefixes->len); + g_free (self->message.watch.prefix); + break; + } + + cache_node = g_ptr_array_index (self->cache_nodes, i); + + trace ("watch thread: unsubscribe: freeing node %x, prefix %s, index %i\n", + (guint)cache_node, self->message.watch.prefix, i); + if (cache_node != NULL) + { + cache_item = cache_node->data; + + /* There may be more than one GSettings object subscribed to this + * path, only free the watch when the last one unsubscribes. + */ + cache_item->subscription_count --; + if (cache_item->subscription_count > 0) + break; + } + + _free_watch (self, i, cache_node); + g_free (self->message.watch.prefix); + + g_atomic_int_inc (&self->watches_remaining); + break; + } + + case WATCH_THREAD_STOP: + { + gint i; + + /* Free any remaining cache and watch handles */ + for (i=1; ievents->len; i++) + _free_watch (self, i, g_ptr_array_index (self->cache_nodes, i)); + + SetEvent (self->message_received_event); + ExitThread (0); + } + } + + self->message.type = WATCH_THREAD_NONE; + SetEvent (self->message_received_event); +} + + +/* Thread which watches for win32 registry events */ +static DWORD WINAPI +watch_thread_function (LPVOID parameter) +{ + WatchThreadState *self = (WatchThreadState *)parameter; + DWORD result; + + self->events = g_ptr_array_new (); + self->handles = g_ptr_array_new (); + self->prefixes = g_ptr_array_new (); + self->cache_nodes = g_ptr_array_new (); + g_ptr_array_add (self->events, self->message_sent_event); + g_ptr_array_add (self->handles, NULL); + g_ptr_array_add (self->prefixes, NULL); + g_ptr_array_add (self->cache_nodes, NULL); + + while (1) + { + trace ("watch thread: going to sleep; %i events watched.\n", self->events->len); + result = WaitForMultipleObjects (self->events->len, self->events->pdata, FALSE, INFINITE); + + if (result == WAIT_OBJECT_0) + { + /* A message to you. The sender (main thread) will block until we signal the received + * event, so there should be no danger of it sending another before we receive the + * first. + */ + watch_thread_handle_message (self); + } + else if (result > WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + self->events->len) + { + HKEY hpath; + HANDLE cond; + gchar *prefix; + GNode *cache_node; + RegistryCacheItem *cache_item; + RegistryEvent *event; + + /* One of our notifications has triggered. All we know is which one, and which key + * this is for. We do most of the processing here, because we may as well. If the + * registry changes further while we are processing it doesn't matter - we will then + * receive another change notification from the OS anyway. + */ + gint notify_index = result - WAIT_OBJECT_0; + hpath = g_ptr_array_index (self->handles, notify_index); + cond = g_ptr_array_index (self->events, notify_index); + prefix = g_ptr_array_index (self->prefixes, notify_index); + cache_node = g_ptr_array_index (self->cache_nodes, notify_index); + + trace ("Watch thread: notify received on prefix %i: %s.\n", notify_index, prefix); + + if (cache_node == NULL) + { + /* This path has been deleted */ + trace ("Notify received on a path that was deleted :(\n"); + continue; + } + + /* Firstly we need to reapply for the notification, because (what a + * sensible API) we won't receive any more. MSDN is pretty + * inconsistent on this matter: + * http://msdn.microsoft.com/en-us/library/ms724892%28VS.85%29.aspx + * http://support.microsoft.com/kb/236570 + * But my tests (on Windows XP SP3) show that we need to reapply + * each time. + */ + result = registry_watch_key (hpath, cond); + + if (result != ERROR_SUCCESS) + { + /* Watch failed, most likely because the key has just been + * deleted. Free the watch and unref the cache nodes. + */ + if (result != ERROR_KEY_DELETED) + g_message_win32_error (result, "watch thread: failed to watch %s", prefix); + _free_watch (self, notify_index, cache_node); + g_atomic_int_inc (&self->watches_remaining); + continue; + } + + /* The notification may have been blocked because we just changed + * some data ourselves. + */ + cache_item = cache_node->data; + if (cache_item->block_count) + { + cache_item->block_count --; + trace ("Watch thread: notify blocked at %s\n", prefix); + continue; + } + + /* Now we update our stored cache from registry data, and find which keys have + * actually changed. If more changes happen while we are processing, we will get + * another event because we have reapplied for change notifications already. + * + * Working here rather than in the main thread is preferable because the UI is less + * likely to block (only when changing notification subscriptions). + */ + event = g_slice_new (RegistryEvent); + + event->self = G_REGISTRY_BACKEND (self->owner); + g_object_ref (self->owner); + + event->items = g_ptr_array_new (); + + EnterCriticalSection (G_REGISTRY_BACKEND (self->owner)->cache_lock); + registry_cache_update (G_REGISTRY_BACKEND (self->owner), hpath, + prefix, NULL, cache_node, 0, event->items); + LeaveCriticalSection (G_REGISTRY_BACKEND (self->owner)->cache_lock); + + if (event->items->len > 0) + { + event->prefix = g_strdup (prefix); + g_idle_add ((GSourceFunc) watch_handler, event); + } + else + { + g_ptr_array_free (event->items, TRUE); + g_slice_free (RegistryEvent, event); + } + } + else + { + /* God knows what has happened */ + g_message_win32_error (GetLastError(), "watch thread: WaitForMultipleObjects error"); + } + } + + return -1; +} + +static gboolean +watch_start (GRegistryBackend *self) +{ + WatchThreadState *watch; + + g_return_val_if_fail (self->watch == NULL, FALSE); + + self->cache_lock = g_slice_new (CRITICAL_SECTION); + InitializeCriticalSection (self->cache_lock); + + watch = g_slice_new (WatchThreadState); + watch->owner = G_SETTINGS_BACKEND (self); + + watch->watches_remaining = MAX_WATCHES; + + watch->message_lock = g_slice_new (CRITICAL_SECTION); + InitializeCriticalSection (watch->message_lock); + watch->message_sent_event = CreateEvent (NULL, FALSE, FALSE, NULL); + watch->message_received_event = CreateEvent (NULL, FALSE, FALSE, NULL); + if (watch->message_sent_event == NULL || watch->message_received_event == NULL) + { + g_message_win32_error (0, "gregistrybackend: Failed to create sync objects."); + goto fail_1; + } + + /* Use a small stack to make the thread more lightweight. */ + watch->thread = CreateThread (NULL, 1024, watch_thread_function, watch, 0, NULL); + if (watch->thread == NULL) + { + g_message_win32_error (0, "gregistrybackend: Failed to create notify watch thread."); + goto fail_2; + } + + self->watch = watch; + + return TRUE; + +fail_2: + DeleteCriticalSection (self->cache_lock); + g_slice_free (CRITICAL_SECTION, self->cache_lock); + DeleteCriticalSection (watch->message_lock); + g_slice_free (CRITICAL_SECTION, watch->message_lock); + CloseHandle (watch->message_sent_event); + CloseHandle (watch->message_received_event); +fail_1: + g_slice_free (WatchThreadState, watch); + return FALSE; +} + +/* This function assumes you hold the message lock! */ +static void +watch_stop_unlocked (GRegistryBackend *self) +{ + WatchThreadState *watch = self->watch; + DWORD result; + g_return_if_fail (watch != NULL); + + watch->message.type = WATCH_THREAD_STOP; + SetEvent (watch->message_sent_event); + + /* This is signalled as soon as the message is received. We must not return + * while the watch thread is still firing off callbacks. Freeing all of the + * memory is done in the watch thread after this is signalled. + */ + result = WaitForSingleObject (watch->message_received_event, INFINITE); + if (result != WAIT_OBJECT_0) + { + g_warning ("gregistrybackend: unable to stop watch thread."); + return; + } + + LeaveCriticalSection (watch->message_lock); + DeleteCriticalSection (watch->message_lock); + DeleteCriticalSection (self->cache_lock); + g_slice_free (CRITICAL_SECTION, watch->message_lock); + g_slice_free (CRITICAL_SECTION, self->cache_lock); + CloseHandle (watch->message_sent_event); + CloseHandle (watch->message_received_event); + CloseHandle (watch->thread); + g_slice_free (WatchThreadState, watch); + + trace ("\nwatch thread: %x: all data freed.\n", self); + self->watch = NULL; +}; + +static gboolean +watch_add_notify (GRegistryBackend *self, + HANDLE event, + HKEY hpath, + gchar *gsettings_prefix) +{ + WatchThreadState *watch = self->watch; + GNode *cache_node; + RegistryCacheItem *cache_item; + DWORD result; + + g_return_val_if_fail (watch != NULL, FALSE); + trace ("watch_add_notify: prefix %s.\n", gsettings_prefix); + + /* Duplicate tree into the cache in the main thread, before we add the notify: if we do it in the + * thread we can miss changes while we are caching. + */ + EnterCriticalSection (self->cache_lock); + cache_node = registry_cache_get_node_for_key (self->cache_root, gsettings_prefix, TRUE); + + g_return_val_if_fail (cache_node != NULL, FALSE); + g_return_val_if_fail (cache_node->data != NULL, FALSE); + + cache_item = cache_node->data; + + cache_item->subscription_count ++; + if (cache_item->subscription_count > 1) + { + trace ("watch_add_notify: prefix %s already watched, %i subscribers.\n", + gsettings_prefix, cache_item->subscription_count); + return FALSE; + } + + registry_cache_ref_tree (cache_node); + registry_cache_update (self, hpath, gsettings_prefix, NULL, cache_node, 0, NULL); + //registry_cache_dump (self->cache_root, NULL); + LeaveCriticalSection (self->cache_lock); + + EnterCriticalSection (watch->message_lock); + watch->message.type = WATCH_THREAD_ADD_WATCH; + watch->message.watch.event = event; + watch->message.watch.hpath = hpath; + watch->message.watch.prefix = gsettings_prefix; + watch->message.watch.cache_node = cache_node; + + SetEvent (watch->message_sent_event); + + /* Wait for the received event in return, to avoid sending another message before the first + * one was received. If it takes > 200ms there is a possible race but the worst outcome is + * a notification is ignored. + */ + result = WaitForSingleObject (watch->message_received_event, 200); + #ifdef TRACE + if (result != WAIT_OBJECT_0) + trace ("watch thread is slow to respond - notification may not be added."); + #endif + LeaveCriticalSection (watch->message_lock); + + return TRUE; +}; + + +static void +watch_remove_notify (GRegistryBackend *self, + const gchar *key_name) +{ + WatchThreadState *watch = self->watch; + LONG result; + + if (self->watch == NULL) + /* Here we assume that the unsubscribe message is for somewhere that was + * deleted, and so it has already been removed and the watch thread has + * stopped. + */ + return; + + EnterCriticalSection (watch->message_lock); + watch->message.type = WATCH_THREAD_REMOVE_WATCH; + watch->message.watch.prefix = g_strdup (key_name); + + SetEvent (watch->message_sent_event); + + /* Wait for the received event in return, to avoid sending another message before the first + * one was received. + */ + result = WaitForSingleObject (watch->message_received_event, INFINITE); + + if (result != ERROR_SUCCESS) + g_warning ("unsubscribe from %s: message not acknowledged\n", key_name); + + if (g_atomic_int_get (&watch->watches_remaining) >= MAX_WATCHES) + /* Stop it before any new ones can get added and confuse things */ + watch_stop_unlocked (self); + else + LeaveCriticalSection (watch->message_lock); +} + +/* dconf semantics are: if the key ends in /, watch the keys underneath it - if not, watch that + * key. Our job is easier because keys and values are separate. + */ +static void +g_registry_backend_subscribe (GSettingsBackend *backend, + const char *key_name) +{ + GRegistryBackend *self = G_REGISTRY_BACKEND (backend); + gchar *path_name, *value_name = NULL; + HKEY hpath; + HANDLE event; + LONG result; + + if (self->watch == NULL) + if (!watch_start (self)) + return; + + if (g_atomic_int_dec_and_test (&self->watch->watches_remaining)) + { + g_atomic_int_inc (&self->watch->watches_remaining); + g_warning ("subscribe() failed: only %i different paths may be watched.\n", MAX_WATCHES); + return; + } + + path_name = parse_key (key_name, self->base_path, &value_name); + + /* Must check for this, otherwise strange crashes occur because the cache + * node that is being watched gets freed. All path names to subscribe must + * end in a slash! + */ + if (value_name != NULL && *value_name != 0) + g_warning ("subscribe() failed: path must end in a /, got %s\n", key_name); + + trace ("Subscribing to %s [registry %s / %s] - watch %x\n", key_name, path_name, value_name, self->watch); + + + /* Give the caller the benefit of the doubt if the key doesn't exist and create it. The caller + * is almost certainly a new g_settings with this path as base path. */ + result = RegCreateKeyExA (HKEY_CURRENT_USER, path_name, 0, NULL, 0, KEY_READ, NULL, &hpath, + NULL); + g_free (path_name); + + if (result != ERROR_SUCCESS) + { + g_message_win32_error (result, "gregistrybackend: Unable to subscribe to key %s.", key_name); + g_atomic_int_inc (&self->watch->watches_remaining); + return; + } + + event = CreateEvent (NULL, FALSE, FALSE, NULL); + if (event == NULL) + { + g_message_win32_error (result, "gregistrybackend: CreateEvent failed.\n"); + g_atomic_int_inc (&self->watch->watches_remaining); + RegCloseKey (hpath); + return; + } + + /* The actual watch is added by the thread, which has to re-subscribe each time it + * receives a change. */ + if (!watch_add_notify (self, event, hpath, g_strdup (key_name))) + g_atomic_int_inc (&self->watch->watches_remaining); +} + +static void +g_registry_backend_unsubscribe (GSettingsBackend *backend, + const char *key_name) +{ + trace ("unsubscribe: %s.\n", key_name); + + watch_remove_notify (G_REGISTRY_BACKEND (backend), key_name); +} + + +/******************************************************************************** + * Object management junk + ********************************************************************************/ + +GSettingsBackend * +g_registry_backend_new (void) { + return g_object_new (G_TYPE_REGISTRY_BACKEND, NULL); +} + +static void +g_registry_backend_finalize (GObject *object) +{ + GRegistryBackend *self = G_REGISTRY_BACKEND (object); + RegistryCacheItem *item; + + item = self->cache_root->data; + g_warn_if_fail (item->ref_count == 1); + + _free_cache_item (item); + g_node_destroy (self->cache_root); + + if (self->watch != NULL) + { + EnterCriticalSection (self->watch->message_lock); + watch_stop_unlocked (self); + } + + g_free (self->base_path); +} + +static void +g_registry_backend_class_init (GRegistryBackendClass *class) +{ + GSettingsBackendClass *backend_class = G_SETTINGS_BACKEND_CLASS (class); + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = g_registry_backend_finalize; + + backend_class->read = g_registry_backend_read; + backend_class->write = g_registry_backend_write; + backend_class->write_tree = g_registry_backend_write_tree; + backend_class->reset = g_registry_backend_reset; + backend_class->get_writable = g_registry_backend_get_writable; + backend_class->get_permission = g_registry_backend_get_permission; + backend_class->subscribe = g_registry_backend_subscribe; + backend_class->unsubscribe = g_registry_backend_unsubscribe; +} + +static void +g_registry_backend_init (GRegistryBackend *self) +{ + RegistryCacheItem *item; + self->base_path = g_strdup_printf ("Software\\GSettings"); + + item = g_slice_new (RegistryCacheItem); + item->value.type = REG_NONE; + item->value.ptr = NULL; + item->name = g_strdup (""); + item->ref_count = 1; + self->cache_root = g_node_new (item); + + self->watch = NULL; +} diff --git a/gio/gregistrysettingsbackend.h b/gio/gregistrysettingsbackend.h new file mode 100644 index 0000000..cd7bd7c --- /dev/null +++ b/gio/gregistrysettingsbackend.h @@ -0,0 +1,31 @@ +/* + * Copyright © 2009-10 Sam Thursfield + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Sam Thursfield + */ + +#ifndef __G_REGISTRY_SETTINGS_BACKEND_H__ +#define __G_REGISTRY_SETTINGS_BACKEND_H__ + +#include + +G_GNUC_INTERNAL +GType g_registry_backend_get_type (void); + + +#endif /* __G_REGISTRY_SETTINGS_BACKEND_H__ */ diff --git a/gio/gresolver.c b/gio/gresolver.c index e7dd8ad..01c6db0 100644 --- a/gio/gresolver.c +++ b/gio/gresolver.c @@ -42,7 +42,6 @@ #include -#include "gioalias.h" /** * SECTION:gresolver @@ -145,7 +144,7 @@ static GResolver *default_resolver; * many threads/processes, etc it should allocate for concurrent DNS * resolutions. * - * Return value: the default #GResolver. + * Return value: (transfer full): the default #GResolver. * * Since: 2.22 */ @@ -240,7 +239,8 @@ g_resolver_maybe_reload (GResolver *resolver) * address, it may be easier to create a #GNetworkAddress and use its * #GSocketConnectable interface. * - * Return value: a #GList of #GInetAddress, or %NULL on error. You + * Return value: (element-type GInetAddress) (transfer full): a #GList + * of #GInetAddress, or %NULL on error. You * must unref each of the addresses and free the list when you are * done with it. (You can use g_resolver_free_addresses() to do this.) * @@ -342,8 +342,9 @@ g_resolver_lookup_by_name_async (GResolver *resolver, * a value from #GResolverError. If the operation was cancelled, * @error will be set to %G_IO_ERROR_CANCELLED. * - * Return value: a #GList of #GInetAddress, or %NULL on error. See - * g_resolver_lookup_by_name() for more details. + * Return value: (element-type GInetAddress) (transfer full): a #GList + * of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() + * for more details. * * Since: 2.22 */ @@ -376,7 +377,7 @@ g_resolver_lookup_by_name_finish (GResolver *resolver, } /** - * g_resolver_free_addresses: + * g_resolver_free_addresses: (skip) * @addresses: a #GList of #GInetAddress * * Frees @addresses (which should be the return value from @@ -546,9 +547,9 @@ g_resolver_get_service_rrname (const char *service, * to create a #GNetworkService and use its #GSocketConnectable * interface. * - * Return value: a #GList of #GSrvTarget, or %NULL on error. You must - * free each of the targets and the list when you are done with it. - * (You can use g_resolver_free_targets() to do this.) + * Return value: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, + * or %NULL on error. You must free each of the targets and the list when you are + * done with it. (You can use g_resolver_free_targets() to do this.) * * Since: 2.22 */ @@ -634,8 +635,8 @@ g_resolver_lookup_service_async (GResolver *resolver, * a value from #GResolverError. If the operation was cancelled, * @error will be set to %G_IO_ERROR_CANCELLED. * - * Return value: a #GList of #GSrvTarget, or %NULL on error. See - * g_resolver_lookup_service() for more details. + * Return value: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, + * or %NULL on error. See g_resolver_lookup_service() for more details. * * Since: 2.22 */ @@ -659,7 +660,7 @@ g_resolver_lookup_service_finish (GResolver *resolver, } /** - * g_resolver_free_targets: + * g_resolver_free_targets: (skip) * @targets: a #GList of #GSrvTarget * * Frees @targets (which should be the return value from @@ -930,6 +931,3 @@ _g_resolver_targets_from_DnsQuery (const gchar *rrname, } #endif - -#define __G_RESOLVER_C__ -#include "gioaliasdef.c" diff --git a/gio/gschema.dtd b/gio/gschema.dtd new file mode 100644 index 0000000..218b544 --- /dev/null +++ b/gio/gschema.dtd @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gio/gseekable.c b/gio/gseekable.c index 04af1f8..976243d 100644 --- a/gio/gseekable.c +++ b/gio/gseekable.c @@ -24,7 +24,6 @@ #include "gseekable.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gseekable @@ -155,7 +154,8 @@ g_seekable_can_truncate (GSeekable *seekable) * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an * operation was partially finished when the operation was cancelled the * partial result will be returned, without an error. - * + * + * Virtual: truncate_fn * Returns: %TRUE if successful. If an error * has occurred, this function will return %FALSE and set @error * appropriately if present. @@ -174,6 +174,3 @@ g_seekable_truncate (GSeekable *seekable, return (* iface->truncate_fn) (seekable, offset, cancellable, error); } - -#define __G_SEEKABLE_C__ -#include "gioaliasdef.c" diff --git a/gio/gsettings-bash-completion.sh b/gio/gsettings-bash-completion.sh new file mode 100644 index 0000000..00f1ca4 --- /dev/null +++ b/gio/gsettings-bash-completion.sh @@ -0,0 +1,67 @@ + +# Check for bash +[ -z "$BASH_VERSION" ] && return + +#################################################################################################### + +__gsettings() { + local choices + + case "${COMP_CWORD}" in + 1) + choices=$'help \nlist-schemas\nlist-relocatable-schemas\nlist-keys \nlist-children \nlist-recursively \nget \nrange \nset \nreset \nwritable \nmonitor' + ;; + + 2) + case "${COMP_WORDS[1]}" in + help) + choices=$'list-schemas\nlist-relocatable-schemas\nlist-keys\nlist-children\nlist-recursively\nget\nrange\nset\nreset\nwritable\nmonitor' + ;; + list-keys|list-children|list-recursively) + choices="$(gsettings list-schemas)"$'\n'"$(gsettings list-relocatable-schemas | sed -e 's.$.:/.')" + ;; + + get|range|set|reset|writable|monitor) + choices="$(gsettings list-schemas | sed -e 's.$. .')"$'\n'"$(gsettings list-relocatable-schemas | sed -e 's.$.:/.')" + ;; + esac + ;; + + 3) + case "${COMP_WORDS[1]}" in + set) + choices="$(gsettings list-keys ${COMP_WORDS[2]} 2> /dev/null | sed -e 's.$. .')" + ;; + + get|range|reset|writable|monitor) + choices="$(gsettings list-keys ${COMP_WORDS[2]} 2> /dev/null)" + ;; + esac + ;; + + 4) + case "${COMP_WORDS[1]}" in + set) + range=($(gsettings range ${COMP_WORDS[2]} ${COMP_WORDS[3]} 2> /dev/null)) + case "${range[0]}" in + enum) + unset range[0] + ;; + *) + unset range + ;; + esac + local IFS=$'\n' + choices="${range[*]}" + ;; + esac + ;; + esac + + local IFS=$'\n' + COMPREPLY=($(compgen -W "${choices}" "${COMP_WORDS[$COMP_CWORD]}")) +} + +#################################################################################################### + +complete -o nospace -F __gsettings gsettings diff --git a/gio/gsettings-mapping.c b/gio/gsettings-mapping.c new file mode 100644 index 0000000..fda7463 --- /dev/null +++ b/gio/gsettings-mapping.c @@ -0,0 +1,594 @@ +/* + * Copyright © 2010 Novell, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Vincent Untz + */ + +#include "config.h" + +#include "gsettings-mapping.h" + +static GVariant * +g_settings_set_mapping_int (const GValue *value, + const GVariantType *expected_type) +{ + GVariant *variant = NULL; + gint64 l; + + if (G_VALUE_HOLDS_INT (value)) + l = g_value_get_int (value); + else if (G_VALUE_HOLDS_INT64 (value)) + l = g_value_get_int64 (value); + else + return NULL; + + if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT16)) + { + if (G_MININT16 <= l && l <= G_MAXINT16) + variant = g_variant_new_int16 ((gint16) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT16)) + { + if (0 <= l && l <= G_MAXUINT16) + variant = g_variant_new_uint16 ((guint16) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT32)) + { + if (G_MININT32 <= l && l <= G_MAXINT32) + variant = g_variant_new_int32 ((gint) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT32)) + { + if (0 <= l && l <= G_MAXUINT32) + variant = g_variant_new_uint32 ((guint) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT64)) + { + if (G_MININT64 <= l && l <= G_MAXINT64) + variant = g_variant_new_int64 ((gint64) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT64)) + { + if (0 <= l && l <= G_MAXUINT64) + variant = g_variant_new_uint64 ((guint64) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_HANDLE)) + { + if (0 <= l && l <= G_MAXUINT32) + variant = g_variant_new_handle ((guint) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_DOUBLE)) + variant = g_variant_new_double ((gdouble) l); + + return variant; +} + +static GVariant * +g_settings_set_mapping_float (const GValue *value, + const GVariantType *expected_type) +{ + GVariant *variant = NULL; + gdouble d; + gint64 l; + + if (G_VALUE_HOLDS_DOUBLE (value)) + d = g_value_get_double (value); + else + return NULL; + + l = (gint64) d; + if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT16)) + { + if (G_MININT16 <= l && l <= G_MAXINT16) + variant = g_variant_new_int16 ((gint16) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT16)) + { + if (0 <= l && l <= G_MAXUINT16) + variant = g_variant_new_uint16 ((guint16) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT32)) + { + if (G_MININT32 <= l && l <= G_MAXINT32) + variant = g_variant_new_int32 ((gint) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT32)) + { + if (0 <= l && l <= G_MAXUINT32) + variant = g_variant_new_uint32 ((guint) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT64)) + { + if (G_MININT64 <= l && l <= G_MAXINT64) + variant = g_variant_new_int64 ((gint64) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT64)) + { + if (0 <= l && l <= G_MAXUINT64) + variant = g_variant_new_uint64 ((guint64) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_HANDLE)) + { + if (0 <= l && l <= G_MAXUINT32) + variant = g_variant_new_handle ((guint) l); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_DOUBLE)) + variant = g_variant_new_double ((gdouble) d); + + return variant; +} +static GVariant * +g_settings_set_mapping_unsigned_int (const GValue *value, + const GVariantType *expected_type) +{ + GVariant *variant = NULL; + guint64 u; + + if (G_VALUE_HOLDS_UINT (value)) + u = g_value_get_uint (value); + else if (G_VALUE_HOLDS_UINT64 (value)) + u = g_value_get_uint64 (value); + else + return NULL; + + if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT16)) + { + if (u <= G_MAXINT16) + variant = g_variant_new_int16 ((gint16) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT16)) + { + if (u <= G_MAXUINT16) + variant = g_variant_new_uint16 ((guint16) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT32)) + { + if (u <= G_MAXINT32) + variant = g_variant_new_int32 ((gint) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT32)) + { + if (u <= G_MAXUINT32) + variant = g_variant_new_uint32 ((guint) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_INT64)) + { + if (u <= G_MAXINT64) + variant = g_variant_new_int64 ((gint64) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT64)) + { + if (u <= G_MAXUINT64) + variant = g_variant_new_uint64 ((guint64) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_HANDLE)) + { + if (u <= G_MAXUINT32) + variant = g_variant_new_handle ((guint) u); + } + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_DOUBLE)) + variant = g_variant_new_double ((gdouble) u); + + return variant; +} + +static gboolean +g_settings_get_mapping_int (GValue *value, + GVariant *variant) +{ + const GVariantType *type; + gint64 l; + + type = g_variant_get_type (variant); + + if (g_variant_type_equal (type, G_VARIANT_TYPE_INT16)) + l = g_variant_get_int16 (variant); + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT32)) + l = g_variant_get_int32 (variant); + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64)) + l = g_variant_get_int64 (variant); + else + return FALSE; + + if (G_VALUE_HOLDS_INT (value)) + { + g_value_set_int (value, l); + return (G_MININT32 <= l && l <= G_MAXINT32); + } + else if (G_VALUE_HOLDS_UINT (value)) + { + g_value_set_uint (value, l); + return (0 <= l && l <= G_MAXUINT32); + } + else if (G_VALUE_HOLDS_INT64 (value)) + { + g_value_set_int64 (value, l); + return (G_MININT64 <= l && l <= G_MAXINT64); + } + else if (G_VALUE_HOLDS_UINT64 (value)) + { + g_value_set_uint64 (value, l); + return (0 <= l && l <= G_MAXUINT64); + } + else if (G_VALUE_HOLDS_DOUBLE (value)) + { + g_value_set_double (value, l); + return TRUE; + } + + return FALSE; +} + +static gboolean +g_settings_get_mapping_float (GValue *value, + GVariant *variant) +{ + const GVariantType *type; + gdouble d; + gint64 l; + + type = g_variant_get_type (variant); + + if (g_variant_type_equal (type, G_VARIANT_TYPE_DOUBLE)) + d = g_variant_get_double (variant); + else + return FALSE; + + l = (gint64)d; + if (G_VALUE_HOLDS_INT (value)) + { + g_value_set_int (value, l); + return (G_MININT32 <= l && l <= G_MAXINT32); + } + else if (G_VALUE_HOLDS_UINT (value)) + { + g_value_set_uint (value, l); + return (0 <= l && l <= G_MAXUINT32); + } + else if (G_VALUE_HOLDS_INT64 (value)) + { + g_value_set_int64 (value, l); + return (G_MININT64 <= l && l <= G_MAXINT64); + } + else if (G_VALUE_HOLDS_UINT64 (value)) + { + g_value_set_uint64 (value, l); + return (0 <= l && l <= G_MAXUINT64); + } + else if (G_VALUE_HOLDS_DOUBLE (value)) + { + g_value_set_double (value, d); + return TRUE; + } + + return FALSE; +} +static gboolean +g_settings_get_mapping_unsigned_int (GValue *value, + GVariant *variant) +{ + const GVariantType *type; + guint64 u; + + type = g_variant_get_type (variant); + + if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT16)) + u = g_variant_get_uint16 (variant); + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT32)) + u = g_variant_get_uint32 (variant); + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64)) + u = g_variant_get_uint64 (variant); + else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE)) + u = g_variant_get_handle (variant); + else + return FALSE; + + if (G_VALUE_HOLDS_INT (value)) + { + g_value_set_int (value, u); + return (u <= G_MAXINT32); + } + else if (G_VALUE_HOLDS_UINT (value)) + { + g_value_set_uint (value, u); + return (u <= G_MAXUINT32); + } + else if (G_VALUE_HOLDS_INT64 (value)) + { + g_value_set_int64 (value, u); + return (u <= G_MAXINT64); + } + else if (G_VALUE_HOLDS_UINT64 (value)) + { + g_value_set_uint64 (value, u); + return (u <= G_MAXUINT64); + } + else if (G_VALUE_HOLDS_DOUBLE (value)) + { + g_value_set_double (value, u); + return TRUE; + } + + return FALSE; +} + +GVariant * +g_settings_set_mapping (const GValue *value, + const GVariantType *expected_type, + gpointer user_data) +{ + gchar *type_string; + + if (G_VALUE_HOLDS_BOOLEAN (value)) + { + if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_BOOLEAN)) + return g_variant_new_boolean (g_value_get_boolean (value)); + } + + else if (G_VALUE_HOLDS_CHAR (value) || + G_VALUE_HOLDS_UCHAR (value)) + { + if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_BYTE)) + { + if (G_VALUE_HOLDS_CHAR (value)) + return g_variant_new_byte (g_value_get_char (value)); + else + return g_variant_new_byte (g_value_get_uchar (value)); + } + } + + else if (G_VALUE_HOLDS_INT (value) || + G_VALUE_HOLDS_INT64 (value)) + return g_settings_set_mapping_int (value, expected_type); + + else if (G_VALUE_HOLDS_DOUBLE (value)) + return g_settings_set_mapping_float (value, expected_type); + + else if (G_VALUE_HOLDS_UINT (value) || + G_VALUE_HOLDS_UINT64 (value)) + return g_settings_set_mapping_unsigned_int (value, expected_type); + + else if (G_VALUE_HOLDS_STRING (value)) + { + if (g_value_get_string (value) == NULL) + return NULL; + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_STRING)) + return g_variant_new_string (g_value_get_string (value)); + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_BYTESTRING)) + return g_variant_new_bytestring (g_value_get_string (value)); + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_OBJECT_PATH)) + return g_variant_new_object_path (g_value_get_string (value)); + else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_SIGNATURE)) + return g_variant_new_signature (g_value_get_string (value)); + } + + else if (G_VALUE_HOLDS (value, G_TYPE_STRV)) + { + if (g_value_get_boxed (value) == NULL) + return NULL; + return g_variant_new_strv ((const gchar **) g_value_get_boxed (value), + -1); + } + + else if (G_VALUE_HOLDS_ENUM (value)) + { + GEnumValue *enumval; + GEnumClass *eclass; + + /* GParamSpecEnum holds a ref on the class so we just peek... */ + eclass = g_type_class_peek (G_VALUE_TYPE (value)); + enumval = g_enum_get_value (eclass, g_value_get_enum (value)); + + if (enumval) + return g_variant_new_string (enumval->value_nick); + else + return NULL; + } + + else if (G_VALUE_HOLDS_FLAGS (value)) + { + GVariantBuilder builder; + GFlagsValue *flagsval; + GFlagsClass *fclass; + guint flags; + + fclass = g_type_class_peek (G_VALUE_TYPE (value)); + flags = g_value_get_flags (value); + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("as")); + while (flags) + { + flagsval = g_flags_get_first_value (fclass, flags); + + if (flagsval == NULL) + { + g_variant_builder_clear (&builder); + return NULL; + } + + g_variant_builder_add (&builder, "s", flagsval->value_nick); + flags &= ~flagsval->value; + } + + return g_variant_builder_end (&builder); + } + + type_string = g_variant_type_dup_string (expected_type); + g_critical ("No GSettings bind handler for type \"%s\".", type_string); + g_free (type_string); + + return NULL; +} + +gboolean +g_settings_get_mapping (GValue *value, + GVariant *variant, + gpointer user_data) +{ + if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BOOLEAN)) + { + if (!G_VALUE_HOLDS_BOOLEAN (value)) + return FALSE; + g_value_set_boolean (value, g_variant_get_boolean (variant)); + return TRUE; + } + + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTE)) + { + if (G_VALUE_HOLDS_UCHAR (value)) + g_value_set_uchar (value, g_variant_get_byte (variant)); + else if (G_VALUE_HOLDS_CHAR (value)) + g_value_set_char (value, (gchar) g_variant_get_byte (variant)); + else + return FALSE; + return TRUE; + } + + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_INT16) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_INT32) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_INT64)) + return g_settings_get_mapping_int (value, variant); + + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_DOUBLE)) + return g_settings_get_mapping_float (value, variant); + + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT16) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT32) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT64) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_HANDLE)) + return g_settings_get_mapping_unsigned_int (value, variant); + + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_OBJECT_PATH) || + g_variant_is_of_type (variant, G_VARIANT_TYPE_SIGNATURE)) + { + if (G_VALUE_HOLDS_STRING (value)) + { + g_value_set_string (value, g_variant_get_string (variant, NULL)); + return TRUE; + } + + else if (G_VALUE_HOLDS_ENUM (value)) + { + GEnumClass *eclass; + GEnumValue *evalue; + const gchar *nick; + + /* GParamSpecEnum holds a ref on the class so we just peek... */ + eclass = g_type_class_peek (G_VALUE_TYPE (value)); + nick = g_variant_get_string (variant, NULL); + evalue = g_enum_get_value_by_nick (eclass, nick); + + if (evalue) + { + g_value_set_enum (value, evalue->value); + return TRUE; + } + + g_warning ("Unable to lookup enum nick '%s' via GType\n", nick); + return FALSE; + } + } + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE ("as"))) + { + if (G_VALUE_HOLDS (value, G_TYPE_STRV)) + { + g_value_take_boxed (value, g_variant_dup_strv (variant, NULL)); + return TRUE; + } + + else if (G_VALUE_HOLDS_FLAGS (value)) + { + GFlagsClass *fclass; + GFlagsValue *fvalue; + const gchar *nick; + GVariantIter iter; + guint flags = 0; + + fclass = g_type_class_peek (G_VALUE_TYPE (value)); + + g_variant_iter_init (&iter, variant); + while (g_variant_iter_next (&iter, "&s", &nick)) + { + fvalue = g_flags_get_value_by_nick (fclass, nick); + + if (fvalue) + flags |= fvalue->value; + + else + { + g_warning ("Unable to lookup flags nick '%s' via GType\n", + nick); + return FALSE; + } + } + + g_value_set_flags (value, flags); + return TRUE; + } + } + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTESTRING)) + { + g_value_set_string (value, g_variant_get_bytestring (variant)); + return TRUE; + } + + g_critical ("No GSettings bind handler for type \"%s\".", + g_variant_get_type_string (variant)); + + return FALSE; +} + +gboolean +g_settings_mapping_is_compatible (GType gvalue_type, + const GVariantType *variant_type) +{ + gboolean ok = FALSE; + + if (gvalue_type == G_TYPE_BOOLEAN) + ok = g_variant_type_equal (variant_type, G_VARIANT_TYPE_BOOLEAN); + else if (gvalue_type == G_TYPE_CHAR || + gvalue_type == G_TYPE_UCHAR) + ok = g_variant_type_equal (variant_type, G_VARIANT_TYPE_BYTE); + else if (gvalue_type == G_TYPE_INT || + gvalue_type == G_TYPE_UINT || + gvalue_type == G_TYPE_INT64 || + gvalue_type == G_TYPE_UINT64 || + gvalue_type == G_TYPE_DOUBLE) + ok = (g_variant_type_equal (variant_type, G_VARIANT_TYPE_INT16) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_UINT16) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_INT32) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_UINT32) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_INT64) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_UINT64) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_HANDLE) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_DOUBLE)); + else if (gvalue_type == G_TYPE_STRING) + ok = (g_variant_type_equal (variant_type, G_VARIANT_TYPE_STRING) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE ("ay")) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_OBJECT_PATH) || + g_variant_type_equal (variant_type, G_VARIANT_TYPE_SIGNATURE)); + else if (gvalue_type == G_TYPE_STRV) + ok = g_variant_type_equal (variant_type, G_VARIANT_TYPE ("as")); + else if (G_TYPE_IS_ENUM (gvalue_type)) + ok = g_variant_type_equal (variant_type, G_VARIANT_TYPE_STRING); + else if (G_TYPE_IS_FLAGS (gvalue_type)) + ok = g_variant_type_equal (variant_type, G_VARIANT_TYPE ("as")); + + return ok; +} diff --git a/gio/gsettings-mapping.h b/gio/gsettings-mapping.h new file mode 100644 index 0000000..18ce318 --- /dev/null +++ b/gio/gsettings-mapping.h @@ -0,0 +1,39 @@ +/* + * Copyright © 2010 Novell, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Vincent Untz + */ + +#ifndef __G_SETTINGS_MAPPING_H__ +#define __G_SETTINGS_MAPPING_H__ + +#include + +G_GNUC_INTERNAL +GVariant * g_settings_set_mapping (const GValue *value, + const GVariantType *expected_type, + gpointer user_data); +G_GNUC_INTERNAL +gboolean g_settings_get_mapping (GValue *value, + GVariant *variant, + gpointer user_data); +G_GNUC_INTERNAL +gboolean g_settings_mapping_is_compatible (GType gvalue_type, + const GVariantType *variant_type); + +#endif /* __G_SETTINGS_MAPPING_H__ */ diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c new file mode 100644 index 0000000..de43782 --- /dev/null +++ b/gio/gsettings-tool.c @@ -0,0 +1,694 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "config.h" + +#include +#include +#include +#include +#include + +static gboolean +contained (const gchar * const *items, + const gchar *item) +{ + while (*items) + if (strcmp (*items++, item) == 0) + return TRUE; + + return FALSE; +} + +static gboolean +is_schema (const gchar *schema) +{ + return contained (g_settings_list_schemas (), schema); +} + +static gboolean +is_relocatable_schema (const gchar *schema) +{ + return contained (g_settings_list_relocatable_schemas (), schema); +} + +static gboolean +check_relocatable_schema (const gchar *schema) +{ + if (is_relocatable_schema (schema)) + return TRUE; + + if (is_schema (schema)) + g_printerr (_("Schema '%s' is not relocatable " + "(path must not be specified)\n"), + schema); + + else + g_printerr (_("No such schema '%s'\n"), schema); + + return FALSE; +} + +static gboolean +check_schema (const gchar *schema) +{ + if (is_schema (schema)) + return TRUE; + + if (is_relocatable_schema (schema)) + g_printerr (_("Schema '%s' is relocatable " + "(path must be specified)\n"), + schema); + + else + g_printerr (_("No such schema '%s'\n"), schema); + + return FALSE; +} + +static gboolean +check_path (const gchar *path) +{ + if (path[0] == '\0') + { + g_printerr (_("Empty path given.\n")); + return FALSE; + } + + if (path[0] != '/') + { + g_printerr (_("Path must begin with a slash (/)\n")); + return FALSE; + } + + if (!g_str_has_suffix (path, "/")) + { + g_printerr (_("Path must end with a slash (/)\n")); + return FALSE; + } + + if (strstr (path, "//")) + { + g_printerr (_("Path must not contain two adjacent slashes (//)\n")); + return FALSE; + } + + return TRUE; +} + +static gboolean +check_key (GSettings *settings, + const gchar *key) +{ + gboolean good; + gchar **keys; + + keys = g_settings_list_keys (settings); + good = contained ((const gchar **) keys, key); + g_strfreev (keys); + + if (good) + return TRUE; + + g_printerr (_("No such key '%s'\n"), key); + + return FALSE; +} + +static void +output_list (const gchar * const *list) +{ + gint i; + + for (i = 0; list[i]; i++) + g_print ("%s\n", list[i]); +} + +static void +gsettings_list_schemas (GSettings *settings, + const gchar *key, + const gchar *value) +{ + output_list (g_settings_list_schemas ()); +} + +static void +gsettings_list_relocatable_schemas (GSettings *settings, + const gchar *key, + const gchar *value) +{ + output_list (g_settings_list_relocatable_schemas ()); +} + +static void +gsettings_list_keys (GSettings *settings, + const gchar *key, + const gchar *value) +{ + gchar **keys; + + keys = g_settings_list_keys (settings); + output_list ((const gchar **) keys); + g_strfreev (keys); +} + +static void +gsettings_list_children (GSettings *settings, + const gchar *key, + const gchar *value) +{ + gchar **children; + gint max = 0; + gint i; + + children = g_settings_list_children (settings); + for (i = 0; children[i]; i++) + if (strlen (children[i]) > max) + max = strlen (children[i]); + + for (i = 0; children[i]; i++) + { + GSettings *child; + gchar *schema; + gchar *path; + + child = g_settings_get_child (settings, children[i]); + g_object_get (child, + "schema", &schema, + "path", &path, + NULL); + + if (is_schema (schema)) + g_print ("%-*s %s\n", max, children[i], schema); + else + g_print ("%-*s %s:%s\n", max, children[i], schema, path); + + g_object_unref (child); + g_free (schema); + g_free (path); + } + + g_strfreev (children); +} + +static void +enumerate (GSettings *settings) +{ + gchar **keys; + gchar *schema; + gint i; + + g_object_get (settings, "schema", &schema, NULL); + + keys = g_settings_list_keys (settings); + for (i = 0; keys[i]; i++) + { + GVariant *value; + gchar *printed; + + value = g_settings_get_value (settings, keys[i]); + printed = g_variant_print (value, TRUE); + g_print ("%s %s %s\n", schema, keys[i], printed); + g_variant_unref (value); + g_free (printed); + } + + g_free (schema); + g_strfreev (keys); +} + +static void +gsettings_list_recursively (GSettings *settings, + const gchar *key, + const gchar *value) +{ + gchar **children; + gint i; + + enumerate (settings); + + children = g_settings_list_children (settings); + + for (i = 0; children[i]; i++) + { + GSettings *child; + gchar *schema; + + child = g_settings_get_child (settings, children[i]); + g_object_get (child, "schema", &schema, NULL); + + if (is_schema (schema)) + enumerate (child); + + g_object_unref (child); + g_free (schema); + } + + g_strfreev (children); +} + +static void +gsettings_range (GSettings *settings, + const gchar *key, + const gchar *value) +{ + GVariant *range, *detail; + const gchar *type; + + range = g_settings_get_range (settings, key); + g_variant_get (range, "(&sv)", &type, &detail); + + if (strcmp (type, "type") == 0) + g_print ("type %s\n", g_variant_get_type_string (detail) + 1); + + else if (strcmp (type, "range") == 0) + { + GVariant *min, *max; + gchar *smin, *smax; + + g_variant_get (detail, "(**)", &min, &max); + smin = g_variant_print (min, FALSE); + smax = g_variant_print (max, FALSE); + + g_print ("range %s %s %s\n", + g_variant_get_type_string (min), smin, smax); + g_variant_unref (min); + g_variant_unref (max); + g_free (smin); + g_free (smax); + } + + else if (strcmp (type, "enum") == 0 || strcmp (type, "flags") == 0) + { + GVariantIter iter; + GVariant *item; + + g_print ("%s\n", type); + + g_variant_iter_init (&iter, detail); + while (g_variant_iter_loop (&iter, "*", &item)) + { + gchar *printed; + + printed = g_variant_print (item, FALSE); + g_print ("%s\n", printed); + g_free (printed); + } + } + + g_variant_unref (detail); + g_variant_unref (range); +} + +static void +gsettings_get (GSettings *settings, + const gchar *key, + const gchar *value_) +{ + GVariant *value; + gchar *printed; + + value = g_settings_get_value (settings, key); + printed = g_variant_print (value, TRUE); + g_print ("%s\n", printed); + g_variant_unref (value); + g_free (printed); +} + +static void +gsettings_reset (GSettings *settings, + const gchar *key, + const gchar *value) +{ + g_settings_reset (settings, key); + g_settings_sync (); +} + +static void +gsettings_writable (GSettings *settings, + const gchar *key, + const gchar *value) +{ + g_print ("%s\n", + g_settings_is_writable (settings, key) ? + "true" : "false"); +} + +static void +value_changed (GSettings *settings, + const gchar *key, + gpointer user_data) +{ + GVariant *value; + gchar *printed; + + value = g_settings_get_value (settings, key); + printed = g_variant_print (value, TRUE); + g_print ("%s: %s\n", key, printed); + g_variant_unref (value); + g_free (printed); +} + +static void +gsettings_monitor (GSettings *settings, + const gchar *key, + const gchar *value) +{ + if (key) + { + gchar *name; + + name = g_strdup_printf ("changed::%s", key); + g_signal_connect (settings, name, G_CALLBACK (value_changed), NULL); + } + else + g_signal_connect (settings, "changed", G_CALLBACK (value_changed), NULL); + + g_main_loop_run (g_main_loop_new (NULL, FALSE)); +} + +static void +gsettings_set (GSettings *settings, + const gchar *key, + const gchar *value) +{ + const GVariantType *type; + GError *error = NULL; + GVariant *existing; + GVariant *new; + gchar *freeme = NULL; + + existing = g_settings_get_value (settings, key); + type = g_variant_get_type (existing); + + new = g_variant_parse (type, value, NULL, NULL, &error); + + /* A common error is to specify a string with single quotes + * (or use completion for that), and forget that the shell + * will eat one level of quoting, resulting in 'unknown keyword' + * error from the gvariant parser. + * To handle this case, try to parse again with an extra level + * of quotes. + */ + if (new == NULL && + g_error_matches (error, G_VARIANT_PARSE_ERROR, + G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD)) + { + value = freeme = g_strdup_printf ("\"%s\"", value); + new = g_variant_parse (type, value, NULL, NULL, NULL); + if (new != NULL) + g_clear_error (&error); + } + + if (new == NULL) + { + g_printerr ("%s\n", error->message); + exit (1); + } + + if (!g_settings_range_check (settings, key, new)) + { + g_printerr (_("The provided value is outside of the valid range\n")); + g_variant_unref (new); + exit (1); + } + + g_settings_set_value (settings, key, new); + g_variant_unref (existing); + g_variant_unref (new); + + g_settings_sync (); + + g_free (freeme); +} + +static int +gsettings_help (gboolean requested, + const gchar *command) +{ + const gchar *description; + const gchar *synopsis; + GString *string; + + string = g_string_new (NULL); + + if (command == NULL) + ; + + else if (strcmp (command, "list-schemas") == 0) + { + description = _("List the installed (non-relocatable) schemas"); + synopsis = ""; + } + + else if (strcmp (command, "list-relocatable-schemas") == 0) + { + description = _("List the installed relocatable schemas"); + synopsis = ""; + } + + else if (strcmp (command, "list-keys") == 0) + { + description = _("Lists the keys in SCHEMA"); + synopsis = N_("SCHEMA[:PATH]"); + } + + else if (strcmp (command, "list-children") == 0) + { + description = _("Lists the children of SCHEMA"); + synopsis = N_("SCHEMA[:PATH]"); + } + + else if (strcmp (command, "list-recursively") == 0) + { + description = _("List keys and values, recursively"); + synopsis = N_("SCHEMA[:PATH]"); + } + + else if (strcmp (command, "get") == 0) + { + description = _("Gets the value of KEY"); + synopsis = N_("SCHEMA[:PATH] KEY"); + } + + else if (strcmp (command, "range") == 0) + { + description = _("Queries the range of valid values for KEY"); + synopsis = N_("SCHEMA[:PATH] KEY"); + } + + else if (strcmp (command, "set") == 0) + { + description = _("Sets the value of KEY to VALUE"); + synopsis = N_("SCHEMA[:PATH] KEY VALUE"); + } + + else if (strcmp (command, "reset") == 0) + { + description = _("Resets KEY to its default value"); + synopsis = N_("SCHEMA[:PATH] KEY"); + } + + else if (strcmp (command, "writable") == 0) + { + description = _("Checks if KEY is writable"); + synopsis = N_("SCHEMA[:PATH] KEY"); + } + + else if (strcmp (command, "monitor") == 0) + { + description = _("Monitors KEY for changes.\n" + "If no KEY is specified, monitor all keys in SCHEMA.\n" + "Use ^C to stop monitoring.\n"); + synopsis = N_("SCHEMA[:PATH] [KEY]"); + } + else + { + g_string_printf (string, _("Unknown command %s\n\n"), command); + requested = FALSE; + command = NULL; + } + + if (command == NULL) + { + g_string_append (string, + _("Usage:\n" + " gsettings COMMAND [ARGS...]\n" + "\n" + "Commands:\n" + " help Show this information\n" + " list-schemas List installed schemas\n" + " list-relocatable-schemas List relocatable schemas\n" + " list-keys List keys in a schema\n" + " list-children List children of a schema\n" + " list-recursively List keys and values, recursively\n" + " range Queries the range of a key\n" + " get Get the value of a key\n" + " set Set the value of a key\n" + " reset Reset the value of a key\n" + " writable Check if a key is writable\n" + " monitor Watch for changes\n" + "\n" + "Use 'gsettings help COMMAND' to get detailed help.\n\n")); + } + else + { + g_string_append_printf (string, _("Usage:\n gsettings %s %s\n\n%s\n\n"), + command, _(synopsis), description); + + if (synopsis[0]) + { + g_string_append (string, _("Arguments:\n")); + + if (strstr (synopsis, "SCHEMA")) + g_string_append (string, + _(" SCHEMA The name of the schema\n" + " PATH The path, for relocatable schemas\n")); + + if (strstr (synopsis, "[KEY]")) + g_string_append (string, + _(" KEY The (optional) key within the schema\n")); + + else if (strstr (synopsis, "KEY")) + g_string_append (string, + _(" KEY The key within the schema\n")); + + if (strstr (synopsis, "VALUE")) + g_string_append (string, + _(" VALUE The value to set\n")); + + g_string_append (string, "\n"); + } + } + + if (requested) + g_print ("%s", string->str); + else + g_printerr ("%s", string->str); + + g_string_free (string, TRUE); + + return requested ? 0 : 1; +} + + +int +main (int argc, char **argv) +{ + void (* function) (GSettings *, const gchar *, const gchar *); + GSettings *settings; + const gchar *key; + + setlocale (LC_ALL, ""); + + if (argc < 2) + return gsettings_help (FALSE, NULL); + + else if (strcmp (argv[1], "help") == 0) + return gsettings_help (TRUE, argv[2]); + + else if (argc == 2 && strcmp (argv[1], "list-schemas") == 0) + function = gsettings_list_schemas; + + else if (argc == 2 && strcmp (argv[1], "list-relocatable-schemas") == 0) + function = gsettings_list_relocatable_schemas; + + else if (argc == 3 && strcmp (argv[1], "list-keys") == 0) + function = gsettings_list_keys; + + else if (argc == 3 && strcmp (argv[1], "list-children") == 0) + function = gsettings_list_children; + + else if (argc == 3 && strcmp (argv[1], "list-recursively") == 0) + function = gsettings_list_recursively; + + else if (argc == 4 && strcmp (argv[1], "range") == 0) + function = gsettings_range; + + else if (argc == 4 && strcmp (argv[1], "get") == 0) + function = gsettings_get; + + else if (argc == 5 && strcmp (argv[1], "set") == 0) + function = gsettings_set; + + else if (argc == 4 && strcmp (argv[1], "reset") == 0) + function = gsettings_reset; + + else if (argc == 4 && strcmp (argv[1], "writable") == 0) + function = gsettings_writable; + + else if ((argc == 3 || argc == 4) && strcmp (argv[1], "monitor") == 0) + function = gsettings_monitor; + + else + return gsettings_help (FALSE, argv[1]); + + g_type_init (); + + if (argc > 2) + { + gchar **parts; + + if (argv[2][0] == '\0') + { + g_printerr (_("Empty schema name given")); + return 1; + } + + parts = g_strsplit (argv[2], ":", 2); + + if (parts[1]) + { + if (!check_relocatable_schema (parts[0]) || !check_path (parts[1])) + return 1; + + settings = g_settings_new_with_path (parts[0], parts[1]); + } + else + { + if (!check_schema (parts[0])) + return 1; + + settings = g_settings_new (parts[0]); + } + + g_strfreev (parts); + } + else + settings = NULL; + + if (argc > 3) + { + if (!check_key (settings, argv[3])) + return 1; + + key = argv[3]; + } + else + key = NULL; + + (* function) (settings, key, argc > 4 ? argv[4] : NULL); + + if (settings != NULL) + g_object_unref (settings); + + return 0; +} diff --git a/gio/gsettings.c b/gio/gsettings.c new file mode 100644 index 0000000..23164b5 --- /dev/null +++ b/gio/gsettings.c @@ -0,0 +1,2941 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +/* Prelude {{{1 */ +#define _GNU_SOURCE +#include "config.h" + +#include +#include +#include + +#include "gsettings.h" + +#include "gdelayedsettingsbackend.h" +#include "gsettingsbackendinternal.h" +#include "gsettings-mapping.h" +#include "gio-marshal.h" +#include "gsettingsschema.h" + +#include + + +#include "strinfo.c" + +/** + * SECTION:gsettings + * @short_description: High-level API for application settings + * + * The #GSettings class provides a convenient API for storing and retrieving + * application settings. + * + * When creating a GSettings instance, you have to specify a schema + * that describes the keys in your settings and their types and default + * values, as well as some other information. + * + * Normally, a schema has as fixed path that determines where the settings + * are stored in the conceptual global tree of settings. However, schemas + * can also be 'relocatable', i.e. not equipped with a fixed path. This is + * useful e.g. when the schema describes an 'account', and you want to be + * able to store a arbitrary number of accounts. + * + * Unlike other configuration systems (like GConf), GSettings does not + * restrict keys to basic types like strings and numbers. GSettings stores + * values as #GVariant, and allows any #GVariantType for keys. Key names + * are restricted to lowercase characters, numbers and '-'. Furthermore, + * the names must begin with a lowercase character, must not end + * with a '-', and must not contain consecutive dashes. Key names can + * be up to 32 characters long. + * + * Similar to GConf, the default values in GSettings schemas can be + * localized, but the localized values are stored in gettext catalogs + * and looked up with the domain that is specified in the + * gettext-domain attribute of the + * schemalist or schema + * elements and the category that is specified in the l10n attribute of the + * key element. + * + * GSettings uses schemas in a compact binary form that is created + * by the glib-compile-schemas + * utility. The input is a schema description in an XML format that can be + * described by the following DTD: + * |[FIXME: MISSING XINCLUDE CONTENT]| + * + * At runtime, schemas are identified by their id (as specified + * in the id attribute of the + * schema element). The + * convention for schema ids is to use a dotted name, similar in + * style to a DBus bus name, e.g. "org.gnome.font-rendering". + * + * In addition to #GVariant types, keys can have types that have enumerated + * types. These can be described by a choice, + * enum or flags element, see + * . The underlying type of + * such a key is string, but you can use g_settings_get_enum(), + * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags() + * access the numeric values corresponding to the string value of enum + * and flags keys. + * + * Default values + * + * + * + * + * "Hello, earthlings" + * A greeting + * + * Greeting of the invading martians + * + * + * + * + * (20,30) + * + * + * + * + * ]]> + * + * Ranges, choices and enumerated types + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * 10 + * + * + * + * + * + * + * + * + * + * + * + * + * 'Joe' + * + * + * + * 'first' + * + * + * + * ["flag1",flag2"] + * + * + * + * ]]> + * + * + * Vendor overrides + * + * Default values are defined in the schemas that get installed by + * an application. Sometimes, it is necessary for a vendor or distributor + * to adjust these defaults. Since patching the XML source for the schema + * is inconvenient and error-prone, + * glib-compile-schemas reads + * so-called 'vendor override' files. These are keyfiles in the same + * directory as the XML schema sources which can override default values. + * The schema id serves as the group name in the key file, and the values + * are expected in serialized GVariant form, as in the following example: + * + * [org.gtk.Example] + * key1='string' + * key2=1.5 + * + * + * + * + * + * Binding + * + * A very convenient feature of GSettings lets you bind #GObject properties + * directly to settings, using g_settings_bind(). Once a GObject property + * has been bound to a setting, changes on either side are automatically + * propagated to the other side. GSettings handles details like + * mapping between GObject and GVariant types, and preventing infinite + * cycles. + * + * + * This makes it very easy to hook up a preferences dialog to the + * underlying settings. To make this even more convenient, GSettings + * looks for a boolean property with the name "sensitivity" and + * automatically binds it to the writability of the bound setting. + * If this 'magic' gets in the way, it can be suppressed with the + * #G_SETTINGS_BIND_NO_SENSITIVITY flag. + * + * + **/ + +struct _GSettingsPrivate +{ + /* where the signals go... */ + GMainContext *main_context; + + GSettingsBackend *backend; + GSettingsSchema *schema; + gchar *schema_name; + gchar *path; + + GDelayedSettingsBackend *delayed; +}; + +enum +{ + PROP_0, + PROP_SCHEMA, + PROP_BACKEND, + PROP_PATH, + PROP_HAS_UNAPPLIED, + PROP_DELAY_APPLY +}; + +enum +{ + SIGNAL_WRITABLE_CHANGE_EVENT, + SIGNAL_WRITABLE_CHANGED, + SIGNAL_CHANGE_EVENT, + SIGNAL_CHANGED, + N_SIGNALS +}; + +static guint g_settings_signals[N_SIGNALS]; + +G_DEFINE_TYPE (GSettings, g_settings, G_TYPE_OBJECT) + +/* Signals {{{1 */ +static gboolean +g_settings_real_change_event (GSettings *settings, + const GQuark *keys, + gint n_keys) +{ + gint i; + + if (keys == NULL) + keys = g_settings_schema_list (settings->priv->schema, &n_keys); + + for (i = 0; i < n_keys; i++) + g_signal_emit (settings, g_settings_signals[SIGNAL_CHANGED], + keys[i], g_quark_to_string (keys[i])); + + return FALSE; +} + +static gboolean +g_settings_real_writable_change_event (GSettings *settings, + GQuark key) +{ + const GQuark *keys = &key; + gint n_keys = 1; + gint i; + + if (key == 0) + keys = g_settings_schema_list (settings->priv->schema, &n_keys); + + for (i = 0; i < n_keys; i++) + g_signal_emit (settings, g_settings_signals[SIGNAL_WRITABLE_CHANGED], + keys[i], g_quark_to_string (keys[i])); + + return FALSE; +} + +static void +settings_backend_changed (GObject *target, + GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + GSettings *settings = G_SETTINGS (target); + gboolean ignore_this; + gint i; + + g_assert (settings->priv->backend == backend); + + for (i = 0; key[i] == settings->priv->path[i]; i++); + + if (settings->priv->path[i] == '\0' && + g_settings_schema_has_key (settings->priv->schema, key + i)) + { + GQuark quark; + + quark = g_quark_from_string (key + i); + g_signal_emit (settings, g_settings_signals[SIGNAL_CHANGE_EVENT], + 0, &quark, 1, &ignore_this); + } +} + +static void +settings_backend_path_changed (GObject *target, + GSettingsBackend *backend, + const gchar *path, + gpointer origin_tag) +{ + GSettings *settings = G_SETTINGS (target); + gboolean ignore_this; + + g_assert (settings->priv->backend == backend); + + if (g_str_has_prefix (settings->priv->path, path)) + g_signal_emit (settings, g_settings_signals[SIGNAL_CHANGE_EVENT], + 0, NULL, 0, &ignore_this); +} + +static void +settings_backend_keys_changed (GObject *target, + GSettingsBackend *backend, + const gchar *path, + const gchar * const *items, + gpointer origin_tag) +{ + GSettings *settings = G_SETTINGS (target); + gboolean ignore_this; + gint i; + + g_assert (settings->priv->backend == backend); + + for (i = 0; settings->priv->path[i] && + settings->priv->path[i] == path[i]; i++); + + if (path[i] == '\0') + { + GQuark quarks[256]; + gint j, l = 0; + + for (j = 0; items[j]; j++) + { + const gchar *item = items[j]; + gint k; + + for (k = 0; item[k] == settings->priv->path[i + k]; k++); + + if (settings->priv->path[i + k] == '\0' && + g_settings_schema_has_key (settings->priv->schema, item + k)) + quarks[l++] = g_quark_from_string (item + k); + + /* "256 quarks ought to be enough for anybody!" + * If this bites you, I'm sorry. Please file a bug. + */ + g_assert (l < 256); + } + + if (l > 0) + g_signal_emit (settings, g_settings_signals[SIGNAL_CHANGE_EVENT], + 0, quarks, l, &ignore_this); + } +} + +static void +settings_backend_writable_changed (GObject *target, + GSettingsBackend *backend, + const gchar *key) +{ + GSettings *settings = G_SETTINGS (target); + gboolean ignore_this; + gint i; + + g_assert (settings->priv->backend == backend); + + for (i = 0; key[i] == settings->priv->path[i]; i++); + + if (settings->priv->path[i] == '\0' && + g_settings_schema_has_key (settings->priv->schema, key + i)) + g_signal_emit (settings, g_settings_signals[SIGNAL_WRITABLE_CHANGE_EVENT], + 0, g_quark_from_string (key + i), &ignore_this); +} + +static void +settings_backend_path_writable_changed (GObject *target, + GSettingsBackend *backend, + const gchar *path) +{ + GSettings *settings = G_SETTINGS (target); + gboolean ignore_this; + + g_assert (settings->priv->backend == backend); + + if (g_str_has_prefix (settings->priv->path, path)) + g_signal_emit (settings, g_settings_signals[SIGNAL_WRITABLE_CHANGE_EVENT], + 0, (GQuark) 0, &ignore_this); +} + +/* Properties, Construction, Destruction {{{1 */ +static void +g_settings_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GSettings *settings = G_SETTINGS (object); + + switch (prop_id) + { + case PROP_SCHEMA: + g_assert (settings->priv->schema_name == NULL); + settings->priv->schema_name = g_value_dup_string (value); + break; + + case PROP_PATH: + settings->priv->path = g_value_dup_string (value); + break; + + case PROP_BACKEND: + settings->priv->backend = g_value_dup_object (value); + break; + + default: + g_assert_not_reached (); + } +} + +static void +g_settings_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GSettings *settings = G_SETTINGS (object); + + switch (prop_id) + { + case PROP_SCHEMA: + g_value_set_string (value, settings->priv->schema_name); + break; + + case PROP_BACKEND: + g_value_set_object (value, settings->priv->backend); + break; + + case PROP_PATH: + g_value_set_string (value, settings->priv->path); + break; + + case PROP_HAS_UNAPPLIED: + g_value_set_boolean (value, g_settings_get_has_unapplied (settings)); + break; + + case PROP_DELAY_APPLY: + g_value_set_boolean (value, settings->priv->delayed != NULL); + break; + + default: + g_assert_not_reached (); + } +} + +static const GSettingsListenerVTable listener_vtable = { + settings_backend_changed, + settings_backend_path_changed, + settings_backend_keys_changed, + settings_backend_writable_changed, + settings_backend_path_writable_changed +}; + +static void +g_settings_constructed (GObject *object) +{ + GSettings *settings = G_SETTINGS (object); + const gchar *schema_path; + + settings->priv->schema = g_settings_schema_new (settings->priv->schema_name); + schema_path = g_settings_schema_get_path (settings->priv->schema); + + if (settings->priv->path && schema_path && strcmp (settings->priv->path, schema_path) != 0) + g_error ("settings object created with schema '%s' and path '%s', but " + "path '%s' is specified by schema", + settings->priv->schema_name, settings->priv->path, schema_path); + + if (settings->priv->path == NULL) + { + if (schema_path == NULL) + g_error ("attempting to create schema '%s' without a path", + settings->priv->schema_name); + + settings->priv->path = g_strdup (schema_path); + } + + if (settings->priv->backend == NULL) + settings->priv->backend = g_settings_backend_get_default (); + + g_settings_backend_watch (settings->priv->backend, + &listener_vtable, G_OBJECT (settings), + settings->priv->main_context); + g_settings_backend_subscribe (settings->priv->backend, + settings->priv->path); +} + +static void +g_settings_finalize (GObject *object) +{ + GSettings *settings = G_SETTINGS (object); + + g_settings_backend_unsubscribe (settings->priv->backend, + settings->priv->path); + g_main_context_unref (settings->priv->main_context); + g_object_unref (settings->priv->backend); + g_object_unref (settings->priv->schema); + g_free (settings->priv->schema_name); + g_free (settings->priv->path); + + G_OBJECT_CLASS (g_settings_parent_class)->finalize (object); +} + +static void +g_settings_init (GSettings *settings) +{ + settings->priv = G_TYPE_INSTANCE_GET_PRIVATE (settings, + G_TYPE_SETTINGS, + GSettingsPrivate); + + settings->priv->main_context = g_main_context_get_thread_default (); + + if (settings->priv->main_context == NULL) + settings->priv->main_context = g_main_context_default (); + + g_main_context_ref (settings->priv->main_context); +} + +static void +g_settings_class_init (GSettingsClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + class->writable_change_event = g_settings_real_writable_change_event; + class->change_event = g_settings_real_change_event; + + object_class->set_property = g_settings_set_property; + object_class->get_property = g_settings_get_property; + object_class->constructed = g_settings_constructed; + object_class->finalize = g_settings_finalize; + + g_type_class_add_private (object_class, sizeof (GSettingsPrivate)); + + /** + * GSettings::changed: + * @settings: the object on which the signal was emitted + * @key: the name of the key that changed + * + * The "changed" signal is emitted when a key has potentially changed. + * You should call one of the g_settings_get() calls to check the new + * value. + * + * This signal supports detailed connections. You can connect to the + * detailed signal "changed::x" in order to only receive callbacks + * when key "x" changes. + */ + g_settings_signals[SIGNAL_CHANGED] = + g_signal_new ("changed", G_TYPE_SETTINGS, + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (GSettingsClass, changed), + NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, + 1, G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE); + + /** + * GSettings::change-event: + * @settings: the object on which the signal was emitted + * @keys: an array of #GQuarks for the changed keys, or %NULL + * @n_keys: the length of the @keys array, or 0 + * @returns: %TRUE to stop other handlers from being invoked for the + * event. FALSE to propagate the event further. + * + * The "change-event" signal is emitted once per change event that + * affects this settings object. You should connect to this signal + * only if you are interested in viewing groups of changes before they + * are split out into multiple emissions of the "changed" signal. + * For most use cases it is more appropriate to use the "changed" signal. + * + * In the event that the change event applies to one or more specified + * keys, @keys will be an array of #GQuark of length @n_keys. In the + * event that the change event applies to the #GSettings object as a + * whole (ie: potentially every key has been changed) then @keys will + * be %NULL and @n_keys will be 0. + * + * The default handler for this signal invokes the "changed" signal + * for each affected key. If any other connected handler returns + * %TRUE then this default functionality will be supressed. + */ + g_settings_signals[SIGNAL_CHANGE_EVENT] = + g_signal_new ("change-event", G_TYPE_SETTINGS, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSettingsClass, change_event), + g_signal_accumulator_true_handled, NULL, + _gio_marshal_BOOL__POINTER_INT, + G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_INT); + + /** + * GSettings::writable-changed: + * @settings: the object on which the signal was emitted + * @key: the key + * + * The "writable-changed" signal is emitted when the writability of a + * key has potentially changed. You should call + * g_settings_is_writable() in order to determine the new status. + * + * This signal supports detailed connections. You can connect to the + * detailed signal "writable-changed::x" in order to only receive + * callbacks when the writability of "x" changes. + */ + g_settings_signals[SIGNAL_WRITABLE_CHANGED] = + g_signal_new ("writable-changed", G_TYPE_SETTINGS, + G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, + G_STRUCT_OFFSET (GSettingsClass, changed), + NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, + 1, G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE); + + /** + * GSettings::writable-change-event: + * @settings: the object on which the signal was emitted + * @key: the quark of the key, or 0 + * @returns: %TRUE to stop other handlers from being invoked for the + * event. FALSE to propagate the event further. + * + * The "writable-change-event" signal is emitted once per writability + * change event that affects this settings object. You should connect + * to this signal if you are interested in viewing groups of changes + * before they are split out into multiple emissions of the + * "writable-changed" signal. For most use cases it is more + * appropriate to use the "writable-changed" signal. + * + * In the event that the writability change applies only to a single + * key, @key will be set to the #GQuark for that key. In the event + * that the writability change affects the entire settings object, + * @key will be 0. + * + * The default handler for this signal invokes the "writable-changed" + * and "changed" signals for each affected key. This is done because + * changes in writability might also imply changes in value (if for + * example, a new mandatory setting is introduced). If any other + * connected handler returns %TRUE then this default functionality + * will be supressed. + */ + g_settings_signals[SIGNAL_WRITABLE_CHANGE_EVENT] = + g_signal_new ("writable-change-event", G_TYPE_SETTINGS, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSettingsClass, writable_change_event), + g_signal_accumulator_true_handled, NULL, + _gio_marshal_BOOLEAN__UINT, G_TYPE_BOOLEAN, 1, G_TYPE_UINT); + + /** + * GSettings:context: + * + * The name of the context that the settings are stored in. + */ + g_object_class_install_property (object_class, PROP_BACKEND, + g_param_spec_object ("backend", + P_("GSettingsBackend"), + P_("The GSettingsBackend for this settings object"), + G_TYPE_SETTINGS_BACKEND, G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GSettings:schema: + * + * The name of the schema that describes the types of keys + * for this #GSettings object. + */ + g_object_class_install_property (object_class, PROP_SCHEMA, + g_param_spec_string ("schema", + P_("Schema name"), + P_("The name of the schema for this settings object"), + NULL, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GSettings:path: + * + * The path within the backend where the settings are stored. + */ + g_object_class_install_property (object_class, PROP_PATH, + g_param_spec_string ("path", + P_("Base path"), + P_("The path within the backend where the settings are"), + NULL, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GSettings:has-unapplied: + * + * If this property is %TRUE, the #GSettings object has outstanding + * changes that will be applied when g_settings_apply() is called. + */ + g_object_class_install_property (object_class, PROP_HAS_UNAPPLIED, + g_param_spec_boolean ("has-unapplied", + P_("Has unapplied changes"), + P_("TRUE if there are outstanding changes to apply()"), + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GSettings:delay-apply: + * + * Whether the #GSettings object is in 'delay-apply' mode. See + * g_settings_delay() for details. + * + * Since: 2.28 + */ + g_object_class_install_property (object_class, PROP_DELAY_APPLY, + g_param_spec_boolean ("delay-apply", + P_("Delay-apply mode"), + P_("Whether this settings object is in 'delay-apply' mode"), + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +/* Construction (new, new_with_path, etc.) {{{1 */ +/** + * g_settings_new: + * @schema: the name of the schema + * @returns: a new #GSettings object + * + * Creates a new #GSettings object with a given schema. + * + * Signals on the newly created #GSettings object will be dispatched + * via the thread-default #GMainContext in effect at the time of the + * call to g_settings_new(). The new #GSettings will hold a reference + * on the context. See g_main_context_push_thread_default(). + * + * Since: 2.26 + */ +GSettings * +g_settings_new (const gchar *schema) +{ + g_return_val_if_fail (schema != NULL, NULL); + + return g_object_new (G_TYPE_SETTINGS, + "schema", schema, + NULL); +} + +/** + * g_settings_new_with_path: + * @schema: the name of the schema + * @path: the path to use + * @returns: a new #GSettings object + * + * Creates a new #GSettings object with a given schema and path. + * + * You only need to do this if you want to directly create a settings + * object with a schema that doesn't have a specified path of its own. + * That's quite rare. + * + * It is a programmer error to call this function for a schema that + * has an explicitly specified path. + * + * Since: 2.26 + */ +GSettings * +g_settings_new_with_path (const gchar *schema, + const gchar *path) +{ + g_return_val_if_fail (schema != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (G_TYPE_SETTINGS, + "schema", schema, + "path", path, + NULL); +} + +/** + * g_settings_new_with_backend: + * @schema: the name of the schema + * @backend: the #GSettingsBackend to use + * @returns: a new #GSettings object + * + * Creates a new #GSettings object with a given schema and backend. + * + * Creating settings objects with an different backend allows accessing settings + * from a database other than the usual one. For example, it may make + * sense to pass a backend corresponding to the "defaults" settings database on + * the system to get a settings object that modifies the system default + * settings instead of the settings for this user. + * + * Since: 2.26 + */ +GSettings * +g_settings_new_with_backend (const gchar *schema, + GSettingsBackend *backend) +{ + g_return_val_if_fail (schema != NULL, NULL); + g_return_val_if_fail (G_IS_SETTINGS_BACKEND (backend), NULL); + + return g_object_new (G_TYPE_SETTINGS, + "schema", schema, + "backend", backend, + NULL); +} + +/** + * g_settings_new_with_backend_and_path: + * @schema: the name of the schema + * @backend: the #GSettingsBackend to use + * @path: the path to use + * @returns: a new #GSettings object + * + * Creates a new #GSettings object with a given schema, backend and + * path. + * + * This is a mix of g_settings_new_with_backend() and + * g_settings_new_with_path(). + * + * Since: 2.26 + */ +GSettings * +g_settings_new_with_backend_and_path (const gchar *schema, + GSettingsBackend *backend, + const gchar *path) +{ + g_return_val_if_fail (schema != NULL, NULL); + g_return_val_if_fail (G_IS_SETTINGS_BACKEND (backend), NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (G_TYPE_SETTINGS, + "schema", schema, + "backend", backend, + "path", path, + NULL); +} + +/* Internal read/write utilities, enum/flags conversion, validation {{{1 */ +typedef struct +{ + GSettings *settings; + const gchar *key; + + GSettingsSchema *schema; + + guint is_flags : 1; + guint is_enum : 1; + + const guint32 *strinfo; + gsize strinfo_length; + + const gchar *unparsed; + gchar lc_char; + + const GVariantType *type; + GVariant *minimum, *maximum; + GVariant *default_value; +} GSettingsKeyInfo; + +static inline void +endian_fixup (GVariant **value) +{ +#if G_BYTE_ORDER == G_BIG_ENDIAN + GVariant *tmp; + + tmp = g_variant_byteswap (*value); + g_variant_unref (*value); + *value = tmp; +#endif +} + +static void +g_settings_get_key_info (GSettingsKeyInfo *info, + GSettings *settings, + const gchar *key) +{ + GVariantIter *iter; + GVariant *data; + guchar code; + + memset (info, 0, sizeof *info); + + iter = g_settings_schema_get_value (settings->priv->schema, key); + + info->default_value = g_variant_iter_next_value (iter); + endian_fixup (&info->default_value); + info->type = g_variant_get_type (info->default_value); + info->settings = g_object_ref (settings); + info->key = g_intern_string (key); + + while (g_variant_iter_next (iter, "(y*)", &code, &data)) + { + switch (code) + { + case 'l': + /* translation requested */ + g_variant_get (data, "(y&s)", &info->lc_char, &info->unparsed); + break; + + case 'e': + /* enumerated types... */ + info->is_enum = TRUE; + goto choice; + + case 'f': + /* flags... */ + info->is_flags = TRUE; + goto choice; + + choice: case 'c': + /* ..., choices, aliases */ + info->strinfo = g_variant_get_fixed_array (data, + &info->strinfo_length, + sizeof (guint32)); + break; + + case 'r': + g_variant_get (data, "(**)", &info->minimum, &info->maximum); + endian_fixup (&info->minimum); + endian_fixup (&info->maximum); + break; + + default: + g_warning ("unknown schema extension '%c'", code); + break; + } + + g_variant_unref (data); + } + + g_variant_iter_free (iter); +} + +static void +g_settings_free_key_info (GSettingsKeyInfo *info) +{ + if (info->minimum) + g_variant_unref (info->minimum); + + if (info->maximum) + g_variant_unref (info->maximum); + + g_variant_unref (info->default_value); + g_object_unref (info->settings); +} + +static gboolean +g_settings_write_to_backend (GSettingsKeyInfo *info, + GVariant *value) +{ + gboolean success; + gchar *path; + + path = g_strconcat (info->settings->priv->path, info->key, NULL); + success = g_settings_backend_write (info->settings->priv->backend, + path, value, NULL); + g_free (path); + + return success; +} + +static gboolean +g_settings_type_check (GSettingsKeyInfo *info, + GVariant *value) +{ + g_return_val_if_fail (value != NULL, FALSE); + + return g_variant_is_of_type (value, info->type); +} + +static gboolean +g_settings_key_info_range_check (GSettingsKeyInfo *info, + GVariant *value) +{ + if (info->minimum == NULL && info->strinfo == NULL) + return TRUE; + + if (g_variant_is_container (value)) + { + gboolean ok = TRUE; + GVariantIter iter; + GVariant *child; + + g_variant_iter_init (&iter, value); + while (ok && (child = g_variant_iter_next_value (&iter))) + { + ok = g_settings_key_info_range_check (info, child); + g_variant_unref (child); + } + + return ok; + } + + if (info->minimum) + { + return g_variant_compare (info->minimum, value) <= 0 && + g_variant_compare (value, info->maximum) <= 0; + } + + return strinfo_is_string_valid (info->strinfo, + info->strinfo_length, + g_variant_get_string (value, NULL)); +} + +static GVariant * +g_settings_range_fixup (GSettingsKeyInfo *info, + GVariant *value) +{ + const gchar *target; + + if (g_settings_key_info_range_check (info, value)) + return g_variant_ref (value); + + if (info->strinfo == NULL) + return NULL; + + if (g_variant_is_container (value)) + { + GVariantBuilder builder; + GVariantIter iter; + GVariant *child; + + g_variant_iter_init (&iter, value); + g_variant_builder_init (&builder, g_variant_get_type (value)); + + while ((child = g_variant_iter_next_value (&iter))) + { + GVariant *fixed; + + fixed = g_settings_range_fixup (info, child); + g_variant_unref (child); + + if (fixed == NULL) + { + g_variant_builder_clear (&builder); + return NULL; + } + + g_variant_builder_add_value (&builder, fixed); + g_variant_unref (fixed); + } + + return g_variant_ref_sink (g_variant_builder_end (&builder)); + } + + target = strinfo_string_from_alias (info->strinfo, info->strinfo_length, + g_variant_get_string (value, NULL)); + return target ? g_variant_ref_sink (g_variant_new_string (target)) : NULL; +} + +static GVariant * +g_settings_read_from_backend (GSettingsKeyInfo *info) +{ + GVariant *value; + GVariant *fixup; + gchar *path; + + path = g_strconcat (info->settings->priv->path, info->key, NULL); + value = g_settings_backend_read (info->settings->priv->backend, + path, info->type, FALSE); + g_free (path); + + if (value != NULL) + { + fixup = g_settings_range_fixup (info, value); + g_variant_unref (value); + } + else + fixup = NULL; + + return fixup; +} + +static GVariant * +g_settings_get_translated_default (GSettingsKeyInfo *info) +{ + const gchar *translated; + GError *error = NULL; + const gchar *domain; + GVariant *value; + + if (info->lc_char == '\0') + /* translation not requested for this key */ + return NULL; + + domain = g_settings_schema_get_gettext_domain (info->settings->priv->schema); + + if (info->lc_char == 't') + translated = g_dcgettext (domain, info->unparsed, LC_TIME); + else + translated = g_dgettext (domain, info->unparsed); + + if (translated == info->unparsed) + /* the default value was not translated */ + return NULL; + + /* try to parse the translation of the unparsed default */ + value = g_variant_parse (info->type, translated, NULL, NULL, &error); + + if (value == NULL) + { + g_warning ("Failed to parse translated string `%s' for " + "key `%s' in schema `%s': %s", info->unparsed, info->key, + info->settings->priv->schema_name, error->message); + g_warning ("Using untranslated default instead."); + g_error_free (error); + } + + else if (!g_settings_key_info_range_check (info, value)) + { + g_warning ("Translated default `%s' for key `%s' in schema `%s' " + "is outside of valid range", info->unparsed, info->key, + info->settings->priv->schema_name); + g_variant_unref (value); + value = NULL; + } + + return value; +} + +static gint +g_settings_to_enum (GSettingsKeyInfo *info, + GVariant *value) +{ + gboolean it_worked; + guint result; + + it_worked = strinfo_enum_from_string (info->strinfo, info->strinfo_length, + g_variant_get_string (value, NULL), + &result); + + /* 'value' can only come from the backend after being filtered for validity, + * from the translation after being filtered for validity, or from the schema + * itself (which the schema compiler checks for validity). If this assertion + * fails then it's really a bug in GSettings or the schema compiler... + */ + g_assert (it_worked); + + return result; +} + +static GVariant * +g_settings_from_enum (GSettingsKeyInfo *info, + gint value) +{ + const gchar *string; + + string = strinfo_string_from_enum (info->strinfo, + info->strinfo_length, + value); + + if (string == NULL) + return NULL; + + return g_variant_new_string (string); +} + +static guint +g_settings_to_flags (GSettingsKeyInfo *info, + GVariant *value) +{ + GVariantIter iter; + const gchar *flag; + guint result; + + result = 0; + g_variant_iter_init (&iter, value); + while (g_variant_iter_next (&iter, "&s", &flag)) + { + gboolean it_worked; + guint flag_value; + + it_worked = strinfo_enum_from_string (info->strinfo, + info->strinfo_length, + flag, &flag_value); + /* as in g_settings_to_enum() */ + g_assert (it_worked); + + result |= flag_value; + } + + return result; +} + +static GVariant * +g_settings_from_flags (GSettingsKeyInfo *info, + guint value) +{ + GVariantBuilder builder; + gint i; + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("as")); + + for (i = 0; i < 32; i++) + if (value & (1u << i)) + { + const gchar *string; + + string = strinfo_string_from_enum (info->strinfo, + info->strinfo_length, + 1u << i); + + if (string == NULL) + { + g_variant_builder_clear (&builder); + return NULL; + } + + g_variant_builder_add (&builder, "s", string); + } + + return g_variant_builder_end (&builder); +} + +/* Public Get/Set API {{{1 (get, get_value, set, set_value, get_mapped) */ +/** + * g_settings_get_value: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: a new #GVariant + * + * Gets the value that is stored in @settings for @key. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings. + * + * Since: 2.26 + */ +GVariant * +g_settings_get_value (GSettings *settings, + const gchar *key) +{ + GSettingsKeyInfo info; + GVariant *value; + + g_return_val_if_fail (G_IS_SETTINGS (settings), NULL); + g_return_val_if_fail (key != NULL, NULL); + + g_settings_get_key_info (&info, settings, key); + value = g_settings_read_from_backend (&info); + + if (value == NULL) + value = g_settings_get_translated_default (&info); + + if (value == NULL) + value = g_variant_ref (info.default_value); + + g_settings_free_key_info (&info); + + return value; +} + +/** + * g_settings_get_enum: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: the enum value + * + * Gets the value that is stored in @settings for @key and converts it + * to the enum value that it represents. + * + * In order to use this function the type of the value must be a string + * and it must be marked in the schema file as an enumerated type. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or is not marked as an enumerated type. + * + * If the value stored in the configuration database is not a valid + * value for the enumerated type then this function will return the + * default value. + * + * Since: 2.26 + **/ +gint +g_settings_get_enum (GSettings *settings, + const gchar *key) +{ + GSettingsKeyInfo info; + GVariant *value; + gint result; + + g_return_val_if_fail (G_IS_SETTINGS (settings), -1); + g_return_val_if_fail (key != NULL, -1); + + g_settings_get_key_info (&info, settings, key); + + if (!info.is_enum) + { + g_critical ("g_settings_get_enum() called on key `%s' which is not " + "associated with an enumerated type", info.key); + g_settings_free_key_info (&info); + return -1; + } + + value = g_settings_read_from_backend (&info); + + if (value == NULL) + value = g_settings_get_translated_default (&info); + + if (value == NULL) + value = g_variant_ref (info.default_value); + + result = g_settings_to_enum (&info, value); + g_settings_free_key_info (&info); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_enum: + * @settings: a #GSettings object + * @key: a key, within @settings + * @value: an enumerated value + * @returns: %TRUE, if the set succeeds + * + * Looks up the enumerated type nick for @value and writes it to @key, + * within @settings. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or is not marked as an enumerated type, or for + * @value not to be a valid value for the named type. + * + * After performing the write, accessing @key directly with + * g_settings_get_string() will return the 'nick' associated with + * @value. + **/ +gboolean +g_settings_set_enum (GSettings *settings, + const gchar *key, + gint value) +{ + GSettingsKeyInfo info; + GVariant *variant; + gboolean success; + + g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + + g_settings_get_key_info (&info, settings, key); + + if (!info.is_enum) + { + g_critical ("g_settings_set_enum() called on key `%s' which is not " + "associated with an enumerated type", info.key); + return FALSE; + } + + if (!(variant = g_settings_from_enum (&info, value))) + { + g_critical ("g_settings_set_enum(): invalid enum value %d for key `%s' " + "in schema `%s'. Doing nothing.", value, info.key, + info.settings->priv->schema_name); + g_settings_free_key_info (&info); + return FALSE; + } + + success = g_settings_write_to_backend (&info, variant); + g_settings_free_key_info (&info); + + return success; +} + +/** + * g_settings_get_flags: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: the flags value + * + * Gets the value that is stored in @settings for @key and converts it + * to the flags value that it represents. + * + * In order to use this function the type of the value must be an array + * of strings and it must be marked in the schema file as an flags type. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or is not marked as a flags type. + * + * If the value stored in the configuration database is not a valid + * value for the flags type then this function will return the default + * value. + * + * Since: 2.26 + **/ +guint +g_settings_get_flags (GSettings *settings, + const gchar *key) +{ + GSettingsKeyInfo info; + GVariant *value; + guint result; + + g_return_val_if_fail (G_IS_SETTINGS (settings), -1); + g_return_val_if_fail (key != NULL, -1); + + g_settings_get_key_info (&info, settings, key); + + if (!info.is_flags) + { + g_critical ("g_settings_get_flags() called on key `%s' which is not " + "associated with a flags type", info.key); + g_settings_free_key_info (&info); + return -1; + } + + value = g_settings_read_from_backend (&info); + + if (value == NULL) + value = g_settings_get_translated_default (&info); + + if (value == NULL) + value = g_variant_ref (info.default_value); + + result = g_settings_to_flags (&info, value); + g_settings_free_key_info (&info); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_flags: + * @settings: a #GSettings object + * @key: a key, within @settings + * @value: a flags value + * @returns: %TRUE, if the set succeeds + * + * Looks up the flags type nicks for the bits specified by @value, puts + * them in an array of strings and writes the array to @key, withing + * @settings. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or is not marked as a flags type, or for @value + * to contain any bits that are not value for the named type. + * + * After performing the write, accessing @key directly with + * g_settings_get_strv() will return an array of 'nicks'; one for each + * bit in @value. + **/ +gboolean +g_settings_set_flags (GSettings *settings, + const gchar *key, + guint value) +{ + GSettingsKeyInfo info; + GVariant *variant; + gboolean success; + + g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + + g_settings_get_key_info (&info, settings, key); + + if (!info.is_flags) + { + g_critical ("g_settings_set_flags() called on key `%s' which is not " + "associated with a flags type", info.key); + return FALSE; + } + + if (!(variant = g_settings_from_flags (&info, value))) + { + g_critical ("g_settings_set_flags(): invalid flags value 0x%08x " + "for key `%s' in schema `%s'. Doing nothing.", + value, info.key, info.settings->priv->schema_name); + g_settings_free_key_info (&info); + return FALSE; + } + + success = g_settings_write_to_backend (&info, variant); + g_settings_free_key_info (&info); + + return success; +} + +/** + * g_settings_set_value: + * @settings: a #GSettings object + * @key: the name of the key to set + * @value: a #GVariant of the correct type + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or for @value to have the incorrect type, per + * the schema. + * + * If @value is floating then this function consumes the reference. + * + * Since: 2.26 + **/ +gboolean +g_settings_set_value (GSettings *settings, + const gchar *key, + GVariant *value) +{ + GSettingsKeyInfo info; + + g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + + g_settings_get_key_info (&info, settings, key); + + if (!g_settings_type_check (&info, value)) + { + g_critical ("g_settings_set_value: key '%s' in '%s' expects type '%s', but a GVariant of type '%s' was given", + key, + settings->priv->schema_name, + g_variant_type_peek_string (info.type), + g_variant_get_type_string (value)); + + return FALSE; + } + + if (!g_settings_key_info_range_check (&info, value)) + { + g_warning ("g_settings_set_value: value for key '%s' in schema '%s' " + "is outside of valid range", + key, + settings->priv->schema_name); + + return FALSE; + } + + g_settings_free_key_info (&info); + + return g_settings_write_to_backend (&info, value); +} + +/** + * g_settings_get: + * @settings: a #GSettings object + * @key: the key to get the value for + * @format: a #GVariant format string + * @...: arguments as per @format + * + * Gets the value that is stored at @key in @settings. + * + * A convenience function that combines g_settings_get_value() with + * g_variant_get(). + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or for the #GVariantType of @format to mismatch + * the type given in the schema. + * + * Since: 2.26 + */ +void +g_settings_get (GSettings *settings, + const gchar *key, + const gchar *format, + ...) +{ + GVariant *value; + va_list ap; + + value = g_settings_get_value (settings, key); + + va_start (ap, format); + g_variant_get_va (value, format, NULL, &ap); + va_end (ap); + + g_variant_unref (value); +} + +/** + * g_settings_set: + * @settings: a #GSettings object + * @key: the name of the key to set + * @format: a #GVariant format string + * @...: arguments as per @format + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * A convenience function that combines g_settings_set_value() with + * g_variant_new(). + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings or for the #GVariantType of @format to mismatch + * the type given in the schema. + * + * Since: 2.26 + */ +gboolean +g_settings_set (GSettings *settings, + const gchar *key, + const gchar *format, + ...) +{ + GVariant *value; + va_list ap; + + va_start (ap, format); + value = g_variant_new_va (format, NULL, &ap); + va_end (ap); + + return g_settings_set_value (settings, key, value); +} + +/** + * g_settings_get_mapped: + * @settings: a #GSettings object + * @key: the key to get the value for + * @mapping: the function to map the value in the settings database to + * the value used by the application + * @user_data: user data for @mapping + * @returns: (transfer full): the result, which may be %NULL + * + * Gets the value that is stored at @key in @settings, subject to + * application-level validation/mapping. + * + * You should use this function when the application needs to perform + * some processing on the value of the key (for example, parsing). The + * @mapping function performs that processing. If the function + * indicates that the processing was unsuccessful (due to a parse error, + * for example) then the mapping is tried again with another value. + + * This allows a robust 'fall back to defaults' behaviour to be + * implemented somewhat automatically. + * + * The first value that is tried is the user's setting for the key. If + * the mapping function fails to map this value, other values may be + * tried in an unspecified order (system or site defaults, translated + * schema default values, untranslated schema default values, etc). + * + * If the mapping function fails for all possible values, one additional + * attempt is made: the mapping function is called with a %NULL value. + * If the mapping function still indicates failure at this point then + * the application will be aborted. + * + * The result parameter for the @mapping function is pointed to a + * #gpointer which is initially set to %NULL. The same pointer is given + * to each invocation of @mapping. The final value of that #gpointer is + * what is returned by this function. %NULL is valid; it is returned + * just as any other value would be. + **/ +gpointer +g_settings_get_mapped (GSettings *settings, + const gchar *key, + GSettingsGetMapping mapping, + gpointer user_data) +{ + gpointer result = NULL; + GSettingsKeyInfo info; + GVariant *value; + gboolean okay; + + g_return_val_if_fail (G_IS_SETTINGS (settings), NULL); + g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (mapping != NULL, NULL); + + g_settings_get_key_info (&info, settings, key); + + if ((value = g_settings_read_from_backend (&info))) + { + okay = mapping (value, &result, user_data); + g_variant_unref (value); + if (okay) goto okay; + } + + if ((value = g_settings_get_translated_default (&info))) + { + okay = mapping (value, &result, user_data); + g_variant_unref (value); + if (okay) goto okay; + } + + if (mapping (info.default_value, &result, user_data)) + goto okay; + + if (!mapping (NULL, &result, user_data)) + g_error ("The mapping function given to g_settings_get_mapped() for key " + "`%s' in schema `%s' returned FALSE when given a NULL value.", + key, settings->priv->schema_name); + + okay: + g_settings_free_key_info (&info); + + return result; +} + +/* Convenience API (get, set_string, int, double, boolean, strv) {{{1 */ +/** + * g_settings_get_string: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: a newly-allocated string + * + * Gets the value that is stored at @key in @settings. + * + * A convenience variant of g_settings_get() for strings. + * + * It is a programmer error to give a @key that isn't specified as + * having a string type in the schema for @settings. + * + * Since: 2.26 + */ +gchar * +g_settings_get_string (GSettings *settings, + const gchar *key) +{ + GVariant *value; + gchar *result; + + value = g_settings_get_value (settings, key); + result = g_variant_dup_string (value, NULL); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_string: + * @settings: a #GSettings object + * @key: the name of the key to set + * @value: the value to set it to + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * A convenience variant of g_settings_set() for strings. + * + * It is a programmer error to give a @key that isn't specified as + * having a string type in the schema for @settings. + * + * Since: 2.26 + */ +gboolean +g_settings_set_string (GSettings *settings, + const gchar *key, + const gchar *value) +{ + return g_settings_set_value (settings, key, g_variant_new_string (value)); +} + +/** + * g_settings_get_int: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: an integer + * + * Gets the value that is stored at @key in @settings. + * + * A convenience variant of g_settings_get() for 32-bit integers. + * + * It is a programmer error to give a @key that isn't specified as + * having a int32 type in the schema for @settings. + * + * Since: 2.26 + */ +gint +g_settings_get_int (GSettings *settings, + const gchar *key) +{ + GVariant *value; + gint result; + + value = g_settings_get_value (settings, key); + result = g_variant_get_int32 (value); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_int: + * @settings: a #GSettings object + * @key: the name of the key to set + * @value: the value to set it to + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * A convenience variant of g_settings_set() for 32-bit integers. + * + * It is a programmer error to give a @key that isn't specified as + * having a int32 type in the schema for @settings. + * + * Since: 2.26 + */ +gboolean +g_settings_set_int (GSettings *settings, + const gchar *key, + gint value) +{ + return g_settings_set_value (settings, key, g_variant_new_int32 (value)); +} + +/** + * g_settings_get_double: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: a double + * + * Gets the value that is stored at @key in @settings. + * + * A convenience variant of g_settings_get() for doubles. + * + * It is a programmer error to give a @key that isn't specified as + * having a 'double' type in the schema for @settings. + * + * Since: 2.26 + */ +gdouble +g_settings_get_double (GSettings *settings, + const gchar *key) +{ + GVariant *value; + gdouble result; + + value = g_settings_get_value (settings, key); + result = g_variant_get_double (value); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_double: + * @settings: a #GSettings object + * @key: the name of the key to set + * @value: the value to set it to + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * A convenience variant of g_settings_set() for doubles. + * + * It is a programmer error to give a @key that isn't specified as + * having a 'double' type in the schema for @settings. + * + * Since: 2.26 + */ +gboolean +g_settings_set_double (GSettings *settings, + const gchar *key, + gdouble value) +{ + return g_settings_set_value (settings, key, g_variant_new_double (value)); +} + +/** + * g_settings_get_boolean: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: a boolean + * + * Gets the value that is stored at @key in @settings. + * + * A convenience variant of g_settings_get() for booleans. + * + * It is a programmer error to give a @key that isn't specified as + * having a boolean type in the schema for @settings. + * + * Since: 2.26 + */ +gboolean +g_settings_get_boolean (GSettings *settings, + const gchar *key) +{ + GVariant *value; + gboolean result; + + value = g_settings_get_value (settings, key); + result = g_variant_get_boolean (value); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_boolean: + * @settings: a #GSettings object + * @key: the name of the key to set + * @value: the value to set it to + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * A convenience variant of g_settings_set() for booleans. + * + * It is a programmer error to give a @key that isn't specified as + * having a boolean type in the schema for @settings. + * + * Since: 2.26 + */ +gboolean +g_settings_set_boolean (GSettings *settings, + const gchar *key, + gboolean value) +{ + return g_settings_set_value (settings, key, g_variant_new_boolean (value)); +} + +/** + * g_settings_get_strv: + * @settings: a #GSettings object + * @key: the key to get the value for + * @returns: a newly-allocated, %NULL-terminated array of strings + * + * A convenience variant of g_settings_get() for string arrays. + * + * It is a programmer error to give a @key that isn't specified as + * having an array of strings type in the schema for @settings. + * + * Returns: (array zero-terminated=1) (transfer full): the value that is + * stored at @key in @settings. + * + * Since: 2.26 + */ +gchar ** +g_settings_get_strv (GSettings *settings, + const gchar *key) +{ + GVariant *value; + gchar **result; + + value = g_settings_get_value (settings, key); + result = g_variant_dup_strv (value, NULL); + g_variant_unref (value); + + return result; +} + +/** + * g_settings_set_strv: + * @settings: a #GSettings object + * @key: the name of the key to set + * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL + * @returns: %TRUE if setting the key succeeded, + * %FALSE if the key was not writable + * + * Sets @key in @settings to @value. + * + * A convenience variant of g_settings_set() for string arrays. If + * @value is %NULL, then @key is set to be the empty array. + * + * It is a programmer error to give a @key that isn't specified as + * having an array of strings type in the schema for @settings. + * + * Since: 2.26 + */ +gboolean +g_settings_set_strv (GSettings *settings, + const gchar *key, + const gchar * const *value) +{ + GVariant *array; + + if (value != NULL) + array = g_variant_new_strv (value, -1); + else + array = g_variant_new_strv (NULL, 0); + + return g_settings_set_value (settings, key, array); +} + +/* Delayed apply (delay, apply, revert, get_has_unapplied) {{{1 */ +/** + * g_settings_delay: + * @settings: a #GSettings object + * + * Changes the #GSettings object into 'delay-apply' mode. In this + * mode, changes to @settings are not immediately propagated to the + * backend, but kept locally until g_settings_apply() is called. + * + * Since: 2.26 + */ +void +g_settings_delay (GSettings *settings) +{ + g_return_if_fail (G_IS_SETTINGS (settings)); + + if (settings->priv->delayed) + return; + + settings->priv->delayed = + g_delayed_settings_backend_new (settings->priv->backend, + settings, + settings->priv->main_context); + g_settings_backend_unwatch (settings->priv->backend, G_OBJECT (settings)); + g_object_unref (settings->priv->backend); + + settings->priv->backend = G_SETTINGS_BACKEND (settings->priv->delayed); + g_settings_backend_watch (settings->priv->backend, + &listener_vtable, G_OBJECT (settings), + settings->priv->main_context); + + g_object_notify (G_OBJECT (settings), "delay-apply"); +} + +/** + * g_settings_apply: + * @settings: a #GSettings instance + * + * Applies any changes that have been made to the settings. This + * function does nothing unless @settings is in 'delay-apply' mode; + * see g_settings_delay(). In the normal case settings are always + * applied immediately. + **/ +void +g_settings_apply (GSettings *settings) +{ + if (settings->priv->delayed) + { + GDelayedSettingsBackend *delayed; + + delayed = G_DELAYED_SETTINGS_BACKEND (settings->priv->backend); + g_delayed_settings_backend_apply (delayed); + } +} + +/** + * g_settings_revert: + * @settings: a #GSettings instance + * + * Reverts all non-applied changes to the settings. This function + * does nothing unless @settings is in 'delay-apply' mode; see + * g_settings_delay(). In the normal case settings are always applied + * immediately. + * + * Change notifications will be emitted for affected keys. + **/ +void +g_settings_revert (GSettings *settings) +{ + if (settings->priv->delayed) + { + GDelayedSettingsBackend *delayed; + + delayed = G_DELAYED_SETTINGS_BACKEND (settings->priv->backend); + g_delayed_settings_backend_revert (delayed); + } +} + +/** + * g_settings_get_has_unapplied: + * @settings: a #GSettings object + * @returns: %TRUE if @settings has unapplied changes + * + * Returns whether the #GSettings object has any unapplied + * changes. This can only be the case if it is in 'delayed-apply' mode. + * + * Since: 2.26 + */ +gboolean +g_settings_get_has_unapplied (GSettings *settings) +{ + g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE); + + return settings->priv->delayed && + g_delayed_settings_backend_get_has_unapplied ( + G_DELAYED_SETTINGS_BACKEND (settings->priv->backend)); +} + +/* Extra API (reset, sync, get_child, is_writable, list_*, ranges) {{{1 */ +/** + * g_settings_reset: + * @settings: a #GSettings object + * @key: the name of a key + * + * Resets @key to its default value. + * + * This call resets the key, as much as possible, to its default value. + * That might the value specified in the schema or the one set by the + * administrator. + **/ +void +g_settings_reset (GSettings *settings, + const gchar *key) +{ + gchar *path; + + path = g_strconcat (settings->priv->path, key, NULL); + g_settings_backend_reset (settings->priv->backend, path, NULL); + g_free (path); +} + +/** + * g_settings_sync: + * + * Ensures that all pending operations for the given are complete for + * the default backend. + * + * Writes made to a #GSettings are handled asynchronously. For this + * reason, it is very unlikely that the changes have it to disk by the + * time g_settings_set() returns. + * + * This call will block until all of the writes have made it to the + * backend. Since the mainloop is not running, no change notifications + * will be dispatched during this call (but some may be queued by the + * time the call is done). + **/ +void +g_settings_sync (void) +{ + g_settings_backend_sync_default (); +} + +/** + * g_settings_is_writable: + * @settings: a #GSettings object + * @name: the name of a key + * @returns: %TRUE if the key @name is writable + * + * Finds out if a key can be written or not + * + * Since: 2.26 + */ +gboolean +g_settings_is_writable (GSettings *settings, + const gchar *name) +{ + gboolean writable; + gchar *path; + + g_return_val_if_fail (G_IS_SETTINGS (settings), FALSE); + + path = g_strconcat (settings->priv->path, name, NULL); + writable = g_settings_backend_get_writable (settings->priv->backend, path); + g_free (path); + + return writable; +} + +/** + * g_settings_get_child: + * @settings: a #GSettings object + * @name: the name of the 'child' schema + * @returns: (transfer full): a 'child' settings object + * + * Creates a 'child' settings object which has a base path of + * base-path/@name", where + * base-path is the base path of @settings. + * + * The schema for the child settings object must have been declared + * in the schema of @settings using a child element. + * + * Since: 2.26 + */ +GSettings * +g_settings_get_child (GSettings *settings, + const gchar *name) +{ + const gchar *child_schema; + gchar *child_path; + gchar *child_name; + GSettings *child; + + g_return_val_if_fail (G_IS_SETTINGS (settings), NULL); + + child_name = g_strconcat (name, "/", NULL); + child_schema = g_settings_schema_get_string (settings->priv->schema, + child_name); + if (child_schema == NULL) + g_error ("Schema '%s' has no child '%s'", + settings->priv->schema_name, name); + + child_path = g_strconcat (settings->priv->path, child_name, NULL); + child = g_object_new (G_TYPE_SETTINGS, + "schema", child_schema, + "path", child_path, + NULL); + g_free (child_path); + g_free (child_name); + + return child; +} + +/** + * g_settings_list_keys: + * @settings: a #GSettings object + * @returns: (transfer full) (element-type utf8): a list of the keys on @settings + * + * Introspects the list of keys on @settings. + * + * You should probably not be calling this function from "normal" code + * (since you should already know what keys are in your schema). This + * function is intended for introspection reasons. + * + * You should free the return value with g_strfreev() when you are done + * with it. + */ +gchar ** +g_settings_list_keys (GSettings *settings) +{ + const GQuark *keys; + gchar **strv; + gint n_keys; + gint i, j; + + keys = g_settings_schema_list (settings->priv->schema, &n_keys); + strv = g_new (gchar *, n_keys + 1); + for (i = j = 0; i < n_keys; i++) + { + const gchar *key = g_quark_to_string (keys[i]); + + if (!g_str_has_suffix (key, "/")) + strv[j++] = g_strdup (key); + } + strv[j] = NULL; + + return strv; +} + +/** + * g_settings_list_children: + * @settings: a #GSettings object + * @returns: (transfer full) (element-type utf8): a list of the children on @settings + * + * Gets the list of children on @settings. + * + * The list is exactly the list of strings for which it is not an error + * to call g_settings_get_child(). + * + * For GSettings objects that are lists, this value can change at any + * time and you should connect to the "children-changed" signal to watch + * for those changes. Note that there is a race condition here: you may + * request a child after listing it only for it to have been destroyed + * in the meantime. For this reason, g_settings_get_child() may return + * %NULL even for a child that was listed by this function. + * + * For GSettings objects that are not lists, you should probably not be + * calling this function from "normal" code (since you should already + * know what children are in your schema). This function may still be + * useful there for introspection reasons, however. + * + * You should free the return value with g_strfreev() when you are done + * with it. + */ +gchar ** +g_settings_list_children (GSettings *settings) +{ + const GQuark *keys; + gchar **strv; + gint n_keys; + gint i, j; + + keys = g_settings_schema_list (settings->priv->schema, &n_keys); + strv = g_new (gchar *, n_keys + 1); + for (i = j = 0; i < n_keys; i++) + { + const gchar *key = g_quark_to_string (keys[i]); + + if (g_str_has_suffix (key, "/")) + { + gint length = strlen (key); + + strv[j] = g_memdup (key, length); + strv[j][length - 1] = '\0'; + j++; + } + } + strv[j] = NULL; + + return strv; +} + +/** + * g_settings_get_range: + * @settings: a #GSettings + * @key: the key to query the range of + * @returns: a #GVariant describing the range + * + * Queries the range of a key. + * + * This function will return a #GVariant that fully describes the range + * of values that are valid for @key. + * + * The type of #GVariant returned is (sv). The + * string describes the type of range restriction in effect. The type + * and meaning of the value contained in the variant depends on the + * string. + * + * If the string is 'type' then the variant contains + * an empty array. The element type of that empty array is the expected + * type of value and all values of that type are valid. + * + * If the string is 'enum' then the variant contains + * an array enumerating the possible values. Each item in the array is + * a possible valid value and no other values are valid. + * + * If the string is 'flags' then the variant contains + * an array. Each item in the array is a value that may appear zero or + * one times in an array to be used as the value for this key. For + * example, if the variant contained the array ['x', + * 'y'] then the valid values for the key would be + * [], ['x'], + * ['y'], ['x', 'y'] and + * ['y', 'x']. + * + * Finally, if the string is 'range' then the variant + * contains a pair of like-typed values -- the minimum and maximum + * permissible values for this key. + * + * This information should not be used by normal programs. It is + * considered to be a hint for introspection purposes. Normal programs + * should already know what is permitted by their own schema. The + * format may change in any way in the future -- but particularly, new + * forms may be added to the possibilities described above. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings. + * + * You should free the returned value with g_variant_unref() when it is + * no longer needed. + * + * Since: 2.28 + **/ +GVariant * +g_settings_get_range (GSettings *settings, + const gchar *key) +{ + GSettingsKeyInfo info; + const gchar *type; + GVariant *range; + + g_settings_get_key_info (&info, settings, key); + + if (info.minimum) + { + range = g_variant_new ("(**)", info.minimum, info.maximum); + type = "range"; + } + else if (info.strinfo) + { + range = strinfo_enumerate (info.strinfo, info.strinfo_length); + type = info.is_flags ? "flags" : "enum"; + } + else + { + range = g_variant_new_array (info.type, NULL, 0); + type = "type"; + } + + g_settings_free_key_info (&info); + + return g_variant_ref_sink (g_variant_new ("(sv)", type, range)); +} + +/** + * g_settings_range_check: + * @settings: a #GSettings + * @key: the key to check + * @value: the value to check + * @returns: %TRUE if @value is valid for @key + * + * Checks if the given @value is of the correct type and within the + * permitted range for @key. + * + * This API is not intended to be used by normal programs -- they should + * already know what is permitted by their own schemas. This API is + * meant to be used by programs such as editors or commandline tools. + * + * It is a programmer error to give a @key that isn't contained in the + * schema for @settings. + * + * Since: 2.28 + **/ +gboolean +g_settings_range_check (GSettings *settings, + const gchar *key, + GVariant *value) +{ + GSettingsKeyInfo info; + gboolean good; + + g_settings_get_key_info (&info, settings, key); + good = g_settings_type_check (&info, value) && + g_settings_key_info_range_check (&info, value); + g_settings_free_key_info (&info); + + return good; +} + +/* Binding {{{1 */ +typedef struct +{ + GSettingsKeyInfo info; + GObject *object; + + GSettingsBindGetMapping get_mapping; + GSettingsBindSetMapping set_mapping; + gpointer user_data; + GDestroyNotify destroy; + + guint writable_handler_id; + guint property_handler_id; + const GParamSpec *property; + guint key_handler_id; + + /* prevent recursion */ + gboolean running; +} GSettingsBinding; + +static void +g_settings_binding_free (gpointer data) +{ + GSettingsBinding *binding = data; + + g_assert (!binding->running); + + if (binding->writable_handler_id) + g_signal_handler_disconnect (binding->info.settings, + binding->writable_handler_id); + + if (binding->key_handler_id) + g_signal_handler_disconnect (binding->info.settings, + binding->key_handler_id); + + if (g_signal_handler_is_connected (binding->object, + binding->property_handler_id)) + g_signal_handler_disconnect (binding->object, + binding->property_handler_id); + + g_settings_free_key_info (&binding->info); + + if (binding->destroy) + binding->destroy (binding->user_data); + + g_slice_free (GSettingsBinding, binding); +} + +static GQuark +g_settings_binding_quark (const char *property) +{ + GQuark quark; + gchar *tmp; + + tmp = g_strdup_printf ("gsettingsbinding-%s", property); + quark = g_quark_from_string (tmp); + g_free (tmp); + + return quark; +} + +static void +g_settings_binding_key_changed (GSettings *settings, + const gchar *key, + gpointer user_data) +{ + GSettingsBinding *binding = user_data; + GValue value = { 0, }; + GVariant *variant; + + g_assert (settings == binding->info.settings); + g_assert (key == binding->info.key); + + if (binding->running) + return; + + binding->running = TRUE; + + g_value_init (&value, binding->property->value_type); + + variant = g_settings_read_from_backend (&binding->info); + if (variant && !binding->get_mapping (&value, variant, binding->user_data)) + { + /* silently ignore errors in the user's config database */ + g_variant_unref (variant); + variant = NULL; + } + + if (variant == NULL) + { + variant = g_settings_get_translated_default (&binding->info); + if (variant && + !binding->get_mapping (&value, variant, binding->user_data)) + { + /* flag translation errors with a warning */ + g_warning ("Translated default `%s' for key `%s' in schema `%s' " + "was rejected by the binding mapping function", + binding->info.unparsed, binding->info.key, + binding->info.settings->priv->schema_name); + g_variant_unref (variant); + variant = NULL; + } + } + + if (variant == NULL) + { + variant = g_variant_ref (binding->info.default_value); + if (!binding->get_mapping (&value, variant, binding->user_data)) + g_error ("The schema default value for key `%s' in schema `%s' " + "was rejected by the binding mapping function.", + binding->info.key, + binding->info.settings->priv->schema_name); + } + + g_object_set_property (binding->object, binding->property->name, &value); + g_variant_unref (variant); + g_value_unset (&value); + + binding->running = FALSE; +} + +static void +g_settings_binding_property_changed (GObject *object, + const GParamSpec *pspec, + gpointer user_data) +{ + GSettingsBinding *binding = user_data; + GValue value = { 0, }; + GVariant *variant; + + g_assert (object == binding->object); + g_assert (pspec == binding->property); + + if (binding->running) + return; + + binding->running = TRUE; + + g_value_init (&value, pspec->value_type); + g_object_get_property (object, pspec->name, &value); + if ((variant = binding->set_mapping (&value, binding->info.type, + binding->user_data))) + { + if (g_variant_is_floating (variant)) + g_variant_ref_sink (variant); + + if (!g_settings_type_check (&binding->info, variant)) + { + g_critical ("binding mapping function for key `%s' returned " + "GVariant of type `%s' when type `%s' was requested", + binding->info.key, g_variant_get_type_string (variant), + g_variant_type_dup_string (binding->info.type)); + return; + } + + if (!g_settings_key_info_range_check (&binding->info, variant)) + { + g_critical ("GObject property `%s' on a `%s' object is out of " + "schema-specified range for key `%s' of `%s': %s", + binding->property->name, + g_type_name (binding->property->owner_type), + binding->info.key, + binding->info.settings->priv->schema_name, + g_variant_print (variant, TRUE)); + return; + } + + g_settings_write_to_backend (&binding->info, variant); + g_variant_unref (variant); + } + g_value_unset (&value); + + binding->running = FALSE; +} + +static gboolean +g_settings_bind_invert_boolean_get_mapping (GValue *value, + GVariant *variant, + gpointer user_data) +{ + g_value_set_boolean (value, !g_variant_get_boolean (variant)); + return TRUE; +} + +static GVariant * +g_settings_bind_invert_boolean_set_mapping (const GValue *value, + const GVariantType *expected_type, + gpointer user_data) +{ + return g_variant_new_boolean (!g_value_get_boolean (value)); +} + +/** + * g_settings_bind: + * @settings: a #GSettings object + * @key: the key to bind + * @object: (type GObject.Object): a #GObject + * @property: the name of the property to bind + * @flags: flags for the binding + * + * Create a binding between the @key in the @settings object + * and the property @property of @object. + * + * The binding uses the default GIO mapping functions to map + * between the settings and property values. These functions + * handle booleans, numeric types and string types in a + * straightforward way. Use g_settings_bind_with_mapping() if + * you need a custom mapping, or map between types that are not + * supported by the default mapping functions. + * + * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this + * function also establishes a binding between the writability of + * @key and the "sensitive" property of @object (if @object has + * a boolean property by that name). See g_settings_bind_writable() + * for more details about writable bindings. + * + * Note that the lifecycle of the binding is tied to the object, + * and that you can have only one binding per object property. + * If you bind the same property twice on the same object, the second + * binding overrides the first one. + * + * Since: 2.26 + */ +void +g_settings_bind (GSettings *settings, + const gchar *key, + gpointer object, + const gchar *property, + GSettingsBindFlags flags) +{ + GSettingsBindGetMapping get_mapping = NULL; + GSettingsBindSetMapping set_mapping = NULL; + + if (flags & G_SETTINGS_BIND_INVERT_BOOLEAN) + { + get_mapping = g_settings_bind_invert_boolean_get_mapping; + set_mapping = g_settings_bind_invert_boolean_set_mapping; + + /* can't pass this flag to g_settings_bind_with_mapping() */ + flags &= ~G_SETTINGS_BIND_INVERT_BOOLEAN; + } + + g_settings_bind_with_mapping (settings, key, object, property, flags, + get_mapping, set_mapping, NULL, NULL); +} + +/** + * g_settings_bind_with_mapping: + * @settings: a #GSettings object + * @key: the key to bind + * @object: (type GObject.Object): a #GObject + * @property: the name of the property to bind + * @flags: flags for the binding + * @get_mapping: a function that gets called to convert values + * from @settings to @object, or %NULL to use the default GIO mapping + * @set_mapping: a function that gets called to convert values + * from @object to @settings, or %NULL to use the default GIO mapping + * @user_data: data that gets passed to @get_mapping and @set_mapping + * @destroy: #GDestroyNotify function for @user_data + * + * Create a binding between the @key in the @settings object + * and the property @property of @object. + * + * The binding uses the provided mapping functions to map between + * settings and property values. + * + * Note that the lifecycle of the binding is tied to the object, + * and that you can have only one binding per object property. + * If you bind the same property twice on the same object, the second + * binding overrides the first one. + * + * Since: 2.26 + */ +void +g_settings_bind_with_mapping (GSettings *settings, + const gchar *key, + gpointer object, + const gchar *property, + GSettingsBindFlags flags, + GSettingsBindGetMapping get_mapping, + GSettingsBindSetMapping set_mapping, + gpointer user_data, + GDestroyNotify destroy) +{ + GSettingsBinding *binding; + GObjectClass *objectclass; + gchar *detailed_signal; + GQuark binding_quark; + + g_return_if_fail (G_IS_SETTINGS (settings)); + g_return_if_fail (~flags & G_SETTINGS_BIND_INVERT_BOOLEAN); + + objectclass = G_OBJECT_GET_CLASS (object); + + binding = g_slice_new0 (GSettingsBinding); + g_settings_get_key_info (&binding->info, settings, key); + binding->object = object; + binding->property = g_object_class_find_property (objectclass, property); + binding->user_data = user_data; + binding->destroy = destroy; + binding->get_mapping = get_mapping ? get_mapping : g_settings_get_mapping; + binding->set_mapping = set_mapping ? set_mapping : g_settings_set_mapping; + + if (!(flags & (G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET))) + flags |= G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET; + + if (binding->property == NULL) + { + g_critical ("g_settings_bind: no property '%s' on class '%s'", + property, G_OBJECT_TYPE_NAME (object)); + return; + } + + if ((flags & G_SETTINGS_BIND_GET) && + (binding->property->flags & G_PARAM_WRITABLE) == 0) + { + g_critical ("g_settings_bind: property '%s' on class '%s' is not " + "writable", property, G_OBJECT_TYPE_NAME (object)); + return; + } + if ((flags & G_SETTINGS_BIND_SET) && + (binding->property->flags & G_PARAM_READABLE) == 0) + { + g_critical ("g_settings_bind: property '%s' on class '%s' is not " + "readable", property, G_OBJECT_TYPE_NAME (object)); + return; + } + + if (get_mapping == g_settings_bind_invert_boolean_get_mapping) + { + /* g_settings_bind_invert_boolean_get_mapping() is a private + * function, so if we are here it means that g_settings_bind() was + * called with G_SETTINGS_BIND_INVERT_BOOLEAN. + * + * Ensure that both sides are boolean. + */ + + if (binding->property->value_type != G_TYPE_BOOLEAN) + { + g_critical ("g_settings_bind: G_SETTINGS_BIND_INVERT_BOOLEAN " + "was specified, but property `%s' on type `%s' has " + "type `%s'", property, G_OBJECT_TYPE_NAME (object), + g_type_name ((binding->property->value_type))); + return; + } + + if (!g_variant_type_equal (binding->info.type, G_VARIANT_TYPE_BOOLEAN)) + { + g_critical ("g_settings_bind: G_SETTINGS_BIND_INVERT_BOOLEAN " + "was specified, but key `%s' on schema `%s' has " + "type `%s'", key, settings->priv->schema_name, + g_variant_type_dup_string (binding->info.type)); + return; + } + + } + + else if (((get_mapping == NULL && (flags & G_SETTINGS_BIND_GET)) || + (set_mapping == NULL && (flags & G_SETTINGS_BIND_SET))) && + !g_settings_mapping_is_compatible (binding->property->value_type, + binding->info.type)) + { + g_critical ("g_settings_bind: property '%s' on class '%s' has type " + "'%s' which is not compatible with type '%s' of key '%s' " + "on schema '%s'", property, G_OBJECT_TYPE_NAME (object), + g_type_name (binding->property->value_type), + g_variant_type_dup_string (binding->info.type), key, + settings->priv->schema_name); + return; + } + + if ((flags & G_SETTINGS_BIND_SET) && + (~flags & G_SETTINGS_BIND_NO_SENSITIVITY)) + { + GParamSpec *sensitive; + + sensitive = g_object_class_find_property (objectclass, "sensitive"); + + if (sensitive && sensitive->value_type == G_TYPE_BOOLEAN && + (sensitive->flags & G_PARAM_WRITABLE)) + g_settings_bind_writable (settings, binding->info.key, + object, "sensitive", FALSE); + } + + if (flags & G_SETTINGS_BIND_SET) + { + detailed_signal = g_strdup_printf ("notify::%s", property); + binding->property_handler_id = + g_signal_connect (object, detailed_signal, + G_CALLBACK (g_settings_binding_property_changed), + binding); + g_free (detailed_signal); + + if (~flags & G_SETTINGS_BIND_GET) + g_settings_binding_property_changed (object, + binding->property, + binding); + } + + if (flags & G_SETTINGS_BIND_GET) + { + if (~flags & G_SETTINGS_BIND_GET_NO_CHANGES) + { + detailed_signal = g_strdup_printf ("changed::%s", key); + binding->key_handler_id = + g_signal_connect (settings, detailed_signal, + G_CALLBACK (g_settings_binding_key_changed), + binding); + g_free (detailed_signal); + } + + g_settings_binding_key_changed (settings, binding->info.key, binding); + } + + binding_quark = g_settings_binding_quark (property); + g_object_set_qdata_full (object, binding_quark, + binding, g_settings_binding_free); +} + +/* Writability binding {{{1 */ +typedef struct +{ + GSettings *settings; + gpointer object; + const gchar *key; + const gchar *property; + gboolean inverted; + gulong handler_id; +} GSettingsWritableBinding; + +static void +g_settings_writable_binding_free (gpointer data) +{ + GSettingsWritableBinding *binding = data; + + g_signal_handler_disconnect (binding->settings, binding->handler_id); + g_object_unref (binding->settings); + g_slice_free (GSettingsWritableBinding, binding); +} + +static void +g_settings_binding_writable_changed (GSettings *settings, + const gchar *key, + gpointer user_data) +{ + GSettingsWritableBinding *binding = user_data; + gboolean writable; + + g_assert (settings == binding->settings); + g_assert (key == binding->key); + + writable = g_settings_is_writable (settings, key); + + if (binding->inverted) + writable = !writable; + + g_object_set (binding->object, binding->property, writable, NULL); +} + +/** + * g_settings_bind_writable: + * @settings: a #GSettings object + * @key: the key to bind + * @object: (type GObject.Object):a #GObject + * @property: the name of a boolean property to bind + * @inverted: whether to 'invert' the value + * + * Create a binding between the writability of @key in the + * @settings object and the property @property of @object. + * The property must be boolean; "sensitive" or "visible" + * properties of widgets are the most likely candidates. + * + * Writable bindings are always uni-directional; changes of the + * writability of the setting will be propagated to the object + * property, not the other way. + * + * When the @inverted argument is %TRUE, the binding inverts the + * value as it passes from the setting to the object, i.e. @property + * will be set to %TRUE if the key is not + * writable. + * + * Note that the lifecycle of the binding is tied to the object, + * and that you can have only one binding per object property. + * If you bind the same property twice on the same object, the second + * binding overrides the first one. + * + * Since: 2.26 + */ +void +g_settings_bind_writable (GSettings *settings, + const gchar *key, + gpointer object, + const gchar *property, + gboolean inverted) +{ + GSettingsWritableBinding *binding; + gchar *detailed_signal; + GParamSpec *pspec; + + g_return_if_fail (G_IS_SETTINGS (settings)); + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), property); + if (pspec == NULL) + { + g_critical ("g_settings_bind_writable: no property '%s' on class '%s'", + property, G_OBJECT_TYPE_NAME (object)); + return; + } + if ((pspec->flags & G_PARAM_WRITABLE) == 0) + { + g_critical ("g_settings_bind_writable: property '%s' on class '%s' is not writable", + property, G_OBJECT_TYPE_NAME (object)); + return; + } + + binding = g_slice_new (GSettingsWritableBinding); + binding->settings = g_object_ref (settings); + binding->object = object; + binding->key = g_intern_string (key); + binding->property = g_intern_string (property); + binding->inverted = inverted; + + detailed_signal = g_strdup_printf ("writable-changed::%s", key); + binding->handler_id = + g_signal_connect (settings, detailed_signal, + G_CALLBACK (g_settings_binding_writable_changed), + binding); + g_free (detailed_signal); + + g_object_set_qdata_full (object, g_settings_binding_quark (property), + binding, g_settings_writable_binding_free); + + g_settings_binding_writable_changed (settings, binding->key, binding); +} + +/** + * g_settings_unbind: + * @object: the object + * @property: the property whose binding is removed + * + * Removes an existing binding for @property on @object. + * + * Note that bindings are automatically removed when the + * object is finalized, so it is rarely necessary to call this + * function. + * + * Since: 2.26 + */ +void +g_settings_unbind (gpointer object, + const gchar *property) +{ + GQuark binding_quark; + + binding_quark = g_settings_binding_quark (property); + g_object_set_qdata (object, binding_quark, NULL); +} + +/* Epilogue {{{1 */ + +/* vim:set foldmethod=marker: */ diff --git a/gio/gsettings.h b/gio/gsettings.h new file mode 100644 index 0000000..8226750 --- /dev/null +++ b/gio/gsettings.h @@ -0,0 +1,264 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_SETTINGS_H__ +#define __G_SETTINGS_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SETTINGS (g_settings_get_type ()) +#define G_SETTINGS(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_SETTINGS, GSettings)) +#define G_SETTINGS_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_SETTINGS, GSettingsClass)) +#define G_IS_SETTINGS(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_SETTINGS)) +#define G_IS_SETTINGS_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_SETTINGS)) +#define G_SETTINGS_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_SETTINGS, GSettingsClass)) + +typedef struct _GSettingsPrivate GSettingsPrivate; +typedef struct _GSettingsClass GSettingsClass; + +struct _GSettingsClass +{ + GObjectClass parent_class; + + /* Signals */ + void (*writable_changed) (GSettings *settings, + const gchar *key); + void (*changed) (GSettings *settings, + const gchar *key); + gboolean (*writable_change_event) (GSettings *settings, + GQuark key); + gboolean (*change_event) (GSettings *settings, + const GQuark *keys, + gint n_keys); + + gpointer padding[20]; +}; + +struct _GSettings +{ + GObject parent_instance; + GSettingsPrivate *priv; +}; + + +GType g_settings_get_type (void); + +const gchar * const * g_settings_list_schemas (void); +const gchar * const * g_settings_list_relocatable_schemas (void); +GSettings * g_settings_new (const gchar *schema); +GSettings * g_settings_new_with_path (const gchar *schema, + const gchar *path); +GSettings * g_settings_new_with_backend (const gchar *schema, + GSettingsBackend *backend); +GSettings * g_settings_new_with_backend_and_path (const gchar *schema, + GSettingsBackend *backend, + const gchar *path); +gchar ** g_settings_list_children (GSettings *settings); +gchar ** g_settings_list_keys (GSettings *settings); +GVariant * g_settings_get_range (GSettings *settings, + const gchar *key); +gboolean g_settings_range_check (GSettings *settings, + const gchar *key, + GVariant *value); + +gboolean g_settings_set_value (GSettings *settings, + const gchar *key, + GVariant *value); +GVariant * g_settings_get_value (GSettings *settings, + const gchar *key); + +gboolean g_settings_set (GSettings *settings, + const gchar *key, + const gchar *format, + ...); +void g_settings_get (GSettings *settings, + const gchar *key, + const gchar *format, + ...); +void g_settings_reset (GSettings *settings, + const gchar *key); + +gint g_settings_get_int (GSettings *settings, + const gchar *key); +gboolean g_settings_set_int (GSettings *settings, + const gchar *key, + gint value); +gchar * g_settings_get_string (GSettings *settings, + const gchar *key); +gboolean g_settings_set_string (GSettings *settings, + const gchar *key, + const gchar *value); +gboolean g_settings_get_boolean (GSettings *settings, + const gchar *key); +gboolean g_settings_set_boolean (GSettings *settings, + const gchar *key, + gboolean value); +gdouble g_settings_get_double (GSettings *settings, + const gchar *key); +gboolean g_settings_set_double (GSettings *settings, + const gchar *key, + gdouble value); +gchar ** g_settings_get_strv (GSettings *settings, + const gchar *key); +gboolean g_settings_set_strv (GSettings *settings, + const gchar *key, + const gchar *const *value); +gint g_settings_get_enum (GSettings *settings, + const gchar *key); +gboolean g_settings_set_enum (GSettings *settings, + const gchar *key, + gint value); +guint g_settings_get_flags (GSettings *settings, + const gchar *key); +gboolean g_settings_set_flags (GSettings *settings, + const gchar *key, + guint value); +GSettings * g_settings_get_child (GSettings *settings, + const gchar *name); + +gboolean g_settings_is_writable (GSettings *settings, + const gchar *name); + +void g_settings_delay (GSettings *settings); +void g_settings_apply (GSettings *settings); +void g_settings_revert (GSettings *settings); +gboolean g_settings_get_has_unapplied (GSettings *settings); +void g_settings_sync (void); + +/** + * GSettingsBindSetMapping: + * @value: a #GValue containing the property value to map + * @expected_type: the #GVariantType to create + * @user_data: user data that was specified when the binding was created + * @returns: a new #GVariant holding the data from @value, + * or %NULL in case of an error + * + * The type for the function that is used to convert an object property + * value to a #GVariant for storing it in #GSettings. + */ +typedef GVariant * (*GSettingsBindSetMapping) (const GValue *value, + const GVariantType *expected_type, + gpointer user_data); + +/** + * GSettingsBindGetMapping: + * @value: return location for the property value + * @variant: the #GVariant + * @user_data: user data that was specified when the binding was created + * @returns: %TRUE if the conversion succeeded, %FALSE in case of an error + * + * The type for the function that is used to convert from #GSettings to + * an object property. The @value is already initialized to hold values + * of the appropriate type. + */ +typedef gboolean (*GSettingsBindGetMapping) (GValue *value, + GVariant *variant, + gpointer user_data); + +/** + * GSettingsGetMapping: + * @value: the #GVariant to map, or %NULL + * @result: the result of the mapping + * @user_data: the user data that was passed to g_settings_get_mapped() + * @returns: %TRUE if the conversion succeeded, %FALSE in case of an error + * + * The type of the function that is used to convert from a value stored + * in a #GSettings to a value that is useful to the application. + * + * If the value is successfully mapped, the result should be stored at + * @result and %TRUE returned. If mapping fails (for example, if @value + * is not in the right format) then %FALSE should be returned. + * + * If @value is %NULL then it means that the mapping function is being + * given a "last chance" to successfully return a valid value. %TRUE + * must be returned in this case. + **/ +typedef gboolean (*GSettingsGetMapping) (GVariant *value, + gpointer *result, + gpointer user_data); + +/** + * GSettingsBindFlags: + * @G_SETTINGS_BIND_DEFAULT: Equivalent to G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET + * @G_SETTINGS_BIND_GET: Update the #GObject property when the setting changes. + * It is an error to use this flag if the property is not writable. + * @G_SETTINGS_BIND_SET: Update the setting when the #GObject property changes. + * It is an error to use this flag if the property is not readable. + * @G_SETTINGS_BIND_NO_SENSITIVITY: Do not try to bind a "sensitivity" property to the writability of the setting + * @G_SETTINGS_BIND_GET_NO_CHANGES: When set in addition to #G_SETTINGS_BIND_GET, set the #GObject property + * value initially from the setting, but do not listen for changes of the setting + * @G_SETTINGS_BIND_INVERT_BOOLEAN: When passed to g_settings_bind(), uses a pair of mapping functions that invert + * the boolean value when mapping between the setting and the property. The setting and property must both + * be booleans. You can not pass this flag to g_settings_bind_with_mapping(). + * + * Flags used when creating a binding. These flags determine in which + * direction the binding works. The default is to synchronize in both + * directions. + */ +typedef enum +{ + G_SETTINGS_BIND_DEFAULT, + G_SETTINGS_BIND_GET = (1<<0), + G_SETTINGS_BIND_SET = (1<<1), + G_SETTINGS_BIND_NO_SENSITIVITY = (1<<2), + G_SETTINGS_BIND_GET_NO_CHANGES = (1<<3), + G_SETTINGS_BIND_INVERT_BOOLEAN = (1<<4) +} GSettingsBindFlags; + +void g_settings_bind (GSettings *settings, + const gchar *key, + gpointer object, + const gchar *property, + GSettingsBindFlags flags); +void g_settings_bind_with_mapping (GSettings *settings, + const gchar *key, + gpointer object, + const gchar *property, + GSettingsBindFlags flags, + GSettingsBindGetMapping get_mapping, + GSettingsBindSetMapping set_mapping, + gpointer user_data, + GDestroyNotify destroy); +void g_settings_bind_writable (GSettings *settings, + const gchar *key, + gpointer object, + const gchar *property, + gboolean inverted); +void g_settings_unbind (gpointer object, + const gchar *property); + +gpointer g_settings_get_mapped (GSettings *settings, + const gchar *key, + GSettingsGetMapping mapping, + gpointer user_data); + +G_END_DECLS + +#endif /* __G_SETTINGS_H__ */ diff --git a/gio/gsettingsbackend.c b/gio/gsettingsbackend.c new file mode 100644 index 0000000..bd2fa2e --- /dev/null +++ b/gio/gsettingsbackend.c @@ -0,0 +1,1029 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * Copyright © 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + * Matthias Clasen + */ + +#include "config.h" + +#include "gsettingsbackendinternal.h" +#include "gnullsettingsbackend.h" +#include "gsimplepermission.h" +#include "giomodule-priv.h" +#include "gio-marshal.h" + +#include +#include +#include +#include + + +G_DEFINE_ABSTRACT_TYPE (GSettingsBackend, g_settings_backend, G_TYPE_OBJECT) + +typedef struct _GSettingsBackendClosure GSettingsBackendClosure; +typedef struct _GSettingsBackendWatch GSettingsBackendWatch; + +struct _GSettingsBackendPrivate +{ + GSettingsBackendWatch *watches; + GStaticMutex lock; +}; + +/** + * SECTION:gsettingsbackend + * @title: GSettingsBackend + * @short_description: Interface for settings backend implementations + * @include: gio/gsettingsbackend.h + * @see_also: #GSettings, #GIOExtensionPoint + * + * The #GSettingsBackend interface defines a generic interface for + * non-strictly-typed data that is stored in a hierarchy. To implement + * an alternative storage backend for #GSettings, you need to implement + * the #GSettingsBackend interface and then make it implement the + * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME. + * + * The interface defines methods for reading and writing values, a + * method for determining if writing of certain values will fail + * (lockdown) and a change notification mechanism. + * + * The semantics of the interface are very precisely defined and + * implementations must carefully adhere to the expectations of + * callers that are documented on each of the interface methods. + * + * Some of the GSettingsBackend functions accept or return a #GTree. + * These trees always have strings as keys and #GVariant as values. + * g_settings_backend_create_tree() is a convenience function to create + * suitable trees. + * + * + * The #GSettingsBackend API is exported to allow third-party + * implementations, but does not carry the same stability guarantees + * as the public GIO API. For this reason, you have to define the + * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including + * gio/gsettingsbackend.h + * + **/ + +static gboolean +is_key (const gchar *key) +{ + gint length; + gint i; + + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (key[0] == '/', FALSE); + + for (i = 1; key[i]; i++) + g_return_val_if_fail (key[i] != '/' || key[i + 1] != '/', FALSE); + + length = i; + + g_return_val_if_fail (key[length - 1] != '/', FALSE); + + return TRUE; +} + +static gboolean +is_path (const gchar *path) +{ + gint length; + gint i; + + g_return_val_if_fail (path != NULL, FALSE); + g_return_val_if_fail (path[0] == '/', FALSE); + + for (i = 1; path[i]; i++) + g_return_val_if_fail (path[i] != '/' || path[i + 1] != '/', FALSE); + + length = i; + + g_return_val_if_fail (path[length - 1] == '/', FALSE); + + return TRUE; +} + +struct _GSettingsBackendWatch +{ + GObject *target; + const GSettingsListenerVTable *vtable; + GMainContext *context; + GSettingsBackendWatch *next; +}; + +struct _GSettingsBackendClosure +{ + void (*function) (GObject *target, + GSettingsBackend *backend, + const gchar *name, + gpointer data1, + gpointer data2); + + GSettingsBackend *backend; + GObject *target; + gchar *name; + gpointer data1; + GBoxedFreeFunc data1_free; + gpointer data2; +}; + +static void +g_settings_backend_watch_weak_notify (gpointer data, + GObject *where_the_object_was) +{ + GSettingsBackend *backend = data; + GSettingsBackendWatch **ptr; + + /* search and remove */ + g_static_mutex_lock (&backend->priv->lock); + for (ptr = &backend->priv->watches; *ptr; ptr = &(*ptr)->next) + if ((*ptr)->target == where_the_object_was) + { + GSettingsBackendWatch *tmp = *ptr; + + *ptr = tmp->next; + g_slice_free (GSettingsBackendWatch, tmp); + + g_static_mutex_unlock (&backend->priv->lock); + return; + } + + /* we didn't find it. that shouldn't happen. */ + g_assert_not_reached (); +} + +/*< private > + * g_settings_backend_watch: + * @backend: a #GSettingsBackend + * @target: the GObject (typically GSettings instance) to call back to + * @context: a #GMainContext, or %NULL + * ...: callbacks... + * + * Registers a new watch on a #GSettingsBackend. + * + * note: %NULL @context does not mean "default main context" but rather, + * "it is okay to dispatch in any context". If the default main context + * is specifically desired then it must be given. + * + * note also: if you want to get meaningful values for the @origin_tag + * that appears as an argument to some of the callbacks, you *must* have + * @context as %NULL. Otherwise, you are subject to cross-thread + * dispatching and whatever owned @origin_tag at the time that the event + * occured may no longer own it. This is a problem if you consider that + * you may now be the new owner of that address and mistakenly think + * that the event in question originated from yourself. + * + * tl;dr: If you give a non-%NULL @context then you must ignore the + * value of @origin_tag given to any callbacks. + **/ +void +g_settings_backend_watch (GSettingsBackend *backend, + const GSettingsListenerVTable *vtable, + GObject *target, + GMainContext *context) +{ + GSettingsBackendWatch *watch; + + /* For purposes of discussion, we assume that our target is a + * GSettings instance. + * + * Our strategy to defend against the final reference dropping on the + * GSettings object in a thread other than the one that is doing the + * dispatching is as follows: + * + * 1) hold a GObject reference on the GSettings during an outstanding + * dispatch. This ensures that the delivery is always possible. + * + * 2) hold a weak reference on the GSettings at other times. This + * allows us to receive early notification of pending destruction + * of the object. At this point, it is still safe to obtain a + * reference on the GObject to keep it alive, so #1 will work up + * to that point. After that point, we'll have been able to drop + * the watch from the list. + * + * Note, in particular, that it's not possible to simply have an + * "unwatch" function that gets called from the finalize function of + * the GSettings instance because, by that point it is no longer + * possible to keep the object alive using g_object_ref() and we would + * have no way of knowing this. + * + * Note also that we do not need to hold a reference on the main + * context here since the GSettings instance does that for us and we + * will receive the weak notify long before it is dropped. We don't + * even need to hold it during dispatches because our reference on the + * GSettings will prevent the finalize from running and dropping the + * ref on the context. + * + * All access to the list holds a mutex. We have some strategies to + * avoid some of the pain that would be associated with that. + */ + + watch = g_slice_new (GSettingsBackendWatch); + watch->context = context; + watch->vtable = vtable; + watch->target = target; + g_object_weak_ref (target, g_settings_backend_watch_weak_notify, backend); + + /* linked list prepend */ + g_static_mutex_lock (&backend->priv->lock); + watch->next = backend->priv->watches; + backend->priv->watches = watch; + g_static_mutex_unlock (&backend->priv->lock); +} + +void +g_settings_backend_unwatch (GSettingsBackend *backend, + GObject *target) +{ + /* Our caller surely owns a reference on 'target', so the order of + * these two calls is unimportant. + */ + g_object_weak_unref (target, g_settings_backend_watch_weak_notify, backend); + g_settings_backend_watch_weak_notify (backend, target); +} + +static gboolean +g_settings_backend_invoke_closure (gpointer user_data) +{ + GSettingsBackendClosure *closure = user_data; + + closure->function (closure->target, closure->backend, closure->name, + closure->data1, closure->data2); + + closure->data1_free (closure->data1); + g_object_unref (closure->backend); + g_object_unref (closure->target); + g_free (closure->name); + + g_slice_free (GSettingsBackendClosure, closure); + + return FALSE; +} + +static gpointer +pointer_id (gpointer a) +{ + return a; +} + +static void +pointer_ignore (gpointer a) +{ +} + +static void +g_settings_backend_dispatch_signal (GSettingsBackend *backend, + gsize function_offset, + const gchar *name, + gpointer data1, + GBoxedCopyFunc data1_copy, + GBoxedFreeFunc data1_free, + gpointer data2) +{ + GSettingsBackendWatch *suffix, *watch, *next; + + if (data1_copy == NULL) + data1_copy = pointer_id; + + if (data1_free == NULL) + data1_free = pointer_ignore; + + /* We're in a little bit of a tricky situation here. We need to hold + * a lock while traversing the list, but we don't want to hold the + * lock while calling back into user code. + * + * Since we're not holding the lock while we call user code, we can't + * render the list immutable. We can, however, store a pointer to a + * given suffix of the list and render that suffix immutable. + * + * Adds will never modify the suffix since adds always come in the + * form of prepends. We can also prevent removes from modifying the + * suffix since removes only happen in response to the last reference + * count dropping -- so just add a reference to everything in the + * suffix. + */ + g_static_mutex_lock (&backend->priv->lock); + suffix = backend->priv->watches; + for (watch = suffix; watch; watch = watch->next) + g_object_ref (watch->target); + g_static_mutex_unlock (&backend->priv->lock); + + /* The suffix is now immutable, so this is safe. */ + for (watch = suffix; watch; watch = next) + { + GSettingsBackendClosure *closure; + + closure = g_slice_new (GSettingsBackendClosure); + closure->backend = g_object_ref (backend); + closure->target = watch->target; /* we took our ref above */ + closure->function = G_STRUCT_MEMBER (void *, watch->vtable, + function_offset); + closure->name = g_strdup (name); + closure->data1 = data1_copy (data1); + closure->data1_free = data1_free; + closure->data2 = data2; + + /* we do this here because 'watch' may not live to the end of this + * iteration of the loop (since we may unref the target below). + */ + next = watch->next; + + if (watch->context) + g_main_context_invoke (watch->context, + g_settings_backend_invoke_closure, + closure); + else + g_settings_backend_invoke_closure (closure); + } +} + +/** + * g_settings_backend_changed: + * @backend: a #GSettingsBackend implementation + * @key: the name of the key + * @origin_tag: the origin tag + * + * Signals that a single key has possibly changed. Backend + * implementations should call this if a key has possibly changed its + * value. + * + * @key must be a valid key (ie starting with a slash, not containing + * '//', and not ending with a slash). + * + * The implementation must call this function during any call to + * g_settings_backend_write(), before the call returns (except in the + * case that no keys are actually changed and it cares to detect this + * fact). It may not rely on the existence of a mainloop for + * dispatching the signal later. + * + * The implementation may call this function at any other time it likes + * in response to other events (such as changes occuring outside of the + * program). These calls may originate from a mainloop or may originate + * in response to any other action (including from calls to + * g_settings_backend_write()). + * + * In the case that this call is in response to a call to + * g_settings_backend_write() then @origin_tag must be set to the same + * value that was passed to that call. + * + * Since: 2.26 + **/ +void +g_settings_backend_changed (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + g_return_if_fail (G_IS_SETTINGS_BACKEND (backend)); + g_return_if_fail (is_key (key)); + + g_settings_backend_dispatch_signal (backend, + G_STRUCT_OFFSET (GSettingsListenerVTable, + changed), + key, origin_tag, NULL, NULL, NULL); +} + +/** + * g_settings_backend_keys_changed: + * @backend: a #GSettingsBackend implementation + * @path: the path containing the changes + * @items: the %NULL-terminated list of changed keys + * @origin_tag: the origin tag + * + * Signals that a list of keys have possibly changed. Backend + * implementations should call this if keys have possibly changed their + * values. + * + * @path must be a valid path (ie starting and ending with a slash and + * not containing '//'). Each string in @items must form a valid key + * name when @path is prefixed to it (ie: each item must not start or + * end with '/' and must not contain '//'). + * + * The meaning of this signal is that any of the key names resulting + * from the contatenation of @path with each item in @items may have + * changed. + * + * The same rules for when notifications must occur apply as per + * g_settings_backend_changed(). These two calls can be used + * interchangeably if exactly one item has changed (although in that + * case g_settings_backend_changed() is definitely preferred). + * + * For efficiency reasons, the implementation should strive for @path to + * be as long as possible (ie: the longest common prefix of all of the + * keys that were changed) but this is not strictly required. + * + * Since: 2.26 + */ +void +g_settings_backend_keys_changed (GSettingsBackend *backend, + const gchar *path, + gchar const * const *items, + gpointer origin_tag) +{ + g_return_if_fail (G_IS_SETTINGS_BACKEND (backend)); + g_return_if_fail (is_path (path)); + + /* XXX: should do stricter checking (ie: inspect each item) */ + g_return_if_fail (items != NULL); + + g_settings_backend_dispatch_signal (backend, + G_STRUCT_OFFSET (GSettingsListenerVTable, + keys_changed), + path, (gpointer) items, + (GBoxedCopyFunc) g_strdupv, + (GBoxedFreeFunc) g_strfreev, + origin_tag); +} + +/** + * g_settings_backend_path_changed: + * @backend: a #GSettingsBackend implementation + * @path: the path containing the changes + * @origin_tag: the origin tag + * + * Signals that all keys below a given path may have possibly changed. + * Backend implementations should call this if an entire path of keys + * have possibly changed their values. + * + * @path must be a valid path (ie starting and ending with a slash and + * not containing '//'). + * + * The meaning of this signal is that any of the key which has a name + * starting with @path may have changed. + * + * The same rules for when notifications must occur apply as per + * g_settings_backend_changed(). This call might be an appropriate + * reasponse to a 'reset' call but implementations are also free to + * explicitly list the keys that were affected by that call if they can + * easily do so. + * + * For efficiency reasons, the implementation should strive for @path to + * be as long as possible (ie: the longest common prefix of all of the + * keys that were changed) but this is not strictly required. As an + * example, if this function is called with the path of "/" then every + * single key in the application will be notified of a possible change. + * + * Since: 2.26 + */ +void +g_settings_backend_path_changed (GSettingsBackend *backend, + const gchar *path, + gpointer origin_tag) +{ + g_return_if_fail (G_IS_SETTINGS_BACKEND (backend)); + g_return_if_fail (is_path (path)); + + g_settings_backend_dispatch_signal (backend, + G_STRUCT_OFFSET (GSettingsListenerVTable, + path_changed), + path, origin_tag, NULL, NULL, NULL); +} + +/** + * g_settings_backend_writable_changed: + * @backend: a #GSettingsBackend implementation + * @key: the name of the key + * + * Signals that the writability of a single key has possibly changed. + * + * Since GSettings performs no locking operations for itself, this call + * will always be made in response to external events. + * + * Since: 2.26 + **/ +void +g_settings_backend_writable_changed (GSettingsBackend *backend, + const gchar *key) +{ + g_return_if_fail (G_IS_SETTINGS_BACKEND (backend)); + g_return_if_fail (is_key (key)); + + g_settings_backend_dispatch_signal (backend, + G_STRUCT_OFFSET (GSettingsListenerVTable, + writable_changed), + key, NULL, NULL, NULL, NULL); +} + +/** + * g_settings_backend_path_writable_changed: + * @backend: a #GSettingsBackend implementation + * @path: the name of the path + * + * Signals that the writability of all keys below a given path may have + * changed. + * + * Since GSettings performs no locking operations for itself, this call + * will always be made in response to external events. + * + * Since: 2.26 + **/ +void +g_settings_backend_path_writable_changed (GSettingsBackend *backend, + const gchar *path) +{ + g_return_if_fail (G_IS_SETTINGS_BACKEND (backend)); + g_return_if_fail (is_path (path)); + + g_settings_backend_dispatch_signal (backend, + G_STRUCT_OFFSET (GSettingsListenerVTable, + path_writable_changed), + path, NULL, NULL, NULL, NULL); +} + +typedef struct +{ + const gchar **keys; + GVariant **values; + gint prefix_len; + gchar *prefix; +} FlattenState; + +static gboolean +g_settings_backend_flatten_one (gpointer key, + gpointer value, + gpointer user_data) +{ + FlattenState *state = user_data; + const gchar *skey = key; + gint i; + + g_return_val_if_fail (is_key (key), TRUE); + + /* calculate longest common prefix */ + if (state->prefix == NULL) + { + gchar *last_byte; + + /* first key? just take the prefix up to the last '/' */ + state->prefix = g_strdup (skey); + last_byte = strrchr (state->prefix, '/') + 1; + state->prefix_len = last_byte - state->prefix; + *last_byte = '\0'; + } + else + { + /* find the first character that does not match. we will + * definitely find one because the prefix ends in '/' and the key + * does not. also: no two keys in the tree are the same. + */ + for (i = 0; state->prefix[i] == skey[i]; i++); + + /* check if we need to shorten the prefix */ + if (state->prefix[i] != '\0') + { + /* find the nearest '/', terminate after it */ + while (state->prefix[i - 1] != '/') + i--; + + state->prefix[i] = '\0'; + state->prefix_len = i; + } + } + + + /* save the entire item into the array. + * the prefixes will be removed later. + */ + *state->keys++ = key; + + if (state->values) + *state->values++ = value; + + return FALSE; +} + +/** + * g_settings_backend_flatten_tree: + * @tree: a #GTree containing the changes + * @path: the location to save the path + * @keys: the location to save the relative keys + * @values: the location to save the values, or %NULL + * + * Calculate the longest common prefix of all keys in a tree and write + * out an array of the key names relative to that prefix and, + * optionally, the value to store at each of those keys. + * + * You must free the value returned in @path, @keys and @values using + * g_free(). You should not attempt to free or unref the contents of + * @keys or @values. + * + * Since: 2.26 + **/ +void +g_settings_backend_flatten_tree (GTree *tree, + gchar **path, + const gchar ***keys, + GVariant ***values) +{ + FlattenState state = { 0, }; + gsize nnodes; + + nnodes = g_tree_nnodes (tree); + + *keys = state.keys = g_new (const gchar *, nnodes + 1); + state.keys[nnodes] = NULL; + + if (values != NULL) + { + *values = state.values = g_new (GVariant *, nnodes + 1); + state.values[nnodes] = NULL; + } + + g_tree_foreach (tree, g_settings_backend_flatten_one, &state); + g_return_if_fail (*keys + nnodes == state.keys); + + *path = state.prefix; + while (nnodes--) + *--state.keys += state.prefix_len; +} + +/** + * g_settings_backend_changed_tree: + * @backend: a #GSettingsBackend implementation + * @tree: a #GTree containing the changes + * @origin_tag: the origin tag + * + * This call is a convenience wrapper. It gets the list of changes from + * @tree, computes the longest common prefix and calls + * g_settings_backend_changed(). + * + * Since: 2.26 + **/ +void +g_settings_backend_changed_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag) +{ + GSettingsBackendWatch *watch; + const gchar **keys; + gchar *path; + + g_return_if_fail (G_IS_SETTINGS_BACKEND (backend)); + + g_settings_backend_flatten_tree (tree, &path, &keys, NULL); + +#ifdef DEBUG_CHANGES + { + gint i; + + g_print ("----\n"); + g_print ("changed_tree(): prefix %s\n", path); + for (i = 0; keys[i]; i++) + g_print (" %s\n", keys[i]); + g_print ("----\n"); + } +#endif + + for (watch = backend->priv->watches; watch; watch = watch->next) + watch->vtable->keys_changed (watch->target, backend, + path, keys, origin_tag); + + g_free (path); + g_free (keys); +} + +/*< private > + * g_settings_backend_read: + * @backend: a #GSettingsBackend implementation + * @key: the key to read + * @expected_type: a #GVariantType + * @default_value: if the default value should be returned + * @returns: the value that was read, or %NULL + * + * Reads a key. This call will never block. + * + * If the key exists, the value associated with it will be returned. + * If the key does not exist, %NULL will be returned. + * + * The returned value will be of the type given in @expected_type. If + * the backend stored a value of a different type then %NULL will be + * returned. + * + * If @default_value is %TRUE then this gets the default value from the + * backend (ie: the one that the backend would contain if + * g_settings_reset() were called). + */ +GVariant * +g_settings_backend_read (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value) +{ + GVariant *value; + + value = G_SETTINGS_BACKEND_GET_CLASS (backend) + ->read (backend, key, expected_type, default_value); + + if G_UNLIKELY (value && !g_variant_is_of_type (value, expected_type)) + { + g_variant_unref (value); + value = NULL; + } + + return value; +} + +/*< private > + * g_settings_backend_write: + * @backend: a #GSettingsBackend implementation + * @key: the name of the key + * @value: a #GVariant value to write to this key + * @origin_tag: the origin tag + * @returns: %TRUE if the write succeeded, %FALSE if the key was not writable + * + * Writes exactly one key. + * + * This call does not fail. During this call a + * #GSettingsBackend::changed signal will be emitted if the value of the + * key has changed. The updated key value will be visible to any signal + * callbacks. + * + * One possible method that an implementation might deal with failures is + * to emit a second "changed" signal (either during this call, or later) + * to indicate that the affected keys have suddenly "changed back" to their + * old values. + */ +gboolean +g_settings_backend_write (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag) +{ + return G_SETTINGS_BACKEND_GET_CLASS (backend) + ->write (backend, key, value, origin_tag); +} + +/*< private > + * g_settings_backend_write_keys: + * @backend: a #GSettingsBackend implementation + * @values: a #GTree containing key-value pairs to write + * @origin_tag: the origin tag + * + * Writes one or more keys. This call will never block. + * + * The key of each item in the tree is the key name to write to and the + * value is a #GVariant to write. The proper type of #GTree for this + * call can be created with g_settings_backend_create_tree(). This call + * might take a reference to the tree; you must not modified the #GTree + * after passing it to this call. + * + * This call does not fail. During this call a #GSettingsBackend::changed + * signal will be emitted if any keys have been changed. The new values of + * all updated keys will be visible to any signal callbacks. + * + * One possible method that an implementation might deal with failures is + * to emit a second "changed" signal (either during this call, or later) + * to indicate that the affected keys have suddenly "changed back" to their + * old values. + */ +gboolean +g_settings_backend_write_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag) +{ + return G_SETTINGS_BACKEND_GET_CLASS (backend) + ->write_tree (backend, tree, origin_tag); +} + +/*< private > + * g_settings_backend_reset: + * @backend: a #GSettingsBackend implementation + * @key: the name of a key + * @origin_tag: the origin tag + * + * "Resets" the named key to its "default" value (ie: after system-wide + * defaults, mandatory keys, etc. have been taken into account) or possibly + * unsets it. + */ +void +g_settings_backend_reset (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag) +{ + G_SETTINGS_BACKEND_GET_CLASS (backend) + ->reset (backend, key, origin_tag); +} + +/*< private > + * g_settings_backend_get_writable: + * @backend: a #GSettingsBackend implementation + * @key: the name of a key + * @returns: %TRUE if the key is writable + * + * Finds out if a key is available for writing to. This is the + * interface through which 'lockdown' is implemented. Locked down + * keys will have %FALSE returned by this call. + * + * You should not write to locked-down keys, but if you do, the + * implementation will deal with it. + */ +gboolean +g_settings_backend_get_writable (GSettingsBackend *backend, + const gchar *key) +{ + return G_SETTINGS_BACKEND_GET_CLASS (backend) + ->get_writable (backend, key); +} + +/*< private > + * g_settings_backend_unsubscribe: + * @backend: a #GSettingsBackend + * @name: a key or path to subscribe to + * + * Reverses the effect of a previous call to + * g_settings_backend_subscribe(). + */ +void +g_settings_backend_unsubscribe (GSettingsBackend *backend, + const char *name) +{ + G_SETTINGS_BACKEND_GET_CLASS (backend) + ->unsubscribe (backend, name); +} + +/*< private > + * g_settings_backend_subscribe: + * @backend: a #GSettingsBackend + * @name: a key or path to subscribe to + * + * Requests that change signals be emitted for events on @name. + */ +void +g_settings_backend_subscribe (GSettingsBackend *backend, + const gchar *name) +{ + G_SETTINGS_BACKEND_GET_CLASS (backend) + ->subscribe (backend, name); +} + +static void +g_settings_backend_finalize (GObject *object) +{ + GSettingsBackend *backend = G_SETTINGS_BACKEND (object); + + g_static_mutex_unlock (&backend->priv->lock); + + G_OBJECT_CLASS (g_settings_backend_parent_class) + ->finalize (object); +} + +static void +ignore_subscription (GSettingsBackend *backend, + const gchar *key) +{ +} + +static void +g_settings_backend_init (GSettingsBackend *backend) +{ + backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend, + G_TYPE_SETTINGS_BACKEND, + GSettingsBackendPrivate); + g_static_mutex_init (&backend->priv->lock); +} + +static void +g_settings_backend_class_init (GSettingsBackendClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + + class->subscribe = ignore_subscription; + class->unsubscribe = ignore_subscription; + + gobject_class->finalize = g_settings_backend_finalize; + + g_type_class_add_private (class, sizeof (GSettingsBackendPrivate)); +} + +/*< private > + * g_settings_backend_create_tree: + * @returns: a new #GTree + * + * This is a convenience function for creating a tree that is compatible + * with g_settings_backend_write(). It merely calls g_tree_new_full() + * with strcmp(), g_free() and g_variant_unref(). + */ +GTree * +g_settings_backend_create_tree (void) +{ + return g_tree_new_full ((GCompareDataFunc) strcmp, NULL, + g_free, (GDestroyNotify) g_variant_unref); +} + +/*< private > + * g_settings_backend_get_default: + * @returns: the default #GSettingsBackend + * + * Returns the default #GSettingsBackend. It is possible to override + * the default by setting the GSETTINGS_BACKEND + * environment variable to the name of a settings backend. + * + * The user gets a reference to the backend. + */ +GSettingsBackend * +g_settings_backend_get_default (void) +{ + static gsize backend; + + if (g_once_init_enter (&backend)) + { + GSettingsBackend *instance; + GIOExtensionPoint *point; + GIOExtension *extension; + GType extension_type; + GList *extensions; + const gchar *env; + + _g_io_modules_ensure_loaded (); + + point = g_io_extension_point_lookup (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME); + extension = NULL; + + if ((env = getenv ("GSETTINGS_BACKEND"))) + { + extension = g_io_extension_point_get_extension_by_name (point, env); + + if (extension == NULL) + g_warning ("Can't find GSettings backend '%s' given in " + "GSETTINGS_BACKEND environment variable", env); + } + + if (extension == NULL) + { + extensions = g_io_extension_point_get_extensions (point); + + if (extensions == NULL) + g_error ("No GSettingsBackend implementations exist."); + + extension = extensions->data; + + if (strcmp (g_io_extension_get_name (extension), "memory") == 0) + g_message ("Using the 'memory' GSettings backend. Your settings " + "will not be saved or shared with other applications."); + } + + extension_type = g_io_extension_get_type (extension); + instance = g_object_new (extension_type, NULL); + + g_once_init_leave (&backend, (gsize) instance); + } + + return g_object_ref ((void *) backend); +} + +/*< private > + * g_settings_backend_get_permission: + * @backend: a #GSettingsBackend + * @path: a path + * @returns: a non-%NULL #GPermission. Free with g_object_unref() + * + * Gets the permission object associated with writing to keys below + * @path on @backend. + * + * If this is not implemented in the backend, then a %TRUE + * #GSimplePermission is returned. + */ +GPermission * +g_settings_backend_get_permission (GSettingsBackend *backend, + const gchar *path) +{ + GSettingsBackendClass *class = G_SETTINGS_BACKEND_GET_CLASS (backend); + + if (class->get_permission) + return class->get_permission (backend, path); + + return g_simple_permission_new (TRUE); +} + +/*< private > + * g_settings_backend_sync_default: + * + * Syncs the default backend. + */ +void +g_settings_backend_sync_default (void) +{ + GSettingsBackendClass *class; + GSettingsBackend *backend; + + backend = g_settings_backend_get_default (); + class = G_SETTINGS_BACKEND_GET_CLASS (backend); + + if (class->sync) + class->sync (backend); +} diff --git a/gio/gsettingsbackend.h b/gio/gsettingsbackend.h new file mode 100644 index 0000000..3705ee5 --- /dev/null +++ b/gio/gsettingsbackend.h @@ -0,0 +1,138 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * Copyright © 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + * Matthias Clasen + */ + +#ifndef __G_SETTINGS_BACKEND_H__ +#define __G_SETTINGS_BACKEND_H__ + +#if !defined (G_SETTINGS_ENABLE_BACKEND) && !defined (GIO_COMPILATION) +#error "You must define G_SETTINGS_ENABLE_BACKEND before including ." +#endif + +#define __GIO_GIO_H_INSIDE__ +#include +#undef __GIO_GIO_H_INSIDE__ + +G_BEGIN_DECLS + +#define G_TYPE_SETTINGS_BACKEND (g_settings_backend_get_type ()) +#define G_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_SETTINGS_BACKEND, GSettingsBackend)) +#define G_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_SETTINGS_BACKEND, GSettingsBackendClass)) +#define G_IS_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_SETTINGS_BACKEND)) +#define G_IS_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_SETTINGS_BACKEND)) +#define G_SETTINGS_BACKEND_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_SETTINGS_BACKEND, GSettingsBackendClass)) + +/** + * G_SETTINGS_BACKEND_EXTENSION_POINT_NAME: + * + * Extension point for #GSettingsBackend functionality. + **/ +#define G_SETTINGS_BACKEND_EXTENSION_POINT_NAME "gsettings-backend" + +/** + * GSettingsBackend: + * + * An implementation of a settings storage repository. + **/ +typedef struct _GSettingsBackendPrivate GSettingsBackendPrivate; +typedef struct _GSettingsBackendClass GSettingsBackendClass; + +struct _GSettingsBackendClass +{ + GObjectClass parent_class; + + GVariant * (*read) (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value); + + gboolean (*get_writable) (GSettingsBackend *backend, + const gchar *key); + + gboolean (*write) (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag); + gboolean (*write_tree) (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag); + void (*reset) (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag); + + void (*subscribe) (GSettingsBackend *backend, + const gchar *name); + void (*unsubscribe) (GSettingsBackend *backend, + const gchar *name); + void (*sync) (GSettingsBackend *backend); + + GPermission * (*get_permission) (GSettingsBackend *backend, + const gchar *path); + + gpointer padding[24]; +}; + +struct _GSettingsBackend +{ + GObject parent_instance; + + /*< private >*/ + GSettingsBackendPrivate *priv; +}; + +GType g_settings_backend_get_type (void); + +void g_settings_backend_changed (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag); +void g_settings_backend_path_changed (GSettingsBackend *backend, + const gchar *path, + gpointer origin_tag); +void g_settings_backend_flatten_tree (GTree *tree, + gchar **path, + const gchar ***keys, + GVariant ***values); +void g_settings_backend_keys_changed (GSettingsBackend *backend, + const gchar *path, + gchar const * const *items, + gpointer origin_tag); + +void g_settings_backend_path_writable_changed (GSettingsBackend *backend, + const gchar *path); +void g_settings_backend_writable_changed (GSettingsBackend *backend, + const gchar *key); +void g_settings_backend_changed_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag); + +GSettingsBackend * g_keyfile_settings_backend_new (const gchar *filename, + const gchar *root_path, + const gchar *root_group); + +G_END_DECLS + +#endif /* __G_SETTINGS_BACKEND_H__ */ diff --git a/gio/gsettingsbackendinternal.h b/gio/gsettingsbackendinternal.h new file mode 100644 index 0000000..a6711cb --- /dev/null +++ b/gio/gsettingsbackendinternal.h @@ -0,0 +1,99 @@ +/* + * Copyright © 2009, 2010 Codethink Limited + * Copyright © 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + * Matthias Clasen + */ + +#ifndef __G_SETTINGS_BACKEND_INTERNAL_H__ +#define __G_SETTINGS_BACKEND_INTERNAL_H__ + +#include "gsettingsbackend.h" + +typedef struct +{ + void (* changed) (GObject *target, + GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag); + void (* path_changed) (GObject *target, + GSettingsBackend *backend, + const gchar *path, + gpointer origin_tag); + void (* keys_changed) (GObject *target, + GSettingsBackend *backend, + const gchar *prefix, + const gchar * const *names, + gpointer origin_tag); + void (* writable_changed) (GObject *target, + GSettingsBackend *backend, + const gchar *key); + void (* path_writable_changed) (GObject *target, + GSettingsBackend *backend, + const gchar *path); +} GSettingsListenerVTable; + +G_GNUC_INTERNAL +void g_settings_backend_watch (GSettingsBackend *backend, + const GSettingsListenerVTable *vtable, + GObject *target, + GMainContext *context); +G_GNUC_INTERNAL +void g_settings_backend_unwatch (GSettingsBackend *backend, + GObject *target); + +G_GNUC_INTERNAL +GTree * g_settings_backend_create_tree (void); + +G_GNUC_INTERNAL +GVariant * g_settings_backend_read (GSettingsBackend *backend, + const gchar *key, + const GVariantType *expected_type, + gboolean default_value); +G_GNUC_INTERNAL +gboolean g_settings_backend_write (GSettingsBackend *backend, + const gchar *key, + GVariant *value, + gpointer origin_tag); +G_GNUC_INTERNAL +gboolean g_settings_backend_write_tree (GSettingsBackend *backend, + GTree *tree, + gpointer origin_tag); +G_GNUC_INTERNAL +void g_settings_backend_reset (GSettingsBackend *backend, + const gchar *key, + gpointer origin_tag); +G_GNUC_INTERNAL +gboolean g_settings_backend_get_writable (GSettingsBackend *backend, + const char *key); +G_GNUC_INTERNAL +void g_settings_backend_unsubscribe (GSettingsBackend *backend, + const char *name); +G_GNUC_INTERNAL +void g_settings_backend_subscribe (GSettingsBackend *backend, + const char *name); +G_GNUC_INTERNAL +GPermission * g_settings_backend_get_permission (GSettingsBackend *backend, + const gchar *path); +G_GNUC_INTERNAL +GSettingsBackend * g_settings_backend_get_default (void); +G_GNUC_INTERNAL +void g_settings_backend_sync_default (void); + +#endif /* __G_SETTINGS_BACKEND_INTERNAL_H__ */ diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c new file mode 100644 index 0000000..6d028ad --- /dev/null +++ b/gio/gsettingsschema.c @@ -0,0 +1,361 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gsettingsschema.h" +#include "gvdb/gvdb-reader.h" + +#include + +G_DEFINE_TYPE (GSettingsSchema, g_settings_schema, G_TYPE_OBJECT) + +struct _GSettingsSchemaPrivate +{ + const gchar *gettext_domain; + const gchar *path; + GQuark *items; + gint n_items; + GvdbTable *table; + gchar *name; +}; + +static GSList *schema_sources; + +static void +initialise_schema_sources (void) +{ + static gsize initialised; + + if G_UNLIKELY (g_once_init_enter (&initialised)) + { + const gchar * const *dir; + const gchar *path; + + for (dir = g_get_system_data_dirs (); *dir; dir++) + { + gchar *filename; + GvdbTable *table; + + filename = g_build_filename (*dir, "glib-2.0", "schemas", + "gschemas.compiled", NULL); + table = gvdb_table_new (filename, TRUE, NULL); + + if (table != NULL) + schema_sources = g_slist_prepend (schema_sources, table); + + g_free (filename); + } + + schema_sources = g_slist_reverse (schema_sources); + + if ((path = g_getenv ("GSETTINGS_SCHEMA_DIR")) != NULL) + { + gchar *filename; + GvdbTable *table; + + filename = g_build_filename (path, "gschemas.compiled", NULL); + table = gvdb_table_new (filename, TRUE, NULL); + + if (table != NULL) + schema_sources = g_slist_prepend (schema_sources, table); + + g_free (filename); + } + + g_once_init_leave (&initialised, TRUE); + } +} + +static gboolean +steal_item (gpointer key, + gpointer value, + gpointer user_data) +{ + gchar ***ptr = user_data; + + *(*ptr)++ = (gchar *) key; + + return TRUE; +} + +static const gchar * const *non_relocatable_schema_list; +static const gchar * const *relocatable_schema_list; +static gsize schema_lists_initialised; + +static void +ensure_schema_lists (void) +{ + if (g_once_init_enter (&schema_lists_initialised)) + { + GHashTable *single, *reloc; + const gchar **ptr; + GSList *source; + gchar **list; + gint i; + + initialise_schema_sources (); + + /* We use hash tables to avoid duplicate listings for schemas that + * appear in more than one file. + */ + single = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + reloc = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + + for (source = schema_sources; source; source = source->next) + { + list = gvdb_table_list (source->data, ""); + + g_assert (list != NULL); + + for (i = 0; list[i]; i++) + { + if (!g_hash_table_lookup (single, list[i]) && + !g_hash_table_lookup (reloc, list[i])) + { + GvdbTable *table; + + table = gvdb_table_get_table (source->data, list[i]); + g_assert (table != NULL); + + if (gvdb_table_has_value (table, ".path")) + g_hash_table_insert (single, g_strdup (list[i]), NULL); + else + g_hash_table_insert (reloc, g_strdup (list[i]), NULL); + + gvdb_table_unref (table); + } + } + + g_strfreev (list); + } + + ptr = g_new (const gchar *, g_hash_table_size (single) + 1); + non_relocatable_schema_list = ptr; + g_hash_table_foreach_steal (single, steal_item, &ptr); + g_hash_table_unref (single); + *ptr = NULL; + + ptr = g_new (const gchar *, g_hash_table_size (reloc) + 1); + relocatable_schema_list = ptr; + g_hash_table_foreach_steal (reloc, steal_item, &ptr); + g_hash_table_unref (reloc); + *ptr = NULL; + + g_once_init_leave (&schema_lists_initialised, TRUE); + } +} + +/** + * g_settings_list_schemas: + * + * Gets a list of the #GSettings schemas installed on the system. The + * returned list is exactly the list of schemas for which you may call + * g_settings_new() without adverse effects. + * + * This function does not list the schemas that do not provide their own + * paths (ie: schemas for which you must use + * g_settings_new_with_path()). See + * g_settings_list_relocatable_schemas() for that. + * + * Returns: (element-type utf8) (transfer none): a list of #GSettings + * schemas that are available. The list must not be modified or + * freed. + * + * Since: 2.26 + **/ +const gchar * const * +g_settings_list_schemas (void) +{ + ensure_schema_lists (); + + return non_relocatable_schema_list; +} + +/** + * g_settings_list_relocatable_schemas: + * + * Gets a list of the relocatable #GSettings schemas installed on the + * system. These are schemas that do not provide their own path. It is + * usual to instantiate these schemas directly, but if you want to you + * can use g_settings_new_with_path() to specify the path. + * + * The output of this function, tTaken together with the output of + * g_settings_list_schemas() represents the complete list of all + * installed schemas. + * + * Returns: (element-type utf8) (transfer none): a list of relocatable + * #GSettings schemas that are available. The list must not be + * modified or freed. + * + * Since: 2.28 + **/ +const gchar * const * +g_settings_list_relocatable_schemas (void) +{ + ensure_schema_lists (); + + return relocatable_schema_list; +} + +static void +g_settings_schema_finalize (GObject *object) +{ + GSettingsSchema *schema = G_SETTINGS_SCHEMA (object); + + gvdb_table_unref (schema->priv->table); + g_free (schema->priv->items); + g_free (schema->priv->name); + + G_OBJECT_CLASS (g_settings_schema_parent_class) + ->finalize (object); +} + +static void +g_settings_schema_init (GSettingsSchema *schema) +{ + schema->priv = G_TYPE_INSTANCE_GET_PRIVATE (schema, G_TYPE_SETTINGS_SCHEMA, + GSettingsSchemaPrivate); +} + +static void +g_settings_schema_class_init (GSettingsSchemaClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = g_settings_schema_finalize; + + g_type_class_add_private (class, sizeof (GSettingsSchemaPrivate)); +} + +const gchar * +g_settings_schema_get_string (GSettingsSchema *schema, + const gchar *key) +{ + const gchar *result = NULL; + GVariant *value; + + if ((value = gvdb_table_get_raw_value (schema->priv->table, key))) + { + result = g_variant_get_string (value, NULL); + g_variant_unref (value); + } + + return result; +} + +GSettingsSchema * +g_settings_schema_new (const gchar *name) +{ + GSettingsSchema *schema; + GvdbTable *table = NULL; + GSList *source; + + initialise_schema_sources (); + + for (source = schema_sources; source; source = source->next) + { + GvdbTable *file = source->data; + + if ((table = gvdb_table_get_table (file, name))) + break; + } + + if (table == NULL) + g_error ("Settings schema '%s' is not installed\n", name); + + schema = g_object_new (G_TYPE_SETTINGS_SCHEMA, NULL); + schema->priv->name = g_strdup (name); + schema->priv->table = table; + schema->priv->path = + g_settings_schema_get_string (schema, ".path"); + schema->priv->gettext_domain = + g_settings_schema_get_string (schema, ".gettext-domain"); + + if (schema->priv->gettext_domain) + bind_textdomain_codeset (schema->priv->gettext_domain, "UTF-8"); + + return schema; +} + +GVariantIter * +g_settings_schema_get_value (GSettingsSchema *schema, + const gchar *key) +{ + GVariantIter *iter; + GVariant *value; + + value = gvdb_table_get_raw_value (schema->priv->table, key); + + if G_UNLIKELY (value == NULL) + g_error ("schema does not contain a key named '%s'", key); + + iter = g_variant_iter_new (value); + g_variant_unref (value); + + return iter; +} + +const gchar * +g_settings_schema_get_path (GSettingsSchema *schema) +{ + return schema->priv->path; +} + +const gchar * +g_settings_schema_get_gettext_domain (GSettingsSchema *schema) +{ + return schema->priv->gettext_domain; +} + +gboolean +g_settings_schema_has_key (GSettingsSchema *schema, + const gchar *key) +{ + return gvdb_table_has_value (schema->priv->table, key); +} + +const GQuark * +g_settings_schema_list (GSettingsSchema *schema, + gint *n_items) +{ + gint i, j; + + if (schema->priv->items == NULL) + { + gchar **list; + gint len; + + list = gvdb_table_list (schema->priv->table, ""); + len = g_strv_length (list); + + schema->priv->items = g_new (GQuark, len); + j = 0; + + for (i = 0; i < len; i++) + if (list[i][0] != '.') + schema->priv->items[j++] = g_quark_from_string (list[i]); + schema->priv->n_items = j; + + g_strfreev (list); + } + + *n_items = schema->priv->n_items; + return schema->priv->items; +} diff --git a/gio/gsettingsschema.h b/gio/gsettingsschema.h new file mode 100644 index 0000000..31ba1f4 --- /dev/null +++ b/gio/gsettingsschema.h @@ -0,0 +1,78 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __G_SETTINGS_SCHEMA_H__ +#define __G_SETTINGS_SCHEMA_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SETTINGS_SCHEMA (g_settings_schema_get_type ()) +#define G_SETTINGS_SCHEMA(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_SETTINGS_SCHEMA, GSettingsSchema)) +#define G_SETTINGS_SCHEMA_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_SETTINGS_SCHEMA, GSettingsSchemaClass)) +#define G_IS_SETTINGS_SCHEMA(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_SETTINGS_SCHEMA)) +#define G_IS_SETTINGS_SCHEMA_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_SETTINGS_SCHEMA)) +#define G_SETTINGS_SCHEMA_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_SETTINGS_SCHEMA, GSettingsSchemaClass)) + +typedef struct _GSettingsSchemaPrivate GSettingsSchemaPrivate; +typedef struct _GSettingsSchemaClass GSettingsSchemaClass; +typedef struct _GSettingsSchema GSettingsSchema; + +struct _GSettingsSchemaClass +{ + GObjectClass parent_class; +}; + +struct _GSettingsSchema +{ + GObject parent_instance; + + GSettingsSchemaPrivate *priv; +}; + +G_GNUC_INTERNAL +GType g_settings_schema_get_type (void); +G_GNUC_INTERNAL +GSettingsSchema * g_settings_schema_new (const gchar *name); +G_GNUC_INTERNAL +const gchar * g_settings_schema_get_path (GSettingsSchema *schema); +G_GNUC_INTERNAL +const gchar * g_settings_schema_get_gettext_domain (GSettingsSchema *schema); +G_GNUC_INTERNAL +GVariantIter * g_settings_schema_get_value (GSettingsSchema *schema, + const gchar *key); +G_GNUC_INTERNAL +gboolean g_settings_schema_has_key (GSettingsSchema *schema, + const gchar *key); +G_GNUC_INTERNAL +const GQuark * g_settings_schema_list (GSettingsSchema *schema, + gint *n_items); +G_GNUC_INTERNAL +const gchar * g_settings_schema_get_string (GSettingsSchema *schema, + const gchar *key); + +G_END_DECLS + +#endif /* __G_SETTINGS_SCHEMA_H__ */ diff --git a/gio/gsimpleaction.c b/gio/gsimpleaction.c new file mode 100644 index 0000000..388ead3 --- /dev/null +++ b/gio/gsimpleaction.c @@ -0,0 +1,498 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#include "config.h" + +#include "gsimpleaction.h" + +#include "gaction.h" +#include "glibintl.h" + +static void g_simple_action_iface_init (GActionInterface *iface); +G_DEFINE_TYPE_WITH_CODE (GSimpleAction, g_simple_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_simple_action_iface_init)) + +/** + * SECTION:gsimpleaction + * @title: GSimpleAction + * @short_description: A simple GSimpleAction + * + * A #GSimpleAction is the obvious simple implementation of the #GSimpleAction + * interface. This is the easiest way to create an action for purposes of + * adding it to a #GSimpleActionGroup. + * + * See also #GtkAction. + **/ + +struct _GSimpleActionPrivate +{ + gchar *name; + GVariantType *parameter_type; + guint enabled : 1; + guint state_set : 1; + GVariant *state; +}; + +enum +{ + PROP_NONE, + PROP_NAME, + PROP_PARAMETER_TYPE, + PROP_ENABLED, + PROP_STATE_TYPE, + PROP_STATE +}; + +enum +{ + SIGNAL_ACTIVATE, + NR_SIGNALS +}; + +static guint g_simple_action_signals[NR_SIGNALS]; + +static const gchar * +g_simple_action_get_name (GAction *action) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + return simple->priv->name; +} + +const GVariantType * +g_simple_action_get_parameter_type (GAction *action) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + return simple->priv->parameter_type; +} + +static const GVariantType * +g_simple_action_get_state_type (GAction *action) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + if (simple->priv->state != NULL) + return g_variant_get_type (simple->priv->state); + else + return NULL; +} + +static GVariant * +g_simple_action_get_state_hint (GAction *action) +{ + return NULL; +} + +static gboolean +g_simple_action_get_enabled (GAction *action) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + return simple->priv->enabled; +} + +static void +g_simple_action_set_state (GAction *action, + GVariant *value) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + g_return_if_fail (value != NULL); + + { + const GVariantType *state_type; + + state_type = simple->priv->state ? + g_variant_get_type (simple->priv->state) : NULL; + g_return_if_fail (state_type != NULL); + g_return_if_fail (g_variant_is_of_type (value, state_type)); + } + + g_variant_ref_sink (value); + + if (!g_variant_equal (simple->priv->state, value)) + { + if (simple->priv->state) + g_variant_unref (simple->priv->state); + + simple->priv->state = g_variant_ref (value); + + g_object_notify (G_OBJECT (simple), "state"); + } + + g_variant_unref (value); +} + +static GVariant * +g_simple_action_get_state (GAction *action) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + return simple->priv->state ? g_variant_ref (simple->priv->state) : NULL; +} + +static void +g_simple_action_activate (GAction *action, + GVariant *parameter) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (action); + + g_return_if_fail (simple->priv->parameter_type == NULL ? + parameter == NULL : + (parameter != NULL && + g_variant_is_of_type (parameter, + simple->priv->parameter_type))); + + if (parameter != NULL) + g_variant_ref_sink (parameter); + + if (simple->priv->enabled) + g_signal_emit (simple, g_simple_action_signals[SIGNAL_ACTIVATE], 0, parameter); + + if (parameter != NULL) + g_variant_unref (parameter); +} + +static void +g_simple_action_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (object); + + switch (prop_id) + { + case PROP_NAME: + g_assert (simple->priv->name == NULL); + simple->priv->name = g_value_dup_string (value); + break; + + case PROP_PARAMETER_TYPE: + g_assert (simple->priv->parameter_type == NULL); + simple->priv->parameter_type = g_value_dup_boxed (value); + break; + + case PROP_ENABLED: + g_simple_action_set_enabled (simple, g_value_get_boolean (value)); + break; + + case PROP_STATE: + /* PROP_STATE is marked as G_PARAM_CONSTRUCT so we always get a + * call during object construction, even if it is NULL. We treat + * that first call differently, for a number of reasons. + * + * First, we don't want the value to be rejected by the + * possibly-overridden .set_state() function. Second, we don't + * want to be tripped by the assertions in g_simple_action_set_state() + * that would enforce the catch22 that we only provide a value of + * the same type as the existing value (when there is not yet an + * existing value). + */ + if (simple->priv->state_set) + g_simple_action_set_state (G_ACTION (simple), + g_value_get_variant (value)); + + else /* this is the special case */ + { + /* only do it the first time. */ + simple->priv->state_set = TRUE; + + /* blindly set it. */ + simple->priv->state = g_value_dup_variant (value); + } + break; + + default: + g_assert_not_reached (); + } +} + +static void +g_simple_action_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GAction *action = G_ACTION (object); + + switch (prop_id) + { + case PROP_NAME: + g_value_set_string (value, g_simple_action_get_name (action)); + break; + + case PROP_PARAMETER_TYPE: + g_value_set_boxed (value, g_simple_action_get_parameter_type (action)); + break; + + case PROP_ENABLED: + g_value_set_boolean (value, g_simple_action_get_enabled (action)); + break; + + case PROP_STATE_TYPE: + g_value_set_boxed (value, g_simple_action_get_state_type (action)); + break; + + case PROP_STATE: + g_value_take_variant (value, g_simple_action_get_state (action)); + break; + + default: + g_assert_not_reached (); + } +} + +static void +g_simple_action_finalize (GObject *object) +{ + GSimpleAction *simple = G_SIMPLE_ACTION (object); + + g_free (simple->priv->name); + if (simple->priv->parameter_type) + g_variant_type_free (simple->priv->parameter_type); + if (simple->priv->state) + g_variant_unref (simple->priv->state); + + G_OBJECT_CLASS (g_simple_action_parent_class) + ->finalize (object); +} + +void +g_simple_action_init (GSimpleAction *simple) +{ + simple->priv = G_TYPE_INSTANCE_GET_PRIVATE (simple, + G_TYPE_SIMPLE_ACTION, + GSimpleActionPrivate); +} + +void +g_simple_action_iface_init (GActionInterface *iface) +{ + iface->get_name = g_simple_action_get_name; + iface->get_parameter_type = g_simple_action_get_parameter_type; + iface->get_state_type = g_simple_action_get_state_type; + iface->get_state_hint = g_simple_action_get_state_hint; + iface->get_enabled = g_simple_action_get_enabled; + iface->get_state = g_simple_action_get_state; + iface->set_state = g_simple_action_set_state; + iface->activate = g_simple_action_activate; +} + +void +g_simple_action_class_init (GSimpleActionClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + + object_class->get_property = g_simple_action_get_property; + object_class->set_property = g_simple_action_set_property; + object_class->finalize = g_simple_action_finalize; + + /** + * GSimpleAction::activate: + * @simple: the #GSimpleAction + * @parameter: (allow-none): the parameter to the activation + * + * Indicates that the action was just activated. + * + * @parameter will always be of the expected type. In the event that + * an incorrect type was given, no signal will be emitted. + * + * Since: 2.28 + */ + g_simple_action_signals[SIGNAL_ACTIVATE] = + g_signal_new (I_("activate"), + G_TYPE_SIMPLE_ACTION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GSimpleActionClass, activate), + NULL, NULL, + g_cclosure_marshal_VOID__VARIANT, + G_TYPE_NONE, 1, + G_TYPE_VARIANT); + + /** + * GSimpleAction:name: + * + * The name of the action. This is mostly meaningful for identifying + * the action once it has been added to a #GSimpleActionGroup. + * + * Since: 2.28 + **/ + g_object_class_install_property (object_class, PROP_NAME, + g_param_spec_string ("name", + P_("Action Name"), + P_("The name used to invoke the action"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * GSimpleAction:parameter-type: + * + * The type of the parameter that must be given when activating the + * action. + * + * Since: 2.28 + **/ + g_object_class_install_property (object_class, PROP_PARAMETER_TYPE, + g_param_spec_boxed ("parameter-type", + P_("Parameter Type"), + P_("The type of GVariant passed to activate()"), + G_TYPE_VARIANT_TYPE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * GSimpleAction:enabled: + * + * If @action is currently enabled. + * + * If the action is disabled then calls to g_simple_action_activate() and + * g_simple_action_set_state() have no effect. + * + * Since: 2.28 + **/ + g_object_class_install_property (object_class, PROP_ENABLED, + g_param_spec_boolean ("enabled", + P_("Enabled"), + P_("If the action can be activated"), + TRUE, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * GSimpleAction:state-type: + * + * The #GVariantType of the state that the action has, or %NULL if the + * action is stateless. + * + * Since: 2.28 + **/ + g_object_class_install_property (object_class, PROP_STATE_TYPE, + g_param_spec_boxed ("state-type", + P_("State Type"), + P_("The type of the state kept by the action"), + G_TYPE_VARIANT_TYPE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GSimpleAction:state: + * + * The state of the action, or %NULL if the action is stateless. + * + * Since: 2.28 + **/ + g_object_class_install_property (object_class, PROP_STATE, + g_param_spec_variant ("state", + P_("State"), + P_("The state the action is in"), + G_VARIANT_TYPE_ANY, + NULL, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (class, sizeof (GSimpleActionPrivate)); +} + +/** + * g_simple_action_set_enabled: + * @simple: a #GSimpleAction + * @enabled: whether the action is enabled + * + * Sets the action as enabled or not. + * + * An action must be enabled in order to be activated or in order to + * have its state changed from outside callers. + * + * Since: 2.28 + **/ +void +g_simple_action_set_enabled (GSimpleAction *simple, + gboolean enabled) +{ + g_return_if_fail (G_IS_SIMPLE_ACTION (simple)); + + enabled = !!enabled; + + if (simple->priv->enabled != enabled) + { + simple->priv->enabled = enabled; + g_object_notify (G_OBJECT (simple), "enabled"); + } +} +/** + * g_simple_action_new: + * @name: the name of the action + * @parameter_type: (allow-none): the type of parameter to the activate function + * + * Creates a new action. + * + * The created action is stateless. See g_simple_action_new_stateful(). + * + * Returns: a new #GSimpleAction + * + * Since: 2.28 + **/ +GSimpleAction * +g_simple_action_new (const gchar *name, + const GVariantType *parameter_type) +{ + return g_object_new (G_TYPE_SIMPLE_ACTION, + "name", name, + "parameter-type", parameter_type, + NULL); +} + +/** + * g_simple_action_new_stateful: + * @name: the name of the action + * @parameter_type: (allow-none): the type of the parameter to the activate function + * @state: the initial state of the action + * + * Creates a new stateful action. + * + * @state is the initial state of the action. All future state values + * must have the same #GVariantType as the initial state. + * + * If the @state GVariant is floating, it is consumed. + * + * Returns: a new #GSimpleAction + * + * Since: 2.28 + **/ +GSimpleAction * +g_simple_action_new_stateful (const gchar *name, + const GVariantType *parameter_type, + GVariant *state) +{ + return g_object_new (G_TYPE_SIMPLE_ACTION, + "name", name, + "parameter-type", parameter_type, + "state", state, + NULL); +} diff --git a/gio/gsimpleaction.h b/gio/gsimpleaction.h new file mode 100644 index 0000000..a4ddeee --- /dev/null +++ b/gio/gsimpleaction.h @@ -0,0 +1,95 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_SIMPLE_ACTION_H__ +#define __G_SIMPLE_ACTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SIMPLE_ACTION (g_simple_action_get_type ()) +#define G_SIMPLE_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_SIMPLE_ACTION, GSimpleAction)) +#define G_SIMPLE_ACTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_SIMPLE_ACTION, GSimpleActionClass)) +#define G_IS_SIMPLE_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_SIMPLE_ACTION)) +#define G_IS_SIMPLE_ACTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_SIMPLE_ACTION)) +#define G_SIMPLE_ACTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_SIMPLE_ACTION, GSimpleActionClass)) + +typedef struct _GSimpleActionPrivate GSimpleActionPrivate; +typedef struct _GSimpleActionClass GSimpleActionClass; + +/** + * GSimpleAction: + * + * The GSimpleAction structure contains private + * data and should only be accessed using the provided API + * + * Since: 2.26 + */ +struct _GSimpleAction +{ + /*< private >*/ + GObject parent_instance; + + GSimpleActionPrivate *priv; +}; + +/** + * GSimpleActionClass: + * @activate: the class closure for the activate signal + * + * Since: 2.26 + */ +struct _GSimpleActionClass +{ + GObjectClass parent_class; + + /* signals */ + void (* activate) (GSimpleAction *simple, + GVariant *parameter); + /*< private >*/ + gpointer padding[6]; +}; + +GType g_simple_action_get_type (void) G_GNUC_CONST; + +GSimpleAction * g_simple_action_new (const gchar *name, + const GVariantType *parameter_type); + +GSimpleAction * g_simple_action_new_stateful (const gchar *name, + const GVariantType *parameter_type, + GVariant *state); + +void g_simple_action_set_enabled (GSimpleAction *simple, + gboolean enabled); + +G_END_DECLS + +#endif /* __G_SIMPLE_ACTION_H__ */ diff --git a/gio/gsimpleactiongroup.c b/gio/gsimpleactiongroup.c new file mode 100644 index 0000000..ecc1dce --- /dev/null +++ b/gio/gsimpleactiongroup.c @@ -0,0 +1,380 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#include "gsimpleactiongroup.h" +#include "gaction.h" + +/** + * SECTION:gsimpleactiongroup + * @title: GSimpleActionGroup + * @short_description: A simple GActionGroup implementation + * + * #GSimpleActionGroup is a hash table filled with #GAction objects, + * implementing the #GActionGroup interface. + **/ + +struct _GSimpleActionGroupPrivate +{ + GHashTable *table; /* string -> GAction */ +}; + +static void g_simple_action_group_iface_init (GActionGroupInterface *); +G_DEFINE_TYPE_WITH_CODE (GSimpleActionGroup, + g_simple_action_group, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, + g_simple_action_group_iface_init)) + +static gchar ** +g_simple_action_group_list_actions (GActionGroup *group) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GHashTableIter iter; + gint n, i = 0; + gchar **keys; + gpointer key; + + n = g_hash_table_size (simple->priv->table); + keys = g_new (gchar *, n + 1); + + g_hash_table_iter_init (&iter, simple->priv->table); + while (g_hash_table_iter_next (&iter, &key, NULL)) + keys[i++] = g_strdup (key); + g_assert_cmpint (i, ==, n); + keys[n] = NULL; + + return keys; +} + +static gboolean +g_simple_action_group_has_action (GActionGroup *group, + const gchar *action_name) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + + return g_hash_table_lookup (simple->priv->table, action_name) != NULL; +} + +static const GVariantType * +g_simple_action_group_get_parameter_type (GActionGroup *group, + const gchar *action_name) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return NULL; + + return g_action_get_parameter_type (action); +} + +static const GVariantType * +g_simple_action_group_get_state_type (GActionGroup *group, + const gchar *action_name) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return NULL; + + return g_action_get_state_type (action); +} + +static GVariant * +g_simple_action_group_get_state_hint (GActionGroup *group, + const gchar *action_name) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return NULL; + + return g_action_get_state_hint (action); +} + +static gboolean +g_simple_action_group_get_enabled (GActionGroup *group, + const gchar *action_name) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return FALSE; + + return g_action_get_enabled (action); +} + +static GVariant * +g_simple_action_group_get_state (GActionGroup *group, + const gchar *action_name) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return NULL; + + return g_action_get_state (action); +} + +static void +g_simple_action_group_set_state (GActionGroup *group, + const gchar *action_name, + GVariant *value) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return; + + return g_action_set_state (action, value); +} + +static void +g_simple_action_group_activate (GActionGroup *group, + const gchar *action_name, + GVariant *parameter) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (group); + GAction *action; + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action == NULL) + return; + + return g_action_activate (action, parameter); +} + +static void +action_enabled_notify (GAction *action, + GParamSpec *pspec, + gpointer user_data) +{ + g_action_group_action_enabled_changed (user_data, + g_action_get_name (action), + g_action_get_enabled (action)); +} + +static void +action_state_notify (GAction *action, + GParamSpec *pspec, + gpointer user_data) +{ + GVariant *value; + + value = g_action_get_state (action); + g_action_group_action_state_changed (user_data, + g_action_get_name (action), + value); + g_variant_unref (value); +} + +static void +g_simple_action_group_disconnect (gpointer key, + gpointer value, + gpointer user_data) +{ + g_signal_handlers_disconnect_by_func (value, action_enabled_notify, + user_data); + g_signal_handlers_disconnect_by_func (value, action_state_notify, + user_data); +} + +static void +g_simple_action_group_finalize (GObject *object) +{ + GSimpleActionGroup *simple = G_SIMPLE_ACTION_GROUP (object); + + g_hash_table_foreach (simple->priv->table, + g_simple_action_group_disconnect, + simple); + g_hash_table_unref (simple->priv->table); + + G_OBJECT_CLASS (g_simple_action_group_parent_class) + ->finalize (object); +} + +static void +g_simple_action_group_init (GSimpleActionGroup *simple) +{ + simple->priv = G_TYPE_INSTANCE_GET_PRIVATE (simple, + G_TYPE_SIMPLE_ACTION_GROUP, + GSimpleActionGroupPrivate); + simple->priv->table = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, g_object_unref); +} + +static void +g_simple_action_group_class_init (GSimpleActionGroupClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = g_simple_action_group_finalize; + + g_type_class_add_private (class, sizeof (GSimpleActionGroupPrivate)); +} + +static void +g_simple_action_group_iface_init (GActionGroupInterface *iface) +{ + iface->list_actions = g_simple_action_group_list_actions; + iface->has_action = g_simple_action_group_has_action; + iface->get_action_parameter_type = g_simple_action_group_get_parameter_type; + iface->get_action_state_type = g_simple_action_group_get_state_type; + iface->get_action_state_hint = g_simple_action_group_get_state_hint; + iface->get_action_enabled = g_simple_action_group_get_enabled; + iface->get_action_state = g_simple_action_group_get_state; + iface->change_action_state = g_simple_action_group_set_state; + iface->activate_action = g_simple_action_group_activate; +} + +/** + * g_simple_action_group_new: + * + * Creates a new, empty, #GSimpleActionGroup. + * + * Returns: a new #GSimpleActionGroup + * + * Since: 2.28 + **/ +GSimpleActionGroup * +g_simple_action_group_new (void) +{ + return g_object_new (G_TYPE_SIMPLE_ACTION_GROUP, NULL); +} + +/** + * g_simple_action_group_lookup: + * @simple: a #GSimpleActionGroup + * @action_name: the name of an action + * + * Looks up the action with the name @action_name in the group. + * + * If no such action exists, returns %NULL. + * + * Returns: (transfer none): a #GAction, or %NULL + * + * Since: 2.28 + **/ +GAction * +g_simple_action_group_lookup (GSimpleActionGroup *simple, + const gchar *action_name) +{ + g_return_val_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple), NULL); + + return g_hash_table_lookup (simple->priv->table, action_name); +} + +/** + * g_simple_action_group_insert: + * @simple: a #GSimpleActionGroup + * @action: a #GAction + * + * Adds an action to the action group. + * + * If the action group already contains an action with the same name as + * @action then the old action is dropped from the group. + * + * The action group takes its own reference on @action. + * + * Since: 2.28 + **/ +void +g_simple_action_group_insert (GSimpleActionGroup *simple, + GAction *action) +{ + const gchar *action_name; + GAction *old_action; + + g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple)); + g_return_if_fail (G_IS_ACTION (action)); + + action_name = g_action_get_name (action); + old_action = g_hash_table_lookup (simple->priv->table, action_name); + + if (old_action != action) + { + if (old_action != NULL) + { + g_action_group_action_removed (G_ACTION_GROUP (simple), + action_name); + g_simple_action_group_disconnect (NULL, old_action, simple); + } + + g_signal_connect (action, "notify::enabled", + G_CALLBACK (action_enabled_notify), simple); + + if (g_action_get_state_type (action) != NULL) + g_signal_connect (action, "notify::state", + G_CALLBACK (action_state_notify), simple); + + g_hash_table_insert (simple->priv->table, + g_strdup (action_name), + g_object_ref (action)); + + g_action_group_action_added (G_ACTION_GROUP (simple), action_name); + } +} + +/** + * g_simple_action_group_remove: + * @simple: a #GSimpleActionGroup + * @action_name: the name of the action + * + * Removes the named action from the action group. + * + * If no action of this name is in the group then nothing happens. + * + * Since: 2.28 + **/ +void +g_simple_action_group_remove (GSimpleActionGroup *simple, + const gchar *action_name) +{ + GAction *action; + + g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple)); + + action = g_hash_table_lookup (simple->priv->table, action_name); + + if (action != NULL) + { + g_action_group_action_removed (G_ACTION_GROUP (simple), action_name); + g_simple_action_group_disconnect (NULL, action, simple); + g_hash_table_remove (simple->priv->table, action_name); + } +} diff --git a/gio/gsimpleactiongroup.h b/gio/gsimpleactiongroup.h new file mode 100644 index 0000000..14d60c4 --- /dev/null +++ b/gio/gsimpleactiongroup.h @@ -0,0 +1,87 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_SIMPLE_ACTION_GROUP_H__ +#define __G_SIMPLE_ACTION_GROUP_H__ + +#include "gactiongroup.h" + +G_BEGIN_DECLS + +#define G_TYPE_SIMPLE_ACTION_GROUP (g_simple_action_group_get_type ()) +#define G_SIMPLE_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_SIMPLE_ACTION_GROUP, GSimpleActionGroup)) +#define G_SIMPLE_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_SIMPLE_ACTION_GROUP, GSimpleActionGroupClass)) +#define G_IS_SIMPLE_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_SIMPLE_ACTION_GROUP)) +#define G_IS_SIMPLE_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_SIMPLE_ACTION_GROUP)) +#define G_SIMPLE_ACTION_GROUP_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_SIMPLE_ACTION_GROUP, GSimpleActionGroupClass)) + +typedef struct _GSimpleActionGroupPrivate GSimpleActionGroupPrivate; +typedef struct _GSimpleActionGroupClass GSimpleActionGroupClass; + +/** + * GSimpleActionGroup: + * + * The #GSimpleActionGroup structure contains private data and should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GSimpleActionGroup +{ + /*< private >*/ + GObject parent_instance; + + GSimpleActionGroupPrivate *priv; +}; + +struct _GSimpleActionGroupClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< private >*/ + gpointer padding[12]; +}; + +GType g_simple_action_group_get_type (void) G_GNUC_CONST; + +GSimpleActionGroup * g_simple_action_group_new (void); + +GAction * g_simple_action_group_lookup (GSimpleActionGroup *simple, + const gchar *action_name); + +void g_simple_action_group_insert (GSimpleActionGroup *simple, + GAction *action); + +void g_simple_action_group_remove (GSimpleActionGroup *simple, + const gchar *action_name); + +G_END_DECLS + +#endif /* __G_SIMPLE_ACTION_GROUP_H__ */ diff --git a/gio/gsimpleasyncresult.c b/gio/gsimpleasyncresult.c index 6121dc0..30d5123 100644 --- a/gio/gsimpleasyncresult.c +++ b/gio/gsimpleasyncresult.c @@ -38,7 +38,6 @@ #include #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gsimpleasyncresult @@ -73,7 +72,8 @@ * * To create a new #GSimpleAsyncResult, call g_simple_async_result_new(). * If the result needs to be created for a #GError, use - * g_simple_async_result_new_from_error(). If a #GError is not available + * g_simple_async_result_new_from_error() or + * g_simple_async_result_new_take_error(). If a #GError is not available * (e.g. the asynchronous operation's doesn't take a #GError argument), * but the result still needs to be created for an error condition, use * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va() @@ -110,7 +110,109 @@ * g_simple_async_result_get_op_res_gssize() are * provided, getting the operation's result as a gpointer, gboolean, and * gssize, respectively. - **/ + * + * For the details of the requirements implementations must respect, see + * #GAsyncResult. A typical implementation of an asynchronous operation + * using GSimpleAsyncResult looks something like this: + * + * |[ + * static void + * baked_cb (Cake *cake, + * gpointer user_data) + * { + * /* In this example, this callback is not given a reference to the cake, so + * * the GSimpleAsyncResult has to take a reference to it. + * */ + * GSimpleAsyncResult *result = user_data; + * + * if (cake == NULL) + * g_simple_async_result_set_error (result, + * BAKER_ERRORS, + * BAKER_ERROR_NO_FLOUR, + * "Go to the supermarket"); + * else + * g_simple_async_result_set_op_res_gpointer (result, + * g_object_ref (cake), + * g_object_unref); + * + * + * /* In this example, we assume that baked_cb is called as a callback from + * * the mainloop, so it's safe to complete the operation synchronously here. + * * If, however, _baker_prepare_cake () might call its callback without + * * first returning to the mainloop — inadvisable, but some APIs do so — + * * we would need to use g_simple_async_result_complete_in_idle(). + * */ + * g_simple_async_result_complete (result); + * g_object_unref (result); + * } + * + * void + * baker_bake_cake_async (Baker *self, + * guint radius, + * GAsyncReadyCallback callback, + * gpointer user_data) + * { + * GSimpleAsyncResult *simple; + * Cake *cake; + * + * if (radius < 3) + * { + * g_simple_async_report_error_in_idle (G_OBJECT (self), + * callback, + * user_data, + * BAKER_ERRORS, + * BAKER_ERROR_TOO_SMALL, + * "%ucm radius cakes are silly", + * radius); + * return; + * } + * + * simple = g_simple_async_result_new (G_OBJECT (self), + * callback, + * user_data, + * baker_bake_cake_async); + * cake = _baker_get_cached_cake (self, radius); + * + * if (cake != NULL) + * { + * g_simple_async_result_set_op_res_gpointer (simple, + * g_object_ref (cake), + * g_object_unref); + * g_simple_async_result_complete_in_idle (simple); + * g_object_unref (simple); + * /* Drop the reference returned by _baker_get_cached_cake(); the + * * GSimpleAsyncResult has taken its own reference. + * */ + * g_object_unref (cake); + * return; + * } + * + * _baker_prepare_cake (self, radius, baked_cb, simple); + * } + * + * Cake * + * baker_bake_cake_finish (Baker *self, + * GAsyncResult *result, + * GError **error) + * { + * GSimpleAsyncResult *simple; + * Cake *cake; + * + * g_return_val_if_fail (g_simple_async_result_is_valid (result, + * G_OBJECT (self), + * baker_bake_cake_async), + * NULL); + * + * simple = (GSimpleAsyncResult *) result; + * + * if (g_simple_async_result_propagate_error (simple, error)) + * return NULL; + * + * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple)); + * return g_object_ref (cake); + * } + * ]| + */ static void g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface); @@ -197,8 +299,7 @@ g_simple_async_result_init (GSimpleAsyncResult *simple) /** * g_simple_async_result_new: - * @source_object: a #GObject the asynchronous function was called with, - * or %NULL. + * @source_object: (allow-none): a #GObject, or %NULL. * @callback: a #GAsyncReadyCallback. * @user_data: user data passed to @callback. * @source_tag: the asynchronous function. @@ -231,10 +332,10 @@ g_simple_async_result_new (GObject *source_object, /** * g_simple_async_result_new_from_error: - * @source_object: a #GObject, or %NULL. + * @source_object: (allow-none): a #GObject, or %NULL. * @callback: a #GAsyncReadyCallback. * @user_data: user data passed to @callback. - * @error: a #GError location. + * @error: a #GError * * Creates a #GSimpleAsyncResult from an error condition. * @@ -244,7 +345,7 @@ GSimpleAsyncResult * g_simple_async_result_new_from_error (GObject *source_object, GAsyncReadyCallback callback, gpointer user_data, - GError *error) + const GError *error) { GSimpleAsyncResult *simple; @@ -259,8 +360,40 @@ g_simple_async_result_new_from_error (GObject *source_object, } /** + * g_simple_async_result_new_take_error: + * @source_object: (allow-none): a #GObject, or %NULL + * @callback: a #GAsyncReadyCallback + * @user_data: (allow-none): user data passed to @callback + * @error: a #GError + * + * Creates a #GSimpleAsyncResult from an error condition, and takes over the + * caller's ownership of @error, so the caller does not need to free it anymore. + * + * Returns: a #GSimpleAsyncResult + * + * Since: 2.28 + **/ +GSimpleAsyncResult * +g_simple_async_result_new_take_error (GObject *source_object, + GAsyncReadyCallback callback, + gpointer user_data, + GError *error) +{ + GSimpleAsyncResult *simple; + + g_return_val_if_fail (!source_object || G_IS_OBJECT (source_object), NULL); + + simple = g_simple_async_result_new (source_object, + callback, + user_data, NULL); + g_simple_async_result_take_error (simple, error); + + return simple; +} + +/** * g_simple_async_result_new_error: - * @source_object: a #GObject, or %NULL. + * @source_object: (allow-none): a #GObject, or %NULL. * @callback: a #GAsyncReadyCallback. * @user_data: user data passed to @callback. * @domain: a #GQuark. @@ -338,7 +471,7 @@ g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple, } /** - * g_simple_async_result_get_source_tag: + * g_simple_async_result_get_source_tag: (skip) * @simple: a #GSimpleAsyncResult. * * Gets the source tag for the #GSimpleAsyncResult. @@ -399,7 +532,7 @@ g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple, } /** - * g_simple_async_result_get_op_res_gpointer: + * g_simple_async_result_get_op_res_gpointer: (skip) * @simple: a #GSimpleAsyncResult. * * Gets a pointer result as returned by the asynchronous function. @@ -498,6 +631,29 @@ g_simple_async_result_set_from_error (GSimpleAsyncResult *simple, } /** + * g_simple_async_result_take_error: + * @simple: a #GSimpleAsyncResult + * @error: a #GError + * + * Sets the result from @error, and takes over the caller's ownership + * of @error, so the caller does not need to free it any more. + * + * Since: 2.28 + **/ +void +g_simple_async_result_take_error (GSimpleAsyncResult *simple, + GError *error) +{ + g_return_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple)); + g_return_if_fail (error != NULL); + + if (simple->error) + g_error_free (simple->error); + simple->error = error; + simple->failed = TRUE; +} + +/** * g_simple_async_result_set_error_va: * @simple: a #GSimpleAsyncResult. * @domain: a #GQuark (usually #G_IO_ERROR). @@ -561,6 +717,9 @@ g_simple_async_result_set_error (GSimpleAsyncResult *simple, * the thread where the asynchronous result was to be delivered, as it * invokes the callback directly. If you are in a different thread use * g_simple_async_result_complete_in_idle(). + * + * Calling this function takes a reference to @simple for as long as + * is needed to complete the call. **/ void g_simple_async_result_complete (GSimpleAsyncResult *simple) @@ -736,12 +895,16 @@ g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple, * First, @result is checked to ensure that it is really a * #GSimpleAsyncResult. Second, @source is checked to ensure that it * matches the source object of @result. Third, @source_tag is - * checked to ensure that it is equal to the source_tag argument given - * to g_simple_async_result_new() (which, by convention, is a pointer - * to the _async function corresponding to the _finish function from - * which this function is called). + * checked to ensure that it is either %NULL (as it is when the result was + * created by g_simple_async_report_error_in_idle() or + * g_simple_async_report_gerror_in_idle()) or equal to the + * @source_tag argument given to g_simple_async_result_new() (which, by + * convention, is a pointer to the _async function corresponding to the + * _finish function from which this function is called). * * Returns: #TRUE if all checks passed or #FALSE if any failed. + * + * Since: 2.20 **/ gboolean g_simple_async_result_is_valid (GAsyncResult *result, @@ -758,17 +921,20 @@ g_simple_async_result_is_valid (GAsyncResult *result, cmp_source = g_async_result_get_source_object (result); if (cmp_source != source) { - g_object_unref (cmp_source); + if (cmp_source != NULL) + g_object_unref (cmp_source); return FALSE; } - g_object_unref (cmp_source); + if (cmp_source != NULL) + g_object_unref (cmp_source); - return source_tag == g_simple_async_result_get_source_tag (simple); + return source_tag == NULL || + source_tag == g_simple_async_result_get_source_tag (simple); } /** * g_simple_async_report_error_in_idle: - * @object: a #GObject. + * @object: (allow-none): a #GObject, or %NULL. * @callback: a #GAsyncReadyCallback. * @user_data: user data passed to @callback. * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR). @@ -792,7 +958,7 @@ g_simple_async_report_error_in_idle (GObject *object, GSimpleAsyncResult *simple; va_list args; - g_return_if_fail (G_IS_OBJECT (object)); + g_return_if_fail (!object || G_IS_OBJECT (object)); g_return_if_fail (domain != 0); g_return_if_fail (format != NULL); @@ -809,7 +975,7 @@ g_simple_async_report_error_in_idle (GObject *object, /** * g_simple_async_report_gerror_in_idle: - * @object: a #GObject. + * @object: (allow-none): a #GObject, or %NULL * @callback: a #GAsyncReadyCallback. * @user_data: user data passed to @callback. * @error: the #GError to report @@ -822,11 +988,11 @@ void g_simple_async_report_gerror_in_idle (GObject *object, GAsyncReadyCallback callback, gpointer user_data, - GError *error) + const GError *error) { GSimpleAsyncResult *simple; - g_return_if_fail (G_IS_OBJECT (object)); + g_return_if_fail (!object || G_IS_OBJECT (object)); g_return_if_fail (error != NULL); simple = g_simple_async_result_new_from_error (object, @@ -837,5 +1003,34 @@ g_simple_async_report_gerror_in_idle (GObject *object, g_object_unref (simple); } -#define __G_SIMPLE_ASYNC_RESULT_C__ -#include "gioaliasdef.c" +/** + * g_simple_async_report_take_gerror_in_idle: + * @object: (allow-none): a #GObject, or %NULL + * @callback: a #GAsyncReadyCallback. + * @user_data: user data passed to @callback. + * @error: the #GError to report + * + * Reports an error in an idle function. Similar to + * g_simple_async_report_gerror_in_idle(), but takes over the caller's + * ownership of @error, so the caller does not have to free it any more. + * + * Since: 2.28 + **/ +void +g_simple_async_report_take_gerror_in_idle (GObject *object, + GAsyncReadyCallback callback, + gpointer user_data, + GError *error) +{ + GSimpleAsyncResult *simple; + + g_return_if_fail (!object || G_IS_OBJECT (object)); + g_return_if_fail (error != NULL); + + simple = g_simple_async_result_new_take_error (object, + callback, + user_data, + error); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); +} diff --git a/gio/gsimpleasyncresult.h b/gio/gsimpleasyncresult.h index 073796c..6d99c7a 100644 --- a/gio/gsimpleasyncresult.h +++ b/gio/gsimpleasyncresult.h @@ -62,6 +62,10 @@ GSimpleAsyncResult *g_simple_async_result_new_error (GObject GSimpleAsyncResult *g_simple_async_result_new_from_error (GObject *source_object, GAsyncReadyCallback callback, gpointer user_data, + const GError *error); +GSimpleAsyncResult *g_simple_async_result_new_take_error (GObject *source_object, + GAsyncReadyCallback callback, + gpointer user_data, GError *error); void g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple, @@ -90,6 +94,8 @@ void g_simple_async_result_run_in_thread (GSimpleAsyncResult GCancellable *cancellable); void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple, const GError *error); +void g_simple_async_result_take_error (GSimpleAsyncResult *simple, + GError *error); gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple, GError **dest); void g_simple_async_result_set_error (GSimpleAsyncResult *simple, @@ -116,7 +122,11 @@ void g_simple_async_report_error_in_idle (GObject *object, void g_simple_async_report_gerror_in_idle (GObject *object, GAsyncReadyCallback callback, gpointer user_data, - GError *error); + const GError *error); +void g_simple_async_report_take_gerror_in_idle (GObject *object, + GAsyncReadyCallback callback, + gpointer user_data, + GError *error); G_END_DECLS diff --git a/gio/gsimplepermission.c b/gio/gsimplepermission.c new file mode 100644 index 0000000..c932c2c --- /dev/null +++ b/gio/gsimplepermission.c @@ -0,0 +1,84 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "config.h" + +#include "gsimplepermission.h" +#include "gpermission.h" + + +/** + * SECTION:gsimplepermission + * @title: GSimplePermission + * @short_description: A GPermission that doesn't change value + * + * #GSimplePermission is a trivial implementation of #GPermission that + * represents a permission that is either always or never allowed. The + * value is given at constuction and doesn't change. + * + * Calling request or release will result in errors. + **/ + +/** + * GSimplePermission: + * + * #GSimplePermission is an opaque data structure. There are no methods + * except for those defined by #GPermission. + **/ + +typedef GPermissionClass GSimplePermissionClass; + +struct _GSimplePermission +{ + GPermission parent_instance; +}; + +G_DEFINE_TYPE (GSimplePermission, g_simple_permission, G_TYPE_PERMISSION) + +static void +g_simple_permission_init (GSimplePermission *simple) +{ +} + +static void +g_simple_permission_class_init (GSimplePermissionClass *class) +{ +} + +/** + * g_simple_permission_new: + * @allowed: %TRUE if the action is allowed + * @returns: the #GSimplePermission, as a #GPermission + * + * Creates a new #GPermission instance that represents an action that is + * either always or never allowed. + * + * Since: 2.26 + **/ +GPermission * +g_simple_permission_new (gboolean allowed) +{ + GPermission *permission = g_object_new (G_TYPE_SIMPLE_PERMISSION, NULL); + + g_permission_impl_update (permission, allowed, FALSE, FALSE); + + return permission; +} diff --git a/gio/gsimplepermission.h b/gio/gsimplepermission.h new file mode 100644 index 0000000..367fe89 --- /dev/null +++ b/gio/gsimplepermission.h @@ -0,0 +1,45 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_SIMPLE_PERMISSION_H__ +#define __G_SIMPLE_PERMISSION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SIMPLE_PERMISSION (g_simple_permission_get_type ()) +#define G_SIMPLE_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_SIMPLE_PERMISSION, \ + GSimplePermission)) +#define G_IS_SIMPLE_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_SIMPLE_PERMISSION)) + +GType g_simple_permission_get_type (void); +GPermission * g_simple_permission_new (gboolean allowed); + +G_END_DECLS + +#endif /* __G_SIMPLE_PERMISSION_H__ */ diff --git a/gio/gsocket.c b/gio/gsocket.c index 91983e4..ae45802 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -26,7 +26,8 @@ */ #include "config.h" -#include "glib.h" + +#include "gsocket.h" #include #include @@ -42,19 +43,20 @@ #include #endif -#include "gsocket.h" #include "gcancellable.h" #include "gioenumtypes.h" +#include "ginetaddress.h" #include "ginitable.h" -#include "gasynchelper.h" #include "gioerror.h" #include "gioenums.h" #include "gioerror.h" +#include "gio-marshal.h" #include "gnetworkingprivate.h" +#include "gsocketaddress.h" +#include "gsocketcontrolmessage.h" +#include "gcredentials.h" #include "glibintl.h" -#include "gioalias.h" - /** * SECTION:gsocket * @short_description: Low-level socket object @@ -131,7 +133,8 @@ enum PROP_LISTEN_BACKLOG, PROP_KEEPALIVE, PROP_LOCAL_ADDRESS, - PROP_REMOTE_ADDRESS + PROP_REMOTE_ADDRESS, + PROP_TIMEOUT }; struct _GSocketPrivate @@ -141,13 +144,17 @@ struct _GSocketPrivate GSocketProtocol protocol; gint fd; gint listen_backlog; + guint timeout; GError *construct_error; + GSocketAddress *remote_address; guint inited : 1; guint blocking : 1; guint keepalive : 1; guint closed : 1; guint connected : 1; guint listening : 1; + guint timed_out : 1; + guint connect_pending : 1; #ifdef G_OS_WIN32 WSAEVENT event; int current_events; @@ -207,20 +214,13 @@ socket_strerror (int err) #ifndef G_OS_WIN32 return g_strerror (err); #else - static GStaticPrivate msg_private = G_STATIC_PRIVATE_INIT; - char *buf, *msg; - - buf = g_static_private_get (&msg_private); - if (!buf) - { - buf = g_new (gchar, 128); - g_static_private_set (&msg_private, buf, g_free); - } + static GStaticPrivate last_msg = G_STATIC_PRIVATE_INIT; + char *msg; msg = g_win32_error_message (err); - strncpy (buf, msg, 128); - g_free (msg); - return buf; + g_static_private_set (&last_msg, msg, g_free); + + return msg; #endif } @@ -292,6 +292,15 @@ check_socket (GSocket *socket, _("Socket is already closed")); return FALSE; } + + if (socket->priv->timed_out) + { + socket->priv->timed_out = FALSE; + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT, + _("Socket I/O timed out")); + return FALSE; + } + return TRUE; } @@ -369,13 +378,34 @@ g_socket_details_from_fd (GSocket *socket) { case G_SOCKET_FAMILY_IPV4: case G_SOCKET_FAMILY_IPV6: + socket->priv->family = address.ss_family; + switch (socket->priv->type) + { + case G_SOCKET_TYPE_STREAM: + socket->priv->protocol = G_SOCKET_PROTOCOL_TCP; + break; + + case G_SOCKET_TYPE_DATAGRAM: + socket->priv->protocol = G_SOCKET_PROTOCOL_UDP; + break; + + case G_SOCKET_TYPE_SEQPACKET: + socket->priv->protocol = G_SOCKET_PROTOCOL_SCTP; + break; + + default: + break; + } + break; + case G_SOCKET_FAMILY_UNIX: - socket->priv->family = address.ss_family; - break; + socket->priv->family = G_SOCKET_FAMILY_UNIX; + socket->priv->protocol = G_SOCKET_PROTOCOL_DEFAULT; + break; default: - socket->priv->family = G_SOCKET_FAMILY_INVALID; - break; + socket->priv->family = G_SOCKET_FAMILY_INVALID; + break; } if (socket->priv->family != G_SOCKET_FAMILY_INVALID) @@ -449,9 +479,11 @@ g_socket_create_socket (GSocketFamily family, } #ifdef SOCK_CLOEXEC - native_type |= SOCK_CLOEXEC; + fd = socket (family, native_type | SOCK_CLOEXEC, protocol); + /* It's possible that libc has SOCK_CLOEXEC but the kernel does not */ + if (fd < 0 && errno == EINVAL) #endif - fd = socket (family, native_type, protocol); + fd = socket (family, native_type, protocol); if (fd < 0) { @@ -554,6 +586,10 @@ g_socket_get_property (GObject *object, g_value_take_object (value, address); break; + case PROP_TIMEOUT: + g_value_set_uint (value, socket->priv->timeout); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -597,6 +633,10 @@ g_socket_set_property (GObject *object, g_socket_set_keepalive (socket, g_value_get_boolean (value)); break; + case PROP_TIMEOUT: + g_socket_set_timeout (socket, g_value_get_uint (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -613,6 +653,9 @@ g_socket_finalize (GObject *object) !socket->priv->closed) g_socket_close (socket, NULL); + if (socket->priv->remote_address) + g_object_unref (socket->priv->remote_address); + #ifdef G_OS_WIN32 if (socket->priv->event != WSA_INVALID_EVENT) { @@ -733,6 +776,23 @@ g_socket_class_init (GSocketClass *klass) G_TYPE_SOCKET_ADDRESS, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GSocket:timeout: + * + * The timeout in seconds on socket I/O + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", + P_("Timeout"), + P_("The timeout in seconds on socket I/O"), + 0, + G_MAXUINT, + 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); } static void @@ -1020,6 +1080,66 @@ g_socket_set_listen_backlog (GSocket *socket, } /** + * g_socket_get_timeout: + * @socket: a #GSocket. + * + * Gets the timeout setting of the socket. For details on this, see + * g_socket_set_timeout(). + * + * Returns: the timeout in seconds + * + * Since: 2.26 + */ +guint +g_socket_get_timeout (GSocket *socket) +{ + g_return_val_if_fail (G_IS_SOCKET (socket), 0); + + return socket->priv->timeout; +} + +/** + * g_socket_set_timeout: + * @socket: a #GSocket. + * @timeout: the timeout for @socket, in seconds, or 0 for none + * + * Sets the time in seconds after which I/O operations on @socket will + * time out if they have not yet completed. + * + * On a blocking socket, this means that any blocking #GSocket + * operation will time out after @timeout seconds of inactivity, + * returning %G_IO_ERROR_TIMED_OUT. + * + * On a non-blocking socket, calls to g_socket_condition_wait() will + * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources + * created with g_socket_create_source() will trigger after + * @timeout seconds of inactivity, with the requested condition + * set, at which point calling g_socket_receive(), g_socket_send(), + * g_socket_check_connect_result(), etc, will fail with + * %G_IO_ERROR_TIMED_OUT. + * + * If @timeout is 0 (the default), operations will never time out + * on their own. + * + * Note that if an I/O operation is interrupted by a signal, this may + * cause the timeout to be reset. + * + * Since: 2.26 + */ +void +g_socket_set_timeout (GSocket *socket, + guint timeout) +{ + g_return_if_fail (G_IS_SOCKET (socket)); + + if (timeout != socket->priv->timeout) + { + socket->priv->timeout = timeout; + g_object_notify (G_OBJECT (socket), "timeout"); + } +} + +/** * g_socket_get_family: * @socket: a #GSocket. * @@ -1105,7 +1225,7 @@ g_socket_get_fd (GSocket *socket) * useful if the socket has been bound to a local address, * either explicitly or implicitly when connecting. * - * Returns: a #GSocketAddress or %NULL on error. + * Returns: (transfer full): a #GSocketAddress or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -1138,7 +1258,7 @@ g_socket_get_local_address (GSocket *socket, * Try to get the remove address of a connected socket. This is only * useful for connection oriented sockets that have been connected. * - * Returns: a #GSocketAddress or %NULL on error. + * Returns: (transfer full): a #GSocketAddress or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -1152,15 +1272,28 @@ g_socket_get_remote_address (GSocket *socket, g_return_val_if_fail (G_IS_SOCKET (socket), NULL); - if (getpeername (socket->priv->fd, (struct sockaddr *) &buffer, &len) < 0) + if (socket->priv->connect_pending) { - int errsv = get_socket_errno (); - g_set_error (error, G_IO_ERROR, socket_io_error_from_errno (errsv), - _("could not get remote address: %s"), socket_strerror (errsv)); - return NULL; + if (!g_socket_check_connect_result (socket, error)) + return NULL; + else + socket->priv->connect_pending = FALSE; } - return g_socket_address_new_from_native (&buffer, len); + if (!socket->priv->remote_address) + { + if (getpeername (socket->priv->fd, (struct sockaddr *) &buffer, &len) < 0) + { + int errsv = get_socket_errno (); + g_set_error (error, G_IO_ERROR, socket_io_error_from_errno (errsv), + _("could not get remote address: %s"), socket_strerror (errsv)); + return NULL; + } + + socket->priv->remote_address = g_socket_address_new_from_native (&buffer, len); + } + + return g_object_ref (socket->priv->remote_address); } /** @@ -1360,7 +1493,7 @@ g_socket_speaks_ipv4 (GSocket *socket) * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled. * To be notified of an incoming connection, wait for the %G_IO_IN condition. * - * Returns: a new #GSocket, or %NULL on error. + * Returns: (transfer full): a new #GSocket, or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -1498,6 +1631,10 @@ g_socket_connect (GSocket *socket, if (!g_socket_address_to_native (address, &buffer, sizeof buffer, error)) return FALSE; + if (socket->priv->remote_address) + g_object_unref (socket->priv->remote_address); + socket->priv->remote_address = g_object_ref (address); + while (1) { if (connect (socket->priv->fd, (struct sockaddr *) &buffer, @@ -1524,8 +1661,11 @@ g_socket_connect (GSocket *socket, g_prefix_error (error, _("Error connecting: ")); } else - g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING, - _("Connection in progress")); + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING, + _("Connection in progress")); + socket->priv->connect_pending = TRUE; + } } else g_set_error (error, G_IO_ERROR, @@ -1564,6 +1704,9 @@ g_socket_check_connect_result (GSocket *socket, guint optlen; int value; + if (!check_socket (socket, error)) + return FALSE; + optlen = sizeof (value); if (getsockopt (socket->priv->fd, SOL_SOCKET, SO_ERROR, (void *)&value, &optlen) != 0) { @@ -1578,6 +1721,11 @@ g_socket_check_connect_result (GSocket *socket, { g_set_error_literal (error, G_IO_ERROR, socket_io_error_from_errno (value), socket_strerror (value)); + if (socket->priv->remote_address) + { + g_object_unref (socket->priv->remote_address); + socket->priv->remote_address = NULL; + } return FALSE; } return TRUE; @@ -1626,6 +1774,37 @@ g_socket_receive (GSocket *socket, GCancellable *cancellable, GError **error) { + return g_socket_receive_with_blocking (socket, buffer, size, + socket->priv->blocking, + cancellable, error); +} + +/** + * g_socket_receive_with_blocking: + * @socket: a #GSocket + * @buffer: a buffer to read data into (which should be at least @size + * bytes long). + * @size: the number of bytes you want to read from the socket + * @blocking: whether to do blocking or non-blocking I/O + * @cancellable: a %GCancellable or %NULL + * @error: #GError for error reporting, or %NULL to ignore. + * + * This behaves exactly the same as g_socket_receive(), except that + * the choice of blocking or non-blocking behavior is determined by + * the @blocking argument rather than by @socket's properties. + * + * Returns: Number of bytes read, or -1 on error + * + * Since: 2.26 + */ +gssize +g_socket_receive_with_blocking (GSocket *socket, + gchar *buffer, + gsize size, + gboolean blocking, + GCancellable *cancellable, + GError **error) +{ gssize ret; g_return_val_if_fail (G_IS_SOCKET (socket) && buffer != NULL, FALSE); @@ -1638,7 +1817,7 @@ g_socket_receive (GSocket *socket, while (1) { - if (socket->priv->blocking && + if (blocking && !g_socket_condition_wait (socket, G_IO_IN, cancellable, error)) return -1; @@ -1650,7 +1829,7 @@ g_socket_receive (GSocket *socket, if (errsv == EINTR) continue; - if (socket->priv->blocking) + if (blocking) { #ifdef WSAEWOULDBLOCK if (errsv == WSAEWOULDBLOCK) @@ -1766,6 +1945,37 @@ g_socket_send (GSocket *socket, GCancellable *cancellable, GError **error) { + return g_socket_send_with_blocking (socket, buffer, size, + socket->priv->blocking, + cancellable, error); +} + +/** + * g_socket_send_with_blocking: + * @socket: a #GSocket + * @buffer: the buffer containing the data to send. + * @size: the number of bytes to send + * @blocking: whether to do blocking or non-blocking I/O + * @cancellable: a %GCancellable or %NULL + * @error: #GError for error reporting, or %NULL to ignore. + * + * This behaves exactly the same as g_socket_send(), except that + * the choice of blocking or non-blocking behavior is determined by + * the @blocking argument rather than by @socket's properties. + * + * Returns: Number of bytes written (which may be less than @size), or -1 + * on error + * + * Since: 2.26 + */ +gssize +g_socket_send_with_blocking (GSocket *socket, + const gchar *buffer, + gsize size, + gboolean blocking, + GCancellable *cancellable, + GError **error) +{ gssize ret; g_return_val_if_fail (G_IS_SOCKET (socket) && buffer != NULL, FALSE); @@ -1778,7 +1988,7 @@ g_socket_send (GSocket *socket, while (1) { - if (socket->priv->blocking && + if (blocking && !g_socket_condition_wait (socket, G_IO_OUT, cancellable, error)) return -1; @@ -1795,7 +2005,7 @@ g_socket_send (GSocket *socket, win32_unset_event_mask (socket, FD_WRITE); #endif - if (socket->priv->blocking) + if (blocking) { #ifdef WSAEWOULDBLOCK if (errsv == WSAEWOULDBLOCK) @@ -2010,6 +2220,11 @@ g_socket_close (GSocket *socket, socket->priv->connected = FALSE; socket->priv->closed = TRUE; + if (socket->priv->remote_address) + { + g_object_unref (socket->priv->remote_address); + socket->priv->remote_address = NULL; + } return TRUE; } @@ -2188,6 +2403,7 @@ update_condition (GSocket *socket) return condition; } +#endif typedef struct { GSource source; @@ -2196,103 +2412,135 @@ typedef struct { GIOCondition condition; GCancellable *cancellable; GPollFD cancel_pollfd; - GIOCondition result_condition; -} GWinsockSource; + gint64 timeout_time; +} GSocketSource; static gboolean -winsock_prepare (GSource *source, - gint *timeout) +socket_source_prepare (GSource *source, + gint *timeout) { - GWinsockSource *winsock_source = (GWinsockSource *)source; - GIOCondition current_condition; + GSocketSource *socket_source = (GSocketSource *)source; - current_condition = update_condition (winsock_source->socket); + if (g_cancellable_is_cancelled (socket_source->cancellable)) + return TRUE; - if (g_cancellable_is_cancelled (winsock_source->cancellable)) + if (socket_source->timeout_time) { - winsock_source->result_condition = current_condition; - return TRUE; + gint64 now; + + now = g_source_get_time (source); + /* Round up to ensure that we don't try again too early */ + *timeout = (socket_source->timeout_time - now + 999) / 1000; + if (*timeout < 0) + { + socket_source->socket->priv->timed_out = TRUE; + socket_source->pollfd.revents = socket_source->condition & (G_IO_IN | G_IO_OUT); + *timeout = 0; + return TRUE; + } } + else + *timeout = -1; - if ((winsock_source->condition & current_condition) != 0) - { - winsock_source->result_condition = current_condition; - return TRUE; - } +#ifdef G_OS_WIN32 + socket_source->pollfd.revents = update_condition (socket_source->socket); +#endif + + if ((socket_source->condition & socket_source->pollfd.revents) != 0) + return TRUE; return FALSE; } static gboolean -winsock_check (GSource *source) +socket_source_check (GSource *source) { - GWinsockSource *winsock_source = (GWinsockSource *)source; - GIOCondition current_condition; - - current_condition = update_condition (winsock_source->socket); + int timeout; - if (g_cancellable_is_cancelled (winsock_source->cancellable)) - { - winsock_source->result_condition = current_condition; - return TRUE; - } - - if ((winsock_source->condition & current_condition) != 0) - { - winsock_source->result_condition = current_condition; - return TRUE; - } - - return FALSE; + return socket_source_prepare (source, &timeout); } static gboolean -winsock_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data) +socket_source_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) { GSocketSourceFunc func = (GSocketSourceFunc)callback; - GWinsockSource *winsock_source = (GWinsockSource *)source; + GSocketSource *socket_source = (GSocketSource *)source; - return (*func) (winsock_source->socket, - winsock_source->result_condition & winsock_source->condition, + return (*func) (socket_source->socket, + socket_source->pollfd.revents & socket_source->condition, user_data); } static void -winsock_finalize (GSource *source) +socket_source_finalize (GSource *source) { - GWinsockSource *winsock_source = (GWinsockSource *)source; + GSocketSource *socket_source = (GSocketSource *)source; GSocket *socket; - socket = winsock_source->socket; + socket = socket_source->socket; + +#ifdef G_OS_WIN32 + remove_condition_watch (socket, &socket_source->condition); +#endif - remove_condition_watch (socket, &winsock_source->condition); g_object_unref (socket); - if (winsock_source->cancellable) + if (socket_source->cancellable) { - g_cancellable_release_fd (winsock_source->cancellable); - g_object_unref (winsock_source->cancellable); + g_cancellable_release_fd (socket_source->cancellable); + g_object_unref (socket_source->cancellable); } } -static GSourceFuncs winsock_funcs = +static gboolean +socket_source_closure_callback (GSocket *socket, + GIOCondition condition, + gpointer data) +{ + GClosure *closure = data; + + GValue params[2] = { { 0, }, { 0, } }; + GValue result_value = { 0, }; + gboolean result; + + g_value_init (&result_value, G_TYPE_BOOLEAN); + + g_value_init (¶ms[0], G_TYPE_SOCKET); + g_value_set_object (¶ms[0], socket); + g_value_init (¶ms[1], G_TYPE_IO_CONDITION); + g_value_set_flags (¶ms[1], condition); + + g_closure_invoke (closure, &result_value, 2, params, NULL); + + result = g_value_get_boolean (&result_value); + g_value_unset (&result_value); + g_value_unset (¶ms[0]); + g_value_unset (¶ms[1]); + + return result; +} + +static GSourceFuncs socket_source_funcs = { - winsock_prepare, - winsock_check, - winsock_dispatch, - winsock_finalize + socket_source_prepare, + socket_source_check, + socket_source_dispatch, + socket_source_finalize, + (GSourceFunc)socket_source_closure_callback, + (GSourceDummyMarshal)_gio_marshal_BOOLEAN__FLAGS, }; static GSource * -winsock_source_new (GSocket *socket, - GIOCondition condition, - GCancellable *cancellable) +socket_source_new (GSocket *socket, + GIOCondition condition, + GCancellable *cancellable) { GSource *source; - GWinsockSource *winsock_source; + GSocketSource *socket_source; +#ifdef G_OS_WIN32 ensure_event (socket); if (socket->priv->event == WSA_INVALID_EVENT) @@ -2300,30 +2548,44 @@ winsock_source_new (GSocket *socket, g_warning ("Failed to create WSAEvent"); return g_source_new (&broken_funcs, sizeof (GSource)); } +#endif condition |= G_IO_HUP | G_IO_ERR; - source = g_source_new (&winsock_funcs, sizeof (GWinsockSource)); - winsock_source = (GWinsockSource *)source; + source = g_source_new (&socket_source_funcs, sizeof (GSocketSource)); + g_source_set_name (source, "GSocket"); + socket_source = (GSocketSource *)source; - winsock_source->socket = g_object_ref (socket); - winsock_source->condition = condition; - add_condition_watch (socket, &winsock_source->condition); + socket_source->socket = g_object_ref (socket); + socket_source->condition = condition; if (g_cancellable_make_pollfd (cancellable, - &winsock_source->cancel_pollfd)) + &socket_source->cancel_pollfd)) { - winsock_source->cancellable = g_object_ref (cancellable); - g_source_add_poll (source, &winsock_source->cancel_pollfd); + socket_source->cancellable = g_object_ref (cancellable); + g_source_add_poll (source, &socket_source->cancel_pollfd); } - winsock_source->pollfd.fd = (gintptr) socket->priv->event; - winsock_source->pollfd.events = condition; - g_source_add_poll (source, &winsock_source->pollfd); +#ifdef G_OS_WIN32 + add_condition_watch (socket, &socket_source->condition); + socket_source->pollfd.fd = (gintptr) socket->priv->event; +#else + socket_source->pollfd.fd = socket->priv->fd; +#endif + + socket_source->pollfd.events = condition; + socket_source->pollfd.revents = 0; + g_source_add_poll (source, &socket_source->pollfd); + + if (socket->priv->timeout) + socket_source->timeout_time = g_get_monotonic_time () + + socket->priv->timeout * 1000000; + + else + socket_source->timeout_time = 0; return source; } -#endif /** * g_socket_create_source: @@ -2336,7 +2598,7 @@ winsock_source_new (GSocket *socket, * * The callback on the source is of the #GSocketSourceFunc type. * - * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition; + * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition; * these conditions will always be reported output if they are true. * * @cancellable if not %NULL can be used to cancel the source, which will @@ -2345,7 +2607,13 @@ winsock_source_new (GSocket *socket, * condition change). You can check for this in the callback using * g_cancellable_is_cancelled(). * - * Returns: a newly allocated %GSource, free with g_source_unref(). + * If @socket has a timeout set, and it is reached before @condition + * occurs, the source will then trigger anyway, reporting %G_IO_IN or + * %G_IO_OUT depending on @condition. However, @socket will have been + * marked as having had a timeout, and so the next #GSocket I/O method + * you call will then fail with a %G_IO_ERROR_TIMED_OUT. + * + * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref(). * * Since: 2.22 */ @@ -2354,16 +2622,9 @@ g_socket_create_source (GSocket *socket, GIOCondition condition, GCancellable *cancellable) { - GSource *source; g_return_val_if_fail (G_IS_SOCKET (socket) && (cancellable == NULL || G_IS_CANCELLABLE (cancellable)), NULL); -#ifdef G_OS_WIN32 - source = winsock_source_new (socket, condition, cancellable); -#else - source =_g_fd_source_new_with_object (G_OBJECT (socket), socket->priv->fd, - condition, cancellable); -#endif - return source; + return socket_source_new (socket, condition, cancellable); } /** @@ -2376,6 +2637,14 @@ g_socket_create_source (GSocket *socket, * against the currently-satisfied conditions on @socket. The result * is returned. * + * Note that on Windows, it is possible for an operation to return + * %G_IO_ERROR_WOULD_BLOCK even immediately after + * g_socket_condition_check() has claimed that the socket is ready for + * writing. Rather than calling g_socket_condition_check() and then + * writing to the socket if it succeeds, it is generally better to + * simply try writing to the socket right away, and try again later if + * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK. + * * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition; * these conditions will always be set in the output if they are true. * @@ -2429,8 +2698,11 @@ g_socket_condition_check (GSocket *socket, * Waits for @condition to become true on @socket. When the condition * is met, %TRUE is returned. * - * If @cancellable is cancelled before the condition is met then %FALSE - * is returned and @error, if non-%NULL, is set to %G_IO_ERROR_CANCELLED. + * If @cancellable is cancelled before the condition is met, or if the + * socket has a timeout set and it is reached before the condition is + * met, then %FALSE is returned and @error, if non-%NULL, is set to + * the appropriate value (%G_IO_ERROR_CANCELLED or + * %G_IO_ERROR_TIMED_OUT). * * Returns: %TRUE if the condition was met, %FALSE otherwise * @@ -2452,7 +2724,7 @@ g_socket_condition_wait (GSocket *socket, { GIOCondition current_condition; WSAEVENT events[2]; - DWORD res; + DWORD res, timeout; GPollFD cancel_fd; int num_events; @@ -2467,11 +2739,16 @@ g_socket_condition_wait (GSocket *socket, if (g_cancellable_make_pollfd (cancellable, &cancel_fd)) events[num_events++] = (WSAEVENT)cancel_fd.fd; + if (socket->priv->timeout) + timeout = socket->priv->timeout * 1000; + else + timeout = WSA_INFINITE; + current_condition = update_condition (socket); while ((condition & current_condition) == 0) { res = WSAWaitForMultipleEvents(num_events, events, - FALSE, WSA_INFINITE, FALSE); + FALSE, timeout, FALSE); if (res == WSA_WAIT_FAILED) { int errsv = get_socket_errno (); @@ -2482,6 +2759,12 @@ g_socket_condition_wait (GSocket *socket, socket_strerror (errsv)); break; } + else if (res == WSA_WAIT_TIMEOUT) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT, + _("Socket I/O timed out")); + break; + } if (g_cancellable_set_error_if_cancelled (cancellable, error)) break; @@ -2499,6 +2782,7 @@ g_socket_condition_wait (GSocket *socket, GPollFD poll_fd[2]; gint result; gint num; + gint timeout; poll_fd[0].fd = socket->priv->fd; poll_fd[0].events = condition; @@ -2507,15 +2791,26 @@ g_socket_condition_wait (GSocket *socket, if (g_cancellable_make_pollfd (cancellable, &poll_fd[1])) num++; + if (socket->priv->timeout) + timeout = socket->priv->timeout * 1000; + else + timeout = -1; + do - result = g_poll (poll_fd, num, -1); + result = g_poll (poll_fd, num, timeout); while (result == -1 && get_socket_errno () == EINTR); if (num > 1) g_cancellable_release_fd (cancellable); - return cancellable == NULL || - !g_cancellable_set_error_if_cancelled (cancellable, error); + if (result == 0) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT, + _("Socket I/O timed out")); + return FALSE; + } + + return !g_cancellable_set_error_if_cancelled (cancellable, error); } #endif } @@ -2627,6 +2922,8 @@ g_socket_send_message (GSocket *socket, struct msghdr msg; gssize result; + msg.msg_flags = 0; + /* name */ if (address) { @@ -2680,7 +2977,13 @@ g_socket_send_message (GSocket *socket, for (i = 0; i < num_messages; i++) msg.msg_controllen += CMSG_SPACE (g_socket_control_message_get_size (messages[i])); - msg.msg_control = g_alloca (msg.msg_controllen); + if (msg.msg_controllen == 0) + msg.msg_control = NULL; + else + { + msg.msg_control = g_alloca (msg.msg_controllen); + memset (msg.msg_control, '\0', msg.msg_controllen); + } cmsg = CMSG_FIRSTHDR (&msg); for (i = 0; i < num_messages; i++) @@ -2816,7 +3119,7 @@ g_socket_send_message (GSocket *socket, * @address: a pointer to a #GSocketAddress pointer, or %NULL * @vectors: an array of #GInputVector structs * @num_vectors: the number of elements in @vectors, or -1 - * @messages: a pointer which will be filled with an array of + * @messages: a pointer which may be filled with an array of * #GSocketControlMessages, or %NULL * @num_messages: a pointer which will be filled with the number of * elements in @messages, or %NULL @@ -2844,12 +3147,13 @@ g_socket_send_message (GSocket *socket, * single '\0' byte for the purposes of transferring ancillary data. * * @messages, if non-%NULL, will be set to point to a newly-allocated - * array of #GSocketControlMessage instances. These correspond to the - * control messages received from the kernel, one - * #GSocketControlMessage per message from the kernel. This array is - * %NULL-terminated and must be freed by the caller using g_free(). If - * @messages is %NULL, any control messages received will be - * discarded. + * array of #GSocketControlMessage instances or %NULL if no such + * messages was received. These correspond to the control messages + * received from the kernel, one #GSocketControlMessage per message + * from the kernel. This array is %NULL-terminated and must be freed + * by the caller using g_free() after calling g_object_unref() on each + * element. If @messages is %NULL, any control messages received will + * be discarded. * * @num_messages, if non-%NULL, will be set to the number of control * messages received. @@ -3019,8 +3323,7 @@ g_socket_receive_message (GSocket *socket, /* decode control messages */ { - GSocketControlMessage **my_messages = NULL; - gint allocated = 0, index = 0; + GPtrArray *my_messages = NULL; const gchar *scm_pointer; struct cmsghdr *cmsg; gsize scm_size; @@ -3041,35 +3344,39 @@ g_socket_receive_message (GSocket *socket, deserialization code, so just continue */ continue; - if (index == allocated) + if (messages == NULL) { - /* estimated 99% case: exactly 1 control message */ - allocated = MAX (allocated * 2, 1); - my_messages = g_new (GSocketControlMessage *, (allocated + 1)); + /* we have to do it this way if the user ignores the + * messages so that we will close any received fds. + */ + g_object_unref (message); + } + else + { + if (my_messages == NULL) + my_messages = g_ptr_array_new (); + g_ptr_array_add (my_messages, message); } - - my_messages[index++] = message; } if (num_messages) - *num_messages = index; + *num_messages = my_messages != NULL ? my_messages->len : 0; if (messages) { - my_messages[index++] = NULL; - *messages = my_messages; + if (my_messages == NULL) + { + *messages = NULL; + } + else + { + g_ptr_array_add (my_messages, NULL); + *messages = (GSocketControlMessage **) g_ptr_array_free (my_messages, FALSE); + } } else { - gint i; - - /* free all those messages we just constructed. - * we have to do it this way if the user ignores the - * messages so that we will close any received fds. - */ - for (i = 0; i < index; i++) - g_object_unref (my_messages[i]); - g_free (my_messages); + g_assert (my_messages == NULL); } } @@ -3159,10 +3466,82 @@ g_socket_receive_message (GSocket *socket, if (flags != NULL) *flags = win_flags; + if (messages != NULL) + *messages = NULL; + if (num_messages != NULL) + *num_messages = 0; + return bytes_received; } #endif } -#define __G_SOCKET_C__ -#include "gioaliasdef.c" +/** + * g_socket_get_credentials: + * @socket: a #GSocket. + * @error: #GError for error reporting, or %NULL to ignore. + * + * Returns the credentials of the foreign process connected to this + * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX + * sockets). + * + * If this operation isn't supported on the OS, the method fails with + * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented + * by reading the %SO_PEERCRED option on the underlying socket. + * + * Other ways to obtain credentials from a foreign peer includes the + * #GUnixCredentialsMessage type and + * g_unix_connection_send_credentials() / + * g_unix_connection_receive_credentials() functions. + * + * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object + * that must be freed with g_object_unref(). + * + * Since: 2.26 + */ +GCredentials * +g_socket_get_credentials (GSocket *socket, + GError **error) +{ + GCredentials *ret; + + g_return_val_if_fail (G_IS_SOCKET (socket), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = NULL; + +#ifdef __linux__ + { + struct ucred native_creds; + socklen_t optlen; + optlen = sizeof (struct ucred); + if (getsockopt (socket->priv->fd, + SOL_SOCKET, + SO_PEERCRED, + (void *)&native_creds, + &optlen) != 0) + { + int errsv = get_socket_errno (); + g_set_error (error, + G_IO_ERROR, + socket_io_error_from_errno (errsv), + _("Unable to get pending error: %s"), + socket_strerror (errsv)); + } + else + { + ret = g_credentials_new (); + g_credentials_set_native (ret, + G_CREDENTIALS_TYPE_LINUX_UCRED, + &native_creds); + } + } +#else + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("g_socket_get_credentials not implemented for this OS")); +#endif + + return ret; +} diff --git a/gio/gsocket.h b/gio/gsocket.h index c56a14c..d17de32 100644 --- a/gio/gsocket.h +++ b/gio/gsocket.h @@ -97,6 +97,9 @@ gboolean g_socket_get_keepalive (GSocket gint g_socket_get_listen_backlog (GSocket *socket); void g_socket_set_listen_backlog (GSocket *socket, gint backlog); +guint g_socket_get_timeout (GSocket *socket); +void g_socket_set_timeout (GSocket *socket, + guint timeout); gboolean g_socket_is_connected (GSocket *socket); gboolean g_socket_bind (GSocket *socket, GSocketAddress *address, @@ -170,6 +173,21 @@ GSource * g_socket_create_source (GSocket GIOCondition condition, GCancellable *cancellable); gboolean g_socket_speaks_ipv4 (GSocket *socket); +GCredentials *g_socket_get_credentials (GSocket *socket, + GError **error); + +gssize g_socket_receive_with_blocking (GSocket *socket, + gchar *buffer, + gsize size, + gboolean blocking, + GCancellable *cancellable, + GError **error); +gssize g_socket_send_with_blocking (GSocket *socket, + const gchar *buffer, + gsize size, + gboolean blocking, + GCancellable *cancellable, + GError **error); G_END_DECLS diff --git a/gio/gsocketaddress.c b/gio/gsocketaddress.c index 70c9e36..d4dcbb0 100644 --- a/gio/gsocketaddress.c +++ b/gio/gsocketaddress.c @@ -28,6 +28,8 @@ #include "ginetaddress.h" #include "ginetsocketaddress.h" #include "gnetworkingprivate.h" +#include "gproxyaddress.h" +#include "gproxyaddressenumerator.h" #include "gsocketaddressenumerator.h" #include "gsocketconnectable.h" #include "glibintl.h" @@ -37,7 +39,6 @@ #include "gunixsocketaddress.h" #endif -#include "gioalias.h" /** * SECTION:gsocketaddress @@ -63,8 +64,9 @@ enum PROP_FAMILY }; -static void g_socket_address_connectable_iface_init (GSocketConnectableIface *iface); -static GSocketAddressEnumerator *g_socket_address_connectable_enumerate (GSocketConnectable *connectable); +static void g_socket_address_connectable_iface_init (GSocketConnectableIface *iface); +static GSocketAddressEnumerator *g_socket_address_connectable_enumerate (GSocketConnectable *connectable); +static GSocketAddressEnumerator *g_socket_address_connectable_proxy_enumerate (GSocketConnectable *connectable); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GSocketAddress, g_socket_address, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_SOCKET_CONNECTABLE, @@ -126,6 +128,7 @@ static void g_socket_address_connectable_iface_init (GSocketConnectableIface *connectable_iface) { connectable_iface->enumerate = g_socket_address_connectable_enumerate; + connectable_iface->proxy_enumerate = g_socket_address_connectable_proxy_enumerate; } static void @@ -217,9 +220,13 @@ g_socket_address_new_from_native (gpointer native, if (family == AF_INET) { struct sockaddr_in *addr = (struct sockaddr_in *) native; - GInetAddress *iaddr = g_inet_address_new_from_bytes ((guint8 *) &(addr->sin_addr), AF_INET); + GInetAddress *iaddr; GSocketAddress *sockaddr; + if (len < sizeof (*addr)) + return NULL; + + iaddr = g_inet_address_new_from_bytes ((guint8 *) &(addr->sin_addr), AF_INET); sockaddr = g_inet_socket_address_new (iaddr, g_ntohs (addr->sin_port)); g_object_unref (iaddr); return sockaddr; @@ -228,9 +235,13 @@ g_socket_address_new_from_native (gpointer native, if (family == AF_INET6) { struct sockaddr_in6 *addr = (struct sockaddr_in6 *) native; - GInetAddress *iaddr = g_inet_address_new_from_bytes ((guint8 *) &(addr->sin6_addr), AF_INET6); + GInetAddress *iaddr; GSocketAddress *sockaddr; + if (len < sizeof (*addr)) + return NULL; + + iaddr = g_inet_address_new_from_bytes ((guint8 *) &(addr->sin6_addr), AF_INET6); sockaddr = g_inet_socket_address_new (iaddr, g_ntohs (addr->sin6_port)); g_object_unref (iaddr); return sockaddr; @@ -240,11 +251,30 @@ g_socket_address_new_from_native (gpointer native, if (family == AF_UNIX) { struct sockaddr_un *addr = (struct sockaddr_un *) native; - - if (addr->sun_path[0] == 0) - return g_unix_socket_address_new_abstract (addr->sun_path+1, - sizeof (addr->sun_path) - 1); - return g_unix_socket_address_new (addr->sun_path); + gint path_len = len - G_STRUCT_OFFSET (struct sockaddr_un, sun_path); + + if (path_len == 0) + { + return g_unix_socket_address_new_with_type ("", 0, + G_UNIX_SOCKET_ADDRESS_ANONYMOUS); + } + else if (addr->sun_path[0] == 0) + { + if (len < sizeof (*addr)) + { + return g_unix_socket_address_new_with_type (addr->sun_path + 1, + path_len - 1, + G_UNIX_SOCKET_ADDRESS_ABSTRACT); + } + else + { + return g_unix_socket_address_new_with_type (addr->sun_path + 1, + path_len - 1, + G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED); + } + } + else + return g_unix_socket_address_new (addr->sun_path); } #endif @@ -326,5 +356,37 @@ g_socket_address_connectable_enumerate (GSocketConnectable *connectable) return (GSocketAddressEnumerator *)sockaddr_enum; } -#define __G_SOCKET_ADDRESS_C__ -#include "gioaliasdef.c" +static GSocketAddressEnumerator * +g_socket_address_connectable_proxy_enumerate (GSocketConnectable *connectable) +{ + GSocketAddressEnumerator *addr_enum = NULL; + + if (G_IS_INET_SOCKET_ADDRESS (connectable) && + !G_IS_PROXY_ADDRESS (connectable)) + { + GInetAddress *addr; + guint port; + gchar *uri; + gchar *ip; + + g_object_get (connectable, "address", &addr, "port", &port, NULL); + + ip = g_inet_address_to_string (addr); + uri = _g_uri_from_authority ("none", ip, port, NULL); + + addr_enum = g_object_new (G_TYPE_PROXY_ADDRESS_ENUMERATOR, + "connectable", connectable, + "uri", uri, + NULL); + + g_object_unref (addr); + g_free (ip); + g_free (uri); + } + else + { + addr_enum = g_socket_address_connectable_enumerate (connectable); + } + + return addr_enum; +} diff --git a/gio/gsocketaddressenumerator.c b/gio/gsocketaddressenumerator.c index 1ae69d2..1886f36 100644 --- a/gio/gsocketaddressenumerator.c +++ b/gio/gsocketaddressenumerator.c @@ -24,7 +24,6 @@ #include "gsimpleasyncresult.h" -#include "gioalias.h" G_DEFINE_ABSTRACT_TYPE (GSocketAddressEnumerator, g_socket_address_enumerator, G_TYPE_OBJECT); @@ -68,7 +67,7 @@ g_socket_address_enumerator_class_init (GSocketAddressEnumeratorClass *enumerato * internal errors (other than @cancellable being triggered) will be * ignored. * - * Return value: a #GSocketAddress (owned by the caller), or %NULL on + * Return value: (transfer full): a #GSocketAddress (owned by the caller), or %NULL on * error (in which case *@error will be set) or if there are no * more addresses. */ @@ -107,10 +106,8 @@ g_socket_address_enumerator_real_next_async (GSocketAddressEnumerator *enumerato if (address) g_simple_async_result_set_op_res_gpointer (result, address, NULL); else if (error) - { - g_simple_async_result_set_from_error (result, error); - g_error_free (error); - } + g_simple_async_result_take_error (result, error); + g_simple_async_result_complete_in_idle (result); g_object_unref (result); } @@ -169,7 +166,7 @@ g_socket_address_enumerator_real_next_finish (GSocketAddressEnumerator *enumera * g_socket_address_enumerator_next() for more information about * error handling. * - * Return value: a #GSocketAddress (owned by the caller), or %NULL on + * Return value: (transfer full): a #GSocketAddress (owned by the caller), or %NULL on * error (in which case *@error will be set) or if there are no * more addresses. */ @@ -186,6 +183,3 @@ g_socket_address_enumerator_next_finish (GSocketAddressEnumerator *enumerator, return (* klass->next_finish) (enumerator, result, error); } - -#define __G_SOCKET_ADDRESS_ENUMERATOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c index 7908aec..f1fe01b 100644 --- a/gio/gsocketclient.c +++ b/gio/gsocketclient.c @@ -26,21 +26,28 @@ #include "gsocketclient.h" #include +#include #include #include #include #include +#include +#include #include #include #include #include #include #include +#include #include +#include +#include +#include +#include #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gsocketclient @@ -71,7 +78,11 @@ enum PROP_FAMILY, PROP_TYPE, PROP_PROTOCOL, - PROP_LOCAL_ADDRESS + PROP_LOCAL_ADDRESS, + PROP_TIMEOUT, + PROP_ENABLE_PROXY, + PROP_TLS, + PROP_TLS_VALIDATION_FLAGS }; struct _GSocketClientPrivate @@ -80,6 +91,11 @@ struct _GSocketClientPrivate GSocketType type; GSocketProtocol protocol; GSocketAddress *local_address; + guint timeout; + gboolean enable_proxy; + GHashTable *app_proxies; + gboolean tls; + GTlsCertificateFlags tls_validation_flags; }; static GSocket * @@ -116,9 +132,21 @@ create_socket (GSocketClient *client, } } + if (client->priv->timeout) + g_socket_set_timeout (socket, client->priv->timeout); + return socket; } +gboolean +can_use_proxy (GSocketClient *client) +{ + GSocketClientPrivate *priv = client->priv; + + return priv->enable_proxy + && priv->type == G_SOCKET_TYPE_STREAM; +} + static void g_socket_client_init (GSocketClient *client) { @@ -126,6 +154,10 @@ g_socket_client_init (GSocketClient *client) G_TYPE_SOCKET_CLIENT, GSocketClientPrivate); client->priv->type = G_SOCKET_TYPE_STREAM; + client->priv->app_proxies = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + NULL); } /** @@ -154,6 +186,8 @@ g_socket_client_finalize (GObject *object) if (G_OBJECT_CLASS (g_socket_client_parent_class)->finalize) (*G_OBJECT_CLASS (g_socket_client_parent_class)->finalize) (object); + + g_hash_table_unref (client->priv->app_proxies); } static void @@ -182,6 +216,22 @@ g_socket_client_get_property (GObject *object, g_value_set_object (value, client->priv->local_address); break; + case PROP_TIMEOUT: + g_value_set_uint (value, client->priv->timeout); + break; + + case PROP_ENABLE_PROXY: + g_value_set_boolean (value, client->priv->enable_proxy); + break; + + case PROP_TLS: + g_value_set_boolean (value, g_socket_client_get_tls (client)); + break; + + case PROP_TLS_VALIDATION_FLAGS: + g_value_set_flags (value, g_socket_client_get_tls_validation_flags (client)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -213,6 +263,22 @@ g_socket_client_set_property (GObject *object, g_socket_client_set_local_address (client, g_value_get_object (value)); break; + case PROP_TIMEOUT: + g_socket_client_set_timeout (client, g_value_get_uint (value)); + break; + + case PROP_ENABLE_PROXY: + g_socket_client_set_enable_proxy (client, g_value_get_boolean (value)); + break; + + case PROP_TLS: + g_socket_client_set_tls (client, g_value_get_boolean (value)); + break; + + case PROP_TLS_VALIDATION_FLAGS: + g_socket_client_set_tls_validation_flags (client, g_value_get_flags (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -357,7 +423,7 @@ g_socket_client_set_protocol (GSocketClient *client, * * See g_socket_client_set_local_address() for details. * - * Returns: a #GSocketAddres or %NULL. don't free + * Returns: (transfer none): a #GSocketAddres or %NULL. don't free * * Since: 2.22 */ @@ -387,7 +453,7 @@ g_socket_client_set_local_address (GSocketClient *client, GSocketAddress *address) { if (address) - g_object_ref (address); + g_object_ref (address); if (client->priv->local_address) { @@ -397,6 +463,175 @@ g_socket_client_set_local_address (GSocketClient *client, g_object_notify (G_OBJECT (client), "local-address"); } +/** + * g_socket_client_get_timeout: + * @client: a #GSocketClient + * + * Gets the I/O timeout time for sockets created by @client. + * + * See g_socket_client_set_timeout() for details. + * + * Returns: the timeout in seconds + * + * Since: 2.26 + */ +guint +g_socket_client_get_timeout (GSocketClient *client) +{ + return client->priv->timeout; +} + + +/** + * g_socket_client_set_timeout: + * @client: a #GSocketClient. + * @timeout: the timeout + * + * Sets the I/O timeout for sockets created by @client. @timeout is a + * time in seconds, or 0 for no timeout (the default). + * + * The timeout value affects the initial connection attempt as well, + * so setting this may cause calls to g_socket_client_connect(), etc, + * to fail with %G_IO_ERROR_TIMED_OUT. + * + * Since: 2.26 + */ +void +g_socket_client_set_timeout (GSocketClient *client, + guint timeout) +{ + if (client->priv->timeout == timeout) + return; + + client->priv->timeout = timeout; + g_object_notify (G_OBJECT (client), "timeout"); +} + +/** + * g_socket_client_get_enable_proxy: + * @client: a #GSocketClient. + * + * Gets the proxy enable state; see g_socket_client_set_enable_proxy() + * + * Returns: whether proxying is enabled + * + * Since: 2.26 + */ +gboolean +g_socket_client_get_enable_proxy (GSocketClient *client) +{ + return client->priv->enable_proxy; +} + +/** + * g_socket_client_set_enable_proxy: + * @client: a #GSocketClient. + * @enable: whether to enable proxies + * + * Sets whether or not @client attempts to make connections via a + * proxy server. When enabled (the default), #GSocketClient will use a + * #GProxyResolver to determine if a proxy protocol such as SOCKS is + * needed, and automatically do the necessary proxy negotiation. + * + * Since: 2.26 + */ +void +g_socket_client_set_enable_proxy (GSocketClient *client, + gboolean enable) +{ + enable = !!enable; + if (client->priv->enable_proxy == enable) + return; + + client->priv->enable_proxy = enable; + g_object_notify (G_OBJECT (client), "enable-proxy"); +} + +/** + * g_socket_client_get_tls: + * @client: a #GSocketClient. + * + * Gets whether @client creates TLS connections. See + * g_socket_client_set_tls() for details. + * + * Returns: whether @client uses TLS + * + * Since: 2.28 + */ +gboolean +g_socket_client_get_tls (GSocketClient *client) +{ + return client->priv->tls; +} + +/** + * g_socket_client_set_tls: + * @client: a #GSocketClient. + * @tls: whether to use TLS + * + * Sets whether @client creates TLS (aka SSL) connections. If @tls is + * %TRUE, @client will wrap its connections in a #GTlsClientConnection + * and perform a TLS handshake when connecting. + * + * Note that since #GSocketClient must return a #GSocketConnection, + * but #GTlsClientConnection is not a #GSocketConnection, this + * actually wraps the resulting #GTlsClientConnection in a + * #GTcpWrapperConnection when returning it. You can use + * g_tcp_wrapper_connection_get_base_io_stream() on the return value + * to extract the #GTlsClientConnection. + * + * Since: 2.28 + */ +void +g_socket_client_set_tls (GSocketClient *client, + gboolean tls) +{ + tls = !!tls; + if (tls == client->priv->tls) + return; + + client->priv->tls = tls; + g_object_notify (G_OBJECT (client), "tls"); +} + +/** + * g_socket_client_get_tls_validation_flags: + * @client: a #GSocketClient. + * + * Gets the TLS validation flags used creating TLS connections via + * @client. + * + * Returns: the TLS validation flags + * + * Since: 2.28 + */ +GTlsCertificateFlags +g_socket_client_get_tls_validation_flags (GSocketClient *client) +{ + return client->priv->tls_validation_flags; +} + +/** + * g_socket_client_set_tls_validation_flags: + * @client: a #GSocketClient. + * @flags: the validation flags + * + * Sets the TLS validation flags used when creating TLS connections + * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL. + * + * Since: 2.28 + */ +void +g_socket_client_set_tls_validation_flags (GSocketClient *client, + GTlsCertificateFlags flags) +{ + if (client->priv->tls_validation_flags != flags) + { + client->priv->tls_validation_flags = flags; + g_object_notify (G_OBJECT (client), "tls-validation-flags"); + } +} + static void g_socket_client_class_init (GSocketClientClass *class) { @@ -446,6 +681,42 @@ g_socket_client_class_init (GSocketClientClass *class) G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", + P_("Socket timeout"), + P_("The I/O timeout for sockets, or 0 for none"), + 0, G_MAXUINT, 0, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_ENABLE_PROXY, + g_param_spec_boolean ("enable-proxy", + P_("Enable proxy"), + P_("Enable proxy support"), + TRUE, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_TLS, + g_param_spec_boolean ("tls", + P_("TLS"), + P_("Whether to create TLS connections"), + FALSE, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_TLS_VALIDATION_FLAGS, + g_param_spec_flags ("tls-validation-flags", + P_("TLS validation flags"), + P_("TLS validation flags to use"), + G_TYPE_TLS_CERTIFICATE_FLAGS, + G_TLS_CERTIFICATE_VALIDATE_ALL, + G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); } /** @@ -474,7 +745,7 @@ g_socket_client_class_init (GSocketClientClass *class) * If a local address is specified with g_socket_client_set_local_address() the * socket will be bound to this address before connecting. * - * Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -484,15 +755,20 @@ g_socket_client_connect (GSocketClient *client, GCancellable *cancellable, GError **error) { - GSocketConnection *connection = NULL; - GSocketAddressEnumerator *enumerator; + GIOStream *connection = NULL; + GSocketAddressEnumerator *enumerator = NULL; GError *last_error, *tmp_error; last_error = NULL; - enumerator = g_socket_connectable_enumerate (connectable); + + if (can_use_proxy (client)) + enumerator = g_socket_connectable_proxy_enumerate (connectable); + else + enumerator = g_socket_connectable_enumerate (connectable); + while (connection == NULL) { - GSocketAddress *address; + GSocketAddress *address = NULL; GSocket *socket; if (g_cancellable_is_cancelled (cancellable)) @@ -504,7 +780,8 @@ g_socket_client_connect (GSocketClient *client, tmp_error = NULL; address = g_socket_address_enumerator_next (enumerator, cancellable, - &tmp_error); + &tmp_error); + if (address == NULL) { if (tmp_error) @@ -526,24 +803,106 @@ g_socket_client_connect (GSocketClient *client, g_clear_error (&last_error); socket = create_socket (client, address, &last_error); - if (socket != NULL) + if (socket == NULL) { - if (g_socket_connect (socket, address, cancellable, &last_error)) - connection = g_socket_connection_factory_create_connection (socket); + g_object_unref (address); + continue; + } - g_object_unref (socket); + if (g_socket_connect (socket, address, cancellable, &last_error)) + connection = (GIOStream *)g_socket_connection_factory_create_connection (socket); + + if (connection && + G_IS_PROXY_ADDRESS (address) && + client->priv->enable_proxy) + { + GProxyAddress *proxy_addr = G_PROXY_ADDRESS (address); + const gchar *protocol; + GProxy *proxy; + + protocol = g_proxy_address_get_protocol (proxy_addr); + proxy = g_proxy_get_default_for_protocol (protocol); + + /* The connection should not be anything else then TCP Connection, + * but let's put a safety guard in case + */ + if (!G_IS_TCP_CONNECTION (connection)) + { + g_critical ("Trying to proxy over non-TCP connection, this is " + "most likely a bug in GLib IO library."); + + g_set_error_literal (&last_error, + G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Trying to proxy over non-TCP connection is not supported.")); + + g_object_unref (connection); + connection = NULL; + } + else if (proxy) + { + GIOStream *proxy_connection; + + proxy_connection = g_proxy_connect (proxy, + connection, + proxy_addr, + cancellable, + &last_error); + g_object_unref (connection); + connection = proxy_connection; + g_object_unref (proxy); + } + else if (!g_hash_table_lookup_extended (client->priv->app_proxies, + protocol, NULL, NULL)) + { + g_set_error (&last_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Proxy protocol '%s' is not supported."), + protocol); + g_object_unref (connection); + connection = NULL; + } + } + + if (connection && client->priv->tls) + { + GIOStream *tlsconn; + + tlsconn = g_tls_client_connection_new (connection, connectable, &last_error); + g_object_unref (connection); + connection = tlsconn; + + if (tlsconn) + { + g_tls_client_connection_set_validation_flags (G_TLS_CLIENT_CONNECTION (tlsconn), + client->priv->tls_validation_flags); + if (!g_tls_connection_handshake (G_TLS_CONNECTION (tlsconn), + cancellable, &last_error)) + { + g_object_unref (tlsconn); + connection = NULL; + } + } } + if (connection && !G_IS_SOCKET_CONNECTION (connection)) + { + GSocketConnection *wrapper_connection; + + wrapper_connection = g_tcp_wrapper_connection_new (connection, socket); + g_object_unref (connection); + connection = (GIOStream *)wrapper_connection; + } + + g_object_unref (socket); g_object_unref (address); } g_object_unref (enumerator); - return connection; + return G_SOCKET_CONNECTION (connection); } /** * g_socket_client_connect_to_host: - * @client: a #SocketClient + * @client: a #GSocketClient * @host_and_port: the name and optionally port of the host to connect to * @default_port: the default port to connect to * @cancellable: a #GCancellable, or %NULL @@ -553,7 +912,7 @@ g_socket_client_connect (GSocketClient *client, * * Attempts to create a TCP connection to the named host. * - * @host_and_port may be in any of a number of recognised formats: an IPv6 + * @host_and_port may be in any of a number of recognised formats; an IPv6 * address, an IPv4 address, or a domain name (in which case a DNS * lookup is performed). Quoting with [] is supported for all address * types. A port override may be specified in the usual way with a @@ -580,7 +939,7 @@ g_socket_client_connect (GSocketClient *client, * connectable) %NULL is returned and @error (if non-%NULL) is set * accordingly. * - Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -612,7 +971,7 @@ g_socket_client_connect_to_host (GSocketClient *client, * @service: the name of the service to connect to * @cancellable: a #GCancellable, or %NULL * @error: a pointer to a #GError, or %NULL - * @returns: a #GSocketConnection if successful, or %NULL on error + * @returns: (transfer full): a #GSocketConnection if successful, or %NULL on error * * Attempts to create a TCP connection to a service. * @@ -647,14 +1006,72 @@ g_socket_client_connect_to_service (GSocketClient *client, return connection; } +/** + * g_socket_client_connect_to_uri: + * @client: a #GSocketClient + * @uri: A network URI + * @default_port: the default port to connect to + * @cancellable: a #GCancellable, or %NULL + * @error: a pointer to a #GError, or %NULL + * + * This is a helper function for g_socket_client_connect(). + * + * Attempts to create a TCP connection with a network URI. + * + * @uri may be any valid URI containing an "authority" (hostname/port) + * component. If a port is not specified in the URI, @default_port + * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE. + * (#GSocketClient does not know to automatically assume TLS for + * certain URI schemes.) + * + * Using this rather than g_socket_client_connect() or + * g_socket_client_connect_to_host() allows #GSocketClient to + * determine when to use application-specific proxy protocols. + * + * Upon a successful connection, a new #GSocketConnection is constructed + * and returned. The caller owns this new object and must drop their + * reference to it when finished with it. + * + * In the event of any failure (DNS error, service not found, no hosts + * connectable) %NULL is returned and @error (if non-%NULL) is set + * accordingly. + * + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. + * + * Since: 2.26 + */ +GSocketConnection * +g_socket_client_connect_to_uri (GSocketClient *client, + const gchar *uri, + guint16 default_port, + GCancellable *cancellable, + GError **error) +{ + GSocketConnectable *connectable; + GSocketConnection *connection; + + connectable = g_network_address_parse_uri (uri, default_port, error); + if (connectable == NULL) + return NULL; + + connection = g_socket_client_connect (client, connectable, + cancellable, error); + g_object_unref (connectable); + + return connection; +} + typedef struct { GSimpleAsyncResult *result; GCancellable *cancellable; GSocketClient *client; + GSocketConnectable *connectable; GSocketAddressEnumerator *enumerator; + GProxyAddress *proxy_addr; GSocket *current_socket; + GIOStream *connection; GError *last_error; } GSocketClientAsyncConnectData; @@ -662,29 +1079,39 @@ typedef struct static void g_socket_client_async_connect_complete (GSocketClientAsyncConnectData *data) { - GSocketConnection *connection; - if (data->last_error) { - g_simple_async_result_set_from_error (data->result, data->last_error); - g_error_free (data->last_error); + g_simple_async_result_take_error (data->result, data->last_error); } else { - g_assert (data->current_socket); + g_assert (data->connection); - g_socket_set_blocking (data->current_socket, TRUE); + if (!G_IS_SOCKET_CONNECTION (data->connection)) + { + GSocketConnection *wrapper_connection; + + wrapper_connection = g_tcp_wrapper_connection_new (data->connection, + data->current_socket); + g_object_unref (data->connection); + data->connection = (GIOStream *)wrapper_connection; + } - connection = g_socket_connection_factory_create_connection (data->current_socket); - g_object_unref (data->current_socket); g_simple_async_result_set_op_res_gpointer (data->result, - connection, + data->connection, g_object_unref); } g_simple_async_result_complete (data->result); g_object_unref (data->result); + g_object_unref (data->connectable); g_object_unref (data->enumerator); + if (data->cancellable) + g_object_unref (data->cancellable); + if (data->current_socket) + g_object_unref (data->current_socket); + if (data->proxy_addr) + g_object_unref (data->proxy_addr); g_slice_free (GSocketClientAsyncConnectData, data); } @@ -702,6 +1129,176 @@ set_last_error (GSocketClientAsyncConnectData *data, data->last_error = error; } +static void +enumerator_next_async (GSocketClientAsyncConnectData *data) +{ + g_socket_address_enumerator_next_async (data->enumerator, + data->cancellable, + g_socket_client_enumerator_callback, + data); +} + +static void +g_socket_client_tls_handshake_callback (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GSocketClientAsyncConnectData *data = user_data; + + if (g_tls_connection_handshake_finish (G_TLS_CONNECTION (object), + result, + &data->last_error)) + { + g_object_unref (data->connection); + data->connection = G_IO_STREAM (object); + } + else + { + g_object_unref (object); + g_object_unref (data->current_socket); + data->current_socket = NULL; + g_object_unref (data->connection); + data->connection = NULL; + + enumerator_next_async (data); + } + + g_socket_client_async_connect_complete (data); +} + +static void +g_socket_client_tls_handshake (GSocketClientAsyncConnectData *data) +{ + GIOStream *tlsconn; + + if (!data->client->priv->tls) + { + g_socket_client_async_connect_complete (data); + return; + } + + tlsconn = g_tls_client_connection_new (data->connection, + data->connectable, + &data->last_error); + if (tlsconn) + { + g_tls_client_connection_set_validation_flags (G_TLS_CLIENT_CONNECTION (tlsconn), + data->client->priv->tls_validation_flags); + g_tls_connection_handshake_async (G_TLS_CONNECTION (tlsconn), + G_PRIORITY_DEFAULT, + data->cancellable, + g_socket_client_tls_handshake_callback, + data); + } + else + { + g_object_unref (data->current_socket); + data->current_socket = NULL; + g_object_unref (data->connection); + data->connection = NULL; + + enumerator_next_async (data); + } +} + +static void +g_socket_client_proxy_connect_callback (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GSocketClientAsyncConnectData *data = user_data; + + g_object_unref (data->connection); + data->connection = g_proxy_connect_finish (G_PROXY (object), + result, + &data->last_error); + if (!data->connection) + { + g_object_unref (data->current_socket); + data->current_socket = NULL; + + enumerator_next_async (data); + return; + } + + g_socket_client_tls_handshake (data); +} + +static void +g_socket_client_proxy_connect (GSocketClientAsyncConnectData *data) +{ + GProxy *proxy; + const gchar *protocol; + + if (!data->proxy_addr) + { + g_socket_client_tls_handshake (data); + return; + } + + protocol = g_proxy_address_get_protocol (data->proxy_addr); + proxy = g_proxy_get_default_for_protocol (protocol); + + /* The connection should not be anything else then TCP Connection, + * but let's put a safety guard in case + */ + if (!G_IS_TCP_CONNECTION (data->connection)) + { + g_critical ("Trying to proxy over non-TCP connection, this is " + "most likely a bug in GLib IO library."); + + g_set_error_literal (&data->last_error, + G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Trying to proxy over non-TCP connection is not supported.")); + + g_object_unref (data->connection); + data->connection = NULL; + g_object_unref (data->current_socket); + data->current_socket = NULL; + + enumerator_next_async (data); + } + else if (proxy) + { + g_proxy_connect_async (proxy, + data->connection, + data->proxy_addr, + data->cancellable, + g_socket_client_proxy_connect_callback, + data); + g_object_unref (proxy); + } + else if (!g_hash_table_lookup_extended (data->client->priv->app_proxies, + protocol, NULL, NULL)) + { + g_clear_error (&data->last_error); + + g_set_error (&data->last_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Proxy protocol '%s' is not supported."), + protocol); + + g_object_unref (data->current_socket); + data->current_socket = NULL; + g_object_unref (data->connection); + data->connection = NULL; + g_object_unref (data->current_socket); + data->current_socket = NULL; + + enumerator_next_async (data); + } +} + +static void +g_socket_client_socket_connected (GSocketClientAsyncConnectData *data) +{ + g_socket_set_blocking (data->current_socket, TRUE); + + data->connection = (GIOStream *) + g_socket_connection_factory_create_connection (data->current_socket); + + g_socket_client_proxy_connect (data); +} + static gboolean g_socket_client_socket_callback (GSocket *socket, GIOCondition condition, @@ -717,6 +1314,9 @@ g_socket_client_socket_callback (GSocket *socket, data->current_socket = NULL; g_cancellable_set_error_if_cancelled (data->cancellable, &data->last_error); + + g_socket_client_async_connect_complete (data); + return FALSE; } else { @@ -724,19 +1324,17 @@ g_socket_client_socket_callback (GSocket *socket, if (!g_socket_check_connect_result (data->current_socket, &error)) { set_last_error (data, error); + g_object_unref (data->current_socket); + data->current_socket = NULL; /* try next one */ - g_socket_address_enumerator_next_async (data->enumerator, - data->cancellable, - g_socket_client_enumerator_callback, - data); + enumerator_next_async (data); return FALSE; } } - g_socket_client_async_connect_complete (data); - + g_socket_client_socket_connected (data); return FALSE; } @@ -746,7 +1344,7 @@ g_socket_client_enumerator_callback (GObject *object, gpointer user_data) { GSocketClientAsyncConnectData *data = user_data; - GSocketAddress *address; + GSocketAddress *address = NULL; GSocket *socket; GError *tmp_error = NULL; @@ -773,6 +1371,10 @@ g_socket_client_enumerator_callback (GObject *object, return; } + if (G_IS_PROXY_ADDRESS (address) && + data->client->priv->enable_proxy) + data->proxy_addr = g_object_ref (G_PROXY_ADDRESS (address)); + g_clear_error (&data->last_error); socket = create_socket (data->client, address, &data->last_error); @@ -782,7 +1384,7 @@ g_socket_client_enumerator_callback (GObject *object, if (g_socket_connect (socket, address, data->cancellable, &tmp_error)) { data->current_socket = socket; - g_socket_client_async_connect_complete (data); + g_socket_client_socket_connected (data); g_object_unref (address); return; @@ -810,13 +1412,10 @@ g_socket_client_enumerator_callback (GObject *object, data->last_error = tmp_error; g_object_unref (socket); } - g_object_unref (address); } - g_socket_address_enumerator_next_async (data->enumerator, - data->cancellable, - g_socket_client_enumerator_callback, - data); + g_object_unref (address); + enumerator_next_async (data); } /** @@ -846,7 +1445,7 @@ g_socket_client_connect_async (GSocketClient *client, g_return_if_fail (G_IS_SOCKET_CLIENT (client)); - data = g_slice_new (GSocketClientAsyncConnectData); + data = g_slice_new0 (GSocketClientAsyncConnectData); data->result = g_simple_async_result_new (G_OBJECT (client), callback, user_data, @@ -857,11 +1456,14 @@ g_socket_client_connect_async (GSocketClient *client, else data->cancellable = NULL; data->last_error = NULL; - data->enumerator = g_socket_connectable_enumerate (connectable); + data->connectable = g_object_ref (connectable); - g_socket_address_enumerator_next_async (data->enumerator, cancellable, - g_socket_client_enumerator_callback, - data); + if (can_use_proxy (client)) + data->enumerator = g_socket_connectable_proxy_enumerate (connectable); + else + data->enumerator = g_socket_connectable_enumerate (connectable); + + enumerator_next_async (data); } /** @@ -897,9 +1499,8 @@ g_socket_client_connect_to_host_async (GSocketClient *client, &error); if (connectable == NULL) { - g_simple_async_report_gerror_in_idle (G_OBJECT (client), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (client), callback, user_data, error); - g_error_free (error); } else { @@ -942,6 +1543,51 @@ g_socket_client_connect_to_service_async (GSocketClient *client, } /** + * g_socket_client_connect_to_uri_async: + * @client: a #GSocketClient + * @uri: a network uri + * @default_port: the default port to connect to + * @cancellable: a #GCancellable, or %NULL + * @callback: a #GAsyncReadyCallback + * @user_data: user data for the callback + * + * This is the asynchronous version of g_socket_client_connect_to_uri(). + * + * When the operation is finished @callback will be + * called. You can then call g_socket_client_connect_to_uri_finish() to get + * the result of the operation. + * + * Since: 2.26 + */ +void +g_socket_client_connect_to_uri_async (GSocketClient *client, + const gchar *uri, + guint16 default_port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSocketConnectable *connectable; + GError *error; + + error = NULL; + connectable = g_network_address_parse_uri (uri, default_port, &error); + if (connectable == NULL) + { + g_simple_async_report_take_gerror_in_idle (G_OBJECT (client), + callback, user_data, error); + } + else + { + g_socket_client_connect_async (client, + connectable, cancellable, + callback, user_data); + g_object_unref (connectable); + } +} + + +/** * g_socket_client_connect_finish: * @client: a #GSocketClient. * @result: a #GAsyncResult. @@ -950,7 +1596,7 @@ g_socket_client_connect_to_service_async (GSocketClient *client, * * Finishes an async connect operation. See g_socket_client_connect_async() * - * Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -976,7 +1622,7 @@ g_socket_client_connect_finish (GSocketClient *client, * * Finishes an async connect operation. See g_socket_client_connect_to_host_async() * - * Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -997,7 +1643,7 @@ g_socket_client_connect_to_host_finish (GSocketClient *client, * * Finishes an async connect operation. See g_socket_client_connect_to_service_async() * - * Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -1009,5 +1655,51 @@ g_socket_client_connect_to_service_finish (GSocketClient *client, return g_socket_client_connect_finish (client, result, error); } -#define __G_SOCKET_CLIENT_C__ -#include "gioaliasdef.c" +/** + * g_socket_client_connect_to_uri_finish: + * @client: a #GSocketClient. + * @result: a #GAsyncResult. + * @error: a #GError location to store the error occuring, or %NULL to + * ignore. + * + * Finishes an async connect operation. See g_socket_client_connect_to_uri_async() + * + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. + * + * Since: 2.26 + */ +GSocketConnection * +g_socket_client_connect_to_uri_finish (GSocketClient *client, + GAsyncResult *result, + GError **error) +{ + return g_socket_client_connect_finish (client, result, error); +} + +/** + * g_socket_client_add_application_proxy: + * @client: a #GSocketClient + * @protocol: The proxy protocol + * + * Enable proxy protocols to be handled by the application. When the + * indicated proxy protocol is returned by the #GProxyResolver, + * #GSocketClient will consider this protocol as supported but will + * not try find a #GProxy instance to handle handshaking. The + * application must check for this case by calling + * g_socket_connection_get_remote_address() on the returned + * #GSocketConnection, and seeing if it's a #GProxyAddress of the + * appropriate type, to determine whether or not it needs to handle + * the proxy handshaking itself. + * + * This should be used for proxy protocols that are dialects of + * another protocol such as HTTP proxy. It also allows cohabitation of + * proxy protocols that are reused between protocols. A good example + * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also + * be use as generic socket proxy through the HTTP CONNECT method. + */ +void +g_socket_client_add_application_proxy (GSocketClient *client, + const gchar *protocol) +{ + g_hash_table_insert (client->priv->app_proxies, g_strdup (protocol), NULL); +} diff --git a/gio/gsocketclient.h b/gio/gsocketclient.h index 0576614..180bedd 100644 --- a/gio/gsocketclient.h +++ b/gio/gsocketclient.h @@ -82,6 +82,19 @@ void g_socket_client_set_protocol (GSocket GSocketAddress *g_socket_client_get_local_address (GSocketClient *client); void g_socket_client_set_local_address (GSocketClient *client, GSocketAddress *address); +guint g_socket_client_get_timeout (GSocketClient *client); +void g_socket_client_set_timeout (GSocketClient *client, + guint timeout); +gboolean g_socket_client_get_enable_proxy (GSocketClient *client); +void g_socket_client_set_enable_proxy (GSocketClient *client, + gboolean enable); + +gboolean g_socket_client_get_tls (GSocketClient *client); +void g_socket_client_set_tls (GSocketClient *client, + gboolean tls); +GTlsCertificateFlags g_socket_client_get_tls_validation_flags (GSocketClient *client); +void g_socket_client_set_tls_validation_flags (GSocketClient *client, + GTlsCertificateFlags flags); GSocketConnection * g_socket_client_connect (GSocketClient *client, GSocketConnectable *connectable, @@ -97,6 +110,11 @@ GSocketConnection * g_socket_client_connect_to_service (GSocket const gchar *service, GCancellable *cancellable, GError **error); +GSocketConnection * g_socket_client_connect_to_uri (GSocketClient *client, + const gchar *uri, + guint16 default_port, + GCancellable *cancellable, + GError **error); void g_socket_client_connect_async (GSocketClient *client, GSocketConnectable *connectable, GCancellable *cancellable, @@ -124,6 +142,17 @@ void g_socket_client_connect_to_service_async (GSocket GSocketConnection * g_socket_client_connect_to_service_finish (GSocketClient *client, GAsyncResult *result, GError **error); +void g_socket_client_connect_to_uri_async (GSocketClient *client, + const gchar *uri, + guint16 default_port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GSocketConnection * g_socket_client_connect_to_uri_finish (GSocketClient *client, + GAsyncResult *result, + GError **error); +void g_socket_client_add_application_proxy (GSocketClient *client, + const gchar *protocol); G_END_DECLS diff --git a/gio/gsocketconnectable.c b/gio/gsocketconnectable.c index a57a001..3bad099 100644 --- a/gio/gsocketconnectable.c +++ b/gio/gsocketconnectable.c @@ -22,7 +22,6 @@ #include "gsocketconnectable.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gsocketconnectable @@ -91,35 +90,13 @@ * ]| */ -GType -g_socket_connectable_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - const GTypeInfo connectable_info = - { - sizeof (GSocketConnectableIface), /* class_size */ - NULL, /* base_init */ - NULL, /* base_finalize */ - NULL, - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL - }; - GType g_define_type_id = - g_type_register_static (G_TYPE_INTERFACE, I_("GSocketConnectable"), - &connectable_info, 0); - - g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT); - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } +typedef GSocketConnectableIface GSocketConnectableInterface; +G_DEFINE_INTERFACE (GSocketConnectable, g_socket_connectable, G_TYPE_OBJECT) - return g_define_type_id__volatile; +static void +g_socket_connectable_default_init (GSocketConnectableInterface *iface) +{ } /** @@ -128,7 +105,7 @@ g_socket_connectable_get_type (void) * * Creates a #GSocketAddressEnumerator for @connectable. * - * Return value: a new #GSocketAddressEnumerator. + * Return value: (transfer full): a new #GSocketAddressEnumerator. * * Since: 2.22 */ @@ -144,5 +121,33 @@ g_socket_connectable_enumerate (GSocketConnectable *connectable) return (* iface->enumerate) (connectable); } -#define __G_SOCKET_CONNECTABLE_C__ -#include "gioaliasdef.c" +/** + * g_socket_connectable_proxy_enumerate: + * @connectable: a #GSocketConnectable + * + * Creates a #GSocketAddressEnumerator for @connectable that will + * return #GProxyAddresses for addresses that you must connect + * to via a proxy. + * + * If @connectable does not implement + * g_socket_connectable_proxy_enumerate(), this will fall back to + * calling g_socket_connectable_enumerate(). + * + * Return value: (transfer full): a new #GSocketAddressEnumerator. + * + * Since: 2.26 + */ +GSocketAddressEnumerator * +g_socket_connectable_proxy_enumerate (GSocketConnectable *connectable) +{ + GSocketConnectableIface *iface; + + g_return_val_if_fail (G_IS_SOCKET_CONNECTABLE (connectable), NULL); + + iface = G_SOCKET_CONNECTABLE_GET_IFACE (connectable); + + if (iface->proxy_enumerate) + return (* iface->proxy_enumerate) (connectable); + else + return (* iface->enumerate) (connectable); +} diff --git a/gio/gsocketconnectable.h b/gio/gsocketconnectable.h index 5952b4f..0f84a4a 100644 --- a/gio/gsocketconnectable.h +++ b/gio/gsocketconnectable.h @@ -45,8 +45,10 @@ typedef struct _GSocketConnectableIface GSocketConnectableIface; * GSocketConnectableIface: * @g_iface: The parent interface. * @enumerate: Creates a #GSocketAddressEnumerator + * @proxy_enumerate: Creates a #GProxyAddressEnumerator * * Provides an interface for returning a #GSocketAddressEnumerator + * and #GProxyAddressEnumerator */ struct _GSocketConnectableIface { @@ -54,7 +56,9 @@ struct _GSocketConnectableIface /* Virtual Table */ - GSocketAddressEnumerator * (* enumerate) (GSocketConnectable *connectable); + GSocketAddressEnumerator * (* enumerate) (GSocketConnectable *connectable); + + GSocketAddressEnumerator * (* proxy_enumerate) (GSocketConnectable *connectable); }; @@ -62,6 +66,8 @@ GType g_socket_connectable_get_type (void) G_GNUC_CONST; GSocketAddressEnumerator *g_socket_connectable_enumerate (GSocketConnectable *connectable); +GSocketAddressEnumerator *g_socket_connectable_proxy_enumerate (GSocketConnectable *connectable); + G_END_DECLS diff --git a/gio/gsocketconnection.c b/gio/gsocketconnection.c index cb8bb5c..852805a 100644 --- a/gio/gsocketconnection.c +++ b/gio/gsocketconnection.c @@ -37,7 +37,6 @@ #include "gtcpconnection.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gsocketconnection @@ -61,8 +60,7 @@ * Since: 2.22 */ -G_DEFINE_TYPE (GSocketConnection, - g_socket_connection, G_TYPE_IO_STREAM); +G_DEFINE_TYPE (GSocketConnection, g_socket_connection, G_TYPE_IO_STREAM); enum { @@ -75,6 +73,8 @@ struct _GSocketConnectionPrivate GSocket *socket; GInputStream *input_stream; GOutputStream *output_stream; + + gboolean in_dispose; }; static gboolean g_socket_connection_close (GIOStream *stream, @@ -121,7 +121,7 @@ g_socket_connection_get_output_stream (GIOStream *io_stream) * This can be useful if you want to do something unusual on it * not supported by the #GSocketConnection APIs. * - * Returns: a #GSocketAddress or %NULL on error. + * Returns: (transfer none): a #GSocketAddress or %NULL on error. * * Since: 2.22 */ @@ -140,7 +140,7 @@ g_socket_connection_get_socket (GSocketConnection *connection) * * Try to get the local address of a socket connection. * - * Returns: a #GSocketAddress or %NULL on error. + * Returns: (transfer full): a #GSocketAddress or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -159,7 +159,7 @@ g_socket_connection_get_local_address (GSocketConnection *connection, * * Try to get the remote address of a socket connection. * - * Returns: a #GSocketAddress or %NULL on error. + * Returns: (transfer full): a #GSocketAddress or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 2.22 @@ -218,6 +218,19 @@ g_socket_connection_constructed (GObject *object) } static void +g_socket_connection_dispose (GObject *object) +{ + GSocketConnection *connection = G_SOCKET_CONNECTION (object); + + connection->priv->in_dispose = TRUE; + + G_OBJECT_CLASS (g_socket_connection_parent_class) + ->dispose (object); + + connection->priv->in_dispose = FALSE; +} + +static void g_socket_connection_finalize (GObject *object) { GSocketConnection *connection = G_SOCKET_CONNECTION (object); @@ -246,6 +259,7 @@ g_socket_connection_class_init (GSocketConnectionClass *klass) gobject_class->get_property = g_socket_connection_get_property; gobject_class->constructed = g_socket_connection_constructed; gobject_class->finalize = g_socket_connection_finalize; + gobject_class->dispose = g_socket_connection_dispose; stream_class->get_input_stream = g_socket_connection_get_input_stream; stream_class->get_output_stream = g_socket_connection_get_output_stream; @@ -286,6 +300,15 @@ g_socket_connection_close (GIOStream *stream, g_input_stream_close (connection->priv->input_stream, cancellable, NULL); + /* Don't close the underlying socket if this is being called + * as part of dispose(); when destroying the GSocketConnection, + * we only want to close the socket if we're holding the last + * reference on it, and in that case it will close itself when + * we unref it in finalize(). + */ + if (connection->priv->in_dispose) + return TRUE; + return g_socket_close (connection->priv->socket, error); } @@ -308,10 +331,9 @@ g_socket_connection_close_async (GIOStream *stream, if (class->close_fn && !class->close_fn (stream, cancellable, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (stream), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (stream), callback, user_data, error); - g_error_free (error); return; } @@ -480,7 +502,7 @@ g_socket_connection_factory_lookup_type (GSocketFamily family, * Creates a #GSocketConnection subclass of the right type for * @socket. * - * Returns: a #GSocketConnection + * Returns: (transfer full): a #GSocketConnection * * Since: 2.22 */ @@ -494,6 +516,3 @@ g_socket_connection_factory_create_connection (GSocket *socket) g_socket_get_protocol (socket)); return g_object_new (type, "socket", socket, NULL); } - -#define __G_SOCKET_CONNECTION_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocketcontrolmessage.c b/gio/gsocketcontrolmessage.c index f576a34..cce8258 100644 --- a/gio/gsocketcontrolmessage.c +++ b/gio/gsocketcontrolmessage.c @@ -48,10 +48,10 @@ #include "glibintl.h" #ifndef G_OS_WIN32 +#include "gunixcredentialsmessage.h" #include "gunixfdmessage.h" #endif -#include "gioalias.h" G_DEFINE_ABSTRACT_TYPE (GSocketControlMessage, g_socket_control_message, @@ -163,7 +163,7 @@ g_socket_control_message_class_init (GSocketControlMessageClass *class) * If there is no implementation for this kind of control message, %NULL * will be returned. * - * Returns: the deserialized message or %NULL + * Returns: (transfer full): the deserialized message or %NULL * * Since: 2.22 */ @@ -173,7 +173,6 @@ g_socket_control_message_deserialize (int level, gsize size, gpointer data) { - GSocketControlMessageClass *klass; GSocketControlMessage *message; GType *message_types; guint n_message_types; @@ -184,6 +183,7 @@ g_socket_control_message_deserialize (int level, /* Ensure we know about the built in types */ #ifndef G_OS_WIN32 + a_type = g_unix_credentials_message_get_type (); a_type = g_unix_fd_message_get_type (); #endif @@ -192,16 +192,14 @@ g_socket_control_message_deserialize (int level, message = NULL; for (i = 0; i < n_message_types; i++) { - klass = (GSocketControlMessageClass *)g_type_class_ref (message_types[i]); + GSocketControlMessageClass *class; - if (klass && klass->deserialize) - { - message = klass->deserialize (level, type, size, data); - g_type_class_unref ((GTypeClass *) klass); - } + class = g_type_class_ref (message_types[i]); + message = class->deserialize (level, type, size, data); + g_type_class_unref (class); if (message != NULL) - break; + break; } g_free (message_types); @@ -211,6 +209,3 @@ g_socket_control_message_deserialize (int level, return message; } - -#define __G_SOCKET_CONTROL_MESSAGE_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocketinputstream.c b/gio/gsocketinputstream.c index 046970f..fb9da1b 100644 --- a/gio/gsocketinputstream.c +++ b/gio/gsocketinputstream.c @@ -27,13 +27,18 @@ #include "gsocketinputstream.h" #include "glibintl.h" -#include -#include +#include "gsimpleasyncresult.h" +#include "gcancellable.h" +#include "gpollableinputstream.h" +#include "gioerror.h" -#include "gioalias.h" + +static void g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); #define g_socket_input_stream_get_type _g_socket_input_stream_get_type -G_DEFINE_TYPE (GSocketInputStream, g_socket_input_stream, G_TYPE_INPUT_STREAM); +G_DEFINE_TYPE_WITH_CODE (GSocketInputStream, g_socket_input_stream, G_TYPE_INPUT_STREAM, + G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM, g_socket_input_stream_pollable_iface_init) + ) enum { @@ -48,7 +53,6 @@ struct _GSocketInputStreamPrivate /* pending operation metadata */ GSimpleAsyncResult *result; GCancellable *cancellable; - gboolean from_mainloop; gpointer buffer; gsize count; }; @@ -112,8 +116,9 @@ g_socket_input_stream_read (GInputStream *stream, { GSocketInputStream *input_stream = G_SOCKET_INPUT_STREAM (stream); - return g_socket_receive (input_stream->priv->socket, buffer, count, - cancellable, error); + return g_socket_receive_with_blocking (input_stream->priv->socket, + buffer, count, TRUE, + cancellable, error); } static gboolean @@ -125,31 +130,29 @@ g_socket_input_stream_read_ready (GSocket *socket, GError *error = NULL; gssize result; + result = g_socket_receive_with_blocking (stream->priv->socket, + stream->priv->buffer, + stream->priv->count, + FALSE, + stream->priv->cancellable, + &error); + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) + return TRUE; + simple = stream->priv->result; stream->priv->result = NULL; - result = g_socket_receive (stream->priv->socket, - stream->priv->buffer, - stream->priv->count, - stream->priv->cancellable, - &error); if (result >= 0) g_simple_async_result_set_op_res_gssize (simple, result); if (error) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); if (stream->priv->cancellable) g_object_unref (stream->priv->cancellable); - if (stream->priv->from_mainloop) - g_simple_async_result_complete (simple); - else - g_simple_async_result_complete_in_idle (simple); - + g_simple_async_result_complete (simple); g_object_unref (simple); return FALSE; @@ -165,6 +168,7 @@ g_socket_input_stream_read_async (GInputStream *stream, gpointer user_data) { GSocketInputStream *input_stream = G_SOCKET_INPUT_STREAM (stream); + GSource *source; g_assert (input_stream->priv->result == NULL); @@ -177,25 +181,14 @@ g_socket_input_stream_read_async (GInputStream *stream, input_stream->priv->buffer = buffer; input_stream->priv->count = count; - if (!g_socket_condition_check (input_stream->priv->socket, G_IO_IN)) - { - GSource *source; - - input_stream->priv->from_mainloop = TRUE; - source = g_socket_create_source (input_stream->priv->socket, - G_IO_IN | G_IO_HUP | G_IO_ERR, - cancellable); - g_source_set_callback (source, - (GSourceFunc) g_socket_input_stream_read_ready, - g_object_ref (input_stream), g_object_unref); - g_source_attach (source, g_main_context_get_thread_default ()); - g_source_unref (source); - } - else - { - input_stream->priv->from_mainloop = FALSE; - g_socket_input_stream_read_ready (input_stream->priv->socket, G_IO_IN, input_stream); - } + source = g_socket_create_source (input_stream->priv->socket, + G_IO_IN | G_IO_HUP | G_IO_ERR, + cancellable); + g_source_set_callback (source, + (GSourceFunc) g_socket_input_stream_read_ready, + g_object_ref (input_stream), g_object_unref); + g_source_attach (source, g_main_context_get_thread_default ()); + g_source_unref (source); } static gssize @@ -217,6 +210,44 @@ g_socket_input_stream_read_finish (GInputStream *stream, return count; } +static gboolean +g_socket_input_stream_pollable_is_readable (GPollableInputStream *pollable) +{ + GSocketInputStream *input_stream = G_SOCKET_INPUT_STREAM (pollable); + + return g_socket_condition_check (input_stream->priv->socket, G_IO_IN); +} + +static GSource * +g_socket_input_stream_pollable_create_source (GPollableInputStream *pollable, + GCancellable *cancellable) +{ + GSocketInputStream *input_stream = G_SOCKET_INPUT_STREAM (pollable); + GSource *socket_source, *pollable_source; + + pollable_source = g_pollable_source_new (G_OBJECT (input_stream)); + socket_source = g_socket_create_source (input_stream->priv->socket, + G_IO_IN, cancellable); + g_source_set_dummy_callback (socket_source); + g_source_add_child_source (pollable_source, socket_source); + g_source_unref (socket_source); + + return pollable_source; +} + +static gssize +g_socket_input_stream_pollable_read_nonblocking (GPollableInputStream *pollable, + void *buffer, + gsize size, + GError **error) +{ + GSocketInputStream *input_stream = G_SOCKET_INPUT_STREAM (pollable); + + return g_socket_receive_with_blocking (input_stream->priv->socket, + buffer, size, FALSE, + NULL, error); +} + static void g_socket_input_stream_class_init (GSocketInputStreamClass *klass) { @@ -242,6 +273,14 @@ g_socket_input_stream_class_init (GSocketInputStreamClass *klass) } static void +g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) +{ + iface->is_readable = g_socket_input_stream_pollable_is_readable; + iface->create_source = g_socket_input_stream_pollable_create_source; + iface->read_nonblocking = g_socket_input_stream_pollable_read_nonblocking; +} + +static void g_socket_input_stream_init (GSocketInputStream *stream) { stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, G_TYPE_SOCKET_INPUT_STREAM, GSocketInputStreamPrivate); @@ -252,6 +291,3 @@ _g_socket_input_stream_new (GSocket *socket) { return G_SOCKET_INPUT_STREAM (g_object_new (G_TYPE_SOCKET_INPUT_STREAM, "socket", socket, NULL)); } - -#define __G_SOCKET_INPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocketlistener.c b/gio/gsocketlistener.c index adbac5c..babefcd 100644 --- a/gio/gsocketlistener.c +++ b/gio/gsocketlistener.c @@ -38,7 +38,6 @@ #include #include "glibintl.h" -#include "gioalias.h" /** * SECTION: gsocketlistener @@ -255,7 +254,7 @@ g_socket_listener_add_socket (GSocketListener *listener, * @type: a #GSocketType * @protocol: a #GSocketProtocol * @source_object: Optional #GObject identifying this source - * @effective_address: location to store the address that was bound to, or %NULL. + * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL. * @error: #GError for error reporting, or %NULL to ignore. * * Creates a socket of type @type and protocol @protocol, binds @@ -563,7 +562,7 @@ accept_callback (GSocket *socket, /** * g_socket_listener_accept_socket: * @listener: a #GSocketListener - * @source_object: location where #GObject pointer will be stored, or %NULL + * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL. * @cancellable: optional #GCancellable object, %NULL to ignore. * @error: #GError for error reporting, or %NULL to ignore. * @@ -582,7 +581,7 @@ accept_callback (GSocket *socket, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GSocket on success, %NULL on error. + * Returns: (transfer full): a #GSocket on success, %NULL on error. * * Since: 2.22 */ @@ -640,7 +639,7 @@ g_socket_listener_accept_socket (GSocketListener *listener, /** * g_socket_listener_accept: * @listener: a #GSocketListener - * @source_object: location where #GObject pointer will be stored, or %NULL + * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL * @cancellable: optional #GCancellable object, %NULL to ignore. * @error: #GError for error reporting, or %NULL to ignore. * @@ -656,7 +655,7 @@ g_socket_listener_accept_socket (GSocketListener *listener, * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * - * Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -711,8 +710,7 @@ accept_ready (GSocket *accept_socket, } else { - g_simple_async_result_set_from_error (data->simple, error); - g_error_free (error); + g_simple_async_result_take_error (data->simple, error); } g_simple_async_result_complete_in_idle (data->simple); @@ -749,10 +747,9 @@ g_socket_listener_accept_socket_async (GSocketListener *listener, if (!check_listener (listener, &error)) { - g_simple_async_report_gerror_in_idle (G_OBJECT (listener), + g_simple_async_report_take_gerror_in_idle (G_OBJECT (listener), callback, user_data, error); - g_error_free (error); return; } @@ -778,7 +775,7 @@ g_socket_listener_accept_socket_async (GSocketListener *listener, * * Finishes an async accept operation. See g_socket_listener_accept_socket_async() * - * Returns: a #GSocket on success, %NULL on error. + * Returns: (transfer full): a #GSocket on success, %NULL on error. * * Since: 2.22 */ @@ -791,7 +788,7 @@ g_socket_listener_accept_socket_finish (GSocketListener *listener, GSocket *socket; GSimpleAsyncResult *simple; - g_return_val_if_fail (G_IS_SOCKET_LISTENER (listener), FALSE); + g_return_val_if_fail (G_IS_SOCKET_LISTENER (listener), NULL); simple = G_SIMPLE_ASYNC_RESULT (result); @@ -845,7 +842,7 @@ g_socket_listener_accept_async (GSocketListener *listener, * * Finishes an async accept operation. See g_socket_listener_accept_async() * - * Returns: a #GSocketConnection on success, %NULL on error. + * Returns: (transfer full): a #GSocketConnection on success, %NULL on error. * * Since: 2.22 */ @@ -1151,6 +1148,3 @@ g_socket_listener_add_any_inet_port (GSocketListener *listener, return candidate_port; } - -#define __G_SOCKET_LISTENER_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocketoutputstream.c b/gio/gsocketoutputstream.c index 7aa9680..0ef3360 100644 --- a/gio/gsocketoutputstream.c +++ b/gio/gsocketoutputstream.c @@ -28,14 +28,20 @@ #include "gsocketoutputstream.h" #include "gsocket.h" -#include -#include +#include "gsimpleasyncresult.h" +#include "gcancellable.h" +#include "gpollableinputstream.h" +#include "gpollableoutputstream.h" +#include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" + +static void g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); #define g_socket_output_stream_get_type _g_socket_output_stream_get_type -G_DEFINE_TYPE (GSocketOutputStream, g_socket_output_stream, G_TYPE_OUTPUT_STREAM); +G_DEFINE_TYPE_WITH_CODE (GSocketOutputStream, g_socket_output_stream, G_TYPE_OUTPUT_STREAM, + G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM, g_socket_output_stream_pollable_iface_init) + ) enum { @@ -50,7 +56,6 @@ struct _GSocketOutputStreamPrivate /* pending operation metadata */ GSimpleAsyncResult *result; GCancellable *cancellable; - gboolean from_mainloop; gconstpointer buffer; gsize count; }; @@ -114,8 +119,9 @@ g_socket_output_stream_write (GOutputStream *stream, { GSocketOutputStream *onput_stream = G_SOCKET_OUTPUT_STREAM (stream); - return g_socket_send (onput_stream->priv->socket, buffer, count, - cancellable, error); + return g_socket_send_with_blocking (onput_stream->priv->socket, + buffer, count, TRUE, + cancellable, error); } static gboolean @@ -127,31 +133,29 @@ g_socket_output_stream_write_ready (GSocket *socket, GError *error = NULL; gssize result; + result = g_socket_send_with_blocking (stream->priv->socket, + stream->priv->buffer, + stream->priv->count, + FALSE, + stream->priv->cancellable, + &error); + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) + return TRUE; + simple = stream->priv->result; stream->priv->result = NULL; - result = g_socket_send (stream->priv->socket, - stream->priv->buffer, - stream->priv->count, - stream->priv->cancellable, - &error); if (result >= 0) g_simple_async_result_set_op_res_gssize (simple, result); if (error) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); if (stream->priv->cancellable) g_object_unref (stream->priv->cancellable); - if (stream->priv->from_mainloop) - g_simple_async_result_complete (simple); - else - g_simple_async_result_complete_in_idle (simple); - + g_simple_async_result_complete (simple); g_object_unref (simple); return FALSE; @@ -167,6 +171,7 @@ g_socket_output_stream_write_async (GOutputStream *stream, gpointer user_data) { GSocketOutputStream *output_stream = G_SOCKET_OUTPUT_STREAM (stream); + GSource *source; g_assert (output_stream->priv->result == NULL); @@ -179,25 +184,14 @@ g_socket_output_stream_write_async (GOutputStream *stream, output_stream->priv->buffer = buffer; output_stream->priv->count = count; - if (!g_socket_condition_check (output_stream->priv->socket, G_IO_OUT)) - { - GSource *source; - - output_stream->priv->from_mainloop = TRUE; - source = g_socket_create_source (output_stream->priv->socket, - G_IO_OUT | G_IO_HUP | G_IO_ERR, - cancellable); - g_source_set_callback (source, - (GSourceFunc) g_socket_output_stream_write_ready, - g_object_ref (output_stream), g_object_unref); - g_source_attach (source, g_main_context_get_thread_default ()); - g_source_unref (source); - } - else - { - output_stream->priv->from_mainloop = FALSE; - g_socket_output_stream_write_ready (output_stream->priv->socket, G_IO_OUT, output_stream); - } + source = g_socket_create_source (output_stream->priv->socket, + G_IO_OUT | G_IO_HUP | G_IO_ERR, + cancellable); + g_source_set_callback (source, + (GSourceFunc) g_socket_output_stream_write_ready, + g_object_ref (output_stream), g_object_unref); + g_source_attach (source, g_main_context_get_thread_default ()); + g_source_unref (source); } static gssize @@ -219,6 +213,44 @@ g_socket_output_stream_write_finish (GOutputStream *stream, return count; } +static gboolean +g_socket_output_stream_pollable_is_writable (GPollableOutputStream *pollable) +{ + GSocketOutputStream *output_stream = G_SOCKET_OUTPUT_STREAM (pollable); + + return g_socket_condition_check (output_stream->priv->socket, G_IO_OUT); +} + +static GSource * +g_socket_output_stream_pollable_create_source (GPollableOutputStream *pollable, + GCancellable *cancellable) +{ + GSocketOutputStream *output_stream = G_SOCKET_OUTPUT_STREAM (pollable); + GSource *socket_source, *pollable_source; + + pollable_source = g_pollable_source_new (G_OBJECT (output_stream)); + socket_source = g_socket_create_source (output_stream->priv->socket, + G_IO_OUT, cancellable); + g_source_set_dummy_callback (socket_source); + g_source_add_child_source (pollable_source, socket_source); + g_source_unref (socket_source); + + return pollable_source; +} + +static gssize +g_socket_output_stream_pollable_write_nonblocking (GPollableOutputStream *pollable, + const void *buffer, + gsize size, + GError **error) +{ + GSocketOutputStream *output_stream = G_SOCKET_OUTPUT_STREAM (pollable); + + return g_socket_send_with_blocking (output_stream->priv->socket, + buffer, size, FALSE, + NULL, error); +} + static void g_socket_output_stream_class_init (GSocketOutputStreamClass *klass) { @@ -244,6 +276,14 @@ g_socket_output_stream_class_init (GSocketOutputStreamClass *klass) } static void +g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) +{ + iface->is_writable = g_socket_output_stream_pollable_is_writable; + iface->create_source = g_socket_output_stream_pollable_create_source; + iface->write_nonblocking = g_socket_output_stream_pollable_write_nonblocking; +} + +static void g_socket_output_stream_init (GSocketOutputStream *stream) { stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, G_TYPE_SOCKET_OUTPUT_STREAM, GSocketOutputStreamPrivate); @@ -254,6 +294,3 @@ _g_socket_output_stream_new (GSocket *socket) { return G_SOCKET_OUTPUT_STREAM (g_object_new (G_TYPE_SOCKET_OUTPUT_STREAM, "socket", socket, NULL)); } - -#define __G_SOCKET_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocketservice.c b/gio/gsocketservice.c index a7bd8f1..e9aab5e 100644 --- a/gio/gsocketservice.c +++ b/gio/gsocketservice.c @@ -64,7 +64,6 @@ #include "gsocketlistener.h" #include "gsocketconnection.h" -#include "gioalias.h" static guint g_socket_service_incoming_signal; @@ -326,6 +325,3 @@ g_socket_service_new (void) { return g_object_new (G_TYPE_SOCKET_SERVICE, NULL); } - -#define __G_SOCKET_SERVICE_C__ -#include "gioaliasdef.c" diff --git a/gio/gsocks4aproxy.c b/gio/gsocks4aproxy.c new file mode 100644 index 0000000..91ca29d --- /dev/null +++ b/gio/gsocks4aproxy.c @@ -0,0 +1,491 @@ + /* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#include "config.h" + +#include "gsocks4aproxy.h" + +#include + +#include "gasyncresult.h" +#include "giomodule.h" +#include "giomodule-priv.h" +#include "giostream.h" +#include "ginetaddress.h" +#include "ginputstream.h" +#include "glibintl.h" +#include "goutputstream.h" +#include "gproxy.h" +#include "gproxyaddress.h" +#include "gsimpleasyncresult.h" + +#define SOCKS4_VERSION 4 + +#define SOCKS4_CMD_CONNECT 1 +#define SOCKS4_CMD_BIND 2 + +#define SOCKS4_MAX_LEN 255 + +#define SOCKS4_REP_VERSION 0 +#define SOCKS4_REP_GRANTED 90 +#define SOCKS4_REP_REJECTED 91 +#define SOCKS4_REP_NO_IDENT 92 +#define SOCKS4_REP_BAD_IDENT 93 + +static void g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface); + +#define g_socks4a_proxy_get_type _g_socks4a_proxy_get_type +G_DEFINE_TYPE_WITH_CODE (GSocks4aProxy, g_socks4a_proxy, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_PROXY, + g_socks4a_proxy_iface_init) + _g_io_modules_ensure_extension_points_registered (); + g_io_extension_point_implement (G_PROXY_EXTENSION_POINT_NAME, + g_define_type_id, + "socks4a", + 0)) + +static void +g_socks4a_proxy_finalize (GObject *object) +{ + /* must chain up */ + G_OBJECT_CLASS (g_socks4a_proxy_parent_class)->finalize (object); +} + +static void +g_socks4a_proxy_init (GSocks4aProxy *proxy) +{ + proxy->supports_hostname = TRUE; +} + +/* |-> SOCKSv4a only + * +----+----+----+----+----+----+----+----+----+----+....+----+------+....+------+ + * | VN | CD | DSTPORT | DSTIP | USERID |NULL| HOST | | NULL | + * +----+----+----+----+----+----+----+----+----+----+....+----+------+....+------+ + * 1 1 2 4 variable 1 variable + */ +#define SOCKS4_CONN_MSG_LEN (9 + SOCKS4_MAX_LEN * 2) +static gint +set_connect_msg (guint8 *msg, + const gchar *hostname, + guint16 port, + const char *username, + GError **error) +{ + GInetAddress *addr; + guint len = 0; + gsize addr_len; + gboolean is_ip; + const gchar *ip; + + msg[len++] = SOCKS4_VERSION; + msg[len++] = SOCKS4_CMD_CONNECT; + + { + guint16 hp = g_htons (port); + memcpy (msg + len, &hp, 2); + len += 2; + } + + is_ip = g_hostname_is_ip_address (hostname); + + if (is_ip) + ip = hostname; + else + ip = "0.0.0.1"; + + addr = g_inet_address_new_from_string (ip); + addr_len = g_inet_address_get_native_size (addr); + + if (addr_len != 4) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("SOCKSv4 does not support IPv6 address '%s'"), + ip); + g_object_unref (addr); + return -1; + } + + memcpy (msg + len, g_inet_address_to_bytes (addr), addr_len); + len += addr_len; + + g_object_unref (addr); + + if (username) + { + gsize user_len = strlen (username); + + if (user_len > SOCKS4_MAX_LEN) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("SOCKSv4 implementation limits username to %i characters"), + SOCKS4_MAX_LEN); + return -1; + } + + memcpy (msg + len, username, user_len); + len += user_len; + } + + msg[len++] = '\0'; + + if (!is_ip) + { + gsize host_len = strlen (hostname); + + if (host_len > SOCKS4_MAX_LEN) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("SOCKSv4a implementation limits hostname to %i characters"), + SOCKS4_MAX_LEN); + return -1; + } + + memcpy (msg + len, hostname, host_len); + len += host_len; + msg[len++] = '\0'; + } + + return len; +} + +/* + * +----+----+----+----+----+----+----+----+ + * | VN | CD | DSTPORT | DSTIP | + * +----+----+----+----+----+----+----+----+ + * 1 1 2 4 + */ +#define SOCKS4_CONN_REP_LEN 8 +static gboolean +parse_connect_reply (const guint8 *data, GError **error) +{ + if (data[0] != SOCKS4_REP_VERSION) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("The server is not a SOCKSv4 proxy server.")); + return FALSE; + } + + if (data[1] != SOCKS4_REP_GRANTED) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("Connection through SOCKSv4 server was rejected")); + return FALSE; + } + + return TRUE; +} + +static GIOStream * +g_socks4a_proxy_connect (GProxy *proxy, + GIOStream *io_stream, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GError **error) +{ + GInputStream *in; + GOutputStream *out; + const gchar *hostname; + guint16 port; + const gchar *username; + + hostname = g_proxy_address_get_destination_hostname (proxy_address); + port = g_proxy_address_get_destination_port (proxy_address); + username = g_proxy_address_get_username (proxy_address); + + in = g_io_stream_get_input_stream (io_stream); + out = g_io_stream_get_output_stream (io_stream); + + /* Send SOCKS4 connection request */ + { + guint8 msg[SOCKS4_CONN_MSG_LEN]; + gint len; + + len = set_connect_msg (msg, hostname, port, username, error); + + if (len < 0) + goto error; + + if (!g_output_stream_write_all (out, msg, len, NULL, + cancellable, error)) + goto error; + } + + /* Read SOCKS4 response */ + { + guint8 data[SOCKS4_CONN_REP_LEN]; + + if (!g_input_stream_read_all (in, data, SOCKS4_CONN_REP_LEN, NULL, + cancellable, error)) + goto error; + + if (!parse_connect_reply (data, error)) + goto error; + } + + return g_object_ref (io_stream); + +error: + return NULL; +} + + +typedef struct +{ + GSimpleAsyncResult *simple; + GIOStream *io_stream; + GProxyAddress *proxy_address; + GCancellable *cancellable; + + /* For connecting */ + guint8 *buffer; + gssize length; + gssize offset; + +} ConnectAsyncData; + +static void connect_msg_write_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); +static void connect_reply_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); + +static void +free_connect_data (ConnectAsyncData *data) +{ + if (data->io_stream) + g_object_unref (data->io_stream); + + if (data->proxy_address) + g_object_unref (data->proxy_address); + + if (data->cancellable) + g_object_unref (data->cancellable); + + g_slice_free (ConnectAsyncData, data); +} + +static void +complete_async_from_error (ConnectAsyncData *data, GError *error) +{ + GSimpleAsyncResult *simple = data->simple; + g_simple_async_result_take_error (data->simple, error); + g_simple_async_result_set_op_res_gpointer (simple, NULL, NULL); + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + +static void +do_read (GAsyncReadyCallback callback, ConnectAsyncData *data) +{ + GInputStream *in; + in = g_io_stream_get_input_stream (data->io_stream); + g_input_stream_read_async (in, + data->buffer + data->offset, + data->length - data->offset, + G_PRIORITY_DEFAULT, data->cancellable, + callback, data); +} + +static void +do_write (GAsyncReadyCallback callback, ConnectAsyncData *data) +{ + GOutputStream *out; + out = g_io_stream_get_output_stream (data->io_stream); + g_output_stream_write_async (out, + data->buffer + data->offset, + data->length - data->offset, + G_PRIORITY_DEFAULT, data->cancellable, + callback, data); +} + + + +static void +g_socks4a_proxy_connect_async (GProxy *proxy, + GIOStream *io_stream, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GError *error = NULL; + GSimpleAsyncResult *simple; + ConnectAsyncData *data; + const gchar *hostname; + guint16 port; + const gchar *username; + + simple = g_simple_async_result_new (G_OBJECT (proxy), + callback, user_data, + g_socks4a_proxy_connect_async); + + data = g_slice_new0 (ConnectAsyncData); + + data->simple = simple; + data->io_stream = g_object_ref (io_stream); + + if (cancellable) + data->cancellable = g_object_ref (cancellable); + + g_simple_async_result_set_op_res_gpointer (simple, data, + (GDestroyNotify) free_connect_data); + + hostname = g_proxy_address_get_destination_hostname (proxy_address); + port = g_proxy_address_get_destination_port (proxy_address); + username = g_proxy_address_get_username (proxy_address); + + data->buffer = g_malloc0 (SOCKS4_CONN_MSG_LEN); + data->length = set_connect_msg (data->buffer, + hostname, port, username, + &error); + data->offset = 0; + + if (data->length < 0) + { + g_simple_async_result_take_error (data->simple, error); + g_simple_async_result_set_op_res_gpointer (simple, NULL, NULL); + g_simple_async_result_complete_in_idle (simple); + g_object_unref (simple); + } + else + { + do_write (connect_msg_write_cb, data); + } +} + +static void +connect_msg_write_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize written; + + written = g_output_stream_write_finish (G_OUTPUT_STREAM (source), + result, &error); + + if (written < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += written; + + if (data->offset == data->length) + { + g_free (data->buffer); + + data->buffer = g_malloc0 (SOCKS4_CONN_REP_LEN); + data->length = SOCKS4_CONN_REP_LEN; + data->offset = 0; + + do_read (connect_reply_read_cb, data); + } + else + { + do_write (connect_msg_write_cb, data); + } +} + +static void +connect_reply_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize read; + + read = g_input_stream_read_finish (G_INPUT_STREAM (source), + result, &error); + + if (read < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += read; + + if (data->offset == data->length) + { + if (!parse_connect_reply (data->buffer, &error)) + { + complete_async_from_error (data, error); + } + else + { + GSimpleAsyncResult *simple = data->simple; + g_simple_async_result_complete (simple); + g_object_unref (simple); + } + } + else + { + do_read (connect_reply_read_cb, data); + } +} + +static GIOStream *g_socks4a_proxy_connect_finish (GProxy *proxy, + GAsyncResult *result, + GError **error); + +static GIOStream * +g_socks4a_proxy_connect_finish (GProxy *proxy, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); + ConnectAsyncData *data = g_simple_async_result_get_op_res_gpointer (simple); + + if (g_simple_async_result_propagate_error (simple, error)) + return NULL; + + return g_object_ref (data->io_stream); +} + +static gboolean +g_socks4a_proxy_supports_hostname (GProxy *proxy) +{ + return G_SOCKS4A_PROXY (proxy)->supports_hostname; +} + +static void +g_socks4a_proxy_class_init (GSocks4aProxyClass *class) +{ + GObjectClass *object_class; + + object_class = (GObjectClass *) class; + object_class->finalize = g_socks4a_proxy_finalize; +} + +static void +g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface) +{ + proxy_iface->connect = g_socks4a_proxy_connect; + proxy_iface->connect_async = g_socks4a_proxy_connect_async; + proxy_iface->connect_finish = g_socks4a_proxy_connect_finish; + proxy_iface->supports_hostname = g_socks4a_proxy_supports_hostname; +} diff --git a/gio/gsocks4aproxy.h b/gio/gsocks4aproxy.h new file mode 100644 index 0000000..e6c7b04 --- /dev/null +++ b/gio/gsocks4aproxy.h @@ -0,0 +1,55 @@ + /* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#ifndef __G_SOCKS4A_PROXY_H__ +#define __G_SOCKS4A_PROXY_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SOCKS4A_PROXY (_g_socks4a_proxy_get_type ()) +#define G_SOCKS4A_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SOCKS4A_PROXY, GSocks4aProxy)) +#define G_SOCKS4A_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SOCKS4A_PROXY, GSocks4aProxyClass)) +#define G_IS_SOCKS4A_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SOCKS4A_PROXY)) +#define G_IS_SOCKS4A_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SOCKS4A_PROXY)) +#define G_SOCKS4A_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SOCKS4A_PROXY, GSocks4aProxyClass)) + +typedef struct _GSocks4aProxy GSocks4aProxy; +typedef struct _GSocks4aProxyClass GSocks4aProxyClass; + +struct _GSocks4aProxy +{ + GObject parent; + gboolean supports_hostname; +}; + +struct _GSocks4aProxyClass +{ + GObjectClass parent_class; +}; + +GType _g_socks4a_proxy_get_type (void); + +G_END_DECLS + +#endif /* __SOCKS5_PROXY_H__ */ diff --git a/gio/gsocks4proxy.c b/gio/gsocks4proxy.c new file mode 100644 index 0000000..05c74c8 --- /dev/null +++ b/gio/gsocks4proxy.c @@ -0,0 +1,71 @@ + /* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#include "config.h" + +#include "gsocks4proxy.h" + +#include "giomodule.h" +#include "giomodule-priv.h" +#include "gproxy.h" +#include "gsocks4aproxy.h" + +struct _GSocks4Proxy +{ + GSocks4aProxy parent; +}; + +struct _GSocks4ProxyClass +{ + GSocks4aProxyClass parent_class; +}; + +#define g_socks4_proxy_get_type _g_socks4_proxy_get_type +G_DEFINE_TYPE_WITH_CODE (GSocks4Proxy, g_socks4_proxy, G_TYPE_SOCKS4A_PROXY, + _g_io_modules_ensure_extension_points_registered (); + g_io_extension_point_implement (G_PROXY_EXTENSION_POINT_NAME, + g_define_type_id, + "socks4", + 0)) + +static void +g_socks4_proxy_finalize (GObject *object) +{ + /* must chain up */ + G_OBJECT_CLASS (g_socks4_proxy_parent_class)->finalize (object); +} + +static void +g_socks4_proxy_init (GSocks4Proxy *proxy) +{ + G_SOCKS4A_PROXY (proxy)->supports_hostname = FALSE; +} + + +static void +g_socks4_proxy_class_init (GSocks4ProxyClass *class) +{ + GObjectClass *object_class; + + object_class = (GObjectClass *) class; + object_class->finalize = g_socks4_proxy_finalize; +} diff --git a/gio/gsocks4proxy.h b/gio/gsocks4proxy.h new file mode 100644 index 0000000..5b89d2d --- /dev/null +++ b/gio/gsocks4proxy.h @@ -0,0 +1,44 @@ + /* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Nicolas Dufresne + */ + +#ifndef __G_SOCKS4_PROXY_H__ +#define __G_SOCKS4_PROXY_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SOCKS4_PROXY (_g_socks4_proxy_get_type ()) +#define G_SOCKS4_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SOCKS4_PROXY, GSocks4Proxy)) +#define G_SOCKS4_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SOCKS4_PROXY, GSocks4ProxyClass)) +#define G_IS_SOCKS4_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SOCKS4_PROXY)) +#define G_IS_SOCKS4_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SOCKS4_PROXY)) +#define G_SOCKS4_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SOCKS4_PROXY, GSocks4ProxyClass)) + +typedef struct _GSocks4Proxy GSocks4Proxy; +typedef struct _GSocks4ProxyClass GSocks4ProxyClass; + +GType _g_socks4_proxy_get_type (void); + +G_END_DECLS + +#endif /* __SOCKS5_PROXY_H__ */ diff --git a/gio/gsocks5proxy.c b/gio/gsocks5proxy.c new file mode 100644 index 0000000..07fc8ce --- /dev/null +++ b/gio/gsocks5proxy.c @@ -0,0 +1,1052 @@ + /* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2008, 2010 Collabora, Ltd. + * Copyright (C) 2008 Nokia Corporation. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Youness Alaoui + */ + +#include "config.h" + +#include "gsocks5proxy.h" + +#include + +#include "giomodule.h" +#include "giomodule-priv.h" +#include "giostream.h" +#include "ginetaddress.h" +#include "ginputstream.h" +#include "glibintl.h" +#include "goutputstream.h" +#include "gproxy.h" +#include "gproxyaddress.h" +#include "gsimpleasyncresult.h" + +#define SOCKS5_VERSION 0x05 + +#define SOCKS5_CMD_CONNECT 0x01 +#define SOCKS5_CMD_BIND 0x02 +#define SOCKS5_CMD_UDP_ASSOCIATE 0x03 + +#define SOCKS5_ATYP_IPV4 0x01 +#define SOCKS5_ATYP_DOMAINNAME 0x03 +#define SOCKS5_ATYP_IPV6 0x04 + +#define SOCKS5_AUTH_VERSION 0x01 + +#define SOCKS5_AUTH_NONE 0x00 +#define SOCKS5_AUTH_GSSAPI 0x01 +#define SOCKS5_AUTH_USR_PASS 0x02 +#define SOCKS5_AUTH_NO_ACCEPT 0xff + +#define SOCKS5_MAX_LEN 255 +#define SOCKS5_RESERVED 0x00 + +#define SOCKS5_REP_SUCCEEDED 0x00 +#define SOCKS5_REP_SRV_FAILURE 0x01 +#define SOCKS5_REP_NOT_ALLOWED 0x02 +#define SOCKS5_REP_NET_UNREACH 0x03 +#define SOCKS5_REP_HOST_UNREACH 0x04 +#define SOCKS5_REP_REFUSED 0x05 +#define SOCKS5_REP_TTL_EXPIRED 0x06 +#define SOCKS5_REP_CMD_NOT_SUP 0x07 +#define SOCKS5_REP_ATYPE_NOT_SUP 0x08 + + +struct _GSocks5Proxy +{ + GObject parent; +}; + +struct _GSocks5ProxyClass +{ + GObjectClass parent_class; +}; + +static void g_socks5_proxy_iface_init (GProxyInterface *proxy_iface); + +#define g_socks5_proxy_get_type _g_socks5_proxy_get_type +G_DEFINE_TYPE_WITH_CODE (GSocks5Proxy, g_socks5_proxy, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_PROXY, + g_socks5_proxy_iface_init) + _g_io_modules_ensure_extension_points_registered (); + g_io_extension_point_implement (G_PROXY_EXTENSION_POINT_NAME, + g_define_type_id, + "socks5", + 0)) + +static void +g_socks5_proxy_finalize (GObject *object) +{ + /* must chain up */ + G_OBJECT_CLASS (g_socks5_proxy_parent_class)->finalize (object); +} + +static void +g_socks5_proxy_init (GSocks5Proxy *proxy) +{ +} + +/* + * +----+----------+----------+ + * |VER | NMETHODS | METHODS | + * +----+----------+----------+ + * | 1 | 1 | 1 to 255 | + * +----+----------+----------+ + */ +#define SOCKS5_NEGO_MSG_LEN 4 +static gint +set_nego_msg (guint8 *msg, gboolean has_auth) +{ + gint len = 3; + + msg[0] = SOCKS5_VERSION; + msg[1] = 0x01; /* number of methods supported */ + msg[2] = SOCKS5_AUTH_NONE; + + /* add support for authentication method */ + if (has_auth) + { + msg[1] = 0x02; /* number of methods supported */ + msg[3] = SOCKS5_AUTH_USR_PASS; + len++; + } + + return len; +} + + +/* + * +----+--------+ + * |VER | METHOD | + * +----+--------+ + * | 1 | 1 | + * +----+--------+ + */ +#define SOCKS5_NEGO_REP_LEN 2 +static gboolean +parse_nego_reply (const guint8 *data, + gboolean has_auth, + gboolean *must_auth, + GError **error) +{ + if (data[0] != SOCKS5_VERSION) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("The server is not a SOCKSv5 proxy server.")); + return FALSE; + } + + switch (data[1]) + { + case SOCKS5_AUTH_NONE: + *must_auth = FALSE; + break; + + case SOCKS5_AUTH_USR_PASS: + if (!has_auth) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_NEED_AUTH, + _("The SOCKSv5 proxy requires authentication.")); + return FALSE; + } + *must_auth = TRUE; + break; + + case SOCKS5_AUTH_GSSAPI: + case SOCKS5_AUTH_NO_ACCEPT: + default: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED, + _("The SOCKSv5 proxy requires an authentication method that is not " + "supported by GLib.")); + return FALSE; + break; + } + + return TRUE; +} + +#define SOCKS5_AUTH_MSG_LEN 515 +static gint +set_auth_msg (guint8 *msg, + const gchar *username, + const gchar *password, + GError **error) +{ + gint len = 0; + gint ulen = 0; /* username length */ + gint plen = 0; /* Password length */ + + if (username) + ulen = strlen (username); + + if (password) + plen = strlen (password); + + if (ulen > SOCKS5_MAX_LEN || plen > SOCKS5_MAX_LEN) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("Username or password is too long for SOCKSv5 " + "protocol (max. is %i)."), + SOCKS5_MAX_LEN); + return FALSE; + } + + msg[len++] = SOCKS5_AUTH_VERSION; + msg[len++] = ulen; + + if (ulen > 0) + memcpy (msg + len, username, ulen); + + len += ulen; + msg[len++] = plen; + + if (plen > 0) + memcpy (msg + len, password, plen); + + len += plen; + + return len; +} + + +static gboolean +check_auth_status (const guint8 *data, GError **error) +{ + if (data[0] != SOCKS5_VERSION + || data[1] != SOCKS5_REP_SUCCEEDED) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED, + _("SOCKSv5 authentication failed due to wrong " + "username or password.")); + return FALSE; + } + return TRUE; +} + +/* + * +----+-----+-------+------+----------+----------+ + * |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | + * +----+-----+-------+------+----------+----------+ + * | 1 | 1 | X'00' | 1 | Variable | 2 | + * +----+-----+-------+------+----------+----------+ + * DST.ADDR is a string with first byte being the size. So DST.ADDR may not be + * longer then 256 bytes. + */ +#define SOCKS5_CONN_MSG_LEN 262 +static gint +set_connect_msg (guint8 *msg, + const gchar *hostname, + guint16 port, + GError **error) +{ + guint len = 0; + + msg[len++] = SOCKS5_VERSION; + msg[len++] = SOCKS5_CMD_CONNECT; + msg[len++] = SOCKS5_RESERVED; + + if (g_hostname_is_ip_address (hostname)) + { + GInetAddress *addr = g_inet_address_new_from_string (hostname); + gsize addr_len = g_inet_address_get_native_size (addr); + + /* We are cheating for simplicity, here's the logic: + * 1 = IPV4 = 4 bytes / 4 + * 4 = IPV6 = 16 bytes / 4 */ + msg[len++] = addr_len / 4; + memcpy (msg + len, g_inet_address_to_bytes (addr), addr_len); + len += addr_len; + + g_object_unref (addr); + } + else + { + gsize host_len = strlen (hostname); + + if (host_len > SOCKS5_MAX_LEN) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("Hostname '%s' too long for SOCKSv5 protocol " + "(maximum is %i bytes)"), + hostname, SOCKS5_MAX_LEN); + return -1; + } + + msg[len++] = SOCKS5_ATYP_DOMAINNAME; + msg[len++] = (guint8) host_len; + memcpy (msg + len, hostname, host_len); + len += host_len; + } + + { + guint16 hp = g_htons (port); + memcpy (msg + len, &hp, 2); + len += 2; + } + + return len; +} + +/* + * +----+-----+-------+------+----------+----------+ + * |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | + * +----+-----+-------+------+----------+----------+ + * | 1 | 1 | X'00' | 1 | Variable | 2 | + * +----+-----+-------+------+----------+----------+ + * This reply need to be read by small part to determin size. Buffer + * size is determined in function of the biggest part to read. + * + * The parser only requires 4 bytes. + */ +#define SOCKS5_CONN_REP_LEN 255 +static gboolean +parse_connect_reply (const guint8 *data, gint *atype, GError **error) +{ + if (data[0] != SOCKS5_VERSION) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("The server is not a SOCKSv5 proxy server.")); + return FALSE; + } + + switch (data[1]) + { + case SOCKS5_REP_SUCCEEDED: + if (data[2] != SOCKS5_RESERVED) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("The server is not a SOCKSv5 proxy server.")); + return FALSE; + } + + switch (data[3]) + { + case SOCKS5_ATYP_IPV4: + case SOCKS5_ATYP_IPV6: + case SOCKS5_ATYP_DOMAINNAME: + *atype = data[3]; + break; + + default: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("The SOCKSv5 proxy server uses unkown address type.")); + return FALSE; + } + break; + + case SOCKS5_REP_SRV_FAILURE: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("Internal SOCKSv5 proxy server error.")); + return FALSE; + break; + + case SOCKS5_REP_NOT_ALLOWED: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_NOT_ALLOWED, + _("SOCKSv5 connection not allowed by ruleset.")); + return FALSE; + break; + + case SOCKS5_REP_TTL_EXPIRED: + case SOCKS5_REP_HOST_UNREACH: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE, + _("Host unreachable through SOCKSv5 server.")); + return FALSE; + break; + + case SOCKS5_REP_NET_UNREACH: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE, + _("Network unreachable through SOCKSv5 proxy.")); + return FALSE; + break; + + case SOCKS5_REP_REFUSED: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, + _("Connection refused through SOCKSv5 proxy.")); + return FALSE; + break; + + case SOCKS5_REP_CMD_NOT_SUP: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("SOCKSv5 proxy does not support 'connect' command.")); + return FALSE; + break; + + case SOCKS5_REP_ATYPE_NOT_SUP: + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("SOCKSv5 proxy does not support provided address type.")); + return FALSE; + break; + + default: /* Unknown error */ + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, + _("Unkown SOCKSv5 proxy error.")); + return FALSE; + break; + } + + return TRUE; +} + +static GIOStream * +g_socks5_proxy_connect (GProxy *proxy, + GIOStream *io_stream, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GError **error) +{ + gboolean has_auth; + GInputStream *in; + GOutputStream *out; + const gchar *hostname; + guint16 port; + const gchar *username; + const gchar *password; + + hostname = g_proxy_address_get_destination_hostname (proxy_address); + port = g_proxy_address_get_destination_port (proxy_address); + username = g_proxy_address_get_username (proxy_address); + password = g_proxy_address_get_password (proxy_address); + + has_auth = username || password; + + in = g_io_stream_get_input_stream (io_stream); + out = g_io_stream_get_output_stream (io_stream); + + /* Send SOCKS5 handshake */ + { + guint8 msg[SOCKS5_NEGO_MSG_LEN]; + gint len; + + len = set_nego_msg (msg, has_auth); + + if (!g_output_stream_write_all (out, msg, len, NULL, + cancellable, error)) + goto error; + } + + /* Recieve SOCKS5 response and reply with authentication if required */ + { + guint8 data[SOCKS5_NEGO_REP_LEN]; + gboolean must_auth = FALSE; + + if (!g_input_stream_read_all (in, data, sizeof (data), NULL, + cancellable, error)) + goto error; + + if (!parse_nego_reply (data, has_auth, &must_auth, error)) + goto error; + + if (must_auth) + { + guint8 msg[SOCKS5_AUTH_MSG_LEN]; + gint len; + + len = set_auth_msg (msg, username, password, error); + + if (len < 0) + goto error; + + if (!g_output_stream_write_all (out, msg, len, NULL, + cancellable, error)) + goto error; + + if (!g_input_stream_read_all (in, data, sizeof (data), NULL, + cancellable, error)) + goto error; + + if (!check_auth_status (data, error)) + goto error; + } + } + + /* Send SOCKS5 connection request */ + { + guint8 msg[SOCKS5_CONN_MSG_LEN]; + gint len; + + len = set_connect_msg (msg, hostname, port, error); + + if (len < 0) + goto error; + + if (!g_output_stream_write_all (out, msg, len, NULL, + cancellable, error)) + goto error; + } + + /* Read SOCKS5 response */ + { + guint8 data[SOCKS5_CONN_REP_LEN]; + gint atype; + + if (!g_input_stream_read_all (in, data, 4, NULL, + cancellable, error)) + goto error; + + if (!parse_connect_reply (data, &atype, error)) + goto error; + + switch (atype) + { + case SOCKS5_ATYP_IPV4: + if (!g_input_stream_read_all (in, data, 6, NULL, + cancellable, error)) + goto error; + break; + + case SOCKS5_ATYP_IPV6: + if (!g_input_stream_read_all (in, data, 18, NULL, + cancellable, error)) + goto error; + break; + + case SOCKS5_ATYP_DOMAINNAME: + if (!g_input_stream_read_all (in, data, 1, NULL, + cancellable, error)) + goto error; + if (!g_input_stream_read_all (in, data, data[0] + 2, NULL, + cancellable, error)) + goto error; + break; + } + } + + return g_object_ref (io_stream); + +error: + return NULL; +} + + +typedef struct +{ + GSimpleAsyncResult *simple; + GIOStream *io_stream; + gchar *hostname; + guint16 port; + gchar *username; + gchar *password; + guint8 *buffer; + gssize length; + gssize offset; + GCancellable *cancellable; +} ConnectAsyncData; + +static void nego_msg_write_cb (GObject *source, + GAsyncResult *res, + gpointer user_data); +static void nego_reply_read_cb (GObject *source, + GAsyncResult *res, + gpointer user_data); +static void auth_msg_write_cb (GObject *source, + GAsyncResult *res, + gpointer user_data); +static void auth_reply_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); +static void send_connect_msg (ConnectAsyncData *data); +static void connect_msg_write_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); +static void connect_reply_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); +static void connect_addr_len_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); +static void connect_addr_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data); + +static void +free_connect_data (ConnectAsyncData *data) +{ + if (data->io_stream) + g_object_unref (data->io_stream); + + g_free (data->hostname); + g_free (data->username); + g_free (data->password); + g_free (data->buffer); + + if (data->cancellable) + g_object_unref (data->cancellable); + + g_slice_free (ConnectAsyncData, data); +} + +static void +complete_async_from_error (ConnectAsyncData *data, GError *error) +{ + GSimpleAsyncResult *simple = data->simple; + g_simple_async_result_take_error (data->simple, error); + g_simple_async_result_set_op_res_gpointer (simple, NULL, NULL); + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + +static void +do_read (GAsyncReadyCallback callback, ConnectAsyncData *data) +{ + GInputStream *in; + in = g_io_stream_get_input_stream (data->io_stream); + g_input_stream_read_async (in, + data->buffer + data->offset, + data->length - data->offset, + G_PRIORITY_DEFAULT, data->cancellable, + callback, data); +} + +static void +do_write (GAsyncReadyCallback callback, ConnectAsyncData *data) +{ + GOutputStream *out; + out = g_io_stream_get_output_stream (data->io_stream); + g_output_stream_write_async (out, + data->buffer + data->offset, + data->length - data->offset, + G_PRIORITY_DEFAULT, data->cancellable, + callback, data); +} + +static void +g_socks5_proxy_connect_async (GProxy *proxy, + GIOStream *io_stream, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *simple; + ConnectAsyncData *data; + + simple = g_simple_async_result_new (G_OBJECT (proxy), + callback, user_data, + g_socks5_proxy_connect_async); + + data = g_slice_new0 (ConnectAsyncData); + + data->simple = simple; + data->io_stream = g_object_ref (io_stream); + + if (cancellable) + data->cancellable = g_object_ref (cancellable); + + g_object_get (G_OBJECT (proxy_address), + "destination-hostname", &data->hostname, + "destination-port", &data->port, + "username", &data->username, + "password", &data->password, + NULL); + + g_simple_async_result_set_op_res_gpointer (simple, data, + (GDestroyNotify) free_connect_data); + + data->buffer = g_malloc0 (SOCKS5_NEGO_MSG_LEN); + data->length = set_nego_msg (data->buffer, + data->username || data->password); + data->offset = 0; + + do_write (nego_msg_write_cb, data); +} + + +static void +nego_msg_write_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize written; + + written = g_output_stream_write_finish (G_OUTPUT_STREAM (source), + res, &error); + + if (written < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += written; + + if (data->offset == data->length) + { + g_free (data->buffer); + + data->buffer = g_malloc0 (SOCKS5_NEGO_REP_LEN); + data->length = SOCKS5_NEGO_REP_LEN; + data->offset = 0; + + do_read (nego_reply_read_cb, data); + } + else + { + do_write (nego_msg_write_cb, data); + } +} + +static void +nego_reply_read_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize read; + + read = g_input_stream_read_finish (G_INPUT_STREAM (source), + res, &error); + + if (read < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += read; + + if (data->offset == data->length) + { + GError *error; + gboolean must_auth = FALSE; + gboolean has_auth = data->username || data->password; + + if (!parse_nego_reply (data->buffer, has_auth, &must_auth, &error)) + { + complete_async_from_error (data, error); + return; + } + + if (must_auth) + { + g_free (data->buffer); + + data->buffer = g_malloc0 (SOCKS5_AUTH_MSG_LEN); + data->length = set_auth_msg (data->buffer, + data->username, + data->password, + &error); + data->offset = 0; + + if (data->length < 0) + { + complete_async_from_error (data, error); + return; + } + + do_write (auth_msg_write_cb, data); + } + else + { + send_connect_msg (data); + } + } + else + { + do_read (nego_reply_read_cb, data); + } +} + +static void +auth_msg_write_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize written; + + written = g_output_stream_write_finish (G_OUTPUT_STREAM (source), + result, &error); + + if (written < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += written; + + if (data->offset == data->length) + { + g_free (data->buffer); + + data->buffer = g_malloc0 (SOCKS5_NEGO_REP_LEN); + data->length = SOCKS5_NEGO_REP_LEN; + data->offset = 0; + + do_read (auth_reply_read_cb, data); + } + else + { + do_write (auth_msg_write_cb, data); + } +} + +static void +auth_reply_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize read; + + read = g_input_stream_read_finish (G_INPUT_STREAM (source), + result, &error); + + if (read < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += read; + + if (data->offset == data->length) + { + if (!check_auth_status (data->buffer, &error)) + { + complete_async_from_error (data, error); + return; + } + + send_connect_msg (data); + } + else + { + do_read (auth_reply_read_cb, data); + } +} + +static void +send_connect_msg (ConnectAsyncData *data) +{ + GError *error = NULL; + + g_free (data->buffer); + + data->buffer = g_malloc0 (SOCKS5_CONN_MSG_LEN); + data->length = set_connect_msg (data->buffer, + data->hostname, + data->port, + &error); + data->offset = 0; + + if (data->length < 0) + { + complete_async_from_error (data, error); + return; + } + + do_write (connect_msg_write_cb, data); +} + +static void +connect_msg_write_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize written; + + written = g_output_stream_write_finish (G_OUTPUT_STREAM (source), + result, &error); + + if (written < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += written; + + if (data->offset == data->length) + { + g_free (data->buffer); + + data->buffer = g_malloc0 (SOCKS5_CONN_REP_LEN); + data->length = 4; + data->offset = 0; + + do_read (connect_reply_read_cb, data); + } + else + { + do_write (connect_msg_write_cb, data); + } +} + +static void +connect_reply_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize read; + + read = g_input_stream_read_finish (G_INPUT_STREAM (source), + result, &error); + + if (read < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += read; + + if (data->offset == data->length) + { + gint atype; + + if (!parse_connect_reply (data->buffer, &atype, &error)) + { + complete_async_from_error (data, error); + return; + } + + switch (atype) + { + case SOCKS5_ATYP_IPV4: + data->length = 6; + data->offset = 0; + do_read (connect_addr_read_cb, data); + break; + + case SOCKS5_ATYP_IPV6: + data->length = 18; + data->offset = 0; + do_read (connect_addr_read_cb, data); + break; + + case SOCKS5_ATYP_DOMAINNAME: + data->length = 1; + data->offset = 0; + do_read (connect_addr_len_read_cb, data); + break; + } + } + else + { + do_read (connect_reply_read_cb, data); + } +} + +static void +connect_addr_len_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize read; + + read = g_input_stream_read_finish (G_INPUT_STREAM (source), + result, &error); + + if (read < 0) + { + complete_async_from_error (data, error); + return; + } + + data->length = data->buffer[0] + 2; + data->offset = 0; + + do_read (connect_addr_read_cb, data); +} + +static void +connect_addr_read_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + ConnectAsyncData *data = user_data; + gssize read; + + read = g_input_stream_read_finish (G_INPUT_STREAM (source), + result, &error); + + if (read < 0) + { + complete_async_from_error (data, error); + return; + } + + data->offset += read; + + if (data->offset == data->length) + { + GSimpleAsyncResult *simple = data->simple; + g_simple_async_result_complete (simple); + g_object_unref (simple); + } + else + { + do_read (connect_reply_read_cb, data); + } +} + +static GIOStream * +g_socks5_proxy_connect_finish (GProxy *proxy, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); + ConnectAsyncData *data = g_simple_async_result_get_op_res_gpointer (simple); + + if (g_simple_async_result_propagate_error (simple, error)) + return NULL; + + return g_object_ref (data->io_stream); +} + +static gboolean +g_socks5_proxy_supports_hostname (GProxy *proxy) +{ + return TRUE; +} + +static void +g_socks5_proxy_class_init (GSocks5ProxyClass *class) +{ + GObjectClass *object_class; + + object_class = (GObjectClass *) class; + object_class->finalize = g_socks5_proxy_finalize; +} + +static void +g_socks5_proxy_iface_init (GProxyInterface *proxy_iface) +{ + proxy_iface->connect = g_socks5_proxy_connect; + proxy_iface->connect_async = g_socks5_proxy_connect_async; + proxy_iface->connect_finish = g_socks5_proxy_connect_finish; + proxy_iface->supports_hostname = g_socks5_proxy_supports_hostname; +} diff --git a/gio/gsocks5proxy.h b/gio/gsocks5proxy.h new file mode 100644 index 0000000..c55d603 --- /dev/null +++ b/gio/gsocks5proxy.h @@ -0,0 +1,48 @@ + /* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2008, 2010 Collabora, Ltd. + * Copyright (C) 2008 Nokia Corporation. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Youness Alaoui + */ + +#ifndef __G_SOCKS5_PROXY_H__ +#define __G_SOCKS5_PROXY_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_SOCKS5_PROXY (_g_socks5_proxy_get_type ()) +#define G_SOCKS5_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SOCKS5_PROXY, GSocks5Proxy)) +#define G_SOCKS5_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SOCKS5_PROXY, GSocks5ProxyClass)) +#define G_IS_SOCKS5_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SOCKS5_PROXY)) +#define G_IS_SOCKS5_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SOCKS5_PROXY)) +#define G_SOCKS5_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SOCKS5_PROXY, GSocks5ProxyClass)) + +typedef struct _GSocks5Proxy GSocks5Proxy; +typedef struct _GSocks5ProxyClass GSocks5ProxyClass; + +GType _g_socks5_proxy_get_type (void); + +G_END_DECLS + +#endif /* __SOCKS5_PROXY_H__ */ diff --git a/gio/gsrvtarget.c b/gio/gsrvtarget.c index 526b0dd..21c0575 100644 --- a/gio/gsrvtarget.c +++ b/gio/gsrvtarget.c @@ -29,7 +29,6 @@ #include #include -#include "gioalias.h" /** * SECTION:gsrvtarget @@ -66,21 +65,8 @@ struct _GSrvTarget { * A single target host/port that a network service is running on. */ -GType -g_srv_target_get_type (void) -{ - static volatile gsize type_volatile = 0; - - if (g_once_init_enter (&type_volatile)) - { - GType type = g_boxed_type_register_static ( - g_intern_static_string ("GSrvTarget"), - (GBoxedCopyFunc) g_srv_target_copy, - (GBoxedFreeFunc) g_srv_target_free); - g_once_init_leave (&type_volatile, type); - } - return type_volatile; -} +G_DEFINE_BOXED_TYPE (GSrvTarget, g_srv_target, + g_srv_target_copy, g_srv_target_free) /** * g_srv_target_new: @@ -236,12 +222,12 @@ compare_target (gconstpointer a, gconstpointer b) } /** - * g_srv_target_list_sort: + * g_srv_target_list_sort: (skip) * @targets: a #GList of #GSrvTarget * * Sorts @targets in place according to the algorithm in RFC 2782. * - * Return value: the head of the sorted list. + * Return value: (transfer full): the head of the sorted list. * * Since: 2.22 */ @@ -326,6 +312,3 @@ g_srv_target_list_sort (GList *targets) return out; } - -#define __G_SRV_TARGET_C__ -#include "gioaliasdef.c" diff --git a/gio/gtcpconnection.c b/gio/gtcpconnection.c index 59f9c1b..f667862 100644 --- a/gio/gtcpconnection.c +++ b/gio/gtcpconnection.c @@ -13,17 +13,12 @@ /** * SECTION: gtcpconnection * @title: GTcpConnection - * @short_description: a TCP #GSocketConnection + * @short_description: A TCP GSocketConnection * @see_also: #GSocketConnection. * * This is the subclass of #GSocketConnection that is created * for TCP/IP sockets. * - * It is currently empty; it offers no additional functionality - * over its base class. - * - * Eventually, some TCP-specific socket stuff will be added. - * * Since: 2.22 */ @@ -34,7 +29,6 @@ #include "giostream.h" #include "glibintl.h" -#include "gioalias.h" G_DEFINE_TYPE_WITH_CODE (GTcpConnection, g_tcp_connection, G_TYPE_SOCKET_CONNECTION, @@ -216,7 +210,7 @@ close_async_data_free (CloseAsyncData *data) static void async_close_finish (CloseAsyncData *data, - GError *error, + GError *error /* consumed */, gboolean in_mainloop) { GIOStreamClass *parent = G_IO_STREAM_CLASS (g_tcp_connection_parent_class); @@ -229,17 +223,14 @@ async_close_finish (CloseAsyncData *data, if (error) { parent->close_fn (stream, data->cancellable, NULL); - g_simple_async_result_set_from_error (data->res, error); + g_simple_async_result_take_error (data->res, error); } else { my_error = NULL; parent->close_fn (stream, data->cancellable, &my_error); if (my_error) - { - g_simple_async_result_set_from_error (data->res, my_error); - g_error_free (my_error); - } + g_simple_async_result_take_error (data->res, my_error); } if (in_mainloop) @@ -266,7 +257,6 @@ close_read_ready (GSocket *socket, else { async_close_finish (data, error, TRUE); - g_error_free (error); return FALSE; } } @@ -312,7 +302,6 @@ g_tcp_connection_close_async (GIOStream *stream, if (!g_socket_shutdown (socket, FALSE, TRUE, &error)) { async_close_finish (data, error, FALSE); - g_error_free (error); close_async_data_free (data); return; } @@ -376,7 +365,3 @@ g_tcp_connection_get_graceful_disconnect (GTcpConnection *connection) { return connection->priv->graceful_disconnect; } - - -#define __G_TCP_CONNECTION_C__ -#include "gioaliasdef.c" diff --git a/gio/gtcpwrapperconnection.c b/gio/gtcpwrapperconnection.c new file mode 100644 index 0000000..7c2ff15 --- /dev/null +++ b/gio/gtcpwrapperconnection.c @@ -0,0 +1,199 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright © 2010 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Nicolas Dufresne + */ + +/** + * SECTION: gtcpwrapperconnection + * @title: GTcpWrapperConnection + * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams + * @see_also: #GSocketConnection. + * + * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is + * based on a #GSocket, but which is not actually a + * #GSocketConnection. This is used by #GSocketClient so that it can + * always return a #GSocketConnection, even when the connection it has + * actually created is not directly a #GSocketConnection. + * + * Since: 2.28 + */ + +#include "config.h" + +#include "gtcpwrapperconnection.h" + +#include "gtcpconnection.h" +#include "glibintl.h" + +G_DEFINE_TYPE (GTcpWrapperConnection, + g_tcp_wrapper_connection, G_TYPE_TCP_CONNECTION); + +enum +{ + PROP_NONE, + PROP_BASE_IO_STREAM +}; + +struct _GTcpWrapperConnectionPrivate +{ + GIOStream *base_io_stream; +}; + +static GInputStream * +g_tcp_wrapper_connection_get_input_stream (GIOStream *io_stream) +{ + GTcpWrapperConnection *connection = G_TCP_WRAPPER_CONNECTION (io_stream); + + return g_io_stream_get_input_stream (connection->priv->base_io_stream); +} + +static GOutputStream * +g_tcp_wrapper_connection_get_output_stream (GIOStream *io_stream) +{ + GTcpWrapperConnection *connection = G_TCP_WRAPPER_CONNECTION (io_stream); + + return g_io_stream_get_output_stream (connection->priv->base_io_stream); +} + +static void +g_tcp_wrapper_connection_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GTcpWrapperConnection *connection = G_TCP_WRAPPER_CONNECTION (object); + + switch (prop_id) + { + case PROP_BASE_IO_STREAM: + g_value_set_object (value, connection->priv->base_io_stream); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_tcp_wrapper_connection_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GTcpWrapperConnection *connection = G_TCP_WRAPPER_CONNECTION (object); + + switch (prop_id) + { + case PROP_BASE_IO_STREAM: + connection->priv->base_io_stream = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_tcp_wrapper_connection_finalize (GObject *object) +{ + GTcpWrapperConnection *connection = G_TCP_WRAPPER_CONNECTION (object); + + if (connection->priv->base_io_stream) + g_object_unref (connection->priv->base_io_stream); + + G_OBJECT_CLASS (g_tcp_wrapper_connection_parent_class)->finalize (object); +} + +static void +g_tcp_wrapper_connection_class_init (GTcpWrapperConnectionClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GIOStreamClass *stream_class = G_IO_STREAM_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GTcpWrapperConnectionPrivate)); + + gobject_class->set_property = g_tcp_wrapper_connection_set_property; + gobject_class->get_property = g_tcp_wrapper_connection_get_property; + gobject_class->finalize = g_tcp_wrapper_connection_finalize; + + stream_class->get_input_stream = g_tcp_wrapper_connection_get_input_stream; + stream_class->get_output_stream = g_tcp_wrapper_connection_get_output_stream; + + g_object_class_install_property (gobject_class, + PROP_BASE_IO_STREAM, + g_param_spec_object ("base-io-stream", + P_("Base IO Stream"), + P_("The wrapped GIOStream"), + G_TYPE_IO_STREAM, + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); +} + +static void +g_tcp_wrapper_connection_init (GTcpWrapperConnection *connection) +{ + connection->priv = G_TYPE_INSTANCE_GET_PRIVATE (connection, + G_TYPE_TCP_WRAPPER_CONNECTION, + GTcpWrapperConnectionPrivate); +} + +/** + * g_tcp_wrapper_connection_new: + * @base_io_stream: the #GIOStream to wrap + * @socket: the #GSocket associated with @base_io_stream + * + * Wraps @base_io_stream and @socket together as a #GSocketConnection. + * + * Return value: the new #GSocketConnection. + * + * Since: 2.28 + */ +GSocketConnection * +g_tcp_wrapper_connection_new (GIOStream *base_io_stream, + GSocket *socket) +{ + g_return_val_if_fail (G_IS_IO_STREAM (base_io_stream), NULL); + g_return_val_if_fail (G_IS_SOCKET (socket), NULL); + g_return_val_if_fail (g_socket_get_family (socket) == G_SOCKET_FAMILY_IPV4 || + g_socket_get_family (socket) == G_SOCKET_FAMILY_IPV6, NULL); + g_return_val_if_fail (g_socket_get_socket_type (socket) == G_SOCKET_TYPE_STREAM, NULL); + + return g_object_new (G_TYPE_TCP_WRAPPER_CONNECTION, + "base-io-stream", base_io_stream, + "socket", socket, + NULL); +} + +/** + * g_tcp_wrapper_connection_get_base_io_stream: + * @conn: a #GTcpWrapperConnection + * + * Get's @conn's base #GIOStream + * + * Return value: (transfer none): @conn's base #GIOStream + */ +GIOStream * +g_tcp_wrapper_connection_get_base_io_stream (GTcpWrapperConnection *conn) +{ + g_return_val_if_fail (G_IS_TCP_WRAPPER_CONNECTION (conn), NULL); + + return conn->priv->base_io_stream; +} diff --git a/gio/gtcpwrapperconnection.h b/gio/gtcpwrapperconnection.h new file mode 100644 index 0000000..01d3a03 --- /dev/null +++ b/gio/gtcpwrapperconnection.h @@ -0,0 +1,68 @@ +/* GIO - GLib Input, Output and Streaming Library + * Copyright © 2010 Collabora Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Nicolas Dufresne + * + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_TCP_WRAPPER_CONNECTION_H__ +#define __G_TCP_WRAPPER_CONNECTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_TCP_WRAPPER_CONNECTION (g_tcp_wrapper_connection_get_type ()) +#define G_TCP_WRAPPER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ + G_TYPE_TCP_WRAPPER_CONNECTION, GTcpWrapperConnection)) +#define G_TCP_WRAPPER_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \ + G_TYPE_TCP_WRAPPER_CONNECTION, GTcpWrapperConnectionClass)) +#define G_IS_TCP_WRAPPER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ + G_TYPE_TCP_WRAPPER_CONNECTION)) +#define G_IS_TCP_WRAPPER_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \ + G_TYPE_TCP_WRAPPER_CONNECTION)) +#define G_TCP_WRAPPER_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \ + G_TYPE_TCP_WRAPPER_CONNECTION, GTcpWrapperConnectionClass)) + +typedef struct _GTcpWrapperConnectionPrivate GTcpWrapperConnectionPrivate; +typedef struct _GTcpWrapperConnectionClass GTcpWrapperConnectionClass; + +struct _GTcpWrapperConnectionClass +{ + GTcpConnectionClass parent_class; +}; + +struct _GTcpWrapperConnection +{ + GTcpConnection parent_instance; + GTcpWrapperConnectionPrivate *priv; +}; + +GType g_tcp_wrapper_connection_get_type (void) G_GNUC_CONST; + +GSocketConnection *g_tcp_wrapper_connection_new (GIOStream *base_io_stream, + GSocket *socket); +GIOStream *g_tcp_wrapper_connection_get_base_io_stream (GTcpWrapperConnection *conn); + +G_END_DECLS + +#endif /* __G_TCP_WRAPPER_CONNECTION_H__ */ diff --git a/gio/gthemedicon.c b/gio/gthemedicon.c index 7b6f193..f6cde15 100644 --- a/gio/gthemedicon.c +++ b/gio/gthemedicon.c @@ -29,7 +29,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gthemedicon @@ -264,7 +263,7 @@ g_themed_icon_init (GThemedIcon *themed) * * Creates a new themed icon for @iconname. * - * Returns: a new #GThemedIcon. + * Returns: (transfer full): a new #GThemedIcon. **/ GIcon * g_themed_icon_new (const char *iconname) @@ -282,7 +281,7 @@ g_themed_icon_new (const char *iconname) * * Creates a new themed icon for @iconnames. * - * Returns: a new #GThemedIcon + * Returns: (transfer full): a new #GThemedIcon **/ GIcon * g_themed_icon_new_from_names (char **iconnames, @@ -334,7 +333,7 @@ g_themed_icon_new_from_names (char **iconnames, * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio"); * ]| * - * Returns: a new #GThemedIcon. + * Returns: (transfer full): a new #GThemedIcon. */ GIcon * g_themed_icon_new_with_default_fallbacks (const char *iconname) @@ -351,7 +350,7 @@ g_themed_icon_new_with_default_fallbacks (const char *iconname) * * Gets the names of icons from within @icon. * - * Returns: a list of icon names. + * Returns: (transfer none): a list of icon names. */ const char * const * g_themed_icon_get_names (GThemedIcon *icon) @@ -521,6 +520,3 @@ g_themed_icon_icon_iface_init (GIconIface *iface) iface->to_tokens = g_themed_icon_to_tokens; iface->from_tokens = g_themed_icon_from_tokens; } - -#define __G_THEMED_ICON_C__ -#include "gioaliasdef.c" diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c index bd7a829..8c98f47 100644 --- a/gio/gthreadedresolver.c +++ b/gio/gthreadedresolver.c @@ -34,7 +34,6 @@ #include "gsimpleasyncresult.h" #include "gsocketaddress.h" -#include "gioalias.h" G_DEFINE_TYPE (GThreadedResolver, g_threaded_resolver, G_TYPE_RESOLVER) @@ -615,6 +614,3 @@ g_threaded_resolver_class_init (GThreadedResolverClass *threaded_class) object_class->finalize = finalize; } - -#define __G_THREADED_RESOLVER_C__ -#include "gioaliasdef.c" diff --git a/gio/gthreadedsocketservice.c b/gio/gthreadedsocketservice.c index 57ca737..83b75fe 100644 --- a/gio/gthreadedsocketservice.c +++ b/gio/gthreadedsocketservice.c @@ -52,7 +52,6 @@ #include "gio-marshal.h" -#include "gioalias.h" static guint g_threaded_socket_service_run_signal; @@ -273,6 +272,3 @@ g_threaded_socket_service_new (int max_threads) "max-threads", max_threads, NULL); } - -#define __G_THREADED_SOCKET_SERVICE_C__ -#include "gioaliasdef.c" diff --git a/gio/gtlsbackend.c b/gio/gtlsbackend.c new file mode 100644 index 0000000..64a9794 --- /dev/null +++ b/gio/gtlsbackend.c @@ -0,0 +1,201 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright © 2010 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "glib.h" + +#include "gtlsbackend.h" +#include "gdummytlsbackend.h" +#include "gioenumtypes.h" +#include "giomodule-priv.h" + +/** + * SECTION:gtls + * @title: TLS Overview + * @short_description: TLS (aka SSL) support for GSocketConnection + * @include: gio/gio.h + * + * #GTlsConnection and related classes provide TLS (Transport Layer + * Security, previously known as SSL, Secure Sockets Layer) support for + * gio-based network streams. + * + * In the simplest case, for a client connection, you can just set the + * #GSocketClient:tls flag on a #GSocketClient, and then any + * connections created by that client will have TLS negotiated + * automatically, using appropriate default settings, and rejecting + * any invalid or self-signed certificates (unless you change that + * default by setting the #GSocketClient:tls-validation-flags + * property). The returned object will be a #GTcpWrapperConnection, + * which wraps the underlying #GTlsClientConnection. + * + * For greater control, you can create your own #GTlsClientConnection, + * wrapping a #GSocketConnection (or an arbitrary #GIOStream with + * pollable input and output streams) and then connect to its signals, + * such as #GTlsConnection::accept-certificate, before starting the + * handshake. + * + * Server-side TLS is similar, using #GTlsServerConnection. At the + * moment, there is no support for automatically wrapping server-side + * connections in the way #GSocketClient does for client-side + * connections. + */ + +/** + * SECTION:gtlsbackend + * @title: GTlsBackend + * @short_description: TLS backend implementation + * @include: gio/gio.h + */ + +/** + * GTlsBackend: + * + * Type implemented by TLS #GIOModules to provide access to additional + * TLS-related types. + * + * Since: 2.28 + */ + +G_DEFINE_INTERFACE (GTlsBackend, g_tls_backend, G_TYPE_OBJECT); + +static void +g_tls_backend_default_init (GTlsBackendInterface *iface) +{ +} + +static gpointer +get_default_tls_backend (gpointer arg) +{ + const char *use_this; + GList *extensions; + GIOExtensionPoint *ep; + GIOExtension *extension; + + _g_io_modules_ensure_loaded (); + + ep = g_io_extension_point_lookup (G_TLS_BACKEND_EXTENSION_POINT_NAME); + + use_this = g_getenv ("GIO_USE_TLS"); + if (use_this) + { + extension = g_io_extension_point_get_extension_by_name (ep, use_this); + if (extension) + return g_object_new (g_io_extension_get_type (extension), NULL); + } + + extensions = g_io_extension_point_get_extensions (ep); + if (extensions) + { + extension = extensions->data; + return g_object_new (g_io_extension_get_type (extension), NULL); + } + + return NULL; +} + +/** + * g_tls_backend_get_default: + * + * Gets the default #GTlsBackend for the system. + * + * Returns: a #GTlsBackend + * + * Since: 2.28 + */ +GTlsBackend * +g_tls_backend_get_default (void) +{ + static GOnce once_init = G_ONCE_INIT; + + return g_once (&once_init, get_default_tls_backend, NULL); +} + +/** + * g_tls_backend_supports_tls: + * @backend: the #GTlsBackend + * + * Checks if TLS is supported; if this returns %FALSE for the default + * #GTlsBackend, it means no "real" TLS backend is available. + * + * Return value: whether or not TLS is supported + * + * Since: 2.28 + */ +gboolean +g_tls_backend_supports_tls (GTlsBackend *backend) +{ + if (G_TLS_BACKEND_GET_INTERFACE (backend)->supports_tls) + return G_TLS_BACKEND_GET_INTERFACE (backend)->supports_tls (backend); + else if (G_IS_DUMMY_TLS_BACKEND (backend)) + return FALSE; + else + return TRUE; +} + +/** + * g_tls_backend_get_certificate_type: + * @backend: the #GTlsBackend + * + * Gets the #GType of @backend's #GTlsCertificate implementation. + * + * Return value: the #GType of @backend's #GTlsCertificate + * implementation. + * + * Since: 2.28 + */ +GType +g_tls_backend_get_certificate_type (GTlsBackend *backend) +{ + return G_TLS_BACKEND_GET_INTERFACE (backend)->get_certificate_type (); +} + +/** + * g_tls_backend_get_client_connection_type: + * @backend: the #GTlsBackend + * + * Gets the #GType of @backend's #GTlsClientConnection implementation. + * + * Return value: the #GType of @backend's #GTlsClientConnection + * implementation. + * + * Since: 2.28 + */ +GType +g_tls_backend_get_client_connection_type (GTlsBackend *backend) +{ + return G_TLS_BACKEND_GET_INTERFACE (backend)->get_client_connection_type (); +} + +/** + * g_tls_backend_get_server_connection_type: + * @backend: the #GTlsBackend + * + * Gets the #GType of @backend's #GTlsServerConnection implementation. + * + * Return value: the #GType of @backend's #GTlsServerConnection + * implementation. + * + * Since: 2.28 + */ +GType +g_tls_backend_get_server_connection_type (GTlsBackend *backend) +{ + return G_TLS_BACKEND_GET_INTERFACE (backend)->get_server_connection_type (); +} diff --git a/gio/gtlsbackend.h b/gio/gtlsbackend.h new file mode 100644 index 0000000..24ae911 --- /dev/null +++ b/gio/gtlsbackend.h @@ -0,0 +1,92 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_TLS_BACKEND_H__ +#define __G_TLS_BACKEND_H__ + +#include + +G_BEGIN_DECLS + +/** + * G_TLS_BACKEND_EXTENSION_POINT_NAME: + * + * Extension point for TLS functionality via #GTlsBackend. + * See Extending GIO. + */ +#define G_TLS_BACKEND_EXTENSION_POINT_NAME "gio-tls-backend" + +#define G_TYPE_TLS_BACKEND (g_tls_backend_get_type ()) +#define G_TLS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_TLS_BACKEND, GTlsBackend)) +#define G_IS_TLS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_TLS_BACKEND)) +#define G_TLS_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_TLS_BACKEND, GTlsBackendInterface)) + +/** + * GTlsBackend: + * + * TLS (Transport Layer Security, aka SSL) backend. This is an + * internal type used to coordinate the different classes implemented + * by a TLS backend. + * + * Since: 2.28 + */ + +typedef struct _GTlsBackend GTlsBackend; +typedef struct _GTlsBackendInterface GTlsBackendInterface; + +/** + * GTlsBackendInterface: + * @g_iface: The parent interface. + * @get_certificate_type: returns the #GTlsCertificate implementation type + * @get_client_connection_type: returns the #GTlsClientConnection implementation type + * @get_server_connection_type: returns the #GTlsServerConnection implementation type + * + * Provides an interface for describing TLS-related types. + * + * Since: 2.28 + */ +struct _GTlsBackendInterface +{ + GTypeInterface g_iface; + + /* methods */ + gboolean ( *supports_tls) (GTlsBackend *backend); + GType ( *get_certificate_type) (void); + GType ( *get_client_connection_type) (void); + GType ( *get_server_connection_type) (void); +}; + +GType g_tls_backend_get_type (void) G_GNUC_CONST; + +GTlsBackend *g_tls_backend_get_default (void); + +gboolean g_tls_backend_supports_tls (GTlsBackend *backend); + +GType g_tls_backend_get_certificate_type (GTlsBackend *backend); +GType g_tls_backend_get_client_connection_type (GTlsBackend *backend); +GType g_tls_backend_get_server_connection_type (GTlsBackend *backend); + +G_END_DECLS + +#endif /* __G_TLS_BACKEND_H__ */ diff --git a/gio/gtlscertificate.c b/gio/gtlscertificate.c new file mode 100644 index 0000000..8e0067c --- /dev/null +++ b/gio/gtlscertificate.c @@ -0,0 +1,488 @@ +/* GIO - GLib Input, Output and Certificateing Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gtlscertificate.h" + +#include +#include "ginitable.h" +#include "gtlsbackend.h" +#include "gtlsconnection.h" +#include "glibintl.h" + +/** + * SECTION: gtlscertificate + * @title: GTlsCertificate + * @short_description: TLS certificate + * @see_also: #GTlsConnection + * + * A certificate used for TLS authentication and encryption. + * This can represent either a public key only (eg, the certificate + * received by a client from a server), or the combination of + * a public key and a private key (which is needed when acting as a + * #GTlsServerConnection). + * + * Since: 2.28 + */ + +/** + * GTlsCertificate: + * + * Abstract base class for TLS certificate types. + * + * Since: 2.28 + */ + +G_DEFINE_ABSTRACT_TYPE (GTlsCertificate, g_tls_certificate, G_TYPE_OBJECT); + +enum +{ + PROP_0, + + PROP_CERTIFICATE, + PROP_CERTIFICATE_PEM, + PROP_PRIVATE_KEY, + PROP_PRIVATE_KEY_PEM, + PROP_ISSUER +}; + +static void +g_tls_certificate_init (GTlsCertificate *cert) +{ +} + +static void +g_tls_certificate_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); +} + +static void +g_tls_certificate_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); +} + +static void +g_tls_certificate_class_init (GTlsCertificateClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + + gobject_class->set_property = g_tls_certificate_set_property; + gobject_class->get_property = g_tls_certificate_get_property; + + /** + * GTlsCertificate:certificate: + * + * The DER (binary) encoded representation of the certificate's + * public key. This property and the + * #GTlsCertificate:certificate-pem property represent the same + * data, just in different forms. + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_CERTIFICATE, + g_param_spec_boxed ("certificate", + P_("Certificate"), + P_("The DER representation of the certificate"), + G_TYPE_BYTE_ARRAY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsCertificate:certificate-pem: + * + * The PEM (ASCII) encoded representation of the certificate's + * public key. This property and the #GTlsCertificate:certificate + * property represent the same data, just in different forms. + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_CERTIFICATE_PEM, + g_param_spec_string ("certificate-pem", + P_("Certificate (PEM)"), + P_("The PEM representation of the certificate"), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsCertificate:private-key: + * + * The DER (binary) encoded representation of the certificate's + * private key. This property (or the + * #GTlsCertificate:private-key-pem property) can be set when + * constructing a key (eg, from a file), but cannot be read. + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_PRIVATE_KEY, + g_param_spec_boxed ("private-key", + P_("Private key"), + P_("The DER representation of the certificate's private key"), + G_TYPE_BYTE_ARRAY, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsCertificate:private-key-pem: + * + * The PEM (ASCII) encoded representation of the certificate's + * private key. This property (or the #GTlsCertificate:private-key + * property) can be set when constructing a key (eg, from a file), + * but cannot be read. + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_PRIVATE_KEY_PEM, + g_param_spec_string ("private-key-pem", + P_("Private key (PEM)"), + P_("The PEM representation of the certificate's private key"), + NULL, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsCertificate:issuer: + * + * A #GTlsCertificate representing the entity that issued this + * certificate. If %NULL, this means that the certificate is either + * self-signed, or else the certificate of the issuer is not + * available. + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_ISSUER, + g_param_spec_object ("issuer", + P_("Issuer"), + P_("The certificate for the issuing entity"), + G_TYPE_TLS_CERTIFICATE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +} + +static GTlsCertificate * +g_tls_certificate_new_internal (const gchar *certificate_pem, + const gchar *private_key_pem, + GError **error) +{ + GObject *cert; + GTlsBackend *backend; + + backend = g_tls_backend_get_default (); + + cert = g_initable_new (g_tls_backend_get_certificate_type (backend), + NULL, error, + "certificate-pem", certificate_pem, + "private-key-pem", private_key_pem, + NULL); + return G_TLS_CERTIFICATE (cert); +} + +#define PEM_CERTIFICATE_HEADER "-----BEGIN CERTIFICATE-----" +#define PEM_CERTIFICATE_FOOTER "-----END CERTIFICATE-----" +#define PEM_PRIVKEY_HEADER "-----BEGIN RSA PRIVATE KEY-----" +#define PEM_PRIVKEY_FOOTER "-----END RSA PRIVATE KEY-----" + +static GTlsCertificate * +parse_next_pem_certificate (const gchar **data, + const gchar *data_end, + gboolean required, + GError **error) +{ + const gchar *start, *end, *next; + gchar *cert_pem, *privkey_pem = NULL; + GTlsCertificate *cert; + + start = g_strstr_len (*data, data_end - *data, PEM_CERTIFICATE_HEADER); + if (!start) + { + if (required) + { + g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE, + _("No PEM-encoded certificate found")); + } + return NULL; + } + + end = g_strstr_len (start, data_end - start, PEM_CERTIFICATE_FOOTER); + if (!end) + { + g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE, + _("Could not parse PEM-encoded certificate")); + return NULL; + } + end += strlen (PEM_CERTIFICATE_FOOTER); + while (*end == '\r' || *end == '\n') + end++; + + cert_pem = g_strndup (start, end - start); + + *data = end; + + next = g_strstr_len (*data, data_end - *data, PEM_CERTIFICATE_HEADER); + start = g_strstr_len (*data, data_end - *data, PEM_PRIVKEY_HEADER); + if (start) + end = g_strstr_len (start, data_end - start, PEM_PRIVKEY_FOOTER); + + if (start && (!next || start < next)) + { + if (!end || (next && end > next)) + { + g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE, + _("Could not parse PEM-encoded private key")); + return NULL; + } + + end += strlen (PEM_PRIVKEY_FOOTER); + while (*end == '\r' || *end == '\n') + end++; + + privkey_pem = g_strndup (start, end - start); + + *data = end + strlen (PEM_PRIVKEY_FOOTER); + } + + cert = g_tls_certificate_new_internal (cert_pem, privkey_pem, error); + g_free (cert_pem); + g_free (privkey_pem); + + return cert; +} + +/** + * g_tls_certificate_new_from_pem: + * @data: PEM-encoded certificate data + * @length: the length of @data, or -1 if it's 0-terminated. + * @error: #GError for error reporting, or %NULL to ignore. + * + * Creates a new #GTlsCertificate from the PEM-encoded data in @data. + * If @data includes both a certificate and a private key, then the + * returned certificate will include the private key data as well. + * + * If @data includes multiple certificates, only the first one will be + * parsed. + * + * Return value: the new certificate, or %NULL if @data is invalid + * + * Since: 2.28 + */ +GTlsCertificate * +g_tls_certificate_new_from_pem (const gchar *data, + gssize length, + GError **error) +{ + const gchar *data_end; + + g_return_val_if_fail (data != NULL, NULL); + + if (length == -1) + data_end = data + strlen (data); + else + data_end = data + length; + return parse_next_pem_certificate (&data, data_end, TRUE, error); +} + +/** + * g_tls_certificate_new_from_file: + * @file: file containing a PEM-encoded certificate to import + * @error: #GError for error reporting, or %NULL to ignore. + * + * Creates a #GTlsCertificate from the PEM-encoded data in @file. If + * @file cannot be read or parsed, the function will return %NULL and + * set @error. Otherwise, this behaves like g_tls_certificate_new(). + * + * Return value: the new certificate, or %NULL on error + * + * Since: 2.28 + */ +GTlsCertificate * +g_tls_certificate_new_from_file (const gchar *file, + GError **error) +{ + GTlsCertificate *cert; + gchar *contents; + gsize length; + + if (!g_file_get_contents (file, &contents, &length, error)) + return NULL; + + cert = g_tls_certificate_new_from_pem (contents, length, error); + g_free (contents); + return cert; +} + +/** + * g_tls_certificate_new_from_files: + * @cert_file: file containing a PEM-encoded certificate to import + * @key_file: file containing a PEM-encoded private key to import + * @error: #GError for error reporting, or %NULL to ignore. + * + * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file + * and @key_file. If either file cannot be read or parsed, the + * function will return %NULL and set @error. Otherwise, this behaves + * like g_tls_certificate_new(). + * + * Return value: the new certificate, or %NULL on error + * + * Since: 2.28 + */ +GTlsCertificate * +g_tls_certificate_new_from_files (const gchar *cert_file, + const gchar *key_file, + GError **error) +{ + GTlsCertificate *cert; + gchar *cert_data, *key_data; + + if (!g_file_get_contents (cert_file, &cert_data, NULL, error)) + return NULL; + if (!g_file_get_contents (key_file, &key_data, NULL, error)) + { + g_free (cert_data); + return NULL; + } + + cert = g_tls_certificate_new_internal (cert_data, key_data, error); + g_free (cert_data); + g_free (key_data); + return cert; +} + +/** + * g_tls_certificate_list_new_from_file: + * @file: file containing PEM-encoded certificates to import + * @error: #GError for error reporting, or %NULL to ignore. + * + * Creates one or more #GTlsCertificates from the PEM-encoded + * data in @file. If @file cannot be read or parsed, the function will + * return %NULL and set @error. If @file does not contain any + * PEM-encoded certificates, this will return an empty list and not + * set @error. + * + * Return value: (element-type Gio.TlsCertificate) (transfer full): a + * #GList containing #GTlsCertificate objects. You must free the list + * and its contents when you are done with it. + * + * Since: 2.28 + */ +GList * +g_tls_certificate_list_new_from_file (const gchar *file, + GError **error) +{ + GTlsCertificate *cert; + GList *list, *l; + gchar *contents, *end; + const gchar *p; + gsize length; + + if (!g_file_get_contents (file, &contents, &length, error)) + return NULL; + + list = NULL; + end = contents + length; + p = contents; + while (p && *p) + { + cert = parse_next_pem_certificate (&p, end, FALSE, error); + if (!cert) + { + for (l = list; l; l = l->next) + g_object_unref (l->data); + g_list_free (list); + list = NULL; + break; + } + list = g_list_prepend (list, cert); + } + + return g_list_reverse (list); +} + + +/** + * g_tls_certificate_get_issuer: + * @cert: a #GTlsCertificate + * + * Gets the #GTlsCertificate representing @cert's issuer, if known + * + * Return value: (transfer none): The certificate of @cert's issuer, + * or %NULL if @cert is self-signed or signed with an unknown + * certificate. + * + * Since: 2.28 + */ +GTlsCertificate * +g_tls_certificate_get_issuer (GTlsCertificate *cert) +{ + GTlsCertificate *issuer; + + g_object_get (G_OBJECT (cert), "issuer", &issuer, NULL); + if (issuer) + g_object_unref (issuer); + + return issuer; +} + +/** + * g_tls_certificate_verify: + * @cert: a #GTlsCertificate + * @identity: (allow-none): the expected peer identity + * @trusted_ca: (allow-none): the certificate of a trusted authority + * + * This verifies @cert and returns a set of #GTlsCertificateFlags + * indicating any problems found with it. This can be used to verify a + * certificate outside the context of making a connection, or to + * check a certificate against a CA that is not part of the system + * CA database. + * + * If @identity is not %NULL, @cert's name(s) will be compared against + * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return + * value if it does not match. If @identity is %NULL, that bit will + * never be set in the return value. + * + * If @trusted_ca is not %NULL, then @cert (or one of the certificates + * in its chain) must be signed by it, or else + * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If + * @trusted_ca is %NULL, that bit will never be set in the return + * value. + * + * (All other #GTlsCertificateFlags values will always be set or unset + * as appropriate.) + * + * Return value: the appropriate #GTlsCertificateFlags + * + * Since: 2.28 + */ +GTlsCertificateFlags +g_tls_certificate_verify (GTlsCertificate *cert, + GSocketConnectable *identity, + GTlsCertificate *trusted_ca) +{ + return G_TLS_CERTIFICATE_GET_CLASS (cert)->verify (cert, identity, trusted_ca); +} diff --git a/gio/gtlscertificate.h b/gio/gtlscertificate.h new file mode 100644 index 0000000..40cabf9 --- /dev/null +++ b/gio/gtlscertificate.h @@ -0,0 +1,83 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_TLS_CERTIFICATE_H__ +#define __G_TLS_CERTIFICATE_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_TLS_CERTIFICATE (g_tls_certificate_get_type ()) +#define G_TLS_CERTIFICATE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CERTIFICATE, GTlsCertificate)) +#define G_TLS_CERTIFICATE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CERTIFICATE, GTlsCertificateClass)) +#define G_IS_TLS_CERTIFICATE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CERTIFICATE)) +#define G_IS_TLS_CERTIFICATE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CERTIFICATE)) +#define G_TLS_CERTIFICATE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CERTIFICATE, GTlsCertificateClass)) + +typedef struct _GTlsCertificateClass GTlsCertificateClass; +typedef struct _GTlsCertificatePrivate GTlsCertificatePrivate; + +struct _GTlsCertificate { + GObject parent_instance; + + GTlsCertificatePrivate *priv; +}; + +struct _GTlsCertificateClass +{ + GObjectClass parent_class; + + GTlsCertificateFlags (* verify) (GTlsCertificate *cert, + GSocketConnectable *identity, + GTlsCertificate *trusted_ca); + + /*< private >*/ + /* Padding for future expansion */ + gpointer padding[8]; +}; + +GType g_tls_certificate_get_type (void) G_GNUC_CONST; + +GTlsCertificate *g_tls_certificate_new_from_pem (const gchar *data, + gssize length, + GError **error); + +GTlsCertificate *g_tls_certificate_new_from_file (const gchar *file, + GError **error); +GTlsCertificate *g_tls_certificate_new_from_files (const gchar *cert_file, + const gchar *key_file, + GError **error); +GList *g_tls_certificate_list_new_from_file (const gchar *file, + GError **error); + +GTlsCertificate *g_tls_certificate_get_issuer (GTlsCertificate *cert); + +GTlsCertificateFlags g_tls_certificate_verify (GTlsCertificate *cert, + GSocketConnectable *identity, + GTlsCertificate *trusted_ca); + +G_END_DECLS + +#endif /* __G_TLS_CERTIFICATE_H__ */ diff --git a/gio/gtlsclientconnection.c b/gio/gtlsclientconnection.c new file mode 100644 index 0000000..92cd9f5 --- /dev/null +++ b/gio/gtlsclientconnection.c @@ -0,0 +1,333 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright © 2010 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "glib.h" + +#include "gtlsclientconnection.h" +#include "ginitable.h" +#include "gioenumtypes.h" +#include "gio-marshal.h" +#include "gsocket.h" +#include "gsocketconnectable.h" +#include "gtlsbackend.h" +#include "gtlscertificate.h" +#include "glibintl.h" + +/** + * SECTION:gtlsclientconnection + * @short_description: TLS client-side connection + * @include: gio/gio.h + * + * #GTlsClientConnection is the client-side subclass of + * #GTlsConnection, representing a client-side TLS connection. + * + * Since: 2.28 + */ + +/** + * GTlsClientConnection: + * + * Abstract base class for the backend-specific client connection + * type. + * + * Since: 2.28 + */ + +G_DEFINE_INTERFACE (GTlsClientConnection, g_tls_client_connection, G_TYPE_TLS_CONNECTION) + +static void +g_tls_client_connection_default_init (GTlsClientConnectionInterface *iface) +{ + /** + * GTlsClientConnection:validation-flags: + * + * What steps to perform when validating a certificate received from + * a server. Server certificates that fail to validate in all of the + * ways indicated here will be rejected unless the application + * overrides the default via #GTlsConnection::accept-certificate. + * + * Since: 2.28 + */ + g_object_interface_install_property (iface, + g_param_spec_flags ("validation-flags", + P_("Validation flags"), + P_("What certificate validation to perform"), + G_TYPE_TLS_CERTIFICATE_FLAGS, + G_TLS_CERTIFICATE_VALIDATE_ALL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + /** + * GTlsClientConnection:server-identity: + * + * A #GSocketConnectable describing the identity of the server that + * is expected on the other end of the connection. + * + * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in + * #GTlsClientConnection:validation-flags, this object will be used + * to determine the expected identify of the remote end of the + * connection; if #GTlsClientConnection:server-identity is not set, + * or does not match the identity presented by the server, then the + * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail. + * + * In addition to its use in verifying the server certificate, + * this is also used to give a hint to the server about what + * certificate we expect, which is useful for servers that serve + * virtual hosts. + * + * Since: 2.28 + */ + g_object_interface_install_property (iface, + g_param_spec_object ("server-identity", + P_("Server identity"), + P_("GSocketConnectable identifying the server"), + G_TYPE_SOCKET_CONNECTABLE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + /** + * GTlsClientConnection:use-ssl3: + * + * If %TRUE, tells the connection to use SSL 3.0 rather than trying + * to negotiate the best version of TLS or SSL to use. This can be + * used when talking to servers that don't implement version + * negotiation correctly and therefore refuse to handshake at all with + * a "modern" TLS handshake. + * + * Since: 2.28 + */ + g_object_interface_install_property (iface, + g_param_spec_boolean ("use-ssl3", + P_("Use SSL3"), + P_("Use SSL 3.0 rather than trying to use TLS 1.x"), + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + /** + * GTlsClientConnection:accepted-cas: + * + * A list of the distinguished names of the Certificate Authorities + * that the server will accept client certificates signed by. If the + * server requests a client certificate during the handshake, then + * this property will be set after the handshake completes. + * + * Since: 2.28 + */ + g_object_interface_install_property (iface, + g_param_spec_boxed ("accepted-cas", + P_("Accepted CAs"), + P_("Distinguished names of the CAs the server accepts certificates from"), + G_TYPE_STRV, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} + +/** + * g_tls_client_connection_new: + * @base_io_stream: the #GIOStream to wrap + * @server_identity: (allow-none): the expected identity of the server + * @error: #GError for error reporting, or %NULL to ignore. + * + * Creates a new #GTlsClientConnection wrapping @base_io_stream (which + * must have pollable input and output streams) which is assumed to + * communicate with the server identified by @server_identity. + * + * Return value: the new #GTlsClientConnection, or %NULL on error + * + * Since: 2.28 + */ +GIOStream * +g_tls_client_connection_new (GIOStream *base_io_stream, + GSocketConnectable *server_identity, + GError **error) +{ + GObject *conn; + GTlsBackend *backend; + + backend = g_tls_backend_get_default (); + conn = g_initable_new (g_tls_backend_get_client_connection_type (backend), + NULL, error, + "base-io-stream", base_io_stream, + "server-identity", server_identity, + NULL); + return G_IO_STREAM (conn); +} + +/** + * g_tls_client_connection_get_validation_flags: + * @conn: the #GTlsClientConnection + * + * Gets @conn's validation flags + * + * Return value: the validation flags + * + * Since: 2.28 + */ +GTlsCertificateFlags +g_tls_client_connection_get_validation_flags (GTlsClientConnection *conn) +{ + GTlsCertificateFlags flags = 0; + + g_return_val_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn), 0); + + g_object_get (G_OBJECT (conn), "validation-flags", &flags, NULL); + return flags; +} + +/** + * g_tls_client_connection_set_validation_flags: + * @conn: the #GTlsClientConnection + * @flags: the #GTlsCertificateFlags to use + * + * Sets @conn's validation flags, to override the default set of + * checks performed when validating a server certificate. By default, + * %G_TLS_CERTIFICATE_VALIDATE_ALL is used. + * + * Since: 2.28 + */ +void +g_tls_client_connection_set_validation_flags (GTlsClientConnection *conn, + GTlsCertificateFlags flags) +{ + g_return_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn)); + + g_object_set (G_OBJECT (conn), "validation-flags", flags, NULL); +} + +/** + * g_tls_client_connection_get_server_identity: + * @conn: the #GTlsClientConnection + * + * Gets @conn's expected server identity + * + * Return value: a #GSocketConnectable describing the + * expected server identity, or %NULL if the expected identity is not + * known. + * + * Since: 2.28 + */ +GSocketConnectable * +g_tls_client_connection_get_server_identity (GTlsClientConnection *conn) +{ + GSocketConnectable *identity = NULL; + + g_return_val_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn), 0); + + g_object_get (G_OBJECT (conn), "server-identity", &identity, NULL); + if (identity) + g_object_unref (identity); + return identity; +} + +/** + * g_tls_client_connection_set_server_identity: + * @conn: the #GTlsClientConnection + * @identity: a #GSocketConnectable describing the expected server identity + * + * Sets @conn's expected server identity, which is used both to tell + * servers on virtual hosts which certificate to present, and also + * to let @conn know what name to look for in the certificate when + * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled. + * + * Since: 2.28 + */ +void +g_tls_client_connection_set_server_identity (GTlsClientConnection *conn, + GSocketConnectable *identity) +{ + g_return_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn)); + + g_object_set (G_OBJECT (conn), "server-identity", identity, NULL); +} + +/** + * g_tls_client_connection_get_use_ssl3: + * @conn: the #GTlsClientConnection + * + * Gets whether @conn will use SSL 3.0 rather than the + * highest-supported version of TLS; see + * g_tls_client_connection_set_use_ssl3(). + * + * Return value: whether @conn will use SSL 3.0 + * + * Since: 2.28 + */ +gboolean +g_tls_client_connection_get_use_ssl3 (GTlsClientConnection *conn) +{ + gboolean use_ssl3 = FALSE; + + g_return_val_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn), 0); + + g_object_get (G_OBJECT (conn), "use-ssl3", &use_ssl3, NULL); + return use_ssl3; +} + +/** + * g_tls_client_connection_set_use_ssl3: + * @conn: the #GTlsClientConnection + * @use_ssl3: whether to use SSL 3.0 + * + * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than + * trying to properly negotiate the right version of TLS or SSL to use. + * This can be used when talking to servers that do not implement the + * fallbacks correctly and which will therefore fail to handshake with + * a "modern" TLS handshake attempt. + * + * Since: 2.28 + */ +void +g_tls_client_connection_set_use_ssl3 (GTlsClientConnection *conn, + gboolean use_ssl3) +{ + g_return_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn)); + + g_object_set (G_OBJECT (conn), "use-ssl3", use_ssl3, NULL); +} + +/** + * g_tls_client_connection_get_accepted_cas: + * @conn: the #GTlsClientConnection + * + * Gets the list of distinguished names of the Certificate Authorities + * that the server will accept certificates from. This will be set + * during the TLS handshake if the server requests a certificate. + * Otherwise, it will be %NULL. + * + * Return value: (transfer full) (array zero-terminated=1): the list + * of CA names, which you must free (eg, with g_strfreev()). + * + * Since: 2.28 + */ +char ** +g_tls_client_connection_get_accepted_cas (GTlsClientConnection *conn) +{ + char **accepted_cas = NULL; + + g_return_val_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn), NULL); + + g_object_get (G_OBJECT (conn), "accepted-cas", &accepted_cas, NULL); + return accepted_cas; +} diff --git a/gio/gtlsclientconnection.h b/gio/gtlsclientconnection.h new file mode 100644 index 0000000..2aaaa97 --- /dev/null +++ b/gio/gtlsclientconnection.h @@ -0,0 +1,72 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_TLS_CLIENT_CONNECTION_H__ +#define __G_TLS_CLIENT_CONNECTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_TLS_CLIENT_CONNECTION (g_tls_client_connection_get_type ()) +#define G_TLS_CLIENT_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CLIENT_CONNECTION, GTlsClientConnection)) +#define G_IS_TLS_CLIENT_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CLIENT_CONNECTION)) +#define G_TLS_CLIENT_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TLS_CLIENT_CONNECTION, GTlsClientConnectionInterface)) + +/** + * GTlsClientConnection: + * + * TLS client-side connection; the client-side implementation of a + * #GTlsConnection + * + * Since: 2.28 + */ +typedef struct _GTlsClientConnectionInterface GTlsClientConnectionInterface; + +struct _GTlsClientConnectionInterface +{ + GTypeInterface g_iface; + +}; + +GType g_tls_client_connection_get_type (void) G_GNUC_CONST; + +GIOStream * g_tls_client_connection_new (GIOStream *base_io_stream, + GSocketConnectable *server_identity, + GError **error); + +GTlsCertificateFlags g_tls_client_connection_get_validation_flags (GTlsClientConnection *conn); +void g_tls_client_connection_set_validation_flags (GTlsClientConnection *conn, + GTlsCertificateFlags flags); +GSocketConnectable *g_tls_client_connection_get_server_identity (GTlsClientConnection *conn); +void g_tls_client_connection_set_server_identity (GTlsClientConnection *conn, + GSocketConnectable *identity); +gboolean g_tls_client_connection_get_use_ssl3 (GTlsClientConnection *conn); +void g_tls_client_connection_set_use_ssl3 (GTlsClientConnection *conn, + gboolean use_ssl3); +char ** g_tls_client_connection_get_accepted_cas (GTlsClientConnection *conn); + +G_END_DECLS + +#endif /* __G_TLS_CLIENT_CONNECTION_H__ */ diff --git a/gio/gtlsconnection.c b/gio/gtlsconnection.c new file mode 100644 index 0000000..a652ac3 --- /dev/null +++ b/gio/gtlsconnection.c @@ -0,0 +1,726 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright © 2010 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "glib.h" + +#include "gtlsconnection.h" +#include "gcancellable.h" +#include "gioenumtypes.h" +#include "gio-marshal.h" +#include "gsocket.h" +#include "gtlsbackend.h" +#include "gtlscertificate.h" +#include "gtlsclientconnection.h" +#include "glibintl.h" + +/** + * SECTION:gtlsconnection + * @short_description: TLS connection type + * @include: gio/gio.h + * + * #GTlsConnection is the base TLS connection class type, which wraps + * a #GIOStream and provides TLS encryption on top of it. Its + * subclasses, #GTlsClientConnection and #GTlsServerConnection, + * implement client-side and server-side TLS, respectively. + * + * Since: 2.28 + */ + +/** + * GTlsConnection: + * + * Abstract base class for the backend-specific #GTlsClientConnection + * and #GTlsServerConnection types. + * + * Since: 2.28 + */ + +G_DEFINE_ABSTRACT_TYPE (GTlsConnection, g_tls_connection, G_TYPE_IO_STREAM) + +static void g_tls_connection_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void g_tls_connection_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); + +enum { + ACCEPT_CERTIFICATE, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_BASE_IO_STREAM, + PROP_REQUIRE_CLOSE_NOTIFY, + PROP_REHANDSHAKE_MODE, + PROP_USE_SYSTEM_CERTDB, + PROP_CERTIFICATE, + PROP_PEER_CERTIFICATE, + PROP_PEER_CERTIFICATE_ERRORS +}; + +static void +g_tls_connection_class_init (GTlsConnectionClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = g_tls_connection_get_property; + gobject_class->set_property = g_tls_connection_set_property; + + /** + * GTlsConnection:base-io-stream: + * + * The #GIOStream that the connection wraps + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_BASE_IO_STREAM, + g_param_spec_object ("base-io-stream", + P_("Base IOStream"), + P_("The GIOStream that the connection wraps"), + G_TYPE_IO_STREAM, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsConnection:use-system-certdb: + * + * Whether or not the system certificate database will be used to + * verify peer certificates. See + * g_tls_connection_set_use_system_certdb(). + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_USE_SYSTEM_CERTDB, + g_param_spec_boolean ("use-system-certdb", + P_("Use system certificate database"), + P_("Whether to verify peer certificates against the system certificate database"), + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsConnection:require-close-notify: + * + * Whether or not proper TLS close notification is required. + * See g_tls_connection_set_require_close_notify(). + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_REQUIRE_CLOSE_NOTIFY, + g_param_spec_boolean ("require-close-notify", + P_("Require close notify"), + P_("Whether to require proper TLS close notification"), + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsConnection:rehandshake-mode: + * + * The rehandshaking mode. See + * g_tls_connection_set_rehandshake_mode(). + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_REHANDSHAKE_MODE, + g_param_spec_enum ("rehandshake-mode", + P_("Rehandshake mode"), + P_("When to allow rehandshaking"), + G_TYPE_TLS_REHANDSHAKE_MODE, + G_TLS_REHANDSHAKE_SAFELY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsConnection:certificate: + * + * The connection's certificate; see + * g_tls_connection_set_certificate(). + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_CERTIFICATE, + g_param_spec_object ("certificate", + P_("Certificate"), + P_("The connection's certificate"), + G_TYPE_TLS_CERTIFICATE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsConnection:peer-certificate: + * + * The connection's peer's certificate, after the TLS handshake has + * completed and the certificate has been accepted. Note in + * particular that this is not yet set during the emission of + * #GTlsConnection::accept-certificate. + * + * (You can watch for a #GObject::notify signal on this property to + * detect when a handshake has occurred.) + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_PEER_CERTIFICATE, + g_param_spec_object ("peer-certificate", + P_("Peer Certificate"), + P_("The connection's peer's certificate"), + G_TYPE_TLS_CERTIFICATE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /** + * GTlsConnection:peer-certificate-errors: + * + * The errors noticed-and-ignored while verifying + * #GTlsConnection:peer-certificate. Normally this should be %0, but + * it may not be if #GTlsClientConnection::validation-flags is not + * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if + * #GTlsConnection::accept-certificate overrode the default + * behavior. + * + * Since: 2.28 + */ + g_object_class_install_property (gobject_class, PROP_PEER_CERTIFICATE_ERRORS, + g_param_spec_flags ("peer-certificate-errors", + P_("Peer Certificate Errors"), + P_("Errors found with the peer's certificate"), + G_TYPE_TLS_CERTIFICATE_FLAGS, + 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GTlsConnection::accept-certificate: + * @conn: a #GTlsConnection + * @peer_cert: the peer's #GTlsCertificate + * @errors: the problems with @peer_cert. + * + * Emitted during the TLS handshake after the peer certificate has + * been received. You can examine @peer_cert's certification path by + * calling g_tls_certificate_get_issuer() on it. + * + * For a client-side connection, @peer_cert is the server's + * certificate, and the signal will only be emitted if the + * certificate was not acceptable according to @conn's + * #GTlsClientConnection:validation_flags. If you would like the + * certificate to be accepted despite @errors, return %TRUE from the + * signal handler. Otherwise, if no handler accepts the certificate, + * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE. + * + * For a server-side connection, @peer_cert is the certificate + * presented by the client, if this was requested via the server's + * #GTlsServerConnection:authentication_mode. On the server side, + * the signal is always emitted when the client presents a + * certificate, and the certificate will only be accepted if a + * handler returns %TRUE. + * + * Note that if this signal is emitted as part of asynchronous I/O + * in the main thread, then you should not attempt to interact with + * the user before returning from the signal handler. If you want to + * let the user decide whether or not to accept the certificate, you + * would have to return %FALSE from the signal handler on the first + * attempt, and then after the connection attempt returns a + * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if + * the user decides to accept the certificate, remember that fact, + * create a new connection, and return %TRUE from the signal handler + * the next time. + * + * If you are doing I/O in another thread, you do not + * need to worry about this, and can simply block in the signal + * handler until the UI thread returns an answer. + * + * Return value: %TRUE to accept @peer_cert (which will also + * immediately end the signal emission). %FALSE to allow the signal + * emission to continue, which will cause the handshake to fail if + * no one else overrides it. + * + * Since: 2.28 + */ + signals[ACCEPT_CERTIFICATE] = + g_signal_new (I_("accept-certificate"), + G_TYPE_TLS_CONNECTION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GTlsConnectionClass, accept_certificate), + g_signal_accumulator_true_handled, NULL, + _gio_marshal_BOOLEAN__OBJECT_FLAGS, + G_TYPE_BOOLEAN, 2, + G_TYPE_TLS_CERTIFICATE, + G_TYPE_TLS_CERTIFICATE_FLAGS); +} + +static void +g_tls_connection_init (GTlsConnection *conn) +{ +} + +static void +g_tls_connection_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); +} + +static void +g_tls_connection_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); +} + +/** + * g_tls_connection_set_use_system_certdb: + * @conn: a #GTlsConnection + * @use_system_certdb: whether to use the system certificate database + * + * Sets whether @conn uses the system certificate database to verify + * peer certificates. This is %TRUE by default. If set to %FALSE, then + * peer certificate validation will always set the + * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning + * #GTlsConnection::accept-certificate will always be emitted on + * client-side connections, unless that bit is not set in + * #GTlsClientConnection:validation-flags). + * + * Since: 2.28 + */ +void +g_tls_connection_set_use_system_certdb (GTlsConnection *conn, + gboolean use_system_certdb) +{ + g_return_if_fail (G_IS_TLS_CONNECTION (conn)); + + g_object_set (G_OBJECT (conn), + "use-system-certdb", use_system_certdb, + NULL); +} + +/** + * g_tls_connection_get_use_system_certdb: + * @conn: a #GTlsConnection + * + * Gets whether @conn uses the system certificate database to verify + * peer certificates. See g_tls_connection_set_use_system_certdb(). + * + * Return value: whether @conn uses the system certificate database + * + * Since: 2.28 + */ +gboolean +g_tls_connection_get_use_system_certdb (GTlsConnection *conn) +{ + gboolean use_system_certdb; + + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), TRUE); + + g_object_get (G_OBJECT (conn), + "use-system-certdb", &use_system_certdb, + NULL); + return use_system_certdb; +} + +/** + * g_tls_connection_set_certificate: + * @conn: a #GTlsConnection + * @certificate: the certificate to use for @conn + * + * This sets the certificate that @conn will present to its peer + * during the TLS handshake. For a #GTlsServerConnection, it is + * mandatory to set this, and that will normally be done at construct + * time. + * + * For a #GTlsClientConnection, this is optional. If a handshake fails + * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server + * requires a certificate, and if you try connecting again, you should + * call this method first. You can call + * g_tls_client_connection_get_accepted_cas() on the failed connection + * to get a list of Certificate Authorities that the server will + * accept certificates from. + * + * (It is also possible that a server will allow the connection with + * or without a certificate; in that case, if you don't provide a + * certificate, you can tell that the server requested one by the fact + * that g_tls_client_connection_get_accepted_cas() will return + * non-%NULL.) + * + * Since: 2.28 + */ +void +g_tls_connection_set_certificate (GTlsConnection *conn, + GTlsCertificate *certificate) +{ + g_return_if_fail (G_IS_TLS_CONNECTION (conn)); + g_return_if_fail (G_IS_TLS_CERTIFICATE (certificate)); + + g_object_set (G_OBJECT (conn), "certificate", certificate, NULL); +} + +/** + * g_tls_connection_get_certificate: + * @conn: a #GTlsConnection + * + * Gets @conn's certificate, as set by + * g_tls_connection_set_certificate(). + * + * Return value: (transfer none): @conn's certificate, or %NULL + * + * Since: 2.28 + */ +GTlsCertificate * +g_tls_connection_get_certificate (GTlsConnection *conn) +{ + GTlsCertificate *certificate; + + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), NULL); + + g_object_get (G_OBJECT (conn), "certificate", &certificate, NULL); + if (certificate) + g_object_unref (certificate); + + return certificate; +} + +/** + * g_tls_connection_get_peer_certificate: + * @conn: a #GTlsConnection + * + * Gets @conn's peer's certificate after the handshake has completed. + * (It is not set during the emission of + * #GTlsConnection::accept-certificate.) + * + * Return value: (transfer none): @conn's peer's certificate, or %NULL + * + * Since: 2.28 + */ +GTlsCertificate * +g_tls_connection_get_peer_certificate (GTlsConnection *conn) +{ + GTlsCertificate *peer_certificate; + + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), NULL); + + g_object_get (G_OBJECT (conn), "peer-certificate", &peer_certificate, NULL); + if (peer_certificate) + g_object_unref (peer_certificate); + + return peer_certificate; +} + +/** + * g_tls_connection_get_peer_certificate_errors: + * @conn: a #GTlsConnection + * + * Gets the errors associated with validating @conn's peer's + * certificate, after the handshake has completed. (It is not set + * during the emission of #GTlsConnection::accept-certificate.) + * + * Return value: @conn's peer's certificate errors + * + * Since: 2.28 + */ +GTlsCertificateFlags +g_tls_connection_get_peer_certificate_errors (GTlsConnection *conn) +{ + GTlsCertificateFlags errors; + + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), 0); + + g_object_get (G_OBJECT (conn), "peer-certificate-errors", &errors, NULL); + return errors; +} + +/** + * g_tls_connection_set_require_close_notify: + * @conn: a #GTlsConnection + * @require_close_notify: whether or not to require close notification + * + * Sets whether or not @conn expects a proper TLS close notification + * before the connection is closed. If this is %TRUE (the default), + * then @conn will expect to receive a TLS close notification from its + * peer before the connection is closed, and will return a + * %G_TLS_ERROR_EOF error if the connection is closed without proper + * notification (since this may indicate a network error, or + * man-in-the-middle attack). + * + * In some protocols, the application will know whether or not the + * connection was closed cleanly based on application-level data + * (because the application-level data includes a length field, or is + * somehow self-delimiting); in this case, the close notify is + * redundant and sometimes omitted. (TLS 1.1 explicitly allows this; + * in TLS 1.0 it is technically an error, but often done anyway.) You + * can use g_tls_connection_set_require_close_notify() to tell @conn + * to allow an "unannounced" connection close, in which case the close + * will show up as a 0-length read, as in a non-TLS + * #GSocketConnection, and it is up to the application to check that + * the data has been fully received. + * + * Note that this only affects the behavior when the peer closes the + * connection; when the application calls g_io_stream_close() itself + * on @conn, this will send a close notification regardless of the + * setting of this property. If you explicitly want to do an unclean + * close, you can close @conn's #GTlsConnection:base-io-stream rather + * than closing @conn itself. + * + * Since: 2.28 + */ +void +g_tls_connection_set_require_close_notify (GTlsConnection *conn, + gboolean require_close_notify) +{ + g_return_if_fail (G_IS_TLS_CONNECTION (conn)); + + g_object_set (G_OBJECT (conn), + "require-close-notify", require_close_notify, + NULL); +} + +/** + * g_tls_connection_get_require_close_notify: + * @conn: a #GTlsConnection + * + * Tests whether or not @conn expects a proper TLS close notification + * when the connection is closed. See + * g_tls_connection_set_require_close_notify() for details. + * + * Return value: %TRUE if @conn requires a proper TLS close + * notification. + * + * Since: 2.28 + */ +gboolean +g_tls_connection_get_require_close_notify (GTlsConnection *conn) +{ + gboolean require_close_notify; + + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), TRUE); + + g_object_get (G_OBJECT (conn), + "require-close-notify", &require_close_notify, + NULL); + return require_close_notify; +} + +/** + * g_tls_connection_set_rehandshake_mode: + * @conn: a #GTlsConnection + * @mode: the rehandshaking mode + * + * Sets how @conn behaves with respect to rehandshaking requests. + * + * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to + * rehandshake after the initial handshake is complete. (For a client, + * this means it will refuse rehandshake requests from the server, and + * for a server, this means it will close the connection with an error + * if the client attempts to rehandshake.) + * + * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a + * rehandshake only if the other end of the connection supports the + * TLS renegotiation_info extension. This is the + * default behavior, but means that rehandshaking will not work + * against older implementations that do not support that extension. + * + * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow + * rehandshaking even without the + * renegotiation_info extension. On the server side + * in particular, this is not recommended, since it leaves the server + * open to certain attacks. However, this mode is necessary if you + * need to allow renegotiation with older client software. + * + * Since: 2.28 + */ +void +g_tls_connection_set_rehandshake_mode (GTlsConnection *conn, + GTlsRehandshakeMode mode) +{ + g_return_if_fail (G_IS_TLS_CONNECTION (conn)); + + g_object_set (G_OBJECT (conn), + "rehandshake-mode", mode, + NULL); +} + +/** + * g_tls_connection_get_rehandshake_mode: + * @conn: a #GTlsConnection + * + * Gets @conn rehandshaking mode. See + * g_tls_connection_set_rehandshake() for details. + * + * Return value: @conn's rehandshaking mode + * + * Since: 2.28 + */ +GTlsRehandshakeMode +g_tls_connection_get_rehandshake_mode (GTlsConnection *conn) +{ + GTlsRehandshakeMode mode; + + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), G_TLS_REHANDSHAKE_NEVER); + + g_object_get (G_OBJECT (conn), + "rehandshake-mode", &mode, + NULL); + return mode; +} + +/** + * g_tls_connection_handshake: + * @conn: a #GTlsConnection + * @cancellable: a #GCancellable, or %NULL + * @error: a #GError, or %NULL + * + * Attempts a TLS handshake on @conn. + * + * On the client side, it is never necessary to call this method; + * although the connection needs to perform a handshake after + * connecting (or after sending a "STARTTLS"-type command) and may + * need to rehandshake later if the server requests it, + * #GTlsConnection will handle this for you automatically when you try + * to send or receive data on the connection. However, you can call + * g_tls_connection_handshake() manually if you want to know for sure + * whether the initial handshake succeeded or failed (as opposed to + * just immediately trying to write to @conn's output stream, in which + * case if it fails, it may not be possible to tell if it failed + * before or after completing the handshake). + * + * Likewise, on the server side, although a handshake is necessary at + * the beginning of the communication, you do not need to call this + * function explicitly unless you want clearer error reporting. + * However, you may call g_tls_connection_handshake() later on to + * renegotiate parameters (encryption methods, etc) with the client. + * + * #GTlsConnection::accept_certificate may be emitted during the + * handshake. + * + * Return value: success or failure + * + * Since: 2.28 + */ +gboolean +g_tls_connection_handshake (GTlsConnection *conn, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), FALSE); + + return G_TLS_CONNECTION_GET_CLASS (conn)->handshake (conn, cancellable, error); +} + +/** + * g_tls_connection_handshake_async: + * @conn: a #GTlsConnection + * @io_priority: the I/O priority + * of the request. + * @cancellable: a #GCancellable, or %NULL + * @callback: callback to call when the handshake is complete + * @user_data: the data to pass to the callback function + * + * Asynchronously performs a TLS handshake on @conn. See + * g_tls_connection_handshake() for more information. + * + * Since: 2.28 + */ +void +g_tls_connection_handshake_async (GTlsConnection *conn, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (G_IS_TLS_CONNECTION (conn)); + + return G_TLS_CONNECTION_GET_CLASS (conn)->handshake_async (conn, io_priority, + cancellable, + callback, user_data); +} + +/** + * g_tls_connection_handshake_finish: + * @conn: a #GTlsConnection + * @result: a #GAsyncResult. + * @error: a #GError pointer, or %NULL + * + * Finish an asynchronous TLS handshake operation. See + * g_tls_connection_handshake() for more information. + * + * Return value: %TRUE on success, %FALSE on failure, in which + * case @error will be set. + * + * Since: 2.28 + */ +gboolean +g_tls_connection_handshake_finish (GTlsConnection *conn, + GAsyncResult *result, + GError **error) +{ + g_return_val_if_fail (G_IS_TLS_CONNECTION (conn), FALSE); + + return G_TLS_CONNECTION_GET_CLASS (conn)->handshake_finish (conn, result, error); +} + +/** + * g_tls_error_quark: + * + * Gets the TLS error quark. + * + * Return value: a #GQuark. + * + * Since: 2.28 + */ +GQuark +g_tls_error_quark (void) +{ + return g_quark_from_static_string ("g-tls-error-quark"); +} + + +/** + * g_tls_connection_emit_accept_certificate: + * @conn: a #GTlsConnection + * @peer_cert: the peer's #GTlsCertificate + * @errors: the problems with @peer_cert + * + * Used by #GTlsConnection implementations to emit the + * #GTlsConnection::accept-certificate signal. + * + * Return value: %TRUE if one of the signal handlers has returned + * %TRUE to accept @peer_cert + * + * Since: 2.28 + */ +gboolean +g_tls_connection_emit_accept_certificate (GTlsConnection *conn, + GTlsCertificate *peer_cert, + GTlsCertificateFlags errors) +{ + gboolean accept = FALSE; + + g_signal_emit (conn, signals[ACCEPT_CERTIFICATE], 0, + peer_cert, errors, &accept); + return accept; +} diff --git a/gio/gtlsconnection.h b/gio/gtlsconnection.h new file mode 100644 index 0000000..7786c43 --- /dev/null +++ b/gio/gtlsconnection.h @@ -0,0 +1,136 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_TLS_CONNECTION_H__ +#define __G_TLS_CONNECTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_TLS_CONNECTION (g_tls_connection_get_type ()) +#define G_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CONNECTION, GTlsConnection)) +#define G_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CONNECTION, GTlsConnectionClass)) +#define G_IS_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CONNECTION)) +#define G_IS_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CONNECTION)) +#define G_TLS_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CONNECTION, GTlsConnectionClass)) + +/** + * GTlsConnection: + * + * TLS connection. This is an abstract type that will be subclassed by + * a TLS-library-specific subtype. + * + * Since: 2.28 + */ +typedef struct _GTlsConnectionClass GTlsConnectionClass; +typedef struct _GTlsConnectionPrivate GTlsConnectionPrivate; + +struct _GTlsConnection { + GIOStream parent_instance; + + GTlsConnectionPrivate *priv; +}; + +struct _GTlsConnectionClass +{ + GIOStreamClass parent_class; + + /* signals */ + gboolean ( *accept_certificate) (GTlsConnection *connection, + GTlsCertificate *peer_cert, + GTlsCertificateFlags errors); + + /* methods */ + gboolean ( *handshake ) (GTlsConnection *conn, + GCancellable *cancellable, + GError **error); + + void ( *handshake_async ) (GTlsConnection *conn, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean ( *handshake_finish ) (GTlsConnection *conn, + GAsyncResult *result, + GError **error); + + /*< private >*/ + /* Padding for future expansion */ + gpointer padding[8]; +}; + +GType g_tls_connection_get_type (void) G_GNUC_CONST; + +void g_tls_connection_set_use_system_certdb (GTlsConnection *conn, + gboolean use_system_certdb); +gboolean g_tls_connection_get_use_system_certdb (GTlsConnection *conn); + +void g_tls_connection_set_certificate (GTlsConnection *conn, + GTlsCertificate *certificate); +GTlsCertificate *g_tls_connection_get_certificate (GTlsConnection *conn); + +GTlsCertificate *g_tls_connection_get_peer_certificate (GTlsConnection *conn); +GTlsCertificateFlags g_tls_connection_get_peer_certificate_errors (GTlsConnection *conn); + +void g_tls_connection_set_require_close_notify (GTlsConnection *conn, + gboolean require_close_notify); +gboolean g_tls_connection_get_require_close_notify (GTlsConnection *conn); + +void g_tls_connection_set_rehandshake_mode (GTlsConnection *conn, + GTlsRehandshakeMode mode); +GTlsRehandshakeMode g_tls_connection_get_rehandshake_mode (GTlsConnection *conn); + +gboolean g_tls_connection_handshake (GTlsConnection *conn, + GCancellable *cancellable, + GError **error); + +void g_tls_connection_handshake_async (GTlsConnection *conn, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean g_tls_connection_handshake_finish (GTlsConnection *conn, + GAsyncResult *result, + GError **error); + +/** + * G_TLS_ERROR: + * + * Error domain for TLS. Errors in this domain will be from the + * #GTlsError enumeration. See #GError for more information on error + * domains. + */ +#define G_TLS_ERROR (g_tls_error_quark ()) +GQuark g_tls_error_quark (void); + + +/*< protected >*/ +gboolean g_tls_connection_emit_accept_certificate (GTlsConnection *conn, + GTlsCertificate *peer_cert, + GTlsCertificateFlags errors); + +G_END_DECLS + +#endif /* __G_TLS_CONNECTION_H__ */ diff --git a/gio/gtlsserverconnection.c b/gio/gtlsserverconnection.c new file mode 100644 index 0000000..4965656 --- /dev/null +++ b/gio/gtlsserverconnection.c @@ -0,0 +1,96 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright © 2010 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "glib.h" + +#include "gtlsserverconnection.h" +#include "ginitable.h" +#include "gio-marshal.h" +#include "gioenumtypes.h" +#include "gsocket.h" +#include "gtlsbackend.h" +#include "gtlscertificate.h" +#include "glibintl.h" + +/** + * SECTION:gtlsserverconnection + * @short_description: TLS server-side connection + * @include: gio/gio.h + * + * #GTlsServerConnection is the server-side subclass of #GTlsConnection, + * representing a server-side TLS connection. + * + * Since: 2.28 + */ + +G_DEFINE_INTERFACE (GTlsServerConnection, g_tls_server_connection, G_TYPE_TLS_CONNECTION) + +static void +g_tls_server_connection_default_init (GTlsServerConnectionInterface *iface) +{ + /** + * GTlsServerConnection:authentication-mode: + * + * The #GTlsAuthenticationMode for the server. This can be changed + * before calling g_tls_connection_handshake() if you want to + * rehandshake with a different mode from the initial handshake. + * + * Since: 2.28 + */ + g_object_interface_install_property (iface, + g_param_spec_enum ("authentication-mode", + P_("Authentication Mode"), + P_("The client authentication mode"), + G_TYPE_TLS_AUTHENTICATION_MODE, + G_TLS_AUTHENTICATION_NONE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); +} + +/** + * g_tls_server_connection_new: + * @base_io_stream: the #GIOStream to wrap + * @certificate: (allow-none): the default server certificate, or %NULL + * @error: #GError for error reporting, or %NULL to ignore. + * + * Creates a new #GTlsServerConnection wrapping @base_io_stream (which + * must have pollable input and output streams). + * + * Return value: the new #GTlsServerConnection, or %NULL on error + * + * Since: 2.28 + */ +GIOStream * +g_tls_server_connection_new (GIOStream *base_io_stream, + GTlsCertificate *certificate, + GError **error) +{ + GObject *conn; + GTlsBackend *backend; + + backend = g_tls_backend_get_default (); + conn = g_initable_new (g_tls_backend_get_server_connection_type (backend), + NULL, error, + "base-io-stream", base_io_stream, + "certificate", certificate, + NULL); + return G_IO_STREAM (conn); +} diff --git a/gio/gtlsserverconnection.h b/gio/gtlsserverconnection.h new file mode 100644 index 0000000..c909d55 --- /dev/null +++ b/gio/gtlsserverconnection.h @@ -0,0 +1,61 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_TLS_SERVER_CONNECTION_H__ +#define __G_TLS_SERVER_CONNECTION_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_TLS_SERVER_CONNECTION (g_tls_server_connection_get_type ()) +#define G_TLS_SERVER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_SERVER_CONNECTION, GTlsServerConnection)) +#define G_IS_TLS_SERVER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_SERVER_CONNECTION)) +#define G_TLS_SERVER_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TLS_SERVER_CONNECTION, GTlsServerConnectionInterface)) + +/** + * GTlsServerConnection: + * + * TLS server-side connection. This is the server-side implementation + * of a #GTlsConnection. + * + * Since: 2.28 + */ +typedef struct _GTlsServerConnectionInterface GTlsServerConnectionInterface; + +struct _GTlsServerConnectionInterface +{ + GTypeInterface g_iface; + +}; + +GType g_tls_server_connection_get_type (void) G_GNUC_CONST; + +GIOStream * g_tls_server_connection_new (GIOStream *base_io_stream, + GTlsCertificate *certificate, + GError **error); + +G_END_DECLS + +#endif /* __G_TLS_SERVER_CONNECTION_H__ */ diff --git a/gio/gunionvolumemonitor.c b/gio/gunionvolumemonitor.c index a0a3634..5320b04 100644 --- a/gio/gunionvolumemonitor.c +++ b/gio/gunionvolumemonitor.c @@ -38,7 +38,6 @@ #include "glibintl.h" -#include "gioalias.h" struct _GUnionVolumeMonitor { GVolumeMonitor parent; @@ -556,7 +555,7 @@ g_union_volume_monitor_new (void) * * Gets the volume monitor used by gio. * - * Returns: a reference to the #GVolumeMonitor used by gio. Call + * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call * g_object_unref() when done with it. **/ GVolumeMonitor * @@ -646,7 +645,7 @@ _g_mount_get_for_mount_path (const gchar *mount_path, * is to return #GVolume objects representing entries in the users * "favorite servers" list or similar. * - * Returns: the #GVolume object that is the parent for @mount or %NULL + * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL * if no wants to adopt the #GMount. * * Deprecated: 2.20: Instead of using this function, #GVolumeMonitor @@ -689,7 +688,3 @@ g_volume_monitor_adopt_orphan_mount (GMount *mount) return volume; } - - -#define __G_UNION_VOLUME_MONITOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gunixconnection.c b/gio/gunixconnection.c index 92ad246..82510f5 100644 --- a/gio/gunixconnection.c +++ b/gio/gunixconnection.c @@ -14,19 +14,25 @@ #include "config.h" #include "gunixconnection.h" +#include "gunixcredentialsmessage.h" #include "glibintl.h" /** * SECTION: gunixconnection * @title: GUnixConnection - * @short_description: a Unix domain #GSocketConnection + * @short_description: A UNIX domain GSocketConnection + * @include: gio/gunixconnection.h * @see_also: #GSocketConnection. * * This is the subclass of #GSocketConnection that is created * for UNIX domain sockets. * - * It contains functions to do some of the unix socket specific - * functionallity like passing file descriptors. + * It contains functions to do some of the UNIX socket specific + * functionality like passing file descriptors. + * + * Note that <gio/gunixconnection.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. * * Since: 2.22 */ @@ -36,7 +42,14 @@ #include #include -#include "gioalias.h" +#ifdef __linux__ +/* for getsockopt() and setsockopt() */ +#include /* See NOTES */ +#include +#include +#include +#endif + G_DEFINE_TYPE_WITH_CODE (GUnixConnection, g_unix_connection, G_TYPE_SOCKET_CONNECTION, @@ -50,8 +63,8 @@ G_DEFINE_TYPE_WITH_CODE (GUnixConnection, g_unix_connection, * g_unix_connection_send_fd: * @connection: a #GUnixConnection * @fd: a file descriptor - * @cancellable: optional #GCancellable object, %NULL to ignore. - * @error: #GError for error reporting, or %NULL to ignore. + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. + * @error: (allow-none): #GError for error reporting, or %NULL to ignore. * * Passes a file descriptor to the recieving side of the * connection. The recieving end has to call g_unix_connection_receive_fd() @@ -104,8 +117,8 @@ g_unix_connection_send_fd (GUnixConnection *connection, /** * g_unix_connection_receive_fd: * @connection: a #GUnixConnection - * @cancellable: optional #GCancellable object, %NULL to ignore - * @error: #GError for error reporting, or %NULL to ignore + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore + * @error: (allow-none): #GError for error reporting, or %NULL to ignore * * Receives a file descriptor from the sending end of the connection. * The sending end has to call g_unix_connection_send_fd() for this @@ -118,7 +131,7 @@ g_unix_connection_send_fd (GUnixConnection *connection, * Returns: a file descriptor on success, -1 on error. * * Since: 2.22 - */ + **/ gint g_unix_connection_receive_fd (GUnixConnection *connection, GCancellable *cancellable, @@ -287,5 +300,254 @@ gboolean g_unix_connection_create_pair (GUnixCo GError **error); */ -#define __G_UNIX_CONNECTION_C__ -#include "gioaliasdef.c" + +/** + * g_unix_connection_send_credentials: + * @connection: A #GUnixConnection. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Passes the credentials of the current user the receiving side + * of the connection. The recieving end has to call + * g_unix_connection_receive_credentials() (or similar) to accept the + * credentials. + * + * As well as sending the credentials this also writes a single NUL + * byte to the stream, as this is required for credentials passing to + * work on some implementations. + * + * Other ways to exchange credentials with a foreign peer includes the + * #GUnixCredentialsMessage type and g_socket_get_credentials() function. + * + * Returns: %TRUE on success, %FALSE if @error is set. + * + * Since: 2.26 + */ +gboolean +g_unix_connection_send_credentials (GUnixConnection *connection, + GCancellable *cancellable, + GError **error) +{ + GCredentials *credentials; + GSocketControlMessage *scm; + GSocket *socket; + gboolean ret; + GOutputVector vector; + guchar nul_byte[1] = {'\0'}; + + g_return_val_if_fail (G_IS_UNIX_CONNECTION (connection), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ret = FALSE; + + credentials = g_credentials_new (); + + vector.buffer = &nul_byte; + vector.size = 1; + scm = g_unix_credentials_message_new_with_credentials (credentials); + g_object_get (connection, "socket", &socket, NULL); + if (g_socket_send_message (socket, + NULL, /* address */ + &vector, + 1, + &scm, + 1, + G_SOCKET_MSG_NONE, + cancellable, + error) != 1) + { + g_prefix_error (error, _("Error sending credentials: ")); + goto out; + } + + ret = TRUE; + + out: + g_object_unref (socket); + g_object_unref (scm); + g_object_unref (credentials); + return ret; +} + +/** + * g_unix_connection_receive_credentials: + * @connection: A #GUnixConnection. + * @cancellable: A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Receives credentials from the sending end of the connection. The + * sending end has to call g_unix_connection_send_credentials() (or + * similar) for this to work. + * + * As well as reading the credentials this also reads (and discards) a + * single byte from the stream, as this is required for credentials + * passing to work on some implementations. + * + * Other ways to exchange credentials with a foreign peer includes the + * #GUnixCredentialsMessage type and g_socket_get_credentials() function. + * + * Returns: (transfer full): Received credentials on success (free with + * g_object_unref()), %NULL if @error is set. + * + * Since: 2.26 + */ +GCredentials * +g_unix_connection_receive_credentials (GUnixConnection *connection, + GCancellable *cancellable, + GError **error) +{ + GCredentials *ret; + GSocketControlMessage **scms; + gint nscm; + GSocket *socket; + gint n; + volatile GType credentials_message_gtype; + gssize num_bytes_read; +#ifdef __linux__ + gboolean turn_off_so_passcreds; +#endif + + g_return_val_if_fail (G_IS_UNIX_CONNECTION (connection), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = NULL; + scms = NULL; + + g_object_get (connection, "socket", &socket, NULL); + + /* On Linux, we need to turn on SO_PASSCRED if it isn't enabled + * already. We also need to turn it off when we're done. See + * #617483 for more discussion. + */ +#ifdef __linux__ + { + gint opt_val; + socklen_t opt_len; + + turn_off_so_passcreds = FALSE; + opt_val = 0; + opt_len = sizeof (gint); + if (getsockopt (g_socket_get_fd (socket), + SOL_SOCKET, + SO_PASSCRED, + &opt_val, + &opt_len) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error checking if SO_PASSCRED is enabled for socket: %s"), + strerror (errno)); + goto out; + } + if (opt_len != sizeof (gint)) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Unexpected option length while checking if SO_PASSCRED is enabled for socket. " + "Expected %d bytes, got %d"), + (gint) sizeof (gint), (gint) opt_len); + goto out; + } + if (opt_val == 0) + { + opt_val = 1; + if (setsockopt (g_socket_get_fd (socket), + SOL_SOCKET, + SO_PASSCRED, + &opt_val, + sizeof opt_val) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error enabling SO_PASSCRED: %s"), + strerror (errno)); + goto out; + } + turn_off_so_passcreds = TRUE; + } + } +#endif + + /* ensure the type of GUnixCredentialsMessage has been registered with the type system */ + credentials_message_gtype = G_TYPE_UNIX_CREDENTIALS_MESSAGE; + num_bytes_read = g_socket_receive_message (socket, + NULL, /* GSocketAddress **address */ + NULL, + 0, + &scms, + &nscm, + NULL, + cancellable, + error); + if (num_bytes_read != 1) + { + /* Handle situation where g_socket_receive_message() returns + * 0 bytes and not setting @error + */ + if (num_bytes_read == 0 && error != NULL && *error == NULL) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Expecting to read a single byte for receiving credentials but read zero bytes")); + } + goto out; + } + + if (nscm != 1) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Expecting 1 control message, got %d"), + nscm); + goto out; + } + + if (!G_IS_UNIX_CREDENTIALS_MESSAGE (scms[0])) + { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Unexpected type of ancillary data")); + goto out; + } + + ret = g_unix_credentials_message_get_credentials (G_UNIX_CREDENTIALS_MESSAGE (scms[0])); + g_object_ref (ret); + + out: + +#ifdef __linux__ + if (turn_off_so_passcreds) + { + gint opt_val; + opt_val = 0; + if (setsockopt (g_socket_get_fd (socket), + SOL_SOCKET, + SO_PASSCRED, + &opt_val, + sizeof opt_val) != 0) + { + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error while disabling SO_PASSCRED: %s"), + strerror (errno)); + goto out; + } + } +#endif + + if (scms != NULL) + { + for (n = 0; n < nscm; n++) + g_object_unref (scms[n]); + g_free (scms); + } + g_object_unref (socket); + return ret; +} diff --git a/gio/gunixconnection.h b/gio/gunixconnection.h index 7435e97..c38b0c9 100644 --- a/gio/gunixconnection.h +++ b/gio/gunixconnection.h @@ -71,6 +71,15 @@ gint g_unix_connection_receive_fd (GUnixCo GCancellable *cancellable, GError **error); +gboolean g_unix_connection_send_credentials (GUnixConnection *connection, + GCancellable *cancellable, + GError **error); + +GCredentials *g_unix_connection_receive_credentials (GUnixConnection *connection, + GCancellable *cancellable, + GError **error); + + G_END_DECLS #endif /* __G_UNIX_CONNECTION_H__ */ diff --git a/gio/gunixcredentialsmessage.c b/gio/gunixcredentialsmessage.c new file mode 100644 index 0000000..ece892c --- /dev/null +++ b/gio/gunixcredentialsmessage.c @@ -0,0 +1,392 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * Copyright (C) 2009 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * See the included COPYING file for more information. + * + * Authors: David Zeuthen + */ + +/** + * SECTION: gunixcredentialsmessage + * @title: GUnixCredentialsMessage + * @short_description: A GSocketControlMessage containing credentials + * @include: gio/gunixcredentialsmessage.h + * @see_also: #GUnixConnection, #GSocketControlMessage + * + * This #GSocketControlMessage contains a #GCredentials instance. It + * may be sent using g_socket_send_message() and received using + * g_socket_receive_message() over UNIX sockets (ie: sockets in the + * %G_SOCKET_FAMILY_UNIX family). + * + * For an easier way to send and receive credentials over + * stream-oriented UNIX sockets, see + * g_unix_connection_send_credentials() and + * g_unix_connection_receive_credentials(). To receive credentials of + * a foreign process connected to a socket, use + * g_socket_get_credentials(). + */ + +#include "config.h" + +/* ---------------------------------------------------------------------------------------------------- */ +#ifdef __linux__ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#define G_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 1 + +#elif defined(__FreeBSD__) +#include +#include +#include +#include +#include +#define G_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 1 +#else +/* TODO: please add support for your UNIX flavor */ +#define G_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 0 +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +#include +#include + +#include "gunixcredentialsmessage.h" +#include "gcredentials.h" + +#include "glibintl.h" + +struct _GUnixCredentialsMessagePrivate +{ + GCredentials *credentials; +}; + +enum +{ + PROP_0, + PROP_CREDENTIALS +}; + +G_DEFINE_TYPE (GUnixCredentialsMessage, g_unix_credentials_message, G_TYPE_SOCKET_CONTROL_MESSAGE); + +static gsize +g_unix_credentials_message_get_size (GSocketControlMessage *message) +{ +#ifdef __linux__ + return sizeof (struct ucred); +#elif defined(__FreeBSD__) + return sizeof (struct cmsgcred); +#else + return 0; +#endif +} + +static int +g_unix_credentials_message_get_level (GSocketControlMessage *message) +{ +#ifdef __linux__ + return SOL_SOCKET; +#elif defined(__FreeBSD__) + return SOL_SOCKET; +#else + return 0; +#endif +} + +static int +g_unix_credentials_message_get_msg_type (GSocketControlMessage *message) +{ +#ifdef __linux__ + return SCM_CREDENTIALS; +#elif defined(__FreeBSD__) + return SCM_CREDS; +#else + return 0; +#endif +} + +static GSocketControlMessage * +g_unix_credentials_message_deserialize (gint level, + gint type, + gsize size, + gpointer data) +{ + GSocketControlMessage *message; + + message = NULL; + +#ifdef __linux__ + { + GCredentials *credentials; + struct ucred *ucred; + + if (level != SOL_SOCKET || type != SCM_CREDENTIALS) + goto out; + + if (size != sizeof (struct ucred)) + { + g_warning ("Expected a struct ucred (%" G_GSIZE_FORMAT " bytes) but " + "got %" G_GSIZE_FORMAT " bytes of data", + sizeof (struct ucred), + size); + goto out; + } + + ucred = data; + + credentials = g_credentials_new (); + g_credentials_set_native (credentials, G_CREDENTIALS_TYPE_LINUX_UCRED, ucred); + message = g_unix_credentials_message_new_with_credentials (credentials); + g_object_unref (credentials); + out: + ; + } +#elif defined(__FreeBSD__) + { + GCredentials *credentials; + struct cmsgcred *cred; + + if (level != SOL_SOCKET || type != SCM_CREDS) + { + goto out; + } + if (size < CMSG_LEN (sizeof *cred)) + { + g_warning ("Expected a struct cmsgcred (%" G_GSIZE_FORMAT " bytes) but " + "got %" G_GSIZE_FORMAT " bytes of data", + CMSG_LEN (sizeof *cred), + size); + goto out; + } + + cred = data; + + credentials = g_credentials_new (); + g_credentials_set_native (credentials, G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED, cred); + message = g_unix_credentials_message_new_with_credentials (credentials); + g_object_unref (credentials); + out: + ; + } +#endif + + return message; +} + +static void +g_unix_credentials_message_serialize (GSocketControlMessage *_message, + gpointer data) +{ + GUnixCredentialsMessage *message = G_UNIX_CREDENTIALS_MESSAGE (_message); +#ifdef __linux__ + memcpy (data, + g_credentials_get_native (message->priv->credentials, + G_CREDENTIALS_TYPE_LINUX_UCRED), + sizeof (struct ucred)); +#elif defined(__FreeBSD__) + memcpy (data, + g_credentials_get_native (message->priv->credentials, + G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED), + sizeof (struct cmsgcred)); + +#endif +} + +static void +g_unix_credentials_message_finalize (GObject *object) +{ + GUnixCredentialsMessage *message = G_UNIX_CREDENTIALS_MESSAGE (object); + + if (message->priv->credentials != NULL) + g_object_unref (message->priv->credentials); + + G_OBJECT_CLASS (g_unix_credentials_message_parent_class)->finalize (object); +} + +static void +g_unix_credentials_message_init (GUnixCredentialsMessage *message) +{ + message->priv = G_TYPE_INSTANCE_GET_PRIVATE (message, + G_TYPE_UNIX_CREDENTIALS_MESSAGE, + GUnixCredentialsMessagePrivate); +} + +static void +g_unix_credentials_message_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GUnixCredentialsMessage *message = G_UNIX_CREDENTIALS_MESSAGE (object); + + switch (prop_id) + { + case PROP_CREDENTIALS: + g_value_set_object (value, message->priv->credentials); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_unix_credentials_message_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GUnixCredentialsMessage *message = G_UNIX_CREDENTIALS_MESSAGE (object); + + switch (prop_id) + { + case PROP_CREDENTIALS: + message->priv->credentials = g_value_dup_object (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_unix_credentials_message_constructed (GObject *object) +{ + GUnixCredentialsMessage *message = G_UNIX_CREDENTIALS_MESSAGE (object); + + if (message->priv->credentials == NULL) + message->priv->credentials = g_credentials_new (); + + if (G_OBJECT_CLASS (g_unix_credentials_message_parent_class)->constructed != NULL) + G_OBJECT_CLASS (g_unix_credentials_message_parent_class)->constructed (object); +} + +static void +g_unix_credentials_message_class_init (GUnixCredentialsMessageClass *class) +{ + GSocketControlMessageClass *scm_class; + GObjectClass *gobject_class; + + g_type_class_add_private (class, sizeof (GUnixCredentialsMessagePrivate)); + + gobject_class = G_OBJECT_CLASS (class); + gobject_class->get_property = g_unix_credentials_message_get_property; + gobject_class->set_property = g_unix_credentials_message_set_property; + gobject_class->finalize = g_unix_credentials_message_finalize; + gobject_class->constructed = g_unix_credentials_message_constructed; + + scm_class = G_SOCKET_CONTROL_MESSAGE_CLASS (class); + scm_class->get_size = g_unix_credentials_message_get_size; + scm_class->get_level = g_unix_credentials_message_get_level; + scm_class->get_type = g_unix_credentials_message_get_msg_type; + scm_class->serialize = g_unix_credentials_message_serialize; + scm_class->deserialize = g_unix_credentials_message_deserialize; + + /** + * GUnixCredentialsMessage:credentials: + * + * The credentials stored in the message. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_CREDENTIALS, + g_param_spec_object ("credentials", + P_("Credentials"), + P_("The credentials stored in the message"), + G_TYPE_CREDENTIALS, + G_PARAM_READABLE | + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_STATIC_NICK)); + +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_unix_credentials_message_is_supported: + * + * Checks if passing a #GCredential on a #GSocket is supported on this platform. + * + * Returns: %TRUE if supported, %FALSE otherwise + * + * Since: 2.26 + */ +gboolean +g_unix_credentials_message_is_supported (void) +{ + return G_UNIX_CREDENTIALS_MESSAGE_SUPPORTED; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/** + * g_unix_credentials_message_new: + * + * Creates a new #GUnixCredentialsMessage with credentials matching the current processes. + * + * Returns: a new #GUnixCredentialsMessage + * + * Since: 2.26 + */ +GSocketControlMessage * +g_unix_credentials_message_new (void) +{ + g_return_val_if_fail (g_unix_credentials_message_is_supported (), NULL); + return g_object_new (G_TYPE_UNIX_CREDENTIALS_MESSAGE, + NULL); +} + +/** + * g_unix_credentials_message_new_with_credentials: + * @credentials: A #GCredentials object. + * + * Creates a new #GUnixCredentialsMessage holding @credentials. + * + * Returns: a new #GUnixCredentialsMessage + * + * Since: 2.26 + */ +GSocketControlMessage * +g_unix_credentials_message_new_with_credentials (GCredentials *credentials) +{ + g_return_val_if_fail (G_IS_CREDENTIALS (credentials), NULL); + g_return_val_if_fail (g_unix_credentials_message_is_supported (), NULL); + return g_object_new (G_TYPE_UNIX_CREDENTIALS_MESSAGE, + "credentials", credentials, + NULL); +} + +/** + * g_unix_credentials_message_get_credentials: + * @message: A #GUnixCredentialsMessage. + * + * Gets the credentials stored in @message. + * + * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message. + * + * Since: 2.26 + */ +GCredentials * +g_unix_credentials_message_get_credentials (GUnixCredentialsMessage *message) +{ + g_return_val_if_fail (G_IS_UNIX_CREDENTIALS_MESSAGE (message), NULL); + return message->priv->credentials; +} diff --git a/gio/gunixcredentialsmessage.h b/gio/gunixcredentialsmessage.h new file mode 100644 index 0000000..8dd660c --- /dev/null +++ b/gio/gunixcredentialsmessage.h @@ -0,0 +1,82 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2010 Red Hat, Inc. + * Copyright (C) 2009 Codethink Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the licence or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: David Zeuthen + */ + +#ifndef __G_UNIX_CREDENTIALS_MESSAGE_H__ +#define __G_UNIX_CREDENTIALS_MESSAGE_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_UNIX_CREDENTIALS_MESSAGE (g_unix_credentials_message_get_type ()) +#define G_UNIX_CREDENTIALS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_UNIX_CREDENTIALS_MESSAGE, GUnixCredentialsMessage)) +#define G_UNIX_CREDENTIALS_MESSAGE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), G_TYPE_UNIX_CREDENTIALS_MESSAGE, GUnixCredentialsMessageClass)) +#define G_IS_UNIX_CREDENTIALS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_UNIX_CREDENTIALS_MESSAGE)) +#define G_IS_UNIX_CREDENTIALS_MESSAGE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), G_TYPE_UNIX_CREDENTIALS_MESSAGE)) +#define G_UNIX_CREDENTIALS_MESSAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_UNIX_CREDENTIALS_MESSAGE, GUnixCredentialsMessageClass)) + +typedef struct _GUnixCredentialsMessagePrivate GUnixCredentialsMessagePrivate; +typedef struct _GUnixCredentialsMessageClass GUnixCredentialsMessageClass; + +/** + * GUnixCredentialsMessageClass: + * + * Class structure for #GUnixCredentialsMessage. + * + * Since: 2.26 + */ +struct _GUnixCredentialsMessageClass +{ + GSocketControlMessageClass parent_class; + + /*< private >*/ + + /* Padding for future expansion */ + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); +}; + +/** + * GUnixCredentialsMessage: + * + * The #GUnixCredentialsMessage structure contains only private data + * and should only be accessed using the provided API. + * + * Since: 2.26 + */ +struct _GUnixCredentialsMessage +{ + GSocketControlMessage parent_instance; + GUnixCredentialsMessagePrivate *priv; +}; + +GType g_unix_credentials_message_get_type (void) G_GNUC_CONST; +GSocketControlMessage *g_unix_credentials_message_new (void); +GSocketControlMessage *g_unix_credentials_message_new_with_credentials (GCredentials *credentials); +GCredentials *g_unix_credentials_message_get_credentials (GUnixCredentialsMessage *message); + +gboolean g_unix_credentials_message_is_supported (void); + +G_END_DECLS + +#endif /* __G_UNIX_CREDENTIALS_MESSAGE_H__ */ diff --git a/gio/gunixfdlist.c b/gio/gunixfdlist.c index 026c127..e9425db 100644 --- a/gio/gunixfdlist.c +++ b/gio/gunixfdlist.c @@ -15,7 +15,8 @@ /** * SECTION: gunixfdlist * @title: GUnixFDList - * @short_description: An object containing a set of file descriptors + * @short_description: An object containing a set of UNIX file descriptors + * @include: gio/gunixfdlist.h * @see_also: #GUnixFDMessage * * A #GUnixFDList contains a list of file descriptors. It owns the file @@ -24,6 +25,10 @@ * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message() * and received using g_socket_receive_message(). + * + * Note that <gio/gunixfdlist.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. */ #define _GNU_SOURCE /* for F_DUPFD_CLOEXEC */ @@ -40,7 +45,6 @@ #include "gunixfdlist.h" #include "gioerror.h" -#include "gioalias.h" G_DEFINE_TYPE (GUnixFDList, g_unix_fd_list, G_TYPE_OBJECT) @@ -391,6 +395,3 @@ g_unix_fd_list_get_length (GUnixFDList *list) return list->priv->nfd; } - -#define __G_UNIX_FD_LIST_C__ -#include "gioaliasdef.c" diff --git a/gio/gunixfdlist.h b/gio/gunixfdlist.h index 638b685..12b6ee8 100644 --- a/gio/gunixfdlist.h +++ b/gio/gunixfdlist.h @@ -23,7 +23,7 @@ #ifndef __G_UNIX_FD_LIST_H__ #define __G_UNIX_FD_LIST_H__ -#include +#include G_BEGIN_DECLS @@ -41,7 +41,6 @@ G_BEGIN_DECLS typedef struct _GUnixFDListPrivate GUnixFDListPrivate; typedef struct _GUnixFDListClass GUnixFDListClass; -typedef struct _GUnixFDList GUnixFDList; struct _GUnixFDListClass { diff --git a/gio/gunixfdmessage.c b/gio/gunixfdmessage.c index bb37d5f..7dc0f8b 100644 --- a/gio/gunixfdmessage.c +++ b/gio/gunixfdmessage.c @@ -15,18 +15,23 @@ /** * SECTION: gunixfdmessage * @title: GUnixFDMessage - * @short_description: A GSocketControlMessage containing a #GUnixFDList + * @short_description: A GSocketControlMessage containing a GUnixFDList + * @include: gio/gunixfdmessage.h * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage * - * This #GSocketControlMessage contains a #GUnixFDList. It may be sent - * using g_socket_send_message() and received using + * This #GSocketControlMessage contains a #GUnixFDList. + * It may be sent using g_socket_send_message() and received using * g_socket_receive_message() over UNIX sockets (ie: sockets in the - * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied + * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied * between processes by the kernel. * * For an easier way to send and receive file descriptors over * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and * g_unix_connection_receive_fd(). + * + * Note that <gio/gunixfdmessage.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. **/ #include "config.h" @@ -39,9 +44,9 @@ #include #include "gunixfdmessage.h" +#include "gunixfdlist.h" #include "gioerror.h" -#include "gioalias.h" G_DEFINE_TYPE (GUnixFDMessage, g_unix_fd_message, @@ -152,7 +157,7 @@ g_unix_fd_message_set_property (GObject *object, guint prop_id, * return a reference to the caller, but the returned list is valid for * the lifetime of @message. * - * Returns: the #GUnixFDList from @message + * Returns: (transfer none): the #GUnixFDList from @message * * Since: 2.24 **/ @@ -280,7 +285,7 @@ gint * g_unix_fd_message_steal_fds (GUnixFDMessage *message, gint *length) { - g_return_val_if_fail (G_UNIX_FD_MESSAGE (message), FALSE); + g_return_val_if_fail (G_UNIX_FD_MESSAGE (message), NULL); return g_unix_fd_list_steal_fds (message->priv->list, length); } @@ -313,6 +318,3 @@ g_unix_fd_message_append_fd (GUnixFDMessage *message, return g_unix_fd_list_append (message->priv->list, fd, error) > 0; } - -#define __G_UNIX_FD_MESSAGE_C__ -#include "gioaliasdef.c" diff --git a/gio/gunixfdmessage.h b/gio/gunixfdmessage.h index 44b47c1..3bfa058 100644 --- a/gio/gunixfdmessage.h +++ b/gio/gunixfdmessage.h @@ -23,8 +23,8 @@ #ifndef __G_UNIX_FD_MESSAGE_H__ #define __G_UNIX_FD_MESSAGE_H__ -#include #include +#include G_BEGIN_DECLS diff --git a/gio/gunixinputstream.c b/gio/gunixinputstream.c index 4253e50..43a9247 100644 --- a/gio/gunixinputstream.c +++ b/gio/gunixinputstream.c @@ -38,7 +38,6 @@ #include "gasynchelper.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gunixinputstream @@ -50,8 +49,8 @@ * UNIX file descriptor, including asynchronous operations. The file * descriptor must be selectable, so it doesn't work with opened files. * - * Note that <gio/gunixinputstream.h> belongs - * to the UNIX-specific GIO interfaces, thus you have to use the + * Note that <gio/gunixinputstream.h> belongs + * to the UNIX-specific GIO interfaces, thus you have to use the * gio-unix-2.0.pc pkg-config file when using it. */ @@ -61,7 +60,12 @@ enum { PROP_CLOSE_FD }; -G_DEFINE_TYPE (GUnixInputStream, g_unix_input_stream, G_TYPE_INPUT_STREAM); +static void g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); + +G_DEFINE_TYPE_WITH_CODE (GUnixInputStream, g_unix_input_stream, G_TYPE_INPUT_STREAM, + G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM, + g_unix_input_stream_pollable_iface_init) + ); struct _GUnixInputStreamPrivate { int fd; @@ -112,6 +116,9 @@ static gboolean g_unix_input_stream_close_finish (GInputStream *stream, GAsyncResult *result, GError **error); +static gboolean g_unix_input_stream_pollable_is_readable (GPollableInputStream *stream); +static GSource *g_unix_input_stream_pollable_create_source (GPollableInputStream *stream, + GCancellable *cancellable); static void g_unix_input_stream_finalize (GObject *object) @@ -176,6 +183,13 @@ g_unix_input_stream_class_init (GUnixInputStreamClass *klass) } static void +g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) +{ + iface->is_readable = g_unix_input_stream_pollable_is_readable; + iface->create_source = g_unix_input_stream_pollable_create_source; +} + +static void g_unix_input_stream_set_property (GObject *object, guint prop_id, const GValue *value, @@ -423,9 +437,9 @@ typedef struct { } ReadAsyncData; static gboolean -read_async_cb (ReadAsyncData *data, +read_async_cb (int fd, GIOCondition condition, - int fd) + ReadAsyncData *data) { GSimpleAsyncResult *simple; GError *error = NULL; @@ -463,10 +477,7 @@ read_async_cb (ReadAsyncData *data, g_simple_async_result_set_op_res_gssize (simple, count_read); if (count_read == -1) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); /* Complete immediately, not in idle, since we're already in a mainloop callout */ g_simple_async_result_complete (simple); @@ -501,6 +512,7 @@ g_unix_input_stream_read_async (GInputStream *stream, source = _g_fd_source_new (unix_stream->priv->fd, G_IO_IN, cancellable); + g_source_set_name (source, "GUnixInputStream"); g_source_set_callback (source, (GSourceFunc)read_async_cb, data, g_free); g_source_attach (source, g_main_context_get_thread_default ()); @@ -601,10 +613,7 @@ close_async_cb (CloseAsyncData *data) g_unix_input_stream_close_async); if (!result) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); /* Complete immediately, not in idle, since we're already in a mainloop callout */ g_simple_async_result_complete (simple); @@ -644,5 +653,36 @@ g_unix_input_stream_close_finish (GInputStream *stream, return TRUE; } -#define __G_UNIX_INPUT_STREAM_C__ -#include "gioaliasdef.c" +static gboolean +g_unix_input_stream_pollable_is_readable (GPollableInputStream *stream) +{ + GUnixInputStream *unix_stream = G_UNIX_INPUT_STREAM (stream); + GPollFD poll_fd; + gint result; + + poll_fd.fd = unix_stream->priv->fd; + poll_fd.events = G_IO_IN; + + do + result = g_poll (&poll_fd, 1, 0); + while (result == -1 && errno == EINTR); + + return poll_fd.revents != 0; +} + +static GSource * +g_unix_input_stream_pollable_create_source (GPollableInputStream *stream, + GCancellable *cancellable) +{ + GUnixInputStream *unix_stream = G_UNIX_INPUT_STREAM (stream); + GSource *inner_source, *pollable_source; + + pollable_source = g_pollable_source_new (G_OBJECT (stream)); + + inner_source = _g_fd_source_new (unix_stream->priv->fd, G_IO_IN, cancellable); + g_source_set_dummy_callback (inner_source); + g_source_add_child_source (pollable_source, inner_source); + g_source_unref (inner_source); + + return pollable_source; +} diff --git a/gio/gunixmount.c b/gio/gunixmount.c index c475ff9..9da2474 100644 --- a/gio/gunixmount.c +++ b/gio/gunixmount.c @@ -45,7 +45,6 @@ /* for BUFSIZ */ #include -#include "gioalias.h" struct _GUnixMount { GObject parent; @@ -371,7 +370,7 @@ eject_unmount_do_cb (gpointer user_data) handle_error: if (error != NULL) { GSimpleAsyncResult *simple; - simple = g_simple_async_result_new_from_error (G_OBJECT (data->unix_mount), + simple = g_simple_async_result_new_take_error (G_OBJECT (data->unix_mount), data->callback, data->user_data, error); @@ -385,7 +384,6 @@ handle_error: g_io_channel_unref (data->error_channel); g_strfreev (data->argv); - g_error_free (error); g_free (data); } diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c index 48dc7c5..f110351 100644 --- a/gio/gunixmounts.c +++ b/gio/gunixmounts.c @@ -56,19 +56,18 @@ #include "glibintl.h" #include "gthemedicon.h" -#include "gioalias.h" static const char *_resolve_dev_root (void); /** * SECTION:gunixmounts * @include: gio/gunixmounts.h - * @short_description: Unix Mounts - * + * @short_description: UNIX mounts + * * Routines for managing mounted UNIX mount points and paths. * - * Note that <gio/gunixmounts.h> belongs to the - * UNIX-specific GIO interfaces, thus you have to use the + * Note that <gio/gunixmounts.h> belongs to the + * UNIX-specific GIO interfaces, thus you have to use the * gio-unix-2.0.pc pkg-config file when using it. */ @@ -243,18 +242,19 @@ g_unix_is_mount_path_system_internal (const char *mount_path) "/proc", "/sbin", "/net", + "/sys", NULL }; if (is_in (mount_path, ignore_mountpoints)) return TRUE; - if (g_str_has_prefix (mount_path, "/dev") || - g_str_has_prefix (mount_path, "/proc") || - g_str_has_prefix (mount_path, "/sys")) + if (g_str_has_prefix (mount_path, "/dev/") || + g_str_has_prefix (mount_path, "/proc/") || + g_str_has_prefix (mount_path, "/sys/")) return TRUE; - if (strstr (mount_path, "/.gvfs") != NULL) + if (g_str_has_suffix (mount_path, "/.gvfs")) return TRUE; return FALSE; @@ -1076,14 +1076,14 @@ get_mount_points_timestamp (void) /** * g_unix_mounts_get: - * @time_read: guint64 to contain a timestamp. - * - * Gets a #GList of strings containing the unix mounts. - * If @time_read is set, it will be filled with the mount - * timestamp, allowing for checking if the mounts have changed + * @time_read: (allow-none): guint64 to contain a timestamp, or %NULL + * + * Gets a #GList of #GUnixMountEntry containing the unix mounts. + * If @time_read is set, it will be filled with the mount + * timestamp, allowing for checking if the mounts have changed * with g_unix_mounts_changed_since(). - * - * Returns: a #GList of the UNIX mounts. + * + * Returns: (element-type utf8) (transfer full): a #GList of the UNIX mounts. **/ GList * g_unix_mounts_get (guint64 *time_read) @@ -1103,7 +1103,7 @@ g_unix_mounts_get (guint64 *time_read) * is set, it will be filled with a unix timestamp for checking * if the mounts have changed since with g_unix_mounts_changed_since(). * - * Returns: a #GUnixMount. + * Returns: (transfer full): a #GUnixMount. **/ GUnixMountEntry * g_unix_mount_at (const char *mount_path, @@ -1131,14 +1131,14 @@ g_unix_mount_at (const char *mount_path, /** * g_unix_mount_points_get: - * @time_read: guint64 to contain a timestamp. - * - * Gets a #GList of strings containing the unix mount points. + * @time_read: (allow-none): guint64 to contain a timestamp. + * + * Gets a #GList of #GUnixMountPoint containing the unix mount points. * If @time_read is set, it will be filled with the mount timestamp, - * allowing for checking if the mounts have changed with + * allowing for checking if the mounts have changed with * g_unix_mounts_points_changed_since(). - * - * Returns: a #GList of the UNIX mountpoints. + * + * Returns: (element-type utf8) (transfer full): a #GList of the UNIX mountpoints. **/ GList * g_unix_mount_points_get (guint64 *time_read) @@ -1856,7 +1856,7 @@ g_unix_mount_guess_name (GUnixMountEntry *mount_entry) * * Guesses the icon of a Unix mount. * - * Returns: a #GIcon + * Returns: (transfer full): a #GIcon */ GIcon * g_unix_mount_guess_icon (GUnixMountEntry *mount_entry) @@ -1893,7 +1893,7 @@ g_unix_mount_point_guess_name (GUnixMountPoint *mount_point) * * Guesses the icon of a Unix mount point. * - * Returns: a #GIcon + * Returns: (transfer full): a #GIcon */ GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point) @@ -1944,6 +1944,10 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry) mount_path = mount_entry->mount_path; if (mount_path != NULL) { + /* Hide mounts within a dot path, suppose it was a purpose to hide this mount */ + if (g_strstr_len (mount_path, -1, "/.") != NULL) + return FALSE; + if (g_str_has_prefix (mount_path, "/media/")) { char *path; @@ -2191,6 +2195,3 @@ found: return real_dev_root; } #endif - -#define __G_UNIX_MOUNTS_C__ -#include "gioaliasdef.c" diff --git a/gio/gunixoutputstream.c b/gio/gunixoutputstream.c index c294b86..81021be 100644 --- a/gio/gunixoutputstream.c +++ b/gio/gunixoutputstream.c @@ -38,19 +38,18 @@ #include "gasynchelper.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gunixoutputstream - * @short_description: Streaming output operations for Unix file descriptors + * @short_description: Streaming output operations for UNIX file descriptors * @include: gio/gunixoutputstream.h * @see_also: #GOutputStream * * #GUnixOutputStream implements #GOutputStream for writing to a - * unix file descriptor, including asynchronous operations. The file + * UNIX file descriptor, including asynchronous operations. The file * descriptor must be selectable, so it doesn't work with opened files. * - * Note that <gio/gunixoutputstream.h> belongs + * Note that <gio/gunixoutputstream.h> belongs * to the UNIX-specific GIO interfaces, thus you have to use the * gio-unix-2.0.pc pkg-config file when using it. */ @@ -61,8 +60,12 @@ enum { PROP_CLOSE_FD }; -G_DEFINE_TYPE (GUnixOutputStream, g_unix_output_stream, G_TYPE_OUTPUT_STREAM); +static void g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); +G_DEFINE_TYPE_WITH_CODE (GUnixOutputStream, g_unix_output_stream, G_TYPE_OUTPUT_STREAM, + G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM, + g_unix_output_stream_pollable_iface_init) + ); struct _GUnixOutputStreamPrivate { int fd; @@ -104,6 +107,9 @@ static gboolean g_unix_output_stream_close_finish (GOutputStream *stream, GAsyncResult *result, GError **error); +static gboolean g_unix_output_stream_pollable_is_writable (GPollableOutputStream *stream); +static GSource *g_unix_output_stream_pollable_create_source (GPollableOutputStream *stream, + GCancellable *cancellable); static void g_unix_output_stream_finalize (GObject *object) @@ -162,6 +168,13 @@ g_unix_output_stream_class_init (GUnixOutputStreamClass *klass) } static void +g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) +{ + iface->is_writable = g_unix_output_stream_pollable_is_writable; + iface->create_source = g_unix_output_stream_pollable_create_source; +} + +static void g_unix_output_stream_set_property (GObject *object, guint prop_id, const GValue *value, @@ -410,9 +423,9 @@ typedef struct { } WriteAsyncData; static gboolean -write_async_cb (WriteAsyncData *data, +write_async_cb (int fd, GIOCondition condition, - int fd) + WriteAsyncData *data) { GSimpleAsyncResult *simple; GError *error = NULL; @@ -436,7 +449,7 @@ write_async_cb (WriteAsyncData *data, g_set_error (&error, G_IO_ERROR, g_io_error_from_errno (errsv), - _("Error reading from unix: %s"), + _("Error writing to unix: %s"), g_strerror (errsv)); } break; @@ -450,10 +463,7 @@ write_async_cb (WriteAsyncData *data, g_simple_async_result_set_op_res_gssize (simple, count_written); if (count_written == -1) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); /* Complete immediately, not in idle, since we're already in a mainloop callout */ g_simple_async_result_complete (simple); @@ -488,6 +498,7 @@ g_unix_output_stream_write_async (GOutputStream *stream, source = _g_fd_source_new (unix_stream->priv->fd, G_IO_OUT, cancellable); + g_source_set_name (source, "GUnixOutputStream"); g_source_set_callback (source, (GSourceFunc)write_async_cb, data, g_free); g_source_attach (source, g_main_context_get_thread_default ()); @@ -557,10 +568,7 @@ close_async_cb (CloseAsyncData *data) g_unix_output_stream_close_async); if (!result) - { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + g_simple_async_result_take_error (simple, error); /* Complete immediately, not in idle, since we're already in a mainloop callout */ g_simple_async_result_complete (simple); @@ -600,5 +608,36 @@ g_unix_output_stream_close_finish (GOutputStream *stream, return TRUE; } -#define __G_UNIX_OUTPUT_STREAM_C__ -#include "gioaliasdef.c" +static gboolean +g_unix_output_stream_pollable_is_writable (GPollableOutputStream *stream) +{ + GUnixOutputStream *unix_stream = G_UNIX_OUTPUT_STREAM (stream); + GPollFD poll_fd; + gint result; + + poll_fd.fd = unix_stream->priv->fd; + poll_fd.events = G_IO_OUT; + + do + result = g_poll (&poll_fd, 1, 0); + while (result == -1 && errno == EINTR); + + return poll_fd.revents != 0; +} + +static GSource * +g_unix_output_stream_pollable_create_source (GPollableOutputStream *stream, + GCancellable *cancellable) +{ + GUnixOutputStream *unix_stream = G_UNIX_OUTPUT_STREAM (stream); + GSource *inner_source, *pollable_source; + + pollable_source = g_pollable_source_new (G_OBJECT (stream)); + + inner_source = _g_fd_source_new (unix_stream->priv->fd, G_IO_OUT, cancellable); + g_source_set_dummy_callback (inner_source); + g_source_add_child_source (pollable_source, inner_source); + g_source_unref (inner_source); + + return pollable_source; +} diff --git a/gio/gunixresolver.c b/gio/gunixresolver.c index 2155c66..9f430ec 100644 --- a/gio/gunixresolver.c +++ b/gio/gunixresolver.c @@ -34,7 +34,6 @@ #include "gsimpleasyncresult.h" #include "gsocketaddress.h" -#include "gioalias.h" G_DEFINE_TYPE (GUnixResolver, g_unix_resolver, G_TYPE_THREADED_RESOLVER) @@ -233,8 +232,7 @@ request_cancelled (GCancellable *cancellable, req->qy = NULL; g_cancellable_set_error_if_cancelled (cancellable, &error); - g_simple_async_result_set_from_error (req->async_result, error); - g_error_free (error); + g_simple_async_result_take_error (req->async_result, error); g_unix_resolver_request_complete (req); } @@ -304,10 +302,7 @@ lookup_by_name_process (GUnixResolverRequest *req) freeaddrinfo (res); if (error) - { - g_simple_async_result_set_from_error (req->async_result, error); - g_error_free (error); - } + g_simple_async_result_take_error (req->async_result, error); } static void @@ -345,7 +340,8 @@ lookup_by_name_finish (GResolver *resolver, GUnixResolverRequest *req; GList *addresses; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_name_async), FALSE); + g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_name_async), NULL); + simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) @@ -373,10 +369,7 @@ lookup_by_address_process (GUnixResolverRequest *req) host, retval, &error); if (error) - { - g_simple_async_result_set_from_error (req->async_result, error); - g_error_free (error); - } + g_simple_async_result_take_error (req->async_result, error); } static void @@ -419,7 +412,8 @@ lookup_by_address_finish (GResolver *resolver, GUnixResolverRequest *req; gchar *name; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_address_async), FALSE); + g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_address_async), NULL); + simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) @@ -452,10 +446,7 @@ lookup_service_process (GUnixResolverRequest *req) _g_asyncns_freeanswer (answer); if (error) - { - g_simple_async_result_set_from_error (req->async_result, error); - g_error_free (error); - } + g_simple_async_result_take_error (req->async_result, error); } static void @@ -492,7 +483,8 @@ lookup_service_finish (GResolver *resolver, GUnixResolverRequest *req; GList *targets; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_service_async), FALSE); + g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_service_async), NULL); + simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) @@ -522,6 +514,3 @@ g_unix_resolver_class_init (GUnixResolverClass *unix_class) object_class->finalize = g_unix_resolver_finalize; } - -#define __G_UNIX_RESOLVER_C__ -#include "gioaliasdef.c" diff --git a/gio/gunixsocketaddress.c b/gio/gunixsocketaddress.c index 89cc643..a1e06b1 100644 --- a/gio/gunixsocketaddress.c +++ b/gio/gunixsocketaddress.c @@ -29,13 +29,26 @@ #include "glibintl.h" #include "gnetworkingprivate.h" -#include "gioalias.h" /** * SECTION:gunixsocketaddress * @short_description: UNIX GSocketAddress + * @include: gio/gunixsocketaddress.h * - * Support for UNIX-domain (aka local) sockets. + * Support for UNIX-domain (also known as local) sockets. + * + * UNIX domain sockets are generally visible in the filesystem. + * However, some systems support abstract socket names which are not + * visible in the filesystem and not affected by the filesystem + * permissions, visibility, etc. Currently this is only supported + * under Linux. If you attempt to use abstract sockets on other + * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED + * errors. You can use g_unix_socket_address_abstract_names_supported() + * to see if abstract names are supported. + * + * Note that <gio/gunixsocketaddress.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. */ /** @@ -52,6 +65,7 @@ enum PROP_PATH, PROP_PATH_AS_ARRAY, PROP_ABSTRACT, + PROP_ADDRESS_TYPE }; #define UNIX_PATH_MAX sizeof (((struct sockaddr_un *) 0)->sun_path) @@ -62,7 +76,7 @@ struct _GUnixSocketAddressPrivate we can guarantee zero termination of abstract pathnames in the get_path() API */ gsize path_len; /* Not including any terminating zeros */ - gboolean abstract; + GUnixSocketAddressType address_type; }; static void @@ -96,10 +110,6 @@ g_unix_socket_address_set_property (GObject *object, /* Clip to fit in UNIX_PATH_MAX with zero termination or first byte */ len = MIN (array->len, UNIX_PATH_MAX-1); - /* Remove any trailing zeros from path_len */ - while (len > 0 && array->data[len-1] == 0) - len--; - memcpy (address->priv->path, array->data, len); address->priv->path[len] = 0; /* Ensure null-terminated */ address->priv->path_len = len; @@ -107,7 +117,26 @@ g_unix_socket_address_set_property (GObject *object, break; case PROP_ABSTRACT: - address->priv->abstract = g_value_get_boolean (value); + /* If the caller already set PROP_ADDRESS_TYPE, don't let the + * default value of PROP_ABSTRACT overwrite it. + */ + if (address->priv->address_type != G_UNIX_SOCKET_ADDRESS_INVALID) + return; + + if (g_value_get_boolean (value)) + address->priv->address_type = G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED; + else + address->priv->address_type = G_UNIX_SOCKET_ADDRESS_PATH; + break; + + case PROP_ADDRESS_TYPE: + /* If the caller already set PROP_ABSTRACT, don't let the + * default value of PROP_ADDRESS_TYPE overwrite it. + */ + if (address->priv->address_type != G_UNIX_SOCKET_ADDRESS_INVALID) + return; + + address->priv->address_type = g_value_get_enum (value); break; default: @@ -137,7 +166,13 @@ g_unix_socket_address_get_property (GObject *object, break; case PROP_ABSTRACT: - g_value_set_boolean (value, address->priv->abstract); + g_value_set_boolean (value, (address->priv->address_type == G_UNIX_SOCKET_ADDRESS_ABSTRACT || + address->priv->address_type == G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED)); + + break; + + case PROP_ADDRESS_TYPE: + g_value_set_enum (value, address->priv->address_type); break; default: @@ -156,7 +191,17 @@ g_unix_socket_address_get_family (GSocketAddress *address) static gssize g_unix_socket_address_get_native_size (GSocketAddress *address) { - return sizeof (struct sockaddr_un); + GUnixSocketAddress *addr = G_UNIX_SOCKET_ADDRESS (address); + + switch (addr->priv->address_type) + { + case G_UNIX_SOCKET_ADDRESS_ANONYMOUS: + return G_STRUCT_OFFSET(struct sockaddr_un, sun_path); + case G_UNIX_SOCKET_ADDRESS_ABSTRACT: + return G_STRUCT_OFFSET(struct sockaddr_un, sun_path) + addr->priv->path_len + 1; + default: + return sizeof (struct sockaddr_un); + } } static gboolean @@ -167,32 +212,43 @@ g_unix_socket_address_to_native (GSocketAddress *address, { GUnixSocketAddress *addr = G_UNIX_SOCKET_ADDRESS (address); struct sockaddr_un *sock; + gssize socklen; - if (destlen < sizeof (*sock)) + socklen = g_unix_socket_address_get_native_size (address); + if (destlen < socklen) { g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE, _("Not enough space for socket address")); return FALSE; } - if (addr->priv->abstract && - !g_unix_socket_address_abstract_names_supported ()) - { - g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Abstract unix domain socket addresses not supported on this system")); - return FALSE; - } - sock = (struct sockaddr_un *) dest; + memset (sock, 0, socklen); sock->sun_family = AF_UNIX; - memset (sock->sun_path, 0, sizeof (sock->sun_path)); - if (addr->priv->abstract) + + switch (addr->priv->address_type) { + case G_UNIX_SOCKET_ADDRESS_INVALID: + case G_UNIX_SOCKET_ADDRESS_ANONYMOUS: + break; + + case G_UNIX_SOCKET_ADDRESS_PATH: + strcpy (sock->sun_path, addr->priv->path); + break; + + case G_UNIX_SOCKET_ADDRESS_ABSTRACT: + case G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED: + if (!g_unix_socket_address_abstract_names_supported ()) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Abstract unix domain socket addresses not supported on this system")); + return FALSE; + } + sock->sun_path[0] = 0; memcpy (sock->sun_path+1, addr->priv->path, addr->priv->path_len); + break; } - else - strcpy (sock->sun_path, addr->priv->path); return TRUE; } @@ -229,6 +285,15 @@ g_unix_socket_address_class_init (GUnixSocketAddressClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + /** + * GUnixSocketAddress:abstract: + * + * Whether or not this is an abstract address + * + * Deprecated: Use #GUnixSocketAddress:address-type, which + * distinguishes between zero-padded and non-zero-padded + * abstract addresses. + */ g_object_class_install_property (gobject_class, PROP_ABSTRACT, g_param_spec_boolean ("abstract", P_("Abstract"), @@ -237,6 +302,15 @@ g_unix_socket_address_class_init (GUnixSocketAddressClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_ADDRESS_TYPE, + g_param_spec_enum ("address-type", + P_("Address type"), + P_("The type of UNIX socket address"), + G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, + G_UNIX_SOCKET_ADDRESS_PATH, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); } static void @@ -248,6 +322,7 @@ g_unix_socket_address_init (GUnixSocketAddress *address) memset (address->priv->path, 0, sizeof (address->priv->path)); address->priv->path_len = -1; + address->priv->address_type = G_UNIX_SOCKET_ADDRESS_INVALID; } /** @@ -277,35 +352,71 @@ g_unix_socket_address_new (const gchar *path) * @path: the abstract name * @path_len: the length of @path, or -1 * - * Creates a new abstract #GUnixSocketAddress for @path. + * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED + * #GUnixSocketAddress for @path. * - * Unix domain sockets are generally visible in the filesystem. However, some - * systems support abstract socket name which are not visible in the - * filesystem and not affected by the filesystem permissions, visibility, etc. + * Returns: a new #GUnixSocketAddress + * + * Deprecated: Use g_unix_socket_address_new_with_type(). + */ +GSocketAddress * +g_unix_socket_address_new_abstract (const gchar *path, + gint path_len) +{ + return g_unix_socket_address_new_with_type (path, path_len, + G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED); +} + +/** + * g_unix_socket_address_new_with_type: + * @path: the name + * @path_len: the length of @path, or -1 + * @type: a #GUnixSocketAddressType + * + * Creates a new #GUnixSocketAddress of type @type with name @path. + * + * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to + * calling g_unix_socket_address_new(). + * + * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len + * bytes of @path will be copied to the socket's path, and only those + * bytes will be considered part of the name. (If @path_len is -1, + * then @path is assumed to be NUL-terminated.) For example, if @path + * was "test", then calling g_socket_address_get_native_size() on the + * returned socket would return 7 (2 bytes of overhead, 1 byte for the + * abstract-socket indicator byte, and 4 bytes for the name "test"). * - * Note that not all systems (really only Linux) support abstract - * socket names, so if you use them on other systems function calls may - * return %G_IO_ERROR_NOT_SUPPORTED errors. You can use - * g_unix_socket_address_abstract_names_supported() to see if abstract - * names are supported. + * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then + * @path_len bytes of @path will be copied to the socket's path, the + * rest of the path will be padded with 0 bytes, and the entire + * zero-padded buffer will be considered the name. (As above, if + * @path_len is -1, then @path is assumed to be NUL-terminated.) In + * this case, g_socket_address_get_native_size() will always return + * the full size of a struct sockaddr_un, although + * g_unix_socket_address_get_path_len() will still return just the + * length of @path. * - * If @path_len is -1 then @path is assumed to be a zero terminated - * string (although in general abstract names need not be zero terminated - * and can have embedded nuls). All bytes after @path_len up to the max size - * of an abstract unix domain name is filled with zero bytes. + * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over + * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course, + * when connecting to a server created by another process, you must + * use the appropriate type corresponding to how that process created + * its listening socket. * * Returns: a new #GUnixSocketAddress * - * Since: 2.22 + * Since: 2.26 */ GSocketAddress * -g_unix_socket_address_new_abstract (const gchar *path, - int path_len) +g_unix_socket_address_new_with_type (const gchar *path, + gint path_len, + GUnixSocketAddressType type) { GSocketAddress *address; GByteArray *array; - if (path_len == -1) + if (type == G_UNIX_SOCKET_ADDRESS_ANONYMOUS) + path_len = 0; + else if (path_len == -1) path_len = strlen (path); array = g_byte_array_sized_new (path_len); @@ -314,7 +425,7 @@ g_unix_socket_address_new_abstract (const gchar *path, address = g_object_new (G_TYPE_UNIX_SOCKET_ADDRESS, "path-as-array", array, - "abstract", TRUE, + "address-type", type, NULL); g_byte_array_unref (array); @@ -362,19 +473,38 @@ g_unix_socket_address_get_path_len (GUnixSocketAddress *address) } /** + * g_unix_socket_address_get_address_type: + * @address: a #GInetSocketAddress + * + * Gets @address's type. + * + * Returns: a #GUnixSocketAddressType + * + * Since: 2.26 + */ +GUnixSocketAddressType +g_unix_socket_address_get_address_type (GUnixSocketAddress *address) +{ + return address->priv->address_type; +} + +/** * g_unix_socket_address_get_is_abstract: * @address: a #GInetSocketAddress * - * Gets @address's path. + * Tests if @address is abstract. * * Returns: %TRUE if the address is abstract, %FALSE otherwise * * Since: 2.22 + * + * Deprecated: Use g_unix_socket_address_get_address_type() */ gboolean g_unix_socket_address_get_is_abstract (GUnixSocketAddress *address) { - return address->priv->abstract; + return (address->priv->address_type == G_UNIX_SOCKET_ADDRESS_ABSTRACT || + address->priv->address_type == G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED); } /** @@ -395,6 +525,3 @@ g_unix_socket_address_abstract_names_supported (void) return FALSE; #endif } - -#define __G_UNIX_SOCKET_ADDRESS_C__ -#include "gioaliasdef.c" diff --git a/gio/gunixsocketaddress.h b/gio/gunixsocketaddress.h index fabddd8..161d898 100644 --- a/gio/gunixsocketaddress.h +++ b/gio/gunixsocketaddress.h @@ -55,11 +55,19 @@ struct _GUnixSocketAddressClass GType g_unix_socket_address_get_type (void) G_GNUC_CONST; GSocketAddress *g_unix_socket_address_new (const gchar *path); +#ifndef G_DISABLE_DEPRECATED GSocketAddress *g_unix_socket_address_new_abstract (const gchar *path, - int path_len); + gint path_len); +#endif +GSocketAddress *g_unix_socket_address_new_with_type (const gchar *path, + gint path_len, + GUnixSocketAddressType type); const char * g_unix_socket_address_get_path (GUnixSocketAddress *address); gsize g_unix_socket_address_get_path_len (GUnixSocketAddress *address); +GUnixSocketAddressType g_unix_socket_address_get_address_type (GUnixSocketAddress *address); +#ifndef G_DISABLE_DEPRECATED gboolean g_unix_socket_address_get_is_abstract (GUnixSocketAddress *address); +#endif gboolean g_unix_socket_address_abstract_names_supported (void); diff --git a/gio/gunixvolume.c b/gio/gunixvolume.c index 28c4f2e..1dc840b 100644 --- a/gio/gunixvolume.c +++ b/gio/gunixvolume.c @@ -42,7 +42,6 @@ /* for BUFSIZ */ #include -#include "gioalias.h" struct _GUnixVolume { GObject parent; @@ -411,7 +410,7 @@ handle_error: if (error != NULL) { GSimpleAsyncResult *simple; - simple = g_simple_async_result_new_from_error (G_OBJECT (data->unix_volume), + simple = g_simple_async_result_new_take_error (G_OBJECT (data->unix_volume), data->callback, data->user_data, error); @@ -424,7 +423,6 @@ handle_error: if (data->error_channel != NULL) g_io_channel_unref (data->error_channel); - g_error_free (error); g_free (data); } } diff --git a/gio/gunixvolumemonitor.c b/gio/gunixvolumemonitor.c index b44e614..76a9840 100644 --- a/gio/gunixvolumemonitor.c +++ b/gio/gunixvolumemonitor.c @@ -37,7 +37,6 @@ #include "giomodule.h" #include "glibintl.h" -#include "gioalias.h" struct _GUnixVolumeMonitor { GNativeVolumeMonitor parent; diff --git a/gio/gvdb/gvdb-builder.c b/gio/gvdb/gvdb-builder.c new file mode 100644 index 0000000..fdd0ef4 --- /dev/null +++ b/gio/gvdb/gvdb-builder.c @@ -0,0 +1,502 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "gvdb-builder.h" +#include "gvdb-format.h" + +#include +#include +#include +#include + + +struct _GvdbItem +{ + gchar *key; + guint32 hash_value; + guint32_le assigned_index; + GvdbItem *parent; + GvdbItem *sibling; + GvdbItem *next; + + /* one of: + * this: + */ + GVariant *value; + + /* this: */ + GHashTable *table; + + /* or this: */ + GvdbItem *child; +}; + +static void +gvdb_item_free (gpointer data) +{ + GvdbItem *item = data; + + g_free (item->key); + + if (item->value) + g_variant_unref (item->value); + + if (item->table) + g_hash_table_unref (item->table); + + g_slice_free (GvdbItem, item); +} + +GHashTable * +gvdb_hash_table_new (GHashTable *parent, + const gchar *name_in_parent) +{ + GHashTable *table; + + table = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, gvdb_item_free); + + if (parent) + { + GvdbItem *item; + + item = gvdb_hash_table_insert (parent, name_in_parent); + gvdb_item_set_hash_table (item, table); + } + + return table; +} + +static guint32 +djb_hash (const gchar *key) +{ + guint32 hash_value = 5381; + + while (*key) + hash_value = hash_value * 33 + *key++; + + return hash_value; +} + +GvdbItem * +gvdb_hash_table_insert (GHashTable *table, + const gchar *key) +{ + GvdbItem *item; + + item = g_slice_new0 (GvdbItem); + item->key = g_strdup (key); + item->hash_value = djb_hash (key); + + g_hash_table_insert (table, g_strdup (key), item); + + return item; +} + +void +gvdb_hash_table_insert_string (GHashTable *table, + const gchar *key, + const gchar *value) +{ + GvdbItem *item; + + item = gvdb_hash_table_insert (table, key); + gvdb_item_set_value (item, g_variant_new_string (value)); +} + +void +gvdb_item_set_value (GvdbItem *item, + GVariant *value) +{ + g_return_if_fail (!item->value && !item->table && !item->child); + + item->value = g_variant_ref_sink (value); +} + +void +gvdb_item_set_hash_table (GvdbItem *item, + GHashTable *table) +{ + g_return_if_fail (!item->value && !item->table && !item->child); + + item->table = g_hash_table_ref (table); +} + +void +gvdb_item_set_parent (GvdbItem *item, + GvdbItem *parent) +{ + GvdbItem **node; + + g_return_if_fail (g_str_has_prefix (item->key, parent->key)); + g_return_if_fail (!parent->value && !parent->table); + g_return_if_fail (!item->parent && !item->sibling); + + for (node = &parent->child; *node; node = &(*node)->sibling) + if (strcmp ((*node)->key, item->key) > 0) + break; + + item->parent = parent; + item->sibling = *node; + *node = item; +} + +typedef struct +{ + GvdbItem **buckets; + gint n_buckets; +} HashTable; + +static HashTable * +hash_table_new (gint n_buckets) +{ + HashTable *table; + + table = g_slice_new (HashTable); + table->buckets = g_new0 (GvdbItem *, n_buckets); + table->n_buckets = n_buckets; + + return table; +} + +static void +hash_table_insert (gpointer key, + gpointer value, + gpointer data) +{ + guint32 hash_value, bucket; + HashTable *table = data; + GvdbItem *item = value; + + hash_value = djb_hash (key); + bucket = hash_value % table->n_buckets; + item->next = table->buckets[bucket]; + table->buckets[bucket] = item; +} + +static guint32_le +item_to_index (GvdbItem *item) +{ + if (item != NULL) + return item->assigned_index; + + return guint32_to_le (-1u); +} + +typedef struct +{ + GQueue *chunks; + guint64 offset; + gboolean byteswap; +} FileBuilder; + +typedef struct +{ + gsize offset; + gsize size; + gpointer data; +} FileChunk; + +static gpointer +file_builder_allocate (FileBuilder *fb, + guint alignment, + gsize size, + struct gvdb_pointer *pointer) +{ + FileChunk *chunk; + + if (size == 0) + return NULL; + + fb->offset += (-fb->offset) & (alignment - 1); + chunk = g_slice_new (FileChunk); + chunk->offset = fb->offset; + chunk->size = size; + chunk->data = g_malloc (size); + + pointer->start = guint32_to_le (fb->offset); + fb->offset += size; + pointer->end = guint32_to_le (fb->offset); + + g_queue_push_tail (fb->chunks, chunk); + + return chunk->data; +} + +static void +file_builder_add_value (FileBuilder *fb, + GVariant *value, + struct gvdb_pointer *pointer) +{ + GVariant *variant, *normal; + gpointer data; + gsize size; + + if (fb->byteswap) + { + value = g_variant_byteswap (value); + variant = g_variant_new_variant (value); + g_variant_unref (value); + } + else + variant = g_variant_new_variant (value); + + normal = g_variant_get_normal_form (variant); + g_variant_unref (variant); + + size = g_variant_get_size (normal); + data = file_builder_allocate (fb, 8, size, pointer); + g_variant_store (normal, data); + g_variant_unref (normal); +} + +static void +file_builder_add_string (FileBuilder *fb, + const gchar *string, + guint32_le *start, + guint16_le *size) +{ + FileChunk *chunk; + gsize length; + + length = strlen (string); + + chunk = g_slice_new (FileChunk); + chunk->offset = fb->offset; + chunk->size = length; + chunk->data = g_malloc (length); + memcpy (chunk->data, string, length); + + *start = guint32_to_le (fb->offset); + *size = guint16_to_le (length); + fb->offset += length; + + g_queue_push_tail (fb->chunks, chunk); +} + +static void +file_builder_allocate_for_hash (FileBuilder *fb, + gsize n_buckets, + gsize n_items, + guint bloom_shift, + gsize n_bloom_words, + guint32_le **bloom_filter, + guint32_le **hash_buckets, + struct gvdb_hash_item **hash_items, + struct gvdb_pointer *pointer) +{ + guint32_le bloom_hdr, table_hdr; + guchar *data; + gsize size; + + g_assert (n_bloom_words < (1u << 27)); + + bloom_hdr = guint32_to_le (bloom_shift << 27 | n_bloom_words); + table_hdr = guint32_to_le (n_buckets); + + size = sizeof bloom_hdr + sizeof table_hdr + + n_bloom_words * sizeof (guint32_le) + + n_buckets * sizeof (guint32_le) + + n_items * sizeof (struct gvdb_hash_item); + + data = file_builder_allocate (fb, 4, size, pointer); + +#define chunk(s) (size -= (s), data += (s), data - (s)) + memcpy (chunk (sizeof bloom_hdr), &bloom_hdr, sizeof bloom_hdr); + memcpy (chunk (sizeof table_hdr), &table_hdr, sizeof table_hdr); + *bloom_filter = (guint32_le *) chunk (n_bloom_words * sizeof (guint32_le)); + *hash_buckets = (guint32_le *) chunk (n_buckets * sizeof (guint32_le)); + *hash_items = (struct gvdb_hash_item *) chunk (n_items * + sizeof (struct gvdb_hash_item)); + g_assert (size == 0); +#undef chunk + + memset (*bloom_filter, 0, n_bloom_words * sizeof (guint32_le)); +} + +static void +file_builder_add_hash (FileBuilder *fb, + GHashTable *table, + struct gvdb_pointer *pointer) +{ + guint32_le *buckets, *bloom_filter; + struct gvdb_hash_item *items; + HashTable *mytable; + GvdbItem *item; + guint32 index; + gint bucket; + + mytable = hash_table_new (g_hash_table_size (table)); + g_hash_table_foreach (table, hash_table_insert, mytable); + index = 0; + + for (bucket = 0; bucket < mytable->n_buckets; bucket++) + for (item = mytable->buckets[bucket]; item; item = item->next) + item->assigned_index = guint32_to_le (index++); + + file_builder_allocate_for_hash (fb, mytable->n_buckets, index, 5, 0, + &bloom_filter, &buckets, &items, pointer); + + index = 0; + for (bucket = 0; bucket < mytable->n_buckets; bucket++) + { + buckets[bucket] = guint32_to_le (index); + + for (item = mytable->buckets[bucket]; item; item = item->next) + { + struct gvdb_hash_item *entry = items++; + const gchar *basename; + + g_assert (index == guint32_from_le (item->assigned_index)); + entry->hash_value = guint32_to_le (item->hash_value); + entry->parent = item_to_index (item->parent); + entry->unused = 0; + + if (item->parent != NULL) + basename = item->key + strlen (item->parent->key); + else + basename = item->key; + + file_builder_add_string (fb, basename, + &entry->key_start, + &entry->key_size); + + if (item->value != NULL) + { + g_assert (item->child == NULL && item->table == NULL); + + file_builder_add_value (fb, item->value, &entry->value.pointer); + entry->type = 'v'; + } + + if (item->child != NULL) + { + guint32 children = 0, i = 0; + guint32_le *offsets; + GvdbItem *child; + + g_assert (item->table == NULL); + + for (child = item->child; child; child = child->sibling) + children++; + + offsets = file_builder_allocate (fb, 4, 4 * children, + &entry->value.pointer); + entry->type = 'L'; + + for (child = item->child; child; child = child->sibling) + offsets[i++] = child->assigned_index; + + g_assert (children == i); + } + + if (item->table != NULL) + { + entry->type = 'H'; + file_builder_add_hash (fb, item->table, &entry->value.pointer); + } + + index++; + } + } +} + +static FileBuilder * +file_builder_new (gboolean byteswap) +{ + FileBuilder *builder; + + builder = g_slice_new (FileBuilder); + builder->chunks = g_queue_new (); + builder->offset = sizeof (struct gvdb_header); + builder->byteswap = byteswap; + + return builder; +} + +static GString * +file_builder_serialise (FileBuilder *fb, + struct gvdb_pointer root) +{ + struct gvdb_header header = { { 0, }, }; + GString *result; + + if (fb->byteswap) + { + header.signature[0] = GVDB_SWAPPED_SIGNATURE0; + header.signature[1] = GVDB_SWAPPED_SIGNATURE1; + } + else + { + header.signature[0] = GVDB_SIGNATURE0; + header.signature[1] = GVDB_SIGNATURE1; + } + + result = g_string_new (NULL); + + header.root = root; + g_string_append_len (result, (gpointer) &header, sizeof header); + + while (!g_queue_is_empty (fb->chunks)) + { + FileChunk *chunk = g_queue_pop_head (fb->chunks); + + if (result->len != chunk->offset) + { + gchar zero[8] = { 0, }; + + g_assert (chunk->offset > result->len); + g_assert (chunk->offset - result->len < 8); + + g_string_append_len (result, zero, chunk->offset - result->len); + g_assert (result->len == chunk->offset); + } + + g_string_append_len (result, chunk->data, chunk->size); + g_free (chunk->data); + } + + g_queue_free (fb->chunks); + g_slice_free (FileBuilder, fb); + + return result; +} + +gboolean +gvdb_table_write_contents (GHashTable *table, + const gchar *filename, + gboolean byteswap, + GError **error) +{ + struct gvdb_pointer root; + gboolean status; + FileBuilder *fb; + GString *str; + + fb = file_builder_new (byteswap); + file_builder_add_hash (fb, table, &root); + str = file_builder_serialise (fb, root); + + status = g_file_set_contents (filename, str->str, str->len, error); + g_string_free (str, TRUE); + + return status; +} diff --git a/gio/gvdb/gvdb-builder.h b/gio/gvdb/gvdb-builder.h new file mode 100644 index 0000000..797626e --- /dev/null +++ b/gio/gvdb/gvdb-builder.h @@ -0,0 +1,57 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#ifndef __gvdb_builder_h__ +#define __gvdb_builder_h__ + +#include + +typedef struct _GvdbItem GvdbItem; + +G_GNUC_INTERNAL +GHashTable * gvdb_hash_table_new (GHashTable *parent, + const gchar *key); + +G_GNUC_INTERNAL +GvdbItem * gvdb_hash_table_insert (GHashTable *table, + const gchar *key); +G_GNUC_INTERNAL +void gvdb_hash_table_insert_string (GHashTable *table, + const gchar *key, + const gchar *value); + +G_GNUC_INTERNAL +void gvdb_item_set_value (GvdbItem *item, + GVariant *value); +G_GNUC_INTERNAL +void gvdb_item_set_hash_table (GvdbItem *item, + GHashTable *table); +G_GNUC_INTERNAL +void gvdb_item_set_parent (GvdbItem *item, + GvdbItem *parent); + +G_GNUC_INTERNAL +gboolean gvdb_table_write_contents (GHashTable *table, + const gchar *filename, + gboolean byteswap, + GError **error); + +#endif /* __gvdb_builder_h__ */ diff --git a/gio/gvdb/gvdb-format.h b/gio/gvdb/gvdb-format.h new file mode 100644 index 0000000..886aa56 --- /dev/null +++ b/gio/gvdb/gvdb-format.h @@ -0,0 +1,87 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#ifndef __gvdb_format_h__ +#define __gvdb_format_h__ + +#include + +typedef struct { guint16 value; } guint16_le; +typedef struct { guint32 value; } guint32_le; + +struct gvdb_pointer { + guint32_le start; + guint32_le end; +}; + +struct gvdb_hash_header { + guint32_le n_bloom_words; + guint32_le n_buckets; +}; + +struct gvdb_hash_item { + guint32_le hash_value; + guint32_le parent; + + guint32_le key_start; + guint16_le key_size; + gchar type; + gchar unused; + + union + { + struct gvdb_pointer pointer; + gchar direct[8]; + } value; +}; + +struct gvdb_header { + guint32 signature[2]; + guint32_le version; + guint32_le options; + + struct gvdb_pointer root; +}; + +static inline guint32_le guint32_to_le (guint32 value) { + guint32_le result = { GUINT32_TO_LE (value) }; + return result; +} + +static inline guint32 guint32_from_le (guint32_le value) { + return GUINT32_FROM_LE (value.value); +} + +static inline guint16_le guint16_to_le (guint16 value) { + guint16_le result = { GUINT16_TO_LE (value) }; + return result; +} + +static inline guint16 guint16_from_le (guint16_le value) { + return GUINT16_FROM_LE (value.value); +} + +#define GVDB_SIGNATURE0 1918981703 +#define GVDB_SIGNATURE1 1953390953 +#define GVDB_SWAPPED_SIGNATURE0 GUINT32_SWAP_LE_BE (GVDB_SIGNATURE0) +#define GVDB_SWAPPED_SIGNATURE1 GUINT32_SWAP_LE_BE (GVDB_SIGNATURE1) + +#endif /* __gvdb_format_h__ */ diff --git a/gio/gvdb/gvdb-reader.c b/gio/gvdb/gvdb-reader.c new file mode 100644 index 0000000..d25e537 --- /dev/null +++ b/gio/gvdb/gvdb-reader.c @@ -0,0 +1,650 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#include "gvdb-reader.h" +#include "gvdb-format.h" + +#include + +struct _GvdbTable { + gint ref_count; + + const gchar *data; + gsize size; + + GMappedFile *mapped; + gboolean byteswapped; + gboolean trusted; + + const guint32_le *bloom_words; + guint32 n_bloom_words; + guint bloom_shift; + + const guint32_le *hash_buckets; + guint32 n_buckets; + + struct gvdb_hash_item *hash_items; + guint32 n_hash_items; +}; + +static const gchar * +gvdb_table_item_get_key (GvdbTable *file, + const struct gvdb_hash_item *item, + gsize *size) +{ + guint32 start, end; + + start = guint32_from_le (item->key_start); + *size = guint16_from_le (item->key_size); + end = start + *size; + + if G_UNLIKELY (start > end || end > file->size) + return NULL; + + return file->data + start; +} + +static gconstpointer +gvdb_table_dereference (GvdbTable *file, + const struct gvdb_pointer *pointer, + gint alignment, + gsize *size) +{ + guint32 start, end; + + start = guint32_from_le (pointer->start); + end = guint32_from_le (pointer->end); + + if G_UNLIKELY (start > end || end > file->size || start & (alignment - 1)) + return NULL; + + *size = end - start; + + return file->data + start; +} + +static void +gvdb_table_setup_root (GvdbTable *file, + const struct gvdb_pointer *pointer) +{ + const struct gvdb_hash_header *header; + guint32 n_bloom_words; + guint32 bloom_shift; + guint32 n_buckets; + gsize size; + + header = gvdb_table_dereference (file, pointer, 4, &size); + + if G_UNLIKELY (header == NULL || size < sizeof *header) + return; + + size -= sizeof *header; + + n_bloom_words = guint32_from_le (header->n_bloom_words); + n_buckets = guint32_from_le (header->n_buckets); + bloom_shift = n_bloom_words >> 27; + n_bloom_words &= (1u << 27) - 1; + + if G_UNLIKELY (n_bloom_words * sizeof (guint32_le) > size) + return; + + file->bloom_words = (gpointer) (header + 1); + size -= n_bloom_words * sizeof (guint32_le); + file->n_bloom_words = n_bloom_words; + + if G_UNLIKELY (n_buckets > G_MAXUINT / sizeof (guint32_le) || + n_buckets * sizeof (guint32_le) > size) + return; + + file->hash_buckets = file->bloom_words + file->n_bloom_words; + size -= n_buckets * sizeof (guint32_le); + file->n_buckets = n_buckets; + + if G_UNLIKELY (size % sizeof (struct gvdb_hash_item)) + return; + + file->hash_items = (gpointer) (file->hash_buckets + n_buckets); + file->n_hash_items = size / sizeof (struct gvdb_hash_item); +} + +/** + * gvdb_table_new: + * @filename: the path to the hash file + * @trusted: if the contents of @filename are trusted + * @error: %NULL, or a pointer to a %NULL #GError + * @returns: a new #GvdbTable + * + * Creates a new #GvdbTable from the contents of the file found at + * @filename. + * + * The only time this function fails is if the file can not be opened. + * In that case, the #GError that is returned will be an error from + * g_mapped_file_new(). + * + * An empty or otherwise corrupted file is considered to be a valid + * #GvdbTable with no entries. + * + * You should call gvdb_table_unref() on the return result when you no + * longer require it. + **/ +GvdbTable * +gvdb_table_new (const gchar *filename, + gboolean trusted, + GError **error) +{ + GMappedFile *mapped; + GvdbTable *file; + + if ((mapped = g_mapped_file_new (filename, FALSE, error)) == NULL) + return NULL; + + file = g_slice_new0 (GvdbTable); + file->data = g_mapped_file_get_contents (mapped); + file->size = g_mapped_file_get_length (mapped); + file->trusted = trusted; + file->mapped = mapped; + file->ref_count = 1; + + if (sizeof (struct gvdb_header) <= file->size) + { + const struct gvdb_header *header = (gpointer) file->data; + + if (header->signature[0] == GVDB_SIGNATURE0 && + header->signature[1] == GVDB_SIGNATURE1 && + guint32_from_le (header->version) == 0) + file->byteswapped = FALSE; + + else if (header->signature[0] == GVDB_SWAPPED_SIGNATURE0 && + header->signature[1] == GVDB_SWAPPED_SIGNATURE1 && + guint32_from_le (header->version) == 0) + file->byteswapped = TRUE; + + else + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, + "%s: invalid header", filename); + g_slice_free (GvdbTable, file); + g_mapped_file_unref (mapped); + + return NULL; + } + + gvdb_table_setup_root (file, &header->root); + } + + return file; +} + +static gboolean +gvdb_table_bloom_filter (GvdbTable *file, + guint32 hash_value) +{ + guint32 word, mask; + + if (file->n_bloom_words == 0) + return TRUE; + + word = (hash_value / 32) % file->n_bloom_words; + mask = 1 << (hash_value & 31); + mask |= 1 << ((hash_value >> file->bloom_shift) & 31); + + return (guint32_from_le (file->bloom_words[word]) & mask) == mask; +} + +static gboolean +gvdb_table_check_name (GvdbTable *file, + struct gvdb_hash_item *item, + const gchar *key, + guint key_length) +{ + const gchar *this_key; + gsize this_size; + guint32 parent; + + this_key = gvdb_table_item_get_key (file, item, &this_size); + + if G_UNLIKELY (this_key == NULL || this_size > key_length) + return FALSE; + + key_length -= this_size; + + if G_UNLIKELY (memcmp (this_key, key + key_length, this_size) != 0) + return FALSE; + + parent = guint32_from_le (item->parent); + if (key_length == 0 && parent == -1) + return TRUE; + + if G_LIKELY (parent < file->n_hash_items && this_size > 0) + return gvdb_table_check_name (file, + &file->hash_items[parent], + key, key_length); + + return FALSE; +} + +static const struct gvdb_hash_item * +gvdb_table_lookup (GvdbTable *file, + const gchar *key, + gchar type) +{ + guint32 hash_value = 5381; + guint key_length; + guint32 bucket; + guint32 lastno; + guint32 itemno; + + if G_UNLIKELY (file->n_buckets == 0 || file->n_hash_items == 0) + return NULL; + + for (key_length = 0; key[key_length]; key_length++) + hash_value = (hash_value * 33) + key[key_length]; + + if (!gvdb_table_bloom_filter (file, hash_value)) + return NULL; + + bucket = hash_value % file->n_buckets; + itemno = guint32_from_le (file->hash_buckets[bucket]); + + if (bucket == file->n_buckets - 1 || + (lastno = guint32_from_le(file->hash_buckets[bucket + 1])) > file->n_hash_items) + lastno = file->n_hash_items; + + while G_LIKELY (itemno < lastno) + { + struct gvdb_hash_item *item = &file->hash_items[itemno]; + + if (hash_value == guint32_from_le (item->hash_value)) + if G_LIKELY (gvdb_table_check_name (file, item, key, key_length)) + if G_LIKELY (item->type == type) + return item; + + itemno++; + } + + return NULL; +} + +static const struct gvdb_hash_item * +gvdb_table_get_item (GvdbTable *table, + guint32_le item_no) +{ + guint32 item_no_native = guint32_from_le (item_no); + + if G_LIKELY (item_no_native < table->n_hash_items) + return table->hash_items + item_no_native; + + return NULL; +} + +static gboolean +gvdb_table_list_from_item (GvdbTable *table, + const struct gvdb_hash_item *item, + const guint32_le **list, + guint *length) +{ + gsize size; + + *list = gvdb_table_dereference (table, &item->value.pointer, 4, &size); + + if G_LIKELY (*list == NULL || size % 4) + return FALSE; + + *length = size / 4; + + return TRUE; +} + + +/** + * gvdb_table_list: + * @file: a #GvdbTable + * @key: a string + * @returns: a %NULL-terminated string array + * + * List all of the keys that appear below @key. The nesting of keys + * within the hash file is defined by the program that created the hash + * file. One thing is constant: each item in the returned array can be + * concatenated to @key to obtain the full name of that key. + * + * It is not possible to tell from this function if a given key is + * itself a path, a value, or another hash table; you are expected to + * know this for yourself. + * + * You should call g_strfreev() on the return result when you no longer + * require it. + **/ +gchar ** +gvdb_table_list (GvdbTable *file, + const gchar *key) +{ + const struct gvdb_hash_item *item; + const guint32_le *list; + gchar **strv; + guint length; + gint i; + + if ((item = gvdb_table_lookup (file, key, 'L')) == NULL) + return NULL; + + if (!gvdb_table_list_from_item (file, item, &list, &length)) + return NULL; + + strv = g_new (gchar *, length + 1); + for (i = 0; i < length; i++) + { + guint32 itemno = guint32_from_le (list[i]); + + if (itemno < file->n_hash_items) + { + const struct gvdb_hash_item *item; + const gchar *string; + gsize strsize; + + item = file->hash_items + itemno; + + string = gvdb_table_item_get_key (file, item, &strsize); + + if (string != NULL) + strv[i] = g_strndup (string, strsize); + else + strv[i] = g_malloc0 (1); + } + else + strv[i] = g_malloc0 (1); + } + + strv[i] = NULL; + + return strv; +} + +/** + * gvdb_table_has_value: + * @file: a #GvdbTable + * @key: a string + * @returns: %TRUE if @key is in the table + * + * Checks for a value named @key in @file. + * + * Note: this function does not consider non-value nodes (other hash + * tables, for example). + **/ +gboolean +gvdb_table_has_value (GvdbTable *file, + const gchar *key) +{ + return gvdb_table_lookup (file, key, 'v') != NULL; +} + +static GVariant * +gvdb_table_value_from_item (GvdbTable *table, + const struct gvdb_hash_item *item) +{ + GVariant *variant, *value; + gconstpointer data; + gsize size; + + data = gvdb_table_dereference (table, &item->value.pointer, 8, &size); + + if G_UNLIKELY (data == NULL) + return NULL; + + variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, + data, size, table->trusted, + (GDestroyNotify) g_mapped_file_unref, + g_mapped_file_ref (table->mapped)); + value = g_variant_get_variant (variant); + g_variant_unref (variant); + + return value; +} + +/** + * gvdb_table_get_value: + * @file: a #GvdbTable + * @key: a string + * @returns: a #GVariant, or %NULL + * + * Looks up a value named @key in @file. + * + * If the value is not found then %NULL is returned. Otherwise, a new + * #GVariant instance is returned. The #GVariant does not depend on the + * continued existence of @file. + * + * You should call g_variant_unref() on the return result when you no + * longer require it. + **/ +GVariant * +gvdb_table_get_value (GvdbTable *file, + const gchar *key) +{ + const struct gvdb_hash_item *item; + GVariant *value; + + if ((item = gvdb_table_lookup (file, key, 'v')) == NULL) + return NULL; + + value = gvdb_table_value_from_item (file, item); + + if (value && file->byteswapped) + { + GVariant *tmp; + + tmp = g_variant_byteswap (value); + g_variant_unref (value); + value = tmp; + } + + return value; +} + +/** + * gvdb_table_get_raw_value: + * @table: a #GvdbTable + * @key: a string + * @returns: a #GVariant, or %NULL + * + * Looks up a value named @key in @file. + * + * This call is equivalent to gvdb_table_get_value() except that it + * never byteswaps the value. + **/ +GVariant * +gvdb_table_get_raw_value (GvdbTable *table, + const gchar *key) +{ + const struct gvdb_hash_item *item; + + if ((item = gvdb_table_lookup (table, key, 'v')) == NULL) + return NULL; + + return gvdb_table_value_from_item (table, item); +} + +/** + * gvdb_table_get_table: + * @file: a #GvdbTable + * @key: a string + * @returns: a new #GvdbTable, or %NULL + * + * Looks up the hash table named @key in @file. + * + * The toplevel hash table in a #GvdbTable can contain reference to + * child hash tables (and those can contain further references...). + * + * If @key is not found in @file then %NULL is returned. Otherwise, a + * new #GvdbTable is returned, referring to the child hashtable as + * contained in the file. This newly-created #GvdbTable does not depend + * on the continued existence of @file. + * + * You should call gvdb_table_unref() on the return result when you no + * longer require it. + **/ +GvdbTable * +gvdb_table_get_table (GvdbTable *file, + const gchar *key) +{ + const struct gvdb_hash_item *item; + GvdbTable *new; + + item = gvdb_table_lookup (file, key, 'H'); + + if (item == NULL) + return NULL; + + new = g_slice_new0 (GvdbTable); + new->mapped = g_mapped_file_ref (file->mapped); + new->byteswapped = file->byteswapped; + new->trusted = file->trusted; + new->data = file->data; + new->size = file->size; + new->ref_count = 1; + + gvdb_table_setup_root (new, &item->value.pointer); + + return new; +} + +/** + * gvdb_table_ref: + * @file: a #GvdbTable + * @returns: a new reference on @file + * + * Increases the reference count on @file. + **/ +GvdbTable * +gvdb_table_ref (GvdbTable *file) +{ + g_atomic_int_inc (&file->ref_count); + + return file; +} + +/** + * gvdb_table_unref: + * @file: a #GvdbTable + * + * Decreases the reference count on @file, possibly freeing it. + * + * Since: 2.26 + **/ +void +gvdb_table_unref (GvdbTable *file) +{ + if (g_atomic_int_dec_and_test (&file->ref_count)) + { + g_mapped_file_unref (file->mapped); + g_slice_free (GvdbTable, file); + } +} + +/** + * gvdb_table_is_valid: + * @table: a #GvdbTable + * @returns: %TRUE if @table is still valid + * + * Checks if the table is still valid. + * + * An on-disk GVDB can be marked as invalid. This happens when the file + * has been replaced. The appropriate action is typically to reopen the + * file. + **/ +gboolean +gvdb_table_is_valid (GvdbTable *table) +{ + return !!*table->data; +} + +void +gvdb_table_walk (GvdbTable *table, + const gchar *key, + GvdbWalkOpenFunc open_func, + GvdbWalkValueFunc value_func, + GvdbWalkCloseFunc close_func, + gpointer user_data) +{ + const struct gvdb_hash_item *item; + const guint32_le *pointers[64]; + const guint32_le *enders[64]; + gint index = 0; + + item = gvdb_table_lookup (table, key, 'L'); + pointers[0] = NULL; + enders[0] = NULL; + goto start_here; + + while (index) + { + close_func (user_data); + index--; + + while (pointers[index] < enders[index]) + { + const gchar *name; + gsize name_len; + + item = gvdb_table_get_item (table, *pointers[index]++); + start_here: + + if (item != NULL && + (name = gvdb_table_item_get_key (table, item, &name_len))) + { + if (item->type == 'L') + { + if (open_func (name, name_len, user_data)) + { + guint length = 0; + + index++; + g_assert (index < 64); + + gvdb_table_list_from_item (table, item, + &pointers[index], + &length); + enders[index] = pointers[index] + length; + } + } + else if (item->type == 'v') + { + GVariant *value; + + value = gvdb_table_value_from_item (table, item); + + if (value != NULL) + { + if (table->byteswapped) + { + GVariant *tmp; + + tmp = g_variant_byteswap (value); + g_variant_unref (value); + value = tmp; + } + + value_func (name, name_len, value, user_data); + g_variant_unref (value); + } + } + } + } + } +} diff --git a/gio/gvdb/gvdb-reader.h b/gio/gvdb/gvdb-reader.h new file mode 100644 index 0000000..9f302c0 --- /dev/null +++ b/gio/gvdb/gvdb-reader.h @@ -0,0 +1,75 @@ +/* + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ryan Lortie + */ + +#ifndef __gvdb_reader_h__ +#define __gvdb_reader_h__ + +#include + +typedef struct _GvdbTable GvdbTable; + +G_GNUC_INTERNAL +GvdbTable * gvdb_table_new (const gchar *filename, + gboolean trusted, + GError **error); +G_GNUC_INTERNAL +GvdbTable * gvdb_table_ref (GvdbTable *table); +G_GNUC_INTERNAL +void gvdb_table_unref (GvdbTable *table); + +G_GNUC_INTERNAL +gchar ** gvdb_table_list (GvdbTable *table, + const gchar *key); +G_GNUC_INTERNAL +GvdbTable * gvdb_table_get_table (GvdbTable *table, + const gchar *key); +G_GNUC_INTERNAL +GVariant * gvdb_table_get_raw_value (GvdbTable *table, + const gchar *key); +G_GNUC_INTERNAL +GVariant * gvdb_table_get_value (GvdbTable *table, + const gchar *key); + +G_GNUC_INTERNAL +gboolean gvdb_table_has_value (GvdbTable *table, + const gchar *key); + +G_GNUC_INTERNAL +gboolean gvdb_table_is_valid (GvdbTable *table); + +typedef void (*GvdbWalkValueFunc) (const gchar *name, + gsize name_len, + GVariant *value, + gpointer user_data); +typedef gboolean (*GvdbWalkOpenFunc) (const gchar *name, + gsize name_len, + gpointer user_data); +typedef void (*GvdbWalkCloseFunc) (gpointer user_data); + +void gvdb_table_walk (GvdbTable *table, + const gchar *key, + GvdbWalkOpenFunc open_func, + GvdbWalkValueFunc value_func, + GvdbWalkCloseFunc close_func, + gpointer user_data); + + +#endif /* __gvdb_reader_h__ */ diff --git a/gio/gvfs.c b/gio/gvfs.c index df59c62..697c69b 100644 --- a/gio/gvfs.c +++ b/gio/gvfs.c @@ -27,7 +27,6 @@ #include "giomodule-priv.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gvfs @@ -78,7 +77,7 @@ g_vfs_is_active (GVfs *vfs) * * Gets a #GFile for @path. * - * Returns: a #GFile. + * Returns: (transfer full): a #GFile. * Free the returned object with g_object_unref(). **/ GFile * @@ -106,7 +105,7 @@ g_vfs_get_file_for_path (GVfs *vfs, * might not support any I/O operation if the URI * is malformed or if the URI scheme is not supported. * - * Returns: a #GFile. + * Returns: (transfer full): a #GFile. * Free the returned object with g_object_unref(). **/ GFile * @@ -129,7 +128,7 @@ g_vfs_get_file_for_uri (GVfs *vfs, * * Gets a list of URI schemes supported by @vfs. * - * Returns: a %NULL-terminated array of strings. + * Returns: (transfer none): a %NULL-terminated array of strings. * The returned array belongs to GIO and must * not be freed or modified. **/ @@ -154,7 +153,7 @@ g_vfs_get_supported_uri_schemes (GVfs *vfs) * not support any I/O operations if the @parse_name cannot * be parsed by the #GVfs module. * - * Returns: a #GFile for the given @parse_name. + * Returns: (transfer full): a #GFile for the given @parse_name. * Free the returned object with g_object_unref(). **/ GFile * @@ -223,7 +222,7 @@ get_default_vfs (gpointer arg) * * Gets the default #GVfs for the system. * - * Returns: a #GVfs. + * Returns: (transfer none): a #GVfs. **/ GVfs * g_vfs_get_default (void) @@ -238,7 +237,7 @@ g_vfs_get_default (void) * * Gets the local #GVfs for the system. * - * Returns: a #GVfs. + * Returns: (transfer none): a #GVfs. **/ GVfs * g_vfs_get_local (void) @@ -250,6 +249,3 @@ g_vfs_get_local (void) return G_VFS (vfs); } - -#define __G_VFS_C__ -#include "gioaliasdef.c" diff --git a/gio/gvolume.c b/gio/gvolume.c index b2b85bb..df1b78d 100644 --- a/gio/gvolume.c +++ b/gio/gvolume.c @@ -29,7 +29,6 @@ #include "gioerror.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gvolume @@ -141,7 +140,7 @@ g_volume_get_name (GVolume *volume) * * Gets the icon for @volume. * - * Returns: a #GIcon. + * Returns: (transfer full): a #GIcon. * The returned object should be unreffed with g_object_unref() * when no longer needed. **/ @@ -188,7 +187,7 @@ g_volume_get_uuid (GVolume *volume) * * Gets the drive for the @volume. * - * Returns: a #GDrive or %NULL if @volume is not associated with a drive. + * Returns: (transfer full): a #GDrive or %NULL if @volume is not associated with a drive. * The returned object should be unreffed with g_object_unref() * when no longer needed. **/ @@ -210,7 +209,7 @@ g_volume_get_drive (GVolume *volume) * * Gets the mount for the @volume. * - * Returns: a #GMount or %NULL if @volume isn't mounted. + * Returns: (transfer full): a #GMount or %NULL if @volume isn't mounted. * The returned object should be unreffed with g_object_unref() * when no longer needed. **/ @@ -301,7 +300,7 @@ g_volume_should_automount (GVolume *volume) * g_volume_mount: * @volume: a #GVolume. * @flags: flags affecting the operation - * @mount_operation: a #GMountOperation or %NULL to avoid user interaction. + * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction. * @cancellable: optional #GCancellable object, %NULL to ignore. * @callback: a #GAsyncReadyCallback, or %NULL. * @user_data: user data that gets passed to @callback @@ -309,6 +308,8 @@ g_volume_should_automount (GVolume *volume) * Mounts a volume. This is an asynchronous operation, and is * finished by calling g_volume_mount_finish() with the @volume * and #GAsyncResult returned in the @callback. + * + * Virtual: mount_fn **/ void g_volume_mount (GVolume *volume, @@ -569,8 +570,8 @@ g_volume_get_identifier (GVolume *volume, * that @volume has. Use g_volume_get_identifer() to obtain * the identifiers themselves. * - * Returns: a %NULL-terminated array of strings containing - * kinds of identifiers. Use g_strfreev() to free. + * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array + * of strings containing kinds of identifiers. Use g_strfreev() to free. */ char ** g_volume_enumerate_identifiers (GVolume *volume) @@ -620,7 +621,7 @@ g_volume_enumerate_identifiers (GVolume *volume) * implementations to find the underlying mount to shadow, see * g_mount_is_shadowed() for more details. * - * Returns: the activation root of @volume or %NULL. Use + * Returns: (transfer full): the activation root of @volume or %NULL. Use * g_object_unref() to free. * * Since: 2.18 @@ -638,8 +639,3 @@ g_volume_get_activation_root (GVolume *volume) return (* iface->get_activation_root) (volume); } - - - -#define __G_VOLUME_C__ -#include "gioaliasdef.c" diff --git a/gio/gvolumemonitor.c b/gio/gvolumemonitor.c index c01162b..bb0fd35 100644 --- a/gio/gvolumemonitor.c +++ b/gio/gvolumemonitor.c @@ -30,7 +30,6 @@ #include "gdrive.h" #include "glibintl.h" -#include "gioalias.h" /** * SECTION:gvolumemonitor @@ -283,7 +282,7 @@ g_volume_monitor_init (GVolumeMonitor *monitor) * The returned list should be freed with g_list_free(), after * its elements have been unreffed with g_object_unref(). * - * Returns: a #GList of connected #GDrive objects. + * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects. **/ GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor) @@ -306,7 +305,7 @@ g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor) * The returned list should be freed with g_list_free(), after * its elements have been unreffed with g_object_unref(). * - * Returns: a #GList of #GVolume objects. + * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects. **/ GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor) @@ -329,7 +328,7 @@ g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor) * The returned list should be freed with g_list_free(), after * its elements have been unreffed with g_object_unref(). * - * Returns: a #GList of #GMount objects. + * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects. **/ GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor) @@ -350,7 +349,7 @@ g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor) * * Finds a #GVolume object by its UUID (see g_volume_get_uuid()) * - * Returns: a #GVolume or %NULL if no such volume is available. + * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. * Free the returned object with g_object_unref(). **/ GVolume * @@ -374,7 +373,7 @@ g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor, * * Finds a #GMount object by its UUID (see g_mount_get_uuid()) * - * Returns: a #GMount or %NULL if no such mount is available. + * Returns: (transfer full): a #GMount or %NULL if no such mount is available. * Free the returned object with g_object_unref(). **/ GMount * @@ -390,7 +389,3 @@ g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor, return class->get_mount_for_uuid (volume_monitor, uuid); } - - -#define __G_VOLUME_MONITOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gvolumemonitor.h b/gio/gvolumemonitor.h index 9e3bd80..5b47a9f 100644 --- a/gio/gvolumemonitor.h +++ b/gio/gvolumemonitor.h @@ -51,7 +51,6 @@ G_BEGIN_DECLS /** * GVolumeMonitor: - * @parent_instance: The parent instance. * * A Volume Monitor that watches for volume events. **/ diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c index 3e669c6..a441251 100644 --- a/gio/gwin32appinfo.c +++ b/gio/gwin32appinfo.c @@ -35,7 +35,6 @@ #include #include -#include "gioalias.h" #ifndef ASSOCF_INIT_BYEXENAME #define ASSOCF_INIT_BYEXENAME 0x00000002 @@ -588,6 +587,28 @@ g_app_info_get_all_for_type (const char *content_type) return g_list_reverse (infos); } +GList * +g_app_info_get_recommended_for_type (const char *content_type) +{ + /* FIXME: this should generate a list of applications that are registered + * as direct handlers for the given content type, without using MIME subclassing. + * See g_app_info_get_recommended_for_type() in gdesktopappinfo.c for a reference + * UNIX implementation. + */ + return g_app_info_get_all_for_type (content_type); +} + +GList * +g_app_info_get_fallback_for_type (const char *content_type) +{ + /* FIXME: this should generate a list of applications that are registered + * as handlers for a superclass of the given content type, but are not + * direct handlers for the content type itself. See g_app_info_get_fallback_for_type() + * in gdesktopappinfo.c for a reference UNIX implementation. + */ + return g_app_info_get_all_for_type (content_type); +} + GAppInfo * g_app_info_get_default_for_type (const char *content_type, gboolean must_support_uris) diff --git a/gio/gwin32inputstream.c b/gio/gwin32inputstream.c new file mode 100644 index 0000000..a545981 --- /dev/null +++ b/gio/gwin32inputstream.c @@ -0,0 +1,355 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2006-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Alexander Larsson + * Author: Tor Lillqvist + */ + +#include "config.h" + +#include + +#include + +#include +#include "gioerror.h" +#include "gsimpleasyncresult.h" +#include "gwin32inputstream.h" +#include "gcancellable.h" +#include "gasynchelper.h" +#include "glibintl.h" + + +/** + * SECTION:gwin32inputstream + * @short_description: Streaming input operations for Windows file handles + * @include: gio/gwin32inputstream.h + * @see_also: #GInputStream + * + * #GWin32InputStream implements #GInputStream for reading from a + * Windows file handle. + * + * Note that <gio/gwin32inputstream.h> belongs + * to the Windows-specific GIO interfaces, thus you have to use the + * gio-windows-2.0.pc pkg-config file when using it. + */ + +enum { + PROP_0, + PROP_HANDLE, + PROP_CLOSE_HANDLE +}; + +G_DEFINE_TYPE (GWin32InputStream, g_win32_input_stream, G_TYPE_INPUT_STREAM); + +struct _GWin32InputStreamPrivate { + HANDLE handle; + gboolean close_handle; +}; + +static void g_win32_input_stream_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void g_win32_input_stream_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static gssize g_win32_input_stream_read (GInputStream *stream, + void *buffer, + gsize count, + GCancellable *cancellable, + GError **error); +static gboolean g_win32_input_stream_close (GInputStream *stream, + GCancellable *cancellable, + GError **error); + +static void +g_win32_input_stream_finalize (GObject *object) +{ + G_OBJECT_CLASS (g_win32_input_stream_parent_class)->finalize (object); +} + +static void +g_win32_input_stream_class_init (GWin32InputStreamClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GWin32InputStreamPrivate)); + + gobject_class->get_property = g_win32_input_stream_get_property; + gobject_class->set_property = g_win32_input_stream_set_property; + gobject_class->finalize = g_win32_input_stream_finalize; + + stream_class->read_fn = g_win32_input_stream_read; + stream_class->close_fn = g_win32_input_stream_close; + + /** + * GWin32InputStream:handle: + * + * The handle that the stream reads from. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_HANDLE, + g_param_spec_pointer ("handle", + P_("File handle"), + P_("The file handle to read from"), + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); + + /** + * GWin32InputStream:close-handle: + * + * Whether to close the file handle when the stream is closed. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_CLOSE_HANDLE, + g_param_spec_boolean ("close-handle", + P_("Close file handle"), + P_("Whether to close the file handle when the stream is closed"), + TRUE, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); +} + +static void +g_win32_input_stream_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GWin32InputStream *win32_stream; + + win32_stream = G_WIN32_INPUT_STREAM (object); + + switch (prop_id) + { + case PROP_HANDLE: + win32_stream->priv->handle = g_value_get_pointer (value); + break; + case PROP_CLOSE_HANDLE: + win32_stream->priv->close_handle = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_win32_input_stream_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GWin32InputStream *win32_stream; + + win32_stream = G_WIN32_INPUT_STREAM (object); + + switch (prop_id) + { + case PROP_HANDLE: + g_value_set_pointer (value, win32_stream->priv->handle); + break; + case PROP_CLOSE_HANDLE: + g_value_set_boolean (value, win32_stream->priv->close_handle); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_win32_input_stream_init (GWin32InputStream *win32_stream) +{ + win32_stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (win32_stream, + G_TYPE_WIN32_INPUT_STREAM, + GWin32InputStreamPrivate); + + win32_stream->priv->handle = NULL; + win32_stream->priv->close_handle = TRUE; +} + +/** + * g_win32_input_stream_new: + * @handle: a Win32 file handle + * @close_fd: %TRUE to close the handle when done + * + * Creates a new #GWin32InputStream for the given @fd. + * + * If @close_handle is %TRUE, the handle will be closed + * when the stream is closed. + * + * Note that "handle" here means a Win32 HANDLE, not a "file descriptor" + * as used in the Windows C libraries. + * + * Returns: a new #GWin32InputStream + **/ +GInputStream * +g_win32_input_stream_new (void *handle, + gboolean close_handle) +{ + GWin32InputStream *stream; + + g_return_val_if_fail (handle != NULL, NULL); + + stream = g_object_new (G_TYPE_WIN32_INPUT_STREAM, + "handle", handle, + "close-handle", close_handle, + NULL); + + return G_INPUT_STREAM (stream); +} + +/** + * g_win32_input_stream_set_close_handle: + * @stream: a #GWin32InputStream + * @close_handle: %TRUE to close the handle when done + * + * Sets whether the handle of @stream shall be closed + * when the stream is closed. + * + * Since: 2.26 + */ +void +g_win32_input_stream_set_close_handle (GWin32InputStream *stream, + gboolean close_handle) +{ + g_return_if_fail (G_IS_WIN32_INPUT_STREAM (stream)); + + close_handle = close_handle != FALSE; + if (stream->priv->close_handle != close_handle) + { + stream->priv->close_handle = close_handle; + g_object_notify (G_OBJECT (stream), "close-handle"); + } +} + +/** + * g_win32_input_stream_get_close_handle: + * @stream: a #GWin32InputStream + * + * Returns whether the handle of @stream will be + * closed when the stream is closed. + * + * Return value: %TRUE if the handle is closed when done + * + * Since: 2.26 + */ +gboolean +g_win32_input_stream_get_close_handle (GWin32InputStream *stream) +{ + g_return_val_if_fail (G_IS_WIN32_INPUT_STREAM (stream), FALSE); + + return stream->priv->close_handle; +} + +/** + * g_win32_input_stream_get_handle: + * @stream: a #GWin32InputStream + * + * Return the Windows file handle that the stream reads from. + * + * Return value: The file handle of @stream + * + * Since: 2.26 + */ +void * +g_win32_input_stream_get_handle (GWin32InputStream *stream) +{ + g_return_val_if_fail (G_IS_WIN32_INPUT_STREAM (stream), NULL); + + return stream->priv->handle; +} + +static gssize +g_win32_input_stream_read (GInputStream *stream, + void *buffer, + gsize count, + GCancellable *cancellable, + GError **error) +{ + GWin32InputStream *win32_stream; + BOOL res; + DWORD nbytes, nread; + + win32_stream = G_WIN32_INPUT_STREAM (stream); + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return -1; + + if (count > G_MAXINT) + nbytes = G_MAXINT; + else + nbytes = count; + + res = ReadFile (win32_stream->priv->handle, buffer, nbytes, &nread, NULL); + if (!res) + { + int errsv = GetLastError (); + gchar *emsg; + + if (errsv == ERROR_HANDLE_EOF || + errsv == ERROR_BROKEN_PIPE) + return 0; + + emsg = g_win32_error_message (errsv); + g_set_error (error, G_IO_ERROR, + g_io_error_from_win32_error (errsv), + _("Error reading from handle: %s"), + emsg); + g_free (emsg); + return -1; + } + + return nread; +} + +static gboolean +g_win32_input_stream_close (GInputStream *stream, + GCancellable *cancellable, + GError **error) +{ + GWin32InputStream *win32_stream; + BOOL res; + + win32_stream = G_WIN32_INPUT_STREAM (stream); + + if (!win32_stream->priv->close_handle) + return TRUE; + + res = CloseHandle (win32_stream->priv->handle); + if (!res) + { + int errsv = GetLastError (); + gchar *emsg = g_win32_error_message (errsv); + + g_set_error (error, G_IO_ERROR, + g_io_error_from_win32_error (errsv), + _("Error closing handle: %s"), + emsg); + g_free (emsg); + return FALSE; + } + + return TRUE; +} diff --git a/gio/gwin32inputstream.h b/gio/gwin32inputstream.h new file mode 100644 index 0000000..937685f --- /dev/null +++ b/gio/gwin32inputstream.h @@ -0,0 +1,79 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2006-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Alexander Larsson + * Author: Tor Lillqvist + */ + +#ifndef __G_WIN32_INPUT_STREAM_H__ +#define __G_WIN32_INPUT_STREAM_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_WIN32_INPUT_STREAM (g_win32_input_stream_get_type ()) +#define G_WIN32_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_WIN32_INPUT_STREAM, GWin32InputStream)) +#define G_WIN32_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_WIN32_INPUT_STREAM, GWin32InputStreamClass)) +#define G_IS_WIN32_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_WIN32_INPUT_STREAM)) +#define G_IS_WIN32_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_WIN32_INPUT_STREAM)) +#define G_WIN32_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_WIN32_INPUT_STREAM, GWin32InputStreamClass)) + +/** + * GWin32InputStream: + * + * Implements #GInputStream for reading from selectable Windows file handles + **/ +typedef struct _GWin32InputStream GWin32InputStream; +typedef struct _GWin32InputStreamClass GWin32InputStreamClass; +typedef struct _GWin32InputStreamPrivate GWin32InputStreamPrivate; + +struct _GWin32InputStream +{ + GInputStream parent_instance; + + /*< private >*/ + GWin32InputStreamPrivate *priv; +}; + +struct _GWin32InputStreamClass +{ + GInputStreamClass parent_class; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +}; + +GType g_win32_input_stream_get_type (void) G_GNUC_CONST; + +GInputStream * g_win32_input_stream_new (void *handle, + gboolean close_handle); +void g_win32_input_stream_set_close_handle (GWin32InputStream *stream, + gboolean close_handle); +gboolean g_win32_input_stream_get_close_handle (GWin32InputStream *stream); +void *g_win32_input_stream_get_handle (GWin32InputStream *stream); + +G_END_DECLS + +#endif /* __G_WIN32_INPUT_STREAM_H__ */ diff --git a/gio/gwin32mount.c b/gio/gwin32mount.c index d7659dc..b40412f 100644 --- a/gio/gwin32mount.c +++ b/gio/gwin32mount.c @@ -40,7 +40,6 @@ #include "gsimpleasyncresult.h" #include "glibintl.h" -#include "gioalias.h" struct _GWin32Mount { GObject parent; diff --git a/gio/gwin32outputstream.c b/gio/gwin32outputstream.c new file mode 100644 index 0000000..609e4f4 --- /dev/null +++ b/gio/gwin32outputstream.c @@ -0,0 +1,355 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2006-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Alexander Larsson + * Author: Tor Lillqvist + */ + +#include "config.h" + +#include + +#include + +#include +#include +#include "gioerror.h" +#include "gwin32outputstream.h" +#include "gcancellable.h" +#include "gsimpleasyncresult.h" +#include "gasynchelper.h" +#include "glibintl.h" + + +/** + * SECTION:gwin32outputstream + * @short_description: Streaming output operations for Windows file handles + * @include: gio/gwin32outputstream.h + * @see_also: #GOutputStream + * + * #GWin32OutputStream implements #GOutputStream for writing to a + * Windows file handle. + * + * Note that <gio/gwin32outputstream.h> belongs + * to the Windows-specific GIO interfaces, thus you have to use the + * gio-windows-2.0.pc pkg-config file when using it. + */ + +enum { + PROP_0, + PROP_HANDLE, + PROP_CLOSE_HANDLE +}; + +G_DEFINE_TYPE (GWin32OutputStream, g_win32_output_stream, G_TYPE_OUTPUT_STREAM); + + +struct _GWin32OutputStreamPrivate { + HANDLE handle; + gboolean close_handle; +}; + +static void g_win32_output_stream_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void g_win32_output_stream_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static gssize g_win32_output_stream_write (GOutputStream *stream, + const void *buffer, + gsize count, + GCancellable *cancellable, + GError **error); +static gboolean g_win32_output_stream_close (GOutputStream *stream, + GCancellable *cancellable, + GError **error); + + +static void +g_win32_output_stream_finalize (GObject *object) +{ + G_OBJECT_CLASS (g_win32_output_stream_parent_class)->finalize (object); +} + +static void +g_win32_output_stream_class_init (GWin32OutputStreamClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GWin32OutputStreamPrivate)); + + gobject_class->get_property = g_win32_output_stream_get_property; + gobject_class->set_property = g_win32_output_stream_set_property; + gobject_class->finalize = g_win32_output_stream_finalize; + + stream_class->write_fn = g_win32_output_stream_write; + stream_class->close_fn = g_win32_output_stream_close; + + /** + * GWin32OutputStream:handle: + * + * The file handle that the stream writes to. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_HANDLE, + g_param_spec_pointer ("handle", + P_("File handle"), + P_("The file handle to write to"), + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); + + /** + * GWin32OutputStream:close-handle: + * + * Whether to close the file handle when the stream is closed. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_CLOSE_HANDLE, + g_param_spec_boolean ("close-handle", + P_("Close file handle"), + P_("Whether to close the file handle when the stream is closed"), + TRUE, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); +} + +static void +g_win32_output_stream_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GWin32OutputStream *win32_stream; + + win32_stream = G_WIN32_OUTPUT_STREAM (object); + + switch (prop_id) + { + case PROP_HANDLE: + win32_stream->priv->handle = g_value_get_pointer (value); + break; + case PROP_CLOSE_HANDLE: + win32_stream->priv->close_handle = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +g_win32_output_stream_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GWin32OutputStream *win32_stream; + + win32_stream = G_WIN32_OUTPUT_STREAM (object); + + switch (prop_id) + { + case PROP_HANDLE: + g_value_set_pointer (value, win32_stream->priv->handle); + break; + case PROP_CLOSE_HANDLE: + g_value_set_boolean (value, win32_stream->priv->close_handle); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +g_win32_output_stream_init (GWin32OutputStream *win32_stream) +{ + win32_stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (win32_stream, + G_TYPE_WIN32_OUTPUT_STREAM, + GWin32OutputStreamPrivate); + + win32_stream->priv->handle = NULL; + win32_stream->priv->close_handle = TRUE; +} + +/** + * g_win32_output_stream_new: + * @handle: a Win32 file handle + * @close_handle: %TRUE to close the handle when done + * + * Creates a new #GWin32OutputStream for the given @handle. + * + * If @close_handle, is %TRUE, the handle will be closed when the + * output stream is destroyed. + * + * Returns: a new #GOutputStream + * + * Since: 2.26 +**/ +GOutputStream * +g_win32_output_stream_new (void *handle, + gboolean close_handle) +{ + GWin32OutputStream *stream; + + g_return_val_if_fail (handle != NULL, NULL); + + stream = g_object_new (G_TYPE_WIN32_OUTPUT_STREAM, + "handle", handle, + "close-handle", close_handle, + NULL); + + return G_OUTPUT_STREAM (stream); +} + +/** + * g_win32_output_stream_set_close_handle: + * @stream: a #GWin32OutputStream + * @close_handle: %TRUE to close the handle when done + * + * Sets whether the handle of @stream shall be closed when the stream + * is closed. + * + * Since: 2.26 + */ +void +g_win32_output_stream_set_close_handle (GWin32OutputStream *stream, + gboolean close_handle) +{ + g_return_if_fail (G_IS_WIN32_OUTPUT_STREAM (stream)); + + close_handle = close_handle != FALSE; + if (stream->priv->close_handle != close_handle) + { + stream->priv->close_handle = close_handle; + g_object_notify (G_OBJECT (stream), "close-handle"); + } +} + +/** + * g_win32_output_stream_get_close_handle: + * @stream: a #GWin32OutputStream + * + * Returns whether the handle of @stream will be closed when the + * stream is closed. + * + * Return value: %TRUE if the handle is closed when done + * + * Since: 2.26 + */ +gboolean +g_win32_output_stream_get_close_handle (GWin32OutputStream *stream) +{ + g_return_val_if_fail (G_IS_WIN32_OUTPUT_STREAM (stream), FALSE); + + return stream->priv->close_handle; +} + +/** + * g_win32_output_stream_get_handle: + * @stream: a #GWin32OutputStream + * + * Return the Windows handle that the stream writes to. + * + * Return value: The handle descriptor of @stream + * + * Since: 2.26 + */ +void * +g_win32_output_stream_get_handle (GWin32OutputStream *stream) +{ + g_return_val_if_fail (G_IS_WIN32_OUTPUT_STREAM (stream), NULL); + + return stream->priv->handle; +} + +static gssize +g_win32_output_stream_write (GOutputStream *stream, + const void *buffer, + gsize count, + GCancellable *cancellable, + GError **error) +{ + GWin32OutputStream *win32_stream; + BOOL res; + DWORD nbytes, nwritten; + + win32_stream = G_WIN32_OUTPUT_STREAM (stream); + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return -1; + + if (count > G_MAXINT) + nbytes = G_MAXINT; + else + nbytes = count; + + res = WriteFile (win32_stream->priv->handle, buffer, nbytes, &nwritten, NULL); + if (!res) + { + int errsv = GetLastError (); + gchar *emsg = g_win32_error_message (errsv); + + if (errsv == ERROR_HANDLE_EOF) + return 0; + + g_set_error (error, G_IO_ERROR, + g_io_error_from_win32_error (errsv), + _("Error writing to handle: %s"), + emsg); + g_free (emsg); + return -1; + } + + return nwritten; +} + +static gboolean +g_win32_output_stream_close (GOutputStream *stream, + GCancellable *cancellable, + GError **error) +{ + GWin32OutputStream *win32_stream; + BOOL res; + + win32_stream = G_WIN32_OUTPUT_STREAM (stream); + + if (!win32_stream->priv->close_handle) + return TRUE; + + res = CloseHandle (win32_stream->priv->handle); + if (!res) + { + int errsv = GetLastError (); + gchar *emsg = g_win32_error_message (errsv); + + g_set_error (error, G_IO_ERROR, + g_io_error_from_win32_error (errsv), + _("Error closing handle: %s"), + emsg); + g_free (emsg); + return FALSE; + } + + return TRUE; +} diff --git a/gio/gwin32outputstream.h b/gio/gwin32outputstream.h new file mode 100644 index 0000000..399a53a --- /dev/null +++ b/gio/gwin32outputstream.h @@ -0,0 +1,78 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2006-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Alexander Larsson + * Author: Tor Lillqvist + */ + +#ifndef __G_WIN32_OUTPUT_STREAM_H__ +#define __G_WIN32_OUTPUT_STREAM_H__ + +#include + +G_BEGIN_DECLS + +#define G_TYPE_WIN32_OUTPUT_STREAM (g_win32_output_stream_get_type ()) +#define G_WIN32_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_WIN32_OUTPUT_STREAM, GWin32OutputStream)) +#define G_WIN32_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_WIN32_OUTPUT_STREAM, GWin32OutputStreamClass)) +#define G_IS_WIN32_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_WIN32_OUTPUT_STREAM)) +#define G_IS_WIN32_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_WIN32_OUTPUT_STREAM)) +#define G_WIN32_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_WIN32_OUTPUT_STREAM, GWin32OutputStreamClass)) + +/** + * GWin32OutputStream: + * + * Implements #GOutputStream for outputting to Windows file handles + **/ +typedef struct _GWin32OutputStream GWin32OutputStream; +typedef struct _GWin32OutputStreamClass GWin32OutputStreamClass; +typedef struct _GWin32OutputStreamPrivate GWin32OutputStreamPrivate; + +struct _GWin32OutputStream +{ + GOutputStream parent_instance; + + /*< private >*/ + GWin32OutputStreamPrivate *priv; +}; + +struct _GWin32OutputStreamClass +{ + GOutputStreamClass parent_class; + + /*< private >*/ + /* Padding for future expansion */ + void (*_g_reserved1) (void); + void (*_g_reserved2) (void); + void (*_g_reserved3) (void); + void (*_g_reserved4) (void); + void (*_g_reserved5) (void); +}; + +GType g_win32_output_stream_get_type (void) G_GNUC_CONST; + +GOutputStream * g_win32_output_stream_new (void *handle, + gboolean close_handle); +void g_win32_output_stream_set_close_handle (GWin32OutputStream *stream, + gboolean close_handle); +gboolean g_win32_output_stream_get_close_handle (GWin32OutputStream *stream); +void *g_win32_output_stream_get_handle (GWin32OutputStream *stream); +G_END_DECLS + +#endif /* __G_WIN32_OUTPUT_STREAM_H__ */ diff --git a/gio/gwin32resolver.c b/gio/gwin32resolver.c index 5198b95..1dd2aad 100644 --- a/gio/gwin32resolver.c +++ b/gio/gwin32resolver.c @@ -34,7 +34,6 @@ #include "gsimpleasyncresult.h" #include "gsocketaddress.h" -#include "gioalias.h" G_DEFINE_TYPE (GWin32Resolver, g_win32_resolver, G_TYPE_THREADED_RESOLVER) @@ -482,6 +481,3 @@ g_win32_handle_source_add (HANDLE handle, g_source_attach (source, g_main_context_get_thread_default ()); return source; } - -#define __G_WIN32_RESOLVER_C__ -#include "gioaliasdef.c" diff --git a/gio/gwin32volumemonitor.c b/gio/gwin32volumemonitor.c index 88cdece..4b984ea 100644 --- a/gio/gwin32volumemonitor.c +++ b/gio/gwin32volumemonitor.c @@ -34,7 +34,6 @@ #include "gwin32mount.h" #include "gmount.h" #include "giomodule.h" -#include "gioalias.h" #define _WIN32_WINNT 0x0500 #include diff --git a/gio/gzlibcompressor.c b/gio/gzlibcompressor.c index fa657fa..3c54753 100644 --- a/gio/gzlibcompressor.c +++ b/gio/gzlibcompressor.c @@ -22,23 +22,24 @@ #include "config.h" +#include "gzlibcompressor.h" + #include #include #include -#include "gzlibcompressor.h" -#include "glib.h" +#include "gfileinfo.h" #include "gioerror.h" -#include "glibintl.h" #include "gioenums.h" #include "gioenumtypes.h" +#include "glibintl.h" -#include "gioalias.h" enum { PROP_0, PROP_FORMAT, - PROP_LEVEL + PROP_LEVEL, + PROP_FILE_INFO }; /** @@ -64,8 +65,37 @@ struct _GZlibCompressor GZlibCompressorFormat format; int level; z_stream zstream; + gz_header gzheader; + GFileInfo *file_info; }; +static void +g_zlib_compressor_set_gzheader (GZlibCompressor *compressor) +{ + /* On win32, these functions were not exported before 1.2.4 */ +#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240 + const gchar *filename; + + if (compressor->format != G_ZLIB_COMPRESSOR_FORMAT_GZIP || + compressor->file_info == NULL) + return; + + memset (&compressor->gzheader, 0, sizeof (gz_header)); + compressor->gzheader.os = 0x03; /* Unix */ + + filename = g_file_info_get_name (compressor->file_info); + compressor->gzheader.name = (Bytef *) filename; + compressor->gzheader.name_max = filename ? strlen (filename) + 1 : 0; + + compressor->gzheader.time = + (uLong) g_file_info_get_attribute_uint64 (compressor->file_info, + G_FILE_ATTRIBUTE_TIME_MODIFIED); + + if (deflateSetHeader (&compressor->zstream, &compressor->gzheader) != Z_OK) + g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg); +#endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */ +} + G_DEFINE_TYPE_WITH_CODE (GZlibCompressor, g_zlib_compressor, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_CONVERTER, g_zlib_compressor_iface_init)) @@ -79,6 +109,9 @@ g_zlib_compressor_finalize (GObject *object) deflateEnd (&compressor->zstream); + if (compressor->file_info) + g_object_unref (compressor->file_info); + G_OBJECT_CLASS (g_zlib_compressor_parent_class)->finalize (object); } @@ -103,6 +136,10 @@ g_zlib_compressor_set_property (GObject *object, compressor->level = g_value_get_int (value); break; + case PROP_FILE_INFO: + g_zlib_compressor_set_file_info (compressor, g_value_get_object (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -130,6 +167,10 @@ g_zlib_compressor_get_property (GObject *object, g_value_set_int (value, compressor->level); break; + case PROP_FILE_INFO: + g_value_set_object (value, compressor->file_info); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -173,6 +214,8 @@ g_zlib_compressor_constructed (GObject *object) if (res != Z_OK) g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg); + + g_zlib_compressor_set_gzheader (compressor); } static void @@ -204,6 +247,24 @@ g_zlib_compressor_class_init (GZlibCompressorClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GZlibCompressor:file-info: + * + * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is + * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name + * and modification time from the file info to the the GZIP header. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_FILE_INFO, + g_param_spec_object ("file-info", + P_("file info"), + P_("File info"), + G_TYPE_FILE_INFO, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); } /** @@ -231,6 +292,59 @@ g_zlib_compressor_new (GZlibCompressorFormat format, return compressor; } +/** + * g_zlib_compressor_get_file_info: + * @compressor: a #GZlibCompressor + * + * Returns the #GZlibCompressor:file-info property. + * + * Returns: (transfer none): a #GFileInfo, or %NULL + * + * Since: 2.26 + */ +GFileInfo * +g_zlib_compressor_get_file_info (GZlibCompressor *compressor) +{ + g_return_val_if_fail (G_IS_ZLIB_COMPRESSOR (compressor), NULL); + + return compressor->file_info; +} + +/** + * g_zlib_compressor_set_file_info: + * @compressor: a #GZlibCompressor + * @file_info: (allow-none): a #GFileInfo + * + * Sets @file_info in @compressor. If non-%NULL, and @compressor's + * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP, + * it will be used to set the file name and modification time in + * the GZIP header of the compressed data. + * + * Note: it is an error to call this function while a compression is in + * progress; it may only be called immediately after creation of @compressor, + * or after resetting it with g_converter_reset(). + * + * Since: 2.26 + */ +void +g_zlib_compressor_set_file_info (GZlibCompressor *compressor, + GFileInfo *file_info) +{ + g_return_if_fail (G_IS_ZLIB_COMPRESSOR (compressor)); + + if (file_info == compressor->file_info) + return; + + if (compressor->file_info) + g_object_unref (compressor->file_info); + if (file_info) + g_object_ref (file_info); + compressor->file_info = file_info; + g_object_notify (G_OBJECT (compressor), "file-info"); + + g_zlib_compressor_set_gzheader (compressor); +} + static void g_zlib_compressor_reset (GConverter *converter) { @@ -240,6 +354,9 @@ g_zlib_compressor_reset (GConverter *converter) res = deflateReset (&compressor->zstream); if (res != Z_OK) g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg); + + /* deflateReset reset the header too, so re-set it */ + g_zlib_compressor_set_gzheader (compressor); } static GConverterResult @@ -319,6 +436,3 @@ g_zlib_compressor_iface_init (GConverterIface *iface) iface->convert = g_zlib_compressor_convert; iface->reset = g_zlib_compressor_reset; } - -#define __G_ZLIB_COMPRESSOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gzlibcompressor.h b/gio/gzlibcompressor.h index 0e14a80..5824781 100644 --- a/gio/gzlibcompressor.h +++ b/gio/gzlibcompressor.h @@ -28,6 +28,7 @@ #define __G_ZLIB_COMPRESSOR_H__ #include +#include G_BEGIN_DECLS @@ -50,6 +51,10 @@ GType g_zlib_compressor_get_type (void) G_GNUC_CONST; GZlibCompressor *g_zlib_compressor_new (GZlibCompressorFormat format, int level); +GFileInfo *g_zlib_compressor_get_file_info (GZlibCompressor *compressor); +void g_zlib_compressor_set_file_info (GZlibCompressor *compressor, + GFileInfo *file_info); + G_END_DECLS #endif /* __G_ZLIB_COMPRESSOR_H__ */ diff --git a/gio/gzlibdecompressor.c b/gio/gzlibdecompressor.c index 439ac7c..df70e7e 100644 --- a/gio/gzlibdecompressor.c +++ b/gio/gzlibdecompressor.c @@ -22,22 +22,23 @@ #include "config.h" +#include "gzlibdecompressor.h" + #include #include #include -#include "gzlibdecompressor.h" -#include "glib.h" +#include "gfileinfo.h" #include "gioerror.h" -#include "glibintl.h" #include "gioenums.h" #include "gioenumtypes.h" +#include "glibintl.h" -#include "gioalias.h" enum { PROP_0, - PROP_FORMAT + PROP_FORMAT, + PROP_FILE_INFO }; /** @@ -51,6 +52,12 @@ enum { static void g_zlib_decompressor_iface_init (GConverterIface *iface); +typedef struct { + gz_header gzheader; + char filename[257]; + GFileInfo *file_info; +} HeaderData; + /** * GZlibDecompressor: * @@ -62,8 +69,38 @@ struct _GZlibDecompressor GZlibCompressorFormat format; z_stream zstream; + HeaderData *header_data; }; +static void +g_zlib_decompressor_set_gzheader (GZlibDecompressor *decompressor) +{ + /* On win32, these functions were not exported before 1.2.4 */ +#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240 + if (decompressor->format != G_ZLIB_COMPRESSOR_FORMAT_GZIP) + return; + + if (decompressor->header_data != NULL) + { + if (decompressor->header_data->file_info) + g_object_unref (decompressor->header_data->file_info); + + memset (decompressor->header_data, 0, sizeof (HeaderData)); + } + else + { + decompressor->header_data = g_new0 (HeaderData, 1); + } + + decompressor->header_data->gzheader.name = (Bytef*) &decompressor->header_data->filename; + /* We keep one byte to guarantee the string is 0-terminated */ + decompressor->header_data->gzheader.name_max = 256; + + if (inflateGetHeader (&decompressor->zstream, &decompressor->header_data->gzheader) != Z_OK) + g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg); +#endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */ +} + G_DEFINE_TYPE_WITH_CODE (GZlibDecompressor, g_zlib_decompressor, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_CONVERTER, g_zlib_decompressor_iface_init)) @@ -77,6 +114,13 @@ g_zlib_decompressor_finalize (GObject *object) inflateEnd (&decompressor->zstream); + if (decompressor->header_data != NULL) + { + if (decompressor->header_data->file_info) + g_object_unref (decompressor->header_data->file_info); + g_free (decompressor->header_data); + } + G_OBJECT_CLASS (g_zlib_decompressor_parent_class)->finalize (object); } @@ -120,6 +164,13 @@ g_zlib_decompressor_get_property (GObject *object, g_value_set_enum (value, decompressor->format); break; + case PROP_FILE_INFO: + if (decompressor->header_data) + g_value_set_object (value, decompressor->header_data->file_info); + else + g_value_set_object (value, NULL); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -157,6 +208,8 @@ g_zlib_decompressor_constructed (GObject *object) if (res != Z_OK) g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg); + + g_zlib_decompressor_set_gzheader (decompressor); } static void @@ -178,6 +231,25 @@ g_zlib_decompressor_class_init (GZlibDecompressorClass *klass) G_ZLIB_COMPRESSOR_FORMAT_ZLIB, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + /** + * GZlibDecompressor:file-info: + * + * A #GFileInfo containing the information found in the GZIP header + * of the data stream processed, or %NULL if the header was not yet + * fully processed, is not present at all, or the compressor's + * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP. + * + * Since: 2.26 + */ + g_object_class_install_property (gobject_class, + PROP_FILE_INFO, + g_param_spec_object ("file-info", + P_("file info"), + P_("File info"), + G_TYPE_FILE_INFO, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } /** @@ -202,6 +274,31 @@ g_zlib_decompressor_new (GZlibCompressorFormat format) return decompressor; } +/** + * g_zlib_decompressor_get_file_info: + * @decompressor: a #GZlibDecompressor + * + * Retrieves the #GFileInfo constructed from the GZIP header data + * of compressed data processed by @compressor, or %NULL if @decompressor's + * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP, + * or the header data was not fully processed yet, or it not present in the + * data stream at all. + * + * Returns: (transfer none): a #GFileInfo, or %NULL + * + * Since: 2.26 + */ +GFileInfo * +g_zlib_decompressor_get_file_info (GZlibDecompressor *decompressor) +{ + g_return_val_if_fail (G_IS_ZLIB_DECOMPRESSOR (decompressor), NULL); + + if (decompressor->header_data) + return decompressor->header_data->file_info; + + return NULL; +} + static void g_zlib_decompressor_reset (GConverter *converter) { @@ -211,6 +308,8 @@ g_zlib_decompressor_reset (GConverter *converter) res = inflateReset (&decompressor->zstream); if (res != Z_OK) g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg); + + g_zlib_decompressor_set_gzheader (decompressor); } static GConverterResult @@ -272,17 +371,40 @@ g_zlib_decompressor_convert (GConverter *converter, return G_CONVERTER_ERROR; } - if (res == Z_OK || res == Z_STREAM_END) + g_assert (res == Z_OK || res == Z_STREAM_END); + + *bytes_read = inbuf_size - decompressor->zstream.avail_in; + *bytes_written = outbuf_size - decompressor->zstream.avail_out; + +#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240 + if (decompressor->header_data != NULL && + decompressor->header_data->gzheader.done == 1) { - *bytes_read = inbuf_size - decompressor->zstream.avail_in; - *bytes_written = outbuf_size - decompressor->zstream.avail_out; + HeaderData *data = decompressor->header_data; + + /* So we don't notify again */ + data->gzheader.done = 2; + + data->file_info = g_file_info_new (); + g_file_info_set_attribute_uint64 (data->file_info, + G_FILE_ATTRIBUTE_TIME_MODIFIED, + data->gzheader.time); + g_file_info_set_attribute_uint32 (data->file_info, + G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, + 0); - if (res == Z_STREAM_END) - return G_CONVERTER_FINISHED; - return G_CONVERTER_CONVERTED; + if (data->filename[0] != '\0') + g_file_info_set_attribute_byte_string (data->file_info, + G_FILE_ATTRIBUTE_STANDARD_NAME, + data->filename); + + g_object_notify (G_OBJECT (decompressor), "file-info"); } +#endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */ - g_assert_not_reached (); + if (res == Z_STREAM_END) + return G_CONVERTER_FINISHED; + return G_CONVERTER_CONVERTED; } static void @@ -291,6 +413,3 @@ g_zlib_decompressor_iface_init (GConverterIface *iface) iface->convert = g_zlib_decompressor_convert; iface->reset = g_zlib_decompressor_reset; } - -#define __G_ZLIB_DECOMPRESSOR_C__ -#include "gioaliasdef.c" diff --git a/gio/gzlibdecompressor.h b/gio/gzlibdecompressor.h index fa334c2..f7bb57d 100644 --- a/gio/gzlibdecompressor.h +++ b/gio/gzlibdecompressor.h @@ -28,6 +28,7 @@ #define __G_ZLIB_DECOMPRESSOR_H__ #include +#include G_BEGIN_DECLS @@ -49,6 +50,8 @@ GType g_zlib_decompressor_get_type (void) G_GNUC_CONST; GZlibDecompressor *g_zlib_decompressor_new (GZlibCompressorFormat format); +GFileInfo *g_zlib_decompressor_get_file_info (GZlibDecompressor *decompressor); + G_END_DECLS #endif /* __G_ZLIB_DECOMPRESSOR_H__ */ diff --git a/gio/inotify/Makefile.am b/gio/inotify/Makefile.am index 725936b..8eb9e91 100644 --- a/gio/inotify/Makefile.am +++ b/gio/inotify/Makefile.am @@ -25,11 +25,7 @@ libinotify_la_SOURCES = \ libinotify_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ - -I$(top_builddir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ diff --git a/gio/inotify/Makefile.in b/gio/inotify/Makefile.in index b933a9b..5ef036d 100644 --- a/gio/inotify/Makefile.in +++ b/gio/inotify/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -100,6 +100,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -124,11 +125,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -142,13 +146,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -195,6 +202,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -202,6 +211,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -227,6 +237,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -243,6 +255,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -252,11 +265,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -272,11 +287,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -290,7 +311,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -342,11 +362,7 @@ libinotify_la_SOURCES = \ libinotify_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ - -I$(top_builddir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ @@ -710,13 +726,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -743,8 +762,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -753,9 +776,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gio/inotify/ginotifydirectorymonitor.c b/gio/inotify/ginotifydirectorymonitor.c index dcc97a0..13bdd52 100644 --- a/gio/inotify/ginotifydirectorymonitor.c +++ b/gio/inotify/ginotifydirectorymonitor.c @@ -26,13 +26,11 @@ #include "config.h" #include "ginotifydirectorymonitor.h" -#include "giomodule.h" +#include #define USE_INOTIFY 1 #include "inotify-helper.h" -#include "gioalias.h" - struct _GInotifyDirectoryMonitor { GLocalDirectoryMonitor parent_instance; @@ -156,4 +154,3 @@ g_inotify_directory_monitor_cancel (GFileMonitor* monitor) return TRUE; } - diff --git a/gio/inotify/ginotifydirectorymonitor.h b/gio/inotify/ginotifydirectorymonitor.h index d5abb71..c8cb9ca 100644 --- a/gio/inotify/ginotifydirectorymonitor.h +++ b/gio/inotify/ginotifydirectorymonitor.h @@ -28,8 +28,8 @@ #include #include -#include "glocaldirectorymonitor.h" -#include "giomodule.h" +#include +#include G_BEGIN_DECLS diff --git a/gio/inotify/ginotifyfilemonitor.c b/gio/inotify/ginotifyfilemonitor.c index f87f079..bdfea19 100644 --- a/gio/inotify/ginotifyfilemonitor.c +++ b/gio/inotify/ginotifyfilemonitor.c @@ -31,8 +31,6 @@ #define USE_INOTIFY 1 #include "inotify-helper.h" -#include "gioalias.h" - struct _GInotifyFileMonitor { GLocalFileMonitor parent_instance; @@ -178,4 +176,3 @@ g_inotify_file_monitor_cancel (GFileMonitor* monitor) return TRUE; } - diff --git a/gio/inotify/inotify-helper.c b/gio/inotify/inotify-helper.c index 5572f0d..f567e1b 100644 --- a/gio/inotify/inotify-helper.c +++ b/gio/inotify/inotify-helper.c @@ -38,9 +38,6 @@ #include "inotify-path.h" #include "inotify-diag.h" -#include "gioalias.h" - - static gboolean ih_debug_enabled = FALSE; #define IH_W if (ih_debug_enabled) g_warning @@ -86,7 +83,6 @@ _ih_startup (void) result = _ip_startup (ih_event_callback); if (!result) { - g_warning ("Could not initialize inotify\n"); G_UNLOCK (inotify_lock); return FALSE; } @@ -139,7 +135,7 @@ _ih_sub_cancel (inotify_sub *sub) } static char * -_ih_fullpath_from_event (ik_event_t *event, char *dirname) +_ih_fullpath_from_event (ik_event_t *event, const char *dirname) { char *fullpath; @@ -171,19 +167,17 @@ ih_event_callback (ik_event_t *event, { gchar *fullpath; GFileMonitorEvent eflags; - GFile* parent; GFile* child; GFile* other; - + eflags = ih_mask_to_EventFlags (event->mask); - parent = g_file_new_for_path (sub->dirname); fullpath = _ih_fullpath_from_event (event, sub->dirname); child = g_file_new_for_path (fullpath); g_free (fullpath); if (ih_event_is_paired_move (event) && sub->pair_moves) { - char *parent_dir = _ip_get_path_for_wd (event->pair->wd); + const char *parent_dir = (char *) _ip_get_path_for_wd (event->pair->wd); fullpath = _ih_fullpath_from_event (event->pair, parent_dir); other = g_file_new_for_path (fullpath); g_free (fullpath); @@ -197,7 +191,6 @@ ih_event_callback (ik_event_t *event, child, other, eflags); g_object_unref (child); - g_object_unref (parent); if (other) g_object_unref (other); } @@ -208,10 +201,7 @@ ih_not_missing_callback (inotify_sub *sub) gchar *fullpath; GFileMonitorEvent eflags; guint32 mask; - GFile* parent; GFile* child; - - parent = g_file_new_for_path (sub->dirname); if (sub->filename) { @@ -238,7 +228,6 @@ ih_not_missing_callback (inotify_sub *sub) child, NULL, eflags); g_object_unref (child); - g_object_unref (parent); } /* Transforms a inotify event to a GVFS event. */ diff --git a/gio/inotify/inotify-kernel.c b/gio/inotify/inotify-kernel.c index d6385f9..e712ee7 100644 --- a/gio/inotify/inotify-kernel.c +++ b/gio/inotify/inotify-kernel.c @@ -32,7 +32,7 @@ #include /* Timings for pairing MOVED_TO / MOVED_FROM events */ -#define PROCESS_EVENTS_TIME 1000 /* 1 millisecond (1 hz) */ +#define PROCESS_EVENTS_TIME 1000 /* 1000 milliseconds (1 hz) */ #define DEFAULT_HOLD_UNTIL_TIME 0 /* 0 millisecond */ #define MOVE_HOLD_UNTIL_TIME 500 /* 500 microseconds or 0.5 milliseconds */ @@ -208,6 +208,7 @@ gboolean _ik_startup (void (*cb)(ik_event_t *event)) g_io_channel_set_flags (inotify_read_ioc, G_IO_FLAG_NONBLOCK, NULL); source = g_source_new (&ik_source_funcs, sizeof (GSource)); + g_source_set_name (source, "GIO Inotify"); g_source_add_poll (source, &ik_poll_fd); g_source_set_callback (source, ik_read_callback, NULL, NULL); g_source_attach (source, NULL); diff --git a/gio/libasyncns/Makefile.am b/gio/libasyncns/Makefile.am index 80b20a2..2b69b6e 100644 --- a/gio/libasyncns/Makefile.am +++ b/gio/libasyncns/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in include $(top_srcdir)/Makefile.decl -INCLUDES = -I$(top_srcdir) +INCLUDES = $(config_h_INCLUDES) noinst_LTLIBRARIES = libasyncns.la diff --git a/gio/libasyncns/Makefile.in b/gio/libasyncns/Makefile.in index b0d31c4..2aa51f7 100644 --- a/gio/libasyncns/Makefile.in +++ b/gio/libasyncns/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -92,6 +92,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -116,11 +117,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -134,13 +138,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -187,6 +194,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -194,6 +203,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -219,6 +229,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -235,6 +247,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -244,11 +257,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -264,11 +279,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -282,7 +303,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -311,7 +331,7 @@ GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package # initialize variables for unconditional += appending EXTRA_DIST = README update.sh TEST_PROGS = -INCLUDES = -I$(top_srcdir) +INCLUDES = $(config_h_INCLUDES) noinst_LTLIBRARIES = libasyncns.la libasyncns_la_SOURCES = \ asyncns.c \ @@ -606,13 +626,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -639,8 +662,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -649,9 +676,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gio/makefile.msc b/gio/makefile.msc index 57656c5..c545578 100644 --- a/gio/makefile.msc +++ b/gio/makefile.msc @@ -221,8 +221,6 @@ local_sources = \ all : \ $(PRJ_TOP)\config.h \ sub-all \ - gioalias.h \ - gioaliasdef.c \ gio-marshal.c \ gioenumtypes.h \ gioenumtypes.c \ @@ -232,12 +230,6 @@ all : \ $(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32 copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h -gioalias.h: gio.symbols - perl ..\glib\makegalias.pl < gio.symbols > gioalias.h - -gioaliasdef.c: gio.symbols - perl ..\glib\makegalias.pl -def < gio.symbols > gioaliasdef.c - gioenumtypes.h: $(gio_headers) gioenumtypes.h.template $(PERL) ..\gobject\glib-mkenums --template gioenumtypes.h.template $(gio_headers) > gioenumtypes.h diff --git a/gio/makegioalias.pl b/gio/makegioalias.pl deleted file mode 100755 index b4ae319..0000000 --- a/gio/makegioalias.pl +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/perl -w - -my $do_def = 0; - -if (($#ARGV >= 0) && ($ARGV[0] eq "-def")) { - shift; - $do_def = 1; -} - -print <) { - - # ignore empty lines - next if /^\s*$/; - - # skip comments - if ($_ =~ /^\s*\/\*/) - { - $in_comment = 1; - } - - if ($in_comment) - { - if ($_ =~ /\*\/\s$/) - { - $in_comment = 0; - } - - next; - } - - # handle ifdefs - if ($_ =~ /^\#endif/) - { - if (!$in_skipped_section) - { - print $_; - } - - $in_skipped_section = 0; - - next; - } - - if ($_ =~ /^\#ifdef\s+(INCLUDE_VARIABLES|INCLUDE_INTERNAL_SYMBOLS|ALL_FILES)/) - { - $in_skipped_section = 1; - } - - if ($in_skipped_section) - { - next; - } - - if ($_ =~ /^\#ifn?def\s+G/) - { - print $_; - - next; - } - - if ($_ =~ /^\#if.*(IN_FILE|IN_HEADER)/) - { - print $_; - - next; - } - - chop; - my $str = $_; - my @words; - my $attributes = ""; - - @words = split(/ /, $str); - $str = shift(@words); - chomp($str); - my $alias = "IA__".$str; - - # Drop any Win32 specific .def file syntax, but keep attributes - foreach $word (@words) { - $attributes = "$attributes $word" unless $word eq "PRIVATE"; - } - - if (!$do_def) { - print </dev/null >/dev/null; then - echo "'readelf' not found; skipping test" - exit 0 -fi - -SKIP='\ + */ + +#include +#include + +/** + * The string info map is an efficient data structure designed to be + * used with a small set of items. It is used by GSettings schemas for + * three purposes: + * + * 1) Implement with a list of valid strings + * + * 2) Implement by mapping one string to another + * + * 3) Implement enumerated types by mapping strings to integer values + * (and back). + * + * The map is made out of an array of uint32s. Each entry in the array + * is an integer value, followed by a specially formatted string value: + * + * The string starts with the byte 0xff or 0xfe, followed by the + * content of the string, followed by a nul byte, followed by + * additional nul bytes for padding, followed by a 0xff byte. + * + * Padding is added so that the entire formatted string takes up a + * multiple of 4 bytes, and not less than 8 bytes. The requirement + * for a string to take up 8 bytes is so that the scanner doesn't lose + * synch and mistake a string for an integer value. + * + * The first byte of the formatted string depends on if the integer is + * an enum value (0xff) or an alias (0xfe). If it is an alias then the + * number refers to the word offset within the info map at which the + * integer corresponding to the "target" value is stored. + * + * For example, consider the case of the string info map representing an + * enumerated type of 'foo' (value 1) and 'bar' (value 2) and 'baz' + * (alias for 'bar'). Note that string info maps are always little + * endian. + * + * x01 x00 x00 x00 xff 'f' 'o' 'o' x00 x00 x00 xff x02 x00 x00 x00 + * xff 'b' 'a' 'r' x00 x00 x00 xff x03 x00 x00 x00 xfe 'b' 'a' 'z' + * x00 x00 x00 xff + * + * + * The operations that someone may want to perform with the map: + * + * - lookup if a string is valid (and not an alias) + * - lookup the integer value for a enum 'nick' + * - lookup the integer value for the target of an alias + * - lookup an alias and convert it to its target string + * - lookup the enum nick for a given value + * + * In order to lookup if a string is valid, it is padded on either side + * (as described) and scanned for in the array. For example, you might + * look for "foo": + * + * xff 'f' 'o' 'o' x00 x00 x00 xff + * + * In order to lookup the integer value for a nick, the string is padded + * on either side and scanned for in the array, as above. Instead of + * merely succeeding, we look at the integer value to the left of the + * match. This is the enum value. + * + * In order to lookup an alias and convert it to its target enum value, + * the string is padded on either side (as described, with 0xfe) and + * scanned for. For example, you might look for "baz": + * + * xfe 'b' 'a' 'z' x00 x00 x00 xff + * + * The integer immediately preceeding the match then contains the offset + * of the integer value of the target. In our example, that's '3'. + * This index is dereferenced to find the enum value of '2'. + * + * To convert the alias to its target string, 5 bytes just need to be + * added past the start of the integer value to find the start of the + * string. + * + * To lookup the enum nick for a given value, the value is searched for + * in the array. To ensure that the value isn't matching the inside of a + * string, we must check that it is either the first item in the array or + * immediately preceeded by the byte 0xff. It must also be immediately + * followed by the byte 0xff. + * + * Because strings always take up a minimum of 2 words, because 0xff or + * 0xfe never appear inside of a utf-8 string and because no two integer + * values ever appear in sequence, the only way we can have the + * sequence: + * + * xff __ __ __ __ xff (or 0xfe) + * + * is in the event of an integer nested between two strings. + * + * For implementation simplicity/efficiency, strings may not be more + * than 65 characters in length (ie: 17 32bit words after padding). + * + * In the event that we are doing (ie: not an enum type) then + * the value of each choice is set to zero and ignored. + */ + +#define STRINFO_MAX_WORDS 17 +G_GNUC_UNUSED static guint +strinfo_string_to_words (const gchar *string, + guint32 *words, + gboolean alias) +{ + guint n_words; + gsize size; + + size = strlen (string); + + n_words = MAX (2, (size + 6) >> 2); + + if (n_words > STRINFO_MAX_WORDS) + return FALSE; + + words[0] = GUINT32_TO_LE (alias ? 0xfe : 0xff); + words[n_words - 1] = GUINT32_TO_BE (0xff); + memcpy (((gchar *) words) + 1, string, size + 1); + + return n_words; +} + +G_GNUC_UNUSED static gint +strinfo_scan (const guint32 *strinfo, + guint length, + const guint32 *words, + guint n_words) +{ + guint i = 0; + + if (length < n_words) + return -1; + + while (i <= length - n_words) + { + guint j = 0; + + for (j = 0; j < n_words; j++) + if (strinfo[i + j] != words[j]) + break; + + if (j == n_words) + return i; /* match */ + + /* skip at least one word, continue */ + i += j ? j : 1; + } + + return -1; +} + +G_GNUC_UNUSED static gint +strinfo_find_string (const guint32 *strinfo, + guint length, + const gchar *string, + gboolean alias) +{ + guint32 words[STRINFO_MAX_WORDS]; + guint n_words; + + if (length == 0) + return -1; + + n_words = strinfo_string_to_words (string, words, alias); + + return strinfo_scan (strinfo + 1, length - 1, words, n_words); +} + +G_GNUC_UNUSED static gint +strinfo_find_integer (const guint32 *strinfo, + guint length, + guint32 value) +{ + guint i; + + for (i = 0; i < length; i++) + if (strinfo[i] == GUINT32_TO_LE (value)) + { + const guchar *charinfo = (const guchar *) &strinfo[i]; + + /* make sure it has 0xff on either side */ + if ((i == 0 || charinfo[-1] == 0xff) && charinfo[4] == 0xff) + return i; + } + + return -1; +} + +G_GNUC_UNUSED static gboolean +strinfo_is_string_valid (const guint32 *strinfo, + guint length, + const gchar *string) +{ + return strinfo_find_string (strinfo, length, string, FALSE) != -1; +} + +G_GNUC_UNUSED static gboolean +strinfo_enum_from_string (const guint32 *strinfo, + guint length, + const gchar *string, + guint *result) +{ + gint index; + + index = strinfo_find_string (strinfo, length, string, FALSE); + + if (index < 0) + return FALSE; + + *result = GUINT32_FROM_LE (strinfo[index]); + return TRUE; +} + +G_GNUC_UNUSED static const gchar * +strinfo_string_from_enum (const guint32 *strinfo, + guint length, + guint value) +{ + gint index; + + index = strinfo_find_integer (strinfo, length, value); + + if (index < 0) + return NULL; + + return 1 + (const gchar *) &strinfo[index + 1]; +} + +G_GNUC_UNUSED static const gchar * +strinfo_string_from_alias (const guint32 *strinfo, + guint length, + const gchar *alias) +{ + gint index; + + index = strinfo_find_string (strinfo, length, alias, TRUE); + + if (index < 0) + return NULL; + + return 1 + (const gchar *) &strinfo[GUINT32_TO_LE (strinfo[index]) + 1]; +} + +G_GNUC_UNUSED static GVariant * +strinfo_enumerate (const guint32 *strinfo, + guint length) +{ + GVariantBuilder builder; + const gchar *ptr, *end; + + ptr = (gpointer) strinfo; + end = ptr + 4 * length; + + ptr += 4; + + g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY); + + while (ptr < end) + { + /* don't include aliases */ + if (*ptr == '\xff') + g_variant_builder_add (&builder, "s", ptr + 1); + + /* find the end of this string */ + ptr = memchr (ptr, '\xff', end - ptr); + g_assert (ptr != NULL); + + /* skip over the int to the next string */ + ptr += 5; + } + + return g_variant_builder_end (&builder); +} + +G_GNUC_UNUSED static void +strinfo_builder_append_item (GString *builder, + const gchar *string, + guint value) +{ + guint32 words[STRINFO_MAX_WORDS]; + guint n_words; + + value = GUINT32_TO_LE (value); + + n_words = strinfo_string_to_words (string, words, FALSE); + g_string_append_len (builder, (void *) &value, sizeof value); + g_string_append_len (builder, (void *) words, 4 * n_words); +} + +G_GNUC_UNUSED static gboolean +strinfo_builder_append_alias (GString *builder, + const gchar *alias, + const gchar *target) +{ + guint32 words[STRINFO_MAX_WORDS]; + guint n_words; + guint value; + gint index; + + index = strinfo_find_string ((const guint32 *) builder->str, + builder->len / 4, target, FALSE); + + if (index == -1) + return FALSE; + + value = GUINT32_TO_LE (index); + + n_words = strinfo_string_to_words (alias, words, TRUE); + g_string_append_len (builder, (void *) &value, sizeof value); + g_string_append_len (builder, (void *) words, 4 * n_words); + + return TRUE; +} + +G_GNUC_UNUSED static gboolean +strinfo_builder_contains (GString *builder, + const gchar *string) +{ + return strinfo_find_string ((const guint32 *) builder->str, + builder->len / 4, string, FALSE) != -1 || + strinfo_find_string ((const guint32 *) builder->str, + builder->len / 4, string, TRUE) != -1; +} + +G_GNUC_UNUSED static gboolean +strinfo_builder_contains_value (GString *builder, + guint value) +{ + return strinfo_string_from_enum ((const guint32 *) builder->str, + builder->len / 4, value) != NULL; +} diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am index 7705e0e..5f49e6c 100644 --- a/gio/tests/Makefile.am +++ b/gio/tests/Makefile.am @@ -1,25 +1,25 @@ +NULL = + include $(top_srcdir)/Makefile.decl INCLUDES = \ -g \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gobject \ - -I$(top_srcdir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DSRCDIR=\""$(srcdir)"\" noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS) +noinst_DATA = $(MISC_STUFF) + progs_ldadd = \ $(top_builddir)/glib/libglib-2.0.la \ - $(top_builddir)/gobject/libgobject-2.0.la \ $(top_builddir)/gthread/libgthread-2.0.la \ - $(top_builddir)/gmodule/libgmodule-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la \ $(top_builddir)/gio/libgio-2.0.la - TEST_PROGS += \ + io-stream \ + actions \ memory-input-stream \ memory-output-stream \ readwrite \ @@ -30,25 +30,84 @@ TEST_PROGS += \ data-output-stream \ g-icon \ buffered-input-stream \ + buffered-output-stream \ sleepy-stream \ filter-streams \ + volumemonitor \ simple-async-result \ srvtarget \ - contexts + contexts \ + gsettings \ + gschema-compile \ + async-close-output-stream \ + gdbus-addresses \ + network-address \ + gdbus-message \ + socket \ + pollable \ + $(NULL) + +if OS_UNIX +TEST_PROGS += \ + gdbus-connection \ + gdbus-connection-slow \ + gdbus-names \ + gdbus-proxy \ + gdbus-proxy-well-known-name \ + gdbus-introspection \ + gdbus-threading \ + gdbus-export \ + gdbus-error \ + gdbus-peer \ + gdbus-exit-on-close \ + gdbus-non-socket \ + gdbus-bz627724 \ + appinfo \ + contenttype \ + file \ + $(NULL) +endif + +SAMPLE_PROGS = \ + resolver \ + socket-server \ + socket-client \ + echo-server \ + httpd \ + send-data \ + filter-cat \ + gdbus-example-export \ + gdbus-example-own-name \ + gdbus-example-watch-name \ + gdbus-example-watch-proxy \ + gdbus-example-server \ + gdbus-example-subtree \ + gdbus-example-peer \ + gdbus-example-proxy-subclass \ + gdbus-connection-flush-helper \ + appinfo-test \ + proxy \ + gapplication-example-open \ + gapplication-example-cmdline \ + gapplication-example-cmdline2 \ + gapplication-example-actions \ + $(NULL) -SAMPLE_PROGS = \ - resolver \ - socket-server \ - socket-client \ - echo-server \ - httpd \ - send-data \ - filter-cat if OS_UNIX -TEST_PROGS += live-g-file unix-streams desktop-app-info unix-fd +TEST_PROGS += live-g-file desktop-app-info unix-fd unix-streams gapplication +SAMPLE_PROGS += gdbus-example-unix-fd-client +endif + +if OS_WIN32 +TEST_PROGS += win32-streams endif +io_stream_SOURCES = io-stream.c +io_stream_LDADD = $(progs_ldadd) + +actions_LDADD = $(progs_ldadd) + memory_input_stream_SOURCES = memory-input-stream.c memory_input_stream_LDADD = $(progs_ldadd) @@ -73,6 +132,9 @@ data_input_stream_LDADD = $(progs_ldadd) data_output_stream_SOURCES = data-output-stream.c data_output_stream_LDADD = $(progs_ldadd) +async_close_output_stream_SOURCES = async-close-output-stream.c +async_close_output_stream_LDADD = $(progs_ldadd) + filter_cat_SOURCES = filter-cat.c filter_cat_LDADD = $(progs_ldadd) @@ -82,6 +144,9 @@ g_icon_LDADD = $(progs_ldadd) buffered_input_stream_SOURCES = buffered-input-stream.c buffered_input_stream_LDADD = $(progs_ldadd) +buffered_output_stream_SOURCES = buffered-output-stream.c +buffered_output_stream_LDADD = $(progs_ldadd) + live_g_file_SOURCES = live-g-file.c live_g_file_LDADD = $(progs_ldadd) @@ -92,6 +157,10 @@ unix_streams_SOURCES = unix-streams.c unix_streams_LDADD = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la +win32_streams_SOURCES = win32-streams.c +win32_streams_LDADD = $(progs_ldadd) \ + $(top_builddir)/gthread/libgthread-2.0.la + unix_fd_SOURCES = unix-fd.c unix_fd_LDADD = $(progs_ldadd) @@ -104,6 +173,9 @@ sleepy_stream_LDADD = $(progs_ldadd) filter_streams_SOURCES = filter-streams.c filter_streams_LDADD = $(progs_ldadd) +volumemonitor_SOURCES = volumemonitor.c +volumemonitor_LDADD = $(progs_ldadd) + resolver_SOURCES = resolver.c resolver_LDADD = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la @@ -131,8 +203,236 @@ send_data_LDADD = $(progs_ldadd) \ srvtarget_SOURCES = srvtarget.c srvtarget_LDADD = $(progs_ldadd) +network_address_SOURCE = network-address.c +network_address_LDADD = $(progs_ldadd) + +socket_SOURCE = socket.c +socket_LDADD = $(progs_ldadd) + +pollable_SOURCE = pollable.c +pollable_LDADD = $(progs_ldadd) + contexts_SOURCES = contexts.c contexts_LDADD = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la -DISTCLEAN_FILES = applications/mimeinfo.cache +gsettings_SOURCES = gsettings.c +gsettings_LDADD = $(progs_ldadd) + +gschema_compile_SOURCES = gschema-compile.c +gschema_compile_LDADD = $(progs_ldadd) + +if HAVE_DBUS1 +TEST_PROGS += gdbus-serialization +gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c +gdbus_serialization_CFLAGS = $(DBUS1_CFLAGS) +gdbus_serialization_LDADD = $(progs_ldadd) $(DBUS1_LIBS) +endif + +gdbus_addresses_SOURCES = gdbus-addresses.c +gdbus_addresses_LDADD = $(progs_ldadd) + +gdbus_bz627724_SOURCES = gdbus-bz627724.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_bz627724_LDADD = $(progs_ldadd) + +gdbus_connection_SOURCES = gdbus-connection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_connection_LDADD = $(progs_ldadd) + +gdbus_connection_slow_SOURCES = gdbus-connection-slow.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_connection_slow_LDADD = $(progs_ldadd) + +gdbus_message_SOURCES = gdbus-message.c +gdbus_message_LDADD = $(progs_ldadd) + +gdbus_names_SOURCES = gdbus-names.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_names_LDADD = $(progs_ldadd) + +gdbus_proxy_SOURCES = gdbus-proxy.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_proxy_LDADD = $(progs_ldadd) + +gdbus_proxy_well_known_name_SOURCES = gdbus-proxy-well-known-name.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_proxy_well_known_name_LDADD = $(progs_ldadd) + +gdbus_introspection_SOURCES = gdbus-introspection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_introspection_LDADD = $(progs_ldadd) + +gdbus_threading_SOURCES = gdbus-threading.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_threading_LDADD = $(progs_ldadd) + +gdbus_export_SOURCES = gdbus-export.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_export_LDADD = $(progs_ldadd) + +gdbus_error_SOURCES = gdbus-error.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_error_LDADD = $(progs_ldadd) + +gdbus_peer_SOURCES = gdbus-peer.c gdbus-tests.h gdbus-tests.c +gdbus_peer_LDADD = $(progs_ldadd) + +gdbus_non_socket_SOURCES = gdbus-non-socket.c gdbus-tests.h gdbus-tests.c +gdbus_non_socket_LDADD = $(progs_ldadd) + +gdbus_exit_on_close_SOURCES = gdbus-exit-on-close.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_exit_on_close_LDADD = $(progs_ldadd) + +gdbus_example_watch_name_SOURCES = gdbus-example-watch-name.c +gdbus_example_watch_name_LDADD = $(progs_ldadd) + +gdbus_example_watch_proxy_SOURCES = gdbus-example-watch-proxy.c +gdbus_example_watch_proxy_LDADD = $(progs_ldadd) + +gdbus_example_own_name_SOURCES = gdbus-example-own-name.c +gdbus_example_own_name_LDADD = $(progs_ldadd) + +gdbus_example_server_SOURCES = gdbus-example-server.c +gdbus_example_server_LDADD = $(progs_ldadd) + +gdbus_example_unix_fd_client_SOURCES = gdbus-example-unix-fd-client.c +gdbus_example_unix_fd_client_LDADD = $(progs_ldadd) + +gdbus_example_subtree_SOURCES = gdbus-example-subtree.c +gdbus_example_subtree_LDADD = $(progs_ldadd) + +gdbus_example_peer_SOURCES = gdbus-example-peer.c +gdbus_example_peer_LDADD = $(progs_ldadd) + +gdbus_example_proxy_subclass_SOURCES = gdbus-example-proxy-subclass.c +gdbus_example_proxy_subclass_LDADD = $(progs_ldadd) + +gdbus_example_export_SOURCES = gdbus-example-export.c +gdbus_example_export_LDADD = $(progs_ldadd) + +gdbus_connection_flush_helper_SOURCES = gdbus-connection-flush-helper.c +gdbus_connection_flush_helper_LDADD = $(progs_ldadd) + +appinfo_SOURCES = appinfo.c +appinfo_LDADD = $(progs_ldadd) + +appinfo_test_SOURCES = appinfo-test.c +appinfo_test_LDADD = $(progs_ldadd) + +contenttype_SOURCES = contenttype.c +contenttype_LDADD = $(progs_ldadd) + +file_SOURCES = file.c +file_LDADD = $(progs_ldadd) + +gapplication_SOURCES = gapplication.c gdbus-sessionbus.c +gapplication_LDADD = $(progs_ldadd) + +gapplication_example_open_SOURCES = gapplication-example-open.c +gapplication_example_open_LDADD = $(progs_ldadd) + +gapplication_example_cmdline_SOURCES = gapplication-example-cmdline.c +gapplication_example_cmdline_LDADD = $(progs_ldadd) + +gapplication_example_cmdline2_SOURCES = gapplication-example-cmdline2.c +gapplication_example_cmdline2_LDADD = $(progs_ldadd) + +gapplication_example_actions_SOURCES = gapplication-example-actions.c +gapplication_example_actions_LDADD = $(progs_ldadd) + +schema_tests = \ + schema-tests/array-default-not-in-choices.gschema.xml \ + schema-tests/bad-choice.gschema.xml \ + schema-tests/bad-key.gschema.xml \ + schema-tests/bad-key2.gschema.xml \ + schema-tests/bad-key3.gschema.xml \ + schema-tests/bad-key4.gschema.xml \ + schema-tests/bad-type.gschema.xml \ + schema-tests/bare-alias.gschema.xml \ + schema-tests/choice-alias.gschema.xml \ + schema-tests/choice-bad.gschema.xml \ + schema-tests/choice-badtype.gschema.xml \ + schema-tests/choice-invalid-alias.gschema.xml \ + schema-tests/choice-missing-value.gschema.xml \ + schema-tests/choice-shadowed-alias.gschema.xml \ + schema-tests/choice-upside-down.gschema.xml \ + schema-tests/choice.gschema.xml \ + schema-tests/choices-wrong-type.gschema.xml \ + schema-tests/default-in-aliases.gschema.xml \ + schema-tests/default-not-in-choices.gschema.xml \ + schema-tests/default-out-of-range.gschema.xml \ + schema-tests/empty-key.gschema.xml \ + schema-tests/enum-with-aliases.gschema.xml \ + schema-tests/enum-with-bad-default.gschema.xml \ + schema-tests/enum-with-chained-alias.gschema.xml \ + schema-tests/enum-with-choice.gschema.xml \ + schema-tests/enum-with-invalid-alias.gschema.xml \ + schema-tests/enum-with-repeated-alias.gschema.xml \ + schema-tests/enum-with-repeated-nick.gschema.xml \ + schema-tests/enum-with-repeated-value.gschema.xml \ + schema-tests/enum-with-shadow-alias.gschema.xml \ + schema-tests/enum.gschema.xml \ + schema-tests/flags-aliased-default.gschema.xml \ + schema-tests/flags-bad-default.gschema.xml \ + schema-tests/flags-more-than-one-bit.gschema.xml \ + schema-tests/flags-with-enum-attr.gschema.xml \ + schema-tests/flags-with-enum-tag.gschema.xml \ + schema-tests/extend-and-shadow-indirect.gschema.xml \ + schema-tests/extend-and-shadow.gschema.xml \ + schema-tests/extend-missing.gschema.xml \ + schema-tests/extend-nonlist.gschema.xml \ + schema-tests/extend-self.gschema.xml \ + schema-tests/extend-wrong-list-indirect.gschema.xml \ + schema-tests/extend-wrong-list.gschema.xml \ + schema-tests/extending.gschema.xml \ + schema-tests/from-docs.gschema.xml \ + schema-tests/incomplete-list.gschema.xml \ + schema-tests/inherit-gettext-domain.gschema.xml \ + schema-tests/invalid-path.gschema.xml \ + schema-tests/key-in-list-indirect.gschema.xml \ + schema-tests/key-in-list.gschema.xml \ + schema-tests/list-of-missing.gschema.xml \ + schema-tests/missing-quotes.gschema.xml \ + schema-tests/no-default.gschema.xml \ + schema-tests/overflow.gschema.xml \ + schema-tests/override-missing.gschema.xml \ + schema-tests/override-range-error.gschema.xml \ + schema-tests/override-then-key.gschema.xml \ + schema-tests/override-twice.gschema.xml \ + schema-tests/override-type-error.gschema.xml \ + schema-tests/override.gschema.xml \ + schema-tests/range-badtype.gschema.xml \ + schema-tests/range-default-high.gschema.xml \ + schema-tests/range-default-low.gschema.xml \ + schema-tests/range-high-default.gschema.xml \ + schema-tests/range-low-default.gschema.xml \ + schema-tests/range-missing-max.gschema.xml \ + schema-tests/range-missing-min.gschema.xml \ + schema-tests/range-parse-error.gschema.xml \ + schema-tests/range-wrong-type.gschema.xml \ + schema-tests/range.gschema.xml \ + schema-tests/wrong-category.gschema.xml + +proxy_SOURCES = proxy.c +proxy_LDADD = $(progs_ldadd) \ + $(top_builddir)/gthread/libgthread-2.0.la + +EXTRA_DIST += \ + socket-common.c \ + org.gtk.test.gschema \ + org.gtk.test.gschema.xml \ + testenum.h \ + enums.xml.template \ + de.po \ + $(schema_tests) \ + appinfo-test.desktop \ + appinfo-test2.desktop \ + appinfo-test-gnome.desktop \ + appinfo-test-notgnome.desktop \ + gdbus-testserver.py + +MISC_STUFF = test.mo + +test.mo: de.po + $(MSGFMT) -o test.mo $(srcdir)/de.po; \ + $(MKDIR_P) de/LC_MESSAGES; \ + cp -f test.mo de/LC_MESSAGES + +DISTCLEANFILES = \ + applications/mimeinfo.cache \ + org.gtk.test.enums.xml \ + de/LC_MESSAGES/test.mo \ + test.mo \ + gsettings.store \ + gschemas.compiled diff --git a/gio/tests/Makefile.in b/gio/tests/Makefile.in index f7784f2..0a9a853 100644 --- a/gio/tests/Makefile.in +++ b/gio/tests/Makefile.in @@ -17,6 +17,7 @@ # GLIB - Library of useful C routines + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -38,8 +39,18 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.decl -noinst_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) -@OS_UNIX_TRUE@am__append_1 = live-g-file unix-streams desktop-app-info unix-fd +noinst_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_7) +@OS_UNIX_TRUE@am__append_1 = gdbus-connection gdbus-connection-slow \ +@OS_UNIX_TRUE@ gdbus-names gdbus-proxy \ +@OS_UNIX_TRUE@ gdbus-proxy-well-known-name gdbus-introspection \ +@OS_UNIX_TRUE@ gdbus-threading gdbus-export gdbus-error \ +@OS_UNIX_TRUE@ gdbus-peer gdbus-exit-on-close gdbus-non-socket \ +@OS_UNIX_TRUE@ gdbus-bz627724 appinfo contenttype file $(NULL) \ +@OS_UNIX_TRUE@ live-g-file desktop-app-info unix-fd \ +@OS_UNIX_TRUE@ unix-streams gapplication +@OS_UNIX_TRUE@am__append_2 = gdbus-example-unix-fd-client +@OS_WIN32_TRUE@am__append_3 = win32-streams +@HAVE_DBUS1_TRUE@am__append_4 = gdbus-serialization subdir = gio/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ @@ -47,34 +58,87 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -@OS_UNIX_TRUE@am__EXEEXT_1 = live-g-file$(EXEEXT) \ -@OS_UNIX_TRUE@ unix-streams$(EXEEXT) desktop-app-info$(EXEEXT) \ -@OS_UNIX_TRUE@ unix-fd$(EXEEXT) -am__EXEEXT_2 = memory-input-stream$(EXEEXT) \ - memory-output-stream$(EXEEXT) readwrite$(EXEEXT) \ - g-file$(EXEEXT) g-file-info$(EXEEXT) converter-stream$(EXEEXT) \ - data-input-stream$(EXEEXT) data-output-stream$(EXEEXT) \ - g-icon$(EXEEXT) buffered-input-stream$(EXEEXT) \ +am__EXEEXT_1 = +@OS_UNIX_TRUE@am__EXEEXT_2 = gdbus-connection$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-connection-slow$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-names$(EXEEXT) gdbus-proxy$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-proxy-well-known-name$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-introspection$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-threading$(EXEEXT) gdbus-export$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-error$(EXEEXT) gdbus-peer$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-exit-on-close$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-non-socket$(EXEEXT) \ +@OS_UNIX_TRUE@ gdbus-bz627724$(EXEEXT) appinfo$(EXEEXT) \ +@OS_UNIX_TRUE@ contenttype$(EXEEXT) file$(EXEEXT) \ +@OS_UNIX_TRUE@ $(am__EXEEXT_1) live-g-file$(EXEEXT) \ +@OS_UNIX_TRUE@ desktop-app-info$(EXEEXT) unix-fd$(EXEEXT) \ +@OS_UNIX_TRUE@ unix-streams$(EXEEXT) gapplication$(EXEEXT) +@OS_WIN32_TRUE@am__EXEEXT_3 = win32-streams$(EXEEXT) +@HAVE_DBUS1_TRUE@am__EXEEXT_4 = gdbus-serialization$(EXEEXT) +am__EXEEXT_5 = io-stream$(EXEEXT) actions$(EXEEXT) \ + memory-input-stream$(EXEEXT) memory-output-stream$(EXEEXT) \ + readwrite$(EXEEXT) g-file$(EXEEXT) g-file-info$(EXEEXT) \ + converter-stream$(EXEEXT) data-input-stream$(EXEEXT) \ + data-output-stream$(EXEEXT) g-icon$(EXEEXT) \ + buffered-input-stream$(EXEEXT) buffered-output-stream$(EXEEXT) \ sleepy-stream$(EXEEXT) filter-streams$(EXEEXT) \ - simple-async-result$(EXEEXT) srvtarget$(EXEEXT) \ - contexts$(EXEEXT) $(am__EXEEXT_1) -am__EXEEXT_3 = resolver$(EXEEXT) socket-server$(EXEEXT) \ + volumemonitor$(EXEEXT) simple-async-result$(EXEEXT) \ + srvtarget$(EXEEXT) contexts$(EXEEXT) gsettings$(EXEEXT) \ + gschema-compile$(EXEEXT) async-close-output-stream$(EXEEXT) \ + gdbus-addresses$(EXEEXT) network-address$(EXEEXT) \ + gdbus-message$(EXEEXT) socket$(EXEEXT) pollable$(EXEEXT) \ + $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ + $(am__EXEEXT_4) +@OS_UNIX_TRUE@am__EXEEXT_6 = gdbus-example-unix-fd-client$(EXEEXT) +am__EXEEXT_7 = resolver$(EXEEXT) socket-server$(EXEEXT) \ socket-client$(EXEEXT) echo-server$(EXEEXT) httpd$(EXEEXT) \ - send-data$(EXEEXT) filter-cat$(EXEEXT) + send-data$(EXEEXT) filter-cat$(EXEEXT) \ + gdbus-example-export$(EXEEXT) gdbus-example-own-name$(EXEEXT) \ + gdbus-example-watch-name$(EXEEXT) \ + gdbus-example-watch-proxy$(EXEEXT) \ + gdbus-example-server$(EXEEXT) gdbus-example-subtree$(EXEEXT) \ + gdbus-example-peer$(EXEEXT) \ + gdbus-example-proxy-subclass$(EXEEXT) \ + gdbus-connection-flush-helper$(EXEEXT) appinfo-test$(EXEEXT) \ + proxy$(EXEEXT) gapplication-example-open$(EXEEXT) \ + gapplication-example-cmdline$(EXEEXT) \ + gapplication-example-cmdline2$(EXEEXT) \ + gapplication-example-actions$(EXEEXT) $(am__EXEEXT_1) \ + $(am__EXEEXT_6) PROGRAMS = $(noinst_PROGRAMS) -am_buffered_input_stream_OBJECTS = buffered-input-stream.$(OBJEXT) -buffered_input_stream_OBJECTS = $(am_buffered_input_stream_OBJECTS) -buffered_input_stream_DEPENDENCIES = $(progs_ldadd) +actions_SOURCES = actions.c +actions_OBJECTS = actions.$(OBJEXT) +actions_DEPENDENCIES = $(progs_ldadd) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent +am_appinfo_OBJECTS = appinfo.$(OBJEXT) +appinfo_OBJECTS = $(am_appinfo_OBJECTS) +appinfo_DEPENDENCIES = $(progs_ldadd) +am_appinfo_test_OBJECTS = appinfo-test.$(OBJEXT) +appinfo_test_OBJECTS = $(am_appinfo_test_OBJECTS) +appinfo_test_DEPENDENCIES = $(progs_ldadd) +am_async_close_output_stream_OBJECTS = \ + async-close-output-stream.$(OBJEXT) +async_close_output_stream_OBJECTS = \ + $(am_async_close_output_stream_OBJECTS) +async_close_output_stream_DEPENDENCIES = $(progs_ldadd) +am_buffered_input_stream_OBJECTS = buffered-input-stream.$(OBJEXT) +buffered_input_stream_OBJECTS = $(am_buffered_input_stream_OBJECTS) +buffered_input_stream_DEPENDENCIES = $(progs_ldadd) +am_buffered_output_stream_OBJECTS = buffered-output-stream.$(OBJEXT) +buffered_output_stream_OBJECTS = $(am_buffered_output_stream_OBJECTS) +buffered_output_stream_DEPENDENCIES = $(progs_ldadd) +am_contenttype_OBJECTS = contenttype.$(OBJEXT) +contenttype_OBJECTS = $(am_contenttype_OBJECTS) +contenttype_DEPENDENCIES = $(progs_ldadd) am_contexts_OBJECTS = contexts.$(OBJEXT) contexts_OBJECTS = $(am_contexts_OBJECTS) contexts_DEPENDENCIES = $(progs_ldadd) \ @@ -95,6 +159,9 @@ am_echo_server_OBJECTS = echo-server.$(OBJEXT) echo_server_OBJECTS = $(am_echo_server_OBJECTS) echo_server_DEPENDENCIES = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la +am_file_OBJECTS = file.$(OBJEXT) +file_OBJECTS = $(am_file_OBJECTS) +file_DEPENDENCIES = $(progs_ldadd) am_filter_cat_OBJECTS = filter-cat.$(OBJEXT) filter_cat_OBJECTS = $(am_filter_cat_OBJECTS) filter_cat_DEPENDENCIES = $(progs_ldadd) @@ -110,10 +177,154 @@ g_file_info_DEPENDENCIES = $(progs_ldadd) am_g_icon_OBJECTS = g-icon.$(OBJEXT) g_icon_OBJECTS = $(am_g_icon_OBJECTS) g_icon_DEPENDENCIES = $(progs_ldadd) +am_gapplication_OBJECTS = gapplication.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) +gapplication_OBJECTS = $(am_gapplication_OBJECTS) +gapplication_DEPENDENCIES = $(progs_ldadd) +am_gapplication_example_actions_OBJECTS = \ + gapplication-example-actions.$(OBJEXT) +gapplication_example_actions_OBJECTS = \ + $(am_gapplication_example_actions_OBJECTS) +gapplication_example_actions_DEPENDENCIES = $(progs_ldadd) +am_gapplication_example_cmdline_OBJECTS = \ + gapplication-example-cmdline.$(OBJEXT) +gapplication_example_cmdline_OBJECTS = \ + $(am_gapplication_example_cmdline_OBJECTS) +gapplication_example_cmdline_DEPENDENCIES = $(progs_ldadd) +am_gapplication_example_cmdline2_OBJECTS = \ + gapplication-example-cmdline2.$(OBJEXT) +gapplication_example_cmdline2_OBJECTS = \ + $(am_gapplication_example_cmdline2_OBJECTS) +gapplication_example_cmdline2_DEPENDENCIES = $(progs_ldadd) +am_gapplication_example_open_OBJECTS = \ + gapplication-example-open.$(OBJEXT) +gapplication_example_open_OBJECTS = \ + $(am_gapplication_example_open_OBJECTS) +gapplication_example_open_DEPENDENCIES = $(progs_ldadd) +am_gdbus_addresses_OBJECTS = gdbus-addresses.$(OBJEXT) +gdbus_addresses_OBJECTS = $(am_gdbus_addresses_OBJECTS) +gdbus_addresses_DEPENDENCIES = $(progs_ldadd) +am_gdbus_bz627724_OBJECTS = gdbus-bz627724.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_bz627724_OBJECTS = $(am_gdbus_bz627724_OBJECTS) +gdbus_bz627724_DEPENDENCIES = $(progs_ldadd) +am_gdbus_connection_OBJECTS = gdbus-connection.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_connection_OBJECTS = $(am_gdbus_connection_OBJECTS) +gdbus_connection_DEPENDENCIES = $(progs_ldadd) +am_gdbus_connection_flush_helper_OBJECTS = \ + gdbus-connection-flush-helper.$(OBJEXT) +gdbus_connection_flush_helper_OBJECTS = \ + $(am_gdbus_connection_flush_helper_OBJECTS) +gdbus_connection_flush_helper_DEPENDENCIES = $(progs_ldadd) +am_gdbus_connection_slow_OBJECTS = gdbus-connection-slow.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_connection_slow_OBJECTS = $(am_gdbus_connection_slow_OBJECTS) +gdbus_connection_slow_DEPENDENCIES = $(progs_ldadd) +am_gdbus_error_OBJECTS = gdbus-error.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_error_OBJECTS = $(am_gdbus_error_OBJECTS) +gdbus_error_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_export_OBJECTS = gdbus-example-export.$(OBJEXT) +gdbus_example_export_OBJECTS = $(am_gdbus_example_export_OBJECTS) +gdbus_example_export_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_own_name_OBJECTS = gdbus-example-own-name.$(OBJEXT) +gdbus_example_own_name_OBJECTS = $(am_gdbus_example_own_name_OBJECTS) +gdbus_example_own_name_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_peer_OBJECTS = gdbus-example-peer.$(OBJEXT) +gdbus_example_peer_OBJECTS = $(am_gdbus_example_peer_OBJECTS) +gdbus_example_peer_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_proxy_subclass_OBJECTS = \ + gdbus-example-proxy-subclass.$(OBJEXT) +gdbus_example_proxy_subclass_OBJECTS = \ + $(am_gdbus_example_proxy_subclass_OBJECTS) +gdbus_example_proxy_subclass_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_server_OBJECTS = gdbus-example-server.$(OBJEXT) +gdbus_example_server_OBJECTS = $(am_gdbus_example_server_OBJECTS) +gdbus_example_server_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_subtree_OBJECTS = gdbus-example-subtree.$(OBJEXT) +gdbus_example_subtree_OBJECTS = $(am_gdbus_example_subtree_OBJECTS) +gdbus_example_subtree_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_unix_fd_client_OBJECTS = \ + gdbus-example-unix-fd-client.$(OBJEXT) +gdbus_example_unix_fd_client_OBJECTS = \ + $(am_gdbus_example_unix_fd_client_OBJECTS) +gdbus_example_unix_fd_client_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_watch_name_OBJECTS = \ + gdbus-example-watch-name.$(OBJEXT) +gdbus_example_watch_name_OBJECTS = \ + $(am_gdbus_example_watch_name_OBJECTS) +gdbus_example_watch_name_DEPENDENCIES = $(progs_ldadd) +am_gdbus_example_watch_proxy_OBJECTS = \ + gdbus-example-watch-proxy.$(OBJEXT) +gdbus_example_watch_proxy_OBJECTS = \ + $(am_gdbus_example_watch_proxy_OBJECTS) +gdbus_example_watch_proxy_DEPENDENCIES = $(progs_ldadd) +am_gdbus_exit_on_close_OBJECTS = gdbus-exit-on-close.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_exit_on_close_OBJECTS = $(am_gdbus_exit_on_close_OBJECTS) +gdbus_exit_on_close_DEPENDENCIES = $(progs_ldadd) +am_gdbus_export_OBJECTS = gdbus-export.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_export_OBJECTS = $(am_gdbus_export_OBJECTS) +gdbus_export_DEPENDENCIES = $(progs_ldadd) +am_gdbus_introspection_OBJECTS = gdbus-introspection.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_introspection_OBJECTS = $(am_gdbus_introspection_OBJECTS) +gdbus_introspection_DEPENDENCIES = $(progs_ldadd) +am_gdbus_message_OBJECTS = gdbus-message.$(OBJEXT) +gdbus_message_OBJECTS = $(am_gdbus_message_OBJECTS) +gdbus_message_DEPENDENCIES = $(progs_ldadd) +am_gdbus_names_OBJECTS = gdbus-names.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_names_OBJECTS = $(am_gdbus_names_OBJECTS) +gdbus_names_DEPENDENCIES = $(progs_ldadd) +am_gdbus_non_socket_OBJECTS = gdbus-non-socket.$(OBJEXT) \ + gdbus-tests.$(OBJEXT) +gdbus_non_socket_OBJECTS = $(am_gdbus_non_socket_OBJECTS) +gdbus_non_socket_DEPENDENCIES = $(progs_ldadd) +am_gdbus_peer_OBJECTS = gdbus-peer.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_peer_OBJECTS = $(am_gdbus_peer_OBJECTS) +gdbus_peer_DEPENDENCIES = $(progs_ldadd) +am_gdbus_proxy_OBJECTS = gdbus-proxy.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_proxy_OBJECTS = $(am_gdbus_proxy_OBJECTS) +gdbus_proxy_DEPENDENCIES = $(progs_ldadd) +am_gdbus_proxy_well_known_name_OBJECTS = \ + gdbus-proxy-well-known-name.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_proxy_well_known_name_OBJECTS = \ + $(am_gdbus_proxy_well_known_name_OBJECTS) +gdbus_proxy_well_known_name_DEPENDENCIES = $(progs_ldadd) +am__gdbus_serialization_SOURCES_DIST = gdbus-serialization.c \ + gdbus-tests.h gdbus-tests.c +@HAVE_DBUS1_TRUE@am_gdbus_serialization_OBJECTS = gdbus_serialization-gdbus-serialization.$(OBJEXT) \ +@HAVE_DBUS1_TRUE@ gdbus_serialization-gdbus-tests.$(OBJEXT) +gdbus_serialization_OBJECTS = $(am_gdbus_serialization_OBJECTS) +am__DEPENDENCIES_1 = +@HAVE_DBUS1_TRUE@gdbus_serialization_DEPENDENCIES = $(progs_ldadd) \ +@HAVE_DBUS1_TRUE@ $(am__DEPENDENCIES_1) +gdbus_serialization_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(gdbus_serialization_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_gdbus_threading_OBJECTS = gdbus-threading.$(OBJEXT) \ + gdbus-sessionbus.$(OBJEXT) gdbus-tests.$(OBJEXT) +gdbus_threading_OBJECTS = $(am_gdbus_threading_OBJECTS) +gdbus_threading_DEPENDENCIES = $(progs_ldadd) +am_gschema_compile_OBJECTS = gschema-compile.$(OBJEXT) +gschema_compile_OBJECTS = $(am_gschema_compile_OBJECTS) +gschema_compile_DEPENDENCIES = $(progs_ldadd) +am_gsettings_OBJECTS = gsettings.$(OBJEXT) +gsettings_OBJECTS = $(am_gsettings_OBJECTS) +gsettings_DEPENDENCIES = $(progs_ldadd) am_httpd_OBJECTS = httpd.$(OBJEXT) httpd_OBJECTS = $(am_httpd_OBJECTS) httpd_DEPENDENCIES = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la +am_io_stream_OBJECTS = io-stream.$(OBJEXT) +io_stream_OBJECTS = $(am_io_stream_OBJECTS) +io_stream_DEPENDENCIES = $(progs_ldadd) am_live_g_file_OBJECTS = live-g-file.$(OBJEXT) live_g_file_OBJECTS = $(am_live_g_file_OBJECTS) live_g_file_DEPENDENCIES = $(progs_ldadd) @@ -123,6 +334,16 @@ memory_input_stream_DEPENDENCIES = $(progs_ldadd) am_memory_output_stream_OBJECTS = memory-output-stream.$(OBJEXT) memory_output_stream_OBJECTS = $(am_memory_output_stream_OBJECTS) memory_output_stream_DEPENDENCIES = $(progs_ldadd) +network_address_SOURCES = network-address.c +network_address_OBJECTS = network-address.$(OBJEXT) +network_address_DEPENDENCIES = $(progs_ldadd) +pollable_SOURCES = pollable.c +pollable_OBJECTS = pollable.$(OBJEXT) +pollable_DEPENDENCIES = $(progs_ldadd) +am_proxy_OBJECTS = proxy.$(OBJEXT) +proxy_OBJECTS = $(am_proxy_OBJECTS) +proxy_DEPENDENCIES = $(progs_ldadd) \ + $(top_builddir)/gthread/libgthread-2.0.la am_readwrite_OBJECTS = readwrite.$(OBJEXT) readwrite_OBJECTS = $(am_readwrite_OBJECTS) readwrite_DEPENDENCIES = $(progs_ldadd) @@ -140,6 +361,9 @@ simple_async_result_DEPENDENCIES = $(progs_ldadd) am_sleepy_stream_OBJECTS = sleepy-stream.$(OBJEXT) sleepy_stream_OBJECTS = $(am_sleepy_stream_OBJECTS) sleepy_stream_DEPENDENCIES = $(progs_ldadd) +socket_SOURCES = socket.c +socket_OBJECTS = socket.$(OBJEXT) +socket_DEPENDENCIES = $(progs_ldadd) am_socket_client_OBJECTS = socket-client.$(OBJEXT) socket_client_OBJECTS = $(am_socket_client_OBJECTS) socket_client_DEPENDENCIES = $(progs_ldadd) \ @@ -158,6 +382,13 @@ am_unix_streams_OBJECTS = unix-streams.$(OBJEXT) unix_streams_OBJECTS = $(am_unix_streams_OBJECTS) unix_streams_DEPENDENCIES = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la +am_volumemonitor_OBJECTS = volumemonitor.$(OBJEXT) +volumemonitor_OBJECTS = $(am_volumemonitor_OBJECTS) +volumemonitor_DEPENDENCIES = $(progs_ldadd) +am_win32_streams_OBJECTS = win32-streams.$(OBJEXT) +win32_streams_OBJECTS = $(am_win32_streams_OBJECTS) +win32_streams_DEPENDENCIES = $(progs_ldadd) \ + $(top_builddir)/gthread/libgthread-2.0.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -184,36 +415,100 @@ am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(buffered_input_stream_SOURCES) $(contexts_SOURCES) \ - $(converter_stream_SOURCES) $(data_input_stream_SOURCES) \ - $(data_output_stream_SOURCES) $(desktop_app_info_SOURCES) \ - $(echo_server_SOURCES) $(filter_cat_SOURCES) \ +SOURCES = actions.c $(appinfo_SOURCES) $(appinfo_test_SOURCES) \ + $(async_close_output_stream_SOURCES) \ + $(buffered_input_stream_SOURCES) \ + $(buffered_output_stream_SOURCES) $(contenttype_SOURCES) \ + $(contexts_SOURCES) $(converter_stream_SOURCES) \ + $(data_input_stream_SOURCES) $(data_output_stream_SOURCES) \ + $(desktop_app_info_SOURCES) $(echo_server_SOURCES) \ + $(file_SOURCES) $(filter_cat_SOURCES) \ $(filter_streams_SOURCES) $(g_file_SOURCES) \ - $(g_file_info_SOURCES) $(g_icon_SOURCES) $(httpd_SOURCES) \ - $(live_g_file_SOURCES) $(memory_input_stream_SOURCES) \ - $(memory_output_stream_SOURCES) $(readwrite_SOURCES) \ - $(resolver_SOURCES) $(send_data_SOURCES) \ + $(g_file_info_SOURCES) $(g_icon_SOURCES) \ + $(gapplication_SOURCES) \ + $(gapplication_example_actions_SOURCES) \ + $(gapplication_example_cmdline_SOURCES) \ + $(gapplication_example_cmdline2_SOURCES) \ + $(gapplication_example_open_SOURCES) \ + $(gdbus_addresses_SOURCES) $(gdbus_bz627724_SOURCES) \ + $(gdbus_connection_SOURCES) \ + $(gdbus_connection_flush_helper_SOURCES) \ + $(gdbus_connection_slow_SOURCES) $(gdbus_error_SOURCES) \ + $(gdbus_example_export_SOURCES) \ + $(gdbus_example_own_name_SOURCES) \ + $(gdbus_example_peer_SOURCES) \ + $(gdbus_example_proxy_subclass_SOURCES) \ + $(gdbus_example_server_SOURCES) \ + $(gdbus_example_subtree_SOURCES) \ + $(gdbus_example_unix_fd_client_SOURCES) \ + $(gdbus_example_watch_name_SOURCES) \ + $(gdbus_example_watch_proxy_SOURCES) \ + $(gdbus_exit_on_close_SOURCES) $(gdbus_export_SOURCES) \ + $(gdbus_introspection_SOURCES) $(gdbus_message_SOURCES) \ + $(gdbus_names_SOURCES) $(gdbus_non_socket_SOURCES) \ + $(gdbus_peer_SOURCES) $(gdbus_proxy_SOURCES) \ + $(gdbus_proxy_well_known_name_SOURCES) \ + $(gdbus_serialization_SOURCES) $(gdbus_threading_SOURCES) \ + $(gschema_compile_SOURCES) $(gsettings_SOURCES) \ + $(httpd_SOURCES) $(io_stream_SOURCES) $(live_g_file_SOURCES) \ + $(memory_input_stream_SOURCES) $(memory_output_stream_SOURCES) \ + network-address.c pollable.c $(proxy_SOURCES) \ + $(readwrite_SOURCES) $(resolver_SOURCES) $(send_data_SOURCES) \ $(simple_async_result_SOURCES) $(sleepy_stream_SOURCES) \ - $(socket_client_SOURCES) $(socket_server_SOURCES) \ + socket.c $(socket_client_SOURCES) $(socket_server_SOURCES) \ $(srvtarget_SOURCES) $(unix_fd_SOURCES) \ - $(unix_streams_SOURCES) -DIST_SOURCES = $(buffered_input_stream_SOURCES) $(contexts_SOURCES) \ - $(converter_stream_SOURCES) $(data_input_stream_SOURCES) \ - $(data_output_stream_SOURCES) $(desktop_app_info_SOURCES) \ - $(echo_server_SOURCES) $(filter_cat_SOURCES) \ + $(unix_streams_SOURCES) $(volumemonitor_SOURCES) \ + $(win32_streams_SOURCES) +DIST_SOURCES = actions.c $(appinfo_SOURCES) $(appinfo_test_SOURCES) \ + $(async_close_output_stream_SOURCES) \ + $(buffered_input_stream_SOURCES) \ + $(buffered_output_stream_SOURCES) $(contenttype_SOURCES) \ + $(contexts_SOURCES) $(converter_stream_SOURCES) \ + $(data_input_stream_SOURCES) $(data_output_stream_SOURCES) \ + $(desktop_app_info_SOURCES) $(echo_server_SOURCES) \ + $(file_SOURCES) $(filter_cat_SOURCES) \ $(filter_streams_SOURCES) $(g_file_SOURCES) \ - $(g_file_info_SOURCES) $(g_icon_SOURCES) $(httpd_SOURCES) \ + $(g_file_info_SOURCES) $(g_icon_SOURCES) \ + $(gapplication_SOURCES) \ + $(gapplication_example_actions_SOURCES) \ + $(gapplication_example_cmdline_SOURCES) \ + $(gapplication_example_cmdline2_SOURCES) \ + $(gapplication_example_open_SOURCES) \ + $(gdbus_addresses_SOURCES) $(gdbus_bz627724_SOURCES) \ + $(gdbus_connection_SOURCES) \ + $(gdbus_connection_flush_helper_SOURCES) \ + $(gdbus_connection_slow_SOURCES) $(gdbus_error_SOURCES) \ + $(gdbus_example_export_SOURCES) \ + $(gdbus_example_own_name_SOURCES) \ + $(gdbus_example_peer_SOURCES) \ + $(gdbus_example_proxy_subclass_SOURCES) \ + $(gdbus_example_server_SOURCES) \ + $(gdbus_example_subtree_SOURCES) \ + $(gdbus_example_unix_fd_client_SOURCES) \ + $(gdbus_example_watch_name_SOURCES) \ + $(gdbus_example_watch_proxy_SOURCES) \ + $(gdbus_exit_on_close_SOURCES) $(gdbus_export_SOURCES) \ + $(gdbus_introspection_SOURCES) $(gdbus_message_SOURCES) \ + $(gdbus_names_SOURCES) $(gdbus_non_socket_SOURCES) \ + $(gdbus_peer_SOURCES) $(gdbus_proxy_SOURCES) \ + $(gdbus_proxy_well_known_name_SOURCES) \ + $(am__gdbus_serialization_SOURCES_DIST) \ + $(gdbus_threading_SOURCES) $(gschema_compile_SOURCES) \ + $(gsettings_SOURCES) $(httpd_SOURCES) $(io_stream_SOURCES) \ $(live_g_file_SOURCES) $(memory_input_stream_SOURCES) \ - $(memory_output_stream_SOURCES) $(readwrite_SOURCES) \ - $(resolver_SOURCES) $(send_data_SOURCES) \ - $(simple_async_result_SOURCES) $(sleepy_stream_SOURCES) \ - $(socket_client_SOURCES) $(socket_server_SOURCES) \ - $(srvtarget_SOURCES) $(unix_fd_SOURCES) \ - $(unix_streams_SOURCES) + $(memory_output_stream_SOURCES) network-address.c pollable.c \ + $(proxy_SOURCES) $(readwrite_SOURCES) $(resolver_SOURCES) \ + $(send_data_SOURCES) $(simple_async_result_SOURCES) \ + $(sleepy_stream_SOURCES) socket.c $(socket_client_SOURCES) \ + $(socket_server_SOURCES) $(srvtarget_SOURCES) \ + $(unix_fd_SOURCES) $(unix_streams_SOURCES) \ + $(volumemonitor_SOURCES) $(win32_streams_SOURCES) +DATA = $(noinst_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -238,11 +533,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -256,13 +554,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -309,6 +610,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -316,6 +619,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -341,6 +645,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -357,6 +663,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -366,11 +673,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -386,11 +695,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -404,7 +719,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -425,42 +739,51 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +NULL = #GTESTER = gtester # for non-GLIB packages GTESTER = $(top_builddir)/glib/gtester # for the GLIB package GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package # initialize variables for unconditional += appending -EXTRA_DIST = -TEST_PROGS = memory-input-stream memory-output-stream readwrite g-file \ - g-file-info converter-stream data-input-stream \ - data-output-stream g-icon buffered-input-stream sleepy-stream \ - filter-streams simple-async-result srvtarget contexts \ - $(am__append_1) +EXTRA_DIST = socket-common.c org.gtk.test.gschema \ + org.gtk.test.gschema.xml testenum.h enums.xml.template de.po \ + $(schema_tests) appinfo-test.desktop appinfo-test2.desktop \ + appinfo-test-gnome.desktop appinfo-test-notgnome.desktop \ + gdbus-testserver.py +TEST_PROGS = io-stream actions memory-input-stream \ + memory-output-stream readwrite g-file g-file-info \ + converter-stream data-input-stream data-output-stream g-icon \ + buffered-input-stream buffered-output-stream sleepy-stream \ + filter-streams volumemonitor simple-async-result srvtarget \ + contexts gsettings gschema-compile async-close-output-stream \ + gdbus-addresses network-address gdbus-message socket pollable \ + $(NULL) $(am__append_1) $(am__append_3) $(am__append_4) INCLUDES = \ -g \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gobject \ - -I$(top_srcdir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DSRCDIR=\""$(srcdir)"\" +noinst_DATA = $(MISC_STUFF) progs_ldadd = \ $(top_builddir)/glib/libglib-2.0.la \ + $(top_builddir)/gthread/libgthread-2.0.la \ $(top_builddir)/gobject/libgobject-2.0.la \ $(top_builddir)/gio/libgio-2.0.la -SAMPLE_PROGS = \ - resolver \ - socket-server \ - socket-client \ - echo-server \ - httpd \ - send-data \ - filter-cat - +SAMPLE_PROGS = resolver socket-server socket-client echo-server httpd \ + send-data filter-cat gdbus-example-export \ + gdbus-example-own-name gdbus-example-watch-name \ + gdbus-example-watch-proxy gdbus-example-server \ + gdbus-example-subtree gdbus-example-peer \ + gdbus-example-proxy-subclass gdbus-connection-flush-helper \ + appinfo-test proxy gapplication-example-open \ + gapplication-example-cmdline gapplication-example-cmdline2 \ + gapplication-example-actions $(NULL) $(am__append_2) +io_stream_SOURCES = io-stream.c +io_stream_LDADD = $(progs_ldadd) +actions_LDADD = $(progs_ldadd) memory_input_stream_SOURCES = memory-input-stream.c memory_input_stream_LDADD = $(progs_ldadd) memory_output_stream_SOURCES = memory-output-stream.c @@ -477,12 +800,16 @@ data_input_stream_SOURCES = data-input-stream.c data_input_stream_LDADD = $(progs_ldadd) data_output_stream_SOURCES = data-output-stream.c data_output_stream_LDADD = $(progs_ldadd) +async_close_output_stream_SOURCES = async-close-output-stream.c +async_close_output_stream_LDADD = $(progs_ldadd) filter_cat_SOURCES = filter-cat.c filter_cat_LDADD = $(progs_ldadd) g_icon_SOURCES = g-icon.c g_icon_LDADD = $(progs_ldadd) buffered_input_stream_SOURCES = buffered-input-stream.c buffered_input_stream_LDADD = $(progs_ldadd) +buffered_output_stream_SOURCES = buffered-output-stream.c +buffered_output_stream_LDADD = $(progs_ldadd) live_g_file_SOURCES = live-g-file.c live_g_file_LDADD = $(progs_ldadd) desktop_app_info_SOURCES = desktop-app-info.c @@ -491,6 +818,10 @@ unix_streams_SOURCES = unix-streams.c unix_streams_LDADD = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la +win32_streams_SOURCES = win32-streams.c +win32_streams_LDADD = $(progs_ldadd) \ + $(top_builddir)/gthread/libgthread-2.0.la + unix_fd_SOURCES = unix-fd.c unix_fd_LDADD = $(progs_ldadd) simple_async_result_SOURCES = simple-async-result.c @@ -499,6 +830,8 @@ sleepy_stream_SOURCES = sleepy-stream.c sleepy_stream_LDADD = $(progs_ldadd) filter_streams_SOURCES = filter-streams.c filter_streams_LDADD = $(progs_ldadd) +volumemonitor_SOURCES = volumemonitor.c +volumemonitor_LDADD = $(progs_ldadd) resolver_SOURCES = resolver.c resolver_LDADD = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la @@ -525,11 +858,177 @@ send_data_LDADD = $(progs_ldadd) \ srvtarget_SOURCES = srvtarget.c srvtarget_LDADD = $(progs_ldadd) +network_address_SOURCE = network-address.c +network_address_LDADD = $(progs_ldadd) +socket_SOURCE = socket.c +socket_LDADD = $(progs_ldadd) +pollable_SOURCE = pollable.c +pollable_LDADD = $(progs_ldadd) contexts_SOURCES = contexts.c contexts_LDADD = $(progs_ldadd) \ $(top_builddir)/gthread/libgthread-2.0.la -DISTCLEAN_FILES = applications/mimeinfo.cache +gsettings_SOURCES = gsettings.c +gsettings_LDADD = $(progs_ldadd) +gschema_compile_SOURCES = gschema-compile.c +gschema_compile_LDADD = $(progs_ldadd) +@HAVE_DBUS1_TRUE@gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c +@HAVE_DBUS1_TRUE@gdbus_serialization_CFLAGS = $(DBUS1_CFLAGS) +@HAVE_DBUS1_TRUE@gdbus_serialization_LDADD = $(progs_ldadd) $(DBUS1_LIBS) +gdbus_addresses_SOURCES = gdbus-addresses.c +gdbus_addresses_LDADD = $(progs_ldadd) +gdbus_bz627724_SOURCES = gdbus-bz627724.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_bz627724_LDADD = $(progs_ldadd) +gdbus_connection_SOURCES = gdbus-connection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_connection_LDADD = $(progs_ldadd) +gdbus_connection_slow_SOURCES = gdbus-connection-slow.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_connection_slow_LDADD = $(progs_ldadd) +gdbus_message_SOURCES = gdbus-message.c +gdbus_message_LDADD = $(progs_ldadd) +gdbus_names_SOURCES = gdbus-names.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_names_LDADD = $(progs_ldadd) +gdbus_proxy_SOURCES = gdbus-proxy.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_proxy_LDADD = $(progs_ldadd) +gdbus_proxy_well_known_name_SOURCES = gdbus-proxy-well-known-name.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_proxy_well_known_name_LDADD = $(progs_ldadd) +gdbus_introspection_SOURCES = gdbus-introspection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_introspection_LDADD = $(progs_ldadd) +gdbus_threading_SOURCES = gdbus-threading.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_threading_LDADD = $(progs_ldadd) +gdbus_export_SOURCES = gdbus-export.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_export_LDADD = $(progs_ldadd) +gdbus_error_SOURCES = gdbus-error.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_error_LDADD = $(progs_ldadd) +gdbus_peer_SOURCES = gdbus-peer.c gdbus-tests.h gdbus-tests.c +gdbus_peer_LDADD = $(progs_ldadd) +gdbus_non_socket_SOURCES = gdbus-non-socket.c gdbus-tests.h gdbus-tests.c +gdbus_non_socket_LDADD = $(progs_ldadd) +gdbus_exit_on_close_SOURCES = gdbus-exit-on-close.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c +gdbus_exit_on_close_LDADD = $(progs_ldadd) +gdbus_example_watch_name_SOURCES = gdbus-example-watch-name.c +gdbus_example_watch_name_LDADD = $(progs_ldadd) +gdbus_example_watch_proxy_SOURCES = gdbus-example-watch-proxy.c +gdbus_example_watch_proxy_LDADD = $(progs_ldadd) +gdbus_example_own_name_SOURCES = gdbus-example-own-name.c +gdbus_example_own_name_LDADD = $(progs_ldadd) +gdbus_example_server_SOURCES = gdbus-example-server.c +gdbus_example_server_LDADD = $(progs_ldadd) +gdbus_example_unix_fd_client_SOURCES = gdbus-example-unix-fd-client.c +gdbus_example_unix_fd_client_LDADD = $(progs_ldadd) +gdbus_example_subtree_SOURCES = gdbus-example-subtree.c +gdbus_example_subtree_LDADD = $(progs_ldadd) +gdbus_example_peer_SOURCES = gdbus-example-peer.c +gdbus_example_peer_LDADD = $(progs_ldadd) +gdbus_example_proxy_subclass_SOURCES = gdbus-example-proxy-subclass.c +gdbus_example_proxy_subclass_LDADD = $(progs_ldadd) +gdbus_example_export_SOURCES = gdbus-example-export.c +gdbus_example_export_LDADD = $(progs_ldadd) +gdbus_connection_flush_helper_SOURCES = gdbus-connection-flush-helper.c +gdbus_connection_flush_helper_LDADD = $(progs_ldadd) +appinfo_SOURCES = appinfo.c +appinfo_LDADD = $(progs_ldadd) +appinfo_test_SOURCES = appinfo-test.c +appinfo_test_LDADD = $(progs_ldadd) +contenttype_SOURCES = contenttype.c +contenttype_LDADD = $(progs_ldadd) +file_SOURCES = file.c +file_LDADD = $(progs_ldadd) +gapplication_SOURCES = gapplication.c gdbus-sessionbus.c +gapplication_LDADD = $(progs_ldadd) +gapplication_example_open_SOURCES = gapplication-example-open.c +gapplication_example_open_LDADD = $(progs_ldadd) +gapplication_example_cmdline_SOURCES = gapplication-example-cmdline.c +gapplication_example_cmdline_LDADD = $(progs_ldadd) +gapplication_example_cmdline2_SOURCES = gapplication-example-cmdline2.c +gapplication_example_cmdline2_LDADD = $(progs_ldadd) +gapplication_example_actions_SOURCES = gapplication-example-actions.c +gapplication_example_actions_LDADD = $(progs_ldadd) +schema_tests = \ + schema-tests/array-default-not-in-choices.gschema.xml \ + schema-tests/bad-choice.gschema.xml \ + schema-tests/bad-key.gschema.xml \ + schema-tests/bad-key2.gschema.xml \ + schema-tests/bad-key3.gschema.xml \ + schema-tests/bad-key4.gschema.xml \ + schema-tests/bad-type.gschema.xml \ + schema-tests/bare-alias.gschema.xml \ + schema-tests/choice-alias.gschema.xml \ + schema-tests/choice-bad.gschema.xml \ + schema-tests/choice-badtype.gschema.xml \ + schema-tests/choice-invalid-alias.gschema.xml \ + schema-tests/choice-missing-value.gschema.xml \ + schema-tests/choice-shadowed-alias.gschema.xml \ + schema-tests/choice-upside-down.gschema.xml \ + schema-tests/choice.gschema.xml \ + schema-tests/choices-wrong-type.gschema.xml \ + schema-tests/default-in-aliases.gschema.xml \ + schema-tests/default-not-in-choices.gschema.xml \ + schema-tests/default-out-of-range.gschema.xml \ + schema-tests/empty-key.gschema.xml \ + schema-tests/enum-with-aliases.gschema.xml \ + schema-tests/enum-with-bad-default.gschema.xml \ + schema-tests/enum-with-chained-alias.gschema.xml \ + schema-tests/enum-with-choice.gschema.xml \ + schema-tests/enum-with-invalid-alias.gschema.xml \ + schema-tests/enum-with-repeated-alias.gschema.xml \ + schema-tests/enum-with-repeated-nick.gschema.xml \ + schema-tests/enum-with-repeated-value.gschema.xml \ + schema-tests/enum-with-shadow-alias.gschema.xml \ + schema-tests/enum.gschema.xml \ + schema-tests/flags-aliased-default.gschema.xml \ + schema-tests/flags-bad-default.gschema.xml \ + schema-tests/flags-more-than-one-bit.gschema.xml \ + schema-tests/flags-with-enum-attr.gschema.xml \ + schema-tests/flags-with-enum-tag.gschema.xml \ + schema-tests/extend-and-shadow-indirect.gschema.xml \ + schema-tests/extend-and-shadow.gschema.xml \ + schema-tests/extend-missing.gschema.xml \ + schema-tests/extend-nonlist.gschema.xml \ + schema-tests/extend-self.gschema.xml \ + schema-tests/extend-wrong-list-indirect.gschema.xml \ + schema-tests/extend-wrong-list.gschema.xml \ + schema-tests/extending.gschema.xml \ + schema-tests/from-docs.gschema.xml \ + schema-tests/incomplete-list.gschema.xml \ + schema-tests/inherit-gettext-domain.gschema.xml \ + schema-tests/invalid-path.gschema.xml \ + schema-tests/key-in-list-indirect.gschema.xml \ + schema-tests/key-in-list.gschema.xml \ + schema-tests/list-of-missing.gschema.xml \ + schema-tests/missing-quotes.gschema.xml \ + schema-tests/no-default.gschema.xml \ + schema-tests/overflow.gschema.xml \ + schema-tests/override-missing.gschema.xml \ + schema-tests/override-range-error.gschema.xml \ + schema-tests/override-then-key.gschema.xml \ + schema-tests/override-twice.gschema.xml \ + schema-tests/override-type-error.gschema.xml \ + schema-tests/override.gschema.xml \ + schema-tests/range-badtype.gschema.xml \ + schema-tests/range-default-high.gschema.xml \ + schema-tests/range-default-low.gschema.xml \ + schema-tests/range-high-default.gschema.xml \ + schema-tests/range-low-default.gschema.xml \ + schema-tests/range-missing-max.gschema.xml \ + schema-tests/range-missing-min.gschema.xml \ + schema-tests/range-parse-error.gschema.xml \ + schema-tests/range-wrong-type.gschema.xml \ + schema-tests/range.gschema.xml \ + schema-tests/wrong-category.gschema.xml + +proxy_SOURCES = proxy.c +proxy_LDADD = $(progs_ldadd) \ + $(top_builddir)/gthread/libgthread-2.0.la + +MISC_STUFF = test.mo +DISTCLEANFILES = \ + applications/mimeinfo.cache \ + org.gtk.test.enums.xml \ + de/LC_MESSAGES/test.mo \ + test.mo \ + gsettings.store \ + gschemas.compiled + all: all-am .SUFFIXES: @@ -573,9 +1072,27 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +actions$(EXEEXT): $(actions_OBJECTS) $(actions_DEPENDENCIES) + @rm -f actions$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(actions_OBJECTS) $(actions_LDADD) $(LIBS) +appinfo$(EXEEXT): $(appinfo_OBJECTS) $(appinfo_DEPENDENCIES) + @rm -f appinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(appinfo_OBJECTS) $(appinfo_LDADD) $(LIBS) +appinfo-test$(EXEEXT): $(appinfo_test_OBJECTS) $(appinfo_test_DEPENDENCIES) + @rm -f appinfo-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(appinfo_test_OBJECTS) $(appinfo_test_LDADD) $(LIBS) +async-close-output-stream$(EXEEXT): $(async_close_output_stream_OBJECTS) $(async_close_output_stream_DEPENDENCIES) + @rm -f async-close-output-stream$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(async_close_output_stream_OBJECTS) $(async_close_output_stream_LDADD) $(LIBS) buffered-input-stream$(EXEEXT): $(buffered_input_stream_OBJECTS) $(buffered_input_stream_DEPENDENCIES) @rm -f buffered-input-stream$(EXEEXT) $(AM_V_CCLD)$(LINK) $(buffered_input_stream_OBJECTS) $(buffered_input_stream_LDADD) $(LIBS) +buffered-output-stream$(EXEEXT): $(buffered_output_stream_OBJECTS) $(buffered_output_stream_DEPENDENCIES) + @rm -f buffered-output-stream$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(buffered_output_stream_OBJECTS) $(buffered_output_stream_LDADD) $(LIBS) +contenttype$(EXEEXT): $(contenttype_OBJECTS) $(contenttype_DEPENDENCIES) + @rm -f contenttype$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(contenttype_OBJECTS) $(contenttype_LDADD) $(LIBS) contexts$(EXEEXT): $(contexts_OBJECTS) $(contexts_DEPENDENCIES) @rm -f contexts$(EXEEXT) $(AM_V_CCLD)$(LINK) $(contexts_OBJECTS) $(contexts_LDADD) $(LIBS) @@ -594,6 +1111,9 @@ desktop-app-info$(EXEEXT): $(desktop_app_info_OBJECTS) $(desktop_app_info_DEPEND echo-server$(EXEEXT): $(echo_server_OBJECTS) $(echo_server_DEPENDENCIES) @rm -f echo-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(echo_server_OBJECTS) $(echo_server_LDADD) $(LIBS) +file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) + @rm -f file$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS) filter-cat$(EXEEXT): $(filter_cat_OBJECTS) $(filter_cat_DEPENDENCIES) @rm -f filter-cat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(filter_cat_OBJECTS) $(filter_cat_LDADD) $(LIBS) @@ -609,9 +1129,111 @@ g-file-info$(EXEEXT): $(g_file_info_OBJECTS) $(g_file_info_DEPENDENCIES) g-icon$(EXEEXT): $(g_icon_OBJECTS) $(g_icon_DEPENDENCIES) @rm -f g-icon$(EXEEXT) $(AM_V_CCLD)$(LINK) $(g_icon_OBJECTS) $(g_icon_LDADD) $(LIBS) +gapplication$(EXEEXT): $(gapplication_OBJECTS) $(gapplication_DEPENDENCIES) + @rm -f gapplication$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gapplication_OBJECTS) $(gapplication_LDADD) $(LIBS) +gapplication-example-actions$(EXEEXT): $(gapplication_example_actions_OBJECTS) $(gapplication_example_actions_DEPENDENCIES) + @rm -f gapplication-example-actions$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gapplication_example_actions_OBJECTS) $(gapplication_example_actions_LDADD) $(LIBS) +gapplication-example-cmdline$(EXEEXT): $(gapplication_example_cmdline_OBJECTS) $(gapplication_example_cmdline_DEPENDENCIES) + @rm -f gapplication-example-cmdline$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gapplication_example_cmdline_OBJECTS) $(gapplication_example_cmdline_LDADD) $(LIBS) +gapplication-example-cmdline2$(EXEEXT): $(gapplication_example_cmdline2_OBJECTS) $(gapplication_example_cmdline2_DEPENDENCIES) + @rm -f gapplication-example-cmdline2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gapplication_example_cmdline2_OBJECTS) $(gapplication_example_cmdline2_LDADD) $(LIBS) +gapplication-example-open$(EXEEXT): $(gapplication_example_open_OBJECTS) $(gapplication_example_open_DEPENDENCIES) + @rm -f gapplication-example-open$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gapplication_example_open_OBJECTS) $(gapplication_example_open_LDADD) $(LIBS) +gdbus-addresses$(EXEEXT): $(gdbus_addresses_OBJECTS) $(gdbus_addresses_DEPENDENCIES) + @rm -f gdbus-addresses$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_addresses_OBJECTS) $(gdbus_addresses_LDADD) $(LIBS) +gdbus-bz627724$(EXEEXT): $(gdbus_bz627724_OBJECTS) $(gdbus_bz627724_DEPENDENCIES) + @rm -f gdbus-bz627724$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_bz627724_OBJECTS) $(gdbus_bz627724_LDADD) $(LIBS) +gdbus-connection$(EXEEXT): $(gdbus_connection_OBJECTS) $(gdbus_connection_DEPENDENCIES) + @rm -f gdbus-connection$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_connection_OBJECTS) $(gdbus_connection_LDADD) $(LIBS) +gdbus-connection-flush-helper$(EXEEXT): $(gdbus_connection_flush_helper_OBJECTS) $(gdbus_connection_flush_helper_DEPENDENCIES) + @rm -f gdbus-connection-flush-helper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_connection_flush_helper_OBJECTS) $(gdbus_connection_flush_helper_LDADD) $(LIBS) +gdbus-connection-slow$(EXEEXT): $(gdbus_connection_slow_OBJECTS) $(gdbus_connection_slow_DEPENDENCIES) + @rm -f gdbus-connection-slow$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_connection_slow_OBJECTS) $(gdbus_connection_slow_LDADD) $(LIBS) +gdbus-error$(EXEEXT): $(gdbus_error_OBJECTS) $(gdbus_error_DEPENDENCIES) + @rm -f gdbus-error$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_error_OBJECTS) $(gdbus_error_LDADD) $(LIBS) +gdbus-example-export$(EXEEXT): $(gdbus_example_export_OBJECTS) $(gdbus_example_export_DEPENDENCIES) + @rm -f gdbus-example-export$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_export_OBJECTS) $(gdbus_example_export_LDADD) $(LIBS) +gdbus-example-own-name$(EXEEXT): $(gdbus_example_own_name_OBJECTS) $(gdbus_example_own_name_DEPENDENCIES) + @rm -f gdbus-example-own-name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_own_name_OBJECTS) $(gdbus_example_own_name_LDADD) $(LIBS) +gdbus-example-peer$(EXEEXT): $(gdbus_example_peer_OBJECTS) $(gdbus_example_peer_DEPENDENCIES) + @rm -f gdbus-example-peer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_peer_OBJECTS) $(gdbus_example_peer_LDADD) $(LIBS) +gdbus-example-proxy-subclass$(EXEEXT): $(gdbus_example_proxy_subclass_OBJECTS) $(gdbus_example_proxy_subclass_DEPENDENCIES) + @rm -f gdbus-example-proxy-subclass$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_proxy_subclass_OBJECTS) $(gdbus_example_proxy_subclass_LDADD) $(LIBS) +gdbus-example-server$(EXEEXT): $(gdbus_example_server_OBJECTS) $(gdbus_example_server_DEPENDENCIES) + @rm -f gdbus-example-server$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_server_OBJECTS) $(gdbus_example_server_LDADD) $(LIBS) +gdbus-example-subtree$(EXEEXT): $(gdbus_example_subtree_OBJECTS) $(gdbus_example_subtree_DEPENDENCIES) + @rm -f gdbus-example-subtree$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_subtree_OBJECTS) $(gdbus_example_subtree_LDADD) $(LIBS) +gdbus-example-unix-fd-client$(EXEEXT): $(gdbus_example_unix_fd_client_OBJECTS) $(gdbus_example_unix_fd_client_DEPENDENCIES) + @rm -f gdbus-example-unix-fd-client$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_unix_fd_client_OBJECTS) $(gdbus_example_unix_fd_client_LDADD) $(LIBS) +gdbus-example-watch-name$(EXEEXT): $(gdbus_example_watch_name_OBJECTS) $(gdbus_example_watch_name_DEPENDENCIES) + @rm -f gdbus-example-watch-name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_watch_name_OBJECTS) $(gdbus_example_watch_name_LDADD) $(LIBS) +gdbus-example-watch-proxy$(EXEEXT): $(gdbus_example_watch_proxy_OBJECTS) $(gdbus_example_watch_proxy_DEPENDENCIES) + @rm -f gdbus-example-watch-proxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_example_watch_proxy_OBJECTS) $(gdbus_example_watch_proxy_LDADD) $(LIBS) +gdbus-exit-on-close$(EXEEXT): $(gdbus_exit_on_close_OBJECTS) $(gdbus_exit_on_close_DEPENDENCIES) + @rm -f gdbus-exit-on-close$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_exit_on_close_OBJECTS) $(gdbus_exit_on_close_LDADD) $(LIBS) +gdbus-export$(EXEEXT): $(gdbus_export_OBJECTS) $(gdbus_export_DEPENDENCIES) + @rm -f gdbus-export$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_export_OBJECTS) $(gdbus_export_LDADD) $(LIBS) +gdbus-introspection$(EXEEXT): $(gdbus_introspection_OBJECTS) $(gdbus_introspection_DEPENDENCIES) + @rm -f gdbus-introspection$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_introspection_OBJECTS) $(gdbus_introspection_LDADD) $(LIBS) +gdbus-message$(EXEEXT): $(gdbus_message_OBJECTS) $(gdbus_message_DEPENDENCIES) + @rm -f gdbus-message$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_message_OBJECTS) $(gdbus_message_LDADD) $(LIBS) +gdbus-names$(EXEEXT): $(gdbus_names_OBJECTS) $(gdbus_names_DEPENDENCIES) + @rm -f gdbus-names$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_names_OBJECTS) $(gdbus_names_LDADD) $(LIBS) +gdbus-non-socket$(EXEEXT): $(gdbus_non_socket_OBJECTS) $(gdbus_non_socket_DEPENDENCIES) + @rm -f gdbus-non-socket$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_non_socket_OBJECTS) $(gdbus_non_socket_LDADD) $(LIBS) +gdbus-peer$(EXEEXT): $(gdbus_peer_OBJECTS) $(gdbus_peer_DEPENDENCIES) + @rm -f gdbus-peer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_peer_OBJECTS) $(gdbus_peer_LDADD) $(LIBS) +gdbus-proxy$(EXEEXT): $(gdbus_proxy_OBJECTS) $(gdbus_proxy_DEPENDENCIES) + @rm -f gdbus-proxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_proxy_OBJECTS) $(gdbus_proxy_LDADD) $(LIBS) +gdbus-proxy-well-known-name$(EXEEXT): $(gdbus_proxy_well_known_name_OBJECTS) $(gdbus_proxy_well_known_name_DEPENDENCIES) + @rm -f gdbus-proxy-well-known-name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_proxy_well_known_name_OBJECTS) $(gdbus_proxy_well_known_name_LDADD) $(LIBS) +gdbus-serialization$(EXEEXT): $(gdbus_serialization_OBJECTS) $(gdbus_serialization_DEPENDENCIES) + @rm -f gdbus-serialization$(EXEEXT) + $(AM_V_CCLD)$(gdbus_serialization_LINK) $(gdbus_serialization_OBJECTS) $(gdbus_serialization_LDADD) $(LIBS) +gdbus-threading$(EXEEXT): $(gdbus_threading_OBJECTS) $(gdbus_threading_DEPENDENCIES) + @rm -f gdbus-threading$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gdbus_threading_OBJECTS) $(gdbus_threading_LDADD) $(LIBS) +gschema-compile$(EXEEXT): $(gschema_compile_OBJECTS) $(gschema_compile_DEPENDENCIES) + @rm -f gschema-compile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gschema_compile_OBJECTS) $(gschema_compile_LDADD) $(LIBS) +gsettings$(EXEEXT): $(gsettings_OBJECTS) $(gsettings_DEPENDENCIES) + @rm -f gsettings$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gsettings_OBJECTS) $(gsettings_LDADD) $(LIBS) httpd$(EXEEXT): $(httpd_OBJECTS) $(httpd_DEPENDENCIES) @rm -f httpd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(httpd_OBJECTS) $(httpd_LDADD) $(LIBS) +io-stream$(EXEEXT): $(io_stream_OBJECTS) $(io_stream_DEPENDENCIES) + @rm -f io-stream$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_stream_OBJECTS) $(io_stream_LDADD) $(LIBS) live-g-file$(EXEEXT): $(live_g_file_OBJECTS) $(live_g_file_DEPENDENCIES) @rm -f live-g-file$(EXEEXT) $(AM_V_CCLD)$(LINK) $(live_g_file_OBJECTS) $(live_g_file_LDADD) $(LIBS) @@ -621,6 +1243,15 @@ memory-input-stream$(EXEEXT): $(memory_input_stream_OBJECTS) $(memory_input_stre memory-output-stream$(EXEEXT): $(memory_output_stream_OBJECTS) $(memory_output_stream_DEPENDENCIES) @rm -f memory-output-stream$(EXEEXT) $(AM_V_CCLD)$(LINK) $(memory_output_stream_OBJECTS) $(memory_output_stream_LDADD) $(LIBS) +network-address$(EXEEXT): $(network_address_OBJECTS) $(network_address_DEPENDENCIES) + @rm -f network-address$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(network_address_OBJECTS) $(network_address_LDADD) $(LIBS) +pollable$(EXEEXT): $(pollable_OBJECTS) $(pollable_DEPENDENCIES) + @rm -f pollable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pollable_OBJECTS) $(pollable_LDADD) $(LIBS) +proxy$(EXEEXT): $(proxy_OBJECTS) $(proxy_DEPENDENCIES) + @rm -f proxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(proxy_OBJECTS) $(proxy_LDADD) $(LIBS) readwrite$(EXEEXT): $(readwrite_OBJECTS) $(readwrite_DEPENDENCIES) @rm -f readwrite$(EXEEXT) $(AM_V_CCLD)$(LINK) $(readwrite_OBJECTS) $(readwrite_LDADD) $(LIBS) @@ -636,6 +1267,9 @@ simple-async-result$(EXEEXT): $(simple_async_result_OBJECTS) $(simple_async_resu sleepy-stream$(EXEEXT): $(sleepy_stream_OBJECTS) $(sleepy_stream_DEPENDENCIES) @rm -f sleepy-stream$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sleepy_stream_OBJECTS) $(sleepy_stream_LDADD) $(LIBS) +socket$(EXEEXT): $(socket_OBJECTS) $(socket_DEPENDENCIES) + @rm -f socket$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(socket_OBJECTS) $(socket_LDADD) $(LIBS) socket-client$(EXEEXT): $(socket_client_OBJECTS) $(socket_client_DEPENDENCIES) @rm -f socket-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(socket_client_OBJECTS) $(socket_client_LDADD) $(LIBS) @@ -651,6 +1285,12 @@ unix-fd$(EXEEXT): $(unix_fd_OBJECTS) $(unix_fd_DEPENDENCIES) unix-streams$(EXEEXT): $(unix_streams_OBJECTS) $(unix_streams_DEPENDENCIES) @rm -f unix-streams$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unix_streams_OBJECTS) $(unix_streams_LDADD) $(LIBS) +volumemonitor$(EXEEXT): $(volumemonitor_OBJECTS) $(volumemonitor_DEPENDENCIES) + @rm -f volumemonitor$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(volumemonitor_OBJECTS) $(volumemonitor_LDADD) $(LIBS) +win32-streams$(EXEEXT): $(win32_streams_OBJECTS) $(win32_streams_DEPENDENCIES) + @rm -f win32-streams$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(win32_streams_OBJECTS) $(win32_streams_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -658,22 +1298,69 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appinfo-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/async-close-output-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffered-input-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffered-output-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contenttype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contexts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/converter-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-input-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-output-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desktop-app-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-cat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-streams.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g-file-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g-icon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplication-example-actions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplication-example-cmdline.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplication-example-cmdline2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplication-example-open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gapplication.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-addresses.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-bz627724.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-connection-flush-helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-connection-slow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-connection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-export.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-own-name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-peer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-proxy-subclass.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-subtree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-unix-fd-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-watch-name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-example-watch-proxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-exit-on-close.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-export.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-introspection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-message.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-names.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-non-socket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-peer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-proxy-well-known-name.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-proxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-sessionbus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-tests.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus-threading.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus_serialization-gdbus-serialization.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbus_serialization-gdbus-tests.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gschema-compile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsettings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/live-g-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory-input-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory-output-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network-address.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readwrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send-data.Po@am__quote@ @@ -681,9 +1368,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleepy-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srvtarget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-fd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-streams.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volumemonitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32-streams.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -709,6 +1399,38 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +gdbus_serialization-gdbus-serialization.o: gdbus-serialization.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -MT gdbus_serialization-gdbus-serialization.o -MD -MP -MF $(DEPDIR)/gdbus_serialization-gdbus-serialization.Tpo -c -o gdbus_serialization-gdbus-serialization.o `test -f 'gdbus-serialization.c' || echo '$(srcdir)/'`gdbus-serialization.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gdbus_serialization-gdbus-serialization.Tpo $(DEPDIR)/gdbus_serialization-gdbus-serialization.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gdbus-serialization.c' object='gdbus_serialization-gdbus-serialization.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -c -o gdbus_serialization-gdbus-serialization.o `test -f 'gdbus-serialization.c' || echo '$(srcdir)/'`gdbus-serialization.c + +gdbus_serialization-gdbus-serialization.obj: gdbus-serialization.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -MT gdbus_serialization-gdbus-serialization.obj -MD -MP -MF $(DEPDIR)/gdbus_serialization-gdbus-serialization.Tpo -c -o gdbus_serialization-gdbus-serialization.obj `if test -f 'gdbus-serialization.c'; then $(CYGPATH_W) 'gdbus-serialization.c'; else $(CYGPATH_W) '$(srcdir)/gdbus-serialization.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gdbus_serialization-gdbus-serialization.Tpo $(DEPDIR)/gdbus_serialization-gdbus-serialization.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gdbus-serialization.c' object='gdbus_serialization-gdbus-serialization.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -c -o gdbus_serialization-gdbus-serialization.obj `if test -f 'gdbus-serialization.c'; then $(CYGPATH_W) 'gdbus-serialization.c'; else $(CYGPATH_W) '$(srcdir)/gdbus-serialization.c'; fi` + +gdbus_serialization-gdbus-tests.o: gdbus-tests.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -MT gdbus_serialization-gdbus-tests.o -MD -MP -MF $(DEPDIR)/gdbus_serialization-gdbus-tests.Tpo -c -o gdbus_serialization-gdbus-tests.o `test -f 'gdbus-tests.c' || echo '$(srcdir)/'`gdbus-tests.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gdbus_serialization-gdbus-tests.Tpo $(DEPDIR)/gdbus_serialization-gdbus-tests.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gdbus-tests.c' object='gdbus_serialization-gdbus-tests.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -c -o gdbus_serialization-gdbus-tests.o `test -f 'gdbus-tests.c' || echo '$(srcdir)/'`gdbus-tests.c + +gdbus_serialization-gdbus-tests.obj: gdbus-tests.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -MT gdbus_serialization-gdbus-tests.obj -MD -MP -MF $(DEPDIR)/gdbus_serialization-gdbus-tests.Tpo -c -o gdbus_serialization-gdbus-tests.obj `if test -f 'gdbus-tests.c'; then $(CYGPATH_W) 'gdbus-tests.c'; else $(CYGPATH_W) '$(srcdir)/gdbus-tests.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gdbus_serialization-gdbus-tests.Tpo $(DEPDIR)/gdbus_serialization-gdbus-tests.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gdbus-tests.c' object='gdbus_serialization-gdbus-tests.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gdbus_serialization_CFLAGS) $(CFLAGS) -c -o gdbus_serialization-gdbus-tests.obj `if test -f 'gdbus-tests.c'; then $(CYGPATH_W) 'gdbus-tests.c'; else $(CYGPATH_W) '$(srcdir)/gdbus-tests.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -800,7 +1522,7 @@ distdir: $(DISTFILES) check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile $(PROGRAMS) $(DATA) installdirs: install: install-am install-exec: install-exec-am @@ -823,6 +1545,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -918,13 +1641,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -951,8 +1677,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -961,9 +1691,34 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive + +test.mo: de.po + $(MSGFMT) -o test.mo $(srcdir)/de.po; \ + $(MKDIR_P) de/LC_MESSAGES; \ + cp -f test.mo de/LC_MESSAGES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gio/tests/actions.c b/gio/tests/actions.c new file mode 100644 index 0000000..9c8fbd5 --- /dev/null +++ b/gio/tests/actions.c @@ -0,0 +1,268 @@ +#include +#include + +typedef struct +{ + GVariant *params; + gboolean did_run; +} Activation; + +static void +activate (GAction *action, + GVariant *parameter, + gpointer user_data) +{ + Activation *activation = user_data; + + if (parameter) + activation->params = g_variant_ref (parameter); + else + activation->params = NULL; + activation->did_run = TRUE; +} + +static void +test_basic (void) +{ + Activation a = { 0, }; + GSimpleAction *action; + gchar *name; + GVariantType *parameter_type; + gboolean enabled; + GVariantType *state_type; + GVariant *state; + + action = g_simple_action_new ("foo", NULL); + g_assert (g_action_get_enabled (G_ACTION (action))); + g_assert (g_action_get_parameter_type (G_ACTION (action)) == NULL); + g_assert (g_action_get_state_type (G_ACTION (action)) == NULL); + g_assert (g_action_get_state_hint (G_ACTION (action)) == NULL); + g_assert (g_action_get_state (G_ACTION (action)) == NULL); + g_object_get (action, + "name", &name, + "parameter-type", ¶meter_type, + "enabled", &enabled, + "state-type", &state_type, + "state", &state, + NULL); + g_assert_cmpstr (name, ==, "foo"); + g_assert (parameter_type == NULL); + g_assert (enabled); + g_assert (state_type == NULL); + g_assert (state == NULL); + g_free (name); + + g_signal_connect (action, "activate", G_CALLBACK (activate), &a); + g_assert (!a.did_run); + g_action_activate (G_ACTION (action), NULL); + g_assert (a.did_run); + a.did_run = FALSE; + + g_simple_action_set_enabled (action, FALSE); + g_action_activate (G_ACTION (action), NULL); + g_assert (!a.did_run); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + g_action_activate (G_ACTION (action), g_variant_new_string ("xxx")); + exit (0); + } + g_test_trap_assert_failed (); + + g_object_unref (action); + g_assert (!a.did_run); + + action = g_simple_action_new ("foo", G_VARIANT_TYPE_STRING); + g_assert (g_action_get_enabled (G_ACTION (action))); + g_assert (g_variant_type_equal (g_action_get_parameter_type (G_ACTION (action)), G_VARIANT_TYPE_STRING)); + g_assert (g_action_get_state_type (G_ACTION (action)) == NULL); + g_assert (g_action_get_state_hint (G_ACTION (action)) == NULL); + g_assert (g_action_get_state (G_ACTION (action)) == NULL); + + g_signal_connect (action, "activate", G_CALLBACK (activate), &a); + g_assert (!a.did_run); + g_action_activate (G_ACTION (action), g_variant_new_string ("Hello world")); + g_assert (a.did_run); + g_assert_cmpstr (g_variant_get_string (a.params, NULL), ==, "Hello world"); + g_variant_unref (a.params); + a.did_run = FALSE; + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + g_action_activate (G_ACTION (action), NULL); + exit (0); + } + + g_test_trap_assert_failed (); + + g_object_unref (action); + g_assert (!a.did_run); +} + +static gboolean +strv_has_string (gchar **haystack, + const gchar *needle) +{ + guint n; + + for (n = 0; haystack != NULL && haystack[n] != NULL; n++) + { + if (g_strcmp0 (haystack[n], needle) == 0) + return TRUE; + } + return FALSE; +} + +static gboolean +strv_set_equal (gchar **strv, ...) +{ + gint count; + va_list list; + const gchar *str; + gboolean res; + + res = TRUE; + count = 0; + va_start (list, strv); + while (1) + { + str = va_arg (list, const gchar *); + if (str == NULL) + break; + if (!strv_has_string (strv, str)) + { + res = FALSE; + break; + } + count++; + } + va_end (list); + + if (res) + res = g_strv_length ((gchar**)strv) == count; + + return res; +} + +static void +test_simple_group (void) +{ + GSimpleActionGroup *group; + Activation a = { 0, }; + GSimpleAction *simple; + GAction *action; + gchar **actions; + GVariant *state; + + simple = g_simple_action_new ("foo", NULL); + g_signal_connect (simple, "activate", G_CALLBACK (activate), &a); + g_assert (!a.did_run); + g_action_activate (G_ACTION (simple), NULL); + g_assert (a.did_run); + a.did_run = FALSE; + + group = g_simple_action_group_new (); + g_simple_action_group_insert (group, G_ACTION (simple)); + g_object_unref (simple); + + g_assert (!a.did_run); + g_action_group_activate_action (G_ACTION_GROUP (group), "foo", NULL); + g_assert (a.did_run); + + simple = g_simple_action_new_stateful ("bar", G_VARIANT_TYPE_STRING, g_variant_new_string ("hihi")); + g_simple_action_group_insert (group, G_ACTION (simple)); + g_object_unref (simple); + + g_assert (g_action_group_has_action (G_ACTION_GROUP (group), "foo")); + g_assert (g_action_group_has_action (G_ACTION_GROUP (group), "bar")); + g_assert (!g_action_group_has_action (G_ACTION_GROUP (group), "baz")); + actions = g_action_group_list_actions (G_ACTION_GROUP (group)); + g_assert_cmpint (g_strv_length (actions), ==, 2); + g_assert (strv_set_equal (actions, "foo", "bar", NULL)); + g_strfreev (actions); + g_assert (g_action_group_get_action_enabled (G_ACTION_GROUP (group), "foo")); + g_assert (g_action_group_get_action_enabled (G_ACTION_GROUP (group), "bar")); + g_assert (g_action_group_get_action_parameter_type (G_ACTION_GROUP (group), "foo") == NULL); + g_assert (g_variant_type_equal (g_action_group_get_action_parameter_type (G_ACTION_GROUP (group), "bar"), G_VARIANT_TYPE_STRING)); + g_assert (g_action_group_get_action_state_type (G_ACTION_GROUP (group), "foo") == NULL); + g_assert (g_variant_type_equal (g_action_group_get_action_state_type (G_ACTION_GROUP (group), "bar"), G_VARIANT_TYPE_STRING)); + g_assert (g_action_group_get_action_state_hint (G_ACTION_GROUP (group), "foo") == NULL); + g_assert (g_action_group_get_action_state_hint (G_ACTION_GROUP (group), "bar") == NULL); + g_assert (g_action_group_get_action_state (G_ACTION_GROUP (group), "foo") == NULL); + state = g_action_group_get_action_state (G_ACTION_GROUP (group), "bar"); + g_assert (g_variant_type_equal (g_variant_get_type (state), G_VARIANT_TYPE_STRING)); + g_assert_cmpstr (g_variant_get_string (state, NULL), ==, "hihi"); + g_variant_unref (state); + + g_action_group_change_action_state (G_ACTION_GROUP (group), "bar", g_variant_new_string ("boo")); + state = g_action_group_get_action_state (G_ACTION_GROUP (group), "bar"); + g_assert_cmpstr (g_variant_get_string (state, NULL), ==, "boo"); + g_variant_unref (state); + + action = g_simple_action_group_lookup (group, "bar"); + g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE); + g_assert (!g_action_group_get_action_enabled (G_ACTION_GROUP (group), "bar")); + + g_simple_action_group_remove (group, "bar"); + action = g_simple_action_group_lookup (group, "foo"); + g_assert_cmpstr (g_action_get_name (action), ==, "foo"); + action = g_simple_action_group_lookup (group, "bar"); + g_assert (action == NULL); + + a.did_run = FALSE; + g_object_unref (group); + g_assert (!a.did_run); +} + +static void +test_stateful (void) +{ + GSimpleAction *action; + GVariant *state; + + action = g_simple_action_new_stateful ("foo", NULL, g_variant_new_string ("hihi")); + g_assert (g_action_get_enabled (G_ACTION (action))); + g_assert (g_action_get_parameter_type (G_ACTION (action)) == NULL); + g_assert (g_action_get_state_hint (G_ACTION (action)) == NULL); + g_assert (g_variant_type_equal (g_action_get_state_type (G_ACTION (action)), + G_VARIANT_TYPE_STRING)); + state = g_action_get_state (G_ACTION (action)); + g_assert_cmpstr (g_variant_get_string (state, NULL), ==, "hihi"); + g_variant_unref (state); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + g_action_set_state (G_ACTION (action), g_variant_new_int32 (123)); + exit (0); + } + g_test_trap_assert_failed (); + + g_action_set_state (G_ACTION (action), g_variant_new_string ("hello")); + state = g_action_get_state (G_ACTION (action)); + g_assert_cmpstr (g_variant_get_string (state, NULL), ==, "hello"); + g_variant_unref (state); + + g_object_unref (action); + + action = g_simple_action_new ("foo", NULL); + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + g_action_set_state (G_ACTION (action), g_variant_new_int32 (123)); + exit (0); + } + g_test_trap_assert_failed (); + g_object_unref (action); +} + +int +main (int argc, char **argv) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/actions/basic", test_basic); + g_test_add_func ("/actions/simplegroup", test_simple_group); + g_test_add_func ("/actions/stateful", test_stateful); + + return g_test_run (); +} diff --git a/gio/tests/appinfo-test-gnome.desktop b/gio/tests/appinfo-test-gnome.desktop new file mode 100644 index 0000000..9e3b428 --- /dev/null +++ b/gio/tests/appinfo-test-gnome.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +Name=appinfo-test +Exec=./appinfo-test --option +OnlyShowIn=GNOME;KDE; +NotShowIn=ROX; diff --git a/gio/tests/appinfo-test-notgnome.desktop b/gio/tests/appinfo-test-notgnome.desktop new file mode 100644 index 0000000..2f7c11d --- /dev/null +++ b/gio/tests/appinfo-test-notgnome.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +Name=appinfo-test +Exec=./appinfo-test --option +OnlyShowIn=KDE; +NotShowIn=GNOME; diff --git a/gio/tests/appinfo-test.c b/gio/tests/appinfo-test.c new file mode 100644 index 0000000..9d6a5ff --- /dev/null +++ b/gio/tests/appinfo-test.c @@ -0,0 +1,20 @@ +#include +#include + +int +main (int argc, char *argv[]) +{ + const gchar *envvar; + gint pid_from_env; + + envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE_PID"); + g_assert (envvar != NULL); + pid_from_env = atoi (envvar); + g_assert_cmpint (pid_from_env, ==, getpid ()); + + envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE"); + g_assert_cmpstr (envvar, ==, SRCDIR "/appinfo-test.desktop"); + + return 0; +} + diff --git a/gio/tests/appinfo-test.desktop b/gio/tests/appinfo-test.desktop new file mode 100644 index 0000000..0a64cfb --- /dev/null +++ b/gio/tests/appinfo-test.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=appinfo-test +Name[de]=appinfo-test-de +X-GNOME-FullName=example +X-GNOME-FullName[de]=Beispiel +Comment=GAppInfo example +Comment[de]=GAppInfo Beispiel +Exec=./appinfo-test --option +Icon=testicon diff --git a/gio/tests/appinfo-test2.desktop b/gio/tests/appinfo-test2.desktop new file mode 100644 index 0000000..1f55393 --- /dev/null +++ b/gio/tests/appinfo-test2.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Name=appinfo-test +Name[de]=appinfo-test-de +X-GNOME-FullName=example +X-GNOME-FullName[de]=Beispiel +Comment=GAppInfo example +Comment[de]=GAppInfo Beispiel +Exec=./appinfo-test --option +TryExec=does-not-exist +Icon=testicon diff --git a/gio/tests/appinfo.c b/gio/tests/appinfo.c new file mode 100644 index 0000000..d9221d7 --- /dev/null +++ b/gio/tests/appinfo.c @@ -0,0 +1,263 @@ + +#include + +#include +#include + +static void +test_launch (void) +{ + GAppInfo *appinfo; + GError *error; + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test.desktop"); + g_assert (appinfo != NULL); + + error = NULL; + g_assert (g_app_info_launch (appinfo, NULL, NULL, &error)); + g_assert_no_error (error); + + g_assert (g_app_info_launch_uris (appinfo, NULL, NULL, &error)); + g_assert_no_error (error); +} + +static void +test_locale (const char *locale) +{ + GAppInfo *appinfo; + const gchar *orig; + + orig = setlocale (LC_ALL, NULL); + g_setenv ("LANGUAGE", locale, TRUE); + setlocale (LC_ALL, ""); + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test.desktop"); + + if (g_strcmp0 (locale, "C") == 0) + { + g_assert_cmpstr (g_app_info_get_name (appinfo), ==, "appinfo-test"); + g_assert_cmpstr (g_app_info_get_description (appinfo), ==, "GAppInfo example"); + g_assert_cmpstr (g_app_info_get_display_name (appinfo), ==, "example"); + } + else if (g_str_has_prefix (locale, "en")) + { + g_assert_cmpstr (g_app_info_get_name (appinfo), ==, "appinfo-test"); + g_assert_cmpstr (g_app_info_get_description (appinfo), ==, "GAppInfo example"); + g_assert_cmpstr (g_app_info_get_display_name (appinfo), ==, "example"); + } + else if (g_str_has_prefix (locale, "de")) + { + g_assert_cmpstr (g_app_info_get_name (appinfo), ==, "appinfo-test-de"); + g_assert_cmpstr (g_app_info_get_description (appinfo), ==, "GAppInfo Beispiel"); + g_assert_cmpstr (g_app_info_get_display_name (appinfo), ==, "Beispiel"); + } + + g_object_unref (appinfo); + + g_setenv ("LANGUAGE", orig, TRUE); + setlocale (LC_ALL, ""); +} + +static void +test_text (void) +{ + test_locale ("C"); + test_locale ("en_US"); + test_locale ("de"); + test_locale ("de_DE.UTF-8"); +} + +static void +test_basic (void) +{ + GAppInfo *appinfo; + GAppInfo *appinfo2; + GIcon *icon, *icon2; + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test.desktop"); + + g_assert (g_app_info_get_id (appinfo) == NULL); + g_assert_cmpstr (g_app_info_get_executable (appinfo), ==, "./appinfo-test"); + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, "./appinfo-test --option"); + + icon = g_app_info_get_icon (appinfo); + g_assert (G_IS_THEMED_ICON (icon)); + icon2 = g_themed_icon_new ("testicon"); + g_assert (g_icon_equal (icon, icon2)); + g_object_unref (icon2); + + appinfo2 = g_app_info_dup (appinfo); + g_assert (g_app_info_get_id (appinfo) == g_app_info_get_id (appinfo2)); + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, g_app_info_get_commandline (appinfo2)); + + g_object_unref (appinfo); + g_object_unref (appinfo2); +} + +static void +test_show_in (void) +{ + GAppInfo *appinfo; + + g_desktop_app_info_set_desktop_env ("GNOME"); + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test.desktop"); + g_assert (g_app_info_should_show (appinfo)); + g_object_unref (appinfo); + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test-gnome.desktop"); + g_assert (g_app_info_should_show (appinfo)); + g_object_unref (appinfo); + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test-notgnome.desktop"); + g_assert (!g_app_info_should_show (appinfo)); + g_object_unref (appinfo); +} + +static void +test_commandline (void) +{ + GAppInfo *appinfo; + GError *error; + + error = NULL; + appinfo = g_app_info_create_from_commandline ("./appinfo-test --option", + "cmdline-app-test", + G_APP_INFO_CREATE_SUPPORTS_URIS, + &error); + g_assert (appinfo != NULL); + g_assert_no_error (error); + g_assert_cmpstr (g_app_info_get_name (appinfo), ==, "cmdline-app-test"); + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, "./appinfo-test --option %u"); + g_assert (g_app_info_supports_uris (appinfo)); + g_assert (!g_app_info_supports_files (appinfo)); + + g_object_unref (appinfo); + + error = NULL; + appinfo = g_app_info_create_from_commandline ("./appinfo-test --option", + "cmdline-app-test", + G_APP_INFO_CREATE_NONE, + &error); + g_assert (appinfo != NULL); + g_assert_no_error (error); + g_assert_cmpstr (g_app_info_get_name (appinfo), ==, "cmdline-app-test"); + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, "./appinfo-test --option %f"); + g_assert (!g_app_info_supports_uris (appinfo)); + g_assert (g_app_info_supports_files (appinfo)); + + g_object_unref (appinfo); +} + +static void +test_launch_context (void) +{ + GAppLaunchContext *context; + GAppInfo *appinfo; + gchar *str; + + context = g_app_launch_context_new (); + appinfo = g_app_info_create_from_commandline ("./appinfo-test --option", + "cmdline-app-test", + G_APP_INFO_CREATE_SUPPORTS_URIS, + NULL); + + str = g_app_launch_context_get_display (context, appinfo, NULL); + g_assert (str == NULL); + + str = g_app_launch_context_get_startup_notify_id (context, appinfo, NULL); + g_assert (str == NULL); + + g_object_unref (appinfo); + g_object_unref (context); +} + +static void +test_tryexec (void) +{ + GAppInfo *appinfo; + + appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (SRCDIR "/appinfo-test2.desktop"); + + g_assert (appinfo == NULL); +} + +/* Test that we can set an appinfo as default for a mime type or + * file extension, and also add and remove handled mime types. + */ +static void +test_associations (void) +{ + GAppInfo *appinfo; + GAppInfo *appinfo2; + GError *error; + gboolean result; + GList *list; + + appinfo = g_app_info_create_from_commandline ("./appinfo-test --option", + "cmdline-app-test", + G_APP_INFO_CREATE_SUPPORTS_URIS, + NULL); + + error = NULL; + result = g_app_info_set_as_default_for_type (appinfo, "application/x-glib-test", &error); + + g_assert (result); + g_assert_no_error (error); + + appinfo2 = g_app_info_get_default_for_type ("application/x-glib-test", FALSE); + + g_assert (appinfo2); + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, g_app_info_get_commandline (appinfo2)); + + g_object_unref (appinfo2); + + result = g_app_info_set_as_default_for_extension (appinfo, "gio-tests", &error); + g_assert (result); + g_assert_no_error (error); + + appinfo2 = g_app_info_get_default_for_type ("application/x-extension-gio-tests", FALSE); + + g_assert (appinfo2); + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, g_app_info_get_commandline (appinfo2)); + + g_object_unref (appinfo2); + + result = g_app_info_add_supports_type (appinfo, "application/x-gio-test", &error); + g_assert (result); + g_assert_no_error (error); + + list = g_app_info_get_all_for_type ("application/x-gio-test"); + g_assert_cmpint (g_list_length (list), ==, 1); + appinfo2 = list->data; + g_assert_cmpstr (g_app_info_get_commandline (appinfo), ==, g_app_info_get_commandline (appinfo2)); + g_object_unref (appinfo2); + g_list_free (list); + + g_assert (g_app_info_can_remove_supports_type (appinfo)); + g_assert (g_app_info_remove_supports_type (appinfo, "application/x-gio-test", &error)); + g_assert_no_error (error); + + g_assert (g_app_info_can_delete (appinfo)); + g_assert (g_app_info_delete (appinfo)); + g_object_unref (appinfo); +} + +int +main (int argc, char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/appinfo/basic", test_basic); + g_test_add_func ("/appinfo/text", test_text); + g_test_add_func ("/appinfo/launch", test_launch); + g_test_add_func ("/appinfo/show-in", test_show_in); + g_test_add_func ("/appinfo/commandline", test_commandline); + g_test_add_func ("/appinfo/launch-context", test_launch_context); + g_test_add_func ("/appinfo/tryexec", test_tryexec); + g_test_add_func ("/appinfo/associations", test_associations); + + return g_test_run (); +} + diff --git a/gio/tests/async-close-output-stream.c b/gio/tests/async-close-output-stream.c new file mode 100644 index 0000000..c4a6c2e --- /dev/null +++ b/gio/tests/async-close-output-stream.c @@ -0,0 +1,286 @@ +/* GLib testing framework examples and tests + * Authors: Jesse van den Kieboom + * + * This work is provided "as is"; redistribution and modification + * in whole or in part, in any medium, physical or electronic is + * permitted without restriction. + * + * This work is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * In no event shall the authors or contributors be liable for any + * direct, indirect, incidental, special, exemplary, or consequential + * damages (including, but not limited to, procurement of substitute + * goods or services; loss of use, data, or profits; or business + * interruption) however caused and on any theory of liability, whether + * in contract, strict liability, or tort (including negligence or + * otherwise) arising in any way out of the use of this software, even + * if advised of the possibility of such damage. + */ + +#include +#include +#include +#include + +#define DATA_TO_WRITE "Hello world\n" + +typedef struct +{ + GOutputStream *conv_stream; + GOutputStream *data_stream; + gchar *expected_output; + gsize expected_size; + GMainLoop *main_loop; +} SetupData; + +static void +create_streams (SetupData *data) +{ + GConverter *converter; + + converter = G_CONVERTER (g_zlib_compressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP, -1)); + + data->data_stream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); + data->conv_stream = g_converter_output_stream_new (data->data_stream, + converter); + + g_object_unref (converter); +} + +static void +destroy_streams (SetupData *data) +{ + g_object_unref (data->data_stream); + g_object_unref (data->conv_stream); +} + +static void +write_data_to_stream (SetupData *data) +{ + gsize bytes_written; + GError *error = NULL; + + /* just write the data synchronously */ + g_output_stream_write_all (data->conv_stream, + DATA_TO_WRITE, + sizeof (DATA_TO_WRITE), + &bytes_written, + NULL, + &error); + + g_assert_no_error (error); + g_assert_cmpint (sizeof (DATA_TO_WRITE), ==, bytes_written); +} + +static void +setup_data (SetupData *data, + gconstpointer user_data) +{ + data->main_loop = g_main_loop_new (NULL, FALSE); + create_streams (data); +} + +static void +teardown_data (SetupData *data, + gconstpointer user_data) +{ + /* cleanup */ + g_main_loop_unref (data->main_loop); + + destroy_streams (data); + + g_free (data->expected_output); +} + +static void +compare_output (SetupData *data) +{ + gsize size; + gpointer written; + + size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream)); + + /* compare the size of the data */ + g_assert_cmpint (size, ==, data->expected_size); + + written = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (data->data_stream)); + + /* compare the data itself */ + g_assert (memcmp (written, data->expected_output, size) == 0); +} + +static void +async_close_ready (GOutputStream *stream, + GAsyncResult *result, + SetupData *data) +{ + GError *error = NULL; + + /* finish the close */ + g_output_stream_close_finish (stream, result, &error); + + g_assert_no_error (error); + + /* compare the output with the desired output */ + compare_output (data); + + g_main_loop_quit (data->main_loop); +} + +static void +prepare_data (SetupData *data, + gboolean manual_flush) +{ + GError *error = NULL; + gpointer written; + + write_data_to_stream (data); + + if (manual_flush) + { + g_output_stream_flush (data->conv_stream, NULL, &error); + g_assert_no_error (error); + } + + g_output_stream_close (data->conv_stream, NULL, &error); + + g_assert_no_error (error); + + written = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (data->data_stream)); + + data->expected_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream)); + + g_assert_cmpint (data->expected_size, >, 0); + + data->expected_output = g_memdup (written, (guint)data->expected_size); + + /* then recreate the streams and prepare them for the asynchronous close */ + destroy_streams (data); + create_streams (data); + + write_data_to_stream (data); +} + +static void +test_without_flush (SetupData *data, + gconstpointer user_data) +{ + prepare_data (data, FALSE); + + g_test_bug ("617937"); + + /* just close asynchronously */ + g_output_stream_close_async (data->conv_stream, + G_PRIORITY_DEFAULT, + NULL, + (GAsyncReadyCallback)async_close_ready, + data); + + g_main_loop_run (data->main_loop); +} + +static void +test_with_flush (SetupData *data, gconstpointer user_data) +{ + GError *error = NULL; + + g_test_bug ("617937"); + + prepare_data (data, TRUE); + + g_output_stream_flush (data->conv_stream, NULL, &error); + + g_assert_no_error (error); + + /* then close asynchronously */ + g_output_stream_close_async (data->conv_stream, + G_PRIORITY_DEFAULT, + NULL, + (GAsyncReadyCallback)async_close_ready, + data); + + g_main_loop_run (data->main_loop); +} + +static void +async_flush_ready (GOutputStream *stream, + GAsyncResult *result, + SetupData *data) +{ + GError *error = NULL; + + g_output_stream_flush_finish (stream, result, &error); + + g_assert_no_error (error); + + /* then close async after the flush */ + g_output_stream_close_async (data->conv_stream, + G_PRIORITY_DEFAULT, + NULL, + (GAsyncReadyCallback)async_close_ready, + data); +} + +static void +test_with_async_flush (SetupData *data, + gconstpointer user_data) +{ + g_test_bug ("617937"); + + prepare_data (data, TRUE); + + /* first flush async */ + g_output_stream_flush_async (data->conv_stream, + G_PRIORITY_DEFAULT, + NULL, + (GAsyncReadyCallback)async_flush_ready, + data); + + g_main_loop_run (data->main_loop); +} + +int +main (int argc, + char *argv[]) +{ + SetupData *data; + + g_type_init (); + g_thread_init (NULL); + + g_test_init (&argc, &argv, NULL); + + g_test_bug_base ("http://bugzilla.gnome.org/"); + + data = g_slice_new (SetupData); + + /* test closing asynchronously without flushing manually */ + g_test_add ("/close-async/without-flush", + SetupData, + data, + setup_data, + test_without_flush, + teardown_data); + + /* test closing asynchronously with a synchronous manually flush */ + g_test_add ("/close-async/with-flush", + SetupData, + data, + setup_data, + test_with_flush, + teardown_data); + + /* test closing asynchronously with an asynchronous manually flush */ + g_test_add ("/close-async/with-async-flush", + SetupData, + data, + setup_data, + test_with_async_flush, + teardown_data); + + g_slice_free (SetupData, data); + + return g_test_run(); +} diff --git a/gio/tests/buffered-input-stream.c b/gio/tests/buffered-input-stream.c index 8d111e6..8515351 100644 --- a/gio/tests/buffered-input-stream.c +++ b/gio/tests/buffered-input-stream.c @@ -36,7 +36,10 @@ test_peek (void) base = g_memory_input_stream_new_from_data ("abcdefghijk", -1, NULL); in = g_buffered_input_stream_new_sized (base, 64); - g_buffered_input_stream_fill (G_BUFFERED_INPUT_STREAM (in), strlen ("abcdefghijk"), NULL, NULL); + g_buffered_input_stream_fill (G_BUFFERED_INPUT_STREAM (in), 5, NULL, NULL); + g_assert_cmpint (g_buffered_input_stream_get_available (G_BUFFERED_INPUT_STREAM (in)), ==, 5); + g_buffered_input_stream_fill (G_BUFFERED_INPUT_STREAM (in), -1, NULL, NULL); + g_assert_cmpint (g_buffered_input_stream_get_available (G_BUFFERED_INPUT_STREAM (in)), ==, strlen ("abcdefjhijk")); buffer = g_new0 (char, 64); npeek = g_buffered_input_stream_peek (G_BUFFERED_INPUT_STREAM (in), buffer, 2, 3); @@ -56,6 +59,7 @@ test_peek (void) g_free (buffer); g_object_unref (in); + g_object_unref (base); } static void @@ -76,6 +80,7 @@ test_peek_buffer (void) g_assert (0 == strncmp ("abcdefghijk", buffer, bufsize)); g_object_unref (in); + g_object_unref (base); } static void @@ -87,6 +92,8 @@ test_set_buffer_size (void) base = g_memory_input_stream_new_from_data ("abcdefghijk", -1, NULL); in = g_buffered_input_stream_new (base); + size = g_buffered_input_stream_get_buffer_size (G_BUFFERED_INPUT_STREAM (in)); + g_assert_cmpint (size, ==, 4096); g_buffered_input_stream_set_buffer_size (G_BUFFERED_INPUT_STREAM (in), 64); size = g_buffered_input_stream_get_buffer_size (G_BUFFERED_INPUT_STREAM (in)); @@ -98,8 +105,17 @@ test_set_buffer_size (void) g_buffered_input_stream_set_buffer_size (G_BUFFERED_INPUT_STREAM (in), 2); size = g_buffered_input_stream_get_buffer_size (G_BUFFERED_INPUT_STREAM (in)); g_assert_cmpint (size, ==, bufsize); + g_object_get (in, "buffer-size", &size, NULL); + g_assert_cmpint (size, ==, bufsize); + + g_object_unref (in); + + in = g_buffered_input_stream_new_sized (base, 64); + size = g_buffered_input_stream_get_buffer_size (G_BUFFERED_INPUT_STREAM (in)); + g_assert_cmpint (size, ==, 64); g_object_unref (in); + g_object_unref (base); } static void @@ -107,21 +123,164 @@ test_read_byte (void) { GInputStream *base; GInputStream *in; + GError *error; g_test_bug ("562393"); - base = g_memory_input_stream_new_from_data ("abcdefghijk", -1, NULL); + base = g_memory_input_stream_new_from_data ("abcdefgh", -1, NULL); + in = g_buffered_input_stream_new (base); + + error = NULL; + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'a'); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'b'); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'c'); + g_assert_no_error (error); + + g_assert_cmpint (g_input_stream_skip (in, 3, NULL, &error), ==, 3); + g_assert_no_error (error); + + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'g'); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'h'); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, -1); + g_assert_no_error (error); + + g_assert (g_input_stream_close (in, NULL, &error)); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, -1); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED); + g_error_free (error); + + g_object_unref (in); + g_object_unref (base); +} + +static void +test_read (void) +{ + GInputStream *base; + GInputStream *in; + gchar buffer[20]; + GError *error; + + base = g_memory_input_stream_new_from_data ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, NULL); + in = g_buffered_input_stream_new_sized (base, 8); + + g_assert_cmpint (g_buffered_input_stream_get_available (G_BUFFERED_INPUT_STREAM (in)), ==, 0); + + error = NULL; + g_assert_cmpint (g_buffered_input_stream_fill (G_BUFFERED_INPUT_STREAM (in), 8, NULL, &error), ==, 8); + g_assert_no_error (error); + + g_assert_cmpint (g_buffered_input_stream_get_available (G_BUFFERED_INPUT_STREAM (in)), ==, 8); + + memset (buffer, 0, 20); + g_assert_cmpint (g_input_stream_read (in, &buffer, 16, NULL, &error), ==, 16); + g_assert_cmpstr (buffer, ==, "abcdefghijklmnop"); + g_assert_no_error (error); + + g_assert_cmpint (g_buffered_input_stream_get_available (G_BUFFERED_INPUT_STREAM (in)), ==, 0); + + memset (buffer, 0, 20); + g_assert_cmpint (g_input_stream_read (in, &buffer, 16, NULL, &error), ==, 16); + g_assert_cmpstr (buffer, ==, "qrstuvwxyzABCDEF"); + g_assert_no_error (error); + + memset (buffer, 0, 20); + g_assert_cmpint (g_input_stream_read (in, &buffer, 16, NULL, &error), ==, 16); + g_assert_cmpstr (buffer, ==, "GHIJKLMNOPQRSTUV"); + g_assert_no_error (error); + + memset (buffer, 0, 20); + g_assert_cmpint (g_input_stream_read (in, &buffer, 16, NULL, &error), ==, 4); + g_assert_cmpstr (buffer, ==, "WXYZ"); + g_assert_no_error (error); + + memset (buffer, 0, 20); + g_assert_cmpint (g_input_stream_read (in, &buffer, 16, NULL, &error), ==, 0); + g_assert_no_error (error); + + g_object_unref (in); + g_object_unref (base); +} + +static void +test_skip (void) +{ + GInputStream *base; + GInputStream *in; + GError *error; + + base = g_memory_input_stream_new_from_data ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVXYZ", -1, NULL); + in = g_buffered_input_stream_new_sized (base, 5); + + error = NULL; + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'a'); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'b'); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'c'); + g_assert_no_error (error); + + g_assert_cmpint (g_input_stream_skip (in, 7, NULL, &error), ==, 7); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'k'); + g_assert_no_error (error); + + g_assert_cmpint (g_input_stream_skip (in, 10, NULL, &error), ==, 10); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'v'); + g_assert_no_error (error); + + g_assert_cmpint (g_input_stream_skip (in, 20, NULL, &error), ==, 20); + g_assert_no_error (error); + g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error), ==, 'Q'); + g_assert_no_error (error); + + g_assert_cmpint (g_input_stream_skip (in, 10, NULL, &error), ==, 8); + g_assert_no_error (error); + g_assert_cmpint (g_input_stream_skip (in, 10, NULL, &error), ==, 0); + g_assert_no_error (error); + + g_object_unref (in); + g_object_unref (base); +} + +static void +test_close (void) +{ + GInputStream *base; + GInputStream *in; + GError *error; + + base = g_memory_input_stream_new_from_data ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVXYZ", -1, NULL); + in = g_buffered_input_stream_new (base); + + g_assert (g_filter_input_stream_get_close_base_stream (G_FILTER_INPUT_STREAM (in))); + + error = NULL; + g_assert (g_input_stream_close (in, NULL, &error)); + g_assert_no_error (error); + g_assert (g_input_stream_is_closed (base)); + + g_object_unref (in); + g_object_unref (base); + + base = g_memory_input_stream_new_from_data ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVXYZ", -1, NULL); in = g_buffered_input_stream_new (base); - g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, NULL), ==, 'a'); - g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, NULL), ==, 'b'); - g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, NULL), ==, 'c'); + g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (in), FALSE); - g_assert_cmpint (g_input_stream_skip (in, 3, NULL, NULL), ==, 3); - - g_assert_cmpint (g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, NULL), ==, 'g'); + error = NULL; + g_assert (g_input_stream_close (in, NULL, &error)); + g_assert_no_error (error); + g_assert (!g_input_stream_is_closed (base)); g_object_unref (in); + g_object_unref (base); } int @@ -136,6 +295,9 @@ main (int argc, g_test_add_func ("/buffered-input-stream/peek-buffer", test_peek_buffer); g_test_add_func ("/buffered-input-stream/set-buffer-size", test_set_buffer_size); g_test_add_func ("/buffered-input-stream/read-byte", test_read_byte); + g_test_add_func ("/buffered-input-stream/read", test_read); + g_test_add_func ("/buffered-input-stream/skip", test_skip); + g_test_add_func ("/filter-input-stream/close", test_close); return g_test_run(); } diff --git a/gio/tests/buffered-output-stream.c b/gio/tests/buffered-output-stream.c new file mode 100644 index 0000000..bb6159c --- /dev/null +++ b/gio/tests/buffered-output-stream.c @@ -0,0 +1,126 @@ +#include + +static void +test_write (void) +{ + GOutputStream *base; + GOutputStream *out; + GError *error; + const gchar buffer[] = "abcdefghijklmnopqrstuvwxyz"; + + base = g_memory_output_stream_new (g_malloc0 (20), 20, g_realloc, g_free); + out = g_buffered_output_stream_new (base); + + g_assert_cmpint (g_buffered_output_stream_get_buffer_size (G_BUFFERED_OUTPUT_STREAM (out)), ==, 4096); + g_assert (!g_buffered_output_stream_get_auto_grow (G_BUFFERED_OUTPUT_STREAM (out))); + g_buffered_output_stream_set_buffer_size (G_BUFFERED_OUTPUT_STREAM (out), 16); + g_assert_cmpint (g_buffered_output_stream_get_buffer_size (G_BUFFERED_OUTPUT_STREAM (out)), ==, 16); + + error = NULL; + g_assert_cmpint (g_output_stream_write (out, buffer, 10, NULL, &error), ==, 10); + g_assert_no_error (error); + + g_assert_cmpint (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (base)), ==, 0); + + g_assert_cmpint (g_output_stream_write (out, buffer + 10, 10, NULL, &error), ==, 6); + g_assert_no_error (error); + + g_assert_cmpint (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (base)), ==, 0); + g_assert (g_output_stream_flush (out, NULL, &error)); + g_assert_no_error (error); + g_assert_cmpint (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (base)), ==, 16); + + g_assert_cmpstr (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (base)), ==, "abcdefghijklmnop"); + + g_object_unref (out); + g_object_unref (base); +} + +static void +test_grow (void) +{ + GOutputStream *base; + GOutputStream *out; + GError *error; + const gchar buffer[] = "abcdefghijklmnopqrstuvwxyz"; + gint size; + gboolean grow; + + base = g_memory_output_stream_new (g_malloc0 (30), 30, g_realloc, g_free); + out = g_buffered_output_stream_new_sized (base, 16); + + g_buffered_output_stream_set_auto_grow (G_BUFFERED_OUTPUT_STREAM (out), TRUE); + + g_object_get (out, "buffer-size", &size, "auto-grow", &grow, NULL); + g_assert_cmpint (size, ==, 16); + g_assert (grow); + + error = NULL; + g_assert_cmpint (g_output_stream_write (out, buffer, 10, NULL, &error), ==, 10); + g_assert_no_error (error); + + g_assert_cmpint (g_buffered_output_stream_get_buffer_size (G_BUFFERED_OUTPUT_STREAM (out)), ==, 16); + g_assert_cmpint (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (base)), ==, 0); + + g_assert_cmpint (g_output_stream_write (out, buffer + 10, 10, NULL, &error), ==, 10); + g_assert_no_error (error); + + g_assert_cmpint (g_buffered_output_stream_get_buffer_size (G_BUFFERED_OUTPUT_STREAM (out)), >=, 20); + g_assert_cmpint (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (base)), ==, 0); + + g_assert (g_output_stream_flush (out, NULL, &error)); + g_assert_no_error (error); + + g_assert_cmpstr (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (base)), ==, "abcdefghijklmnopqrst"); + + g_object_unref (out); + g_object_unref (base); +} + +static void +test_close (void) +{ + GOutputStream *base; + GOutputStream *out; + GError *error; + + base = g_memory_output_stream_new (g_malloc0 (30), 30, g_realloc, g_free); + out = g_buffered_output_stream_new (base); + + g_assert (g_filter_output_stream_get_close_base_stream (G_FILTER_OUTPUT_STREAM (out))); + + error = NULL; + g_assert (g_output_stream_close (out, NULL, &error)); + g_assert_no_error (error); + g_assert (g_output_stream_is_closed (base)); + + g_object_unref (out); + g_object_unref (base); + + base = g_memory_output_stream_new (g_malloc0 (30), 30, g_realloc, g_free); + out = g_buffered_output_stream_new (base); + + g_filter_output_stream_set_close_base_stream (G_FILTER_OUTPUT_STREAM (out), FALSE); + + error = NULL; + g_assert (g_output_stream_close (out, NULL, &error)); + g_assert_no_error (error); + g_assert (!g_output_stream_is_closed (base)); + + g_object_unref (out); + g_object_unref (base); +} + +int +main (int argc, char *argv[]) +{ + g_type_init (); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/buffered-output-stream/write", test_write); + g_test_add_func ("/buffered-output-stream/grow", test_grow); + g_test_add_func ("/filter-output-stream/close", test_close); + + return g_test_run (); +} diff --git a/gio/tests/contenttype.c b/gio/tests/contenttype.c new file mode 100644 index 0000000..db31ba1 --- /dev/null +++ b/gio/tests/contenttype.c @@ -0,0 +1,132 @@ +#include + +static void +test_guess (void) +{ + gchar *res; + gchar *expected; + gboolean uncertain; + + res = g_content_type_guess ("/etc/", NULL, 0, &uncertain); + expected = g_content_type_from_mime_type ("inode/directory"); + g_assert (g_content_type_equals (expected, res)); + g_free (res); + g_free (expected); + + res = g_content_type_guess ("foo.txt", NULL, 0, &uncertain); + expected = g_content_type_from_mime_type ("text/plain"); + g_assert (g_content_type_equals (expected, res)); + g_free (res); + g_free (expected); +} + +static void +test_unknown (void) +{ + gchar *unknown; + gchar *str; + + unknown = g_content_type_from_mime_type ("application/octet-stream"); + g_assert (g_content_type_is_unknown (unknown)); + str = g_content_type_get_mime_type (unknown); + g_assert_cmpstr (str, ==, "application/octet-stream"); + g_free (str); + g_free (unknown); +} + +static void +test_subtype (void) +{ + gchar *plain; + gchar *xml; + + plain = g_content_type_from_mime_type ("text/plain"); + xml = g_content_type_from_mime_type ("application/xml"); + + g_assert (g_content_type_is_a (xml, plain)); + + g_free (plain); + g_free (xml); +} + +static gint +find_mime (gconstpointer a, gconstpointer b) +{ + if (g_content_type_equals (a, b)) + return 0; + return 1; +} + +static void +test_list (void) +{ + GList *types; + gchar *plain; + gchar *xml; + + plain = g_content_type_from_mime_type ("text/plain"); + xml = g_content_type_from_mime_type ("application/xml"); + + types = g_content_types_get_registered (); + + g_assert (g_list_length (types) > 1); + + /* just check that some types are in the list */ + g_assert (g_list_find_custom (types, plain, find_mime) != NULL); + g_assert (g_list_find_custom (types, xml, find_mime) != NULL); + + g_list_foreach (types, (GFunc)g_free, NULL); + g_list_free (types); + + g_free (plain); + g_free (xml); +} + +static void +test_executable (void) +{ + gchar *type; + + type = g_content_type_from_mime_type ("application/x-executable"); + g_assert (g_content_type_can_be_executable (type)); + g_free (type); + + type = g_content_type_from_mime_type ("text/plain"); + g_assert (g_content_type_can_be_executable (type)); + g_free (type); + + type = g_content_type_from_mime_type ("image/png"); + g_assert (!g_content_type_can_be_executable (type)); + g_free (type); +} + +static void +test_description (void) +{ + gchar *type; + gchar *desc; + + type = g_content_type_from_mime_type ("text/plain"); + desc = g_content_type_get_description (type); + g_assert (desc != NULL); + + g_free (desc); + g_free (type); +} + +int +main (int argc, char *argv[]) +{ + g_type_init (); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/contenttype/guess", test_guess); + g_test_add_func ("/contenttype/unknown", test_unknown); + g_test_add_func ("/contenttype/subtype", test_subtype); + g_test_add_func ("/contenttype/list", test_list); + g_test_add_func ("/contenttype/executable", test_executable); + g_test_add_func ("/contenttype/description", test_description); + + return g_test_run (); +} diff --git a/gio/tests/contexts.c b/gio/tests/contexts.c index 3fe16cb..5ddb54f 100644 --- a/gio/tests/contexts.c +++ b/gio/tests/contexts.c @@ -39,6 +39,8 @@ opened_for_read (GObject *source, GAsyncResult *result, gpointer loop) async_read_buffer, sizeof (async_read_buffer), G_PRIORITY_DEFAULT, NULL, read_data, loop); + + g_object_unref (in); } /* Test 1: Async I/O started in a thread with a thread-default context @@ -113,6 +115,7 @@ test1_thread (gpointer user_data) loop = g_main_loop_new (context, FALSE); g_file_read_async (file, G_PRIORITY_DEFAULT, NULL, opened_for_read, loop); + g_object_unref (file); g_main_loop_run (loop); g_main_loop_unref (loop); @@ -155,6 +158,7 @@ test_context_independence (void) loop = g_main_loop_new (context, FALSE); g_file_read_async (file, G_PRIORITY_DEFAULT, NULL, opened_for_read, loop); + g_object_unref (file); g_main_loop_run (loop); g_main_loop_unref (loop); diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c index f1e6edf..ceafed7 100644 --- a/gio/tests/converter-stream.c +++ b/gio/tests/converter-stream.c @@ -301,6 +301,7 @@ test_expander (void) GInputStream *mem, *cstream; GOutputStream *mem_out, *cstream_out; GConverter *expander; + GConverter *converter; GError *error; int i; @@ -325,6 +326,10 @@ test_expander (void) sizeof (unexpanded_data), NULL); cstream = g_converter_input_stream_new (mem, expander); + g_assert (g_converter_input_stream_get_converter (G_CONVERTER_INPUT_STREAM (cstream)) == expander); + g_object_get (cstream, "converter", &converter, NULL); + g_assert (converter == expander); + g_object_unref (converter); g_object_unref (mem); total_read = 0; @@ -349,6 +354,10 @@ test_expander (void) mem_out = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); cstream_out = g_converter_output_stream_new (mem_out, expander); + g_assert (g_converter_output_stream_get_converter (G_CONVERTER_OUTPUT_STREAM (cstream_out)) == expander); + g_object_get (cstream_out, "converter", &converter, NULL); + g_assert (converter == expander); + g_object_unref (converter); g_object_unref (mem_out); for (i = 0; i < sizeof(unexpanded_data); i++) @@ -493,6 +502,8 @@ test_compressor (void) g_assert (total_read == 1); g_assert (*converted == 5); + g_object_unref (cstream); + mem = g_memory_input_stream_new_from_data (expanded, 5*1000 * 2, NULL); @@ -539,6 +550,7 @@ test_compressor (void) if (res == -1) { g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PARTIAL_INPUT); + g_error_free (error); break; } @@ -561,7 +573,7 @@ test_compressor (void) #define DATA_LENGTH 1000000 static void -test_corruption (void) +test_corruption (GZlibCompressorFormat format, gint level) { GError *error = NULL; guint32 *data0, *data1; @@ -570,6 +582,8 @@ test_corruption (void) GInputStream *istream0, *istream1, *cistream1; GOutputStream *ostream1, *ostream2, *costream1; GConverter *compressor, *decompressor; + GZlibCompressorFormat fmt; + gint lvl; data0 = g_malloc (DATA_LENGTH * sizeof (guint32)); for (i = 0; i < DATA_LENGTH; i++) @@ -578,28 +592,32 @@ test_corruption (void) istream0 = g_memory_input_stream_new_from_data (data0, DATA_LENGTH * sizeof (guint32), NULL); - ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, NULL); - compressor = G_CONVERTER (g_zlib_compressor_new ( - G_ZLIB_COMPRESSOR_FORMAT_GZIP, -1)); + ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); + compressor = G_CONVERTER (g_zlib_compressor_new (format, level)); costream1 = g_converter_output_stream_new (ostream1, compressor); + g_assert (g_converter_output_stream_get_converter (G_CONVERTER_OUTPUT_STREAM (costream1)) == compressor); g_output_stream_splice (costream1, istream0, 0, NULL, &error); g_assert_no_error (error); g_object_unref (costream1); + + g_converter_reset (compressor); + g_object_get (compressor, "format", &fmt, "level", &lvl, NULL); + g_assert_cmpint (fmt, ==, format); + g_assert_cmpint (lvl, ==, level); g_object_unref (compressor); - data1 = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (ostream1)); + data1 = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (ostream1)); data1_size = g_memory_output_stream_get_data_size ( G_MEMORY_OUTPUT_STREAM (ostream1)); g_object_unref (ostream1); g_object_unref (istream0); - istream1 = g_memory_input_stream_new_from_data (data1, data1_size, NULL); - decompressor = G_CONVERTER (g_zlib_decompressor_new ( - G_ZLIB_COMPRESSOR_FORMAT_GZIP)); + istream1 = g_memory_input_stream_new_from_data (data1, data1_size, g_free); + decompressor = G_CONVERTER (g_zlib_decompressor_new (format)); cistream1 = g_converter_input_stream_new (istream1, decompressor); - ostream2 = g_memory_output_stream_new (NULL, 0, g_realloc, NULL); + ostream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); g_output_stream_splice (ostream2, cistream1, 0, NULL, &error); g_assert_no_error (error); @@ -608,19 +626,145 @@ test_corruption (void) g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (ostream2))); g_assert (memcmp (data0, g_memory_output_stream_get_data ( G_MEMORY_OUTPUT_STREAM (ostream2)), DATA_LENGTH * sizeof (guint32)) == 0); + g_object_unref (istream1); + g_converter_reset (decompressor); + g_object_get (decompressor, "format", &fmt, NULL); + g_assert_cmpint (fmt, ==, format); + g_object_unref (decompressor); + g_object_unref (cistream1); + g_object_unref (ostream2); + g_free (data0); +} + +typedef struct { + const gchar *path; + GZlibCompressorFormat format; + gint level; +} CompressorTest; + +static void +test_roundtrip (gconstpointer data) +{ + const CompressorTest *test = data; + + g_test_bug ("162549"); + + test_corruption (test->format, test->level); } +typedef struct { + const gchar *path; + const gchar *charset_in; + const gchar *text_in; + const gchar *charset_out; + const gchar *text_out; + gint n_fallbacks; +} CharsetTest; + +static void +test_charset (gconstpointer data) +{ + const CharsetTest *test = data; + GInputStream *in, *in2; + GConverter *conv; + gchar *buffer; + gsize count; + gsize bytes_read; + GError *error; + gboolean fallback; + + conv = (GConverter *)g_charset_converter_new (test->charset_out, test->charset_in, NULL); + g_object_get (conv, "use-fallback", &fallback, NULL); + g_assert (!fallback); + + in = g_memory_input_stream_new_from_data (test->text_in, -1, NULL); + in2 = g_converter_input_stream_new (in, conv); + + count = 2 * strlen (test->text_out); + buffer = g_malloc0 (count); + error = NULL; + g_input_stream_read_all (in2, buffer, count, &bytes_read, NULL, &error); + if (test->n_fallbacks == 0) + { + g_assert_no_error (error); + g_assert_cmpint (bytes_read, ==, strlen (test->text_out)); + g_assert_cmpstr (buffer, ==, test->text_out); + } + else + { + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA); + g_error_free (error); + } + + g_free (buffer); + g_object_unref (in2); + g_object_unref (in); + + if (test->n_fallbacks == 0) + { + g_object_unref (conv); + return; + } + + g_converter_reset (conv); + + g_assert (!g_charset_converter_get_use_fallback (G_CHARSET_CONVERTER (conv))); + g_charset_converter_set_use_fallback (G_CHARSET_CONVERTER (conv), TRUE); + + in = g_memory_input_stream_new_from_data (test->text_in, -1, NULL); + in2 = g_converter_input_stream_new (in, conv); + + count = 2 * strlen (test->text_out); + buffer = g_malloc0 (count); + error = NULL; + g_input_stream_read_all (in2, buffer, count, &bytes_read, NULL, &error); + g_assert_no_error (error); + g_assert_cmpstr (buffer, ==, test->text_out); + g_assert_cmpint (bytes_read, ==, strlen (test->text_out)); + g_assert_cmpint (test->n_fallbacks, ==, g_charset_converter_get_num_fallbacks (G_CHARSET_CONVERTER (conv))); + + g_free (buffer); + g_object_unref (in2); + g_object_unref (in); + + g_object_unref (conv); +} int main (int argc, char *argv[]) { + CompressorTest compressor_tests[] = { + { "/converter-output-stream/corruption/zlib-0", G_ZLIB_COMPRESSOR_FORMAT_ZLIB, 0 }, + { "/converter-output-stream/corruption/zlib-9", G_ZLIB_COMPRESSOR_FORMAT_ZLIB, 9 }, + { "/converter-output-stream/corruption/gzip-0", G_ZLIB_COMPRESSOR_FORMAT_GZIP, 0 }, + { "/converter-output-stream/corruption/gzip-9", G_ZLIB_COMPRESSOR_FORMAT_GZIP, 9 }, + { "/converter-output-stream/corruption/raw-0", G_ZLIB_COMPRESSOR_FORMAT_RAW, 0 }, + { "/converter-output-stream/corruption/raw-9", G_ZLIB_COMPRESSOR_FORMAT_RAW, 9 }, + }; + CharsetTest charset_tests[] = { + { "/converter-input-stream/charset/utf8->latin1", "UTF-8", "\303\205rr Sant\303\251", "ISO-8859-1", "\305rr Sant\351", 0 }, + { "/converter-input-stream/charset/latin1->utf8", "ISO-8859-1", "\305rr Sant\351", "UTF-8", "\303\205rr Sant\303\251", 0 }, + { "/converter-input-stream/charset/fallbacks", "UTF-8", "Some characters just don't fit into latin1: πא", "ISO-8859-1", "Some characters just don't fit into latin1: \\CF\\80\\D7\\90", 4 }, + + }; + + gint i; + g_type_init (); g_test_init (&argc, &argv, NULL); + g_test_bug_base ("http://bugzilla.gnome.org/"); + g_test_add_func ("/converter-input-stream/expander", test_expander); g_test_add_func ("/converter-input-stream/compressor", test_compressor); - g_test_add_func ("/converter-output-stream/corruption", test_corruption); + + for (i = 0; i < G_N_ELEMENTS (compressor_tests); i++) + g_test_add_data_func (compressor_tests[i].path, &compressor_tests[i], test_roundtrip); + + for (i = 0; i < G_N_ELEMENTS (charset_tests); i++) + g_test_add_data_func (charset_tests[i].path, &charset_tests[i], test_charset); + return g_test_run(); } diff --git a/gio/tests/data-input-stream.c b/gio/tests/data-input-stream.c index 368866e..1a34205 100644 --- a/gio/tests/data-input-stream.c +++ b/gio/tests/data-input-stream.c @@ -29,6 +29,30 @@ #define MAX_BYTES 0x10000 static void +test_basic (void) +{ + GInputStream *stream; + GInputStream *base_stream; + gint val; + + base_stream = g_memory_input_stream_new (); + stream = G_INPUT_STREAM (g_data_input_stream_new (base_stream)); + + g_object_get (stream, "byte-order", &val, NULL); + g_assert_cmpint (val, ==, G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN); + g_object_set (stream, "byte-order", G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN, NULL); + g_assert_cmpint (g_data_input_stream_get_byte_order (G_DATA_INPUT_STREAM (stream)), ==, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); + + g_object_get (stream, "newline-type", &val, NULL); + g_assert_cmpint (val, ==, G_DATA_STREAM_NEWLINE_TYPE_LF); + g_object_set (stream, "newline-type", G_DATA_STREAM_NEWLINE_TYPE_CR_LF, NULL); + g_assert_cmpint (g_data_input_stream_get_newline_type (G_DATA_INPUT_STREAM (stream)), ==, G_DATA_STREAM_NEWLINE_TYPE_CR_LF); + + g_object_unref (stream); + g_object_unref (base_stream); +} + +static void test_seek_to_start (GInputStream *stream) { GError *error = NULL; @@ -72,7 +96,7 @@ test_read_lines (GDataStreamNewlineType newline_type) /* Add sample data */ for (i = 0; i < MAX_LINES; i++) g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (base_stream), - g_strconcat (lines[i], endl[newline_type], NULL), -1, NULL); + g_strconcat (lines[i], endl[newline_type], NULL), -1, g_free); /* Seek to the start */ test_seek_to_start (base_stream); @@ -88,9 +112,12 @@ test_read_lines (GDataStreamNewlineType newline_type) if (data) { g_assert_cmpstr (data, ==, lines[line]); + g_free (data); g_assert_no_error (error); line++; } + if (error) + g_error_free (error); } g_assert_cmpint (line, ==, MAX_LINES); @@ -117,6 +144,11 @@ test_read_lines_CR_LF (void) test_read_lines (G_DATA_STREAM_NEWLINE_TYPE_CR_LF); } +static void +test_read_lines_any (void) +{ + test_read_lines (G_DATA_STREAM_NEWLINE_TYPE_ANY); +} static void test_read_until (void) @@ -132,7 +164,8 @@ test_read_until (void) #define DATA_STRING " part1 # part2 $ part3 % part4 ^" #define DATA_PART_LEN 7 /* number of characters between separators */ #define DATA_SEP "#$%^" - const int DATA_PARTS_NUM = strlen (DATA_SEP) * REPEATS; +#define DATA_SEP_LEN 4 + const int DATA_PARTS_NUM = DATA_SEP_LEN * REPEATS; base_stream = g_memory_input_stream_new (); stream = G_INPUT_STREAM (g_data_input_stream_new (base_stream)); @@ -151,18 +184,72 @@ test_read_until (void) if (data) { g_assert_cmpint (strlen (data), ==, DATA_PART_LEN); + g_free (data); g_assert_no_error (error); line++; } } g_assert_no_error (error); g_assert_cmpint (line, ==, DATA_PARTS_NUM); - - + g_object_unref (base_stream); g_object_unref (stream); } +static void +test_read_upto (void) +{ + GInputStream *stream; + GInputStream *base_stream; + GError *error = NULL; + char *data; + int line; + int i; + guchar stop_char; + +#undef REPEATS +#undef DATA_STRING +#undef DATA_PART_LEN +#undef DATA_SEP +#undef DATA_SEP_LEN +#define REPEATS 10 /* number of rounds */ +#define DATA_STRING " part1 # part2 $ part3 \0 part4 ^" +#define DATA_PART_LEN 7 /* number of characters between separators */ +#define DATA_SEP "#$\0^" +#define DATA_SEP_LEN 4 + const int DATA_PARTS_NUM = DATA_SEP_LEN * REPEATS; + + base_stream = g_memory_input_stream_new (); + stream = G_INPUT_STREAM (g_data_input_stream_new (base_stream)); + + for (i = 0; i < REPEATS; i++) + g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (base_stream), DATA_STRING, 32, NULL); + + /* Test stop characters */ + error = NULL; + data = (char*)1; + line = 0; + while (data) + { + gsize length = -1; + data = g_data_input_stream_read_upto (G_DATA_INPUT_STREAM (stream), DATA_SEP, DATA_SEP_LEN, &length, NULL, &error); + if (data) + { + g_assert_cmpint (strlen (data), ==, DATA_PART_LEN); + g_assert_no_error (error); + line++; + + stop_char = g_data_input_stream_read_byte (G_DATA_INPUT_STREAM (stream), NULL, &error); + g_assert (memchr (DATA_SEP, stop_char, DATA_SEP_LEN) != NULL); + g_assert_no_error (error); + } + } + g_assert_no_error (error); + g_assert_cmpint (line, ==, DATA_PARTS_NUM); + + g_object_unref (base_stream); + g_object_unref (stream); +} enum TestDataType { TEST_DATA_BYTE = 0, TEST_DATA_INT16, @@ -267,13 +354,15 @@ test_data_array (GInputStream *stream, GInputStream *base_stream, g_assert_not_reached (); break; } - if ((data) && (! error)) + if (!error) g_assert_cmpint (data, ==, TEST_DATA_RETYPE_BUFF(data_type, gint64, ((guchar*)buffer + pos))); pos += data_size; } if (pos < len + 1) g_assert_no_error (error); + if (error) + g_error_free (error); g_assert_cmpint (pos - data_size, ==, len); } @@ -326,10 +415,13 @@ main (int argc, g_type_init (); g_test_init (&argc, &argv, NULL); + g_test_add_func ("/data-input-stream/basic", test_basic); g_test_add_func ("/data-input-stream/read-lines-LF", test_read_lines_LF); g_test_add_func ("/data-input-stream/read-lines-CR", test_read_lines_CR); g_test_add_func ("/data-input-stream/read-lines-CR-LF", test_read_lines_CR_LF); + g_test_add_func ("/data-input-stream/read-lines-any", test_read_lines_any); g_test_add_func ("/data-input-stream/read-until", test_read_until); + g_test_add_func ("/data-input-stream/read-upto", test_read_upto); g_test_add_func ("/data-input-stream/read-int", test_read_int); return g_test_run(); diff --git a/gio/tests/data-output-stream.c b/gio/tests/data-output-stream.c index 0172389..a97201e 100644 --- a/gio/tests/data-output-stream.c +++ b/gio/tests/data-output-stream.c @@ -30,6 +30,30 @@ #define MAX_BYTES_BINARY 0x100 static void +test_basic (void) +{ + GOutputStream *stream; + GOutputStream *base_stream; + gpointer data; + gint val; + + data = g_malloc0 (MAX_LINES_BUFF); + + /* initialize objects */ + base_stream = g_memory_output_stream_new (data, MAX_LINES_BUFF, NULL, NULL); + stream = G_OUTPUT_STREAM (g_data_output_stream_new (base_stream)); + + g_object_get (stream, "byte-order", &val, NULL); + g_assert_cmpint (val, ==, G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN); + g_object_set (stream, "byte-order", G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN, NULL); + g_assert_cmpint (g_data_output_stream_get_byte_order (G_DATA_OUTPUT_STREAM (stream)), ==, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); + + g_object_unref (stream); + g_object_unref (base_stream); + g_free (data); +} + +static void test_read_lines (GDataStreamNewlineType newline_type) { GOutputStream *stream; @@ -62,6 +86,7 @@ test_read_lines (GDataStreamNewlineType newline_type) g_stpcpy ((char*)(lines + i*strlen(s)), s); g_assert_no_error (error); g_assert (res == TRUE); + g_free (s); } /* Byte order testing */ @@ -280,10 +305,11 @@ main (int argc, g_type_init (); g_test_init (&argc, &argv, NULL); - g_test_add_func ("/data-input-stream/read-lines-LF", test_read_lines_LF); - g_test_add_func ("/data-input-stream/read-lines-CR", test_read_lines_CR); - g_test_add_func ("/data-input-stream/read-lines-CR-LF", test_read_lines_CR_LF); - g_test_add_func ("/data-input-stream/read-int", test_read_int); + g_test_add_func ("/data-output-stream/basic", test_basic); + g_test_add_func ("/data-output-stream/write-lines-LF", test_read_lines_LF); + g_test_add_func ("/data-output-stream/write-lines-CR", test_read_lines_CR); + g_test_add_func ("/data-output-stream/write-lines-CR-LF", test_read_lines_CR_LF); + g_test_add_func ("/data-output-stream/write-int", test_read_int); return g_test_run(); } diff --git a/gio/tests/de.po b/gio/tests/de.po new file mode 100644 index 0000000..eed161c --- /dev/null +++ b/gio/tests/de.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: \n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +msgid "\"Unnamed\"" +msgstr "\"Unbenannt\"" + +msgctxt "keyboard label" +msgid "\"BackSpace\"" +msgstr "\"Löschen\"" diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c index 62ccd03..b9ae777 100644 --- a/gio/tests/desktop-app-info.c +++ b/gio/tests/desktop-app-info.c @@ -175,6 +175,124 @@ test_default (void) } static void +test_fallback (void) +{ + GAppInfo *info1, *info2, *app; + GList *apps, *recomm, *fallback, *list, *l, *m; + GError *error = NULL; + gint old_length; + + info1 = create_app_info ("Test1"); + info2 = create_app_info ("Test2"); + + g_assert (g_content_type_is_a ("text/x-python", "text/plain")); + + apps = g_app_info_get_all_for_type ("text/x-python"); + old_length = g_list_length (apps); + g_list_free_full (apps, g_object_unref); + + g_app_info_set_as_default_for_type (info1, "text/x-python", &error); + g_assert (error == NULL); + + g_app_info_set_as_default_for_type (info2, "text/plain", &error); + g_assert (error == NULL); + + /* check that both apps are registered */ + apps = g_app_info_get_all_for_type ("text/x-python"); + g_assert (g_list_length (apps) == old_length + 2); + + /* check the ordering */ + app = g_list_nth_data (apps, 0); + g_assert (g_app_info_equal (info1, app)); + + /* check that Test1 is the first recommended app */ + recomm = g_app_info_get_recommended_for_type ("text/x-python"); + g_assert (recomm != NULL); + app = g_list_nth_data (recomm, 0); + g_assert (g_app_info_equal (info1, app)); + + /* and that Test2 is the first fallback */ + fallback = g_app_info_get_fallback_for_type ("text/x-python"); + g_assert (fallback != NULL); + app = g_list_nth_data (fallback, 0); + g_assert (g_app_info_equal (info2, app)); + + /* check that recomm + fallback = all applications */ + list = g_list_concat (g_list_copy (recomm), g_list_copy (fallback)); + g_assert (g_list_length (list) == g_list_length (apps)); + + for (l = list, m = apps; l != NULL && m != NULL; l = l->next, m = m->next) + { + g_assert (g_app_info_equal (l->data, m->data)); + } + + g_list_free (list); + + g_list_free_full (apps, g_object_unref); + g_list_free_full (recomm, g_object_unref); + g_list_free_full (fallback, g_object_unref); + + g_app_info_reset_type_associations ("text/x-python"); + g_app_info_reset_type_associations ("text/plain"); + + g_app_info_delete (info1); + g_app_info_delete (info2); + + g_object_unref (info1); + g_object_unref (info2); +} + +static void +test_last_used (void) +{ + GList *applications; + GAppInfo *info1, *info2, *default_app; + GError *error = NULL; + + info1 = create_app_info ("Test1"); + info2 = create_app_info ("Test2"); + + g_app_info_set_as_default_for_type (info1, "application/x-test", &error); + g_assert (error == NULL); + + g_app_info_add_supports_type (info2, "application/x-test", &error); + g_assert (error == NULL); + + applications = g_app_info_get_recommended_for_type ("application/x-test"); + g_assert (g_list_length (applications) == 2); + + /* the first should be the default app now */ + g_assert (g_app_info_equal (g_list_nth_data (applications, 0), info1)); + g_assert (g_app_info_equal (g_list_nth_data (applications, 1), info2)); + + g_list_free_full (applications, g_object_unref); + + g_app_info_set_as_last_used_for_type (info2, "application/x-test", &error); + g_assert (error == NULL); + + applications = g_app_info_get_recommended_for_type ("application/x-test"); + g_assert (g_list_length (applications) == 2); + + default_app = g_app_info_get_default_for_type ("application/x-test", FALSE); + g_assert (g_app_info_equal (default_app, info1)); + + /* the first should be the other app now */ + g_assert (g_app_info_equal (g_list_nth_data (applications, 0), info2)); + g_assert (g_app_info_equal (g_list_nth_data (applications, 1), info1)); + + g_list_free_full (applications, g_object_unref); + + g_app_info_reset_type_associations ("application/x-test"); + + g_app_info_delete (info1); + g_app_info_delete (info2); + + g_object_unref (info1); + g_object_unref (info2); + g_object_unref (default_app); +} + +static void cleanup_dir_recurse (GFile *parent, GFile *root) { gboolean res; @@ -250,6 +368,8 @@ main (int argc, g_test_add_func ("/desktop-app-info/delete", test_delete); g_test_add_func ("/desktop-app-info/default", test_default); + g_test_add_func ("/desktop-app-info/fallback", test_fallback); + g_test_add_func ("/desktop-app-info/lastused", test_last_used); result = g_test_run (); diff --git a/gio/tests/enums.xml.template b/gio/tests/enums.xml.template new file mode 100644 index 0000000..67d07b5 --- /dev/null +++ b/gio/tests/enums.xml.template @@ -0,0 +1,18 @@ +/*** BEGIN comment ***/ + +/*** END comment ***/ +/*** BEGIN file-header ***/ + +/*** END file-header ***/ +/*** BEGIN value-header ***/ + <@type@ id='org.gtk.test.@EnumName@'> +/*** END value-header ***/ +/*** BEGIN value-production ***/ + +/*** END value-production ***/ +/*** BEGIN value-tail ***/ + +/*** END value-tail ***/ +/*** BEGIN file-tail ***/ + +/*** END file-tail ***/ diff --git a/gio/tests/file.c b/gio/tests/file.c new file mode 100644 index 0000000..a8903ab --- /dev/null +++ b/gio/tests/file.c @@ -0,0 +1,612 @@ +#include +#include +#include +#include +#include + +static void +test_basic (void) +{ + GFile *file; + gchar *s; + + file = g_file_new_for_path ("./some/directory/testfile"); + + s = g_file_get_basename (file); + g_assert_cmpstr (s, ==, "testfile"); + g_free (s); + + s = g_file_get_uri (file); + g_assert (g_str_has_prefix (s, "file://")); + g_assert (g_str_has_suffix (s, "/some/directory/testfile")); + g_free (s); + + g_assert (g_file_has_uri_scheme (file, "file")); + s = g_file_get_uri_scheme (file); + g_assert_cmpstr (s, ==, "file"); + g_free (s); + + g_object_unref (file); +} + +static void +test_parent (void) +{ + GFile *file; + GFile *file2; + GFile *parent; + GFile *root; + + file = g_file_new_for_path ("./some/directory/testfile"); + file2 = g_file_new_for_path ("./some/directory"); + root = g_file_new_for_path ("/"); + + g_assert (g_file_has_parent (file, file2)); + + parent = g_file_get_parent (file); + g_assert (g_file_equal (parent, file2)); + g_object_unref (parent); + + g_assert (g_file_get_parent (root) == NULL); + + g_object_unref (file); + g_object_unref (file2); + g_object_unref (root); +} + +static void +test_child (void) +{ + GFile *file; + GFile *child; + GFile *child2; + + file = g_file_new_for_path ("./some/directory"); + child = g_file_get_child (file, "child"); + g_assert (g_file_has_parent (child, file)); + + child2 = g_file_get_child_for_display_name (file, "child2", NULL); + g_assert (g_file_has_parent (child2, file)); + + g_object_unref (child); + g_object_unref (child2); + g_object_unref (file); +} + +static void +test_type (void) +{ + GFile *file; + GFileType type; + + file = g_file_new_for_path (SRCDIR "/file.c"); + type = g_file_query_file_type (file, 0, NULL); + g_assert_cmpint (type, ==, G_FILE_TYPE_REGULAR); + g_object_unref (file); + + file = g_file_new_for_path (SRCDIR "/schema-tests"); + type = g_file_query_file_type (file, 0, NULL); + g_assert_cmpint (type, ==, G_FILE_TYPE_DIRECTORY); + g_object_unref (file); +} + + +typedef struct +{ + GFile *file; + GFileMonitor *monitor; + GOutputStream *ostream; + GInputStream *istream; + GMainLoop *loop; + gint buffersize; + gint monitor_created; + gint monitor_deleted; + gint monitor_changed; + gchar *monitor_path; + gint pos; + gchar *data; + gchar *buffer; + guint timeout; +} CreateDeleteData; + +static void +monitor_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + + g_assert_cmpstr (data->monitor_path, ==, g_file_get_path (file)); + + if (event_type == G_FILE_MONITOR_EVENT_CREATED) + data->monitor_created++; + if (event_type == G_FILE_MONITOR_EVENT_DELETED) + data->monitor_deleted++; + if (event_type == G_FILE_MONITOR_EVENT_CHANGED) + data->monitor_changed++; +} + + +static gboolean +quit_idle (gpointer user_data) +{ + CreateDeleteData *data = user_data; + + g_source_remove (data->timeout); + g_main_loop_quit (data->loop); + + return FALSE; +} + +static void +iclosed_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + GError *error; + gboolean ret; + + error = NULL; + ret = g_input_stream_close_finish (data->istream, res, &error); + g_assert_no_error (error); + g_assert (ret); + + g_assert (g_input_stream_is_closed (data->istream)); + + ret = g_file_delete (data->file, NULL, &error); + g_assert (ret); + g_assert_no_error (error); + + /* work around file monitor bug: + * inotify events are only processed every 1000 ms, regardless + * of the rate limit set on the file monitor + */ + g_timeout_add (2000, quit_idle, data); +} + +static void +read_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + GError *error; + gssize size; + + error = NULL; + size = g_input_stream_read_finish (data->istream, res, &error); + g_assert_no_error (error); + + data->pos += size; + if (data->pos < strlen (data->data)) + { + g_input_stream_read_async (data->istream, + data->buffer + data->pos, + strlen (data->data) - data->pos, + 0, + NULL, + read_cb, + data); + } + else + { + g_assert_cmpstr (data->buffer, ==, data->data); + g_assert (!g_input_stream_is_closed (data->istream)); + g_input_stream_close_async (data->istream, 0, NULL, iclosed_cb, data); + } +} + +static void +ipending_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + GError *error; + gssize size; + + error = NULL; + size = g_input_stream_read_finish (data->istream, res, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); + g_error_free (error); +} + +static void +skipped_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + GError *error; + gssize size; + + error = NULL; + size = g_input_stream_skip_finish (data->istream, res, &error); + g_assert_no_error (error); + g_assert_cmpint (size, ==, data->pos); + + g_input_stream_read_async (data->istream, + data->buffer + data->pos, + strlen (data->data) - data->pos, + 0, + NULL, + read_cb, + data); + /* check that we get a pending error */ + g_input_stream_read_async (data->istream, + data->buffer + data->pos, + strlen (data->data) - data->pos, + 0, + NULL, + ipending_cb, + data); +} + +static void +opened_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + GFileInputStream *base; + CreateDeleteData *data = user_data; + GError *error; + + error = NULL; + base = g_file_read_finish (data->file, res, &error); + g_assert_no_error (error); + + if (data->buffersize == 0) + data->istream = G_INPUT_STREAM (g_object_ref (base)); + else + data->istream = g_buffered_input_stream_new_sized (G_INPUT_STREAM (base), data->buffersize); + g_object_unref (base); + + data->buffer = g_new0 (gchar, strlen (data->data) + 1); + + /* copy initial segment directly, then skip */ + memcpy (data->buffer, data->data, 10); + data->pos = 10; + + g_input_stream_skip_async (data->istream, + 10, + 0, + NULL, + skipped_cb, + data); +} + +static void +oclosed_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + GError *error; + gboolean ret; + + error = NULL; + ret = g_output_stream_close_finish (data->ostream, res, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert (g_output_stream_is_closed (data->ostream)); + + g_file_read_async (data->file, 0, NULL, opened_cb, data); +} + +static void +written_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + gssize size; + GError *error; + + error = NULL; + size = g_output_stream_write_finish (data->ostream, res, &error); + g_assert_no_error (error); + + data->pos += size; + if (data->pos < strlen (data->data)) + { + g_output_stream_write_async (data->ostream, + data->data + data->pos, + strlen (data->data) - data->pos, + 0, + NULL, + written_cb, + data); + } + else + { + g_assert (!g_output_stream_is_closed (data->ostream)); + g_output_stream_close_async (data->ostream, 0, NULL, oclosed_cb, data); + } +} + +static void +opending_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + CreateDeleteData *data = user_data; + GError *error; + gssize size; + + error = NULL; + size = g_output_stream_write_finish (data->ostream, res, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); + g_error_free (error); +} + +static void +created_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + GFileOutputStream *base; + CreateDeleteData *data = user_data; + GError *error; + + error = NULL; + base = g_file_create_finish (G_FILE (source), res, &error); + g_assert_no_error (error); + g_assert (g_file_query_exists (data->file, NULL)); + + if (data->buffersize == 0) + data->ostream = G_OUTPUT_STREAM (g_object_ref (base)); + else + data->ostream = g_buffered_output_stream_new_sized (G_OUTPUT_STREAM (base), data->buffersize); + g_object_unref (base); + + g_output_stream_write_async (data->ostream, + data->data, + strlen (data->data), + 0, + NULL, + written_cb, + data); + /* check that we get a pending error */ + g_output_stream_write_async (data->ostream, + data->data, + strlen (data->data), + 0, + NULL, + opending_cb, + data); +} + +static gboolean +stop_timeout (gpointer data) +{ + g_assert_not_reached (); + + return FALSE; +} + +/* + * This test does a fully async create-write-read-delete. + * Callbackistan. + */ +static void +test_create_delete (gconstpointer d) +{ + GError *error; + CreateDeleteData *data; + int tmpfd; + + data = g_new0 (CreateDeleteData, 1); + + data->buffersize = GPOINTER_TO_INT (d); + data->data = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789"; + data->pos = 0; + + /* Using tempnam() would be easier here, but causes a compile warning */ + tmpfd = g_file_open_tmp ("g_file_create_delete_XXXXXX", + &data->monitor_path, NULL); + g_assert_cmpint (tmpfd, !=, -1); + close (tmpfd); + remove (data->monitor_path); + + data->file = g_file_new_for_path (data->monitor_path); + g_assert (!g_file_query_exists (data->file, NULL)); + + error = NULL; + data->monitor = g_file_monitor_file (data->file, 0, NULL, &error); + g_assert_no_error (error); + g_file_monitor_set_rate_limit (data->monitor, 100); + + g_signal_connect (data->monitor, "changed", G_CALLBACK (monitor_changed), data); + + data->loop = g_main_loop_new (NULL, FALSE); + + data->timeout = g_timeout_add (5000, stop_timeout, NULL); + + g_file_create_async (data->file, 0, 0, NULL, created_cb, data); + + g_main_loop_run (data->loop); + + g_assert_cmpint (data->monitor_created, ==, 1); + g_assert_cmpint (data->monitor_deleted, ==, 1); + g_assert_cmpint (data->monitor_changed, >, 0); + + g_assert (!g_file_monitor_is_cancelled (data->monitor)); + g_file_monitor_cancel (data->monitor); + g_assert (g_file_monitor_is_cancelled (data->monitor)); + + g_main_loop_unref (data->loop); + g_object_unref (data->monitor); + g_object_unref (data->ostream); + g_object_unref (data->istream); + g_object_unref (data->file); + free (data->monitor_path); + g_free (data->buffer); + g_free (data); +} + +typedef struct +{ + GFile *file; + const gchar *data; + GMainLoop *loop; + gboolean again; +} ReplaceLoadData; + +static void replaced_cb (GObject *source, + GAsyncResult *res, + gpointer user_data); + +static void +loaded_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + ReplaceLoadData *data = user_data; + gboolean ret; + GError *error; + gchar *contents; + gsize length; + + error = NULL; + ret = g_file_load_contents_finish (data->file, res, &contents, &length, NULL, &error); + g_assert (ret); + g_assert_no_error (error); + g_assert_cmpint (length, ==, strlen (data->data)); + g_assert_cmpstr (contents, ==, data->data); + + g_free (contents); + + if (data->again) + { + data->again = FALSE; + data->data = "pi pa po"; + + g_file_replace_contents_async (data->file, + data->data, + strlen (data->data), + NULL, + FALSE, + 0, + NULL, + replaced_cb, + data); + } + else + { + error = NULL; + ret = g_file_delete (data->file, NULL, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert (!g_file_query_exists (data->file, NULL)); + + g_main_loop_quit (data->loop); + } +} + +static void +replaced_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +{ + ReplaceLoadData *data = user_data; + gboolean ret; + GError *error; + + error = NULL; + ret = g_file_replace_contents_finish (data->file, res, NULL, &error); + g_assert_no_error (error); + + g_file_load_contents_async (data->file, NULL, loaded_cb, data); +} + +static void +test_replace_load (void) +{ + ReplaceLoadData *data; + gchar *path; + int tmpfd; + + data = g_new0 (ReplaceLoadData, 1); + data->again = TRUE; + data->data = + "/**\n" + " * g_file_replace_contents_async:\n" + " * @file: input #GFile.\n" + " * @contents: string of contents to replace the file with.\n" + " * @length: the length of @contents in bytes.\n" + " * @etag: (allow-none): a new entity tag for the @file, or %NULL\n" + " * @make_backup: %TRUE if a backup should be created.\n" + " * @flags: a set of #GFileCreateFlags.\n" + " * @cancellable: optional #GCancellable object, %NULL to ignore.\n" + " * @callback: a #GAsyncReadyCallback to call when the request is satisfied\n" + " * @user_data: the data to pass to callback function\n" + " * \n" + " * Starts an asynchronous replacement of @file with the given \n" + " * @contents of @length bytes. @etag will replace the document's\n" + " * current entity tag.\n" + " * \n" + " * When this operation has completed, @callback will be called with\n" + " * @user_user data, and the operation can be finalized with \n" + " * g_file_replace_contents_finish().\n" + " * \n" + " * If @cancellable is not %NULL, then the operation can be cancelled by\n" + " * triggering the cancellable object from another thread. If the operation\n" + " * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. \n" + " * \n" + " * If @make_backup is %TRUE, this function will attempt to \n" + " * make a backup of @file.\n" + " **/\n"; + + /* Using tempnam() would be easier here, but causes a compile warning */ + tmpfd = g_file_open_tmp ("g_file_replace_load_XXXXXX", + &path, NULL); + g_assert_cmpint (tmpfd, !=, -1); + close (tmpfd); + remove (path); + + data->file = g_file_new_for_path (path); + g_assert (!g_file_query_exists (data->file, NULL)); + + data->loop = g_main_loop_new (NULL, FALSE); + + g_file_replace_contents_async (data->file, + data->data, + strlen (data->data), + NULL, + FALSE, + 0, + NULL, + replaced_cb, + data); + + g_main_loop_run (data->loop); + + g_main_loop_unref (data->loop); + g_object_unref (data->file); + g_free (data); + free (path); +} + +int +main (int argc, char *argv[]) +{ + g_type_init (); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/file/basic", test_basic); + g_test_add_func ("/file/parent", test_parent); + g_test_add_func ("/file/child", test_child); + g_test_add_func ("/file/type", test_type); + g_test_add_data_func ("/file/async-create-delete/0", GINT_TO_POINTER (0), test_create_delete); + g_test_add_data_func ("/file/async-create-delete/1", GINT_TO_POINTER (1), test_create_delete); + g_test_add_data_func ("/file/async-create-delete/10", GINT_TO_POINTER (10), test_create_delete); + g_test_add_data_func ("/file/async-create-delete/25", GINT_TO_POINTER (25), test_create_delete); + g_test_add_data_func ("/file/async-create-delete/4096", GINT_TO_POINTER (4096), test_create_delete); + g_test_add_func ("/file/replace-load", test_replace_load); + + return g_test_run (); +} diff --git a/gio/tests/filter-cat.c b/gio/tests/filter-cat.c index 770ab1a..ff7ddd3 100644 --- a/gio/tests/filter-cat.c +++ b/gio/tests/filter-cat.c @@ -50,6 +50,23 @@ static GOptionEntry entries[] = { }; static void +decompressor_file_info_notify_cb (GZlibDecompressor *decompressor, + GParamSpec *pspec, + gpointer data) +{ + GFileInfo *file_info; + const gchar *filename; + + file_info = g_zlib_decompressor_get_file_info (decompressor); + if (file_info == NULL) + return; + + filename = g_file_info_get_name (file_info); + if (filename) + g_printerr ("Decompressor filename: %s\n", filename); +} + +static void cat (GFile * file) { GInputStream *in; @@ -79,6 +96,7 @@ cat (GFile * file) conv = (GConverter *)g_zlib_decompressor_new (gzip?G_ZLIB_COMPRESSOR_FORMAT_GZIP:G_ZLIB_COMPRESSOR_FORMAT_ZLIB); old = in; in = (GInputStream *) g_converter_input_stream_new (in, conv); + g_signal_connect (conv, "notify::file-info", G_CALLBACK (decompressor_file_info_notify_cb), NULL); g_object_unref (conv); g_object_unref (old); } @@ -108,11 +126,29 @@ cat (GFile * file) if (compress) { GInputStream *old; - conv = (GConverter *)g_zlib_compressor_new (gzip?G_ZLIB_COMPRESSOR_FORMAT_GZIP:G_ZLIB_COMPRESSOR_FORMAT_ZLIB, -1); + GFileInfo *in_file_info; + + in_file_info = g_file_query_info (file, + G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_TIME_MODIFIED, + G_FILE_QUERY_INFO_NONE, + NULL, + &error); + if (in_file_info == NULL) + { + g_printerr ("%s: %s: error reading file info: %s\n", + g_get_prgname (), g_file_get_uri (file), error->message); + g_error_free (error); + return; + } + + conv = (GConverter *)g_zlib_compressor_new(gzip?G_ZLIB_COMPRESSOR_FORMAT_GZIP:G_ZLIB_COMPRESSOR_FORMAT_ZLIB, -1); + g_zlib_compressor_set_file_info (G_ZLIB_COMPRESSOR (conv), in_file_info); old = in; in = (GInputStream *) g_converter_input_stream_new (in, conv); g_object_unref (conv); g_object_unref (old); + g_object_unref (in_file_info); } while (1) diff --git a/gio/tests/filter-streams.c b/gio/tests/filter-streams.c index c9b3e18..050a4ea 100644 --- a/gio/tests/filter-streams.c +++ b/gio/tests/filter-streams.c @@ -79,6 +79,7 @@ gpointer expected_obj; gpointer expected_data; gboolean callback_happened; +#if 0 static void in_cb (GObject *object, GAsyncResult *result, @@ -167,7 +168,6 @@ out_cb (GObject *object, callback_happened = TRUE; } - static void test_output_async (void) { @@ -221,7 +221,7 @@ test_output_async (void) g_assert (g_output_stream_is_closed (base)); g_object_unref (base); } - +#endif int main (int argc, char **argv) diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c index 80bdd6e..ec0ae27 100644 --- a/gio/tests/g-file-info.c +++ b/gio/tests/g-file-info.c @@ -76,7 +76,8 @@ test_g_file_info (void) attr_list = g_file_info_list_attributes (info, NULL); g_assert (attr_list != NULL); g_assert (*attr_list == NULL); - + g_strfreev (attr_list); + g_file_info_set_attribute_byte_string (info, G_FILE_ATTRIBUTE_STANDARD_NAME, TEST_NAME); g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, TEST_DISPLAY_NAME); g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE, TEST_SIZE); @@ -86,7 +87,8 @@ test_g_file_info (void) attr_list = g_file_info_list_attributes (info, NULL); g_assert (attr_list != NULL); g_assert (*attr_list != NULL); - + g_strfreev (attr_list); + test_assigned_values (info); /* Test dups */ diff --git a/gio/tests/g-icon.c b/gio/tests/g-icon.c index 5fe4571..52465c8 100644 --- a/gio/tests/g-icon.c +++ b/gio/tests/g-icon.c @@ -230,6 +230,118 @@ test_g_icon_serialize (void) g_object_unref (icon3); g_object_unref (icon4); g_object_unref (icon5); + g_free (data); +} + +static void +test_themed_icon (void) +{ + GIcon *icon1, *icon2, *icon3; + const gchar *const *names; + const gchar *names2[] = { "first", "testicon", "last", NULL }; + gchar *str; + gboolean fallbacks; + + icon1 = g_themed_icon_new ("testicon"); + + g_object_get (icon1, "use-default-fallbacks", &fallbacks, NULL); + g_assert (!fallbacks); + + names = g_themed_icon_get_names (G_THEMED_ICON (icon1)); + g_assert_cmpint (g_strv_length ((gchar **)names), ==, 1); + g_assert_cmpstr (names[0], ==, "testicon"); + + g_themed_icon_prepend_name (G_THEMED_ICON (icon1), "first"); + g_themed_icon_append_name (G_THEMED_ICON (icon1), "last"); + names = g_themed_icon_get_names (G_THEMED_ICON (icon1)); + g_assert_cmpint (g_strv_length ((gchar **)names), ==, 3); + g_assert_cmpstr (names[0], ==, "first"); + g_assert_cmpstr (names[1], ==, "testicon"); + g_assert_cmpstr (names[2], ==, "last"); + g_assert_cmpuint (g_icon_hash (icon1), ==, 2400773466U); + + icon2 = g_themed_icon_new_from_names ((gchar**)names2, -1); + g_assert (g_icon_equal (icon1, icon2)); + + str = g_icon_to_string (icon2); + icon3 = g_icon_new_for_string (str, NULL); + g_assert (g_icon_equal (icon2, icon3)); + g_free (str); + + g_object_unref (icon1); + g_object_unref (icon2); + g_object_unref (icon3); +} + +static void +test_emblemed_icon (void) +{ + GIcon *icon1, *icon2, *icon3, *icon4; + GEmblem *emblem, *emblem1, *emblem2; + GList *emblems; + + icon1 = g_themed_icon_new ("testicon"); + icon2 = g_themed_icon_new ("testemblem"); + emblem1 = g_emblem_new (icon2); + emblem2 = g_emblem_new_with_origin (icon2, G_EMBLEM_ORIGIN_TAG); + + icon3 = g_emblemed_icon_new (icon1, emblem1); + emblems = g_emblemed_icon_get_emblems (G_EMBLEMED_ICON (icon3)); + g_assert_cmpint (g_list_length (emblems), ==, 1); + g_assert (g_emblemed_icon_get_icon (G_EMBLEMED_ICON (icon3)) == icon1); + + icon4 = g_emblemed_icon_new (icon1, emblem1); + g_emblemed_icon_add_emblem (G_EMBLEMED_ICON (icon4), emblem2); + emblems = g_emblemed_icon_get_emblems (G_EMBLEMED_ICON (icon4)); + g_assert_cmpint (g_list_length (emblems), ==, 2); + + g_assert (!g_icon_equal (icon3, icon4)); + + emblem = emblems->data; + g_assert (g_emblem_get_icon (emblem) == icon2); + g_assert (g_emblem_get_origin (emblem) == G_EMBLEM_ORIGIN_TAG); + + emblem = emblems->next->data; + g_assert (g_emblem_get_icon (emblem) == icon2); + g_assert (g_emblem_get_origin (emblem) == G_EMBLEM_ORIGIN_UNKNOWN); + + g_object_unref (icon1); + g_object_unref (icon2); + g_object_unref (icon3); + g_object_unref (icon4); + + g_object_unref (emblem1); + g_object_unref (emblem2); +} + +static void +test_file_icon (void) +{ + GFile *file; + GIcon *icon; + GIcon *icon2; + GError *error; + GInputStream *stream; + gchar *str; + + file = g_file_new_for_path (SRCDIR "/g-icon.c"); + icon = g_file_icon_new (file); + g_object_unref (file); + + error = NULL; + stream = g_loadable_icon_load (G_LOADABLE_ICON (icon), 20, NULL, NULL, &error); + g_assert (stream != NULL); + g_assert_no_error (error); + + g_object_unref (stream); + + str = g_icon_to_string (icon); + icon2 = g_icon_new_for_string (str, NULL); + g_assert (g_icon_equal (icon, icon2)); + g_free (str); + + g_object_unref (icon); + g_object_unref (icon2); } int @@ -239,7 +351,10 @@ main (int argc, g_type_init (); g_test_init (&argc, &argv, NULL); - g_test_add_func ("/g-icon/serialize", test_g_icon_serialize); + g_test_add_func ("/icons/serialize", test_g_icon_serialize); + g_test_add_func ("/icons/themed", test_themed_icon); + g_test_add_func ("/icons/emblemed", test_emblemed_icon); + g_test_add_func ("/icons/file", test_file_icon); return g_test_run(); } diff --git a/gio/tests/gapplication-example-actions.c b/gio/tests/gapplication-example-actions.c new file mode 100644 index 0000000..0b8be94 --- /dev/null +++ b/gio/tests/gapplication-example-actions.c @@ -0,0 +1,89 @@ +#include +#include +#include + +static void +activate (GApplication *application) +{ + g_print ("activated\n"); +} + +static void +activate_action (GAction *action, + GVariant *parameter, + gpointer data) +{ + g_print ("action %s activated\n", g_action_get_name (action)); +} + +static void +activate_toggle_action (GAction *action, + GVariant *parameter, + gpointer data) +{ + GVariant *state; + gboolean b; + + g_print ("action %s activated\n", g_action_get_name (action)); + + state = g_action_get_state (action); + b = g_variant_get_boolean (state); + g_variant_unref (state); + g_action_set_state (action, g_variant_new_boolean (!b)); + g_print ("state change %d -> %d\n", b, !b); +} + +static void +add_actions (GApplication *app) +{ + GSimpleActionGroup *actions; + GSimpleAction *action; + + actions = g_simple_action_group_new (); + + action = g_simple_action_new ("simple-action", NULL); + g_signal_connect (action, "activate", G_CALLBACK (activate_action), app); + g_simple_action_group_insert (actions, G_ACTION (action)); + g_object_unref (action); + + action = g_simple_action_new_stateful ("toggle-action", NULL, + g_variant_new_boolean (FALSE)); + g_signal_connect (action, "activate", G_CALLBACK (activate_toggle_action), app); + g_simple_action_group_insert (actions, G_ACTION (action)); + g_object_unref (action); + + g_application_set_action_group (app, G_ACTION_GROUP (actions)); + g_object_unref (actions); +} + +int +main (int argc, char **argv) +{ + GApplication *app; + int status; + + app = g_application_new ("org.gtk.TestApplication", 0); + g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); + g_application_set_inactivity_timeout (app, 10000); + + add_actions (app); + + if (argc > 1 && strcmp (argv[1], "--simple-action") == 0) + { + g_application_register (app, NULL, NULL); + g_action_group_activate_action (G_ACTION_GROUP (app), "simple-action", NULL); + exit (0); + } + else if (argc > 1 && strcmp (argv[1], "--toggle-action") == 0) + { + g_application_register (app, NULL, NULL); + g_action_group_activate_action (G_ACTION_GROUP (app), "toggle-action", NULL); + exit (0); + } + + status = g_application_run (app, argc, argv); + + g_object_unref (app); + + return status; +} diff --git a/gio/tests/gapplication-example-cmdline.c b/gio/tests/gapplication-example-cmdline.c new file mode 100644 index 0000000..99380cd --- /dev/null +++ b/gio/tests/gapplication-example-cmdline.c @@ -0,0 +1,43 @@ +#include +#include +#include + +static int +command_line (GApplication *application, + GApplicationCommandLine *cmdline) +{ + gchar **argv; + gint argc; + gint i; + + argv = g_application_command_line_get_arguments (cmdline, &argc); + + g_application_command_line_print (cmdline, + "This text is written back\n" + "to stdout of the caller\n"); + + for (i = 0; i < argc; i++) + g_print ("argument %d: %s\n", i, argv[i]); + + g_strfreev (argv); + + return 0; +} + +int +main (int argc, char **argv) +{ + GApplication *app; + int status; + + app = g_application_new ("org.gtk.TestApplication", + G_APPLICATION_HANDLES_COMMAND_LINE); + g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); + g_application_set_inactivity_timeout (app, 10000); + + status = g_application_run (app, argc, argv); + + g_object_unref (app); + + return status; +} diff --git a/gio/tests/gapplication-example-cmdline2.c b/gio/tests/gapplication-example-cmdline2.c new file mode 100644 index 0000000..4351224 --- /dev/null +++ b/gio/tests/gapplication-example-cmdline2.c @@ -0,0 +1,103 @@ +#include +#include +#include + +static int +command_line (GApplication *application, + GApplicationCommandLine *cmdline) +{ + gchar **argv; + gint argc; + gint i; + + argv = g_application_command_line_get_arguments (cmdline, &argc); + + for (i = 0; i < argc; i++) + g_print ("handling argument %s remotely\n", argv[i]); + + g_strfreev (argv); + + return 0; +} + +static gboolean +test_local_cmdline (GApplication *application, + gchar ***arguments, + gint *exit_status) +{ + gint i, j; + gchar **argv; + + argv = *arguments; + + for (i = 0; argv[i]; i++) + { + if (g_str_has_prefix (argv[i], "--local-")) + { + g_print ("handling argument %s locally\n", argv[i]); + for (j = i + 1; argv[j]; j++) + { + argv[j - 1] = argv[j]; + argv[j] = NULL; + } + } + } + + *exit_status = 0; + + return FALSE; +} + +typedef GApplication TestApplication; +typedef GApplicationClass TestApplicationClass; + +G_DEFINE_TYPE (TestApplication, test_application, G_TYPE_APPLICATION) + +static void +test_application_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_application_parent_class)->finalize (object); +} + +static void +test_application_init (TestApplication *app) +{ +} + +static void +test_application_class_init (TestApplicationClass *class) +{ + G_OBJECT_CLASS (class)->finalize = test_application_finalize; + G_APPLICATION_CLASS (class)->local_command_line = test_local_cmdline; +} + +GApplication * +test_application_new (const gchar *application_id, + GApplicationFlags flags) +{ + g_return_val_if_fail (g_application_id_is_valid (application_id), NULL); + + g_type_init (); + + return g_object_new (test_application_get_type (), + "application-id", application_id, + "flags", flags, + NULL); +} + +int +main (int argc, char **argv) +{ + GApplication *app; + int status; + + app = test_application_new ("org.gtk.TestApplication", 0); + g_application_set_inactivity_timeout (app, 10000); + g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); + + status = g_application_run (app, argc, argv); + + g_object_unref (app); + + return status; +} diff --git a/gio/tests/gapplication-example-open.c b/gio/tests/gapplication-example-open.c new file mode 100644 index 0000000..6dcf53c --- /dev/null +++ b/gio/tests/gapplication-example-open.c @@ -0,0 +1,56 @@ +#include +#include +#include + +static void +activate (GApplication *application) +{ + g_print ("activated\n"); + + /* Note: when doing a longer-lasting action here that returns + * to the mainloop, you should use g_application_hold() and + * g_application_release() to keep the application alive until + * the action is completed. + */ +} + +static void +open (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint) +{ + gint i; + + for (i = 0; i < n_files; i++) + { + gchar *uri = g_file_get_uri (files[i]); + g_print ("open %s\n", uri); + g_free (uri); + } + + /* Note: when doing a longer-lasting action here that returns + * to the mainloop, you should use g_application_hold() and + * g_application_release() to keep the application alive until + * the action is completed. + */ +} + +int +main (int argc, char **argv) +{ + GApplication *app; + int status; + + app = g_application_new ("org.gtk.TestApplication", + G_APPLICATION_HANDLES_OPEN); + g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); + g_signal_connect (app, "open", G_CALLBACK (open), NULL); + g_application_set_inactivity_timeout (app, 10000); + + status = g_application_run (app, argc, argv); + + g_object_unref (app); + + return status; +} diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c new file mode 100644 index 0000000..453d8d8 --- /dev/null +++ b/gio/tests/gapplication.c @@ -0,0 +1,233 @@ +#include +#include +#include +#include "gdbus-sessionbus.h" + +static void +activate (GApplication *application) +{ + g_application_hold (application); + g_print ("activated\n"); + g_application_release (application); +} + +static void +open (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint) +{ + gint i; + + g_application_hold (application); + g_print ("open"); + + for (i = 0; i < n_files; i++) + { + gchar *uri = g_file_get_uri (files[i]); + g_print (" %s", uri); + g_free (uri); + } + g_application_release (application); + + g_print ("\n"); +} + +static int +command_line (GApplication *application, + GApplicationCommandLine *cmdline) +{ + gchar **argv; + gint argc; + + argv = g_application_command_line_get_arguments (cmdline, &argc); + + g_application_command_line_print (cmdline, "%d + %d = %d\n", 40, 2, 42); + + g_assert_cmpint (argc, ==, 3); + g_assert_cmpstr (argv[0], ==, "./cmd"); + g_assert_cmpstr (argv[1], ==, "40 +"); + g_assert_cmpstr (argv[2], ==, "2"); + g_assert (argv[3] == NULL); + g_print ("cmdline '%s' '%s'\n", argv[1], argv[2]); + g_strfreev (argv); + + return 42; +} + +static int +app_main (int argc, char **argv) +{ + GApplication *app; + int status; + + app = g_application_new ("org.gtk.TestApplication", + G_APPLICATION_HANDLES_OPEN | + (strcmp (argv[0], "./cmd") == 0 ? + G_APPLICATION_HANDLES_COMMAND_LINE + : 0)); + g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); + g_signal_connect (app, "open", G_CALLBACK (open), NULL); + g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); +#ifdef STANDALONE + g_application_set_inactivity_timeout (app, 10000); +#else + g_application_set_inactivity_timeout (app, 1000); +#endif + status = g_application_run (app, argc, argv); + g_object_unref (app); + + return status; +} + +#ifdef STANDALONE +int +main (int argc, char **argv) +{ + return app_main (argc - 1, argv + 1); +} +#else +static gint outstanding_watches; +static GMainLoop *main_loop; + +typedef struct +{ + const gchar *expected_stdout; + gint stdout_pipe; +} ChildData; + +static void +child_quit (GPid pid, + gint status, + gpointer data) +{ + ChildData *child = data; + gssize expected, actual; + gchar *buffer; + + g_assert_cmpint (status, ==, 0); + + if (--outstanding_watches == 0) + g_main_loop_quit (main_loop); + + expected = strlen (child->expected_stdout); + buffer = g_alloca (expected + 100); + actual = read (child->stdout_pipe, buffer, expected + 100); + close (child->stdout_pipe); + + g_assert_cmpint (actual, >=, 0); + + if (actual != expected || + memcmp (buffer, child->expected_stdout, expected) != 0) + { + buffer[MIN(expected + 100, actual)] = '\0'; + + g_error ("\nExpected\n-----\n%s-----\nGot (%s)\n-----\n%s-----\n", + child->expected_stdout, + (actual > expected) ? "truncated" : "full", buffer); + } + + g_slice_free (ChildData, child); +} + +static void +spawn (const gchar *expected_stdout, + const gchar *first_arg, + ...) +{ + gint pipefd[2]; + GPid pid; + int s; + + /* We assume that the child will not produce enough stdout + * to deadlock by filling the pipe. + */ + s = pipe (pipefd); + g_assert_cmpint (s, ==, 0); + + pid = fork (); + + if (pid == 0) + { + const gchar *arg; + GPtrArray *array; + gchar **args; + int status; + va_list ap; + + dup2 (pipefd[1], 1); + close (pipefd[0]); + close (pipefd[1]); + + va_start (ap, first_arg); + array = g_ptr_array_new (); + for (arg = first_arg; arg; arg = va_arg (ap, const gchar *)) + g_ptr_array_add (array, g_strdup (arg)); + g_ptr_array_add (array, NULL); + args = (gchar **) g_ptr_array_free (array, FALSE); + + status = app_main (g_strv_length (args), args); + g_strfreev (args); + + g_print ("exit status: %d\n", status); + exit (0); + } + else if (pid > 0) + { + ChildData *data; + + data = g_slice_new (ChildData); + data->expected_stdout = expected_stdout; + data->stdout_pipe = pipefd[0]; + close (pipefd[1]); + + g_child_watch_add (pid, child_quit, data); + outstanding_watches++; + } + else + g_assert_not_reached (); +} + +static void +basic (void) +{ + session_bus_up (); + + main_loop = g_main_loop_new (NULL, 0); + + /* spawn the master */ + spawn ("activated\n" + "open file:///a file:///b\n" + "cmdline '40 +' '2'\n" + "exit status: 0\n", + "./app", NULL); + + /* make sure it becomes the master */ + g_usleep (100000); + + /* send it some files */ + spawn ("exit status: 0\n", + "./app", "/a", "/b", NULL); + + /* make sure the commandline arrives after the files */ + g_usleep (100000); + + spawn ("40 + 2 = 42\n" + "exit status: 42\n", + "./cmd", "40 +", "2", NULL); + + g_main_loop_run (main_loop); + + session_bus_down (); +} + +int +main (int argc, char **argv) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/gapplication/basic", basic); + + return g_test_run (); +} +#endif diff --git a/gio/tests/gdbus-addresses.c b/gio/tests/gdbus-addresses.c new file mode 100644 index 0000000..9ead2ec --- /dev/null +++ b/gio/tests/gdbus-addresses.c @@ -0,0 +1,123 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include + +#ifdef G_OS_UNIX +#include +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_empty_address (void) +{ + GError *error; + error = NULL; + g_dbus_address_get_stream_sync ("", + NULL, + NULL, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); +} + +#ifdef G_OS_UNIX +static void +test_unix_address (void) +{ + g_assert (!g_dbus_is_supported_address ("some-imaginary-transport:foo=bar", NULL)); + g_assert (g_dbus_is_supported_address ("unix:path=/tmp/dbus-test", NULL)); + g_assert (g_dbus_is_supported_address ("unix:abstract=/tmp/dbus-another-test", NULL)); + g_assert (g_dbus_is_address ("unix:foo=bar")); + g_assert (!g_dbus_is_supported_address ("unix:foo=bar", NULL)); + g_assert (!g_dbus_is_address ("unix:path=/foo;abstract=/bar")); + g_assert (!g_dbus_is_supported_address ("unix:path=/foo;abstract=/bar", NULL)); + g_assert (g_dbus_is_supported_address ("unix:path=/tmp/concrete;unix:abstract=/tmp/abstract", NULL)); + g_assert (g_dbus_is_address ("some-imaginary-transport:foo=bar")); + + g_assert (g_dbus_is_address ("some-imaginary-transport:foo=bar;unix:path=/this/is/valid")); + g_assert (!g_dbus_is_supported_address ("some-imaginary-transport:foo=bar;unix:path=/this/is/valid", NULL)); +} +#endif + +static void +test_nonce_tcp_address (void) +{ + g_assert (g_dbus_is_supported_address ("nonce-tcp:host=localhost,port=42,noncefile=/foo/bar", NULL)); + g_assert (g_dbus_is_supported_address ("nonce-tcp:host=localhost,port=42,noncefile=/foo/bar,family=ipv6", NULL)); + g_assert (g_dbus_is_supported_address ("nonce-tcp:host=localhost,port=42,noncefile=/foo/bar,family=ipv4", NULL)); + + g_assert (!g_dbus_is_supported_address ("nonce-tcp:host=localhost,port=42,noncefile=/foo/bar,family=blah", NULL)); + g_assert (!g_dbus_is_supported_address ("nonce-tcp:host=localhost,port=420000,noncefile=/foo/bar,family=ipv4", NULL)); + g_assert (!g_dbus_is_supported_address ("nonce-tcp:host=,port=x42,noncefile=/foo/bar,family=ipv4", NULL)); + g_assert (!g_dbus_is_supported_address ("nonce-tcp:host=,port=42x,noncefile=/foo/bar,family=ipv4", NULL)); + g_assert (!g_dbus_is_supported_address ("nonce-tcp:host=,port=420000,noncefile=/foo/bar,family=ipv4", NULL)); +} + +static void +test_tcp_address (void) +{ + g_assert (g_dbus_is_supported_address ("tcp:host=localhost", NULL)); + g_assert (!g_dbus_is_supported_address ("tcp:host=localhost,noncefile=/tmp/foo", NULL)); + g_assert (g_dbus_is_supported_address ("tcp:host=localhost,port=42", NULL)); + g_assert (!g_dbus_is_supported_address ("tcp:host=localhost,port=-1", NULL)); + g_assert (!g_dbus_is_supported_address ("tcp:host=localhost,port=420000", NULL)); + g_assert (!g_dbus_is_supported_address ("tcp:host=localhost,port=42x", NULL)); + g_assert (g_dbus_is_supported_address ("tcp:host=localhost,port=42,family=ipv4", NULL)); + g_assert (g_dbus_is_supported_address ("tcp:host=localhost,port=42,family=ipv6", NULL)); + g_assert (!g_dbus_is_supported_address ("tcp:host=localhost,port=42,family=sopranos", NULL)); +} + +static void +test_autolaunch_address (void) +{ + g_assert (g_dbus_is_supported_address ("autolaunch:", NULL)); +} + +static void +test_mixed_address (void) +{ + g_assert (g_dbus_is_supported_address ("unix:path=/tmp/dbus1;unix:path=/tmp/dbus2", NULL)); + g_assert (g_dbus_is_supported_address ("tcp:host=localhost,port=42;autolaunch:", NULL)); + g_assert (!g_dbus_is_supported_address ("tcp:host=localhost,port=42;tcp:family=bla", NULL)); +} + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/gdbus/empty-address", test_empty_address); +#ifdef G_OS_UNIX + g_test_add_func ("/gdbus/unix-address", test_unix_address); +#endif + g_test_add_func ("/gdbus/nonce-tcp-address", test_nonce_tcp_address); + g_test_add_func ("/gdbus/tcp-address", test_tcp_address); + g_test_add_func ("/gdbus/autolaunch-address", test_autolaunch_address); + g_test_add_func ("/gdbus/mixed-address", test_mixed_address); + + return g_test_run(); +} + diff --git a/gio/tests/gdbus-bz627724.c b/gio/tests/gdbus-bz627724.c new file mode 100644 index 0000000..03d196e --- /dev/null +++ b/gio/tests/gdbus-bz627724.c @@ -0,0 +1,94 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +static GDBusConnection *the_connection = NULL; + +#define MY_TYPE_OBJECT (my_object_get_type ()) +#define MY_OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MY_TYPE_OBJECT, MyObject)) +#define MY_IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MY_TYPE_OBJECT)) + +typedef struct { + GObject parent_instance; +} MyObject; + +typedef struct { + GObjectClass parent_class; +} MyObjectClass; + +GType my_object_get_type (void) G_GNUC_CONST; + +G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT); + +static void +my_object_init (MyObject *object) +{ +} + +static void +my_object_class_init (MyObjectClass *klass) +{ + GError *error; + error = NULL; + the_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, + NULL, /* GCancellable* */ + &error); + g_assert_no_error (error); + g_assert (G_IS_DBUS_CONNECTION (the_connection)); +} + +static void +test_bz627724 (void) +{ + MyObject *object; + + session_bus_up (); + g_assert (the_connection == NULL); + object = g_object_new (MY_TYPE_OBJECT, NULL); + g_assert (the_connection != NULL); + g_object_unref (the_connection); + g_object_unref (object); + session_bus_down (); +} + + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/bz627724", test_bz627724); + return g_test_run(); +} diff --git a/gio/tests/gdbus-connection-flush-helper.c b/gio/tests/gdbus-connection-flush-helper.c new file mode 100644 index 0000000..5e36075 --- /dev/null +++ b/gio/tests/gdbus-connection-flush-helper.c @@ -0,0 +1,60 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include + +int +main (int argc, + char *argv[]) +{ + GDBusConnection *c; + GError *error; + gboolean ret; + + g_type_init (); + + error = NULL; + c = g_bus_get_sync (G_BUS_TYPE_SESSION, + NULL, /* GCancellable* */ + &error); + g_assert_no_error (error); + + error = NULL; + g_dbus_connection_emit_signal (c, + NULL, /* const gchar *destination_bus_name */ + "/org/gtk/GDBus/FlushObject", + "org.gtk.GDBus.FlushInterface", + "SomeSignal", + NULL, /* GVariant *parameters */ + &error); + g_assert_no_error (error); + + error = NULL; + ret = g_dbus_connection_flush_sync (c, + NULL, /* GCancellable* */ + &error); + g_assert_no_error (error); + g_assert (ret); + + /* and now exit immediately! */ + return 0; +} diff --git a/gio/tests/gdbus-connection-slow.c b/gio/tests/gdbus-connection-slow.c new file mode 100644 index 0000000..5511b5f --- /dev/null +++ b/gio/tests/gdbus-connection-slow.c @@ -0,0 +1,214 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_connection_flush_signal_handler (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + g_main_loop_quit (loop); +} + +static gboolean +test_connection_flush_on_timeout (gpointer user_data) +{ + guint iteration = GPOINTER_TO_UINT (user_data); + g_printerr ("Timeout waiting 1000 msec on iteration %d\n", iteration); + g_assert_not_reached (); + return FALSE; +} + +static void +test_connection_flush (void) +{ + GDBusConnection *connection; + GError *error; + guint n; + guint signal_handler_id; + + session_bus_up (); + + error = NULL; + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (connection != NULL); + + signal_handler_id = g_dbus_connection_signal_subscribe (connection, + NULL, /* sender */ + "org.gtk.GDBus.FlushInterface", + "SomeSignal", + "/org/gtk/GDBus/FlushObject", + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + test_connection_flush_signal_handler, + NULL, + NULL); + g_assert_cmpint (signal_handler_id, !=, 0); + + for (n = 0; n < 50; n++) + { + gboolean ret; + gint exit_status; + guint timeout_mainloop_id; + + error = NULL; + ret = g_spawn_command_line_sync ("./gdbus-connection-flush-helper", + NULL, /* stdout */ + NULL, /* stderr */ + &exit_status, + &error); + g_assert_no_error (error); + g_assert (WIFEXITED (exit_status)); + g_assert_cmpint (WEXITSTATUS (exit_status), ==, 0); + g_assert (ret); + + timeout_mainloop_id = g_timeout_add (1000, test_connection_flush_on_timeout, GUINT_TO_POINTER (n)); + g_main_loop_run (loop); + g_source_remove (timeout_mainloop_id); + } + + g_dbus_connection_signal_unsubscribe (connection, signal_handler_id); + _g_object_wait_for_single_ref (connection); + g_object_unref (connection); + + session_bus_down (); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +/* Message size > 20MiB ... should be enough to make sure the message + * is fragmented when shoved across any transport + */ +#define LARGE_MESSAGE_STRING_LENGTH (20*1024*1024) + +static void +large_message_on_name_appeared (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data) +{ + GError *error; + gchar *request; + const gchar *reply; + GVariant *result; + guint n; + + request = g_new (gchar, LARGE_MESSAGE_STRING_LENGTH + 1); + for (n = 0; n < LARGE_MESSAGE_STRING_LENGTH; n++) + request[n] = '0' + (n%10); + request[n] = '\0'; + + error = NULL; + result = g_dbus_connection_call_sync (connection, + "com.example.TestService", /* bus name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + "HelloWorld", /* method name */ + g_variant_new ("(s)", request), /* parameters */ + G_VARIANT_TYPE ("(s)"), /* return type */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_get (result, "(&s)", &reply); + g_assert_cmpint (strlen (reply), >, LARGE_MESSAGE_STRING_LENGTH); + g_assert (g_str_has_prefix (reply, "You greeted me with '01234567890123456789012")); + g_assert (g_str_has_suffix (reply, "6789'. Thanks!")); + g_variant_unref (result); + + g_free (request); + + g_main_loop_quit (loop); +} + +static void +large_message_on_name_vanished (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ +} + +static void +test_connection_large_message (void) +{ + guint watcher_id; + + session_bus_up (); + + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + + watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION, + "com.example.TestService", + G_BUS_NAME_WATCHER_FLAGS_NONE, + large_message_on_name_appeared, + large_message_on_name_vanished, + NULL, /* user_data */ + NULL); /* GDestroyNotify */ + g_main_loop_run (loop); + g_bus_unwatch_name (watcher_id); + + session_bus_down (); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/connection/flush", test_connection_flush); + g_test_add_func ("/gdbus/connection/large_message", test_connection_large_message); + return g_test_run(); +} diff --git a/gio/tests/gdbus-connection.c b/gio/tests/gdbus-connection.c new file mode 100644 index 0000000..5c2939e --- /dev/null +++ b/gio/tests/gdbus-connection.c @@ -0,0 +1,1076 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +G_GNUC_UNUSED static void +_log (const gchar *format, ...) +{ + GTimeVal now; + time_t now_time; + struct tm *now_tm; + gchar time_buf[128]; + gchar *str; + va_list var_args; + + va_start (var_args, format); + str = g_strdup_vprintf (format, var_args); + va_end (var_args); + + g_get_current_time (&now); + now_time = (time_t) now.tv_sec; + now_tm = localtime (&now_time); + strftime (time_buf, sizeof time_buf, "%H:%M:%S", now_tm); + + g_print ("%s.%06d: %s\n", + time_buf, (gint) now.tv_usec / 1000, + str); + g_free (str); +} + +static gboolean +test_connection_quit_mainloop (gpointer user_data) +{ + volatile gboolean *quit_mainloop_fired = user_data; + //_log ("quit_mainloop_fired"); + *quit_mainloop_fired = TRUE; + g_main_loop_quit (loop); + return TRUE; +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* Connection life-cycle testing */ +/* ---------------------------------------------------------------------------------------------------- */ + +static const GDBusInterfaceInfo boo_interface_info = +{ + -1, + "org.example.Boo", + (GDBusMethodInfo **) NULL, + (GDBusSignalInfo **) NULL, + (GDBusPropertyInfo **) NULL, + NULL, +}; + +static const GDBusInterfaceVTable boo_vtable = +{ + NULL, /* _method_call */ + NULL, /* _get_property */ + NULL /* _set_property */ +}; + +static GDBusMessage * +some_filter_func (GDBusConnection *connection, + GDBusMessage *message, + gboolean incoming, + gpointer user_data) +{ + return message; +} + +static void +on_name_owner_changed (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ +} + +static void +a_gdestroynotify_that_sets_a_gboolean_to_true_and_quits_loop (gpointer user_data) +{ + volatile gboolean *val = user_data; + *val = TRUE; + //_log ("destroynotify fired for %p", val); + g_main_loop_quit (loop); +} + +static void +test_connection_life_cycle (void) +{ + gboolean ret; + GDBusConnection *c; + GDBusConnection *c2; + GError *error; + volatile gboolean on_signal_registration_freed_called; + volatile gboolean on_filter_freed_called; + volatile gboolean on_register_object_freed_called; + volatile gboolean quit_mainloop_fired; + guint quit_mainloop_id; + guint registration_id; + + error = NULL; + + /* + * Check for correct behavior when no bus is present + * + */ + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + _g_assert_error_domain (error, G_IO_ERROR); + g_assert (!g_dbus_error_is_remote_error (error)); + g_assert (c == NULL); + g_error_free (error); + + /* + * Check for correct behavior when a bus is present + */ + session_bus_up (); + /* case 1 */ + error = NULL; + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c != NULL); + g_assert (!g_dbus_connection_is_closed (c)); + + /* + * Check that singleton handling work + */ + error = NULL; + c2 = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c2 != NULL); + g_assert (c == c2); + g_object_unref (c2); + + /* + * Check that private connections work + */ + c2 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c2 != NULL); + g_assert (c != c2); + g_object_unref (c2); + + c2 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c2 != NULL); + g_assert (!g_dbus_connection_is_closed (c2)); + ret = g_dbus_connection_close_sync (c2, NULL, &error); + g_assert_no_error (error); + g_assert (ret); + _g_assert_signal_received (c2, "closed"); + g_assert (g_dbus_connection_is_closed (c2)); + ret = g_dbus_connection_close_sync (c2, NULL, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED); + g_error_free (error); + g_assert (!ret); + g_object_unref (c2); + + /* + * Check that the finalization code works + * + * (and that the GDestroyNotify for filters and objects and signal + * registrations are run as expected) + */ + error = NULL; + c2 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c2 != NULL); + /* signal registration */ + on_signal_registration_freed_called = FALSE; + g_dbus_connection_signal_subscribe (c2, + "org.freedesktop.DBus", /* bus name */ + "org.freedesktop.DBus", /* interface */ + "NameOwnerChanged", /* member */ + "/org/freesktop/DBus", /* path */ + NULL, /* arg0 */ + G_DBUS_SIGNAL_FLAGS_NONE, + on_name_owner_changed, + (gpointer) &on_signal_registration_freed_called, + a_gdestroynotify_that_sets_a_gboolean_to_true_and_quits_loop); + /* filter func */ + on_filter_freed_called = FALSE; + g_dbus_connection_add_filter (c2, + some_filter_func, + (gpointer) &on_filter_freed_called, + a_gdestroynotify_that_sets_a_gboolean_to_true_and_quits_loop); + /* object registration */ + on_register_object_freed_called = FALSE; + error = NULL; + registration_id = g_dbus_connection_register_object (c2, + "/foo", + (GDBusInterfaceInfo *) &boo_interface_info, + &boo_vtable, + (gpointer) &on_register_object_freed_called, + a_gdestroynotify_that_sets_a_gboolean_to_true_and_quits_loop, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + /* ok, finalize the connection and check that all the GDestroyNotify functions are invoked as expected */ + g_object_unref (c2); + quit_mainloop_fired = FALSE; + quit_mainloop_id = g_timeout_add (30000, test_connection_quit_mainloop, (gpointer) &quit_mainloop_fired); + //_log ("destroynotifies for\n" + // " register_object %p\n" + // " filter %p\n" + // " signal %p", + // &on_register_object_freed_called, + // &on_filter_freed_called, + // &on_signal_registration_freed_called); + while (TRUE) + { + if (on_signal_registration_freed_called && + on_filter_freed_called && + on_register_object_freed_called) + break; + if (quit_mainloop_fired) + break; + //_log ("entering loop"); + g_main_loop_run (loop); + //_log ("exiting loop"); + } + g_source_remove (quit_mainloop_id); + g_assert (on_signal_registration_freed_called); + g_assert (on_filter_freed_called); + g_assert (on_register_object_freed_called); + g_assert (!quit_mainloop_fired); + + /* + * Check for correct behavior when the bus goes away + * + */ + g_assert (!g_dbus_connection_is_closed (c)); + g_dbus_connection_set_exit_on_close (c, FALSE); + session_bus_down (); + if (!g_dbus_connection_is_closed (c)) + _g_assert_signal_received (c, "closed"); + g_assert (g_dbus_connection_is_closed (c)); + + _g_object_wait_for_single_ref (c); + g_object_unref (c); +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that sending and receiving messages work as expected */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +msg_cb_expect_error_disconnected (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED); + g_assert (!g_dbus_error_is_remote_error (error)); + g_error_free (error); + g_assert (result == NULL); + + g_main_loop_quit (loop); +} + +static void +msg_cb_expect_error_unknown_method (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD); + g_assert (g_dbus_error_is_remote_error (error)); + g_error_free (error); + g_assert (result == NULL); + + g_main_loop_quit (loop); +} + +static void +msg_cb_expect_success (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_unref (result); + + g_main_loop_quit (loop); +} + +static void +msg_cb_expect_error_cancelled (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_assert (!g_dbus_error_is_remote_error (error)); + g_error_free (error); + g_assert (result == NULL); + + g_main_loop_quit (loop); +} + +static void +msg_cb_expect_error_cancelled_2 (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_assert (!g_dbus_error_is_remote_error (error)); + g_error_free (error); + g_assert (result == NULL); + + g_main_loop_quit (loop); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_connection_send (void) +{ + GDBusConnection *c; + GCancellable *ca; + + session_bus_up (); + + /* First, get an unopened connection */ + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c != NULL); + g_assert (!g_dbus_connection_is_closed (c)); + + /* + * Check that we never actually send a message if the GCancellable + * is already cancelled - i.e. we should get #G_IO_ERROR_CANCELLED + * when the actual connection is not up. + */ + ca = g_cancellable_new (); + g_cancellable_cancel (ca); + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + ca, + (GAsyncReadyCallback) msg_cb_expect_error_cancelled, + NULL); + g_main_loop_run (loop); + g_object_unref (ca); + + /* + * Check that we get a reply to the GetId() method call. + */ + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) msg_cb_expect_success, + NULL); + g_main_loop_run (loop); + + /* + * Check that we get an error reply to the NonExistantMethod() method call. + */ + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "NonExistantMethod", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) msg_cb_expect_error_unknown_method, + NULL); + g_main_loop_run (loop); + + /* + * Check that cancellation works when the message is already in flight. + */ + ca = g_cancellable_new (); + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + ca, + (GAsyncReadyCallback) msg_cb_expect_error_cancelled_2, + NULL); + g_cancellable_cancel (ca); + g_main_loop_run (loop); + g_object_unref (ca); + + /* + * Check that we get an error when sending to a connection that is disconnected. + */ + g_dbus_connection_set_exit_on_close (c, FALSE); + session_bus_down (); + _g_assert_signal_received (c, "closed"); + g_assert (g_dbus_connection_is_closed (c)); + + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) msg_cb_expect_error_disconnected, + NULL); + g_main_loop_run (loop); + + _g_object_wait_for_single_ref (c); + g_object_unref (c); +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* Connection signal tests */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_connection_signal_handler (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + gint *counter = user_data; + *counter += 1; + + /*g_debug ("in test_connection_signal_handler (sender=%s path=%s interface=%s member=%s)", + sender_name, + object_path, + interface_name, + signal_name);*/ + + g_main_loop_quit (loop); +} + +static void +test_connection_signals (void) +{ + GDBusConnection *c1; + GDBusConnection *c2; + GDBusConnection *c3; + guint s1; + guint s1b; + guint s2; + guint s3; + gint count_s1; + gint count_s1b; + gint count_s2; + gint count_name_owner_changed; + GError *error; + gboolean ret; + GVariant *result; + + error = NULL; + + /* + * Bring up first separate connections + */ + session_bus_up (); + /* if running with dbus-monitor, it claims the name :1.0 - so if we don't run with the monitor + * emulate this + */ + if (g_getenv ("G_DBUS_MONITOR") == NULL) + { + c1 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c1 != NULL); + g_assert (!g_dbus_connection_is_closed (c1)); + g_object_unref (c1); + } + c1 = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c1 != NULL); + g_assert (!g_dbus_connection_is_closed (c1)); + g_assert_cmpstr (g_dbus_connection_get_unique_name (c1), ==, ":1.1"); + + /* + * Install two signal handlers for the first connection + * + * - Listen to the signal "Foo" from :1.2 (e.g. c2) + * - Listen to the signal "Foo" from anyone (e.g. both c2 and c3) + * + * and then count how many times this signal handler was invoked. + */ + s1 = g_dbus_connection_signal_subscribe (c1, + ":1.2", + "org.gtk.GDBus.ExampleInterface", + "Foo", + "/org/gtk/GDBus/ExampleInterface", + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + test_connection_signal_handler, + &count_s1, + NULL); + s2 = g_dbus_connection_signal_subscribe (c1, + NULL, /* match any sender */ + "org.gtk.GDBus.ExampleInterface", + "Foo", + "/org/gtk/GDBus/ExampleInterface", + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + test_connection_signal_handler, + &count_s2, + NULL); + s3 = g_dbus_connection_signal_subscribe (c1, + "org.freedesktop.DBus", /* sender */ + "org.freedesktop.DBus", /* interface */ + "NameOwnerChanged", /* member */ + "/org/freedesktop/DBus", /* path */ + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + test_connection_signal_handler, + &count_name_owner_changed, + NULL); + /* Note that s1b is *just like* s1 - this is to catch a bug where N + * subscriptions of the same rule causes N calls to each of the N + * subscriptions instead of just 1 call to each of the N subscriptions. + */ + s1b = g_dbus_connection_signal_subscribe (c1, + ":1.2", + "org.gtk.GDBus.ExampleInterface", + "Foo", + "/org/gtk/GDBus/ExampleInterface", + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + test_connection_signal_handler, + &count_s1b, + NULL); + g_assert (s1 != 0); + g_assert (s1b != 0); + g_assert (s2 != 0); + g_assert (s3 != 0); + + count_s1 = 0; + count_s1b = 0; + count_s2 = 0; + count_name_owner_changed = 0; + + /* + * Bring up two other connections + */ + c2 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c2 != NULL); + g_assert (!g_dbus_connection_is_closed (c2)); + g_assert_cmpstr (g_dbus_connection_get_unique_name (c2), ==, ":1.2"); + c3 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c3 != NULL); + g_assert (!g_dbus_connection_is_closed (c3)); + g_assert_cmpstr (g_dbus_connection_get_unique_name (c3), ==, ":1.3"); + + /* + * Make c2 emit "Foo" - we should catch it twice + * + * Note that there is no way to be sure that the signal subscriptions + * on c1 are effective yet - for all we know, the AddMatch() messages + * could sit waiting in a buffer somewhere between this process and + * the message bus. And emitting signals on c2 (a completely other + * socket!) will not necessarily change this. + * + * To ensure this is not the case, do a synchronous call on c1. + */ + result = g_dbus_connection_call_sync (c1, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, /* parameters */ + NULL, /* return type */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_unref (result); + /* now, emit the signal on c2 */ + ret = g_dbus_connection_emit_signal (c2, + NULL, /* destination bus name */ + "/org/gtk/GDBus/ExampleInterface", + "org.gtk.GDBus.ExampleInterface", + "Foo", + NULL, + &error); + g_assert_no_error (error); + g_assert (ret); + while (!(count_s1 >= 1 && count_s2 >= 1)) + g_main_loop_run (loop); + g_assert_cmpint (count_s1, ==, 1); + g_assert_cmpint (count_s2, ==, 1); + + /* + * Make c3 emit "Foo" - we should catch it only once + */ + ret = g_dbus_connection_emit_signal (c3, + NULL, /* destination bus name */ + "/org/gtk/GDBus/ExampleInterface", + "org.gtk.GDBus.ExampleInterface", + "Foo", + NULL, + &error); + g_assert_no_error (error); + g_assert (ret); + while (!(count_s1 == 1 && count_s2 == 2)) + g_main_loop_run (loop); + g_assert_cmpint (count_s1, ==, 1); + g_assert_cmpint (count_s2, ==, 2); + + /* + * Also to check the total amount of NameOwnerChanged signals - use a 5 second ceiling + * to avoid spinning forever + */ + gboolean quit_mainloop_fired; + guint quit_mainloop_id; + quit_mainloop_fired = FALSE; + quit_mainloop_id = g_timeout_add (30000, test_connection_quit_mainloop, &quit_mainloop_fired); + while (count_name_owner_changed < 2 && !quit_mainloop_fired) + g_main_loop_run (loop); + g_source_remove (quit_mainloop_id); + g_assert_cmpint (count_s1, ==, 1); + g_assert_cmpint (count_s2, ==, 2); + g_assert_cmpint (count_name_owner_changed, ==, 2); + + g_dbus_connection_signal_unsubscribe (c1, s1); + g_dbus_connection_signal_unsubscribe (c1, s2); + g_dbus_connection_signal_unsubscribe (c1, s3); + g_dbus_connection_signal_unsubscribe (c1, s1b); + + _g_object_wait_for_single_ref (c1); + _g_object_wait_for_single_ref (c2); + _g_object_wait_for_single_ref (c3); + + g_object_unref (c1); + g_object_unref (c2); + g_object_unref (c3); + + session_bus_down (); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + guint num_handled; + guint num_outgoing; + guint32 serial; +} FilterData; + +static GDBusMessage * +filter_func (GDBusConnection *connection, + GDBusMessage *message, + gboolean incoming, + gpointer user_data) +{ + FilterData *data = user_data; + guint32 reply_serial; + + if (incoming) + { + reply_serial = g_dbus_message_get_reply_serial (message); + if (reply_serial == data->serial) + data->num_handled += 1; + } + else + { + data->num_outgoing += 1; + } + + return message; +} + + +typedef struct +{ + gboolean alter_incoming; + gboolean alter_outgoing; +} FilterEffects; + +static GDBusMessage * +other_filter_func (GDBusConnection *connection, + GDBusMessage *message, + gboolean incoming, + gpointer user_data) +{ + FilterEffects *effects = user_data; + GDBusMessage *ret; + gboolean alter; + + if (incoming) + alter = effects->alter_incoming; + else + alter = effects->alter_outgoing; + + if (alter) + { + GDBusMessage *copy; + GVariant *body; + gchar *s; + gchar *s2; + + copy = g_dbus_message_copy (message, NULL); + g_object_unref (message); + + body = g_dbus_message_get_body (copy); + g_variant_get (body, "(s)", &s); + s2 = g_strdup_printf ("MOD: %s", s); + g_dbus_message_set_body (copy, g_variant_new ("(s)", s2)); + g_free (s2); + g_free (s); + + ret = copy; + } + else + { + ret = message; + } + + return ret; +} + +static void +test_connection_filter_name_owner_changed_signal_handler (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + const gchar *name; + const gchar *old_owner; + const gchar *new_owner; + + g_variant_get (parameters, + "(&s&s&s)", + &name, + &old_owner, + &new_owner); + + if (g_strcmp0 (name, "com.example.TestService") == 0 && strlen (new_owner) > 0) + { + g_main_loop_quit (loop); + } +} + +static gboolean +test_connection_filter_on_timeout (gpointer user_data) +{ + g_printerr ("Timeout waiting 30 sec on service\n"); + g_assert_not_reached (); + return FALSE; +} + +static void +test_connection_filter (void) +{ + GDBusConnection *c; + FilterData data; + GDBusMessage *m; + GDBusMessage *m2; + GDBusMessage *r; + GError *error; + guint filter_id; + guint timeout_mainloop_id; + guint signal_handler_id; + FilterEffects effects; + GVariant *result; + const gchar *s; + + memset (&data, '\0', sizeof (FilterData)); + + session_bus_up (); + + error = NULL; + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c != NULL); + + filter_id = g_dbus_connection_add_filter (c, + filter_func, + &data, + NULL); + + m = g_dbus_message_new_method_call ("org.freedesktop.DBus", /* name */ + "/org/freedesktop/DBus", /* path */ + "org.freedesktop.DBus", /* interface */ + "GetNameOwner"); + g_dbus_message_set_body (m, g_variant_new ("(s)", "org.freedesktop.DBus")); + error = NULL; + g_dbus_connection_send_message (c, m, G_DBUS_SEND_MESSAGE_FLAGS_NONE, &data.serial, &error); + g_assert_no_error (error); + + while (data.num_handled == 0) + g_thread_yield (); + + m2 = g_dbus_message_copy (m, &error); + g_assert_no_error (error); + g_dbus_connection_send_message (c, m2, G_DBUS_SEND_MESSAGE_FLAGS_NONE, &data.serial, &error); + g_object_unref (m2); + g_assert_no_error (error); + + while (data.num_handled == 1) + g_thread_yield (); + + m2 = g_dbus_message_copy (m, &error); + g_assert_no_error (error); + g_dbus_message_set_serial (m2, data.serial); + /* lock the message to test PRESERVE_SERIAL flag. */ + g_dbus_message_lock (m2); + g_dbus_connection_send_message (c, m2, G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL, &data.serial, &error); + g_object_unref (m2); + g_assert_no_error (error); + + while (data.num_handled == 2) + g_thread_yield (); + + m2 = g_dbus_message_copy (m, &error); + g_assert_no_error (error); + r = g_dbus_connection_send_message_with_reply_sync (c, + m2, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + -1, + &data.serial, + NULL, /* GCancellable */ + &error); + g_object_unref (m2); + g_assert_no_error (error); + g_assert (r != NULL); + g_object_unref (r); + g_assert_cmpint (data.num_handled, ==, 4); + + g_dbus_connection_remove_filter (c, filter_id); + + m2 = g_dbus_message_copy (m, &error); + g_assert_no_error (error); + r = g_dbus_connection_send_message_with_reply_sync (c, + m2, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + -1, + &data.serial, + NULL, /* GCancellable */ + &error); + g_object_unref (m2); + g_assert_no_error (error); + g_assert (r != NULL); + g_object_unref (r); + g_assert_cmpint (data.num_handled, ==, 4); + g_assert_cmpint (data.num_outgoing, ==, 4); + + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + /* wait for service to be available */ + signal_handler_id = g_dbus_connection_signal_subscribe (c, + "org.freedesktop.DBus", /* sender */ + "org.freedesktop.DBus", + "NameOwnerChanged", + "/org/freedesktop/DBus", + NULL, /* arg0 */ + G_DBUS_SIGNAL_FLAGS_NONE, + test_connection_filter_name_owner_changed_signal_handler, + NULL, + NULL); + g_assert_cmpint (signal_handler_id, !=, 0); + timeout_mainloop_id = g_timeout_add (30000, test_connection_filter_on_timeout, NULL); + g_main_loop_run (loop); + g_source_remove (timeout_mainloop_id); + g_dbus_connection_signal_unsubscribe (c, signal_handler_id); + + /* now test some combinations... */ + filter_id = g_dbus_connection_add_filter (c, + other_filter_func, + &effects, + NULL); + /* -- */ + effects.alter_incoming = FALSE; + effects.alter_outgoing = FALSE; + error = NULL; + result = g_dbus_connection_call_sync (c, + "com.example.TestService", /* bus name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + "HelloWorld", /* method name */ + g_variant_new ("(s)", "Cat"), /* parameters */ + G_VARIANT_TYPE ("(s)"), /* return type */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_variant_get (result, "(&s)", &s); + g_assert_cmpstr (s, ==, "You greeted me with 'Cat'. Thanks!"); + g_variant_unref (result); + /* -- */ + effects.alter_incoming = TRUE; + effects.alter_outgoing = TRUE; + error = NULL; + result = g_dbus_connection_call_sync (c, + "com.example.TestService", /* bus name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + "HelloWorld", /* method name */ + g_variant_new ("(s)", "Cat"), /* parameters */ + G_VARIANT_TYPE ("(s)"), /* return type */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_variant_get (result, "(&s)", &s); + g_assert_cmpstr (s, ==, "MOD: You greeted me with 'MOD: Cat'. Thanks!"); + g_variant_unref (result); + + + g_dbus_connection_remove_filter (c, filter_id); + + _g_object_wait_for_single_ref (c); + g_object_unref (c); + g_object_unref (m); + + session_bus_down (); +} + +static void +test_connection_basic (void) +{ + GDBusConnection *connection; + GError *error; + GDBusCapabilityFlags flags; + gchar *guid; + gchar *name; + gboolean closed; + gboolean exit_on_close; + GIOStream *stream; + GCredentials *credentials; + + session_bus_up (); + + error = NULL; + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (connection != NULL); + + flags = g_dbus_connection_get_capabilities (connection); + g_assert (flags == G_DBUS_CAPABILITY_FLAGS_NONE || + flags == G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); + + credentials = g_dbus_connection_get_peer_credentials (connection); + g_assert (credentials == NULL); + + g_object_get (connection, + "stream", &stream, + "guid", &guid, + "unique-name", &name, + "closed", &closed, + "exit-on-close", &exit_on_close, + "capabilities", &flags, + NULL); + + g_assert (G_IS_IO_STREAM (stream)); + g_assert (g_dbus_is_guid (guid)); + g_assert (g_dbus_is_unique_name (name)); + g_assert (!closed); + g_assert (exit_on_close); + g_assert (flags == G_DBUS_CAPABILITY_FLAGS_NONE || + flags == G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); + g_object_unref (stream); + g_free (name); + g_free (guid); + + _g_object_wait_for_single_ref (connection); + g_object_unref (connection); + + session_bus_down (); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/connection/basic", test_connection_basic); + g_test_add_func ("/gdbus/connection/life-cycle", test_connection_life_cycle); + g_test_add_func ("/gdbus/connection/send", test_connection_send); + g_test_add_func ("/gdbus/connection/signals", test_connection_signals); + g_test_add_func ("/gdbus/connection/filter", test_connection_filter); + return g_test_run(); +} diff --git a/gio/tests/gdbus-error.c b/gio/tests/gdbus-error.c new file mode 100644 index 0000000..00dfc61 --- /dev/null +++ b/gio/tests/gdbus-error.c @@ -0,0 +1,269 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that registered errors are properly mapped */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +check_registered_error (const gchar *given_dbus_error_name, + GQuark error_domain, + gint error_code) +{ + GError *error; + gchar *dbus_error_name; + + error = g_dbus_error_new_for_dbus_error (given_dbus_error_name, "test message"); + g_assert_error (error, error_domain, error_code); + g_assert (g_dbus_error_is_remote_error (error)); + g_assert (g_dbus_error_strip_remote_error (error)); + g_assert_cmpstr (error->message, ==, "test message"); + dbus_error_name = g_dbus_error_get_remote_error (error); + g_assert_cmpstr (dbus_error_name, ==, given_dbus_error_name); + g_free (dbus_error_name); + g_error_free (error); +} + +static void +test_registered_errors (void) +{ + /* Here we check that we are able to map to GError and back for registered + * errors. + * + * For example, if "org.freedesktop.DBus.Error.AddressInUse" is + * associated with (G_DBUS_ERROR, G_DBUS_ERROR_DBUS_FAILED), check + * that + * + * - Creating a GError for e.g. "org.freedesktop.DBus.Error.AddressInUse" + * has (error_domain, code) == (G_DBUS_ERROR, G_DBUS_ERROR_DBUS_FAILED) + * + * - That it is possible to recover e.g. "org.freedesktop.DBus.Error.AddressInUse" + * as the D-Bus error name when dealing with an error with (error_domain, code) == + * (G_DBUS_ERROR, G_DBUS_ERROR_DBUS_FAILED) + * + * We just check a couple of well-known errors. + */ + check_registered_error ("org.freedesktop.DBus.Error.Failed", + G_DBUS_ERROR, + G_DBUS_ERROR_FAILED); + check_registered_error ("org.freedesktop.DBus.Error.AddressInUse", + G_DBUS_ERROR, + G_DBUS_ERROR_ADDRESS_IN_USE); + check_registered_error ("org.freedesktop.DBus.Error.UnknownMethod", + G_DBUS_ERROR, + G_DBUS_ERROR_UNKNOWN_METHOD); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +check_unregistered_error (const gchar *given_dbus_error_name) +{ + GError *error; + gchar *dbus_error_name; + + error = g_dbus_error_new_for_dbus_error (given_dbus_error_name, "test message"); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR); + g_assert (g_dbus_error_is_remote_error (error)); + dbus_error_name = g_dbus_error_get_remote_error (error); + g_assert_cmpstr (dbus_error_name, ==, given_dbus_error_name); + g_free (dbus_error_name); + + /* strip the message */ + g_assert (g_dbus_error_strip_remote_error (error)); + g_assert_cmpstr (error->message, ==, "test message"); + + /* check that we can no longer recover the D-Bus error name */ + g_assert (g_dbus_error_get_remote_error (error) == NULL); + + g_error_free (error); + +} + +static void +test_unregistered_errors (void) +{ + /* Here we check that we are able to map to GError and back for unregistered + * errors. + * + * For example, if "com.example.Error.Failed" is not registered, then check + * + * - Creating a GError for e.g. "com.example.Error.Failed" has (error_domain, code) == + * (G_IO_ERROR, G_IO_ERROR_DBUS_ERROR) + * + * - That it is possible to recover e.g. "com.example.Error.Failed" from that + * GError. + * + * We just check a couple of random errors. + */ + + check_unregistered_error ("com.example.Error.Failed"); + check_unregistered_error ("foobar.buh"); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +check_transparent_gerror (GQuark error_domain, + gint error_code) +{ + GError *error; + gchar *given_dbus_error_name; + gchar *dbus_error_name; + + error = g_error_new (error_domain, error_code, "test message"); + given_dbus_error_name = g_dbus_error_encode_gerror (error); + g_assert (g_str_has_prefix (given_dbus_error_name, "org.gtk.GDBus.UnmappedGError.Quark")); + g_error_free (error); + + error = g_dbus_error_new_for_dbus_error (given_dbus_error_name, "test message"); + g_assert_error (error, error_domain, error_code); + g_assert (g_dbus_error_is_remote_error (error)); + dbus_error_name = g_dbus_error_get_remote_error (error); + g_assert_cmpstr (dbus_error_name, ==, given_dbus_error_name); + g_free (dbus_error_name); + g_free (given_dbus_error_name); + + /* strip the message */ + g_assert (g_dbus_error_strip_remote_error (error)); + g_assert_cmpstr (error->message, ==, "test message"); + + /* check that we can no longer recover the D-Bus error name */ + g_assert (g_dbus_error_get_remote_error (error) == NULL); + + g_error_free (error); +} + +static void +test_transparent_gerror (void) +{ + /* Here we check that we are able to transparent pass unregistered GError's + * over the wire. + * + * For example, if G_IO_ERROR_FAILED is not registered, then check + * + * - g_dbus_error_encode_gerror() returns something of the form + * org.gtk.GDBus.UnmappedGError.Quark_HEXENCODED_QUARK_NAME_.Code_ERROR_CODE + * + * - mapping back the D-Bus error name gives us G_IO_ERROR_FAILED + * + * - That it is possible to recover the D-Bus error name from the + * GError. + * + * We just check a couple of random errors. + */ + + check_transparent_gerror (G_IO_ERROR, G_IO_ERROR_FAILED); + check_transparent_gerror (G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE); +} + +typedef enum +{ + TEST_ERROR_FAILED, + TEST_ERROR_BLA +} TestError; + +GDBusErrorEntry test_error_entries[] = +{ + { TEST_ERROR_FAILED, "org.gtk.test.Error.Failed" }, + { TEST_ERROR_BLA, "org.gtk.test.Error.Bla" } +}; + +static void +test_register_error (void) +{ + gsize test_error_quark = 0; + gboolean res; + gchar *msg; + GError *error; + + g_dbus_error_register_error_domain ("test-error-quark", + &test_error_quark, + test_error_entries, + G_N_ELEMENTS (test_error_entries)); + g_assert_cmpint (test_error_quark, !=, 0); + + error = g_dbus_error_new_for_dbus_error ("org.gtk.test.Error.Failed", "Failed"); + g_assert_error (error, test_error_quark, TEST_ERROR_FAILED); + res = g_dbus_error_is_remote_error (error); + msg = g_dbus_error_get_remote_error (error); + g_assert (res); + g_assert_cmpstr (msg, ==, "org.gtk.test.Error.Failed"); + res = g_dbus_error_strip_remote_error (error); + g_assert (res); + g_assert_cmpstr (error->message, ==, "Failed"); + g_clear_error (&error); + g_free (msg); + + g_dbus_error_set_dbus_error (&error, "org.gtk.test.Error.Failed", "Failed again", "Prefix %d", 1); + res = g_dbus_error_is_remote_error (error); + msg = g_dbus_error_get_remote_error (error); + g_assert (res); + g_assert_cmpstr (msg, ==, "org.gtk.test.Error.Failed"); + res = g_dbus_error_strip_remote_error (error); + g_assert (res); + g_assert_cmpstr (error->message, ==, "Prefix 1: Failed again"); + g_clear_error (&error); + g_free (msg); + + error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_EMPTY, "Not Empty"); + res = g_dbus_error_is_remote_error (error); + msg = g_dbus_error_get_remote_error (error); + g_assert (!res); + g_assert_cmpstr (msg, ==, NULL); + res = g_dbus_error_strip_remote_error (error); + g_assert (!res); + g_assert_cmpstr (error->message, ==, "Not Empty"); + g_clear_error (&error); + + error = g_error_new_literal (test_error_quark, TEST_ERROR_BLA, "Bla"); + msg = g_dbus_error_encode_gerror (error); + g_assert_cmpstr (msg, ==, "org.gtk.test.Error.Bla"); + g_free (msg); + g_clear_error (&error); + + res = g_dbus_error_unregister_error (test_error_quark, + TEST_ERROR_BLA, "org.gtk.test.Error.Bla"); + g_assert (res); +} + + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/gdbus/registered-errors", test_registered_errors); + g_test_add_func ("/gdbus/unregistered-errors", test_unregistered_errors); + g_test_add_func ("/gdbus/transparent-gerror", test_transparent_gerror); + g_test_add_func ("/gdbus/register-error", test_register_error); + + return g_test_run(); +} diff --git a/gio/tests/gdbus-example-export.c b/gio/tests/gdbus-example-export.c new file mode 100644 index 0000000..5dda58d --- /dev/null +++ b/gio/tests/gdbus-example-export.c @@ -0,0 +1,335 @@ +#include +#include + +/* ---------------------------------------------------------------------------------------------------- */ + +/* The object we want to export */ +typedef struct _MyObjectClass MyObjectClass; +typedef struct _MyObject MyObject; + +struct _MyObjectClass +{ + GObjectClass parent_class; +}; + +struct _MyObject +{ + GObject parent_instance; + + gint count; + gchar *name; +}; + +enum +{ + PROP_0, + PROP_COUNT, + PROP_NAME +}; + +G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT); + +static void +my_object_finalize (GObject *object) +{ + MyObject *myobj = (MyObject*)object; + + g_free (myobj->name); + + G_OBJECT_CLASS (my_object_parent_class)->finalize (object); +} + +static void +my_object_init (MyObject *object) +{ + object->count = 0; + object->name = NULL; +} + +static void +my_object_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MyObject *myobj = (MyObject*)object; + + switch (prop_id) + { + case PROP_COUNT: + g_value_set_int (value, myobj->count); + break; + + case PROP_NAME: + g_value_set_string (value, myobj->name); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +my_object_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MyObject *myobj = (MyObject*)object; + + switch (prop_id) + { + case PROP_COUNT: + myobj->count = g_value_get_int (value); + break; + + case PROP_NAME: + g_free (myobj->name); + myobj->name = g_value_dup_string (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +my_object_class_init (MyObjectClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + + gobject_class->finalize = my_object_finalize; + gobject_class->set_property = my_object_set_property; + gobject_class->get_property = my_object_get_property; + + g_object_class_install_property (gobject_class, + PROP_COUNT, + g_param_spec_int ("count", + "Count", + "Count", + 0, 99999, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (gobject_class, + PROP_NAME, + g_param_spec_string ("name", + "Name", + "Name", + NULL, + G_PARAM_READWRITE)); +} + +/* A method that we want to export */ +void +my_object_change_count (MyObject *myobj, + gint change) +{ + myobj->count = 2 * myobj->count + change; + + g_object_notify (G_OBJECT (myobj), "count"); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusNodeInfo *introspection_data = NULL; + +/* Introspection data for the service we are exporting */ +static const gchar introspection_xml[] = + "" + " " + " " + " " + " " + " " + " " + " " + ""; + + +static void +handle_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + MyObject *myobj = user_data; + + if (g_strcmp0 (method_name, "ChangeCount") == 0) + { + gint change; + g_variant_get (parameters, "(i)", &change); + + my_object_change_count (myobj, change); + + g_dbus_method_invocation_return_value (invocation, NULL); + } +} + +static GVariant * +handle_get_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GVariant *ret; + MyObject *myobj = user_data; + + ret = NULL; + if (g_strcmp0 (property_name, "Count") == 0) + { + ret = g_variant_new_int32 (myobj->count); + } + else if (g_strcmp0 (property_name, "Name") == 0) + { + ret = g_variant_new_string (myobj->name ? myobj->name : ""); + } + + return ret; +} + +static gboolean +handle_set_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *value, + GError **error, + gpointer user_data) +{ + MyObject *myobj = user_data; + + if (g_strcmp0 (property_name, "Count") == 0) + { + g_object_set (myobj, "count", g_variant_get_int32 (value), NULL); + } + else if (g_strcmp0 (property_name, "Name") == 0) + { + g_object_set (myobj, "name", g_variant_get_string (value, NULL), NULL); + } + + return TRUE; +} + + +/* for now */ +static const GDBusInterfaceVTable interface_vtable = +{ + handle_method_call, + handle_get_property, + handle_set_property +}; + +static void +send_property_change (GObject *obj, + GParamSpec *pspec, + GDBusConnection *connection) +{ + GVariantBuilder *builder; + GVariantBuilder *invalidated_builder; + MyObject *myobj = (MyObject *)obj; + + builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY); + invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as")); + + if (g_strcmp0 (pspec->name, "count") == 0) + g_variant_builder_add (builder, + "{sv}", + "Count", g_variant_new_int32 (myobj->count)); + else if (g_strcmp0 (pspec->name, "name") == 0) + g_variant_builder_add (builder, + "{sv}", + "Name", g_variant_new_string (myobj->name ? myobj->name : "")); + + g_dbus_connection_emit_signal (connection, + NULL, + "/org/myorg/MyObject", + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + g_variant_new ("(sa{sv}as)", + "org.myorg.MyObject", + builder, + invalidated_builder), + NULL); +} + +static void +on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + MyObject *myobj = user_data; + guint registration_id; + + g_signal_connect (myobj, "notify", + G_CALLBACK (send_property_change), connection); + registration_id = g_dbus_connection_register_object (connection, + "/org/myorg/MyObject", + introspection_data->interfaces[0], + &interface_vtable, + myobj, + NULL, /* user_data_free_func */ + NULL); /* GError** */ + g_assert (registration_id > 0); +} + +static void +on_name_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ +} + +static void +on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + exit (1); +} + +int +main (int argc, char *argv[]) +{ + guint owner_id; + GMainLoop *loop; + MyObject *myobj; + + g_type_init (); + + /* We are lazy here - we don't want to manually provide + * the introspection data structures - so we just build + * them from XML. + */ + introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + g_assert (introspection_data != NULL); + + myobj = g_object_new (my_object_get_type (), NULL); + + owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + "org.myorg.MyObject", + G_BUS_NAME_OWNER_FLAGS_NONE, + on_bus_acquired, + on_name_acquired, + on_name_lost, + myobj, + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_bus_unown_name (owner_id); + + g_dbus_node_info_unref (introspection_data); + + g_object_unref (myobj); + + return 0; +} diff --git a/gio/tests/gdbus-example-own-name.c b/gio/tests/gdbus-example-own-name.c new file mode 100644 index 0000000..0466cd4 --- /dev/null +++ b/gio/tests/gdbus-example-own-name.c @@ -0,0 +1,86 @@ +#include + +static void +on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + /* This is where we'd export some objects on the bus */ +} + +static void +on_name_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + g_print ("Acquired the name %s on the session bus\n", name); +} + +static void +on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + g_print ("Lost the name %s on the session bus\n", name); +} + +int +main (int argc, char *argv[]) +{ + guint owner_id; + GMainLoop *loop; + GBusNameOwnerFlags flags; + gboolean opt_replace; + gboolean opt_allow_replacement; + gchar *opt_name; + GOptionContext *opt_context; + GError *error; + GOptionEntry opt_entries[] = + { + { "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace existing name if possible", NULL }, + { "allow-replacement", 'a', 0, G_OPTION_ARG_NONE, &opt_allow_replacement, "Allow replacement", NULL }, + { "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name to acquire", NULL }, + { NULL} + }; + + g_type_init (); + + error = NULL; + opt_name = NULL; + opt_replace = FALSE; + opt_allow_replacement = FALSE; + opt_context = g_option_context_new ("g_bus_own_name() example"); + g_option_context_add_main_entries (opt_context, opt_entries, NULL); + if (!g_option_context_parse (opt_context, &argc, &argv, &error)) + { + g_printerr ("Error parsing options: %s", error->message); + return 1; + } + if (opt_name == NULL) + { + g_printerr ("Incorrect usage, try --help.\n"); + return 1; + } + + flags = G_BUS_NAME_OWNER_FLAGS_NONE; + if (opt_replace) + flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE; + if (opt_allow_replacement) + flags |= G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT; + + owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + opt_name, + flags, + on_bus_acquired, + on_name_acquired, + on_name_lost, + NULL, + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_bus_unown_name (owner_id); + + return 0; +} diff --git a/gio/tests/gdbus-example-peer.c b/gio/tests/gdbus-example-peer.c new file mode 100644 index 0000000..cb54a13 --- /dev/null +++ b/gio/tests/gdbus-example-peer.c @@ -0,0 +1,308 @@ +/* + +Usage examples (modulo addresses / credentials). + +UNIX domain socket transport: + + Server: + $ ./gdbus-example-peer --server --address unix:abstract=myaddr + Server is listening at: unix:abstract=myaddr + Client connected. + Peer credentials: GCredentials:unix-user=500,unix-group=500,unix-process=13378 + Negotiated capabilities: unix-fd-passing=1 + Client said: Hey, it's 1273093080 already! + + Client: + $ ./gdbus-example-peer --address unix:abstract=myaddr + Connected. + Negotiated capabilities: unix-fd-passing=1 + Server said: You said 'Hey, it's 1273093080 already!'. KTHXBYE! + +Nonce-secured TCP transport on the same host: + + Server: + $ ./gdbus-example-peer --server --address nonce-tcp: + Server is listening at: nonce-tcp:host=localhost,port=43077,noncefile=/tmp/gdbus-nonce-file-X1ZNCV + Client connected. + Peer credentials: (no credentials received) + Negotiated capabilities: unix-fd-passing=0 + Client said: Hey, it's 1273093206 already! + + Client: + $ ./gdbus-example-peer -address nonce-tcp:host=localhost,port=43077,noncefile=/tmp/gdbus-nonce-file-X1ZNCV + Connected. + Negotiated capabilities: unix-fd-passing=0 + Server said: You said 'Hey, it's 1273093206 already!'. KTHXBYE! + +TCP transport on two different hosts with a shared home directory: + + Server: + host1 $ ./gdbus-example-peer --server --address tcp:host=0.0.0.0 + Server is listening at: tcp:host=0.0.0.0,port=46314 + Client connected. + Peer credentials: (no credentials received) + Negotiated capabilities: unix-fd-passing=0 + Client said: Hey, it's 1273093337 already! + + Client: + host2 $ ./gdbus-example-peer -a tcp:host=host1,port=46314 + Connected. + Negotiated capabilities: unix-fd-passing=0 + Server said: You said 'Hey, it's 1273093337 already!'. KTHXBYE! + +TCP transport on two different hosts without authentication: + + Server: + host1 $ ./gdbus-example-peer --server --address tcp:host=0.0.0.0 --allow-anonymous + Server is listening at: tcp:host=0.0.0.0,port=59556 + Client connected. + Peer credentials: (no credentials received) + Negotiated capabilities: unix-fd-passing=0 + Client said: Hey, it's 1273093652 already! + + Client: + host2 $ ./gdbus-example-peer -a tcp:host=host1,port=59556 + Connected. + Negotiated capabilities: unix-fd-passing=0 + Server said: You said 'Hey, it's 1273093652 already!'. KTHXBYE! + + */ + +#include +#include + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusNodeInfo *introspection_data = NULL; + +/* Introspection data for the service we are exporting */ +static const gchar introspection_xml[] = + "" + " " + " " + " " + " " + " " + " " + ""; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +handle_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + if (g_strcmp0 (method_name, "HelloWorld") == 0) + { + const gchar *greeting; + gchar *response; + + g_variant_get (parameters, "(&s)", &greeting); + response = g_strdup_printf ("You said '%s'. KTHXBYE!", greeting); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", response)); + g_free (response); + g_print ("Client said: %s\n", greeting); + } +} + +static const GDBusInterfaceVTable interface_vtable = +{ + handle_method_call, + NULL, + NULL, +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +on_new_connection (GDBusServer *server, + GDBusConnection *connection, + gpointer user_data) +{ + guint registration_id; + GCredentials *credentials; + gchar *s; + + credentials = g_dbus_connection_get_peer_credentials (connection); + if (credentials == NULL) + s = g_strdup ("(no credentials received)"); + else + s = g_credentials_to_string (credentials); + + + g_print ("Client connected.\n" + "Peer credentials: %s\n" + "Negotiated capabilities: unix-fd-passing=%d\n", + s, + g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); + + g_object_ref (connection); + registration_id = g_dbus_connection_register_object (connection, + "/org/gtk/GDBus/TestObject", + introspection_data->interfaces[0], + &interface_vtable, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + NULL); /* GError** */ + g_assert (registration_id > 0); + + return TRUE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, char *argv[]) +{ + gint ret; + gboolean opt_server; + gchar *opt_address; + GOptionContext *opt_context; + gboolean opt_allow_anonymous; + GError *error; + GOptionEntry opt_entries[] = + { + { "server", 's', 0, G_OPTION_ARG_NONE, &opt_server, "Start a server instead of a client", NULL }, + { "address", 'a', 0, G_OPTION_ARG_STRING, &opt_address, "D-Bus address to use", NULL }, + { "allow-anonymous", 'n', 0, G_OPTION_ARG_NONE, &opt_allow_anonymous, "Allow anonymous authentication", NULL }, + { NULL} + }; + + ret = 1; + + g_type_init (); + + opt_address = NULL; + opt_server = FALSE; + opt_allow_anonymous = FALSE; + + opt_context = g_option_context_new ("peer-to-peer example"); + error = NULL; + g_option_context_add_main_entries (opt_context, opt_entries, NULL); + if (!g_option_context_parse (opt_context, &argc, &argv, &error)) + { + g_printerr ("Error parsing options: %s\n", error->message); + g_error_free (error); + goto out; + } + if (opt_address == NULL) + { + g_printerr ("Incorrect usage, try --help.\n"); + goto out; + } + if (!opt_server && opt_allow_anonymous) + { + g_printerr ("The --allow-anonymous option only makes sense when used with --server.\n"); + goto out; + } + + /* We are lazy here - we don't want to manually provide + * the introspection data structures - so we just build + * them from XML. + */ + introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + g_assert (introspection_data != NULL); + + if (opt_server) + { + GDBusServer *server; + gchar *guid; + GMainLoop *loop; + GDBusServerFlags server_flags; + + guid = g_dbus_generate_guid (); + + server_flags = G_DBUS_SERVER_FLAGS_NONE; + if (opt_allow_anonymous) + server_flags |= G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS; + + error = NULL; + server = g_dbus_server_new_sync (opt_address, + server_flags, + guid, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + &error); + g_dbus_server_start (server); + g_free (guid); + + if (server == NULL) + { + g_printerr ("Error creating server at address %s: %s\n", opt_address, error->message); + g_error_free (error); + goto out; + } + g_print ("Server is listening at: %s\n", g_dbus_server_get_client_address (server)); + g_signal_connect (server, + "new-connection", + G_CALLBACK (on_new_connection), + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_object_unref (server); + g_main_loop_unref (loop); + } + else + { + GDBusConnection *connection; + const gchar *greeting_response; + GVariant *value; + gchar *greeting; + + error = NULL; + connection = g_dbus_connection_new_for_address_sync (opt_address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + &error); + if (connection == NULL) + { + g_printerr ("Error connecting to D-Bus address %s: %s\n", opt_address, error->message); + g_error_free (error); + goto out; + } + + g_print ("Connected.\n" + "Negotiated capabilities: unix-fd-passing=%d\n", + g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); + + greeting = g_strdup_printf ("Hey, it's %" G_GUINT64_FORMAT " already!", (guint64) time (NULL)); + value = g_dbus_connection_call_sync (connection, + NULL, /* bus_name */ + "/org/gtk/GDBus/TestObject", + "org.gtk.GDBus.TestPeerInterface", + "HelloWorld", + g_variant_new ("(s)", greeting), + G_VARIANT_TYPE ("(s)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + if (value == NULL) + { + g_printerr ("Error invoking HelloWorld(): %s\n", error->message); + g_error_free (error); + goto out; + } + g_variant_get (value, "(&s)", &greeting_response); + g_print ("Server said: %s\n", greeting_response); + g_variant_unref (value); + + g_object_unref (connection); + } + g_dbus_node_info_unref (introspection_data); + + ret = 0; + + out: + return ret; +} diff --git a/gio/tests/gdbus-example-proxy-subclass.c b/gio/tests/gdbus-example-proxy-subclass.c new file mode 100644 index 0000000..fb1a528 --- /dev/null +++ b/gio/tests/gdbus-example-proxy-subclass.c @@ -0,0 +1,358 @@ + +#include + +/* ---------------------------------------------------------------------------------------------------- */ +/* The D-Bus interface definition we want to create a GDBusProxy-derived type for: */ +/* ---------------------------------------------------------------------------------------------------- */ + +static const gchar introspection_xml[] = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Definition of the AccountsUser type */ +/* ---------------------------------------------------------------------------------------------------- */ + +#define ACCOUNTS_TYPE_USER (accounts_user_get_type ()) +#define ACCOUNTS_USER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ACCOUNTS_TYPE_USER, AccountsUser)) +#define ACCOUNTS_USER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ACCOUNTS_TYPE_USER, AccountsUserClass)) +#define ACCOUNTS_USER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ACCOUNTS_TYPE_USER, AccountsUserClass)) +#define ACCOUNTS_IS_USER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ACCOUNTS_TYPE_USER)) +#define ACCOUNTS_IS_USER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ACCOUNTS_TYPE_USER)) + +typedef struct _AccountsUser AccountsUser; +typedef struct _AccountsUserClass AccountsUserClass; +typedef struct _AccountsUserPrivate AccountsUserPrivate; + +struct _AccountsUser +{ + /*< private >*/ + GDBusProxy parent_instance; + AccountsUserPrivate *priv; +}; + +struct _AccountsUserClass +{ + /*< private >*/ + GDBusProxyClass parent_class; + void (*changed) (AccountsUser *user); +}; + +GType accounts_user_get_type (void) G_GNUC_CONST; + +const gchar *accounts_user_get_user_name (AccountsUser *user); +const gchar *accounts_user_get_real_name (AccountsUser *user); +gboolean accounts_user_get_automatic_login (AccountsUser *user); + +void accounts_user_frobnicate (AccountsUser *user, + const gchar *flux, + gint baz, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gchar *accounts_user_frobnicate_finish (AccountsUser *user, + GAsyncResult *res, + GError **error); +gchar *accounts_user_frobnicate_sync (AccountsUser *user, + const gchar *flux, + gint baz, + GCancellable *cancellable, + GError **error); + +/* ---------------------------------------------------------------------------------------------------- */ +/* Implementation of the AccountsUser type */ +/* ---------------------------------------------------------------------------------------------------- */ + +/* A more efficient approach than parsing XML is to use const static + * GDBusInterfaceInfo, GDBusMethodInfo, ... structures + */ +static GDBusInterfaceInfo * +accounts_user_get_interface_info (void) +{ + static gsize has_info = 0; + static GDBusInterfaceInfo *info = NULL; + if (g_once_init_enter (&has_info)) + { + GDBusNodeInfo *introspection_data; + introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + info = introspection_data->interfaces[0]; + g_once_init_leave (&has_info, 1); + } + return info; +} + +enum +{ + PROP_0, + PROP_USER_NAME, + PROP_REAL_NAME, + PROP_AUTOMATIC_LOGIN, +}; + +enum +{ + CHANGED_SIGNAL, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = {0}; + +G_DEFINE_TYPE (AccountsUser, accounts_user, G_TYPE_DBUS_PROXY); + +static void +accounts_user_finalize (GObject *object) +{ + G_GNUC_UNUSED AccountsUser *user = ACCOUNTS_USER (object); + + if (G_OBJECT_CLASS (accounts_user_parent_class)->finalize != NULL) + G_OBJECT_CLASS (accounts_user_parent_class)->finalize (object); +} + +static void +accounts_user_init (AccountsUser *user) +{ + /* Sets the expected interface */ + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (user), accounts_user_get_interface_info ()); +} + +static void +accounts_user_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + AccountsUser *user = ACCOUNTS_USER (object); + + switch (prop_id) + { + case PROP_USER_NAME: + g_value_set_string (value, accounts_user_get_user_name (user)); + break; + + case PROP_REAL_NAME: + g_value_set_string (value, accounts_user_get_real_name (user)); + break; + + case PROP_AUTOMATIC_LOGIN: + g_value_set_boolean (value, accounts_user_get_automatic_login (user)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +const gchar * +accounts_user_get_user_name (AccountsUser *user) +{ + GVariant *value; + const gchar *ret; + g_return_val_if_fail (ACCOUNTS_IS_USER (user), NULL); + value = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (user), "UserName"); + ret = g_variant_get_string (value, NULL); + g_variant_unref (value); + return ret; +} + +const gchar * +accounts_user_get_real_name (AccountsUser *user) +{ + GVariant *value; + const gchar *ret; + g_return_val_if_fail (ACCOUNTS_IS_USER (user), NULL); + value = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (user), "RealName"); + ret = g_variant_get_string (value, NULL); + g_variant_unref (value); + return ret; +} + +gboolean +accounts_user_get_automatic_login (AccountsUser *user) +{ + GVariant *value; + gboolean ret; + g_return_val_if_fail (ACCOUNTS_IS_USER (user), FALSE); + value = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (user), "AutomaticLogin"); + ret = g_variant_get_boolean (value); + g_variant_unref (value); + return ret; +} + +static void +accounts_user_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + AccountsUser *user = ACCOUNTS_USER (proxy); + if (g_strcmp0 (signal_name, "Changed") == 0) + g_signal_emit (user, signals[CHANGED_SIGNAL], 0); +} + +static void +accounts_user_g_properties_changed (GDBusProxy *proxy, + GVariant *changed_properties, + const gchar* const *invalidated_properties) +{ + AccountsUser *user = ACCOUNTS_USER (proxy); + GVariantIter *iter; + const gchar *key; + + if (changed_properties != NULL) + { + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + if (g_strcmp0 (key, "AutomaticLogin") == 0) + g_object_notify (G_OBJECT (user), "automatic-login"); + else if (g_strcmp0 (key, "RealName") == 0) + g_object_notify (G_OBJECT (user), "real-name"); + else if (g_strcmp0 (key, "UserName") == 0) + g_object_notify (G_OBJECT (user), "user-name"); + } + g_variant_iter_free (iter); + } +} + +static void +accounts_user_class_init (AccountsUserClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->get_property = accounts_user_get_property; + gobject_class->finalize = accounts_user_finalize; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = accounts_user_g_signal; + proxy_class->g_properties_changed = accounts_user_g_properties_changed; + + g_object_class_install_property (gobject_class, + PROP_USER_NAME, + g_param_spec_string ("user-name", + "User Name", + "The user name of the user", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + PROP_REAL_NAME, + g_param_spec_string ("real-name", + "Real Name", + "The real name of the user", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + PROP_AUTOMATIC_LOGIN, + g_param_spec_boolean ("automatic-login", + "Automatic Login", + "Whether the user is automatically logged in", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + signals[CHANGED_SIGNAL] = g_signal_new ("changed", + ACCOUNTS_TYPE_USER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AccountsUserClass, changed), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); +} + +gchar * +accounts_user_frobnicate_sync (AccountsUser *user, + const gchar *flux, + gint baz, + GCancellable *cancellable, + GError **error) +{ + gchar *ret; + GVariant *value; + + g_return_val_if_fail (ACCOUNTS_IS_USER (user), NULL); + + ret = NULL; + + value = g_dbus_proxy_call_sync (G_DBUS_PROXY (user), + "Frobnicate", + g_variant_new ("(si)", + flux, + baz), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (value != NULL) + { + g_variant_get (value, "(s)", &ret); + g_variant_unref (value); + } + return ret; +} + +void +accounts_user_frobnicate (AccountsUser *user, + const gchar *flux, + gint baz, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (ACCOUNTS_IS_USER (user)); + g_dbus_proxy_call (G_DBUS_PROXY (user), + "Frobnicate", + g_variant_new ("(si)", + flux, + baz), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + + +gchar * +accounts_user_frobnicate_finish (AccountsUser *user, + GAsyncResult *res, + GError **error) +{ + gchar *ret; + GVariant *value; + + ret = NULL; + value = g_dbus_proxy_call_finish (G_DBUS_PROXY (user), res, error); + if (value != NULL) + { + g_variant_get (value, "(s)", &ret); + g_variant_unref (value); + } + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +gint +main (gint argc, gchar *argv[]) +{ + return 0; +} diff --git a/gio/tests/gdbus-example-server.c b/gio/tests/gdbus-example-server.c new file mode 100644 index 0000000..79f83df --- /dev/null +++ b/gio/tests/gdbus-example-server.c @@ -0,0 +1,392 @@ +#include +#include + +#ifdef G_OS_UNIX +#include +/* For STDOUT_FILENO */ +#include +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusNodeInfo *introspection_data = NULL; + +/* Introspection data for the service we are exporting */ +static const gchar introspection_xml[] = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +handle_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + if (g_strcmp0 (method_name, "HelloWorld") == 0) + { + const gchar *greeting; + + g_variant_get (parameters, "(&s)", &greeting); + + if (g_strcmp0 (greeting, "Return Unregistered") == 0) + { + g_dbus_method_invocation_return_error (invocation, + G_IO_ERROR, + G_IO_ERROR_FAILED_HANDLED, + "As requested, here's a GError not registered (G_IO_ERROR_FAILED_HANDLED)"); + } + else if (g_strcmp0 (greeting, "Return Registered") == 0) + { + g_dbus_method_invocation_return_error (invocation, + G_DBUS_ERROR, + G_DBUS_ERROR_MATCH_RULE_NOT_FOUND, + "As requested, here's a GError that is registered (G_DBUS_ERROR_MATCH_RULE_NOT_FOUND)"); + } + else if (g_strcmp0 (greeting, "Return Raw") == 0) + { + g_dbus_method_invocation_return_dbus_error (invocation, + "org.gtk.GDBus.SomeErrorName", + "As requested, here's a raw D-Bus error"); + } + else + { + gchar *response; + response = g_strdup_printf ("You greeted me with '%s'. Thanks!", greeting); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", response)); + g_free (response); + } + } + else if (g_strcmp0 (method_name, "EmitSignal") == 0) + { + GError *local_error; + gdouble speed_in_mph; + gchar *speed_as_string; + + g_variant_get (parameters, "(d)", &speed_in_mph); + speed_as_string = g_strdup_printf ("%g mph!", speed_in_mph); + + local_error = NULL; + g_dbus_connection_emit_signal (connection, + NULL, + object_path, + interface_name, + "VelocityChanged", + g_variant_new ("(ds)", + speed_in_mph, + speed_as_string), + &local_error); + g_assert_no_error (local_error); + g_free (speed_as_string); + + g_dbus_method_invocation_return_value (invocation, NULL); + } + else if (g_strcmp0 (method_name, "GimmeStdout") == 0) + { +#ifdef G_OS_UNIX + if (g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING) + { + GDBusMessage *reply; + GUnixFDList *fd_list; + GError *error; + + fd_list = g_unix_fd_list_new (); + error = NULL; + g_unix_fd_list_append (fd_list, STDOUT_FILENO, &error); + g_assert_no_error (error); + + reply = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_dbus_message_set_unix_fd_list (reply, fd_list); + + error = NULL; + g_dbus_connection_send_message (connection, + reply, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + NULL, /* out_serial */ + &error); + g_assert_no_error (error); + + g_object_unref (invocation); + g_object_unref (fd_list); + g_object_unref (reply); + } + else + { + g_dbus_method_invocation_return_dbus_error (invocation, + "org.gtk.GDBus.Failed", + "Your message bus daemon does not support file descriptor passing (need D-Bus >= 1.3.0)"); + } +#else + g_dbus_method_invocation_return_dbus_error (invocation, + "org.gtk.GDBus.NotOnUnix", + "Your OS does not support file descriptor passing"); +#endif + } +} + +static gchar *_global_title = NULL; + +static gboolean swap_a_and_b = FALSE; + +static GVariant * +handle_get_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GVariant *ret; + + ret = NULL; + if (g_strcmp0 (property_name, "FluxCapicitorName") == 0) + { + ret = g_variant_new_string ("DeLorean"); + } + else if (g_strcmp0 (property_name, "Title") == 0) + { + if (_global_title == NULL) + _global_title = g_strdup ("Back To C!"); + ret = g_variant_new_string (_global_title); + } + else if (g_strcmp0 (property_name, "ReadingAlwaysThrowsError") == 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Hello %s. I thought I said reading this property " + "always results in an error. kthxbye", + sender); + } + else if (g_strcmp0 (property_name, "WritingAlwaysThrowsError") == 0) + { + ret = g_variant_new_string ("There's no home like home"); + } + else if (g_strcmp0 (property_name, "Foo") == 0) + { + ret = g_variant_new_string (swap_a_and_b ? "Tock" : "Tick"); + } + else if (g_strcmp0 (property_name, "Bar") == 0) + { + ret = g_variant_new_string (swap_a_and_b ? "Tick" : "Tock"); + } + + return ret; +} + +static gboolean +handle_set_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *value, + GError **error, + gpointer user_data) +{ + if (g_strcmp0 (property_name, "Title") == 0) + { + if (g_strcmp0 (_global_title, g_variant_get_string (value, NULL)) != 0) + { + GVariantBuilder *builder; + GError *local_error; + + g_free (_global_title); + _global_title = g_variant_dup_string (value, NULL); + + local_error = NULL; + builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY); + g_variant_builder_add (builder, + "{sv}", + "Title", + g_variant_new_string (_global_title)); + g_dbus_connection_emit_signal (connection, + NULL, + object_path, + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + g_variant_new ("(sa{sv}as)", + interface_name, + builder, + NULL), + &local_error); + g_assert_no_error (local_error); + } + } + else if (g_strcmp0 (property_name, "ReadingAlwaysThrowsError") == 0) + { + /* do nothing - they can't read it after all! */ + } + else if (g_strcmp0 (property_name, "WritingAlwaysThrowsError") == 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Hello AGAIN %s. I thought I said writing this property " + "always results in an error. kthxbye", + sender); + } + + return *error == NULL; +} + + +/* for now */ +static const GDBusInterfaceVTable interface_vtable = +{ + handle_method_call, + handle_get_property, + handle_set_property +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +on_timeout_cb (gpointer user_data) +{ + GDBusConnection *connection = G_DBUS_CONNECTION (user_data); + GVariantBuilder *builder; + GVariantBuilder *invalidated_builder; + GError *error; + + swap_a_and_b = !swap_a_and_b; + + error = NULL; + builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY); + invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as")); + g_variant_builder_add (builder, + "{sv}", + "Foo", + g_variant_new_string (swap_a_and_b ? "Tock" : "Tick")); + g_variant_builder_add (builder, + "{sv}", + "Bar", + g_variant_new_string (swap_a_and_b ? "Tick" : "Tock")); + g_dbus_connection_emit_signal (connection, + NULL, + "/org/gtk/GDBus/TestObject", + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + g_variant_new ("(sa{sv}as)", + "org.gtk.GDBus.TestInterface", + builder, + invalidated_builder), + &error); + g_assert_no_error (error); + + + return TRUE; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + guint registration_id; + + registration_id = g_dbus_connection_register_object (connection, + "/org/gtk/GDBus/TestObject", + introspection_data->interfaces[0], + &interface_vtable, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + NULL); /* GError** */ + g_assert (registration_id > 0); + + /* swap value of properties Foo and Bar every two seconds */ + g_timeout_add_seconds (2, + on_timeout_cb, + connection); +} + +static void +on_name_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ +} + +static void +on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + exit (1); +} + +int +main (int argc, char *argv[]) +{ + guint owner_id; + GMainLoop *loop; + + g_type_init (); + + /* We are lazy here - we don't want to manually provide + * the introspection data structures - so we just build + * them from XML. + */ + introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + g_assert (introspection_data != NULL); + + owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.TestServer", + G_BUS_NAME_OWNER_FLAGS_NONE, + on_bus_acquired, + on_name_acquired, + on_name_lost, + NULL, + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_bus_unown_name (owner_id); + + g_dbus_node_info_unref (introspection_data); + + return 0; +} diff --git a/gio/tests/gdbus-example-subtree.c b/gio/tests/gdbus-example-subtree.c new file mode 100644 index 0000000..cd3365f --- /dev/null +++ b/gio/tests/gdbus-example-subtree.c @@ -0,0 +1,400 @@ +#include +#include +#include + +/* ---------------------------------------------------------------------------------------------------- */ + +static GDBusNodeInfo *introspection_data = NULL; +static GDBusInterfaceInfo *manager_interface_info = NULL; +static GDBusInterfaceInfo *block_interface_info = NULL; +static GDBusInterfaceInfo *partition_interface_info = NULL; + +/* Introspection data for the service we are exporting */ +static const gchar introspection_xml[] = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +manager_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + const gchar *greeting; + gchar *response; + + g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.Example.Manager"); + g_assert_cmpstr (method_name, ==, "Hello"); + + g_variant_get (parameters, "(&s)", &greeting); + + response = g_strdup_printf ("Method %s.%s with user_data `%s' on object path %s called with arg '%s'", + interface_name, + method_name, + (const gchar *) user_data, + object_path, + greeting); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", response)); + g_free (response); +} + +const GDBusInterfaceVTable manager_vtable = +{ + manager_method_call, + NULL, /* get_property */ + NULL /* set_property */ +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +block_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.Example.Block"); + + if (g_strcmp0 (method_name, "Hello") == 0) + { + const gchar *greeting; + gchar *response; + + g_variant_get (parameters, "(&s)", &greeting); + + response = g_strdup_printf ("Method %s.%s with user_data `%s' on object path %s called with arg '%s'", + interface_name, + method_name, + (const gchar *) user_data, + object_path, + greeting); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", response)); + g_free (response); + } + else if (g_strcmp0 (method_name, "DoStuff") == 0) + { + g_dbus_method_invocation_return_dbus_error (invocation, + "org.gtk.GDBus.TestSubtree.Error.Failed", + "This method intentionally always fails"); + } + else + { + g_assert_not_reached (); + } +} + +static GVariant * +block_get_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GVariant *ret; + const gchar *node; + gint major; + gint minor; + + node = strrchr (object_path, '/') + 1; + if (g_str_has_prefix (node, "sda")) + major = 8; + else + major = 9; + if (strlen (node) == 4) + minor = node[3] - '0'; + else + minor = 0; + + ret = NULL; + if (g_strcmp0 (property_name, "Major") == 0) + { + ret = g_variant_new_int32 (major); + } + else if (g_strcmp0 (property_name, "Minor") == 0) + { + ret = g_variant_new_int32 (minor); + } + else if (g_strcmp0 (property_name, "Notes") == 0) + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "Hello %s. I thought I said reading this property " + "always results in an error. kthxbye", + sender); + } + else + { + g_assert_not_reached (); + } + + return ret; +} + +static gboolean +block_set_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *value, + GError **error, + gpointer user_data) +{ + /* TODO */ + g_assert_not_reached (); +} + +const GDBusInterfaceVTable block_vtable = +{ + block_method_call, + block_get_property, + block_set_property, +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +partition_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + const gchar *greeting; + gchar *response; + + g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.Example.Partition"); + g_assert_cmpstr (method_name, ==, "Hello"); + + g_variant_get (parameters, "(&s)", &greeting); + + response = g_strdup_printf ("Method %s.%s with user_data `%s' on object path %s called with arg '%s'", + interface_name, + method_name, + (const gchar *) user_data, + object_path, + greeting); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", response)); + g_free (response); +} + +const GDBusInterfaceVTable partition_vtable = +{ + partition_method_call, + //partition_get_property, + //partition_set_property +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar ** +subtree_enumerate (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + gpointer user_data) +{ + gchar **nodes; + GPtrArray *p; + + p = g_ptr_array_new (); + g_ptr_array_add (p, g_strdup ("sda")); + g_ptr_array_add (p, g_strdup ("sda1")); + g_ptr_array_add (p, g_strdup ("sda2")); + g_ptr_array_add (p, g_strdup ("sda3")); + g_ptr_array_add (p, g_strdup ("sdb")); + g_ptr_array_add (p, g_strdup ("sdb1")); + g_ptr_array_add (p, g_strdup ("sdc")); + g_ptr_array_add (p, g_strdup ("sdc1")); + g_ptr_array_add (p, NULL); + nodes = (gchar **) g_ptr_array_free (p, FALSE); + + return nodes; +} + +static GDBusInterfaceInfo ** +subtree_introspect (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *node, + gpointer user_data) +{ + GPtrArray *p; + + p = g_ptr_array_new (); + if (node == NULL) + { + g_ptr_array_add (p, g_dbus_interface_info_ref (manager_interface_info)); + } + else + { + g_ptr_array_add (p, g_dbus_interface_info_ref (block_interface_info)); + if (strlen (node) == 4) + g_ptr_array_add (p, + g_dbus_interface_info_ref (partition_interface_info)); + } + + g_ptr_array_add (p, NULL); + + return (GDBusInterfaceInfo **) g_ptr_array_free (p, FALSE); +} + +static const GDBusInterfaceVTable * +subtree_dispatch (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *node, + gpointer *out_user_data, + gpointer user_data) +{ + const GDBusInterfaceVTable *vtable_to_return; + gpointer user_data_to_return; + + if (g_strcmp0 (interface_name, "org.gtk.GDBus.Example.Manager") == 0) + { + user_data_to_return = "The Root"; + vtable_to_return = &manager_vtable; + } + else + { + if (strlen (node) == 4) + user_data_to_return = "A partition"; + else + user_data_to_return = "A block device"; + + if (g_strcmp0 (interface_name, "org.gtk.GDBus.Example.Block") == 0) + vtable_to_return = &block_vtable; + else if (g_strcmp0 (interface_name, "org.gtk.GDBus.Example.Partition") == 0) + vtable_to_return = &partition_vtable; + else + g_assert_not_reached (); + } + + *out_user_data = user_data_to_return; + + return vtable_to_return; +} + +const GDBusSubtreeVTable subtree_vtable = +{ + subtree_enumerate, + subtree_introspect, + subtree_dispatch +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + guint registration_id; + + registration_id = g_dbus_connection_register_subtree (connection, + "/org/gtk/GDBus/TestSubtree/Devices", + &subtree_vtable, + G_DBUS_SUBTREE_FLAGS_NONE, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + NULL); /* GError** */ + g_assert (registration_id > 0); +} + +static void +on_name_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ +} + +static void +on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + exit (1); +} + +int +main (int argc, char *argv[]) +{ + guint owner_id; + GMainLoop *loop; + + g_type_init (); + + /* We are lazy here - we don't want to manually provide + * the introspection data structures - so we just build + * them from XML. + */ + introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + g_assert (introspection_data != NULL); + + manager_interface_info = g_dbus_node_info_lookup_interface (introspection_data, "org.gtk.GDBus.Example.Manager"); + block_interface_info = g_dbus_node_info_lookup_interface (introspection_data, "org.gtk.GDBus.Example.Block"); + partition_interface_info = g_dbus_node_info_lookup_interface (introspection_data, "org.gtk.GDBus.Example.Partition"); + g_assert (manager_interface_info != NULL); + g_assert (block_interface_info != NULL); + g_assert (partition_interface_info != NULL); + + owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.TestSubtree", + G_BUS_NAME_OWNER_FLAGS_NONE, + on_bus_acquired, + on_name_acquired, + on_name_lost, + NULL, + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_bus_unown_name (owner_id); + + g_dbus_node_info_unref (introspection_data); + + return 0; +} diff --git a/gio/tests/gdbus-example-unix-fd-client.c b/gio/tests/gdbus-example-unix-fd-client.c new file mode 100644 index 0000000..9b9c27a --- /dev/null +++ b/gio/tests/gdbus-example-unix-fd-client.c @@ -0,0 +1,134 @@ +#include +#include + +#include +#include + +#include + +#include +#include + +/* see gdbus-example-server.c for the server implementation */ +static gint +get_server_stdout (GDBusConnection *connection, + const gchar *name_owner, + GError **error) +{ + GDBusMessage *method_call_message; + GDBusMessage *method_reply_message; + GUnixFDList *fd_list; + gint fd; + + fd = -1; + method_call_message = NULL; + method_reply_message = NULL; + + method_call_message = g_dbus_message_new_method_call (name_owner, + "/org/gtk/GDBus/TestObject", + "org.gtk.GDBus.TestInterface", + "GimmeStdout"); + method_reply_message = g_dbus_connection_send_message_with_reply_sync (connection, + method_call_message, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + -1, + NULL, /* out_serial */ + NULL, /* cancellable */ + error); + if (method_reply_message == NULL) + goto out; + + if (g_dbus_message_get_message_type (method_reply_message) == G_DBUS_MESSAGE_TYPE_ERROR) + { + g_dbus_message_to_gerror (method_reply_message, error); + goto out; + } + + fd_list = g_dbus_message_get_unix_fd_list (method_reply_message); + fd = g_unix_fd_list_get (fd_list, 0, error); + + out: + g_object_unref (method_call_message); + g_object_unref (method_reply_message); + + return fd; +} + +static void +on_name_appeared (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data) +{ + gint fd; + GError *error; + + error = NULL; + fd = get_server_stdout (connection, name_owner, &error); + if (fd == -1) + { + g_printerr ("Error invoking GimmeStdout(): %s\n", + error->message); + g_error_free (error); + exit (1); + } + else + { + gchar now_buf[256]; + time_t now; + gssize len; + gchar *str; + + now = time (NULL); + strftime (now_buf, + sizeof now_buf, + "%c", + localtime (&now)); + + str = g_strdup_printf ("On %s, gdbus-example-unix-fd-client with pid %d was here!\n", + now_buf, + (gint) getpid ()); + len = strlen (str); + g_warn_if_fail (write (fd, str, len) == len); + close (fd); + + g_print ("Wrote the following on server's stdout:\n%s", str); + + g_free (str); + exit (0); + } +} + +static void +on_name_vanished (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + g_printerr ("Failed to get name owner for %s\n" + "Is ./gdbus-example-server running?\n", + name); + exit (1); +} + +int +main (int argc, char *argv[]) +{ + guint watcher_id; + GMainLoop *loop; + + g_type_init (); + + watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.TestServer", + G_BUS_NAME_WATCHER_FLAGS_NONE, + on_name_appeared, + on_name_vanished, + NULL, + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_bus_unwatch_name (watcher_id); + return 0; +} diff --git a/gio/tests/gdbus-example-watch-name.c b/gio/tests/gdbus-example-watch-name.c new file mode 100644 index 0000000..769419b --- /dev/null +++ b/gio/tests/gdbus-example-watch-name.c @@ -0,0 +1,88 @@ +#include + +static gchar *opt_name = NULL; +static gboolean opt_system_bus = FALSE; +static gboolean opt_auto_start = FALSE; + +static GOptionEntry opt_entries[] = +{ + { "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name to watch", NULL }, + { "system-bus", 's', 0, G_OPTION_ARG_NONE, &opt_system_bus, "Use the system-bus instead of the session-bus", NULL }, + { "auto-start", 'a', 0, G_OPTION_ARG_NONE, &opt_auto_start, "Instruct the bus to launch an owner for the name", NULL}, + { NULL} +}; + +static void +on_name_appeared (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data) +{ + g_print ("Name %s on %s is owned by %s\n", + name, + opt_system_bus ? "the system bus" : "the session bus", + name_owner); +} + +static void +on_name_vanished (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + g_print ("Name %s does not exist on %s\n", + name, + opt_system_bus ? "the system bus" : "the session bus"); +} + +int +main (int argc, char *argv[]) +{ + guint watcher_id; + GMainLoop *loop; + GOptionContext *opt_context; + GError *error; + GBusNameWatcherFlags flags; + + g_type_init (); + + error = NULL; + opt_context = g_option_context_new ("g_bus_watch_name() example"); + g_option_context_set_summary (opt_context, + "Example: to watch the power manager on the session bus, use:\n" + "\n" + " ./example-watch-name -n org.gnome.PowerManager"); + g_option_context_add_main_entries (opt_context, opt_entries, NULL); + if (!g_option_context_parse (opt_context, &argc, &argv, &error)) + { + g_printerr ("Error parsing options: %s", error->message); + goto out; + } + if (opt_name == NULL) + { + g_printerr ("Incorrect usage, try --help.\n"); + goto out; + } + + flags = G_BUS_NAME_WATCHER_FLAGS_NONE; + if (opt_auto_start) + flags |= G_BUS_NAME_WATCHER_FLAGS_AUTO_START; + + watcher_id = g_bus_watch_name (opt_system_bus ? G_BUS_TYPE_SYSTEM : G_BUS_TYPE_SESSION, + opt_name, + flags, + on_name_appeared, + on_name_vanished, + NULL, + NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + + g_bus_unwatch_name (watcher_id); + + out: + g_option_context_free (opt_context); + g_free (opt_name); + + return 0; +} diff --git a/gio/tests/gdbus-example-watch-proxy.c b/gio/tests/gdbus-example-watch-proxy.c new file mode 100644 index 0000000..c66826d --- /dev/null +++ b/gio/tests/gdbus-example-watch-proxy.c @@ -0,0 +1,232 @@ +#include + +static gchar *opt_name = NULL; +static gchar *opt_object_path = NULL; +static gchar *opt_interface = NULL; +static gboolean opt_system_bus = FALSE; +static gboolean opt_no_auto_start = FALSE; +static gboolean opt_no_properties = FALSE; + +static GOptionEntry opt_entries[] = +{ + { "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name of the remote object to watch", NULL }, + { "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_object_path, "Object path of the remote object", NULL }, + { "interface", 'i', 0, G_OPTION_ARG_STRING, &opt_interface, "D-Bus interface of remote object", NULL }, + { "system-bus", 's', 0, G_OPTION_ARG_NONE, &opt_system_bus, "Use the system-bus instead of the session-bus", NULL }, + { "no-auto-start", 'a', 0, G_OPTION_ARG_NONE, &opt_no_auto_start, "Don't instruct the bus to launch an owner for the name", NULL}, + { "no-properties", 'p', 0, G_OPTION_ARG_NONE, &opt_no_properties, "Do not load properties", NULL}, + { NULL} +}; + +static GMainLoop *loop = NULL; + +static void +print_properties (GDBusProxy *proxy) +{ + gchar **property_names; + guint n; + + g_print (" properties:\n"); + + property_names = g_dbus_proxy_get_cached_property_names (proxy); + for (n = 0; property_names != NULL && property_names[n] != NULL; n++) + { + const gchar *key = property_names[n]; + GVariant *value; + gchar *value_str; + value = g_dbus_proxy_get_cached_property (proxy, key); + value_str = g_variant_print (value, TRUE); + g_print (" %s -> %s\n", key, value_str); + g_variant_unref (value); + g_free (value_str); + } + g_strfreev (property_names); +} + +static void +on_properties_changed (GDBusProxy *proxy, + GVariant *changed_properties, + const gchar* const *invalidated_properties, + gpointer user_data) +{ + /* Note that we are guaranteed that changed_properties and + * invalidated_properties are never NULL + */ + + if (g_variant_n_children (changed_properties) > 0) + { + GVariantIter *iter; + const gchar *key; + GVariant *value; + + g_print (" *** Properties Changed:\n"); + g_variant_get (changed_properties, + "a{sv}", + &iter); + while (g_variant_iter_loop (iter, "{&sv}", &key, &value)) + { + gchar *value_str; + value_str = g_variant_print (value, TRUE); + g_print (" %s -> %s\n", key, value_str); + g_free (value_str); + } + g_variant_iter_free (iter); + } + + if (g_strv_length ((GStrv) invalidated_properties) > 0) + { + guint n; + g_print (" *** Properties Invalidated:\n"); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + const gchar *key = invalidated_properties[n]; + g_print (" %s\n", key); + } + } +} + +static void +on_signal (GDBusProxy *proxy, + gchar *sender_name, + gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + gchar *parameters_str; + + parameters_str = g_variant_print (parameters, TRUE); + g_print (" *** Received Signal: %s: %s\n", + signal_name, + parameters_str); + g_free (parameters_str); +} + +static void +print_proxy (GDBusProxy *proxy) +{ + gchar *name_owner; + + name_owner = g_dbus_proxy_get_name_owner (proxy); + if (name_owner != NULL) + { + g_print ("+++ Proxy object points to remote object owned by %s\n" + " bus: %s\n" + " name: %s\n" + " object path: %s\n" + " interface: %s\n", + name_owner, + opt_system_bus ? "System Bus" : "Session Bus", + opt_name, + opt_object_path, + opt_interface); + print_properties (proxy); + } + else + { + g_print ("--- Proxy object is inert - there is no name owner for the name\n" + " bus: %s\n" + " name: %s\n" + " object path: %s\n" + " interface: %s\n", + opt_system_bus ? "System Bus" : "Session Bus", + opt_name, + opt_object_path, + opt_interface); + } + g_free (name_owner); +} + +static void +on_name_owner_notify (GObject *object, + GParamSpec *pspec, + gpointer user_data) +{ + GDBusProxy *proxy = G_DBUS_PROXY (object); + print_proxy (proxy); +} + +int +main (int argc, char *argv[]) +{ + GOptionContext *opt_context; + GError *error; + GDBusProxyFlags flags; + GDBusProxy *proxy; + + g_type_init (); + + loop = NULL; + proxy = NULL; + + opt_context = g_option_context_new ("g_bus_watch_proxy() example"); + g_option_context_set_summary (opt_context, + "Example: to watch the object of gdbus-example-server, use:\n" + "\n" + " ./gdbus-example-watch-proxy -n org.gtk.GDBus.TestServer \\\n" + " -o /org/gtk/GDBus/TestObject \\\n" + " -i org.gtk.GDBus.TestInterface"); + g_option_context_add_main_entries (opt_context, opt_entries, NULL); + error = NULL; + if (!g_option_context_parse (opt_context, &argc, &argv, &error)) + { + g_printerr ("Error parsing options: %s\n", error->message); + goto out; + } + if (opt_name == NULL || opt_object_path == NULL || opt_interface == NULL) + { + g_printerr ("Incorrect usage, try --help.\n"); + goto out; + } + + flags = G_DBUS_PROXY_FLAGS_NONE; + if (opt_no_properties) + flags |= G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES; + if (opt_no_auto_start) + flags |= G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START; + + loop = g_main_loop_new (NULL, FALSE); + + error = NULL; + proxy = g_dbus_proxy_new_for_bus_sync (opt_system_bus ? G_BUS_TYPE_SYSTEM : G_BUS_TYPE_SESSION, + flags, + NULL, /* GDBusInterfaceInfo */ + opt_name, + opt_object_path, + opt_interface, + NULL, /* GCancellable */ + &error); + if (proxy == NULL) + { + g_printerr ("Error creating proxy: %s\n", error->message); + g_error_free (error); + goto out; + } + + g_signal_connect (proxy, + "g-properties-changed", + G_CALLBACK (on_properties_changed), + NULL); + g_signal_connect (proxy, + "g-signal", + G_CALLBACK (on_signal), + NULL); + g_signal_connect (proxy, + "notify::g-name-owner", + G_CALLBACK (on_name_owner_notify), + NULL); + print_proxy (proxy); + + g_main_loop_run (loop); + + out: + if (proxy != NULL) + g_object_unref (proxy); + if (loop != NULL) + g_main_loop_unref (loop); + g_option_context_free (opt_context); + g_free (opt_name); + g_free (opt_object_path); + g_free (opt_interface); + + return 0; +} diff --git a/gio/tests/gdbus-exit-on-close.c b/gio/tests/gdbus-exit-on-close.c new file mode 100644 index 0000000..df1bce8 --- /dev/null +++ b/gio/tests/gdbus-exit-on-close.c @@ -0,0 +1,82 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +nuke_session_bus_cb (gpointer data) +{ + g_main_loop_quit (loop); + return FALSE; +} + +static void +test_exit_on_close (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) + { + GDBusConnection *c; + session_bus_up (); + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c != NULL); + g_assert (!g_dbus_connection_is_closed (c)); + g_timeout_add (50, + nuke_session_bus_cb, + NULL); + g_main_loop_run (loop); + session_bus_down (); + g_main_loop_run (loop); + } + g_test_trap_assert_stdout ("*Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.*"); + g_test_trap_assert_failed(); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/exit-on-close", test_exit_on_close); + return g_test_run(); +} diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c new file mode 100644 index 0000000..47d3d03 --- /dev/null +++ b/gio/tests/gdbus-export.c @@ -0,0 +1,1426 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +static GDBusConnection *c = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that we can export objects, the hierarchy is correct and the right handlers are invoked */ +/* ---------------------------------------------------------------------------------------------------- */ + +static const GDBusArgInfo foo_method1_in_args = +{ + -1, + "an_input_string", + "s", + NULL +}; +static const GDBusArgInfo * const foo_method1_in_arg_pointers[] = {&foo_method1_in_args, NULL}; + +static const GDBusArgInfo foo_method1_out_args = +{ + -1, + "an_output_string", + "s", + NULL +}; +static const GDBusArgInfo * const foo_method1_out_arg_pointers[] = {&foo_method1_out_args, NULL}; + +static const GDBusMethodInfo foo_method_info_method1 = +{ + -1, + "Method1", + (GDBusArgInfo **) &foo_method1_in_arg_pointers, + (GDBusArgInfo **) &foo_method1_out_arg_pointers, + NULL +}; +static const GDBusMethodInfo foo_method_info_method2 = +{ + -1, + "Method2", + NULL, + NULL, + NULL +}; +static const GDBusMethodInfo * const foo_method_info_pointers[] = {&foo_method_info_method1, &foo_method_info_method2, NULL}; + +static const GDBusSignalInfo foo_signal_info = +{ + -1, + "SignalAlpha", + NULL, + NULL +}; +static const GDBusSignalInfo * const foo_signal_info_pointers[] = {&foo_signal_info, NULL}; + +static const GDBusPropertyInfo foo_property_info[] = +{ + { + -1, + "PropertyUno", + "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, + NULL + }, + { + -1, + "NotWritable", + "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + { + -1, + "NotReadable", + "s", + G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, + NULL + } +}; +static const GDBusPropertyInfo * const foo_property_info_pointers[] = +{ + &foo_property_info[0], + &foo_property_info[1], + &foo_property_info[2], + NULL +}; + +static const GDBusInterfaceInfo foo_interface_info = +{ + -1, + "org.example.Foo", + (GDBusMethodInfo **) &foo_method_info_pointers, + (GDBusSignalInfo **) &foo_signal_info_pointers, + (GDBusPropertyInfo **)&foo_property_info_pointers, + NULL, +}; + +static void +foo_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + if (g_strcmp0 (method_name, "Method1") == 0) + { + const gchar *input; + gchar *output; + g_variant_get (parameters, "(&s)", &input); + output = g_strdup_printf ("You passed the string `%s'. Jolly good!", input); + g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", output)); + g_free (output); + } + else + { + g_dbus_method_invocation_return_dbus_error (invocation, + "org.example.SomeError", + "How do you like them apples, buddy!"); + } +} + +static GVariant * +foo_get_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + GVariant *ret; + gchar *s; + s = g_strdup_printf ("Property `%s' Is What It Is!", property_name); + ret = g_variant_new_string (s); + g_free (s); + return ret; +} + +static gboolean +foo_set_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *value, + GError **error, + gpointer user_data) +{ + gchar *s; + s = g_variant_print (value, TRUE); + g_set_error (error, + G_DBUS_ERROR, + G_DBUS_ERROR_SPAWN_FILE_INVALID, + "Returning some error instead of writing the value `%s' to the property `%s'", + property_name, s); + g_free (s); + return FALSE; +} + +static const GDBusInterfaceVTable foo_vtable = +{ + foo_method_call, + foo_get_property, + foo_set_property +}; + +/* -------------------- */ + +static const GDBusMethodInfo bar_method_info[] = +{ + { + -1, + "MethodA", + NULL, + NULL, + NULL + }, + { + -1, + "MethodB", + NULL, + NULL, + NULL + } +}; +static const GDBusMethodInfo * const bar_method_info_pointers[] = {&bar_method_info[0], &bar_method_info[1], NULL}; + +static const GDBusSignalInfo bar_signal_info[] = +{ + { + -1, + "SignalMars", + NULL, + NULL + } +}; +static const GDBusSignalInfo * const bar_signal_info_pointers[] = {&bar_signal_info[0], NULL}; + +static const GDBusPropertyInfo bar_property_info[] = +{ + { + -1, + "PropertyDuo", + "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + } +}; +static const GDBusPropertyInfo * const bar_property_info_pointers[] = {&bar_property_info[0], NULL}; + +static const GDBusInterfaceInfo bar_interface_info = +{ + -1, + "org.example.Bar", + (GDBusMethodInfo **) bar_method_info_pointers, + (GDBusSignalInfo **) bar_signal_info_pointers, + (GDBusPropertyInfo **) bar_property_info_pointers, + NULL, +}; + +/* -------------------- */ + +static const GDBusMethodInfo dyna_method_info[] = +{ + { + -1, + "DynaCyber", + NULL, + NULL, + NULL + } +}; +static const GDBusMethodInfo * const dyna_method_info_pointers[] = {&dyna_method_info[0], NULL}; + +static const GDBusInterfaceInfo dyna_interface_info = +{ + -1, + "org.example.Dyna", + (GDBusMethodInfo **) dyna_method_info_pointers, + NULL, /* no signals */ + NULL, /* no properties */ + NULL, +}; + +static void +dyna_cyber (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + GPtrArray *data = user_data; + gchar *node_name; + guint n; + + node_name = strrchr (object_path, '/') + 1; + + /* Add new node if it is not already known */ + for (n = 0; n < data->len ; n++) + { + if (g_strcmp0 (g_ptr_array_index (data, n), node_name) == 0) + goto out; + } + g_ptr_array_add (data, g_strdup(node_name)); + + out: + g_dbus_method_invocation_return_value (invocation, NULL); +} + +static const GDBusInterfaceVTable dyna_interface_vtable = +{ + dyna_cyber, + NULL, + NULL +}; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +introspect_callback (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + gchar **xml_data = user_data; + GVariant *result; + GError *error; + + error = NULL; + result = g_dbus_proxy_call_finish (proxy, + res, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_get (result, "(s)", xml_data); + g_variant_unref (result); + + g_main_loop_quit (loop); +} + +static gchar ** +get_nodes_at (GDBusConnection *c, + const gchar *object_path) +{ + GError *error; + GDBusProxy *proxy; + gchar *xml_data; + GPtrArray *p; + GDBusNodeInfo *node_info; + guint n; + + error = NULL; + proxy = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + NULL, + g_dbus_connection_get_unique_name (c), + object_path, + "org.freedesktop.DBus.Introspectable", + NULL, + &error); + g_assert_no_error (error); + g_assert (proxy != NULL); + + /* do this async to avoid libdbus-1 deadlocks */ + xml_data = NULL; + g_dbus_proxy_call (proxy, + "Introspect", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) introspect_callback, + &xml_data); + g_main_loop_run (loop); + g_assert (xml_data != NULL); + + node_info = g_dbus_node_info_new_for_xml (xml_data, &error); + g_assert_no_error (error); + g_assert (node_info != NULL); + + p = g_ptr_array_new (); + for (n = 0; node_info->nodes != NULL && node_info->nodes[n] != NULL; n++) + { + const GDBusNodeInfo *sub_node_info = node_info->nodes[n]; + g_ptr_array_add (p, g_strdup (sub_node_info->path)); + } + g_ptr_array_add (p, NULL); + + g_object_unref (proxy); + g_free (xml_data); + g_dbus_node_info_unref (node_info); + + return (gchar **) g_ptr_array_free (p, FALSE); +} + +static gboolean +has_interface (GDBusConnection *c, + const gchar *object_path, + const gchar *interface_name) +{ + GError *error; + GDBusProxy *proxy; + gchar *xml_data; + GDBusNodeInfo *node_info; + gboolean ret; + + error = NULL; + proxy = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + NULL, + g_dbus_connection_get_unique_name (c), + object_path, + "org.freedesktop.DBus.Introspectable", + NULL, + &error); + g_assert_no_error (error); + g_assert (proxy != NULL); + + /* do this async to avoid libdbus-1 deadlocks */ + xml_data = NULL; + g_dbus_proxy_call (proxy, + "Introspect", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) introspect_callback, + &xml_data); + g_main_loop_run (loop); + g_assert (xml_data != NULL); + + node_info = g_dbus_node_info_new_for_xml (xml_data, &error); + g_assert_no_error (error); + g_assert (node_info != NULL); + + ret = (g_dbus_node_info_lookup_interface (node_info, interface_name) != NULL); + + g_object_unref (proxy); + g_free (xml_data); + g_dbus_node_info_unref (node_info); + + return ret; +} + +static guint +count_interfaces (GDBusConnection *c, + const gchar *object_path) +{ + GError *error; + GDBusProxy *proxy; + gchar *xml_data; + GDBusNodeInfo *node_info; + guint ret; + + error = NULL; + proxy = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + NULL, + g_dbus_connection_get_unique_name (c), + object_path, + "org.freedesktop.DBus.Introspectable", + NULL, + &error); + g_assert_no_error (error); + g_assert (proxy != NULL); + + /* do this async to avoid libdbus-1 deadlocks */ + xml_data = NULL; + g_dbus_proxy_call (proxy, + "Introspect", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) introspect_callback, + &xml_data); + g_main_loop_run (loop); + g_assert (xml_data != NULL); + + node_info = g_dbus_node_info_new_for_xml (xml_data, &error); + g_assert_no_error (error); + g_assert (node_info != NULL); + + ret = 0; + while (node_info->interfaces != NULL && node_info->interfaces[ret] != NULL) + ret++; + + g_object_unref (proxy); + g_free (xml_data); + g_dbus_node_info_unref (node_info); + + return ret; +} + +static void +dyna_create_callback (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + GVariant *result; + GError *error; + + error = NULL; + result = g_dbus_proxy_call_finish (proxy, + res, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_unref (result); + + g_main_loop_quit (loop); +} + +/* Dynamically create @object_name under /foo/dyna */ +static void +dyna_create (GDBusConnection *c, + const gchar *object_name) +{ + GError *error; + GDBusProxy *proxy; + gchar *object_path; + + object_path = g_strconcat ("/foo/dyna/", object_name, NULL); + + error = NULL; + proxy = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + NULL, + g_dbus_connection_get_unique_name (c), + object_path, + "org.example.Dyna", + NULL, + &error); + g_assert_no_error (error); + g_assert (proxy != NULL); + + /* do this async to avoid libdbus-1 deadlocks */ + g_dbus_proxy_call (proxy, + "DynaCyber", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) dyna_create_callback, + NULL); + g_main_loop_run (loop); + + g_assert_no_error (error); + + g_object_unref (proxy); + g_free (object_path); + + return; +} + +typedef struct +{ + guint num_unregistered_calls; + guint num_unregistered_subtree_calls; + guint num_subtree_nodes; +} ObjectRegistrationData; + +static void +on_object_unregistered (gpointer user_data) +{ + ObjectRegistrationData *data = user_data; + + data->num_unregistered_calls++; +} + +static void +on_subtree_unregistered (gpointer user_data) +{ + ObjectRegistrationData *data = user_data; + + data->num_unregistered_subtree_calls++; +} + +static gboolean +_g_strv_has_string (const gchar* const * haystack, + const gchar *needle) +{ + guint n; + + for (n = 0; haystack != NULL && haystack[n] != NULL; n++) + { + if (g_strcmp0 (haystack[n], needle) == 0) + return TRUE; + } + return FALSE; +} + +/* -------------------- */ + +static gchar ** +subtree_enumerate (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + gpointer user_data) +{ + ObjectRegistrationData *data = user_data; + GPtrArray *p; + gchar **nodes; + guint n; + + p = g_ptr_array_new (); + + for (n = 0; n < data->num_subtree_nodes; n++) + { + g_ptr_array_add (p, g_strdup_printf ("vp%d", n)); + g_ptr_array_add (p, g_strdup_printf ("evp%d", n)); + } + g_ptr_array_add (p, NULL); + + nodes = (gchar **) g_ptr_array_free (p, FALSE); + + return nodes; +} + +/* Only allows certain objects, and aborts on unknowns */ +static GDBusInterfaceInfo ** +subtree_introspect (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *node, + gpointer user_data) +{ + const GDBusInterfaceInfo *interfaces[2] = { + NULL /* filled in below */, NULL + }; + + /* VPs implement the Foo interface, EVPs implement the Bar interface. The root + * does not implement any interfaces + */ + if (node == NULL) + { + return NULL; + } + else if (g_str_has_prefix (node, "vp")) + { + interfaces[0] = &foo_interface_info; + } + else if (g_str_has_prefix (node, "evp")) + { + interfaces[0] = &bar_interface_info; + } + else + { + g_assert_not_reached (); + } + + return g_memdup (interfaces, 2 * sizeof (void *)); +} + +static const GDBusInterfaceVTable * +subtree_dispatch (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *node, + gpointer *out_user_data, + gpointer user_data) +{ + if (g_strcmp0 (interface_name, "org.example.Foo") == 0) + return &foo_vtable; + else + return NULL; +} + +static const GDBusSubtreeVTable subtree_vtable = +{ + subtree_enumerate, + subtree_introspect, + subtree_dispatch +}; + +/* -------------------- */ + +static gchar ** +dynamic_subtree_enumerate (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + gpointer user_data) +{ + GPtrArray *data = user_data; + gchar **nodes = g_new (gchar*, data->len + 1); + guint n; + + for (n = 0; n < data->len; n++) + { + nodes[n] = g_strdup (g_ptr_array_index (data, n)); + } + nodes[data->len] = NULL; + + return nodes; +} + +/* Allow all objects to be introspected */ +static GDBusInterfaceInfo ** +dynamic_subtree_introspect (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *node, + gpointer user_data) +{ + const GDBusInterfaceInfo *interfaces[2] = { &dyna_interface_info, NULL }; + + return g_memdup (interfaces, 2 * sizeof (void *)); +} + +static const GDBusInterfaceVTable * +dynamic_subtree_dispatch (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *node, + gpointer *out_user_data, + gpointer user_data) +{ + *out_user_data = user_data; + return &dyna_interface_vtable; +} + +static const GDBusSubtreeVTable dynamic_subtree_vtable = +{ + dynamic_subtree_enumerate, + dynamic_subtree_introspect, + dynamic_subtree_dispatch +}; + +/* -------------------- */ + +static gpointer +test_dispatch_thread_func (gpointer user_data) +{ + const gchar *object_path = user_data; + GDBusProxy *foo_proxy; + GVariant *value; + GVariant *inner; + GError *error; + gchar *s; + const gchar *value_str; + + foo_proxy = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + NULL, + g_dbus_connection_get_unique_name (c), + object_path, + "org.example.Foo", + NULL, + &error); + g_assert (foo_proxy != NULL); + + /* generic interfaces */ + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Peer.Ping", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (value != NULL); + g_variant_unref (value); + + /* user methods */ + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "Method1", + g_variant_new ("(s)", "winwinwin"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (value != NULL); + g_assert (g_variant_is_of_type (value, G_VARIANT_TYPE ("(s)"))); + g_variant_get (value, "(&s)", &value_str); + g_assert_cmpstr (value_str, ==, "You passed the string `winwinwin'. Jolly good!"); + g_variant_unref (value); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "Method2", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.example.SomeError: How do you like them apples, buddy!"); + g_error_free (error); + g_assert (value == NULL); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "Method2", + g_variant_new ("(s)", "failfailfail"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, `(s)', does not match expected type `()'"); + g_error_free (error); + g_assert (value == NULL); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "NonExistantMethod", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method `NonExistantMethod'"); + g_error_free (error); + g_assert (value == NULL); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.example.FooXYZ.NonExistant", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD); + g_error_free (error); + g_assert (value == NULL); + + /* user properties */ + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Properties.Get", + g_variant_new ("(ss)", + "org.example.Foo", + "PropertyUno"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (value != NULL); + g_assert (g_variant_is_of_type (value, G_VARIANT_TYPE ("(v)"))); + g_variant_get (value, "(v)", &inner); + g_assert (g_variant_is_of_type (inner, G_VARIANT_TYPE_STRING)); + g_assert_cmpstr (g_variant_get_string (inner, NULL), ==, "Property `PropertyUno' Is What It Is!"); + g_variant_unref (value); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Properties.Get", + g_variant_new ("(ss)", + "org.example.Foo", + "ThisDoesntExist"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert (value == NULL); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property `ThisDoesntExist'"); + g_error_free (error); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Properties.Get", + g_variant_new ("(ss)", + "org.example.Foo", + "NotReadable"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert (value == NULL); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Property `NotReadable' is not readable"); + g_error_free (error); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Properties.Set", + g_variant_new ("(ssv)", + "org.example.Foo", + "NotReadable", + g_variant_new_string ("But Writable you are!")), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert (value == NULL); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FILE_INVALID); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.Spawn.FileInvalid: Returning some error instead of writing the value `NotReadable' to the property `'But Writable you are!''"); + g_error_free (error); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Properties.Set", + g_variant_new ("(ssv)", + "org.example.Foo", + "NotWritable", + g_variant_new_uint32 (42)), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert (value == NULL); + g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS); + g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Property `NotWritable' is not writable"); + g_error_free (error); + + error = NULL; + value = g_dbus_proxy_call_sync (foo_proxy, + "org.freedesktop.DBus.Properties.GetAll", + g_variant_new ("(s)", + "org.example.Foo"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (value != NULL); + g_assert (g_variant_is_of_type (value, G_VARIANT_TYPE ("(a{sv})"))); + s = g_variant_print (value, TRUE); + g_assert_cmpstr (s, ==, "({'PropertyUno': <\"Property `PropertyUno' Is What It Is!\">, 'NotWritable': <\"Property `NotWritable' Is What It Is!\">},)"); + g_free (s); + g_variant_unref (value); + + g_object_unref (foo_proxy); + + g_main_loop_quit (loop); + return NULL; +} + +static void +test_dispatch (const gchar *object_path) +{ + GThread *thread; + GError *error; + + /* run this in a thread to avoid deadlocks */ + error = NULL; + thread = g_thread_create (test_dispatch_thread_func, + (gpointer) object_path, + TRUE, + &error); + g_assert_no_error (error); + g_assert (thread != NULL); + g_main_loop_run (loop); + g_thread_join (thread); +} + +static void +test_object_registration (void) +{ + GError *error; + ObjectRegistrationData data; + GPtrArray *dyna_data; + gchar **nodes; + guint boss_foo_reg_id; + guint boss_bar_reg_id; + guint worker1_foo_reg_id; + guint worker1p1_foo_reg_id; + guint worker2_bar_reg_id; + guint intern1_foo_reg_id; + guint intern2_bar_reg_id; + guint intern2_foo_reg_id; + guint intern3_bar_reg_id; + guint registration_id; + guint subtree_registration_id; + guint non_subtree_object_path_foo_reg_id; + guint non_subtree_object_path_bar_reg_id; + guint dyna_subtree_registration_id; + guint num_successful_registrations; + + data.num_unregistered_calls = 0; + data.num_unregistered_subtree_calls = 0; + data.num_subtree_nodes = 0; + + num_successful_registrations = 0; + + error = NULL; + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c != NULL); + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss", + (GDBusInterfaceInfo *) &foo_interface_info, + &foo_vtable, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + boss_foo_reg_id = registration_id; + num_successful_registrations++; + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss", + (GDBusInterfaceInfo *) &bar_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + boss_bar_reg_id = registration_id; + num_successful_registrations++; + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/worker1", + (GDBusInterfaceInfo *) &foo_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + worker1_foo_reg_id = registration_id; + num_successful_registrations++; + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/worker1p1", + (GDBusInterfaceInfo *) &foo_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + worker1p1_foo_reg_id = registration_id; + num_successful_registrations++; + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/worker2", + (GDBusInterfaceInfo *) &bar_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + worker2_bar_reg_id = registration_id; + num_successful_registrations++; + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/interns/intern1", + (GDBusInterfaceInfo *) &foo_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + intern1_foo_reg_id = registration_id; + num_successful_registrations++; + + /* ... and try again at another path */ + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/interns/intern2", + (GDBusInterfaceInfo *) &bar_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + intern2_bar_reg_id = registration_id; + num_successful_registrations++; + + /* register at the same path/interface - this should fail */ + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/interns/intern2", + (GDBusInterfaceInfo *) &bar_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS); + g_assert (!g_dbus_error_is_remote_error (error)); + g_error_free (error); + error = NULL; + g_assert (registration_id == 0); + + /* register at different interface - shouldn't fail */ + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/interns/intern2", + (GDBusInterfaceInfo *) &foo_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + intern2_foo_reg_id = registration_id; + num_successful_registrations++; + + /* unregister it via the id */ + g_assert (g_dbus_connection_unregister_object (c, registration_id)); + g_assert_cmpint (data.num_unregistered_calls, ==, 1); + intern2_foo_reg_id = 0; + + /* register it back */ + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/interns/intern2", + (GDBusInterfaceInfo *) &foo_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + intern2_foo_reg_id = registration_id; + num_successful_registrations++; + + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/interns/intern3", + (GDBusInterfaceInfo *) &bar_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + intern3_bar_reg_id = registration_id; + num_successful_registrations++; + + /* now register a whole subtree at /foo/boss/executives */ + subtree_registration_id = g_dbus_connection_register_subtree (c, + "/foo/boss/executives", + &subtree_vtable, + G_DBUS_SUBTREE_FLAGS_NONE, + &data, + on_subtree_unregistered, + &error); + g_assert_no_error (error); + g_assert (subtree_registration_id > 0); + /* try registering it again.. this should fail */ + registration_id = g_dbus_connection_register_subtree (c, + "/foo/boss/executives", + &subtree_vtable, + G_DBUS_SUBTREE_FLAGS_NONE, + &data, + on_subtree_unregistered, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS); + g_assert (!g_dbus_error_is_remote_error (error)); + g_error_free (error); + error = NULL; + g_assert (registration_id == 0); + + /* unregister it, then register it again */ + g_assert_cmpint (data.num_unregistered_subtree_calls, ==, 0); + g_assert (g_dbus_connection_unregister_subtree (c, subtree_registration_id)); + g_assert_cmpint (data.num_unregistered_subtree_calls, ==, 1); + subtree_registration_id = g_dbus_connection_register_subtree (c, + "/foo/boss/executives", + &subtree_vtable, + G_DBUS_SUBTREE_FLAGS_NONE, + &data, + on_subtree_unregistered, + &error); + g_assert_no_error (error); + g_assert (subtree_registration_id > 0); + + /* try to register something under /foo/boss/executives - this should work + * because registered subtrees and registered objects can coexist. + * + * Make the exported object implement *two* interfaces so we can check + * that the right introspection handler is invoked. + */ + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/executives/non_subtree_object", + (GDBusInterfaceInfo *) &bar_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + non_subtree_object_path_bar_reg_id = registration_id; + num_successful_registrations++; + registration_id = g_dbus_connection_register_object (c, + "/foo/boss/executives/non_subtree_object", + (GDBusInterfaceInfo *) &foo_interface_info, + NULL, + &data, + on_object_unregistered, + &error); + g_assert_no_error (error); + g_assert (registration_id > 0); + non_subtree_object_path_foo_reg_id = registration_id; + num_successful_registrations++; + + /* now register a dynamic subtree, spawning objects as they are called */ + dyna_data = g_ptr_array_new (); + dyna_subtree_registration_id = g_dbus_connection_register_subtree (c, + "/foo/dyna", + &dynamic_subtree_vtable, + G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES, + dyna_data, + (GDestroyNotify)g_ptr_array_unref, + &error); + g_assert_no_error (error); + g_assert (dyna_subtree_registration_id > 0); + + /* First assert that we have no nodes in the dynamic subtree */ + nodes = get_nodes_at (c, "/foo/dyna"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 0); + g_strfreev (nodes); + g_assert_cmpint (count_interfaces (c, "/foo/dyna"), ==, 4); + + /* Install three nodes in the dynamic subtree via the dyna_data backdoor and + * assert that they show up correctly in the introspection data */ + g_ptr_array_add (dyna_data, "lol"); + g_ptr_array_add (dyna_data, "cat"); + g_ptr_array_add (dyna_data, "cheezburger"); + nodes = get_nodes_at (c, "/foo/dyna"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 3); + g_assert_cmpstr (nodes[0], ==, "lol"); + g_assert_cmpstr (nodes[1], ==, "cat"); + g_assert_cmpstr (nodes[2], ==, "cheezburger"); + g_strfreev (nodes); + g_assert_cmpint (count_interfaces (c, "/foo/dyna/lol"), ==, 4); + g_assert_cmpint (count_interfaces (c, "/foo/dyna/cat"), ==, 4); + g_assert_cmpint (count_interfaces (c, "/foo/dyna/cheezburger"), ==, 4); + + /* Call a non-existing object path and assert that it has been created */ + dyna_create (c, "dynamicallycreated"); + nodes = get_nodes_at (c, "/foo/dyna"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 4); + g_assert_cmpstr (nodes[0], ==, "lol"); + g_assert_cmpstr (nodes[1], ==, "cat"); + g_assert_cmpstr (nodes[2], ==, "cheezburger"); + g_assert_cmpstr (nodes[3], ==, "dynamicallycreated"); + g_strfreev (nodes); + g_assert_cmpint (count_interfaces (c, "/foo/dyna/dynamicallycreated"), ==, 4); + + /* now check that the object hierarachy is properly generated... yes, it's a bit + * perverse that we round-trip to the bus to introspect ourselves ;-) + */ + nodes = get_nodes_at (c, "/"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 1); + g_assert_cmpstr (nodes[0], ==, "foo"); + g_strfreev (nodes); + g_assert_cmpint (count_interfaces (c, "/"), ==, 0); + + nodes = get_nodes_at (c, "/foo"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 2); + g_assert_cmpstr (nodes[0], ==, "boss"); + g_assert_cmpstr (nodes[1], ==, "dyna"); + g_strfreev (nodes); + g_assert_cmpint (count_interfaces (c, "/foo"), ==, 0); + + nodes = get_nodes_at (c, "/foo/boss"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 5); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "worker1")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "worker1p1")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "worker2")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "interns")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "executives")); + g_strfreev (nodes); + /* any registered object always implement org.freedesktop.DBus.[Peer,Introspectable,Properties] */ + g_assert_cmpint (count_interfaces (c, "/foo/boss"), ==, 5); + g_assert (has_interface (c, "/foo/boss", foo_interface_info.name)); + g_assert (has_interface (c, "/foo/boss", bar_interface_info.name)); + + /* check subtree nodes - we should have only non_subtree_object in /foo/boss/executives + * because data.num_subtree_nodes is 0 + */ + nodes = get_nodes_at (c, "/foo/boss/executives"); + g_assert (nodes != NULL); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "non_subtree_object")); + g_assert_cmpint (g_strv_length (nodes), ==, 1); + g_strfreev (nodes); + g_assert_cmpint (count_interfaces (c, "/foo/boss/executives"), ==, 0); + + /* now change data.num_subtree_nodes and check */ + data.num_subtree_nodes = 2; + nodes = get_nodes_at (c, "/foo/boss/executives"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 5); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "non_subtree_object")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "vp0")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "vp1")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "evp0")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "evp1")); + /* check that /foo/boss/executives/non_subtree_object is not handled by the + * subtree handlers - we can do this because objects from subtree handlers + * has exactly one interface and non_subtree_object has two + */ + g_assert_cmpint (count_interfaces (c, "/foo/boss/executives/non_subtree_object"), ==, 5); + g_assert (has_interface (c, "/foo/boss/executives/non_subtree_object", foo_interface_info.name)); + g_assert (has_interface (c, "/foo/boss/executives/non_subtree_object", bar_interface_info.name)); + /* check that the vp and evp objects are handled by the subtree handlers */ + g_assert_cmpint (count_interfaces (c, "/foo/boss/executives/vp0"), ==, 4); + g_assert_cmpint (count_interfaces (c, "/foo/boss/executives/vp1"), ==, 4); + g_assert_cmpint (count_interfaces (c, "/foo/boss/executives/evp0"), ==, 4); + g_assert_cmpint (count_interfaces (c, "/foo/boss/executives/evp1"), ==, 4); + g_assert (has_interface (c, "/foo/boss/executives/vp0", foo_interface_info.name)); + g_assert (has_interface (c, "/foo/boss/executives/vp1", foo_interface_info.name)); + g_assert (has_interface (c, "/foo/boss/executives/evp0", bar_interface_info.name)); + g_assert (has_interface (c, "/foo/boss/executives/evp1", bar_interface_info.name)); + g_strfreev (nodes); + data.num_subtree_nodes = 3; + nodes = get_nodes_at (c, "/foo/boss/executives"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 7); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "non_subtree_object")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "vp0")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "vp1")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "vp2")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "evp0")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "evp1")); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "evp2")); + g_strfreev (nodes); + + /* This is to check that a bug (rather, class of bugs) in gdbusconnection.c's + * + * g_dbus_connection_list_registered_unlocked() + * + * where /foo/boss/worker1 reported a child '1', is now fixed. + */ + nodes = get_nodes_at (c, "/foo/boss/worker1"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 0); + g_strfreev (nodes); + + /* check that calls are properly dispatched to the functions in foo_vtable for objects + * implementing the org.example.Foo interface + * + * We do this for both a regular registered object (/foo/boss) and also for an object + * registered through the subtree mechanism. + */ + test_dispatch ("/foo/boss"); + test_dispatch ("/foo/boss/executives/vp0"); + + /* To prevent from exiting and attaching a D-Bus tool like D-Feet; uncomment: */ +#if 0 + g_debug ("Point D-feet or other tool at: %s", session_bus_get_temporary_address()); + g_main_loop_run (loop); +#endif + + /* check that unregistering the subtree handler works */ + g_assert_cmpint (data.num_unregistered_subtree_calls, ==, 1); + g_assert (g_dbus_connection_unregister_subtree (c, subtree_registration_id)); + g_assert_cmpint (data.num_unregistered_subtree_calls, ==, 2); + nodes = get_nodes_at (c, "/foo/boss/executives"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 1); + g_assert (_g_strv_has_string ((const gchar* const *) nodes, "non_subtree_object")); + g_strfreev (nodes); + + g_assert (g_dbus_connection_unregister_object (c, boss_foo_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, boss_bar_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, worker1_foo_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, worker1p1_foo_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, worker2_bar_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, intern1_foo_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, intern2_bar_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, intern2_foo_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, intern3_bar_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, non_subtree_object_path_bar_reg_id)); + g_assert (g_dbus_connection_unregister_object (c, non_subtree_object_path_foo_reg_id)); + + g_assert_cmpint (data.num_unregistered_calls, ==, num_successful_registrations); + + /* check that we no longer export any objects - TODO: it looks like there's a bug in + * libdbus-1 here: libdbus still reports the '/foo' object; so disable the test for now + */ +#if 0 + nodes = get_nodes_at (c, "/"); + g_assert (nodes != NULL); + g_assert_cmpint (g_strv_length (nodes), ==, 0); + g_strfreev (nodes); +#endif + + g_object_unref (c); +} + + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + gint ret; + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + session_bus_up (); + + /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return + * until one can connect to the bus but that's not how things work right now + */ + usleep (500 * 1000); + + g_test_add_func ("/gdbus/object-registration", test_object_registration); + /* TODO: check that we spit out correct introspection data */ + /* TODO: check that registering a whole subtree works */ + + ret = g_test_run(); + + /* tear down bus */ + session_bus_down (); + + return ret; +} diff --git a/gio/tests/gdbus-introspection.c b/gio/tests/gdbus-introspection.c new file mode 100644 index 0000000..d0f6c26 --- /dev/null +++ b/gio/tests/gdbus-introspection.c @@ -0,0 +1,331 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test introspection parser */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_introspection (GDBusProxy *proxy) +{ + GError *error; + const gchar *xml_data; + GDBusNodeInfo *node_info; + GDBusInterfaceInfo *interface_info; + GDBusMethodInfo *method_info; + GDBusSignalInfo *signal_info; + GVariant *result; + + error = NULL; + + /* + * Invoke Introspect(), then parse the output. + */ + result = g_dbus_proxy_call_sync (proxy, + "org.freedesktop.DBus.Introspectable.Introspect", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_get (result, "(&s)", &xml_data); + + node_info = g_dbus_node_info_new_for_xml (xml_data, &error); + g_assert_no_error (error); + g_assert (node_info != NULL); + + /* for now we only check a couple of things. TODO: check more things */ + + interface_info = g_dbus_node_info_lookup_interface (node_info, "com.example.NonExistantInterface"); + g_assert (interface_info == NULL); + + interface_info = g_dbus_node_info_lookup_interface (node_info, "org.freedesktop.DBus.Introspectable"); + g_assert (interface_info != NULL); + method_info = g_dbus_interface_info_lookup_method (interface_info, "NonExistantMethod"); + g_assert (method_info == NULL); + method_info = g_dbus_interface_info_lookup_method (interface_info, "Introspect"); + g_assert (method_info != NULL); + g_assert (method_info->in_args == NULL); + g_assert (method_info->out_args != NULL); + g_assert (method_info->out_args[0] != NULL); + g_assert (method_info->out_args[1] == NULL); + g_assert_cmpstr (method_info->out_args[0]->signature, ==, "s"); + + interface_info = g_dbus_node_info_lookup_interface (node_info, "com.example.Frob"); + g_assert (interface_info != NULL); + signal_info = g_dbus_interface_info_lookup_signal (interface_info, "TestSignal"); + g_assert (signal_info != NULL); + g_assert (signal_info->args != NULL); + g_assert (signal_info->args[0] != NULL); + g_assert_cmpstr (signal_info->args[0]->signature, ==, "s"); + g_assert (signal_info->args[1] != NULL); + g_assert_cmpstr (signal_info->args[1]->signature, ==, "o"); + g_assert (signal_info->args[2] != NULL); + g_assert_cmpstr (signal_info->args[2]->signature, ==, "v"); + g_assert (signal_info->args[3] == NULL); + + g_dbus_node_info_unref (node_info); + g_variant_unref (result); + + g_main_loop_quit (loop); +} + +static void +test_introspection_parser (void) +{ + GDBusProxy *proxy; + GDBusConnection *connection; + GError *error; + + session_bus_up (); + + /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return + * until one can connect to the bus but that's not how things work right now + */ + usleep (500 * 1000); + + error = NULL; + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, + NULL, + &error); + g_assert_no_error (error); + error = NULL; + proxy = g_dbus_proxy_new_sync (connection, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + + _g_assert_property_notify (proxy, "g-name-owner"); + + test_introspection (proxy); + + g_object_unref (proxy); + g_object_unref (connection); +} + +/* check that a parse-generate roundtrip produces identical results + */ +static void +test_generate (void) +{ + GDBusNodeInfo *info; + GDBusNodeInfo *info2; + GDBusInterfaceInfo *iinfo; + GDBusMethodInfo *minfo; + GDBusSignalInfo *sinfo; + GDBusArgInfo *arginfo; + GDBusPropertyInfo *pinfo; + GDBusAnnotationInfo *aninfo; + const gchar *data = + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "; + + GString *string; + GString *string2; + GError *error; + + error = NULL; + info = g_dbus_node_info_new_for_xml (data, &error); + g_assert_no_error (error); + + iinfo = g_dbus_node_info_lookup_interface (info, "com.example.Frob"); + aninfo = iinfo->annotations[0]; + g_assert_cmpstr (aninfo->key, ==, "foo"); + g_assert_cmpstr (aninfo->value, ==, "bar"); + g_assert (iinfo->annotations[1] == NULL); + minfo = g_dbus_interface_info_lookup_method (iinfo, "PairReturn"); + g_assert_cmpstr (g_dbus_annotation_info_lookup (minfo->annotations, "org.freedesktop.DBus.GLib.Async"), ==, ""); + arginfo = minfo->in_args[0]; + g_assert_cmpstr (arginfo->name, ==, "somenumber"); + g_assert_cmpstr (arginfo->signature, ==, "u"); + g_assert (minfo->in_args[1] == NULL); + arginfo = minfo->out_args[0]; + g_assert_cmpstr (arginfo->name, ==, "somestring"); + g_assert_cmpstr (arginfo->signature, ==, "s"); + g_assert (minfo->out_args[1] == NULL); + sinfo = g_dbus_interface_info_lookup_signal (iinfo, "HelloWorld"); + arginfo = sinfo->args[0]; + g_assert_cmpstr (arginfo->name, ==, "greeting"); + g_assert_cmpstr (arginfo->signature, ==, "s"); + g_assert (sinfo->args[1] == NULL); + pinfo = g_dbus_interface_info_lookup_property (iinfo, "y"); + g_assert_cmpstr (pinfo->signature, ==, "y"); + g_assert_cmpint (pinfo->flags, ==, G_DBUS_PROPERTY_INFO_FLAGS_READABLE | + G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE); + + string = g_string_new (""); + g_dbus_node_info_generate_xml (info, 2, string); + + info2 = g_dbus_node_info_new_for_xml (string->str, &error); + string2 = g_string_new (""); + g_dbus_node_info_generate_xml (info2, 2, string2); + + g_assert_cmpstr (string->str, ==, string2->str); + g_string_free (string, TRUE); + g_string_free (string2, TRUE); + + g_dbus_node_info_unref (info); + g_dbus_node_info_unref (info2); +} + +/* test that omitted direction attributes default to 'out' for signals, + * and 'in' for methods. + */ +static void +test_default_direction (void) +{ + GDBusNodeInfo *info; + GDBusInterfaceInfo *iinfo; + GDBusMethodInfo *minfo; + GDBusSignalInfo *sinfo; + GDBusArgInfo *arginfo; + const gchar *data = + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "; + + GError *error; + + error = NULL; + info = g_dbus_node_info_new_for_xml (data, &error); + g_assert_no_error (error); + + iinfo = g_dbus_node_info_lookup_interface (info, "com.example.Frob"); + sinfo = g_dbus_interface_info_lookup_signal (iinfo, "HelloWorld"); + g_assert (sinfo->args != NULL); + arginfo = sinfo->args[0]; + g_assert_cmpstr (arginfo->name, ==, "greeting"); + g_assert (sinfo->args[1] == NULL); + minfo = g_dbus_interface_info_lookup_method (iinfo, "Sleep"); + g_assert (minfo->in_args != NULL); + arginfo = minfo->in_args[0]; + g_assert_cmpstr (arginfo->name, ==, "timeout"); + g_assert (minfo->in_args[1] == NULL); + + g_dbus_node_info_unref (info); +} + +#if 0 +/* XXX: need to figure out how generous we want to be here */ +/* test that extraneous attributes are ignored + */ +static void +test_extra_data (void) +{ + GDBusNodeInfo *info; + const gchar *data = + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "; + GError *error; + + error = NULL; + info = g_dbus_node_info_new_for_xml (data, &error); + g_assert_no_error (error); + + g_dbus_node_info_unref (info); +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/introspection-parser", test_introspection_parser); + g_test_add_func ("/gdbus/introspection-generate", test_generate); + g_test_add_func ("/gdbus/introspection-default-direction", test_default_direction); +#if 0 + /* XXX: need to figure out how generous we want to be here */ + g_test_add_func ("/gdbus/introspection-extra-data", test_extra_data); +#endif + + return g_test_run(); +} diff --git a/gio/tests/gdbus-message.c b/gio/tests/gdbus-message.c new file mode 100644 index 0000000..b3be200 --- /dev/null +++ b/gio/tests/gdbus-message.c @@ -0,0 +1,153 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +on_notify_locked (GObject *object, + GParamSpec *pspec, + gpointer user_data) +{ + gint *count = user_data; + *count += 1; +} + +static void +message_lock (void) +{ + GDBusMessage *m; + gint count; + + count = 0; + m = g_dbus_message_new (); + g_signal_connect (m, + "notify::locked", + G_CALLBACK (on_notify_locked), + &count); + g_assert (!g_dbus_message_get_locked (m)); + g_dbus_message_lock (m); + g_assert (g_dbus_message_get_locked (m)); + g_assert_cmpint (count, ==, 1); + g_dbus_message_lock (m); + g_assert (g_dbus_message_get_locked (m)); + g_assert_cmpint (count, ==, 1); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_dbus_message_set_serial (m, 42); + g_test_trap_assert_failed (); g_test_trap_assert_stderr ("*Attempted to modify a locked message*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_dbus_message_set_byte_order (m, G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN); + g_test_trap_assert_failed (); g_test_trap_assert_stderr ("*Attempted to modify a locked message*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_dbus_message_set_message_type (m, G_DBUS_MESSAGE_TYPE_METHOD_CALL); + g_test_trap_assert_failed (); g_test_trap_assert_stderr ("*Attempted to modify a locked message*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_dbus_message_set_flags (m, G_DBUS_MESSAGE_FLAGS_NONE); + g_test_trap_assert_failed (); g_test_trap_assert_stderr ("*Attempted to modify a locked message*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_dbus_message_set_body (m, NULL); + g_test_trap_assert_failed (); g_test_trap_assert_stderr ("*Attempted to modify a locked message*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_dbus_message_set_header (m, 0, NULL); + g_test_trap_assert_failed (); g_test_trap_assert_stderr ("*Attempted to modify a locked message*"); + + g_object_unref (m); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +message_copy (void) +{ + GDBusMessage *m; + GDBusMessage *copy; + GError *error; + guchar *m_headers; + guchar *copy_headers; + guint n; + + m = g_dbus_message_new_method_call ("org.example.Name", + "/org/example/Object", + "org.example.Interface", + "Method"); + g_dbus_message_set_serial (m, 42); + g_dbus_message_set_byte_order (m, G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN); + + error = NULL; + copy = g_dbus_message_copy (m, &error); + g_assert_no_error (error); + g_assert (G_IS_DBUS_MESSAGE (copy)); + g_assert (m != copy); + g_assert_cmpint (G_OBJECT (m)->ref_count, ==, 1); + g_assert_cmpint (G_OBJECT (copy)->ref_count, ==, 1); + + g_assert_cmpint (g_dbus_message_get_serial (copy), ==, g_dbus_message_get_serial (m)); + g_assert_cmpint (g_dbus_message_get_byte_order (copy), ==, g_dbus_message_get_byte_order (m)); + g_assert_cmpint (g_dbus_message_get_flags (copy), ==, g_dbus_message_get_flags (m)); + g_assert_cmpint (g_dbus_message_get_message_type (copy), ==, g_dbus_message_get_message_type (m)); + m_headers = g_dbus_message_get_header_fields (m); + copy_headers = g_dbus_message_get_header_fields (copy); + g_assert (m_headers != NULL); + g_assert (copy_headers != NULL); + for (n = 0; m_headers[n] != 0; n++) + { + GVariant *m_val; + GVariant *copy_val; + m_val = g_dbus_message_get_header (m, m_headers[n]); + copy_val = g_dbus_message_get_header (m, m_headers[n]); + g_assert (m_val != NULL); + g_assert (copy_val != NULL); + g_assert (g_variant_equal (m_val, copy_val)); + } + g_assert_cmpint (n, >, 0); /* make sure we actually compared headers etc. */ + g_assert_cmpint (copy_headers[n], ==, 0); + g_free (m_headers); + g_free (copy_headers); + + g_object_unref (copy); + g_object_unref (m); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + setlocale (LC_ALL, "C"); + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/gdbus/message/lock", message_lock); + g_test_add_func ("/gdbus/message/copy", message_copy); + return g_test_run(); +} + diff --git a/gio/tests/gdbus-names.c b/gio/tests/gdbus-names.c new file mode 100644 index 0000000..80e41a5 --- /dev/null +++ b/gio/tests/gdbus-names.c @@ -0,0 +1,765 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that g_bus_own_name() works correctly */ +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GMainLoop *loop; + gboolean expect_null_connection; + guint num_bus_acquired; + guint num_acquired; + guint num_lost; + guint num_free_func; +} OwnNameData; + +static void +own_name_data_free_func (OwnNameData *data) +{ + data->num_free_func++; + g_main_loop_quit (loop); +} + +static void +bus_acquired_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + OwnNameData *data = user_data; + g_dbus_connection_set_exit_on_close (connection, FALSE); + data->num_bus_acquired += 1; + g_main_loop_quit (loop); +} + +static void +name_acquired_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + OwnNameData *data = user_data; + data->num_acquired += 1; + g_main_loop_quit (loop); +} + +static void +name_lost_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + OwnNameData *data = user_data; + if (data->expect_null_connection) + { + g_assert (connection == NULL); + } + else + { + g_assert (connection != NULL); + g_dbus_connection_set_exit_on_close (connection, FALSE); + } + data->num_lost += 1; + g_main_loop_quit (loop); +} + +static void +test_bus_own_name (void) +{ + guint id; + guint id2; + OwnNameData data; + OwnNameData data2; + const gchar *name; + GDBusConnection *c; + GError *error; + gboolean name_has_owner_reply; + GDBusConnection *c2; + GVariant *result; + + error = NULL; + name = "org.gtk.GDBus.Name1"; + + /* + * First check that name_lost_handler() is invoked if there is no bus. + * + * Also make sure name_lost_handler() isn't invoked when unowning the name. + */ + data.num_bus_acquired = 0; + data.num_free_func = 0; + data.num_acquired = 0; + data.num_lost = 0; + data.expect_null_connection = TRUE; + id = g_bus_own_name (G_BUS_TYPE_SESSION, + name, + G_BUS_NAME_OWNER_FLAGS_NONE, + bus_acquired_handler, + name_acquired_handler, + name_lost_handler, + &data, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data.num_bus_acquired, ==, 0); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 0); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 1); + g_bus_unown_name (id); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 1); + g_assert_cmpint (data.num_free_func, ==, 1); + + /* + * Bring up a bus, then own a name and check bus_acquired_handler() then name_acquired_handler() is invoked. + */ + session_bus_up (); + data.num_bus_acquired = 0; + data.num_acquired = 0; + data.num_lost = 0; + data.expect_null_connection = FALSE; + id = g_bus_own_name (G_BUS_TYPE_SESSION, + name, + G_BUS_NAME_OWNER_FLAGS_NONE, + bus_acquired_handler, + name_acquired_handler, + name_lost_handler, + &data, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data.num_bus_acquired, ==, 0); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 0); + + /* + * Check that the name was actually acquired. + */ + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c != NULL); + g_assert (!g_dbus_connection_is_closed (c)); + result = g_dbus_connection_call_sync (c, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "NameHasOwner", /* method name */ + g_variant_new ("(s)", name), + G_VARIANT_TYPE ("(b)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_get (result, "(b)", &name_has_owner_reply); + g_assert (name_has_owner_reply); + g_variant_unref (result); + + /* + * Stop owning the name - this should invoke our free func + */ + g_bus_unown_name (id); + g_assert_cmpint (data.num_free_func, ==, 2); + + /* + * Check that the name was actually released. + */ + result = g_dbus_connection_call_sync (c, + "org.freedesktop.DBus", /* bus name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "NameHasOwner", /* method name */ + g_variant_new ("(s)", name), + G_VARIANT_TYPE ("(b)"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_get (result, "(b)", &name_has_owner_reply); + g_assert (!name_has_owner_reply); + g_variant_unref (result); + + /* + * Own the name again. + */ + data.num_bus_acquired = 0; + data.num_acquired = 0; + data.num_lost = 0; + data.expect_null_connection = FALSE; + id = g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, + name, + G_BUS_NAME_OWNER_FLAGS_NONE, + g_cclosure_new (G_CALLBACK (bus_acquired_handler), + &data, + NULL), + g_cclosure_new (G_CALLBACK (name_acquired_handler), + &data, + NULL), + g_cclosure_new (G_CALLBACK (name_lost_handler), + &data, + (GClosureNotify) own_name_data_free_func)); + g_assert_cmpint (data.num_bus_acquired, ==, 0); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 0); + + /* + * Try owning the name with another object on the same connection - this should + * fail because we already own the name. + */ + data2.num_free_func = 0; + data2.num_bus_acquired = 0; + data2.num_acquired = 0; + data2.num_lost = 0; + data2.expect_null_connection = FALSE; + id2 = g_bus_own_name (G_BUS_TYPE_SESSION, + name, + G_BUS_NAME_OWNER_FLAGS_NONE, + bus_acquired_handler, + name_acquired_handler, + name_lost_handler, + &data2, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data2.num_bus_acquired, ==, 1); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data2.num_bus_acquired, ==, 1); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_bus_unown_name (id2); + g_assert_cmpint (data2.num_bus_acquired, ==, 1); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_assert_cmpint (data2.num_free_func, ==, 1); + + /* + * Create a secondary (e.g. private) connection and try owning the name on that + * connection. This should fail both with and without _REPLACE because we + * didn't specify ALLOW_REPLACEMENT. + */ + c2 = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (c2 != NULL); + g_assert (!g_dbus_connection_is_closed (c2)); + /* first without _REPLACE */ + data2.num_bus_acquired = 0; + data2.num_acquired = 0; + data2.num_lost = 0; + data2.expect_null_connection = FALSE; + data2.num_free_func = 0; + id2 = g_bus_own_name_on_connection (c2, + name, + G_BUS_NAME_OWNER_FLAGS_NONE, + name_acquired_handler, + name_lost_handler, + &data2, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_bus_unown_name (id2); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_assert_cmpint (data2.num_free_func, ==, 1); + /* then with _REPLACE */ + data2.num_bus_acquired = 0; + data2.num_acquired = 0; + data2.num_lost = 0; + data2.expect_null_connection = FALSE; + data2.num_free_func = 0; + id2 = g_bus_own_name_on_connection (c2, + name, + G_BUS_NAME_OWNER_FLAGS_REPLACE, + name_acquired_handler, + name_lost_handler, + &data2, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_bus_unown_name (id2); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_assert_cmpint (data2.num_free_func, ==, 1); + + /* + * Stop owning the name and grab it again with _ALLOW_REPLACEMENT. + */ + data.expect_null_connection = FALSE; + g_bus_unown_name (id); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_free_func, ==, 3); + /* grab it again */ + data.num_bus_acquired = 0; + data.num_acquired = 0; + data.num_lost = 0; + data.expect_null_connection = FALSE; + id = g_bus_own_name (G_BUS_TYPE_SESSION, + name, + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, + bus_acquired_handler, + name_acquired_handler, + name_lost_handler, + &data, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data.num_bus_acquired, ==, 0); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 0); + g_assert_cmpint (data.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_bus_acquired, ==, 1); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 0); + + /* + * Now try to grab the name from the secondary connection. + * + */ + /* first without _REPLACE - this won't make us acquire the name */ + data2.num_bus_acquired = 0; + data2.num_acquired = 0; + data2.num_lost = 0; + data2.expect_null_connection = FALSE; + data2.num_free_func = 0; + id2 = g_bus_own_name_on_connection (c2, + name, + G_BUS_NAME_OWNER_FLAGS_NONE, + name_acquired_handler, + name_lost_handler, + &data2, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_bus_unown_name (id2); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 1); + g_assert_cmpint (data2.num_free_func, ==, 1); + /* then with _REPLACE - here we should acquire the name - e.g. owner should lose it + * and owner2 should acquire it */ + data2.num_bus_acquired = 0; + data2.num_acquired = 0; + data2.num_lost = 0; + data2.expect_null_connection = FALSE; + data2.num_free_func = 0; + id2 = g_bus_own_name_on_connection (c2, + name, + G_BUS_NAME_OWNER_FLAGS_REPLACE, + name_acquired_handler, + name_lost_handler, + &data2, + (GDestroyNotify) own_name_data_free_func); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 0); + g_assert_cmpint (data2.num_acquired, ==, 0); + g_assert_cmpint (data2.num_lost, ==, 0); + /* wait for handlers for both owner and owner2 to fire */ + while (data.num_lost == 0 || data2.num_acquired == 0) + g_main_loop_run (loop); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 1); + g_assert_cmpint (data2.num_acquired, ==, 1); + g_assert_cmpint (data2.num_lost, ==, 0); + g_assert_cmpint (data2.num_bus_acquired, ==, 0); + /* ok, make owner2 release the name - then wait for owner to automagically reacquire it */ + g_bus_unown_name (id2); + g_assert_cmpint (data2.num_free_func, ==, 1); + g_main_loop_run (loop); + g_assert_cmpint (data.num_acquired, ==, 2); + g_assert_cmpint (data.num_lost, ==, 1); + + /* + * Finally, nuke the bus and check name_lost_handler() is invoked. + * + */ + data.expect_null_connection = TRUE; + session_bus_down (); + while (data.num_lost != 2) + g_main_loop_run (loop); + g_assert_cmpint (data.num_acquired, ==, 2); + g_assert_cmpint (data.num_lost, ==, 2); + g_bus_unown_name (id); + g_assert_cmpint (data.num_free_func, ==, 4); + + _g_object_wait_for_single_ref (c); + g_object_unref (c); + g_object_unref (c2); +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that g_bus_watch_name() works correctly */ +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + gboolean expect_null_connection; + guint num_acquired; + guint num_lost; + guint num_appeared; + guint num_vanished; + guint num_free_func; +} WatchNameData; + +static void +watch_name_data_free_func (WatchNameData *data) +{ + data->num_free_func++; + g_main_loop_quit (loop); +} + +static void +w_bus_acquired_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ +} + +static void +w_name_acquired_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + WatchNameData *data = user_data; + data->num_acquired += 1; + g_main_loop_quit (loop); +} + +static void +w_name_lost_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + WatchNameData *data = user_data; + data->num_lost += 1; + g_main_loop_quit (loop); +} + +static void +name_appeared_handler (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer user_data) +{ + WatchNameData *data = user_data; + if (data->expect_null_connection) + { + g_assert (connection == NULL); + } + else + { + g_assert (connection != NULL); + g_dbus_connection_set_exit_on_close (connection, FALSE); + } + data->num_appeared += 1; + g_main_loop_quit (loop); +} + +static void +name_vanished_handler (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + WatchNameData *data = user_data; + if (data->expect_null_connection) + { + g_assert (connection == NULL); + } + else + { + g_assert (connection != NULL); + g_dbus_connection_set_exit_on_close (connection, FALSE); + } + data->num_vanished += 1; + g_main_loop_quit (loop); +} + +static void +test_bus_watch_name (void) +{ + WatchNameData data; + guint id; + guint owner_id; + GDBusConnection *connection; + + /* + * First check that name_vanished_handler() is invoked if there is no bus. + * + * Also make sure name_vanished_handler() isn't invoked when unwatching the name. + */ + data.num_free_func = 0; + data.num_appeared = 0; + data.num_vanished = 0; + data.expect_null_connection = TRUE; + id = g_bus_watch_name (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.Name1", + G_BUS_NAME_WATCHER_FLAGS_NONE, + name_appeared_handler, + name_vanished_handler, + &data, + (GDestroyNotify) watch_name_data_free_func); + g_assert_cmpint (data.num_appeared, ==, 0); + g_assert_cmpint (data.num_vanished, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_appeared, ==, 0); + g_assert_cmpint (data.num_vanished, ==, 1); + g_bus_unwatch_name (id); + g_assert_cmpint (data.num_appeared, ==, 0); + g_assert_cmpint (data.num_vanished, ==, 1); + g_assert_cmpint (data.num_free_func, ==, 1); + + /* + * Now bring up a bus, own a name, and then start watching it. + */ + session_bus_up (); + /* own the name */ + data.num_free_func = 0; + data.num_acquired = 0; + data.num_lost = 0; + data.expect_null_connection = FALSE; + owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.Name1", + G_BUS_NAME_OWNER_FLAGS_NONE, + w_bus_acquired_handler, + w_name_acquired_handler, + w_name_lost_handler, + &data, + (GDestroyNotify) watch_name_data_free_func); + g_main_loop_run (loop); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 0); + + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + g_assert (connection != NULL); + + /* now watch the name */ + data.num_appeared = 0; + data.num_vanished = 0; + id = g_bus_watch_name_on_connection (connection, + "org.gtk.GDBus.Name1", + G_BUS_NAME_WATCHER_FLAGS_NONE, + name_appeared_handler, + name_vanished_handler, + &data, + (GDestroyNotify) watch_name_data_free_func); + g_assert_cmpint (data.num_appeared, ==, 0); + g_assert_cmpint (data.num_vanished, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_appeared, ==, 1); + g_assert_cmpint (data.num_vanished, ==, 0); + + /* + * Unwatch the name. + */ + g_bus_unwatch_name (id); + g_assert_cmpint (data.num_free_func, ==, 1); + + g_object_unref (connection); + + /* unown the name */ + g_bus_unown_name (owner_id); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_free_func, ==, 2); + + /* + * Create a watcher and then make a name be owned. + * + * This should trigger name_appeared_handler() ... + */ + /* watch the name */ + data.num_appeared = 0; + data.num_vanished = 0; + data.num_free_func = 0; + id = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.Name1", + G_BUS_NAME_WATCHER_FLAGS_NONE, + g_cclosure_new (G_CALLBACK (name_appeared_handler), + &data, + NULL), + g_cclosure_new (G_CALLBACK (name_vanished_handler), + &data, + (GClosureNotify) watch_name_data_free_func)); + g_assert_cmpint (data.num_appeared, ==, 0); + g_assert_cmpint (data.num_vanished, ==, 0); + g_main_loop_run (loop); + g_assert_cmpint (data.num_appeared, ==, 0); + g_assert_cmpint (data.num_vanished, ==, 1); + + /* own the name */ + data.num_acquired = 0; + data.num_lost = 0; + data.expect_null_connection = FALSE; + owner_id = g_bus_own_name (G_BUS_TYPE_SESSION, + "org.gtk.GDBus.Name1", + G_BUS_NAME_OWNER_FLAGS_NONE, + w_bus_acquired_handler, + w_name_acquired_handler, + w_name_lost_handler, + &data, + (GDestroyNotify) watch_name_data_free_func); + while (data.num_acquired == 0 || data.num_appeared == 0) + g_main_loop_run (loop); + g_assert_cmpint (data.num_acquired, ==, 1); + g_assert_cmpint (data.num_lost, ==, 0); + g_assert_cmpint (data.num_appeared, ==, 1); + g_assert_cmpint (data.num_vanished, ==, 1); + + /* + * Nuke the bus and check that the name vanishes and is lost. + */ + data.expect_null_connection = TRUE; + session_bus_down (); + g_main_loop_run (loop); + g_assert_cmpint (data.num_lost, ==, 1); + g_assert_cmpint (data.num_vanished, ==, 2); + + g_bus_unwatch_name (id); + g_assert_cmpint (data.num_free_func, ==, 1); + + g_bus_unown_name (owner_id); + g_assert_cmpint (data.num_free_func, ==, 2); + +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_validate_names (void) +{ + guint n; + static const struct + { + gboolean name; + gboolean unique; + gboolean interface; + const gchar *string; + } names[] = { + { 1, 0, 1, "valid.well_known.name"}, + { 1, 0, 0, "valid.well-known.name"}, + { 1, 1, 0, ":valid.unique.name"}, + { 0, 0, 0, "invalid.5well_known.name"}, + { 0, 0, 0, "4invalid.5well_known.name"}, + { 1, 1, 0, ":4valid.5unique.name"}, + { 0, 0, 0, ""}, + { 1, 0, 1, "very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.name1"}, /* 255 */ + { 0, 0, 0, "very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.very.long.name12"}, /* 256 - too long! */ + { 0, 0, 0, ".starts.with.a.dot"}, + { 0, 0, 0, "contains.invalid;.characters"}, + { 0, 0, 0, "contains.inva/lid.characters"}, + { 0, 0, 0, "contains.inva[lid.characters"}, + { 0, 0, 0, "contains.inva]lid.characters"}, + { 0, 0, 0, "contains.inva_æøå_lid.characters"}, + { 1, 1, 0, ":1.1"}, + }; + + for (n = 0; n < G_N_ELEMENTS (names); n++) + { + if (names[n].name) + g_assert (g_dbus_is_name (names[n].string)); + else + g_assert (!g_dbus_is_name (names[n].string)); + + if (names[n].unique) + g_assert (g_dbus_is_unique_name (names[n].string)); + else + g_assert (!g_dbus_is_unique_name (names[n].string)); + + if (names[n].interface) + g_assert (g_dbus_is_interface_name (names[n].string)); + else + g_assert (!g_dbus_is_interface_name (names[n].string)); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + gint ret; + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/validate-names", test_validate_names); + g_test_add_func ("/gdbus/bus-own-name", test_bus_own_name); + g_test_add_func ("/gdbus/bus-watch-name", test_bus_watch_name); + + ret = g_test_run(); + + g_main_loop_unref (loop); + + return ret; +} diff --git a/gio/tests/gdbus-non-socket.c b/gio/tests/gdbus-non-socket.c new file mode 100644 index 0000000..cf8853f --- /dev/null +++ b/gio/tests/gdbus-non-socket.c @@ -0,0 +1,357 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include + +#ifdef G_OS_UNIX +#include +#include +#include +#endif + +#include "gdbus-tests.h" + +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ +#ifdef G_OS_UNIX + +#define MY_TYPE_IO_STREAM (my_io_stream_get_type ()) +#define MY_IO_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MY_TYPE_IO_STREAM, MyIOStream)) +#define MY_IS_IO_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MY_TYPE_IO_STREAM)) + +typedef struct +{ + GIOStream parent_instance; + GInputStream *input_stream; + GOutputStream *output_stream; +} MyIOStream; + +typedef struct +{ + GIOStreamClass parent_class; +} MyIOStreamClass; + +static GType my_io_stream_get_type (void) G_GNUC_CONST; + +G_DEFINE_TYPE (MyIOStream, my_io_stream, G_TYPE_IO_STREAM); + +static void +my_io_stream_finalize (GObject *object) +{ + MyIOStream *stream = MY_IO_STREAM (object); + g_object_unref (stream->input_stream); + g_object_unref (stream->output_stream); + G_OBJECT_CLASS (my_io_stream_parent_class)->finalize (object); +} + +static void +my_io_stream_init (MyIOStream *stream) +{ +} + +static GInputStream * +my_io_stream_get_input_stream (GIOStream *_stream) +{ + MyIOStream *stream = MY_IO_STREAM (_stream); + return stream->input_stream; +} + +static GOutputStream * +my_io_stream_get_output_stream (GIOStream *_stream) +{ + MyIOStream *stream = MY_IO_STREAM (_stream); + return stream->output_stream; +} + +static void +my_io_stream_class_init (MyIOStreamClass *klass) +{ + GObjectClass *gobject_class; + GIOStreamClass *giostream_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = my_io_stream_finalize; + + giostream_class = G_IO_STREAM_CLASS (klass); + giostream_class->get_input_stream = my_io_stream_get_input_stream; + giostream_class->get_output_stream = my_io_stream_get_output_stream; +} + +static GIOStream * +my_io_stream_new (GInputStream *input_stream, + GOutputStream *output_stream) +{ + MyIOStream *stream; + g_return_val_if_fail (G_IS_INPUT_STREAM (input_stream), NULL); + g_return_val_if_fail (G_IS_OUTPUT_STREAM (output_stream), NULL); + stream = MY_IO_STREAM (g_object_new (MY_TYPE_IO_STREAM, NULL)); + stream->input_stream = g_object_ref (input_stream); + stream->output_stream = g_object_ref (output_stream); + return G_IO_STREAM (stream); +} + +static GIOStream * +my_io_stream_new_for_fds (gint fd_in, gint fd_out) +{ + GIOStream *stream; + GInputStream *input_stream; + GOutputStream *output_stream; + + input_stream = g_unix_input_stream_new (fd_in, TRUE); + output_stream = g_unix_output_stream_new (fd_out, TRUE); + stream = my_io_stream_new (input_stream, output_stream); + g_object_unref (input_stream); + g_object_unref (output_stream); + return stream; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static const GDBusArgInfo pokee_method_poke_out_arg0 = { + -1, /* ref_count */ + "result", + "s", + NULL /* annotations */ +}; + +static const GDBusArgInfo *pokee_method_poke_out_args[2] = { + &pokee_method_poke_out_arg0, + NULL, +}; + +static const GDBusArgInfo pokee_method_poke_in_arg0 = { + -1, /* ref_count */ + "value", + "s", + NULL /* annotations */ +}; + +static const GDBusArgInfo *pokee_method_poke_in_args[2] = { + &pokee_method_poke_in_arg0, + NULL, +}; + +static const GDBusMethodInfo pokee_method_poke = { + -1, /* ref_count */ + "Poke", + (GDBusArgInfo**) pokee_method_poke_in_args, + (GDBusArgInfo**) pokee_method_poke_out_args, + NULL /* annotations */ +}; + +static const GDBusMethodInfo *pokee_methods[2] = { + &pokee_method_poke, + NULL +}; + +static const GDBusInterfaceInfo pokee_object_info = { + -1, /* ref_count */ + "org.gtk.GDBus.Pokee", + (GDBusMethodInfo**) pokee_methods, + NULL, /* signals */ + NULL, /* properties */ + NULL /* annotations */ +}; + +static void +pokee_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + const gchar *str; + gchar *ret; + + g_assert_cmpstr (method_name, ==, "Poke"); + + g_variant_get (parameters, "(&s)", &str); + ret = g_strdup_printf ("You poked me with: `%s'", str); + g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", ret)); + g_free (ret); +} + +static const GDBusInterfaceVTable pokee_vtable = { + pokee_method_call, + NULL, /* get_property */ + NULL /* set_property */ +}; + +static void +test_non_socket (void) +{ + gint in_pipes[2]; + gint out_pipes[2]; + GIOStream *stream; + GDBusConnection *connection; + GError *error; + gchar *guid; + pid_t child; + gint read_fd; + gint write_fd; + GVariant *ret; + const gchar *str; + + g_assert_cmpint (pipe (in_pipes), ==, 0); + g_assert_cmpint (pipe (out_pipes), ==, 0); + + switch ((child = fork ())) + { + case -1: + g_assert_not_reached (); + break; + + case 0: + /* child */ + read_fd = in_pipes[0]; + write_fd = out_pipes[1]; + g_assert_cmpint (close ( in_pipes[1]), ==, 0); /* close unused write end */ + g_assert_cmpint (close (out_pipes[0]), ==, 0); /* close unused read end */ + stream = my_io_stream_new_for_fds (read_fd, write_fd); + guid = g_dbus_generate_guid (); + error = NULL; + /* We need to delay message processing to avoid the race + * described in + * + * https://bugzilla.gnome.org/show_bug.cgi?id=627188 + * + * This is because (early) dispatching is done on the IO thread + * (method_call() isn't called until we're in the right thread + * though) so in rare cases the parent sends the message before + * we (the child) register the object + */ + connection = g_dbus_connection_new_sync (stream, + guid, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER | + G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, + NULL, /* GDBusAuthObserver */ + NULL, + &error); + g_free (guid); + g_assert_no_error (error); + g_object_unref (stream); + + /* make sure we exit along with the parent */ + g_dbus_connection_set_exit_on_close (connection, TRUE); + + error = NULL; + g_dbus_connection_register_object (connection, + "/pokee", + (GDBusInterfaceInfo *) &pokee_object_info, + &pokee_vtable, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + &error); + g_assert_no_error (error); + + /* and now start message processing */ + g_dbus_connection_start_message_processing (connection); + + g_main_loop_run (loop); + + g_assert_not_reached (); + break; + + default: + /* parent continues below */ + break; + } + + /* parent */ + read_fd = out_pipes[0]; + write_fd = in_pipes[1]; + g_assert_cmpint (close (out_pipes[1]), ==, 0); /* close unused write end */ + g_assert_cmpint (close ( in_pipes[0]), ==, 0); /* close unused read end */ + stream = my_io_stream_new_for_fds (read_fd, write_fd); + error = NULL; + connection = g_dbus_connection_new_sync (stream, + NULL, /* guid */ + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, + &error); + g_assert_no_error (error); + g_object_unref (stream); + + /* poke the child */ + error = NULL; + ret = g_dbus_connection_call_sync (connection, + NULL, /* name */ + "/pokee", + "org.gtk.GDBus.Pokee", + "Poke", + g_variant_new ("(s)", "I am the POKER!"), + G_VARIANT_TYPE ("(s)"), /* return type */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + g_variant_get (ret, "(&s)", &str); + g_assert_cmpstr (str, ==, "You poked me with: `I am the POKER!'"); + g_variant_unref (ret); + + g_object_unref (connection); + + g_assert_cmpint (kill (child, SIGTERM), ==, 0); +} + +#else /* G_OS_UNIX */ + +static void +test_non_socket (void) +{ + /* TODO: test this with e.g. GWin32InputStream/GWin32OutputStream */ +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + gint ret; + + g_type_init (); + g_thread_init (NULL); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + g_test_add_func ("/gdbus/non-socket", test_non_socket); + + ret = g_test_run(); + + g_main_loop_unref (loop); + + return ret; +} diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c new file mode 100644 index 0000000..e304618 --- /dev/null +++ b/gio/tests/gdbus-peer.c @@ -0,0 +1,1476 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +/* for open(2) */ +#include +#include +#include +#include + +/* for g_unlink() */ +#include + +#include +#include +#include + +/* used in test_overflow */ +#ifdef G_OS_UNIX +#include +#include +#endif + +#include "gdbus-tests.h" + +#ifdef G_OS_UNIX +static gboolean is_unix = TRUE; +#else +static gboolean is_unix = FALSE; +#endif + +static gchar *test_guid = NULL; +static GMainLoop *service_loop = NULL; +static GDBusServer *server = NULL; +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that peer-to-peer connections work */ +/* ---------------------------------------------------------------------------------------------------- */ + + +typedef struct +{ + gboolean accept_connection; + gint num_connection_attempts; + GPtrArray *current_connections; + guint num_method_calls; + gboolean signal_received; +} PeerData; + +static const gchar *test_interface_introspection_xml = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; +static GDBusInterfaceInfo *test_interface_introspection_data = NULL; + +static void +test_interface_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + PeerData *data = user_data; + const GDBusMethodInfo *info; + + data->num_method_calls++; + + g_assert_cmpstr (object_path, ==, "/org/gtk/GDBus/PeerTestObject"); + g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.PeerTestInterface"); + + info = g_dbus_method_invocation_get_method_info (invocation); + g_assert_cmpstr (info->name, ==, method_name); + + if (g_strcmp0 (method_name, "HelloPeer") == 0) + { + const gchar *greeting; + gchar *response; + + g_variant_get (parameters, "(&s)", &greeting); + + response = g_strdup_printf ("You greeted me with '%s'.", + greeting); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", response)); + g_free (response); + } + else if (g_strcmp0 (method_name, "EmitSignal") == 0) + { + GError *error; + + error = NULL; + g_dbus_connection_emit_signal (connection, + NULL, + "/org/gtk/GDBus/PeerTestObject", + "org.gtk.GDBus.PeerTestInterface", + "PeerSignal", + NULL, + &error); + g_assert_no_error (error); + g_dbus_method_invocation_return_value (invocation, NULL); + } + else if (g_strcmp0 (method_name, "EmitSignalWithNameSet") == 0) + { + GError *error; + gboolean ret; + GDBusMessage *message; + + message = g_dbus_message_new_signal ("/org/gtk/GDBus/PeerTestObject", + "org.gtk.GDBus.PeerTestInterface", + "PeerSignalWithNameSet"); + g_dbus_message_set_sender (message, ":1.42"); + + error = NULL; + ret = g_dbus_connection_send_message (connection, message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, &error); + g_assert_no_error (error); + g_assert (ret); + g_object_unref (message); + + g_dbus_method_invocation_return_value (invocation, NULL); + } + else if (g_strcmp0 (method_name, "OpenFile") == 0) + { +#ifdef G_OS_UNIX + const gchar *path; + GDBusMessage *reply; + GError *error; + gint fd; + GUnixFDList *fd_list; + + g_variant_get (parameters, "(&s)", &path); + + fd_list = g_unix_fd_list_new (); + + error = NULL; + + fd = open (path, O_RDONLY); + g_unix_fd_list_append (fd_list, fd, &error); + g_assert_no_error (error); + close (fd); + + reply = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); + g_dbus_message_set_unix_fd_list (reply, fd_list); + g_object_unref (fd_list); + g_object_unref (invocation); + + error = NULL; + g_dbus_connection_send_message (connection, + reply, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + NULL, /* out_serial */ + &error); + g_assert_no_error (error); + g_object_unref (reply); +#else + g_dbus_method_invocation_return_dbus_error (invocation, + "org.gtk.GDBus.NotOnUnix", + "Your OS does not support file descriptor passing"); +#endif + } + else + { + g_assert_not_reached (); + } +} + +static GVariant * +test_interface_get_property (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + g_assert_cmpstr (object_path, ==, "/org/gtk/GDBus/PeerTestObject"); + g_assert_cmpstr (interface_name, ==, "org.gtk.GDBus.PeerTestInterface"); + g_assert_cmpstr (property_name, ==, "PeerProperty"); + + return g_variant_new_string ("ThePropertyValue"); +} + + +static const GDBusInterfaceVTable test_interface_vtable = +{ + test_interface_method_call, + test_interface_get_property, + NULL /* set_property */ +}; + +static void +on_proxy_signal_received (GDBusProxy *proxy, + gchar *sender_name, + gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + PeerData *data = user_data; + + data->signal_received = TRUE; + + g_assert (sender_name == NULL); + g_assert_cmpstr (signal_name, ==, "PeerSignal"); + g_main_loop_quit (loop); +} + +static void +on_proxy_signal_received_with_name_set (GDBusProxy *proxy, + gchar *sender_name, + gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + PeerData *data = user_data; + + data->signal_received = TRUE; + + g_assert_cmpstr (sender_name, ==, ":1.42"); + g_assert_cmpstr (signal_name, ==, "PeerSignalWithNameSet"); + g_main_loop_quit (loop); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +on_authorize_authenticated_peer (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials, + gpointer user_data) +{ + PeerData *data = user_data; + gboolean authorized; + + data->num_connection_attempts++; + + authorized = TRUE; + if (!data->accept_connection) + { + authorized = FALSE; + g_main_loop_quit (loop); + } + + return authorized; +} + +/* Runs in thread we created GDBusServer in (since we didn't pass G_DBUS_SERVER_FLAGS_RUN_IN_THREAD) */ +static gboolean +on_new_connection (GDBusServer *server, + GDBusConnection *connection, + gpointer user_data) +{ + PeerData *data = user_data; + GError *error; + guint reg_id; + + //g_print ("Client connected.\n" + // "Negotiated capabilities: unix-fd-passing=%d\n", + // g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); + + g_ptr_array_add (data->current_connections, g_object_ref (connection)); + + /* export object on the newly established connection */ + error = NULL; + reg_id = g_dbus_connection_register_object (connection, + "/org/gtk/GDBus/PeerTestObject", + test_interface_introspection_data, + &test_interface_vtable, + data, + NULL, /* GDestroyNotify for data */ + &error); + g_assert_no_error (error); + g_assert (reg_id > 0); + + g_main_loop_quit (loop); + + return TRUE; +} + +static gpointer +service_thread_func (gpointer user_data) +{ + PeerData *data = user_data; + GMainContext *service_context; + GDBusAuthObserver *observer; + GError *error; + + service_context = g_main_context_new (); + g_main_context_push_thread_default (service_context); + + error = NULL; + observer = g_dbus_auth_observer_new (); + server = g_dbus_server_new_sync (is_unix ? "unix:tmpdir=/tmp/gdbus-test-" : "nonce-tcp:", + G_DBUS_SERVER_FLAGS_NONE, + test_guid, + observer, + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + + g_signal_connect (server, + "new-connection", + G_CALLBACK (on_new_connection), + data); + g_signal_connect (observer, + "authorize-authenticated-peer", + G_CALLBACK (on_authorize_authenticated_peer), + data); + g_object_unref (observer); + + g_dbus_server_start (server); + + service_loop = g_main_loop_new (service_context, FALSE); + g_main_loop_run (service_loop); + + g_main_context_pop_thread_default (service_context); + + g_main_loop_unref (service_loop); + g_main_context_unref (service_context); + + /* test code specifically unrefs the server - see below */ + g_assert (server == NULL); + + return NULL; +} + +#if 0 +static gboolean +on_incoming_connection (GSocketService *service, + GSocketConnection *socket_connection, + GObject *source_object, + gpointer user_data) +{ + PeerData *data = user_data; + + if (data->accept_connection) + { + GError *error; + guint reg_id; + GDBusConnection *connection; + + error = NULL; + connection = g_dbus_connection_new_sync (G_IO_STREAM (socket_connection), + test_guid, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER, + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + + g_ptr_array_add (data->current_connections, connection); + + /* export object on the newly established connection */ + error = NULL; + reg_id = g_dbus_connection_register_object (connection, + "/org/gtk/GDBus/PeerTestObject", + &test_interface_introspection_data, + &test_interface_vtable, + data, + NULL, /* GDestroyNotify for data */ + &error); + g_assert_no_error (error); + g_assert (reg_id > 0); + + } + else + { + /* don't do anything */ + } + + data->num_connection_attempts++; + + g_main_loop_quit (loop); + + /* stops other signal handlers from being invoked */ + return TRUE; +} + +static gpointer +service_thread_func (gpointer data) +{ + GMainContext *service_context; + gchar *socket_path; + GSocketAddress *address; + GError *error; + + service_context = g_main_context_new (); + g_main_context_push_thread_default (service_context); + + socket_path = g_strdup_printf ("/tmp/gdbus-test-pid-%d", getpid ()); + address = g_unix_socket_address_new (socket_path); + + service = g_socket_service_new (); + error = NULL; + g_socket_listener_add_address (G_SOCKET_LISTENER (service), + address, + G_SOCKET_TYPE_STREAM, + G_SOCKET_PROTOCOL_DEFAULT, + NULL, /* source_object */ + NULL, /* effective_address */ + &error); + g_assert_no_error (error); + g_signal_connect (service, + "incoming", + G_CALLBACK (on_incoming_connection), + data); + g_socket_service_start (service); + + service_loop = g_main_loop_new (service_context, FALSE); + g_main_loop_run (service_loop); + + g_main_context_pop_thread_default (service_context); + + g_main_loop_unref (service_loop); + g_main_context_unref (service_context); + + g_object_unref (address); + g_free (socket_path); + return NULL; +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +#if 0 +static gboolean +check_connection (gpointer user_data) +{ + PeerData *data = user_data; + guint n; + + for (n = 0; n < data->current_connections->len; n++) + { + GDBusConnection *c; + GIOStream *stream; + + c = G_DBUS_CONNECTION (data->current_connections->pdata[n]); + stream = g_dbus_connection_get_stream (c); + + g_debug ("In check_connection for %d: connection %p, stream %p", n, c, stream); + g_debug ("closed = %d", g_io_stream_is_closed (stream)); + + GSocket *socket; + socket = g_socket_connection_get_socket (G_SOCKET_CONNECTION (stream)); + g_debug ("socket_closed = %d", g_socket_is_closed (socket)); + g_debug ("socket_condition_check = %d", g_socket_condition_check (socket, G_IO_IN|G_IO_OUT|G_IO_ERR|G_IO_HUP)); + + gchar buf[128]; + GError *error; + gssize num_read; + error = NULL; + num_read = g_input_stream_read (g_io_stream_get_input_stream (stream), + buf, + 128, + NULL, + &error); + if (num_read < 0) + { + g_debug ("error: %s", error->message); + g_error_free (error); + } + else + { + g_debug ("no error, read %d bytes", (gint) num_read); + } + } + + return FALSE; +} + +static gboolean +on_do_disconnect_in_idle (gpointer data) +{ + GDBusConnection *c = G_DBUS_CONNECTION (data); + g_debug ("GDC %p has ref_count %d", c, G_OBJECT (c)->ref_count); + g_dbus_connection_disconnect (c); + g_object_unref (c); + return FALSE; +} +#endif + +#ifdef G_OS_UNIX +static gchar * +read_all_from_fd (gint fd, gsize *out_len, GError **error) +{ + GString *str; + gchar buf[64]; + gssize num_read; + + str = g_string_new (NULL); + + do + { + num_read = read (fd, buf, sizeof (buf)); + if (num_read == -1) + { + if (errno == EAGAIN || errno == EWOULDBLOCK) + continue; + g_set_error (error, + G_IO_ERROR, + g_io_error_from_errno (errno), + "Failed reading %d bytes into offset %d: %s", + (gint) sizeof (buf), + (gint) str->len, + strerror (errno)); + goto error; + } + else if (num_read > 0) + { + g_string_append_len (str, buf, num_read); + } + else if (num_read == 0) + { + break; + } + } + while (TRUE); + + if (out_len != NULL) + *out_len = str->len; + return g_string_free (str, FALSE); + + error: + if (out_len != NULL) + out_len = 0; + g_string_free (str, TRUE); + return NULL; +} +#endif + +static void +test_peer (void) +{ + GDBusConnection *c; + GDBusConnection *c2; + GDBusProxy *proxy; + GError *error; + PeerData data; + GVariant *value; + GVariant *result; + const gchar *s; + GThread *service_thread; + gulong signal_handler_id; + + memset (&data, '\0', sizeof (PeerData)); + data.current_connections = g_ptr_array_new_with_free_func (g_object_unref); + + /* first try to connect when there is no server */ + error = NULL; + c = g_dbus_connection_new_for_address_sync (is_unix ? "unix:path=/tmp/gdbus-test-does-not-exist-pid" : + /* NOTE: Even if something is listening on port 12345 the connection + * will fail because the nonce file doesn't exist */ + "nonce-tcp:host=localhost,port=12345,noncefile=this-does-not-exist-gdbus", + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + _g_assert_error_domain (error, G_IO_ERROR); + g_assert (!g_dbus_error_is_remote_error (error)); + g_clear_error (&error); + g_assert (c == NULL); + + /* bring up a server - we run the server in a different thread to avoid deadlocks */ + error = NULL; + service_thread = g_thread_create (service_thread_func, + &data, + TRUE, + &error); + while (service_loop == NULL) + g_thread_yield (); + g_assert (server != NULL); + + /* bring up a connection and accept it */ + data.accept_connection = TRUE; + error = NULL; + c = g_dbus_connection_new_for_address_sync (g_dbus_server_get_client_address (server), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + g_assert (c != NULL); + while (data.current_connections->len < 1) + g_main_loop_run (loop); + g_assert_cmpint (data.current_connections->len, ==, 1); + g_assert_cmpint (data.num_connection_attempts, ==, 1); + g_assert (g_dbus_connection_get_unique_name (c) == NULL); + g_assert_cmpstr (g_dbus_connection_get_guid (c), ==, test_guid); + + /* check that we create a proxy, read properties, receive signals and invoke + * the HelloPeer() method. Since the server runs in another thread it's fine + * to use synchronous blocking API here. + */ + error = NULL; + proxy = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_NONE, + NULL, + NULL, /* bus_name */ + "/org/gtk/GDBus/PeerTestObject", + "org.gtk.GDBus.PeerTestInterface", + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + g_assert (proxy != NULL); + error = NULL; + value = g_dbus_proxy_get_cached_property (proxy, "PeerProperty"); + g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "ThePropertyValue"); + + /* try invoking a method */ + error = NULL; + result = g_dbus_proxy_call_sync (proxy, + "HelloPeer", + g_variant_new ("(s)", "Hey Peer!"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + g_variant_get (result, "(&s)", &s); + g_assert_cmpstr (s, ==, "You greeted me with 'Hey Peer!'."); + g_variant_unref (result); + g_assert_cmpint (data.num_method_calls, ==, 1); + + /* make the other peer emit a signal - catch it */ + signal_handler_id = g_signal_connect (proxy, + "g-signal", + G_CALLBACK (on_proxy_signal_received), + &data); + g_assert (!data.signal_received); + g_dbus_proxy_call (proxy, + "EmitSignal", + NULL, /* no arguments */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* GCancellable */ + NULL, /* GAsyncReadyCallback - we don't care about the result */ + NULL); /* user_data */ + g_main_loop_run (loop); + g_assert (data.signal_received); + g_assert_cmpint (data.num_method_calls, ==, 2); + g_signal_handler_disconnect (proxy, signal_handler_id); + + /* Also ensure that messages with the sender header-field set gets + * delivered to the proxy - note that this doesn't really make sense + * e.g. names are meaning-less in a peer-to-peer case... but we + * support it because it makes sense in certain bridging + * applications - see e.g. #623815. + */ + signal_handler_id = g_signal_connect (proxy, + "g-signal", + G_CALLBACK (on_proxy_signal_received_with_name_set), + &data); + data.signal_received = FALSE; + g_dbus_proxy_call (proxy, + "EmitSignalWithNameSet", + NULL, /* no arguments */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* GCancellable */ + NULL, /* GAsyncReadyCallback - we don't care about the result */ + NULL); /* user_data */ + g_main_loop_run (loop); + g_assert (data.signal_received); + g_assert_cmpint (data.num_method_calls, ==, 3); + g_signal_handler_disconnect (proxy, signal_handler_id); + + /* check for UNIX fd passing */ +#ifdef G_OS_UNIX + { + GDBusMessage *method_call_message; + GDBusMessage *method_reply_message; + GUnixFDList *fd_list; + gint fd; + gchar *buf; + gsize len; + gchar *buf2; + gsize len2; + + method_call_message = g_dbus_message_new_method_call (NULL, /* name */ + "/org/gtk/GDBus/PeerTestObject", + "org.gtk.GDBus.PeerTestInterface", + "OpenFile"); + g_dbus_message_set_body (method_call_message, g_variant_new ("(s)", "/etc/hosts")); + error = NULL; + method_reply_message = g_dbus_connection_send_message_with_reply_sync (c, + method_call_message, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, + -1, + NULL, /* out_serial */ + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + g_assert (g_dbus_message_get_message_type (method_reply_message) == G_DBUS_MESSAGE_TYPE_METHOD_RETURN); + fd_list = g_dbus_message_get_unix_fd_list (method_reply_message); + g_assert (fd_list != NULL); + g_assert_cmpint (g_unix_fd_list_get_length (fd_list), ==, 1); + error = NULL; + fd = g_unix_fd_list_get (fd_list, 0, &error); + g_assert_no_error (error); + g_object_unref (method_call_message); + g_object_unref (method_reply_message); + + error = NULL; + len = 0; + buf = read_all_from_fd (fd, &len, &error); + g_assert_no_error (error); + g_assert (buf != NULL); + close (fd); + + error = NULL; + g_file_get_contents ("/etc/hosts", + &buf2, + &len2, + &error); + g_assert_no_error (error); + g_assert_cmpint (len, ==, len2); + g_assert (memcmp (buf, buf2, len) == 0); + g_free (buf2); + g_free (buf); + } +#else + error = NULL; + result = g_dbus_proxy_call_sync (proxy, + "OpenFile", + g_variant_new ("(s)", "boo"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* GCancellable */ + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR); + g_assert (result == NULL); + g_error_free (error); +#endif /* G_OS_UNIX */ + + /* Check that g_socket_get_credentials() work - this really should + * be in a GSocket-specific test suite but no such test suite exists + * right now. + */ + { + GSocket *socket; + GCredentials *credentials; + socket = g_socket_connection_get_socket (G_SOCKET_CONNECTION (g_dbus_connection_get_stream (c))); + g_assert (G_IS_SOCKET (socket)); + error = NULL; + credentials = g_socket_get_credentials (socket, &error); +#ifdef __linux__ + { + struct ucred *native_creds; + g_assert_no_error (error); + g_assert (G_IS_CREDENTIALS (credentials)); + native_creds = g_credentials_get_native (credentials, G_CREDENTIALS_TYPE_LINUX_UCRED); + g_assert (native_creds != NULL); + g_assert (native_creds->uid == getuid ()); + g_assert (native_creds->gid == getgid ()); + g_assert (native_creds->pid == getpid ()); + } + g_object_unref (credentials); +#else + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED); + g_assert (credentials == NULL); +#endif + } + + + /* bring up a connection - don't accept it - this should fail + */ + data.accept_connection = FALSE; + error = NULL; + c2 = g_dbus_connection_new_for_address_sync (g_dbus_server_get_client_address (server), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + _g_assert_error_domain (error, G_IO_ERROR); + g_error_free (error); + g_assert (c2 == NULL); + +#if 0 + /* TODO: THIS TEST DOESN'T WORK YET */ + + /* bring up a connection - accept it.. then disconnect from the client side - check + * that the server side gets the disconnect signal. + */ + error = NULL; + data.accept_connection = TRUE; + c2 = g_dbus_connection_new_for_address_sync (g_dbus_server_get_client_address (server), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + g_assert (c2 != NULL); + g_assert (!g_dbus_connection_get_is_disconnected (c2)); + while (data.num_connection_attempts < 3) + g_main_loop_run (loop); + g_assert_cmpint (data.current_connections->len, ==, 2); + g_assert_cmpint (data.num_connection_attempts, ==, 3); + g_assert (!g_dbus_connection_get_is_disconnected (G_DBUS_CONNECTION (data.current_connections->pdata[1]))); + g_idle_add (on_do_disconnect_in_idle, c2); + g_debug ("=================================================="); + g_debug ("=================================================="); + g_debug ("=================================================="); + g_debug ("waiting for disconnect on connection %p, stream %p", + data.current_connections->pdata[1], + g_dbus_connection_get_stream (data.current_connections->pdata[1])); + + g_timeout_add (2000, check_connection, &data); + //_g_assert_signal_received (G_DBUS_CONNECTION (data.current_connections->pdata[1]), "closed"); + g_main_loop_run (loop); + g_assert (g_dbus_connection_get_is_disconnected (G_DBUS_CONNECTION (data.current_connections->pdata[1]))); + g_ptr_array_set_size (data.current_connections, 1); /* remove disconnected connection object */ +#endif + + /* unref the server and stop listening for new connections + * + * This won't bring down the established connections - check that c is still connected + * by invoking a method + */ + //g_socket_service_stop (service); + //g_object_unref (service); + g_dbus_server_stop (server); + g_object_unref (server); + server = NULL; + + error = NULL; + result = g_dbus_proxy_call_sync (proxy, + "HelloPeer", + g_variant_new ("(s)", "Hey Again Peer!"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + g_variant_get (result, "(&s)", &s); + g_assert_cmpstr (s, ==, "You greeted me with 'Hey Again Peer!'."); + g_variant_unref (result); + g_assert_cmpint (data.num_method_calls, ==, 5); + +#if 0 + /* TODO: THIS TEST DOESN'T WORK YET */ + + /* now disconnect from the server side - check that the client side gets the signal */ + g_assert_cmpint (data.current_connections->len, ==, 1); + g_assert (G_DBUS_CONNECTION (data.current_connections->pdata[0]) != c); + g_dbus_connection_disconnect (G_DBUS_CONNECTION (data.current_connections->pdata[0])); + if (!g_dbus_connection_get_is_disconnected (c)) + _g_assert_signal_received (c, "closed"); + g_assert (g_dbus_connection_get_is_disconnected (c)); +#endif + + g_object_unref (c); + g_ptr_array_unref (data.current_connections); + g_object_unref (proxy); + + g_main_loop_quit (service_loop); + g_thread_join (service_thread); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GDBusServer *server; + GMainContext *context; + GMainLoop *loop; + + GList *connections; +} DmpData; + +static void +dmp_data_free (DmpData *data) +{ + g_main_loop_unref (data->loop); + g_main_context_unref (data->context); + g_object_unref (data->server); + g_list_foreach (data->connections, (GFunc) g_object_unref, NULL); + g_list_free (data->connections); + g_free (data); +} + +static void +dmp_on_method_call (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + //DmpData *data = user_data; + gint32 first; + gint32 second; + g_variant_get (parameters, + "(ii)", + &first, + &second); + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(i)", first + second)); +} + +static const GDBusInterfaceVTable dmp_interface_vtable = +{ + dmp_on_method_call, + NULL, /* get_property */ + NULL /* set_property */ +}; + + +/* Runs in thread we created GDBusServer in (since we didn't pass G_DBUS_SERVER_FLAGS_RUN_IN_THREAD) */ +static gboolean +dmp_on_new_connection (GDBusServer *server, + GDBusConnection *connection, + gpointer user_data) +{ + DmpData *data = user_data; + GDBusNodeInfo *node; + GError *error; + + /* accept the connection */ + data->connections = g_list_prepend (data->connections, g_object_ref (connection)); + + error = NULL; + node = g_dbus_node_info_new_for_xml ("" + " " + " " + " " + " " + " " + " " + " " + "", + &error); + g_assert_no_error (error); + + /* sleep 100ms before exporting an object - this is to test that + * G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING really works + * (GDBusServer uses this feature). + */ + usleep (100 * 1000); + + /* export an object */ + error = NULL; + g_dbus_connection_register_object (connection, + "/dmp/test", + node->interfaces[0], + &dmp_interface_vtable, + data, + NULL, + &error); + g_dbus_node_info_unref (node); + + return TRUE; +} + +static gpointer +dmp_thread_func (gpointer user_data) +{ + DmpData *data = user_data; + GError *error; + gchar *guid; + + data->context = g_main_context_new (); + g_main_context_push_thread_default (data->context); + + error = NULL; + guid = g_dbus_generate_guid (); + data->server = g_dbus_server_new_sync ("unix:tmpdir=/tmp/gdbus-test-", + G_DBUS_SERVER_FLAGS_NONE, + guid, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + g_signal_connect (data->server, + "new-connection", + G_CALLBACK (dmp_on_new_connection), + data); + + g_dbus_server_start (data->server); + + data->loop = g_main_loop_new (data->context, FALSE); + g_main_loop_run (data->loop); + + g_main_context_pop_thread_default (data->context); + + g_free (guid); + return NULL; +} + +static void +delayed_message_processing (void) +{ + GError *error; + DmpData *data; + GThread *service_thread; + guint n; + + data = g_new0 (DmpData, 1); + + error = NULL; + service_thread = g_thread_create (dmp_thread_func, + data, + TRUE, + &error); + while (data->server == NULL || !g_dbus_server_is_active (data->server)) + g_thread_yield (); + + for (n = 0; n < 5; n++) + { + GDBusConnection *c; + GVariant *res; + gint32 val; + + error = NULL; + c = g_dbus_connection_new_for_address_sync (g_dbus_server_get_client_address (data->server), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + + error = NULL; + res = g_dbus_connection_call_sync (c, + NULL, /* bus name */ + "/dmp/test", + "org.gtk.GDBus.DmpInterface", + "AddPair", + g_variant_new ("(ii)", 2, n), + G_VARIANT_TYPE ("(i)"), + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout_msec */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + g_variant_get (res, "(i)", &val); + g_assert_cmpint (val, ==, 2 + n); + g_variant_unref (res); + g_object_unref (c); + } + + g_main_loop_quit (data->loop); + g_thread_join (service_thread); + dmp_data_free (data); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef BUG_631379_FIXED +static gboolean +nonce_tcp_on_authorize_authenticated_peer (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials, + gpointer user_data) +{ + PeerData *data = user_data; + gboolean authorized; + + data->num_connection_attempts++; + + authorized = TRUE; + if (!data->accept_connection) + { + authorized = FALSE; + g_main_loop_quit (loop); + } + + return authorized; +} + +/* Runs in thread we created GDBusServer in (since we didn't pass G_DBUS_SERVER_FLAGS_RUN_IN_THREAD) */ +static gboolean +nonce_tcp_on_new_connection (GDBusServer *server, + GDBusConnection *connection, + gpointer user_data) +{ + PeerData *data = user_data; + + g_ptr_array_add (data->current_connections, g_object_ref (connection)); + + g_main_loop_quit (loop); + + return TRUE; +} + +static gpointer +nonce_tcp_service_thread_func (gpointer user_data) +{ + PeerData *data = user_data; + GMainContext *service_context; + GDBusAuthObserver *observer; + GError *error; + + service_context = g_main_context_new (); + g_main_context_push_thread_default (service_context); + + error = NULL; + observer = g_dbus_auth_observer_new (); + server = g_dbus_server_new_sync ("nonce-tcp:", + G_DBUS_SERVER_FLAGS_NONE, + test_guid, + observer, + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + + g_signal_connect (server, + "new-connection", + G_CALLBACK (nonce_tcp_on_new_connection), + data); + g_signal_connect (observer, + "authorize-authenticated-peer", + G_CALLBACK (nonce_tcp_on_authorize_authenticated_peer), + data); + g_object_unref (observer); + + g_dbus_server_start (server); + + service_loop = g_main_loop_new (service_context, FALSE); + g_main_loop_run (service_loop); + + g_main_context_pop_thread_default (service_context); + + g_main_loop_unref (service_loop); + g_main_context_unref (service_context); + + /* test code specifically unrefs the server - see below */ + g_assert (server == NULL); + + return NULL; +} + +static void +test_nonce_tcp (void) +{ + PeerData data; + GError *error; + GThread *service_thread; + GDBusConnection *c; + gchar *s; + gchar *nonce_file; + gboolean res; + const gchar *address; + + memset (&data, '\0', sizeof (PeerData)); + data.current_connections = g_ptr_array_new_with_free_func (g_object_unref); + + error = NULL; + server = NULL; + service_loop = NULL; + service_thread = g_thread_create (nonce_tcp_service_thread_func, + &data, + TRUE, + &error); + while (service_loop == NULL) + g_thread_yield (); + g_assert (server != NULL); + + + /* bring up a connection and accept it */ + data.accept_connection = TRUE; + error = NULL; + c = g_dbus_connection_new_for_address_sync (g_dbus_server_get_client_address (server), + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + g_assert_no_error (error); + g_assert (c != NULL); + while (data.current_connections->len < 1) + g_main_loop_run (loop); + g_assert_cmpint (data.current_connections->len, ==, 1); + g_assert_cmpint (data.num_connection_attempts, ==, 1); + g_assert (g_dbus_connection_get_unique_name (c) == NULL); + g_assert_cmpstr (g_dbus_connection_get_guid (c), ==, test_guid); + g_object_unref (c); + + /* now, try to subvert the nonce file (this assumes noncefile is the last key/value pair) + */ + + address = g_dbus_server_get_client_address (server); + + s = strstr (address, "noncefile="); + g_assert (s != NULL); + s += sizeof "noncefile=" - 1; + nonce_file = g_strdup (s); + + /* First try invalid data in the nonce file - this will actually + * make the client send this and the server will reject it. The way + * it works is that if the nonce doesn't match, the server will + * simply close the connection. So, from the client point of view, + * we can see a variety of errors. + */ + error = NULL; + res = g_file_set_contents (nonce_file, + "0123456789012345", + -1, + &error); + g_assert_no_error (error); + g_assert (res); + c = g_dbus_connection_new_for_address_sync (address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + _g_assert_error_domain (error, G_IO_ERROR); + g_error_free (error); + g_assert (c == NULL); + + /* Then try with a nonce-file of incorrect length - this will make + * the client complain - we won't even try connecting to the server + * for this + */ + error = NULL; + res = g_file_set_contents (nonce_file, + "0123456789012345_", + -1, + &error); + g_assert_no_error (error); + g_assert (res); + c = g_dbus_connection_new_for_address_sync (address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); + g_assert (c == NULL); + + /* Finally try with no nonce-file at all */ + g_assert_cmpint (g_unlink (nonce_file), ==, 0); + error = NULL; + c = g_dbus_connection_new_for_address_sync (address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, /* GDBusAuthObserver */ + NULL, /* cancellable */ + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); + g_assert (c == NULL); + + g_free (nonce_file); + + g_dbus_server_stop (server); + g_object_unref (server); + server = NULL; + + g_main_loop_quit (service_loop); + g_thread_join (service_thread); +} +#endif + +static void +test_credentials (void) +{ + GCredentials *c1, *c2; + GError *error; + gchar *desc; + + c1 = g_credentials_new (); + c2 = g_credentials_new (); + + error = NULL; + if (g_credentials_set_unix_user (c2, getuid (), &error)) + g_assert_no_error (error); + + g_clear_error (&error); + g_assert (g_credentials_is_same_user (c1, c2, &error)); + g_assert_no_error (error); + + desc = g_credentials_to_string (c1); + g_assert (desc != NULL); + g_free (desc); + + g_object_unref (c1); + g_object_unref (c2); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#ifdef G_OS_UNIX + +/* Chosen to be big enough to overflow the socket buffer */ +#define OVERFLOW_NUM_SIGNALS 5000 +#define OVERFLOW_TIMEOUT_SEC 10 + +static GDBusMessage * +overflow_filter_func (GDBusConnection *connection, + GDBusMessage *message, + gboolean incoming, + gpointer user_data) +{ + volatile gint *counter = user_data; + *counter += 1; + return message; +} + +static gboolean +overflow_on_500ms_later_func (gpointer user_data) +{ + g_main_loop_quit (loop); + return FALSE; /* don't keep the idle */ +} + +static void +test_overflow (void) +{ + gint sv[2]; + gint n; + GSocket *socket; + GSocketConnection *socket_connection; + GDBusConnection *producer, *consumer; + GError *error; + GTimer *timer; + volatile gint n_messages_received; + volatile gint n_messages_sent; + + g_assert_cmpint (socketpair (AF_UNIX, SOCK_STREAM, 0, sv), ==, 0); + + error = NULL; + socket = g_socket_new_from_fd (sv[0], &error); + g_assert_no_error (error); + socket_connection = g_socket_connection_factory_create_connection (socket); + g_assert (socket_connection != NULL); + g_object_unref (socket); + producer = g_dbus_connection_new_sync (G_IO_STREAM (socket_connection), + NULL, /* guid */ + G_DBUS_CONNECTION_FLAGS_NONE, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + &error); + g_dbus_connection_set_exit_on_close (producer, TRUE); + g_assert_no_error (error); + g_object_unref (socket_connection); + n_messages_sent = 0; + g_dbus_connection_add_filter (producer, overflow_filter_func, (gpointer) &n_messages_sent, NULL); + + /* send enough data that we get an EAGAIN */ + for (n = 0; n < OVERFLOW_NUM_SIGNALS; n++) + { + error = NULL; + g_dbus_connection_emit_signal (producer, + NULL, /* destination */ + "/org/foo/Object", + "org.foo.Interface", + "Member", + g_variant_new ("(s)", "a string"), + &error); + g_assert_no_error (error); + } + + /* sleep for 0.5 sec (to allow the GDBus IO thread to fill up the + * kernel buffers) and verify that n_messages_sent < + * OVERFLOW_NUM_SIGNALS + * + * This is to verify that not all the submitted messages have been + * sent to the underlying transport. + */ + g_timeout_add (500, overflow_on_500ms_later_func, NULL); + g_main_loop_run (loop); + g_assert_cmpint (n_messages_sent, <, OVERFLOW_NUM_SIGNALS); + + /* now suck it all out as a client, and add it up */ + socket = g_socket_new_from_fd (sv[1], &error); + g_assert_no_error (error); + socket_connection = g_socket_connection_factory_create_connection (socket); + g_assert (socket_connection != NULL); + g_object_unref (socket); + consumer = g_dbus_connection_new_sync (G_IO_STREAM (socket_connection), + NULL, /* guid */ + G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, + NULL, /* GDBusAuthObserver */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + g_object_unref (socket_connection); + n_messages_received = 0; + g_dbus_connection_add_filter (consumer, overflow_filter_func, (gpointer) &n_messages_received, NULL); + g_dbus_connection_start_message_processing (consumer); + + timer = g_timer_new (); + g_timer_start (timer); + + while (n_messages_received < OVERFLOW_NUM_SIGNALS && g_timer_elapsed (timer, NULL) < OVERFLOW_TIMEOUT_SEC) + g_main_context_iteration (NULL, FALSE); + + g_assert_cmpint (n_messages_sent, ==, OVERFLOW_NUM_SIGNALS); + g_assert_cmpint (n_messages_received, ==, OVERFLOW_NUM_SIGNALS); + + g_timer_destroy (timer); + g_object_unref (consumer); + g_object_unref (producer); +} +#else +static void +test_overflow (void) +{ + /* TODO: test this with e.g. GWin32InputStream/GWin32OutputStream */ +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + gint ret; + GDBusNodeInfo *introspection_data = NULL; + + g_type_init (); + g_thread_init (NULL); + g_test_init (&argc, &argv, NULL); + + introspection_data = g_dbus_node_info_new_for_xml (test_interface_introspection_xml, NULL); + g_assert (introspection_data != NULL); + test_interface_introspection_data = introspection_data->interfaces[0]; + + test_guid = g_dbus_generate_guid (); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + g_test_add_func ("/gdbus/peer-to-peer", test_peer); + g_test_add_func ("/gdbus/delayed-message-processing", delayed_message_processing); +#ifdef BUG_631379_FIXED + g_test_add_func ("/gdbus/nonce-tcp", test_nonce_tcp); +#endif + g_test_add_func ("/gdbus/credentials", test_credentials); + g_test_add_func ("/gdbus/overflow", test_overflow); + + ret = g_test_run(); + + g_main_loop_unref (loop); + g_free (test_guid); + g_dbus_node_info_unref (introspection_data); + + return ret; +} diff --git a/gio/tests/gdbus-proxy-well-known-name.c b/gio/tests/gdbus-proxy-well-known-name.c new file mode 100644 index 0000000..a599ef6 --- /dev/null +++ b/gio/tests/gdbus-proxy-well-known-name.c @@ -0,0 +1,283 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +proxy_new_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + GDBusProxy **ret = user_data; + GError *error; + + error = NULL; + *ret = g_dbus_proxy_new_finish (res, &error); + g_assert_no_error (error); + g_assert (ret != NULL); + + g_main_loop_quit (loop); +} + +static void +test_proxy_well_known_name (void) +{ + GDBusProxy *p; + GDBusProxy *p2; + GDBusProxy *ap; + GDBusProxy *ap2; + GDBusConnection *c; + GError *error; + gchar *name_owner; + gchar **property_names; + GVariant *variant; + GVariant *result; + + session_bus_up (); + + /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return + * until one can connect to the bus but that's not how things work right now + */ + usleep (500 * 1000); + + error = NULL; + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c != NULL); + + error = NULL; + p = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo* */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + + /* we shouldn't have a name owner nor any cached properties */ + g_assert_cmpstr (g_dbus_proxy_get_name_owner (p), ==, NULL); + g_assert (g_dbus_proxy_get_cached_property_names (p) == NULL); + + /* also for async: we shouldn't have a name owner nor any cached properties */ + g_dbus_proxy_new (c, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo* */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + NULL, /* GCancellable */ + (GAsyncReadyCallback) proxy_new_cb, + &ap); + g_main_loop_run (loop); + g_assert_cmpstr (g_dbus_proxy_get_name_owner (ap), ==, NULL); + g_assert (g_dbus_proxy_get_cached_property_names (ap) == NULL); + + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + + /* check that we get the notify::g-name-owner signal */ + _g_assert_property_notify (p, "g-name-owner"); + + /* Now we should have a name owner as well as properties */ + name_owner = g_dbus_proxy_get_name_owner (p); + property_names = g_dbus_proxy_get_cached_property_names (p); + g_assert (g_dbus_is_unique_name (name_owner)); + g_assert (property_names != NULL && g_strv_length (property_names) > 0); + g_free (name_owner); + g_strfreev (property_names); + + /* if we create another proxy with the service being available, check that + * it has a name owner and properties + */ + error = NULL; + p2 = g_dbus_proxy_new_sync (c, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo* */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + name_owner = g_dbus_proxy_get_name_owner (p2); + property_names = g_dbus_proxy_get_cached_property_names (p2); + g_assert (g_dbus_is_unique_name (name_owner)); + g_assert (property_names != NULL && g_strv_length (property_names) > 0); + g_free (name_owner); + g_strfreev (property_names); + + /* also for async: we should have a name owner and cached properties */ + g_dbus_proxy_new (c, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo* */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface name */ + NULL, /* GCancellable */ + (GAsyncReadyCallback) proxy_new_cb, + &ap2); + g_main_loop_run (loop); + name_owner = g_dbus_proxy_get_name_owner (ap2); + property_names = g_dbus_proxy_get_cached_property_names (ap2); + g_assert (g_dbus_is_unique_name (name_owner)); + g_assert (property_names != NULL && g_strv_length (property_names) > 0); + g_free (name_owner); + g_strfreev (property_names); + + /* Check property value is the initial value */ + variant = g_dbus_proxy_get_cached_property (p, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 1); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (p2, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 1); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (ap, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 1); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (ap2, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 1); + g_variant_unref (variant); + + /* Check that properties are updated on both p and p2 */ + result = g_dbus_proxy_call_sync (p, + "FrobSetProperty", + g_variant_new ("(sv)", + "y", + g_variant_new_byte (42)), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + _g_assert_signal_received (p, "g-properties-changed"); + variant = g_dbus_proxy_get_cached_property (p, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 42); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (p2, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 42); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (ap, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 42); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (ap2, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 42); + g_variant_unref (variant); + + /* Nuke the service and check that we get the signal and then don't + * have a name owner nor any cached properties + */ + result = g_dbus_proxy_call_sync (p, + "Quit", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + /* and wait... */ + _g_assert_property_notify (p, "g-name-owner"); + /* now we shouldn't have a name owner nor any cached properties */ + g_assert_cmpstr (g_dbus_proxy_get_name_owner (p), ==, NULL); + g_assert (g_dbus_proxy_get_cached_property_names (p) == NULL); + g_assert (g_dbus_proxy_get_cached_property (p, "y") == NULL); + + /* now bring back the server and wait for the proxy to be updated.. now + * the 'y' property should be back at 1... + */ + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + /* check that we get the notify::g-name-owner signal */ + _g_assert_property_notify (p, "g-name-owner"); + /* Now we should have a name owner as well as properties */ + name_owner = g_dbus_proxy_get_name_owner (p); + property_names = g_dbus_proxy_get_cached_property_names (p); + g_assert (g_dbus_is_unique_name (name_owner)); + g_assert (property_names != NULL && g_strv_length (property_names) > 0); + g_free (name_owner); + g_strfreev (property_names); + /* and finally check the 'y' property */ + variant = g_dbus_proxy_get_cached_property (p, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 1); + g_variant_unref (variant); + + g_object_unref (p2); + g_object_unref (p); + g_object_unref (ap2); + g_object_unref (ap); + + g_object_unref (c); + + /* tear down bus */ + session_bus_down (); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + gint ret; + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/proxy-well-known-name", test_proxy_well_known_name); + + ret = g_test_run(); + return ret; +} diff --git a/gio/tests/gdbus-proxy.c b/gio/tests/gdbus-proxy.c new file mode 100644 index 0000000..142476f --- /dev/null +++ b/gio/tests/gdbus-proxy.c @@ -0,0 +1,684 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that the method aspects of GDBusProxy works */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_methods (GDBusProxy *proxy) +{ + GVariant *result; + GError *error; + const gchar *str; + gchar *dbus_error_name; + + /* check that we can invoke a method */ + error = NULL; + result = g_dbus_proxy_call_sync (proxy, + "HelloWorld", + g_variant_new ("(s)", "Hey"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "(s)"); + g_variant_get (result, "(&s)", &str); + g_assert_cmpstr (str, ==, "You greeted me with 'Hey'. Thanks!"); + g_variant_unref (result); + + /* Check that we can completely recover the returned error */ + result = g_dbus_proxy_call_sync (proxy, + "HelloWorld", + g_variant_new ("(s)", "Yo"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR); + g_assert (g_dbus_error_is_remote_error (error)); + g_assert (g_dbus_error_is_remote_error (error)); + g_assert (result == NULL); + dbus_error_name = g_dbus_error_get_remote_error (error); + g_assert_cmpstr (dbus_error_name, ==, "com.example.TestException"); + g_free (dbus_error_name); + g_assert (g_dbus_error_strip_remote_error (error)); + g_assert_cmpstr (error->message, ==, "Yo is not a proper greeting"); + g_clear_error (&error); + + /* Check that we get a timeout if the method handling is taking longer than timeout */ + error = NULL; + result = g_dbus_proxy_call_sync (proxy, + "Sleep", + g_variant_new ("(i)", 500 /* msec */), + G_DBUS_CALL_FLAGS_NONE, + 100 /* msec */, + NULL, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT); + g_assert (!g_dbus_error_is_remote_error (error)); + g_assert (result == NULL); + g_clear_error (&error); + + /* Check that proxy-default timeouts work. */ + g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, -1); + + /* the default timeout is 25000 msec so this should work */ + result = g_dbus_proxy_call_sync (proxy, + "Sleep", + g_variant_new ("(i)", 500 /* msec */), + G_DBUS_CALL_FLAGS_NONE, + -1, /* use proxy default (e.g. -1 -> e.g. 25000 msec) */ + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + + /* now set the proxy-default timeout to 250 msec and try the 500 msec call - this should FAIL */ + g_dbus_proxy_set_default_timeout (proxy, 250); + g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, 250); + result = g_dbus_proxy_call_sync (proxy, + "Sleep", + g_variant_new ("(i)", 500 /* msec */), + G_DBUS_CALL_FLAGS_NONE, + -1, /* use proxy default (e.g. 250 msec) */ + NULL, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT); + g_assert (!g_dbus_error_is_remote_error (error)); + g_assert (result == NULL); + g_clear_error (&error); + + /* clean up after ourselves */ + g_dbus_proxy_set_default_timeout (proxy, -1); +} + +static gboolean +strv_equal (gchar **strv, ...) +{ + gint count; + va_list list; + const gchar *str; + gboolean res; + + res = TRUE; + count = 0; + va_start (list, strv); + while (1) + { + str = va_arg (list, const gchar *); + if (str == NULL) + break; + if (g_strcmp0 (str, strv[count]) != 0) + { + res = FALSE; + break; + } + count++; + } + va_end (list); + + if (res) + res = g_strv_length (strv) == count; + + return res; +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that the property aspects of GDBusProxy works */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_properties (GDBusProxy *proxy) +{ + GError *error; + GVariant *variant; + GVariant *variant2; + GVariant *result; + gchar **names; + + error = NULL; + + if (g_dbus_proxy_get_flags (proxy) & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES) + { + g_assert (g_dbus_proxy_get_cached_property_names (proxy) == NULL); + return; + } + + /* + * Check that we can list all cached properties. + */ + names = g_dbus_proxy_get_cached_property_names (proxy); + + g_assert (strv_equal (names, + "PropertyThatWillBeInvalidated", + "ab", + "ad", + "ai", + "an", + "ao", + "aq", + "as", + "at", + "au", + "ax", + "ay", + "b", + "d", + "foo", + "i", + "n", + "o", + "q", + "s", + "t", + "u", + "x", + "y", + NULL)); + + g_strfreev (names); + + /* + * Check that we can read cached properties. + * + * No need to test all properties - GVariant has already been tested + */ + variant = g_dbus_proxy_get_cached_property (proxy, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 1); + g_variant_unref (variant); + variant = g_dbus_proxy_get_cached_property (proxy, "o"); + g_assert (variant != NULL); + g_assert_cmpstr (g_variant_get_string (variant, NULL), ==, "/some/path"); + g_variant_unref (variant); + + /* + * Now ask the service to change a property and check that #GDBusProxy::g-property-changed + * is received. Also check that the cache is updated. + */ + variant2 = g_variant_new_byte (42); + result = g_dbus_proxy_call_sync (proxy, + "FrobSetProperty", + g_variant_new ("(sv)", + "y", + variant2), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + _g_assert_signal_received (proxy, "g-properties-changed"); + variant = g_dbus_proxy_get_cached_property (proxy, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 42); + g_variant_unref (variant); + + g_dbus_proxy_set_cached_property (proxy, "y", g_variant_new_byte (142)); + variant = g_dbus_proxy_get_cached_property (proxy, "y"); + g_assert (variant != NULL); + g_assert_cmpint (g_variant_get_byte (variant), ==, 142); + g_variant_unref (variant); + + g_dbus_proxy_set_cached_property (proxy, "y", NULL); + variant = g_dbus_proxy_get_cached_property (proxy, "y"); + g_assert (variant == NULL); + + /* Check that the invalidation feature of the PropertiesChanged() + * signal works... First, check that we have a cached value of the + * property (from the initial GetAll() call) + */ + variant = g_dbus_proxy_get_cached_property (proxy, "PropertyThatWillBeInvalidated"); + g_assert (variant != NULL); + g_assert_cmpstr (g_variant_get_string (variant, NULL), ==, "InitialValue"); + g_variant_unref (variant); + /* now ask to invalidate the property - this causes a + * + * PropertiesChanaged("com.example.Frob", + * {}, + * ["PropertyThatWillBeInvalidated") + * + * signal to be emitted. This is received before the method reply + * for FrobInvalidateProperty *but* since the proxy was created in + * the same thread as we're doing this synchronous call, we'll get + * the method reply before... + */ + result = g_dbus_proxy_call_sync (proxy, + "FrobInvalidateProperty", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + /* ... hence we wait for the g-properties-changed signal to be delivered */ + _g_assert_signal_received (proxy, "g-properties-changed"); + /* ... and now we finally, check that the cached value has been invalidated */ + variant = g_dbus_proxy_get_cached_property (proxy, "PropertyThatWillBeInvalidated"); + g_assert (variant == NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ +/* Test that the signal aspects of GDBusProxy works */ +/* ---------------------------------------------------------------------------------------------------- */ + +static void +test_proxy_signals_on_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + GString *s = user_data; + + g_assert_cmpstr (signal_name, ==, "TestSignal"); + g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(sov)"); + + g_variant_print_string (parameters, s, TRUE); +} + +typedef struct +{ + GMainLoop *internal_loop; + GString *s; +} TestSignalData; + +static void +test_proxy_signals_on_emit_signal_cb (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + TestSignalData *data = user_data; + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_proxy_call_finish (proxy, + res, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + + /* check that the signal was recieved before we got the method result */ + g_assert (strlen (data->s->str) > 0); + + /* break out of the loop */ + g_main_loop_quit (data->internal_loop); +} + +static void +test_signals (GDBusProxy *proxy) +{ + GError *error; + GString *s; + gulong signal_handler_id; + TestSignalData data; + GVariant *result; + + error = NULL; + + /* + * Ask the service to emit a signal and check that we receive it. + * + * Note that blocking calls don't block in the mainloop so wait for the signal (which + * is dispatched before the method reply) + */ + s = g_string_new (NULL); + signal_handler_id = g_signal_connect (proxy, + "g-signal", + G_CALLBACK (test_proxy_signals_on_signal), + s); + + result = g_dbus_proxy_call_sync (proxy, + "EmitSignal", + g_variant_new ("(so)", + "Accept the next proposition you hear", + "/some/path"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + /* check that we haven't received the signal just yet */ + g_assert (strlen (s->str) == 0); + /* and now wait for the signal */ + _g_assert_signal_received (proxy, "g-signal"); + g_assert_cmpstr (s->str, + ==, + "('Accept the next proposition you hear .. in bed!', objectpath '/some/path/in/bed', <'a variant'>)"); + g_signal_handler_disconnect (proxy, signal_handler_id); + g_string_free (s, TRUE); + + /* + * Now do this async to check the signal is received before the method returns. + */ + s = g_string_new (NULL); + data.internal_loop = g_main_loop_new (NULL, FALSE); + data.s = s; + signal_handler_id = g_signal_connect (proxy, + "g-signal", + G_CALLBACK (test_proxy_signals_on_signal), + s); + g_dbus_proxy_call (proxy, + "EmitSignal", + g_variant_new ("(so)", + "You will make a great programmer", + "/some/other/path"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) test_proxy_signals_on_emit_signal_cb, + &data); + g_main_loop_run (data.internal_loop); + g_main_loop_unref (data.internal_loop); + g_assert_cmpstr (s->str, + ==, + "('You will make a great programmer .. in bed!', objectpath '/some/other/path/in/bed', <'a variant'>)"); + g_signal_handler_disconnect (proxy, signal_handler_id); + g_string_free (s, TRUE); +} + +static void +test_bogus_method_return (GDBusProxy *proxy) +{ + GError *error = NULL; + GVariant *result; + + result = g_dbus_proxy_call_sync (proxy, + "PairReturn", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); + g_assert (result == NULL); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static const gchar *frob_dbus_interface_xml = + "" + " " + /* Deliberately different from gdbus-testserver.py's definition */ + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; +static GDBusInterfaceInfo *frob_dbus_interface_info; + +static void +test_expected_interface (GDBusProxy *proxy) +{ + /* This is obviously wrong but expected interface is not set so we don't fail... */ + g_dbus_proxy_set_cached_property (proxy, "y", g_variant_new_string ("error_me_out!")); + g_dbus_proxy_set_cached_property (proxy, "y", g_variant_new_byte (42)); + g_dbus_proxy_set_cached_property (proxy, "does-not-exist", g_variant_new_string ("something")); + g_dbus_proxy_set_cached_property (proxy, "does-not-exist", NULL); + + /* Now repeat the method tests, with an expected interface set */ + g_dbus_proxy_set_interface_info (proxy, frob_dbus_interface_info); + test_methods (proxy); + + /* And now one more test where we deliberately set the expected + * interface definition incorrectly + */ + test_bogus_method_return (proxy); + + /* Also check that we complain if setting a cached property of the wrong type */ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) + { + g_dbus_proxy_set_cached_property (proxy, "y", g_variant_new_string ("error_me_out!")); + } + g_test_trap_assert_stderr ("*Trying to set property y of type s but according to the expected interface the type is y*"); + g_test_trap_assert_failed(); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) + { + g_dbus_proxy_set_cached_property (proxy, "does-not-exist", g_variant_new_string ("something")); + } + g_test_trap_assert_stderr ("*Trying to lookup property does-not-exist which isn't in expected interface com.example.Frob*"); + g_test_trap_assert_failed(); + + /* this should work, however (since the type is correct) */ + g_dbus_proxy_set_cached_property (proxy, "y", g_variant_new_byte (42)); +} + +static void +test_basic (GDBusProxy *proxy) +{ + GDBusConnection *connection; + GDBusConnection *conn; + GDBusProxyFlags flags; + GDBusInterfaceInfo *info; + gchar *name; + gchar *path; + gchar *interface; + gint timeout; + + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + + g_assert (g_dbus_proxy_get_connection (proxy) == connection); + g_assert (g_dbus_proxy_get_flags (proxy) == G_DBUS_PROXY_FLAGS_NONE); + g_assert (g_dbus_proxy_get_interface_info (proxy) == NULL); + g_assert_cmpstr (g_dbus_proxy_get_name (proxy), ==, "com.example.TestService"); + g_assert_cmpstr (g_dbus_proxy_get_object_path (proxy), ==, "/com/example/TestObject"); + g_assert_cmpstr (g_dbus_proxy_get_interface_name (proxy), ==, "com.example.Frob"); + g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, -1); + + g_object_get (proxy, + "g-connection", &conn, + "g-interface-info", &info, + "g-flags", &flags, + "g-name", &name, + "g-object-path", &path, + "g-interface-name", &interface, + "g-default-timeout", &timeout, + NULL); + + g_assert (conn == connection); + g_assert (info == NULL); + g_assert_cmpint (flags, ==, G_DBUS_PROXY_FLAGS_NONE); + g_assert_cmpstr (name, ==, "com.example.TestService"); + g_assert_cmpstr (path, ==, "/com/example/TestObject"); + g_assert_cmpstr (interface, ==, "com.example.Frob"); + g_assert_cmpint (timeout, ==, -1); + + g_object_unref (conn); + g_free (name); + g_free (path); + g_free (interface); + + g_object_unref (connection); +} + +static void +test_proxy (void) +{ + GDBusProxy *proxy; + GDBusConnection *connection; + GError *error; + + session_bus_up (); + + /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return + * until one can connect to the bus but that's not how things work right now + */ + usleep (500 * 1000); + + error = NULL; + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, + NULL, + &error); + g_assert_no_error (error); + error = NULL; + proxy = g_dbus_proxy_new_sync (connection, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + + _g_assert_property_notify (proxy, "g-name-owner"); + + test_basic (proxy); + test_methods (proxy); + test_properties (proxy); + test_signals (proxy); + test_expected_interface (proxy); + + g_object_unref (proxy); + g_object_unref (connection); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +proxy_ready (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GDBusProxy *proxy; + GError *error; + + error = NULL; + proxy = g_dbus_proxy_new_for_bus_finish (result, &error); + g_assert_no_error (error); + + test_basic (proxy); + test_methods (proxy); + test_properties (proxy); + test_signals (proxy); + test_expected_interface (proxy); + + g_object_unref (proxy); +} + +static void +test_async (void) +{ + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface */ + NULL, /* GCancellable */ + proxy_ready, + NULL); +} + +static void +test_no_properties (void) +{ + GDBusProxy *proxy; + GError *error; + + error = NULL; + proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + NULL, /* GDBusInterfaceInfo */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + + test_properties (proxy); + + g_object_unref (proxy); +} + +int +main (int argc, + char *argv[]) +{ + gint ret; + GDBusNodeInfo *introspection_data = NULL; + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + introspection_data = g_dbus_node_info_new_for_xml (frob_dbus_interface_xml, NULL); + g_assert (introspection_data != NULL); + frob_dbus_interface_info = introspection_data->interfaces[0]; + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + g_test_add_func ("/gdbus/proxy", test_proxy); + g_test_add_func ("/gdbus/proxy/async", test_async); + g_test_add_func ("/gdbus/proxy/no-properties", test_no_properties); + + ret = g_test_run(); + + g_dbus_node_info_unref (introspection_data); + return ret; +} diff --git a/gio/tests/gdbus-serialization.c b/gio/tests/gdbus-serialization.c new file mode 100644 index 0000000..38227c3 --- /dev/null +++ b/gio/tests/gdbus-serialization.c @@ -0,0 +1,991 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include + +#include +#include +#include + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +hexdump (const guchar *str, gsize len) +{ + const guchar *data = (const guchar *) str; + guint n, m; + + for (n = 0; n < len; n += 16) + { + g_printerr ("%04x: ", n); + + for (m = n; m < n + 16; m++) + { + if (m > n && (m%4) == 0) + g_printerr (" "); + if (m < len) + g_printerr ("%02x ", data[m]); + else + g_printerr (" "); + } + + g_printerr (" "); + + for (m = n; m < len && m < n + 16; m++) + g_printerr ("%c", g_ascii_isprint (data[m]) ? data[m] : '.'); + + g_printerr ("\n"); + } +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gboolean +append_gv_to_dbus_iter (DBusMessageIter *iter, + GVariant *value, + GError **error) +{ + const GVariantType *type; + + type = g_variant_get_type (value); + if (g_variant_type_equal (type, G_VARIANT_TYPE_BOOLEAN)) + { + dbus_bool_t v = g_variant_get_boolean (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_BOOLEAN, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_BYTE)) + { + guint8 v = g_variant_get_byte (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_BYTE, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT16)) + { + gint16 v = g_variant_get_int16 (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_INT16, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT16)) + { + guint16 v = g_variant_get_uint16 (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT16, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT32)) + { + gint32 v = g_variant_get_int32 (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_INT32, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT32)) + { + guint32 v = g_variant_get_uint32 (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT32, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64)) + { + gint64 v = g_variant_get_int64 (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_INT64, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64)) + { + guint64 v = g_variant_get_uint64 (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT64, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_DOUBLE)) + { + gdouble v = g_variant_get_double (value); + dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING)) + { + const gchar *v = g_variant_get_string (value, NULL); + dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_OBJECT_PATH)) + { + const gchar *v = g_variant_get_string (value, NULL); + dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &v); + } + else if (g_variant_type_equal (type, G_VARIANT_TYPE_SIGNATURE)) + { + const gchar *v = g_variant_get_string (value, NULL); + dbus_message_iter_append_basic (iter, DBUS_TYPE_SIGNATURE, &v); + } + else if (g_variant_type_is_variant (type)) + { + DBusMessageIter sub; + GVariant *child; + + child = g_variant_get_child_value (value, 0); + dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, + g_variant_get_type_string (child), + &sub); + if (!append_gv_to_dbus_iter (&sub, child, error)) + { + g_variant_unref (child); + goto fail; + } + dbus_message_iter_close_container (iter, &sub); + g_variant_unref (child); + } + else if (g_variant_type_is_array (type)) + { + DBusMessageIter dbus_iter; + const gchar *type_string; + GVariantIter gv_iter; + GVariant *item; + + type_string = g_variant_get_type_string (value); + type_string++; /* skip the 'a' */ + + dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, + type_string, &dbus_iter); + g_variant_iter_init (&gv_iter, value); + + while ((item = g_variant_iter_next_value (&gv_iter))) + { + if (!append_gv_to_dbus_iter (&dbus_iter, item, error)) + { + goto fail; + } + } + + dbus_message_iter_close_container (iter, &dbus_iter); + } + else if (g_variant_type_is_tuple (type)) + { + DBusMessageIter dbus_iter; + GVariantIter gv_iter; + GVariant *item; + + dbus_message_iter_open_container (iter, DBUS_TYPE_STRUCT, + NULL, &dbus_iter); + g_variant_iter_init (&gv_iter, value); + + while ((item = g_variant_iter_next_value (&gv_iter))) + { + if (!append_gv_to_dbus_iter (&dbus_iter, item, error)) + goto fail; + } + + dbus_message_iter_close_container (iter, &dbus_iter); + } + else if (g_variant_type_is_dict_entry (type)) + { + DBusMessageIter dbus_iter; + GVariant *key, *val; + + dbus_message_iter_open_container (iter, DBUS_TYPE_DICT_ENTRY, + NULL, &dbus_iter); + key = g_variant_get_child_value (value, 0); + if (!append_gv_to_dbus_iter (&dbus_iter, key, error)) + { + g_variant_unref (key); + goto fail; + } + g_variant_unref (key); + + val = g_variant_get_child_value (value, 1); + if (!append_gv_to_dbus_iter (&dbus_iter, val, error)) + { + g_variant_unref (val); + goto fail; + } + g_variant_unref (val); + + dbus_message_iter_close_container (iter, &dbus_iter); + } + else + { + g_set_error (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + "Error serializing GVariant with type-string `%s' to a D-Bus message", + g_variant_get_type_string (value)); + goto fail; + } + + return TRUE; + + fail: + return FALSE; +} + +static gboolean +append_gv_to_dbus_message (DBusMessage *message, + GVariant *value, + GError **error) +{ + gboolean ret; + guint n; + + ret = FALSE; + + if (value != NULL) + { + DBusMessageIter iter; + GVariantIter gv_iter; + GVariant *item; + + dbus_message_iter_init_append (message, &iter); + + g_variant_iter_init (&gv_iter, value); + n = 0; + while ((item = g_variant_iter_next_value (&gv_iter))) + { + if (!append_gv_to_dbus_iter (&iter, item, error)) + { + g_prefix_error (error, + "Error encoding in-arg %d: ", + n); + goto out; + } + n++; + } + } + + ret = TRUE; + + out: + return ret; +} + +static void +print_gv_dbus_message (GVariant *value) +{ + DBusMessage *message; + char *blob; + int blob_len; + GError *error; + + message = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); + dbus_message_set_serial (message, 0x41); + dbus_message_set_path (message, "/foo/bar"); + dbus_message_set_member (message, "Member"); + + error = NULL; + if (!append_gv_to_dbus_message (message, value, &error)) + { + g_printerr ("Error printing GVariant as DBusMessage: %s", error->message); + g_error_free (error); + goto out; + } + + dbus_message_marshal (message, &blob, &blob_len); + g_printerr ("\n"); + hexdump ((guchar *) blob, blob_len); + out: + dbus_message_unref (message); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +dbus_1_message_append (GString *s, + guint indent, + DBusMessageIter *iter) +{ + gint arg_type; + DBusMessageIter sub; + + g_string_append_printf (s, "%*s", indent, ""); + + arg_type = dbus_message_iter_get_arg_type (iter); + switch (arg_type) + { + case DBUS_TYPE_BOOLEAN: + { + dbus_bool_t value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "bool: %s\n", value ? "true" : "false"); + break; + } + + case DBUS_TYPE_BYTE: + { + guchar value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "byte: 0x%02x\n", (guint) value); + break; + } + + case DBUS_TYPE_INT16: + { + gint16 value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "int16: %" G_GINT16_FORMAT "\n", value); + break; + } + + case DBUS_TYPE_UINT16: + { + guint16 value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "uint16: %" G_GUINT16_FORMAT "\n", value); + break; + } + + case DBUS_TYPE_INT32: + { + gint32 value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "int32: %" G_GINT32_FORMAT "\n", value); + break; + } + + case DBUS_TYPE_UINT32: + { + guint32 value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "uint32: %" G_GUINT32_FORMAT "\n", value); + break; + } + + case DBUS_TYPE_INT64: + { + gint64 value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "int64: %" G_GINT64_FORMAT "\n", value); + break; + } + + case DBUS_TYPE_UINT64: + { + guint64 value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "uint64: %" G_GUINT64_FORMAT "\n", value); + break; + } + + case DBUS_TYPE_DOUBLE: + { + gdouble value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "double: %f\n", value); + break; + } + + case DBUS_TYPE_STRING: + { + const gchar *value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "string: `%s'\n", value); + break; + } + + case DBUS_TYPE_OBJECT_PATH: + { + const gchar *value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "object_path: `%s'\n", value); + break; + } + + case DBUS_TYPE_SIGNATURE: + { + const gchar *value; + dbus_message_iter_get_basic (iter, &value); + g_string_append_printf (s, "signature: `%s'\n", value); + break; + } + +#ifdef DBUS_TYPE_UNIX_FD + case DBUS_TYPE_UNIX_FD: + { + /* unfortunately there's currently no way to get just the + * protocol value, since dbus_message_iter_get_basic() wants + * to be 'helpful' and dup the fd for the user... + */ + g_string_append (s, "unix-fd: (not extracted)\n"); + break; + } +#endif + + case DBUS_TYPE_VARIANT: + g_string_append_printf (s, "variant:\n"); + dbus_message_iter_recurse (iter, &sub); + while (dbus_message_iter_get_arg_type (&sub)) + { + dbus_1_message_append (s, indent + 2, &sub); + dbus_message_iter_next (&sub); + } + break; + + case DBUS_TYPE_ARRAY: + g_string_append_printf (s, "array:\n"); + dbus_message_iter_recurse (iter, &sub); + while (dbus_message_iter_get_arg_type (&sub)) + { + dbus_1_message_append (s, indent + 2, &sub); + dbus_message_iter_next (&sub); + } + break; + + case DBUS_TYPE_STRUCT: + g_string_append_printf (s, "struct:\n"); + dbus_message_iter_recurse (iter, &sub); + while (dbus_message_iter_get_arg_type (&sub)) + { + dbus_1_message_append (s, indent + 2, &sub); + dbus_message_iter_next (&sub); + } + break; + + case DBUS_TYPE_DICT_ENTRY: + g_string_append_printf (s, "dict_entry:\n"); + dbus_message_iter_recurse (iter, &sub); + while (dbus_message_iter_get_arg_type (&sub)) + { + dbus_1_message_append (s, indent + 2, &sub); + dbus_message_iter_next (&sub); + } + break; + + default: + g_printerr ("Error serializing D-Bus message to GVariant. Unsupported arg type `%c' (%d)", + arg_type, + arg_type); + g_assert_not_reached (); + break; + } +} + +static gchar * +dbus_1_message_print (DBusMessage *message) +{ + GString *s; + guint n; + DBusMessageIter iter; + + s = g_string_new (NULL); + n = 0; + dbus_message_iter_init (message, &iter); + while (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INVALID) + { + g_string_append_printf (s, "value %d: ", n); + dbus_1_message_append (s, 2, &iter); + dbus_message_iter_next (&iter); + n++; + } + + return g_string_free (s, FALSE); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static gchar * +get_body_signature (GVariant *value) +{ + const gchar *s; + gsize len; + gchar *ret; + + if (value == NULL) + { + ret = g_strdup (""); + goto out; + } + + s = g_variant_get_type_string (value); + len = strlen (s); + g_assert (len >= 2); + + ret = g_strndup (s + 1, len - 2); + + out: + return ret; +} + +static void +check_serialization (GVariant *value, + const gchar *expected_dbus_1_output) +{ + guchar *blob; + gsize blob_size; + DBusMessage *dbus_1_message; + GDBusMessage *message; + GDBusMessage *recovered_message; + GError *error; + DBusError dbus_error; + gchar *s; + gchar *s1; + guint n; + + message = g_dbus_message_new (); + g_dbus_message_set_body (message, value); + g_dbus_message_set_message_type (message, G_DBUS_MESSAGE_TYPE_METHOD_CALL); + g_dbus_message_set_serial (message, 0x41); + s = get_body_signature (value); + g_dbus_message_set_header (message, G_DBUS_MESSAGE_HEADER_FIELD_PATH, g_variant_new_object_path ("/foo/bar")); + g_dbus_message_set_header (message, G_DBUS_MESSAGE_HEADER_FIELD_MEMBER, g_variant_new_string ("Member")); + g_dbus_message_set_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE, g_variant_new_signature (s)); + g_free (s); + + /* First check that the serialization to the D-Bus wire format is correct - do this for both byte orders */ + for (n = 0; n < 2; n++) + { + GDBusMessageByteOrder byte_order; + switch (n) + { + case 0: + byte_order = G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN; + break; + case 1: + byte_order = G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN; + break; + case 2: + g_assert_not_reached (); + break; + } + g_dbus_message_set_byte_order (message, byte_order); + + error = NULL; + blob = g_dbus_message_to_blob (message, + &blob_size, + G_DBUS_CAPABILITY_FLAGS_NONE, + &error); + g_assert_no_error (error); + g_assert (blob != NULL); + + switch (byte_order) + { + case G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN: + g_assert_cmpint (blob[0], ==, 'B'); + break; + case G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN: + g_assert_cmpint (blob[0], ==, 'l'); + break; + } + + dbus_error_init (&dbus_error); + dbus_1_message = dbus_message_demarshal ((char *) blob, blob_size, &dbus_error); + if (dbus_error_is_set (&dbus_error)) + { + g_printerr ("Error calling dbus_message_demarshal() on this blob: %s: %s\n", + dbus_error.name, + dbus_error.message); + hexdump (blob, blob_size); + dbus_error_free (&dbus_error); + + s = g_variant_print (value, TRUE); + g_printerr ("\nThe blob was generated from the following GVariant value:\n%s\n\n", s); + g_free (s); + + g_printerr ("If the blob was encoded using DBusMessageIter, the payload would have been:\n"); + print_gv_dbus_message (value); + + g_assert_not_reached (); + } + + s = dbus_1_message_print (dbus_1_message); + dbus_message_unref (dbus_1_message); + + g_assert_cmpstr (s, ==, expected_dbus_1_output); + g_free (s); + + /* Then serialize back and check that the body is identical */ + + error = NULL; + recovered_message = g_dbus_message_new_from_blob (blob, + blob_size, + G_DBUS_CAPABILITY_FLAGS_NONE, + &error); + g_assert (recovered_message != NULL); + g_assert_no_error (error); + + if (value == NULL) + { + g_assert (g_dbus_message_get_body (recovered_message) == NULL); + } + else + { + g_assert (g_dbus_message_get_body (recovered_message) != NULL); + if (!g_variant_equal (g_dbus_message_get_body (recovered_message), value)) + { + s = g_variant_print (g_dbus_message_get_body (recovered_message), TRUE); + s1 = g_variant_print (value, TRUE); + g_printerr ("Recovered value:\n%s\ndoes not match given value\n%s\n", + s, + s1); + g_free (s); + g_free (s1); + g_assert_not_reached (); + } + } + g_object_unref (recovered_message); + } + + g_object_unref (message); +} + +static void +message_serialize_basic (void) +{ + check_serialization (NULL, ""); + + check_serialization (g_variant_new ("(sogybnqiuxtd)", + "this is a string", + "/this/is/a/path", + "sad", + 42, + TRUE, + -42, + 60000, + -44, + 100000, + -G_GINT64_CONSTANT(2)<<34, + G_GUINT64_CONSTANT(0xffffffffffffffff), + 42.5), + "value 0: string: `this is a string'\n" + "value 1: object_path: `/this/is/a/path'\n" + "value 2: signature: `sad'\n" + "value 3: byte: 0x2a\n" + "value 4: bool: true\n" + "value 5: int16: -42\n" + "value 6: uint16: 60000\n" + "value 7: int32: -44\n" + "value 8: uint32: 100000\n" + "value 9: int64: -34359738368\n" + "value 10: uint64: 18446744073709551615\n" + "value 11: double: 42.500000\n"); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +message_serialize_complex (void) +{ + GError *error; + GVariant *value; + + error = NULL; + + value = g_variant_parse (G_VARIANT_TYPE ("(aia{ss})"), + "([1, 2, 3], {'one': 'white', 'two': 'black'})", + NULL, NULL, &error); + g_assert_no_error (error); + g_assert (value != NULL); + check_serialization (value, + "value 0: array:\n" + " int32: 1\n" + " int32: 2\n" + " int32: 3\n" + "value 1: array:\n" + " dict_entry:\n" + " string: `one'\n" + " string: `white'\n" + " dict_entry:\n" + " string: `two'\n" + " string: `black'\n"); + + value = g_variant_parse (G_VARIANT_TYPE ("(sa{sv}as)"), + "('01234567890123456', {}, ['Something'])", + NULL, NULL, &error); + g_assert_no_error (error); + g_assert (value != NULL); + check_serialization (value, + "value 0: string: `01234567890123456'\n" + "value 1: array:\n" + "value 2: array:\n" + " string: `Something'\n"); + + /* https://bugzilla.gnome.org/show_bug.cgi?id=621838 */ + check_serialization (g_variant_new_parsed ("(@aay [], {'cwd': <'/home/davidz/Hacking/glib/gio/tests'>})"), + "value 0: array:\n" + "value 1: array:\n" + " dict_entry:\n" + " string: `cwd'\n" + " variant:\n" + " string: `/home/davidz/Hacking/glib/gio/tests'\n"); + +#ifdef DBUS_TYPE_UNIX_FD + value = g_variant_parse (G_VARIANT_TYPE ("(hah)"), + "(42, [43, 44])", + NULL, NULL, &error); + g_assert_no_error (error); + g_assert (value != NULL); + /* about (not extracted), see comment in DBUS_TYPE_UNIX_FD case in + * dbus_1_message_append() above. + */ + check_serialization (value, + "value 0: unix-fd: (not extracted)\n" + "value 1: array:\n" + " unix-fd: (not extracted)\n" + " unix-fd: (not extracted)\n"); +#endif +} + + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +message_serialize_invalid (void) +{ + guint n; + + /* Here we're relying on libdbus-1's DBusMessage type not checking + * anything. If that were to change, we'd need to do our own + * thing. + * + * Other things we could check (note that GDBus _does_ check for all + * these things - we just don't have test-suit coverage for it) + * + * - array exceeding 64 MiB (2^26 bytes) - unfortunately libdbus-1 checks + * this, e.g. + * + * process 19620: arguments to dbus_message_iter_append_fixed_array() were incorrect, + * assertion "n_elements <= DBUS_MAXIMUM_ARRAY_LENGTH / _dbus_type_get_alignment (element_type)" + * failed in file dbus-message.c line 2344. + * This is normally a bug in some application using the D-Bus library. + * D-Bus not built with -rdynamic so unable to print a backtrace + * Aborted (core dumped) + * + * - message exceeding 128 MiB (2^27 bytes) + * + * - endianness, message type, flags, protocol version + */ + + for (n = 0; n < 3; n++) + { + GDBusMessage *message; + GError *error; + DBusMessage *dbus_message; + char *blob; + int blob_len; + const gchar *invalid_utf8_str = "this is invalid\xff"; + const gchar *invalid_object_path = "/this/is/not a valid object path"; + const gchar *invalid_signature = "not valid signature"; + + dbus_message = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL); + dbus_message_set_serial (dbus_message, 0x41); + dbus_message_set_path (dbus_message, "/foo/bar"); + dbus_message_set_member (dbus_message, "Member"); + switch (n) + { + case 0: + /* invalid UTF-8 */ + dbus_message_append_args (dbus_message, + DBUS_TYPE_STRING, &invalid_utf8_str, + DBUS_TYPE_INVALID); + break; + + case 1: + /* invalid object path */ + dbus_message_append_args (dbus_message, + DBUS_TYPE_OBJECT_PATH, &invalid_object_path, + DBUS_TYPE_INVALID); + break; + + case 2: + /* invalid signature */ + dbus_message_append_args (dbus_message, + DBUS_TYPE_SIGNATURE, &invalid_signature, + DBUS_TYPE_INVALID); + break; + + default: + g_assert_not_reached (); + break; + } + dbus_message_marshal (dbus_message, &blob, &blob_len); + + error = NULL; + message = g_dbus_message_new_from_blob ((guchar *) blob, + blob_len, + G_DBUS_CAPABILITY_FLAGS_NONE, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); + g_assert (message == NULL); + + dbus_free (blob); + } + +} + +/* ---------------------------------------------------------------------------------------------------- */ + +static void +message_serialize_header_checks (void) +{ + GDBusMessage *message; + GDBusMessage *reply; + GError *error; + guchar *blob; + gsize blob_size; + + /* + * check we can't serialize messages with INVALID type + */ + message = g_dbus_message_new (); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: type is INVALID"); + g_error_free (error); + g_assert (blob == NULL); + g_object_unref (message); + + /* + * check we can't serialize signal messages with INTERFACE, PATH or MEMBER unset / set to reserved value + */ + message = g_dbus_message_new_signal ("/the/path", "The.Interface", "TheMember"); + /* ----- */ + /* interface NULL => error */ + g_dbus_message_set_interface (message, NULL); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: SIGNAL message: PATH, INTERFACE or MEMBER header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + /* interface reserved value => error */ + g_dbus_message_set_interface (message, "org.freedesktop.DBus.Local"); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: SIGNAL message: The INTERFACE header field is using the reserved value org.freedesktop.DBus.Local"); + g_error_free (error); + g_assert (blob == NULL); + /* reset interface */ + g_dbus_message_set_interface (message, "The.Interface"); + /* ----- */ + /* path NULL => error */ + g_dbus_message_set_path (message, NULL); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: SIGNAL message: PATH, INTERFACE or MEMBER header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + /* path reserved value => error */ + g_dbus_message_set_path (message, "/org/freedesktop/DBus/Local"); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: SIGNAL message: The PATH header field is using the reserved value /org/freedesktop/DBus/Local"); + g_error_free (error); + g_assert (blob == NULL); + /* reset path */ + g_dbus_message_set_path (message, "/the/path"); + /* ----- */ + /* member NULL => error */ + g_dbus_message_set_member (message, NULL); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: SIGNAL message: PATH, INTERFACE or MEMBER header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + /* reset member */ + g_dbus_message_set_member (message, "TheMember"); + /* ----- */ + /* done */ + g_object_unref (message); + + /* + * check that we can't serialize method call messages with PATH or MEMBER unset + */ + message = g_dbus_message_new_method_call (NULL, "/the/path", NULL, "TheMember"); + /* ----- */ + /* path NULL => error */ + g_dbus_message_set_path (message, NULL); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: METHOD_CALL message: PATH or MEMBER header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + /* reset path */ + g_dbus_message_set_path (message, "/the/path"); + /* ----- */ + /* member NULL => error */ + g_dbus_message_set_member (message, NULL); + error = NULL; + blob = g_dbus_message_to_blob (message, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: METHOD_CALL message: PATH or MEMBER header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + /* reset member */ + g_dbus_message_set_member (message, "TheMember"); + /* ----- */ + /* done */ + g_object_unref (message); + + /* + * check that we can't serialize method reply messages with REPLY_SERIAL unset + */ + message = g_dbus_message_new_method_call (NULL, "/the/path", NULL, "TheMember"); + g_dbus_message_set_serial (message, 42); + /* method reply */ + reply = g_dbus_message_new_method_reply (message); + g_assert_cmpint (g_dbus_message_get_reply_serial (reply), ==, 42); + g_dbus_message_set_header (reply, G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL, NULL); + error = NULL; + blob = g_dbus_message_to_blob (reply, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: METHOD_RETURN message: REPLY_SERIAL header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + g_object_unref (reply); + /* method error - first nuke ERROR_NAME, then REPLY_SERIAL */ + reply = g_dbus_message_new_method_error (message, "Some.Error.Name", "the message"); + g_assert_cmpint (g_dbus_message_get_reply_serial (reply), ==, 42); + /* nuke ERROR_NAME */ + g_dbus_message_set_error_name (reply, NULL); + error = NULL; + blob = g_dbus_message_to_blob (reply, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: ERROR message: REPLY_SERIAL or ERROR_NAME header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + /* reset ERROR_NAME */ + g_dbus_message_set_error_name (reply, "Some.Error.Name"); + /* nuke REPLY_SERIAL */ + g_dbus_message_set_header (reply, G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL, NULL); + error = NULL; + blob = g_dbus_message_to_blob (reply, &blob_size, G_DBUS_CAPABILITY_FLAGS_NONE, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (error->message, ==, "Cannot serialize message: ERROR message: REPLY_SERIAL or ERROR_NAME header field is missing"); + g_error_free (error); + g_assert (blob == NULL); + g_object_unref (reply); + g_object_unref (message); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + setlocale (LC_ALL, "C"); + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/gdbus/message-serialize-basic", message_serialize_basic); + g_test_add_func ("/gdbus/message-serialize-complex", message_serialize_complex); + g_test_add_func ("/gdbus/message-serialize-invalid", message_serialize_invalid); + g_test_add_func ("/gdbus/message-serialize-header-checks", message_serialize_header_checks); + return g_test_run(); +} + diff --git a/gio/tests/gdbus-sessionbus.c b/gio/tests/gdbus-sessionbus.c new file mode 100644 index 0000000..e90bd1f --- /dev/null +++ b/gio/tests/gdbus-sessionbus.c @@ -0,0 +1,344 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "gdbus-sessionbus.h" + +/* ---------------------------------------------------------------------------------------------------- */ +/* Utilities for bringing up and tearing down session message bus instances */ + +static void +watch_parent (gint fd) +{ + GPollFD fds[1]; + gint num_events; + gchar buf[512]; + guint bytes_read; + GArray *buses_to_kill_array; + + fds[0].fd = fd; + fds[0].events = G_IO_HUP | G_IO_IN; + fds[0].revents = 0; + + buses_to_kill_array = g_array_new (FALSE, TRUE, sizeof (guint)); + + do + { + guint pid; + guint n; + + num_events = g_poll (fds, 1, -1); + if (num_events == 0) + continue; + + if (fds[0].revents == G_IO_HUP) + { + for (n = 0; n < buses_to_kill_array->len; n++) + { + pid = g_array_index (buses_to_kill_array, guint, n); + g_print ("cleaning up bus with pid %d\n", pid); + kill (pid, SIGTERM); + } + g_array_free (buses_to_kill_array, TRUE); + exit (0); + } + + //g_debug ("data from parent"); + + memset (buf, '\0', sizeof buf); + again: + bytes_read = read (fds[0].fd, buf, sizeof buf); + if (bytes_read < 0 && (errno == EAGAIN || errno == EINTR)) + goto again; + + if (sscanf (buf, "add %d\n", &pid) == 1) + { + g_array_append_val (buses_to_kill_array, pid); + } + else if (sscanf (buf, "remove %d\n", &pid) == 1) + { + for (n = 0; n < buses_to_kill_array->len; n++) + { + if (g_array_index (buses_to_kill_array, guint, n) == pid) + { + g_array_remove_index (buses_to_kill_array, n); + pid = 0; + break; + } + } + if (pid != 0) + { + g_warning ("unknown pid %d to remove", pid); + } + } + else + { + g_warning ("unknown command from parent '%s'", buf); + } + } + while (TRUE); + +} + +static GHashTable *session_bus_address_to_pid = NULL; +static gint pipe_fds[2]; + +const gchar * +session_bus_up_with_address (const gchar *given_address) +{ + gchar *address; + int stdout_fd; + GError *error; + gchar *argv[] = {"dbus-daemon", "--print-address", "--config-file=foo", NULL}; + GPid pid; + gchar buf[512]; + ssize_t bytes_read; + gchar *config_file_name; + gint config_file_fd; + GString *config_file_contents; + + address = NULL; + error = NULL; + config_file_name = NULL; + config_file_fd = -1; + argv[2] = NULL; + + config_file_fd = g_file_open_tmp ("g-dbus-tests-XXXXXX", + &config_file_name, + &error); + if (config_file_fd < 0) + { + g_warning ("Error creating temporary config file: %s", error->message); + g_error_free (error); + goto out; + } + + config_file_contents = g_string_new (NULL); + g_string_append (config_file_contents, "\n"); + g_string_append (config_file_contents, " session\n"); + g_string_append_printf (config_file_contents, " %s\n", given_address); + g_string_append (config_file_contents, + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n"); + g_string_append (config_file_contents, "\n"); + + if (write (config_file_fd, config_file_contents->str, config_file_contents->len) != (gssize) config_file_contents->len) + { + g_warning ("Error writing %d bytes to config file: %m", (gint) config_file_contents->len); + g_string_free (config_file_contents, TRUE); + goto out; + } + g_string_free (config_file_contents, TRUE); + + argv[2] = g_strdup_printf ("--config-file=%s", config_file_name); + + if (session_bus_address_to_pid == NULL) + { + /* keep a mapping from session bus address to the pid */ + session_bus_address_to_pid = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + + /* fork a child to clean up session buses when we are killed */ + if (pipe (pipe_fds) != 0) + { + g_warning ("pipe() failed: %m"); + g_assert_not_reached (); + } + switch (fork ()) + { + case -1: + g_warning ("fork() failed: %m"); + g_assert_not_reached (); + break; + + case 0: + /* child */ + close (pipe_fds[1]); + watch_parent (pipe_fds[0]); + break; + + default: + /* parent */ + close (pipe_fds[0]); + break; + } + + //atexit (cleanup_session_buses); + /* TODO: need to handle the cases where we crash */ + } + else + { + /* check if we already have a bus running for this address */ + if (g_hash_table_lookup (session_bus_address_to_pid, given_address) != NULL) + { + g_warning ("Already have a bus instance for the given address %s", given_address); + goto out; + } + } + + if (!g_spawn_async_with_pipes (NULL, + argv, + NULL, + G_SPAWN_SEARCH_PATH, + NULL, + NULL, + &pid, + NULL, + &stdout_fd, + NULL, + &error)) + { + g_warning ("Error spawning dbus-daemon: %s", error->message); + g_error_free (error); + goto out; + } + + memset (buf, '\0', sizeof buf); + again: + bytes_read = read (stdout_fd, buf, sizeof buf); + if (bytes_read < 0 && (errno == EAGAIN || errno == EINTR)) + goto again; + close (stdout_fd); + + if (bytes_read == 0 || bytes_read == sizeof buf) + { + g_warning ("Error reading address from dbus daemon, %d bytes read", (gint) bytes_read); + kill (SIGTERM, pid); + goto out; + } + + address = g_strdup (buf); + g_strstrip (address); + + /* write the pid to the child so it can kill it when we die */ + g_snprintf (buf, sizeof buf, "add %d\n", (guint) pid); + write (pipe_fds[1], buf, strlen (buf)); + + /* start dbus-monitor */ + if (g_getenv ("G_DBUS_MONITOR") != NULL) + { + g_spawn_command_line_async ("dbus-monitor --session", NULL); + usleep (500 * 1000); + } + + g_hash_table_insert (session_bus_address_to_pid, address, GUINT_TO_POINTER (pid)); + + out: + if (config_file_fd > 0) + { + if (close (config_file_fd) != 0) + { + g_warning ("Error closing fd for config file %s: %m", config_file_name); + } + g_assert (config_file_name != NULL); + if (unlink (config_file_name) != 0) + { + g_warning ("Error unlinking config file %s: %m", config_file_name); + } + } + g_free (argv[2]); + g_free (config_file_name); + return address; +} + +void +session_bus_down_with_address (const gchar *address) +{ + gpointer value; + GPid pid; + gchar buf[512]; + + g_assert (address != NULL); + g_assert (session_bus_address_to_pid != NULL); + + value = g_hash_table_lookup (session_bus_address_to_pid, address); + g_assert (value != NULL); + + pid = GPOINTER_TO_UINT (g_hash_table_lookup (session_bus_address_to_pid, address)); + + kill (pid, SIGTERM); + + /* write the pid to the child so it won't kill it when we die */ + g_snprintf (buf, sizeof buf, "remove %d\n", (guint) pid); + write (pipe_fds[1], buf, strlen (buf)); + + g_hash_table_remove (session_bus_address_to_pid, address); +} + +static gchar *temporary_address = NULL; +static gchar *temporary_address_used_by_bus = NULL; + +const gchar * +session_bus_get_temporary_address (void) +{ + if (temporary_address == NULL) + { + temporary_address = g_strdup_printf ("unix:path=/tmp/g-dbus-tests-pid-%d", getpid ()); + } + + return temporary_address; +} + +const gchar * +session_bus_up (void) +{ + if (temporary_address_used_by_bus != NULL) + { + g_warning ("There is already a session bus up"); + goto out; + } + + temporary_address_used_by_bus = g_strdup (session_bus_up_with_address (session_bus_get_temporary_address ())); + + out: + return temporary_address_used_by_bus; +} + +void +session_bus_down (void) +{ + if (temporary_address_used_by_bus == NULL) + { + g_warning ("There is not a session bus up"); + } + else + { + session_bus_down_with_address (temporary_address_used_by_bus); + g_free (temporary_address_used_by_bus); + temporary_address_used_by_bus = NULL; + } +} diff --git a/gio/fen/fen-missing.h b/gio/tests/gdbus-sessionbus.h similarity index 58% rename from gio/fen/fen-missing.h rename to gio/tests/gdbus-sessionbus.h index d431a00..e107e06 100644 --- a/gio/fen/fen-missing.h +++ b/gio/tests/gdbus-sessionbus.h @@ -1,8 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:set expandtab ts=4 shiftwidth=4: */ -/* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2009 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,20 +17,22 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * - * Authors: Lin Ma + * Author: David Zeuthen */ -#ifndef __GAM_FEN_H__ -#define __GAM_FEN_H__ +#ifndef __SESSION_BUS_H__ +#define __SESSION_BUS_H__ -#include "fen-data.h" +#include G_BEGIN_DECLS -extern void _missing_add (fdata *f); -extern void _missing_remove (fdata *f); +const gchar *session_bus_up_with_address (const gchar *given_address); +void session_bus_down_with_address (const gchar *address); +const gchar *session_bus_get_temporary_address (void); +const gchar *session_bus_up (void); +void session_bus_down (void); G_END_DECLS -#endif /* __GAM_FEN_H__ */ - +#endif /* __SESSION_BUS_H__ */ diff --git a/gio/tests/gdbus-tests.c b/gio/tests/gdbus-tests.c new file mode 100644 index 0000000..06f1384 --- /dev/null +++ b/gio/tests/gdbus-tests.c @@ -0,0 +1,265 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include + +#include "gdbus-tests.h" + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GMainLoop *loop; + gboolean timed_out; +} PropertyNotifyData; + +static void +on_property_notify (GObject *object, + GParamSpec *pspec, + gpointer user_data) +{ + PropertyNotifyData *data = user_data; + g_main_loop_quit (data->loop); +} + +static gboolean +on_property_notify_timeout (gpointer user_data) +{ + PropertyNotifyData *data = user_data; + data->timed_out = TRUE; + g_main_loop_quit (data->loop); + return TRUE; +} + +gboolean +_g_assert_property_notify_run (gpointer object, + const gchar *property_name) +{ + gchar *s; + gulong handler_id; + guint timeout_id; + PropertyNotifyData data; + + data.loop = g_main_loop_new (NULL, FALSE); + data.timed_out = FALSE; + s = g_strdup_printf ("notify::%s", property_name); + handler_id = g_signal_connect (object, + s, + G_CALLBACK (on_property_notify), + &data); + g_free (s); + timeout_id = g_timeout_add (30 * 1000, + on_property_notify_timeout, + &data); + g_main_loop_run (data.loop); + g_signal_handler_disconnect (object, handler_id); + g_source_remove (timeout_id); + g_main_loop_unref (data.loop); + + return data.timed_out; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct +{ + GMainLoop *loop; + gboolean timed_out; +} SignalReceivedData; + +static void +on_signal_received (gpointer user_data) +{ + SignalReceivedData *data = user_data; + g_main_loop_quit (data->loop); +} + +static gboolean +on_signal_received_timeout (gpointer user_data) +{ + SignalReceivedData *data = user_data; + data->timed_out = TRUE; + g_main_loop_quit (data->loop); + return TRUE; +} + +gboolean +_g_assert_signal_received_run (gpointer object, + const gchar *signal_name) +{ + gulong handler_id; + guint timeout_id; + SignalReceivedData data; + + data.loop = g_main_loop_new (NULL, FALSE); + data.timed_out = FALSE; + handler_id = g_signal_connect_swapped (object, + signal_name, + G_CALLBACK (on_signal_received), + &data); + timeout_id = g_timeout_add (30 * 1000, + on_signal_received_timeout, + &data); + g_main_loop_run (data.loop); + g_signal_handler_disconnect (object, handler_id); + g_source_remove (timeout_id); + g_main_loop_unref (data.loop); + + return data.timed_out; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +GDBusConnection * +_g_bus_get_priv (GBusType bus_type, + GCancellable *cancellable, + GError **error) +{ + gchar *address; + GDBusConnection *ret; + + ret = NULL; + + address = g_dbus_address_get_for_bus_sync (bus_type, cancellable, error); + if (address == NULL) + goto out; + + ret = g_dbus_connection_new_for_address_sync (address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | + G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, + NULL, /* GDBusAuthObserver */ + cancellable, + error); + g_free (address); + + out: + return ret; +} + +/* ---------------------------------------------------------------------------------------------------- */ + +#if 1 +/* toggle refs are not easy to use (maybe not even safe) when multiple + * threads are involved so implement this by busy-waiting for now + */ +gboolean +_g_object_wait_for_single_ref_do (gpointer object) +{ + guint num_ms_elapsed; + gboolean timed_out; + + timed_out = FALSE; + num_ms_elapsed = 0; + + while (TRUE) + { + if (G_OBJECT (object)->ref_count == 1) + goto out; + + if (num_ms_elapsed > 30000) + { + timed_out = TRUE; + goto out; + } + + usleep (10 * 1000); + num_ms_elapsed += 10; + } + + out: + return timed_out; +} + +#else + +typedef struct +{ + GMainLoop *loop; + gboolean timed_out; +} WaitSingleRefData; + +static gboolean +on_wait_single_ref_timeout (gpointer user_data) +{ + WaitSingleRefData *data = user_data; + data->timed_out = TRUE; + g_main_loop_quit (data->loop); + return TRUE; +} + +static void +on_wait_for_single_ref_toggled (gpointer user_data, + GObject *object, + gboolean is_last_ref) +{ + WaitSingleRefData *data = user_data; + g_main_loop_quit (data->loop); +} + +gboolean +_g_object_wait_for_single_ref_do (gpointer object) +{ + WaitSingleRefData data; + guint timeout_id; + + data.timed_out = FALSE; + + if (G_OBJECT (object)->ref_count == 1) + goto out; + + data.loop = g_main_loop_new (NULL, FALSE); + timeout_id = g_timeout_add (30 * 1000, + on_wait_single_ref_timeout, + &data); + + g_object_add_toggle_ref (G_OBJECT (object), + on_wait_for_single_ref_toggled, + &data); + /* the reference could have been removed between us checking the + * ref_count and the toggle ref being added + */ + if (G_OBJECT (object)->ref_count == 2) + goto single_ref_already; + + g_object_unref (object); + g_main_loop_run (data.loop); + g_object_ref (object); + +single_ref_already: + g_object_remove_toggle_ref (object, + on_wait_for_single_ref_toggled, + &data); + + g_source_remove (timeout_id); + g_main_loop_unref (data.loop); + + out: + if (data.timed_out) + { + g_printerr ("b ref_count is %d\n", G_OBJECT (object)->ref_count); + } + return data.timed_out; +} +#endif + +/* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/tests/gdbus-tests.h b/gio/tests/gdbus-tests.h new file mode 100644 index 0000000..ffcc57c --- /dev/null +++ b/gio/tests/gdbus-tests.h @@ -0,0 +1,146 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2009 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#ifndef __TESTS_H__ +#define __TESTS_H__ + +#include +#include "gdbus-sessionbus.h" + +G_BEGIN_DECLS + +/* TODO: clean up and move to gtestutils.c + * + * This is needed because libdbus-1 does not give predictable error messages - e.g. you + * get a different error message on connecting to a bus if the socket file is there vs + * if the socket file is missing. + */ + +#define _g_assert_error_domain(err, dom) do { if (!err || (err)->domain != dom) \ + g_assertion_message_error (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + #err, err, dom, -1); } while (0) + +#define _g_assert_property_notify(object, property_name) \ + do \ + { \ + if (!G_IS_OBJECT (object)) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Not a GObject instance"); \ + } \ + if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), \ + property_name) == NULL) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Property " property_name " does not " \ + "exist on object"); \ + } \ + if (_g_assert_property_notify_run (object, property_name)) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Timed out waiting for notification " \ + "on property " property_name); \ + } \ + } \ + while (FALSE) + +#define _g_assert_signal_received(object, signal_name) \ + do \ + { \ + if (!G_IS_OBJECT (object)) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Not a GObject instance"); \ + } \ + if (g_signal_lookup (signal_name, \ + G_TYPE_FROM_INSTANCE (object)) == 0) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Signal `" signal_name "' does not " \ + "exist on object"); \ + } \ + if (_g_assert_signal_received_run (object, signal_name)) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Timed out waiting for signal `" \ + signal_name "'"); \ + } \ + } \ + while (FALSE) + +gboolean _g_assert_property_notify_run (gpointer object, + const gchar *property_name); + + +gboolean _g_assert_signal_received_run (gpointer object, + const gchar *signal_name); + +GDBusConnection *_g_bus_get_priv (GBusType bus_type, + GCancellable *cancellable, + GError **error); + + +#define _g_object_wait_for_single_ref(object) \ + do \ + { \ + if (!G_IS_OBJECT (object)) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Not a GObject instance"); \ + } \ + if (_g_object_wait_for_single_ref_do (object)) \ + { \ + g_assertion_message (G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "Timed out waiting for single ref"); \ + } \ + } \ + while (FALSE) + +gboolean _g_object_wait_for_single_ref_do (gpointer object); + +G_END_DECLS + +#endif /* __TESTS_H__ */ diff --git a/gio/tests/gdbus-testserver.py b/gio/tests/gdbus-testserver.py new file mode 100755 index 0000000..f7be13e --- /dev/null +++ b/gio/tests/gdbus-testserver.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python + +import gobject +import time + +import dbus +import dbus.service +import dbus.mainloop.glib + +class TestException(dbus.DBusException): + _dbus_error_name = 'com.example.TestException' + + +class TestService(dbus.service.Object): + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='s', out_signature='s') + def HelloWorld(self, hello_message): + if str(hello_message) == 'Yo': + raise TestException('Yo is not a proper greeting') + else: + return "You greeted me with '%s'. Thanks!"%(str(hello_message)) + + @dbus.service.method("com.example.Frob", + in_signature='ss', out_signature='ss') + def DoubleHelloWorld(self, hello1, hello2): + return ("You greeted me with '%s'. Thanks!"%(str(hello1)), "Yo dawg, you uttered '%s'. Thanks!"%(str(hello2))) + + @dbus.service.method("com.example.Frob", + in_signature='', out_signature='su') + def PairReturn(self): + return ("foo", 42) + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='ybnqiuxtdsog', out_signature='ybnqiuxtdsog') + def TestPrimitiveTypes(self, val_byte, val_boolean, val_int16, val_uint16, val_int32, val_uint32, val_int64, val_uint64, val_double, val_string, val_objpath, val_signature): + return val_byte + 1, not val_boolean, val_int16 + 1, val_uint16 + 1, val_int32 + 1, val_uint32 + 1, val_int64 + 1, val_uint64 + 1, -val_double + 0.123, val_string * 2, val_objpath + "/modified", val_signature * 2 + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='ayabanaqaiauaxatad', out_signature='ayabanaqaiauaxatad') + def TestArrayOfPrimitiveTypes(self, val_byte, val_boolean, val_int16, val_uint16, val_int32, val_uint32, val_int64, val_uint64, val_double): + return val_byte*2, val_boolean*2, val_int16*2, val_uint16*2, val_int32*2, val_uint32*2, val_int64*2, val_uint64*2, val_double*2 + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='asaoag', out_signature='asaoag') + def TestArrayOfStringTypes(self, val_string, val_objpath, val_signature): + return val_string * 2, val_objpath * 2, val_signature * 2 + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature = 'a{yy}a{bb}a{nn}a{qq}a{ii}a{uu}a{xx}a{tt}a{dd}a{ss}a{oo}a{gg}', + out_signature = 'a{yy}a{bb}a{nn}a{qq}a{ii}a{uu}a{xx}a{tt}a{dd}a{ss}a{oo}a{gg}') + def TestHashTables(self, hyy, hbb, hnn, hqq, hii, huu, hxx, htt, hdd, hss, hoo, hgg): + + ret_hyy = {} + for i in hyy: + ret_hyy[i*2] = (hyy[i]*3) & 255 + + ret_hbb = {} + for i in hbb: + ret_hbb[i] = True + + ret_hnn = {} + for i in hnn: + ret_hnn[i*2] = hnn[i]*3 + + ret_hqq = {} + for i in hqq: + ret_hqq[i*2] = hqq[i]*3 + + ret_hii = {} + for i in hii: + ret_hii[i*2] = hii[i]*3 + + ret_huu = {} + for i in huu: + ret_huu[i*2] = huu[i]*3 + + ret_hxx = {} + for i in hxx: + ret_hxx[i + 2] = hxx[i] + 1 + + ret_htt = {} + for i in htt: + ret_htt[i + 2] = htt[i] + 1 + + ret_hdd = {} + for i in hdd: + ret_hdd[i + 2.5] = hdd[i] + 5.0 + + ret_hss = {} + for i in hss: + ret_hss[i + "mod"] = hss[i]*2 + + ret_hoo = {} + for i in hoo: + ret_hoo[i + "/mod"] = hoo[i] + "/mod2" + + ret_hgg = {} + for i in hgg: + ret_hgg[i + "assgit"] = hgg[i]*2 + + return ret_hyy, ret_hbb, ret_hnn, ret_hqq, ret_hii, ret_huu, ret_hxx, ret_htt, ret_hdd, ret_hss, ret_hoo, ret_hgg + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='(ii)(s(ii)aya{ss})', out_signature='(ii)(s(ii)aya{ss})') + def TestStructureTypes(self, s1, s2): + (x, y) = s1; + (desc, (x1, y1), ay, hss) = s2; + ret_hss = {} + for i in hss: + ret_hss[i] = hss[i] + " ... in bed!" + return (x + 1, y + 1), (desc + " ... in bed!", (x1 + 2, y1 + 2), ay * 2, ret_hss) + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='vb', out_signature='v') + def TestVariant(self, v, modify): + + if modify: + if type(v)==dbus.Boolean: + ret = False + elif type(v)==dbus.Dictionary: + ret = {} + for i in v: + ret[i] = v[i] * 2 + elif type(v)==dbus.Struct: + ret = ["other struct", dbus.Int16(100)] + else: + ret = v * 2 + else: + ret = v + return (type(v))(ret) + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='a(ii)aa(ii)aasaa{ss}aayavaav', out_signature='a(ii)aa(ii)aasaa{ss}aayavaav') + def TestComplexArrays(self, aii, aaii, aas, ahashes, aay, av, aav): + return aii * 2, aaii * 2, aas * 2, ahashes * 2, aay * 2, av *2, aav * 2 + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='a{s(ii)}a{sv}a{sav}a{saav}a{sa(ii)}a{sa{ss}}', + out_signature='a{s(ii)}a{sv}a{sav}a{saav}a{sa(ii)}a{sa{ss}}') + def TestComplexHashTables(self, h_str_to_pair, h_str_to_variant, h_str_to_av, h_str_to_aav, + h_str_to_array_of_pairs, hash_of_hashes): + + ret_h_str_to_pair = {} + for i in h_str_to_pair: + ret_h_str_to_pair[i + "_baz"] = h_str_to_pair[i] + + ret_h_str_to_variant = {} + for i in h_str_to_variant: + ret_h_str_to_variant[i + "_baz"] = h_str_to_variant[i] + + return ret_h_str_to_pair, ret_h_str_to_variant, h_str_to_av, h_str_to_aav, h_str_to_array_of_pairs, hash_of_hashes + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='', out_signature='') + def Quit(self): + mainloop.quit() + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='sv', out_signature='') + def FrobSetProperty(self, prop_name, prop_value): + self.frob_props[prop_name] = prop_value + message = dbus.lowlevel.SignalMessage("/com/example/TestObject", + "org.freedesktop.DBus.Properties", + "PropertiesChanged") + message.append("com.example.Frob") + message.append({prop_name : prop_value}) + message.append([], signature="as") + session_bus.send_message(message) + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", + in_signature='', out_signature='') + def FrobInvalidateProperty(self): + self.frob_props["PropertyThatWillBeInvalidated"] = "OMGInvalidated" + message = dbus.lowlevel.SignalMessage("/com/example/TestObject", + "org.freedesktop.DBus.Properties", + "PropertiesChanged") + message.append("com.example.Frob") + message.append({}, signature="a{sv}") + message.append(["PropertyThatWillBeInvalidated"]) + session_bus.send_message(message) + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.signal("com.example.Frob", + signature="sov") + def TestSignal(self, str1, objpath1, variant1): + pass + + @dbus.service.method("com.example.Frob", + in_signature='so', out_signature='') + def EmitSignal(self, str1, objpath1): + self.TestSignal (str1 + " .. in bed!", objpath1 + "/in/bed", "a variant") + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("com.example.Frob", in_signature='i', out_signature='', + async_callbacks=('return_cb', 'raise_cb')) + def Sleep(self, msec, return_cb, raise_cb): + def return_from_async_wait(): + return_cb() + return False + gobject.timeout_add(msec, return_from_async_wait) + + # ---------------------------------------------------------------------------------------------------- + + @dbus.service.method("org.freedesktop.DBus.Properties", + in_signature = 'ss', + out_signature = 'v') + def Get(self, interface_name, property_name): + + if interface_name == "com.example.Frob": + return self.frob_props[property_name] + else: + raise TestException("No such interface " + interface_name) + + @dbus.service.method("org.freedesktop.DBus.Properties", + in_signature = 's', + out_signature = 'a{sv}') + def GetAll(self, interface_name): + if interface_name == "com.example.Frob": + return self.frob_props + else: + raise TestException("No such interface " + interface_name) + +if __name__ == '__main__': + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + + session_bus = dbus.SessionBus() + name = dbus.service.BusName("com.example.TestService", session_bus) + + obj = TestService(session_bus, '/com/example/TestObject') + + #print "Our unique name is %s"%(session_bus.get_unique_name()) + + obj.frob_props = {} + obj.frob_props["y"] = dbus.Byte(1) + obj.frob_props["b"] = dbus.Boolean(True) + obj.frob_props["n"] = dbus.Int16(2) + obj.frob_props["q"] = dbus.UInt16(3) + obj.frob_props["i"] = dbus.Int32(4) + obj.frob_props["u"] = dbus.UInt32(5) + obj.frob_props["x"] = dbus.Int64(6) + obj.frob_props["t"] = dbus.UInt64(7) + obj.frob_props["d"] = dbus.Double(7.5) + obj.frob_props["s"] = dbus.String("a string") + obj.frob_props["o"] = dbus.ObjectPath("/some/path") + obj.frob_props["ay"] = [dbus.Byte(1), dbus.Byte(11)] + obj.frob_props["ab"] = [dbus.Boolean(True), dbus.Boolean(False)] + obj.frob_props["an"] = [dbus.Int16(2), dbus.Int16(12)] + obj.frob_props["aq"] = [dbus.UInt16(3), dbus.UInt16(13)] + obj.frob_props["ai"] = [dbus.Int32(4), dbus.Int32(14)] + obj.frob_props["au"] = [dbus.UInt32(5), dbus.UInt32(15)] + obj.frob_props["ax"] = [dbus.Int64(6), dbus.Int64(16)] + obj.frob_props["at"] = [dbus.UInt64(7), dbus.UInt64(17)] + obj.frob_props["ad"] = [dbus.Double(7.5), dbus.Double(17.5)] + obj.frob_props["as"] = [dbus.String("a string"), dbus.String("another string")] + obj.frob_props["ao"] = [dbus.ObjectPath("/some/path"), dbus.ObjectPath("/another/path")] + obj.frob_props["foo"] = "a frobbed string" + obj.frob_props["PropertyThatWillBeInvalidated"] = "InitialValue" + + mainloop = gobject.MainLoop() + mainloop.run() diff --git a/gio/tests/gdbus-threading.c b/gio/tests/gdbus-threading.c new file mode 100644 index 0000000..0700ad3 --- /dev/null +++ b/gio/tests/gdbus-threading.c @@ -0,0 +1,539 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include +#include +#include + +#include "gdbus-tests.h" + +/* all tests rely on a global connection */ +static GDBusConnection *c = NULL; + +/* all tests rely on a shared mainloop */ +static GMainLoop *loop = NULL; + +/* ---------------------------------------------------------------------------------------------------- */ +/* Ensure that signal and method replies are delivered in the right thread */ +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct { + GThread *thread; + GMainLoop *thread_loop; + guint signal_count; +} DeliveryData; + +static void +msg_cb_expect_success (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + DeliveryData *data = user_data; + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_variant_unref (result); + + g_assert (g_thread_self () == data->thread); + + g_main_loop_quit (data->thread_loop); +} + +static void +msg_cb_expect_error_cancelled (GDBusConnection *connection, + GAsyncResult *res, + gpointer user_data) +{ + DeliveryData *data = user_data; + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_connection_call_finish (connection, + res, + &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_assert (!g_dbus_error_is_remote_error (error)); + g_error_free (error); + g_assert (result == NULL); + + g_assert (g_thread_self () == data->thread); + + g_main_loop_quit (data->thread_loop); +} + +static void +signal_handler (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + DeliveryData *data = user_data; + + g_assert (g_thread_self () == data->thread); + + data->signal_count++; + + g_main_loop_quit (data->thread_loop); +} + +static gpointer +test_delivery_in_thread_func (gpointer _data) +{ + GMainLoop *thread_loop; + GMainContext *thread_context; + DeliveryData data; + GCancellable *ca; + guint subscription_id; + GDBusConnection *priv_c; + GError *error; + + error = NULL; + + thread_context = g_main_context_new (); + thread_loop = g_main_loop_new (thread_context, FALSE); + g_main_context_push_thread_default (thread_context); + + data.thread = g_thread_self (); + data.thread_loop = thread_loop; + data.signal_count = 0; + + /* ---------------------------------------------------------------------------------------------------- */ + + /* + * Check that we get a reply to the GetId() method call. + */ + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) msg_cb_expect_success, + &data); + g_main_loop_run (thread_loop); + + /* + * Check that we never actually send a message if the GCancellable + * is already cancelled - i.e. we should get #G_IO_ERROR_CANCELLED + * when the actual connection is not up. + */ + ca = g_cancellable_new (); + g_cancellable_cancel (ca); + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + ca, + (GAsyncReadyCallback) msg_cb_expect_error_cancelled, + &data); + g_main_loop_run (thread_loop); + g_object_unref (ca); + + /* + * Check that cancellation works when the message is already in flight. + */ + ca = g_cancellable_new (); + g_dbus_connection_call (c, + "org.freedesktop.DBus", /* bus_name */ + "/org/freedesktop/DBus", /* object path */ + "org.freedesktop.DBus", /* interface name */ + "GetId", /* method name */ + NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + ca, + (GAsyncReadyCallback) msg_cb_expect_error_cancelled, + &data); + g_cancellable_cancel (ca); + g_main_loop_run (thread_loop); + g_object_unref (ca); + + /* + * Check that signals are delivered to the correct thread. + * + * First we subscribe to the signal, then we create a a private + * connection. This should cause a NameOwnerChanged message from + * the message bus. + */ + subscription_id = g_dbus_connection_signal_subscribe (c, + "org.freedesktop.DBus", /* sender */ + "org.freedesktop.DBus", /* interface */ + "NameOwnerChanged", /* member */ + "/org/freedesktop/DBus", /* path */ + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + signal_handler, + &data, + NULL); + g_assert (subscription_id != 0); + g_assert (data.signal_count == 0); + + priv_c = _g_bus_get_priv (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (priv_c != NULL); + + g_main_loop_run (thread_loop); + g_assert (data.signal_count == 1); + + g_object_unref (priv_c); + + g_dbus_connection_signal_unsubscribe (c, subscription_id); + + /* ---------------------------------------------------------------------------------------------------- */ + + g_main_context_pop_thread_default (thread_context); + g_main_loop_unref (thread_loop); + g_main_context_unref (thread_context); + + g_main_loop_quit (loop); + + return NULL; +} + +static void +test_delivery_in_thread (void) +{ + GError *error; + GThread *thread; + + error = NULL; + thread = g_thread_create (test_delivery_in_thread_func, + NULL, + TRUE, + &error); + g_assert_no_error (error); + g_assert (thread != NULL); + + /* run the event loop - it is needed to dispatch D-Bus messages */ + g_main_loop_run (loop); + + g_thread_join (thread); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +typedef struct { + GDBusProxy *proxy; + gint msec; + guint num; + gboolean async; + + GMainLoop *thread_loop; + GThread *thread; + + gboolean done; +} SyncThreadData; + +static void +sleep_cb (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + SyncThreadData *data = user_data; + GError *error; + GVariant *result; + + error = NULL; + result = g_dbus_proxy_call_finish (proxy, + res, + &error); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + + g_assert (data->thread == g_thread_self ()); + + g_main_loop_quit (data->thread_loop); + + //g_debug ("async cb (%p)", g_thread_self ()); +} + +static gpointer +test_sleep_in_thread_func (gpointer _data) +{ + SyncThreadData *data = _data; + GMainContext *thread_context; + guint n; + + thread_context = g_main_context_new (); + data->thread_loop = g_main_loop_new (thread_context, FALSE); + g_main_context_push_thread_default (thread_context); + + data->thread = g_thread_self (); + + for (n = 0; n < data->num; n++) + { + if (data->async) + { + //g_debug ("invoking async (%p)", g_thread_self ()); + g_dbus_proxy_call (data->proxy, + "Sleep", + g_variant_new ("(i)", data->msec), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + (GAsyncReadyCallback) sleep_cb, + data); + g_main_loop_run (data->thread_loop); + g_print ("A"); + //g_debug ("done invoking async (%p)", g_thread_self ()); + } + else + { + GError *error; + GVariant *result; + + error = NULL; + //g_debug ("invoking sync (%p)", g_thread_self ()); + result = g_dbus_proxy_call_sync (data->proxy, + "Sleep", + g_variant_new ("(i)", data->msec), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + g_print ("S"); + //g_debug ("done invoking sync (%p)", g_thread_self ()); + g_assert_no_error (error); + g_assert (result != NULL); + g_assert_cmpstr (g_variant_get_type_string (result), ==, "()"); + g_variant_unref (result); + } + } + + g_main_context_pop_thread_default (thread_context); + g_main_loop_unref (data->thread_loop); + g_main_context_unref (thread_context); + + data->done = TRUE; + g_main_loop_quit (loop); + + return NULL; +} + +static void +test_method_calls_on_proxy (GDBusProxy *proxy) +{ + guint n; + + /* + * Check that multiple threads can do calls without interferring with + * each other. We do this by creating three threads that call the + * Sleep() method on the server (which handles it asynchronously, e.g. + * it won't block other requests) with different sleep durations and + * a number of times. We do this so each set of calls add up to 4000 + * milliseconds. + * + * The dbus test server that this code calls into uses glib timeouts + * to do the sleeping which have only a granularity of 1ms. It is + * therefore possible to lose as much as 40ms; the test could finish + * in slightly less than 4 seconds. + * + * We run this test twice - first with async calls in each thread, then + * again with sync calls + */ + + for (n = 0; n < 2; n++) + { + gboolean do_async; + GThread *thread1; + GThread *thread2; + GThread *thread3; + SyncThreadData data1; + SyncThreadData data2; + SyncThreadData data3; + GError *error; + GTimeVal start_time; + GTimeVal end_time; + guint elapsed_msec; + + error = NULL; + do_async = (n == 0); + + g_get_current_time (&start_time); + + data1.proxy = proxy; + data1.msec = 40; + data1.num = 100; + data1.async = do_async; + data1.done = FALSE; + thread1 = g_thread_create (test_sleep_in_thread_func, + &data1, + TRUE, + &error); + g_assert_no_error (error); + g_assert (thread1 != NULL); + + data2.proxy = proxy; + data2.msec = 20; + data2.num = 200; + data2.async = do_async; + data2.done = FALSE; + thread2 = g_thread_create (test_sleep_in_thread_func, + &data2, + TRUE, + &error); + g_assert_no_error (error); + g_assert (thread2 != NULL); + + data3.proxy = proxy; + data3.msec = 100; + data3.num = 40; + data3.async = do_async; + data3.done = FALSE; + thread3 = g_thread_create (test_sleep_in_thread_func, + &data3, + TRUE, + &error); + g_assert_no_error (error); + g_assert (thread3 != NULL); + + /* we handle messages in the main loop - threads will quit it when they are done */ + while (!(data1.done && data2.done && data3.done)) + g_main_loop_run (loop); + + g_thread_join (thread1); + g_thread_join (thread2); + g_thread_join (thread3); + + g_get_current_time (&end_time); + + elapsed_msec = ((end_time.tv_sec * G_USEC_PER_SEC + end_time.tv_usec) - + (start_time.tv_sec * G_USEC_PER_SEC + start_time.tv_usec)) / 1000; + + //g_debug ("Elapsed time for %s = %d msec", n == 0 ? "async" : "sync", elapsed_msec); + + /* elapsed_msec should be 4000 msec +/- change for overhead/inaccuracy */ + g_assert_cmpint (elapsed_msec, >=, 3950); + g_assert_cmpint (elapsed_msec, <, 6000); + + g_print (" "); + } + + g_main_loop_quit (loop); +} + +static void +test_method_calls_in_thread (void) +{ + GDBusProxy *proxy; + GDBusConnection *connection; + GError *error; + gchar *name_owner; + + error = NULL; + connection = g_bus_get_sync (G_BUS_TYPE_SESSION, + NULL, + &error); + g_assert_no_error (error); + error = NULL; + proxy = g_dbus_proxy_new_sync (connection, + G_DBUS_PROXY_FLAGS_NONE, + NULL, /* GDBusInterfaceInfo */ + "com.example.TestService", /* name */ + "/com/example/TestObject", /* object path */ + "com.example.Frob", /* interface */ + NULL, /* GCancellable */ + &error); + g_assert_no_error (error); + + name_owner = g_dbus_proxy_get_name_owner (proxy); + g_assert_cmpstr (name_owner, !=, NULL); + g_free (name_owner); + + test_method_calls_on_proxy (proxy); + + g_object_unref (proxy); + g_object_unref (connection); +} + +/* ---------------------------------------------------------------------------------------------------- */ + +int +main (int argc, + char *argv[]) +{ + GError *error; + gint ret; + + g_type_init (); + g_thread_init (NULL); + g_test_init (&argc, &argv, NULL); + + /* all the tests rely on a shared main loop */ + loop = g_main_loop_new (NULL, FALSE); + + /* all the tests use a session bus with a well-known address that we can bring up and down + * using session_bus_up() and session_bus_down(). + */ + g_unsetenv ("DISPLAY"); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE); + + session_bus_up (); + + /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return + * until one can connect to the bus but that's not how things work right now + */ + usleep (500 * 1000); + + /* this is safe; testserver will exit once the bus goes away */ + g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL)); + + /* wait for the service to come up */ + usleep (500 * 1000); + + /* Create the connection in the main thread */ + error = NULL; + c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + g_assert (c != NULL); + + g_test_add_func ("/gdbus/delivery-in-thread", test_delivery_in_thread); + g_test_add_func ("/gdbus/method-calls-in-thread", test_method_calls_in_thread); + + ret = g_test_run(); + + g_object_unref (c); + + /* tear down bus */ + session_bus_down (); + + return ret; +} diff --git a/gio/tests/gschema-compile.c b/gio/tests/gschema-compile.c new file mode 100644 index 0000000..2ffa85b --- /dev/null +++ b/gio/tests/gschema-compile.c @@ -0,0 +1,143 @@ +#include +#include +#include +#include +#include +#include + +typedef struct { + const gchar *name; + const gchar *opt; + const gchar *err; +} SchemaTest; + +static void +test_schema (gpointer data) +{ + SchemaTest *test = (SchemaTest *) data; + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + gchar *filename = g_strconcat (test->name, ".gschema.xml", NULL); + gchar *path = g_build_filename (SRCDIR, "schema-tests", filename, NULL); + gchar *argv[] = { + "../glib-compile-schemas", + "--strict", + "--dry-run", + "--schema-file", path, + (gchar *)test->opt, + NULL + }; + gchar *envp[] = { NULL }; + execve (argv[0], argv, envp); + g_free (filename); + g_free (path); + } + if (test->err) + { + g_test_trap_assert_failed (); + g_test_trap_assert_stderr (test->err); + } + else + g_test_trap_assert_passed(); +} + +static const SchemaTest tests[] = { + { "no-default", NULL, "* is required in *" }, + { "missing-quotes", NULL, "*unknown keyword*" }, + { "incomplete-list", NULL, "*to follow array element*" }, + { "wrong-category", NULL, "*unsupported l10n category*" }, + { "bad-type", NULL, "*invalid GVariant type string*" }, + { "overflow", NULL, "*out of range*" }, + { "range-wrong-type", NULL, "* not allowed for keys of type*" }, + { "range-missing-min", NULL, "*element 'range' requires attribute 'min'*" }, + { "range-missing-max", NULL, "*element 'range' requires attribute 'max'*" }, + { "default-out-of-range", NULL, "* is not contained in the specified range*" }, + { "choices-wrong-type", NULL, "* not allowed for keys of type*" }, + { "choice-missing-value", NULL, "*element 'choice' requires attribute 'value'*" }, + { "default-not-in-choices", NULL, "* contains string not in *" }, + { "array-default-not-in-choices", NULL, "* contains string not in *" }, + { "bad-key", NULL, "*invalid name*" }, + { "invalid-path", NULL, "*must begin and end with a slash*" }, + { "bad-key", "--allow-any-name", NULL }, + { "bad-key2", NULL, "*invalid name*" }, + { "bad-key2", "--allow-any-name", NULL }, + { "bad-key3", NULL, "*invalid name*" }, + { "bad-key3", "--allow-any-name", NULL }, + { "bad-key4", NULL, "*invalid name*" }, + { "bad-key4", "--allow-any-name", NULL }, + { "empty-key", NULL, "*empty names*" }, + { "empty-key", "--allow-any-name", "*empty names*" }, + { "enum", NULL, NULL }, + { "enum-with-aliases", NULL, NULL }, + { "enum-with-invalid-alias", NULL, "*'banger' is not in enumerated type*" }, + { "enum-with-repeated-alias", NULL, "* already specified*" }, + { "enum-with-repeated-nick", NULL, "* already specified*" }, + { "enum-with-repeated-value", NULL, "*value='1' already specified*" }, + { "enum-with-chained-alias", NULL, "*'sausages' is not in enumerated type*" }, + { "enum-with-shadow-alias", NULL, "*'mash' is already a member of the enum*" }, + { "enum-with-choice", NULL, "* can not be specified*" }, + { "enum-with-bad-default", NULL, "* is not a valid member*" }, + { "choice", NULL, NULL }, + { "choice-upside-down", NULL, NULL }, + { "bad-choice", NULL, "* contains string not in *" }, + { "choice-bad", NULL, "* contains string not in *" }, + { "choice-badtype", NULL, "* not allowed for keys of type 'i'*" }, + { "bare-alias", NULL, "*enumerated or flags types or after *" }, + { "choice-alias", NULL, NULL }, + { "default-in-aliases", NULL, "* contains string not in *" }, + { "choice-invalid-alias", NULL, "*'befor' is not in *" }, + { "choice-shadowed-alias", NULL, "*given when was already*" }, + { "range", NULL, NULL }, + { "range-badtype", NULL, "* not allowed for keys of type 's'*" }, + { "range-low-default", NULL, "* is not contained in the specified range*" }, + { "range-high-default", NULL, "* is not contained in the specified range*" }, + { "range-default-low", NULL, "* is not contained in the specified range*" }, + { "range-default-high", NULL, "* is not contained in the specified range*" }, + { "range-parse-error", NULL, "*invalid character in number*" }, + { "from-docs", NULL, NULL }, + { "extending", NULL, NULL }, + { "extend-missing", NULL, "*extends not yet existing schema*" }, + { "extend-nonlist", NULL, "*which is not a list*" }, + { "extend-self", NULL, "*not yet existing*" }, + { "extend-wrong-list-indirect", NULL, "*'y' does not extend 'x'*" }, + { "extend-wrong-list", NULL, "*'y' does not extend 'x'*" }, + { "key-in-list-indirect", NULL, "*can not add keys to a 'list*" }, + { "key-in-list", NULL, "*can not add keys to a 'list*" }, + { "list-of-missing", NULL, "*is list of not yet existing schema*" }, + { "extend-and-shadow", NULL, "*shadows*use *" }, + { "extend-and-shadow-indirect", NULL, "*shadows*use *" }, + { "override", NULL, NULL }, + { "override-missing", NULL, "*no to override*" }, + { "override-range-error", NULL, "* is not contained in the specified range*"}, + { "override-then-key", NULL, "*shadows in *" }, + { "override-twice", NULL, "* already specified*" }, + { "override-type-error", NULL, "*invalid character in number*" }, + { "flags-aliased-default", NULL, "* * not in the specified flags type*" }, + { "flags-bad-default", NULL, "* * not in the specified flags type*" }, + { "flags-more-than-one-bit", NULL, "*flags values must have at most 1 bit set*" }, + { "flags-with-enum-attr", NULL, "* not (yet) defined*" }, + { "flags-with-enum-tag", NULL, "* not (yet) defined*" }, + { "inherit-gettext-domain", NULL, NULL } +}; + + +int +main (int argc, char *argv[]) +{ + guint i; + + setlocale (LC_ALL, ""); + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + for (i = 0; i < G_N_ELEMENTS (tests); ++i) + { + gchar *name = g_strdup_printf ("/gschema/%s%s", tests[i].name, tests[i].opt ? "/opt" : ""); + g_test_add_data_func (name, &tests[i], (gpointer) test_schema); + g_free (name); + } + + return g_test_run (); +} diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c new file mode 100644 index 0000000..b2f9d4f --- /dev/null +++ b/gio/tests/gsettings.c @@ -0,0 +1,1978 @@ +#include +#include +#include +#include +#include +#define G_SETTINGS_ENABLE_BACKEND +#include + +#include "testenum.h" + +static gboolean backend_set; + +/* These tests rely on the schemas in org.gtk.test.gschema.xml + * to be compiled and installed in the same directory. + */ + +static void +check_and_free (GVariant *value, + const gchar *expected) +{ + gchar *printed; + + printed = g_variant_print (value, TRUE); + g_assert_cmpstr (printed, ==, expected); + g_free (printed); + + g_variant_unref (value); +} + + +/* Just to get warmed up: Read and set a string, and + * verify that can read the changed string back + */ +static void +test_basic (void) +{ + gchar *str = NULL; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test"); + + g_object_get (settings, "schema", &str, NULL); + g_assert_cmpstr (str, ==, "org.gtk.test"); + g_free (str); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "Hello, earthlings"); + g_free (str); + + g_settings_set (settings, "greeting", "s", "goodbye world"); + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "goodbye world"); + g_free (str); + str = NULL; + + if (!backend_set) + { + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + settings = g_settings_new ("org.gtk.test"); + g_settings_set (settings, "greeting", "i", 555); + abort (); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*g_settings_set_value*expects type*"); + } + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "goodbye world"); + g_free (str); + str = NULL; + + g_settings_reset (settings, "greeting"); + str = g_settings_get_string (settings, "greeting"); + g_assert_cmpstr (str, ==, "Hello, earthlings"); + g_free (str); + + g_settings_set (settings, "greeting", "s", "this is the end"); + g_object_unref (settings); +} + +/* Check that we get an error when getting a key + * that is not in the schema + */ +static void +test_unknown_key (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + GSettings *settings; + GVariant *value; + + settings = g_settings_new ("org.gtk.test"); + value = g_settings_get_value (settings, "no_such_key"); + + g_assert (value == NULL); + + g_object_unref (settings); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*does not contain*"); +} + +/* Check that we get an error when the schema + * has not been installed + */ +void +test_no_schema (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + GSettings *settings; + + settings = g_settings_new ("no.such.schema"); + + g_assert (settings == NULL); + } + + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*Settings schema 'no.such.schema' is not installed*"); +} + +/* Check that we get an error when passing a type string + * that does not match the schema + */ +static void +test_wrong_type (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + GSettings *settings; + gchar *str = NULL; + + settings = g_settings_new ("org.gtk.test"); + + g_settings_get (settings, "greeting", "o", &str); + + g_assert (str == NULL); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*CRITICAL*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + GSettings *settings; + + settings = g_settings_new ("org.gtk.test"); + + g_settings_set (settings, "greeting", "o", "/a/path"); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*CRITICAL*"); +} + +/* Check errors with explicit paths */ +static void +test_wrong_path (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + GSettings *settings; + + settings = g_settings_new_with_path ("org.gtk.test", "/wrong-path/"); + } + + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*but path * specified by schema*"); +} + +static void +test_no_path (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.no-path"); + } + + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*attempting to create schema * without a path**"); +} + + +/* Check that we can successfully read and set the full + * range of all basic types + */ +static void +test_basic_types (void) +{ + GSettings *settings; + gboolean b; + guint8 byte; + gint16 i16; + guint16 u16; + gint32 i32; + guint32 u32; + gint64 i64; + guint64 u64; + gdouble d; + gchar *str; + + settings = g_settings_new ("org.gtk.test.basic-types"); + + g_settings_get (settings, "test-boolean", "b", &b); + g_assert_cmpint (b, ==, 1); + + g_settings_set (settings, "test-boolean", "b", 0); + g_settings_get (settings, "test-boolean", "b", &b); + g_assert_cmpint (b, ==, 0); + + g_settings_get (settings, "test-byte", "y", &byte); + g_assert_cmpint (byte, ==, 25); + + g_settings_set (settings, "test-byte", "y", G_MAXUINT8); + g_settings_get (settings, "test-byte", "y", &byte); + g_assert_cmpint (byte, ==, G_MAXUINT8); + + g_settings_get (settings, "test-int16", "n", &i16); + g_assert_cmpint (i16, ==, -1234); + + g_settings_set (settings, "test-int16", "n", G_MININT16); + g_settings_get (settings, "test-int16", "n", &i16); + g_assert_cmpint (i16, ==, G_MININT16); + + g_settings_set (settings, "test-int16", "n", G_MAXINT16); + g_settings_get (settings, "test-int16", "n", &i16); + g_assert_cmpint (i16, ==, G_MAXINT16); + + g_settings_get (settings, "test-uint16", "q", &u16); + g_assert_cmpuint (u16, ==, 1234); + + g_settings_set (settings, "test-uint16", "q", G_MAXUINT16); + g_settings_get (settings, "test-uint16", "q", &u16); + g_assert_cmpuint (u16, ==, G_MAXUINT16); + + g_settings_get (settings, "test-int32", "i", &i32); + g_assert_cmpint (i32, ==, -123456); + + g_settings_set (settings, "test-int32", "i", G_MININT32); + g_settings_get (settings, "test-int32", "i", &i32); + g_assert_cmpint (i32, ==, G_MININT32); + + g_settings_set (settings, "test-int32", "i", G_MAXINT32); + g_settings_get (settings, "test-int32", "i", &i32); + g_assert_cmpint (i32, ==, G_MAXINT32); + + g_settings_get (settings, "test-uint32", "u", &u32); + g_assert_cmpuint (u32, ==, 123456); + + g_settings_set (settings, "test-uint32", "u", G_MAXUINT32); + g_settings_get (settings, "test-uint32", "u", &u32); + g_assert_cmpuint (u32, ==, G_MAXUINT32); + + g_settings_get (settings, "test-int64", "x", &i64); + g_assert_cmpuint (i64, ==, -123456789); + + g_settings_set (settings, "test-int64", "x", G_MININT64); + g_settings_get (settings, "test-int64", "x", &i64); + g_assert_cmpuint (i64, ==, G_MININT64); + + g_settings_set (settings, "test-int64", "x", G_MAXINT64); + g_settings_get (settings, "test-int64", "x", &i64); + g_assert_cmpuint (i64, ==, G_MAXINT64); + + g_settings_get (settings, "test-uint64", "t", &u64); + g_assert_cmpuint (u64, ==, 123456789); + + g_settings_set (settings, "test-uint64", "t", G_MAXUINT64); + g_settings_get (settings, "test-uint64", "t", &u64); + g_assert_cmpuint (u64, ==, G_MAXUINT64); + + g_settings_get (settings, "test-double", "d", &d); + g_assert_cmpfloat (d, ==, 123.456); + + g_settings_set (settings, "test-double", "d", G_MINDOUBLE); + g_settings_get (settings, "test-double", "d", &d); + g_assert_cmpfloat (d, ==, G_MINDOUBLE); + + g_settings_set (settings, "test-double", "d", G_MAXDOUBLE); + g_settings_get (settings, "test-double", "d", &d); + g_assert_cmpfloat (d, ==, G_MAXDOUBLE); + + g_settings_get (settings, "test-string", "s", &str); + g_assert_cmpstr (str, ==, "a string, it seems"); + g_free (str); + str = NULL; + + g_settings_get (settings, "test-objectpath", "o", &str); + g_assert_cmpstr (str, ==, "/a/object/path"); + g_object_unref (settings); + g_free (str); + str = NULL; +} + +/* Check that we can read an set complex types like + * tuples, arrays and dictionaries + */ +static void +test_complex_types (void) +{ + GSettings *settings; + gchar *s; + gint i1, i2; + GVariantIter *iter = NULL; + + settings = g_settings_new ("org.gtk.test.complex-types"); + + g_settings_get (settings, "test-tuple", "(s(ii))", &s, &i1, &i2); + g_assert_cmpstr (s, ==, "one"); + g_assert_cmpint (i1,==, 2); + g_assert_cmpint (i2,==, 3); + g_free (s) ; + s = NULL; + + g_settings_set (settings, "test-tuple", "(s(ii))", "none", 0, 0); + g_settings_get (settings, "test-tuple", "(s(ii))", &s, &i1, &i2); + g_assert_cmpstr (s, ==, "none"); + g_assert_cmpint (i1,==, 0); + g_assert_cmpint (i2,==, 0); + g_free (s); + s = NULL; + + g_settings_get (settings, "test-array", "ai", &iter); + g_assert_cmpint (g_variant_iter_n_children (iter), ==, 6); + g_assert (g_variant_iter_next (iter, "i", &i1)); + g_assert_cmpint (i1, ==, 0); + g_assert (g_variant_iter_next (iter, "i", &i1)); + g_assert_cmpint (i1, ==, 1); + g_assert (g_variant_iter_next (iter, "i", &i1)); + g_assert_cmpint (i1, ==, 2); + g_assert (g_variant_iter_next (iter, "i", &i1)); + g_assert_cmpint (i1, ==, 3); + g_assert (g_variant_iter_next (iter, "i", &i1)); + g_assert_cmpint (i1, ==, 4); + g_assert (g_variant_iter_next (iter, "i", &i1)); + g_assert_cmpint (i1, ==, 5); + g_assert (!g_variant_iter_next (iter, "i", &i1)); + g_variant_iter_free (iter); + + g_object_unref (settings); +} + +static gboolean changed_cb_called; + +static void +changed_cb (GSettings *settings, + const gchar *key, + gpointer data) +{ + changed_cb_called = TRUE; + + g_assert_cmpstr (key, ==, data); +} + +/* Test that basic change notification with the changed signal works. + */ +void +test_changes (void) +{ + GSettings *settings; + GSettings *settings2; + + settings = g_settings_new ("org.gtk.test"); + + g_signal_connect (settings, "changed", + G_CALLBACK (changed_cb), "greeting"); + + changed_cb_called = FALSE; + + g_settings_set (settings, "greeting", "s", "new greeting"); + g_assert (changed_cb_called); + + settings2 = g_settings_new ("org.gtk.test"); + + changed_cb_called = FALSE; + + g_settings_set (settings2, "greeting", "s", "hi"); + g_assert (changed_cb_called); + + g_object_unref (settings2); + g_object_unref (settings); +} + +static gboolean changed_cb_called2; + +static void +changed_cb2 (GSettings *settings, + const gchar *key, + gpointer data) +{ + gboolean *p = data; + + *p = TRUE; +} + +/* Test that changes done to a delay-mode instance + * don't appear to the outside world until apply. Also + * check that we get change notification when they are + * applied. + * Also test that the has-unapplied property is properly + * maintained. + */ +void +test_delay_apply (void) +{ + GSettings *settings; + GSettings *settings2; + gchar *str; + + settings = g_settings_new ("org.gtk.test"); + settings2 = g_settings_new ("org.gtk.test"); + + g_settings_set (settings2, "greeting", "s", "top o' the morning"); + + changed_cb_called = FALSE; + changed_cb_called2 = FALSE; + + g_signal_connect (settings, "changed", + G_CALLBACK (changed_cb2), &changed_cb_called); + g_signal_connect (settings2, "changed", + G_CALLBACK (changed_cb2), &changed_cb_called2); + + g_settings_delay (settings); + + g_settings_set (settings, "greeting", "s", "greetings from test_delay_apply"); + + g_assert (changed_cb_called); + g_assert (!changed_cb_called2); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_delay_apply"); + g_free (str); + str = NULL; + + g_settings_get (settings2, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "top o' the morning"); + g_free (str); + str = NULL; + + g_assert (g_settings_get_has_unapplied (settings)); + g_assert (!g_settings_get_has_unapplied (settings2)); + + changed_cb_called = FALSE; + changed_cb_called2 = FALSE; + + g_settings_apply (settings); + + g_assert (!changed_cb_called); + g_assert (changed_cb_called2); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_delay_apply"); + g_free (str); + str = NULL; + + g_settings_get (settings2, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_delay_apply"); + g_free (str); + str = NULL; + + g_assert (!g_settings_get_has_unapplied (settings)); + g_assert (!g_settings_get_has_unapplied (settings2)); + + g_object_unref (settings2); + g_object_unref (settings); +} + +/* Test that reverting unapplied changes in a delay-apply + * settings instance works. + */ +static void +test_delay_revert (void) +{ + GSettings *settings; + GSettings *settings2; + gchar *str; + + settings = g_settings_new ("org.gtk.test"); + settings2 = g_settings_new ("org.gtk.test"); + + g_settings_set (settings2, "greeting", "s", "top o' the morning"); + + g_settings_delay (settings); + + g_settings_set (settings, "greeting", "s", "greetings from test_delay_revert"); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_delay_revert"); + g_free (str); + str = NULL; + + g_settings_get (settings2, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "top o' the morning"); + g_free (str); + str = NULL; + + g_assert (g_settings_get_has_unapplied (settings)); + + g_settings_revert (settings); + + g_assert (!g_settings_get_has_unapplied (settings)); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "top o' the morning"); + g_free (str); + str = NULL; + + g_settings_get (settings2, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "top o' the morning"); + g_free (str); + str = NULL; + + g_object_unref (settings2); + g_object_unref (settings); +} + +static void +keys_changed_cb (GSettings *settings, + const GQuark *keys, + gint n_keys) +{ + gchar *str; + + g_assert_cmpint (n_keys, ==, 2); + + g_assert ((keys[0] == g_quark_from_static_string ("greeting") && + keys[1] == g_quark_from_static_string ("farewell")) || + (keys[1] == g_quark_from_static_string ("greeting") && + keys[0] == g_quark_from_static_string ("farewell"))); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_atomic"); + g_free (str); + str = NULL; + + g_settings_get (settings, "farewell", "s", &str); + g_assert_cmpstr (str, ==, "atomic bye-bye"); + g_free (str); + str = NULL; +} + +/* Check that delay-applied changes appear atomically. + * More specifically, verify that all changed keys appear + * with their new value while handling the change-event signal. + */ +static void +test_atomic (void) +{ + GSettings *settings; + GSettings *settings2; + gchar *str; + + settings = g_settings_new ("org.gtk.test"); + settings2 = g_settings_new ("org.gtk.test"); + + g_settings_set (settings2, "greeting", "s", "top o' the morning"); + + changed_cb_called = FALSE; + changed_cb_called2 = FALSE; + + g_signal_connect (settings2, "change-event", + G_CALLBACK (keys_changed_cb), NULL); + + g_settings_delay (settings); + + g_settings_set (settings, "greeting", "s", "greetings from test_atomic"); + g_settings_set (settings, "farewell", "s", "atomic bye-bye"); + + g_settings_apply (settings); + + g_settings_get (settings, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_atomic"); + g_free (str); + str = NULL; + + g_settings_get (settings, "farewell", "s", &str); + g_assert_cmpstr (str, ==, "atomic bye-bye"); + g_free (str); + str = NULL; + + g_settings_get (settings2, "greeting", "s", &str); + g_assert_cmpstr (str, ==, "greetings from test_atomic"); + g_free (str); + str = NULL; + + g_settings_get (settings2, "farewell", "s", &str); + g_assert_cmpstr (str, ==, "atomic bye-bye"); + g_free (str); + str = NULL; + + g_object_unref (settings2); + g_object_unref (settings); +} + +/* On Windows the interaction between the C library locale and libintl + * (from GNU gettext) is not like on POSIX, so just skip these tests + * for now. + * + * There are several issues: + * + * 1) The C library doesn't use LC_MESSAGES, that is implemented only + * in libintl (defined in its ). + * + * 2) The locale names that setlocale() accepts and returns aren't in + * the "de_DE" style, but like "German_Germany". + * + * 3) libintl looks at the Win32 thread locale and not the C library + * locale. (And even if libintl would use the C library's locale, as + * there are several alternative C library DLLs, libintl might be + * linked to a different one than the application code, so they + * wouldn't have the same C library locale anyway.) + */ + +/* Test that translations work for schema defaults. + * + * This test relies on the de.po file in the same directory + * to be compiled into ./de/LC_MESSAGES/test.mo + */ +static void +test_l10n (void) +{ + GSettings *settings; + gchar *str; + gchar *locale; + + bindtextdomain ("test", "."); + bind_textdomain_codeset ("test", "UTF-8"); + + locale = g_strdup (setlocale (LC_MESSAGES, NULL)); + + settings = g_settings_new ("org.gtk.test.localized"); + + setlocale (LC_MESSAGES, "C"); + str = g_settings_get_string (settings, "error-message"); + setlocale (LC_MESSAGES, locale); + + g_assert_cmpstr (str, ==, "Unnamed"); + g_free (str); + str = NULL; + + setlocale (LC_MESSAGES, "de_DE"); + str = g_settings_get_string (settings, "error-message"); + setlocale (LC_MESSAGES, locale); + + g_assert_cmpstr (str, ==, "Unbenannt"); + g_object_unref (settings); + g_free (str); + str = NULL; + + g_free (locale); +} + +/* Test that message context works as expected with translated + * schema defaults. Also, verify that non-ASCII UTF-8 content + * works. + * + * This test relies on the de.po file in the same directory + * to be compiled into ./de/LC_MESSAGES/test.mo + */ +static void +test_l10n_context (void) +{ + GSettings *settings; + gchar *str; + gchar *locale; + + bindtextdomain ("test", "."); + bind_textdomain_codeset ("test", "UTF-8"); + + locale = g_strdup (setlocale (LC_MESSAGES, NULL)); + + settings = g_settings_new ("org.gtk.test.localized"); + + setlocale (LC_MESSAGES, "C"); + g_settings_get (settings, "backspace", "s", &str); + setlocale (LC_MESSAGES, locale); + + g_assert_cmpstr (str, ==, "BackSpace"); + g_free (str); + str = NULL; + + setlocale (LC_MESSAGES, "de_DE"); + g_settings_get (settings, "backspace", "s", &str); + setlocale (LC_MESSAGES, locale); + + g_assert_cmpstr (str, ==, "Löschen"); + g_object_unref (settings); + g_free (str); + str = NULL; + + g_free (locale); +} + +enum +{ + PROP_0, + PROP_BOOL, + PROP_ANTI_BOOL, + PROP_BYTE, + PROP_INT16, + PROP_UINT16, + PROP_INT, + PROP_UINT, + PROP_INT64, + PROP_UINT64, + PROP_DOUBLE, + PROP_STRING, + PROP_NO_READ, + PROP_NO_WRITE, + PROP_STRV, + PROP_ENUM +}; + +typedef struct +{ + GObject parent_instance; + + gboolean bool_prop; + gboolean anti_bool_prop; + gchar byte_prop; + gint int16_prop; + guint16 uint16_prop; + gint int_prop; + guint uint_prop; + gint64 int64_prop; + guint64 uint64_prop; + gdouble double_prop; + gchar *string_prop; + gchar *no_read_prop; + gchar *no_write_prop; + gchar **strv_prop; + guint enum_prop; +} TestObject; + +typedef struct +{ + GObjectClass parent_class; +} TestObjectClass; + +G_DEFINE_TYPE (TestObject, test_object, G_TYPE_OBJECT) + +static void +test_object_init (TestObject *object) +{ +} + +static void +test_object_finalize (GObject *object) +{ + TestObject *testo = (TestObject*)object; + g_strfreev (testo->strv_prop); + g_free (testo->string_prop); + G_OBJECT_CLASS (test_object_parent_class)->finalize (object); +} + +static void +test_object_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + TestObject *test_object = (TestObject *)object; + + switch (prop_id) + { + case PROP_BOOL: + g_value_set_boolean (value, test_object->bool_prop); + break; + case PROP_ANTI_BOOL: + g_value_set_boolean (value, test_object->anti_bool_prop); + break; + case PROP_BYTE: + g_value_set_char (value, test_object->byte_prop); + break; + case PROP_UINT16: + g_value_set_uint (value, test_object->uint16_prop); + break; + case PROP_INT16: + g_value_set_int (value, test_object->int16_prop); + break; + case PROP_INT: + g_value_set_int (value, test_object->int_prop); + break; + case PROP_UINT: + g_value_set_uint (value, test_object->uint_prop); + break; + case PROP_INT64: + g_value_set_int64 (value, test_object->int64_prop); + break; + case PROP_UINT64: + g_value_set_uint64 (value, test_object->uint64_prop); + break; + case PROP_DOUBLE: + g_value_set_double (value, test_object->double_prop); + break; + case PROP_STRING: + g_value_set_string (value, test_object->string_prop); + break; + case PROP_NO_WRITE: + g_value_set_string (value, test_object->no_write_prop); + break; + case PROP_STRV: + g_value_set_boxed (value, test_object->strv_prop); + break; + case PROP_ENUM: + g_value_set_enum (value, test_object->enum_prop); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +test_object_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + TestObject *test_object = (TestObject *)object; + + switch (prop_id) + { + case PROP_BOOL: + test_object->bool_prop = g_value_get_boolean (value); + break; + case PROP_ANTI_BOOL: + test_object->anti_bool_prop = g_value_get_boolean (value); + break; + case PROP_BYTE: + test_object->byte_prop = g_value_get_char (value); + break; + case PROP_INT16: + test_object->int16_prop = g_value_get_int (value); + break; + case PROP_UINT16: + test_object->uint16_prop = g_value_get_uint (value); + break; + case PROP_INT: + test_object->int_prop = g_value_get_int (value); + break; + case PROP_UINT: + test_object->uint_prop = g_value_get_uint (value); + break; + case PROP_INT64: + test_object->int64_prop = g_value_get_int64 (value); + break; + case PROP_UINT64: + test_object->uint64_prop = g_value_get_uint64 (value); + break; + case PROP_DOUBLE: + test_object->double_prop = g_value_get_double (value); + break; + case PROP_STRING: + g_free (test_object->string_prop); + test_object->string_prop = g_value_dup_string (value); + break; + case PROP_NO_READ: + g_free (test_object->no_read_prop); + test_object->no_read_prop = g_value_dup_string (value); + break; + case PROP_STRV: + g_strfreev (test_object->strv_prop); + test_object->strv_prop = g_value_dup_boxed (value); + break; + case PROP_ENUM: + test_object->enum_prop = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static GType +test_enum_get_type (void) +{ + static volatile gsize define_type_id = 0; + + if (g_once_init_enter (&define_type_id)) + { + static const GEnumValue values[] = { + { TEST_ENUM_FOO, "TEST_ENUM_FOO", "foo" }, + { TEST_ENUM_BAR, "TEST_ENUM_BAR", "bar" }, + { TEST_ENUM_BAZ, "TEST_ENUM_BAZ", "baz" }, + { TEST_ENUM_QUUX, "TEST_ENUM_QUUX", "quux" }, + { 0, NULL, NULL } + }; + + GType type_id = g_enum_register_static ("TestEnum", values); + g_once_init_leave (&define_type_id, type_id); + } + + return define_type_id; +} + +static void +test_object_class_init (TestObjectClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (class); + + gobject_class->get_property = test_object_get_property; + gobject_class->set_property = test_object_set_property; + gobject_class->finalize = test_object_finalize; + + g_object_class_install_property (gobject_class, PROP_BOOL, + g_param_spec_boolean ("bool", "", "", FALSE, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_ANTI_BOOL, + g_param_spec_boolean ("anti-bool", "", "", FALSE, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_BYTE, + g_param_spec_char ("byte", "", "", G_MININT8, G_MAXINT8, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_INT16, + g_param_spec_int ("int16", "", "", -G_MAXINT16, G_MAXINT16, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_UINT16, + g_param_spec_uint ("uint16", "", "", 0, G_MAXUINT16, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_INT, + g_param_spec_int ("int", "", "", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_UINT, + g_param_spec_uint ("uint", "", "", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_INT64, + g_param_spec_int64 ("int64", "", "", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_UINT64, + g_param_spec_uint64 ("uint64", "", "", 0, G_MAXUINT64, 0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_DOUBLE, + g_param_spec_double ("double", "", "", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_STRING, + g_param_spec_string ("string", "", "", NULL, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_NO_WRITE, + g_param_spec_string ("no-write", "", "", NULL, G_PARAM_READABLE)); + g_object_class_install_property (gobject_class, PROP_NO_READ, + g_param_spec_string ("no-read", "", "", NULL, G_PARAM_WRITABLE)); + g_object_class_install_property (gobject_class, PROP_STRV, + g_param_spec_boxed ("strv", "", "", G_TYPE_STRV, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_ENUM, + g_param_spec_enum ("enum", "", "", test_enum_get_type (), TEST_ENUM_FOO, G_PARAM_READWRITE)); +} + +static TestObject * +test_object_new (void) +{ + return (TestObject*)g_object_new (test_object_get_type (), NULL); +} + +/* Test basic binding functionality for simple types. + * Verify that with bidirectional bindings, changes on either side + * are notified on the other end. + */ +static void +test_simple_binding (void) +{ + TestObject *obj; + GSettings *settings; + gboolean b; + gchar y; + gint i; + gint16 n; + guint16 q; + gint n2; + guint q2; + gint64 i64; + guint64 u64; + gdouble d; + gchar *s; + GVariant *value; + gchar **strv; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "bool", obj, "bool", G_SETTINGS_BIND_DEFAULT); + g_object_set (obj, "bool", TRUE, NULL); + g_assert_cmpint (g_settings_get_boolean (settings, "bool"), ==, TRUE); + + g_settings_set_boolean (settings, "bool", FALSE); + b = TRUE; + g_object_get (obj, "bool", &b, NULL); + g_assert_cmpint (b, ==, FALSE); + + g_settings_bind (settings, "anti-bool", obj, "anti-bool", + G_SETTINGS_BIND_INVERT_BOOLEAN); + g_object_set (obj, "anti-bool", FALSE, NULL); + g_assert_cmpint (g_settings_get_boolean (settings, "anti-bool"), ==, TRUE); + + g_settings_set_boolean (settings, "anti-bool", FALSE); + b = FALSE; + g_object_get (obj, "anti-bool", &b, NULL); + g_assert_cmpint (b, ==, TRUE); + + g_settings_bind (settings, "byte", obj, "byte", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "byte", 123, NULL); + y = 'c'; + g_settings_get (settings, "byte", "y", &y); + g_assert_cmpint (y, ==, 123); + + g_settings_set (settings, "byte", "y", 54); + y = 'c'; + g_object_get (obj, "byte", &y, NULL); + g_assert_cmpint (y, ==, 54); + + g_settings_bind (settings, "int16", obj, "int16", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "int16", 1234, NULL); + n = 4321; + g_settings_get (settings, "int16", "n", &n); + g_assert_cmpint (n, ==, 1234); + + g_settings_set (settings, "int16", "n", 4321); + n2 = 1111; + g_object_get (obj, "int16", &n2, NULL); + g_assert_cmpint (n2, ==, 4321); + + g_settings_bind (settings, "uint16", obj, "uint16", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "uint16", (guint16) G_MAXUINT16, NULL); + q = 1111; + g_settings_get (settings, "uint16", "q", &q); + g_assert_cmpuint (q, ==, G_MAXUINT16); + + g_settings_set (settings, "uint16", "q", (guint16) G_MAXINT16); + q2 = 1111; + g_object_get (obj, "uint16", &q2, NULL); + g_assert_cmpuint (q2, ==, (guint16) G_MAXINT16); + + g_settings_bind (settings, "int", obj, "int", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "int", 12345, NULL); + g_assert_cmpint (g_settings_get_int (settings, "int"), ==, 12345); + + g_settings_set_int (settings, "int", 54321); + i = 1111; + g_object_get (obj, "int", &i, NULL); + g_assert_cmpint (i, ==, 54321); + + g_settings_bind (settings, "int64", obj, "int64", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "int64", (gint64) G_MAXINT64, NULL); + i64 = 1111; + g_settings_get (settings, "int64", "x", &i64); + g_assert_cmpint (i64, ==, G_MAXINT64); + + g_settings_set (settings, "int64", "x", (gint64) G_MININT64); + i64 = 1111; + g_object_get (obj, "int64", &i64, NULL); + g_assert_cmpint (i64, ==, G_MININT64); + + g_settings_bind (settings, "uint64", obj, "uint64", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "uint64", (guint64) G_MAXUINT64, NULL); + u64 = 1111; + g_settings_get (settings, "uint64", "t", &u64); + g_assert_cmpuint (u64, ==, G_MAXUINT64); + + g_settings_set (settings, "uint64", "t", (guint64) G_MAXINT64); + u64 = 1111; + g_object_get (obj, "uint64", &u64, NULL); + g_assert_cmpuint (u64, ==, (guint64) G_MAXINT64); + + g_settings_bind (settings, "string", obj, "string", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "string", "bu ba", NULL); + s = g_settings_get_string (settings, "string"); + g_assert_cmpstr (s, ==, "bu ba"); + g_free (s); + + g_settings_set_string (settings, "string", "bla bla"); + g_object_get (obj, "string", &s, NULL); + g_assert_cmpstr (s, ==, "bla bla"); + g_free (s); + + g_settings_bind (settings, "chararray", obj, "string", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "string", "non-unicode:\315", NULL); + value = g_settings_get_value (settings, "chararray"); + g_assert_cmpstr (g_variant_get_bytestring (value), ==, "non-unicode:\315"); + g_variant_unref (value); + + g_settings_bind (settings, "double", obj, "double", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "double", G_MAXFLOAT, NULL); + g_assert_cmpfloat (g_settings_get_double (settings, "double"), ==, G_MAXFLOAT); + + g_settings_set_double (settings, "double", G_MINFLOAT); + d = 1.0; + g_object_get (obj, "double", &d, NULL); + g_assert_cmpfloat (d, ==, G_MINFLOAT); + + g_object_set (obj, "double", G_MAXDOUBLE, NULL); + g_assert_cmpfloat (g_settings_get_double (settings, "double"), ==, G_MAXDOUBLE); + + g_settings_set_double (settings, "double", -G_MINDOUBLE); + d = 1.0; + g_object_get (obj, "double", &d, NULL); + g_assert_cmpfloat (d, ==, -G_MINDOUBLE); + + strv = g_strsplit ("plastic bag,middle class,polyethylene", ",", 0); + g_settings_bind (settings, "strv", obj, "strv", G_SETTINGS_BIND_DEFAULT); + g_object_set (obj, "strv", strv, NULL); + g_strfreev (strv); + strv = g_settings_get_strv (settings, "strv"); + s = g_strjoinv (",", strv); + g_assert_cmpstr (s, ==, "plastic bag,middle class,polyethylene"); + g_strfreev (strv); + g_free (s); + strv = g_strsplit ("decaffeinate,unleaded,keep all surfaces clean", ",", 0); + g_settings_set_strv (settings, "strv", (const gchar **) strv); + g_strfreev (strv); + g_object_get (obj, "strv", &strv, NULL); + s = g_strjoinv (",", strv); + g_assert_cmpstr (s, ==, "decaffeinate,unleaded,keep all surfaces clean"); + g_strfreev (strv); + g_free (s); + + g_settings_bind (settings, "enum", obj, "enum", G_SETTINGS_BIND_DEFAULT); + g_object_set (obj, "enum", TEST_ENUM_BAZ, NULL); + s = g_settings_get_string (settings, "enum"); + g_assert_cmpstr (s, ==, "baz"); + g_free (s); + g_assert_cmpint (g_settings_get_enum (settings, "enum"), ==, TEST_ENUM_BAZ); + + g_settings_set_enum (settings, "enum", TEST_ENUM_QUUX); + i = 230; + g_object_get (obj, "enum", &i, NULL); + g_assert_cmpint (i, ==, TEST_ENUM_QUUX); + + g_settings_set_string (settings, "enum", "baz"); + i = 230; + g_object_get (obj, "enum", &i, NULL); + g_assert_cmpint (i, ==, TEST_ENUM_BAZ); + + g_object_unref (obj); + g_object_unref (settings); +} + +static void +test_unbind (void) +{ + TestObject *obj; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "int", obj, "int", G_SETTINGS_BIND_DEFAULT); + + g_object_set (obj, "int", 12345, NULL); + g_assert_cmpint (g_settings_get_int (settings, "int"), ==, 12345); + + g_settings_unbind (obj, "int"); + + g_object_set (obj, "int", 54321, NULL); + g_assert_cmpint (g_settings_get_int (settings, "int"), ==, 12345); + + g_object_unref (obj); + g_object_unref (settings); +} + +static void +test_bind_writable (void) +{ + TestObject *obj; + GSettings *settings; + gboolean b; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_object_set (obj, "bool", FALSE, NULL); + + g_settings_bind_writable (settings, "int", obj, "bool", FALSE); + + g_object_get (obj, "bool", &b, NULL); + g_assert (b); + + g_settings_unbind (obj, "bool"); + + g_settings_bind_writable (settings, "int", obj, "bool", TRUE); + + g_object_get (obj, "bool", &b, NULL); + g_assert (!b); + + g_object_unref (obj); + g_object_unref (settings); +} + +/* Test one-way bindings. + * Verify that changes on one side show up on the other, + * but not vice versa + */ +static void +test_directional_binding (void) +{ + TestObject *obj; + GSettings *settings; + gboolean b; + gint i; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_object_set (obj, "bool", FALSE, NULL); + g_settings_set_boolean (settings, "bool", FALSE); + + g_settings_bind (settings, "bool", obj, "bool", G_SETTINGS_BIND_GET); + + g_settings_set_boolean (settings, "bool", TRUE); + g_object_get (obj, "bool", &b, NULL); + g_assert_cmpint (b, ==, TRUE); + + g_object_set (obj, "bool", FALSE, NULL); + g_assert_cmpint (g_settings_get_boolean (settings, "bool"), ==, TRUE); + + g_object_set (obj, "int", 20, NULL); + g_settings_set_int (settings, "int", 20); + + g_settings_bind (settings, "int", obj, "int", G_SETTINGS_BIND_SET); + + g_object_set (obj, "int", 32, NULL); + g_assert_cmpint (g_settings_get_int (settings, "int"), ==, 32); + + g_settings_set_int (settings, "int", 20); + g_object_get (obj, "int", &i, NULL); + g_assert_cmpint (i, ==, 32); + + g_object_unref (obj); + g_object_unref (settings); +} + +/* Test that type mismatch is caught when creating a binding + */ +static void +test_typesafe_binding (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + TestObject *obj; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "string", obj, "int", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (obj); + g_object_unref (settings); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*not compatible*"); +} + +static gboolean +string_to_bool (GValue *value, + GVariant *variant, + gpointer user_data) +{ + const gchar *s; + + s = g_variant_get_string (variant, NULL); + g_value_set_boolean (value, g_strcmp0 (s, "true") == 0); + + return TRUE; +} + +static GVariant * +bool_to_string (const GValue *value, + const GVariantType *expected_type, + gpointer user_data) +{ + if (g_value_get_boolean (value)) + return g_variant_new_string ("true"); + else + return g_variant_new_string ("false"); +} + +/* Test custom bindings. + * Translate strings to booleans and back + */ +static void +test_custom_binding (void) +{ + TestObject *obj; + GSettings *settings; + gchar *s; + gboolean b; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_set_string (settings, "string", "true"); + + g_settings_bind_with_mapping (settings, "string", + obj, "bool", + G_SETTINGS_BIND_DEFAULT, + string_to_bool, + bool_to_string, + NULL, NULL); + + g_settings_set_string (settings, "string", "false"); + g_object_get (obj, "bool", &b, NULL); + g_assert_cmpint (b, ==, FALSE); + + g_settings_set_string (settings, "string", "not true"); + g_object_get (obj, "bool", &b, NULL); + g_assert_cmpint (b, ==, FALSE); + + g_object_set (obj, "bool", TRUE, NULL); + s = g_settings_get_string (settings, "string"); + g_assert_cmpstr (s, ==, "true"); + g_free (s); + + g_object_unref (obj); + g_object_unref (settings); +} + +/* Test that with G_SETTINGS_BIND_NO_CHANGES, the + * initial settings value is transported to the object + * side, but later settings changes do not affect the + * object + */ +static void +test_no_change_binding (void) +{ + TestObject *obj; + GSettings *settings; + gboolean b; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_object_set (obj, "bool", TRUE, NULL); + g_settings_set_boolean (settings, "bool", FALSE); + + g_settings_bind (settings, "bool", obj, "bool", G_SETTINGS_BIND_GET_NO_CHANGES); + + g_object_get (obj, "bool", &b, NULL); + g_assert_cmpint (b, ==, FALSE); + + g_settings_set_boolean (settings, "bool", TRUE); + g_object_get (obj, "bool", &b, NULL); + g_assert_cmpint (b, ==, FALSE); + + g_settings_set_boolean (settings, "bool", FALSE); + g_object_set (obj, "bool", TRUE, NULL); + b = g_settings_get_boolean (settings, "bool"); + g_assert_cmpint (b, ==, TRUE); + + g_object_unref (obj); + g_object_unref (settings); +} + +/* Test that binding a non-readable property only + * works in 'GET' mode. + */ +static void +test_no_read_binding (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + TestObject *obj; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "string", obj, "no-read", 0); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*property*is not readable*"); + + if (g_test_trap_fork (0, 0)) + { + TestObject *obj; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "string", obj, "no-read", G_SETTINGS_BIND_GET); + + exit (0); + } + g_test_trap_assert_passed (); +} + +/* Test that binding a non-writable property only + * works in 'SET' mode. + */ +static void +test_no_write_binding (void) +{ + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + { + TestObject *obj; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "string", obj, "no-write", 0); + } + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*property*is not writable*"); + + if (g_test_trap_fork (0, 0)) + { + TestObject *obj; + GSettings *settings; + + settings = g_settings_new ("org.gtk.test.binding"); + obj = test_object_new (); + + g_settings_bind (settings, "string", obj, "no-write", G_SETTINGS_BIND_SET); + + exit (0); + } + g_test_trap_assert_passed (); +} + +/* + * Test that using a keyfile works + */ +static void +test_keyfile (void) +{ + GSettingsBackend *kf_backend; + GSettings *settings; + GKeyFile *keyfile; + gchar *str; + + g_remove ("gsettings.store"); + + kf_backend = g_keyfile_settings_backend_new ("gsettings.store", "/", "root"); + settings = g_settings_new_with_backend ("org.gtk.test", kf_backend); + g_object_unref (kf_backend); + + g_settings_set (settings, "greeting", "s", "see if this works"); + + keyfile = g_key_file_new (); + g_assert (g_key_file_load_from_file (keyfile, "gsettings.store", 0, NULL)); + + str = g_key_file_get_string (keyfile, "tests", "greeting", NULL); + g_assert_cmpstr (str, ==, "'see if this works'"); + + g_free (str); + g_key_file_free (keyfile); + g_object_unref (settings); +} + +/* Test that getting child schemas works + */ +static void +test_child_schema (void) +{ + GSettings *settings; + GSettings *child; + guint8 byte; + + /* first establish some known conditions */ + settings = g_settings_new ("org.gtk.test.basic-types"); + g_settings_set (settings, "test-byte", "y", 36); + + g_settings_get (settings, "test-byte", "y", &byte); + g_assert_cmpint (byte, ==, 36); + + g_object_unref (settings); + + settings = g_settings_new ("org.gtk.test"); + child = g_settings_get_child (settings, "basic-types"); + g_assert (child != NULL); + + g_settings_get (child, "test-byte", "y", &byte); + g_assert_cmpint (byte, ==, 36); + + g_object_unref (child); + g_object_unref (settings); +} + +static gboolean +glib_translations_work (void) +{ + gchar *locale; + gchar *orig = "Unnamed"; + gchar *str; + + locale = g_strdup (setlocale (LC_MESSAGES, NULL)); + setlocale (LC_MESSAGES, "de"); + str = dgettext ("glib20", orig); + setlocale (LC_MESSAGES, locale); + g_free (locale); + + return str != orig; +} + +#include "../strinfo.c" + +static void +test_strinfo (void) +{ + /* "foo" has a value of 1 + * "bar" has a value of 2 + * "baz" is an alias for "bar" + */ + gchar array[] = + "\1\0\0\0" "\xff""foo" "\0\0\0\xff" "\2\0\0\0" + "\xff" "bar" "\0\0\0\xff" "\3\0\0\0" "\xfe""baz" + "\0\0\0\xff"; + const guint32 *strinfo = (guint32 *) array; + guint length = sizeof array / 4; + guint result; + + { + /* build it and compare */ + GString *builder; + + builder = g_string_new (NULL); + strinfo_builder_append_item (builder, "foo", 1); + strinfo_builder_append_item (builder, "bar", 2); + g_assert (strinfo_builder_append_alias (builder, "baz", "bar")); + g_assert_cmpint (builder->len % 4, ==, 0); + g_assert_cmpint (builder->len / 4, ==, length); + g_assert (memcmp (builder->str, strinfo, length * 4) == 0); + g_string_free (builder, TRUE); + } + + g_assert_cmpstr (strinfo_string_from_alias (strinfo, length, "foo"), + ==, NULL); + g_assert_cmpstr (strinfo_string_from_alias (strinfo, length, "bar"), + ==, NULL); + g_assert_cmpstr (strinfo_string_from_alias (strinfo, length, "baz"), + ==, "bar"); + g_assert_cmpstr (strinfo_string_from_alias (strinfo, length, "quux"), + ==, NULL); + + g_assert (strinfo_enum_from_string (strinfo, length, "foo", &result)); + g_assert_cmpint (result, ==, 1); + g_assert (strinfo_enum_from_string (strinfo, length, "bar", &result)); + g_assert_cmpint (result, ==, 2); + g_assert (!strinfo_enum_from_string (strinfo, length, "baz", &result)); + g_assert (!strinfo_enum_from_string (strinfo, length, "quux", &result)); + + g_assert_cmpstr (strinfo_string_from_enum (strinfo, length, 0), ==, NULL); + g_assert_cmpstr (strinfo_string_from_enum (strinfo, length, 1), ==, "foo"); + g_assert_cmpstr (strinfo_string_from_enum (strinfo, length, 2), ==, "bar"); + g_assert_cmpstr (strinfo_string_from_enum (strinfo, length, 3), ==, NULL); + + g_assert (strinfo_is_string_valid (strinfo, length, "foo")); + g_assert (strinfo_is_string_valid (strinfo, length, "bar")); + g_assert (!strinfo_is_string_valid (strinfo, length, "baz")); + g_assert (!strinfo_is_string_valid (strinfo, length, "quux")); +} + +static void +test_enums (void) +{ + GSettings *settings, *direct; + gchar *str; + + settings = g_settings_new ("org.gtk.test.enums"); + direct = g_settings_new ("org.gtk.test.enums.direct"); + + if (!backend_set) + { + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_get_enum (direct, "test"); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*not associated with an enum*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_set_enum (settings, "test", 42); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*invalid enum value 42*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_set_string (settings, "test", "qux"); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*g_settings_set_value*valid range*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_get_flags (settings, "test"); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*not associated with a flags*"); + } + + str = g_settings_get_string (settings, "test"); + g_assert_cmpstr (str, ==, "bar"); + g_free (str); + + g_settings_set_enum (settings, "test", TEST_ENUM_FOO); + + str = g_settings_get_string (settings, "test"); + g_assert_cmpstr (str, ==, "foo"); + g_free (str); + + g_assert_cmpint (g_settings_get_enum (settings, "test"), ==, TEST_ENUM_FOO); + + g_settings_set_string (direct, "test", "qux"); + + str = g_settings_get_string (direct, "test"); + g_assert_cmpstr (str, ==, "qux"); + g_free (str); + + str = g_settings_get_string (settings, "test"); + g_assert_cmpstr (str, ==, "quux"); + g_free (str); + + g_assert_cmpint (g_settings_get_enum (settings, "test"), ==, TEST_ENUM_QUUX); +} + +static void +test_flags (void) +{ + GSettings *settings, *direct; + gchar **strv; + gchar *str; + + settings = g_settings_new ("org.gtk.test.enums"); + direct = g_settings_new ("org.gtk.test.enums.direct"); + + if (!backend_set) + { + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_get_flags (direct, "test"); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*not associated with a flags*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_set_flags (settings, "f-test", 0x42); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*invalid flags value 0x00000042*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_set_strv (settings, "f-test", + (const gchar **) g_strsplit ("rock", ",", 0)); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*g_settings_set_value*valid range*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_get_enum (settings, "f-test"); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*not associated with an enum*"); + } + + strv = g_settings_get_strv (settings, "f-test"); + str = g_strjoinv (",", strv); + g_assert_cmpstr (str, ==, ""); + g_strfreev (strv); + g_free (str); + + g_settings_set_flags (settings, "f-test", + TEST_FLAGS_WALKING | TEST_FLAGS_TALKING); + + strv = g_settings_get_strv (settings, "f-test"); + str = g_strjoinv (",", strv); + g_assert_cmpstr (str, ==, "talking,walking"); + g_strfreev (strv); + g_free (str); + + g_assert_cmpint (g_settings_get_flags (settings, "f-test"), ==, + TEST_FLAGS_WALKING | TEST_FLAGS_TALKING); + + strv = g_strsplit ("speaking,laughing", ",", 0); + g_settings_set_strv (direct, "f-test", (const gchar **) strv); + g_strfreev (strv); + + strv = g_settings_get_strv (direct, "f-test"); + str = g_strjoinv (",", strv); + g_assert_cmpstr (str, ==, "speaking,laughing"); + g_strfreev (strv); + g_free (str); + + strv = g_settings_get_strv (settings, "f-test"); + str = g_strjoinv (",", strv); + g_assert_cmpstr (str, ==, "talking,laughing"); + g_strfreev (strv); + g_free (str); + + g_assert_cmpint (g_settings_get_flags (settings, "f-test"), ==, + TEST_FLAGS_TALKING | TEST_FLAGS_LAUGHING); +} + +static void +test_range (void) +{ + GSettings *settings, *direct; + + settings = g_settings_new ("org.gtk.test.range"); + direct = g_settings_new ("org.gtk.test.range.direct"); + + if (!backend_set) + { + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_set_int (settings, "val", 45); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*g_settings_set_value*valid range*"); + + if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) + g_settings_set_int (settings, "val", 1); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*g_settings_set_value*valid range*"); + } + + g_assert_cmpint (g_settings_get_int (settings, "val"), ==, 33); + g_settings_set_int (direct, "val", 22); + g_assert_cmpint (g_settings_get_int (direct, "val"), ==, 22); + g_assert_cmpint (g_settings_get_int (settings, "val"), ==, 22); + g_settings_set_int (direct, "val", 45); + g_assert_cmpint (g_settings_get_int (direct, "val"), ==, 45); + g_assert_cmpint (g_settings_get_int (settings, "val"), ==, 33); + g_settings_set_int (direct, "val", 1); + g_assert_cmpint (g_settings_get_int (direct, "val"), ==, 1); + g_assert_cmpint (g_settings_get_int (settings, "val"), ==, 33); +} + +static gboolean +strv_has_string (gchar **haystack, + const gchar *needle) +{ + guint n; + + for (n = 0; haystack != NULL && haystack[n] != NULL; n++) + { + if (g_strcmp0 (haystack[n], needle) == 0) + return TRUE; + } + return FALSE; +} + +static gboolean +strv_set_equal (gchar **strv, ...) +{ + gint count; + va_list list; + const gchar *str; + gboolean res; + + res = TRUE; + count = 0; + va_start (list, strv); + while (1) + { + str = va_arg (list, const gchar *); + if (str == NULL) + break; + if (!strv_has_string (strv, str)) + { + res = FALSE; + break; + } + count++; + } + va_end (list); + + if (res) + res = g_strv_length ((gchar**)strv) == count; + + return res; +} + +static void +test_list_items (void) +{ + GSettings *settings; + gchar **children; + gchar **keys; + + settings = g_settings_new ("org.gtk.test"); + children = g_settings_list_children (settings); + keys = g_settings_list_keys (settings); + + g_assert (strv_set_equal (children, "basic-types", "complex-types", "localized", NULL)); + g_assert (strv_set_equal (keys, "greeting", "farewell", NULL)); + + g_strfreev (children); + g_strfreev (keys); + + g_object_unref (settings); +} + +static void +test_list_schemas (void) +{ + const gchar * const *schemas; + const gchar * const *relocs; + + relocs = g_settings_list_relocatable_schemas (); + schemas = g_settings_list_schemas (); + + g_assert (strv_set_equal ((gchar **)relocs, + "org.gtk.test.no-path", + NULL)); + + g_assert (strv_set_equal ((gchar **)schemas, + "org.gtk.test", + "org.gtk.test.basic-types", + "org.gtk.test.complex-types", + "org.gtk.test.localized", + "org.gtk.test.binding", + "org.gtk.test.enums", + "org.gtk.test.enums.direct", + "org.gtk.test.range", + "org.gtk.test.range.direct", + "org.gtk.test.mapped", + NULL)); +} + +static gboolean +map_func (GVariant *value, + gpointer *result, + gpointer user_data) +{ + gint *state = user_data; + gint v; + + if (value) + v = g_variant_get_int32 (value); + else + v = -1; + + if (*state == 0) + { + g_assert_cmpint (v, ==, 1); + (*state)++; + return FALSE; + } + else if (*state == 1) + { + g_assert_cmpint (v, ==, 0); + (*state)++; + return FALSE; + } + else + { + g_assert (value == NULL); + *result = g_variant_new_int32 (5); + return TRUE; + } +} + +static void +test_get_mapped (void) +{ + GSettings *settings; + gint state; + gpointer p; + gint val; + + settings = g_settings_new ("org.gtk.test.mapped"); + g_settings_set_int (settings, "val", 1); + + state = 0; + p = g_settings_get_mapped (settings, "val", map_func, &state); + val = g_variant_get_int32 ((GVariant*)p); + g_assert_cmpint (val, ==, 5); + + g_variant_unref (p); + g_object_unref (settings); +} + +static void +test_get_range (void) +{ + GSettings *settings; + GVariant *range; + + settings = g_settings_new ("org.gtk.test.range"); + range = g_settings_get_range (settings, "val"); + check_and_free (range, "('range', <(2, 44)>)"); + g_object_unref (settings); + + settings = g_settings_new ("org.gtk.test.enums"); + range = g_settings_get_range (settings, "test"); + check_and_free (range, "('enum', <['foo', 'bar', 'baz', 'quux']>)"); + g_object_unref (settings); + + settings = g_settings_new ("org.gtk.test.enums"); + range = g_settings_get_range (settings, "f-test"); + check_and_free (range, "('flags', " + "<['mourning', 'laughing', 'talking', 'walking']>)"); + g_object_unref (settings); + + settings = g_settings_new ("org.gtk.test"); + range = g_settings_get_range (settings, "greeting"); + check_and_free (range, "('type', <@as []>)"); + g_object_unref (settings); +} + +int +main (int argc, char *argv[]) +{ + gchar *enums; + gint result; + + setlocale (LC_ALL, ""); + + backend_set = g_getenv ("GSETTINGS_BACKEND") != NULL; + + g_setenv ("XDG_DATA_DIRS", ".", TRUE); + g_setenv ("GSETTINGS_SCHEMA_DIR", ".", TRUE); + + if (!backend_set) + g_setenv ("GSETTINGS_BACKEND", "memory", TRUE); + + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_remove ("org.gtk.test.enums.xml"); + g_assert (g_spawn_command_line_sync ("../../gobject/glib-mkenums " + "--template " SRCDIR "/enums.xml.template " + SRCDIR "/testenum.h", + &enums, NULL, &result, NULL)); + g_assert (result == 0); + g_assert (g_file_set_contents ("org.gtk.test.enums.xml", enums, -1, NULL)); + g_free (enums); + + g_remove ("gschemas.compiled"); + g_assert (g_spawn_command_line_sync ("../glib-compile-schemas --targetdir=. " + "--schema-file=org.gtk.test.enums.xml " + "--schema-file=" SRCDIR "/org.gtk.test.gschema.xml", + NULL, NULL, &result, NULL)); + g_assert (result == 0); + + g_test_add_func ("/gsettings/basic", test_basic); + + if (!backend_set) + { + g_test_add_func ("/gsettings/no-schema", test_no_schema); + g_test_add_func ("/gsettings/unknown-key", test_unknown_key); + g_test_add_func ("/gsettings/wrong-type", test_wrong_type); + g_test_add_func ("/gsettings/wrong-path", test_wrong_path); + g_test_add_func ("/gsettings/no-path", test_no_path); + } + + g_test_add_func ("/gsettings/basic-types", test_basic_types); + g_test_add_func ("/gsettings/complex-types", test_complex_types); + g_test_add_func ("/gsettings/changes", test_changes); + + if (glib_translations_work ()) + { + g_test_add_func ("/gsettings/l10n", test_l10n); + g_test_add_func ("/gsettings/l10n-context", test_l10n_context); + } + + g_test_add_func ("/gsettings/delay-apply", test_delay_apply); + g_test_add_func ("/gsettings/delay-revert", test_delay_revert); + g_test_add_func ("/gsettings/atomic", test_atomic); + + g_test_add_func ("/gsettings/simple-binding", test_simple_binding); + g_test_add_func ("/gsettings/directional-binding", test_directional_binding); + g_test_add_func ("/gsettings/custom-binding", test_custom_binding); + g_test_add_func ("/gsettings/no-change-binding", test_no_change_binding); + g_test_add_func ("/gsettings/unbinding", test_unbind); + g_test_add_func ("/gsettings/writable-binding", test_bind_writable); + + if (!backend_set) + { + g_test_add_func ("/gsettings/typesafe-binding", test_typesafe_binding); + g_test_add_func ("/gsettings/no-read-binding", test_no_read_binding); + g_test_add_func ("/gsettings/no-write-binding", test_no_write_binding); + } + + g_test_add_func ("/gsettings/keyfile", test_keyfile); + g_test_add_func ("/gsettings/child-schema", test_child_schema); + g_test_add_func ("/gsettings/strinfo", test_strinfo); + g_test_add_func ("/gsettings/enums", test_enums); + g_test_add_func ("/gsettings/flags", test_flags); + g_test_add_func ("/gsettings/range", test_range); + g_test_add_func ("/gsettings/list-items", test_list_items); + g_test_add_func ("/gsettings/list-schemas", test_list_schemas); + g_test_add_func ("/gsettings/mapped", test_get_mapped); + g_test_add_func ("/gsettings/get-range", test_get_range); + + result = g_test_run (); + + g_settings_sync (); + + return result; +} diff --git a/gio/tests/io-stream.c b/gio/tests/io-stream.c new file mode 100644 index 0000000..dbac08b --- /dev/null +++ b/gio/tests/io-stream.c @@ -0,0 +1,185 @@ +/* GLib testing framework examples and tests + * Copyright (C) 2010 Collabora Ltd. + * Authors: Xavier Claessens + * + * This work is provided "as is"; redistribution and modification + * in whole or in part, in any medium, physical or electronic is + * permitted without restriction. + * + * This work is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * In no event shall the authors or contributors be liable for any + * direct, indirect, incidental, special, exemplary, or consequential + * damages (including, but not limited to, procurement of substitute + * goods or services; loss of use, data, or profits; or business + * interruption) however caused and on any theory of liability, whether + * in contract, strict liability, or tort (including negligence or + * otherwise) arising in any way out of the use of this software, even + * if advised of the possibility of such damage. + */ + +#include +#include +#include +#include + +typedef struct +{ + GIOStream parent; + GInputStream *input_stream; + GOutputStream *output_stream; +} GTestIOStream; + +typedef struct +{ + GIOStreamClass parent_class; +} GTestIOStreamClass; + +G_DEFINE_TYPE (GTestIOStream, g_test_io_stream, G_TYPE_IO_STREAM); + + +static GInputStream * +get_input_stream (GIOStream *io_stream) +{ + GTestIOStream *self = (GTestIOStream *) io_stream; + + return self->input_stream; +} + +static GOutputStream * +get_output_stream (GIOStream *io_stream) +{ + GTestIOStream *self = (GTestIOStream *) io_stream; + + return self->output_stream; +} + +static void +finalize (GObject *object) +{ + GTestIOStream *self = (GTestIOStream *) object; + + if (self->input_stream != NULL) + g_object_unref (self->input_stream); + + if (self->output_stream != NULL) + g_object_unref (self->output_stream); + + G_OBJECT_CLASS (g_test_io_stream_parent_class)->finalize (object); +} + +static void +g_test_io_stream_class_init (GTestIOStreamClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GIOStreamClass *io_class = G_IO_STREAM_CLASS (klass); + + object_class->finalize = finalize; + + io_class->get_input_stream = get_input_stream; + io_class->get_output_stream = get_output_stream; +} + +static void +g_test_io_stream_init (GTestIOStream *self) +{ +} + +static GIOStream * +g_test_io_stream_new (GInputStream *input, GOutputStream *output) +{ + GTestIOStream *self; + + self = g_object_new (g_test_io_stream_get_type (), NULL); + self->input_stream = g_object_ref (input); + self->output_stream = g_object_ref (output); + + return G_IO_STREAM (self); +} + +typedef struct +{ + GMainLoop *main_loop; + const gchar *data1; + const gchar *data2; + GIOStream *iostream1; + GIOStream *iostream2; +} TestCopyChunksData; + +static void +test_copy_chunks_splice_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + TestCopyChunksData *data = user_data; + GMemoryOutputStream *ostream; + gchar *received_data; + GError *error = NULL; + + g_io_stream_splice_finish (res, &error); + g_assert_no_error (error); + + ostream = G_MEMORY_OUTPUT_STREAM (((GTestIOStream *) data->iostream1)->output_stream); + received_data = g_memory_output_stream_get_data (ostream); + g_assert_cmpstr (received_data, ==, data->data2); + + ostream = G_MEMORY_OUTPUT_STREAM (((GTestIOStream *) data->iostream2)->output_stream); + received_data = g_memory_output_stream_get_data (ostream); + g_assert_cmpstr (received_data, ==, data->data1); + + g_assert (g_io_stream_is_closed (data->iostream1)); + g_assert (g_io_stream_is_closed (data->iostream2)); + + g_main_loop_quit (data->main_loop); +} + +static void +test_copy_chunks (void) +{ + TestCopyChunksData data; + GInputStream *istream; + GOutputStream *ostream; + + data.main_loop = g_main_loop_new (NULL, FALSE); + data.data1 = "abcdefghijklmnopqrstuvwxyz"; + data.data2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + istream = g_memory_input_stream_new_from_data (data.data1, -1, NULL); + ostream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); + data.iostream1 = g_test_io_stream_new (istream, ostream); + g_object_unref (istream); + g_object_unref (ostream); + + istream = g_memory_input_stream_new_from_data (data.data2, -1, NULL); + ostream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); + data.iostream2 = g_test_io_stream_new (istream, ostream); + g_object_unref (istream); + g_object_unref (ostream); + + g_io_stream_splice_async (data.iostream1, data.iostream2, + G_IO_STREAM_SPLICE_CLOSE_STREAM1 | G_IO_STREAM_SPLICE_CLOSE_STREAM2 | + G_IO_STREAM_SPLICE_WAIT_FOR_BOTH, G_PRIORITY_DEFAULT, + NULL, test_copy_chunks_splice_cb, &data); + + /* We do not hold a ref in data struct, this is to make sure the operation + * keeps the iostream objects alive until it finishes */ + g_object_unref (data.iostream1); + g_object_unref (data.iostream2); + + g_main_loop_run (data.main_loop); + g_main_loop_unref (data.main_loop); +} + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/io-stream/copy-chunks", test_copy_chunks); + + return g_test_run(); +} diff --git a/gio/tests/live-g-file.c b/gio/tests/live-g-file.c index 1ca70ce..32203b6 100644 --- a/gio/tests/live-g-file.c +++ b/gio/tests/live-g-file.c @@ -506,6 +506,8 @@ traverse_recurse_dirs (GFile * parent, GFile * root) g_assert (enumerator != NULL); g_assert_no_error (error); + g_assert (g_file_enumerator_get_container (enumerator) == parent); + error = NULL; info = g_file_enumerator_next_file (enumerator, NULL, &error); while ((info) && (!error)) @@ -545,6 +547,9 @@ traverse_recurse_dirs (GFile * parent, GFile * root) res = g_file_enumerator_close (enumerator, NULL, &error); g_assert_cmpint (res, ==, TRUE); g_assert_no_error (error); + g_assert (g_file_enumerator_is_closed (enumerator)); + + g_object_unref (enumerator); } static void @@ -642,6 +647,8 @@ test_enumerate (gconstpointer test_data) res = g_file_enumerator_close (enumerator, NULL, &error); g_assert_cmpint (res, ==, TRUE); g_assert_no_error (error); + + g_object_unref (enumerator); } g_object_unref (child); } @@ -695,10 +702,7 @@ do_copy_move (GFile * root, struct StructureItem item, const char *target_dir, (extra_flags == TEST_TARGET_IS_FILE)) { g_assert_cmpint (res, ==, FALSE); - if (item.file_type == G_FILE_TYPE_DIRECTORY) - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_RECURSE); - else - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY); } /* source file is directory */ else if ((item.extra_flags & TEST_COPY_ERROR_RECURSE) == @@ -1083,6 +1087,8 @@ cleanup_dir_recurse (GFile *parent, GFile *root) res = g_file_enumerator_close (enumerator, NULL, &error); g_assert_cmpint (res, ==, TRUE); g_assert_no_error (error); + + g_object_unref (enumerator); } static void diff --git a/gio/tests/memory-input-stream.c b/gio/tests/memory-input-stream.c index 6ffee86..6651695 100644 --- a/gio/tests/memory-input-stream.c +++ b/gio/tests/memory-input-stream.c @@ -63,6 +63,70 @@ test_read_chunks (void) g_assert_cmpint (res, ==, TRUE); g_assert_no_error (error); } + + g_object_unref (stream); +} + +static void +test_seek (void) +{ + const char *data1 = "abcdefghijklmnopqrstuvwxyz"; + const char *data2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + GInputStream *stream; + GError *error; + char buffer[10]; + + stream = g_memory_input_stream_new (); + + g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (stream), + data1, -1, NULL); + g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (stream), + data2, -1, NULL); + + g_assert (G_IS_SEEKABLE (stream)); + g_assert (g_seekable_can_seek (G_SEEKABLE (stream))); + + error = NULL; + g_assert (g_seekable_seek (G_SEEKABLE (stream), 26, G_SEEK_SET, NULL, &error)); + g_assert_no_error (error); + g_assert_cmpint (g_seekable_tell (G_SEEKABLE (stream)), ==, 26); + + g_assert (g_input_stream_read (stream, buffer, 1, NULL, &error) == 1); + g_assert_no_error (error); + + g_assert (buffer[0] == 'A'); + + g_assert (!g_seekable_seek (G_SEEKABLE (stream), 26, G_SEEK_CUR, NULL, &error)); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); + + g_object_unref (stream); +} + +static void +test_truncate (void) +{ + const char *data1 = "abcdefghijklmnopqrstuvwxyz"; + const char *data2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + GInputStream *stream; + GError *error; + + stream = g_memory_input_stream_new (); + + g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (stream), + data1, -1, NULL); + g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (stream), + data2, -1, NULL); + + g_assert (G_IS_SEEKABLE (stream)); + g_assert (!g_seekable_can_truncate (G_SEEKABLE (stream))); + + error = NULL; + g_assert (!g_seekable_truncate (G_SEEKABLE (stream), 26, NULL, &error)); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED); + g_error_free (error); + + g_object_unref (stream); } int @@ -73,6 +137,8 @@ main (int argc, g_test_init (&argc, &argv, NULL); g_test_add_func ("/memory-input-stream/read-chunks", test_read_chunks); + g_test_add_func ("/memory-input-stream/seek", test_seek); + g_test_add_func ("/memory-input-stream/truncate", test_truncate); return g_test_run(); } diff --git a/gio/tests/memory-output-stream.c b/gio/tests/memory-output-stream.c index c30e96f..210ad50 100644 --- a/gio/tests/memory-output-stream.c +++ b/gio/tests/memory-output-stream.c @@ -35,6 +35,7 @@ test_truncate (void) g_test_bug ("540423"); mo = g_memory_output_stream_new (NULL, 0, g_realloc, g_free); + g_assert (g_seekable_can_truncate (G_SEEKABLE (mo))); o = g_data_output_stream_new (mo); for (i = 0; i < 1000; i++) { @@ -54,6 +55,29 @@ test_truncate (void) } static void +test_seek (void) +{ + GOutputStream *mo; + GError *error; + + mo = g_memory_output_stream_new (g_new (gchar, 100), 100, g_realloc, g_free); + + g_assert (G_IS_SEEKABLE (mo)); + g_assert (g_seekable_can_seek (G_SEEKABLE (mo))); + + error = NULL; + g_assert (g_seekable_seek (G_SEEKABLE (mo), 26, G_SEEK_SET, NULL, &error)); + g_assert_no_error (error); + g_assert_cmpint (g_seekable_tell (G_SEEKABLE (mo)), ==, 26); + + g_assert (!g_seekable_seek (G_SEEKABLE (mo), 200, G_SEEK_CUR, NULL, &error)); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_error_free (error); + + g_object_unref (mo); +} + +static void test_data_size (void) { GOutputStream *mo; @@ -80,7 +104,9 @@ test_data_size (void) pos = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mo)); g_assert_cmpint (pos, ==, 1); - + + g_assert_cmpint (g_memory_output_stream_get_size (G_MEMORY_OUTPUT_STREAM (mo)), ==, 16); + g_object_unref (o); g_object_unref (mo); } @@ -115,7 +141,7 @@ test_properties (void) gpointer data_fun = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (mo)); gpointer data_prop; g_object_get (mo, "data", &data_prop, NULL); - g_assert_cmphex (data_fun, ==, data_prop); + g_assert_cmphex (GPOINTER_TO_SIZE (data_fun), ==, GPOINTER_TO_SIZE (data_prop)); g_object_unref (o); g_object_unref (mo); @@ -130,6 +156,7 @@ main (int argc, g_test_bug_base ("http://bugzilla.gnome.org/"); g_test_add_func ("/memory-output-stream/truncate", test_truncate); + g_test_add_func ("/memory-output-stream/seek", test_seek); g_test_add_func ("/memory-output-stream/get-data-size", test_data_size); g_test_add_func ("/memory-output-stream/properties", test_properties); diff --git a/gio/tests/network-address.c b/gio/tests/network-address.c new file mode 100644 index 0000000..aabb8ef --- /dev/null +++ b/gio/tests/network-address.c @@ -0,0 +1,94 @@ +#include + +static void +test_basic (void) +{ + GNetworkAddress *address; + guint port; + gchar *hostname; + + address = (GNetworkAddress*)g_network_address_new ("www.gnome.org", 8080); + + g_assert_cmpstr (g_network_address_get_hostname (address), ==, "www.gnome.org"); + g_assert_cmpint (g_network_address_get_port (address), ==, 8080); + + g_object_get (address, "hostname", &hostname, "port", &port, NULL); + g_assert_cmpstr (hostname, ==, "www.gnome.org"); + g_assert_cmpint (port, ==, 8080); + g_free (hostname); + + g_object_unref (address); +} + +typedef struct _ParseTest ParseTest; + +struct _ParseTest +{ + const gchar *input; + const gchar *hostname; + guint16 port; + gint error_code; +}; + +static ParseTest tests[] = +{ + { "www.gnome.org", "www.gnome.org", 1234, -1 }, + { "www.gnome.org:8080", "www.gnome.org", 8080, -1 }, + { "www.gnome.org:http", "www.gnome.org", 80, -1 }, + { "[2001:db8::1]", "2001:db8::1", 1234, -1 }, + { "[2001:db8::1]:888", "2001:db8::1", 888, -1 }, + { "[hostname", NULL, 0, G_IO_ERROR_INVALID_ARGUMENT }, + { "[hostnam]e", NULL, 0, G_IO_ERROR_INVALID_ARGUMENT }, + { "hostname:", NULL, 0, G_IO_ERROR_INVALID_ARGUMENT }, + { "hostname:-1", NULL, 0, G_IO_ERROR_INVALID_ARGUMENT }, + { "hostname:9999999", NULL, 0, G_IO_ERROR_INVALID_ARGUMENT } +}; + +static void +test_parse (gconstpointer d) +{ + const ParseTest *test = d; + GNetworkAddress *address; + GError *error; + + error = NULL; + address = (GNetworkAddress*)g_network_address_parse (test->input, 1234, &error); + + if (address) + { + g_assert_cmpstr (g_network_address_get_hostname (address), ==, test->hostname); + g_assert_cmpint (g_network_address_get_port (address), ==, test->port); + g_assert_no_error (error); + } + else + { + g_assert_error (error, G_IO_ERROR, test->error_code); + } + + if (address) + g_object_unref (address); + if (error) + g_error_free (error); +} + +int +main (int argc, char *argv[]) +{ + gint i; + gchar *path; + + g_type_init (); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/network-address/basic", test_basic); + + for (i = 0; i < G_N_ELEMENTS (tests); i++) + { + path = g_strdup_printf ("/network-address/parse/%d", i); + g_test_add_data_func (path, &tests[i], test_parse); + g_free (path); + } + + return g_test_run (); +} diff --git a/gio/tests/org.gtk.test.gschema b/gio/tests/org.gtk.test.gschema new file mode 100644 index 0000000..291b3e8 --- /dev/null +++ b/gio/tests/org.gtk.test.gschema @@ -0,0 +1,39 @@ +schema org.gtk.test: + gettext-domain: test + path: /tests/ + + key greeting = @s "Hello, earthlings" + l10n: messages + summary: A greeting + description: Greeting of the invading martians + key farewell = @s "So long" + l10n: messages + + child basic-types: + key test-boolean = @b true + key test-byte = @y 25 + key test-int16 = @n -1234 + key test-uint16 = @q 1234 + key test-int32 = @i -123456 + key test-uint32 = @u 123456 + key test-int64 = @x -123456789 + key test-uint64 = @t 123456789 + key test-double = @d 123.456 + key test-string = @s "a string, it seems" + key test-objectpath = @o "/a/object/path" + + child complex-types: + key test-tuple = @(s(ii)) ("one",(2,3)) + key test-array = @ai [0,1,2,3,4,5] + + child localized: + gettext-domain: glib20 + + key error-message = @s "Unnamed" + l10n: messages + + child binding: + key bool = @b false + key int = @i 0 + key double = @d 0 + key string = @s "" diff --git a/gio/tests/org.gtk.test.gschema.xml b/gio/tests/org.gtk.test.gschema.xml new file mode 100644 index 0000000..6d166d8 --- /dev/null +++ b/gio/tests/org.gtk.test.gschema.xml @@ -0,0 +1,167 @@ + + + + + "Hello, earthlings" + A greeting + + Greeting of the invading martians + + + + "So long" + + + + + + + + + + true + + + + + + true + + + 25 + + + -1234 + + + 1234 + + + -123456 + + + 123456 + + + -123456789 + + + 123456789 + + + 123.456 + + + "a string, it seems" + + + "/a/object/path" + + + + + + ("one",(2,3)) + + + [0,1,2,3,4,5] + + + + + + "Unnamed" + + + "BackSpace" + + + + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + "" + + + [48, 49] + + + [] + + + 'foo' + + + + + + 'bar' + + + + + + [] + + + + + + + + + [] + + + 'bar' + + + + + + 33 + + + + + + + 33 + + + + + + 0 + + + diff --git a/gio/tests/pollable.c b/gio/tests/pollable.c new file mode 100644 index 0000000..8669e2b --- /dev/null +++ b/gio/tests/pollable.c @@ -0,0 +1,240 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + +#ifdef G_OS_UNIX +#include +#include +#endif + +GMainLoop *loop; +GPollableInputStream *in; +GOutputStream *out; + +static gboolean +poll_source_callback (GPollableInputStream *in, + gpointer user_data) +{ + GError *error = NULL; + char buf[2]; + gssize nread; + gboolean *success = user_data; + + nread = g_pollable_input_stream_read_nonblocking (in, buf, 2, NULL, &error); + g_assert_no_error (error); + g_assert_cmpint (nread, ==, 2); + g_assert_cmpstr (buf, ==, "x"); + + *success = TRUE; + return FALSE; +} + +static gboolean +check_source_readability_callback (gpointer user_data) +{ + gboolean expected = GPOINTER_TO_INT (user_data); + gboolean readable; + + readable = g_pollable_input_stream_is_readable (in); + g_assert_cmpint (readable, ==, expected); + return FALSE; +} + +static gboolean +write_callback (gpointer user_data) +{ + char *buf = "x"; + gssize nwrote; + GError *error = NULL; + + nwrote = g_output_stream_write (out, buf, 2, NULL, &error); + g_assert_no_error (error); + g_assert_cmpint (nwrote, ==, 2); + + check_source_readability_callback (GINT_TO_POINTER (TRUE)); + + return FALSE; +} + +static gboolean +check_source_and_quit_callback (gpointer user_data) +{ + check_source_readability_callback (user_data); + g_main_loop_quit (loop); + return FALSE; +} + +static void +test_streams (void) +{ + gboolean readable; + GError *error = NULL; + char buf[1]; + gssize nread; + GSource *poll_source; + gboolean success = FALSE; + + readable = g_pollable_input_stream_is_readable (in); + g_assert (!readable); + + nread = g_pollable_input_stream_read_nonblocking (in, buf, 1, NULL, &error); + g_assert_cmpint (nread, ==, -1); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK); + g_clear_error (&error); + + /* Create 4 sources, in decreasing order of priority: + * 1. poll source on @in + * 2. idle source that checks if @in is readable once + * (it won't be) and then removes itself + * 3. idle source that writes a byte to @out, checks that + * @in is now readable, and removes itself + * 4. idle source that checks if @in is readable once + * (it won't be, since the poll source will fire before + * this one does) and then quits the loop. + * + * If the poll source triggers before it should, then it will get a + * %G_IO_ERROR_WOULD_BLOCK, and if check() fails in either + * direction, we will catch it at some point. + */ + + poll_source = g_pollable_input_stream_create_source (in, NULL); + g_source_set_priority (poll_source, 1); + g_source_set_callback (poll_source, (GSourceFunc) poll_source_callback, &success, NULL); + g_source_attach (poll_source, NULL); + g_source_unref (poll_source); + + g_idle_add_full (2, check_source_readability_callback, GINT_TO_POINTER (FALSE), NULL); + g_idle_add_full (3, write_callback, NULL, NULL); + g_idle_add_full (4, check_source_and_quit_callback, GINT_TO_POINTER (FALSE), NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + g_main_loop_unref (loop); + + g_assert_cmpint (success, ==, TRUE); +} + +#ifdef G_OS_UNIX +static void +test_pollable_unix (void) +{ + int pipefds[2], status; + + status = pipe (pipefds); + g_assert_cmpint (status, ==, 0); + + in = G_POLLABLE_INPUT_STREAM (g_unix_input_stream_new (pipefds[0], TRUE)); + out = g_unix_output_stream_new (pipefds[1], TRUE); + + test_streams (); + + g_object_unref (in); + g_object_unref (out); +} +#endif + +static void +client_connected (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GSocketClient *client = G_SOCKET_CLIENT (source); + GSocketConnection **conn = user_data; + GError *error = NULL; + + *conn = g_socket_client_connect_finish (client, result, &error); + g_assert_no_error (error); +} + +static void +server_connected (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GSocketListener *listener = G_SOCKET_LISTENER (source); + GSocketConnection **conn = user_data; + GError *error = NULL; + + *conn = g_socket_listener_accept_finish (listener, result, NULL, &error); + g_assert_no_error (error); +} + +static void +test_pollable_socket (void) +{ + GInetAddress *iaddr; + GSocketAddress *saddr, *effective_address; + GSocketListener *listener; + GSocketClient *client; + GError *error = NULL; + GSocketConnection *client_conn = NULL, *server_conn = NULL; + + iaddr = g_inet_address_new_loopback (G_SOCKET_FAMILY_IPV4); + saddr = g_inet_socket_address_new (iaddr, 0); + g_object_unref (iaddr); + + listener = g_socket_listener_new (); + g_socket_listener_add_address (listener, saddr, + G_SOCKET_TYPE_STREAM, + G_SOCKET_PROTOCOL_TCP, + NULL, + &effective_address, + &error); + g_assert_no_error (error); + g_object_unref (saddr); + + client = g_socket_client_new (); + + g_socket_client_connect_async (client, + G_SOCKET_CONNECTABLE (effective_address), + NULL, client_connected, &client_conn); + g_socket_listener_accept_async (listener, NULL, + server_connected, &server_conn); + + while (!client_conn || !server_conn) + g_main_context_iteration (NULL, TRUE); + + in = G_POLLABLE_INPUT_STREAM (g_io_stream_get_input_stream (G_IO_STREAM (client_conn))); + out = g_io_stream_get_output_stream (G_IO_STREAM (server_conn)); + + test_streams (); + + g_object_unref (client_conn); + g_object_unref (server_conn); + g_object_unref (client); + g_object_unref (listener); +} + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + +#ifdef G_OS_UNIX + g_test_add_func ("/pollable/unix", test_pollable_unix); +#endif + g_test_add_func ("/pollable/socket", test_pollable_socket); + + return g_test_run(); +} + diff --git a/gio/tests/proxy.c b/gio/tests/proxy.c new file mode 100644 index 0000000..cf54d69 --- /dev/null +++ b/gio/tests/proxy.c @@ -0,0 +1,662 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2010 Collabora, Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Nicolas Dufresne + */ + +#include "config.h" + +#include +#include +#include + +#include +#include + +#include "glibintl.h" + +#ifdef G_OS_UNIX +#include "gio/gunixsocketaddress.h" +#endif + +static const gchar *info = NULL; +static GCancellable *cancellable = NULL; +static gint return_value = 0; + +static void G_GNUC_NORETURN +usage (void) +{ + fprintf (stderr, "Usage: proxy [-s] (uri|host:port|ip:port|path|srv/protocol/domain)\n"); + fprintf (stderr, " Use -t to enable threading.\n"); + fprintf (stderr, " Use -s to do synchronous lookups.\n"); + fprintf (stderr, " Use -c to cancel operation.\n"); + fprintf (stderr, " Use -e to use enumerator.\n"); + fprintf (stderr, " Use -inet to use GInetSocketAddress enumerator (ip:port).\n"); +#ifdef G_OS_UNIX + fprintf (stderr, " Use -unix to use GUnixSocketAddress enumerator (path).\n"); +#endif + fprintf (stderr, " Use -proxyaddr tp use GProxyAddress enumerator " + "(ip:port:protocol:dest_host:dest_port[:username[:password]]).\n"); + fprintf (stderr, " Use -netaddr to use GNetworkAddress enumerator (host:port).\n"); + fprintf (stderr, " Use -neturi to use GNetworkAddress enumerator (uri).\n"); + fprintf (stderr, " Use -netsrv to use GNetworkService enumerator (srv/protocol/domain).\n"); + fprintf (stderr, " Use -connect to create a connection using GSocketClient object (uri).\n"); + exit (1); +} + +static void +print_and_free_error (GError *error) +{ + fprintf (stderr, "Failed to obtain proxies: %s\n", error->message); + g_error_free (error); + return_value = 1; +} + +static void +print_proxies (const gchar *info, gchar **proxies) +{ + printf ("Proxies for URI '%s' are:\n", info); + + if (proxies == NULL || proxies[0] == NULL) + printf ("\tnone\n"); + else + for (; proxies[0]; proxies++) + printf ("\t%s\n", proxies[0]); +} + +static void +_proxy_lookup_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + gchar **proxies; + GMainLoop *loop = user_data; + + proxies = g_proxy_resolver_lookup_finish (G_PROXY_RESOLVER (source_object), + result, + &error); + if (error) + { + print_and_free_error (error); + } + else + { + print_proxies (info, proxies); + g_strfreev (proxies); + } + + g_main_loop_quit (loop); +} + +static void +use_resolver (gboolean synchronous) +{ + GProxyResolver *resolver; + + resolver = g_proxy_resolver_get_default (); + + if (synchronous) + { + GError *error = NULL; + gchar **proxies; + + proxies = g_proxy_resolver_lookup (resolver, info, cancellable, &error); + + if (error) + print_and_free_error (error); + else + print_proxies (info, proxies); + + g_strfreev (proxies); + } + else + { + GMainLoop *loop = g_main_loop_new (NULL, FALSE); + + g_proxy_resolver_lookup_async (resolver, + info, + cancellable, + _proxy_lookup_cb, + loop); + + g_main_loop_run (loop); + g_main_loop_unref (loop); + } +} + +static void +print_proxy_address (GSocketAddress *sockaddr) +{ + GProxyAddress *proxy = NULL; + + if (sockaddr == NULL) + { + printf ("\tdirect://\n"); + return; + } + + if (G_IS_PROXY_ADDRESS (sockaddr)) + { + proxy = G_PROXY_ADDRESS (sockaddr); + printf ("\t%s://", g_proxy_address_get_protocol(proxy)); + } + else + { + printf ("\tdirect://"); + } + + if (G_IS_INET_SOCKET_ADDRESS (sockaddr)) + { + GInetAddress *inetaddr; + guint port; + gchar *addr; + + g_object_get (sockaddr, + "address", &inetaddr, + "port", &port, + NULL); + + addr = g_inet_address_to_string (inetaddr); + + printf ("%s:%u", addr, port); + + g_free (addr); + } + + if (proxy) + { + if (g_proxy_address_get_username(proxy)) + printf (" (Username: %s Password: %s)", + g_proxy_address_get_username(proxy), + g_proxy_address_get_password(proxy)); + printf (" (Hostname: %s, Port: %i)", + g_proxy_address_get_destination_hostname (proxy), + g_proxy_address_get_destination_port (proxy)); + } + + printf ("\n"); +} + +static void +_proxy_enumerate_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + GMainLoop *loop = user_data; + GSocketAddressEnumerator *enumerator = G_SOCKET_ADDRESS_ENUMERATOR (object); + GSocketAddress *sockaddr; + + sockaddr = g_socket_address_enumerator_next_finish (enumerator, + result, + &error); + if (sockaddr) + { + print_proxy_address (sockaddr); + g_socket_address_enumerator_next_async (enumerator, + cancellable, + _proxy_enumerate_cb, + loop); + g_object_unref (sockaddr); + } + else + { + if (error) + print_and_free_error (error); + + g_main_loop_quit (loop); + } +} + +static void +run_with_enumerator (gboolean synchronous, GSocketAddressEnumerator *enumerator) +{ + GError *error = NULL; + + if (synchronous) + { + GSocketAddress *sockaddr; + + while ((sockaddr = g_socket_address_enumerator_next (enumerator, + cancellable, + &error))) + { + print_proxy_address (sockaddr); + g_object_unref (sockaddr); + } + + if (error) + print_and_free_error (error); + } + else + { + GMainLoop *loop = g_main_loop_new (NULL, FALSE); + + g_socket_address_enumerator_next_async (enumerator, + cancellable, + _proxy_enumerate_cb, + loop); + g_main_loop_run (loop); + g_main_loop_unref (loop); + } +} + +static void +use_enumerator (gboolean synchronous) +{ + GSocketAddressEnumerator *enumerator; + + enumerator = g_object_new (G_TYPE_PROXY_ADDRESS_ENUMERATOR, + "uri", info, + NULL); + + printf ("Proxies for URI '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} + +static void +use_inet_address (gboolean synchronous) +{ + GSocketAddressEnumerator *enumerator; + GSocketAddress *sockaddr; + GInetAddress *addr; + guint port = 0; + gchar **ip_and_port; + + ip_and_port = g_strsplit (info, ":", 2); + + if (ip_and_port[0]) + { + addr = g_inet_address_new_from_string (ip_and_port[0]); + if (ip_and_port [1]) + port = strtoul (ip_and_port [1], NULL, 10); + } + + g_strfreev (ip_and_port); + + if (addr == NULL || port <= 0 || port >= 65535) + { + fprintf (stderr, "Bad 'ip:port' parameter '%s'\n", info); + if (addr) + g_object_unref (addr); + return_value = 1; + return; + } + + sockaddr = g_inet_socket_address_new (addr, port); + g_object_unref (addr); + + enumerator = + g_socket_connectable_proxy_enumerate (G_SOCKET_CONNECTABLE (sockaddr)); + g_object_unref (sockaddr); + + printf ("Proxies for ip and port '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} + +#ifdef G_OS_UNIX +static void +use_unix_address (gboolean synchronous) +{ + GSocketAddressEnumerator *enumerator; + GSocketAddress *sockaddr; + + sockaddr = g_unix_socket_address_new_abstract (info, -1); + + if (sockaddr == NULL) + { + fprintf (stderr, "Failed to create unix socket with name '%s'\n", info); + return_value = 1; + return; + } + + enumerator = + g_socket_connectable_proxy_enumerate (G_SOCKET_CONNECTABLE (sockaddr)); + g_object_unref (sockaddr); + + printf ("Proxies for path '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} +#endif + +static void +use_proxy_address (gboolean synchronous) +{ + GSocketAddressEnumerator *enumerator; + GSocketAddress *sockaddr; + GInetAddress *addr; + guint port = 0; + gchar *protocol; + gchar *dest_host; + guint dest_port; + gchar *username = NULL; + gchar *password = NULL; + gchar **split_info; + + split_info = g_strsplit (info, ":", 7); + + if (!split_info[0] + || !split_info[1] + || !split_info[2] + || !split_info[3] + || !split_info[4]) + { + fprintf (stderr, "Bad 'ip:port:protocol:dest_host:dest_port' parameter '%s'\n", info); + return_value = 1; + return; + } + + addr = g_inet_address_new_from_string (split_info[0]); + port = strtoul (split_info [1], NULL, 10); + protocol = g_strdup (split_info[2]); + dest_host = g_strdup (split_info[3]); + dest_port = strtoul (split_info[4], NULL, 10); + + if (split_info[5]) + { + username = g_strdup (split_info[5]); + if (split_info[6]) + password = g_strdup (split_info[6]); + } + + g_strfreev (split_info); + + sockaddr = g_proxy_address_new (addr, port, + protocol, dest_host, dest_port, + username, password); + + g_object_unref (addr); + g_free (protocol); + g_free (dest_host); + g_free (username); + g_free (password); + + enumerator = + g_socket_connectable_proxy_enumerate (G_SOCKET_CONNECTABLE (sockaddr)); + g_object_unref (sockaddr); + + printf ("Proxies for ip and port '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} + +static void +use_network_address (gboolean synchronous) +{ + GError *error = NULL; + GSocketAddressEnumerator *enumerator; + GSocketConnectable *connectable; + + connectable = g_network_address_parse (info, -1, &error); + + if (error) + { + print_and_free_error (error); + return; + } + + enumerator = g_socket_connectable_proxy_enumerate (connectable); + g_object_unref (connectable); + + printf ("Proxies for hostname and port '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} + +static void +use_network_uri (gboolean synchronous) +{ + GError *error = NULL; + GSocketAddressEnumerator *enumerator; + GSocketConnectable *connectable; + + connectable = g_network_address_parse_uri (info, 0, &error); + + if (error) + { + print_and_free_error (error); + return; + } + + enumerator = g_socket_connectable_proxy_enumerate (connectable); + g_object_unref (connectable); + + printf ("Proxies for URI '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} + +static void +use_network_service (gboolean synchronous) +{ + GSocketAddressEnumerator *enumerator; + GSocketConnectable *connectable = NULL; + gchar **split; + + split = g_strsplit (info, "/", 3); + + if (split[0] && split[1] && split[2]) + connectable = g_network_service_new (split[0], split[1], split[2]); + + g_strfreev (split); + + if (connectable == NULL) + { + fprintf (stderr, "Bad 'srv/protocol/domain' parameter '%s'\n", info); + return_value = 1; + return; + } + + enumerator = g_socket_connectable_proxy_enumerate (connectable); + g_object_unref (connectable); + + printf ("Proxies for hostname and port '%s' are:\n", info); + run_with_enumerator (synchronous, enumerator); + + g_object_unref (enumerator); +} + +static void +_socket_connect_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + GMainLoop *loop = user_data; + GSocketClient *client = G_SOCKET_CLIENT (object); + GSocketConnection *connection; + + connection = g_socket_client_connect_to_uri_finish (client, + result, + &error); + if (connection) + { + GSocketAddress *proxy_addr; + proxy_addr = g_socket_connection_get_remote_address (connection, NULL); + print_proxy_address (proxy_addr); + } + else + { + print_and_free_error (error); + } + + g_main_loop_quit (loop); +} + +static void +use_socket_client (gboolean synchronous) +{ + GError *error = NULL; + GSocketClient *client; + + client = g_socket_client_new (); + + printf ("Proxies for URI '%s' are:\n", info); + + if (synchronous) + { + GSocketConnection *connection; + GSocketAddress *proxy_addr; + + connection = g_socket_client_connect_to_uri (client, + info, + 0, + cancellable, + &error); + + if (connection) + { + proxy_addr = g_socket_connection_get_remote_address (connection, NULL); + print_proxy_address (proxy_addr); + } + else + { + print_and_free_error (error); + } + } + else + { + GMainLoop *loop = g_main_loop_new (NULL, FALSE); + + g_socket_client_connect_to_uri_async (client, + info, + 0, + cancellable, + _socket_connect_cb, + loop); + + g_main_loop_run (loop); + g_main_loop_unref (loop); + } + + g_object_unref (client); +} + +typedef enum +{ + USE_RESOLVER, + USE_ENUMERATOR, +#ifdef G_OS_UNIX + USE_UNIX_SOCKET_ADDRESS, +#endif + USE_INET_SOCKET_ADDRESS, + USE_PROXY_ADDRESS, + USE_NETWORK_ADDRESS, + USE_NETWORK_URI, + USE_NETWORK_SERVICE, + USE_SOCKET_CLIENT, +} ProxyTestType; + +gint +main (gint argc, gchar **argv) +{ + gboolean synchronous = FALSE; + gboolean cancel = FALSE; + ProxyTestType type = USE_RESOLVER; + + g_type_init (); + + while (argc >= 2 && argv[1][0] == '-') + { + if (!strcmp (argv[1], "-s")) + synchronous = TRUE; + else if (!strcmp (argv[1], "-c")) + cancel = TRUE; + else if (!strcmp (argv[1], "-e")) + type = USE_ENUMERATOR; + else if (!strcmp (argv[1], "-inet")) + type = USE_INET_SOCKET_ADDRESS; +#ifdef G_OS_UNIX + else if (!strcmp (argv[1], "-unix")) + type = USE_UNIX_SOCKET_ADDRESS; +#endif + else if (!strcmp (argv[1], "-proxyaddr")) + type = USE_PROXY_ADDRESS; + else if (!strcmp (argv[1], "-netaddr")) + type = USE_NETWORK_ADDRESS; + else if (!strcmp (argv[1], "-neturi")) + type = USE_NETWORK_URI; + else if (!strcmp (argv[1], "-netsrv")) + type = USE_NETWORK_SERVICE; + else if (!strcmp (argv[1], "-connect")) + type = USE_SOCKET_CLIENT; + else + usage (); + + argv++; + argc--; + } + + if (argc != 2) + usage (); + + /* Save URI for asynchronous callback */ + info = argv[1]; + + if (cancel) + { + cancellable = g_cancellable_new (); + g_cancellable_cancel (cancellable); + } + + switch (type) + { + case USE_RESOLVER: + use_resolver (synchronous); + break; + case USE_ENUMERATOR: + use_enumerator (synchronous); + break; + case USE_INET_SOCKET_ADDRESS: + use_inet_address (synchronous); + break; +#ifdef G_OS_UNIX + case USE_UNIX_SOCKET_ADDRESS: + use_unix_address (synchronous); + break; +#endif + case USE_PROXY_ADDRESS: + use_proxy_address (synchronous); + break; + case USE_NETWORK_ADDRESS: + use_network_address (synchronous); + break; + case USE_NETWORK_URI: + use_network_uri (synchronous); + break; + case USE_NETWORK_SERVICE: + use_network_service (synchronous); + break; + case USE_SOCKET_CLIENT: + use_socket_client (synchronous); + break; + } + + return return_value; +} diff --git a/gio/tests/readwrite.c b/gio/tests/readwrite.c index 2b1bd5e..7836270 100644 --- a/gio/tests/readwrite.c +++ b/gio/tests/readwrite.c @@ -110,12 +110,13 @@ verify_iostream (GFileIOStream *file_iostream) res = g_output_stream_write_all (out, new_data, strlen (new_data), &n_bytes, NULL, &error); g_assert (!res); - g_assert (error != NULL); - g_assert (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED)); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED); + g_error_free (error); error = NULL; res = g_io_stream_close (iostream, NULL, &error); - g_assert (res && error == NULL); + g_assert (res); + g_assert_no_error (error); g_free (modified_data); } @@ -154,6 +155,7 @@ test_g_file_open_readwrite (void) error = NULL; file_iostream = g_file_open_readwrite (file, NULL, &error); g_assert (file_iostream != NULL); + g_object_unref (file); verify_iostream (file_iostream); @@ -184,7 +186,8 @@ test_g_file_create_readwrite (void) error = NULL; file_iostream = g_file_create_readwrite (file, 0, NULL, &error); g_assert (file_iostream == NULL); - g_assert (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS); + g_error_free (error); g_unlink (tmp_file); file_iostream = g_file_create_readwrite (file, 0, NULL, &error); @@ -204,6 +207,7 @@ test_g_file_create_readwrite (void) verify_iostream (file_iostream); g_object_unref (file_iostream); + g_object_unref (file); g_unlink (tmp_file); g_free (tmp_file); @@ -259,6 +263,7 @@ test_g_file_replace_readwrite (void) verify_iostream (file_iostream); g_object_unref (file_iostream); + g_object_unref (file); backup = g_strconcat (tmp_file, "~", NULL); res = g_file_get_contents (backup, diff --git a/gio/tests/resolver.c b/gio/tests/resolver.c index 64bc67e..0b2a3fd 100644 --- a/gio/tests/resolver.c +++ b/gio/tests/resolver.c @@ -41,11 +41,12 @@ static void G_GNUC_NORETURN usage (void) { fprintf (stderr, "Usage: resolver [-t] [-s] [hostname | IP | service/protocol/domain ] ...\n"); - fprintf (stderr, " resolver [-t] [-s] -c [hostname | IP | service/protocol/domain ]\n"); + fprintf (stderr, " resolver [-t] [-s] -c NUMBER [hostname | IP | service/protocol/domain ]\n"); fprintf (stderr, " Use -t to enable threading.\n"); fprintf (stderr, " Use -s to do synchronous lookups.\n"); fprintf (stderr, " Both together will result in simultaneous lookups in multiple threads\n"); - fprintf (stderr, " Use -c (and only a single resolvable argument) to test GSocketConnectable.\n"); + fprintf (stderr, " Use -c NUMBER(and only a single resolvable argument) to test GSocketConnectable.\n"); + fprintf (stderr, " The given NUMBER determines how often the connectable will be enumerated.\n"); exit (1); } @@ -360,7 +361,7 @@ do_async_connectable (GSocketAddressEnumerator *enumerator) } static void -do_connectable (const char *arg, gboolean synchronous) +do_connectable (const char *arg, gboolean synchronous, guint count) { char **parts; GSocketConnectable *connectable; @@ -400,13 +401,17 @@ do_connectable (const char *arg, gboolean synchronous) connectable = g_network_address_new (arg, port); } - enumerator = g_socket_connectable_enumerate (connectable); - g_object_unref (connectable); + while (count--) + { + enumerator = g_socket_connectable_enumerate (connectable); - if (synchronous) - do_sync_connectable (enumerator); - else - do_async_connectable (enumerator); + if (synchronous) + do_sync_connectable (enumerator); + else + do_async_connectable (enumerator); + } + + g_object_unref (connectable); } #ifdef G_OS_UNIX @@ -434,7 +439,7 @@ int main (int argc, char **argv) { gboolean threaded = FALSE, synchronous = FALSE; - gboolean use_connectable = FALSE; + guint connectable_count = 0; #ifdef G_OS_UNIX GIOChannel *chan; guint watch; @@ -453,7 +458,11 @@ main (int argc, char **argv) else if (!strcmp (argv[1], "-s")) synchronous = TRUE; else if (!strcmp (argv[1], "-c")) - use_connectable = TRUE; + { + connectable_count = atoi (argv[2]); + argv++; + argc--; + } else usage (); @@ -462,7 +471,7 @@ main (int argc, char **argv) } g_type_init (); - if (argc < 2 || (argc > 2 && use_connectable)) + if (argc < 2 || (argc > 2 && connectable_count)) usage (); resolver = g_resolver_get_default (); @@ -488,8 +497,11 @@ main (int argc, char **argv) nlookups = argc - 1; loop = g_main_loop_new (NULL, TRUE); - if (use_connectable) - do_connectable (argv[1], synchronous); + if (connectable_count) + { + nlookups = connectable_count; + do_connectable (argv[1], synchronous, connectable_count); + } else { if (threaded && synchronous) diff --git a/gio/tests/schema-tests/array-default-not-in-choices.gschema.xml b/gio/tests/schema-tests/array-default-not-in-choices.gschema.xml new file mode 100644 index 0000000..b6fffc6 --- /dev/null +++ b/gio/tests/schema-tests/array-default-not-in-choices.gschema.xml @@ -0,0 +1,11 @@ + + + + + + + + ["first","last","second"] + + + diff --git a/gio/tests/schema-tests/bad-choice.gschema.xml b/gio/tests/schema-tests/bad-choice.gschema.xml new file mode 100644 index 0000000..07640d5 --- /dev/null +++ b/gio/tests/schema-tests/bad-choice.gschema.xml @@ -0,0 +1,14 @@ + + + + 'how' + + + + + + + + + + diff --git a/gio/tests/schema-tests/bad-key.gschema.xml b/gio/tests/schema-tests/bad-key.gschema.xml new file mode 100644 index 0000000..f98cc7c --- /dev/null +++ b/gio/tests/schema-tests/bad-key.gschema.xml @@ -0,0 +1,7 @@ + + + + '' + + + diff --git a/gio/tests/schema-tests/bad-key2.gschema.xml b/gio/tests/schema-tests/bad-key2.gschema.xml new file mode 100644 index 0000000..b7c4e7b --- /dev/null +++ b/gio/tests/schema-tests/bad-key2.gschema.xml @@ -0,0 +1,7 @@ + + + + '' + + + diff --git a/gio/tests/schema-tests/bad-key3.gschema.xml b/gio/tests/schema-tests/bad-key3.gschema.xml new file mode 100644 index 0000000..208a02d --- /dev/null +++ b/gio/tests/schema-tests/bad-key3.gschema.xml @@ -0,0 +1,7 @@ + + + + '' + + + diff --git a/gio/tests/schema-tests/bad-key4.gschema.xml b/gio/tests/schema-tests/bad-key4.gschema.xml new file mode 100644 index 0000000..6a3777c --- /dev/null +++ b/gio/tests/schema-tests/bad-key4.gschema.xml @@ -0,0 +1,7 @@ + + + + '' + + + diff --git a/gio/tests/schema-tests/bad-type.gschema.xml b/gio/tests/schema-tests/bad-type.gschema.xml new file mode 100644 index 0000000..9b74684 --- /dev/null +++ b/gio/tests/schema-tests/bad-type.gschema.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gio/tests/schema-tests/bare-alias.gschema.xml b/gio/tests/schema-tests/bare-alias.gschema.xml new file mode 100644 index 0000000..52184cd --- /dev/null +++ b/gio/tests/schema-tests/bare-alias.gschema.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gio/tests/schema-tests/choice-alias.gschema.xml b/gio/tests/schema-tests/choice-alias.gschema.xml new file mode 100644 index 0000000..d5c9279 --- /dev/null +++ b/gio/tests/schema-tests/choice-alias.gschema.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + 'after' + + + diff --git a/gio/tests/schema-tests/choice-bad.gschema.xml b/gio/tests/schema-tests/choice-bad.gschema.xml new file mode 100644 index 0000000..4a2dbc2 --- /dev/null +++ b/gio/tests/schema-tests/choice-bad.gschema.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + 'how' + + + diff --git a/gio/tests/schema-tests/choice-badtype.gschema.xml b/gio/tests/schema-tests/choice-badtype.gschema.xml new file mode 100644 index 0000000..88104c5 --- /dev/null +++ b/gio/tests/schema-tests/choice-badtype.gschema.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gio/tests/schema-tests/choice-invalid-alias.gschema.xml b/gio/tests/schema-tests/choice-invalid-alias.gschema.xml new file mode 100644 index 0000000..ae5bcd3 --- /dev/null +++ b/gio/tests/schema-tests/choice-invalid-alias.gschema.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + 'after' + + + diff --git a/gio/tests/schema-tests/choice-missing-value.gschema.xml b/gio/tests/schema-tests/choice-missing-value.gschema.xml new file mode 100644 index 0000000..d900fc5 --- /dev/null +++ b/gio/tests/schema-tests/choice-missing-value.gschema.xml @@ -0,0 +1,10 @@ + + + + + + + "a" + + + diff --git a/gio/tests/schema-tests/choice-shadowed-alias.gschema.xml b/gio/tests/schema-tests/choice-shadowed-alias.gschema.xml new file mode 100644 index 0000000..fb68e32 --- /dev/null +++ b/gio/tests/schema-tests/choice-shadowed-alias.gschema.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + 'after' + + + diff --git a/gio/tests/schema-tests/choice-upside-down.gschema.xml b/gio/tests/schema-tests/choice-upside-down.gschema.xml new file mode 100644 index 0000000..ea6f532 --- /dev/null +++ b/gio/tests/schema-tests/choice-upside-down.gschema.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + 'who' + + + diff --git a/gio/tests/schema-tests/choice.gschema.xml b/gio/tests/schema-tests/choice.gschema.xml new file mode 100644 index 0000000..c9d7426 --- /dev/null +++ b/gio/tests/schema-tests/choice.gschema.xml @@ -0,0 +1,14 @@ + + + + 'who' + + + + + + + + + + diff --git a/gio/tests/schema-tests/choices-wrong-type.gschema.xml b/gio/tests/schema-tests/choices-wrong-type.gschema.xml new file mode 100644 index 0000000..7e6f14c --- /dev/null +++ b/gio/tests/schema-tests/choices-wrong-type.gschema.xml @@ -0,0 +1,8 @@ + + + + + (1,"a") + + + diff --git a/gio/tests/schema-tests/default-in-aliases.gschema.xml b/gio/tests/schema-tests/default-in-aliases.gschema.xml new file mode 100644 index 0000000..81d639f --- /dev/null +++ b/gio/tests/schema-tests/default-in-aliases.gschema.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + 'pre' + + + diff --git a/gio/tests/schema-tests/default-not-in-choices.gschema.xml b/gio/tests/schema-tests/default-not-in-choices.gschema.xml new file mode 100644 index 0000000..ec4a08d --- /dev/null +++ b/gio/tests/schema-tests/default-not-in-choices.gschema.xml @@ -0,0 +1,11 @@ + + + + + + + + "next-to-last" + + + diff --git a/gio/tests/schema-tests/default-out-of-range.gschema.xml b/gio/tests/schema-tests/default-out-of-range.gschema.xml new file mode 100644 index 0000000..8b3cbd3 --- /dev/null +++ b/gio/tests/schema-tests/default-out-of-range.gschema.xml @@ -0,0 +1,8 @@ + + + + + -1 + + + diff --git a/gio/tests/schema-tests/empty-key.gschema.xml b/gio/tests/schema-tests/empty-key.gschema.xml new file mode 100644 index 0000000..3c5c05c --- /dev/null +++ b/gio/tests/schema-tests/empty-key.gschema.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-aliases.gschema.xml b/gio/tests/schema-tests/enum-with-aliases.gschema.xml new file mode 100644 index 0000000..e8c1e68 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-aliases.gschema.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + 'spam' + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-bad-default.gschema.xml b/gio/tests/schema-tests/enum-with-bad-default.gschema.xml new file mode 100644 index 0000000..aee0867 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-bad-default.gschema.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + 'nie' + + + diff --git a/gio/tests/schema-tests/enum-with-chained-alias.gschema.xml b/gio/tests/schema-tests/enum-with-chained-alias.gschema.xml new file mode 100644 index 0000000..65c31e3 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-chained-alias.gschema.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + 'spam' + + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-choice.gschema.xml b/gio/tests/schema-tests/enum-with-choice.gschema.xml new file mode 100644 index 0000000..50caf21 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-choice.gschema.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + 'spam' + + + + diff --git a/gio/tests/schema-tests/enum-with-invalid-alias.gschema.xml b/gio/tests/schema-tests/enum-with-invalid-alias.gschema.xml new file mode 100644 index 0000000..51a51fd --- /dev/null +++ b/gio/tests/schema-tests/enum-with-invalid-alias.gschema.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + 'spam' + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-repeated-alias.gschema.xml b/gio/tests/schema-tests/enum-with-repeated-alias.gschema.xml new file mode 100644 index 0000000..a13ef89 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-repeated-alias.gschema.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + 'spam' + + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-repeated-nick.gschema.xml b/gio/tests/schema-tests/enum-with-repeated-nick.gschema.xml new file mode 100644 index 0000000..8910711 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-repeated-nick.gschema.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-repeated-value.gschema.xml b/gio/tests/schema-tests/enum-with-repeated-value.gschema.xml new file mode 100644 index 0000000..a357d11 --- /dev/null +++ b/gio/tests/schema-tests/enum-with-repeated-value.gschema.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/gio/tests/schema-tests/enum-with-shadow-alias.gschema.xml b/gio/tests/schema-tests/enum-with-shadow-alias.gschema.xml new file mode 100644 index 0000000..52e30ee --- /dev/null +++ b/gio/tests/schema-tests/enum-with-shadow-alias.gschema.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + 'spam' + + + + + + + diff --git a/gio/tests/schema-tests/enum.gschema.xml b/gio/tests/schema-tests/enum.gschema.xml new file mode 100644 index 0000000..8cf5879 --- /dev/null +++ b/gio/tests/schema-tests/enum.gschema.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + 'spam' + + + diff --git a/gio/tests/schema-tests/extend-and-shadow-indirect.gschema.xml b/gio/tests/schema-tests/extend-and-shadow-indirect.gschema.xml new file mode 100644 index 0000000..dc066dd --- /dev/null +++ b/gio/tests/schema-tests/extend-and-shadow-indirect.gschema.xml @@ -0,0 +1,17 @@ + + + + '' + + + + + + '' + + + + + + + diff --git a/gio/tests/schema-tests/extend-and-shadow.gschema.xml b/gio/tests/schema-tests/extend-and-shadow.gschema.xml new file mode 100644 index 0000000..79935b4 --- /dev/null +++ b/gio/tests/schema-tests/extend-and-shadow.gschema.xml @@ -0,0 +1,17 @@ + + + + '' + + + + + + '' + + + + + + + diff --git a/gio/tests/schema-tests/extend-missing.gschema.xml b/gio/tests/schema-tests/extend-missing.gschema.xml new file mode 100644 index 0000000..675803a --- /dev/null +++ b/gio/tests/schema-tests/extend-missing.gschema.xml @@ -0,0 +1,3 @@ + + + diff --git a/gio/tests/schema-tests/extend-nonlist.gschema.xml b/gio/tests/schema-tests/extend-nonlist.gschema.xml new file mode 100644 index 0000000..7008cee --- /dev/null +++ b/gio/tests/schema-tests/extend-nonlist.gschema.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gio/tests/schema-tests/extend-self.gschema.xml b/gio/tests/schema-tests/extend-self.gschema.xml new file mode 100644 index 0000000..f5b0c3d --- /dev/null +++ b/gio/tests/schema-tests/extend-self.gschema.xml @@ -0,0 +1,3 @@ + + + diff --git a/gio/tests/schema-tests/extend-wrong-list-indirect.gschema.xml b/gio/tests/schema-tests/extend-wrong-list-indirect.gschema.xml new file mode 100644 index 0000000..a336db7 --- /dev/null +++ b/gio/tests/schema-tests/extend-wrong-list-indirect.gschema.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/gio/tests/schema-tests/extend-wrong-list.gschema.xml b/gio/tests/schema-tests/extend-wrong-list.gschema.xml new file mode 100644 index 0000000..4232dc2 --- /dev/null +++ b/gio/tests/schema-tests/extend-wrong-list.gschema.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/gio/tests/schema-tests/extending.gschema.xml b/gio/tests/schema-tests/extending.gschema.xml new file mode 100644 index 0000000..98882c7 --- /dev/null +++ b/gio/tests/schema-tests/extending.gschema.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/gio/tests/schema-tests/flags-aliased-default.gschema.xml b/gio/tests/schema-tests/flags-aliased-default.gschema.xml new file mode 100644 index 0000000..c36bd62 --- /dev/null +++ b/gio/tests/schema-tests/flags-aliased-default.gschema.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + ['speaking'] + + + + diff --git a/gio/tests/schema-tests/flags-bad-default.gschema.xml b/gio/tests/schema-tests/flags-bad-default.gschema.xml new file mode 100644 index 0000000..d412057 --- /dev/null +++ b/gio/tests/schema-tests/flags-bad-default.gschema.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + ['speaking'] + + + + diff --git a/gio/tests/schema-tests/flags-more-than-one-bit.gschema.xml b/gio/tests/schema-tests/flags-more-than-one-bit.gschema.xml new file mode 100644 index 0000000..ce2faaf --- /dev/null +++ b/gio/tests/schema-tests/flags-more-than-one-bit.gschema.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/gio/tests/schema-tests/flags-with-enum-attr.gschema.xml b/gio/tests/schema-tests/flags-with-enum-attr.gschema.xml new file mode 100644 index 0000000..a48547f --- /dev/null +++ b/gio/tests/schema-tests/flags-with-enum-attr.gschema.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/gio/tests/schema-tests/flags-with-enum-tag.gschema.xml b/gio/tests/schema-tests/flags-with-enum-tag.gschema.xml new file mode 100644 index 0000000..4b2fb90 --- /dev/null +++ b/gio/tests/schema-tests/flags-with-enum-tag.gschema.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/gio/tests/schema-tests/from-docs.gschema.xml b/gio/tests/schema-tests/from-docs.gschema.xml new file mode 100644 index 0000000..4fe45c7 --- /dev/null +++ b/gio/tests/schema-tests/from-docs.gschema.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + 10 + + + + + + + + + + + + + 'Joe' + + + + 'first' + + + + diff --git a/gio/tests/schema-tests/incomplete-list.gschema.xml b/gio/tests/schema-tests/incomplete-list.gschema.xml new file mode 100644 index 0000000..df33e84 --- /dev/null +++ b/gio/tests/schema-tests/incomplete-list.gschema.xml @@ -0,0 +1,7 @@ + + + + [1,2,3 + + + diff --git a/gio/tests/schema-tests/inherit-gettext-domain.gschema.xml b/gio/tests/schema-tests/inherit-gettext-domain.gschema.xml new file mode 100644 index 0000000..1f0ca89 --- /dev/null +++ b/gio/tests/schema-tests/inherit-gettext-domain.gschema.xml @@ -0,0 +1,8 @@ + + + + + 'value' + + + diff --git a/gio/tests/schema-tests/invalid-path.gschema.xml b/gio/tests/schema-tests/invalid-path.gschema.xml new file mode 100644 index 0000000..85ecd4c --- /dev/null +++ b/gio/tests/schema-tests/invalid-path.gschema.xml @@ -0,0 +1,3 @@ + + + diff --git a/gio/tests/schema-tests/key-in-list-indirect.gschema.xml b/gio/tests/schema-tests/key-in-list-indirect.gschema.xml new file mode 100644 index 0000000..6f0bea1 --- /dev/null +++ b/gio/tests/schema-tests/key-in-list-indirect.gschema.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/gio/tests/schema-tests/key-in-list.gschema.xml b/gio/tests/schema-tests/key-in-list.gschema.xml new file mode 100644 index 0000000..e2a967a --- /dev/null +++ b/gio/tests/schema-tests/key-in-list.gschema.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/gio/tests/schema-tests/list-of-missing.gschema.xml b/gio/tests/schema-tests/list-of-missing.gschema.xml new file mode 100644 index 0000000..f5ef476 --- /dev/null +++ b/gio/tests/schema-tests/list-of-missing.gschema.xml @@ -0,0 +1,3 @@ + + + diff --git a/gio/tests/schema-tests/missing-quotes.gschema.xml b/gio/tests/schema-tests/missing-quotes.gschema.xml new file mode 100644 index 0000000..4400a62 --- /dev/null +++ b/gio/tests/schema-tests/missing-quotes.gschema.xml @@ -0,0 +1,7 @@ + + + + foo + + + diff --git a/gio/tests/schema-tests/no-default.gschema.xml b/gio/tests/schema-tests/no-default.gschema.xml new file mode 100644 index 0000000..5496ce3 --- /dev/null +++ b/gio/tests/schema-tests/no-default.gschema.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/gio/tests/schema-tests/overflow.gschema.xml b/gio/tests/schema-tests/overflow.gschema.xml new file mode 100644 index 0000000..19d4176 --- /dev/null +++ b/gio/tests/schema-tests/overflow.gschema.xml @@ -0,0 +1,7 @@ + + + + 512 + + + diff --git a/gio/tests/schema-tests/override-missing.gschema.xml b/gio/tests/schema-tests/override-missing.gschema.xml new file mode 100644 index 0000000..9a3c781 --- /dev/null +++ b/gio/tests/schema-tests/override-missing.gschema.xml @@ -0,0 +1,11 @@ + + + + 'bar' + + + + + 'baz' + + diff --git a/gio/tests/schema-tests/override-range-error.gschema.xml b/gio/tests/schema-tests/override-range-error.gschema.xml new file mode 100644 index 0000000..4887ac3 --- /dev/null +++ b/gio/tests/schema-tests/override-range-error.gschema.xml @@ -0,0 +1,12 @@ + + + + + 10 + + + + + 77 + + diff --git a/gio/tests/schema-tests/override-then-key.gschema.xml b/gio/tests/schema-tests/override-then-key.gschema.xml new file mode 100644 index 0000000..85b70bd --- /dev/null +++ b/gio/tests/schema-tests/override-then-key.gschema.xml @@ -0,0 +1,15 @@ + + + + 'bar' + + + + + 'baz' + + + + + + diff --git a/gio/tests/schema-tests/override-twice.gschema.xml b/gio/tests/schema-tests/override-twice.gschema.xml new file mode 100644 index 0000000..fe6bb64 --- /dev/null +++ b/gio/tests/schema-tests/override-twice.gschema.xml @@ -0,0 +1,12 @@ + + + + 'bar' + + + + + 'baz' + 'baz' + + diff --git a/gio/tests/schema-tests/override-type-error.gschema.xml b/gio/tests/schema-tests/override-type-error.gschema.xml new file mode 100644 index 0000000..a16ec02 --- /dev/null +++ b/gio/tests/schema-tests/override-type-error.gschema.xml @@ -0,0 +1,11 @@ + + + + 10 + + + + + 37.5 + + diff --git a/gio/tests/schema-tests/override.gschema.xml b/gio/tests/schema-tests/override.gschema.xml new file mode 100644 index 0000000..6309884 --- /dev/null +++ b/gio/tests/schema-tests/override.gschema.xml @@ -0,0 +1,34 @@ + + + + 'bar' + + + + + 10 + + + + + + + + + 'aaaaa' + + + + + + + + 'baz' + 0 + 'aaa' + + + + 'foo' + + diff --git a/gio/tests/schema-tests/range-badtype.gschema.xml b/gio/tests/schema-tests/range-badtype.gschema.xml new file mode 100644 index 0000000..14a7217 --- /dev/null +++ b/gio/tests/schema-tests/range-badtype.gschema.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gio/tests/schema-tests/range-default-high.gschema.xml b/gio/tests/schema-tests/range-default-high.gschema.xml new file mode 100644 index 0000000..b5feb3e --- /dev/null +++ b/gio/tests/schema-tests/range-default-high.gschema.xml @@ -0,0 +1,8 @@ + + + + 28 + + + + diff --git a/gio/tests/schema-tests/range-default-low.gschema.xml b/gio/tests/schema-tests/range-default-low.gschema.xml new file mode 100644 index 0000000..f8fb9ef --- /dev/null +++ b/gio/tests/schema-tests/range-default-low.gschema.xml @@ -0,0 +1,8 @@ + + + + 21 + + + + diff --git a/gio/tests/schema-tests/range-high-default.gschema.xml b/gio/tests/schema-tests/range-high-default.gschema.xml new file mode 100644 index 0000000..0f01fc8 --- /dev/null +++ b/gio/tests/schema-tests/range-high-default.gschema.xml @@ -0,0 +1,8 @@ + + + + + 28 + + + diff --git a/gio/tests/schema-tests/range-low-default.gschema.xml b/gio/tests/schema-tests/range-low-default.gschema.xml new file mode 100644 index 0000000..49db491 --- /dev/null +++ b/gio/tests/schema-tests/range-low-default.gschema.xml @@ -0,0 +1,8 @@ + + + + + 21 + + + diff --git a/gio/tests/schema-tests/range-missing-max.gschema.xml b/gio/tests/schema-tests/range-missing-max.gschema.xml new file mode 100644 index 0000000..8e8bd55 --- /dev/null +++ b/gio/tests/schema-tests/range-missing-max.gschema.xml @@ -0,0 +1,8 @@ + + + + + 2 + + + diff --git a/gio/tests/schema-tests/range-missing-min.gschema.xml b/gio/tests/schema-tests/range-missing-min.gschema.xml new file mode 100644 index 0000000..f4de90c --- /dev/null +++ b/gio/tests/schema-tests/range-missing-min.gschema.xml @@ -0,0 +1,8 @@ + + + + + 2 + + + diff --git a/gio/tests/schema-tests/range-parse-error.gschema.xml b/gio/tests/schema-tests/range-parse-error.gschema.xml new file mode 100644 index 0000000..58ddb50 --- /dev/null +++ b/gio/tests/schema-tests/range-parse-error.gschema.xml @@ -0,0 +1,8 @@ + + + + + 25 + + + diff --git a/gio/tests/schema-tests/range-wrong-type.gschema.xml b/gio/tests/schema-tests/range-wrong-type.gschema.xml new file mode 100644 index 0000000..033767f --- /dev/null +++ b/gio/tests/schema-tests/range-wrong-type.gschema.xml @@ -0,0 +1,8 @@ + + + + + "a" + + + diff --git a/gio/tests/schema-tests/range.gschema.xml b/gio/tests/schema-tests/range.gschema.xml new file mode 100644 index 0000000..59118bd --- /dev/null +++ b/gio/tests/schema-tests/range.gschema.xml @@ -0,0 +1,8 @@ + + + + + 25 + + + diff --git a/gio/tests/schema-tests/wrong-category.gschema.xml b/gio/tests/schema-tests/wrong-category.gschema.xml new file mode 100644 index 0000000..c548248 --- /dev/null +++ b/gio/tests/schema-tests/wrong-category.gschema.xml @@ -0,0 +1,7 @@ + + + + 'foo' + + + diff --git a/gio/tests/send-data.c b/gio/tests/send-data.c index a2592ce..189aed2 100644 --- a/gio/tests/send-data.c +++ b/gio/tests/send-data.c @@ -5,6 +5,7 @@ GMainLoop *loop; int cancel_timeout = 0; +int io_timeout = 0; gboolean async = FALSE; gboolean graceful = FALSE; static GOptionEntry cmd_entries[] = { @@ -14,6 +15,8 @@ static GOptionEntry cmd_entries[] = { "Use async ops", NULL}, {"graceful-disconnect", 'g', 0, G_OPTION_ARG_NONE, &graceful, "Use graceful disconnect", NULL}, + {"timeout", 't', 0, G_OPTION_ARG_INT, &io_timeout, + "Time out socket I/O after the specified number of seconds", NULL}, {NULL} }; @@ -97,6 +100,8 @@ main (int argc, char *argv[]) } client = g_socket_client_new (); + if (io_timeout) + g_socket_client_set_timeout (client, io_timeout); if (async) { diff --git a/gio/tests/simple-async-result.c b/gio/tests/simple-async-result.c index 2b3f0a7..841da02 100644 --- a/gio/tests/simple-async-result.c +++ b/gio/tests/simple-async-result.c @@ -68,6 +68,7 @@ test_simple_async_idle (gpointer user_data) c = g_object_new (G_TYPE_OBJECT, NULL); result = g_simple_async_result_new (a, callback_func, b, test_simple_async_idle); + g_assert (g_async_result_get_user_data (G_ASYNC_RESULT (result)) == b); check (NULL, NULL, NULL); g_simple_async_result_complete (result); check (a, result, b); diff --git a/gio/tests/socket-client.c b/gio/tests/socket-client.c index f0f7c4e..6068034 100644 --- a/gio/tests/socket-client.c +++ b/gio/tests/socket-client.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -9,8 +10,10 @@ GMainLoop *loop; gboolean verbose = FALSE; gboolean non_blocking = FALSE; gboolean use_udp = FALSE; -gboolean use_source = FALSE; int cancel_timeout = 0; +int read_timeout = 0; +gboolean unix_socket = FALSE; +gboolean tls = FALSE; static GOptionEntry cmd_entries[] = { {"cancel", 'c', 0, G_OPTION_ARG_INT, &cancel_timeout, @@ -21,79 +24,39 @@ static GOptionEntry cmd_entries[] = { "Be verbose", NULL}, {"non-blocking", 'n', 0, G_OPTION_ARG_NONE, &non_blocking, "Enable non-blocking i/o", NULL}, - {"use-source", 's', 0, G_OPTION_ARG_NONE, &use_source, - "Use GSource to wait for non-blocking i/o", NULL}, +#ifdef G_OS_UNIX + {"unix", 'U', 0, G_OPTION_ARG_NONE, &unix_socket, + "Use a unix socket instead of IP", NULL}, +#endif + {"timeout", 't', 0, G_OPTION_ARG_INT, &read_timeout, + "Time out reads after the specified number of seconds", NULL}, + {"tls", 'T', 0, G_OPTION_ARG_NONE, &tls, + "Use TLS (SSL)", NULL}, {NULL} }; -static char * -socket_address_to_string (GSocketAddress *address) -{ - GInetAddress *inet_address; - char *str, *res; - int port; - - inet_address = g_inet_socket_address_get_address (G_INET_SOCKET_ADDRESS (address)); - str = g_inet_address_to_string (inet_address); - port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (address)); - res = g_strdup_printf ("%s:%d", str, port); - g_free (str); - return res; -} +#include "socket-common.c" static gboolean -source_ready (gpointer data, - GIOCondition condition) -{ - g_main_loop_quit (loop); - return FALSE; -} - -static void -ensure_condition (GSocket *socket, - const char *where, - GCancellable *cancellable, - GIOCondition condition) -{ - GError *error = NULL; - GSource *source; - - if (!non_blocking) - return; - - if (use_source) - { - source = g_socket_create_source (socket, - condition, - cancellable); - g_source_set_callback (source, - (GSourceFunc) source_ready, - NULL, NULL); - g_source_attach (source, NULL); - g_source_unref (source); - g_main_loop_run (loop); - } - else - { - if (!g_socket_condition_wait (socket, condition, cancellable, &error)) - { - g_printerr ("condition wait error for %s: %s\n", - where, - error->message); - exit (1); - } - } -} - -static gpointer -cancel_thread (gpointer data) +accept_certificate (GTlsClientConnection *conn, GTlsCertificate *cert, + GTlsCertificateFlags errors, gpointer user_data) { - GCancellable *cancellable = data; - - g_usleep (1000*1000*cancel_timeout); - g_print ("Cancelling\n"); - g_cancellable_cancel (cancellable); - return NULL; + g_print ("Certificate would have been rejected ( "); + if (errors & G_TLS_CERTIFICATE_UNKNOWN_CA) + g_print ("unknown-ca "); + if (errors & G_TLS_CERTIFICATE_BAD_IDENTITY) + g_print ("bad-identity "); + if (errors & G_TLS_CERTIFICATE_NOT_ACTIVATED) + g_print ("not-activated "); + if (errors & G_TLS_CERTIFICATE_EXPIRED) + g_print ("expired "); + if (errors & G_TLS_CERTIFICATE_REVOKED) + g_print ("revoked "); + if (errors & G_TLS_CERTIFICATE_INSECURE) + g_print ("insecure "); + g_print (") but accepting anyway.\n"); + + return TRUE; } int @@ -104,11 +67,15 @@ main (int argc, GSocketAddress *src_address; GSocketAddress *address; GSocketType socket_type; + GSocketFamily socket_family; GError *error = NULL; GOptionContext *context; GCancellable *cancellable; GSocketAddressEnumerator *enumerator; GSocketConnectable *connectable; + GIOStream *connection; + GInputStream *istream; + GOutputStream *ostream; g_thread_init (NULL); @@ -124,7 +91,13 @@ main (int argc, if (argc != 2) { - g_printerr ("%s: %s\n", argv[0], "Need to specify hostname"); + g_printerr ("%s: %s\n", argv[0], "Need to specify hostname / unix socket name"); + return 1; + } + + if (use_udp && tls) + { + g_printerr ("DTLS (TLS over UDP) is not supported"); return 1; } @@ -145,18 +118,41 @@ main (int argc, else socket_type = G_SOCKET_TYPE_STREAM; - socket = g_socket_new (G_SOCKET_FAMILY_IPV4, socket_type, 0, &error); + if (unix_socket) + socket_family = G_SOCKET_FAMILY_UNIX; + else + socket_family = G_SOCKET_FAMILY_IPV4; + + socket = g_socket_new (socket_family, socket_type, 0, &error); if (socket == NULL) { g_printerr ("%s: %s\n", argv[0], error->message); return 1; } - connectable = g_network_address_parse (argv[1], 7777, &error); - if (connectable == NULL) + if (read_timeout) + g_socket_set_timeout (socket, read_timeout); + + if (unix_socket) { - g_printerr ("%s: %s\n", argv[0], error->message); - return 1; + GSocketAddress *addr; + + addr = socket_address_from_string (argv[1]); + if (addr == NULL) + { + g_printerr ("%s: Could not parse '%s' as unix socket name\n", argv[0], argv[1]); + return 1; + } + connectable = G_SOCKET_CONNECTABLE (addr); + } + else + { + connectable = g_network_address_parse (argv[1], 7777, &error); + if (connectable == NULL) + { + g_printerr ("%s: %s\n", argv[0], error->message); + return 1; + } } enumerator = g_socket_connectable_enumerate (connectable); @@ -181,15 +177,10 @@ main (int argc, g_object_unref (address); } g_object_unref (enumerator); - g_object_unref (connectable); g_print ("Connected to %s\n", socket_address_to_string (address)); - /* TODO: Test non-blocking connect */ - if (non_blocking) - g_socket_set_blocking (socket, FALSE); - src_address = g_socket_get_local_address (socket, &error); if (!src_address) { @@ -201,9 +192,56 @@ main (int argc, socket_address_to_string (src_address)); g_object_unref (src_address); + if (use_udp) + { + connection = NULL; + istream = NULL; + ostream = NULL; + } + else + connection = G_IO_STREAM (g_socket_connection_factory_create_connection (socket)); + + if (tls) + { + GIOStream *tls_conn; + + tls_conn = g_tls_client_connection_new (connection, connectable, &error); + if (!tls_conn) + { + g_printerr ("Could not create TLS connection: %s\n", + error->message); + return 1; + } + + g_signal_connect (tls_conn, "accept-certificate", + G_CALLBACK (accept_certificate), NULL); + + if (!g_tls_connection_handshake (G_TLS_CONNECTION (tls_conn), + cancellable, &error)) + { + g_printerr ("Error during TLS handshake: %s\n", + error->message); + return 1; + } + + g_object_unref (connection); + connection = G_IO_STREAM (tls_conn); + } + g_object_unref (connectable); + + if (connection) + { + istream = g_io_stream_get_input_stream (connection); + ostream = g_io_stream_get_output_stream (connection); + } + + /* TODO: Test non-blocking connect/handshake */ + if (non_blocking) + g_socket_set_blocking (socket, FALSE); + while (TRUE) { - gchar buffer[4096] = { }; + gchar buffer[4096]; gssize size; gsize to_send; @@ -213,14 +251,20 @@ main (int argc, to_send = strlen (buffer); while (to_send > 0) { - ensure_condition (socket, "send", cancellable, G_IO_OUT); if (use_udp) - size = g_socket_send_to (socket, address, - buffer, to_send, - cancellable, &error); + { + ensure_socket_condition (socket, G_IO_OUT, cancellable); + size = g_socket_send_to (socket, address, + buffer, to_send, + cancellable, &error); + } else - size = g_socket_send (socket, buffer, to_send, - cancellable, &error); + { + ensure_connection_condition (connection, G_IO_OUT, cancellable); + size = g_output_stream_write (ostream, + buffer, to_send, + cancellable, &error); + } if (size < 0) { @@ -252,14 +296,20 @@ main (int argc, to_send -= size; } - ensure_condition (socket, "receive", cancellable, G_IO_IN); if (use_udp) - size = g_socket_receive_from (socket, &src_address, + { + ensure_socket_condition (socket, G_IO_IN, cancellable); + size = g_socket_receive_from (socket, &src_address, + buffer, sizeof buffer, + cancellable, &error); + } + else + { + ensure_connection_condition (connection, G_IO_IN, cancellable); + size = g_input_stream_read (istream, buffer, sizeof buffer, cancellable, &error); - else - size = g_socket_receive (socket, buffer, sizeof buffer, - cancellable, &error); + } if (size < 0) { @@ -286,15 +336,28 @@ main (int argc, g_print ("closing socket\n"); - if (!g_socket_close (socket, &error)) + if (connection) { - g_printerr ("Error closing master socket: %s\n", - error->message); - return 1; + if (!g_io_stream_close (connection, cancellable, &error)) + { + g_printerr ("Error closing connection: %s\n", + error->message); + return 1; + } + g_object_unref (connection); + } + else + { + if (!g_socket_close (socket, &error)) + { + g_printerr ("Error closing master socket: %s\n", + error->message); + return 1; + } } - g_object_unref (G_OBJECT (socket)); - g_object_unref (G_OBJECT (address)); + g_object_unref (socket); + g_object_unref (address); return 0; } diff --git a/gio/tests/socket-common.c b/gio/tests/socket-common.c new file mode 100644 index 0000000..fdee383 --- /dev/null +++ b/gio/tests/socket-common.c @@ -0,0 +1,121 @@ +/* #included into both socket-client.c and socket-server.c */ + +static const char *unix_socket_address_types[] = { + "invalid", + "anonymous", + "path", + "abstract", + "padded" +}; + +static char * +socket_address_to_string (GSocketAddress *address) +{ + char *res = NULL; + + if (G_IS_INET_SOCKET_ADDRESS (address)) + { + GInetAddress *inet_address; + char *str; + int port; + + inet_address = g_inet_socket_address_get_address (G_INET_SOCKET_ADDRESS (address)); + str = g_inet_address_to_string (inet_address); + port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (address)); + res = g_strdup_printf ("%s:%d", str, port); + g_free (str); + } +#ifdef G_OS_UNIX + else if (G_IS_UNIX_SOCKET_ADDRESS (address)) + { + GUnixSocketAddress *uaddr = G_UNIX_SOCKET_ADDRESS (address); + + res = g_strdup_printf ("%s:%s", + unix_socket_address_types[g_unix_socket_address_get_address_type (uaddr)], + g_unix_socket_address_get_path (uaddr)); + } +#endif + + return res; +} + +GSocketAddress * +socket_address_from_string (const char *name) +{ +#ifdef G_OS_UNIX + int i, len; + + for (i = 0; i < G_N_ELEMENTS (unix_socket_address_types); i++) + { + len = strlen (unix_socket_address_types[i]); + if (!strncmp (name, unix_socket_address_types[i], len) && + name[len] == ':') + { + return g_unix_socket_address_new_with_type (name + len + 1, -1, + (GUnixSocketAddressType)i); + } + } +#endif + return NULL; +} + +static gboolean +source_ready (GPollableInputStream *stream, + gpointer data) +{ + g_main_loop_quit (loop); + return FALSE; +} + +static void +ensure_socket_condition (GSocket *socket, + GIOCondition condition, + GCancellable *cancellable) +{ + GSource *source; + + if (!non_blocking) + return; + + source = g_socket_create_source (socket, condition, cancellable); + g_source_set_callback (source, + (GSourceFunc) source_ready, + NULL, NULL); + g_source_attach (source, NULL); + g_source_unref (source); + g_main_loop_run (loop); +} + +static void +ensure_connection_condition (GIOStream *stream, + GIOCondition condition, + GCancellable *cancellable) +{ + GSource *source; + + if (!non_blocking) + return; + + if (condition & G_IO_IN) + source = g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM (g_io_stream_get_input_stream (stream)), cancellable); + else + source = g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM (g_io_stream_get_output_stream (stream)), cancellable); + + g_source_set_callback (source, + (GSourceFunc) source_ready, + NULL, NULL); + g_source_attach (source, NULL); + g_source_unref (source); + g_main_loop_run (loop); +} + +static gpointer +cancel_thread (gpointer data) +{ + GCancellable *cancellable = data; + + g_usleep (1000*1000*cancel_timeout); + g_print ("Cancelling\n"); + g_cancellable_cancel (cancellable); + return NULL; +} diff --git a/gio/tests/socket-server.c b/gio/tests/socket-server.c index 205cdaf..a44b158 100644 --- a/gio/tests/socket-server.c +++ b/gio/tests/socket-server.c @@ -1,6 +1,8 @@ #include +#include #include #include +#include GMainLoop *loop; @@ -9,8 +11,11 @@ gboolean verbose = FALSE; gboolean dont_reuse_address = FALSE; gboolean non_blocking = FALSE; gboolean use_udp = FALSE; -gboolean use_source = FALSE; int cancel_timeout = 0; +int read_timeout = 0; +int delay = 0; +gboolean unix_socket = FALSE; +const char *tls_cert_file = NULL; static GOptionEntry cmd_entries[] = { {"port", 'p', 0, G_OPTION_ARG_INT, &port, @@ -25,80 +30,20 @@ static GOptionEntry cmd_entries[] = { "Don't SOADDRREUSE", NULL}, {"non-blocking", 'n', 0, G_OPTION_ARG_NONE, &non_blocking, "Enable non-blocking i/o", NULL}, - {"use-source", 's', 0, G_OPTION_ARG_NONE, &use_source, - "Use GSource to wait for non-blocking i/o", NULL}, +#ifdef G_OS_UNIX + {"unix", 'U', 0, G_OPTION_ARG_NONE, &unix_socket, + "Use a unix socket instead of IP", NULL}, +#endif + {"delay", 'd', 0, G_OPTION_ARG_INT, &delay, + "Delay responses by the specified number of seconds", NULL}, + {"timeout", 't', 0, G_OPTION_ARG_INT, &read_timeout, + "Time out reads after the specified number of seconds", NULL}, + {"tls", 'T', 0, G_OPTION_ARG_STRING, &tls_cert_file, + "Use TLS (SSL) with indicated server certificate", "CERTFILE"}, {NULL} }; -static char * -socket_address_to_string (GSocketAddress *address) -{ - GInetAddress *inet_address; - char *str, *res; - int the_port; - - inet_address = g_inet_socket_address_get_address (G_INET_SOCKET_ADDRESS (address)); - str = g_inet_address_to_string (inet_address); - the_port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (address)); - res = g_strdup_printf ("%s:%d", str, the_port); - g_free (str); - return res; -} - -static gboolean -source_ready (gpointer data, - GIOCondition condition) -{ - g_main_loop_quit (loop); - return FALSE; -} - -static void -ensure_condition (GSocket *socket, - const char *where, - GCancellable *cancellable, - GIOCondition condition) -{ - GError *error = NULL; - GSource *source; - - if (!non_blocking) - return; - - if (use_source) - { - source = g_socket_create_source (socket, - condition, - cancellable); - g_source_set_callback (source, - (GSourceFunc) source_ready, - NULL, NULL); - g_source_attach (source, NULL); - g_source_unref (source); - g_main_loop_run (loop); - } - else - { - if (!g_socket_condition_wait (socket, condition, cancellable, &error)) - { - g_printerr ("condition wait error for %s: %s\n", - where, - error->message); - exit (1); - } - } -} - -static gpointer -cancel_thread (gpointer data) -{ - GCancellable *cancellable = data; - - g_usleep (1000*1000*cancel_timeout); - g_print ("Cancelling\n"); - g_cancellable_cancel (cancellable); - return NULL; -} +#include "socket-common.c" int main (int argc, @@ -108,9 +53,15 @@ main (int argc, GSocketAddress *src_address; GSocketAddress *address; GSocketType socket_type; + GSocketFamily socket_family; GError *error = NULL; GOptionContext *context; GCancellable *cancellable; + char *display_addr; + GTlsCertificate *tlscert = NULL; + GIOStream *connection; + GInputStream *istream; + GOutputStream *ostream; g_thread_init (NULL); @@ -124,6 +75,12 @@ main (int argc, return 1; } + if (unix_socket && argc != 2) + { + g_printerr ("%s: %s\n", argv[0], "Need to specify unix socket name"); + return 1; + } + if (cancel_timeout) { cancellable = g_cancellable_new (); @@ -134,6 +91,23 @@ main (int argc, cancellable = NULL; } + if (tls_cert_file) + { + if (use_udp) + { + g_printerr ("DTLS (TLS over UDP) is not supported"); + return 1; + } + + tlscert = g_tls_certificate_new_from_file (tls_cert_file, &error); + if (!tlscert) + { + g_printerr ("Could not read server certificate '%s': %s\n", + tls_cert_file, error->message); + return 1; + } + } + loop = g_main_loop_new (NULL, FALSE); if (use_udp) @@ -141,7 +115,12 @@ main (int argc, else socket_type = G_SOCKET_TYPE_STREAM; - socket = g_socket_new (G_SOCKET_FAMILY_IPV4, socket_type, 0, &error); + if (unix_socket) + socket_family = G_SOCKET_FAMILY_UNIX; + else + socket_family = G_SOCKET_FAMILY_IPV4; + + socket = g_socket_new (socket_family, socket_type, 0, &error); if (socket == NULL) { @@ -152,7 +131,20 @@ main (int argc, if (non_blocking) g_socket_set_blocking (socket, FALSE); - src_address = g_inet_socket_address_new (g_inet_address_new_any (G_SOCKET_FAMILY_IPV4), port); + if (unix_socket) + { + src_address = socket_address_from_string (argv[1]); + if (src_address == NULL) + { + g_printerr ("%s: Could not parse '%s' as unix socket name\n", argv[0], argv[1]); + return 1; + } + } + else + { + src_address = g_inet_socket_address_new (g_inet_address_new_any (G_SOCKET_FAMILY_IPV4), port); + } + if (!g_socket_bind (socket, src_address, !dont_reuse_address, &error)) { g_printerr ("Can't bind socket: %s\n", error->message); @@ -168,9 +160,18 @@ main (int argc, return 1; } - g_print ("listening on port %d...\n", port); + address = g_socket_get_local_address (socket, &error); + if (!address) + { + g_printerr ("Error getting local address: %s\n", + error->message); + return 1; + } + display_addr = socket_address_to_string (address); + g_print ("listening on %s...\n", display_addr); + g_free (display_addr); - ensure_condition (socket, "accept", cancellable, G_IO_IN); + ensure_socket_condition (socket, G_IO_IN, cancellable); new_socket = g_socket_accept (socket, cancellable, &error); if (!new_socket) { @@ -181,6 +182,8 @@ main (int argc, if (non_blocking) g_socket_set_blocking (new_socket, FALSE); + if (read_timeout) + g_socket_set_timeout (new_socket, read_timeout); address = g_socket_get_remote_address (new_socket, &error); if (!address) @@ -190,33 +193,78 @@ main (int argc, return 1; } - g_print ("got a new connection from %s\n", - socket_address_to_string (address)); + display_addr = socket_address_to_string (address); + g_print ("got a new connection from %s\n", display_addr); + g_free(display_addr); g_object_unref (address); recv_socket = new_socket; + + connection = G_IO_STREAM (g_socket_connection_factory_create_connection (recv_socket)); + g_object_unref (new_socket); } else { recv_socket = socket; - new_socket = NULL; + connection = NULL; + } + + if (tlscert) + { + GIOStream *tls_conn; + + tls_conn = g_tls_server_connection_new (connection, tlscert, &error); + if (!tls_conn) + { + g_printerr ("Could not create TLS connection: %s\n", + error->message); + return 1; + } + + if (!g_tls_connection_handshake (G_TLS_CONNECTION (tls_conn), + cancellable, &error)) + { + g_printerr ("Error during TLS handshake: %s\n", + error->message); + return 1; + } + + g_object_unref (connection); + connection = tls_conn; } + if (connection) + { + istream = g_io_stream_get_input_stream (connection); + ostream = g_io_stream_get_output_stream (connection); + } + else + { + g_assert (use_udp); + istream = NULL; + ostream = NULL; + } while (TRUE) { - gchar buffer[4096] = { }; + gchar buffer[4096]; gssize size; gsize to_send; - ensure_condition (recv_socket, "receive", cancellable, G_IO_IN); if (use_udp) - size = g_socket_receive_from (recv_socket, &address, + { + ensure_socket_condition (recv_socket, G_IO_IN, cancellable); + size = g_socket_receive_from (recv_socket, &address, + buffer, sizeof buffer, + cancellable, &error); + } + else + { + ensure_connection_condition (connection, G_IO_IN, cancellable); + size = g_input_stream_read (istream, buffer, sizeof buffer, cancellable, &error); - else - size = g_socket_receive (recv_socket, buffer, sizeof buffer, - cancellable, &error); + } if (size < 0) { @@ -241,15 +289,28 @@ main (int argc, to_send = size; + if (delay) + { + if (verbose) + g_print ("delaying %d seconds before response\n", delay); + g_usleep (1000 * 1000 * delay); + } + while (to_send > 0) { - ensure_condition (recv_socket, "send", cancellable, G_IO_OUT); if (use_udp) - size = g_socket_send_to (recv_socket, address, - buffer, to_send, cancellable, &error); + { + ensure_socket_condition (recv_socket, G_IO_OUT, cancellable); + size = g_socket_send_to (recv_socket, address, + buffer, to_send, cancellable, &error); + } else - size = g_socket_send (recv_socket, buffer, to_send, - cancellable, &error); + { + ensure_connection_condition (connection, G_IO_OUT, cancellable); + size = g_output_stream_write (ostream, + buffer, to_send, + cancellable, &error); + } if (size < 0) { @@ -284,16 +345,15 @@ main (int argc, g_print ("connection closed\n"); - if (new_socket) + if (connection) { - if (!g_socket_close (new_socket, &error)) + if (!g_io_stream_close (connection, NULL, &error)) { - g_printerr ("Error closing connection socket: %s\n", + g_printerr ("Error closing connection stream: %s\n", error->message); return 1; } - - g_object_unref (G_OBJECT (new_socket)); + g_object_unref (connection); } if (!g_socket_close (socket, &error)) @@ -302,8 +362,7 @@ main (int argc, error->message); return 1; } - - g_object_unref (G_OBJECT (socket)); + g_object_unref (socket); return 0; } diff --git a/gio/tests/socket.c b/gio/tests/socket.c new file mode 100644 index 0000000..9c4c0d6 --- /dev/null +++ b/gio/tests/socket.c @@ -0,0 +1,86 @@ +/* GLib testing framework examples and tests + * + * Copyright (C) 2008-2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: David Zeuthen + */ + +#include + +#ifdef G_OS_UNIX +#include +#include +#include +#endif + +#ifdef G_OS_UNIX +static void +test_unix_from_fd (void) +{ + gint fd; + GError *error; + GSocket *s; + + fd = socket (AF_UNIX, SOCK_STREAM, 0); + g_assert_cmpint (fd, !=, -1); + + error = NULL; + s = g_socket_new_from_fd (fd, &error); + g_assert_no_error (error); + g_assert_cmpint (g_socket_get_family (s), ==, G_SOCKET_FAMILY_UNIX); + g_assert_cmpint (g_socket_get_socket_type (s), ==, G_SOCKET_TYPE_STREAM); + g_assert_cmpint (g_socket_get_protocol (s), ==, G_SOCKET_PROTOCOL_DEFAULT); + g_object_unref (s); +} + +static void +test_unix_connection (void) +{ + gint fd; + GError *error; + GSocket *s; + GSocketConnection *c; + + fd = socket (AF_UNIX, SOCK_STREAM, 0); + g_assert_cmpint (fd, !=, -1); + + error = NULL; + s = g_socket_new_from_fd (fd, &error); + g_assert_no_error (error); + c = g_socket_connection_factory_create_connection (s); + g_assert (G_IS_UNIX_CONNECTION (c)); + g_object_unref (c); + g_object_unref (s); +} +#endif /* G_OS_UNIX */ + +int +main (int argc, + char *argv[]) +{ + g_type_init (); + g_test_init (&argc, &argv, NULL); + +#ifdef G_OS_UNIX + g_test_add_func ("/socket/unix-from-fd", test_unix_from_fd); + g_test_add_func ("/socket/unix-connection", test_unix_connection); +#endif + + return g_test_run(); +} + diff --git a/gio/tests/testenum.h b/gio/tests/testenum.h new file mode 100644 index 0000000..def8713 --- /dev/null +++ b/gio/tests/testenum.h @@ -0,0 +1,16 @@ +typedef enum +{ + TEST_ENUM_FOO, + TEST_ENUM_BAR, + TEST_ENUM_BAZ, + TEST_ENUM_QUUX +} TestEnum; + +typedef enum +{ + TEST_FLAGS_NONE = 0, + TEST_FLAGS_MOURNING = (1 << 0), + TEST_FLAGS_LAUGHING = (1 << 1), + TEST_FLAGS_TALKING = (1 << 2), + TEST_FLAGS_WALKING = (1 << 3) +} TestFlags; diff --git a/gio/tests/unix-fd.c b/gio/tests/unix-fd.c index a84e03f..2612521 100644 --- a/gio/tests/unix-fd.c +++ b/gio/tests/unix-fd.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -40,10 +41,12 @@ create_fd_list (gint *fd_list) static void test_fds (void) { + GError *err = NULL; GUnixFDMessage *message; GUnixFDMessage **mv; GUnixFDList *list, *l2; GSocket *sockets[2]; + GSocketAddress *addr; const gint *peek; char buffer[1024]; gint fd_list[40]; @@ -81,24 +84,32 @@ test_fds (void) g_assert_cmpint (stolen[2], ==, sv[2]); g_free (stolen); - g_unix_fd_message_append_fd (message, sv[0], NULL); + g_unix_fd_message_append_fd (message, sv[0], &err); + g_assert_no_error (err); s = close (sv[0]); g_assert_cmpint (s, ==, 0); - g_unix_fd_message_append_fd (message, sv[1], NULL); + g_unix_fd_message_append_fd (message, sv[1], &err); + g_assert_no_error (err); s = close (sv[1]); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 0, NULL)); + s = close (g_unix_fd_list_get (list, 0, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 1, NULL)); + s = close (g_unix_fd_list_get (list, 1, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 0, NULL)); + s = close (g_unix_fd_list_get (list, 0, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 1, NULL)); + s = close (g_unix_fd_list_get (list, 1, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 0, NULL)); + s = close (g_unix_fd_list_get (list, 0, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 1, NULL)); + s = close (g_unix_fd_list_get (list, 1, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); g_object_unref (message); @@ -111,34 +122,48 @@ test_fds (void) s = pipe (sv); g_assert_cmpint (s, ==, 0); - s = g_unix_fd_list_append (list, sv[0], NULL); + s = g_unix_fd_list_append (list, sv[0], &err); + g_assert_no_error (err); g_assert_cmpint (s, >=, 0); - s = g_unix_fd_list_append (list, sv[1], NULL); + s = g_unix_fd_list_append (list, sv[1], &err); + g_assert_no_error (err); g_assert_cmpint (s, >=, 0); s = close (sv[0]); g_assert_cmpint (s, ==, 0); s = close (sv[1]); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 0, NULL)); + s = close (g_unix_fd_list_get (list, 0, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); - s = close (g_unix_fd_list_get (list, 1, NULL)); + s = close (g_unix_fd_list_get (list, 1, &err)); + g_assert_no_error (err); g_assert_cmpint (s, ==, 0); s = socketpair (PF_UNIX, SOCK_STREAM, 0, sv); g_assert_cmpint (s, ==, 0); - sockets[0] = g_socket_new_from_fd (sv[0], NULL); + sockets[0] = g_socket_new_from_fd (sv[0], &err); + g_assert_no_error (err); g_assert (G_IS_SOCKET (sockets[0])); - sockets[1] = g_socket_new_from_fd (sv[1], NULL); + sockets[1] = g_socket_new_from_fd (sv[1], &err); + g_assert_no_error (err); g_assert (G_IS_SOCKET (sockets[1])); + addr = g_socket_get_local_address (sockets[0], &err); + g_assert_no_error (err); + g_assert (G_IS_UNIX_SOCKET_ADDRESS (addr)); + g_assert_cmpint (g_unix_socket_address_get_address_type (G_UNIX_SOCKET_ADDRESS (addr)), ==, G_UNIX_SOCKET_ADDRESS_ANONYMOUS); + g_assert_cmpint (g_unix_socket_address_get_path_len (G_UNIX_SOCKET_ADDRESS (addr)), ==, 0); + g_object_unref (addr); + buffer[0] = 0xff; ov.buffer = buffer; ov.size = 1; s = g_socket_send_message (sockets[0], NULL, &ov, 1, (GSocketControlMessage **) &message, - 1, 0, NULL, NULL); + 1, 0, NULL, &err); + g_assert_no_error (err); g_assert_cmpint (s, ==, 1); g_object_unref (message); @@ -149,7 +174,8 @@ test_fds (void) iv.size = 1; s = g_socket_receive_message (sockets[1], NULL, &iv, 1, (GSocketControlMessage ***) &mv, - &nm, &flags, NULL, NULL); + &nm, &flags, NULL, &err); + g_assert_no_error (err); g_assert_cmpint (s, ==, 1); g_object_unref (sockets[0]); g_object_unref (sockets[1]); @@ -164,7 +190,8 @@ test_fds (void) peek = g_unix_fd_list_peek_fds (list, &s); g_assert_cmpint (s, ==, 2); - sv[0] = g_unix_fd_list_get (list, 1, NULL); + sv[0] = g_unix_fd_list_get (list, 1, &err); + g_assert_no_error (err); strcpy (buffer, "failure to say failure to say 'i love gnome-panel!'."); s = write (sv[0], buffer, strlen (buffer) + 1); diff --git a/gio/tests/unix-streams.c b/gio/tests/unix-streams.c index 50b2d8c..2d06b8e 100644 --- a/gio/tests/unix-streams.c +++ b/gio/tests/unix-streams.c @@ -19,7 +19,6 @@ * if advised of the possibility of such damage. */ -#include #include #include #include @@ -34,6 +33,7 @@ int writer_pipe[2], reader_pipe[2]; GCancellable *writer_cancel, *reader_cancel, *main_cancel; GMainLoop *loop; + static gpointer writer_thread (gpointer user_data) { diff --git a/gio/tests/volumemonitor.c b/gio/tests/volumemonitor.c new file mode 100644 index 0000000..e3fdc3b --- /dev/null +++ b/gio/tests/volumemonitor.c @@ -0,0 +1,187 @@ +#include + +static GVolumeMonitor *monitor; + +static void +do_mount_tests (GDrive *drive, GVolume *volume, GMount *mount) +{ + GDrive *d; + GVolume *v; + gchar *name; + gchar *uuid; + + name = g_mount_get_name (mount); + g_assert (name != NULL); + g_free (name); + + v = g_mount_get_volume (mount); + g_assert (v == volume); + if (v != NULL) + g_object_unref (v); + + d = g_mount_get_drive (mount); + g_assert (d == drive); + if (d != NULL) + g_object_unref (d); + + uuid = g_mount_get_uuid (mount); + if (uuid) + { + GMount *m; + m = g_volume_monitor_get_mount_for_uuid (monitor, uuid); + g_assert (m == mount); + g_object_unref (m); + g_free (uuid); + } +} + +static void +do_volume_tests (GDrive *drive, GVolume *volume) +{ + GDrive *d; + gchar *name; + GMount *mount; + gchar *uuid; + + name = g_volume_get_name (volume); + g_assert (name != NULL); + g_free (name); + + d = g_volume_get_drive (volume); + g_assert (d == drive); + if (d != NULL) + g_object_unref (d); + + mount = g_volume_get_mount (volume); + if (mount != NULL) + { + do_mount_tests (drive, volume, mount); + g_object_unref (mount); + } + + uuid = g_volume_get_uuid (volume); + if (uuid) + { + GVolume *v; + v = g_volume_monitor_get_volume_for_uuid (monitor, uuid); + g_assert (v == volume); + g_object_unref (v); + g_free (uuid); + } +} + +static void +do_drive_tests (GDrive *drive) +{ + GList *volumes, *l; + gchar *name; + gboolean has_volumes; + + g_assert (G_IS_DRIVE (drive)); + name = g_drive_get_name (drive); + g_assert (name != NULL); + g_free (name); + + has_volumes = g_drive_has_volumes (drive); + volumes = g_drive_get_volumes (drive); + g_assert (has_volumes == (volumes != NULL)); + for (l = volumes; l; l = l->next) + { + GVolume *volume = l->data; + do_volume_tests (drive, volume); + } + + g_list_foreach (volumes, (GFunc)g_object_unref, NULL); + g_list_free (volumes); +} + +static void +test_connected_drives (void) +{ + GList *drives; + GList *l; + + drives = g_volume_monitor_get_connected_drives (monitor); + + for (l = drives; l; l = l->next) + { + GDrive *drive = l->data; + do_drive_tests (drive); + } + + g_list_foreach (drives, (GFunc)g_object_unref, NULL); + g_list_free (drives); +} + +static void +test_volumes (void) +{ + GList *volumes, *l; + + volumes = g_volume_monitor_get_volumes (monitor); + + for (l = volumes; l; l = l->next) + { + GVolume *volume = l->data; + GDrive *drive; + + drive = g_volume_get_drive (volume); + do_volume_tests (drive, volume); + if (drive != NULL) + g_object_unref (drive); + } + + g_list_foreach (volumes, (GFunc)g_object_unref, NULL); + g_list_free (volumes); +} + +static void +test_mounts (void) +{ + GList *mounts, *l; + + mounts = g_volume_monitor_get_mounts (monitor); + + for (l = mounts; l; l = l->next) + { + GMount *mount = l->data; + GVolume *volume; + GDrive *drive; + + drive = g_mount_get_drive (mount); + volume = g_mount_get_volume (mount); + do_mount_tests (drive, volume, mount); + + if (drive != NULL) + g_object_unref (drive); + if (volume != NULL) + g_object_unref (volume); + } + + g_list_foreach (mounts, (GFunc)g_object_unref, NULL); + g_list_free (mounts); +} +int +main (int argc, char *argv[]) +{ + gboolean ret; + + g_setenv ("GIO_USE_VFS", "local", FALSE); + + g_type_init (); + + g_test_init (&argc, &argv, NULL); + + monitor = g_volume_monitor_get (); + + g_test_add_func ("/volumemonitor/connected_drives", test_connected_drives); + g_test_add_func ("/volumemonitor/volumes", test_volumes); + g_test_add_func ("/volumemonitor/mounts", test_mounts); + + ret = g_test_run (); + + g_object_unref (monitor); + + return ret; +} + diff --git a/gio/tests/win32-streams.c b/gio/tests/win32-streams.c new file mode 100644 index 0000000..4ac04d4 --- /dev/null +++ b/gio/tests/win32-streams.c @@ -0,0 +1,292 @@ +/* GLib testing framework examples and tests + * Copyright (C) 2008 Red Hat, Inc + * + * This work is provided "as is"; redistribution and modification + * in whole or in part, in any medium, physical or electronic is + * permitted without restriction. + * + * This work is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * In no event shall the authors or contributors be liable for any + * direct, indirect, incidental, special, exemplary, or consequential + * damages (including, but not limited to, procurement of substitute + * goods or services; loss of use, data, or profits; or business + * interruption) however caused and on any theory of liability, whether + * in contract, strict liability, or tort (including negligence or + * otherwise) arising in any way out of the use of this software, even + * if advised of the possibility of such damage. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define DATA "abcdefghijklmnopqrstuvwxyz" + +int writer_pipe[2], reader_pipe[2]; +GCancellable *writer_cancel, *reader_cancel, *main_cancel; +GMainLoop *loop; + +static gpointer +writer_thread (gpointer user_data) +{ + GOutputStream *out; + gssize nwrote, offset; + GError *err = NULL; + HANDLE out_handle; + + g_assert (DuplicateHandle (GetCurrentProcess (), + (HANDLE) (gintptr) _get_osfhandle (writer_pipe[1]), + GetCurrentProcess (), + &out_handle, + 0, FALSE, + DUPLICATE_SAME_ACCESS)); + close (writer_pipe[1]); + + out = g_win32_output_stream_new (out_handle, TRUE); + do + { + g_usleep (10); + + offset = 0; + while (offset < (gssize) sizeof (DATA)) + { + nwrote = g_output_stream_write (out, DATA + offset, + sizeof (DATA) - offset, + writer_cancel, &err); + if (nwrote <= 0 || err != NULL) + break; + offset += nwrote; + } + + g_assert (nwrote > 0 || err != NULL); + } + while (err == NULL); + + if (g_cancellable_is_cancelled (writer_cancel)) + { + g_cancellable_cancel (main_cancel); + g_object_unref (out); + return NULL; + } + + g_warning ("writer: %s", err->message); + g_assert_not_reached (); +} + +static gpointer +reader_thread (gpointer user_data) +{ + GInputStream *in; + gssize nread = 0, total; + GError *err = NULL; + char buf[sizeof (DATA)]; + HANDLE in_handle; + + g_assert (DuplicateHandle (GetCurrentProcess (), + (HANDLE) (gintptr) _get_osfhandle (reader_pipe[0]), + GetCurrentProcess (), + &in_handle, + 0, FALSE, + DUPLICATE_SAME_ACCESS)); + close (reader_pipe[0]); + + in = g_win32_input_stream_new (in_handle, TRUE); + + do + { + total = 0; + while (total < (gssize) sizeof (DATA)) + { + nread = g_input_stream_read (in, buf + total, sizeof (buf) - total, + reader_cancel, &err); + if (nread <= 0 || err != NULL) + break; + total += nread; + } + + if (err) + break; + + if (nread == 0) + { + g_assert (err == NULL); + /* pipe closed */ + g_object_unref (in); + return NULL; + } + + g_assert_cmpstr (buf, ==, DATA); + g_assert (!g_cancellable_is_cancelled (reader_cancel)); + } + while (err == NULL); + + g_warning ("reader: %s", err->message); + g_assert_not_reached (); +} + +char main_buf[sizeof (DATA)]; +gssize main_len, main_offset; + +static void readable (GObject *source, GAsyncResult *res, gpointer user_data); +static void writable (GObject *source, GAsyncResult *res, gpointer user_data); + +static void +do_main_cancel (GOutputStream *out) +{ + g_output_stream_close (out, NULL, NULL); + g_main_loop_quit (loop); +} + +static void +readable (GObject *source, GAsyncResult *res, gpointer user_data) +{ + GInputStream *in = G_INPUT_STREAM (source); + GOutputStream *out = user_data; + GError *err = NULL; + + main_len = g_input_stream_read_finish (in, res, &err); + + if (g_cancellable_is_cancelled (main_cancel)) + { + do_main_cancel (out); + return; + } + + g_assert (err == NULL); + + main_offset = 0; + g_output_stream_write_async (out, main_buf, main_len, + G_PRIORITY_DEFAULT, main_cancel, + writable, in); +} + +static void +writable (GObject *source, GAsyncResult *res, gpointer user_data) +{ + GOutputStream *out = G_OUTPUT_STREAM (source); + GInputStream *in = user_data; + GError *err = NULL; + gssize nwrote; + + nwrote = g_output_stream_write_finish (out, res, &err); + + if (g_cancellable_is_cancelled (main_cancel)) + { + do_main_cancel (out); + return; + } + + g_assert (err == NULL); + g_assert_cmpint (nwrote, <=, main_len - main_offset); + + main_offset += nwrote; + if (main_offset == main_len) + { + g_input_stream_read_async (in, main_buf, sizeof (main_buf), + G_PRIORITY_DEFAULT, main_cancel, + readable, out); + } + else + { + g_output_stream_write_async (out, main_buf + main_offset, + main_len - main_offset, + G_PRIORITY_DEFAULT, main_cancel, + writable, in); + } +} + +static gboolean +timeout (gpointer cancellable) +{ + g_cancellable_cancel (cancellable); + return FALSE; +} + +static void +test_pipe_io (void) +{ + GThread *writer, *reader; + GInputStream *in; + GOutputStream *out; + HANDLE in_handle, out_handle; + + /* Split off two (additional) threads, a reader and a writer. From + * the writer thread, write data synchronously in small chunks, + * which gets read asynchronously by the main thread and then + * written asynchronously to the reader thread, which reads it + * synchronously. Eventually a timeout in the main thread will cause + * it to cancel the writer thread, which will in turn cancel the + * read op in the main thread, which will then close the pipe to + * the reader thread, causing the read op to fail. + */ + + g_assert (_pipe (writer_pipe, 10, _O_BINARY) == 0 && _pipe (reader_pipe, 10, _O_BINARY) == 0); + + writer_cancel = g_cancellable_new (); + reader_cancel = g_cancellable_new (); + main_cancel = g_cancellable_new (); + + writer = g_thread_create (writer_thread, NULL, TRUE, NULL); + reader = g_thread_create (reader_thread, NULL, TRUE, NULL); + + g_assert (DuplicateHandle (GetCurrentProcess (), + (HANDLE) (gintptr) _get_osfhandle (writer_pipe[0]), + GetCurrentProcess (), + &in_handle, + 0, FALSE, + DUPLICATE_SAME_ACCESS)); + close (writer_pipe[0]); + + g_assert (DuplicateHandle (GetCurrentProcess (), + (HANDLE) (gintptr) _get_osfhandle (reader_pipe[1]), + GetCurrentProcess (), + &out_handle, + 0, FALSE, + DUPLICATE_SAME_ACCESS)); + close (reader_pipe[1]); + + in = g_win32_input_stream_new (in_handle, TRUE); + out = g_win32_output_stream_new (out_handle, TRUE); + + g_input_stream_read_async (in, main_buf, sizeof (main_buf), + G_PRIORITY_DEFAULT, main_cancel, + readable, out); + + g_timeout_add (500, timeout, writer_cancel); + + loop = g_main_loop_new (NULL, TRUE); + g_main_loop_run (loop); + g_main_loop_unref (loop); + + g_thread_join (reader); + g_thread_join (writer); + + g_object_unref (main_cancel); + g_object_unref (reader_cancel); + g_object_unref (writer_cancel); + g_object_unref (in); + g_object_unref (out); +} + +int +main (int argc, + char *argv[]) +{ + g_thread_init (NULL); + g_type_init (); + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/win32-streams/pipe-io-test", test_pipe_io); + + return g_test_run(); +} diff --git a/gio/win32/Makefile.am b/gio/win32/Makefile.am index bb609e3..6f85a15 100644 --- a/gio/win32/Makefile.am +++ b/gio/win32/Makefile.am @@ -20,11 +20,7 @@ libgiowin32_la_SOURCES = \ libgiowin32_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_builddir)/gio \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ diff --git a/gio/win32/Makefile.in b/gio/win32/Makefile.in index f897f0c..37f0867 100644 --- a/gio/win32/Makefile.in +++ b/gio/win32/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -99,6 +99,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -123,11 +124,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -141,13 +145,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -194,6 +201,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -201,6 +210,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -226,6 +236,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -242,6 +254,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -251,11 +264,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -271,11 +286,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -289,7 +310,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -336,11 +356,7 @@ libgiowin32_la_SOURCES = \ libgiowin32_la_CFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GIO\" \ - -I$(top_builddir)/gio \ - -I$(top_srcdir) \ - -I$(top_srcdir)/glib \ - -I$(top_srcdir)/gmodule \ - -I$(top_srcdir)/gio \ + $(gio_INCLUDES) \ $(GLIB_DEBUG_FLAGS) \ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \ -DGIO_COMPILATION \ @@ -677,13 +693,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -710,8 +729,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -720,9 +743,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gio/win32/gwin32directorymonitor.c b/gio/win32/gwin32directorymonitor.c index 6e9fa68..4b774ee 100644 --- a/gio/win32/gwin32directorymonitor.c +++ b/gio/win32/gwin32directorymonitor.c @@ -25,7 +25,6 @@ #include "config.h" #include "gwin32directorymonitor.h" -#include "giomodule.h" #include G_DEFINE_TYPE_WITH_CODE (GWin32DirectoryMonitor, diff --git a/gio/win32/gwin32directorymonitor.h b/gio/win32/gwin32directorymonitor.h index 1504bd4..810f797 100644 --- a/gio/win32/gwin32directorymonitor.h +++ b/gio/win32/gwin32directorymonitor.h @@ -29,8 +29,8 @@ #include #include -#include "glocaldirectorymonitor.h" -#include "giomodule.h" +#include "gio/glocaldirectorymonitor.h" +#include "gio/giomodule.h" G_BEGIN_DECLS diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c index 5f2d6be..84d5d77 100644 --- a/gio/win32/gwinhttpfile.c +++ b/gio/win32/gwinhttpfile.c @@ -28,18 +28,16 @@ #include #include -#include "gfile.h" -#include "gfileattribute.h" -#include "gfileinfo.h" +#include "gio/gfile.h" +#include "gio/gfileattribute.h" +#include "gio/gfileinfo.h" #include "gwinhttpfile.h" #include "gwinhttpfileinputstream.h" #include "gwinhttpfileoutputstream.h" -#include "gioerror.h" +#include "gio/gioerror.h" #include "glibintl.h" -#include "gioalias.h" - static void g_winhttp_file_file_iface_init (GFileIface *iface); #define g_winhttp_file_get_type _g_winhttp_file_get_type diff --git a/gio/win32/gwinhttpfileinputstream.c b/gio/win32/gwinhttpfileinputstream.c index 3bd361e..1d1d2a3 100644 --- a/gio/win32/gwinhttpfileinputstream.c +++ b/gio/win32/gwinhttpfileinputstream.c @@ -26,13 +26,11 @@ #include -#include "gcancellable.h" -#include "gioerror.h" +#include "gio/gcancellable.h" +#include "gio/gioerror.h" #include "gwinhttpfileinputstream.h" #include "glibintl.h" -#include "gioalias.h" - struct _GWinHttpFileInputStream { GFileInputStream parent_instance; diff --git a/gio/win32/gwinhttpfileoutputstream.c b/gio/win32/gwinhttpfileoutputstream.c index 586a2a6..1c6888c 100644 --- a/gio/win32/gwinhttpfileoutputstream.c +++ b/gio/win32/gwinhttpfileoutputstream.c @@ -26,13 +26,11 @@ #include -#include "gcancellable.h" -#include "gioerror.h" +#include "gio/gcancellable.h" +#include "gio/gioerror.h" #include "gwinhttpfileoutputstream.h" #include "glibintl.h" -#include "gioalias.h" - struct _GWinHttpFileOutputStream { GFileOutputStream parent_instance; diff --git a/gio/win32/gwinhttpvfs.c b/gio/win32/gwinhttpvfs.c index 494f53f..a0f747e 100644 --- a/gio/win32/gwinhttpvfs.c +++ b/gio/win32/gwinhttpvfs.c @@ -26,15 +26,13 @@ #include -#include "gioerror.h" -#include "giomodule.h" -#include "gvfs.h" +#include "gio/gioerror.h" +#include "gio/giomodule.h" +#include "gio/gvfs.h" #include "gwinhttpfile.h" #include "gwinhttpvfs.h" -#include "gioalias.h" - static gboolean lookup_done = FALSE; static gboolean funcs_found = FALSE; static GWinHttpDllFuncs funcs; @@ -42,12 +40,23 @@ static GWinHttpDllFuncs funcs; static void lookup_funcs (void) { - HMODULE winhttp; + HMODULE winhttp = NULL; + char winhttp_dll[MAX_PATH + 100]; + int n; if (lookup_done) return; - winhttp = LoadLibrary ("winhttp.dll"); + n = GetSystemDirectory (winhttp_dll, MAX_PATH); + if (n > 0 && n < MAX_PATH) + { + if (winhttp_dll[n-1] != '\\' && + winhttp_dll[n-1] != '/') + strcat (winhttp_dll, "\\"); + strcat (winhttp_dll, "winhttp.dll"); + winhttp = LoadLibrary (winhttp_dll); + } + if (winhttp != NULL) { funcs.pWinHttpCloseHandle = (BOOL (WINAPI *) (HINTERNET)) GetProcAddress (winhttp, "WinHttpCloseHandle"); diff --git a/gio/win32/gwinhttpvfs.h b/gio/win32/gwinhttpvfs.h index 11593ab..655c223 100644 --- a/gio/win32/gwinhttpvfs.h +++ b/gio/win32/gwinhttpvfs.h @@ -26,8 +26,7 @@ #define __G_WINHTTP_VFS_H__ #include - -#include "gvfs.h" +#include #define _WIN32_WINNT 0x0500 #include diff --git a/gio/xdgmime/Makefile.in b/gio/xdgmime/Makefile.in index 94e00cb..aca8f7d 100644 --- a/gio/xdgmime/Makefile.in +++ b/gio/xdgmime/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -93,6 +93,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -117,11 +118,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -135,13 +139,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -188,6 +195,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -195,6 +204,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -220,6 +230,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -236,6 +248,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -245,11 +258,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -265,11 +280,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -283,7 +304,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -626,13 +646,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -659,8 +682,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -669,9 +696,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gio/xdgmime/xdgmime.c b/gio/xdgmime/xdgmime.c index 0888583..846be39 100644 --- a/gio/xdgmime/xdgmime.c +++ b/gio/xdgmime/xdgmime.c @@ -480,6 +480,8 @@ xdg_mime_get_mime_type_for_data (const void *data, return XDG_MIME_TYPE_UNKNOWN; } +#ifdef NOT_USED_IN_GIO + const char * xdg_mime_get_mime_type_for_file (const char *file_name, struct stat *statbuf) @@ -575,6 +577,8 @@ xdg_mime_get_mime_type_from_file_name (const char *file_name) return XDG_MIME_TYPE_UNKNOWN; } +#endif + int xdg_mime_get_mime_types_from_file_name (const char *file_name, const char *mime_types[], @@ -588,6 +592,8 @@ xdg_mime_get_mime_types_from_file_name (const char *file_name, return _xdg_glob_hash_lookup_file_name (global_hash, file_name, mime_types, n_mime_types); } +#ifdef NOT_USED_IN_GIO + int xdg_mime_is_valid_mime_type (const char *mime_type) { @@ -596,6 +602,8 @@ xdg_mime_is_valid_mime_type (const char *mime_type) return _xdg_utf8_validate (mime_type); } +#endif + void xdg_mime_shutdown (void) { @@ -801,14 +809,19 @@ xdg_mime_mime_type_subclass (const char *mime, char ** xdg_mime_list_mime_parents (const char *mime) { + const char *umime; const char **parents; char **result; int i, n; + xdg_mime_init (); + if (_caches) return _xdg_mime_cache_list_mime_parents (mime); - parents = xdg_mime_get_mime_parents (mime); + umime = _xdg_mime_unalias_mime_type (mime); + + parents = _xdg_mime_parent_list_lookup (parent_list, umime); if (!parents) return NULL; @@ -822,6 +835,8 @@ xdg_mime_list_mime_parents (const char *mime) return result; } +#ifdef NOT_USED_IN_GIO + const char ** xdg_mime_get_mime_parents (const char *mime) { @@ -851,6 +866,7 @@ xdg_mime_dump (void) _xdg_mime_cache_glob_dump (); } +#endif /* Registers a function to be called every time the mime database reloads its files */ @@ -878,6 +894,8 @@ xdg_mime_register_reload_callback (XdgMimeCallback callback, return callback_id - 1; } +#ifdef NOT_USED_IN_GIO + void xdg_mime_remove_callback (int callback_id) { @@ -903,6 +921,8 @@ xdg_mime_remove_callback (int callback_id) } } +#endif + const char * xdg_mime_get_icon (const char *mime) { diff --git a/gio/xdgmime/xdgmime.h b/gio/xdgmime/xdgmime.h index d3031a3..fadf59d 100644 --- a/gio/xdgmime/xdgmime.h +++ b/gio/xdgmime/xdgmime.h @@ -71,9 +71,9 @@ typedef void (*XdgMimeDestroy) (void *user_data); #define xdg_mime_get_icon XDG_ENTRY(get_icon) #define xdg_mime_get_generic_icon XDG_ENTRY(get_generic_icon) -#define _xdg_mime_mime_type_equal XDG_RESERVED_ENTRY(mime_type_equal) #define _xdg_mime_mime_type_subclass XDG_RESERVED_ENTRY(mime_type_subclass) -#define _xdg_mime_unalias_mime_type XDG_RESERVED_ENTRY(unalias_mime_type) +#define _xdg_mime_mime_type_equal XDG_RESERVED_ENTRY(mime_type_equal) +#define _xdg_mime_unalias_mime_type XDG_RESERVED_ENTRY(unalias_mime_type) #endif extern const char xdg_mime_type_unknown[]; @@ -82,13 +82,17 @@ extern const char xdg_mime_type_unknown[]; const char *xdg_mime_get_mime_type_for_data (const void *data, size_t len, int *result_prio); +#ifdef NOT_USED_IN_GIO const char *xdg_mime_get_mime_type_for_file (const char *file_name, struct stat *statbuf); const char *xdg_mime_get_mime_type_from_file_name (const char *file_name); +#endif int xdg_mime_get_mime_types_from_file_name(const char *file_name, const char *mime_types[], int n_mime_types); +#ifdef NOT_USED_IN_GIO int xdg_mime_is_valid_mime_type (const char *mime_type); +#endif int xdg_mime_mime_type_equal (const char *mime_a, const char *mime_b); int xdg_mime_media_type_equal (const char *mime_a, @@ -100,18 +104,24 @@ int xdg_mime_mime_type_subclass (const char *mime_a, * instead, but notice that that function expects you to free * the array it returns. */ +#ifdef NOT_USED_IN_GIO const char **xdg_mime_get_mime_parents (const char *mime); +#endif char ** xdg_mime_list_mime_parents (const char *mime); const char *xdg_mime_unalias_mime_type (const char *mime); const char *xdg_mime_get_icon (const char *mime); const char *xdg_mime_get_generic_icon (const char *mime); int xdg_mime_get_max_buffer_extents (void); void xdg_mime_shutdown (void); +#ifdef NOT_USED_IN_GIO void xdg_mime_dump (void); +#endif int xdg_mime_register_reload_callback (XdgMimeCallback callback, void *data, XdgMimeDestroy destroy); +#ifdef NOT_USED_IN_GIO void xdg_mime_remove_callback (int callback_id); +#endif /* Private versions of functions that don't call xdg_mime_init () */ int _xdg_mime_mime_type_equal (const char *mime_a, diff --git a/gio/xdgmime/xdgmimealias.c b/gio/xdgmime/xdgmimealias.c index c33adfa..8740c3f 100644 --- a/gio/xdgmime/xdgmimealias.c +++ b/gio/xdgmime/xdgmimealias.c @@ -165,6 +165,8 @@ _xdg_mime_alias_read_from_file (XdgAliasList *list, } +#ifdef NOT_USED_IN_GIO + void _xdg_mime_alias_list_dump (XdgAliasList *list) { @@ -181,4 +183,4 @@ _xdg_mime_alias_list_dump (XdgAliasList *list) } } - +#endif diff --git a/gio/xdgmime/xdgmimealias.h b/gio/xdgmime/xdgmimealias.h index 3c28012..06fc0c3 100644 --- a/gio/xdgmime/xdgmimealias.h +++ b/gio/xdgmime/xdgmimealias.h @@ -46,6 +46,7 @@ XdgAliasList *_xdg_mime_alias_list_new (void); void _xdg_mime_alias_list_free (XdgAliasList *list); const char *_xdg_mime_alias_list_lookup (XdgAliasList *list, const char *alias); +#ifdef NOT_USED_IN_GIO void _xdg_mime_alias_list_dump (XdgAliasList *list); - +#endif #endif /* __XDG_MIME_ALIAS_H__ */ diff --git a/gio/xdgmime/xdgmimecache.c b/gio/xdgmime/xdgmimecache.c index 91c8a07..0324e14 100644 --- a/gio/xdgmime/xdgmimecache.c +++ b/gio/xdgmime/xdgmimecache.c @@ -740,6 +740,8 @@ _xdg_mime_cache_get_mime_type_for_data (const void *data, return cache_get_mime_type_for_data (data, len, result_prio, NULL, 0); } +#ifdef NOT_USED_IN_GIO + const char * _xdg_mime_cache_get_mime_type_for_file (const char *file_name, struct stat *statbuf) @@ -820,6 +822,8 @@ _xdg_mime_cache_get_mime_type_from_file_name (const char *file_name) return XDG_MIME_TYPE_UNKNOWN; } +#endif + int _xdg_mime_cache_get_mime_types_from_file_name (const char *file_name, const char *mime_types[], @@ -1036,6 +1040,8 @@ _xdg_mime_cache_get_icon (const char *mime) return cache_lookup_icon (mime, 32); } +#ifdef NOT_USED_IN_GIO + static void dump_glob_node (XdgMimeCache *cache, xdg_uint32_t offset, @@ -1082,4 +1088,4 @@ _xdg_mime_cache_glob_dump (void) } } - +#endif diff --git a/gio/xdgmime/xdgmimecache.h b/gio/xdgmime/xdgmimecache.h index 27f42d0..48756ad 100644 --- a/gio/xdgmime/xdgmimecache.h +++ b/gio/xdgmime/xdgmimecache.h @@ -58,12 +58,16 @@ void _xdg_mime_cache_unref (XdgMimeCache *cache); const char *_xdg_mime_cache_get_mime_type_for_data (const void *data, size_t len, int *result_prio); +#ifdef NOT_USED_IN_GIO const char *_xdg_mime_cache_get_mime_type_for_file (const char *file_name, struct stat *statbuf); +#endif int _xdg_mime_cache_get_mime_types_from_file_name (const char *file_name, const char *mime_types[], int n_mime_types); +#ifdef NOT_USED_IN_GIO const char *_xdg_mime_cache_get_mime_type_from_file_name (const char *file_name); +#endif int _xdg_mime_cache_is_valid_mime_type (const char *mime_type); int _xdg_mime_cache_mime_type_equal (const char *mime_a, const char *mime_b); @@ -76,6 +80,8 @@ const char *_xdg_mime_cache_unalias_mime_type (const char *mime); int _xdg_mime_cache_get_max_buffer_extents (void); const char *_xdg_mime_cache_get_icon (const char *mime); const char *_xdg_mime_cache_get_generic_icon (const char *mime); +#ifdef NOT_USED_IN_GIO void _xdg_mime_cache_glob_dump (void); +#endif #endif /* __XDG_MIME_CACHE_H__ */ diff --git a/gio/xdgmime/xdgmimeglob.c b/gio/xdgmime/xdgmimeglob.c index daea606..eeda2a5 100644 --- a/gio/xdgmime/xdgmimeglob.c +++ b/gio/xdgmime/xdgmimeglob.c @@ -162,6 +162,8 @@ _xdg_glob_hash_node_new (void) return glob_hash_node; } +#ifdef NOT_USED_IN_GIO + static void _xdg_glob_hash_node_dump (XdgGlobHashNode *glob_hash_node, int depth) @@ -181,6 +183,8 @@ _xdg_glob_hash_node_dump (XdgGlobHashNode *glob_hash_node, _xdg_glob_hash_node_dump (glob_hash_node->next, depth); } +#endif + static XdgGlobHashNode * _xdg_glob_hash_insert_ucs4 (XdgGlobHashNode *glob_hash_node, xdg_unichar_t *text, @@ -603,6 +607,8 @@ _xdg_glob_hash_append_glob (XdgGlobHash *glob_hash, } } +#ifdef NOT_USED_IN_GIO + void _xdg_glob_hash_dump (XdgGlobHash *glob_hash) { @@ -639,6 +645,7 @@ _xdg_glob_hash_dump (XdgGlobHash *glob_hash) } } +#endif void _xdg_mime_glob_read_from_file (XdgGlobHash *glob_hash, diff --git a/gio/xdgmime/xdgmimeglob.h b/gio/xdgmime/xdgmimeglob.h index 0018292..d826434 100644 --- a/gio/xdgmime/xdgmimeglob.h +++ b/gio/xdgmime/xdgmimeglob.h @@ -65,6 +65,8 @@ void _xdg_glob_hash_append_glob (XdgGlobHash *glob_hash, int weight, int case_sensitive); XdgGlobType _xdg_glob_determine_type (const char *glob); +#ifdef NOT_USED_IN_GIO void _xdg_glob_hash_dump (XdgGlobHash *glob_hash); +#endif #endif /* __XDG_MIME_GLOB_H__ */ diff --git a/gio/xdgmime/xdgmimeicon.c b/gio/xdgmime/xdgmimeicon.c index 16db843..9658bd4 100644 --- a/gio/xdgmime/xdgmimeicon.c +++ b/gio/xdgmime/xdgmimeicon.c @@ -163,6 +163,7 @@ _xdg_mime_icon_read_from_file (XdgIconList *list, sizeof (XdgIcon), icon_entry_cmp); } +#ifdef NOT_USED_IN_GIO void _xdg_mime_icon_list_dump (XdgIconList *list) @@ -180,4 +181,5 @@ _xdg_mime_icon_list_dump (XdgIconList *list) } } +#endif diff --git a/gio/xdgmime/xdgmimeicon.h b/gio/xdgmime/xdgmimeicon.h index b5f2583..4f604c1 100644 --- a/gio/xdgmime/xdgmimeicon.h +++ b/gio/xdgmime/xdgmimeicon.h @@ -45,6 +45,8 @@ XdgIconList *_xdg_mime_icon_list_new (void); void _xdg_mime_icon_list_free (XdgIconList *list); const char *_xdg_mime_icon_list_lookup (XdgIconList *list, const char *mime); +#ifdef NOT_USED_IN_GIO void _xdg_mime_icon_list_dump (XdgIconList *list); +#endif #endif /* __XDG_MIME_ICON_H__ */ diff --git a/gio/xdgmime/xdgmimeparent.c b/gio/xdgmime/xdgmimeparent.c index 52d3c0c..577b49f 100644 --- a/gio/xdgmime/xdgmimeparent.c +++ b/gio/xdgmime/xdgmimeparent.c @@ -199,6 +199,7 @@ _xdg_mime_parent_read_from_file (XdgParentList *list, sizeof (XdgMimeParents), &parent_entry_cmp); } +#ifdef NOT_USED_IN_GIO void _xdg_mime_parent_list_dump (XdgParentList *list) @@ -216,4 +217,5 @@ _xdg_mime_parent_list_dump (XdgParentList *list) } } +#endif diff --git a/gio/xdgmime/xdgmimeparent.h b/gio/xdgmime/xdgmimeparent.h index b564f41..fbc927e 100644 --- a/gio/xdgmime/xdgmimeparent.h +++ b/gio/xdgmime/xdgmimeparent.h @@ -46,6 +46,8 @@ XdgParentList *_xdg_mime_parent_list_new (void); void _xdg_mime_parent_list_free (XdgParentList *list); const char **_xdg_mime_parent_list_lookup (XdgParentList *list, const char *mime); +#ifdef NOT_USED_IN_GIO void _xdg_mime_parent_list_dump (XdgParentList *list); +#endif #endif /* __XDG_MIME_PARENT_H__ */ diff --git a/glib-zip.in b/glib-zip.in index 859a06a..b8ceb09 100755 --- a/glib-zip.in +++ b/glib-zip.in @@ -64,6 +64,7 @@ lib/pkgconfig/gmodule-no-export-2.0.pc lib/pkgconfig/gobject-2.0.pc lib/pkgconfig/gthread-2.0.pc lib/pkgconfig/gio-2.0.pc +lib/pkgconfig/gio-windows-2.0.pc share/aclocal/glib-2.0.m4 share/aclocal/glib-gettext.m4 share/glib-2.0 diff --git a/glib/Makefile.am b/glib/Makefile.am index 8882ae2..d757773 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -1,6 +1,29 @@ ## Process this file with automake to produce Makefile.in include $(top_srcdir)/Makefile.decl +BUILT_SOURCES = +DISTCLEANFILES = +CLEANFILES = + +# +# Generate glibconfig.h +# +# The timestamp of the stamp file is used to indicate if glibconfig.h is +# up to date with respect to config.status. In the usual case, changes +# to config.status will not result in changes to glibconfig.h so we +# avoid touching its timestamp (in order not to rebuild the whole tree). +# +DISTCLEANFILES += glibconfig-stamp glibconfig.h +BUILT_SOURCES += glibconfig-stamp +configexecincludedir = $(libdir)/glib-2.0/include +nodist_configexecinclude_HEADERS = glibconfig.h +glibconfig-stamp: ../config.status + $(AM_V_GEN) cd $(top_builddir) && \ + $(SHELL) ./config.status glib/glibconfig.h + @touch glibconfig-stamp + + + if HAVE_GOOD_PRINTF else PRINTF_SUBDIR = gnulib @@ -30,7 +53,7 @@ SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests AM_CPPFLAGS = \ - -I$(top_srcdir) \ + $(glib_INCLUDES) \ $(pcre_inc) \ -DG_LOG_DOMAIN=\"GLib\" \ $(GLIB_DEBUG_FLAGS) \ @@ -39,23 +62,15 @@ AM_CPPFLAGS = \ -DPCRE_STATIC glib.def: glib.symbols - (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > glib.def - -galias.h: $(srcdir)/makegalias.pl glib.symbols - $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h - -galiasdef.c: $(srcdir)/makegalias.pl glib.symbols - $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c + $(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > glib.def if OS_LINUX if HAVE_GNUC_VISIBILITY TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)" -TESTS = abicheck.sh pltcheck.sh +TESTS = abicheck.sh endif endif -BUILT_SOURCES = galias.h galiasdef.c - MIRRORING_TAB_SOURCE = \ glib-mirroring-tab/Makefile \ glib-mirroring-tab/gen-mirroring-tab.c \ @@ -69,9 +84,8 @@ EXTRA_DIST += \ glib.rc.in \ gen-unicode-tables.pl \ gen-script-table.pl \ - makegalias.pl \ + glibconfig.h.win32.in \ abicheck.sh \ - pltcheck.sh \ glib.symbols \ gregex.c \ gregex.h \ @@ -82,9 +96,8 @@ EXTRA_DIST += \ # These may be in the builddir too BUILT_EXTRA_DIST = \ makefile.msc \ - glib.rc \ - galias.h \ - galiasdef.c + glibconfig.h.win32 \ + glib.rc lib_LTLIBRARIES = libglib-2.0.la @@ -104,6 +117,7 @@ uninstall-ms-lib: $(uninstall_ms_lib_cmd) libglib_2_0_la_SOURCES = \ + glib_probes.d \ garray.c \ gasyncqueue.c \ $(gatomic_c) \ @@ -120,7 +134,8 @@ libglib_2_0_la_SOURCES = \ gconvert.c \ gdataset.c \ gdatasetprivate.h \ - gdate.c \ + gdate.c \ + gdatetime.c \ gdir.c \ gerror.c \ gfileutils.c \ @@ -128,10 +143,11 @@ libglib_2_0_la_SOURCES = \ ghook.c \ ghostutils.c \ giochannel.c \ - gkeyfile.c \ + gkeyfile.c \ glibintl.h \ + glib_trace.h \ glist.c \ - gmain.c \ + gmain.c \ gmappedfile.c \ gmarkup.c \ gmem.c \ @@ -161,6 +177,7 @@ libglib_2_0_la_SOURCES = \ gthreadprivate.h \ gthreadpool.c \ gtimer.c \ + gtimezone.c \ gtree.c \ guniprop.c \ gutf8.c \ @@ -218,6 +235,7 @@ glibsubinclude_HEADERS = \ gconvert.h \ gdataset.h \ gdate.h \ + gdatetime.h \ gdir.h \ gerror.h \ gfileutils.h \ @@ -259,10 +277,11 @@ glibsubinclude_HEADERS = \ gthread.h \ gthreadpool.h \ gtimer.h \ + gtimezone.h \ gtree.h \ gtypes.h \ gunicode.h \ - gurifuncs.h \ + gurifuncs.h \ gutils.h \ gvarianttype.h \ gvariant.h \ @@ -274,7 +293,7 @@ install-data-local: install-ms-lib install-def-file echo "*** Old headers found in $(glibincludedir). You should remove the" ; \ echo "*** contents of this directory and type 'make install' again." ; \ false ; \ - fi + fi uninstall-local: uninstall-ms-lib uninstall-def-file @@ -315,16 +334,34 @@ pcre_lib = pcre_inc = endif -libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) +libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(GLIB_RT_LIBS) libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def) -libglib_2_0_la_LDFLAGS = \ +libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ $(glib_win32_res_ldflag) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic $(no_undefined) $(export_symbols) INSTALL_PROGS= +if ENABLE_DTRACE +glib_probes.h: glib_probes.d Makefile + $(DTRACE) -C -h -s $< -o $@.tmp + sed -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp +glib_probes.o: glib_probes.d Makefile + $(DTRACE) -G -s $< -o $@ +BUILT_SOURCES += glib_probes.h glib_probes.o +CLEANFILES += glib_probes.h glib_probes.h.tmp +libglib_2_0_la_LIBADD += glib_probes.o +endif + +if ENABLE_SYSTEMTAP +tapset_in_files = glib.stp.in +tapsetdir = @ABS_TAPSET_DIR@ +tapset_DATA = $(tapset_in_files:.stp.in=.stp) +EXTRA_DIST += $(tapset_in_files) +endif + gspawn-win32-helper-console.c: echo '#define HELPER_CONSOLE' >$@ echo '#include "gspawn-win32-helper.c"' >>$@ @@ -336,6 +373,7 @@ gspawn-win64-helper-console.c: echo '#define HELPER_CONSOLE' >$@ echo '#include "gspawn-win32-helper.c"' >>$@ + if OS_WIN32 if OS_WIN32_X64 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console @@ -366,8 +404,8 @@ bin_SCRIPTS = ${auto_config_binscripts} EXTRA_DIST += ${auto_config_binscripts} CONFIGVARS = \ - "bindir" : "${bindir}", \ - "glib-version" : "${GLIB_VERSION}" + "bindir" : "${bindir}", \ + "glib-version" : "${GLIB_VERSION}" install-exec-hook: for sf in ${auto_config_binscripts} ; do \ @@ -376,6 +414,7 @@ install-exec-hook: -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@| ${CONFIGVARS}|' \ -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \ || exit $$? ; \ + chmod a+x $(DESTDIR)$(bindir)/$$sf ; \ rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \ done @@ -411,7 +450,7 @@ gdbdir = $(datadir)/glib-2.0/gdb dist_gdb_SCRIPTS = glib.py libglib-gdb.py: libglib-gdb.py.in - sed -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py + $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py install-data-hook: libglib-gdb.py diff --git a/glib/Makefile.in b/glib/Makefile.in index 2e55684..0c5be22 100644 --- a/glib/Makefile.in +++ b/glib/Makefile.in @@ -43,12 +43,17 @@ host_triplet = @host@ DIST_COMMON = $(am__glibsubinclude_HEADERS_DIST) $(dist_gdb_SCRIPTS) \ $(glibinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/glib.rc.in \ + $(srcdir)/glib.stp.in $(srcdir)/glibconfig.h.win32.in \ $(srcdir)/makefile.msc.in $(top_srcdir)/Makefile.decl -@OS_WIN32_TRUE@@OS_WIN32_X64_TRUE@am__append_1 = gspawn-win64-helper gspawn-win64-helper-console -@OS_WIN32_TRUE@@OS_WIN32_X64_FALSE@am__append_2 = gspawn-win32-helper gspawn-win32-helper-console +@ENABLE_DTRACE_TRUE@am__append_1 = glib_probes.h glib_probes.o +@ENABLE_DTRACE_TRUE@am__append_2 = glib_probes.h glib_probes.h.tmp +@ENABLE_DTRACE_TRUE@am__append_3 = glib_probes.o +@ENABLE_SYSTEMTAP_TRUE@am__append_4 = $(tapset_in_files) +@OS_WIN32_TRUE@@OS_WIN32_X64_TRUE@am__append_5 = gspawn-win64-helper gspawn-win64-helper-console +@OS_WIN32_TRUE@@OS_WIN32_X64_FALSE@am__append_6 = gspawn-win32-helper gspawn-win32-helper-console bin_PROGRAMS = $(am__EXEEXT_4) -@OS_UNIX_TRUE@am__append_3 = gtester -@OS_UNIX_TRUE@am__append_4 = ${auto_config_binscripts} +@OS_UNIX_TRUE@am__append_7 = gtester +@OS_UNIX_TRUE@am__append_8 = ${auto_config_binscripts} subdir = glib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ @@ -56,12 +61,12 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = makefile.msc glib.rc +CONFIG_CLEAN_FILES = glib.stp glibconfig.h.win32 makefile.msc glib.rc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -86,30 +91,34 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gdbdir)" \ - "$(DESTDIR)$(glibincludedir)" "$(DESTDIR)$(glibsubincludedir)" + "$(DESTDIR)$(tapsetdir)" "$(DESTDIR)$(glibincludedir)" \ + "$(DESTDIR)$(glibsubincludedir)" \ + "$(DESTDIR)$(configexecincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @ENABLE_REGEX_TRUE@@USE_SYSTEM_PCRE_FALSE@am__DEPENDENCIES_2 = \ @ENABLE_REGEX_TRUE@@USE_SYSTEM_PCRE_FALSE@ pcre/libpcre.la @ENABLE_REGEX_TRUE@@USE_SYSTEM_PCRE_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -am__libglib_2_0_la_SOURCES_DIST = garray.c gasyncqueue.c gatomic.c \ - gatomic-gcc.c gbacktrace.c gbase64.c gbitlock.c \ +am__libglib_2_0_la_SOURCES_DIST = glib_probes.d garray.c gasyncqueue.c \ + gatomic.c gatomic-gcc.c gbacktrace.c gbase64.c gbitlock.c \ gbookmarkfile.c gbsearcharray.h gbuffer.c gbuffer.h gcache.c \ gchecksum.c gcompletion.c gconvert.c gdataset.c \ - gdatasetprivate.h gdate.c gdir.c gerror.c gfileutils.c ghash.c \ - ghook.c ghostutils.c giochannel.c gkeyfile.c glibintl.h \ - glist.c gmain.c gmappedfile.c gmarkup.c gmem.c gmessages.c \ - gmirroringtable.h gnode.c goption.c gpattern.c gpoll.c \ - gprimes.c gqsort.c gqueue.c grel.c grand.c gregex.c gscanner.c \ - gscripttable.h gsequence.c gshell.c gslice.c gslist.c gstdio.c \ - gstrfuncs.c gstring.c gtestutils.c gthread.c gthreadprivate.h \ - gthreadpool.c gtimer.c gtree.c guniprop.c gutf8.c gunibreak.h \ - gunibreak.c gunichartables.h gunicollate.c gunicomp.h \ - gunidecomp.h gunidecomp.c gunicodeprivate.h gurifuncs.c \ - gutils.c gvariant.h gvariant.c gvariant-core.h gvariant-core.c \ - gvariant-internal.h gvariant-parser.c gvariant-serialiser.h \ - gvariant-serialiser.c gvarianttypeinfo.h gvarianttypeinfo.c \ - gvarianttype.c gdebug.h gprintf.c gprintfint.h + gdatasetprivate.h gdate.c gdatetime.c gdir.c gerror.c \ + gfileutils.c ghash.c ghook.c ghostutils.c giochannel.c \ + gkeyfile.c glibintl.h glib_trace.h glist.c gmain.c \ + gmappedfile.c gmarkup.c gmem.c gmessages.c gmirroringtable.h \ + gnode.c goption.c gpattern.c gpoll.c gprimes.c gqsort.c \ + gqueue.c grel.c grand.c gregex.c gscanner.c gscripttable.h \ + gsequence.c gshell.c gslice.c gslist.c gstdio.c gstrfuncs.c \ + gstring.c gtestutils.c gthread.c gthreadprivate.h \ + gthreadpool.c gtimer.c gtimezone.c gtree.c guniprop.c gutf8.c \ + gunibreak.h gunibreak.c gunichartables.h gunicollate.c \ + gunicomp.h gunidecomp.h gunidecomp.c gunicodeprivate.h \ + gurifuncs.c gutils.c gvariant.h gvariant.c gvariant-core.h \ + gvariant-core.c gvariant-internal.h gvariant-parser.c \ + gvariant-serialiser.h gvariant-serialiser.c gvarianttypeinfo.h \ + gvarianttypeinfo.c gvarianttype.c gdebug.h gprintf.c \ + gprintfint.h @HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE@am__objects_1 = \ @HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE@ gatomic.lo @HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE@am__objects_1 = \ @@ -118,18 +127,18 @@ am__libglib_2_0_la_SOURCES_DIST = garray.c gasyncqueue.c gatomic.c \ am_libglib_2_0_la_OBJECTS = garray.lo gasyncqueue.lo $(am__objects_1) \ gbacktrace.lo gbase64.lo gbitlock.lo gbookmarkfile.lo \ gbuffer.lo gcache.lo gchecksum.lo gcompletion.lo gconvert.lo \ - gdataset.lo gdate.lo gdir.lo gerror.lo gfileutils.lo ghash.lo \ - ghook.lo ghostutils.lo giochannel.lo gkeyfile.lo glist.lo \ - gmain.lo gmappedfile.lo gmarkup.lo gmem.lo gmessages.lo \ - gnode.lo goption.lo gpattern.lo gpoll.lo gprimes.lo gqsort.lo \ - gqueue.lo grel.lo grand.lo $(am__objects_2) gscanner.lo \ - gsequence.lo gshell.lo gslice.lo gslist.lo gstdio.lo \ - gstrfuncs.lo gstring.lo gtestutils.lo gthread.lo \ - gthreadpool.lo gtimer.lo gtree.lo guniprop.lo gutf8.lo \ - gunibreak.lo gunicollate.lo gunidecomp.lo gurifuncs.lo \ - gutils.lo gvariant.lo gvariant-core.lo gvariant-parser.lo \ - gvariant-serialiser.lo gvarianttypeinfo.lo gvarianttype.lo \ - gprintf.lo + gdataset.lo gdate.lo gdatetime.lo gdir.lo gerror.lo \ + gfileutils.lo ghash.lo ghook.lo ghostutils.lo giochannel.lo \ + gkeyfile.lo glist.lo gmain.lo gmappedfile.lo gmarkup.lo \ + gmem.lo gmessages.lo gnode.lo goption.lo gpattern.lo gpoll.lo \ + gprimes.lo gqsort.lo gqueue.lo grel.lo grand.lo \ + $(am__objects_2) gscanner.lo gsequence.lo gshell.lo gslice.lo \ + gslist.lo gstdio.lo gstrfuncs.lo gstring.lo gtestutils.lo \ + gthread.lo gthreadpool.lo gtimer.lo gtimezone.lo gtree.lo \ + guniprop.lo gutf8.lo gunibreak.lo gunicollate.lo gunidecomp.lo \ + gurifuncs.lo gutils.lo gvariant.lo gvariant-core.lo \ + gvariant-parser.lo gvariant-serialiser.lo gvarianttypeinfo.lo \ + gvarianttype.lo gprintf.lo libglib_2_0_la_OBJECTS = $(am_libglib_2_0_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -217,20 +226,22 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive -DATA = $(noinst_DATA) +DATA = $(noinst_DATA) $(tapset_DATA) am__glibsubinclude_HEADERS_DIST = galloca.h garray.h gasyncqueue.h \ gatomic.h gbacktrace.h gbase64.h gbitlock.h gbookmarkfile.h \ gcache.h gchecksum.h gcompletion.h gconvert.h gdataset.h \ - gdate.h gdir.h gerror.h gfileutils.h ghash.h ghook.h \ - ghostutils.h gi18n.h gi18n-lib.h giochannel.h gkeyfile.h \ - glist.h gmacros.h gmain.h gmappedfile.h gmarkup.h gmem.h \ - gmessages.h gnode.h goption.h gpattern.h gpoll.h gprimes.h \ - gqsort.h gquark.h gqueue.h grand.h gregex.h grel.h gscanner.h \ - gsequence.h gshell.h gslice.h gslist.h gspawn.h gstdio.h \ - gstrfuncs.h gtestutils.h gstring.h gthread.h gthreadpool.h \ - gtimer.h gtree.h gtypes.h gunicode.h gurifuncs.h gutils.h \ - gvarianttype.h gvariant.h gwin32.h gprintf.h -HEADERS = $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) + gdate.h gdatetime.h gdir.h gerror.h gfileutils.h ghash.h \ + ghook.h ghostutils.h gi18n.h gi18n-lib.h giochannel.h \ + gkeyfile.h glist.h gmacros.h gmain.h gmappedfile.h gmarkup.h \ + gmem.h gmessages.h gnode.h goption.h gpattern.h gpoll.h \ + gprimes.h gqsort.h gquark.h gqueue.h grand.h gregex.h grel.h \ + gscanner.h gsequence.h gshell.h gslice.h gslist.h gspawn.h \ + gstdio.h gstrfuncs.h gtestutils.h gstring.h gthread.h \ + gthreadpool.h gtimer.h gtimezone.h gtree.h gtypes.h gunicode.h \ + gurifuncs.h gutils.h gvarianttype.h gvariant.h gwin32.h \ + gprintf.h +HEADERS = $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) \ + $(nodist_configexecinclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -267,6 +278,7 @@ am__relativize = \ done; \ reldir="$$dir2" ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -291,11 +303,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -309,13 +324,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -362,6 +380,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -369,6 +389,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -394,6 +415,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -410,6 +433,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -419,11 +443,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -439,11 +465,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -457,7 +489,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -488,10 +519,24 @@ GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package # The compilation of GRegex can be disabled, but the source files must # be distributed. EXTRA_DIST = makefile.msc.in glib.rc.in gen-unicode-tables.pl \ - gen-script-table.pl makegalias.pl abicheck.sh pltcheck.sh \ + gen-script-table.pl glibconfig.h.win32.in abicheck.sh \ glib.symbols gregex.c gregex.h win_iconv.c libglib-gdb.py.in \ - $(MIRRORING_TAB_SOURCE) $(am__append_4) + $(MIRRORING_TAB_SOURCE) $(am__append_4) $(am__append_8) TEST_PROGS = +BUILT_SOURCES = glibconfig-stamp $(am__append_1) + +# +# Generate glibconfig.h +# +# The timestamp of the stamp file is used to indicate if glibconfig.h is +# up to date with respect to config.status. In the usual case, changes +# to config.status will not result in changes to glibconfig.h so we +# avoid touching its timestamp (in order not to rebuild the whole tree). +# +DISTCLEANFILES = glibconfig-stamp glibconfig.h +CLEANFILES = $(am__append_2) +configexecincludedir = $(libdir)/glib-2.0/include +nodist_configexecinclude_HEADERS = glibconfig.h @HAVE_GOOD_PRINTF_FALSE@PRINTF_SUBDIR = gnulib @HAVE_GOOD_PRINTF_FALSE@printf_la = gnulib/libgnulib.la @ENABLE_REGEX_TRUE@@USE_SYSTEM_PCRE_FALSE@MAYBE_PCRE = pcre @@ -504,7 +549,7 @@ TEST_PROGS = SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests AM_CPPFLAGS = \ - -I$(top_srcdir) \ + $(glib_INCLUDES) \ $(pcre_inc) \ -DG_LOG_DOMAIN=\"GLib\" \ $(GLIB_DEBUG_FLAGS) \ @@ -513,8 +558,7 @@ AM_CPPFLAGS = \ -DPCRE_STATIC @HAVE_GNUC_VISIBILITY_TRUE@@OS_LINUX_TRUE@TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)" -@HAVE_GNUC_VISIBILITY_TRUE@@OS_LINUX_TRUE@TESTS = abicheck.sh pltcheck.sh -BUILT_SOURCES = galias.h galiasdef.c +@HAVE_GNUC_VISIBILITY_TRUE@@OS_LINUX_TRUE@TESTS = abicheck.sh MIRRORING_TAB_SOURCE = \ glib-mirroring-tab/Makefile \ glib-mirroring-tab/gen-mirroring-tab.c \ @@ -525,15 +569,15 @@ MIRRORING_TAB_SOURCE = \ # These may be in the builddir too BUILT_EXTRA_DIST = \ makefile.msc \ - glib.rc \ - galias.h \ - galiasdef.c + glibconfig.h.win32 \ + glib.rc lib_LTLIBRARIES = libglib-2.0.la @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@noinst_DATA = glib-2.0.lib @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir) @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib libglib_2_0_la_SOURCES = \ + glib_probes.d \ garray.c \ gasyncqueue.c \ $(gatomic_c) \ @@ -550,7 +594,8 @@ libglib_2_0_la_SOURCES = \ gconvert.c \ gdataset.c \ gdatasetprivate.h \ - gdate.c \ + gdate.c \ + gdatetime.c \ gdir.c \ gerror.c \ gfileutils.c \ @@ -558,10 +603,11 @@ libglib_2_0_la_SOURCES = \ ghook.c \ ghostutils.c \ giochannel.c \ - gkeyfile.c \ + gkeyfile.c \ glibintl.h \ + glib_trace.h \ glist.c \ - gmain.c \ + gmain.c \ gmappedfile.c \ gmarkup.c \ gmem.c \ @@ -591,6 +637,7 @@ libglib_2_0_la_SOURCES = \ gthreadprivate.h \ gthreadpool.c \ gtimer.c \ + gtimezone.c \ gtree.c \ guniprop.c \ gutf8.c \ @@ -647,6 +694,7 @@ glibsubinclude_HEADERS = \ gconvert.h \ gdataset.h \ gdate.h \ + gdatetime.h \ gdir.h \ gerror.h \ gfileutils.h \ @@ -688,10 +736,11 @@ glibsubinclude_HEADERS = \ gthread.h \ gthreadpool.h \ gtimer.h \ + gtimezone.h \ gtree.h \ gtypes.h \ gunicode.h \ - gurifuncs.h \ + gurifuncs.h \ gutils.h \ gvarianttype.h \ gvariant.h \ @@ -710,14 +759,19 @@ glibsubinclude_HEADERS = \ @ENABLE_REGEX_FALSE@pcre_inc = @ENABLE_REGEX_TRUE@@USE_SYSTEM_PCRE_FALSE@pcre_inc = @ENABLE_REGEX_TRUE@@USE_SYSTEM_PCRE_TRUE@pcre_inc = $(PCRE_CFLAGS) -libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) +libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ \ + @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) \ + $(GLIB_RT_LIBS) $(am__append_3) libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def) -libglib_2_0_la_LDFLAGS = \ +libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ $(glib_win32_res_ldflag) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic $(no_undefined) $(export_symbols) -INSTALL_PROGS = $(am__append_1) $(am__append_2) $(am__append_3) +INSTALL_PROGS = $(am__append_5) $(am__append_6) $(am__append_7) +@ENABLE_SYSTEMTAP_TRUE@tapset_in_files = glib.stp.in +@ENABLE_SYSTEMTAP_TRUE@tapsetdir = @ABS_TAPSET_DIR@ +@ENABLE_SYSTEMTAP_TRUE@tapset_DATA = $(tapset_in_files:.stp.in=.stp) @OS_WIN32_TRUE@@OS_WIN32_X64_TRUE@gspawn_win64_helper_LDADD = libglib-2.0.la @OS_WIN32_TRUE@@OS_WIN32_X64_TRUE@gspawn_win64_helper_LDFLAGS = -mwindows @OS_WIN32_TRUE@@OS_WIN32_X64_TRUE@gspawn_win64_helper_console_LDADD = libglib-2.0.la @@ -729,8 +783,8 @@ INSTALL_PROGS = $(am__append_1) $(am__append_2) $(am__append_3) @OS_UNIX_TRUE@auto_config_binscripts = gtester-report @OS_UNIX_TRUE@bin_SCRIPTS = ${auto_config_binscripts} @OS_UNIX_TRUE@CONFIGVARS = \ -@OS_UNIX_TRUE@ "bindir" : "${bindir}", \ -@OS_UNIX_TRUE@ "glib-version" : "${GLIB_VERSION}" +@OS_UNIX_TRUE@ "bindir" : "${bindir}", \ +@OS_UNIX_TRUE@ "glib-version" : "${GLIB_VERSION}" # install gdb scripts @@ -771,6 +825,10 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +glib.stp: $(top_builddir)/config.status $(srcdir)/glib.stp.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +glibconfig.h.win32: $(top_builddir)/config.status $(srcdir)/glibconfig.h.win32.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ makefile.msc: $(top_builddir)/config.status $(srcdir)/makefile.msc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ glib.rc: $(top_builddir)/config.status $(srcdir)/glib.rc.in @@ -956,6 +1014,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconvert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdataset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdatetime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfileutils.Plo@am__quote@ @@ -1002,6 +1061,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthreadpool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimezone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunibreak.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gunicollate.Plo@am__quote@ @@ -1047,6 +1107,26 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-tapsetDATA: $(tapset_DATA) + @$(NORMAL_INSTALL) + test -z "$(tapsetdir)" || $(MKDIR_P) "$(DESTDIR)$(tapsetdir)" + @list='$(tapset_DATA)'; test -n "$(tapsetdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(tapsetdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(tapsetdir)" || exit $$?; \ + done + +uninstall-tapsetDATA: + @$(NORMAL_UNINSTALL) + @list='$(tapset_DATA)'; test -n "$(tapsetdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(tapsetdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(tapsetdir)" && rm -f $$files install-glibincludeHEADERS: $(glibinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(glibincludedir)" || $(MKDIR_P) "$(DESTDIR)$(glibincludedir)" @@ -1087,6 +1167,26 @@ uninstall-glibsubincludeHEADERS: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(glibsubincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(glibsubincludedir)" && rm -f $$files +install-nodist_configexecincludeHEADERS: $(nodist_configexecinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(configexecincludedir)" || $(MKDIR_P) "$(DESTDIR)$(configexecincludedir)" + @list='$(nodist_configexecinclude_HEADERS)'; test -n "$(configexecincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(configexecincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(configexecincludedir)" || exit $$?; \ + done + +uninstall-nodist_configexecincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_configexecinclude_HEADERS)'; test -n "$(configexecincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(configexecincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(configexecincludedir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -1386,7 +1486,7 @@ install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gdbdir)" "$(DESTDIR)$(glibincludedir)" "$(DESTDIR)$(glibsubincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gdbdir)" "$(DESTDIR)$(tapsetdir)" "$(DESTDIR)$(glibincludedir)" "$(DESTDIR)$(glibsubincludedir)" "$(DESTDIR)$(configexecincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1407,10 +1507,12 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1441,7 +1543,8 @@ info: info-recursive info-am: install-data-am: install-data-local install-dist_gdbSCRIPTS \ - install-glibincludeHEADERS install-glibsubincludeHEADERS + install-glibincludeHEADERS install-glibsubincludeHEADERS \ + install-tapsetDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive @@ -1449,7 +1552,7 @@ install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS \ - install-libLTLIBRARIES + install-libLTLIBRARIES install-nodist_configexecincludeHEADERS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive @@ -1493,7 +1596,8 @@ ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dist_gdbSCRIPTS uninstall-glibincludeHEADERS \ uninstall-glibsubincludeHEADERS uninstall-libLTLIBRARIES \ - uninstall-local + uninstall-local uninstall-nodist_configexecincludeHEADERS \ + uninstall-tapsetDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ check-am ctags-recursive install install-am install-data-am \ @@ -1512,8 +1616,9 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ install-exec-hook install-glibincludeHEADERS \ install-glibsubincludeHEADERS install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ + install-man install-nodist_configexecincludeHEADERS \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip install-tapsetDATA installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ @@ -1521,19 +1626,23 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dist_gdbSCRIPTS uninstall-glibincludeHEADERS \ uninstall-glibsubincludeHEADERS uninstall-libLTLIBRARIES \ - uninstall-local + uninstall-local uninstall-nodist_configexecincludeHEADERS \ + uninstall-tapsetDATA ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -1560,8 +1669,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -1570,18 +1683,36 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive +glibconfig-stamp: ../config.status + $(AM_V_GEN) cd $(top_builddir) && \ + $(SHELL) ./config.status glib/glibconfig.h + @touch glibconfig-stamp glib.def: glib.symbols - (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > glib.def - -galias.h: $(srcdir)/makegalias.pl glib.symbols - $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h - -galiasdef.c: $(srcdir)/makegalias.pl glib.symbols - $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c + $(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > glib.def install-ms-lib: $(install_ms_lib_cmd) @@ -1594,7 +1725,7 @@ install-data-local: install-ms-lib install-def-file echo "*** Old headers found in $(glibincludedir). You should remove the" ; \ echo "*** contents of this directory and type 'make install' again." ; \ false ; \ - fi + fi uninstall-local: uninstall-ms-lib uninstall-def-file @@ -1606,6 +1737,12 @@ uninstall-local: uninstall-ms-lib uninstall-def-file @OS_WIN32_AND_DLL_COMPILATION_FALSE@install-def-file: @OS_WIN32_AND_DLL_COMPILATION_FALSE@uninstall-def-file: +@ENABLE_DTRACE_TRUE@glib_probes.h: glib_probes.d Makefile +@ENABLE_DTRACE_TRUE@ $(DTRACE) -C -h -s $< -o $@.tmp +@ENABLE_DTRACE_TRUE@ sed -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp +@ENABLE_DTRACE_TRUE@glib_probes.o: glib_probes.d Makefile +@ENABLE_DTRACE_TRUE@ $(DTRACE) -G -s $< -o $@ + gspawn-win32-helper-console.c: echo '#define HELPER_CONSOLE' >$@ echo '#include "gspawn-win32-helper.c"' >>$@ @@ -1627,6 +1764,7 @@ glib-win32-res.o: glib.rc @OS_UNIX_TRUE@ -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@| ${CONFIGVARS}|' \ @OS_UNIX_TRUE@ -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \ @OS_UNIX_TRUE@ || exit $$? ; \ +@OS_UNIX_TRUE@ chmod a+x $(DESTDIR)$(bindir)/$$sf ; \ @OS_UNIX_TRUE@ rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \ @OS_UNIX_TRUE@ done @@ -1656,7 +1794,7 @@ distclean-local: fi libglib-gdb.py: libglib-gdb.py.in - sed -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py + $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py install-data-hook: libglib-gdb.py mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR) diff --git a/glib/abicheck.sh b/glib/abicheck.sh index ce9a966..d2c9d88 100755 --- a/glib/abicheck.sh +++ b/glib/abicheck.sh @@ -1,6 +1,6 @@ #! /bin/sh -egrep '^#([^i]|if).*[^\]$' "${top_builddir:-..}/glibconfig.h" > glibconfig.cpp +egrep '^#([^i]|if).*[^\]$' "${builddir:-.}/glibconfig.h" > glibconfig.cpp INCLUDES="-include ${top_builddir:-..}/config.h" INCLUDES="$INCLUDES -include glibconfig.cpp $GLIB_DEBUG_FLAGS" @@ -8,6 +8,6 @@ INCLUDES="$INCLUDES -include glibconfig.cpp $GLIB_DEBUG_FLAGS" cpp -P -DINCLUDE_INTERNAL_SYMBOLS -DINCLUDE_VARIABLES -DG_STDIO_NO_WRAP_ON_UNIX -DALL_FILES $INCLUDES "${srcdir:-.}/glib.symbols" | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE$//' | sort > expected-abi rm -f glibconfig.cpp -nm -D -g --defined-only .libs/libglib-2.0.so | cut -d ' ' -f 3 | sort > actual-abi +nm -D -g --defined-only .libs/libglib-2.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi diff -u expected-abi actual-abi && rm -f expected-abi actual-abi diff --git a/glib/galias.h b/glib/galias.h deleted file mode 100644 index 8d57f61..0000000 --- a/glib/galias.h +++ /dev/null @@ -1,4449 +0,0 @@ -/* Generated by makegalias.pl */ - -#ifndef DISABLE_VISIBILITY - -#include "glibconfig.h" - -#ifdef G_HAVE_GNUC_VISIBILITY - -#define IN_FILE(x) 1 -#define IN_HEADER defined - -#if IN_HEADER(__G_ARRAY_H__) -#if IN_FILE(__G_ARRAY_C__) -extern __typeof (g_array_append_vals) IA__g_array_append_vals __attribute((visibility("hidden"))); -#define g_array_append_vals IA__g_array_append_vals - -extern __typeof (g_array_free) IA__g_array_free __attribute((visibility("hidden"))); -#define g_array_free IA__g_array_free - -extern __typeof (g_array_insert_vals) IA__g_array_insert_vals __attribute((visibility("hidden"))); -#define g_array_insert_vals IA__g_array_insert_vals - -extern __typeof (g_array_new) IA__g_array_new __attribute((visibility("hidden"))); -#define g_array_new IA__g_array_new - -extern __typeof (g_array_ref) IA__g_array_ref __attribute((visibility("hidden"))); -#define g_array_ref IA__g_array_ref - -extern __typeof (g_array_unref) IA__g_array_unref __attribute((visibility("hidden"))); -#define g_array_unref IA__g_array_unref - -extern __typeof (g_array_get_element_size) IA__g_array_get_element_size __attribute((visibility("hidden"))); -#define g_array_get_element_size IA__g_array_get_element_size - -extern __typeof (g_array_prepend_vals) IA__g_array_prepend_vals __attribute((visibility("hidden"))); -#define g_array_prepend_vals IA__g_array_prepend_vals - -extern __typeof (g_array_remove_index) IA__g_array_remove_index __attribute((visibility("hidden"))); -#define g_array_remove_index IA__g_array_remove_index - -extern __typeof (g_array_remove_index_fast) IA__g_array_remove_index_fast __attribute((visibility("hidden"))); -#define g_array_remove_index_fast IA__g_array_remove_index_fast - -extern __typeof (g_array_remove_range) IA__g_array_remove_range __attribute((visibility("hidden"))); -#define g_array_remove_range IA__g_array_remove_range - -extern __typeof (g_array_set_size) IA__g_array_set_size __attribute((visibility("hidden"))); -#define g_array_set_size IA__g_array_set_size - -extern __typeof (g_array_sized_new) IA__g_array_sized_new __attribute((visibility("hidden"))); -#define g_array_sized_new IA__g_array_sized_new - -extern __typeof (g_array_sort) IA__g_array_sort __attribute((visibility("hidden"))); -#define g_array_sort IA__g_array_sort - -extern __typeof (g_array_sort_with_data) IA__g_array_sort_with_data __attribute((visibility("hidden"))); -#define g_array_sort_with_data IA__g_array_sort_with_data - -extern __typeof (g_byte_array_append) IA__g_byte_array_append __attribute((visibility("hidden"))); -#define g_byte_array_append IA__g_byte_array_append - -extern __typeof (g_byte_array_free) IA__g_byte_array_free __attribute((visibility("hidden"))); -#define g_byte_array_free IA__g_byte_array_free - -extern __typeof (g_byte_array_unref) IA__g_byte_array_unref __attribute((visibility("hidden"))); -#define g_byte_array_unref IA__g_byte_array_unref - -extern __typeof (g_byte_array_ref) IA__g_byte_array_ref __attribute((visibility("hidden"))); -#define g_byte_array_ref IA__g_byte_array_ref - -extern __typeof (g_byte_array_new) IA__g_byte_array_new __attribute((visibility("hidden"))); -#define g_byte_array_new IA__g_byte_array_new - -extern __typeof (g_byte_array_prepend) IA__g_byte_array_prepend __attribute((visibility("hidden"))); -#define g_byte_array_prepend IA__g_byte_array_prepend - -extern __typeof (g_byte_array_remove_index) IA__g_byte_array_remove_index __attribute((visibility("hidden"))); -#define g_byte_array_remove_index IA__g_byte_array_remove_index - -extern __typeof (g_byte_array_remove_index_fast) IA__g_byte_array_remove_index_fast __attribute((visibility("hidden"))); -#define g_byte_array_remove_index_fast IA__g_byte_array_remove_index_fast - -extern __typeof (g_byte_array_remove_range) IA__g_byte_array_remove_range __attribute((visibility("hidden"))); -#define g_byte_array_remove_range IA__g_byte_array_remove_range - -extern __typeof (g_byte_array_set_size) IA__g_byte_array_set_size __attribute((visibility("hidden"))); -#define g_byte_array_set_size IA__g_byte_array_set_size - -extern __typeof (g_byte_array_sized_new) IA__g_byte_array_sized_new __attribute((visibility("hidden"))); -#define g_byte_array_sized_new IA__g_byte_array_sized_new - -extern __typeof (g_byte_array_sort) IA__g_byte_array_sort __attribute((visibility("hidden"))); -#define g_byte_array_sort IA__g_byte_array_sort - -extern __typeof (g_byte_array_sort_with_data) IA__g_byte_array_sort_with_data __attribute((visibility("hidden"))); -#define g_byte_array_sort_with_data IA__g_byte_array_sort_with_data - -extern __typeof (g_ptr_array_add) IA__g_ptr_array_add __attribute((visibility("hidden"))); -#define g_ptr_array_add IA__g_ptr_array_add - -extern __typeof (g_ptr_array_foreach) IA__g_ptr_array_foreach __attribute((visibility("hidden"))); -#define g_ptr_array_foreach IA__g_ptr_array_foreach - -extern __typeof (g_ptr_array_free) IA__g_ptr_array_free __attribute((visibility("hidden"))); -#define g_ptr_array_free IA__g_ptr_array_free - -extern __typeof (g_ptr_array_unref) IA__g_ptr_array_unref __attribute((visibility("hidden"))); -#define g_ptr_array_unref IA__g_ptr_array_unref - -extern __typeof (g_ptr_array_ref) IA__g_ptr_array_ref __attribute((visibility("hidden"))); -#define g_ptr_array_ref IA__g_ptr_array_ref - -extern __typeof (g_ptr_array_new) IA__g_ptr_array_new __attribute((visibility("hidden"))); -#define g_ptr_array_new IA__g_ptr_array_new - -extern __typeof (g_ptr_array_new_with_free_func) IA__g_ptr_array_new_with_free_func __attribute((visibility("hidden"))); -#define g_ptr_array_new_with_free_func IA__g_ptr_array_new_with_free_func - -extern __typeof (g_ptr_array_set_free_func) IA__g_ptr_array_set_free_func __attribute((visibility("hidden"))); -#define g_ptr_array_set_free_func IA__g_ptr_array_set_free_func - -extern __typeof (g_ptr_array_remove) IA__g_ptr_array_remove __attribute((visibility("hidden"))); -#define g_ptr_array_remove IA__g_ptr_array_remove - -extern __typeof (g_ptr_array_remove_fast) IA__g_ptr_array_remove_fast __attribute((visibility("hidden"))); -#define g_ptr_array_remove_fast IA__g_ptr_array_remove_fast - -extern __typeof (g_ptr_array_remove_index) IA__g_ptr_array_remove_index __attribute((visibility("hidden"))); -#define g_ptr_array_remove_index IA__g_ptr_array_remove_index - -extern __typeof (g_ptr_array_remove_index_fast) IA__g_ptr_array_remove_index_fast __attribute((visibility("hidden"))); -#define g_ptr_array_remove_index_fast IA__g_ptr_array_remove_index_fast - -extern __typeof (g_ptr_array_remove_range) IA__g_ptr_array_remove_range __attribute((visibility("hidden"))); -#define g_ptr_array_remove_range IA__g_ptr_array_remove_range - -extern __typeof (g_ptr_array_set_size) IA__g_ptr_array_set_size __attribute((visibility("hidden"))); -#define g_ptr_array_set_size IA__g_ptr_array_set_size - -extern __typeof (g_ptr_array_sized_new) IA__g_ptr_array_sized_new __attribute((visibility("hidden"))); -#define g_ptr_array_sized_new IA__g_ptr_array_sized_new - -extern __typeof (g_ptr_array_sort) IA__g_ptr_array_sort __attribute((visibility("hidden"))); -#define g_ptr_array_sort IA__g_ptr_array_sort - -extern __typeof (g_ptr_array_sort_with_data) IA__g_ptr_array_sort_with_data __attribute((visibility("hidden"))); -#define g_ptr_array_sort_with_data IA__g_ptr_array_sort_with_data - -#endif -#endif -#if IN_HEADER(__G_ASYNCQUEUE_H__) -#if IN_FILE(__G_ASYNCQUEUE_C__) -extern __typeof (g_async_queue_length) IA__g_async_queue_length __attribute((visibility("hidden"))); -#define g_async_queue_length IA__g_async_queue_length - -extern __typeof (g_async_queue_length_unlocked) IA__g_async_queue_length_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_length_unlocked IA__g_async_queue_length_unlocked - -extern __typeof (g_async_queue_lock) IA__g_async_queue_lock __attribute((visibility("hidden"))); -#define g_async_queue_lock IA__g_async_queue_lock - -extern __typeof (g_async_queue_new) IA__g_async_queue_new __attribute((visibility("hidden"))); -#define g_async_queue_new IA__g_async_queue_new - -extern __typeof (g_async_queue_new_full) IA__g_async_queue_new_full __attribute((visibility("hidden"))); -#define g_async_queue_new_full IA__g_async_queue_new_full - -extern __typeof (g_async_queue_pop) IA__g_async_queue_pop __attribute((visibility("hidden"))); -#define g_async_queue_pop IA__g_async_queue_pop - -extern __typeof (g_async_queue_pop_unlocked) IA__g_async_queue_pop_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_pop_unlocked IA__g_async_queue_pop_unlocked - -extern __typeof (g_async_queue_push) IA__g_async_queue_push __attribute((visibility("hidden"))); -#define g_async_queue_push IA__g_async_queue_push - -extern __typeof (g_async_queue_push_unlocked) IA__g_async_queue_push_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_push_unlocked IA__g_async_queue_push_unlocked - -extern __typeof (g_async_queue_push_sorted) IA__g_async_queue_push_sorted __attribute((visibility("hidden"))); -#define g_async_queue_push_sorted IA__g_async_queue_push_sorted - -extern __typeof (g_async_queue_push_sorted_unlocked) IA__g_async_queue_push_sorted_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_push_sorted_unlocked IA__g_async_queue_push_sorted_unlocked - -extern __typeof (g_async_queue_ref) IA__g_async_queue_ref __attribute((visibility("hidden"))); -#define g_async_queue_ref IA__g_async_queue_ref - -extern __typeof (g_async_queue_sort) IA__g_async_queue_sort __attribute((visibility("hidden"))); -#define g_async_queue_sort IA__g_async_queue_sort - -extern __typeof (g_async_queue_sort_unlocked) IA__g_async_queue_sort_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_sort_unlocked IA__g_async_queue_sort_unlocked - -extern __typeof (g_async_queue_timed_pop) IA__g_async_queue_timed_pop __attribute((visibility("hidden"))); -#define g_async_queue_timed_pop IA__g_async_queue_timed_pop - -extern __typeof (g_async_queue_timed_pop_unlocked) IA__g_async_queue_timed_pop_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_timed_pop_unlocked IA__g_async_queue_timed_pop_unlocked - -extern __typeof (g_async_queue_try_pop) IA__g_async_queue_try_pop __attribute((visibility("hidden"))); -#define g_async_queue_try_pop IA__g_async_queue_try_pop - -extern __typeof (g_async_queue_try_pop_unlocked) IA__g_async_queue_try_pop_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_try_pop_unlocked IA__g_async_queue_try_pop_unlocked - -extern __typeof (g_async_queue_unlock) IA__g_async_queue_unlock __attribute((visibility("hidden"))); -#define g_async_queue_unlock IA__g_async_queue_unlock - -extern __typeof (g_async_queue_unref) IA__g_async_queue_unref __attribute((visibility("hidden"))); -#define g_async_queue_unref IA__g_async_queue_unref - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_async_queue_ref_unlocked) IA__g_async_queue_ref_unlocked __attribute((visibility("hidden"))); -#define g_async_queue_ref_unlocked IA__g_async_queue_ref_unlocked - -extern __typeof (g_async_queue_unref_and_unlock) IA__g_async_queue_unref_and_unlock __attribute((visibility("hidden"))); -#define g_async_queue_unref_and_unlock IA__g_async_queue_unref_and_unlock - -#endif -#endif -#endif -#if IN_HEADER(__G_ATOMIC_H__) -#if IN_FILE(__G_ATOMIC_C__) -extern __typeof (g_atomic_int_add) IA__g_atomic_int_add __attribute((visibility("hidden"))); -#define g_atomic_int_add IA__g_atomic_int_add - -extern __typeof (g_atomic_int_compare_and_exchange) IA__g_atomic_int_compare_and_exchange __attribute((visibility("hidden"))); -#define g_atomic_int_compare_and_exchange IA__g_atomic_int_compare_and_exchange - -extern __typeof (g_atomic_int_exchange_and_add) IA__g_atomic_int_exchange_and_add __attribute((visibility("hidden"))); -#define g_atomic_int_exchange_and_add IA__g_atomic_int_exchange_and_add - -extern __typeof (g_atomic_pointer_compare_and_exchange) IA__g_atomic_pointer_compare_and_exchange __attribute((visibility("hidden"))); -#define g_atomic_pointer_compare_and_exchange IA__g_atomic_pointer_compare_and_exchange - -#endif -#endif -#if IN_HEADER(__G_BACKTRACE_H__) -#if IN_FILE(__G_BACKTRACE_C__) -extern __typeof (g_on_error_query) IA__g_on_error_query __attribute((visibility("hidden"))); -#define g_on_error_query IA__g_on_error_query - -extern __typeof (g_on_error_stack_trace) IA__g_on_error_stack_trace __attribute((visibility("hidden"))); -#define g_on_error_stack_trace IA__g_on_error_stack_trace - -#endif -#endif -#if IN_HEADER(__G_BASE64_H__) -#if IN_FILE(__G_BASE64_C__) -extern __typeof (g_base64_encode_step) IA__g_base64_encode_step __attribute((visibility("hidden"))); -#define g_base64_encode_step IA__g_base64_encode_step - -extern __typeof (g_base64_encode_close) IA__g_base64_encode_close __attribute((visibility("hidden"))); -#define g_base64_encode_close IA__g_base64_encode_close - -extern __typeof (g_base64_encode) IA__g_base64_encode __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_base64_encode IA__g_base64_encode - -extern __typeof (g_base64_decode_step) IA__g_base64_decode_step __attribute((visibility("hidden"))); -#define g_base64_decode_step IA__g_base64_decode_step - -extern __typeof (g_base64_decode) IA__g_base64_decode __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_base64_decode IA__g_base64_decode - -extern __typeof (g_base64_decode_inplace) IA__g_base64_decode_inplace __attribute((visibility("hidden"))); -#define g_base64_decode_inplace IA__g_base64_decode_inplace - -#endif -#endif -#if IN_HEADER(__G_BOOKMARK_FILE_H__) -#if IN_FILE(__G_BOOKMARK_FILE_C__) -extern __typeof (g_bookmark_file_error_quark) IA__g_bookmark_file_error_quark __attribute((visibility("hidden"))); -#define g_bookmark_file_error_quark IA__g_bookmark_file_error_quark - -extern __typeof (g_bookmark_file_new) IA__g_bookmark_file_new __attribute((visibility("hidden"))); -#define g_bookmark_file_new IA__g_bookmark_file_new - -extern __typeof (g_bookmark_file_free) IA__g_bookmark_file_free __attribute((visibility("hidden"))); -#define g_bookmark_file_free IA__g_bookmark_file_free - -extern __typeof (g_bookmark_file_load_from_file) IA__g_bookmark_file_load_from_file __attribute((visibility("hidden"))); -#define g_bookmark_file_load_from_file IA__g_bookmark_file_load_from_file - -extern __typeof (g_bookmark_file_load_from_data) IA__g_bookmark_file_load_from_data __attribute((visibility("hidden"))); -#define g_bookmark_file_load_from_data IA__g_bookmark_file_load_from_data - -extern __typeof (g_bookmark_file_load_from_data_dirs) IA__g_bookmark_file_load_from_data_dirs __attribute((visibility("hidden"))); -#define g_bookmark_file_load_from_data_dirs IA__g_bookmark_file_load_from_data_dirs - -extern __typeof (g_bookmark_file_to_data) IA__g_bookmark_file_to_data __attribute((visibility("hidden"))); -#define g_bookmark_file_to_data IA__g_bookmark_file_to_data - -extern __typeof (g_bookmark_file_to_file) IA__g_bookmark_file_to_file __attribute((visibility("hidden"))); -#define g_bookmark_file_to_file IA__g_bookmark_file_to_file - -extern __typeof (g_bookmark_file_set_title) IA__g_bookmark_file_set_title __attribute((visibility("hidden"))); -#define g_bookmark_file_set_title IA__g_bookmark_file_set_title - -extern __typeof (g_bookmark_file_get_title) IA__g_bookmark_file_get_title __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_bookmark_file_get_title IA__g_bookmark_file_get_title - -extern __typeof (g_bookmark_file_set_description) IA__g_bookmark_file_set_description __attribute((visibility("hidden"))); -#define g_bookmark_file_set_description IA__g_bookmark_file_set_description - -extern __typeof (g_bookmark_file_get_description) IA__g_bookmark_file_get_description __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_bookmark_file_get_description IA__g_bookmark_file_get_description - -extern __typeof (g_bookmark_file_set_mime_type) IA__g_bookmark_file_set_mime_type __attribute((visibility("hidden"))); -#define g_bookmark_file_set_mime_type IA__g_bookmark_file_set_mime_type - -extern __typeof (g_bookmark_file_get_mime_type) IA__g_bookmark_file_get_mime_type __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_bookmark_file_get_mime_type IA__g_bookmark_file_get_mime_type - -extern __typeof (g_bookmark_file_set_groups) IA__g_bookmark_file_set_groups __attribute((visibility("hidden"))); -#define g_bookmark_file_set_groups IA__g_bookmark_file_set_groups - -extern __typeof (g_bookmark_file_add_group) IA__g_bookmark_file_add_group __attribute((visibility("hidden"))); -#define g_bookmark_file_add_group IA__g_bookmark_file_add_group - -extern __typeof (g_bookmark_file_has_group) IA__g_bookmark_file_has_group __attribute((visibility("hidden"))); -#define g_bookmark_file_has_group IA__g_bookmark_file_has_group - -extern __typeof (g_bookmark_file_get_groups) IA__g_bookmark_file_get_groups __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_bookmark_file_get_groups IA__g_bookmark_file_get_groups - -extern __typeof (g_bookmark_file_add_application) IA__g_bookmark_file_add_application __attribute((visibility("hidden"))); -#define g_bookmark_file_add_application IA__g_bookmark_file_add_application - -extern __typeof (g_bookmark_file_has_application) IA__g_bookmark_file_has_application __attribute((visibility("hidden"))); -#define g_bookmark_file_has_application IA__g_bookmark_file_has_application - -extern __typeof (g_bookmark_file_get_applications) IA__g_bookmark_file_get_applications __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_bookmark_file_get_applications IA__g_bookmark_file_get_applications - -extern __typeof (g_bookmark_file_set_app_info) IA__g_bookmark_file_set_app_info __attribute((visibility("hidden"))); -#define g_bookmark_file_set_app_info IA__g_bookmark_file_set_app_info - -extern __typeof (g_bookmark_file_get_app_info) IA__g_bookmark_file_get_app_info __attribute((visibility("hidden"))); -#define g_bookmark_file_get_app_info IA__g_bookmark_file_get_app_info - -extern __typeof (g_bookmark_file_set_is_private) IA__g_bookmark_file_set_is_private __attribute((visibility("hidden"))); -#define g_bookmark_file_set_is_private IA__g_bookmark_file_set_is_private - -extern __typeof (g_bookmark_file_get_is_private) IA__g_bookmark_file_get_is_private __attribute((visibility("hidden"))); -#define g_bookmark_file_get_is_private IA__g_bookmark_file_get_is_private - -extern __typeof (g_bookmark_file_set_icon) IA__g_bookmark_file_set_icon __attribute((visibility("hidden"))); -#define g_bookmark_file_set_icon IA__g_bookmark_file_set_icon - -extern __typeof (g_bookmark_file_get_icon) IA__g_bookmark_file_get_icon __attribute((visibility("hidden"))); -#define g_bookmark_file_get_icon IA__g_bookmark_file_get_icon - -extern __typeof (g_bookmark_file_set_added) IA__g_bookmark_file_set_added __attribute((visibility("hidden"))); -#define g_bookmark_file_set_added IA__g_bookmark_file_set_added - -extern __typeof (g_bookmark_file_get_added) IA__g_bookmark_file_get_added __attribute((visibility("hidden"))); -#define g_bookmark_file_get_added IA__g_bookmark_file_get_added - -extern __typeof (g_bookmark_file_set_modified) IA__g_bookmark_file_set_modified __attribute((visibility("hidden"))); -#define g_bookmark_file_set_modified IA__g_bookmark_file_set_modified - -extern __typeof (g_bookmark_file_get_modified) IA__g_bookmark_file_get_modified __attribute((visibility("hidden"))); -#define g_bookmark_file_get_modified IA__g_bookmark_file_get_modified - -extern __typeof (g_bookmark_file_set_visited) IA__g_bookmark_file_set_visited __attribute((visibility("hidden"))); -#define g_bookmark_file_set_visited IA__g_bookmark_file_set_visited - -extern __typeof (g_bookmark_file_get_visited) IA__g_bookmark_file_get_visited __attribute((visibility("hidden"))); -#define g_bookmark_file_get_visited IA__g_bookmark_file_get_visited - -extern __typeof (g_bookmark_file_has_item) IA__g_bookmark_file_has_item __attribute((visibility("hidden"))); -#define g_bookmark_file_has_item IA__g_bookmark_file_has_item - -extern __typeof (g_bookmark_file_get_size) IA__g_bookmark_file_get_size __attribute((visibility("hidden"))); -#define g_bookmark_file_get_size IA__g_bookmark_file_get_size - -extern __typeof (g_bookmark_file_get_uris) IA__g_bookmark_file_get_uris __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_bookmark_file_get_uris IA__g_bookmark_file_get_uris - -extern __typeof (g_bookmark_file_remove_group) IA__g_bookmark_file_remove_group __attribute((visibility("hidden"))); -#define g_bookmark_file_remove_group IA__g_bookmark_file_remove_group - -extern __typeof (g_bookmark_file_remove_application) IA__g_bookmark_file_remove_application __attribute((visibility("hidden"))); -#define g_bookmark_file_remove_application IA__g_bookmark_file_remove_application - -extern __typeof (g_bookmark_file_remove_item) IA__g_bookmark_file_remove_item __attribute((visibility("hidden"))); -#define g_bookmark_file_remove_item IA__g_bookmark_file_remove_item - -extern __typeof (g_bookmark_file_move_item) IA__g_bookmark_file_move_item __attribute((visibility("hidden"))); -#define g_bookmark_file_move_item IA__g_bookmark_file_move_item - -#endif -#endif -#if IN_HEADER(__G_CACHE_H__) -#if IN_FILE(__G_CACHE_C__) -extern __typeof (g_cache_destroy) IA__g_cache_destroy __attribute((visibility("hidden"))); -#define g_cache_destroy IA__g_cache_destroy - -extern __typeof (g_cache_insert) IA__g_cache_insert __attribute((visibility("hidden"))); -#define g_cache_insert IA__g_cache_insert - -extern __typeof (g_cache_key_foreach) IA__g_cache_key_foreach __attribute((visibility("hidden"))); -#define g_cache_key_foreach IA__g_cache_key_foreach - -extern __typeof (g_cache_new) IA__g_cache_new __attribute((visibility("hidden"))); -#define g_cache_new IA__g_cache_new - -extern __typeof (g_cache_remove) IA__g_cache_remove __attribute((visibility("hidden"))); -#define g_cache_remove IA__g_cache_remove - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_cache_value_foreach) IA__g_cache_value_foreach __attribute((visibility("hidden"))); -#define g_cache_value_foreach IA__g_cache_value_foreach - -#endif -#endif -#endif -#if IN_HEADER(__G_CHECKSUM_H__) -#if IN_FILE(__G_CHECKSUM_C__) -extern __typeof (g_checksum_type_get_length) IA__g_checksum_type_get_length __attribute((visibility("hidden"))); -#define g_checksum_type_get_length IA__g_checksum_type_get_length - -extern __typeof (g_checksum_new) IA__g_checksum_new __attribute((visibility("hidden"))); -#define g_checksum_new IA__g_checksum_new - -extern __typeof (g_checksum_copy) IA__g_checksum_copy __attribute((visibility("hidden"))); -#define g_checksum_copy IA__g_checksum_copy - -extern __typeof (g_checksum_free) IA__g_checksum_free __attribute((visibility("hidden"))); -#define g_checksum_free IA__g_checksum_free - -extern __typeof (g_checksum_update) IA__g_checksum_update __attribute((visibility("hidden"))); -#define g_checksum_update IA__g_checksum_update - -extern __typeof (g_checksum_reset) IA__g_checksum_reset __attribute((visibility("hidden"))); -#define g_checksum_reset IA__g_checksum_reset - -extern __typeof (g_checksum_get_string) IA__g_checksum_get_string __attribute((visibility("hidden"))); -#define g_checksum_get_string IA__g_checksum_get_string - -extern __typeof (g_checksum_get_digest) IA__g_checksum_get_digest __attribute((visibility("hidden"))); -#define g_checksum_get_digest IA__g_checksum_get_digest - -extern __typeof (g_compute_checksum_for_data) IA__g_compute_checksum_for_data __attribute((visibility("hidden"))); -#define g_compute_checksum_for_data IA__g_compute_checksum_for_data - -extern __typeof (g_compute_checksum_for_string) IA__g_compute_checksum_for_string __attribute((visibility("hidden"))); -#define g_compute_checksum_for_string IA__g_compute_checksum_for_string - -#endif -#endif -#if IN_HEADER(__G_COMPLETION_H__) -#if IN_FILE(__G_COMPLETION_C__) -extern __typeof (g_completion_add_items) IA__g_completion_add_items __attribute((visibility("hidden"))); -#define g_completion_add_items IA__g_completion_add_items - -extern __typeof (g_completion_clear_items) IA__g_completion_clear_items __attribute((visibility("hidden"))); -#define g_completion_clear_items IA__g_completion_clear_items - -extern __typeof (g_completion_complete) IA__g_completion_complete __attribute((visibility("hidden"))); -#define g_completion_complete IA__g_completion_complete - -extern __typeof (g_completion_complete_utf8) IA__g_completion_complete_utf8 __attribute((visibility("hidden"))); -#define g_completion_complete_utf8 IA__g_completion_complete_utf8 - -extern __typeof (g_completion_free) IA__g_completion_free __attribute((visibility("hidden"))); -#define g_completion_free IA__g_completion_free - -extern __typeof (g_completion_new) IA__g_completion_new __attribute((visibility("hidden"))); -#define g_completion_new IA__g_completion_new - -extern __typeof (g_completion_remove_items) IA__g_completion_remove_items __attribute((visibility("hidden"))); -#define g_completion_remove_items IA__g_completion_remove_items - -extern __typeof (g_completion_set_compare) IA__g_completion_set_compare __attribute((visibility("hidden"))); -#define g_completion_set_compare IA__g_completion_set_compare - -#endif -#endif -#if IN_HEADER(__G_CONVERT_H__) -#if IN_FILE(__G_CONVERT_C__) -extern __typeof (g_get_filename_charsets) IA__g_get_filename_charsets __attribute((visibility("hidden"))); -#define g_get_filename_charsets IA__g_get_filename_charsets - -extern __typeof (g_convert) IA__g_convert __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_convert IA__g_convert - -extern __typeof (g_convert_error_quark) IA__g_convert_error_quark __attribute((visibility("hidden"))); -#define g_convert_error_quark IA__g_convert_error_quark - -extern __typeof (g_convert_with_fallback) IA__g_convert_with_fallback __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_convert_with_fallback IA__g_convert_with_fallback - -extern __typeof (g_convert_with_iconv) IA__g_convert_with_iconv __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_convert_with_iconv IA__g_convert_with_iconv - -extern __typeof (g_iconv) IA__g_iconv __attribute((visibility("hidden"))); -#define g_iconv IA__g_iconv - -extern __typeof (g_iconv_close) IA__g_iconv_close __attribute((visibility("hidden"))); -#define g_iconv_close IA__g_iconv_close - -extern __typeof (g_iconv_open) IA__g_iconv_open __attribute((visibility("hidden"))); -#define g_iconv_open IA__g_iconv_open - -extern __typeof (g_locale_from_utf8) IA__g_locale_from_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_locale_from_utf8 IA__g_locale_from_utf8 - -extern __typeof (g_locale_to_utf8) IA__g_locale_to_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_locale_to_utf8 IA__g_locale_to_utf8 - -extern __typeof (g_filename_display_name) IA__g_filename_display_name __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_display_name IA__g_filename_display_name - -extern __typeof (g_filename_display_basename) IA__g_filename_display_basename __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_display_basename IA__g_filename_display_basename - -#ifndef _WIN64 -extern __typeof (g_filename_from_uri) IA__g_filename_from_uri __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_from_uri IA__g_filename_from_uri - -extern __typeof (g_filename_from_utf8) IA__g_filename_from_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_from_utf8 IA__g_filename_from_utf8 - -extern __typeof (g_filename_to_uri) IA__g_filename_to_uri __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_to_uri IA__g_filename_to_uri - -extern __typeof (g_filename_to_utf8) IA__g_filename_to_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_to_utf8 IA__g_filename_to_utf8 - -#endif -#ifdef G_OS_WIN32 -extern __typeof (g_filename_from_uri_utf8) IA__g_filename_from_uri_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_from_uri_utf8 IA__g_filename_from_uri_utf8 - -extern __typeof (g_filename_from_utf8_utf8) IA__g_filename_from_utf8_utf8 __attribute((visibility("hidden"))); -#define g_filename_from_utf8_utf8 IA__g_filename_from_utf8_utf8 - -extern __typeof (g_filename_to_uri_utf8) IA__g_filename_to_uri_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_filename_to_uri_utf8 IA__g_filename_to_uri_utf8 - -extern __typeof (g_filename_to_utf8_utf8) IA__g_filename_to_utf8_utf8 __attribute((visibility("hidden"))); -#define g_filename_to_utf8_utf8 IA__g_filename_to_utf8_utf8 - -#endif -extern __typeof (g_uri_list_extract_uris) IA__g_uri_list_extract_uris __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_uri_list_extract_uris IA__g_uri_list_extract_uris - -#endif -#endif -#if IN_HEADER(__G_DATASET_H__) -#if IN_FILE(__G_DATASET_C__) -extern __typeof (g_datalist_clear) IA__g_datalist_clear __attribute((visibility("hidden"))); -#define g_datalist_clear IA__g_datalist_clear - -extern __typeof (g_datalist_foreach) IA__g_datalist_foreach __attribute((visibility("hidden"))); -#define g_datalist_foreach IA__g_datalist_foreach - -extern __typeof (g_datalist_get_flags) IA__g_datalist_get_flags __attribute((visibility("hidden"))); -#define g_datalist_get_flags IA__g_datalist_get_flags - -extern __typeof (g_datalist_id_get_data) IA__g_datalist_id_get_data __attribute((visibility("hidden"))); -#define g_datalist_id_get_data IA__g_datalist_id_get_data - -extern __typeof (g_datalist_id_remove_no_notify) IA__g_datalist_id_remove_no_notify __attribute((visibility("hidden"))); -#define g_datalist_id_remove_no_notify IA__g_datalist_id_remove_no_notify - -extern __typeof (g_datalist_id_set_data_full) IA__g_datalist_id_set_data_full __attribute((visibility("hidden"))); -#define g_datalist_id_set_data_full IA__g_datalist_id_set_data_full - -extern __typeof (g_datalist_set_flags) IA__g_datalist_set_flags __attribute((visibility("hidden"))); -#define g_datalist_set_flags IA__g_datalist_set_flags - -extern __typeof (g_datalist_unset_flags) IA__g_datalist_unset_flags __attribute((visibility("hidden"))); -#define g_datalist_unset_flags IA__g_datalist_unset_flags - -extern __typeof (g_datalist_init) IA__g_datalist_init __attribute((visibility("hidden"))); -#define g_datalist_init IA__g_datalist_init - -extern __typeof (g_dataset_destroy) IA__g_dataset_destroy __attribute((visibility("hidden"))); -#define g_dataset_destroy IA__g_dataset_destroy - -extern __typeof (g_dataset_foreach) IA__g_dataset_foreach __attribute((visibility("hidden"))); -#define g_dataset_foreach IA__g_dataset_foreach - -extern __typeof (g_dataset_id_get_data) IA__g_dataset_id_get_data __attribute((visibility("hidden"))); -#define g_dataset_id_get_data IA__g_dataset_id_get_data - -extern __typeof (g_dataset_id_remove_no_notify) IA__g_dataset_id_remove_no_notify __attribute((visibility("hidden"))); -#define g_dataset_id_remove_no_notify IA__g_dataset_id_remove_no_notify - -extern __typeof (g_dataset_id_set_data_full) IA__g_dataset_id_set_data_full __attribute((visibility("hidden"))); -#define g_dataset_id_set_data_full IA__g_dataset_id_set_data_full - -#endif -#endif -#if IN_HEADER(__G_QUARK_H__) -#if IN_FILE(__G_DATASET_C__) -extern __typeof (g_quark_from_static_string) IA__g_quark_from_static_string __attribute((visibility("hidden"))); -#define g_quark_from_static_string IA__g_quark_from_static_string - -extern __typeof (g_quark_from_string) IA__g_quark_from_string __attribute((visibility("hidden"))); -#define g_quark_from_string IA__g_quark_from_string - -extern __typeof (g_quark_to_string) IA__g_quark_to_string __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_quark_to_string IA__g_quark_to_string - -extern __typeof (g_quark_try_string) IA__g_quark_try_string __attribute((visibility("hidden"))); -#define g_quark_try_string IA__g_quark_try_string - -extern __typeof (g_intern_string) IA__g_intern_string __attribute((visibility("hidden"))); -#define g_intern_string IA__g_intern_string - -extern __typeof (g_intern_static_string) IA__g_intern_static_string __attribute((visibility("hidden"))); -#define g_intern_static_string IA__g_intern_static_string - -#endif -#endif -#if IN_HEADER(__G_DATE_H__) -#if IN_FILE(__G_DATE_C__) -extern __typeof (g_date_add_days) IA__g_date_add_days __attribute((visibility("hidden"))); -#define g_date_add_days IA__g_date_add_days - -extern __typeof (g_date_add_months) IA__g_date_add_months __attribute((visibility("hidden"))); -#define g_date_add_months IA__g_date_add_months - -extern __typeof (g_date_add_years) IA__g_date_add_years __attribute((visibility("hidden"))); -#define g_date_add_years IA__g_date_add_years - -extern __typeof (g_date_clamp) IA__g_date_clamp __attribute((visibility("hidden"))); -#define g_date_clamp IA__g_date_clamp - -extern __typeof (g_date_clear) IA__g_date_clear __attribute((visibility("hidden"))); -#define g_date_clear IA__g_date_clear - -extern __typeof (g_date_compare) IA__g_date_compare __attribute((visibility("hidden"))); -#define g_date_compare IA__g_date_compare - -extern __typeof (g_date_days_between) IA__g_date_days_between __attribute((visibility("hidden"))); -#define g_date_days_between IA__g_date_days_between - -extern __typeof (g_date_free) IA__g_date_free __attribute((visibility("hidden"))); -#define g_date_free IA__g_date_free - -extern __typeof (g_date_get_day) IA__g_date_get_day __attribute((visibility("hidden"))); -#define g_date_get_day IA__g_date_get_day - -extern __typeof (g_date_get_day_of_year) IA__g_date_get_day_of_year __attribute((visibility("hidden"))); -#define g_date_get_day_of_year IA__g_date_get_day_of_year - -extern __typeof (g_date_get_days_in_month) IA__g_date_get_days_in_month __attribute((visibility("hidden"))); -#define g_date_get_days_in_month IA__g_date_get_days_in_month - -extern __typeof (g_date_get_iso8601_week_of_year) IA__g_date_get_iso8601_week_of_year __attribute((visibility("hidden"))); -#define g_date_get_iso8601_week_of_year IA__g_date_get_iso8601_week_of_year - -extern __typeof (g_date_get_julian) IA__g_date_get_julian __attribute((visibility("hidden"))); -#define g_date_get_julian IA__g_date_get_julian - -extern __typeof (g_date_get_monday_week_of_year) IA__g_date_get_monday_week_of_year __attribute((visibility("hidden"))); -#define g_date_get_monday_week_of_year IA__g_date_get_monday_week_of_year - -extern __typeof (g_date_get_monday_weeks_in_year) IA__g_date_get_monday_weeks_in_year __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_get_monday_weeks_in_year IA__g_date_get_monday_weeks_in_year - -extern __typeof (g_date_get_month) IA__g_date_get_month __attribute((visibility("hidden"))); -#define g_date_get_month IA__g_date_get_month - -extern __typeof (g_date_get_sunday_week_of_year) IA__g_date_get_sunday_week_of_year __attribute((visibility("hidden"))); -#define g_date_get_sunday_week_of_year IA__g_date_get_sunday_week_of_year - -extern __typeof (g_date_get_sunday_weeks_in_year) IA__g_date_get_sunday_weeks_in_year __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_get_sunday_weeks_in_year IA__g_date_get_sunday_weeks_in_year - -extern __typeof (g_date_get_weekday) IA__g_date_get_weekday __attribute((visibility("hidden"))); -#define g_date_get_weekday IA__g_date_get_weekday - -extern __typeof (g_date_get_year) IA__g_date_get_year __attribute((visibility("hidden"))); -#define g_date_get_year IA__g_date_get_year - -extern __typeof (g_date_is_first_of_month) IA__g_date_is_first_of_month __attribute((visibility("hidden"))); -#define g_date_is_first_of_month IA__g_date_is_first_of_month - -extern __typeof (g_date_is_last_of_month) IA__g_date_is_last_of_month __attribute((visibility("hidden"))); -#define g_date_is_last_of_month IA__g_date_is_last_of_month - -extern __typeof (g_date_is_leap_year) IA__g_date_is_leap_year __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_is_leap_year IA__g_date_is_leap_year - -extern __typeof (g_date_new) IA__g_date_new __attribute((visibility("hidden"))); -#define g_date_new IA__g_date_new - -extern __typeof (g_date_new_dmy) IA__g_date_new_dmy __attribute((visibility("hidden"))); -#define g_date_new_dmy IA__g_date_new_dmy - -extern __typeof (g_date_new_julian) IA__g_date_new_julian __attribute((visibility("hidden"))); -#define g_date_new_julian IA__g_date_new_julian - -extern __typeof (g_date_order) IA__g_date_order __attribute((visibility("hidden"))); -#define g_date_order IA__g_date_order - -extern __typeof (g_date_set_day) IA__g_date_set_day __attribute((visibility("hidden"))); -#define g_date_set_day IA__g_date_set_day - -extern __typeof (g_date_set_dmy) IA__g_date_set_dmy __attribute((visibility("hidden"))); -#define g_date_set_dmy IA__g_date_set_dmy - -extern __typeof (g_date_set_julian) IA__g_date_set_julian __attribute((visibility("hidden"))); -#define g_date_set_julian IA__g_date_set_julian - -extern __typeof (g_date_set_month) IA__g_date_set_month __attribute((visibility("hidden"))); -#define g_date_set_month IA__g_date_set_month - -extern __typeof (g_date_set_parse) IA__g_date_set_parse __attribute((visibility("hidden"))); -#define g_date_set_parse IA__g_date_set_parse - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_date_set_time) IA__g_date_set_time __attribute((visibility("hidden"))); -#define g_date_set_time IA__g_date_set_time - -#endif -extern __typeof (g_date_set_time_t) IA__g_date_set_time_t __attribute((visibility("hidden"))); -#define g_date_set_time_t IA__g_date_set_time_t - -extern __typeof (g_date_set_time_val) IA__g_date_set_time_val __attribute((visibility("hidden"))); -#define g_date_set_time_val IA__g_date_set_time_val - -extern __typeof (g_date_set_year) IA__g_date_set_year __attribute((visibility("hidden"))); -#define g_date_set_year IA__g_date_set_year - -extern __typeof (g_date_strftime) IA__g_date_strftime __attribute((visibility("hidden"))); -#define g_date_strftime IA__g_date_strftime - -extern __typeof (g_date_subtract_days) IA__g_date_subtract_days __attribute((visibility("hidden"))); -#define g_date_subtract_days IA__g_date_subtract_days - -extern __typeof (g_date_subtract_months) IA__g_date_subtract_months __attribute((visibility("hidden"))); -#define g_date_subtract_months IA__g_date_subtract_months - -extern __typeof (g_date_subtract_years) IA__g_date_subtract_years __attribute((visibility("hidden"))); -#define g_date_subtract_years IA__g_date_subtract_years - -extern __typeof (g_date_to_struct_tm) IA__g_date_to_struct_tm __attribute((visibility("hidden"))); -#define g_date_to_struct_tm IA__g_date_to_struct_tm - -extern __typeof (g_date_valid) IA__g_date_valid __attribute((visibility("hidden"))); -#define g_date_valid IA__g_date_valid - -extern __typeof (g_date_valid_day) IA__g_date_valid_day __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_valid_day IA__g_date_valid_day - -extern __typeof (g_date_valid_dmy) IA__g_date_valid_dmy __attribute((visibility("hidden"))); -#define g_date_valid_dmy IA__g_date_valid_dmy - -extern __typeof (g_date_valid_julian) IA__g_date_valid_julian __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_valid_julian IA__g_date_valid_julian - -extern __typeof (g_date_valid_month) IA__g_date_valid_month __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_valid_month IA__g_date_valid_month - -extern __typeof (g_date_valid_weekday) IA__g_date_valid_weekday __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_valid_weekday IA__g_date_valid_weekday - -extern __typeof (g_date_valid_year) IA__g_date_valid_year __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_date_valid_year IA__g_date_valid_year - -#endif -#endif -#if IN_HEADER(__G_DIR_H__) -#if IN_FILE(__G_DIR_C__) -extern __typeof (g_dir_close) IA__g_dir_close __attribute((visibility("hidden"))); -#define g_dir_close IA__g_dir_close - -#ifndef _WIN64 -extern __typeof (g_dir_open) IA__g_dir_open __attribute((visibility("hidden"))); -#define g_dir_open IA__g_dir_open - -extern __typeof (g_dir_read_name) IA__g_dir_read_name __attribute((visibility("hidden"))); -#define g_dir_read_name IA__g_dir_read_name - -#endif -#ifdef G_OS_WIN32 -extern __typeof (g_dir_open_utf8) IA__g_dir_open_utf8 __attribute((visibility("hidden"))); -#define g_dir_open_utf8 IA__g_dir_open_utf8 - -extern __typeof (g_dir_read_name_utf8) IA__g_dir_read_name_utf8 __attribute((visibility("hidden"))); -#define g_dir_read_name_utf8 IA__g_dir_read_name_utf8 - -#endif -extern __typeof (g_dir_rewind) IA__g_dir_rewind __attribute((visibility("hidden"))); -#define g_dir_rewind IA__g_dir_rewind - -#endif -#endif -#if IN_HEADER(__G_ERROR_H__) -#if IN_FILE(__G_ERROR_C__) -extern __typeof (g_clear_error) IA__g_clear_error __attribute((visibility("hidden"))); -#define g_clear_error IA__g_clear_error - -extern __typeof (g_error_copy) IA__g_error_copy __attribute((visibility("hidden"))); -#define g_error_copy IA__g_error_copy - -extern __typeof (g_error_free) IA__g_error_free __attribute((visibility("hidden"))); -#define g_error_free IA__g_error_free - -extern __typeof (g_error_matches) IA__g_error_matches __attribute((visibility("hidden"))); -#define g_error_matches IA__g_error_matches - -extern __typeof (g_error_new) IA__g_error_new __attribute((visibility("hidden"))) G_GNUC_PRINTF(3,4); -#define g_error_new IA__g_error_new - -extern __typeof (g_error_new_literal) IA__g_error_new_literal __attribute((visibility("hidden"))); -#define g_error_new_literal IA__g_error_new_literal - -extern __typeof (g_error_new_valist) IA__g_error_new_valist __attribute((visibility("hidden"))); -#define g_error_new_valist IA__g_error_new_valist - -extern __typeof (g_propagate_error) IA__g_propagate_error __attribute((visibility("hidden"))); -#define g_propagate_error IA__g_propagate_error - -extern __typeof (g_set_error) IA__g_set_error __attribute((visibility("hidden"))) G_GNUC_PRINTF(4,5); -#define g_set_error IA__g_set_error - -extern __typeof (g_set_error_literal) IA__g_set_error_literal __attribute((visibility("hidden"))); -#define g_set_error_literal IA__g_set_error_literal - -extern __typeof (g_prefix_error) IA__g_prefix_error __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_prefix_error IA__g_prefix_error - -extern __typeof (g_propagate_prefixed_error) IA__g_propagate_prefixed_error __attribute((visibility("hidden"))) G_GNUC_PRINTF(3,4); -#define g_propagate_prefixed_error IA__g_propagate_prefixed_error - -#endif -#endif -#if IN_HEADER(__G_FILEUTILS_H__) -#if IN_FILE(__G_FILEUTILS_C__) -extern __typeof (g_build_filename) IA__g_build_filename __attribute((visibility("hidden"))) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED; -#define g_build_filename IA__g_build_filename - -extern __typeof (g_build_filenamev) IA__g_build_filenamev __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_build_filenamev IA__g_build_filenamev - -extern __typeof (g_build_path) IA__g_build_path __attribute((visibility("hidden"))) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED; -#define g_build_path IA__g_build_path - -extern __typeof (g_build_pathv) IA__g_build_pathv __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_build_pathv IA__g_build_pathv - -extern __typeof (g_file_error_from_errno) IA__g_file_error_from_errno __attribute((visibility("hidden"))); -#define g_file_error_from_errno IA__g_file_error_from_errno - -extern __typeof (g_file_error_quark) IA__g_file_error_quark __attribute((visibility("hidden"))); -#define g_file_error_quark IA__g_file_error_quark - -#ifndef _WIN64 -extern __typeof (g_file_get_contents) IA__g_file_get_contents __attribute((visibility("hidden"))); -#define g_file_get_contents IA__g_file_get_contents - -#endif -extern __typeof (g_file_set_contents) IA__g_file_set_contents __attribute((visibility("hidden"))); -#define g_file_set_contents IA__g_file_set_contents - -#ifndef _WIN64 -extern __typeof (g_file_open_tmp) IA__g_file_open_tmp __attribute((visibility("hidden"))); -#define g_file_open_tmp IA__g_file_open_tmp - -extern __typeof (g_file_test) IA__g_file_test __attribute((visibility("hidden"))); -#define g_file_test IA__g_file_test - -#endif -extern __typeof (g_file_read_link) IA__g_file_read_link __attribute((visibility("hidden"))); -#define g_file_read_link IA__g_file_read_link - -extern __typeof (g_format_size_for_display) IA__g_format_size_for_display __attribute((visibility("hidden"))); -#define g_format_size_for_display IA__g_format_size_for_display - -#ifndef _WIN64 -extern __typeof (g_mkstemp) IA__g_mkstemp __attribute((visibility("hidden"))); -#define g_mkstemp IA__g_mkstemp - -#endif -extern __typeof (g_mkstemp_full) IA__g_mkstemp_full __attribute((visibility("hidden"))); -#define g_mkstemp_full IA__g_mkstemp_full - -extern __typeof (g_mkdir_with_parents) IA__g_mkdir_with_parents __attribute((visibility("hidden"))); -#define g_mkdir_with_parents IA__g_mkdir_with_parents - -#ifdef G_OS_WIN32 -extern __typeof (g_file_get_contents_utf8) IA__g_file_get_contents_utf8 __attribute((visibility("hidden"))); -#define g_file_get_contents_utf8 IA__g_file_get_contents_utf8 - -extern __typeof (g_file_open_tmp_utf8) IA__g_file_open_tmp_utf8 __attribute((visibility("hidden"))); -#define g_file_open_tmp_utf8 IA__g_file_open_tmp_utf8 - -extern __typeof (g_file_test_utf8) IA__g_file_test_utf8 __attribute((visibility("hidden"))); -#define g_file_test_utf8 IA__g_file_test_utf8 - -extern __typeof (g_mkstemp_utf8) IA__g_mkstemp_utf8 __attribute((visibility("hidden"))); -#define g_mkstemp_utf8 IA__g_mkstemp_utf8 - -#endif -#endif -#endif -#if IN_HEADER(__G_HASH_H__) -#if IN_FILE(__G_HASH_C__) -extern __typeof (g_hash_table_destroy) IA__g_hash_table_destroy __attribute((visibility("hidden"))); -#define g_hash_table_destroy IA__g_hash_table_destroy - -extern __typeof (g_hash_table_unref) IA__g_hash_table_unref __attribute((visibility("hidden"))); -#define g_hash_table_unref IA__g_hash_table_unref - -extern __typeof (g_hash_table_ref) IA__g_hash_table_ref __attribute((visibility("hidden"))); -#define g_hash_table_ref IA__g_hash_table_ref - -extern __typeof (g_hash_table_find) IA__g_hash_table_find __attribute((visibility("hidden"))); -#define g_hash_table_find IA__g_hash_table_find - -extern __typeof (g_hash_table_foreach) IA__g_hash_table_foreach __attribute((visibility("hidden"))); -#define g_hash_table_foreach IA__g_hash_table_foreach - -extern __typeof (g_hash_table_foreach_remove) IA__g_hash_table_foreach_remove __attribute((visibility("hidden"))); -#define g_hash_table_foreach_remove IA__g_hash_table_foreach_remove - -extern __typeof (g_hash_table_foreach_steal) IA__g_hash_table_foreach_steal __attribute((visibility("hidden"))); -#define g_hash_table_foreach_steal IA__g_hash_table_foreach_steal - -extern __typeof (g_hash_table_get_keys) IA__g_hash_table_get_keys __attribute((visibility("hidden"))); -#define g_hash_table_get_keys IA__g_hash_table_get_keys - -extern __typeof (g_hash_table_get_values) IA__g_hash_table_get_values __attribute((visibility("hidden"))); -#define g_hash_table_get_values IA__g_hash_table_get_values - -extern __typeof (g_hash_table_insert) IA__g_hash_table_insert __attribute((visibility("hidden"))); -#define g_hash_table_insert IA__g_hash_table_insert - -extern __typeof (g_hash_table_lookup) IA__g_hash_table_lookup __attribute((visibility("hidden"))); -#define g_hash_table_lookup IA__g_hash_table_lookup - -extern __typeof (g_hash_table_lookup_extended) IA__g_hash_table_lookup_extended __attribute((visibility("hidden"))); -#define g_hash_table_lookup_extended IA__g_hash_table_lookup_extended - -extern __typeof (g_hash_table_new) IA__g_hash_table_new __attribute((visibility("hidden"))); -#define g_hash_table_new IA__g_hash_table_new - -extern __typeof (g_hash_table_new_full) IA__g_hash_table_new_full __attribute((visibility("hidden"))); -#define g_hash_table_new_full IA__g_hash_table_new_full - -extern __typeof (g_hash_table_remove) IA__g_hash_table_remove __attribute((visibility("hidden"))); -#define g_hash_table_remove IA__g_hash_table_remove - -extern __typeof (g_hash_table_remove_all) IA__g_hash_table_remove_all __attribute((visibility("hidden"))); -#define g_hash_table_remove_all IA__g_hash_table_remove_all - -extern __typeof (g_hash_table_replace) IA__g_hash_table_replace __attribute((visibility("hidden"))); -#define g_hash_table_replace IA__g_hash_table_replace - -extern __typeof (g_hash_table_size) IA__g_hash_table_size __attribute((visibility("hidden"))); -#define g_hash_table_size IA__g_hash_table_size - -extern __typeof (g_hash_table_steal) IA__g_hash_table_steal __attribute((visibility("hidden"))); -#define g_hash_table_steal IA__g_hash_table_steal - -extern __typeof (g_hash_table_steal_all) IA__g_hash_table_steal_all __attribute((visibility("hidden"))); -#define g_hash_table_steal_all IA__g_hash_table_steal_all - -extern __typeof (g_hash_table_iter_init) IA__g_hash_table_iter_init __attribute((visibility("hidden"))); -#define g_hash_table_iter_init IA__g_hash_table_iter_init - -extern __typeof (g_hash_table_iter_next) IA__g_hash_table_iter_next __attribute((visibility("hidden"))); -#define g_hash_table_iter_next IA__g_hash_table_iter_next - -extern __typeof (g_hash_table_iter_get_hash_table) IA__g_hash_table_iter_get_hash_table __attribute((visibility("hidden"))); -#define g_hash_table_iter_get_hash_table IA__g_hash_table_iter_get_hash_table - -extern __typeof (g_hash_table_iter_remove) IA__g_hash_table_iter_remove __attribute((visibility("hidden"))); -#define g_hash_table_iter_remove IA__g_hash_table_iter_remove - -extern __typeof (g_hash_table_iter_steal) IA__g_hash_table_iter_steal __attribute((visibility("hidden"))); -#define g_hash_table_iter_steal IA__g_hash_table_iter_steal - -#endif -#endif -#if IN_HEADER(__G_HOOK_H__) -#if IN_FILE(__G_HOOK_C__) -extern __typeof (g_hook_alloc) IA__g_hook_alloc __attribute((visibility("hidden"))); -#define g_hook_alloc IA__g_hook_alloc - -extern __typeof (g_hook_compare_ids) IA__g_hook_compare_ids __attribute((visibility("hidden"))); -#define g_hook_compare_ids IA__g_hook_compare_ids - -extern __typeof (g_hook_destroy) IA__g_hook_destroy __attribute((visibility("hidden"))); -#define g_hook_destroy IA__g_hook_destroy - -extern __typeof (g_hook_destroy_link) IA__g_hook_destroy_link __attribute((visibility("hidden"))); -#define g_hook_destroy_link IA__g_hook_destroy_link - -extern __typeof (g_hook_find) IA__g_hook_find __attribute((visibility("hidden"))); -#define g_hook_find IA__g_hook_find - -extern __typeof (g_hook_find_data) IA__g_hook_find_data __attribute((visibility("hidden"))); -#define g_hook_find_data IA__g_hook_find_data - -extern __typeof (g_hook_find_func) IA__g_hook_find_func __attribute((visibility("hidden"))); -#define g_hook_find_func IA__g_hook_find_func - -extern __typeof (g_hook_find_func_data) IA__g_hook_find_func_data __attribute((visibility("hidden"))); -#define g_hook_find_func_data IA__g_hook_find_func_data - -extern __typeof (g_hook_first_valid) IA__g_hook_first_valid __attribute((visibility("hidden"))); -#define g_hook_first_valid IA__g_hook_first_valid - -extern __typeof (g_hook_free) IA__g_hook_free __attribute((visibility("hidden"))); -#define g_hook_free IA__g_hook_free - -extern __typeof (g_hook_get) IA__g_hook_get __attribute((visibility("hidden"))); -#define g_hook_get IA__g_hook_get - -extern __typeof (g_hook_insert_before) IA__g_hook_insert_before __attribute((visibility("hidden"))); -#define g_hook_insert_before IA__g_hook_insert_before - -extern __typeof (g_hook_insert_sorted) IA__g_hook_insert_sorted __attribute((visibility("hidden"))); -#define g_hook_insert_sorted IA__g_hook_insert_sorted - -extern __typeof (g_hook_list_clear) IA__g_hook_list_clear __attribute((visibility("hidden"))); -#define g_hook_list_clear IA__g_hook_list_clear - -extern __typeof (g_hook_list_init) IA__g_hook_list_init __attribute((visibility("hidden"))); -#define g_hook_list_init IA__g_hook_list_init - -extern __typeof (g_hook_list_invoke) IA__g_hook_list_invoke __attribute((visibility("hidden"))); -#define g_hook_list_invoke IA__g_hook_list_invoke - -extern __typeof (g_hook_list_invoke_check) IA__g_hook_list_invoke_check __attribute((visibility("hidden"))); -#define g_hook_list_invoke_check IA__g_hook_list_invoke_check - -extern __typeof (g_hook_list_marshal) IA__g_hook_list_marshal __attribute((visibility("hidden"))); -#define g_hook_list_marshal IA__g_hook_list_marshal - -extern __typeof (g_hook_list_marshal_check) IA__g_hook_list_marshal_check __attribute((visibility("hidden"))); -#define g_hook_list_marshal_check IA__g_hook_list_marshal_check - -extern __typeof (g_hook_next_valid) IA__g_hook_next_valid __attribute((visibility("hidden"))); -#define g_hook_next_valid IA__g_hook_next_valid - -extern __typeof (g_hook_prepend) IA__g_hook_prepend __attribute((visibility("hidden"))); -#define g_hook_prepend IA__g_hook_prepend - -extern __typeof (g_hook_ref) IA__g_hook_ref __attribute((visibility("hidden"))); -#define g_hook_ref IA__g_hook_ref - -extern __typeof (g_hook_unref) IA__g_hook_unref __attribute((visibility("hidden"))); -#define g_hook_unref IA__g_hook_unref - -#endif -#endif -#if IN_HEADER(__G_IOCHANNEL_H__) -#if IN_FILE(__G_IOCHANNEL_C__) -extern __typeof (g_io_add_watch) IA__g_io_add_watch __attribute((visibility("hidden"))); -#define g_io_add_watch IA__g_io_add_watch - -extern __typeof (g_io_add_watch_full) IA__g_io_add_watch_full __attribute((visibility("hidden"))); -#define g_io_add_watch_full IA__g_io_add_watch_full - -extern __typeof (g_io_create_watch) IA__g_io_create_watch __attribute((visibility("hidden"))); -#define g_io_create_watch IA__g_io_create_watch - -extern __typeof (g_io_channel_error_from_errno) IA__g_io_channel_error_from_errno __attribute((visibility("hidden"))); -#define g_io_channel_error_from_errno IA__g_io_channel_error_from_errno - -extern __typeof (g_io_channel_error_quark) IA__g_io_channel_error_quark __attribute((visibility("hidden"))); -#define g_io_channel_error_quark IA__g_io_channel_error_quark - -extern __typeof (g_io_channel_flush) IA__g_io_channel_flush __attribute((visibility("hidden"))); -#define g_io_channel_flush IA__g_io_channel_flush - -extern __typeof (g_io_channel_get_buffer_condition) IA__g_io_channel_get_buffer_condition __attribute((visibility("hidden"))); -#define g_io_channel_get_buffer_condition IA__g_io_channel_get_buffer_condition - -extern __typeof (g_io_channel_get_buffered) IA__g_io_channel_get_buffered __attribute((visibility("hidden"))); -#define g_io_channel_get_buffered IA__g_io_channel_get_buffered - -extern __typeof (g_io_channel_get_buffer_size) IA__g_io_channel_get_buffer_size __attribute((visibility("hidden"))); -#define g_io_channel_get_buffer_size IA__g_io_channel_get_buffer_size - -extern __typeof (g_io_channel_get_close_on_unref) IA__g_io_channel_get_close_on_unref __attribute((visibility("hidden"))); -#define g_io_channel_get_close_on_unref IA__g_io_channel_get_close_on_unref - -extern __typeof (g_io_channel_get_encoding) IA__g_io_channel_get_encoding __attribute((visibility("hidden"))); -#define g_io_channel_get_encoding IA__g_io_channel_get_encoding - -extern __typeof (g_io_channel_get_flags) IA__g_io_channel_get_flags __attribute((visibility("hidden"))); -#define g_io_channel_get_flags IA__g_io_channel_get_flags - -extern __typeof (g_io_channel_get_line_term) IA__g_io_channel_get_line_term __attribute((visibility("hidden"))); -#define g_io_channel_get_line_term IA__g_io_channel_get_line_term - -extern __typeof (g_io_channel_init) IA__g_io_channel_init __attribute((visibility("hidden"))); -#define g_io_channel_init IA__g_io_channel_init - -extern __typeof (g_io_channel_read_chars) IA__g_io_channel_read_chars __attribute((visibility("hidden"))); -#define g_io_channel_read_chars IA__g_io_channel_read_chars - -extern __typeof (g_io_channel_read_line) IA__g_io_channel_read_line __attribute((visibility("hidden"))); -#define g_io_channel_read_line IA__g_io_channel_read_line - -extern __typeof (g_io_channel_read_line_string) IA__g_io_channel_read_line_string __attribute((visibility("hidden"))); -#define g_io_channel_read_line_string IA__g_io_channel_read_line_string - -extern __typeof (g_io_channel_read_to_end) IA__g_io_channel_read_to_end __attribute((visibility("hidden"))); -#define g_io_channel_read_to_end IA__g_io_channel_read_to_end - -extern __typeof (g_io_channel_read_unichar) IA__g_io_channel_read_unichar __attribute((visibility("hidden"))); -#define g_io_channel_read_unichar IA__g_io_channel_read_unichar - -extern __typeof (g_io_channel_ref) IA__g_io_channel_ref __attribute((visibility("hidden"))); -#define g_io_channel_ref IA__g_io_channel_ref - -extern __typeof (g_io_channel_seek_position) IA__g_io_channel_seek_position __attribute((visibility("hidden"))); -#define g_io_channel_seek_position IA__g_io_channel_seek_position - -extern __typeof (g_io_channel_set_buffered) IA__g_io_channel_set_buffered __attribute((visibility("hidden"))); -#define g_io_channel_set_buffered IA__g_io_channel_set_buffered - -extern __typeof (g_io_channel_set_buffer_size) IA__g_io_channel_set_buffer_size __attribute((visibility("hidden"))); -#define g_io_channel_set_buffer_size IA__g_io_channel_set_buffer_size - -extern __typeof (g_io_channel_set_close_on_unref) IA__g_io_channel_set_close_on_unref __attribute((visibility("hidden"))); -#define g_io_channel_set_close_on_unref IA__g_io_channel_set_close_on_unref - -extern __typeof (g_io_channel_set_encoding) IA__g_io_channel_set_encoding __attribute((visibility("hidden"))); -#define g_io_channel_set_encoding IA__g_io_channel_set_encoding - -extern __typeof (g_io_channel_set_flags) IA__g_io_channel_set_flags __attribute((visibility("hidden"))); -#define g_io_channel_set_flags IA__g_io_channel_set_flags - -extern __typeof (g_io_channel_set_line_term) IA__g_io_channel_set_line_term __attribute((visibility("hidden"))); -#define g_io_channel_set_line_term IA__g_io_channel_set_line_term - -extern __typeof (g_io_channel_shutdown) IA__g_io_channel_shutdown __attribute((visibility("hidden"))); -#define g_io_channel_shutdown IA__g_io_channel_shutdown - -extern __typeof (g_io_channel_unref) IA__g_io_channel_unref __attribute((visibility("hidden"))); -#define g_io_channel_unref IA__g_io_channel_unref - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_io_channel_close) IA__g_io_channel_close __attribute((visibility("hidden"))); -#define g_io_channel_close IA__g_io_channel_close - -extern __typeof (g_io_channel_read) IA__g_io_channel_read __attribute((visibility("hidden"))); -#define g_io_channel_read IA__g_io_channel_read - -extern __typeof (g_io_channel_seek) IA__g_io_channel_seek __attribute((visibility("hidden"))); -#define g_io_channel_seek IA__g_io_channel_seek - -extern __typeof (g_io_channel_write) IA__g_io_channel_write __attribute((visibility("hidden"))); -#define g_io_channel_write IA__g_io_channel_write - -#endif -extern __typeof (g_io_channel_write_chars) IA__g_io_channel_write_chars __attribute((visibility("hidden"))); -#define g_io_channel_write_chars IA__g_io_channel_write_chars - -extern __typeof (g_io_channel_write_unichar) IA__g_io_channel_write_unichar __attribute((visibility("hidden"))); -#define g_io_channel_write_unichar IA__g_io_channel_write_unichar - -#endif -#endif -#if IN_HEADER(__G_IOCHANNEL_H__) -#if IN_FILE(__G_IO_UNIX_C__) -#ifdef G_OS_UNIX -extern __typeof (g_io_channel_unix_get_fd) IA__g_io_channel_unix_get_fd __attribute((visibility("hidden"))); -#define g_io_channel_unix_get_fd IA__g_io_channel_unix_get_fd - -extern __typeof (g_io_channel_unix_new) IA__g_io_channel_unix_new __attribute((visibility("hidden"))); -#define g_io_channel_unix_new IA__g_io_channel_unix_new - -extern __typeof (g_io_channel_new_file) IA__g_io_channel_new_file __attribute((visibility("hidden"))); -#define g_io_channel_new_file IA__g_io_channel_new_file - -#endif -#endif -#endif -#if IN_HEADER(__G_IOCHANNEL_H__) -#if IN_FILE(__G_IO_WIN32_C__) -#ifdef G_OS_WIN32 -extern __typeof (g_io_channel_unix_get_fd) IA__g_io_channel_unix_get_fd __attribute((visibility("hidden"))); -#define g_io_channel_unix_get_fd IA__g_io_channel_unix_get_fd - -extern __typeof (g_io_channel_unix_new) IA__g_io_channel_unix_new __attribute((visibility("hidden"))); -#define g_io_channel_unix_new IA__g_io_channel_unix_new - -#ifndef _WIN64 -extern __typeof (g_io_channel_new_file) IA__g_io_channel_new_file __attribute((visibility("hidden"))); -#define g_io_channel_new_file IA__g_io_channel_new_file - -#endif -extern __typeof (g_io_channel_new_file_utf8) IA__g_io_channel_new_file_utf8 __attribute((visibility("hidden"))); -#define g_io_channel_new_file_utf8 IA__g_io_channel_new_file_utf8 - -extern __typeof (g_io_channel_win32_get_fd) IA__g_io_channel_win32_get_fd __attribute((visibility("hidden"))); -#define g_io_channel_win32_get_fd IA__g_io_channel_win32_get_fd - -extern __typeof (g_io_channel_win32_make_pollfd) IA__g_io_channel_win32_make_pollfd __attribute((visibility("hidden"))); -#define g_io_channel_win32_make_pollfd IA__g_io_channel_win32_make_pollfd - -extern __typeof (g_io_channel_win32_new_fd) IA__g_io_channel_win32_new_fd __attribute((visibility("hidden"))); -#define g_io_channel_win32_new_fd IA__g_io_channel_win32_new_fd - -extern __typeof (g_io_channel_win32_new_messages) IA__g_io_channel_win32_new_messages __attribute((visibility("hidden"))); -#define g_io_channel_win32_new_messages IA__g_io_channel_win32_new_messages - -extern __typeof (g_io_channel_win32_new_socket) IA__g_io_channel_win32_new_socket __attribute((visibility("hidden"))); -#define g_io_channel_win32_new_socket IA__g_io_channel_win32_new_socket - -#ifndef _WIN64 -extern __typeof (g_io_channel_win32_new_stream_socket) IA__g_io_channel_win32_new_stream_socket __attribute((visibility("hidden"))); -#define g_io_channel_win32_new_stream_socket IA__g_io_channel_win32_new_stream_socket - -#endif -extern __typeof (g_io_channel_win32_poll) IA__g_io_channel_win32_poll __attribute((visibility("hidden"))); -#define g_io_channel_win32_poll IA__g_io_channel_win32_poll - -extern __typeof (g_io_channel_win32_set_debug) IA__g_io_channel_win32_set_debug __attribute((visibility("hidden"))); -#define g_io_channel_win32_set_debug IA__g_io_channel_win32_set_debug - -#endif -#endif -#endif -#if IN_HEADER(__G_KEY_FILE_H__) -#if IN_FILE(__G_KEY_FILE_C__) -extern __typeof (g_key_file_error_quark) IA__g_key_file_error_quark __attribute((visibility("hidden"))); -#define g_key_file_error_quark IA__g_key_file_error_quark - -extern __typeof (g_key_file_free) IA__g_key_file_free __attribute((visibility("hidden"))); -#define g_key_file_free IA__g_key_file_free - -extern __typeof (g_key_file_get_boolean) IA__g_key_file_get_boolean __attribute((visibility("hidden"))); -#define g_key_file_get_boolean IA__g_key_file_get_boolean - -extern __typeof (g_key_file_get_boolean_list) IA__g_key_file_get_boolean_list __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_boolean_list IA__g_key_file_get_boolean_list - -extern __typeof (g_key_file_get_comment) IA__g_key_file_get_comment __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_comment IA__g_key_file_get_comment - -extern __typeof (g_key_file_get_groups) IA__g_key_file_get_groups __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_groups IA__g_key_file_get_groups - -extern __typeof (g_key_file_get_double) IA__g_key_file_get_double __attribute((visibility("hidden"))); -#define g_key_file_get_double IA__g_key_file_get_double - -extern __typeof (g_key_file_get_double_list) IA__g_key_file_get_double_list __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_double_list IA__g_key_file_get_double_list - -extern __typeof (g_key_file_get_integer) IA__g_key_file_get_integer __attribute((visibility("hidden"))); -#define g_key_file_get_integer IA__g_key_file_get_integer - -extern __typeof (g_key_file_get_integer_list) IA__g_key_file_get_integer_list __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_integer_list IA__g_key_file_get_integer_list - -extern __typeof (g_key_file_get_keys) IA__g_key_file_get_keys __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_keys IA__g_key_file_get_keys - -extern __typeof (g_key_file_get_locale_string) IA__g_key_file_get_locale_string __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_locale_string IA__g_key_file_get_locale_string - -extern __typeof (g_key_file_get_locale_string_list) IA__g_key_file_get_locale_string_list __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_locale_string_list IA__g_key_file_get_locale_string_list - -extern __typeof (g_key_file_get_start_group) IA__g_key_file_get_start_group __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_start_group IA__g_key_file_get_start_group - -extern __typeof (g_key_file_get_string) IA__g_key_file_get_string __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_string IA__g_key_file_get_string - -extern __typeof (g_key_file_get_string_list) IA__g_key_file_get_string_list __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_string_list IA__g_key_file_get_string_list - -extern __typeof (g_key_file_get_value) IA__g_key_file_get_value __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_get_value IA__g_key_file_get_value - -extern __typeof (g_key_file_has_group) IA__g_key_file_has_group __attribute((visibility("hidden"))); -#define g_key_file_has_group IA__g_key_file_has_group - -extern __typeof (g_key_file_has_key) IA__g_key_file_has_key __attribute((visibility("hidden"))); -#define g_key_file_has_key IA__g_key_file_has_key - -extern __typeof (g_key_file_load_from_dirs) IA__g_key_file_load_from_dirs __attribute((visibility("hidden"))); -#define g_key_file_load_from_dirs IA__g_key_file_load_from_dirs - -extern __typeof (g_key_file_load_from_data) IA__g_key_file_load_from_data __attribute((visibility("hidden"))); -#define g_key_file_load_from_data IA__g_key_file_load_from_data - -extern __typeof (g_key_file_load_from_data_dirs) IA__g_key_file_load_from_data_dirs __attribute((visibility("hidden"))); -#define g_key_file_load_from_data_dirs IA__g_key_file_load_from_data_dirs - -extern __typeof (g_key_file_load_from_file) IA__g_key_file_load_from_file __attribute((visibility("hidden"))); -#define g_key_file_load_from_file IA__g_key_file_load_from_file - -extern __typeof (g_key_file_new) IA__g_key_file_new __attribute((visibility("hidden"))); -#define g_key_file_new IA__g_key_file_new - -extern __typeof (g_key_file_remove_comment) IA__g_key_file_remove_comment __attribute((visibility("hidden"))); -#define g_key_file_remove_comment IA__g_key_file_remove_comment - -extern __typeof (g_key_file_remove_group) IA__g_key_file_remove_group __attribute((visibility("hidden"))); -#define g_key_file_remove_group IA__g_key_file_remove_group - -extern __typeof (g_key_file_remove_key) IA__g_key_file_remove_key __attribute((visibility("hidden"))); -#define g_key_file_remove_key IA__g_key_file_remove_key - -extern __typeof (g_key_file_set_boolean) IA__g_key_file_set_boolean __attribute((visibility("hidden"))); -#define g_key_file_set_boolean IA__g_key_file_set_boolean - -extern __typeof (g_key_file_set_boolean_list) IA__g_key_file_set_boolean_list __attribute((visibility("hidden"))); -#define g_key_file_set_boolean_list IA__g_key_file_set_boolean_list - -extern __typeof (g_key_file_set_comment) IA__g_key_file_set_comment __attribute((visibility("hidden"))); -#define g_key_file_set_comment IA__g_key_file_set_comment - -extern __typeof (g_key_file_set_double) IA__g_key_file_set_double __attribute((visibility("hidden"))); -#define g_key_file_set_double IA__g_key_file_set_double - -extern __typeof (g_key_file_set_double_list) IA__g_key_file_set_double_list __attribute((visibility("hidden"))); -#define g_key_file_set_double_list IA__g_key_file_set_double_list - -extern __typeof (g_key_file_set_integer) IA__g_key_file_set_integer __attribute((visibility("hidden"))); -#define g_key_file_set_integer IA__g_key_file_set_integer - -extern __typeof (g_key_file_set_integer_list) IA__g_key_file_set_integer_list __attribute((visibility("hidden"))); -#define g_key_file_set_integer_list IA__g_key_file_set_integer_list - -extern __typeof (g_key_file_set_list_separator) IA__g_key_file_set_list_separator __attribute((visibility("hidden"))); -#define g_key_file_set_list_separator IA__g_key_file_set_list_separator - -extern __typeof (g_key_file_set_locale_string) IA__g_key_file_set_locale_string __attribute((visibility("hidden"))); -#define g_key_file_set_locale_string IA__g_key_file_set_locale_string - -extern __typeof (g_key_file_set_locale_string_list) IA__g_key_file_set_locale_string_list __attribute((visibility("hidden"))); -#define g_key_file_set_locale_string_list IA__g_key_file_set_locale_string_list - -extern __typeof (g_key_file_set_string) IA__g_key_file_set_string __attribute((visibility("hidden"))); -#define g_key_file_set_string IA__g_key_file_set_string - -extern __typeof (g_key_file_set_string_list) IA__g_key_file_set_string_list __attribute((visibility("hidden"))); -#define g_key_file_set_string_list IA__g_key_file_set_string_list - -extern __typeof (g_key_file_set_value) IA__g_key_file_set_value __attribute((visibility("hidden"))); -#define g_key_file_set_value IA__g_key_file_set_value - -extern __typeof (g_key_file_to_data) IA__g_key_file_to_data __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_key_file_to_data IA__g_key_file_to_data - -#endif -#endif -#if IN_HEADER(__G_LIST_H__) -#if IN_FILE(__G_LIST_C__) -extern __typeof (g_list_alloc) IA__g_list_alloc __attribute((visibility("hidden"))); -#define g_list_alloc IA__g_list_alloc - -extern __typeof (g_list_append) IA__g_list_append __attribute((visibility("hidden"))); -#define g_list_append IA__g_list_append - -extern __typeof (g_list_concat) IA__g_list_concat __attribute((visibility("hidden"))); -#define g_list_concat IA__g_list_concat - -extern __typeof (g_list_copy) IA__g_list_copy __attribute((visibility("hidden"))); -#define g_list_copy IA__g_list_copy - -extern __typeof (g_list_delete_link) IA__g_list_delete_link __attribute((visibility("hidden"))); -#define g_list_delete_link IA__g_list_delete_link - -extern __typeof (g_list_find) IA__g_list_find __attribute((visibility("hidden"))); -#define g_list_find IA__g_list_find - -extern __typeof (g_list_find_custom) IA__g_list_find_custom __attribute((visibility("hidden"))); -#define g_list_find_custom IA__g_list_find_custom - -extern __typeof (g_list_first) IA__g_list_first __attribute((visibility("hidden"))); -#define g_list_first IA__g_list_first - -extern __typeof (g_list_foreach) IA__g_list_foreach __attribute((visibility("hidden"))); -#define g_list_foreach IA__g_list_foreach - -extern __typeof (g_list_free) IA__g_list_free __attribute((visibility("hidden"))); -#define g_list_free IA__g_list_free - -extern __typeof (g_list_free_1) IA__g_list_free_1 __attribute((visibility("hidden"))); -#define g_list_free_1 IA__g_list_free_1 - -extern __typeof (g_list_index) IA__g_list_index __attribute((visibility("hidden"))); -#define g_list_index IA__g_list_index - -extern __typeof (g_list_insert) IA__g_list_insert __attribute((visibility("hidden"))); -#define g_list_insert IA__g_list_insert - -extern __typeof (g_list_insert_before) IA__g_list_insert_before __attribute((visibility("hidden"))); -#define g_list_insert_before IA__g_list_insert_before - -extern __typeof (g_list_insert_sorted) IA__g_list_insert_sorted __attribute((visibility("hidden"))); -#define g_list_insert_sorted IA__g_list_insert_sorted - -extern __typeof (g_list_insert_sorted_with_data) IA__g_list_insert_sorted_with_data __attribute((visibility("hidden"))); -#define g_list_insert_sorted_with_data IA__g_list_insert_sorted_with_data - -extern __typeof (g_list_last) IA__g_list_last __attribute((visibility("hidden"))); -#define g_list_last IA__g_list_last - -extern __typeof (g_list_length) IA__g_list_length __attribute((visibility("hidden"))); -#define g_list_length IA__g_list_length - -extern __typeof (g_list_nth) IA__g_list_nth __attribute((visibility("hidden"))); -#define g_list_nth IA__g_list_nth - -extern __typeof (g_list_nth_data) IA__g_list_nth_data __attribute((visibility("hidden"))); -#define g_list_nth_data IA__g_list_nth_data - -extern __typeof (g_list_nth_prev) IA__g_list_nth_prev __attribute((visibility("hidden"))); -#define g_list_nth_prev IA__g_list_nth_prev - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_list_pop_allocator) IA__g_list_pop_allocator __attribute((visibility("hidden"))); -#define g_list_pop_allocator IA__g_list_pop_allocator - -#endif -extern __typeof (g_list_position) IA__g_list_position __attribute((visibility("hidden"))); -#define g_list_position IA__g_list_position - -extern __typeof (g_list_prepend) IA__g_list_prepend __attribute((visibility("hidden"))); -#define g_list_prepend IA__g_list_prepend - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_list_push_allocator) IA__g_list_push_allocator __attribute((visibility("hidden"))); -#define g_list_push_allocator IA__g_list_push_allocator - -#endif -extern __typeof (g_list_remove) IA__g_list_remove __attribute((visibility("hidden"))); -#define g_list_remove IA__g_list_remove - -extern __typeof (g_list_remove_all) IA__g_list_remove_all __attribute((visibility("hidden"))); -#define g_list_remove_all IA__g_list_remove_all - -extern __typeof (g_list_remove_link) IA__g_list_remove_link __attribute((visibility("hidden"))); -#define g_list_remove_link IA__g_list_remove_link - -extern __typeof (g_list_reverse) IA__g_list_reverse __attribute((visibility("hidden"))); -#define g_list_reverse IA__g_list_reverse - -extern __typeof (g_list_sort) IA__g_list_sort __attribute((visibility("hidden"))); -#define g_list_sort IA__g_list_sort - -extern __typeof (g_list_sort_with_data) IA__g_list_sort_with_data __attribute((visibility("hidden"))); -#define g_list_sort_with_data IA__g_list_sort_with_data - -#endif -#endif -#if IN_HEADER(__G_MAIN_H__) -#if IN_FILE(__G_MAIN_C__) -extern __typeof (g_child_watch_add) IA__g_child_watch_add __attribute((visibility("hidden"))); -#define g_child_watch_add IA__g_child_watch_add - -extern __typeof (g_child_watch_add_full) IA__g_child_watch_add_full __attribute((visibility("hidden"))); -#define g_child_watch_add_full IA__g_child_watch_add_full - -extern __typeof (g_child_watch_source_new) IA__g_child_watch_source_new __attribute((visibility("hidden"))); -#define g_child_watch_source_new IA__g_child_watch_source_new - -extern __typeof (g_get_current_time) IA__g_get_current_time __attribute((visibility("hidden"))); -#define g_get_current_time IA__g_get_current_time - -extern __typeof (g_main_context_acquire) IA__g_main_context_acquire __attribute((visibility("hidden"))); -#define g_main_context_acquire IA__g_main_context_acquire - -extern __typeof (g_main_context_add_poll) IA__g_main_context_add_poll __attribute((visibility("hidden"))); -#define g_main_context_add_poll IA__g_main_context_add_poll - -extern __typeof (g_main_context_check) IA__g_main_context_check __attribute((visibility("hidden"))); -#define g_main_context_check IA__g_main_context_check - -extern __typeof (g_main_context_default) IA__g_main_context_default __attribute((visibility("hidden"))); -#define g_main_context_default IA__g_main_context_default - -extern __typeof (g_main_context_dispatch) IA__g_main_context_dispatch __attribute((visibility("hidden"))); -#define g_main_context_dispatch IA__g_main_context_dispatch - -extern __typeof (g_main_context_find_source_by_funcs_user_data) IA__g_main_context_find_source_by_funcs_user_data __attribute((visibility("hidden"))); -#define g_main_context_find_source_by_funcs_user_data IA__g_main_context_find_source_by_funcs_user_data - -extern __typeof (g_main_context_find_source_by_id) IA__g_main_context_find_source_by_id __attribute((visibility("hidden"))); -#define g_main_context_find_source_by_id IA__g_main_context_find_source_by_id - -extern __typeof (g_main_context_find_source_by_user_data) IA__g_main_context_find_source_by_user_data __attribute((visibility("hidden"))); -#define g_main_context_find_source_by_user_data IA__g_main_context_find_source_by_user_data - -extern __typeof (g_main_context_get_poll_func) IA__g_main_context_get_poll_func __attribute((visibility("hidden"))); -#define g_main_context_get_poll_func IA__g_main_context_get_poll_func - -extern __typeof (g_main_context_get_thread_default) IA__g_main_context_get_thread_default __attribute((visibility("hidden"))); -#define g_main_context_get_thread_default IA__g_main_context_get_thread_default - -extern __typeof (g_main_context_is_owner) IA__g_main_context_is_owner __attribute((visibility("hidden"))); -#define g_main_context_is_owner IA__g_main_context_is_owner - -extern __typeof (g_main_context_iteration) IA__g_main_context_iteration __attribute((visibility("hidden"))); -#define g_main_context_iteration IA__g_main_context_iteration - -extern __typeof (g_main_context_new) IA__g_main_context_new __attribute((visibility("hidden"))); -#define g_main_context_new IA__g_main_context_new - -extern __typeof (g_main_context_pending) IA__g_main_context_pending __attribute((visibility("hidden"))); -#define g_main_context_pending IA__g_main_context_pending - -extern __typeof (g_main_context_pop_thread_default) IA__g_main_context_pop_thread_default __attribute((visibility("hidden"))); -#define g_main_context_pop_thread_default IA__g_main_context_pop_thread_default - -extern __typeof (g_main_context_prepare) IA__g_main_context_prepare __attribute((visibility("hidden"))); -#define g_main_context_prepare IA__g_main_context_prepare - -extern __typeof (g_main_context_push_thread_default) IA__g_main_context_push_thread_default __attribute((visibility("hidden"))); -#define g_main_context_push_thread_default IA__g_main_context_push_thread_default - -extern __typeof (g_main_context_query) IA__g_main_context_query __attribute((visibility("hidden"))); -#define g_main_context_query IA__g_main_context_query - -extern __typeof (g_main_context_ref) IA__g_main_context_ref __attribute((visibility("hidden"))); -#define g_main_context_ref IA__g_main_context_ref - -extern __typeof (g_main_context_release) IA__g_main_context_release __attribute((visibility("hidden"))); -#define g_main_context_release IA__g_main_context_release - -extern __typeof (g_main_context_remove_poll) IA__g_main_context_remove_poll __attribute((visibility("hidden"))); -#define g_main_context_remove_poll IA__g_main_context_remove_poll - -extern __typeof (g_main_context_set_poll_func) IA__g_main_context_set_poll_func __attribute((visibility("hidden"))); -#define g_main_context_set_poll_func IA__g_main_context_set_poll_func - -extern __typeof (g_main_context_unref) IA__g_main_context_unref __attribute((visibility("hidden"))); -#define g_main_context_unref IA__g_main_context_unref - -extern __typeof (g_main_context_wait) IA__g_main_context_wait __attribute((visibility("hidden"))); -#define g_main_context_wait IA__g_main_context_wait - -extern __typeof (g_main_context_wakeup) IA__g_main_context_wakeup __attribute((visibility("hidden"))); -#define g_main_context_wakeup IA__g_main_context_wakeup - -extern __typeof (g_main_depth) IA__g_main_depth __attribute((visibility("hidden"))); -#define g_main_depth IA__g_main_depth - -extern __typeof (g_main_current_source) IA__g_main_current_source __attribute((visibility("hidden"))); -#define g_main_current_source IA__g_main_current_source - -extern __typeof (g_main_loop_get_context) IA__g_main_loop_get_context __attribute((visibility("hidden"))); -#define g_main_loop_get_context IA__g_main_loop_get_context - -extern __typeof (g_main_loop_is_running) IA__g_main_loop_is_running __attribute((visibility("hidden"))); -#define g_main_loop_is_running IA__g_main_loop_is_running - -extern __typeof (g_main_loop_new) IA__g_main_loop_new __attribute((visibility("hidden"))); -#define g_main_loop_new IA__g_main_loop_new - -extern __typeof (g_main_loop_quit) IA__g_main_loop_quit __attribute((visibility("hidden"))); -#define g_main_loop_quit IA__g_main_loop_quit - -extern __typeof (g_main_loop_ref) IA__g_main_loop_ref __attribute((visibility("hidden"))); -#define g_main_loop_ref IA__g_main_loop_ref - -extern __typeof (g_main_loop_run) IA__g_main_loop_run __attribute((visibility("hidden"))); -#define g_main_loop_run IA__g_main_loop_run - -extern __typeof (g_main_loop_unref) IA__g_main_loop_unref __attribute((visibility("hidden"))); -#define g_main_loop_unref IA__g_main_loop_unref - -extern __typeof (g_source_add_poll) IA__g_source_add_poll __attribute((visibility("hidden"))); -#define g_source_add_poll IA__g_source_add_poll - -extern __typeof (g_source_attach) IA__g_source_attach __attribute((visibility("hidden"))); -#define g_source_attach IA__g_source_attach - -extern __typeof (g_source_destroy) IA__g_source_destroy __attribute((visibility("hidden"))); -#define g_source_destroy IA__g_source_destroy - -extern __typeof (g_source_get_can_recurse) IA__g_source_get_can_recurse __attribute((visibility("hidden"))); -#define g_source_get_can_recurse IA__g_source_get_can_recurse - -extern __typeof (g_source_get_context) IA__g_source_get_context __attribute((visibility("hidden"))); -#define g_source_get_context IA__g_source_get_context - -extern __typeof (g_source_get_current_time) IA__g_source_get_current_time __attribute((visibility("hidden"))); -#define g_source_get_current_time IA__g_source_get_current_time - -extern __typeof (g_source_get_id) IA__g_source_get_id __attribute((visibility("hidden"))); -#define g_source_get_id IA__g_source_get_id - -extern __typeof (g_source_get_priority) IA__g_source_get_priority __attribute((visibility("hidden"))); -#define g_source_get_priority IA__g_source_get_priority - -extern __typeof (g_source_new) IA__g_source_new __attribute((visibility("hidden"))); -#define g_source_new IA__g_source_new - -extern __typeof (g_source_ref) IA__g_source_ref __attribute((visibility("hidden"))); -#define g_source_ref IA__g_source_ref - -extern __typeof (g_source_remove) IA__g_source_remove __attribute((visibility("hidden"))); -#define g_source_remove IA__g_source_remove - -extern __typeof (g_source_remove_by_funcs_user_data) IA__g_source_remove_by_funcs_user_data __attribute((visibility("hidden"))); -#define g_source_remove_by_funcs_user_data IA__g_source_remove_by_funcs_user_data - -extern __typeof (g_source_remove_by_user_data) IA__g_source_remove_by_user_data __attribute((visibility("hidden"))); -#define g_source_remove_by_user_data IA__g_source_remove_by_user_data - -extern __typeof (g_source_remove_poll) IA__g_source_remove_poll __attribute((visibility("hidden"))); -#define g_source_remove_poll IA__g_source_remove_poll - -extern __typeof (g_source_set_callback) IA__g_source_set_callback __attribute((visibility("hidden"))); -#define g_source_set_callback IA__g_source_set_callback - -extern __typeof (g_source_set_callback_indirect) IA__g_source_set_callback_indirect __attribute((visibility("hidden"))); -#define g_source_set_callback_indirect IA__g_source_set_callback_indirect - -extern __typeof (g_source_set_can_recurse) IA__g_source_set_can_recurse __attribute((visibility("hidden"))); -#define g_source_set_can_recurse IA__g_source_set_can_recurse - -extern __typeof (g_source_set_funcs) IA__g_source_set_funcs __attribute((visibility("hidden"))); -#define g_source_set_funcs IA__g_source_set_funcs - -extern __typeof (g_source_is_destroyed) IA__g_source_is_destroyed __attribute((visibility("hidden"))); -#define g_source_is_destroyed IA__g_source_is_destroyed - -extern __typeof (g_source_set_priority) IA__g_source_set_priority __attribute((visibility("hidden"))); -#define g_source_set_priority IA__g_source_set_priority - -extern __typeof (g_source_unref) IA__g_source_unref __attribute((visibility("hidden"))); -#define g_source_unref IA__g_source_unref - -extern __typeof (g_idle_add) IA__g_idle_add __attribute((visibility("hidden"))); -#define g_idle_add IA__g_idle_add - -extern __typeof (g_idle_add_full) IA__g_idle_add_full __attribute((visibility("hidden"))); -#define g_idle_add_full IA__g_idle_add_full - -extern __typeof (g_idle_remove_by_data) IA__g_idle_remove_by_data __attribute((visibility("hidden"))); -#define g_idle_remove_by_data IA__g_idle_remove_by_data - -extern __typeof (g_idle_source_new) IA__g_idle_source_new __attribute((visibility("hidden"))); -#define g_idle_source_new IA__g_idle_source_new - -extern __typeof (g_timeout_add) IA__g_timeout_add __attribute((visibility("hidden"))); -#define g_timeout_add IA__g_timeout_add - -extern __typeof (g_timeout_add_seconds) IA__g_timeout_add_seconds __attribute((visibility("hidden"))); -#define g_timeout_add_seconds IA__g_timeout_add_seconds - -extern __typeof (g_timeout_add_full) IA__g_timeout_add_full __attribute((visibility("hidden"))); -#define g_timeout_add_full IA__g_timeout_add_full - -extern __typeof (g_timeout_add_seconds_full) IA__g_timeout_add_seconds_full __attribute((visibility("hidden"))); -#define g_timeout_add_seconds_full IA__g_timeout_add_seconds_full - -extern __typeof (g_timeout_source_new) IA__g_timeout_source_new __attribute((visibility("hidden"))); -#define g_timeout_source_new IA__g_timeout_source_new - -extern __typeof (g_timeout_source_new_seconds) IA__g_timeout_source_new_seconds __attribute((visibility("hidden"))); -#define g_timeout_source_new_seconds IA__g_timeout_source_new_seconds - -#endif -#endif -#if IN_HEADER(__G_MAPPED_FILE_H__) -#if IN_FILE(__G_MAPPED_FILE_C__) -extern __typeof (g_mapped_file_new) IA__g_mapped_file_new __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_mapped_file_new IA__g_mapped_file_new - -extern __typeof (g_mapped_file_get_length) IA__g_mapped_file_get_length __attribute((visibility("hidden"))); -#define g_mapped_file_get_length IA__g_mapped_file_get_length - -extern __typeof (g_mapped_file_get_contents) IA__g_mapped_file_get_contents __attribute((visibility("hidden"))); -#define g_mapped_file_get_contents IA__g_mapped_file_get_contents - -extern __typeof (g_mapped_file_ref) IA__g_mapped_file_ref __attribute((visibility("hidden"))); -#define g_mapped_file_ref IA__g_mapped_file_ref - -extern __typeof (g_mapped_file_unref) IA__g_mapped_file_unref __attribute((visibility("hidden"))); -#define g_mapped_file_unref IA__g_mapped_file_unref - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_mapped_file_free) IA__g_mapped_file_free __attribute((visibility("hidden"))); -#define g_mapped_file_free IA__g_mapped_file_free - -#endif -#endif -#endif -#if IN_HEADER(__G_MARKUP_H__) -#if IN_FILE(__G_MARKUP_C__) -extern __typeof (g_markup_error_quark) IA__g_markup_error_quark __attribute((visibility("hidden"))); -#define g_markup_error_quark IA__g_markup_error_quark - -extern __typeof (g_markup_escape_text) IA__g_markup_escape_text __attribute((visibility("hidden"))); -#define g_markup_escape_text IA__g_markup_escape_text - -extern __typeof (g_markup_parse_context_end_parse) IA__g_markup_parse_context_end_parse __attribute((visibility("hidden"))); -#define g_markup_parse_context_end_parse IA__g_markup_parse_context_end_parse - -extern __typeof (g_markup_parse_context_free) IA__g_markup_parse_context_free __attribute((visibility("hidden"))); -#define g_markup_parse_context_free IA__g_markup_parse_context_free - -extern __typeof (g_markup_parse_context_get_element) IA__g_markup_parse_context_get_element __attribute((visibility("hidden"))); -#define g_markup_parse_context_get_element IA__g_markup_parse_context_get_element - -extern __typeof (g_markup_parse_context_get_element_stack) IA__g_markup_parse_context_get_element_stack __attribute((visibility("hidden"))); -#define g_markup_parse_context_get_element_stack IA__g_markup_parse_context_get_element_stack - -extern __typeof (g_markup_parse_context_get_position) IA__g_markup_parse_context_get_position __attribute((visibility("hidden"))); -#define g_markup_parse_context_get_position IA__g_markup_parse_context_get_position - -extern __typeof (g_markup_parse_context_get_user_data) IA__g_markup_parse_context_get_user_data __attribute((visibility("hidden"))); -#define g_markup_parse_context_get_user_data IA__g_markup_parse_context_get_user_data - -extern __typeof (g_markup_parse_context_new) IA__g_markup_parse_context_new __attribute((visibility("hidden"))); -#define g_markup_parse_context_new IA__g_markup_parse_context_new - -extern __typeof (g_markup_parse_context_parse) IA__g_markup_parse_context_parse __attribute((visibility("hidden"))); -#define g_markup_parse_context_parse IA__g_markup_parse_context_parse - -extern __typeof (g_markup_parse_context_push) IA__g_markup_parse_context_push __attribute((visibility("hidden"))); -#define g_markup_parse_context_push IA__g_markup_parse_context_push - -extern __typeof (g_markup_parse_context_pop) IA__g_markup_parse_context_pop __attribute((visibility("hidden"))); -#define g_markup_parse_context_pop IA__g_markup_parse_context_pop - -extern __typeof (g_markup_printf_escaped) IA__g_markup_printf_escaped __attribute((visibility("hidden"))) G_GNUC_PRINTF(1,2); -#define g_markup_printf_escaped IA__g_markup_printf_escaped - -extern __typeof (g_markup_vprintf_escaped) IA__g_markup_vprintf_escaped __attribute((visibility("hidden"))); -#define g_markup_vprintf_escaped IA__g_markup_vprintf_escaped - -extern __typeof (g_markup_collect_attributes) IA__g_markup_collect_attributes __attribute((visibility("hidden"))); -#define g_markup_collect_attributes IA__g_markup_collect_attributes - -#endif -#endif -#if IN_HEADER(__G_MEM_H__) -#if IN_FILE(__G_MEM_C__) -extern __typeof (g_free) IA__g_free __attribute((visibility("hidden"))); -#define g_free IA__g_free - -extern __typeof (g_malloc) IA__g_malloc __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_malloc IA__g_malloc - -extern __typeof (g_malloc0) IA__g_malloc0 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_malloc0 IA__g_malloc0 - -extern __typeof (g_malloc_n) IA__g_malloc_n __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_malloc_n IA__g_malloc_n - -extern __typeof (g_malloc0_n) IA__g_malloc0_n __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_malloc0_n IA__g_malloc0_n - -extern __typeof (g_mem_is_system_malloc) IA__g_mem_is_system_malloc __attribute((visibility("hidden"))); -#define g_mem_is_system_malloc IA__g_mem_is_system_malloc - -extern __typeof (g_mem_profile) IA__g_mem_profile __attribute((visibility("hidden"))); -#define g_mem_profile IA__g_mem_profile - -extern __typeof (g_mem_set_vtable) IA__g_mem_set_vtable __attribute((visibility("hidden"))); -#define g_mem_set_vtable IA__g_mem_set_vtable - -extern __typeof (g_realloc) IA__g_realloc __attribute((visibility("hidden"))); -#define g_realloc IA__g_realloc - -extern __typeof (g_realloc_n) IA__g_realloc_n __attribute((visibility("hidden"))); -#define g_realloc_n IA__g_realloc_n - -extern __typeof (g_try_malloc) IA__g_try_malloc __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_try_malloc IA__g_try_malloc - -extern __typeof (g_try_malloc0) IA__g_try_malloc0 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_try_malloc0 IA__g_try_malloc0 - -extern __typeof (g_try_malloc_n) IA__g_try_malloc_n __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_try_malloc_n IA__g_try_malloc_n - -extern __typeof (g_try_malloc0_n) IA__g_try_malloc0_n __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_try_malloc0_n IA__g_try_malloc0_n - -extern __typeof (g_try_realloc) IA__g_try_realloc __attribute((visibility("hidden"))); -#define g_try_realloc IA__g_try_realloc - -extern __typeof (g_try_realloc_n) IA__g_try_realloc_n __attribute((visibility("hidden"))); -#define g_try_realloc_n IA__g_try_realloc_n - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_allocator_free) IA__g_allocator_free __attribute((visibility("hidden"))); -#define g_allocator_free IA__g_allocator_free - -extern __typeof (g_allocator_new) IA__g_allocator_new __attribute((visibility("hidden"))); -#define g_allocator_new IA__g_allocator_new - -extern __typeof (g_mem_chunk_alloc) IA__g_mem_chunk_alloc __attribute((visibility("hidden"))); -#define g_mem_chunk_alloc IA__g_mem_chunk_alloc - -extern __typeof (g_mem_chunk_alloc0) IA__g_mem_chunk_alloc0 __attribute((visibility("hidden"))); -#define g_mem_chunk_alloc0 IA__g_mem_chunk_alloc0 - -extern __typeof (g_mem_chunk_clean) IA__g_mem_chunk_clean __attribute((visibility("hidden"))); -#define g_mem_chunk_clean IA__g_mem_chunk_clean - -extern __typeof (g_mem_chunk_destroy) IA__g_mem_chunk_destroy __attribute((visibility("hidden"))); -#define g_mem_chunk_destroy IA__g_mem_chunk_destroy - -extern __typeof (g_mem_chunk_free) IA__g_mem_chunk_free __attribute((visibility("hidden"))); -#define g_mem_chunk_free IA__g_mem_chunk_free - -extern __typeof (g_mem_chunk_info) IA__g_mem_chunk_info __attribute((visibility("hidden"))); -#define g_mem_chunk_info IA__g_mem_chunk_info - -extern __typeof (g_mem_chunk_new) IA__g_mem_chunk_new __attribute((visibility("hidden"))); -#define g_mem_chunk_new IA__g_mem_chunk_new - -extern __typeof (g_mem_chunk_print) IA__g_mem_chunk_print __attribute((visibility("hidden"))); -#define g_mem_chunk_print IA__g_mem_chunk_print - -extern __typeof (g_mem_chunk_reset) IA__g_mem_chunk_reset __attribute((visibility("hidden"))); -#define g_mem_chunk_reset IA__g_mem_chunk_reset - -extern __typeof (g_blow_chunks) IA__g_blow_chunks __attribute((visibility("hidden"))); -#define g_blow_chunks IA__g_blow_chunks - -#endif -#endif -#endif -#if IN_HEADER(__G_SLICE_H__) -#if IN_FILE(__G_SLICE_C__) -extern __typeof (g_slice_alloc) IA__g_slice_alloc __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_slice_alloc IA__g_slice_alloc - -extern __typeof (g_slice_alloc0) IA__g_slice_alloc0 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_slice_alloc0 IA__g_slice_alloc0 - -extern __typeof (g_slice_copy) IA__g_slice_copy __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_slice_copy IA__g_slice_copy - -extern __typeof (g_slice_free1) IA__g_slice_free1 __attribute((visibility("hidden"))); -#define g_slice_free1 IA__g_slice_free1 - -extern __typeof (g_slice_free_chain_with_offset) IA__g_slice_free_chain_with_offset __attribute((visibility("hidden"))); -#define g_slice_free_chain_with_offset IA__g_slice_free_chain_with_offset - -extern __typeof (g_slice_set_config) IA__g_slice_set_config __attribute((visibility("hidden"))); -#define g_slice_set_config IA__g_slice_set_config - -extern __typeof (g_slice_get_config) IA__g_slice_get_config __attribute((visibility("hidden"))); -#define g_slice_get_config IA__g_slice_get_config - -extern __typeof (g_slice_get_config_state) IA__g_slice_get_config_state __attribute((visibility("hidden"))); -#define g_slice_get_config_state IA__g_slice_get_config_state - -#ifdef G_ENABLE_DEBUG -#endif -#endif -#endif -#if IN_HEADER(__G_MESSAGES_H__) -#if IN_FILE(__G_MESSAGES_C__) -extern __typeof (g_printf_string_upper_bound) IA__g_printf_string_upper_bound __attribute((visibility("hidden"))); -#define g_printf_string_upper_bound IA__g_printf_string_upper_bound - -extern __typeof (g_log) IA__g_log __attribute((visibility("hidden"))) G_GNUC_PRINTF(3,4); -#define g_log IA__g_log - -extern __typeof (g_log_default_handler) IA__g_log_default_handler __attribute((visibility("hidden"))); -#define g_log_default_handler IA__g_log_default_handler - -extern __typeof (g_log_remove_handler) IA__g_log_remove_handler __attribute((visibility("hidden"))); -#define g_log_remove_handler IA__g_log_remove_handler - -extern __typeof (g_log_set_always_fatal) IA__g_log_set_always_fatal __attribute((visibility("hidden"))); -#define g_log_set_always_fatal IA__g_log_set_always_fatal - -extern __typeof (g_log_set_default_handler) IA__g_log_set_default_handler __attribute((visibility("hidden"))); -#define g_log_set_default_handler IA__g_log_set_default_handler - -extern __typeof (g_log_set_fatal_mask) IA__g_log_set_fatal_mask __attribute((visibility("hidden"))); -#define g_log_set_fatal_mask IA__g_log_set_fatal_mask - -extern __typeof (g_log_set_handler) IA__g_log_set_handler __attribute((visibility("hidden"))); -#define g_log_set_handler IA__g_log_set_handler - -extern __typeof (g_logv) IA__g_logv __attribute((visibility("hidden"))); -#define g_logv IA__g_logv - -extern __typeof (g_return_if_fail_warning) IA__g_return_if_fail_warning __attribute((visibility("hidden"))); -#define g_return_if_fail_warning IA__g_return_if_fail_warning - -extern __typeof (g_warn_message) IA__g_warn_message __attribute((visibility("hidden"))); -#define g_warn_message IA__g_warn_message - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_assert_warning) IA__g_assert_warning __attribute((visibility("hidden"))) G_GNUC_NORETURN; -#define g_assert_warning IA__g_assert_warning - -#endif -extern __typeof (g_print) IA__g_print __attribute((visibility("hidden"))) G_GNUC_PRINTF(1,2); -#define g_print IA__g_print - -extern __typeof (g_printerr) IA__g_printerr __attribute((visibility("hidden"))) G_GNUC_PRINTF(1,2); -#define g_printerr IA__g_printerr - -extern __typeof (g_set_printerr_handler) IA__g_set_printerr_handler __attribute((visibility("hidden"))); -#define g_set_printerr_handler IA__g_set_printerr_handler - -extern __typeof (g_set_print_handler) IA__g_set_print_handler __attribute((visibility("hidden"))); -#define g_set_print_handler IA__g_set_print_handler - -#endif -#endif -#if IN_HEADER(__G_NODE_H__) -#if IN_FILE(__G_NODE_C__) -extern __typeof (g_node_child_index) IA__g_node_child_index __attribute((visibility("hidden"))); -#define g_node_child_index IA__g_node_child_index - -extern __typeof (g_node_child_position) IA__g_node_child_position __attribute((visibility("hidden"))); -#define g_node_child_position IA__g_node_child_position - -extern __typeof (g_node_children_foreach) IA__g_node_children_foreach __attribute((visibility("hidden"))); -#define g_node_children_foreach IA__g_node_children_foreach - -extern __typeof (g_node_copy) IA__g_node_copy __attribute((visibility("hidden"))); -#define g_node_copy IA__g_node_copy - -extern __typeof (g_node_copy_deep) IA__g_node_copy_deep __attribute((visibility("hidden"))); -#define g_node_copy_deep IA__g_node_copy_deep - -extern __typeof (g_node_depth) IA__g_node_depth __attribute((visibility("hidden"))); -#define g_node_depth IA__g_node_depth - -extern __typeof (g_node_destroy) IA__g_node_destroy __attribute((visibility("hidden"))); -#define g_node_destroy IA__g_node_destroy - -extern __typeof (g_node_find) IA__g_node_find __attribute((visibility("hidden"))); -#define g_node_find IA__g_node_find - -extern __typeof (g_node_find_child) IA__g_node_find_child __attribute((visibility("hidden"))); -#define g_node_find_child IA__g_node_find_child - -extern __typeof (g_node_first_sibling) IA__g_node_first_sibling __attribute((visibility("hidden"))); -#define g_node_first_sibling IA__g_node_first_sibling - -extern __typeof (g_node_get_root) IA__g_node_get_root __attribute((visibility("hidden"))); -#define g_node_get_root IA__g_node_get_root - -extern __typeof (g_node_insert) IA__g_node_insert __attribute((visibility("hidden"))); -#define g_node_insert IA__g_node_insert - -extern __typeof (g_node_insert_after) IA__g_node_insert_after __attribute((visibility("hidden"))); -#define g_node_insert_after IA__g_node_insert_after - -extern __typeof (g_node_insert_before) IA__g_node_insert_before __attribute((visibility("hidden"))); -#define g_node_insert_before IA__g_node_insert_before - -extern __typeof (g_node_is_ancestor) IA__g_node_is_ancestor __attribute((visibility("hidden"))); -#define g_node_is_ancestor IA__g_node_is_ancestor - -extern __typeof (g_node_last_child) IA__g_node_last_child __attribute((visibility("hidden"))); -#define g_node_last_child IA__g_node_last_child - -extern __typeof (g_node_last_sibling) IA__g_node_last_sibling __attribute((visibility("hidden"))); -#define g_node_last_sibling IA__g_node_last_sibling - -extern __typeof (g_node_max_height) IA__g_node_max_height __attribute((visibility("hidden"))); -#define g_node_max_height IA__g_node_max_height - -extern __typeof (g_node_n_children) IA__g_node_n_children __attribute((visibility("hidden"))); -#define g_node_n_children IA__g_node_n_children - -extern __typeof (g_node_new) IA__g_node_new __attribute((visibility("hidden"))); -#define g_node_new IA__g_node_new - -extern __typeof (g_node_n_nodes) IA__g_node_n_nodes __attribute((visibility("hidden"))); -#define g_node_n_nodes IA__g_node_n_nodes - -extern __typeof (g_node_nth_child) IA__g_node_nth_child __attribute((visibility("hidden"))); -#define g_node_nth_child IA__g_node_nth_child - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_node_pop_allocator) IA__g_node_pop_allocator __attribute((visibility("hidden"))); -#define g_node_pop_allocator IA__g_node_pop_allocator - -#endif -extern __typeof (g_node_prepend) IA__g_node_prepend __attribute((visibility("hidden"))); -#define g_node_prepend IA__g_node_prepend - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_node_push_allocator) IA__g_node_push_allocator __attribute((visibility("hidden"))); -#define g_node_push_allocator IA__g_node_push_allocator - -#endif -extern __typeof (g_node_reverse_children) IA__g_node_reverse_children __attribute((visibility("hidden"))); -#define g_node_reverse_children IA__g_node_reverse_children - -extern __typeof (g_node_traverse) IA__g_node_traverse __attribute((visibility("hidden"))); -#define g_node_traverse IA__g_node_traverse - -extern __typeof (g_node_unlink) IA__g_node_unlink __attribute((visibility("hidden"))); -#define g_node_unlink IA__g_node_unlink - -#endif -#endif -#if IN_HEADER(__G_OPTION_H__) -#if IN_FILE(__G_OPTION_C__) -extern __typeof (g_option_context_add_group) IA__g_option_context_add_group __attribute((visibility("hidden"))); -#define g_option_context_add_group IA__g_option_context_add_group - -extern __typeof (g_option_context_add_main_entries) IA__g_option_context_add_main_entries __attribute((visibility("hidden"))); -#define g_option_context_add_main_entries IA__g_option_context_add_main_entries - -extern __typeof (g_option_error_quark) IA__g_option_error_quark __attribute((visibility("hidden"))); -#define g_option_error_quark IA__g_option_error_quark - -extern __typeof (g_option_context_free) IA__g_option_context_free __attribute((visibility("hidden"))); -#define g_option_context_free IA__g_option_context_free - -extern __typeof (g_option_context_get_description) IA__g_option_context_get_description __attribute((visibility("hidden"))); -#define g_option_context_get_description IA__g_option_context_get_description - -extern __typeof (g_option_context_get_help_enabled) IA__g_option_context_get_help_enabled __attribute((visibility("hidden"))); -#define g_option_context_get_help_enabled IA__g_option_context_get_help_enabled - -extern __typeof (g_option_context_get_ignore_unknown_options) IA__g_option_context_get_ignore_unknown_options __attribute((visibility("hidden"))); -#define g_option_context_get_ignore_unknown_options IA__g_option_context_get_ignore_unknown_options - -extern __typeof (g_option_context_get_main_group) IA__g_option_context_get_main_group __attribute((visibility("hidden"))); -#define g_option_context_get_main_group IA__g_option_context_get_main_group - -extern __typeof (g_option_context_get_summary) IA__g_option_context_get_summary __attribute((visibility("hidden"))); -#define g_option_context_get_summary IA__g_option_context_get_summary - -extern __typeof (g_option_context_new) IA__g_option_context_new __attribute((visibility("hidden"))); -#define g_option_context_new IA__g_option_context_new - -extern __typeof (g_option_context_parse) IA__g_option_context_parse __attribute((visibility("hidden"))); -#define g_option_context_parse IA__g_option_context_parse - -extern __typeof (g_option_context_set_description) IA__g_option_context_set_description __attribute((visibility("hidden"))); -#define g_option_context_set_description IA__g_option_context_set_description - -extern __typeof (g_option_context_set_help_enabled) IA__g_option_context_set_help_enabled __attribute((visibility("hidden"))); -#define g_option_context_set_help_enabled IA__g_option_context_set_help_enabled - -extern __typeof (g_option_context_set_ignore_unknown_options) IA__g_option_context_set_ignore_unknown_options __attribute((visibility("hidden"))); -#define g_option_context_set_ignore_unknown_options IA__g_option_context_set_ignore_unknown_options - -extern __typeof (g_option_context_set_main_group) IA__g_option_context_set_main_group __attribute((visibility("hidden"))); -#define g_option_context_set_main_group IA__g_option_context_set_main_group - -extern __typeof (g_option_context_set_summary) IA__g_option_context_set_summary __attribute((visibility("hidden"))); -#define g_option_context_set_summary IA__g_option_context_set_summary - -extern __typeof (g_option_context_set_translate_func) IA__g_option_context_set_translate_func __attribute((visibility("hidden"))); -#define g_option_context_set_translate_func IA__g_option_context_set_translate_func - -extern __typeof (g_option_context_set_translation_domain) IA__g_option_context_set_translation_domain __attribute((visibility("hidden"))); -#define g_option_context_set_translation_domain IA__g_option_context_set_translation_domain - -extern __typeof (g_option_context_get_help) IA__g_option_context_get_help __attribute((visibility("hidden"))); -#define g_option_context_get_help IA__g_option_context_get_help - -extern __typeof (g_option_group_add_entries) IA__g_option_group_add_entries __attribute((visibility("hidden"))); -#define g_option_group_add_entries IA__g_option_group_add_entries - -extern __typeof (g_option_group_free) IA__g_option_group_free __attribute((visibility("hidden"))); -#define g_option_group_free IA__g_option_group_free - -extern __typeof (g_option_group_new) IA__g_option_group_new __attribute((visibility("hidden"))); -#define g_option_group_new IA__g_option_group_new - -extern __typeof (g_option_group_set_error_hook) IA__g_option_group_set_error_hook __attribute((visibility("hidden"))); -#define g_option_group_set_error_hook IA__g_option_group_set_error_hook - -extern __typeof (g_option_group_set_parse_hooks) IA__g_option_group_set_parse_hooks __attribute((visibility("hidden"))); -#define g_option_group_set_parse_hooks IA__g_option_group_set_parse_hooks - -extern __typeof (g_option_group_set_translate_func) IA__g_option_group_set_translate_func __attribute((visibility("hidden"))); -#define g_option_group_set_translate_func IA__g_option_group_set_translate_func - -extern __typeof (g_option_group_set_translation_domain) IA__g_option_group_set_translation_domain __attribute((visibility("hidden"))); -#define g_option_group_set_translation_domain IA__g_option_group_set_translation_domain - -#endif -#endif -#if IN_HEADER(__G_PATTERN_H__) -#if IN_FILE(__G_PATTERN_C__) -extern __typeof (g_pattern_match) IA__g_pattern_match __attribute((visibility("hidden"))); -#define g_pattern_match IA__g_pattern_match - -extern __typeof (g_pattern_match_simple) IA__g_pattern_match_simple __attribute((visibility("hidden"))); -#define g_pattern_match_simple IA__g_pattern_match_simple - -extern __typeof (g_pattern_match_string) IA__g_pattern_match_string __attribute((visibility("hidden"))); -#define g_pattern_match_string IA__g_pattern_match_string - -extern __typeof (g_pattern_spec_equal) IA__g_pattern_spec_equal __attribute((visibility("hidden"))); -#define g_pattern_spec_equal IA__g_pattern_spec_equal - -extern __typeof (g_pattern_spec_free) IA__g_pattern_spec_free __attribute((visibility("hidden"))); -#define g_pattern_spec_free IA__g_pattern_spec_free - -extern __typeof (g_pattern_spec_new) IA__g_pattern_spec_new __attribute((visibility("hidden"))); -#define g_pattern_spec_new IA__g_pattern_spec_new - -#endif -#endif -#if IN_HEADER(__G_POLL_H__) -#if IN_FILE(__G_POLL_C__) -extern __typeof (g_poll) IA__g_poll __attribute((visibility("hidden"))); -#define g_poll IA__g_poll - -#endif -#endif -#if IN_HEADER(__G_PRIMES_H__) -#if IN_FILE(__G_PRIMES_C__) -extern __typeof (g_spaced_primes_closest) IA__g_spaced_primes_closest __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_spaced_primes_closest IA__g_spaced_primes_closest - -#endif -#endif -#if IN_HEADER(__G_PRINTF_H__) -#if IN_FILE(__G_PRINTF_C__) -extern __typeof (g_fprintf) IA__g_fprintf __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_fprintf IA__g_fprintf - -extern __typeof (g_printf) IA__g_printf __attribute((visibility("hidden"))) G_GNUC_PRINTF(1,2); -#define g_printf IA__g_printf - -extern __typeof (g_sprintf) IA__g_sprintf __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_sprintf IA__g_sprintf - -extern __typeof (g_vasprintf) IA__g_vasprintf __attribute((visibility("hidden"))); -#define g_vasprintf IA__g_vasprintf - -extern __typeof (g_vfprintf) IA__g_vfprintf __attribute((visibility("hidden"))); -#define g_vfprintf IA__g_vfprintf - -extern __typeof (g_vprintf) IA__g_vprintf __attribute((visibility("hidden"))); -#define g_vprintf IA__g_vprintf - -extern __typeof (g_vsprintf) IA__g_vsprintf __attribute((visibility("hidden"))); -#define g_vsprintf IA__g_vsprintf - -#endif -#endif -#if IN_HEADER(__G_UTILS_H__) -#if IN_FILE(__G_PRINTF_C__) -extern __typeof (g_snprintf) IA__g_snprintf __attribute((visibility("hidden"))) G_GNUC_PRINTF(3,4); -#define g_snprintf IA__g_snprintf - -extern __typeof (g_vsnprintf) IA__g_vsnprintf __attribute((visibility("hidden"))); -#define g_vsnprintf IA__g_vsnprintf - -#endif -#endif -#if IN_HEADER(__G_QSORT_H__) -#if IN_FILE(__G_QSORT_C__) -extern __typeof (g_qsort_with_data) IA__g_qsort_with_data __attribute((visibility("hidden"))); -#define g_qsort_with_data IA__g_qsort_with_data - -#endif -#endif -#if IN_HEADER(__G_QUEUE_H__) -#if IN_FILE(__G_QUEUE_C__) -extern __typeof (g_queue_clear) IA__g_queue_clear __attribute((visibility("hidden"))); -#define g_queue_clear IA__g_queue_clear - -extern __typeof (g_queue_copy) IA__g_queue_copy __attribute((visibility("hidden"))); -#define g_queue_copy IA__g_queue_copy - -extern __typeof (g_queue_delete_link) IA__g_queue_delete_link __attribute((visibility("hidden"))); -#define g_queue_delete_link IA__g_queue_delete_link - -extern __typeof (g_queue_find) IA__g_queue_find __attribute((visibility("hidden"))); -#define g_queue_find IA__g_queue_find - -extern __typeof (g_queue_find_custom) IA__g_queue_find_custom __attribute((visibility("hidden"))); -#define g_queue_find_custom IA__g_queue_find_custom - -extern __typeof (g_queue_foreach) IA__g_queue_foreach __attribute((visibility("hidden"))); -#define g_queue_foreach IA__g_queue_foreach - -extern __typeof (g_queue_free) IA__g_queue_free __attribute((visibility("hidden"))); -#define g_queue_free IA__g_queue_free - -extern __typeof (g_queue_get_length) IA__g_queue_get_length __attribute((visibility("hidden"))); -#define g_queue_get_length IA__g_queue_get_length - -extern __typeof (g_queue_index) IA__g_queue_index __attribute((visibility("hidden"))); -#define g_queue_index IA__g_queue_index - -extern __typeof (g_queue_init) IA__g_queue_init __attribute((visibility("hidden"))); -#define g_queue_init IA__g_queue_init - -extern __typeof (g_queue_insert_after) IA__g_queue_insert_after __attribute((visibility("hidden"))); -#define g_queue_insert_after IA__g_queue_insert_after - -extern __typeof (g_queue_insert_before) IA__g_queue_insert_before __attribute((visibility("hidden"))); -#define g_queue_insert_before IA__g_queue_insert_before - -extern __typeof (g_queue_insert_sorted) IA__g_queue_insert_sorted __attribute((visibility("hidden"))); -#define g_queue_insert_sorted IA__g_queue_insert_sorted - -extern __typeof (g_queue_is_empty) IA__g_queue_is_empty __attribute((visibility("hidden"))); -#define g_queue_is_empty IA__g_queue_is_empty - -extern __typeof (g_queue_link_index) IA__g_queue_link_index __attribute((visibility("hidden"))); -#define g_queue_link_index IA__g_queue_link_index - -extern __typeof (g_queue_new) IA__g_queue_new __attribute((visibility("hidden"))); -#define g_queue_new IA__g_queue_new - -extern __typeof (g_queue_peek_head) IA__g_queue_peek_head __attribute((visibility("hidden"))); -#define g_queue_peek_head IA__g_queue_peek_head - -extern __typeof (g_queue_peek_head_link) IA__g_queue_peek_head_link __attribute((visibility("hidden"))); -#define g_queue_peek_head_link IA__g_queue_peek_head_link - -extern __typeof (g_queue_peek_nth) IA__g_queue_peek_nth __attribute((visibility("hidden"))); -#define g_queue_peek_nth IA__g_queue_peek_nth - -extern __typeof (g_queue_peek_nth_link) IA__g_queue_peek_nth_link __attribute((visibility("hidden"))); -#define g_queue_peek_nth_link IA__g_queue_peek_nth_link - -extern __typeof (g_queue_peek_tail) IA__g_queue_peek_tail __attribute((visibility("hidden"))); -#define g_queue_peek_tail IA__g_queue_peek_tail - -extern __typeof (g_queue_peek_tail_link) IA__g_queue_peek_tail_link __attribute((visibility("hidden"))); -#define g_queue_peek_tail_link IA__g_queue_peek_tail_link - -extern __typeof (g_queue_pop_head) IA__g_queue_pop_head __attribute((visibility("hidden"))); -#define g_queue_pop_head IA__g_queue_pop_head - -extern __typeof (g_queue_pop_head_link) IA__g_queue_pop_head_link __attribute((visibility("hidden"))); -#define g_queue_pop_head_link IA__g_queue_pop_head_link - -extern __typeof (g_queue_pop_nth) IA__g_queue_pop_nth __attribute((visibility("hidden"))); -#define g_queue_pop_nth IA__g_queue_pop_nth - -extern __typeof (g_queue_pop_nth_link) IA__g_queue_pop_nth_link __attribute((visibility("hidden"))); -#define g_queue_pop_nth_link IA__g_queue_pop_nth_link - -extern __typeof (g_queue_pop_tail) IA__g_queue_pop_tail __attribute((visibility("hidden"))); -#define g_queue_pop_tail IA__g_queue_pop_tail - -extern __typeof (g_queue_pop_tail_link) IA__g_queue_pop_tail_link __attribute((visibility("hidden"))); -#define g_queue_pop_tail_link IA__g_queue_pop_tail_link - -extern __typeof (g_queue_push_head) IA__g_queue_push_head __attribute((visibility("hidden"))); -#define g_queue_push_head IA__g_queue_push_head - -extern __typeof (g_queue_push_head_link) IA__g_queue_push_head_link __attribute((visibility("hidden"))); -#define g_queue_push_head_link IA__g_queue_push_head_link - -extern __typeof (g_queue_push_nth) IA__g_queue_push_nth __attribute((visibility("hidden"))); -#define g_queue_push_nth IA__g_queue_push_nth - -extern __typeof (g_queue_push_nth_link) IA__g_queue_push_nth_link __attribute((visibility("hidden"))); -#define g_queue_push_nth_link IA__g_queue_push_nth_link - -extern __typeof (g_queue_push_tail) IA__g_queue_push_tail __attribute((visibility("hidden"))); -#define g_queue_push_tail IA__g_queue_push_tail - -extern __typeof (g_queue_push_tail_link) IA__g_queue_push_tail_link __attribute((visibility("hidden"))); -#define g_queue_push_tail_link IA__g_queue_push_tail_link - -extern __typeof (g_queue_remove) IA__g_queue_remove __attribute((visibility("hidden"))); -#define g_queue_remove IA__g_queue_remove - -extern __typeof (g_queue_remove_all) IA__g_queue_remove_all __attribute((visibility("hidden"))); -#define g_queue_remove_all IA__g_queue_remove_all - -extern __typeof (g_queue_reverse) IA__g_queue_reverse __attribute((visibility("hidden"))); -#define g_queue_reverse IA__g_queue_reverse - -extern __typeof (g_queue_sort) IA__g_queue_sort __attribute((visibility("hidden"))); -#define g_queue_sort IA__g_queue_sort - -extern __typeof (g_queue_unlink) IA__g_queue_unlink __attribute((visibility("hidden"))); -#define g_queue_unlink IA__g_queue_unlink - -#endif -#endif -#if IN_HEADER(__G_RAND_H__) -#if IN_FILE(__G_RAND_C__) -extern __typeof (g_rand_copy) IA__g_rand_copy __attribute((visibility("hidden"))); -#define g_rand_copy IA__g_rand_copy - -extern __typeof (g_rand_double) IA__g_rand_double __attribute((visibility("hidden"))); -#define g_rand_double IA__g_rand_double - -extern __typeof (g_rand_double_range) IA__g_rand_double_range __attribute((visibility("hidden"))); -#define g_rand_double_range IA__g_rand_double_range - -extern __typeof (g_rand_free) IA__g_rand_free __attribute((visibility("hidden"))); -#define g_rand_free IA__g_rand_free - -extern __typeof (g_rand_int) IA__g_rand_int __attribute((visibility("hidden"))); -#define g_rand_int IA__g_rand_int - -extern __typeof (g_rand_int_range) IA__g_rand_int_range __attribute((visibility("hidden"))); -#define g_rand_int_range IA__g_rand_int_range - -extern __typeof (g_rand_new) IA__g_rand_new __attribute((visibility("hidden"))); -#define g_rand_new IA__g_rand_new - -extern __typeof (g_rand_new_with_seed) IA__g_rand_new_with_seed __attribute((visibility("hidden"))); -#define g_rand_new_with_seed IA__g_rand_new_with_seed - -extern __typeof (g_rand_new_with_seed_array) IA__g_rand_new_with_seed_array __attribute((visibility("hidden"))); -#define g_rand_new_with_seed_array IA__g_rand_new_with_seed_array - -extern __typeof (g_random_double) IA__g_random_double __attribute((visibility("hidden"))); -#define g_random_double IA__g_random_double - -extern __typeof (g_random_double_range) IA__g_random_double_range __attribute((visibility("hidden"))); -#define g_random_double_range IA__g_random_double_range - -extern __typeof (g_random_int) IA__g_random_int __attribute((visibility("hidden"))); -#define g_random_int IA__g_random_int - -extern __typeof (g_random_int_range) IA__g_random_int_range __attribute((visibility("hidden"))); -#define g_random_int_range IA__g_random_int_range - -extern __typeof (g_random_set_seed) IA__g_random_set_seed __attribute((visibility("hidden"))); -#define g_random_set_seed IA__g_random_set_seed - -extern __typeof (g_rand_set_seed) IA__g_rand_set_seed __attribute((visibility("hidden"))); -#define g_rand_set_seed IA__g_rand_set_seed - -extern __typeof (g_rand_set_seed_array) IA__g_rand_set_seed_array __attribute((visibility("hidden"))); -#define g_rand_set_seed_array IA__g_rand_set_seed_array - -#endif -#endif -#if IN_HEADER(__G_REL_H__) -#if IN_FILE(__G_REL_C__) -extern __typeof (g_relation_count) IA__g_relation_count __attribute((visibility("hidden"))); -#define g_relation_count IA__g_relation_count - -extern __typeof (g_relation_delete) IA__g_relation_delete __attribute((visibility("hidden"))); -#define g_relation_delete IA__g_relation_delete - -extern __typeof (g_relation_destroy) IA__g_relation_destroy __attribute((visibility("hidden"))); -#define g_relation_destroy IA__g_relation_destroy - -extern __typeof (g_relation_exists) IA__g_relation_exists __attribute((visibility("hidden"))); -#define g_relation_exists IA__g_relation_exists - -extern __typeof (g_relation_index) IA__g_relation_index __attribute((visibility("hidden"))); -#define g_relation_index IA__g_relation_index - -extern __typeof (g_relation_insert) IA__g_relation_insert __attribute((visibility("hidden"))); -#define g_relation_insert IA__g_relation_insert - -extern __typeof (g_relation_new) IA__g_relation_new __attribute((visibility("hidden"))); -#define g_relation_new IA__g_relation_new - -extern __typeof (g_relation_print) IA__g_relation_print __attribute((visibility("hidden"))); -#define g_relation_print IA__g_relation_print - -extern __typeof (g_relation_select) IA__g_relation_select __attribute((visibility("hidden"))); -#define g_relation_select IA__g_relation_select - -extern __typeof (g_tuples_destroy) IA__g_tuples_destroy __attribute((visibility("hidden"))); -#define g_tuples_destroy IA__g_tuples_destroy - -extern __typeof (g_tuples_index) IA__g_tuples_index __attribute((visibility("hidden"))); -#define g_tuples_index IA__g_tuples_index - -#endif -#endif -#if IN_HEADER(__G_SCANNER_H__) -#if IN_FILE(__G_SCANNER_C__) -extern __typeof (g_scanner_cur_line) IA__g_scanner_cur_line __attribute((visibility("hidden"))); -#define g_scanner_cur_line IA__g_scanner_cur_line - -extern __typeof (g_scanner_cur_position) IA__g_scanner_cur_position __attribute((visibility("hidden"))); -#define g_scanner_cur_position IA__g_scanner_cur_position - -extern __typeof (g_scanner_cur_token) IA__g_scanner_cur_token __attribute((visibility("hidden"))); -#define g_scanner_cur_token IA__g_scanner_cur_token - -extern __typeof (g_scanner_cur_value) IA__g_scanner_cur_value __attribute((visibility("hidden"))); -#define g_scanner_cur_value IA__g_scanner_cur_value - -extern __typeof (g_scanner_destroy) IA__g_scanner_destroy __attribute((visibility("hidden"))); -#define g_scanner_destroy IA__g_scanner_destroy - -extern __typeof (g_scanner_eof) IA__g_scanner_eof __attribute((visibility("hidden"))); -#define g_scanner_eof IA__g_scanner_eof - -extern __typeof (g_scanner_error) IA__g_scanner_error __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_scanner_error IA__g_scanner_error - -extern __typeof (g_scanner_get_next_token) IA__g_scanner_get_next_token __attribute((visibility("hidden"))); -#define g_scanner_get_next_token IA__g_scanner_get_next_token - -extern __typeof (g_scanner_input_file) IA__g_scanner_input_file __attribute((visibility("hidden"))); -#define g_scanner_input_file IA__g_scanner_input_file - -extern __typeof (g_scanner_input_text) IA__g_scanner_input_text __attribute((visibility("hidden"))); -#define g_scanner_input_text IA__g_scanner_input_text - -extern __typeof (g_scanner_lookup_symbol) IA__g_scanner_lookup_symbol __attribute((visibility("hidden"))); -#define g_scanner_lookup_symbol IA__g_scanner_lookup_symbol - -extern __typeof (g_scanner_new) IA__g_scanner_new __attribute((visibility("hidden"))); -#define g_scanner_new IA__g_scanner_new - -extern __typeof (g_scanner_peek_next_token) IA__g_scanner_peek_next_token __attribute((visibility("hidden"))); -#define g_scanner_peek_next_token IA__g_scanner_peek_next_token - -extern __typeof (g_scanner_scope_add_symbol) IA__g_scanner_scope_add_symbol __attribute((visibility("hidden"))); -#define g_scanner_scope_add_symbol IA__g_scanner_scope_add_symbol - -extern __typeof (g_scanner_scope_foreach_symbol) IA__g_scanner_scope_foreach_symbol __attribute((visibility("hidden"))); -#define g_scanner_scope_foreach_symbol IA__g_scanner_scope_foreach_symbol - -extern __typeof (g_scanner_scope_lookup_symbol) IA__g_scanner_scope_lookup_symbol __attribute((visibility("hidden"))); -#define g_scanner_scope_lookup_symbol IA__g_scanner_scope_lookup_symbol - -extern __typeof (g_scanner_scope_remove_symbol) IA__g_scanner_scope_remove_symbol __attribute((visibility("hidden"))); -#define g_scanner_scope_remove_symbol IA__g_scanner_scope_remove_symbol - -extern __typeof (g_scanner_set_scope) IA__g_scanner_set_scope __attribute((visibility("hidden"))); -#define g_scanner_set_scope IA__g_scanner_set_scope - -extern __typeof (g_scanner_sync_file_offset) IA__g_scanner_sync_file_offset __attribute((visibility("hidden"))); -#define g_scanner_sync_file_offset IA__g_scanner_sync_file_offset - -extern __typeof (g_scanner_unexp_token) IA__g_scanner_unexp_token __attribute((visibility("hidden"))); -#define g_scanner_unexp_token IA__g_scanner_unexp_token - -extern __typeof (g_scanner_warn) IA__g_scanner_warn __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_scanner_warn IA__g_scanner_warn - -#endif -#endif -#if IN_HEADER(__G_SEQUENCE_H__) -#if IN_FILE(__G_SEQUENCE_C__) -extern __typeof (g_sequence_new) IA__g_sequence_new __attribute((visibility("hidden"))); -#define g_sequence_new IA__g_sequence_new - -extern __typeof (g_sequence_free) IA__g_sequence_free __attribute((visibility("hidden"))); -#define g_sequence_free IA__g_sequence_free - -extern __typeof (g_sequence_get_length) IA__g_sequence_get_length __attribute((visibility("hidden"))); -#define g_sequence_get_length IA__g_sequence_get_length - -extern __typeof (g_sequence_foreach) IA__g_sequence_foreach __attribute((visibility("hidden"))); -#define g_sequence_foreach IA__g_sequence_foreach - -extern __typeof (g_sequence_foreach_range) IA__g_sequence_foreach_range __attribute((visibility("hidden"))); -#define g_sequence_foreach_range IA__g_sequence_foreach_range - -extern __typeof (g_sequence_sort) IA__g_sequence_sort __attribute((visibility("hidden"))); -#define g_sequence_sort IA__g_sequence_sort - -extern __typeof (g_sequence_sort_iter) IA__g_sequence_sort_iter __attribute((visibility("hidden"))); -#define g_sequence_sort_iter IA__g_sequence_sort_iter - -extern __typeof (g_sequence_get_begin_iter) IA__g_sequence_get_begin_iter __attribute((visibility("hidden"))); -#define g_sequence_get_begin_iter IA__g_sequence_get_begin_iter - -extern __typeof (g_sequence_get_end_iter) IA__g_sequence_get_end_iter __attribute((visibility("hidden"))); -#define g_sequence_get_end_iter IA__g_sequence_get_end_iter - -extern __typeof (g_sequence_get_iter_at_pos) IA__g_sequence_get_iter_at_pos __attribute((visibility("hidden"))); -#define g_sequence_get_iter_at_pos IA__g_sequence_get_iter_at_pos - -extern __typeof (g_sequence_append) IA__g_sequence_append __attribute((visibility("hidden"))); -#define g_sequence_append IA__g_sequence_append - -extern __typeof (g_sequence_prepend) IA__g_sequence_prepend __attribute((visibility("hidden"))); -#define g_sequence_prepend IA__g_sequence_prepend - -extern __typeof (g_sequence_insert_before) IA__g_sequence_insert_before __attribute((visibility("hidden"))); -#define g_sequence_insert_before IA__g_sequence_insert_before - -extern __typeof (g_sequence_move) IA__g_sequence_move __attribute((visibility("hidden"))); -#define g_sequence_move IA__g_sequence_move - -extern __typeof (g_sequence_swap) IA__g_sequence_swap __attribute((visibility("hidden"))); -#define g_sequence_swap IA__g_sequence_swap - -extern __typeof (g_sequence_insert_sorted) IA__g_sequence_insert_sorted __attribute((visibility("hidden"))); -#define g_sequence_insert_sorted IA__g_sequence_insert_sorted - -extern __typeof (g_sequence_insert_sorted_iter) IA__g_sequence_insert_sorted_iter __attribute((visibility("hidden"))); -#define g_sequence_insert_sorted_iter IA__g_sequence_insert_sorted_iter - -extern __typeof (g_sequence_sort_changed) IA__g_sequence_sort_changed __attribute((visibility("hidden"))); -#define g_sequence_sort_changed IA__g_sequence_sort_changed - -extern __typeof (g_sequence_sort_changed_iter) IA__g_sequence_sort_changed_iter __attribute((visibility("hidden"))); -#define g_sequence_sort_changed_iter IA__g_sequence_sort_changed_iter - -extern __typeof (g_sequence_remove) IA__g_sequence_remove __attribute((visibility("hidden"))); -#define g_sequence_remove IA__g_sequence_remove - -extern __typeof (g_sequence_remove_range) IA__g_sequence_remove_range __attribute((visibility("hidden"))); -#define g_sequence_remove_range IA__g_sequence_remove_range - -extern __typeof (g_sequence_move_range) IA__g_sequence_move_range __attribute((visibility("hidden"))); -#define g_sequence_move_range IA__g_sequence_move_range - -extern __typeof (g_sequence_search) IA__g_sequence_search __attribute((visibility("hidden"))); -#define g_sequence_search IA__g_sequence_search - -extern __typeof (g_sequence_search_iter) IA__g_sequence_search_iter __attribute((visibility("hidden"))); -#define g_sequence_search_iter IA__g_sequence_search_iter - -extern __typeof (g_sequence_get) IA__g_sequence_get __attribute((visibility("hidden"))); -#define g_sequence_get IA__g_sequence_get - -extern __typeof (g_sequence_set) IA__g_sequence_set __attribute((visibility("hidden"))); -#define g_sequence_set IA__g_sequence_set - -extern __typeof (g_sequence_iter_is_begin) IA__g_sequence_iter_is_begin __attribute((visibility("hidden"))); -#define g_sequence_iter_is_begin IA__g_sequence_iter_is_begin - -extern __typeof (g_sequence_iter_is_end) IA__g_sequence_iter_is_end __attribute((visibility("hidden"))); -#define g_sequence_iter_is_end IA__g_sequence_iter_is_end - -extern __typeof (g_sequence_iter_next) IA__g_sequence_iter_next __attribute((visibility("hidden"))); -#define g_sequence_iter_next IA__g_sequence_iter_next - -extern __typeof (g_sequence_iter_prev) IA__g_sequence_iter_prev __attribute((visibility("hidden"))); -#define g_sequence_iter_prev IA__g_sequence_iter_prev - -extern __typeof (g_sequence_iter_get_position) IA__g_sequence_iter_get_position __attribute((visibility("hidden"))); -#define g_sequence_iter_get_position IA__g_sequence_iter_get_position - -extern __typeof (g_sequence_iter_move) IA__g_sequence_iter_move __attribute((visibility("hidden"))); -#define g_sequence_iter_move IA__g_sequence_iter_move - -extern __typeof (g_sequence_iter_get_sequence) IA__g_sequence_iter_get_sequence __attribute((visibility("hidden"))); -#define g_sequence_iter_get_sequence IA__g_sequence_iter_get_sequence - -extern __typeof (g_sequence_iter_compare) IA__g_sequence_iter_compare __attribute((visibility("hidden"))); -#define g_sequence_iter_compare IA__g_sequence_iter_compare - -extern __typeof (g_sequence_range_get_midpoint) IA__g_sequence_range_get_midpoint __attribute((visibility("hidden"))); -#define g_sequence_range_get_midpoint IA__g_sequence_range_get_midpoint - -#endif -#endif -#if IN_HEADER(__G_SHELL_H__) -#if IN_FILE(__G_SHELL_C__) -extern __typeof (g_shell_error_quark) IA__g_shell_error_quark __attribute((visibility("hidden"))); -#define g_shell_error_quark IA__g_shell_error_quark - -extern __typeof (g_shell_parse_argv) IA__g_shell_parse_argv __attribute((visibility("hidden"))); -#define g_shell_parse_argv IA__g_shell_parse_argv - -extern __typeof (g_shell_quote) IA__g_shell_quote __attribute((visibility("hidden"))); -#define g_shell_quote IA__g_shell_quote - -extern __typeof (g_shell_unquote) IA__g_shell_unquote __attribute((visibility("hidden"))); -#define g_shell_unquote IA__g_shell_unquote - -#endif -#endif -#if IN_HEADER(__G_SLIST_H__) -#if IN_FILE(__G_SLIST_C__) -extern __typeof (g_slist_alloc) IA__g_slist_alloc __attribute((visibility("hidden"))); -#define g_slist_alloc IA__g_slist_alloc - -extern __typeof (g_slist_append) IA__g_slist_append __attribute((visibility("hidden"))); -#define g_slist_append IA__g_slist_append - -extern __typeof (g_slist_concat) IA__g_slist_concat __attribute((visibility("hidden"))); -#define g_slist_concat IA__g_slist_concat - -extern __typeof (g_slist_copy) IA__g_slist_copy __attribute((visibility("hidden"))); -#define g_slist_copy IA__g_slist_copy - -extern __typeof (g_slist_delete_link) IA__g_slist_delete_link __attribute((visibility("hidden"))); -#define g_slist_delete_link IA__g_slist_delete_link - -extern __typeof (g_slist_find) IA__g_slist_find __attribute((visibility("hidden"))); -#define g_slist_find IA__g_slist_find - -extern __typeof (g_slist_find_custom) IA__g_slist_find_custom __attribute((visibility("hidden"))); -#define g_slist_find_custom IA__g_slist_find_custom - -extern __typeof (g_slist_foreach) IA__g_slist_foreach __attribute((visibility("hidden"))); -#define g_slist_foreach IA__g_slist_foreach - -extern __typeof (g_slist_free) IA__g_slist_free __attribute((visibility("hidden"))); -#define g_slist_free IA__g_slist_free - -extern __typeof (g_slist_free_1) IA__g_slist_free_1 __attribute((visibility("hidden"))); -#define g_slist_free_1 IA__g_slist_free_1 - -extern __typeof (g_slist_index) IA__g_slist_index __attribute((visibility("hidden"))); -#define g_slist_index IA__g_slist_index - -extern __typeof (g_slist_insert) IA__g_slist_insert __attribute((visibility("hidden"))); -#define g_slist_insert IA__g_slist_insert - -extern __typeof (g_slist_insert_before) IA__g_slist_insert_before __attribute((visibility("hidden"))); -#define g_slist_insert_before IA__g_slist_insert_before - -extern __typeof (g_slist_insert_sorted) IA__g_slist_insert_sorted __attribute((visibility("hidden"))); -#define g_slist_insert_sorted IA__g_slist_insert_sorted - -extern __typeof (g_slist_insert_sorted_with_data) IA__g_slist_insert_sorted_with_data __attribute((visibility("hidden"))); -#define g_slist_insert_sorted_with_data IA__g_slist_insert_sorted_with_data - -extern __typeof (g_slist_last) IA__g_slist_last __attribute((visibility("hidden"))); -#define g_slist_last IA__g_slist_last - -extern __typeof (g_slist_length) IA__g_slist_length __attribute((visibility("hidden"))); -#define g_slist_length IA__g_slist_length - -extern __typeof (g_slist_nth) IA__g_slist_nth __attribute((visibility("hidden"))); -#define g_slist_nth IA__g_slist_nth - -extern __typeof (g_slist_nth_data) IA__g_slist_nth_data __attribute((visibility("hidden"))); -#define g_slist_nth_data IA__g_slist_nth_data - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_slist_pop_allocator) IA__g_slist_pop_allocator __attribute((visibility("hidden"))); -#define g_slist_pop_allocator IA__g_slist_pop_allocator - -#endif -extern __typeof (g_slist_position) IA__g_slist_position __attribute((visibility("hidden"))); -#define g_slist_position IA__g_slist_position - -extern __typeof (g_slist_prepend) IA__g_slist_prepend __attribute((visibility("hidden"))); -#define g_slist_prepend IA__g_slist_prepend - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_slist_push_allocator) IA__g_slist_push_allocator __attribute((visibility("hidden"))); -#define g_slist_push_allocator IA__g_slist_push_allocator - -#endif -extern __typeof (g_slist_remove) IA__g_slist_remove __attribute((visibility("hidden"))); -#define g_slist_remove IA__g_slist_remove - -extern __typeof (g_slist_remove_all) IA__g_slist_remove_all __attribute((visibility("hidden"))); -#define g_slist_remove_all IA__g_slist_remove_all - -extern __typeof (g_slist_remove_link) IA__g_slist_remove_link __attribute((visibility("hidden"))); -#define g_slist_remove_link IA__g_slist_remove_link - -extern __typeof (g_slist_reverse) IA__g_slist_reverse __attribute((visibility("hidden"))); -#define g_slist_reverse IA__g_slist_reverse - -extern __typeof (g_slist_sort) IA__g_slist_sort __attribute((visibility("hidden"))); -#define g_slist_sort IA__g_slist_sort - -extern __typeof (g_slist_sort_with_data) IA__g_slist_sort_with_data __attribute((visibility("hidden"))); -#define g_slist_sort_with_data IA__g_slist_sort_with_data - -#endif -#endif -#if IN_HEADER(__G_SPAWN_H__) -#if IN_FILE(__G_SPAWN_C__) -#ifndef _WIN64 -extern __typeof (g_spawn_async) IA__g_spawn_async __attribute((visibility("hidden"))); -#define g_spawn_async IA__g_spawn_async - -extern __typeof (g_spawn_async_with_pipes) IA__g_spawn_async_with_pipes __attribute((visibility("hidden"))); -#define g_spawn_async_with_pipes IA__g_spawn_async_with_pipes - -#endif -extern __typeof (g_spawn_close_pid) IA__g_spawn_close_pid __attribute((visibility("hidden"))); -#define g_spawn_close_pid IA__g_spawn_close_pid - -#ifndef _WIN64 -extern __typeof (g_spawn_command_line_async) IA__g_spawn_command_line_async __attribute((visibility("hidden"))); -#define g_spawn_command_line_async IA__g_spawn_command_line_async - -extern __typeof (g_spawn_command_line_sync) IA__g_spawn_command_line_sync __attribute((visibility("hidden"))); -#define g_spawn_command_line_sync IA__g_spawn_command_line_sync - -#endif -extern __typeof (g_spawn_error_quark) IA__g_spawn_error_quark __attribute((visibility("hidden"))); -#define g_spawn_error_quark IA__g_spawn_error_quark - -#ifndef _WIN64 -extern __typeof (g_spawn_sync) IA__g_spawn_sync __attribute((visibility("hidden"))); -#define g_spawn_sync IA__g_spawn_sync - -#endif -#ifdef G_OS_WIN32 -extern __typeof (g_spawn_async_utf8) IA__g_spawn_async_utf8 __attribute((visibility("hidden"))); -#define g_spawn_async_utf8 IA__g_spawn_async_utf8 - -extern __typeof (g_spawn_async_with_pipes_utf8) IA__g_spawn_async_with_pipes_utf8 __attribute((visibility("hidden"))); -#define g_spawn_async_with_pipes_utf8 IA__g_spawn_async_with_pipes_utf8 - -extern __typeof (g_spawn_command_line_async_utf8) IA__g_spawn_command_line_async_utf8 __attribute((visibility("hidden"))); -#define g_spawn_command_line_async_utf8 IA__g_spawn_command_line_async_utf8 - -extern __typeof (g_spawn_command_line_sync_utf8) IA__g_spawn_command_line_sync_utf8 __attribute((visibility("hidden"))); -#define g_spawn_command_line_sync_utf8 IA__g_spawn_command_line_sync_utf8 - -extern __typeof (g_spawn_sync_utf8) IA__g_spawn_sync_utf8 __attribute((visibility("hidden"))); -#define g_spawn_sync_utf8 IA__g_spawn_sync_utf8 - -#endif -#endif -#endif -#if IN_HEADER(__G_STDIO_H__) -#if IN_FILE(__G_STDIO_C__) -#if !defined(G_OS_UNIX) || defined(G_STDIO_NO_WRAP_ON_UNIX) -extern __typeof (g_chmod) IA__g_chmod __attribute((visibility("hidden"))); -#define g_chmod IA__g_chmod - -extern __typeof (g_open) IA__g_open __attribute((visibility("hidden"))); -#define g_open IA__g_open - -extern __typeof (g_creat) IA__g_creat __attribute((visibility("hidden"))); -#define g_creat IA__g_creat - -extern __typeof (g_rename) IA__g_rename __attribute((visibility("hidden"))); -#define g_rename IA__g_rename - -extern __typeof (g_mkdir) IA__g_mkdir __attribute((visibility("hidden"))); -#define g_mkdir IA__g_mkdir - -extern __typeof (g_stat) IA__g_stat __attribute((visibility("hidden"))); -#define g_stat IA__g_stat - -extern __typeof (g_lstat) IA__g_lstat __attribute((visibility("hidden"))); -#define g_lstat IA__g_lstat - -extern __typeof (g_remove) IA__g_remove __attribute((visibility("hidden"))); -#define g_remove IA__g_remove - -extern __typeof (g_fopen) IA__g_fopen __attribute((visibility("hidden"))); -#define g_fopen IA__g_fopen - -extern __typeof (g_freopen) IA__g_freopen __attribute((visibility("hidden"))); -#define g_freopen IA__g_freopen - -extern __typeof (g_utime) IA__g_utime __attribute((visibility("hidden"))); -#define g_utime IA__g_utime - -#endif -extern __typeof (g_access) IA__g_access __attribute((visibility("hidden"))); -#define g_access IA__g_access - -extern __typeof (g_chdir) IA__g_chdir __attribute((visibility("hidden"))); -#define g_chdir IA__g_chdir - -extern __typeof (g_unlink) IA__g_unlink __attribute((visibility("hidden"))); -#define g_unlink IA__g_unlink - -extern __typeof (g_rmdir) IA__g_rmdir __attribute((visibility("hidden"))); -#define g_rmdir IA__g_rmdir - -#endif -#endif -#if IN_HEADER(__G_STRFUNCS_H__) -#if IN_FILE(__G_STRFUNCS_C__) -extern __typeof (g_ascii_digit_value) IA__g_ascii_digit_value __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_ascii_digit_value IA__g_ascii_digit_value - -extern __typeof (g_ascii_dtostr) IA__g_ascii_dtostr __attribute((visibility("hidden"))); -#define g_ascii_dtostr IA__g_ascii_dtostr - -extern __typeof (g_ascii_formatd) IA__g_ascii_formatd __attribute((visibility("hidden"))); -#define g_ascii_formatd IA__g_ascii_formatd - -extern __typeof (g_ascii_strdown) IA__g_ascii_strdown __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_ascii_strdown IA__g_ascii_strdown - -extern __typeof (g_ascii_strtod) IA__g_ascii_strtod __attribute((visibility("hidden"))); -#define g_ascii_strtod IA__g_ascii_strtod - -extern __typeof (g_ascii_strtoull) IA__g_ascii_strtoull __attribute((visibility("hidden"))); -#define g_ascii_strtoull IA__g_ascii_strtoull - -extern __typeof (g_ascii_strtoll) IA__g_ascii_strtoll __attribute((visibility("hidden"))); -#define g_ascii_strtoll IA__g_ascii_strtoll - -extern __typeof (g_ascii_strup) IA__g_ascii_strup __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_ascii_strup IA__g_ascii_strup - -extern __typeof (g_ascii_tolower) IA__g_ascii_tolower __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_ascii_tolower IA__g_ascii_tolower - -extern __typeof (g_ascii_toupper) IA__g_ascii_toupper __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_ascii_toupper IA__g_ascii_toupper - -extern __typeof (g_ascii_xdigit_value) IA__g_ascii_xdigit_value __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_ascii_xdigit_value IA__g_ascii_xdigit_value - -extern __typeof (g_ascii_strcasecmp) IA__g_ascii_strcasecmp __attribute((visibility("hidden"))); -#define g_ascii_strcasecmp IA__g_ascii_strcasecmp - -extern __typeof (g_ascii_strncasecmp) IA__g_ascii_strncasecmp __attribute((visibility("hidden"))); -#define g_ascii_strncasecmp IA__g_ascii_strncasecmp - -extern __typeof (g_memdup) IA__g_memdup __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_memdup IA__g_memdup - -extern __typeof (g_stpcpy) IA__g_stpcpy __attribute((visibility("hidden"))); -#define g_stpcpy IA__g_stpcpy - -extern __typeof (g_strcanon) IA__g_strcanon __attribute((visibility("hidden"))); -#define g_strcanon IA__g_strcanon - -extern __typeof (g_strchomp) IA__g_strchomp __attribute((visibility("hidden"))); -#define g_strchomp IA__g_strchomp - -extern __typeof (g_strchug) IA__g_strchug __attribute((visibility("hidden"))); -#define g_strchug IA__g_strchug - -extern __typeof (g_strcompress) IA__g_strcompress __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strcompress IA__g_strcompress - -extern __typeof (g_strconcat) IA__g_strconcat __attribute((visibility("hidden"))) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED; -#define g_strconcat IA__g_strconcat - -extern __typeof (g_strdelimit) IA__g_strdelimit __attribute((visibility("hidden"))); -#define g_strdelimit IA__g_strdelimit - -extern __typeof (g_strdup) IA__g_strdup __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strdup IA__g_strdup - -extern __typeof (g_strdup_printf) IA__g_strdup_printf __attribute((visibility("hidden"))) G_GNUC_PRINTF(1,2) G_GNUC_MALLOC; -#define g_strdup_printf IA__g_strdup_printf - -extern __typeof (g_strdupv) IA__g_strdupv __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strdupv IA__g_strdupv - -extern __typeof (g_strdup_vprintf) IA__g_strdup_vprintf __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strdup_vprintf IA__g_strdup_vprintf - -extern __typeof (g_strerror) IA__g_strerror __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_strerror IA__g_strerror - -extern __typeof (g_strescape) IA__g_strescape __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strescape IA__g_strescape - -extern __typeof (g_strfreev) IA__g_strfreev __attribute((visibility("hidden"))); -#define g_strfreev IA__g_strfreev - -extern __typeof (g_str_has_prefix) IA__g_str_has_prefix __attribute((visibility("hidden"))); -#define g_str_has_prefix IA__g_str_has_prefix - -extern __typeof (g_str_has_suffix) IA__g_str_has_suffix __attribute((visibility("hidden"))); -#define g_str_has_suffix IA__g_str_has_suffix - -extern __typeof (g_strjoin) IA__g_strjoin __attribute((visibility("hidden"))) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED; -#define g_strjoin IA__g_strjoin - -extern __typeof (g_strjoinv) IA__g_strjoinv __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strjoinv IA__g_strjoinv - -extern __typeof (g_strlcat) IA__g_strlcat __attribute((visibility("hidden"))); -#define g_strlcat IA__g_strlcat - -extern __typeof (g_strlcpy) IA__g_strlcpy __attribute((visibility("hidden"))); -#define g_strlcpy IA__g_strlcpy - -extern __typeof (g_strndup) IA__g_strndup __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strndup IA__g_strndup - -extern __typeof (g_strnfill) IA__g_strnfill __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strnfill IA__g_strnfill - -extern __typeof (g_strreverse) IA__g_strreverse __attribute((visibility("hidden"))); -#define g_strreverse IA__g_strreverse - -extern __typeof (g_strrstr) IA__g_strrstr __attribute((visibility("hidden"))); -#define g_strrstr IA__g_strrstr - -extern __typeof (g_strrstr_len) IA__g_strrstr_len __attribute((visibility("hidden"))); -#define g_strrstr_len IA__g_strrstr_len - -extern __typeof (g_strsignal) IA__g_strsignal __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_strsignal IA__g_strsignal - -extern __typeof (g_strsplit) IA__g_strsplit __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strsplit IA__g_strsplit - -extern __typeof (g_strsplit_set) IA__g_strsplit_set __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_strsplit_set IA__g_strsplit_set - -extern __typeof (g_strstr_len) IA__g_strstr_len __attribute((visibility("hidden"))); -#define g_strstr_len IA__g_strstr_len - -extern __typeof (g_strtod) IA__g_strtod __attribute((visibility("hidden"))); -#define g_strtod IA__g_strtod - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_strcasecmp) IA__g_strcasecmp __attribute((visibility("hidden"))); -#define g_strcasecmp IA__g_strcasecmp - -extern __typeof (g_strncasecmp) IA__g_strncasecmp __attribute((visibility("hidden"))); -#define g_strncasecmp IA__g_strncasecmp - -extern __typeof (g_strup) IA__g_strup __attribute((visibility("hidden"))); -#define g_strup IA__g_strup - -extern __typeof (g_strdown) IA__g_strdown __attribute((visibility("hidden"))); -#define g_strdown IA__g_strdown - -#endif -extern __typeof (g_strv_length) IA__g_strv_length __attribute((visibility("hidden"))); -#define g_strv_length IA__g_strv_length - -extern __typeof (g_strip_context) IA__g_strip_context __attribute((visibility("hidden"))) G_GNUC_FORMAT(1); -#define g_strip_context IA__g_strip_context - -extern __typeof (g_dgettext) IA__g_dgettext __attribute((visibility("hidden"))) G_GNUC_FORMAT(2); -#define g_dgettext IA__g_dgettext - -extern __typeof (g_dngettext) IA__g_dngettext __attribute((visibility("hidden"))) G_GNUC_FORMAT(3); -#define g_dngettext IA__g_dngettext - -extern __typeof (g_dpgettext) IA__g_dpgettext __attribute((visibility("hidden"))) G_GNUC_FORMAT(2); -#define g_dpgettext IA__g_dpgettext - -extern __typeof (g_dpgettext2) IA__g_dpgettext2 __attribute((visibility("hidden"))) G_GNUC_FORMAT(3); -#define g_dpgettext2 IA__g_dpgettext2 - -#endif -#endif -#if IN_HEADER(__G_URI_FUNCS_H__) -#if IN_FILE(__G_URI_FUNCS_C__) -extern __typeof (g_uri_unescape_string) IA__g_uri_unescape_string __attribute((visibility("hidden"))); -#define g_uri_unescape_string IA__g_uri_unescape_string - -extern __typeof (g_uri_unescape_segment) IA__g_uri_unescape_segment __attribute((visibility("hidden"))); -#define g_uri_unescape_segment IA__g_uri_unescape_segment - -extern __typeof (g_uri_parse_scheme) IA__g_uri_parse_scheme __attribute((visibility("hidden"))); -#define g_uri_parse_scheme IA__g_uri_parse_scheme - -extern __typeof (g_uri_escape_string) IA__g_uri_escape_string __attribute((visibility("hidden"))); -#define g_uri_escape_string IA__g_uri_escape_string - -#endif -#endif -#if IN_HEADER(__G_STRING_H__) -#if IN_FILE(__G_STRING_C__) -extern __typeof (g_string_append) IA__g_string_append __attribute((visibility("hidden"))); -#define g_string_append IA__g_string_append - -extern __typeof (g_string_append_len) IA__g_string_append_len __attribute((visibility("hidden"))); -#define g_string_append_len IA__g_string_append_len - -extern __typeof (g_string_append_printf) IA__g_string_append_printf __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_string_append_printf IA__g_string_append_printf - -extern __typeof (g_string_append_unichar) IA__g_string_append_unichar __attribute((visibility("hidden"))); -#define g_string_append_unichar IA__g_string_append_unichar - -extern __typeof (g_string_append_vprintf) IA__g_string_append_vprintf __attribute((visibility("hidden"))); -#define g_string_append_vprintf IA__g_string_append_vprintf - -extern __typeof (g_string_ascii_down) IA__g_string_ascii_down __attribute((visibility("hidden"))); -#define g_string_ascii_down IA__g_string_ascii_down - -extern __typeof (g_string_ascii_up) IA__g_string_ascii_up __attribute((visibility("hidden"))); -#define g_string_ascii_up IA__g_string_ascii_up - -extern __typeof (g_string_assign) IA__g_string_assign __attribute((visibility("hidden"))); -#define g_string_assign IA__g_string_assign - -extern __typeof (g_string_chunk_free) IA__g_string_chunk_free __attribute((visibility("hidden"))); -#define g_string_chunk_free IA__g_string_chunk_free - -extern __typeof (g_string_chunk_clear) IA__g_string_chunk_clear __attribute((visibility("hidden"))); -#define g_string_chunk_clear IA__g_string_chunk_clear - -extern __typeof (g_string_chunk_insert) IA__g_string_chunk_insert __attribute((visibility("hidden"))); -#define g_string_chunk_insert IA__g_string_chunk_insert - -extern __typeof (g_string_chunk_insert_const) IA__g_string_chunk_insert_const __attribute((visibility("hidden"))); -#define g_string_chunk_insert_const IA__g_string_chunk_insert_const - -extern __typeof (g_string_chunk_insert_len) IA__g_string_chunk_insert_len __attribute((visibility("hidden"))); -#define g_string_chunk_insert_len IA__g_string_chunk_insert_len - -extern __typeof (g_string_chunk_new) IA__g_string_chunk_new __attribute((visibility("hidden"))); -#define g_string_chunk_new IA__g_string_chunk_new - -extern __typeof (g_string_equal) IA__g_string_equal __attribute((visibility("hidden"))); -#define g_string_equal IA__g_string_equal - -extern __typeof (g_string_erase) IA__g_string_erase __attribute((visibility("hidden"))); -#define g_string_erase IA__g_string_erase - -extern __typeof (g_string_free) IA__g_string_free __attribute((visibility("hidden"))); -#define g_string_free IA__g_string_free - -extern __typeof (g_string_hash) IA__g_string_hash __attribute((visibility("hidden"))); -#define g_string_hash IA__g_string_hash - -extern __typeof (g_string_insert) IA__g_string_insert __attribute((visibility("hidden"))); -#define g_string_insert IA__g_string_insert - -extern __typeof (g_string_insert_c) IA__g_string_insert_c __attribute((visibility("hidden"))); -#define g_string_insert_c IA__g_string_insert_c - -extern __typeof (g_string_insert_len) IA__g_string_insert_len __attribute((visibility("hidden"))); -#define g_string_insert_len IA__g_string_insert_len - -extern __typeof (g_string_insert_unichar) IA__g_string_insert_unichar __attribute((visibility("hidden"))); -#define g_string_insert_unichar IA__g_string_insert_unichar - -extern __typeof (g_string_new) IA__g_string_new __attribute((visibility("hidden"))); -#define g_string_new IA__g_string_new - -extern __typeof (g_string_new_len) IA__g_string_new_len __attribute((visibility("hidden"))); -#define g_string_new_len IA__g_string_new_len - -extern __typeof (g_string_overwrite) IA__g_string_overwrite __attribute((visibility("hidden"))); -#define g_string_overwrite IA__g_string_overwrite - -extern __typeof (g_string_overwrite_len) IA__g_string_overwrite_len __attribute((visibility("hidden"))); -#define g_string_overwrite_len IA__g_string_overwrite_len - -extern __typeof (g_string_prepend) IA__g_string_prepend __attribute((visibility("hidden"))); -#define g_string_prepend IA__g_string_prepend - -extern __typeof (g_string_prepend_c) IA__g_string_prepend_c __attribute((visibility("hidden"))); -#define g_string_prepend_c IA__g_string_prepend_c - -extern __typeof (g_string_prepend_len) IA__g_string_prepend_len __attribute((visibility("hidden"))); -#define g_string_prepend_len IA__g_string_prepend_len - -extern __typeof (g_string_prepend_unichar) IA__g_string_prepend_unichar __attribute((visibility("hidden"))); -#define g_string_prepend_unichar IA__g_string_prepend_unichar - -extern __typeof (g_string_printf) IA__g_string_printf __attribute((visibility("hidden"))) G_GNUC_PRINTF(2,3); -#define g_string_printf IA__g_string_printf - -extern __typeof (g_string_set_size) IA__g_string_set_size __attribute((visibility("hidden"))); -#define g_string_set_size IA__g_string_set_size - -extern __typeof (g_string_sized_new) IA__g_string_sized_new __attribute((visibility("hidden"))); -#define g_string_sized_new IA__g_string_sized_new - -extern __typeof (g_string_truncate) IA__g_string_truncate __attribute((visibility("hidden"))); -#define g_string_truncate IA__g_string_truncate - -extern __typeof (g_string_append_uri_escaped) IA__g_string_append_uri_escaped __attribute((visibility("hidden"))); -#define g_string_append_uri_escaped IA__g_string_append_uri_escaped - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_string_down) IA__g_string_down __attribute((visibility("hidden"))); -#define g_string_down IA__g_string_down - -extern __typeof (g_string_up) IA__g_string_up __attribute((visibility("hidden"))); -#define g_string_up IA__g_string_up - -#endif -extern __typeof (g_string_vprintf) IA__g_string_vprintf __attribute((visibility("hidden"))); -#define g_string_vprintf IA__g_string_vprintf - -#endif -#endif -#if IN_HEADER(__G_BITLOCK_H__) -#if IN_FILE(__G_BITLOCK_C__) -extern __typeof (g_bit_lock) IA__g_bit_lock __attribute((visibility("hidden"))); -#define g_bit_lock IA__g_bit_lock - -extern __typeof (g_bit_trylock) IA__g_bit_trylock __attribute((visibility("hidden"))); -#define g_bit_trylock IA__g_bit_trylock - -extern __typeof (g_bit_unlock) IA__g_bit_unlock __attribute((visibility("hidden"))); -#define g_bit_unlock IA__g_bit_unlock - -#endif -#endif -#if IN_HEADER(__G_THREAD_H__) -#if IN_FILE(__G_THREAD_C__) -extern __typeof (g_once_impl) IA__g_once_impl __attribute((visibility("hidden"))); -#define g_once_impl IA__g_once_impl - -extern __typeof (g_once_init_enter_impl) IA__g_once_init_enter_impl __attribute((visibility("hidden"))); -#define g_once_init_enter_impl IA__g_once_init_enter_impl - -extern __typeof (g_once_init_leave) IA__g_once_init_leave __attribute((visibility("hidden"))); -#define g_once_init_leave IA__g_once_init_leave - -extern __typeof (g_thread_create_full) IA__g_thread_create_full __attribute((visibility("hidden"))); -#define g_thread_create_full IA__g_thread_create_full - -extern __typeof (g_thread_error_quark) IA__g_thread_error_quark __attribute((visibility("hidden"))); -#define g_thread_error_quark IA__g_thread_error_quark - -extern __typeof (g_thread_exit) IA__g_thread_exit __attribute((visibility("hidden"))); -#define g_thread_exit IA__g_thread_exit - -extern __typeof (g_thread_join) IA__g_thread_join __attribute((visibility("hidden"))); -#define g_thread_join IA__g_thread_join - -extern __typeof (g_thread_self) IA__g_thread_self __attribute((visibility("hidden"))); -#define g_thread_self IA__g_thread_self - -extern __typeof (g_thread_set_priority) IA__g_thread_set_priority __attribute((visibility("hidden"))); -#define g_thread_set_priority IA__g_thread_set_priority - -extern __typeof (g_static_mutex_free) IA__g_static_mutex_free __attribute((visibility("hidden"))); -#define g_static_mutex_free IA__g_static_mutex_free - -extern __typeof (g_static_mutex_get_mutex_impl) IA__g_static_mutex_get_mutex_impl __attribute((visibility("hidden"))); -#define g_static_mutex_get_mutex_impl IA__g_static_mutex_get_mutex_impl - -extern __typeof (g_static_mutex_init) IA__g_static_mutex_init __attribute((visibility("hidden"))); -#define g_static_mutex_init IA__g_static_mutex_init - -extern __typeof (g_static_private_free) IA__g_static_private_free __attribute((visibility("hidden"))); -#define g_static_private_free IA__g_static_private_free - -extern __typeof (g_static_private_get) IA__g_static_private_get __attribute((visibility("hidden"))); -#define g_static_private_get IA__g_static_private_get - -extern __typeof (g_static_private_init) IA__g_static_private_init __attribute((visibility("hidden"))); -#define g_static_private_init IA__g_static_private_init - -extern __typeof (g_static_private_set) IA__g_static_private_set __attribute((visibility("hidden"))); -#define g_static_private_set IA__g_static_private_set - -extern __typeof (g_static_rec_mutex_free) IA__g_static_rec_mutex_free __attribute((visibility("hidden"))); -#define g_static_rec_mutex_free IA__g_static_rec_mutex_free - -extern __typeof (g_static_rec_mutex_init) IA__g_static_rec_mutex_init __attribute((visibility("hidden"))); -#define g_static_rec_mutex_init IA__g_static_rec_mutex_init - -extern __typeof (g_static_rec_mutex_lock) IA__g_static_rec_mutex_lock __attribute((visibility("hidden"))); -#define g_static_rec_mutex_lock IA__g_static_rec_mutex_lock - -extern __typeof (g_static_rec_mutex_lock_full) IA__g_static_rec_mutex_lock_full __attribute((visibility("hidden"))); -#define g_static_rec_mutex_lock_full IA__g_static_rec_mutex_lock_full - -extern __typeof (g_static_rec_mutex_trylock) IA__g_static_rec_mutex_trylock __attribute((visibility("hidden"))); -#define g_static_rec_mutex_trylock IA__g_static_rec_mutex_trylock - -extern __typeof (g_static_rec_mutex_unlock) IA__g_static_rec_mutex_unlock __attribute((visibility("hidden"))); -#define g_static_rec_mutex_unlock IA__g_static_rec_mutex_unlock - -extern __typeof (g_static_rec_mutex_unlock_full) IA__g_static_rec_mutex_unlock_full __attribute((visibility("hidden"))); -#define g_static_rec_mutex_unlock_full IA__g_static_rec_mutex_unlock_full - -extern __typeof (g_static_rw_lock_free) IA__g_static_rw_lock_free __attribute((visibility("hidden"))); -#define g_static_rw_lock_free IA__g_static_rw_lock_free - -extern __typeof (g_static_rw_lock_init) IA__g_static_rw_lock_init __attribute((visibility("hidden"))); -#define g_static_rw_lock_init IA__g_static_rw_lock_init - -extern __typeof (g_static_rw_lock_reader_lock) IA__g_static_rw_lock_reader_lock __attribute((visibility("hidden"))); -#define g_static_rw_lock_reader_lock IA__g_static_rw_lock_reader_lock - -extern __typeof (g_static_rw_lock_reader_trylock) IA__g_static_rw_lock_reader_trylock __attribute((visibility("hidden"))); -#define g_static_rw_lock_reader_trylock IA__g_static_rw_lock_reader_trylock - -extern __typeof (g_static_rw_lock_reader_unlock) IA__g_static_rw_lock_reader_unlock __attribute((visibility("hidden"))); -#define g_static_rw_lock_reader_unlock IA__g_static_rw_lock_reader_unlock - -extern __typeof (g_static_rw_lock_writer_lock) IA__g_static_rw_lock_writer_lock __attribute((visibility("hidden"))); -#define g_static_rw_lock_writer_lock IA__g_static_rw_lock_writer_lock - -extern __typeof (g_static_rw_lock_writer_trylock) IA__g_static_rw_lock_writer_trylock __attribute((visibility("hidden"))); -#define g_static_rw_lock_writer_trylock IA__g_static_rw_lock_writer_trylock - -extern __typeof (g_static_rw_lock_writer_unlock) IA__g_static_rw_lock_writer_unlock __attribute((visibility("hidden"))); -#define g_static_rw_lock_writer_unlock IA__g_static_rw_lock_writer_unlock - -extern __typeof (g_thread_foreach) IA__g_thread_foreach __attribute((visibility("hidden"))); -#define g_thread_foreach IA__g_thread_foreach - -extern __typeof (g_thread_get_initialized) IA__g_thread_get_initialized __attribute((visibility("hidden"))); -#define g_thread_get_initialized IA__g_thread_get_initialized - -#endif -#endif -#if IN_HEADER(__G_THREADPOOL_H__) -#if IN_FILE(__G_THREADPOOL_C__) -extern __typeof (g_thread_pool_free) IA__g_thread_pool_free __attribute((visibility("hidden"))); -#define g_thread_pool_free IA__g_thread_pool_free - -extern __typeof (g_thread_pool_get_max_threads) IA__g_thread_pool_get_max_threads __attribute((visibility("hidden"))); -#define g_thread_pool_get_max_threads IA__g_thread_pool_get_max_threads - -extern __typeof (g_thread_pool_get_max_unused_threads) IA__g_thread_pool_get_max_unused_threads __attribute((visibility("hidden"))); -#define g_thread_pool_get_max_unused_threads IA__g_thread_pool_get_max_unused_threads - -extern __typeof (g_thread_pool_get_max_idle_time) IA__g_thread_pool_get_max_idle_time __attribute((visibility("hidden"))); -#define g_thread_pool_get_max_idle_time IA__g_thread_pool_get_max_idle_time - -extern __typeof (g_thread_pool_get_num_threads) IA__g_thread_pool_get_num_threads __attribute((visibility("hidden"))); -#define g_thread_pool_get_num_threads IA__g_thread_pool_get_num_threads - -extern __typeof (g_thread_pool_get_num_unused_threads) IA__g_thread_pool_get_num_unused_threads __attribute((visibility("hidden"))); -#define g_thread_pool_get_num_unused_threads IA__g_thread_pool_get_num_unused_threads - -extern __typeof (g_thread_pool_new) IA__g_thread_pool_new __attribute((visibility("hidden"))); -#define g_thread_pool_new IA__g_thread_pool_new - -extern __typeof (g_thread_pool_push) IA__g_thread_pool_push __attribute((visibility("hidden"))); -#define g_thread_pool_push IA__g_thread_pool_push - -extern __typeof (g_thread_pool_set_max_threads) IA__g_thread_pool_set_max_threads __attribute((visibility("hidden"))); -#define g_thread_pool_set_max_threads IA__g_thread_pool_set_max_threads - -extern __typeof (g_thread_pool_set_max_unused_threads) IA__g_thread_pool_set_max_unused_threads __attribute((visibility("hidden"))); -#define g_thread_pool_set_max_unused_threads IA__g_thread_pool_set_max_unused_threads - -extern __typeof (g_thread_pool_set_max_idle_time) IA__g_thread_pool_set_max_idle_time __attribute((visibility("hidden"))); -#define g_thread_pool_set_max_idle_time IA__g_thread_pool_set_max_idle_time - -extern __typeof (g_thread_pool_stop_unused_threads) IA__g_thread_pool_stop_unused_threads __attribute((visibility("hidden"))); -#define g_thread_pool_stop_unused_threads IA__g_thread_pool_stop_unused_threads - -extern __typeof (g_thread_pool_unprocessed) IA__g_thread_pool_unprocessed __attribute((visibility("hidden"))); -#define g_thread_pool_unprocessed IA__g_thread_pool_unprocessed - -extern __typeof (g_thread_pool_set_sort_function) IA__g_thread_pool_set_sort_function __attribute((visibility("hidden"))); -#define g_thread_pool_set_sort_function IA__g_thread_pool_set_sort_function - -#endif -#endif -#if IN_HEADER(__G_TEST_UTILS_H__) -#if IN_FILE(__G_MESSAGES_C__) -extern __typeof (g_test_log_set_fatal_handler) IA__g_test_log_set_fatal_handler __attribute((visibility("hidden"))); -#define g_test_log_set_fatal_handler IA__g_test_log_set_fatal_handler - -#endif -#if IN_FILE(__G_TEST_UTILS_C__) -extern __typeof (g_assertion_message) IA__g_assertion_message __attribute((visibility("hidden"))) G_GNUC_NORETURN; -#define g_assertion_message IA__g_assertion_message - -extern __typeof (g_assertion_message_cmpnum) IA__g_assertion_message_cmpnum __attribute((visibility("hidden"))) G_GNUC_NORETURN; -#define g_assertion_message_cmpnum IA__g_assertion_message_cmpnum - -extern __typeof (g_assertion_message_cmpstr) IA__g_assertion_message_cmpstr __attribute((visibility("hidden"))) G_GNUC_NORETURN; -#define g_assertion_message_cmpstr IA__g_assertion_message_cmpstr - -extern __typeof (g_assertion_message_expr) IA__g_assertion_message_expr __attribute((visibility("hidden"))) G_GNUC_NORETURN; -#define g_assertion_message_expr IA__g_assertion_message_expr - -extern __typeof (g_assertion_message_error) IA__g_assertion_message_error __attribute((visibility("hidden"))) G_GNUC_NORETURN; -#define g_assertion_message_error IA__g_assertion_message_error - -extern __typeof (g_strcmp0) IA__g_strcmp0 __attribute((visibility("hidden"))); -#define g_strcmp0 IA__g_strcmp0 - -extern __typeof (g_test_add_data_func) IA__g_test_add_data_func __attribute((visibility("hidden"))); -#define g_test_add_data_func IA__g_test_add_data_func - -extern __typeof (g_test_add_func) IA__g_test_add_func __attribute((visibility("hidden"))); -#define g_test_add_func IA__g_test_add_func - -extern __typeof (g_test_add_vtable) IA__g_test_add_vtable __attribute((visibility("hidden"))); -#define g_test_add_vtable IA__g_test_add_vtable - -extern __typeof (g_test_bug) IA__g_test_bug __attribute((visibility("hidden"))); -#define g_test_bug IA__g_test_bug - -extern __typeof (g_test_bug_base) IA__g_test_bug_base __attribute((visibility("hidden"))); -#define g_test_bug_base IA__g_test_bug_base - -extern __typeof (g_test_create_case) IA__g_test_create_case __attribute((visibility("hidden"))); -#define g_test_create_case IA__g_test_create_case - -extern __typeof (g_test_create_suite) IA__g_test_create_suite __attribute((visibility("hidden"))); -#define g_test_create_suite IA__g_test_create_suite - -extern __typeof (g_test_get_root) IA__g_test_get_root __attribute((visibility("hidden"))); -#define g_test_get_root IA__g_test_get_root - -extern __typeof (g_test_init) IA__g_test_init __attribute((visibility("hidden"))); -#define g_test_init IA__g_test_init - -extern __typeof (g_test_log_buffer_free) IA__g_test_log_buffer_free __attribute((visibility("hidden"))); -#define g_test_log_buffer_free IA__g_test_log_buffer_free - -extern __typeof (g_test_log_buffer_new) IA__g_test_log_buffer_new __attribute((visibility("hidden"))); -#define g_test_log_buffer_new IA__g_test_log_buffer_new - -extern __typeof (g_test_log_buffer_pop) IA__g_test_log_buffer_pop __attribute((visibility("hidden"))); -#define g_test_log_buffer_pop IA__g_test_log_buffer_pop - -extern __typeof (g_test_log_buffer_push) IA__g_test_log_buffer_push __attribute((visibility("hidden"))); -#define g_test_log_buffer_push IA__g_test_log_buffer_push - -extern __typeof (g_test_log_msg_free) IA__g_test_log_msg_free __attribute((visibility("hidden"))); -#define g_test_log_msg_free IA__g_test_log_msg_free - -extern __typeof (g_test_log_type_name) IA__g_test_log_type_name __attribute((visibility("hidden"))); -#define g_test_log_type_name IA__g_test_log_type_name - -extern __typeof (g_test_maximized_result) IA__g_test_maximized_result __attribute((visibility("hidden"))); -#define g_test_maximized_result IA__g_test_maximized_result - -extern __typeof (g_test_message) IA__g_test_message __attribute((visibility("hidden"))); -#define g_test_message IA__g_test_message - -extern __typeof (g_test_minimized_result) IA__g_test_minimized_result __attribute((visibility("hidden"))); -#define g_test_minimized_result IA__g_test_minimized_result - -extern __typeof (g_test_queue_destroy) IA__g_test_queue_destroy __attribute((visibility("hidden"))); -#define g_test_queue_destroy IA__g_test_queue_destroy - -extern __typeof (g_test_queue_free) IA__g_test_queue_free __attribute((visibility("hidden"))); -#define g_test_queue_free IA__g_test_queue_free - -extern __typeof (g_test_rand_double) IA__g_test_rand_double __attribute((visibility("hidden"))); -#define g_test_rand_double IA__g_test_rand_double - -extern __typeof (g_test_rand_double_range) IA__g_test_rand_double_range __attribute((visibility("hidden"))); -#define g_test_rand_double_range IA__g_test_rand_double_range - -extern __typeof (g_test_rand_int) IA__g_test_rand_int __attribute((visibility("hidden"))); -#define g_test_rand_int IA__g_test_rand_int - -extern __typeof (g_test_rand_int_range) IA__g_test_rand_int_range __attribute((visibility("hidden"))); -#define g_test_rand_int_range IA__g_test_rand_int_range - -extern __typeof (g_test_run) IA__g_test_run __attribute((visibility("hidden"))); -#define g_test_run IA__g_test_run - -extern __typeof (g_test_run_suite) IA__g_test_run_suite __attribute((visibility("hidden"))); -#define g_test_run_suite IA__g_test_run_suite - -extern __typeof (g_test_suite_add) IA__g_test_suite_add __attribute((visibility("hidden"))); -#define g_test_suite_add IA__g_test_suite_add - -extern __typeof (g_test_suite_add_suite) IA__g_test_suite_add_suite __attribute((visibility("hidden"))); -#define g_test_suite_add_suite IA__g_test_suite_add_suite - -extern __typeof (g_test_timer_elapsed) IA__g_test_timer_elapsed __attribute((visibility("hidden"))); -#define g_test_timer_elapsed IA__g_test_timer_elapsed - -extern __typeof (g_test_timer_last) IA__g_test_timer_last __attribute((visibility("hidden"))); -#define g_test_timer_last IA__g_test_timer_last - -extern __typeof (g_test_timer_start) IA__g_test_timer_start __attribute((visibility("hidden"))); -#define g_test_timer_start IA__g_test_timer_start - -extern __typeof (g_test_trap_assertions) IA__g_test_trap_assertions __attribute((visibility("hidden"))); -#define g_test_trap_assertions IA__g_test_trap_assertions - -extern __typeof (g_test_trap_fork) IA__g_test_trap_fork __attribute((visibility("hidden"))); -#define g_test_trap_fork IA__g_test_trap_fork - -extern __typeof (g_test_trap_has_passed) IA__g_test_trap_has_passed __attribute((visibility("hidden"))); -#define g_test_trap_has_passed IA__g_test_trap_has_passed - -extern __typeof (g_test_trap_reached_timeout) IA__g_test_trap_reached_timeout __attribute((visibility("hidden"))); -#define g_test_trap_reached_timeout IA__g_test_trap_reached_timeout - -#endif -#endif -#if IN_HEADER(__G_TIMER_H__) -#if IN_FILE(__G_TIMER_C__) -extern __typeof (g_timer_continue) IA__g_timer_continue __attribute((visibility("hidden"))); -#define g_timer_continue IA__g_timer_continue - -extern __typeof (g_timer_destroy) IA__g_timer_destroy __attribute((visibility("hidden"))); -#define g_timer_destroy IA__g_timer_destroy - -extern __typeof (g_timer_elapsed) IA__g_timer_elapsed __attribute((visibility("hidden"))); -#define g_timer_elapsed IA__g_timer_elapsed - -extern __typeof (g_timer_new) IA__g_timer_new __attribute((visibility("hidden"))); -#define g_timer_new IA__g_timer_new - -extern __typeof (g_timer_reset) IA__g_timer_reset __attribute((visibility("hidden"))); -#define g_timer_reset IA__g_timer_reset - -extern __typeof (g_timer_start) IA__g_timer_start __attribute((visibility("hidden"))); -#define g_timer_start IA__g_timer_start - -extern __typeof (g_timer_stop) IA__g_timer_stop __attribute((visibility("hidden"))); -#define g_timer_stop IA__g_timer_stop - -extern __typeof (g_time_val_add) IA__g_time_val_add __attribute((visibility("hidden"))); -#define g_time_val_add IA__g_time_val_add - -extern __typeof (g_time_val_from_iso8601) IA__g_time_val_from_iso8601 __attribute((visibility("hidden"))); -#define g_time_val_from_iso8601 IA__g_time_val_from_iso8601 - -extern __typeof (g_time_val_to_iso8601) IA__g_time_val_to_iso8601 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_time_val_to_iso8601 IA__g_time_val_to_iso8601 - -extern __typeof (g_usleep) IA__g_usleep __attribute((visibility("hidden"))); -#define g_usleep IA__g_usleep - -#endif -#endif -#if IN_HEADER(__G_TREE_H__) -#if IN_FILE(__G_TREE_C__) -extern __typeof (g_tree_destroy) IA__g_tree_destroy __attribute((visibility("hidden"))); -#define g_tree_destroy IA__g_tree_destroy - -extern __typeof (g_tree_foreach) IA__g_tree_foreach __attribute((visibility("hidden"))); -#define g_tree_foreach IA__g_tree_foreach - -extern __typeof (g_tree_height) IA__g_tree_height __attribute((visibility("hidden"))); -#define g_tree_height IA__g_tree_height - -extern __typeof (g_tree_insert) IA__g_tree_insert __attribute((visibility("hidden"))); -#define g_tree_insert IA__g_tree_insert - -extern __typeof (g_tree_lookup) IA__g_tree_lookup __attribute((visibility("hidden"))); -#define g_tree_lookup IA__g_tree_lookup - -extern __typeof (g_tree_lookup_extended) IA__g_tree_lookup_extended __attribute((visibility("hidden"))); -#define g_tree_lookup_extended IA__g_tree_lookup_extended - -extern __typeof (g_tree_new) IA__g_tree_new __attribute((visibility("hidden"))); -#define g_tree_new IA__g_tree_new - -extern __typeof (g_tree_ref) IA__g_tree_ref __attribute((visibility("hidden"))); -#define g_tree_ref IA__g_tree_ref - -extern __typeof (g_tree_unref) IA__g_tree_unref __attribute((visibility("hidden"))); -#define g_tree_unref IA__g_tree_unref - -extern __typeof (g_tree_new_full) IA__g_tree_new_full __attribute((visibility("hidden"))); -#define g_tree_new_full IA__g_tree_new_full - -extern __typeof (g_tree_new_with_data) IA__g_tree_new_with_data __attribute((visibility("hidden"))); -#define g_tree_new_with_data IA__g_tree_new_with_data - -extern __typeof (g_tree_nnodes) IA__g_tree_nnodes __attribute((visibility("hidden"))); -#define g_tree_nnodes IA__g_tree_nnodes - -extern __typeof (g_tree_remove) IA__g_tree_remove __attribute((visibility("hidden"))); -#define g_tree_remove IA__g_tree_remove - -extern __typeof (g_tree_replace) IA__g_tree_replace __attribute((visibility("hidden"))); -#define g_tree_replace IA__g_tree_replace - -extern __typeof (g_tree_search) IA__g_tree_search __attribute((visibility("hidden"))); -#define g_tree_search IA__g_tree_search - -extern __typeof (g_tree_steal) IA__g_tree_steal __attribute((visibility("hidden"))); -#define g_tree_steal IA__g_tree_steal - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_tree_traverse) IA__g_tree_traverse __attribute((visibility("hidden"))); -#define g_tree_traverse IA__g_tree_traverse - -#endif -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNIBREAK_C__) -extern __typeof (g_unichar_break_type) IA__g_unichar_break_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_break_type IA__g_unichar_break_type - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNICOLLATE_C__) -extern __typeof (g_utf8_collate) IA__g_utf8_collate __attribute((visibility("hidden"))); -#define g_utf8_collate IA__g_utf8_collate - -extern __typeof (g_utf8_collate_key) IA__g_utf8_collate_key __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_collate_key IA__g_utf8_collate_key - -extern __typeof (g_utf8_collate_key_for_filename) IA__g_utf8_collate_key_for_filename __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_collate_key_for_filename IA__g_utf8_collate_key_for_filename - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNIDECOMP_C__) -extern __typeof (g_unicode_canonical_decomposition) IA__g_unicode_canonical_decomposition __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_unicode_canonical_decomposition IA__g_unicode_canonical_decomposition - -extern __typeof (g_unicode_canonical_ordering) IA__g_unicode_canonical_ordering __attribute((visibility("hidden"))); -#define g_unicode_canonical_ordering IA__g_unicode_canonical_ordering - -extern __typeof (g_unichar_combining_class) IA__g_unichar_combining_class __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_combining_class IA__g_unichar_combining_class - -extern __typeof (g_utf8_normalize) IA__g_utf8_normalize __attribute((visibility("hidden"))); -#define g_utf8_normalize IA__g_utf8_normalize - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNIPROP_C__) -extern __typeof (g_unichar_isalnum) IA__g_unichar_isalnum __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isalnum IA__g_unichar_isalnum - -extern __typeof (g_unichar_isalpha) IA__g_unichar_isalpha __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isalpha IA__g_unichar_isalpha - -extern __typeof (g_unichar_iscntrl) IA__g_unichar_iscntrl __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_iscntrl IA__g_unichar_iscntrl - -extern __typeof (g_unichar_isdefined) IA__g_unichar_isdefined __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isdefined IA__g_unichar_isdefined - -extern __typeof (g_unichar_isdigit) IA__g_unichar_isdigit __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isdigit IA__g_unichar_isdigit - -extern __typeof (g_unichar_isgraph) IA__g_unichar_isgraph __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isgraph IA__g_unichar_isgraph - -extern __typeof (g_unichar_islower) IA__g_unichar_islower __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_islower IA__g_unichar_islower - -extern __typeof (g_unichar_isprint) IA__g_unichar_isprint __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isprint IA__g_unichar_isprint - -extern __typeof (g_unichar_ispunct) IA__g_unichar_ispunct __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_ispunct IA__g_unichar_ispunct - -extern __typeof (g_unichar_isspace) IA__g_unichar_isspace __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isspace IA__g_unichar_isspace - -extern __typeof (g_unichar_istitle) IA__g_unichar_istitle __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_istitle IA__g_unichar_istitle - -extern __typeof (g_unichar_isupper) IA__g_unichar_isupper __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isupper IA__g_unichar_isupper - -extern __typeof (g_unichar_iswide) IA__g_unichar_iswide __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_iswide IA__g_unichar_iswide - -extern __typeof (g_unichar_iswide_cjk) IA__g_unichar_iswide_cjk __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_iswide_cjk IA__g_unichar_iswide_cjk - -extern __typeof (g_unichar_isxdigit) IA__g_unichar_isxdigit __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_isxdigit IA__g_unichar_isxdigit - -extern __typeof (g_unichar_iszerowidth) IA__g_unichar_iszerowidth __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_iszerowidth IA__g_unichar_iszerowidth - -extern __typeof (g_unichar_tolower) IA__g_unichar_tolower __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_tolower IA__g_unichar_tolower - -extern __typeof (g_unichar_totitle) IA__g_unichar_totitle __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_totitle IA__g_unichar_totitle - -extern __typeof (g_unichar_toupper) IA__g_unichar_toupper __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_toupper IA__g_unichar_toupper - -extern __typeof (g_unichar_ismark) IA__g_unichar_ismark __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_ismark IA__g_unichar_ismark - -extern __typeof (g_unichar_get_mirror_char) IA__g_unichar_get_mirror_char __attribute((visibility("hidden"))); -#define g_unichar_get_mirror_char IA__g_unichar_get_mirror_char - -extern __typeof (g_unichar_get_script) IA__g_unichar_get_script __attribute((visibility("hidden"))); -#define g_unichar_get_script IA__g_unichar_get_script - -extern __typeof (g_unichar_digit_value) IA__g_unichar_digit_value __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_digit_value IA__g_unichar_digit_value - -extern __typeof (g_unichar_xdigit_value) IA__g_unichar_xdigit_value __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_xdigit_value IA__g_unichar_xdigit_value - -extern __typeof (g_unichar_type) IA__g_unichar_type __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_unichar_type IA__g_unichar_type - -extern __typeof (g_utf8_casefold) IA__g_utf8_casefold __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_casefold IA__g_utf8_casefold - -extern __typeof (g_utf8_strup) IA__g_utf8_strup __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_strup IA__g_utf8_strup - -extern __typeof (g_utf8_strdown) IA__g_utf8_strdown __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_strdown IA__g_utf8_strdown - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UTF8_C__) -extern __typeof (g_get_charset) IA__g_get_charset __attribute((visibility("hidden"))); -#define g_get_charset IA__g_get_charset - -extern __typeof (g_ucs4_to_utf16) IA__g_ucs4_to_utf16 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_ucs4_to_utf16 IA__g_ucs4_to_utf16 - -extern __typeof (g_ucs4_to_utf8) IA__g_ucs4_to_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_ucs4_to_utf8 IA__g_ucs4_to_utf8 - -extern __typeof (g_utf16_to_ucs4) IA__g_utf16_to_ucs4 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf16_to_ucs4 IA__g_utf16_to_ucs4 - -extern __typeof (g_utf16_to_utf8) IA__g_utf16_to_utf8 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf16_to_utf8 IA__g_utf16_to_utf8 - -extern __typeof (g_utf8_find_next_char) IA__g_utf8_find_next_char __attribute((visibility("hidden"))); -#define g_utf8_find_next_char IA__g_utf8_find_next_char - -extern __typeof (g_utf8_find_prev_char) IA__g_utf8_find_prev_char __attribute((visibility("hidden"))); -#define g_utf8_find_prev_char IA__g_utf8_find_prev_char - -extern __typeof (g_utf8_get_char) IA__g_utf8_get_char __attribute((visibility("hidden"))); -#define g_utf8_get_char IA__g_utf8_get_char - -extern __typeof (g_utf8_get_char_validated) IA__g_utf8_get_char_validated __attribute((visibility("hidden"))); -#define g_utf8_get_char_validated IA__g_utf8_get_char_validated - -extern __typeof (g_utf8_offset_to_pointer) IA__g_utf8_offset_to_pointer __attribute((visibility("hidden"))); -#define g_utf8_offset_to_pointer IA__g_utf8_offset_to_pointer - -extern __typeof (g_utf8_pointer_to_offset) IA__g_utf8_pointer_to_offset __attribute((visibility("hidden"))); -#define g_utf8_pointer_to_offset IA__g_utf8_pointer_to_offset - -extern __typeof (g_utf8_prev_char) IA__g_utf8_prev_char __attribute((visibility("hidden"))); -#define g_utf8_prev_char IA__g_utf8_prev_char - -extern __typeof (g_utf8_strchr) IA__g_utf8_strchr __attribute((visibility("hidden"))); -#define g_utf8_strchr IA__g_utf8_strchr - -extern __typeof (g_utf8_strlen) IA__g_utf8_strlen __attribute((visibility("hidden"))); -#define g_utf8_strlen IA__g_utf8_strlen - -extern __typeof (g_utf8_strncpy) IA__g_utf8_strncpy __attribute((visibility("hidden"))); -#define g_utf8_strncpy IA__g_utf8_strncpy - -extern __typeof (g_utf8_strrchr) IA__g_utf8_strrchr __attribute((visibility("hidden"))); -#define g_utf8_strrchr IA__g_utf8_strrchr - -extern __typeof (g_utf8_strreverse) IA__g_utf8_strreverse __attribute((visibility("hidden"))); -#define g_utf8_strreverse IA__g_utf8_strreverse - -extern __typeof (g_utf8_to_ucs4) IA__g_utf8_to_ucs4 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_to_ucs4 IA__g_utf8_to_ucs4 - -extern __typeof (g_utf8_to_ucs4_fast) IA__g_utf8_to_ucs4_fast __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_to_ucs4_fast IA__g_utf8_to_ucs4_fast - -extern __typeof (g_utf8_to_utf16) IA__g_utf8_to_utf16 __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_utf8_to_utf16 IA__g_utf8_to_utf16 - -extern __typeof (g_utf8_validate) IA__g_utf8_validate __attribute((visibility("hidden"))); -#define g_utf8_validate IA__g_utf8_validate - -extern __typeof (g_unichar_to_utf8) IA__g_unichar_to_utf8 __attribute((visibility("hidden"))); -#define g_unichar_to_utf8 IA__g_unichar_to_utf8 - -extern __typeof (g_unichar_validate) IA__g_unichar_validate __attribute((visibility("hidden"))); -#define g_unichar_validate IA__g_unichar_validate - -#endif -#endif -#if IN_HEADER(__GLIBINTL_H__) -#if IN_FILE(__G_UTILS_C__) -extern __typeof (glib_gettext) IA__glib_gettext __attribute((visibility("hidden"))) G_GNUC_FORMAT(1); -#define glib_gettext IA__glib_gettext - -#endif -#endif -#if IN_HEADER(__G_HASH_H__) -#if IN_FILE(__G_UTILS_C__) -extern __typeof (g_int_equal) IA__g_int_equal __attribute((visibility("hidden"))); -#define g_int_equal IA__g_int_equal - -extern __typeof (g_int_hash) IA__g_int_hash __attribute((visibility("hidden"))); -#define g_int_hash IA__g_int_hash - -extern __typeof (g_int64_equal) IA__g_int64_equal __attribute((visibility("hidden"))); -#define g_int64_equal IA__g_int64_equal - -extern __typeof (g_int64_hash) IA__g_int64_hash __attribute((visibility("hidden"))); -#define g_int64_hash IA__g_int64_hash - -extern __typeof (g_double_equal) IA__g_double_equal __attribute((visibility("hidden"))); -#define g_double_equal IA__g_double_equal - -extern __typeof (g_double_hash) IA__g_double_hash __attribute((visibility("hidden"))); -#define g_double_hash IA__g_double_hash - -extern __typeof (g_direct_equal) IA__g_direct_equal __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_direct_equal IA__g_direct_equal - -extern __typeof (g_direct_hash) IA__g_direct_hash __attribute((visibility("hidden"))) G_GNUC_CONST; -#define g_direct_hash IA__g_direct_hash - -#endif -#if IN_FILE(__G_STRING_C__) -extern __typeof (g_str_equal) IA__g_str_equal __attribute((visibility("hidden"))); -#define g_str_equal IA__g_str_equal - -extern __typeof (g_str_hash) IA__g_str_hash __attribute((visibility("hidden"))); -#define g_str_hash IA__g_str_hash - -#endif -#endif -#if IN_HEADER(__G_UTILS_H__) -#if IN_FILE(__G_UTILS_C__) -extern __typeof (g_atexit) IA__g_atexit __attribute((visibility("hidden"))); -#define g_atexit IA__g_atexit - -#ifndef G_DISABLE_DEPRECATED -extern __typeof (g_basename) IA__g_basename __attribute((visibility("hidden"))); -#define g_basename IA__g_basename - -#endif -extern __typeof (g_get_application_name) IA__g_get_application_name __attribute((visibility("hidden"))); -#define g_get_application_name IA__g_get_application_name - -#ifndef _WIN64 -extern __typeof (g_find_program_in_path) IA__g_find_program_in_path __attribute((visibility("hidden"))); -#define g_find_program_in_path IA__g_find_program_in_path - -extern __typeof (g_get_current_dir) IA__g_get_current_dir __attribute((visibility("hidden"))); -#define g_get_current_dir IA__g_get_current_dir - -extern __typeof (g_getenv) IA__g_getenv __attribute((visibility("hidden"))); -#define g_getenv IA__g_getenv - -extern __typeof (g_unsetenv) IA__g_unsetenv __attribute((visibility("hidden"))); -#define g_unsetenv IA__g_unsetenv - -extern __typeof (g_get_home_dir) IA__g_get_home_dir __attribute((visibility("hidden"))); -#define g_get_home_dir IA__g_get_home_dir - -#endif -extern __typeof (g_get_host_name) IA__g_get_host_name __attribute((visibility("hidden"))); -#define g_get_host_name IA__g_get_host_name - -#ifndef _WIN64 -extern __typeof (g_setenv) IA__g_setenv __attribute((visibility("hidden"))); -#define g_setenv IA__g_setenv - -#endif -extern __typeof (g_listenv) IA__g_listenv __attribute((visibility("hidden"))); -#define g_listenv IA__g_listenv - -#ifdef G_OS_WIN32 -extern __typeof (g_find_program_in_path_utf8) IA__g_find_program_in_path_utf8 __attribute((visibility("hidden"))); -#define g_find_program_in_path_utf8 IA__g_find_program_in_path_utf8 - -extern __typeof (g_get_current_dir_utf8) IA__g_get_current_dir_utf8 __attribute((visibility("hidden"))); -#define g_get_current_dir_utf8 IA__g_get_current_dir_utf8 - -extern __typeof (g_getenv_utf8) IA__g_getenv_utf8 __attribute((visibility("hidden"))); -#define g_getenv_utf8 IA__g_getenv_utf8 - -extern __typeof (g_unsetenv_utf8) IA__g_unsetenv_utf8 __attribute((visibility("hidden"))); -#define g_unsetenv_utf8 IA__g_unsetenv_utf8 - -extern __typeof (g_setenv_utf8) IA__g_setenv_utf8 __attribute((visibility("hidden"))); -#define g_setenv_utf8 IA__g_setenv_utf8 - -extern __typeof (g_get_home_dir_utf8) IA__g_get_home_dir_utf8 __attribute((visibility("hidden"))); -#define g_get_home_dir_utf8 IA__g_get_home_dir_utf8 - -#endif -extern __typeof (g_get_language_names) IA__g_get_language_names __attribute((visibility("hidden"))); -#define g_get_language_names IA__g_get_language_names - -extern __typeof (g_get_prgname) IA__g_get_prgname __attribute((visibility("hidden"))); -#define g_get_prgname IA__g_get_prgname - -#ifndef _WIN64 -extern __typeof (g_get_real_name) IA__g_get_real_name __attribute((visibility("hidden"))); -#define g_get_real_name IA__g_get_real_name - -#endif -#ifdef G_OS_WIN32 -extern __typeof (g_get_real_name_utf8) IA__g_get_real_name_utf8 __attribute((visibility("hidden"))); -#define g_get_real_name_utf8 IA__g_get_real_name_utf8 - -#endif -extern __typeof (g_get_system_config_dirs) IA__g_get_system_config_dirs __attribute((visibility("hidden"))); -#define g_get_system_config_dirs IA__g_get_system_config_dirs - -extern __typeof (g_get_system_data_dirs) IA__g_get_system_data_dirs __attribute((visibility("hidden"))); -#define g_get_system_data_dirs IA__g_get_system_data_dirs - -#ifdef G_OS_WIN32 -extern __typeof (g_win32_get_system_data_dirs_for_module) IA__g_win32_get_system_data_dirs_for_module __attribute((visibility("hidden"))); -#define g_win32_get_system_data_dirs_for_module IA__g_win32_get_system_data_dirs_for_module - -#endif -#ifndef _WIN64 -extern __typeof (g_get_tmp_dir) IA__g_get_tmp_dir __attribute((visibility("hidden"))); -#define g_get_tmp_dir IA__g_get_tmp_dir - -#endif -#ifdef G_OS_WIN32 -extern __typeof (g_get_tmp_dir_utf8) IA__g_get_tmp_dir_utf8 __attribute((visibility("hidden"))); -#define g_get_tmp_dir_utf8 IA__g_get_tmp_dir_utf8 - -#endif -extern __typeof (g_get_user_cache_dir) IA__g_get_user_cache_dir __attribute((visibility("hidden"))); -#define g_get_user_cache_dir IA__g_get_user_cache_dir - -extern __typeof (g_get_user_config_dir) IA__g_get_user_config_dir __attribute((visibility("hidden"))); -#define g_get_user_config_dir IA__g_get_user_config_dir - -extern __typeof (g_get_user_data_dir) IA__g_get_user_data_dir __attribute((visibility("hidden"))); -#define g_get_user_data_dir IA__g_get_user_data_dir - -extern __typeof (g_reload_user_special_dirs_cache) IA__g_reload_user_special_dirs_cache __attribute((visibility("hidden"))); -#define g_reload_user_special_dirs_cache IA__g_reload_user_special_dirs_cache - -extern __typeof (g_get_user_special_dir) IA__g_get_user_special_dir __attribute((visibility("hidden"))); -#define g_get_user_special_dir IA__g_get_user_special_dir - -#ifndef _WIN64 -extern __typeof (g_get_user_name) IA__g_get_user_name __attribute((visibility("hidden"))); -#define g_get_user_name IA__g_get_user_name - -#endif -#ifdef G_OS_WIN32 -extern __typeof (g_get_user_name_utf8) IA__g_get_user_name_utf8 __attribute((visibility("hidden"))); -#define g_get_user_name_utf8 IA__g_get_user_name_utf8 - -#endif -extern __typeof (glib_check_version) IA__glib_check_version __attribute((visibility("hidden"))); -#define glib_check_version IA__glib_check_version - -extern __typeof (g_nullify_pointer) IA__g_nullify_pointer __attribute((visibility("hidden"))); -#define g_nullify_pointer IA__g_nullify_pointer - -extern __typeof (g_parse_debug_string) IA__g_parse_debug_string __attribute((visibility("hidden"))); -#define g_parse_debug_string IA__g_parse_debug_string - -extern __typeof (g_path_get_basename) IA__g_path_get_basename __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_path_get_basename IA__g_path_get_basename - -extern __typeof (g_path_get_dirname) IA__g_path_get_dirname __attribute((visibility("hidden"))) G_GNUC_MALLOC; -#define g_path_get_dirname IA__g_path_get_dirname - -extern __typeof (g_path_is_absolute) IA__g_path_is_absolute __attribute((visibility("hidden"))); -#define g_path_is_absolute IA__g_path_is_absolute - -extern __typeof (g_path_skip_root) IA__g_path_skip_root __attribute((visibility("hidden"))); -#define g_path_skip_root IA__g_path_skip_root - -extern __typeof (g_set_application_name) IA__g_set_application_name __attribute((visibility("hidden"))); -#define g_set_application_name IA__g_set_application_name - -extern __typeof (g_set_prgname) IA__g_set_prgname __attribute((visibility("hidden"))); -#define g_set_prgname IA__g_set_prgname - -#endif -#endif -#if IN_HEADER(__G_REGEX_H__) -#if IN_FILE(__G_REGEX_C__) -extern __typeof (g_regex_error_quark) IA__g_regex_error_quark __attribute((visibility("hidden"))); -#define g_regex_error_quark IA__g_regex_error_quark - -extern __typeof (g_regex_new) IA__g_regex_new __attribute((visibility("hidden"))); -#define g_regex_new IA__g_regex_new - -extern __typeof (g_regex_ref) IA__g_regex_ref __attribute((visibility("hidden"))); -#define g_regex_ref IA__g_regex_ref - -extern __typeof (g_regex_unref) IA__g_regex_unref __attribute((visibility("hidden"))); -#define g_regex_unref IA__g_regex_unref - -extern __typeof (g_regex_get_pattern) IA__g_regex_get_pattern __attribute((visibility("hidden"))); -#define g_regex_get_pattern IA__g_regex_get_pattern - -extern __typeof (g_regex_get_max_backref) IA__g_regex_get_max_backref __attribute((visibility("hidden"))); -#define g_regex_get_max_backref IA__g_regex_get_max_backref - -extern __typeof (g_regex_get_capture_count) IA__g_regex_get_capture_count __attribute((visibility("hidden"))); -#define g_regex_get_capture_count IA__g_regex_get_capture_count - -extern __typeof (g_regex_get_string_number) IA__g_regex_get_string_number __attribute((visibility("hidden"))); -#define g_regex_get_string_number IA__g_regex_get_string_number - -extern __typeof (g_regex_escape_string) IA__g_regex_escape_string __attribute((visibility("hidden"))); -#define g_regex_escape_string IA__g_regex_escape_string - -extern __typeof (g_regex_match_simple) IA__g_regex_match_simple __attribute((visibility("hidden"))); -#define g_regex_match_simple IA__g_regex_match_simple - -extern __typeof (g_regex_match) IA__g_regex_match __attribute((visibility("hidden"))); -#define g_regex_match IA__g_regex_match - -extern __typeof (g_regex_match_full) IA__g_regex_match_full __attribute((visibility("hidden"))); -#define g_regex_match_full IA__g_regex_match_full - -extern __typeof (g_regex_match_all) IA__g_regex_match_all __attribute((visibility("hidden"))); -#define g_regex_match_all IA__g_regex_match_all - -extern __typeof (g_regex_match_all_full) IA__g_regex_match_all_full __attribute((visibility("hidden"))); -#define g_regex_match_all_full IA__g_regex_match_all_full - -extern __typeof (g_regex_split_simple) IA__g_regex_split_simple __attribute((visibility("hidden"))); -#define g_regex_split_simple IA__g_regex_split_simple - -extern __typeof (g_regex_split) IA__g_regex_split __attribute((visibility("hidden"))); -#define g_regex_split IA__g_regex_split - -extern __typeof (g_regex_split_full) IA__g_regex_split_full __attribute((visibility("hidden"))); -#define g_regex_split_full IA__g_regex_split_full - -extern __typeof (g_regex_replace) IA__g_regex_replace __attribute((visibility("hidden"))); -#define g_regex_replace IA__g_regex_replace - -extern __typeof (g_regex_replace_literal) IA__g_regex_replace_literal __attribute((visibility("hidden"))); -#define g_regex_replace_literal IA__g_regex_replace_literal - -extern __typeof (g_regex_replace_eval) IA__g_regex_replace_eval __attribute((visibility("hidden"))); -#define g_regex_replace_eval IA__g_regex_replace_eval - -extern __typeof (g_regex_check_replacement) IA__g_regex_check_replacement __attribute((visibility("hidden"))); -#define g_regex_check_replacement IA__g_regex_check_replacement - -extern __typeof (g_match_info_get_regex) IA__g_match_info_get_regex __attribute((visibility("hidden"))); -#define g_match_info_get_regex IA__g_match_info_get_regex - -extern __typeof (g_match_info_get_string) IA__g_match_info_get_string __attribute((visibility("hidden"))); -#define g_match_info_get_string IA__g_match_info_get_string - -extern __typeof (g_match_info_free) IA__g_match_info_free __attribute((visibility("hidden"))); -#define g_match_info_free IA__g_match_info_free - -extern __typeof (g_match_info_next) IA__g_match_info_next __attribute((visibility("hidden"))); -#define g_match_info_next IA__g_match_info_next - -extern __typeof (g_match_info_matches) IA__g_match_info_matches __attribute((visibility("hidden"))); -#define g_match_info_matches IA__g_match_info_matches - -extern __typeof (g_match_info_get_match_count) IA__g_match_info_get_match_count __attribute((visibility("hidden"))); -#define g_match_info_get_match_count IA__g_match_info_get_match_count - -extern __typeof (g_match_info_is_partial_match) IA__g_match_info_is_partial_match __attribute((visibility("hidden"))); -#define g_match_info_is_partial_match IA__g_match_info_is_partial_match - -extern __typeof (g_match_info_expand_references) IA__g_match_info_expand_references __attribute((visibility("hidden"))); -#define g_match_info_expand_references IA__g_match_info_expand_references - -extern __typeof (g_match_info_fetch) IA__g_match_info_fetch __attribute((visibility("hidden"))); -#define g_match_info_fetch IA__g_match_info_fetch - -extern __typeof (g_match_info_fetch_pos) IA__g_match_info_fetch_pos __attribute((visibility("hidden"))); -#define g_match_info_fetch_pos IA__g_match_info_fetch_pos - -extern __typeof (g_match_info_fetch_named) IA__g_match_info_fetch_named __attribute((visibility("hidden"))); -#define g_match_info_fetch_named IA__g_match_info_fetch_named - -extern __typeof (g_match_info_fetch_named_pos) IA__g_match_info_fetch_named_pos __attribute((visibility("hidden"))); -#define g_match_info_fetch_named_pos IA__g_match_info_fetch_named_pos - -extern __typeof (g_match_info_fetch_all) IA__g_match_info_fetch_all __attribute((visibility("hidden"))); -#define g_match_info_fetch_all IA__g_match_info_fetch_all - -#endif -#endif -#if IN_HEADER(__G_VARIANT_TYPE_H__) -#if IN_FILE(__G_VARIANT_TYPE_C__) -extern __typeof (g_variant_type_string_is_valid) IA__g_variant_type_string_is_valid __attribute((visibility("hidden"))); -#define g_variant_type_string_is_valid IA__g_variant_type_string_is_valid - -extern __typeof (g_variant_type_string_scan) IA__g_variant_type_string_scan __attribute((visibility("hidden"))); -#define g_variant_type_string_scan IA__g_variant_type_string_scan - -extern __typeof (g_variant_type_free) IA__g_variant_type_free __attribute((visibility("hidden"))); -#define g_variant_type_free IA__g_variant_type_free - -extern __typeof (g_variant_type_copy) IA__g_variant_type_copy __attribute((visibility("hidden"))); -#define g_variant_type_copy IA__g_variant_type_copy - -extern __typeof (g_variant_type_new) IA__g_variant_type_new __attribute((visibility("hidden"))); -#define g_variant_type_new IA__g_variant_type_new - -extern __typeof (g_variant_type_get_string_length) IA__g_variant_type_get_string_length __attribute((visibility("hidden"))); -#define g_variant_type_get_string_length IA__g_variant_type_get_string_length - -extern __typeof (g_variant_type_peek_string) IA__g_variant_type_peek_string __attribute((visibility("hidden"))); -#define g_variant_type_peek_string IA__g_variant_type_peek_string - -extern __typeof (g_variant_type_dup_string) IA__g_variant_type_dup_string __attribute((visibility("hidden"))); -#define g_variant_type_dup_string IA__g_variant_type_dup_string - -extern __typeof (g_variant_type_is_definite) IA__g_variant_type_is_definite __attribute((visibility("hidden"))); -#define g_variant_type_is_definite IA__g_variant_type_is_definite - -extern __typeof (g_variant_type_is_container) IA__g_variant_type_is_container __attribute((visibility("hidden"))); -#define g_variant_type_is_container IA__g_variant_type_is_container - -extern __typeof (g_variant_type_is_basic) IA__g_variant_type_is_basic __attribute((visibility("hidden"))); -#define g_variant_type_is_basic IA__g_variant_type_is_basic - -extern __typeof (g_variant_type_is_maybe) IA__g_variant_type_is_maybe __attribute((visibility("hidden"))); -#define g_variant_type_is_maybe IA__g_variant_type_is_maybe - -extern __typeof (g_variant_type_is_array) IA__g_variant_type_is_array __attribute((visibility("hidden"))); -#define g_variant_type_is_array IA__g_variant_type_is_array - -extern __typeof (g_variant_type_is_tuple) IA__g_variant_type_is_tuple __attribute((visibility("hidden"))); -#define g_variant_type_is_tuple IA__g_variant_type_is_tuple - -extern __typeof (g_variant_type_is_dict_entry) IA__g_variant_type_is_dict_entry __attribute((visibility("hidden"))); -#define g_variant_type_is_dict_entry IA__g_variant_type_is_dict_entry - -extern __typeof (g_variant_type_is_variant) IA__g_variant_type_is_variant __attribute((visibility("hidden"))); -#define g_variant_type_is_variant IA__g_variant_type_is_variant - -extern __typeof (g_variant_type_hash) IA__g_variant_type_hash __attribute((visibility("hidden"))); -#define g_variant_type_hash IA__g_variant_type_hash - -extern __typeof (g_variant_type_equal) IA__g_variant_type_equal __attribute((visibility("hidden"))); -#define g_variant_type_equal IA__g_variant_type_equal - -extern __typeof (g_variant_type_is_subtype_of) IA__g_variant_type_is_subtype_of __attribute((visibility("hidden"))); -#define g_variant_type_is_subtype_of IA__g_variant_type_is_subtype_of - -extern __typeof (g_variant_type_element) IA__g_variant_type_element __attribute((visibility("hidden"))); -#define g_variant_type_element IA__g_variant_type_element - -extern __typeof (g_variant_type_first) IA__g_variant_type_first __attribute((visibility("hidden"))); -#define g_variant_type_first IA__g_variant_type_first - -extern __typeof (g_variant_type_next) IA__g_variant_type_next __attribute((visibility("hidden"))); -#define g_variant_type_next IA__g_variant_type_next - -extern __typeof (g_variant_type_n_items) IA__g_variant_type_n_items __attribute((visibility("hidden"))); -#define g_variant_type_n_items IA__g_variant_type_n_items - -extern __typeof (g_variant_type_key) IA__g_variant_type_key __attribute((visibility("hidden"))); -#define g_variant_type_key IA__g_variant_type_key - -extern __typeof (g_variant_type_value) IA__g_variant_type_value __attribute((visibility("hidden"))); -#define g_variant_type_value IA__g_variant_type_value - -extern __typeof (g_variant_type_new_array) IA__g_variant_type_new_array __attribute((visibility("hidden"))); -#define g_variant_type_new_array IA__g_variant_type_new_array - -extern __typeof (g_variant_type_new_maybe) IA__g_variant_type_new_maybe __attribute((visibility("hidden"))); -#define g_variant_type_new_maybe IA__g_variant_type_new_maybe - -extern __typeof (g_variant_type_new_tuple) IA__g_variant_type_new_tuple __attribute((visibility("hidden"))); -#define g_variant_type_new_tuple IA__g_variant_type_new_tuple - -extern __typeof (g_variant_type_new_dict_entry) IA__g_variant_type_new_dict_entry __attribute((visibility("hidden"))); -#define g_variant_type_new_dict_entry IA__g_variant_type_new_dict_entry - -extern __typeof (g_variant_type_checked_) IA__g_variant_type_checked_ __attribute((visibility("hidden"))); -#define g_variant_type_checked_ IA__g_variant_type_checked_ - -#endif -#endif -#if IN_HEADER(__G_VARIANT_H__) -#if IN_FILE(__G_VARIANT_CORE_C__) -extern __typeof (g_variant_unref) IA__g_variant_unref __attribute((visibility("hidden"))); -#define g_variant_unref IA__g_variant_unref - -extern __typeof (g_variant_ref) IA__g_variant_ref __attribute((visibility("hidden"))); -#define g_variant_ref IA__g_variant_ref - -extern __typeof (g_variant_ref_sink) IA__g_variant_ref_sink __attribute((visibility("hidden"))); -#define g_variant_ref_sink IA__g_variant_ref_sink - -extern __typeof (g_variant_n_children) IA__g_variant_n_children __attribute((visibility("hidden"))); -#define g_variant_n_children IA__g_variant_n_children - -extern __typeof (g_variant_get_child_value) IA__g_variant_get_child_value __attribute((visibility("hidden"))); -#define g_variant_get_child_value IA__g_variant_get_child_value - -extern __typeof (g_variant_get_size) IA__g_variant_get_size __attribute((visibility("hidden"))); -#define g_variant_get_size IA__g_variant_get_size - -extern __typeof (g_variant_get_data) IA__g_variant_get_data __attribute((visibility("hidden"))); -#define g_variant_get_data IA__g_variant_get_data - -extern __typeof (g_variant_store) IA__g_variant_store __attribute((visibility("hidden"))); -#define g_variant_store IA__g_variant_store - -extern __typeof (g_variant_is_normal_form) IA__g_variant_is_normal_form __attribute((visibility("hidden"))); -#define g_variant_is_normal_form IA__g_variant_is_normal_form - -#endif -#if IN_FILE(__G_VARIANT_C__) -extern __typeof (g_variant_get_type) IA__g_variant_get_type __attribute((visibility("hidden"))); -#define g_variant_get_type IA__g_variant_get_type - -extern __typeof (g_variant_get_type_string) IA__g_variant_get_type_string __attribute((visibility("hidden"))); -#define g_variant_get_type_string IA__g_variant_get_type_string - -extern __typeof (g_variant_is_of_type) IA__g_variant_is_of_type __attribute((visibility("hidden"))); -#define g_variant_is_of_type IA__g_variant_is_of_type - -extern __typeof (g_variant_is_container) IA__g_variant_is_container __attribute((visibility("hidden"))); -#define g_variant_is_container IA__g_variant_is_container - -extern __typeof (g_variant_classify) IA__g_variant_classify __attribute((visibility("hidden"))); -#define g_variant_classify IA__g_variant_classify - -extern __typeof (g_variant_new_boolean) IA__g_variant_new_boolean __attribute((visibility("hidden"))); -#define g_variant_new_boolean IA__g_variant_new_boolean - -extern __typeof (g_variant_new_byte) IA__g_variant_new_byte __attribute((visibility("hidden"))); -#define g_variant_new_byte IA__g_variant_new_byte - -extern __typeof (g_variant_new_int16) IA__g_variant_new_int16 __attribute((visibility("hidden"))); -#define g_variant_new_int16 IA__g_variant_new_int16 - -extern __typeof (g_variant_new_uint16) IA__g_variant_new_uint16 __attribute((visibility("hidden"))); -#define g_variant_new_uint16 IA__g_variant_new_uint16 - -extern __typeof (g_variant_new_int32) IA__g_variant_new_int32 __attribute((visibility("hidden"))); -#define g_variant_new_int32 IA__g_variant_new_int32 - -extern __typeof (g_variant_new_uint32) IA__g_variant_new_uint32 __attribute((visibility("hidden"))); -#define g_variant_new_uint32 IA__g_variant_new_uint32 - -extern __typeof (g_variant_new_int64) IA__g_variant_new_int64 __attribute((visibility("hidden"))); -#define g_variant_new_int64 IA__g_variant_new_int64 - -extern __typeof (g_variant_new_uint64) IA__g_variant_new_uint64 __attribute((visibility("hidden"))); -#define g_variant_new_uint64 IA__g_variant_new_uint64 - -extern __typeof (g_variant_new_handle) IA__g_variant_new_handle __attribute((visibility("hidden"))); -#define g_variant_new_handle IA__g_variant_new_handle - -extern __typeof (g_variant_new_double) IA__g_variant_new_double __attribute((visibility("hidden"))); -#define g_variant_new_double IA__g_variant_new_double - -extern __typeof (g_variant_new_string) IA__g_variant_new_string __attribute((visibility("hidden"))); -#define g_variant_new_string IA__g_variant_new_string - -extern __typeof (g_variant_new_object_path) IA__g_variant_new_object_path __attribute((visibility("hidden"))); -#define g_variant_new_object_path IA__g_variant_new_object_path - -extern __typeof (g_variant_is_object_path) IA__g_variant_is_object_path __attribute((visibility("hidden"))); -#define g_variant_is_object_path IA__g_variant_is_object_path - -extern __typeof (g_variant_new_signature) IA__g_variant_new_signature __attribute((visibility("hidden"))); -#define g_variant_new_signature IA__g_variant_new_signature - -extern __typeof (g_variant_is_signature) IA__g_variant_is_signature __attribute((visibility("hidden"))); -#define g_variant_is_signature IA__g_variant_is_signature - -extern __typeof (g_variant_new_variant) IA__g_variant_new_variant __attribute((visibility("hidden"))); -#define g_variant_new_variant IA__g_variant_new_variant - -extern __typeof (g_variant_new_strv) IA__g_variant_new_strv __attribute((visibility("hidden"))); -#define g_variant_new_strv IA__g_variant_new_strv - -extern __typeof (g_variant_get_boolean) IA__g_variant_get_boolean __attribute((visibility("hidden"))); -#define g_variant_get_boolean IA__g_variant_get_boolean - -extern __typeof (g_variant_get_byte) IA__g_variant_get_byte __attribute((visibility("hidden"))); -#define g_variant_get_byte IA__g_variant_get_byte - -extern __typeof (g_variant_get_int16) IA__g_variant_get_int16 __attribute((visibility("hidden"))); -#define g_variant_get_int16 IA__g_variant_get_int16 - -extern __typeof (g_variant_get_uint16) IA__g_variant_get_uint16 __attribute((visibility("hidden"))); -#define g_variant_get_uint16 IA__g_variant_get_uint16 - -extern __typeof (g_variant_get_int32) IA__g_variant_get_int32 __attribute((visibility("hidden"))); -#define g_variant_get_int32 IA__g_variant_get_int32 - -extern __typeof (g_variant_get_uint32) IA__g_variant_get_uint32 __attribute((visibility("hidden"))); -#define g_variant_get_uint32 IA__g_variant_get_uint32 - -extern __typeof (g_variant_get_int64) IA__g_variant_get_int64 __attribute((visibility("hidden"))); -#define g_variant_get_int64 IA__g_variant_get_int64 - -extern __typeof (g_variant_get_uint64) IA__g_variant_get_uint64 __attribute((visibility("hidden"))); -#define g_variant_get_uint64 IA__g_variant_get_uint64 - -extern __typeof (g_variant_get_handle) IA__g_variant_get_handle __attribute((visibility("hidden"))); -#define g_variant_get_handle IA__g_variant_get_handle - -extern __typeof (g_variant_get_double) IA__g_variant_get_double __attribute((visibility("hidden"))); -#define g_variant_get_double IA__g_variant_get_double - -extern __typeof (g_variant_get_string) IA__g_variant_get_string __attribute((visibility("hidden"))); -#define g_variant_get_string IA__g_variant_get_string - -extern __typeof (g_variant_dup_string) IA__g_variant_dup_string __attribute((visibility("hidden"))); -#define g_variant_dup_string IA__g_variant_dup_string - -extern __typeof (g_variant_get_variant) IA__g_variant_get_variant __attribute((visibility("hidden"))); -#define g_variant_get_variant IA__g_variant_get_variant - -extern __typeof (g_variant_get_strv) IA__g_variant_get_strv __attribute((visibility("hidden"))); -#define g_variant_get_strv IA__g_variant_get_strv - -extern __typeof (g_variant_dup_strv) IA__g_variant_dup_strv __attribute((visibility("hidden"))); -#define g_variant_dup_strv IA__g_variant_dup_strv - -extern __typeof (g_variant_new_maybe) IA__g_variant_new_maybe __attribute((visibility("hidden"))); -#define g_variant_new_maybe IA__g_variant_new_maybe - -extern __typeof (g_variant_new_array) IA__g_variant_new_array __attribute((visibility("hidden"))); -#define g_variant_new_array IA__g_variant_new_array - -extern __typeof (g_variant_new_tuple) IA__g_variant_new_tuple __attribute((visibility("hidden"))); -#define g_variant_new_tuple IA__g_variant_new_tuple - -extern __typeof (g_variant_new_dict_entry) IA__g_variant_new_dict_entry __attribute((visibility("hidden"))); -#define g_variant_new_dict_entry IA__g_variant_new_dict_entry - -extern __typeof (g_variant_get_maybe) IA__g_variant_get_maybe __attribute((visibility("hidden"))); -#define g_variant_get_maybe IA__g_variant_get_maybe - -extern __typeof (g_variant_get_fixed_array) IA__g_variant_get_fixed_array __attribute((visibility("hidden"))); -#define g_variant_get_fixed_array IA__g_variant_get_fixed_array - -extern __typeof (g_variant_print) IA__g_variant_print __attribute((visibility("hidden"))); -#define g_variant_print IA__g_variant_print - -extern __typeof (g_variant_print_string) IA__g_variant_print_string __attribute((visibility("hidden"))); -#define g_variant_print_string IA__g_variant_print_string - -extern __typeof (g_variant_hash) IA__g_variant_hash __attribute((visibility("hidden"))); -#define g_variant_hash IA__g_variant_hash - -extern __typeof (g_variant_equal) IA__g_variant_equal __attribute((visibility("hidden"))); -#define g_variant_equal IA__g_variant_equal - -extern __typeof (g_variant_iter_copy) IA__g_variant_iter_copy __attribute((visibility("hidden"))); -#define g_variant_iter_copy IA__g_variant_iter_copy - -extern __typeof (g_variant_iter_free) IA__g_variant_iter_free __attribute((visibility("hidden"))); -#define g_variant_iter_free IA__g_variant_iter_free - -extern __typeof (g_variant_iter_init) IA__g_variant_iter_init __attribute((visibility("hidden"))); -#define g_variant_iter_init IA__g_variant_iter_init - -extern __typeof (g_variant_iter_n_children) IA__g_variant_iter_n_children __attribute((visibility("hidden"))); -#define g_variant_iter_n_children IA__g_variant_iter_n_children - -extern __typeof (g_variant_iter_new) IA__g_variant_iter_new __attribute((visibility("hidden"))); -#define g_variant_iter_new IA__g_variant_iter_new - -extern __typeof (g_variant_iter_next_value) IA__g_variant_iter_next_value __attribute((visibility("hidden"))); -#define g_variant_iter_next_value IA__g_variant_iter_next_value - -extern __typeof (g_variant_builder_add_value) IA__g_variant_builder_add_value __attribute((visibility("hidden"))); -#define g_variant_builder_add_value IA__g_variant_builder_add_value - -extern __typeof (g_variant_builder_init) IA__g_variant_builder_init __attribute((visibility("hidden"))); -#define g_variant_builder_init IA__g_variant_builder_init - -extern __typeof (g_variant_builder_clear) IA__g_variant_builder_clear __attribute((visibility("hidden"))); -#define g_variant_builder_clear IA__g_variant_builder_clear - -extern __typeof (g_variant_builder_open) IA__g_variant_builder_open __attribute((visibility("hidden"))); -#define g_variant_builder_open IA__g_variant_builder_open - -extern __typeof (g_variant_builder_close) IA__g_variant_builder_close __attribute((visibility("hidden"))); -#define g_variant_builder_close IA__g_variant_builder_close - -extern __typeof (g_variant_builder_end) IA__g_variant_builder_end __attribute((visibility("hidden"))); -#define g_variant_builder_end IA__g_variant_builder_end - -extern __typeof (g_variant_builder_new) IA__g_variant_builder_new __attribute((visibility("hidden"))); -#define g_variant_builder_new IA__g_variant_builder_new - -extern __typeof (g_variant_builder_unref) IA__g_variant_builder_unref __attribute((visibility("hidden"))); -#define g_variant_builder_unref IA__g_variant_builder_unref - -extern __typeof (g_variant_builder_ref) IA__g_variant_builder_ref __attribute((visibility("hidden"))); -#define g_variant_builder_ref IA__g_variant_builder_ref - -extern __typeof (g_variant_new_va) IA__g_variant_new_va __attribute((visibility("hidden"))); -#define g_variant_new_va IA__g_variant_new_va - -extern __typeof (g_variant_get_va) IA__g_variant_get_va __attribute((visibility("hidden"))); -#define g_variant_get_va IA__g_variant_get_va - -extern __typeof (g_variant_new) IA__g_variant_new __attribute((visibility("hidden"))); -#define g_variant_new IA__g_variant_new - -extern __typeof (g_variant_get) IA__g_variant_get __attribute((visibility("hidden"))); -#define g_variant_get IA__g_variant_get - -extern __typeof (g_variant_builder_add) IA__g_variant_builder_add __attribute((visibility("hidden"))); -#define g_variant_builder_add IA__g_variant_builder_add - -extern __typeof (g_variant_get_child) IA__g_variant_get_child __attribute((visibility("hidden"))); -#define g_variant_get_child IA__g_variant_get_child - -extern __typeof (g_variant_iter_next) IA__g_variant_iter_next __attribute((visibility("hidden"))); -#define g_variant_iter_next IA__g_variant_iter_next - -extern __typeof (g_variant_iter_loop) IA__g_variant_iter_loop __attribute((visibility("hidden"))); -#define g_variant_iter_loop IA__g_variant_iter_loop - -extern __typeof (g_variant_new_from_data) IA__g_variant_new_from_data __attribute((visibility("hidden"))); -#define g_variant_new_from_data IA__g_variant_new_from_data - -extern __typeof (g_variant_get_normal_form) IA__g_variant_get_normal_form __attribute((visibility("hidden"))); -#define g_variant_get_normal_form IA__g_variant_get_normal_form - -extern __typeof (g_variant_byteswap) IA__g_variant_byteswap __attribute((visibility("hidden"))); -#define g_variant_byteswap IA__g_variant_byteswap - -#endif -#if IN_FILE(__G_VARIANT_PARSER_C__) -extern __typeof (g_variant_new_parsed) IA__g_variant_new_parsed __attribute((visibility("hidden"))); -#define g_variant_new_parsed IA__g_variant_new_parsed - -extern __typeof (g_variant_new_parsed_va) IA__g_variant_new_parsed_va __attribute((visibility("hidden"))); -#define g_variant_new_parsed_va IA__g_variant_new_parsed_va - -extern __typeof (g_variant_parse) IA__g_variant_parse __attribute((visibility("hidden"))); -#define g_variant_parse IA__g_variant_parse - -extern __typeof (g_variant_parser_get_error_quark) IA__g_variant_parser_get_error_quark __attribute((visibility("hidden"))); -#define g_variant_parser_get_error_quark IA__g_variant_parser_get_error_quark - -#endif -#endif -#if IN_HEADER(__G_VARIANT_TYPE_INFO_H__) -#if IN_FILE(__G_VARIANT_TYPE_INFO_C__) -extern __typeof (g_variant_type_info_get_type_string) IA__g_variant_type_info_get_type_string __attribute((visibility("hidden"))); -#define g_variant_type_info_get_type_string IA__g_variant_type_info_get_type_string - -extern __typeof (g_variant_type_info_query) IA__g_variant_type_info_query __attribute((visibility("hidden"))); -#define g_variant_type_info_query IA__g_variant_type_info_query - -extern __typeof (g_variant_type_info_element) IA__g_variant_type_info_element __attribute((visibility("hidden"))); -#define g_variant_type_info_element IA__g_variant_type_info_element - -extern __typeof (g_variant_type_info_query_element) IA__g_variant_type_info_query_element __attribute((visibility("hidden"))); -#define g_variant_type_info_query_element IA__g_variant_type_info_query_element - -extern __typeof (g_variant_type_info_n_members) IA__g_variant_type_info_n_members __attribute((visibility("hidden"))); -#define g_variant_type_info_n_members IA__g_variant_type_info_n_members - -extern __typeof (g_variant_type_info_member_info) IA__g_variant_type_info_member_info __attribute((visibility("hidden"))); -#define g_variant_type_info_member_info IA__g_variant_type_info_member_info - -extern __typeof (g_variant_type_info_get) IA__g_variant_type_info_get __attribute((visibility("hidden"))); -#define g_variant_type_info_get IA__g_variant_type_info_get - -extern __typeof (g_variant_type_info_ref) IA__g_variant_type_info_ref __attribute((visibility("hidden"))); -#define g_variant_type_info_ref IA__g_variant_type_info_ref - -extern __typeof (g_variant_type_info_unref) IA__g_variant_type_info_unref __attribute((visibility("hidden"))); -#define g_variant_type_info_unref IA__g_variant_type_info_unref - -extern __typeof (g_variant_type_info_assert_no_infos) IA__g_variant_type_info_assert_no_infos __attribute((visibility("hidden"))); -#define g_variant_type_info_assert_no_infos IA__g_variant_type_info_assert_no_infos - -#endif -#endif -#if IN_HEADER(__G_VARIANT_SERIALISER_H__) -#if IN_FILE(__G_VARIANT_SERIALISER_C__) -extern __typeof (g_variant_serialised_byteswap) IA__g_variant_serialised_byteswap __attribute((visibility("hidden"))); -#define g_variant_serialised_byteswap IA__g_variant_serialised_byteswap - -extern __typeof (g_variant_serialised_get_child) IA__g_variant_serialised_get_child __attribute((visibility("hidden"))); -#define g_variant_serialised_get_child IA__g_variant_serialised_get_child - -extern __typeof (g_variant_serialised_is_normal) IA__g_variant_serialised_is_normal __attribute((visibility("hidden"))); -#define g_variant_serialised_is_normal IA__g_variant_serialised_is_normal - -extern __typeof (g_variant_serialised_n_children) IA__g_variant_serialised_n_children __attribute((visibility("hidden"))); -#define g_variant_serialised_n_children IA__g_variant_serialised_n_children - -extern __typeof (g_variant_serialiser_is_object_path) IA__g_variant_serialiser_is_object_path __attribute((visibility("hidden"))); -#define g_variant_serialiser_is_object_path IA__g_variant_serialiser_is_object_path - -extern __typeof (g_variant_serialiser_is_signature) IA__g_variant_serialiser_is_signature __attribute((visibility("hidden"))); -#define g_variant_serialiser_is_signature IA__g_variant_serialiser_is_signature - -extern __typeof (g_variant_serialiser_is_string) IA__g_variant_serialiser_is_string __attribute((visibility("hidden"))); -#define g_variant_serialiser_is_string IA__g_variant_serialiser_is_string - -extern __typeof (g_variant_serialiser_needed_size) IA__g_variant_serialiser_needed_size __attribute((visibility("hidden"))); -#define g_variant_serialiser_needed_size IA__g_variant_serialiser_needed_size - -extern __typeof (g_variant_serialiser_serialise) IA__g_variant_serialiser_serialise __attribute((visibility("hidden"))); -#define g_variant_serialiser_serialise IA__g_variant_serialiser_serialise - -#endif -#endif -#if IN_HEADER(__G_VARIANT_INTERNAL_H__) -#if IN_FILE(__G_VARIANT_C__) -extern __typeof (g_variant_format_string_scan_type) IA__g_variant_format_string_scan_type __attribute((visibility("hidden"))); -#define g_variant_format_string_scan_type IA__g_variant_format_string_scan_type - -extern __typeof (g_variant_format_string_scan) IA__g_variant_format_string_scan __attribute((visibility("hidden"))); -#define g_variant_format_string_scan IA__g_variant_format_string_scan - -#endif -#endif -#if IN_HEADER(__G_WIN32_H__) -#if IN_FILE(__G_WIN32_H__) -#ifdef G_OS_WIN32 -extern __typeof (g_win32_error_message) IA__g_win32_error_message __attribute((visibility("hidden"))); -#define g_win32_error_message IA__g_win32_error_message - -extern __typeof (g_win32_ftruncate) IA__g_win32_ftruncate __attribute((visibility("hidden"))); -#define g_win32_ftruncate IA__g_win32_ftruncate - -extern __typeof (g_win32_get_package_installation_directory_of_module) IA__g_win32_get_package_installation_directory_of_module __attribute((visibility("hidden"))); -#define g_win32_get_package_installation_directory_of_module IA__g_win32_get_package_installation_directory_of_module - -#ifndef _WIN64 -extern __typeof (g_win32_get_package_installation_directory) IA__g_win32_get_package_installation_directory __attribute((visibility("hidden"))); -#define g_win32_get_package_installation_directory IA__g_win32_get_package_installation_directory - -#endif -extern __typeof (g_win32_get_package_installation_directory_utf8) IA__g_win32_get_package_installation_directory_utf8 __attribute((visibility("hidden"))); -#define g_win32_get_package_installation_directory_utf8 IA__g_win32_get_package_installation_directory_utf8 - -#ifndef _WIN64 -extern __typeof (g_win32_get_package_installation_subdirectory) IA__g_win32_get_package_installation_subdirectory __attribute((visibility("hidden"))); -#define g_win32_get_package_installation_subdirectory IA__g_win32_get_package_installation_subdirectory - -#endif -extern __typeof (g_win32_get_package_installation_subdirectory_utf8) IA__g_win32_get_package_installation_subdirectory_utf8 __attribute((visibility("hidden"))); -#define g_win32_get_package_installation_subdirectory_utf8 IA__g_win32_get_package_installation_subdirectory_utf8 - -extern __typeof (g_win32_get_windows_version) IA__g_win32_get_windows_version __attribute((visibility("hidden"))); -#define g_win32_get_windows_version IA__g_win32_get_windows_version - -extern __typeof (g_win32_getlocale) IA__g_win32_getlocale __attribute((visibility("hidden"))); -#define g_win32_getlocale IA__g_win32_getlocale - -extern __typeof (g_win32_locale_filename_from_utf8) IA__g_win32_locale_filename_from_utf8 __attribute((visibility("hidden"))); -#define g_win32_locale_filename_from_utf8 IA__g_win32_locale_filename_from_utf8 - -#endif -#endif -#endif -#if IN_HEADER(__G_HOST_UTILS_H__) -#if IN_FILE(__G_HOST_UTILS_C__) -extern __typeof (g_hostname_is_non_ascii) IA__g_hostname_is_non_ascii __attribute((visibility("hidden"))); -#define g_hostname_is_non_ascii IA__g_hostname_is_non_ascii - -extern __typeof (g_hostname_is_ascii_encoded) IA__g_hostname_is_ascii_encoded __attribute((visibility("hidden"))); -#define g_hostname_is_ascii_encoded IA__g_hostname_is_ascii_encoded - -extern __typeof (g_hostname_is_ip_address) IA__g_hostname_is_ip_address __attribute((visibility("hidden"))); -#define g_hostname_is_ip_address IA__g_hostname_is_ip_address - -extern __typeof (g_hostname_to_ascii) IA__g_hostname_to_ascii __attribute((visibility("hidden"))); -#define g_hostname_to_ascii IA__g_hostname_to_ascii - -extern __typeof (g_hostname_to_unicode) IA__g_hostname_to_unicode __attribute((visibility("hidden"))); -#define g_hostname_to_unicode IA__g_hostname_to_unicode - -#endif -#endif - -#endif /* G_HAVE_GNUC_VISIBILITY */ -#endif /* DISABLE_VISIBILITY */ diff --git a/glib/galiasdef.c b/glib/galiasdef.c deleted file mode 100644 index f144f7f..0000000 --- a/glib/galiasdef.c +++ /dev/null @@ -1,4452 +0,0 @@ -/* Generated by makegalias.pl */ - -#ifndef DISABLE_VISIBILITY - -#include "glibconfig.h" - -#ifdef G_HAVE_GNUC_VISIBILITY - -#undef IN_FILE -#define IN_FILE defined - -#undef IN_HEADER -#define IN_HEADER(x) 1 - -#if IN_HEADER(__G_ARRAY_H__) -#if IN_FILE(__G_ARRAY_C__) -#undef g_array_append_vals -extern __typeof (g_array_append_vals) g_array_append_vals __attribute((alias("IA__g_array_append_vals"), visibility("default"))); - -#undef g_array_free -extern __typeof (g_array_free) g_array_free __attribute((alias("IA__g_array_free"), visibility("default"))); - -#undef g_array_insert_vals -extern __typeof (g_array_insert_vals) g_array_insert_vals __attribute((alias("IA__g_array_insert_vals"), visibility("default"))); - -#undef g_array_new -extern __typeof (g_array_new) g_array_new __attribute((alias("IA__g_array_new"), visibility("default"))); - -#undef g_array_ref -extern __typeof (g_array_ref) g_array_ref __attribute((alias("IA__g_array_ref"), visibility("default"))); - -#undef g_array_unref -extern __typeof (g_array_unref) g_array_unref __attribute((alias("IA__g_array_unref"), visibility("default"))); - -#undef g_array_get_element_size -extern __typeof (g_array_get_element_size) g_array_get_element_size __attribute((alias("IA__g_array_get_element_size"), visibility("default"))); - -#undef g_array_prepend_vals -extern __typeof (g_array_prepend_vals) g_array_prepend_vals __attribute((alias("IA__g_array_prepend_vals"), visibility("default"))); - -#undef g_array_remove_index -extern __typeof (g_array_remove_index) g_array_remove_index __attribute((alias("IA__g_array_remove_index"), visibility("default"))); - -#undef g_array_remove_index_fast -extern __typeof (g_array_remove_index_fast) g_array_remove_index_fast __attribute((alias("IA__g_array_remove_index_fast"), visibility("default"))); - -#undef g_array_remove_range -extern __typeof (g_array_remove_range) g_array_remove_range __attribute((alias("IA__g_array_remove_range"), visibility("default"))); - -#undef g_array_set_size -extern __typeof (g_array_set_size) g_array_set_size __attribute((alias("IA__g_array_set_size"), visibility("default"))); - -#undef g_array_sized_new -extern __typeof (g_array_sized_new) g_array_sized_new __attribute((alias("IA__g_array_sized_new"), visibility("default"))); - -#undef g_array_sort -extern __typeof (g_array_sort) g_array_sort __attribute((alias("IA__g_array_sort"), visibility("default"))); - -#undef g_array_sort_with_data -extern __typeof (g_array_sort_with_data) g_array_sort_with_data __attribute((alias("IA__g_array_sort_with_data"), visibility("default"))); - -#undef g_byte_array_append -extern __typeof (g_byte_array_append) g_byte_array_append __attribute((alias("IA__g_byte_array_append"), visibility("default"))); - -#undef g_byte_array_free -extern __typeof (g_byte_array_free) g_byte_array_free __attribute((alias("IA__g_byte_array_free"), visibility("default"))); - -#undef g_byte_array_unref -extern __typeof (g_byte_array_unref) g_byte_array_unref __attribute((alias("IA__g_byte_array_unref"), visibility("default"))); - -#undef g_byte_array_ref -extern __typeof (g_byte_array_ref) g_byte_array_ref __attribute((alias("IA__g_byte_array_ref"), visibility("default"))); - -#undef g_byte_array_new -extern __typeof (g_byte_array_new) g_byte_array_new __attribute((alias("IA__g_byte_array_new"), visibility("default"))); - -#undef g_byte_array_prepend -extern __typeof (g_byte_array_prepend) g_byte_array_prepend __attribute((alias("IA__g_byte_array_prepend"), visibility("default"))); - -#undef g_byte_array_remove_index -extern __typeof (g_byte_array_remove_index) g_byte_array_remove_index __attribute((alias("IA__g_byte_array_remove_index"), visibility("default"))); - -#undef g_byte_array_remove_index_fast -extern __typeof (g_byte_array_remove_index_fast) g_byte_array_remove_index_fast __attribute((alias("IA__g_byte_array_remove_index_fast"), visibility("default"))); - -#undef g_byte_array_remove_range -extern __typeof (g_byte_array_remove_range) g_byte_array_remove_range __attribute((alias("IA__g_byte_array_remove_range"), visibility("default"))); - -#undef g_byte_array_set_size -extern __typeof (g_byte_array_set_size) g_byte_array_set_size __attribute((alias("IA__g_byte_array_set_size"), visibility("default"))); - -#undef g_byte_array_sized_new -extern __typeof (g_byte_array_sized_new) g_byte_array_sized_new __attribute((alias("IA__g_byte_array_sized_new"), visibility("default"))); - -#undef g_byte_array_sort -extern __typeof (g_byte_array_sort) g_byte_array_sort __attribute((alias("IA__g_byte_array_sort"), visibility("default"))); - -#undef g_byte_array_sort_with_data -extern __typeof (g_byte_array_sort_with_data) g_byte_array_sort_with_data __attribute((alias("IA__g_byte_array_sort_with_data"), visibility("default"))); - -#undef g_ptr_array_add -extern __typeof (g_ptr_array_add) g_ptr_array_add __attribute((alias("IA__g_ptr_array_add"), visibility("default"))); - -#undef g_ptr_array_foreach -extern __typeof (g_ptr_array_foreach) g_ptr_array_foreach __attribute((alias("IA__g_ptr_array_foreach"), visibility("default"))); - -#undef g_ptr_array_free -extern __typeof (g_ptr_array_free) g_ptr_array_free __attribute((alias("IA__g_ptr_array_free"), visibility("default"))); - -#undef g_ptr_array_unref -extern __typeof (g_ptr_array_unref) g_ptr_array_unref __attribute((alias("IA__g_ptr_array_unref"), visibility("default"))); - -#undef g_ptr_array_ref -extern __typeof (g_ptr_array_ref) g_ptr_array_ref __attribute((alias("IA__g_ptr_array_ref"), visibility("default"))); - -#undef g_ptr_array_new -extern __typeof (g_ptr_array_new) g_ptr_array_new __attribute((alias("IA__g_ptr_array_new"), visibility("default"))); - -#undef g_ptr_array_new_with_free_func -extern __typeof (g_ptr_array_new_with_free_func) g_ptr_array_new_with_free_func __attribute((alias("IA__g_ptr_array_new_with_free_func"), visibility("default"))); - -#undef g_ptr_array_set_free_func -extern __typeof (g_ptr_array_set_free_func) g_ptr_array_set_free_func __attribute((alias("IA__g_ptr_array_set_free_func"), visibility("default"))); - -#undef g_ptr_array_remove -extern __typeof (g_ptr_array_remove) g_ptr_array_remove __attribute((alias("IA__g_ptr_array_remove"), visibility("default"))); - -#undef g_ptr_array_remove_fast -extern __typeof (g_ptr_array_remove_fast) g_ptr_array_remove_fast __attribute((alias("IA__g_ptr_array_remove_fast"), visibility("default"))); - -#undef g_ptr_array_remove_index -extern __typeof (g_ptr_array_remove_index) g_ptr_array_remove_index __attribute((alias("IA__g_ptr_array_remove_index"), visibility("default"))); - -#undef g_ptr_array_remove_index_fast -extern __typeof (g_ptr_array_remove_index_fast) g_ptr_array_remove_index_fast __attribute((alias("IA__g_ptr_array_remove_index_fast"), visibility("default"))); - -#undef g_ptr_array_remove_range -extern __typeof (g_ptr_array_remove_range) g_ptr_array_remove_range __attribute((alias("IA__g_ptr_array_remove_range"), visibility("default"))); - -#undef g_ptr_array_set_size -extern __typeof (g_ptr_array_set_size) g_ptr_array_set_size __attribute((alias("IA__g_ptr_array_set_size"), visibility("default"))); - -#undef g_ptr_array_sized_new -extern __typeof (g_ptr_array_sized_new) g_ptr_array_sized_new __attribute((alias("IA__g_ptr_array_sized_new"), visibility("default"))); - -#undef g_ptr_array_sort -extern __typeof (g_ptr_array_sort) g_ptr_array_sort __attribute((alias("IA__g_ptr_array_sort"), visibility("default"))); - -#undef g_ptr_array_sort_with_data -extern __typeof (g_ptr_array_sort_with_data) g_ptr_array_sort_with_data __attribute((alias("IA__g_ptr_array_sort_with_data"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_ASYNCQUEUE_H__) -#if IN_FILE(__G_ASYNCQUEUE_C__) -#undef g_async_queue_length -extern __typeof (g_async_queue_length) g_async_queue_length __attribute((alias("IA__g_async_queue_length"), visibility("default"))); - -#undef g_async_queue_length_unlocked -extern __typeof (g_async_queue_length_unlocked) g_async_queue_length_unlocked __attribute((alias("IA__g_async_queue_length_unlocked"), visibility("default"))); - -#undef g_async_queue_lock -extern __typeof (g_async_queue_lock) g_async_queue_lock __attribute((alias("IA__g_async_queue_lock"), visibility("default"))); - -#undef g_async_queue_new -extern __typeof (g_async_queue_new) g_async_queue_new __attribute((alias("IA__g_async_queue_new"), visibility("default"))); - -#undef g_async_queue_new_full -extern __typeof (g_async_queue_new_full) g_async_queue_new_full __attribute((alias("IA__g_async_queue_new_full"), visibility("default"))); - -#undef g_async_queue_pop -extern __typeof (g_async_queue_pop) g_async_queue_pop __attribute((alias("IA__g_async_queue_pop"), visibility("default"))); - -#undef g_async_queue_pop_unlocked -extern __typeof (g_async_queue_pop_unlocked) g_async_queue_pop_unlocked __attribute((alias("IA__g_async_queue_pop_unlocked"), visibility("default"))); - -#undef g_async_queue_push -extern __typeof (g_async_queue_push) g_async_queue_push __attribute((alias("IA__g_async_queue_push"), visibility("default"))); - -#undef g_async_queue_push_unlocked -extern __typeof (g_async_queue_push_unlocked) g_async_queue_push_unlocked __attribute((alias("IA__g_async_queue_push_unlocked"), visibility("default"))); - -#undef g_async_queue_push_sorted -extern __typeof (g_async_queue_push_sorted) g_async_queue_push_sorted __attribute((alias("IA__g_async_queue_push_sorted"), visibility("default"))); - -#undef g_async_queue_push_sorted_unlocked -extern __typeof (g_async_queue_push_sorted_unlocked) g_async_queue_push_sorted_unlocked __attribute((alias("IA__g_async_queue_push_sorted_unlocked"), visibility("default"))); - -#undef g_async_queue_ref -extern __typeof (g_async_queue_ref) g_async_queue_ref __attribute((alias("IA__g_async_queue_ref"), visibility("default"))); - -#undef g_async_queue_sort -extern __typeof (g_async_queue_sort) g_async_queue_sort __attribute((alias("IA__g_async_queue_sort"), visibility("default"))); - -#undef g_async_queue_sort_unlocked -extern __typeof (g_async_queue_sort_unlocked) g_async_queue_sort_unlocked __attribute((alias("IA__g_async_queue_sort_unlocked"), visibility("default"))); - -#undef g_async_queue_timed_pop -extern __typeof (g_async_queue_timed_pop) g_async_queue_timed_pop __attribute((alias("IA__g_async_queue_timed_pop"), visibility("default"))); - -#undef g_async_queue_timed_pop_unlocked -extern __typeof (g_async_queue_timed_pop_unlocked) g_async_queue_timed_pop_unlocked __attribute((alias("IA__g_async_queue_timed_pop_unlocked"), visibility("default"))); - -#undef g_async_queue_try_pop -extern __typeof (g_async_queue_try_pop) g_async_queue_try_pop __attribute((alias("IA__g_async_queue_try_pop"), visibility("default"))); - -#undef g_async_queue_try_pop_unlocked -extern __typeof (g_async_queue_try_pop_unlocked) g_async_queue_try_pop_unlocked __attribute((alias("IA__g_async_queue_try_pop_unlocked"), visibility("default"))); - -#undef g_async_queue_unlock -extern __typeof (g_async_queue_unlock) g_async_queue_unlock __attribute((alias("IA__g_async_queue_unlock"), visibility("default"))); - -#undef g_async_queue_unref -extern __typeof (g_async_queue_unref) g_async_queue_unref __attribute((alias("IA__g_async_queue_unref"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_async_queue_ref_unlocked -extern __typeof (g_async_queue_ref_unlocked) g_async_queue_ref_unlocked __attribute((alias("IA__g_async_queue_ref_unlocked"), visibility("default"))); - -#undef g_async_queue_unref_and_unlock -extern __typeof (g_async_queue_unref_and_unlock) g_async_queue_unref_and_unlock __attribute((alias("IA__g_async_queue_unref_and_unlock"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_ATOMIC_H__) -#if IN_FILE(__G_ATOMIC_C__) -#undef g_atomic_int_add -extern __typeof (g_atomic_int_add) g_atomic_int_add __attribute((alias("IA__g_atomic_int_add"), visibility("default"))); - -#undef g_atomic_int_compare_and_exchange -extern __typeof (g_atomic_int_compare_and_exchange) g_atomic_int_compare_and_exchange __attribute((alias("IA__g_atomic_int_compare_and_exchange"), visibility("default"))); - -#undef g_atomic_int_exchange_and_add -extern __typeof (g_atomic_int_exchange_and_add) g_atomic_int_exchange_and_add __attribute((alias("IA__g_atomic_int_exchange_and_add"), visibility("default"))); - -#undef g_atomic_pointer_compare_and_exchange -extern __typeof (g_atomic_pointer_compare_and_exchange) g_atomic_pointer_compare_and_exchange __attribute((alias("IA__g_atomic_pointer_compare_and_exchange"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_BACKTRACE_H__) -#if IN_FILE(__G_BACKTRACE_C__) -#undef g_on_error_query -extern __typeof (g_on_error_query) g_on_error_query __attribute((alias("IA__g_on_error_query"), visibility("default"))); - -#undef g_on_error_stack_trace -extern __typeof (g_on_error_stack_trace) g_on_error_stack_trace __attribute((alias("IA__g_on_error_stack_trace"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_BASE64_H__) -#if IN_FILE(__G_BASE64_C__) -#undef g_base64_encode_step -extern __typeof (g_base64_encode_step) g_base64_encode_step __attribute((alias("IA__g_base64_encode_step"), visibility("default"))); - -#undef g_base64_encode_close -extern __typeof (g_base64_encode_close) g_base64_encode_close __attribute((alias("IA__g_base64_encode_close"), visibility("default"))); - -#undef g_base64_encode -extern __typeof (g_base64_encode) g_base64_encode __attribute((alias("IA__g_base64_encode"), visibility("default"))); - -#undef g_base64_decode_step -extern __typeof (g_base64_decode_step) g_base64_decode_step __attribute((alias("IA__g_base64_decode_step"), visibility("default"))); - -#undef g_base64_decode -extern __typeof (g_base64_decode) g_base64_decode __attribute((alias("IA__g_base64_decode"), visibility("default"))); - -#undef g_base64_decode_inplace -extern __typeof (g_base64_decode_inplace) g_base64_decode_inplace __attribute((alias("IA__g_base64_decode_inplace"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_BOOKMARK_FILE_H__) -#if IN_FILE(__G_BOOKMARK_FILE_C__) -#undef g_bookmark_file_error_quark -extern __typeof (g_bookmark_file_error_quark) g_bookmark_file_error_quark __attribute((alias("IA__g_bookmark_file_error_quark"), visibility("default"))); - -#undef g_bookmark_file_new -extern __typeof (g_bookmark_file_new) g_bookmark_file_new __attribute((alias("IA__g_bookmark_file_new"), visibility("default"))); - -#undef g_bookmark_file_free -extern __typeof (g_bookmark_file_free) g_bookmark_file_free __attribute((alias("IA__g_bookmark_file_free"), visibility("default"))); - -#undef g_bookmark_file_load_from_file -extern __typeof (g_bookmark_file_load_from_file) g_bookmark_file_load_from_file __attribute((alias("IA__g_bookmark_file_load_from_file"), visibility("default"))); - -#undef g_bookmark_file_load_from_data -extern __typeof (g_bookmark_file_load_from_data) g_bookmark_file_load_from_data __attribute((alias("IA__g_bookmark_file_load_from_data"), visibility("default"))); - -#undef g_bookmark_file_load_from_data_dirs -extern __typeof (g_bookmark_file_load_from_data_dirs) g_bookmark_file_load_from_data_dirs __attribute((alias("IA__g_bookmark_file_load_from_data_dirs"), visibility("default"))); - -#undef g_bookmark_file_to_data -extern __typeof (g_bookmark_file_to_data) g_bookmark_file_to_data __attribute((alias("IA__g_bookmark_file_to_data"), visibility("default"))); - -#undef g_bookmark_file_to_file -extern __typeof (g_bookmark_file_to_file) g_bookmark_file_to_file __attribute((alias("IA__g_bookmark_file_to_file"), visibility("default"))); - -#undef g_bookmark_file_set_title -extern __typeof (g_bookmark_file_set_title) g_bookmark_file_set_title __attribute((alias("IA__g_bookmark_file_set_title"), visibility("default"))); - -#undef g_bookmark_file_get_title -extern __typeof (g_bookmark_file_get_title) g_bookmark_file_get_title __attribute((alias("IA__g_bookmark_file_get_title"), visibility("default"))); - -#undef g_bookmark_file_set_description -extern __typeof (g_bookmark_file_set_description) g_bookmark_file_set_description __attribute((alias("IA__g_bookmark_file_set_description"), visibility("default"))); - -#undef g_bookmark_file_get_description -extern __typeof (g_bookmark_file_get_description) g_bookmark_file_get_description __attribute((alias("IA__g_bookmark_file_get_description"), visibility("default"))); - -#undef g_bookmark_file_set_mime_type -extern __typeof (g_bookmark_file_set_mime_type) g_bookmark_file_set_mime_type __attribute((alias("IA__g_bookmark_file_set_mime_type"), visibility("default"))); - -#undef g_bookmark_file_get_mime_type -extern __typeof (g_bookmark_file_get_mime_type) g_bookmark_file_get_mime_type __attribute((alias("IA__g_bookmark_file_get_mime_type"), visibility("default"))); - -#undef g_bookmark_file_set_groups -extern __typeof (g_bookmark_file_set_groups) g_bookmark_file_set_groups __attribute((alias("IA__g_bookmark_file_set_groups"), visibility("default"))); - -#undef g_bookmark_file_add_group -extern __typeof (g_bookmark_file_add_group) g_bookmark_file_add_group __attribute((alias("IA__g_bookmark_file_add_group"), visibility("default"))); - -#undef g_bookmark_file_has_group -extern __typeof (g_bookmark_file_has_group) g_bookmark_file_has_group __attribute((alias("IA__g_bookmark_file_has_group"), visibility("default"))); - -#undef g_bookmark_file_get_groups -extern __typeof (g_bookmark_file_get_groups) g_bookmark_file_get_groups __attribute((alias("IA__g_bookmark_file_get_groups"), visibility("default"))); - -#undef g_bookmark_file_add_application -extern __typeof (g_bookmark_file_add_application) g_bookmark_file_add_application __attribute((alias("IA__g_bookmark_file_add_application"), visibility("default"))); - -#undef g_bookmark_file_has_application -extern __typeof (g_bookmark_file_has_application) g_bookmark_file_has_application __attribute((alias("IA__g_bookmark_file_has_application"), visibility("default"))); - -#undef g_bookmark_file_get_applications -extern __typeof (g_bookmark_file_get_applications) g_bookmark_file_get_applications __attribute((alias("IA__g_bookmark_file_get_applications"), visibility("default"))); - -#undef g_bookmark_file_set_app_info -extern __typeof (g_bookmark_file_set_app_info) g_bookmark_file_set_app_info __attribute((alias("IA__g_bookmark_file_set_app_info"), visibility("default"))); - -#undef g_bookmark_file_get_app_info -extern __typeof (g_bookmark_file_get_app_info) g_bookmark_file_get_app_info __attribute((alias("IA__g_bookmark_file_get_app_info"), visibility("default"))); - -#undef g_bookmark_file_set_is_private -extern __typeof (g_bookmark_file_set_is_private) g_bookmark_file_set_is_private __attribute((alias("IA__g_bookmark_file_set_is_private"), visibility("default"))); - -#undef g_bookmark_file_get_is_private -extern __typeof (g_bookmark_file_get_is_private) g_bookmark_file_get_is_private __attribute((alias("IA__g_bookmark_file_get_is_private"), visibility("default"))); - -#undef g_bookmark_file_set_icon -extern __typeof (g_bookmark_file_set_icon) g_bookmark_file_set_icon __attribute((alias("IA__g_bookmark_file_set_icon"), visibility("default"))); - -#undef g_bookmark_file_get_icon -extern __typeof (g_bookmark_file_get_icon) g_bookmark_file_get_icon __attribute((alias("IA__g_bookmark_file_get_icon"), visibility("default"))); - -#undef g_bookmark_file_set_added -extern __typeof (g_bookmark_file_set_added) g_bookmark_file_set_added __attribute((alias("IA__g_bookmark_file_set_added"), visibility("default"))); - -#undef g_bookmark_file_get_added -extern __typeof (g_bookmark_file_get_added) g_bookmark_file_get_added __attribute((alias("IA__g_bookmark_file_get_added"), visibility("default"))); - -#undef g_bookmark_file_set_modified -extern __typeof (g_bookmark_file_set_modified) g_bookmark_file_set_modified __attribute((alias("IA__g_bookmark_file_set_modified"), visibility("default"))); - -#undef g_bookmark_file_get_modified -extern __typeof (g_bookmark_file_get_modified) g_bookmark_file_get_modified __attribute((alias("IA__g_bookmark_file_get_modified"), visibility("default"))); - -#undef g_bookmark_file_set_visited -extern __typeof (g_bookmark_file_set_visited) g_bookmark_file_set_visited __attribute((alias("IA__g_bookmark_file_set_visited"), visibility("default"))); - -#undef g_bookmark_file_get_visited -extern __typeof (g_bookmark_file_get_visited) g_bookmark_file_get_visited __attribute((alias("IA__g_bookmark_file_get_visited"), visibility("default"))); - -#undef g_bookmark_file_has_item -extern __typeof (g_bookmark_file_has_item) g_bookmark_file_has_item __attribute((alias("IA__g_bookmark_file_has_item"), visibility("default"))); - -#undef g_bookmark_file_get_size -extern __typeof (g_bookmark_file_get_size) g_bookmark_file_get_size __attribute((alias("IA__g_bookmark_file_get_size"), visibility("default"))); - -#undef g_bookmark_file_get_uris -extern __typeof (g_bookmark_file_get_uris) g_bookmark_file_get_uris __attribute((alias("IA__g_bookmark_file_get_uris"), visibility("default"))); - -#undef g_bookmark_file_remove_group -extern __typeof (g_bookmark_file_remove_group) g_bookmark_file_remove_group __attribute((alias("IA__g_bookmark_file_remove_group"), visibility("default"))); - -#undef g_bookmark_file_remove_application -extern __typeof (g_bookmark_file_remove_application) g_bookmark_file_remove_application __attribute((alias("IA__g_bookmark_file_remove_application"), visibility("default"))); - -#undef g_bookmark_file_remove_item -extern __typeof (g_bookmark_file_remove_item) g_bookmark_file_remove_item __attribute((alias("IA__g_bookmark_file_remove_item"), visibility("default"))); - -#undef g_bookmark_file_move_item -extern __typeof (g_bookmark_file_move_item) g_bookmark_file_move_item __attribute((alias("IA__g_bookmark_file_move_item"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CACHE_H__) -#if IN_FILE(__G_CACHE_C__) -#undef g_cache_destroy -extern __typeof (g_cache_destroy) g_cache_destroy __attribute((alias("IA__g_cache_destroy"), visibility("default"))); - -#undef g_cache_insert -extern __typeof (g_cache_insert) g_cache_insert __attribute((alias("IA__g_cache_insert"), visibility("default"))); - -#undef g_cache_key_foreach -extern __typeof (g_cache_key_foreach) g_cache_key_foreach __attribute((alias("IA__g_cache_key_foreach"), visibility("default"))); - -#undef g_cache_new -extern __typeof (g_cache_new) g_cache_new __attribute((alias("IA__g_cache_new"), visibility("default"))); - -#undef g_cache_remove -extern __typeof (g_cache_remove) g_cache_remove __attribute((alias("IA__g_cache_remove"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_cache_value_foreach -extern __typeof (g_cache_value_foreach) g_cache_value_foreach __attribute((alias("IA__g_cache_value_foreach"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_CHECKSUM_H__) -#if IN_FILE(__G_CHECKSUM_C__) -#undef g_checksum_type_get_length -extern __typeof (g_checksum_type_get_length) g_checksum_type_get_length __attribute((alias("IA__g_checksum_type_get_length"), visibility("default"))); - -#undef g_checksum_new -extern __typeof (g_checksum_new) g_checksum_new __attribute((alias("IA__g_checksum_new"), visibility("default"))); - -#undef g_checksum_copy -extern __typeof (g_checksum_copy) g_checksum_copy __attribute((alias("IA__g_checksum_copy"), visibility("default"))); - -#undef g_checksum_free -extern __typeof (g_checksum_free) g_checksum_free __attribute((alias("IA__g_checksum_free"), visibility("default"))); - -#undef g_checksum_update -extern __typeof (g_checksum_update) g_checksum_update __attribute((alias("IA__g_checksum_update"), visibility("default"))); - -#undef g_checksum_reset -extern __typeof (g_checksum_reset) g_checksum_reset __attribute((alias("IA__g_checksum_reset"), visibility("default"))); - -#undef g_checksum_get_string -extern __typeof (g_checksum_get_string) g_checksum_get_string __attribute((alias("IA__g_checksum_get_string"), visibility("default"))); - -#undef g_checksum_get_digest -extern __typeof (g_checksum_get_digest) g_checksum_get_digest __attribute((alias("IA__g_checksum_get_digest"), visibility("default"))); - -#undef g_compute_checksum_for_data -extern __typeof (g_compute_checksum_for_data) g_compute_checksum_for_data __attribute((alias("IA__g_compute_checksum_for_data"), visibility("default"))); - -#undef g_compute_checksum_for_string -extern __typeof (g_compute_checksum_for_string) g_compute_checksum_for_string __attribute((alias("IA__g_compute_checksum_for_string"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_COMPLETION_H__) -#if IN_FILE(__G_COMPLETION_C__) -#undef g_completion_add_items -extern __typeof (g_completion_add_items) g_completion_add_items __attribute((alias("IA__g_completion_add_items"), visibility("default"))); - -#undef g_completion_clear_items -extern __typeof (g_completion_clear_items) g_completion_clear_items __attribute((alias("IA__g_completion_clear_items"), visibility("default"))); - -#undef g_completion_complete -extern __typeof (g_completion_complete) g_completion_complete __attribute((alias("IA__g_completion_complete"), visibility("default"))); - -#undef g_completion_complete_utf8 -extern __typeof (g_completion_complete_utf8) g_completion_complete_utf8 __attribute((alias("IA__g_completion_complete_utf8"), visibility("default"))); - -#undef g_completion_free -extern __typeof (g_completion_free) g_completion_free __attribute((alias("IA__g_completion_free"), visibility("default"))); - -#undef g_completion_new -extern __typeof (g_completion_new) g_completion_new __attribute((alias("IA__g_completion_new"), visibility("default"))); - -#undef g_completion_remove_items -extern __typeof (g_completion_remove_items) g_completion_remove_items __attribute((alias("IA__g_completion_remove_items"), visibility("default"))); - -#undef g_completion_set_compare -extern __typeof (g_completion_set_compare) g_completion_set_compare __attribute((alias("IA__g_completion_set_compare"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_CONVERT_H__) -#if IN_FILE(__G_CONVERT_C__) -#undef g_get_filename_charsets -extern __typeof (g_get_filename_charsets) g_get_filename_charsets __attribute((alias("IA__g_get_filename_charsets"), visibility("default"))); - -#undef g_convert -extern __typeof (g_convert) g_convert __attribute((alias("IA__g_convert"), visibility("default"))); - -#undef g_convert_error_quark -extern __typeof (g_convert_error_quark) g_convert_error_quark __attribute((alias("IA__g_convert_error_quark"), visibility("default"))); - -#undef g_convert_with_fallback -extern __typeof (g_convert_with_fallback) g_convert_with_fallback __attribute((alias("IA__g_convert_with_fallback"), visibility("default"))); - -#undef g_convert_with_iconv -extern __typeof (g_convert_with_iconv) g_convert_with_iconv __attribute((alias("IA__g_convert_with_iconv"), visibility("default"))); - -#undef g_iconv -extern __typeof (g_iconv) g_iconv __attribute((alias("IA__g_iconv"), visibility("default"))); - -#undef g_iconv_close -extern __typeof (g_iconv_close) g_iconv_close __attribute((alias("IA__g_iconv_close"), visibility("default"))); - -#undef g_iconv_open -extern __typeof (g_iconv_open) g_iconv_open __attribute((alias("IA__g_iconv_open"), visibility("default"))); - -#undef g_locale_from_utf8 -extern __typeof (g_locale_from_utf8) g_locale_from_utf8 __attribute((alias("IA__g_locale_from_utf8"), visibility("default"))); - -#undef g_locale_to_utf8 -extern __typeof (g_locale_to_utf8) g_locale_to_utf8 __attribute((alias("IA__g_locale_to_utf8"), visibility("default"))); - -#undef g_filename_display_name -extern __typeof (g_filename_display_name) g_filename_display_name __attribute((alias("IA__g_filename_display_name"), visibility("default"))); - -#undef g_filename_display_basename -extern __typeof (g_filename_display_basename) g_filename_display_basename __attribute((alias("IA__g_filename_display_basename"), visibility("default"))); - -#ifndef _WIN64 -#undef g_filename_from_uri -extern __typeof (g_filename_from_uri) g_filename_from_uri __attribute((alias("IA__g_filename_from_uri"), visibility("default"))); - -#undef g_filename_from_utf8 -extern __typeof (g_filename_from_utf8) g_filename_from_utf8 __attribute((alias("IA__g_filename_from_utf8"), visibility("default"))); - -#undef g_filename_to_uri -extern __typeof (g_filename_to_uri) g_filename_to_uri __attribute((alias("IA__g_filename_to_uri"), visibility("default"))); - -#undef g_filename_to_utf8 -extern __typeof (g_filename_to_utf8) g_filename_to_utf8 __attribute((alias("IA__g_filename_to_utf8"), visibility("default"))); - -#endif -#ifdef G_OS_WIN32 -#undef g_filename_from_uri_utf8 -extern __typeof (g_filename_from_uri_utf8) g_filename_from_uri_utf8 __attribute((alias("IA__g_filename_from_uri_utf8"), visibility("default"))); - -#undef g_filename_from_utf8_utf8 -extern __typeof (g_filename_from_utf8_utf8) g_filename_from_utf8_utf8 __attribute((alias("IA__g_filename_from_utf8_utf8"), visibility("default"))); - -#undef g_filename_to_uri_utf8 -extern __typeof (g_filename_to_uri_utf8) g_filename_to_uri_utf8 __attribute((alias("IA__g_filename_to_uri_utf8"), visibility("default"))); - -#undef g_filename_to_utf8_utf8 -extern __typeof (g_filename_to_utf8_utf8) g_filename_to_utf8_utf8 __attribute((alias("IA__g_filename_to_utf8_utf8"), visibility("default"))); - -#endif -#undef g_uri_list_extract_uris -extern __typeof (g_uri_list_extract_uris) g_uri_list_extract_uris __attribute((alias("IA__g_uri_list_extract_uris"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DATASET_H__) -#if IN_FILE(__G_DATASET_C__) -#undef g_datalist_clear -extern __typeof (g_datalist_clear) g_datalist_clear __attribute((alias("IA__g_datalist_clear"), visibility("default"))); - -#undef g_datalist_foreach -extern __typeof (g_datalist_foreach) g_datalist_foreach __attribute((alias("IA__g_datalist_foreach"), visibility("default"))); - -#undef g_datalist_get_flags -extern __typeof (g_datalist_get_flags) g_datalist_get_flags __attribute((alias("IA__g_datalist_get_flags"), visibility("default"))); - -#undef g_datalist_id_get_data -extern __typeof (g_datalist_id_get_data) g_datalist_id_get_data __attribute((alias("IA__g_datalist_id_get_data"), visibility("default"))); - -#undef g_datalist_id_remove_no_notify -extern __typeof (g_datalist_id_remove_no_notify) g_datalist_id_remove_no_notify __attribute((alias("IA__g_datalist_id_remove_no_notify"), visibility("default"))); - -#undef g_datalist_id_set_data_full -extern __typeof (g_datalist_id_set_data_full) g_datalist_id_set_data_full __attribute((alias("IA__g_datalist_id_set_data_full"), visibility("default"))); - -#undef g_datalist_set_flags -extern __typeof (g_datalist_set_flags) g_datalist_set_flags __attribute((alias("IA__g_datalist_set_flags"), visibility("default"))); - -#undef g_datalist_unset_flags -extern __typeof (g_datalist_unset_flags) g_datalist_unset_flags __attribute((alias("IA__g_datalist_unset_flags"), visibility("default"))); - -#undef g_datalist_init -extern __typeof (g_datalist_init) g_datalist_init __attribute((alias("IA__g_datalist_init"), visibility("default"))); - -#undef g_dataset_destroy -extern __typeof (g_dataset_destroy) g_dataset_destroy __attribute((alias("IA__g_dataset_destroy"), visibility("default"))); - -#undef g_dataset_foreach -extern __typeof (g_dataset_foreach) g_dataset_foreach __attribute((alias("IA__g_dataset_foreach"), visibility("default"))); - -#undef g_dataset_id_get_data -extern __typeof (g_dataset_id_get_data) g_dataset_id_get_data __attribute((alias("IA__g_dataset_id_get_data"), visibility("default"))); - -#undef g_dataset_id_remove_no_notify -extern __typeof (g_dataset_id_remove_no_notify) g_dataset_id_remove_no_notify __attribute((alias("IA__g_dataset_id_remove_no_notify"), visibility("default"))); - -#undef g_dataset_id_set_data_full -extern __typeof (g_dataset_id_set_data_full) g_dataset_id_set_data_full __attribute((alias("IA__g_dataset_id_set_data_full"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_QUARK_H__) -#if IN_FILE(__G_DATASET_C__) -#undef g_quark_from_static_string -extern __typeof (g_quark_from_static_string) g_quark_from_static_string __attribute((alias("IA__g_quark_from_static_string"), visibility("default"))); - -#undef g_quark_from_string -extern __typeof (g_quark_from_string) g_quark_from_string __attribute((alias("IA__g_quark_from_string"), visibility("default"))); - -#undef g_quark_to_string -extern __typeof (g_quark_to_string) g_quark_to_string __attribute((alias("IA__g_quark_to_string"), visibility("default"))); - -#undef g_quark_try_string -extern __typeof (g_quark_try_string) g_quark_try_string __attribute((alias("IA__g_quark_try_string"), visibility("default"))); - -#undef g_intern_string -extern __typeof (g_intern_string) g_intern_string __attribute((alias("IA__g_intern_string"), visibility("default"))); - -#undef g_intern_static_string -extern __typeof (g_intern_static_string) g_intern_static_string __attribute((alias("IA__g_intern_static_string"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DATE_H__) -#if IN_FILE(__G_DATE_C__) -#undef g_date_add_days -extern __typeof (g_date_add_days) g_date_add_days __attribute((alias("IA__g_date_add_days"), visibility("default"))); - -#undef g_date_add_months -extern __typeof (g_date_add_months) g_date_add_months __attribute((alias("IA__g_date_add_months"), visibility("default"))); - -#undef g_date_add_years -extern __typeof (g_date_add_years) g_date_add_years __attribute((alias("IA__g_date_add_years"), visibility("default"))); - -#undef g_date_clamp -extern __typeof (g_date_clamp) g_date_clamp __attribute((alias("IA__g_date_clamp"), visibility("default"))); - -#undef g_date_clear -extern __typeof (g_date_clear) g_date_clear __attribute((alias("IA__g_date_clear"), visibility("default"))); - -#undef g_date_compare -extern __typeof (g_date_compare) g_date_compare __attribute((alias("IA__g_date_compare"), visibility("default"))); - -#undef g_date_days_between -extern __typeof (g_date_days_between) g_date_days_between __attribute((alias("IA__g_date_days_between"), visibility("default"))); - -#undef g_date_free -extern __typeof (g_date_free) g_date_free __attribute((alias("IA__g_date_free"), visibility("default"))); - -#undef g_date_get_day -extern __typeof (g_date_get_day) g_date_get_day __attribute((alias("IA__g_date_get_day"), visibility("default"))); - -#undef g_date_get_day_of_year -extern __typeof (g_date_get_day_of_year) g_date_get_day_of_year __attribute((alias("IA__g_date_get_day_of_year"), visibility("default"))); - -#undef g_date_get_days_in_month -extern __typeof (g_date_get_days_in_month) g_date_get_days_in_month __attribute((alias("IA__g_date_get_days_in_month"), visibility("default"))); - -#undef g_date_get_iso8601_week_of_year -extern __typeof (g_date_get_iso8601_week_of_year) g_date_get_iso8601_week_of_year __attribute((alias("IA__g_date_get_iso8601_week_of_year"), visibility("default"))); - -#undef g_date_get_julian -extern __typeof (g_date_get_julian) g_date_get_julian __attribute((alias("IA__g_date_get_julian"), visibility("default"))); - -#undef g_date_get_monday_week_of_year -extern __typeof (g_date_get_monday_week_of_year) g_date_get_monday_week_of_year __attribute((alias("IA__g_date_get_monday_week_of_year"), visibility("default"))); - -#undef g_date_get_monday_weeks_in_year -extern __typeof (g_date_get_monday_weeks_in_year) g_date_get_monday_weeks_in_year __attribute((alias("IA__g_date_get_monday_weeks_in_year"), visibility("default"))); - -#undef g_date_get_month -extern __typeof (g_date_get_month) g_date_get_month __attribute((alias("IA__g_date_get_month"), visibility("default"))); - -#undef g_date_get_sunday_week_of_year -extern __typeof (g_date_get_sunday_week_of_year) g_date_get_sunday_week_of_year __attribute((alias("IA__g_date_get_sunday_week_of_year"), visibility("default"))); - -#undef g_date_get_sunday_weeks_in_year -extern __typeof (g_date_get_sunday_weeks_in_year) g_date_get_sunday_weeks_in_year __attribute((alias("IA__g_date_get_sunday_weeks_in_year"), visibility("default"))); - -#undef g_date_get_weekday -extern __typeof (g_date_get_weekday) g_date_get_weekday __attribute((alias("IA__g_date_get_weekday"), visibility("default"))); - -#undef g_date_get_year -extern __typeof (g_date_get_year) g_date_get_year __attribute((alias("IA__g_date_get_year"), visibility("default"))); - -#undef g_date_is_first_of_month -extern __typeof (g_date_is_first_of_month) g_date_is_first_of_month __attribute((alias("IA__g_date_is_first_of_month"), visibility("default"))); - -#undef g_date_is_last_of_month -extern __typeof (g_date_is_last_of_month) g_date_is_last_of_month __attribute((alias("IA__g_date_is_last_of_month"), visibility("default"))); - -#undef g_date_is_leap_year -extern __typeof (g_date_is_leap_year) g_date_is_leap_year __attribute((alias("IA__g_date_is_leap_year"), visibility("default"))); - -#undef g_date_new -extern __typeof (g_date_new) g_date_new __attribute((alias("IA__g_date_new"), visibility("default"))); - -#undef g_date_new_dmy -extern __typeof (g_date_new_dmy) g_date_new_dmy __attribute((alias("IA__g_date_new_dmy"), visibility("default"))); - -#undef g_date_new_julian -extern __typeof (g_date_new_julian) g_date_new_julian __attribute((alias("IA__g_date_new_julian"), visibility("default"))); - -#undef g_date_order -extern __typeof (g_date_order) g_date_order __attribute((alias("IA__g_date_order"), visibility("default"))); - -#undef g_date_set_day -extern __typeof (g_date_set_day) g_date_set_day __attribute((alias("IA__g_date_set_day"), visibility("default"))); - -#undef g_date_set_dmy -extern __typeof (g_date_set_dmy) g_date_set_dmy __attribute((alias("IA__g_date_set_dmy"), visibility("default"))); - -#undef g_date_set_julian -extern __typeof (g_date_set_julian) g_date_set_julian __attribute((alias("IA__g_date_set_julian"), visibility("default"))); - -#undef g_date_set_month -extern __typeof (g_date_set_month) g_date_set_month __attribute((alias("IA__g_date_set_month"), visibility("default"))); - -#undef g_date_set_parse -extern __typeof (g_date_set_parse) g_date_set_parse __attribute((alias("IA__g_date_set_parse"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_date_set_time -extern __typeof (g_date_set_time) g_date_set_time __attribute((alias("IA__g_date_set_time"), visibility("default"))); - -#endif -#undef g_date_set_time_t -extern __typeof (g_date_set_time_t) g_date_set_time_t __attribute((alias("IA__g_date_set_time_t"), visibility("default"))); - -#undef g_date_set_time_val -extern __typeof (g_date_set_time_val) g_date_set_time_val __attribute((alias("IA__g_date_set_time_val"), visibility("default"))); - -#undef g_date_set_year -extern __typeof (g_date_set_year) g_date_set_year __attribute((alias("IA__g_date_set_year"), visibility("default"))); - -#undef g_date_strftime -extern __typeof (g_date_strftime) g_date_strftime __attribute((alias("IA__g_date_strftime"), visibility("default"))); - -#undef g_date_subtract_days -extern __typeof (g_date_subtract_days) g_date_subtract_days __attribute((alias("IA__g_date_subtract_days"), visibility("default"))); - -#undef g_date_subtract_months -extern __typeof (g_date_subtract_months) g_date_subtract_months __attribute((alias("IA__g_date_subtract_months"), visibility("default"))); - -#undef g_date_subtract_years -extern __typeof (g_date_subtract_years) g_date_subtract_years __attribute((alias("IA__g_date_subtract_years"), visibility("default"))); - -#undef g_date_to_struct_tm -extern __typeof (g_date_to_struct_tm) g_date_to_struct_tm __attribute((alias("IA__g_date_to_struct_tm"), visibility("default"))); - -#undef g_date_valid -extern __typeof (g_date_valid) g_date_valid __attribute((alias("IA__g_date_valid"), visibility("default"))); - -#undef g_date_valid_day -extern __typeof (g_date_valid_day) g_date_valid_day __attribute((alias("IA__g_date_valid_day"), visibility("default"))); - -#undef g_date_valid_dmy -extern __typeof (g_date_valid_dmy) g_date_valid_dmy __attribute((alias("IA__g_date_valid_dmy"), visibility("default"))); - -#undef g_date_valid_julian -extern __typeof (g_date_valid_julian) g_date_valid_julian __attribute((alias("IA__g_date_valid_julian"), visibility("default"))); - -#undef g_date_valid_month -extern __typeof (g_date_valid_month) g_date_valid_month __attribute((alias("IA__g_date_valid_month"), visibility("default"))); - -#undef g_date_valid_weekday -extern __typeof (g_date_valid_weekday) g_date_valid_weekday __attribute((alias("IA__g_date_valid_weekday"), visibility("default"))); - -#undef g_date_valid_year -extern __typeof (g_date_valid_year) g_date_valid_year __attribute((alias("IA__g_date_valid_year"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_DIR_H__) -#if IN_FILE(__G_DIR_C__) -#undef g_dir_close -extern __typeof (g_dir_close) g_dir_close __attribute((alias("IA__g_dir_close"), visibility("default"))); - -#ifndef _WIN64 -#undef g_dir_open -extern __typeof (g_dir_open) g_dir_open __attribute((alias("IA__g_dir_open"), visibility("default"))); - -#undef g_dir_read_name -extern __typeof (g_dir_read_name) g_dir_read_name __attribute((alias("IA__g_dir_read_name"), visibility("default"))); - -#endif -#ifdef G_OS_WIN32 -#undef g_dir_open_utf8 -extern __typeof (g_dir_open_utf8) g_dir_open_utf8 __attribute((alias("IA__g_dir_open_utf8"), visibility("default"))); - -#undef g_dir_read_name_utf8 -extern __typeof (g_dir_read_name_utf8) g_dir_read_name_utf8 __attribute((alias("IA__g_dir_read_name_utf8"), visibility("default"))); - -#endif -#undef g_dir_rewind -extern __typeof (g_dir_rewind) g_dir_rewind __attribute((alias("IA__g_dir_rewind"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_ERROR_H__) -#if IN_FILE(__G_ERROR_C__) -#undef g_clear_error -extern __typeof (g_clear_error) g_clear_error __attribute((alias("IA__g_clear_error"), visibility("default"))); - -#undef g_error_copy -extern __typeof (g_error_copy) g_error_copy __attribute((alias("IA__g_error_copy"), visibility("default"))); - -#undef g_error_free -extern __typeof (g_error_free) g_error_free __attribute((alias("IA__g_error_free"), visibility("default"))); - -#undef g_error_matches -extern __typeof (g_error_matches) g_error_matches __attribute((alias("IA__g_error_matches"), visibility("default"))); - -#undef g_error_new -extern __typeof (g_error_new) g_error_new __attribute((alias("IA__g_error_new"), visibility("default"))); - -#undef g_error_new_literal -extern __typeof (g_error_new_literal) g_error_new_literal __attribute((alias("IA__g_error_new_literal"), visibility("default"))); - -#undef g_error_new_valist -extern __typeof (g_error_new_valist) g_error_new_valist __attribute((alias("IA__g_error_new_valist"), visibility("default"))); - -#undef g_propagate_error -extern __typeof (g_propagate_error) g_propagate_error __attribute((alias("IA__g_propagate_error"), visibility("default"))); - -#undef g_set_error -extern __typeof (g_set_error) g_set_error __attribute((alias("IA__g_set_error"), visibility("default"))); - -#undef g_set_error_literal -extern __typeof (g_set_error_literal) g_set_error_literal __attribute((alias("IA__g_set_error_literal"), visibility("default"))); - -#undef g_prefix_error -extern __typeof (g_prefix_error) g_prefix_error __attribute((alias("IA__g_prefix_error"), visibility("default"))); - -#undef g_propagate_prefixed_error -extern __typeof (g_propagate_prefixed_error) g_propagate_prefixed_error __attribute((alias("IA__g_propagate_prefixed_error"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_FILEUTILS_H__) -#if IN_FILE(__G_FILEUTILS_C__) -#undef g_build_filename -extern __typeof (g_build_filename) g_build_filename __attribute((alias("IA__g_build_filename"), visibility("default"))); - -#undef g_build_filenamev -extern __typeof (g_build_filenamev) g_build_filenamev __attribute((alias("IA__g_build_filenamev"), visibility("default"))); - -#undef g_build_path -extern __typeof (g_build_path) g_build_path __attribute((alias("IA__g_build_path"), visibility("default"))); - -#undef g_build_pathv -extern __typeof (g_build_pathv) g_build_pathv __attribute((alias("IA__g_build_pathv"), visibility("default"))); - -#undef g_file_error_from_errno -extern __typeof (g_file_error_from_errno) g_file_error_from_errno __attribute((alias("IA__g_file_error_from_errno"), visibility("default"))); - -#undef g_file_error_quark -extern __typeof (g_file_error_quark) g_file_error_quark __attribute((alias("IA__g_file_error_quark"), visibility("default"))); - -#ifndef _WIN64 -#undef g_file_get_contents -extern __typeof (g_file_get_contents) g_file_get_contents __attribute((alias("IA__g_file_get_contents"), visibility("default"))); - -#endif -#undef g_file_set_contents -extern __typeof (g_file_set_contents) g_file_set_contents __attribute((alias("IA__g_file_set_contents"), visibility("default"))); - -#ifndef _WIN64 -#undef g_file_open_tmp -extern __typeof (g_file_open_tmp) g_file_open_tmp __attribute((alias("IA__g_file_open_tmp"), visibility("default"))); - -#undef g_file_test -extern __typeof (g_file_test) g_file_test __attribute((alias("IA__g_file_test"), visibility("default"))); - -#endif -#undef g_file_read_link -extern __typeof (g_file_read_link) g_file_read_link __attribute((alias("IA__g_file_read_link"), visibility("default"))); - -#undef g_format_size_for_display -extern __typeof (g_format_size_for_display) g_format_size_for_display __attribute((alias("IA__g_format_size_for_display"), visibility("default"))); - -#ifndef _WIN64 -#undef g_mkstemp -extern __typeof (g_mkstemp) g_mkstemp __attribute((alias("IA__g_mkstemp"), visibility("default"))); - -#endif -#undef g_mkstemp_full -extern __typeof (g_mkstemp_full) g_mkstemp_full __attribute((alias("IA__g_mkstemp_full"), visibility("default"))); - -#undef g_mkdir_with_parents -extern __typeof (g_mkdir_with_parents) g_mkdir_with_parents __attribute((alias("IA__g_mkdir_with_parents"), visibility("default"))); - -#ifdef G_OS_WIN32 -#undef g_file_get_contents_utf8 -extern __typeof (g_file_get_contents_utf8) g_file_get_contents_utf8 __attribute((alias("IA__g_file_get_contents_utf8"), visibility("default"))); - -#undef g_file_open_tmp_utf8 -extern __typeof (g_file_open_tmp_utf8) g_file_open_tmp_utf8 __attribute((alias("IA__g_file_open_tmp_utf8"), visibility("default"))); - -#undef g_file_test_utf8 -extern __typeof (g_file_test_utf8) g_file_test_utf8 __attribute((alias("IA__g_file_test_utf8"), visibility("default"))); - -#undef g_mkstemp_utf8 -extern __typeof (g_mkstemp_utf8) g_mkstemp_utf8 __attribute((alias("IA__g_mkstemp_utf8"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_HASH_H__) -#if IN_FILE(__G_HASH_C__) -#undef g_hash_table_destroy -extern __typeof (g_hash_table_destroy) g_hash_table_destroy __attribute((alias("IA__g_hash_table_destroy"), visibility("default"))); - -#undef g_hash_table_unref -extern __typeof (g_hash_table_unref) g_hash_table_unref __attribute((alias("IA__g_hash_table_unref"), visibility("default"))); - -#undef g_hash_table_ref -extern __typeof (g_hash_table_ref) g_hash_table_ref __attribute((alias("IA__g_hash_table_ref"), visibility("default"))); - -#undef g_hash_table_find -extern __typeof (g_hash_table_find) g_hash_table_find __attribute((alias("IA__g_hash_table_find"), visibility("default"))); - -#undef g_hash_table_foreach -extern __typeof (g_hash_table_foreach) g_hash_table_foreach __attribute((alias("IA__g_hash_table_foreach"), visibility("default"))); - -#undef g_hash_table_foreach_remove -extern __typeof (g_hash_table_foreach_remove) g_hash_table_foreach_remove __attribute((alias("IA__g_hash_table_foreach_remove"), visibility("default"))); - -#undef g_hash_table_foreach_steal -extern __typeof (g_hash_table_foreach_steal) g_hash_table_foreach_steal __attribute((alias("IA__g_hash_table_foreach_steal"), visibility("default"))); - -#undef g_hash_table_get_keys -extern __typeof (g_hash_table_get_keys) g_hash_table_get_keys __attribute((alias("IA__g_hash_table_get_keys"), visibility("default"))); - -#undef g_hash_table_get_values -extern __typeof (g_hash_table_get_values) g_hash_table_get_values __attribute((alias("IA__g_hash_table_get_values"), visibility("default"))); - -#undef g_hash_table_insert -extern __typeof (g_hash_table_insert) g_hash_table_insert __attribute((alias("IA__g_hash_table_insert"), visibility("default"))); - -#undef g_hash_table_lookup -extern __typeof (g_hash_table_lookup) g_hash_table_lookup __attribute((alias("IA__g_hash_table_lookup"), visibility("default"))); - -#undef g_hash_table_lookup_extended -extern __typeof (g_hash_table_lookup_extended) g_hash_table_lookup_extended __attribute((alias("IA__g_hash_table_lookup_extended"), visibility("default"))); - -#undef g_hash_table_new -extern __typeof (g_hash_table_new) g_hash_table_new __attribute((alias("IA__g_hash_table_new"), visibility("default"))); - -#undef g_hash_table_new_full -extern __typeof (g_hash_table_new_full) g_hash_table_new_full __attribute((alias("IA__g_hash_table_new_full"), visibility("default"))); - -#undef g_hash_table_remove -extern __typeof (g_hash_table_remove) g_hash_table_remove __attribute((alias("IA__g_hash_table_remove"), visibility("default"))); - -#undef g_hash_table_remove_all -extern __typeof (g_hash_table_remove_all) g_hash_table_remove_all __attribute((alias("IA__g_hash_table_remove_all"), visibility("default"))); - -#undef g_hash_table_replace -extern __typeof (g_hash_table_replace) g_hash_table_replace __attribute((alias("IA__g_hash_table_replace"), visibility("default"))); - -#undef g_hash_table_size -extern __typeof (g_hash_table_size) g_hash_table_size __attribute((alias("IA__g_hash_table_size"), visibility("default"))); - -#undef g_hash_table_steal -extern __typeof (g_hash_table_steal) g_hash_table_steal __attribute((alias("IA__g_hash_table_steal"), visibility("default"))); - -#undef g_hash_table_steal_all -extern __typeof (g_hash_table_steal_all) g_hash_table_steal_all __attribute((alias("IA__g_hash_table_steal_all"), visibility("default"))); - -#undef g_hash_table_iter_init -extern __typeof (g_hash_table_iter_init) g_hash_table_iter_init __attribute((alias("IA__g_hash_table_iter_init"), visibility("default"))); - -#undef g_hash_table_iter_next -extern __typeof (g_hash_table_iter_next) g_hash_table_iter_next __attribute((alias("IA__g_hash_table_iter_next"), visibility("default"))); - -#undef g_hash_table_iter_get_hash_table -extern __typeof (g_hash_table_iter_get_hash_table) g_hash_table_iter_get_hash_table __attribute((alias("IA__g_hash_table_iter_get_hash_table"), visibility("default"))); - -#undef g_hash_table_iter_remove -extern __typeof (g_hash_table_iter_remove) g_hash_table_iter_remove __attribute((alias("IA__g_hash_table_iter_remove"), visibility("default"))); - -#undef g_hash_table_iter_steal -extern __typeof (g_hash_table_iter_steal) g_hash_table_iter_steal __attribute((alias("IA__g_hash_table_iter_steal"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_HOOK_H__) -#if IN_FILE(__G_HOOK_C__) -#undef g_hook_alloc -extern __typeof (g_hook_alloc) g_hook_alloc __attribute((alias("IA__g_hook_alloc"), visibility("default"))); - -#undef g_hook_compare_ids -extern __typeof (g_hook_compare_ids) g_hook_compare_ids __attribute((alias("IA__g_hook_compare_ids"), visibility("default"))); - -#undef g_hook_destroy -extern __typeof (g_hook_destroy) g_hook_destroy __attribute((alias("IA__g_hook_destroy"), visibility("default"))); - -#undef g_hook_destroy_link -extern __typeof (g_hook_destroy_link) g_hook_destroy_link __attribute((alias("IA__g_hook_destroy_link"), visibility("default"))); - -#undef g_hook_find -extern __typeof (g_hook_find) g_hook_find __attribute((alias("IA__g_hook_find"), visibility("default"))); - -#undef g_hook_find_data -extern __typeof (g_hook_find_data) g_hook_find_data __attribute((alias("IA__g_hook_find_data"), visibility("default"))); - -#undef g_hook_find_func -extern __typeof (g_hook_find_func) g_hook_find_func __attribute((alias("IA__g_hook_find_func"), visibility("default"))); - -#undef g_hook_find_func_data -extern __typeof (g_hook_find_func_data) g_hook_find_func_data __attribute((alias("IA__g_hook_find_func_data"), visibility("default"))); - -#undef g_hook_first_valid -extern __typeof (g_hook_first_valid) g_hook_first_valid __attribute((alias("IA__g_hook_first_valid"), visibility("default"))); - -#undef g_hook_free -extern __typeof (g_hook_free) g_hook_free __attribute((alias("IA__g_hook_free"), visibility("default"))); - -#undef g_hook_get -extern __typeof (g_hook_get) g_hook_get __attribute((alias("IA__g_hook_get"), visibility("default"))); - -#undef g_hook_insert_before -extern __typeof (g_hook_insert_before) g_hook_insert_before __attribute((alias("IA__g_hook_insert_before"), visibility("default"))); - -#undef g_hook_insert_sorted -extern __typeof (g_hook_insert_sorted) g_hook_insert_sorted __attribute((alias("IA__g_hook_insert_sorted"), visibility("default"))); - -#undef g_hook_list_clear -extern __typeof (g_hook_list_clear) g_hook_list_clear __attribute((alias("IA__g_hook_list_clear"), visibility("default"))); - -#undef g_hook_list_init -extern __typeof (g_hook_list_init) g_hook_list_init __attribute((alias("IA__g_hook_list_init"), visibility("default"))); - -#undef g_hook_list_invoke -extern __typeof (g_hook_list_invoke) g_hook_list_invoke __attribute((alias("IA__g_hook_list_invoke"), visibility("default"))); - -#undef g_hook_list_invoke_check -extern __typeof (g_hook_list_invoke_check) g_hook_list_invoke_check __attribute((alias("IA__g_hook_list_invoke_check"), visibility("default"))); - -#undef g_hook_list_marshal -extern __typeof (g_hook_list_marshal) g_hook_list_marshal __attribute((alias("IA__g_hook_list_marshal"), visibility("default"))); - -#undef g_hook_list_marshal_check -extern __typeof (g_hook_list_marshal_check) g_hook_list_marshal_check __attribute((alias("IA__g_hook_list_marshal_check"), visibility("default"))); - -#undef g_hook_next_valid -extern __typeof (g_hook_next_valid) g_hook_next_valid __attribute((alias("IA__g_hook_next_valid"), visibility("default"))); - -#undef g_hook_prepend -extern __typeof (g_hook_prepend) g_hook_prepend __attribute((alias("IA__g_hook_prepend"), visibility("default"))); - -#undef g_hook_ref -extern __typeof (g_hook_ref) g_hook_ref __attribute((alias("IA__g_hook_ref"), visibility("default"))); - -#undef g_hook_unref -extern __typeof (g_hook_unref) g_hook_unref __attribute((alias("IA__g_hook_unref"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_IOCHANNEL_H__) -#if IN_FILE(__G_IOCHANNEL_C__) -#undef g_io_add_watch -extern __typeof (g_io_add_watch) g_io_add_watch __attribute((alias("IA__g_io_add_watch"), visibility("default"))); - -#undef g_io_add_watch_full -extern __typeof (g_io_add_watch_full) g_io_add_watch_full __attribute((alias("IA__g_io_add_watch_full"), visibility("default"))); - -#undef g_io_create_watch -extern __typeof (g_io_create_watch) g_io_create_watch __attribute((alias("IA__g_io_create_watch"), visibility("default"))); - -#undef g_io_channel_error_from_errno -extern __typeof (g_io_channel_error_from_errno) g_io_channel_error_from_errno __attribute((alias("IA__g_io_channel_error_from_errno"), visibility("default"))); - -#undef g_io_channel_error_quark -extern __typeof (g_io_channel_error_quark) g_io_channel_error_quark __attribute((alias("IA__g_io_channel_error_quark"), visibility("default"))); - -#undef g_io_channel_flush -extern __typeof (g_io_channel_flush) g_io_channel_flush __attribute((alias("IA__g_io_channel_flush"), visibility("default"))); - -#undef g_io_channel_get_buffer_condition -extern __typeof (g_io_channel_get_buffer_condition) g_io_channel_get_buffer_condition __attribute((alias("IA__g_io_channel_get_buffer_condition"), visibility("default"))); - -#undef g_io_channel_get_buffered -extern __typeof (g_io_channel_get_buffered) g_io_channel_get_buffered __attribute((alias("IA__g_io_channel_get_buffered"), visibility("default"))); - -#undef g_io_channel_get_buffer_size -extern __typeof (g_io_channel_get_buffer_size) g_io_channel_get_buffer_size __attribute((alias("IA__g_io_channel_get_buffer_size"), visibility("default"))); - -#undef g_io_channel_get_close_on_unref -extern __typeof (g_io_channel_get_close_on_unref) g_io_channel_get_close_on_unref __attribute((alias("IA__g_io_channel_get_close_on_unref"), visibility("default"))); - -#undef g_io_channel_get_encoding -extern __typeof (g_io_channel_get_encoding) g_io_channel_get_encoding __attribute((alias("IA__g_io_channel_get_encoding"), visibility("default"))); - -#undef g_io_channel_get_flags -extern __typeof (g_io_channel_get_flags) g_io_channel_get_flags __attribute((alias("IA__g_io_channel_get_flags"), visibility("default"))); - -#undef g_io_channel_get_line_term -extern __typeof (g_io_channel_get_line_term) g_io_channel_get_line_term __attribute((alias("IA__g_io_channel_get_line_term"), visibility("default"))); - -#undef g_io_channel_init -extern __typeof (g_io_channel_init) g_io_channel_init __attribute((alias("IA__g_io_channel_init"), visibility("default"))); - -#undef g_io_channel_read_chars -extern __typeof (g_io_channel_read_chars) g_io_channel_read_chars __attribute((alias("IA__g_io_channel_read_chars"), visibility("default"))); - -#undef g_io_channel_read_line -extern __typeof (g_io_channel_read_line) g_io_channel_read_line __attribute((alias("IA__g_io_channel_read_line"), visibility("default"))); - -#undef g_io_channel_read_line_string -extern __typeof (g_io_channel_read_line_string) g_io_channel_read_line_string __attribute((alias("IA__g_io_channel_read_line_string"), visibility("default"))); - -#undef g_io_channel_read_to_end -extern __typeof (g_io_channel_read_to_end) g_io_channel_read_to_end __attribute((alias("IA__g_io_channel_read_to_end"), visibility("default"))); - -#undef g_io_channel_read_unichar -extern __typeof (g_io_channel_read_unichar) g_io_channel_read_unichar __attribute((alias("IA__g_io_channel_read_unichar"), visibility("default"))); - -#undef g_io_channel_ref -extern __typeof (g_io_channel_ref) g_io_channel_ref __attribute((alias("IA__g_io_channel_ref"), visibility("default"))); - -#undef g_io_channel_seek_position -extern __typeof (g_io_channel_seek_position) g_io_channel_seek_position __attribute((alias("IA__g_io_channel_seek_position"), visibility("default"))); - -#undef g_io_channel_set_buffered -extern __typeof (g_io_channel_set_buffered) g_io_channel_set_buffered __attribute((alias("IA__g_io_channel_set_buffered"), visibility("default"))); - -#undef g_io_channel_set_buffer_size -extern __typeof (g_io_channel_set_buffer_size) g_io_channel_set_buffer_size __attribute((alias("IA__g_io_channel_set_buffer_size"), visibility("default"))); - -#undef g_io_channel_set_close_on_unref -extern __typeof (g_io_channel_set_close_on_unref) g_io_channel_set_close_on_unref __attribute((alias("IA__g_io_channel_set_close_on_unref"), visibility("default"))); - -#undef g_io_channel_set_encoding -extern __typeof (g_io_channel_set_encoding) g_io_channel_set_encoding __attribute((alias("IA__g_io_channel_set_encoding"), visibility("default"))); - -#undef g_io_channel_set_flags -extern __typeof (g_io_channel_set_flags) g_io_channel_set_flags __attribute((alias("IA__g_io_channel_set_flags"), visibility("default"))); - -#undef g_io_channel_set_line_term -extern __typeof (g_io_channel_set_line_term) g_io_channel_set_line_term __attribute((alias("IA__g_io_channel_set_line_term"), visibility("default"))); - -#undef g_io_channel_shutdown -extern __typeof (g_io_channel_shutdown) g_io_channel_shutdown __attribute((alias("IA__g_io_channel_shutdown"), visibility("default"))); - -#undef g_io_channel_unref -extern __typeof (g_io_channel_unref) g_io_channel_unref __attribute((alias("IA__g_io_channel_unref"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_io_channel_close -extern __typeof (g_io_channel_close) g_io_channel_close __attribute((alias("IA__g_io_channel_close"), visibility("default"))); - -#undef g_io_channel_read -extern __typeof (g_io_channel_read) g_io_channel_read __attribute((alias("IA__g_io_channel_read"), visibility("default"))); - -#undef g_io_channel_seek -extern __typeof (g_io_channel_seek) g_io_channel_seek __attribute((alias("IA__g_io_channel_seek"), visibility("default"))); - -#undef g_io_channel_write -extern __typeof (g_io_channel_write) g_io_channel_write __attribute((alias("IA__g_io_channel_write"), visibility("default"))); - -#endif -#undef g_io_channel_write_chars -extern __typeof (g_io_channel_write_chars) g_io_channel_write_chars __attribute((alias("IA__g_io_channel_write_chars"), visibility("default"))); - -#undef g_io_channel_write_unichar -extern __typeof (g_io_channel_write_unichar) g_io_channel_write_unichar __attribute((alias("IA__g_io_channel_write_unichar"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_IOCHANNEL_H__) -#if IN_FILE(__G_IO_UNIX_C__) -#ifdef G_OS_UNIX -#undef g_io_channel_unix_get_fd -extern __typeof (g_io_channel_unix_get_fd) g_io_channel_unix_get_fd __attribute((alias("IA__g_io_channel_unix_get_fd"), visibility("default"))); - -#undef g_io_channel_unix_new -extern __typeof (g_io_channel_unix_new) g_io_channel_unix_new __attribute((alias("IA__g_io_channel_unix_new"), visibility("default"))); - -#undef g_io_channel_new_file -extern __typeof (g_io_channel_new_file) g_io_channel_new_file __attribute((alias("IA__g_io_channel_new_file"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_IOCHANNEL_H__) -#if IN_FILE(__G_IO_WIN32_C__) -#ifdef G_OS_WIN32 -#undef g_io_channel_unix_get_fd -extern __typeof (g_io_channel_unix_get_fd) g_io_channel_unix_get_fd __attribute((alias("IA__g_io_channel_unix_get_fd"), visibility("default"))); - -#undef g_io_channel_unix_new -extern __typeof (g_io_channel_unix_new) g_io_channel_unix_new __attribute((alias("IA__g_io_channel_unix_new"), visibility("default"))); - -#ifndef _WIN64 -#undef g_io_channel_new_file -extern __typeof (g_io_channel_new_file) g_io_channel_new_file __attribute((alias("IA__g_io_channel_new_file"), visibility("default"))); - -#endif -#undef g_io_channel_new_file_utf8 -extern __typeof (g_io_channel_new_file_utf8) g_io_channel_new_file_utf8 __attribute((alias("IA__g_io_channel_new_file_utf8"), visibility("default"))); - -#undef g_io_channel_win32_get_fd -extern __typeof (g_io_channel_win32_get_fd) g_io_channel_win32_get_fd __attribute((alias("IA__g_io_channel_win32_get_fd"), visibility("default"))); - -#undef g_io_channel_win32_make_pollfd -extern __typeof (g_io_channel_win32_make_pollfd) g_io_channel_win32_make_pollfd __attribute((alias("IA__g_io_channel_win32_make_pollfd"), visibility("default"))); - -#undef g_io_channel_win32_new_fd -extern __typeof (g_io_channel_win32_new_fd) g_io_channel_win32_new_fd __attribute((alias("IA__g_io_channel_win32_new_fd"), visibility("default"))); - -#undef g_io_channel_win32_new_messages -extern __typeof (g_io_channel_win32_new_messages) g_io_channel_win32_new_messages __attribute((alias("IA__g_io_channel_win32_new_messages"), visibility("default"))); - -#undef g_io_channel_win32_new_socket -extern __typeof (g_io_channel_win32_new_socket) g_io_channel_win32_new_socket __attribute((alias("IA__g_io_channel_win32_new_socket"), visibility("default"))); - -#ifndef _WIN64 -#undef g_io_channel_win32_new_stream_socket -extern __typeof (g_io_channel_win32_new_stream_socket) g_io_channel_win32_new_stream_socket __attribute((alias("IA__g_io_channel_win32_new_stream_socket"), visibility("default"))); - -#endif -#undef g_io_channel_win32_poll -extern __typeof (g_io_channel_win32_poll) g_io_channel_win32_poll __attribute((alias("IA__g_io_channel_win32_poll"), visibility("default"))); - -#undef g_io_channel_win32_set_debug -extern __typeof (g_io_channel_win32_set_debug) g_io_channel_win32_set_debug __attribute((alias("IA__g_io_channel_win32_set_debug"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_KEY_FILE_H__) -#if IN_FILE(__G_KEY_FILE_C__) -#undef g_key_file_error_quark -extern __typeof (g_key_file_error_quark) g_key_file_error_quark __attribute((alias("IA__g_key_file_error_quark"), visibility("default"))); - -#undef g_key_file_free -extern __typeof (g_key_file_free) g_key_file_free __attribute((alias("IA__g_key_file_free"), visibility("default"))); - -#undef g_key_file_get_boolean -extern __typeof (g_key_file_get_boolean) g_key_file_get_boolean __attribute((alias("IA__g_key_file_get_boolean"), visibility("default"))); - -#undef g_key_file_get_boolean_list -extern __typeof (g_key_file_get_boolean_list) g_key_file_get_boolean_list __attribute((alias("IA__g_key_file_get_boolean_list"), visibility("default"))); - -#undef g_key_file_get_comment -extern __typeof (g_key_file_get_comment) g_key_file_get_comment __attribute((alias("IA__g_key_file_get_comment"), visibility("default"))); - -#undef g_key_file_get_groups -extern __typeof (g_key_file_get_groups) g_key_file_get_groups __attribute((alias("IA__g_key_file_get_groups"), visibility("default"))); - -#undef g_key_file_get_double -extern __typeof (g_key_file_get_double) g_key_file_get_double __attribute((alias("IA__g_key_file_get_double"), visibility("default"))); - -#undef g_key_file_get_double_list -extern __typeof (g_key_file_get_double_list) g_key_file_get_double_list __attribute((alias("IA__g_key_file_get_double_list"), visibility("default"))); - -#undef g_key_file_get_integer -extern __typeof (g_key_file_get_integer) g_key_file_get_integer __attribute((alias("IA__g_key_file_get_integer"), visibility("default"))); - -#undef g_key_file_get_integer_list -extern __typeof (g_key_file_get_integer_list) g_key_file_get_integer_list __attribute((alias("IA__g_key_file_get_integer_list"), visibility("default"))); - -#undef g_key_file_get_keys -extern __typeof (g_key_file_get_keys) g_key_file_get_keys __attribute((alias("IA__g_key_file_get_keys"), visibility("default"))); - -#undef g_key_file_get_locale_string -extern __typeof (g_key_file_get_locale_string) g_key_file_get_locale_string __attribute((alias("IA__g_key_file_get_locale_string"), visibility("default"))); - -#undef g_key_file_get_locale_string_list -extern __typeof (g_key_file_get_locale_string_list) g_key_file_get_locale_string_list __attribute((alias("IA__g_key_file_get_locale_string_list"), visibility("default"))); - -#undef g_key_file_get_start_group -extern __typeof (g_key_file_get_start_group) g_key_file_get_start_group __attribute((alias("IA__g_key_file_get_start_group"), visibility("default"))); - -#undef g_key_file_get_string -extern __typeof (g_key_file_get_string) g_key_file_get_string __attribute((alias("IA__g_key_file_get_string"), visibility("default"))); - -#undef g_key_file_get_string_list -extern __typeof (g_key_file_get_string_list) g_key_file_get_string_list __attribute((alias("IA__g_key_file_get_string_list"), visibility("default"))); - -#undef g_key_file_get_value -extern __typeof (g_key_file_get_value) g_key_file_get_value __attribute((alias("IA__g_key_file_get_value"), visibility("default"))); - -#undef g_key_file_has_group -extern __typeof (g_key_file_has_group) g_key_file_has_group __attribute((alias("IA__g_key_file_has_group"), visibility("default"))); - -#undef g_key_file_has_key -extern __typeof (g_key_file_has_key) g_key_file_has_key __attribute((alias("IA__g_key_file_has_key"), visibility("default"))); - -#undef g_key_file_load_from_dirs -extern __typeof (g_key_file_load_from_dirs) g_key_file_load_from_dirs __attribute((alias("IA__g_key_file_load_from_dirs"), visibility("default"))); - -#undef g_key_file_load_from_data -extern __typeof (g_key_file_load_from_data) g_key_file_load_from_data __attribute((alias("IA__g_key_file_load_from_data"), visibility("default"))); - -#undef g_key_file_load_from_data_dirs -extern __typeof (g_key_file_load_from_data_dirs) g_key_file_load_from_data_dirs __attribute((alias("IA__g_key_file_load_from_data_dirs"), visibility("default"))); - -#undef g_key_file_load_from_file -extern __typeof (g_key_file_load_from_file) g_key_file_load_from_file __attribute((alias("IA__g_key_file_load_from_file"), visibility("default"))); - -#undef g_key_file_new -extern __typeof (g_key_file_new) g_key_file_new __attribute((alias("IA__g_key_file_new"), visibility("default"))); - -#undef g_key_file_remove_comment -extern __typeof (g_key_file_remove_comment) g_key_file_remove_comment __attribute((alias("IA__g_key_file_remove_comment"), visibility("default"))); - -#undef g_key_file_remove_group -extern __typeof (g_key_file_remove_group) g_key_file_remove_group __attribute((alias("IA__g_key_file_remove_group"), visibility("default"))); - -#undef g_key_file_remove_key -extern __typeof (g_key_file_remove_key) g_key_file_remove_key __attribute((alias("IA__g_key_file_remove_key"), visibility("default"))); - -#undef g_key_file_set_boolean -extern __typeof (g_key_file_set_boolean) g_key_file_set_boolean __attribute((alias("IA__g_key_file_set_boolean"), visibility("default"))); - -#undef g_key_file_set_boolean_list -extern __typeof (g_key_file_set_boolean_list) g_key_file_set_boolean_list __attribute((alias("IA__g_key_file_set_boolean_list"), visibility("default"))); - -#undef g_key_file_set_comment -extern __typeof (g_key_file_set_comment) g_key_file_set_comment __attribute((alias("IA__g_key_file_set_comment"), visibility("default"))); - -#undef g_key_file_set_double -extern __typeof (g_key_file_set_double) g_key_file_set_double __attribute((alias("IA__g_key_file_set_double"), visibility("default"))); - -#undef g_key_file_set_double_list -extern __typeof (g_key_file_set_double_list) g_key_file_set_double_list __attribute((alias("IA__g_key_file_set_double_list"), visibility("default"))); - -#undef g_key_file_set_integer -extern __typeof (g_key_file_set_integer) g_key_file_set_integer __attribute((alias("IA__g_key_file_set_integer"), visibility("default"))); - -#undef g_key_file_set_integer_list -extern __typeof (g_key_file_set_integer_list) g_key_file_set_integer_list __attribute((alias("IA__g_key_file_set_integer_list"), visibility("default"))); - -#undef g_key_file_set_list_separator -extern __typeof (g_key_file_set_list_separator) g_key_file_set_list_separator __attribute((alias("IA__g_key_file_set_list_separator"), visibility("default"))); - -#undef g_key_file_set_locale_string -extern __typeof (g_key_file_set_locale_string) g_key_file_set_locale_string __attribute((alias("IA__g_key_file_set_locale_string"), visibility("default"))); - -#undef g_key_file_set_locale_string_list -extern __typeof (g_key_file_set_locale_string_list) g_key_file_set_locale_string_list __attribute((alias("IA__g_key_file_set_locale_string_list"), visibility("default"))); - -#undef g_key_file_set_string -extern __typeof (g_key_file_set_string) g_key_file_set_string __attribute((alias("IA__g_key_file_set_string"), visibility("default"))); - -#undef g_key_file_set_string_list -extern __typeof (g_key_file_set_string_list) g_key_file_set_string_list __attribute((alias("IA__g_key_file_set_string_list"), visibility("default"))); - -#undef g_key_file_set_value -extern __typeof (g_key_file_set_value) g_key_file_set_value __attribute((alias("IA__g_key_file_set_value"), visibility("default"))); - -#undef g_key_file_to_data -extern __typeof (g_key_file_to_data) g_key_file_to_data __attribute((alias("IA__g_key_file_to_data"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_LIST_H__) -#if IN_FILE(__G_LIST_C__) -#undef g_list_alloc -extern __typeof (g_list_alloc) g_list_alloc __attribute((alias("IA__g_list_alloc"), visibility("default"))); - -#undef g_list_append -extern __typeof (g_list_append) g_list_append __attribute((alias("IA__g_list_append"), visibility("default"))); - -#undef g_list_concat -extern __typeof (g_list_concat) g_list_concat __attribute((alias("IA__g_list_concat"), visibility("default"))); - -#undef g_list_copy -extern __typeof (g_list_copy) g_list_copy __attribute((alias("IA__g_list_copy"), visibility("default"))); - -#undef g_list_delete_link -extern __typeof (g_list_delete_link) g_list_delete_link __attribute((alias("IA__g_list_delete_link"), visibility("default"))); - -#undef g_list_find -extern __typeof (g_list_find) g_list_find __attribute((alias("IA__g_list_find"), visibility("default"))); - -#undef g_list_find_custom -extern __typeof (g_list_find_custom) g_list_find_custom __attribute((alias("IA__g_list_find_custom"), visibility("default"))); - -#undef g_list_first -extern __typeof (g_list_first) g_list_first __attribute((alias("IA__g_list_first"), visibility("default"))); - -#undef g_list_foreach -extern __typeof (g_list_foreach) g_list_foreach __attribute((alias("IA__g_list_foreach"), visibility("default"))); - -#undef g_list_free -extern __typeof (g_list_free) g_list_free __attribute((alias("IA__g_list_free"), visibility("default"))); - -#undef g_list_free_1 -extern __typeof (g_list_free_1) g_list_free_1 __attribute((alias("IA__g_list_free_1"), visibility("default"))); - -#undef g_list_index -extern __typeof (g_list_index) g_list_index __attribute((alias("IA__g_list_index"), visibility("default"))); - -#undef g_list_insert -extern __typeof (g_list_insert) g_list_insert __attribute((alias("IA__g_list_insert"), visibility("default"))); - -#undef g_list_insert_before -extern __typeof (g_list_insert_before) g_list_insert_before __attribute((alias("IA__g_list_insert_before"), visibility("default"))); - -#undef g_list_insert_sorted -extern __typeof (g_list_insert_sorted) g_list_insert_sorted __attribute((alias("IA__g_list_insert_sorted"), visibility("default"))); - -#undef g_list_insert_sorted_with_data -extern __typeof (g_list_insert_sorted_with_data) g_list_insert_sorted_with_data __attribute((alias("IA__g_list_insert_sorted_with_data"), visibility("default"))); - -#undef g_list_last -extern __typeof (g_list_last) g_list_last __attribute((alias("IA__g_list_last"), visibility("default"))); - -#undef g_list_length -extern __typeof (g_list_length) g_list_length __attribute((alias("IA__g_list_length"), visibility("default"))); - -#undef g_list_nth -extern __typeof (g_list_nth) g_list_nth __attribute((alias("IA__g_list_nth"), visibility("default"))); - -#undef g_list_nth_data -extern __typeof (g_list_nth_data) g_list_nth_data __attribute((alias("IA__g_list_nth_data"), visibility("default"))); - -#undef g_list_nth_prev -extern __typeof (g_list_nth_prev) g_list_nth_prev __attribute((alias("IA__g_list_nth_prev"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_list_pop_allocator -extern __typeof (g_list_pop_allocator) g_list_pop_allocator __attribute((alias("IA__g_list_pop_allocator"), visibility("default"))); - -#endif -#undef g_list_position -extern __typeof (g_list_position) g_list_position __attribute((alias("IA__g_list_position"), visibility("default"))); - -#undef g_list_prepend -extern __typeof (g_list_prepend) g_list_prepend __attribute((alias("IA__g_list_prepend"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_list_push_allocator -extern __typeof (g_list_push_allocator) g_list_push_allocator __attribute((alias("IA__g_list_push_allocator"), visibility("default"))); - -#endif -#undef g_list_remove -extern __typeof (g_list_remove) g_list_remove __attribute((alias("IA__g_list_remove"), visibility("default"))); - -#undef g_list_remove_all -extern __typeof (g_list_remove_all) g_list_remove_all __attribute((alias("IA__g_list_remove_all"), visibility("default"))); - -#undef g_list_remove_link -extern __typeof (g_list_remove_link) g_list_remove_link __attribute((alias("IA__g_list_remove_link"), visibility("default"))); - -#undef g_list_reverse -extern __typeof (g_list_reverse) g_list_reverse __attribute((alias("IA__g_list_reverse"), visibility("default"))); - -#undef g_list_sort -extern __typeof (g_list_sort) g_list_sort __attribute((alias("IA__g_list_sort"), visibility("default"))); - -#undef g_list_sort_with_data -extern __typeof (g_list_sort_with_data) g_list_sort_with_data __attribute((alias("IA__g_list_sort_with_data"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_MAIN_H__) -#if IN_FILE(__G_MAIN_C__) -#undef g_child_watch_add -extern __typeof (g_child_watch_add) g_child_watch_add __attribute((alias("IA__g_child_watch_add"), visibility("default"))); - -#undef g_child_watch_add_full -extern __typeof (g_child_watch_add_full) g_child_watch_add_full __attribute((alias("IA__g_child_watch_add_full"), visibility("default"))); - -#undef g_child_watch_source_new -extern __typeof (g_child_watch_source_new) g_child_watch_source_new __attribute((alias("IA__g_child_watch_source_new"), visibility("default"))); - -#undef g_get_current_time -extern __typeof (g_get_current_time) g_get_current_time __attribute((alias("IA__g_get_current_time"), visibility("default"))); - -#undef g_main_context_acquire -extern __typeof (g_main_context_acquire) g_main_context_acquire __attribute((alias("IA__g_main_context_acquire"), visibility("default"))); - -#undef g_main_context_add_poll -extern __typeof (g_main_context_add_poll) g_main_context_add_poll __attribute((alias("IA__g_main_context_add_poll"), visibility("default"))); - -#undef g_main_context_check -extern __typeof (g_main_context_check) g_main_context_check __attribute((alias("IA__g_main_context_check"), visibility("default"))); - -#undef g_main_context_default -extern __typeof (g_main_context_default) g_main_context_default __attribute((alias("IA__g_main_context_default"), visibility("default"))); - -#undef g_main_context_dispatch -extern __typeof (g_main_context_dispatch) g_main_context_dispatch __attribute((alias("IA__g_main_context_dispatch"), visibility("default"))); - -#undef g_main_context_find_source_by_funcs_user_data -extern __typeof (g_main_context_find_source_by_funcs_user_data) g_main_context_find_source_by_funcs_user_data __attribute((alias("IA__g_main_context_find_source_by_funcs_user_data"), visibility("default"))); - -#undef g_main_context_find_source_by_id -extern __typeof (g_main_context_find_source_by_id) g_main_context_find_source_by_id __attribute((alias("IA__g_main_context_find_source_by_id"), visibility("default"))); - -#undef g_main_context_find_source_by_user_data -extern __typeof (g_main_context_find_source_by_user_data) g_main_context_find_source_by_user_data __attribute((alias("IA__g_main_context_find_source_by_user_data"), visibility("default"))); - -#undef g_main_context_get_poll_func -extern __typeof (g_main_context_get_poll_func) g_main_context_get_poll_func __attribute((alias("IA__g_main_context_get_poll_func"), visibility("default"))); - -#undef g_main_context_get_thread_default -extern __typeof (g_main_context_get_thread_default) g_main_context_get_thread_default __attribute((alias("IA__g_main_context_get_thread_default"), visibility("default"))); - -#undef g_main_context_is_owner -extern __typeof (g_main_context_is_owner) g_main_context_is_owner __attribute((alias("IA__g_main_context_is_owner"), visibility("default"))); - -#undef g_main_context_iteration -extern __typeof (g_main_context_iteration) g_main_context_iteration __attribute((alias("IA__g_main_context_iteration"), visibility("default"))); - -#undef g_main_context_new -extern __typeof (g_main_context_new) g_main_context_new __attribute((alias("IA__g_main_context_new"), visibility("default"))); - -#undef g_main_context_pending -extern __typeof (g_main_context_pending) g_main_context_pending __attribute((alias("IA__g_main_context_pending"), visibility("default"))); - -#undef g_main_context_pop_thread_default -extern __typeof (g_main_context_pop_thread_default) g_main_context_pop_thread_default __attribute((alias("IA__g_main_context_pop_thread_default"), visibility("default"))); - -#undef g_main_context_prepare -extern __typeof (g_main_context_prepare) g_main_context_prepare __attribute((alias("IA__g_main_context_prepare"), visibility("default"))); - -#undef g_main_context_push_thread_default -extern __typeof (g_main_context_push_thread_default) g_main_context_push_thread_default __attribute((alias("IA__g_main_context_push_thread_default"), visibility("default"))); - -#undef g_main_context_query -extern __typeof (g_main_context_query) g_main_context_query __attribute((alias("IA__g_main_context_query"), visibility("default"))); - -#undef g_main_context_ref -extern __typeof (g_main_context_ref) g_main_context_ref __attribute((alias("IA__g_main_context_ref"), visibility("default"))); - -#undef g_main_context_release -extern __typeof (g_main_context_release) g_main_context_release __attribute((alias("IA__g_main_context_release"), visibility("default"))); - -#undef g_main_context_remove_poll -extern __typeof (g_main_context_remove_poll) g_main_context_remove_poll __attribute((alias("IA__g_main_context_remove_poll"), visibility("default"))); - -#undef g_main_context_set_poll_func -extern __typeof (g_main_context_set_poll_func) g_main_context_set_poll_func __attribute((alias("IA__g_main_context_set_poll_func"), visibility("default"))); - -#undef g_main_context_unref -extern __typeof (g_main_context_unref) g_main_context_unref __attribute((alias("IA__g_main_context_unref"), visibility("default"))); - -#undef g_main_context_wait -extern __typeof (g_main_context_wait) g_main_context_wait __attribute((alias("IA__g_main_context_wait"), visibility("default"))); - -#undef g_main_context_wakeup -extern __typeof (g_main_context_wakeup) g_main_context_wakeup __attribute((alias("IA__g_main_context_wakeup"), visibility("default"))); - -#undef g_main_depth -extern __typeof (g_main_depth) g_main_depth __attribute((alias("IA__g_main_depth"), visibility("default"))); - -#undef g_main_current_source -extern __typeof (g_main_current_source) g_main_current_source __attribute((alias("IA__g_main_current_source"), visibility("default"))); - -#undef g_main_loop_get_context -extern __typeof (g_main_loop_get_context) g_main_loop_get_context __attribute((alias("IA__g_main_loop_get_context"), visibility("default"))); - -#undef g_main_loop_is_running -extern __typeof (g_main_loop_is_running) g_main_loop_is_running __attribute((alias("IA__g_main_loop_is_running"), visibility("default"))); - -#undef g_main_loop_new -extern __typeof (g_main_loop_new) g_main_loop_new __attribute((alias("IA__g_main_loop_new"), visibility("default"))); - -#undef g_main_loop_quit -extern __typeof (g_main_loop_quit) g_main_loop_quit __attribute((alias("IA__g_main_loop_quit"), visibility("default"))); - -#undef g_main_loop_ref -extern __typeof (g_main_loop_ref) g_main_loop_ref __attribute((alias("IA__g_main_loop_ref"), visibility("default"))); - -#undef g_main_loop_run -extern __typeof (g_main_loop_run) g_main_loop_run __attribute((alias("IA__g_main_loop_run"), visibility("default"))); - -#undef g_main_loop_unref -extern __typeof (g_main_loop_unref) g_main_loop_unref __attribute((alias("IA__g_main_loop_unref"), visibility("default"))); - -#undef g_source_add_poll -extern __typeof (g_source_add_poll) g_source_add_poll __attribute((alias("IA__g_source_add_poll"), visibility("default"))); - -#undef g_source_attach -extern __typeof (g_source_attach) g_source_attach __attribute((alias("IA__g_source_attach"), visibility("default"))); - -#undef g_source_destroy -extern __typeof (g_source_destroy) g_source_destroy __attribute((alias("IA__g_source_destroy"), visibility("default"))); - -#undef g_source_get_can_recurse -extern __typeof (g_source_get_can_recurse) g_source_get_can_recurse __attribute((alias("IA__g_source_get_can_recurse"), visibility("default"))); - -#undef g_source_get_context -extern __typeof (g_source_get_context) g_source_get_context __attribute((alias("IA__g_source_get_context"), visibility("default"))); - -#undef g_source_get_current_time -extern __typeof (g_source_get_current_time) g_source_get_current_time __attribute((alias("IA__g_source_get_current_time"), visibility("default"))); - -#undef g_source_get_id -extern __typeof (g_source_get_id) g_source_get_id __attribute((alias("IA__g_source_get_id"), visibility("default"))); - -#undef g_source_get_priority -extern __typeof (g_source_get_priority) g_source_get_priority __attribute((alias("IA__g_source_get_priority"), visibility("default"))); - -#undef g_source_new -extern __typeof (g_source_new) g_source_new __attribute((alias("IA__g_source_new"), visibility("default"))); - -#undef g_source_ref -extern __typeof (g_source_ref) g_source_ref __attribute((alias("IA__g_source_ref"), visibility("default"))); - -#undef g_source_remove -extern __typeof (g_source_remove) g_source_remove __attribute((alias("IA__g_source_remove"), visibility("default"))); - -#undef g_source_remove_by_funcs_user_data -extern __typeof (g_source_remove_by_funcs_user_data) g_source_remove_by_funcs_user_data __attribute((alias("IA__g_source_remove_by_funcs_user_data"), visibility("default"))); - -#undef g_source_remove_by_user_data -extern __typeof (g_source_remove_by_user_data) g_source_remove_by_user_data __attribute((alias("IA__g_source_remove_by_user_data"), visibility("default"))); - -#undef g_source_remove_poll -extern __typeof (g_source_remove_poll) g_source_remove_poll __attribute((alias("IA__g_source_remove_poll"), visibility("default"))); - -#undef g_source_set_callback -extern __typeof (g_source_set_callback) g_source_set_callback __attribute((alias("IA__g_source_set_callback"), visibility("default"))); - -#undef g_source_set_callback_indirect -extern __typeof (g_source_set_callback_indirect) g_source_set_callback_indirect __attribute((alias("IA__g_source_set_callback_indirect"), visibility("default"))); - -#undef g_source_set_can_recurse -extern __typeof (g_source_set_can_recurse) g_source_set_can_recurse __attribute((alias("IA__g_source_set_can_recurse"), visibility("default"))); - -#undef g_source_set_funcs -extern __typeof (g_source_set_funcs) g_source_set_funcs __attribute((alias("IA__g_source_set_funcs"), visibility("default"))); - -#undef g_source_is_destroyed -extern __typeof (g_source_is_destroyed) g_source_is_destroyed __attribute((alias("IA__g_source_is_destroyed"), visibility("default"))); - -#undef g_source_set_priority -extern __typeof (g_source_set_priority) g_source_set_priority __attribute((alias("IA__g_source_set_priority"), visibility("default"))); - -#undef g_source_unref -extern __typeof (g_source_unref) g_source_unref __attribute((alias("IA__g_source_unref"), visibility("default"))); - -#undef g_idle_add -extern __typeof (g_idle_add) g_idle_add __attribute((alias("IA__g_idle_add"), visibility("default"))); - -#undef g_idle_add_full -extern __typeof (g_idle_add_full) g_idle_add_full __attribute((alias("IA__g_idle_add_full"), visibility("default"))); - -#undef g_idle_remove_by_data -extern __typeof (g_idle_remove_by_data) g_idle_remove_by_data __attribute((alias("IA__g_idle_remove_by_data"), visibility("default"))); - -#undef g_idle_source_new -extern __typeof (g_idle_source_new) g_idle_source_new __attribute((alias("IA__g_idle_source_new"), visibility("default"))); - -#undef g_timeout_add -extern __typeof (g_timeout_add) g_timeout_add __attribute((alias("IA__g_timeout_add"), visibility("default"))); - -#undef g_timeout_add_seconds -extern __typeof (g_timeout_add_seconds) g_timeout_add_seconds __attribute((alias("IA__g_timeout_add_seconds"), visibility("default"))); - -#undef g_timeout_add_full -extern __typeof (g_timeout_add_full) g_timeout_add_full __attribute((alias("IA__g_timeout_add_full"), visibility("default"))); - -#undef g_timeout_add_seconds_full -extern __typeof (g_timeout_add_seconds_full) g_timeout_add_seconds_full __attribute((alias("IA__g_timeout_add_seconds_full"), visibility("default"))); - -#undef g_timeout_source_new -extern __typeof (g_timeout_source_new) g_timeout_source_new __attribute((alias("IA__g_timeout_source_new"), visibility("default"))); - -#undef g_timeout_source_new_seconds -extern __typeof (g_timeout_source_new_seconds) g_timeout_source_new_seconds __attribute((alias("IA__g_timeout_source_new_seconds"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_MAPPED_FILE_H__) -#if IN_FILE(__G_MAPPED_FILE_C__) -#undef g_mapped_file_new -extern __typeof (g_mapped_file_new) g_mapped_file_new __attribute((alias("IA__g_mapped_file_new"), visibility("default"))); - -#undef g_mapped_file_get_length -extern __typeof (g_mapped_file_get_length) g_mapped_file_get_length __attribute((alias("IA__g_mapped_file_get_length"), visibility("default"))); - -#undef g_mapped_file_get_contents -extern __typeof (g_mapped_file_get_contents) g_mapped_file_get_contents __attribute((alias("IA__g_mapped_file_get_contents"), visibility("default"))); - -#undef g_mapped_file_ref -extern __typeof (g_mapped_file_ref) g_mapped_file_ref __attribute((alias("IA__g_mapped_file_ref"), visibility("default"))); - -#undef g_mapped_file_unref -extern __typeof (g_mapped_file_unref) g_mapped_file_unref __attribute((alias("IA__g_mapped_file_unref"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_mapped_file_free -extern __typeof (g_mapped_file_free) g_mapped_file_free __attribute((alias("IA__g_mapped_file_free"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_MARKUP_H__) -#if IN_FILE(__G_MARKUP_C__) -#undef g_markup_error_quark -extern __typeof (g_markup_error_quark) g_markup_error_quark __attribute((alias("IA__g_markup_error_quark"), visibility("default"))); - -#undef g_markup_escape_text -extern __typeof (g_markup_escape_text) g_markup_escape_text __attribute((alias("IA__g_markup_escape_text"), visibility("default"))); - -#undef g_markup_parse_context_end_parse -extern __typeof (g_markup_parse_context_end_parse) g_markup_parse_context_end_parse __attribute((alias("IA__g_markup_parse_context_end_parse"), visibility("default"))); - -#undef g_markup_parse_context_free -extern __typeof (g_markup_parse_context_free) g_markup_parse_context_free __attribute((alias("IA__g_markup_parse_context_free"), visibility("default"))); - -#undef g_markup_parse_context_get_element -extern __typeof (g_markup_parse_context_get_element) g_markup_parse_context_get_element __attribute((alias("IA__g_markup_parse_context_get_element"), visibility("default"))); - -#undef g_markup_parse_context_get_element_stack -extern __typeof (g_markup_parse_context_get_element_stack) g_markup_parse_context_get_element_stack __attribute((alias("IA__g_markup_parse_context_get_element_stack"), visibility("default"))); - -#undef g_markup_parse_context_get_position -extern __typeof (g_markup_parse_context_get_position) g_markup_parse_context_get_position __attribute((alias("IA__g_markup_parse_context_get_position"), visibility("default"))); - -#undef g_markup_parse_context_get_user_data -extern __typeof (g_markup_parse_context_get_user_data) g_markup_parse_context_get_user_data __attribute((alias("IA__g_markup_parse_context_get_user_data"), visibility("default"))); - -#undef g_markup_parse_context_new -extern __typeof (g_markup_parse_context_new) g_markup_parse_context_new __attribute((alias("IA__g_markup_parse_context_new"), visibility("default"))); - -#undef g_markup_parse_context_parse -extern __typeof (g_markup_parse_context_parse) g_markup_parse_context_parse __attribute((alias("IA__g_markup_parse_context_parse"), visibility("default"))); - -#undef g_markup_parse_context_push -extern __typeof (g_markup_parse_context_push) g_markup_parse_context_push __attribute((alias("IA__g_markup_parse_context_push"), visibility("default"))); - -#undef g_markup_parse_context_pop -extern __typeof (g_markup_parse_context_pop) g_markup_parse_context_pop __attribute((alias("IA__g_markup_parse_context_pop"), visibility("default"))); - -#undef g_markup_printf_escaped -extern __typeof (g_markup_printf_escaped) g_markup_printf_escaped __attribute((alias("IA__g_markup_printf_escaped"), visibility("default"))); - -#undef g_markup_vprintf_escaped -extern __typeof (g_markup_vprintf_escaped) g_markup_vprintf_escaped __attribute((alias("IA__g_markup_vprintf_escaped"), visibility("default"))); - -#undef g_markup_collect_attributes -extern __typeof (g_markup_collect_attributes) g_markup_collect_attributes __attribute((alias("IA__g_markup_collect_attributes"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_MEM_H__) -#if IN_FILE(__G_MEM_C__) -#undef g_free -extern __typeof (g_free) g_free __attribute((alias("IA__g_free"), visibility("default"))); - -#undef g_malloc -extern __typeof (g_malloc) g_malloc __attribute((alias("IA__g_malloc"), visibility("default"))); - -#undef g_malloc0 -extern __typeof (g_malloc0) g_malloc0 __attribute((alias("IA__g_malloc0"), visibility("default"))); - -#undef g_malloc_n -extern __typeof (g_malloc_n) g_malloc_n __attribute((alias("IA__g_malloc_n"), visibility("default"))); - -#undef g_malloc0_n -extern __typeof (g_malloc0_n) g_malloc0_n __attribute((alias("IA__g_malloc0_n"), visibility("default"))); - -#undef g_mem_is_system_malloc -extern __typeof (g_mem_is_system_malloc) g_mem_is_system_malloc __attribute((alias("IA__g_mem_is_system_malloc"), visibility("default"))); - -#undef g_mem_profile -extern __typeof (g_mem_profile) g_mem_profile __attribute((alias("IA__g_mem_profile"), visibility("default"))); - -#undef g_mem_set_vtable -extern __typeof (g_mem_set_vtable) g_mem_set_vtable __attribute((alias("IA__g_mem_set_vtable"), visibility("default"))); - -#undef g_realloc -extern __typeof (g_realloc) g_realloc __attribute((alias("IA__g_realloc"), visibility("default"))); - -#undef g_realloc_n -extern __typeof (g_realloc_n) g_realloc_n __attribute((alias("IA__g_realloc_n"), visibility("default"))); - -#undef g_try_malloc -extern __typeof (g_try_malloc) g_try_malloc __attribute((alias("IA__g_try_malloc"), visibility("default"))); - -#undef g_try_malloc0 -extern __typeof (g_try_malloc0) g_try_malloc0 __attribute((alias("IA__g_try_malloc0"), visibility("default"))); - -#undef g_try_malloc_n -extern __typeof (g_try_malloc_n) g_try_malloc_n __attribute((alias("IA__g_try_malloc_n"), visibility("default"))); - -#undef g_try_malloc0_n -extern __typeof (g_try_malloc0_n) g_try_malloc0_n __attribute((alias("IA__g_try_malloc0_n"), visibility("default"))); - -#undef g_try_realloc -extern __typeof (g_try_realloc) g_try_realloc __attribute((alias("IA__g_try_realloc"), visibility("default"))); - -#undef g_try_realloc_n -extern __typeof (g_try_realloc_n) g_try_realloc_n __attribute((alias("IA__g_try_realloc_n"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_allocator_free -extern __typeof (g_allocator_free) g_allocator_free __attribute((alias("IA__g_allocator_free"), visibility("default"))); - -#undef g_allocator_new -extern __typeof (g_allocator_new) g_allocator_new __attribute((alias("IA__g_allocator_new"), visibility("default"))); - -#undef g_mem_chunk_alloc -extern __typeof (g_mem_chunk_alloc) g_mem_chunk_alloc __attribute((alias("IA__g_mem_chunk_alloc"), visibility("default"))); - -#undef g_mem_chunk_alloc0 -extern __typeof (g_mem_chunk_alloc0) g_mem_chunk_alloc0 __attribute((alias("IA__g_mem_chunk_alloc0"), visibility("default"))); - -#undef g_mem_chunk_clean -extern __typeof (g_mem_chunk_clean) g_mem_chunk_clean __attribute((alias("IA__g_mem_chunk_clean"), visibility("default"))); - -#undef g_mem_chunk_destroy -extern __typeof (g_mem_chunk_destroy) g_mem_chunk_destroy __attribute((alias("IA__g_mem_chunk_destroy"), visibility("default"))); - -#undef g_mem_chunk_free -extern __typeof (g_mem_chunk_free) g_mem_chunk_free __attribute((alias("IA__g_mem_chunk_free"), visibility("default"))); - -#undef g_mem_chunk_info -extern __typeof (g_mem_chunk_info) g_mem_chunk_info __attribute((alias("IA__g_mem_chunk_info"), visibility("default"))); - -#undef g_mem_chunk_new -extern __typeof (g_mem_chunk_new) g_mem_chunk_new __attribute((alias("IA__g_mem_chunk_new"), visibility("default"))); - -#undef g_mem_chunk_print -extern __typeof (g_mem_chunk_print) g_mem_chunk_print __attribute((alias("IA__g_mem_chunk_print"), visibility("default"))); - -#undef g_mem_chunk_reset -extern __typeof (g_mem_chunk_reset) g_mem_chunk_reset __attribute((alias("IA__g_mem_chunk_reset"), visibility("default"))); - -#undef g_blow_chunks -extern __typeof (g_blow_chunks) g_blow_chunks __attribute((alias("IA__g_blow_chunks"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_SLICE_H__) -#if IN_FILE(__G_SLICE_C__) -#undef g_slice_alloc -extern __typeof (g_slice_alloc) g_slice_alloc __attribute((alias("IA__g_slice_alloc"), visibility("default"))); - -#undef g_slice_alloc0 -extern __typeof (g_slice_alloc0) g_slice_alloc0 __attribute((alias("IA__g_slice_alloc0"), visibility("default"))); - -#undef g_slice_copy -extern __typeof (g_slice_copy) g_slice_copy __attribute((alias("IA__g_slice_copy"), visibility("default"))); - -#undef g_slice_free1 -extern __typeof (g_slice_free1) g_slice_free1 __attribute((alias("IA__g_slice_free1"), visibility("default"))); - -#undef g_slice_free_chain_with_offset -extern __typeof (g_slice_free_chain_with_offset) g_slice_free_chain_with_offset __attribute((alias("IA__g_slice_free_chain_with_offset"), visibility("default"))); - -#undef g_slice_set_config -extern __typeof (g_slice_set_config) g_slice_set_config __attribute((alias("IA__g_slice_set_config"), visibility("default"))); - -#undef g_slice_get_config -extern __typeof (g_slice_get_config) g_slice_get_config __attribute((alias("IA__g_slice_get_config"), visibility("default"))); - -#undef g_slice_get_config_state -extern __typeof (g_slice_get_config_state) g_slice_get_config_state __attribute((alias("IA__g_slice_get_config_state"), visibility("default"))); - -#ifdef G_ENABLE_DEBUG -#endif -#endif -#endif -#if IN_HEADER(__G_MESSAGES_H__) -#if IN_FILE(__G_MESSAGES_C__) -#undef g_printf_string_upper_bound -extern __typeof (g_printf_string_upper_bound) g_printf_string_upper_bound __attribute((alias("IA__g_printf_string_upper_bound"), visibility("default"))); - -#undef g_log -extern __typeof (g_log) g_log __attribute((alias("IA__g_log"), visibility("default"))); - -#undef g_log_default_handler -extern __typeof (g_log_default_handler) g_log_default_handler __attribute((alias("IA__g_log_default_handler"), visibility("default"))); - -#undef g_log_remove_handler -extern __typeof (g_log_remove_handler) g_log_remove_handler __attribute((alias("IA__g_log_remove_handler"), visibility("default"))); - -#undef g_log_set_always_fatal -extern __typeof (g_log_set_always_fatal) g_log_set_always_fatal __attribute((alias("IA__g_log_set_always_fatal"), visibility("default"))); - -#undef g_log_set_default_handler -extern __typeof (g_log_set_default_handler) g_log_set_default_handler __attribute((alias("IA__g_log_set_default_handler"), visibility("default"))); - -#undef g_log_set_fatal_mask -extern __typeof (g_log_set_fatal_mask) g_log_set_fatal_mask __attribute((alias("IA__g_log_set_fatal_mask"), visibility("default"))); - -#undef g_log_set_handler -extern __typeof (g_log_set_handler) g_log_set_handler __attribute((alias("IA__g_log_set_handler"), visibility("default"))); - -#undef g_logv -extern __typeof (g_logv) g_logv __attribute((alias("IA__g_logv"), visibility("default"))); - -#undef g_return_if_fail_warning -extern __typeof (g_return_if_fail_warning) g_return_if_fail_warning __attribute((alias("IA__g_return_if_fail_warning"), visibility("default"))); - -#undef g_warn_message -extern __typeof (g_warn_message) g_warn_message __attribute((alias("IA__g_warn_message"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_assert_warning -extern __typeof (g_assert_warning) g_assert_warning __attribute((alias("IA__g_assert_warning"), visibility("default"))); - -#endif -#undef g_print -extern __typeof (g_print) g_print __attribute((alias("IA__g_print"), visibility("default"))); - -#undef g_printerr -extern __typeof (g_printerr) g_printerr __attribute((alias("IA__g_printerr"), visibility("default"))); - -#undef g_set_printerr_handler -extern __typeof (g_set_printerr_handler) g_set_printerr_handler __attribute((alias("IA__g_set_printerr_handler"), visibility("default"))); - -#undef g_set_print_handler -extern __typeof (g_set_print_handler) g_set_print_handler __attribute((alias("IA__g_set_print_handler"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_NODE_H__) -#if IN_FILE(__G_NODE_C__) -#undef g_node_child_index -extern __typeof (g_node_child_index) g_node_child_index __attribute((alias("IA__g_node_child_index"), visibility("default"))); - -#undef g_node_child_position -extern __typeof (g_node_child_position) g_node_child_position __attribute((alias("IA__g_node_child_position"), visibility("default"))); - -#undef g_node_children_foreach -extern __typeof (g_node_children_foreach) g_node_children_foreach __attribute((alias("IA__g_node_children_foreach"), visibility("default"))); - -#undef g_node_copy -extern __typeof (g_node_copy) g_node_copy __attribute((alias("IA__g_node_copy"), visibility("default"))); - -#undef g_node_copy_deep -extern __typeof (g_node_copy_deep) g_node_copy_deep __attribute((alias("IA__g_node_copy_deep"), visibility("default"))); - -#undef g_node_depth -extern __typeof (g_node_depth) g_node_depth __attribute((alias("IA__g_node_depth"), visibility("default"))); - -#undef g_node_destroy -extern __typeof (g_node_destroy) g_node_destroy __attribute((alias("IA__g_node_destroy"), visibility("default"))); - -#undef g_node_find -extern __typeof (g_node_find) g_node_find __attribute((alias("IA__g_node_find"), visibility("default"))); - -#undef g_node_find_child -extern __typeof (g_node_find_child) g_node_find_child __attribute((alias("IA__g_node_find_child"), visibility("default"))); - -#undef g_node_first_sibling -extern __typeof (g_node_first_sibling) g_node_first_sibling __attribute((alias("IA__g_node_first_sibling"), visibility("default"))); - -#undef g_node_get_root -extern __typeof (g_node_get_root) g_node_get_root __attribute((alias("IA__g_node_get_root"), visibility("default"))); - -#undef g_node_insert -extern __typeof (g_node_insert) g_node_insert __attribute((alias("IA__g_node_insert"), visibility("default"))); - -#undef g_node_insert_after -extern __typeof (g_node_insert_after) g_node_insert_after __attribute((alias("IA__g_node_insert_after"), visibility("default"))); - -#undef g_node_insert_before -extern __typeof (g_node_insert_before) g_node_insert_before __attribute((alias("IA__g_node_insert_before"), visibility("default"))); - -#undef g_node_is_ancestor -extern __typeof (g_node_is_ancestor) g_node_is_ancestor __attribute((alias("IA__g_node_is_ancestor"), visibility("default"))); - -#undef g_node_last_child -extern __typeof (g_node_last_child) g_node_last_child __attribute((alias("IA__g_node_last_child"), visibility("default"))); - -#undef g_node_last_sibling -extern __typeof (g_node_last_sibling) g_node_last_sibling __attribute((alias("IA__g_node_last_sibling"), visibility("default"))); - -#undef g_node_max_height -extern __typeof (g_node_max_height) g_node_max_height __attribute((alias("IA__g_node_max_height"), visibility("default"))); - -#undef g_node_n_children -extern __typeof (g_node_n_children) g_node_n_children __attribute((alias("IA__g_node_n_children"), visibility("default"))); - -#undef g_node_new -extern __typeof (g_node_new) g_node_new __attribute((alias("IA__g_node_new"), visibility("default"))); - -#undef g_node_n_nodes -extern __typeof (g_node_n_nodes) g_node_n_nodes __attribute((alias("IA__g_node_n_nodes"), visibility("default"))); - -#undef g_node_nth_child -extern __typeof (g_node_nth_child) g_node_nth_child __attribute((alias("IA__g_node_nth_child"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_node_pop_allocator -extern __typeof (g_node_pop_allocator) g_node_pop_allocator __attribute((alias("IA__g_node_pop_allocator"), visibility("default"))); - -#endif -#undef g_node_prepend -extern __typeof (g_node_prepend) g_node_prepend __attribute((alias("IA__g_node_prepend"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_node_push_allocator -extern __typeof (g_node_push_allocator) g_node_push_allocator __attribute((alias("IA__g_node_push_allocator"), visibility("default"))); - -#endif -#undef g_node_reverse_children -extern __typeof (g_node_reverse_children) g_node_reverse_children __attribute((alias("IA__g_node_reverse_children"), visibility("default"))); - -#undef g_node_traverse -extern __typeof (g_node_traverse) g_node_traverse __attribute((alias("IA__g_node_traverse"), visibility("default"))); - -#undef g_node_unlink -extern __typeof (g_node_unlink) g_node_unlink __attribute((alias("IA__g_node_unlink"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_OPTION_H__) -#if IN_FILE(__G_OPTION_C__) -#undef g_option_context_add_group -extern __typeof (g_option_context_add_group) g_option_context_add_group __attribute((alias("IA__g_option_context_add_group"), visibility("default"))); - -#undef g_option_context_add_main_entries -extern __typeof (g_option_context_add_main_entries) g_option_context_add_main_entries __attribute((alias("IA__g_option_context_add_main_entries"), visibility("default"))); - -#undef g_option_error_quark -extern __typeof (g_option_error_quark) g_option_error_quark __attribute((alias("IA__g_option_error_quark"), visibility("default"))); - -#undef g_option_context_free -extern __typeof (g_option_context_free) g_option_context_free __attribute((alias("IA__g_option_context_free"), visibility("default"))); - -#undef g_option_context_get_description -extern __typeof (g_option_context_get_description) g_option_context_get_description __attribute((alias("IA__g_option_context_get_description"), visibility("default"))); - -#undef g_option_context_get_help_enabled -extern __typeof (g_option_context_get_help_enabled) g_option_context_get_help_enabled __attribute((alias("IA__g_option_context_get_help_enabled"), visibility("default"))); - -#undef g_option_context_get_ignore_unknown_options -extern __typeof (g_option_context_get_ignore_unknown_options) g_option_context_get_ignore_unknown_options __attribute((alias("IA__g_option_context_get_ignore_unknown_options"), visibility("default"))); - -#undef g_option_context_get_main_group -extern __typeof (g_option_context_get_main_group) g_option_context_get_main_group __attribute((alias("IA__g_option_context_get_main_group"), visibility("default"))); - -#undef g_option_context_get_summary -extern __typeof (g_option_context_get_summary) g_option_context_get_summary __attribute((alias("IA__g_option_context_get_summary"), visibility("default"))); - -#undef g_option_context_new -extern __typeof (g_option_context_new) g_option_context_new __attribute((alias("IA__g_option_context_new"), visibility("default"))); - -#undef g_option_context_parse -extern __typeof (g_option_context_parse) g_option_context_parse __attribute((alias("IA__g_option_context_parse"), visibility("default"))); - -#undef g_option_context_set_description -extern __typeof (g_option_context_set_description) g_option_context_set_description __attribute((alias("IA__g_option_context_set_description"), visibility("default"))); - -#undef g_option_context_set_help_enabled -extern __typeof (g_option_context_set_help_enabled) g_option_context_set_help_enabled __attribute((alias("IA__g_option_context_set_help_enabled"), visibility("default"))); - -#undef g_option_context_set_ignore_unknown_options -extern __typeof (g_option_context_set_ignore_unknown_options) g_option_context_set_ignore_unknown_options __attribute((alias("IA__g_option_context_set_ignore_unknown_options"), visibility("default"))); - -#undef g_option_context_set_main_group -extern __typeof (g_option_context_set_main_group) g_option_context_set_main_group __attribute((alias("IA__g_option_context_set_main_group"), visibility("default"))); - -#undef g_option_context_set_summary -extern __typeof (g_option_context_set_summary) g_option_context_set_summary __attribute((alias("IA__g_option_context_set_summary"), visibility("default"))); - -#undef g_option_context_set_translate_func -extern __typeof (g_option_context_set_translate_func) g_option_context_set_translate_func __attribute((alias("IA__g_option_context_set_translate_func"), visibility("default"))); - -#undef g_option_context_set_translation_domain -extern __typeof (g_option_context_set_translation_domain) g_option_context_set_translation_domain __attribute((alias("IA__g_option_context_set_translation_domain"), visibility("default"))); - -#undef g_option_context_get_help -extern __typeof (g_option_context_get_help) g_option_context_get_help __attribute((alias("IA__g_option_context_get_help"), visibility("default"))); - -#undef g_option_group_add_entries -extern __typeof (g_option_group_add_entries) g_option_group_add_entries __attribute((alias("IA__g_option_group_add_entries"), visibility("default"))); - -#undef g_option_group_free -extern __typeof (g_option_group_free) g_option_group_free __attribute((alias("IA__g_option_group_free"), visibility("default"))); - -#undef g_option_group_new -extern __typeof (g_option_group_new) g_option_group_new __attribute((alias("IA__g_option_group_new"), visibility("default"))); - -#undef g_option_group_set_error_hook -extern __typeof (g_option_group_set_error_hook) g_option_group_set_error_hook __attribute((alias("IA__g_option_group_set_error_hook"), visibility("default"))); - -#undef g_option_group_set_parse_hooks -extern __typeof (g_option_group_set_parse_hooks) g_option_group_set_parse_hooks __attribute((alias("IA__g_option_group_set_parse_hooks"), visibility("default"))); - -#undef g_option_group_set_translate_func -extern __typeof (g_option_group_set_translate_func) g_option_group_set_translate_func __attribute((alias("IA__g_option_group_set_translate_func"), visibility("default"))); - -#undef g_option_group_set_translation_domain -extern __typeof (g_option_group_set_translation_domain) g_option_group_set_translation_domain __attribute((alias("IA__g_option_group_set_translation_domain"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_PATTERN_H__) -#if IN_FILE(__G_PATTERN_C__) -#undef g_pattern_match -extern __typeof (g_pattern_match) g_pattern_match __attribute((alias("IA__g_pattern_match"), visibility("default"))); - -#undef g_pattern_match_simple -extern __typeof (g_pattern_match_simple) g_pattern_match_simple __attribute((alias("IA__g_pattern_match_simple"), visibility("default"))); - -#undef g_pattern_match_string -extern __typeof (g_pattern_match_string) g_pattern_match_string __attribute((alias("IA__g_pattern_match_string"), visibility("default"))); - -#undef g_pattern_spec_equal -extern __typeof (g_pattern_spec_equal) g_pattern_spec_equal __attribute((alias("IA__g_pattern_spec_equal"), visibility("default"))); - -#undef g_pattern_spec_free -extern __typeof (g_pattern_spec_free) g_pattern_spec_free __attribute((alias("IA__g_pattern_spec_free"), visibility("default"))); - -#undef g_pattern_spec_new -extern __typeof (g_pattern_spec_new) g_pattern_spec_new __attribute((alias("IA__g_pattern_spec_new"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_POLL_H__) -#if IN_FILE(__G_POLL_C__) -#undef g_poll -extern __typeof (g_poll) g_poll __attribute((alias("IA__g_poll"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_PRIMES_H__) -#if IN_FILE(__G_PRIMES_C__) -#undef g_spaced_primes_closest -extern __typeof (g_spaced_primes_closest) g_spaced_primes_closest __attribute((alias("IA__g_spaced_primes_closest"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_PRINTF_H__) -#if IN_FILE(__G_PRINTF_C__) -#undef g_fprintf -extern __typeof (g_fprintf) g_fprintf __attribute((alias("IA__g_fprintf"), visibility("default"))); - -#undef g_printf -extern __typeof (g_printf) g_printf __attribute((alias("IA__g_printf"), visibility("default"))); - -#undef g_sprintf -extern __typeof (g_sprintf) g_sprintf __attribute((alias("IA__g_sprintf"), visibility("default"))); - -#undef g_vasprintf -extern __typeof (g_vasprintf) g_vasprintf __attribute((alias("IA__g_vasprintf"), visibility("default"))); - -#undef g_vfprintf -extern __typeof (g_vfprintf) g_vfprintf __attribute((alias("IA__g_vfprintf"), visibility("default"))); - -#undef g_vprintf -extern __typeof (g_vprintf) g_vprintf __attribute((alias("IA__g_vprintf"), visibility("default"))); - -#undef g_vsprintf -extern __typeof (g_vsprintf) g_vsprintf __attribute((alias("IA__g_vsprintf"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UTILS_H__) -#if IN_FILE(__G_PRINTF_C__) -#undef g_snprintf -extern __typeof (g_snprintf) g_snprintf __attribute((alias("IA__g_snprintf"), visibility("default"))); - -#undef g_vsnprintf -extern __typeof (g_vsnprintf) g_vsnprintf __attribute((alias("IA__g_vsnprintf"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_QSORT_H__) -#if IN_FILE(__G_QSORT_C__) -#undef g_qsort_with_data -extern __typeof (g_qsort_with_data) g_qsort_with_data __attribute((alias("IA__g_qsort_with_data"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_QUEUE_H__) -#if IN_FILE(__G_QUEUE_C__) -#undef g_queue_clear -extern __typeof (g_queue_clear) g_queue_clear __attribute((alias("IA__g_queue_clear"), visibility("default"))); - -#undef g_queue_copy -extern __typeof (g_queue_copy) g_queue_copy __attribute((alias("IA__g_queue_copy"), visibility("default"))); - -#undef g_queue_delete_link -extern __typeof (g_queue_delete_link) g_queue_delete_link __attribute((alias("IA__g_queue_delete_link"), visibility("default"))); - -#undef g_queue_find -extern __typeof (g_queue_find) g_queue_find __attribute((alias("IA__g_queue_find"), visibility("default"))); - -#undef g_queue_find_custom -extern __typeof (g_queue_find_custom) g_queue_find_custom __attribute((alias("IA__g_queue_find_custom"), visibility("default"))); - -#undef g_queue_foreach -extern __typeof (g_queue_foreach) g_queue_foreach __attribute((alias("IA__g_queue_foreach"), visibility("default"))); - -#undef g_queue_free -extern __typeof (g_queue_free) g_queue_free __attribute((alias("IA__g_queue_free"), visibility("default"))); - -#undef g_queue_get_length -extern __typeof (g_queue_get_length) g_queue_get_length __attribute((alias("IA__g_queue_get_length"), visibility("default"))); - -#undef g_queue_index -extern __typeof (g_queue_index) g_queue_index __attribute((alias("IA__g_queue_index"), visibility("default"))); - -#undef g_queue_init -extern __typeof (g_queue_init) g_queue_init __attribute((alias("IA__g_queue_init"), visibility("default"))); - -#undef g_queue_insert_after -extern __typeof (g_queue_insert_after) g_queue_insert_after __attribute((alias("IA__g_queue_insert_after"), visibility("default"))); - -#undef g_queue_insert_before -extern __typeof (g_queue_insert_before) g_queue_insert_before __attribute((alias("IA__g_queue_insert_before"), visibility("default"))); - -#undef g_queue_insert_sorted -extern __typeof (g_queue_insert_sorted) g_queue_insert_sorted __attribute((alias("IA__g_queue_insert_sorted"), visibility("default"))); - -#undef g_queue_is_empty -extern __typeof (g_queue_is_empty) g_queue_is_empty __attribute((alias("IA__g_queue_is_empty"), visibility("default"))); - -#undef g_queue_link_index -extern __typeof (g_queue_link_index) g_queue_link_index __attribute((alias("IA__g_queue_link_index"), visibility("default"))); - -#undef g_queue_new -extern __typeof (g_queue_new) g_queue_new __attribute((alias("IA__g_queue_new"), visibility("default"))); - -#undef g_queue_peek_head -extern __typeof (g_queue_peek_head) g_queue_peek_head __attribute((alias("IA__g_queue_peek_head"), visibility("default"))); - -#undef g_queue_peek_head_link -extern __typeof (g_queue_peek_head_link) g_queue_peek_head_link __attribute((alias("IA__g_queue_peek_head_link"), visibility("default"))); - -#undef g_queue_peek_nth -extern __typeof (g_queue_peek_nth) g_queue_peek_nth __attribute((alias("IA__g_queue_peek_nth"), visibility("default"))); - -#undef g_queue_peek_nth_link -extern __typeof (g_queue_peek_nth_link) g_queue_peek_nth_link __attribute((alias("IA__g_queue_peek_nth_link"), visibility("default"))); - -#undef g_queue_peek_tail -extern __typeof (g_queue_peek_tail) g_queue_peek_tail __attribute((alias("IA__g_queue_peek_tail"), visibility("default"))); - -#undef g_queue_peek_tail_link -extern __typeof (g_queue_peek_tail_link) g_queue_peek_tail_link __attribute((alias("IA__g_queue_peek_tail_link"), visibility("default"))); - -#undef g_queue_pop_head -extern __typeof (g_queue_pop_head) g_queue_pop_head __attribute((alias("IA__g_queue_pop_head"), visibility("default"))); - -#undef g_queue_pop_head_link -extern __typeof (g_queue_pop_head_link) g_queue_pop_head_link __attribute((alias("IA__g_queue_pop_head_link"), visibility("default"))); - -#undef g_queue_pop_nth -extern __typeof (g_queue_pop_nth) g_queue_pop_nth __attribute((alias("IA__g_queue_pop_nth"), visibility("default"))); - -#undef g_queue_pop_nth_link -extern __typeof (g_queue_pop_nth_link) g_queue_pop_nth_link __attribute((alias("IA__g_queue_pop_nth_link"), visibility("default"))); - -#undef g_queue_pop_tail -extern __typeof (g_queue_pop_tail) g_queue_pop_tail __attribute((alias("IA__g_queue_pop_tail"), visibility("default"))); - -#undef g_queue_pop_tail_link -extern __typeof (g_queue_pop_tail_link) g_queue_pop_tail_link __attribute((alias("IA__g_queue_pop_tail_link"), visibility("default"))); - -#undef g_queue_push_head -extern __typeof (g_queue_push_head) g_queue_push_head __attribute((alias("IA__g_queue_push_head"), visibility("default"))); - -#undef g_queue_push_head_link -extern __typeof (g_queue_push_head_link) g_queue_push_head_link __attribute((alias("IA__g_queue_push_head_link"), visibility("default"))); - -#undef g_queue_push_nth -extern __typeof (g_queue_push_nth) g_queue_push_nth __attribute((alias("IA__g_queue_push_nth"), visibility("default"))); - -#undef g_queue_push_nth_link -extern __typeof (g_queue_push_nth_link) g_queue_push_nth_link __attribute((alias("IA__g_queue_push_nth_link"), visibility("default"))); - -#undef g_queue_push_tail -extern __typeof (g_queue_push_tail) g_queue_push_tail __attribute((alias("IA__g_queue_push_tail"), visibility("default"))); - -#undef g_queue_push_tail_link -extern __typeof (g_queue_push_tail_link) g_queue_push_tail_link __attribute((alias("IA__g_queue_push_tail_link"), visibility("default"))); - -#undef g_queue_remove -extern __typeof (g_queue_remove) g_queue_remove __attribute((alias("IA__g_queue_remove"), visibility("default"))); - -#undef g_queue_remove_all -extern __typeof (g_queue_remove_all) g_queue_remove_all __attribute((alias("IA__g_queue_remove_all"), visibility("default"))); - -#undef g_queue_reverse -extern __typeof (g_queue_reverse) g_queue_reverse __attribute((alias("IA__g_queue_reverse"), visibility("default"))); - -#undef g_queue_sort -extern __typeof (g_queue_sort) g_queue_sort __attribute((alias("IA__g_queue_sort"), visibility("default"))); - -#undef g_queue_unlink -extern __typeof (g_queue_unlink) g_queue_unlink __attribute((alias("IA__g_queue_unlink"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_RAND_H__) -#if IN_FILE(__G_RAND_C__) -#undef g_rand_copy -extern __typeof (g_rand_copy) g_rand_copy __attribute((alias("IA__g_rand_copy"), visibility("default"))); - -#undef g_rand_double -extern __typeof (g_rand_double) g_rand_double __attribute((alias("IA__g_rand_double"), visibility("default"))); - -#undef g_rand_double_range -extern __typeof (g_rand_double_range) g_rand_double_range __attribute((alias("IA__g_rand_double_range"), visibility("default"))); - -#undef g_rand_free -extern __typeof (g_rand_free) g_rand_free __attribute((alias("IA__g_rand_free"), visibility("default"))); - -#undef g_rand_int -extern __typeof (g_rand_int) g_rand_int __attribute((alias("IA__g_rand_int"), visibility("default"))); - -#undef g_rand_int_range -extern __typeof (g_rand_int_range) g_rand_int_range __attribute((alias("IA__g_rand_int_range"), visibility("default"))); - -#undef g_rand_new -extern __typeof (g_rand_new) g_rand_new __attribute((alias("IA__g_rand_new"), visibility("default"))); - -#undef g_rand_new_with_seed -extern __typeof (g_rand_new_with_seed) g_rand_new_with_seed __attribute((alias("IA__g_rand_new_with_seed"), visibility("default"))); - -#undef g_rand_new_with_seed_array -extern __typeof (g_rand_new_with_seed_array) g_rand_new_with_seed_array __attribute((alias("IA__g_rand_new_with_seed_array"), visibility("default"))); - -#undef g_random_double -extern __typeof (g_random_double) g_random_double __attribute((alias("IA__g_random_double"), visibility("default"))); - -#undef g_random_double_range -extern __typeof (g_random_double_range) g_random_double_range __attribute((alias("IA__g_random_double_range"), visibility("default"))); - -#undef g_random_int -extern __typeof (g_random_int) g_random_int __attribute((alias("IA__g_random_int"), visibility("default"))); - -#undef g_random_int_range -extern __typeof (g_random_int_range) g_random_int_range __attribute((alias("IA__g_random_int_range"), visibility("default"))); - -#undef g_random_set_seed -extern __typeof (g_random_set_seed) g_random_set_seed __attribute((alias("IA__g_random_set_seed"), visibility("default"))); - -#undef g_rand_set_seed -extern __typeof (g_rand_set_seed) g_rand_set_seed __attribute((alias("IA__g_rand_set_seed"), visibility("default"))); - -#undef g_rand_set_seed_array -extern __typeof (g_rand_set_seed_array) g_rand_set_seed_array __attribute((alias("IA__g_rand_set_seed_array"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_REL_H__) -#if IN_FILE(__G_REL_C__) -#undef g_relation_count -extern __typeof (g_relation_count) g_relation_count __attribute((alias("IA__g_relation_count"), visibility("default"))); - -#undef g_relation_delete -extern __typeof (g_relation_delete) g_relation_delete __attribute((alias("IA__g_relation_delete"), visibility("default"))); - -#undef g_relation_destroy -extern __typeof (g_relation_destroy) g_relation_destroy __attribute((alias("IA__g_relation_destroy"), visibility("default"))); - -#undef g_relation_exists -extern __typeof (g_relation_exists) g_relation_exists __attribute((alias("IA__g_relation_exists"), visibility("default"))); - -#undef g_relation_index -extern __typeof (g_relation_index) g_relation_index __attribute((alias("IA__g_relation_index"), visibility("default"))); - -#undef g_relation_insert -extern __typeof (g_relation_insert) g_relation_insert __attribute((alias("IA__g_relation_insert"), visibility("default"))); - -#undef g_relation_new -extern __typeof (g_relation_new) g_relation_new __attribute((alias("IA__g_relation_new"), visibility("default"))); - -#undef g_relation_print -extern __typeof (g_relation_print) g_relation_print __attribute((alias("IA__g_relation_print"), visibility("default"))); - -#undef g_relation_select -extern __typeof (g_relation_select) g_relation_select __attribute((alias("IA__g_relation_select"), visibility("default"))); - -#undef g_tuples_destroy -extern __typeof (g_tuples_destroy) g_tuples_destroy __attribute((alias("IA__g_tuples_destroy"), visibility("default"))); - -#undef g_tuples_index -extern __typeof (g_tuples_index) g_tuples_index __attribute((alias("IA__g_tuples_index"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SCANNER_H__) -#if IN_FILE(__G_SCANNER_C__) -#undef g_scanner_cur_line -extern __typeof (g_scanner_cur_line) g_scanner_cur_line __attribute((alias("IA__g_scanner_cur_line"), visibility("default"))); - -#undef g_scanner_cur_position -extern __typeof (g_scanner_cur_position) g_scanner_cur_position __attribute((alias("IA__g_scanner_cur_position"), visibility("default"))); - -#undef g_scanner_cur_token -extern __typeof (g_scanner_cur_token) g_scanner_cur_token __attribute((alias("IA__g_scanner_cur_token"), visibility("default"))); - -#undef g_scanner_cur_value -extern __typeof (g_scanner_cur_value) g_scanner_cur_value __attribute((alias("IA__g_scanner_cur_value"), visibility("default"))); - -#undef g_scanner_destroy -extern __typeof (g_scanner_destroy) g_scanner_destroy __attribute((alias("IA__g_scanner_destroy"), visibility("default"))); - -#undef g_scanner_eof -extern __typeof (g_scanner_eof) g_scanner_eof __attribute((alias("IA__g_scanner_eof"), visibility("default"))); - -#undef g_scanner_error -extern __typeof (g_scanner_error) g_scanner_error __attribute((alias("IA__g_scanner_error"), visibility("default"))); - -#undef g_scanner_get_next_token -extern __typeof (g_scanner_get_next_token) g_scanner_get_next_token __attribute((alias("IA__g_scanner_get_next_token"), visibility("default"))); - -#undef g_scanner_input_file -extern __typeof (g_scanner_input_file) g_scanner_input_file __attribute((alias("IA__g_scanner_input_file"), visibility("default"))); - -#undef g_scanner_input_text -extern __typeof (g_scanner_input_text) g_scanner_input_text __attribute((alias("IA__g_scanner_input_text"), visibility("default"))); - -#undef g_scanner_lookup_symbol -extern __typeof (g_scanner_lookup_symbol) g_scanner_lookup_symbol __attribute((alias("IA__g_scanner_lookup_symbol"), visibility("default"))); - -#undef g_scanner_new -extern __typeof (g_scanner_new) g_scanner_new __attribute((alias("IA__g_scanner_new"), visibility("default"))); - -#undef g_scanner_peek_next_token -extern __typeof (g_scanner_peek_next_token) g_scanner_peek_next_token __attribute((alias("IA__g_scanner_peek_next_token"), visibility("default"))); - -#undef g_scanner_scope_add_symbol -extern __typeof (g_scanner_scope_add_symbol) g_scanner_scope_add_symbol __attribute((alias("IA__g_scanner_scope_add_symbol"), visibility("default"))); - -#undef g_scanner_scope_foreach_symbol -extern __typeof (g_scanner_scope_foreach_symbol) g_scanner_scope_foreach_symbol __attribute((alias("IA__g_scanner_scope_foreach_symbol"), visibility("default"))); - -#undef g_scanner_scope_lookup_symbol -extern __typeof (g_scanner_scope_lookup_symbol) g_scanner_scope_lookup_symbol __attribute((alias("IA__g_scanner_scope_lookup_symbol"), visibility("default"))); - -#undef g_scanner_scope_remove_symbol -extern __typeof (g_scanner_scope_remove_symbol) g_scanner_scope_remove_symbol __attribute((alias("IA__g_scanner_scope_remove_symbol"), visibility("default"))); - -#undef g_scanner_set_scope -extern __typeof (g_scanner_set_scope) g_scanner_set_scope __attribute((alias("IA__g_scanner_set_scope"), visibility("default"))); - -#undef g_scanner_sync_file_offset -extern __typeof (g_scanner_sync_file_offset) g_scanner_sync_file_offset __attribute((alias("IA__g_scanner_sync_file_offset"), visibility("default"))); - -#undef g_scanner_unexp_token -extern __typeof (g_scanner_unexp_token) g_scanner_unexp_token __attribute((alias("IA__g_scanner_unexp_token"), visibility("default"))); - -#undef g_scanner_warn -extern __typeof (g_scanner_warn) g_scanner_warn __attribute((alias("IA__g_scanner_warn"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SEQUENCE_H__) -#if IN_FILE(__G_SEQUENCE_C__) -#undef g_sequence_new -extern __typeof (g_sequence_new) g_sequence_new __attribute((alias("IA__g_sequence_new"), visibility("default"))); - -#undef g_sequence_free -extern __typeof (g_sequence_free) g_sequence_free __attribute((alias("IA__g_sequence_free"), visibility("default"))); - -#undef g_sequence_get_length -extern __typeof (g_sequence_get_length) g_sequence_get_length __attribute((alias("IA__g_sequence_get_length"), visibility("default"))); - -#undef g_sequence_foreach -extern __typeof (g_sequence_foreach) g_sequence_foreach __attribute((alias("IA__g_sequence_foreach"), visibility("default"))); - -#undef g_sequence_foreach_range -extern __typeof (g_sequence_foreach_range) g_sequence_foreach_range __attribute((alias("IA__g_sequence_foreach_range"), visibility("default"))); - -#undef g_sequence_sort -extern __typeof (g_sequence_sort) g_sequence_sort __attribute((alias("IA__g_sequence_sort"), visibility("default"))); - -#undef g_sequence_sort_iter -extern __typeof (g_sequence_sort_iter) g_sequence_sort_iter __attribute((alias("IA__g_sequence_sort_iter"), visibility("default"))); - -#undef g_sequence_get_begin_iter -extern __typeof (g_sequence_get_begin_iter) g_sequence_get_begin_iter __attribute((alias("IA__g_sequence_get_begin_iter"), visibility("default"))); - -#undef g_sequence_get_end_iter -extern __typeof (g_sequence_get_end_iter) g_sequence_get_end_iter __attribute((alias("IA__g_sequence_get_end_iter"), visibility("default"))); - -#undef g_sequence_get_iter_at_pos -extern __typeof (g_sequence_get_iter_at_pos) g_sequence_get_iter_at_pos __attribute((alias("IA__g_sequence_get_iter_at_pos"), visibility("default"))); - -#undef g_sequence_append -extern __typeof (g_sequence_append) g_sequence_append __attribute((alias("IA__g_sequence_append"), visibility("default"))); - -#undef g_sequence_prepend -extern __typeof (g_sequence_prepend) g_sequence_prepend __attribute((alias("IA__g_sequence_prepend"), visibility("default"))); - -#undef g_sequence_insert_before -extern __typeof (g_sequence_insert_before) g_sequence_insert_before __attribute((alias("IA__g_sequence_insert_before"), visibility("default"))); - -#undef g_sequence_move -extern __typeof (g_sequence_move) g_sequence_move __attribute((alias("IA__g_sequence_move"), visibility("default"))); - -#undef g_sequence_swap -extern __typeof (g_sequence_swap) g_sequence_swap __attribute((alias("IA__g_sequence_swap"), visibility("default"))); - -#undef g_sequence_insert_sorted -extern __typeof (g_sequence_insert_sorted) g_sequence_insert_sorted __attribute((alias("IA__g_sequence_insert_sorted"), visibility("default"))); - -#undef g_sequence_insert_sorted_iter -extern __typeof (g_sequence_insert_sorted_iter) g_sequence_insert_sorted_iter __attribute((alias("IA__g_sequence_insert_sorted_iter"), visibility("default"))); - -#undef g_sequence_sort_changed -extern __typeof (g_sequence_sort_changed) g_sequence_sort_changed __attribute((alias("IA__g_sequence_sort_changed"), visibility("default"))); - -#undef g_sequence_sort_changed_iter -extern __typeof (g_sequence_sort_changed_iter) g_sequence_sort_changed_iter __attribute((alias("IA__g_sequence_sort_changed_iter"), visibility("default"))); - -#undef g_sequence_remove -extern __typeof (g_sequence_remove) g_sequence_remove __attribute((alias("IA__g_sequence_remove"), visibility("default"))); - -#undef g_sequence_remove_range -extern __typeof (g_sequence_remove_range) g_sequence_remove_range __attribute((alias("IA__g_sequence_remove_range"), visibility("default"))); - -#undef g_sequence_move_range -extern __typeof (g_sequence_move_range) g_sequence_move_range __attribute((alias("IA__g_sequence_move_range"), visibility("default"))); - -#undef g_sequence_search -extern __typeof (g_sequence_search) g_sequence_search __attribute((alias("IA__g_sequence_search"), visibility("default"))); - -#undef g_sequence_search_iter -extern __typeof (g_sequence_search_iter) g_sequence_search_iter __attribute((alias("IA__g_sequence_search_iter"), visibility("default"))); - -#undef g_sequence_get -extern __typeof (g_sequence_get) g_sequence_get __attribute((alias("IA__g_sequence_get"), visibility("default"))); - -#undef g_sequence_set -extern __typeof (g_sequence_set) g_sequence_set __attribute((alias("IA__g_sequence_set"), visibility("default"))); - -#undef g_sequence_iter_is_begin -extern __typeof (g_sequence_iter_is_begin) g_sequence_iter_is_begin __attribute((alias("IA__g_sequence_iter_is_begin"), visibility("default"))); - -#undef g_sequence_iter_is_end -extern __typeof (g_sequence_iter_is_end) g_sequence_iter_is_end __attribute((alias("IA__g_sequence_iter_is_end"), visibility("default"))); - -#undef g_sequence_iter_next -extern __typeof (g_sequence_iter_next) g_sequence_iter_next __attribute((alias("IA__g_sequence_iter_next"), visibility("default"))); - -#undef g_sequence_iter_prev -extern __typeof (g_sequence_iter_prev) g_sequence_iter_prev __attribute((alias("IA__g_sequence_iter_prev"), visibility("default"))); - -#undef g_sequence_iter_get_position -extern __typeof (g_sequence_iter_get_position) g_sequence_iter_get_position __attribute((alias("IA__g_sequence_iter_get_position"), visibility("default"))); - -#undef g_sequence_iter_move -extern __typeof (g_sequence_iter_move) g_sequence_iter_move __attribute((alias("IA__g_sequence_iter_move"), visibility("default"))); - -#undef g_sequence_iter_get_sequence -extern __typeof (g_sequence_iter_get_sequence) g_sequence_iter_get_sequence __attribute((alias("IA__g_sequence_iter_get_sequence"), visibility("default"))); - -#undef g_sequence_iter_compare -extern __typeof (g_sequence_iter_compare) g_sequence_iter_compare __attribute((alias("IA__g_sequence_iter_compare"), visibility("default"))); - -#undef g_sequence_range_get_midpoint -extern __typeof (g_sequence_range_get_midpoint) g_sequence_range_get_midpoint __attribute((alias("IA__g_sequence_range_get_midpoint"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SHELL_H__) -#if IN_FILE(__G_SHELL_C__) -#undef g_shell_error_quark -extern __typeof (g_shell_error_quark) g_shell_error_quark __attribute((alias("IA__g_shell_error_quark"), visibility("default"))); - -#undef g_shell_parse_argv -extern __typeof (g_shell_parse_argv) g_shell_parse_argv __attribute((alias("IA__g_shell_parse_argv"), visibility("default"))); - -#undef g_shell_quote -extern __typeof (g_shell_quote) g_shell_quote __attribute((alias("IA__g_shell_quote"), visibility("default"))); - -#undef g_shell_unquote -extern __typeof (g_shell_unquote) g_shell_unquote __attribute((alias("IA__g_shell_unquote"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SLIST_H__) -#if IN_FILE(__G_SLIST_C__) -#undef g_slist_alloc -extern __typeof (g_slist_alloc) g_slist_alloc __attribute((alias("IA__g_slist_alloc"), visibility("default"))); - -#undef g_slist_append -extern __typeof (g_slist_append) g_slist_append __attribute((alias("IA__g_slist_append"), visibility("default"))); - -#undef g_slist_concat -extern __typeof (g_slist_concat) g_slist_concat __attribute((alias("IA__g_slist_concat"), visibility("default"))); - -#undef g_slist_copy -extern __typeof (g_slist_copy) g_slist_copy __attribute((alias("IA__g_slist_copy"), visibility("default"))); - -#undef g_slist_delete_link -extern __typeof (g_slist_delete_link) g_slist_delete_link __attribute((alias("IA__g_slist_delete_link"), visibility("default"))); - -#undef g_slist_find -extern __typeof (g_slist_find) g_slist_find __attribute((alias("IA__g_slist_find"), visibility("default"))); - -#undef g_slist_find_custom -extern __typeof (g_slist_find_custom) g_slist_find_custom __attribute((alias("IA__g_slist_find_custom"), visibility("default"))); - -#undef g_slist_foreach -extern __typeof (g_slist_foreach) g_slist_foreach __attribute((alias("IA__g_slist_foreach"), visibility("default"))); - -#undef g_slist_free -extern __typeof (g_slist_free) g_slist_free __attribute((alias("IA__g_slist_free"), visibility("default"))); - -#undef g_slist_free_1 -extern __typeof (g_slist_free_1) g_slist_free_1 __attribute((alias("IA__g_slist_free_1"), visibility("default"))); - -#undef g_slist_index -extern __typeof (g_slist_index) g_slist_index __attribute((alias("IA__g_slist_index"), visibility("default"))); - -#undef g_slist_insert -extern __typeof (g_slist_insert) g_slist_insert __attribute((alias("IA__g_slist_insert"), visibility("default"))); - -#undef g_slist_insert_before -extern __typeof (g_slist_insert_before) g_slist_insert_before __attribute((alias("IA__g_slist_insert_before"), visibility("default"))); - -#undef g_slist_insert_sorted -extern __typeof (g_slist_insert_sorted) g_slist_insert_sorted __attribute((alias("IA__g_slist_insert_sorted"), visibility("default"))); - -#undef g_slist_insert_sorted_with_data -extern __typeof (g_slist_insert_sorted_with_data) g_slist_insert_sorted_with_data __attribute((alias("IA__g_slist_insert_sorted_with_data"), visibility("default"))); - -#undef g_slist_last -extern __typeof (g_slist_last) g_slist_last __attribute((alias("IA__g_slist_last"), visibility("default"))); - -#undef g_slist_length -extern __typeof (g_slist_length) g_slist_length __attribute((alias("IA__g_slist_length"), visibility("default"))); - -#undef g_slist_nth -extern __typeof (g_slist_nth) g_slist_nth __attribute((alias("IA__g_slist_nth"), visibility("default"))); - -#undef g_slist_nth_data -extern __typeof (g_slist_nth_data) g_slist_nth_data __attribute((alias("IA__g_slist_nth_data"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_slist_pop_allocator -extern __typeof (g_slist_pop_allocator) g_slist_pop_allocator __attribute((alias("IA__g_slist_pop_allocator"), visibility("default"))); - -#endif -#undef g_slist_position -extern __typeof (g_slist_position) g_slist_position __attribute((alias("IA__g_slist_position"), visibility("default"))); - -#undef g_slist_prepend -extern __typeof (g_slist_prepend) g_slist_prepend __attribute((alias("IA__g_slist_prepend"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_slist_push_allocator -extern __typeof (g_slist_push_allocator) g_slist_push_allocator __attribute((alias("IA__g_slist_push_allocator"), visibility("default"))); - -#endif -#undef g_slist_remove -extern __typeof (g_slist_remove) g_slist_remove __attribute((alias("IA__g_slist_remove"), visibility("default"))); - -#undef g_slist_remove_all -extern __typeof (g_slist_remove_all) g_slist_remove_all __attribute((alias("IA__g_slist_remove_all"), visibility("default"))); - -#undef g_slist_remove_link -extern __typeof (g_slist_remove_link) g_slist_remove_link __attribute((alias("IA__g_slist_remove_link"), visibility("default"))); - -#undef g_slist_reverse -extern __typeof (g_slist_reverse) g_slist_reverse __attribute((alias("IA__g_slist_reverse"), visibility("default"))); - -#undef g_slist_sort -extern __typeof (g_slist_sort) g_slist_sort __attribute((alias("IA__g_slist_sort"), visibility("default"))); - -#undef g_slist_sort_with_data -extern __typeof (g_slist_sort_with_data) g_slist_sort_with_data __attribute((alias("IA__g_slist_sort_with_data"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_SPAWN_H__) -#if IN_FILE(__G_SPAWN_C__) -#ifndef _WIN64 -#undef g_spawn_async -extern __typeof (g_spawn_async) g_spawn_async __attribute((alias("IA__g_spawn_async"), visibility("default"))); - -#undef g_spawn_async_with_pipes -extern __typeof (g_spawn_async_with_pipes) g_spawn_async_with_pipes __attribute((alias("IA__g_spawn_async_with_pipes"), visibility("default"))); - -#endif -#undef g_spawn_close_pid -extern __typeof (g_spawn_close_pid) g_spawn_close_pid __attribute((alias("IA__g_spawn_close_pid"), visibility("default"))); - -#ifndef _WIN64 -#undef g_spawn_command_line_async -extern __typeof (g_spawn_command_line_async) g_spawn_command_line_async __attribute((alias("IA__g_spawn_command_line_async"), visibility("default"))); - -#undef g_spawn_command_line_sync -extern __typeof (g_spawn_command_line_sync) g_spawn_command_line_sync __attribute((alias("IA__g_spawn_command_line_sync"), visibility("default"))); - -#endif -#undef g_spawn_error_quark -extern __typeof (g_spawn_error_quark) g_spawn_error_quark __attribute((alias("IA__g_spawn_error_quark"), visibility("default"))); - -#ifndef _WIN64 -#undef g_spawn_sync -extern __typeof (g_spawn_sync) g_spawn_sync __attribute((alias("IA__g_spawn_sync"), visibility("default"))); - -#endif -#ifdef G_OS_WIN32 -#undef g_spawn_async_utf8 -extern __typeof (g_spawn_async_utf8) g_spawn_async_utf8 __attribute((alias("IA__g_spawn_async_utf8"), visibility("default"))); - -#undef g_spawn_async_with_pipes_utf8 -extern __typeof (g_spawn_async_with_pipes_utf8) g_spawn_async_with_pipes_utf8 __attribute((alias("IA__g_spawn_async_with_pipes_utf8"), visibility("default"))); - -#undef g_spawn_command_line_async_utf8 -extern __typeof (g_spawn_command_line_async_utf8) g_spawn_command_line_async_utf8 __attribute((alias("IA__g_spawn_command_line_async_utf8"), visibility("default"))); - -#undef g_spawn_command_line_sync_utf8 -extern __typeof (g_spawn_command_line_sync_utf8) g_spawn_command_line_sync_utf8 __attribute((alias("IA__g_spawn_command_line_sync_utf8"), visibility("default"))); - -#undef g_spawn_sync_utf8 -extern __typeof (g_spawn_sync_utf8) g_spawn_sync_utf8 __attribute((alias("IA__g_spawn_sync_utf8"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_STDIO_H__) -#if IN_FILE(__G_STDIO_C__) -#if !defined(G_OS_UNIX) || defined(G_STDIO_NO_WRAP_ON_UNIX) -#undef g_chmod -extern __typeof (g_chmod) g_chmod __attribute((alias("IA__g_chmod"), visibility("default"))); - -#undef g_open -extern __typeof (g_open) g_open __attribute((alias("IA__g_open"), visibility("default"))); - -#undef g_creat -extern __typeof (g_creat) g_creat __attribute((alias("IA__g_creat"), visibility("default"))); - -#undef g_rename -extern __typeof (g_rename) g_rename __attribute((alias("IA__g_rename"), visibility("default"))); - -#undef g_mkdir -extern __typeof (g_mkdir) g_mkdir __attribute((alias("IA__g_mkdir"), visibility("default"))); - -#undef g_stat -extern __typeof (g_stat) g_stat __attribute((alias("IA__g_stat"), visibility("default"))); - -#undef g_lstat -extern __typeof (g_lstat) g_lstat __attribute((alias("IA__g_lstat"), visibility("default"))); - -#undef g_remove -extern __typeof (g_remove) g_remove __attribute((alias("IA__g_remove"), visibility("default"))); - -#undef g_fopen -extern __typeof (g_fopen) g_fopen __attribute((alias("IA__g_fopen"), visibility("default"))); - -#undef g_freopen -extern __typeof (g_freopen) g_freopen __attribute((alias("IA__g_freopen"), visibility("default"))); - -#undef g_utime -extern __typeof (g_utime) g_utime __attribute((alias("IA__g_utime"), visibility("default"))); - -#endif -#undef g_access -extern __typeof (g_access) g_access __attribute((alias("IA__g_access"), visibility("default"))); - -#undef g_chdir -extern __typeof (g_chdir) g_chdir __attribute((alias("IA__g_chdir"), visibility("default"))); - -#undef g_unlink -extern __typeof (g_unlink) g_unlink __attribute((alias("IA__g_unlink"), visibility("default"))); - -#undef g_rmdir -extern __typeof (g_rmdir) g_rmdir __attribute((alias("IA__g_rmdir"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_STRFUNCS_H__) -#if IN_FILE(__G_STRFUNCS_C__) -#undef g_ascii_digit_value -extern __typeof (g_ascii_digit_value) g_ascii_digit_value __attribute((alias("IA__g_ascii_digit_value"), visibility("default"))); - -#undef g_ascii_dtostr -extern __typeof (g_ascii_dtostr) g_ascii_dtostr __attribute((alias("IA__g_ascii_dtostr"), visibility("default"))); - -#undef g_ascii_formatd -extern __typeof (g_ascii_formatd) g_ascii_formatd __attribute((alias("IA__g_ascii_formatd"), visibility("default"))); - -#undef g_ascii_strdown -extern __typeof (g_ascii_strdown) g_ascii_strdown __attribute((alias("IA__g_ascii_strdown"), visibility("default"))); - -#undef g_ascii_strtod -extern __typeof (g_ascii_strtod) g_ascii_strtod __attribute((alias("IA__g_ascii_strtod"), visibility("default"))); - -#undef g_ascii_strtoull -extern __typeof (g_ascii_strtoull) g_ascii_strtoull __attribute((alias("IA__g_ascii_strtoull"), visibility("default"))); - -#undef g_ascii_strtoll -extern __typeof (g_ascii_strtoll) g_ascii_strtoll __attribute((alias("IA__g_ascii_strtoll"), visibility("default"))); - -#undef g_ascii_strup -extern __typeof (g_ascii_strup) g_ascii_strup __attribute((alias("IA__g_ascii_strup"), visibility("default"))); - -#undef g_ascii_tolower -extern __typeof (g_ascii_tolower) g_ascii_tolower __attribute((alias("IA__g_ascii_tolower"), visibility("default"))); - -#undef g_ascii_toupper -extern __typeof (g_ascii_toupper) g_ascii_toupper __attribute((alias("IA__g_ascii_toupper"), visibility("default"))); - -#undef g_ascii_xdigit_value -extern __typeof (g_ascii_xdigit_value) g_ascii_xdigit_value __attribute((alias("IA__g_ascii_xdigit_value"), visibility("default"))); - -#undef g_ascii_strcasecmp -extern __typeof (g_ascii_strcasecmp) g_ascii_strcasecmp __attribute((alias("IA__g_ascii_strcasecmp"), visibility("default"))); - -#undef g_ascii_strncasecmp -extern __typeof (g_ascii_strncasecmp) g_ascii_strncasecmp __attribute((alias("IA__g_ascii_strncasecmp"), visibility("default"))); - -#undef g_memdup -extern __typeof (g_memdup) g_memdup __attribute((alias("IA__g_memdup"), visibility("default"))); - -#undef g_stpcpy -extern __typeof (g_stpcpy) g_stpcpy __attribute((alias("IA__g_stpcpy"), visibility("default"))); - -#undef g_strcanon -extern __typeof (g_strcanon) g_strcanon __attribute((alias("IA__g_strcanon"), visibility("default"))); - -#undef g_strchomp -extern __typeof (g_strchomp) g_strchomp __attribute((alias("IA__g_strchomp"), visibility("default"))); - -#undef g_strchug -extern __typeof (g_strchug) g_strchug __attribute((alias("IA__g_strchug"), visibility("default"))); - -#undef g_strcompress -extern __typeof (g_strcompress) g_strcompress __attribute((alias("IA__g_strcompress"), visibility("default"))); - -#undef g_strconcat -extern __typeof (g_strconcat) g_strconcat __attribute((alias("IA__g_strconcat"), visibility("default"))); - -#undef g_strdelimit -extern __typeof (g_strdelimit) g_strdelimit __attribute((alias("IA__g_strdelimit"), visibility("default"))); - -#undef g_strdup -extern __typeof (g_strdup) g_strdup __attribute((alias("IA__g_strdup"), visibility("default"))); - -#undef g_strdup_printf -extern __typeof (g_strdup_printf) g_strdup_printf __attribute((alias("IA__g_strdup_printf"), visibility("default"))); - -#undef g_strdupv -extern __typeof (g_strdupv) g_strdupv __attribute((alias("IA__g_strdupv"), visibility("default"))); - -#undef g_strdup_vprintf -extern __typeof (g_strdup_vprintf) g_strdup_vprintf __attribute((alias("IA__g_strdup_vprintf"), visibility("default"))); - -#undef g_strerror -extern __typeof (g_strerror) g_strerror __attribute((alias("IA__g_strerror"), visibility("default"))); - -#undef g_strescape -extern __typeof (g_strescape) g_strescape __attribute((alias("IA__g_strescape"), visibility("default"))); - -#undef g_strfreev -extern __typeof (g_strfreev) g_strfreev __attribute((alias("IA__g_strfreev"), visibility("default"))); - -#undef g_str_has_prefix -extern __typeof (g_str_has_prefix) g_str_has_prefix __attribute((alias("IA__g_str_has_prefix"), visibility("default"))); - -#undef g_str_has_suffix -extern __typeof (g_str_has_suffix) g_str_has_suffix __attribute((alias("IA__g_str_has_suffix"), visibility("default"))); - -#undef g_strjoin -extern __typeof (g_strjoin) g_strjoin __attribute((alias("IA__g_strjoin"), visibility("default"))); - -#undef g_strjoinv -extern __typeof (g_strjoinv) g_strjoinv __attribute((alias("IA__g_strjoinv"), visibility("default"))); - -#undef g_strlcat -extern __typeof (g_strlcat) g_strlcat __attribute((alias("IA__g_strlcat"), visibility("default"))); - -#undef g_strlcpy -extern __typeof (g_strlcpy) g_strlcpy __attribute((alias("IA__g_strlcpy"), visibility("default"))); - -#undef g_strndup -extern __typeof (g_strndup) g_strndup __attribute((alias("IA__g_strndup"), visibility("default"))); - -#undef g_strnfill -extern __typeof (g_strnfill) g_strnfill __attribute((alias("IA__g_strnfill"), visibility("default"))); - -#undef g_strreverse -extern __typeof (g_strreverse) g_strreverse __attribute((alias("IA__g_strreverse"), visibility("default"))); - -#undef g_strrstr -extern __typeof (g_strrstr) g_strrstr __attribute((alias("IA__g_strrstr"), visibility("default"))); - -#undef g_strrstr_len -extern __typeof (g_strrstr_len) g_strrstr_len __attribute((alias("IA__g_strrstr_len"), visibility("default"))); - -#undef g_strsignal -extern __typeof (g_strsignal) g_strsignal __attribute((alias("IA__g_strsignal"), visibility("default"))); - -#undef g_strsplit -extern __typeof (g_strsplit) g_strsplit __attribute((alias("IA__g_strsplit"), visibility("default"))); - -#undef g_strsplit_set -extern __typeof (g_strsplit_set) g_strsplit_set __attribute((alias("IA__g_strsplit_set"), visibility("default"))); - -#undef g_strstr_len -extern __typeof (g_strstr_len) g_strstr_len __attribute((alias("IA__g_strstr_len"), visibility("default"))); - -#undef g_strtod -extern __typeof (g_strtod) g_strtod __attribute((alias("IA__g_strtod"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_strcasecmp -extern __typeof (g_strcasecmp) g_strcasecmp __attribute((alias("IA__g_strcasecmp"), visibility("default"))); - -#undef g_strncasecmp -extern __typeof (g_strncasecmp) g_strncasecmp __attribute((alias("IA__g_strncasecmp"), visibility("default"))); - -#undef g_strup -extern __typeof (g_strup) g_strup __attribute((alias("IA__g_strup"), visibility("default"))); - -#undef g_strdown -extern __typeof (g_strdown) g_strdown __attribute((alias("IA__g_strdown"), visibility("default"))); - -#endif -#undef g_strv_length -extern __typeof (g_strv_length) g_strv_length __attribute((alias("IA__g_strv_length"), visibility("default"))); - -#undef g_strip_context -extern __typeof (g_strip_context) g_strip_context __attribute((alias("IA__g_strip_context"), visibility("default"))); - -#undef g_dgettext -extern __typeof (g_dgettext) g_dgettext __attribute((alias("IA__g_dgettext"), visibility("default"))); - -#undef g_dngettext -extern __typeof (g_dngettext) g_dngettext __attribute((alias("IA__g_dngettext"), visibility("default"))); - -#undef g_dpgettext -extern __typeof (g_dpgettext) g_dpgettext __attribute((alias("IA__g_dpgettext"), visibility("default"))); - -#undef g_dpgettext2 -extern __typeof (g_dpgettext2) g_dpgettext2 __attribute((alias("IA__g_dpgettext2"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_URI_FUNCS_H__) -#if IN_FILE(__G_URI_FUNCS_C__) -#undef g_uri_unescape_string -extern __typeof (g_uri_unescape_string) g_uri_unescape_string __attribute((alias("IA__g_uri_unescape_string"), visibility("default"))); - -#undef g_uri_unescape_segment -extern __typeof (g_uri_unescape_segment) g_uri_unescape_segment __attribute((alias("IA__g_uri_unescape_segment"), visibility("default"))); - -#undef g_uri_parse_scheme -extern __typeof (g_uri_parse_scheme) g_uri_parse_scheme __attribute((alias("IA__g_uri_parse_scheme"), visibility("default"))); - -#undef g_uri_escape_string -extern __typeof (g_uri_escape_string) g_uri_escape_string __attribute((alias("IA__g_uri_escape_string"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_STRING_H__) -#if IN_FILE(__G_STRING_C__) -#undef g_string_append -extern __typeof (g_string_append) g_string_append __attribute((alias("IA__g_string_append"), visibility("default"))); - -#undef g_string_append_len -extern __typeof (g_string_append_len) g_string_append_len __attribute((alias("IA__g_string_append_len"), visibility("default"))); - -#undef g_string_append_printf -extern __typeof (g_string_append_printf) g_string_append_printf __attribute((alias("IA__g_string_append_printf"), visibility("default"))); - -#undef g_string_append_unichar -extern __typeof (g_string_append_unichar) g_string_append_unichar __attribute((alias("IA__g_string_append_unichar"), visibility("default"))); - -#undef g_string_append_vprintf -extern __typeof (g_string_append_vprintf) g_string_append_vprintf __attribute((alias("IA__g_string_append_vprintf"), visibility("default"))); - -#undef g_string_ascii_down -extern __typeof (g_string_ascii_down) g_string_ascii_down __attribute((alias("IA__g_string_ascii_down"), visibility("default"))); - -#undef g_string_ascii_up -extern __typeof (g_string_ascii_up) g_string_ascii_up __attribute((alias("IA__g_string_ascii_up"), visibility("default"))); - -#undef g_string_assign -extern __typeof (g_string_assign) g_string_assign __attribute((alias("IA__g_string_assign"), visibility("default"))); - -#undef g_string_chunk_free -extern __typeof (g_string_chunk_free) g_string_chunk_free __attribute((alias("IA__g_string_chunk_free"), visibility("default"))); - -#undef g_string_chunk_clear -extern __typeof (g_string_chunk_clear) g_string_chunk_clear __attribute((alias("IA__g_string_chunk_clear"), visibility("default"))); - -#undef g_string_chunk_insert -extern __typeof (g_string_chunk_insert) g_string_chunk_insert __attribute((alias("IA__g_string_chunk_insert"), visibility("default"))); - -#undef g_string_chunk_insert_const -extern __typeof (g_string_chunk_insert_const) g_string_chunk_insert_const __attribute((alias("IA__g_string_chunk_insert_const"), visibility("default"))); - -#undef g_string_chunk_insert_len -extern __typeof (g_string_chunk_insert_len) g_string_chunk_insert_len __attribute((alias("IA__g_string_chunk_insert_len"), visibility("default"))); - -#undef g_string_chunk_new -extern __typeof (g_string_chunk_new) g_string_chunk_new __attribute((alias("IA__g_string_chunk_new"), visibility("default"))); - -#undef g_string_equal -extern __typeof (g_string_equal) g_string_equal __attribute((alias("IA__g_string_equal"), visibility("default"))); - -#undef g_string_erase -extern __typeof (g_string_erase) g_string_erase __attribute((alias("IA__g_string_erase"), visibility("default"))); - -#undef g_string_free -extern __typeof (g_string_free) g_string_free __attribute((alias("IA__g_string_free"), visibility("default"))); - -#undef g_string_hash -extern __typeof (g_string_hash) g_string_hash __attribute((alias("IA__g_string_hash"), visibility("default"))); - -#undef g_string_insert -extern __typeof (g_string_insert) g_string_insert __attribute((alias("IA__g_string_insert"), visibility("default"))); - -#undef g_string_insert_c -extern __typeof (g_string_insert_c) g_string_insert_c __attribute((alias("IA__g_string_insert_c"), visibility("default"))); - -#undef g_string_insert_len -extern __typeof (g_string_insert_len) g_string_insert_len __attribute((alias("IA__g_string_insert_len"), visibility("default"))); - -#undef g_string_insert_unichar -extern __typeof (g_string_insert_unichar) g_string_insert_unichar __attribute((alias("IA__g_string_insert_unichar"), visibility("default"))); - -#undef g_string_new -extern __typeof (g_string_new) g_string_new __attribute((alias("IA__g_string_new"), visibility("default"))); - -#undef g_string_new_len -extern __typeof (g_string_new_len) g_string_new_len __attribute((alias("IA__g_string_new_len"), visibility("default"))); - -#undef g_string_overwrite -extern __typeof (g_string_overwrite) g_string_overwrite __attribute((alias("IA__g_string_overwrite"), visibility("default"))); - -#undef g_string_overwrite_len -extern __typeof (g_string_overwrite_len) g_string_overwrite_len __attribute((alias("IA__g_string_overwrite_len"), visibility("default"))); - -#undef g_string_prepend -extern __typeof (g_string_prepend) g_string_prepend __attribute((alias("IA__g_string_prepend"), visibility("default"))); - -#undef g_string_prepend_c -extern __typeof (g_string_prepend_c) g_string_prepend_c __attribute((alias("IA__g_string_prepend_c"), visibility("default"))); - -#undef g_string_prepend_len -extern __typeof (g_string_prepend_len) g_string_prepend_len __attribute((alias("IA__g_string_prepend_len"), visibility("default"))); - -#undef g_string_prepend_unichar -extern __typeof (g_string_prepend_unichar) g_string_prepend_unichar __attribute((alias("IA__g_string_prepend_unichar"), visibility("default"))); - -#undef g_string_printf -extern __typeof (g_string_printf) g_string_printf __attribute((alias("IA__g_string_printf"), visibility("default"))); - -#undef g_string_set_size -extern __typeof (g_string_set_size) g_string_set_size __attribute((alias("IA__g_string_set_size"), visibility("default"))); - -#undef g_string_sized_new -extern __typeof (g_string_sized_new) g_string_sized_new __attribute((alias("IA__g_string_sized_new"), visibility("default"))); - -#undef g_string_truncate -extern __typeof (g_string_truncate) g_string_truncate __attribute((alias("IA__g_string_truncate"), visibility("default"))); - -#undef g_string_append_uri_escaped -extern __typeof (g_string_append_uri_escaped) g_string_append_uri_escaped __attribute((alias("IA__g_string_append_uri_escaped"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_string_down -extern __typeof (g_string_down) g_string_down __attribute((alias("IA__g_string_down"), visibility("default"))); - -#undef g_string_up -extern __typeof (g_string_up) g_string_up __attribute((alias("IA__g_string_up"), visibility("default"))); - -#endif -#undef g_string_vprintf -extern __typeof (g_string_vprintf) g_string_vprintf __attribute((alias("IA__g_string_vprintf"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_BITLOCK_H__) -#if IN_FILE(__G_BITLOCK_C__) -#undef g_bit_lock -extern __typeof (g_bit_lock) g_bit_lock __attribute((alias("IA__g_bit_lock"), visibility("default"))); - -#undef g_bit_trylock -extern __typeof (g_bit_trylock) g_bit_trylock __attribute((alias("IA__g_bit_trylock"), visibility("default"))); - -#undef g_bit_unlock -extern __typeof (g_bit_unlock) g_bit_unlock __attribute((alias("IA__g_bit_unlock"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_THREAD_H__) -#if IN_FILE(__G_THREAD_C__) -#undef g_once_impl -extern __typeof (g_once_impl) g_once_impl __attribute((alias("IA__g_once_impl"), visibility("default"))); - -#undef g_once_init_enter_impl -extern __typeof (g_once_init_enter_impl) g_once_init_enter_impl __attribute((alias("IA__g_once_init_enter_impl"), visibility("default"))); - -#undef g_once_init_leave -extern __typeof (g_once_init_leave) g_once_init_leave __attribute((alias("IA__g_once_init_leave"), visibility("default"))); - -#undef g_thread_create_full -extern __typeof (g_thread_create_full) g_thread_create_full __attribute((alias("IA__g_thread_create_full"), visibility("default"))); - -#undef g_thread_error_quark -extern __typeof (g_thread_error_quark) g_thread_error_quark __attribute((alias("IA__g_thread_error_quark"), visibility("default"))); - -#undef g_thread_exit -extern __typeof (g_thread_exit) g_thread_exit __attribute((alias("IA__g_thread_exit"), visibility("default"))); - -#undef g_thread_join -extern __typeof (g_thread_join) g_thread_join __attribute((alias("IA__g_thread_join"), visibility("default"))); - -#undef g_thread_self -extern __typeof (g_thread_self) g_thread_self __attribute((alias("IA__g_thread_self"), visibility("default"))); - -#undef g_thread_set_priority -extern __typeof (g_thread_set_priority) g_thread_set_priority __attribute((alias("IA__g_thread_set_priority"), visibility("default"))); - -#undef g_static_mutex_free -extern __typeof (g_static_mutex_free) g_static_mutex_free __attribute((alias("IA__g_static_mutex_free"), visibility("default"))); - -#undef g_static_mutex_get_mutex_impl -extern __typeof (g_static_mutex_get_mutex_impl) g_static_mutex_get_mutex_impl __attribute((alias("IA__g_static_mutex_get_mutex_impl"), visibility("default"))); - -#undef g_static_mutex_init -extern __typeof (g_static_mutex_init) g_static_mutex_init __attribute((alias("IA__g_static_mutex_init"), visibility("default"))); - -#undef g_static_private_free -extern __typeof (g_static_private_free) g_static_private_free __attribute((alias("IA__g_static_private_free"), visibility("default"))); - -#undef g_static_private_get -extern __typeof (g_static_private_get) g_static_private_get __attribute((alias("IA__g_static_private_get"), visibility("default"))); - -#undef g_static_private_init -extern __typeof (g_static_private_init) g_static_private_init __attribute((alias("IA__g_static_private_init"), visibility("default"))); - -#undef g_static_private_set -extern __typeof (g_static_private_set) g_static_private_set __attribute((alias("IA__g_static_private_set"), visibility("default"))); - -#undef g_static_rec_mutex_free -extern __typeof (g_static_rec_mutex_free) g_static_rec_mutex_free __attribute((alias("IA__g_static_rec_mutex_free"), visibility("default"))); - -#undef g_static_rec_mutex_init -extern __typeof (g_static_rec_mutex_init) g_static_rec_mutex_init __attribute((alias("IA__g_static_rec_mutex_init"), visibility("default"))); - -#undef g_static_rec_mutex_lock -extern __typeof (g_static_rec_mutex_lock) g_static_rec_mutex_lock __attribute((alias("IA__g_static_rec_mutex_lock"), visibility("default"))); - -#undef g_static_rec_mutex_lock_full -extern __typeof (g_static_rec_mutex_lock_full) g_static_rec_mutex_lock_full __attribute((alias("IA__g_static_rec_mutex_lock_full"), visibility("default"))); - -#undef g_static_rec_mutex_trylock -extern __typeof (g_static_rec_mutex_trylock) g_static_rec_mutex_trylock __attribute((alias("IA__g_static_rec_mutex_trylock"), visibility("default"))); - -#undef g_static_rec_mutex_unlock -extern __typeof (g_static_rec_mutex_unlock) g_static_rec_mutex_unlock __attribute((alias("IA__g_static_rec_mutex_unlock"), visibility("default"))); - -#undef g_static_rec_mutex_unlock_full -extern __typeof (g_static_rec_mutex_unlock_full) g_static_rec_mutex_unlock_full __attribute((alias("IA__g_static_rec_mutex_unlock_full"), visibility("default"))); - -#undef g_static_rw_lock_free -extern __typeof (g_static_rw_lock_free) g_static_rw_lock_free __attribute((alias("IA__g_static_rw_lock_free"), visibility("default"))); - -#undef g_static_rw_lock_init -extern __typeof (g_static_rw_lock_init) g_static_rw_lock_init __attribute((alias("IA__g_static_rw_lock_init"), visibility("default"))); - -#undef g_static_rw_lock_reader_lock -extern __typeof (g_static_rw_lock_reader_lock) g_static_rw_lock_reader_lock __attribute((alias("IA__g_static_rw_lock_reader_lock"), visibility("default"))); - -#undef g_static_rw_lock_reader_trylock -extern __typeof (g_static_rw_lock_reader_trylock) g_static_rw_lock_reader_trylock __attribute((alias("IA__g_static_rw_lock_reader_trylock"), visibility("default"))); - -#undef g_static_rw_lock_reader_unlock -extern __typeof (g_static_rw_lock_reader_unlock) g_static_rw_lock_reader_unlock __attribute((alias("IA__g_static_rw_lock_reader_unlock"), visibility("default"))); - -#undef g_static_rw_lock_writer_lock -extern __typeof (g_static_rw_lock_writer_lock) g_static_rw_lock_writer_lock __attribute((alias("IA__g_static_rw_lock_writer_lock"), visibility("default"))); - -#undef g_static_rw_lock_writer_trylock -extern __typeof (g_static_rw_lock_writer_trylock) g_static_rw_lock_writer_trylock __attribute((alias("IA__g_static_rw_lock_writer_trylock"), visibility("default"))); - -#undef g_static_rw_lock_writer_unlock -extern __typeof (g_static_rw_lock_writer_unlock) g_static_rw_lock_writer_unlock __attribute((alias("IA__g_static_rw_lock_writer_unlock"), visibility("default"))); - -#undef g_thread_foreach -extern __typeof (g_thread_foreach) g_thread_foreach __attribute((alias("IA__g_thread_foreach"), visibility("default"))); - -#undef g_thread_get_initialized -extern __typeof (g_thread_get_initialized) g_thread_get_initialized __attribute((alias("IA__g_thread_get_initialized"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_THREADPOOL_H__) -#if IN_FILE(__G_THREADPOOL_C__) -#undef g_thread_pool_free -extern __typeof (g_thread_pool_free) g_thread_pool_free __attribute((alias("IA__g_thread_pool_free"), visibility("default"))); - -#undef g_thread_pool_get_max_threads -extern __typeof (g_thread_pool_get_max_threads) g_thread_pool_get_max_threads __attribute((alias("IA__g_thread_pool_get_max_threads"), visibility("default"))); - -#undef g_thread_pool_get_max_unused_threads -extern __typeof (g_thread_pool_get_max_unused_threads) g_thread_pool_get_max_unused_threads __attribute((alias("IA__g_thread_pool_get_max_unused_threads"), visibility("default"))); - -#undef g_thread_pool_get_max_idle_time -extern __typeof (g_thread_pool_get_max_idle_time) g_thread_pool_get_max_idle_time __attribute((alias("IA__g_thread_pool_get_max_idle_time"), visibility("default"))); - -#undef g_thread_pool_get_num_threads -extern __typeof (g_thread_pool_get_num_threads) g_thread_pool_get_num_threads __attribute((alias("IA__g_thread_pool_get_num_threads"), visibility("default"))); - -#undef g_thread_pool_get_num_unused_threads -extern __typeof (g_thread_pool_get_num_unused_threads) g_thread_pool_get_num_unused_threads __attribute((alias("IA__g_thread_pool_get_num_unused_threads"), visibility("default"))); - -#undef g_thread_pool_new -extern __typeof (g_thread_pool_new) g_thread_pool_new __attribute((alias("IA__g_thread_pool_new"), visibility("default"))); - -#undef g_thread_pool_push -extern __typeof (g_thread_pool_push) g_thread_pool_push __attribute((alias("IA__g_thread_pool_push"), visibility("default"))); - -#undef g_thread_pool_set_max_threads -extern __typeof (g_thread_pool_set_max_threads) g_thread_pool_set_max_threads __attribute((alias("IA__g_thread_pool_set_max_threads"), visibility("default"))); - -#undef g_thread_pool_set_max_unused_threads -extern __typeof (g_thread_pool_set_max_unused_threads) g_thread_pool_set_max_unused_threads __attribute((alias("IA__g_thread_pool_set_max_unused_threads"), visibility("default"))); - -#undef g_thread_pool_set_max_idle_time -extern __typeof (g_thread_pool_set_max_idle_time) g_thread_pool_set_max_idle_time __attribute((alias("IA__g_thread_pool_set_max_idle_time"), visibility("default"))); - -#undef g_thread_pool_stop_unused_threads -extern __typeof (g_thread_pool_stop_unused_threads) g_thread_pool_stop_unused_threads __attribute((alias("IA__g_thread_pool_stop_unused_threads"), visibility("default"))); - -#undef g_thread_pool_unprocessed -extern __typeof (g_thread_pool_unprocessed) g_thread_pool_unprocessed __attribute((alias("IA__g_thread_pool_unprocessed"), visibility("default"))); - -#undef g_thread_pool_set_sort_function -extern __typeof (g_thread_pool_set_sort_function) g_thread_pool_set_sort_function __attribute((alias("IA__g_thread_pool_set_sort_function"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_TEST_UTILS_H__) -#if IN_FILE(__G_MESSAGES_C__) -#undef g_test_log_set_fatal_handler -extern __typeof (g_test_log_set_fatal_handler) g_test_log_set_fatal_handler __attribute((alias("IA__g_test_log_set_fatal_handler"), visibility("default"))); - -#endif -#if IN_FILE(__G_TEST_UTILS_C__) -#undef g_assertion_message -extern __typeof (g_assertion_message) g_assertion_message __attribute((alias("IA__g_assertion_message"), visibility("default"))); - -#undef g_assertion_message_cmpnum -extern __typeof (g_assertion_message_cmpnum) g_assertion_message_cmpnum __attribute((alias("IA__g_assertion_message_cmpnum"), visibility("default"))); - -#undef g_assertion_message_cmpstr -extern __typeof (g_assertion_message_cmpstr) g_assertion_message_cmpstr __attribute((alias("IA__g_assertion_message_cmpstr"), visibility("default"))); - -#undef g_assertion_message_expr -extern __typeof (g_assertion_message_expr) g_assertion_message_expr __attribute((alias("IA__g_assertion_message_expr"), visibility("default"))); - -#undef g_assertion_message_error -extern __typeof (g_assertion_message_error) g_assertion_message_error __attribute((alias("IA__g_assertion_message_error"), visibility("default"))); - -#undef g_strcmp0 -extern __typeof (g_strcmp0) g_strcmp0 __attribute((alias("IA__g_strcmp0"), visibility("default"))); - -#undef g_test_add_data_func -extern __typeof (g_test_add_data_func) g_test_add_data_func __attribute((alias("IA__g_test_add_data_func"), visibility("default"))); - -#undef g_test_add_func -extern __typeof (g_test_add_func) g_test_add_func __attribute((alias("IA__g_test_add_func"), visibility("default"))); - -#undef g_test_add_vtable -extern __typeof (g_test_add_vtable) g_test_add_vtable __attribute((alias("IA__g_test_add_vtable"), visibility("default"))); - -#undef g_test_bug -extern __typeof (g_test_bug) g_test_bug __attribute((alias("IA__g_test_bug"), visibility("default"))); - -#undef g_test_bug_base -extern __typeof (g_test_bug_base) g_test_bug_base __attribute((alias("IA__g_test_bug_base"), visibility("default"))); - -#undef g_test_create_case -extern __typeof (g_test_create_case) g_test_create_case __attribute((alias("IA__g_test_create_case"), visibility("default"))); - -#undef g_test_create_suite -extern __typeof (g_test_create_suite) g_test_create_suite __attribute((alias("IA__g_test_create_suite"), visibility("default"))); - -#undef g_test_get_root -extern __typeof (g_test_get_root) g_test_get_root __attribute((alias("IA__g_test_get_root"), visibility("default"))); - -#undef g_test_init -extern __typeof (g_test_init) g_test_init __attribute((alias("IA__g_test_init"), visibility("default"))); - -#undef g_test_log_buffer_free -extern __typeof (g_test_log_buffer_free) g_test_log_buffer_free __attribute((alias("IA__g_test_log_buffer_free"), visibility("default"))); - -#undef g_test_log_buffer_new -extern __typeof (g_test_log_buffer_new) g_test_log_buffer_new __attribute((alias("IA__g_test_log_buffer_new"), visibility("default"))); - -#undef g_test_log_buffer_pop -extern __typeof (g_test_log_buffer_pop) g_test_log_buffer_pop __attribute((alias("IA__g_test_log_buffer_pop"), visibility("default"))); - -#undef g_test_log_buffer_push -extern __typeof (g_test_log_buffer_push) g_test_log_buffer_push __attribute((alias("IA__g_test_log_buffer_push"), visibility("default"))); - -#undef g_test_log_msg_free -extern __typeof (g_test_log_msg_free) g_test_log_msg_free __attribute((alias("IA__g_test_log_msg_free"), visibility("default"))); - -#undef g_test_log_type_name -extern __typeof (g_test_log_type_name) g_test_log_type_name __attribute((alias("IA__g_test_log_type_name"), visibility("default"))); - -#undef g_test_maximized_result -extern __typeof (g_test_maximized_result) g_test_maximized_result __attribute((alias("IA__g_test_maximized_result"), visibility("default"))); - -#undef g_test_message -extern __typeof (g_test_message) g_test_message __attribute((alias("IA__g_test_message"), visibility("default"))); - -#undef g_test_minimized_result -extern __typeof (g_test_minimized_result) g_test_minimized_result __attribute((alias("IA__g_test_minimized_result"), visibility("default"))); - -#undef g_test_queue_destroy -extern __typeof (g_test_queue_destroy) g_test_queue_destroy __attribute((alias("IA__g_test_queue_destroy"), visibility("default"))); - -#undef g_test_queue_free -extern __typeof (g_test_queue_free) g_test_queue_free __attribute((alias("IA__g_test_queue_free"), visibility("default"))); - -#undef g_test_rand_double -extern __typeof (g_test_rand_double) g_test_rand_double __attribute((alias("IA__g_test_rand_double"), visibility("default"))); - -#undef g_test_rand_double_range -extern __typeof (g_test_rand_double_range) g_test_rand_double_range __attribute((alias("IA__g_test_rand_double_range"), visibility("default"))); - -#undef g_test_rand_int -extern __typeof (g_test_rand_int) g_test_rand_int __attribute((alias("IA__g_test_rand_int"), visibility("default"))); - -#undef g_test_rand_int_range -extern __typeof (g_test_rand_int_range) g_test_rand_int_range __attribute((alias("IA__g_test_rand_int_range"), visibility("default"))); - -#undef g_test_run -extern __typeof (g_test_run) g_test_run __attribute((alias("IA__g_test_run"), visibility("default"))); - -#undef g_test_run_suite -extern __typeof (g_test_run_suite) g_test_run_suite __attribute((alias("IA__g_test_run_suite"), visibility("default"))); - -#undef g_test_suite_add -extern __typeof (g_test_suite_add) g_test_suite_add __attribute((alias("IA__g_test_suite_add"), visibility("default"))); - -#undef g_test_suite_add_suite -extern __typeof (g_test_suite_add_suite) g_test_suite_add_suite __attribute((alias("IA__g_test_suite_add_suite"), visibility("default"))); - -#undef g_test_timer_elapsed -extern __typeof (g_test_timer_elapsed) g_test_timer_elapsed __attribute((alias("IA__g_test_timer_elapsed"), visibility("default"))); - -#undef g_test_timer_last -extern __typeof (g_test_timer_last) g_test_timer_last __attribute((alias("IA__g_test_timer_last"), visibility("default"))); - -#undef g_test_timer_start -extern __typeof (g_test_timer_start) g_test_timer_start __attribute((alias("IA__g_test_timer_start"), visibility("default"))); - -#undef g_test_trap_assertions -extern __typeof (g_test_trap_assertions) g_test_trap_assertions __attribute((alias("IA__g_test_trap_assertions"), visibility("default"))); - -#undef g_test_trap_fork -extern __typeof (g_test_trap_fork) g_test_trap_fork __attribute((alias("IA__g_test_trap_fork"), visibility("default"))); - -#undef g_test_trap_has_passed -extern __typeof (g_test_trap_has_passed) g_test_trap_has_passed __attribute((alias("IA__g_test_trap_has_passed"), visibility("default"))); - -#undef g_test_trap_reached_timeout -extern __typeof (g_test_trap_reached_timeout) g_test_trap_reached_timeout __attribute((alias("IA__g_test_trap_reached_timeout"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_TIMER_H__) -#if IN_FILE(__G_TIMER_C__) -#undef g_timer_continue -extern __typeof (g_timer_continue) g_timer_continue __attribute((alias("IA__g_timer_continue"), visibility("default"))); - -#undef g_timer_destroy -extern __typeof (g_timer_destroy) g_timer_destroy __attribute((alias("IA__g_timer_destroy"), visibility("default"))); - -#undef g_timer_elapsed -extern __typeof (g_timer_elapsed) g_timer_elapsed __attribute((alias("IA__g_timer_elapsed"), visibility("default"))); - -#undef g_timer_new -extern __typeof (g_timer_new) g_timer_new __attribute((alias("IA__g_timer_new"), visibility("default"))); - -#undef g_timer_reset -extern __typeof (g_timer_reset) g_timer_reset __attribute((alias("IA__g_timer_reset"), visibility("default"))); - -#undef g_timer_start -extern __typeof (g_timer_start) g_timer_start __attribute((alias("IA__g_timer_start"), visibility("default"))); - -#undef g_timer_stop -extern __typeof (g_timer_stop) g_timer_stop __attribute((alias("IA__g_timer_stop"), visibility("default"))); - -#undef g_time_val_add -extern __typeof (g_time_val_add) g_time_val_add __attribute((alias("IA__g_time_val_add"), visibility("default"))); - -#undef g_time_val_from_iso8601 -extern __typeof (g_time_val_from_iso8601) g_time_val_from_iso8601 __attribute((alias("IA__g_time_val_from_iso8601"), visibility("default"))); - -#undef g_time_val_to_iso8601 -extern __typeof (g_time_val_to_iso8601) g_time_val_to_iso8601 __attribute((alias("IA__g_time_val_to_iso8601"), visibility("default"))); - -#undef g_usleep -extern __typeof (g_usleep) g_usleep __attribute((alias("IA__g_usleep"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_TREE_H__) -#if IN_FILE(__G_TREE_C__) -#undef g_tree_destroy -extern __typeof (g_tree_destroy) g_tree_destroy __attribute((alias("IA__g_tree_destroy"), visibility("default"))); - -#undef g_tree_foreach -extern __typeof (g_tree_foreach) g_tree_foreach __attribute((alias("IA__g_tree_foreach"), visibility("default"))); - -#undef g_tree_height -extern __typeof (g_tree_height) g_tree_height __attribute((alias("IA__g_tree_height"), visibility("default"))); - -#undef g_tree_insert -extern __typeof (g_tree_insert) g_tree_insert __attribute((alias("IA__g_tree_insert"), visibility("default"))); - -#undef g_tree_lookup -extern __typeof (g_tree_lookup) g_tree_lookup __attribute((alias("IA__g_tree_lookup"), visibility("default"))); - -#undef g_tree_lookup_extended -extern __typeof (g_tree_lookup_extended) g_tree_lookup_extended __attribute((alias("IA__g_tree_lookup_extended"), visibility("default"))); - -#undef g_tree_new -extern __typeof (g_tree_new) g_tree_new __attribute((alias("IA__g_tree_new"), visibility("default"))); - -#undef g_tree_ref -extern __typeof (g_tree_ref) g_tree_ref __attribute((alias("IA__g_tree_ref"), visibility("default"))); - -#undef g_tree_unref -extern __typeof (g_tree_unref) g_tree_unref __attribute((alias("IA__g_tree_unref"), visibility("default"))); - -#undef g_tree_new_full -extern __typeof (g_tree_new_full) g_tree_new_full __attribute((alias("IA__g_tree_new_full"), visibility("default"))); - -#undef g_tree_new_with_data -extern __typeof (g_tree_new_with_data) g_tree_new_with_data __attribute((alias("IA__g_tree_new_with_data"), visibility("default"))); - -#undef g_tree_nnodes -extern __typeof (g_tree_nnodes) g_tree_nnodes __attribute((alias("IA__g_tree_nnodes"), visibility("default"))); - -#undef g_tree_remove -extern __typeof (g_tree_remove) g_tree_remove __attribute((alias("IA__g_tree_remove"), visibility("default"))); - -#undef g_tree_replace -extern __typeof (g_tree_replace) g_tree_replace __attribute((alias("IA__g_tree_replace"), visibility("default"))); - -#undef g_tree_search -extern __typeof (g_tree_search) g_tree_search __attribute((alias("IA__g_tree_search"), visibility("default"))); - -#undef g_tree_steal -extern __typeof (g_tree_steal) g_tree_steal __attribute((alias("IA__g_tree_steal"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_tree_traverse -extern __typeof (g_tree_traverse) g_tree_traverse __attribute((alias("IA__g_tree_traverse"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNIBREAK_C__) -#undef g_unichar_break_type -extern __typeof (g_unichar_break_type) g_unichar_break_type __attribute((alias("IA__g_unichar_break_type"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNICOLLATE_C__) -#undef g_utf8_collate -extern __typeof (g_utf8_collate) g_utf8_collate __attribute((alias("IA__g_utf8_collate"), visibility("default"))); - -#undef g_utf8_collate_key -extern __typeof (g_utf8_collate_key) g_utf8_collate_key __attribute((alias("IA__g_utf8_collate_key"), visibility("default"))); - -#undef g_utf8_collate_key_for_filename -extern __typeof (g_utf8_collate_key_for_filename) g_utf8_collate_key_for_filename __attribute((alias("IA__g_utf8_collate_key_for_filename"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNIDECOMP_C__) -#undef g_unicode_canonical_decomposition -extern __typeof (g_unicode_canonical_decomposition) g_unicode_canonical_decomposition __attribute((alias("IA__g_unicode_canonical_decomposition"), visibility("default"))); - -#undef g_unicode_canonical_ordering -extern __typeof (g_unicode_canonical_ordering) g_unicode_canonical_ordering __attribute((alias("IA__g_unicode_canonical_ordering"), visibility("default"))); - -#undef g_unichar_combining_class -extern __typeof (g_unichar_combining_class) g_unichar_combining_class __attribute((alias("IA__g_unichar_combining_class"), visibility("default"))); - -#undef g_utf8_normalize -extern __typeof (g_utf8_normalize) g_utf8_normalize __attribute((alias("IA__g_utf8_normalize"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UNIPROP_C__) -#undef g_unichar_isalnum -extern __typeof (g_unichar_isalnum) g_unichar_isalnum __attribute((alias("IA__g_unichar_isalnum"), visibility("default"))); - -#undef g_unichar_isalpha -extern __typeof (g_unichar_isalpha) g_unichar_isalpha __attribute((alias("IA__g_unichar_isalpha"), visibility("default"))); - -#undef g_unichar_iscntrl -extern __typeof (g_unichar_iscntrl) g_unichar_iscntrl __attribute((alias("IA__g_unichar_iscntrl"), visibility("default"))); - -#undef g_unichar_isdefined -extern __typeof (g_unichar_isdefined) g_unichar_isdefined __attribute((alias("IA__g_unichar_isdefined"), visibility("default"))); - -#undef g_unichar_isdigit -extern __typeof (g_unichar_isdigit) g_unichar_isdigit __attribute((alias("IA__g_unichar_isdigit"), visibility("default"))); - -#undef g_unichar_isgraph -extern __typeof (g_unichar_isgraph) g_unichar_isgraph __attribute((alias("IA__g_unichar_isgraph"), visibility("default"))); - -#undef g_unichar_islower -extern __typeof (g_unichar_islower) g_unichar_islower __attribute((alias("IA__g_unichar_islower"), visibility("default"))); - -#undef g_unichar_isprint -extern __typeof (g_unichar_isprint) g_unichar_isprint __attribute((alias("IA__g_unichar_isprint"), visibility("default"))); - -#undef g_unichar_ispunct -extern __typeof (g_unichar_ispunct) g_unichar_ispunct __attribute((alias("IA__g_unichar_ispunct"), visibility("default"))); - -#undef g_unichar_isspace -extern __typeof (g_unichar_isspace) g_unichar_isspace __attribute((alias("IA__g_unichar_isspace"), visibility("default"))); - -#undef g_unichar_istitle -extern __typeof (g_unichar_istitle) g_unichar_istitle __attribute((alias("IA__g_unichar_istitle"), visibility("default"))); - -#undef g_unichar_isupper -extern __typeof (g_unichar_isupper) g_unichar_isupper __attribute((alias("IA__g_unichar_isupper"), visibility("default"))); - -#undef g_unichar_iswide -extern __typeof (g_unichar_iswide) g_unichar_iswide __attribute((alias("IA__g_unichar_iswide"), visibility("default"))); - -#undef g_unichar_iswide_cjk -extern __typeof (g_unichar_iswide_cjk) g_unichar_iswide_cjk __attribute((alias("IA__g_unichar_iswide_cjk"), visibility("default"))); - -#undef g_unichar_isxdigit -extern __typeof (g_unichar_isxdigit) g_unichar_isxdigit __attribute((alias("IA__g_unichar_isxdigit"), visibility("default"))); - -#undef g_unichar_iszerowidth -extern __typeof (g_unichar_iszerowidth) g_unichar_iszerowidth __attribute((alias("IA__g_unichar_iszerowidth"), visibility("default"))); - -#undef g_unichar_tolower -extern __typeof (g_unichar_tolower) g_unichar_tolower __attribute((alias("IA__g_unichar_tolower"), visibility("default"))); - -#undef g_unichar_totitle -extern __typeof (g_unichar_totitle) g_unichar_totitle __attribute((alias("IA__g_unichar_totitle"), visibility("default"))); - -#undef g_unichar_toupper -extern __typeof (g_unichar_toupper) g_unichar_toupper __attribute((alias("IA__g_unichar_toupper"), visibility("default"))); - -#undef g_unichar_ismark -extern __typeof (g_unichar_ismark) g_unichar_ismark __attribute((alias("IA__g_unichar_ismark"), visibility("default"))); - -#undef g_unichar_get_mirror_char -extern __typeof (g_unichar_get_mirror_char) g_unichar_get_mirror_char __attribute((alias("IA__g_unichar_get_mirror_char"), visibility("default"))); - -#undef g_unichar_get_script -extern __typeof (g_unichar_get_script) g_unichar_get_script __attribute((alias("IA__g_unichar_get_script"), visibility("default"))); - -#undef g_unichar_digit_value -extern __typeof (g_unichar_digit_value) g_unichar_digit_value __attribute((alias("IA__g_unichar_digit_value"), visibility("default"))); - -#undef g_unichar_xdigit_value -extern __typeof (g_unichar_xdigit_value) g_unichar_xdigit_value __attribute((alias("IA__g_unichar_xdigit_value"), visibility("default"))); - -#undef g_unichar_type -extern __typeof (g_unichar_type) g_unichar_type __attribute((alias("IA__g_unichar_type"), visibility("default"))); - -#undef g_utf8_casefold -extern __typeof (g_utf8_casefold) g_utf8_casefold __attribute((alias("IA__g_utf8_casefold"), visibility("default"))); - -#undef g_utf8_strup -extern __typeof (g_utf8_strup) g_utf8_strup __attribute((alias("IA__g_utf8_strup"), visibility("default"))); - -#undef g_utf8_strdown -extern __typeof (g_utf8_strdown) g_utf8_strdown __attribute((alias("IA__g_utf8_strdown"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UNICODE_H__) -#if IN_FILE(__G_UTF8_C__) -#undef g_get_charset -extern __typeof (g_get_charset) g_get_charset __attribute((alias("IA__g_get_charset"), visibility("default"))); - -#undef g_ucs4_to_utf16 -extern __typeof (g_ucs4_to_utf16) g_ucs4_to_utf16 __attribute((alias("IA__g_ucs4_to_utf16"), visibility("default"))); - -#undef g_ucs4_to_utf8 -extern __typeof (g_ucs4_to_utf8) g_ucs4_to_utf8 __attribute((alias("IA__g_ucs4_to_utf8"), visibility("default"))); - -#undef g_utf16_to_ucs4 -extern __typeof (g_utf16_to_ucs4) g_utf16_to_ucs4 __attribute((alias("IA__g_utf16_to_ucs4"), visibility("default"))); - -#undef g_utf16_to_utf8 -extern __typeof (g_utf16_to_utf8) g_utf16_to_utf8 __attribute((alias("IA__g_utf16_to_utf8"), visibility("default"))); - -#undef g_utf8_find_next_char -extern __typeof (g_utf8_find_next_char) g_utf8_find_next_char __attribute((alias("IA__g_utf8_find_next_char"), visibility("default"))); - -#undef g_utf8_find_prev_char -extern __typeof (g_utf8_find_prev_char) g_utf8_find_prev_char __attribute((alias("IA__g_utf8_find_prev_char"), visibility("default"))); - -#undef g_utf8_get_char -extern __typeof (g_utf8_get_char) g_utf8_get_char __attribute((alias("IA__g_utf8_get_char"), visibility("default"))); - -#undef g_utf8_get_char_validated -extern __typeof (g_utf8_get_char_validated) g_utf8_get_char_validated __attribute((alias("IA__g_utf8_get_char_validated"), visibility("default"))); - -#undef g_utf8_offset_to_pointer -extern __typeof (g_utf8_offset_to_pointer) g_utf8_offset_to_pointer __attribute((alias("IA__g_utf8_offset_to_pointer"), visibility("default"))); - -#undef g_utf8_pointer_to_offset -extern __typeof (g_utf8_pointer_to_offset) g_utf8_pointer_to_offset __attribute((alias("IA__g_utf8_pointer_to_offset"), visibility("default"))); - -#undef g_utf8_prev_char -extern __typeof (g_utf8_prev_char) g_utf8_prev_char __attribute((alias("IA__g_utf8_prev_char"), visibility("default"))); - -#undef g_utf8_strchr -extern __typeof (g_utf8_strchr) g_utf8_strchr __attribute((alias("IA__g_utf8_strchr"), visibility("default"))); - -#undef g_utf8_strlen -extern __typeof (g_utf8_strlen) g_utf8_strlen __attribute((alias("IA__g_utf8_strlen"), visibility("default"))); - -#undef g_utf8_strncpy -extern __typeof (g_utf8_strncpy) g_utf8_strncpy __attribute((alias("IA__g_utf8_strncpy"), visibility("default"))); - -#undef g_utf8_strrchr -extern __typeof (g_utf8_strrchr) g_utf8_strrchr __attribute((alias("IA__g_utf8_strrchr"), visibility("default"))); - -#undef g_utf8_strreverse -extern __typeof (g_utf8_strreverse) g_utf8_strreverse __attribute((alias("IA__g_utf8_strreverse"), visibility("default"))); - -#undef g_utf8_to_ucs4 -extern __typeof (g_utf8_to_ucs4) g_utf8_to_ucs4 __attribute((alias("IA__g_utf8_to_ucs4"), visibility("default"))); - -#undef g_utf8_to_ucs4_fast -extern __typeof (g_utf8_to_ucs4_fast) g_utf8_to_ucs4_fast __attribute((alias("IA__g_utf8_to_ucs4_fast"), visibility("default"))); - -#undef g_utf8_to_utf16 -extern __typeof (g_utf8_to_utf16) g_utf8_to_utf16 __attribute((alias("IA__g_utf8_to_utf16"), visibility("default"))); - -#undef g_utf8_validate -extern __typeof (g_utf8_validate) g_utf8_validate __attribute((alias("IA__g_utf8_validate"), visibility("default"))); - -#undef g_unichar_to_utf8 -extern __typeof (g_unichar_to_utf8) g_unichar_to_utf8 __attribute((alias("IA__g_unichar_to_utf8"), visibility("default"))); - -#undef g_unichar_validate -extern __typeof (g_unichar_validate) g_unichar_validate __attribute((alias("IA__g_unichar_validate"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__GLIBINTL_H__) -#if IN_FILE(__G_UTILS_C__) -#undef glib_gettext -extern __typeof (glib_gettext) glib_gettext __attribute((alias("IA__glib_gettext"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_HASH_H__) -#if IN_FILE(__G_UTILS_C__) -#undef g_int_equal -extern __typeof (g_int_equal) g_int_equal __attribute((alias("IA__g_int_equal"), visibility("default"))); - -#undef g_int_hash -extern __typeof (g_int_hash) g_int_hash __attribute((alias("IA__g_int_hash"), visibility("default"))); - -#undef g_int64_equal -extern __typeof (g_int64_equal) g_int64_equal __attribute((alias("IA__g_int64_equal"), visibility("default"))); - -#undef g_int64_hash -extern __typeof (g_int64_hash) g_int64_hash __attribute((alias("IA__g_int64_hash"), visibility("default"))); - -#undef g_double_equal -extern __typeof (g_double_equal) g_double_equal __attribute((alias("IA__g_double_equal"), visibility("default"))); - -#undef g_double_hash -extern __typeof (g_double_hash) g_double_hash __attribute((alias("IA__g_double_hash"), visibility("default"))); - -#undef g_direct_equal -extern __typeof (g_direct_equal) g_direct_equal __attribute((alias("IA__g_direct_equal"), visibility("default"))); - -#undef g_direct_hash -extern __typeof (g_direct_hash) g_direct_hash __attribute((alias("IA__g_direct_hash"), visibility("default"))); - -#endif -#if IN_FILE(__G_STRING_C__) -#undef g_str_equal -extern __typeof (g_str_equal) g_str_equal __attribute((alias("IA__g_str_equal"), visibility("default"))); - -#undef g_str_hash -extern __typeof (g_str_hash) g_str_hash __attribute((alias("IA__g_str_hash"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_UTILS_H__) -#if IN_FILE(__G_UTILS_C__) -#undef g_atexit -extern __typeof (g_atexit) g_atexit __attribute((alias("IA__g_atexit"), visibility("default"))); - -#ifndef G_DISABLE_DEPRECATED -#undef g_basename -extern __typeof (g_basename) g_basename __attribute((alias("IA__g_basename"), visibility("default"))); - -#endif -#undef g_get_application_name -extern __typeof (g_get_application_name) g_get_application_name __attribute((alias("IA__g_get_application_name"), visibility("default"))); - -#ifndef _WIN64 -#undef g_find_program_in_path -extern __typeof (g_find_program_in_path) g_find_program_in_path __attribute((alias("IA__g_find_program_in_path"), visibility("default"))); - -#undef g_get_current_dir -extern __typeof (g_get_current_dir) g_get_current_dir __attribute((alias("IA__g_get_current_dir"), visibility("default"))); - -#undef g_getenv -extern __typeof (g_getenv) g_getenv __attribute((alias("IA__g_getenv"), visibility("default"))); - -#undef g_unsetenv -extern __typeof (g_unsetenv) g_unsetenv __attribute((alias("IA__g_unsetenv"), visibility("default"))); - -#undef g_get_home_dir -extern __typeof (g_get_home_dir) g_get_home_dir __attribute((alias("IA__g_get_home_dir"), visibility("default"))); - -#endif -#undef g_get_host_name -extern __typeof (g_get_host_name) g_get_host_name __attribute((alias("IA__g_get_host_name"), visibility("default"))); - -#ifndef _WIN64 -#undef g_setenv -extern __typeof (g_setenv) g_setenv __attribute((alias("IA__g_setenv"), visibility("default"))); - -#endif -#undef g_listenv -extern __typeof (g_listenv) g_listenv __attribute((alias("IA__g_listenv"), visibility("default"))); - -#ifdef G_OS_WIN32 -#undef g_find_program_in_path_utf8 -extern __typeof (g_find_program_in_path_utf8) g_find_program_in_path_utf8 __attribute((alias("IA__g_find_program_in_path_utf8"), visibility("default"))); - -#undef g_get_current_dir_utf8 -extern __typeof (g_get_current_dir_utf8) g_get_current_dir_utf8 __attribute((alias("IA__g_get_current_dir_utf8"), visibility("default"))); - -#undef g_getenv_utf8 -extern __typeof (g_getenv_utf8) g_getenv_utf8 __attribute((alias("IA__g_getenv_utf8"), visibility("default"))); - -#undef g_unsetenv_utf8 -extern __typeof (g_unsetenv_utf8) g_unsetenv_utf8 __attribute((alias("IA__g_unsetenv_utf8"), visibility("default"))); - -#undef g_setenv_utf8 -extern __typeof (g_setenv_utf8) g_setenv_utf8 __attribute((alias("IA__g_setenv_utf8"), visibility("default"))); - -#undef g_get_home_dir_utf8 -extern __typeof (g_get_home_dir_utf8) g_get_home_dir_utf8 __attribute((alias("IA__g_get_home_dir_utf8"), visibility("default"))); - -#endif -#undef g_get_language_names -extern __typeof (g_get_language_names) g_get_language_names __attribute((alias("IA__g_get_language_names"), visibility("default"))); - -#undef g_get_prgname -extern __typeof (g_get_prgname) g_get_prgname __attribute((alias("IA__g_get_prgname"), visibility("default"))); - -#ifndef _WIN64 -#undef g_get_real_name -extern __typeof (g_get_real_name) g_get_real_name __attribute((alias("IA__g_get_real_name"), visibility("default"))); - -#endif -#ifdef G_OS_WIN32 -#undef g_get_real_name_utf8 -extern __typeof (g_get_real_name_utf8) g_get_real_name_utf8 __attribute((alias("IA__g_get_real_name_utf8"), visibility("default"))); - -#endif -#undef g_get_system_config_dirs -extern __typeof (g_get_system_config_dirs) g_get_system_config_dirs __attribute((alias("IA__g_get_system_config_dirs"), visibility("default"))); - -#undef g_get_system_data_dirs -extern __typeof (g_get_system_data_dirs) g_get_system_data_dirs __attribute((alias("IA__g_get_system_data_dirs"), visibility("default"))); - -#ifdef G_OS_WIN32 -#undef g_win32_get_system_data_dirs_for_module -extern __typeof (g_win32_get_system_data_dirs_for_module) g_win32_get_system_data_dirs_for_module __attribute((alias("IA__g_win32_get_system_data_dirs_for_module"), visibility("default"))); - -#endif -#ifndef _WIN64 -#undef g_get_tmp_dir -extern __typeof (g_get_tmp_dir) g_get_tmp_dir __attribute((alias("IA__g_get_tmp_dir"), visibility("default"))); - -#endif -#ifdef G_OS_WIN32 -#undef g_get_tmp_dir_utf8 -extern __typeof (g_get_tmp_dir_utf8) g_get_tmp_dir_utf8 __attribute((alias("IA__g_get_tmp_dir_utf8"), visibility("default"))); - -#endif -#undef g_get_user_cache_dir -extern __typeof (g_get_user_cache_dir) g_get_user_cache_dir __attribute((alias("IA__g_get_user_cache_dir"), visibility("default"))); - -#undef g_get_user_config_dir -extern __typeof (g_get_user_config_dir) g_get_user_config_dir __attribute((alias("IA__g_get_user_config_dir"), visibility("default"))); - -#undef g_get_user_data_dir -extern __typeof (g_get_user_data_dir) g_get_user_data_dir __attribute((alias("IA__g_get_user_data_dir"), visibility("default"))); - -#undef g_reload_user_special_dirs_cache -extern __typeof (g_reload_user_special_dirs_cache) g_reload_user_special_dirs_cache __attribute((alias("IA__g_reload_user_special_dirs_cache"), visibility("default"))); - -#undef g_get_user_special_dir -extern __typeof (g_get_user_special_dir) g_get_user_special_dir __attribute((alias("IA__g_get_user_special_dir"), visibility("default"))); - -#ifndef _WIN64 -#undef g_get_user_name -extern __typeof (g_get_user_name) g_get_user_name __attribute((alias("IA__g_get_user_name"), visibility("default"))); - -#endif -#ifdef G_OS_WIN32 -#undef g_get_user_name_utf8 -extern __typeof (g_get_user_name_utf8) g_get_user_name_utf8 __attribute((alias("IA__g_get_user_name_utf8"), visibility("default"))); - -#endif -#undef glib_check_version -extern __typeof (glib_check_version) glib_check_version __attribute((alias("IA__glib_check_version"), visibility("default"))); - -#undef g_nullify_pointer -extern __typeof (g_nullify_pointer) g_nullify_pointer __attribute((alias("IA__g_nullify_pointer"), visibility("default"))); - -#undef g_parse_debug_string -extern __typeof (g_parse_debug_string) g_parse_debug_string __attribute((alias("IA__g_parse_debug_string"), visibility("default"))); - -#undef g_path_get_basename -extern __typeof (g_path_get_basename) g_path_get_basename __attribute((alias("IA__g_path_get_basename"), visibility("default"))); - -#undef g_path_get_dirname -extern __typeof (g_path_get_dirname) g_path_get_dirname __attribute((alias("IA__g_path_get_dirname"), visibility("default"))); - -#undef g_path_is_absolute -extern __typeof (g_path_is_absolute) g_path_is_absolute __attribute((alias("IA__g_path_is_absolute"), visibility("default"))); - -#undef g_path_skip_root -extern __typeof (g_path_skip_root) g_path_skip_root __attribute((alias("IA__g_path_skip_root"), visibility("default"))); - -#undef g_set_application_name -extern __typeof (g_set_application_name) g_set_application_name __attribute((alias("IA__g_set_application_name"), visibility("default"))); - -#undef g_set_prgname -extern __typeof (g_set_prgname) g_set_prgname __attribute((alias("IA__g_set_prgname"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_REGEX_H__) -#if IN_FILE(__G_REGEX_C__) -#undef g_regex_error_quark -extern __typeof (g_regex_error_quark) g_regex_error_quark __attribute((alias("IA__g_regex_error_quark"), visibility("default"))); - -#undef g_regex_new -extern __typeof (g_regex_new) g_regex_new __attribute((alias("IA__g_regex_new"), visibility("default"))); - -#undef g_regex_ref -extern __typeof (g_regex_ref) g_regex_ref __attribute((alias("IA__g_regex_ref"), visibility("default"))); - -#undef g_regex_unref -extern __typeof (g_regex_unref) g_regex_unref __attribute((alias("IA__g_regex_unref"), visibility("default"))); - -#undef g_regex_get_pattern -extern __typeof (g_regex_get_pattern) g_regex_get_pattern __attribute((alias("IA__g_regex_get_pattern"), visibility("default"))); - -#undef g_regex_get_max_backref -extern __typeof (g_regex_get_max_backref) g_regex_get_max_backref __attribute((alias("IA__g_regex_get_max_backref"), visibility("default"))); - -#undef g_regex_get_capture_count -extern __typeof (g_regex_get_capture_count) g_regex_get_capture_count __attribute((alias("IA__g_regex_get_capture_count"), visibility("default"))); - -#undef g_regex_get_string_number -extern __typeof (g_regex_get_string_number) g_regex_get_string_number __attribute((alias("IA__g_regex_get_string_number"), visibility("default"))); - -#undef g_regex_escape_string -extern __typeof (g_regex_escape_string) g_regex_escape_string __attribute((alias("IA__g_regex_escape_string"), visibility("default"))); - -#undef g_regex_match_simple -extern __typeof (g_regex_match_simple) g_regex_match_simple __attribute((alias("IA__g_regex_match_simple"), visibility("default"))); - -#undef g_regex_match -extern __typeof (g_regex_match) g_regex_match __attribute((alias("IA__g_regex_match"), visibility("default"))); - -#undef g_regex_match_full -extern __typeof (g_regex_match_full) g_regex_match_full __attribute((alias("IA__g_regex_match_full"), visibility("default"))); - -#undef g_regex_match_all -extern __typeof (g_regex_match_all) g_regex_match_all __attribute((alias("IA__g_regex_match_all"), visibility("default"))); - -#undef g_regex_match_all_full -extern __typeof (g_regex_match_all_full) g_regex_match_all_full __attribute((alias("IA__g_regex_match_all_full"), visibility("default"))); - -#undef g_regex_split_simple -extern __typeof (g_regex_split_simple) g_regex_split_simple __attribute((alias("IA__g_regex_split_simple"), visibility("default"))); - -#undef g_regex_split -extern __typeof (g_regex_split) g_regex_split __attribute((alias("IA__g_regex_split"), visibility("default"))); - -#undef g_regex_split_full -extern __typeof (g_regex_split_full) g_regex_split_full __attribute((alias("IA__g_regex_split_full"), visibility("default"))); - -#undef g_regex_replace -extern __typeof (g_regex_replace) g_regex_replace __attribute((alias("IA__g_regex_replace"), visibility("default"))); - -#undef g_regex_replace_literal -extern __typeof (g_regex_replace_literal) g_regex_replace_literal __attribute((alias("IA__g_regex_replace_literal"), visibility("default"))); - -#undef g_regex_replace_eval -extern __typeof (g_regex_replace_eval) g_regex_replace_eval __attribute((alias("IA__g_regex_replace_eval"), visibility("default"))); - -#undef g_regex_check_replacement -extern __typeof (g_regex_check_replacement) g_regex_check_replacement __attribute((alias("IA__g_regex_check_replacement"), visibility("default"))); - -#undef g_match_info_get_regex -extern __typeof (g_match_info_get_regex) g_match_info_get_regex __attribute((alias("IA__g_match_info_get_regex"), visibility("default"))); - -#undef g_match_info_get_string -extern __typeof (g_match_info_get_string) g_match_info_get_string __attribute((alias("IA__g_match_info_get_string"), visibility("default"))); - -#undef g_match_info_free -extern __typeof (g_match_info_free) g_match_info_free __attribute((alias("IA__g_match_info_free"), visibility("default"))); - -#undef g_match_info_next -extern __typeof (g_match_info_next) g_match_info_next __attribute((alias("IA__g_match_info_next"), visibility("default"))); - -#undef g_match_info_matches -extern __typeof (g_match_info_matches) g_match_info_matches __attribute((alias("IA__g_match_info_matches"), visibility("default"))); - -#undef g_match_info_get_match_count -extern __typeof (g_match_info_get_match_count) g_match_info_get_match_count __attribute((alias("IA__g_match_info_get_match_count"), visibility("default"))); - -#undef g_match_info_is_partial_match -extern __typeof (g_match_info_is_partial_match) g_match_info_is_partial_match __attribute((alias("IA__g_match_info_is_partial_match"), visibility("default"))); - -#undef g_match_info_expand_references -extern __typeof (g_match_info_expand_references) g_match_info_expand_references __attribute((alias("IA__g_match_info_expand_references"), visibility("default"))); - -#undef g_match_info_fetch -extern __typeof (g_match_info_fetch) g_match_info_fetch __attribute((alias("IA__g_match_info_fetch"), visibility("default"))); - -#undef g_match_info_fetch_pos -extern __typeof (g_match_info_fetch_pos) g_match_info_fetch_pos __attribute((alias("IA__g_match_info_fetch_pos"), visibility("default"))); - -#undef g_match_info_fetch_named -extern __typeof (g_match_info_fetch_named) g_match_info_fetch_named __attribute((alias("IA__g_match_info_fetch_named"), visibility("default"))); - -#undef g_match_info_fetch_named_pos -extern __typeof (g_match_info_fetch_named_pos) g_match_info_fetch_named_pos __attribute((alias("IA__g_match_info_fetch_named_pos"), visibility("default"))); - -#undef g_match_info_fetch_all -extern __typeof (g_match_info_fetch_all) g_match_info_fetch_all __attribute((alias("IA__g_match_info_fetch_all"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_VARIANT_TYPE_H__) -#if IN_FILE(__G_VARIANT_TYPE_C__) -#undef g_variant_type_string_is_valid -extern __typeof (g_variant_type_string_is_valid) g_variant_type_string_is_valid __attribute((alias("IA__g_variant_type_string_is_valid"), visibility("default"))); - -#undef g_variant_type_string_scan -extern __typeof (g_variant_type_string_scan) g_variant_type_string_scan __attribute((alias("IA__g_variant_type_string_scan"), visibility("default"))); - -#undef g_variant_type_free -extern __typeof (g_variant_type_free) g_variant_type_free __attribute((alias("IA__g_variant_type_free"), visibility("default"))); - -#undef g_variant_type_copy -extern __typeof (g_variant_type_copy) g_variant_type_copy __attribute((alias("IA__g_variant_type_copy"), visibility("default"))); - -#undef g_variant_type_new -extern __typeof (g_variant_type_new) g_variant_type_new __attribute((alias("IA__g_variant_type_new"), visibility("default"))); - -#undef g_variant_type_get_string_length -extern __typeof (g_variant_type_get_string_length) g_variant_type_get_string_length __attribute((alias("IA__g_variant_type_get_string_length"), visibility("default"))); - -#undef g_variant_type_peek_string -extern __typeof (g_variant_type_peek_string) g_variant_type_peek_string __attribute((alias("IA__g_variant_type_peek_string"), visibility("default"))); - -#undef g_variant_type_dup_string -extern __typeof (g_variant_type_dup_string) g_variant_type_dup_string __attribute((alias("IA__g_variant_type_dup_string"), visibility("default"))); - -#undef g_variant_type_is_definite -extern __typeof (g_variant_type_is_definite) g_variant_type_is_definite __attribute((alias("IA__g_variant_type_is_definite"), visibility("default"))); - -#undef g_variant_type_is_container -extern __typeof (g_variant_type_is_container) g_variant_type_is_container __attribute((alias("IA__g_variant_type_is_container"), visibility("default"))); - -#undef g_variant_type_is_basic -extern __typeof (g_variant_type_is_basic) g_variant_type_is_basic __attribute((alias("IA__g_variant_type_is_basic"), visibility("default"))); - -#undef g_variant_type_is_maybe -extern __typeof (g_variant_type_is_maybe) g_variant_type_is_maybe __attribute((alias("IA__g_variant_type_is_maybe"), visibility("default"))); - -#undef g_variant_type_is_array -extern __typeof (g_variant_type_is_array) g_variant_type_is_array __attribute((alias("IA__g_variant_type_is_array"), visibility("default"))); - -#undef g_variant_type_is_tuple -extern __typeof (g_variant_type_is_tuple) g_variant_type_is_tuple __attribute((alias("IA__g_variant_type_is_tuple"), visibility("default"))); - -#undef g_variant_type_is_dict_entry -extern __typeof (g_variant_type_is_dict_entry) g_variant_type_is_dict_entry __attribute((alias("IA__g_variant_type_is_dict_entry"), visibility("default"))); - -#undef g_variant_type_is_variant -extern __typeof (g_variant_type_is_variant) g_variant_type_is_variant __attribute((alias("IA__g_variant_type_is_variant"), visibility("default"))); - -#undef g_variant_type_hash -extern __typeof (g_variant_type_hash) g_variant_type_hash __attribute((alias("IA__g_variant_type_hash"), visibility("default"))); - -#undef g_variant_type_equal -extern __typeof (g_variant_type_equal) g_variant_type_equal __attribute((alias("IA__g_variant_type_equal"), visibility("default"))); - -#undef g_variant_type_is_subtype_of -extern __typeof (g_variant_type_is_subtype_of) g_variant_type_is_subtype_of __attribute((alias("IA__g_variant_type_is_subtype_of"), visibility("default"))); - -#undef g_variant_type_element -extern __typeof (g_variant_type_element) g_variant_type_element __attribute((alias("IA__g_variant_type_element"), visibility("default"))); - -#undef g_variant_type_first -extern __typeof (g_variant_type_first) g_variant_type_first __attribute((alias("IA__g_variant_type_first"), visibility("default"))); - -#undef g_variant_type_next -extern __typeof (g_variant_type_next) g_variant_type_next __attribute((alias("IA__g_variant_type_next"), visibility("default"))); - -#undef g_variant_type_n_items -extern __typeof (g_variant_type_n_items) g_variant_type_n_items __attribute((alias("IA__g_variant_type_n_items"), visibility("default"))); - -#undef g_variant_type_key -extern __typeof (g_variant_type_key) g_variant_type_key __attribute((alias("IA__g_variant_type_key"), visibility("default"))); - -#undef g_variant_type_value -extern __typeof (g_variant_type_value) g_variant_type_value __attribute((alias("IA__g_variant_type_value"), visibility("default"))); - -#undef g_variant_type_new_array -extern __typeof (g_variant_type_new_array) g_variant_type_new_array __attribute((alias("IA__g_variant_type_new_array"), visibility("default"))); - -#undef g_variant_type_new_maybe -extern __typeof (g_variant_type_new_maybe) g_variant_type_new_maybe __attribute((alias("IA__g_variant_type_new_maybe"), visibility("default"))); - -#undef g_variant_type_new_tuple -extern __typeof (g_variant_type_new_tuple) g_variant_type_new_tuple __attribute((alias("IA__g_variant_type_new_tuple"), visibility("default"))); - -#undef g_variant_type_new_dict_entry -extern __typeof (g_variant_type_new_dict_entry) g_variant_type_new_dict_entry __attribute((alias("IA__g_variant_type_new_dict_entry"), visibility("default"))); - -#undef g_variant_type_checked_ -extern __typeof (g_variant_type_checked_) g_variant_type_checked_ __attribute((alias("IA__g_variant_type_checked_"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_VARIANT_H__) -#if IN_FILE(__G_VARIANT_CORE_C__) -#undef g_variant_unref -extern __typeof (g_variant_unref) g_variant_unref __attribute((alias("IA__g_variant_unref"), visibility("default"))); - -#undef g_variant_ref -extern __typeof (g_variant_ref) g_variant_ref __attribute((alias("IA__g_variant_ref"), visibility("default"))); - -#undef g_variant_ref_sink -extern __typeof (g_variant_ref_sink) g_variant_ref_sink __attribute((alias("IA__g_variant_ref_sink"), visibility("default"))); - -#undef g_variant_n_children -extern __typeof (g_variant_n_children) g_variant_n_children __attribute((alias("IA__g_variant_n_children"), visibility("default"))); - -#undef g_variant_get_child_value -extern __typeof (g_variant_get_child_value) g_variant_get_child_value __attribute((alias("IA__g_variant_get_child_value"), visibility("default"))); - -#undef g_variant_get_size -extern __typeof (g_variant_get_size) g_variant_get_size __attribute((alias("IA__g_variant_get_size"), visibility("default"))); - -#undef g_variant_get_data -extern __typeof (g_variant_get_data) g_variant_get_data __attribute((alias("IA__g_variant_get_data"), visibility("default"))); - -#undef g_variant_store -extern __typeof (g_variant_store) g_variant_store __attribute((alias("IA__g_variant_store"), visibility("default"))); - -#undef g_variant_is_normal_form -extern __typeof (g_variant_is_normal_form) g_variant_is_normal_form __attribute((alias("IA__g_variant_is_normal_form"), visibility("default"))); - -#endif -#if IN_FILE(__G_VARIANT_C__) -#undef g_variant_get_type -extern __typeof (g_variant_get_type) g_variant_get_type __attribute((alias("IA__g_variant_get_type"), visibility("default"))); - -#undef g_variant_get_type_string -extern __typeof (g_variant_get_type_string) g_variant_get_type_string __attribute((alias("IA__g_variant_get_type_string"), visibility("default"))); - -#undef g_variant_is_of_type -extern __typeof (g_variant_is_of_type) g_variant_is_of_type __attribute((alias("IA__g_variant_is_of_type"), visibility("default"))); - -#undef g_variant_is_container -extern __typeof (g_variant_is_container) g_variant_is_container __attribute((alias("IA__g_variant_is_container"), visibility("default"))); - -#undef g_variant_classify -extern __typeof (g_variant_classify) g_variant_classify __attribute((alias("IA__g_variant_classify"), visibility("default"))); - -#undef g_variant_new_boolean -extern __typeof (g_variant_new_boolean) g_variant_new_boolean __attribute((alias("IA__g_variant_new_boolean"), visibility("default"))); - -#undef g_variant_new_byte -extern __typeof (g_variant_new_byte) g_variant_new_byte __attribute((alias("IA__g_variant_new_byte"), visibility("default"))); - -#undef g_variant_new_int16 -extern __typeof (g_variant_new_int16) g_variant_new_int16 __attribute((alias("IA__g_variant_new_int16"), visibility("default"))); - -#undef g_variant_new_uint16 -extern __typeof (g_variant_new_uint16) g_variant_new_uint16 __attribute((alias("IA__g_variant_new_uint16"), visibility("default"))); - -#undef g_variant_new_int32 -extern __typeof (g_variant_new_int32) g_variant_new_int32 __attribute((alias("IA__g_variant_new_int32"), visibility("default"))); - -#undef g_variant_new_uint32 -extern __typeof (g_variant_new_uint32) g_variant_new_uint32 __attribute((alias("IA__g_variant_new_uint32"), visibility("default"))); - -#undef g_variant_new_int64 -extern __typeof (g_variant_new_int64) g_variant_new_int64 __attribute((alias("IA__g_variant_new_int64"), visibility("default"))); - -#undef g_variant_new_uint64 -extern __typeof (g_variant_new_uint64) g_variant_new_uint64 __attribute((alias("IA__g_variant_new_uint64"), visibility("default"))); - -#undef g_variant_new_handle -extern __typeof (g_variant_new_handle) g_variant_new_handle __attribute((alias("IA__g_variant_new_handle"), visibility("default"))); - -#undef g_variant_new_double -extern __typeof (g_variant_new_double) g_variant_new_double __attribute((alias("IA__g_variant_new_double"), visibility("default"))); - -#undef g_variant_new_string -extern __typeof (g_variant_new_string) g_variant_new_string __attribute((alias("IA__g_variant_new_string"), visibility("default"))); - -#undef g_variant_new_object_path -extern __typeof (g_variant_new_object_path) g_variant_new_object_path __attribute((alias("IA__g_variant_new_object_path"), visibility("default"))); - -#undef g_variant_is_object_path -extern __typeof (g_variant_is_object_path) g_variant_is_object_path __attribute((alias("IA__g_variant_is_object_path"), visibility("default"))); - -#undef g_variant_new_signature -extern __typeof (g_variant_new_signature) g_variant_new_signature __attribute((alias("IA__g_variant_new_signature"), visibility("default"))); - -#undef g_variant_is_signature -extern __typeof (g_variant_is_signature) g_variant_is_signature __attribute((alias("IA__g_variant_is_signature"), visibility("default"))); - -#undef g_variant_new_variant -extern __typeof (g_variant_new_variant) g_variant_new_variant __attribute((alias("IA__g_variant_new_variant"), visibility("default"))); - -#undef g_variant_new_strv -extern __typeof (g_variant_new_strv) g_variant_new_strv __attribute((alias("IA__g_variant_new_strv"), visibility("default"))); - -#undef g_variant_get_boolean -extern __typeof (g_variant_get_boolean) g_variant_get_boolean __attribute((alias("IA__g_variant_get_boolean"), visibility("default"))); - -#undef g_variant_get_byte -extern __typeof (g_variant_get_byte) g_variant_get_byte __attribute((alias("IA__g_variant_get_byte"), visibility("default"))); - -#undef g_variant_get_int16 -extern __typeof (g_variant_get_int16) g_variant_get_int16 __attribute((alias("IA__g_variant_get_int16"), visibility("default"))); - -#undef g_variant_get_uint16 -extern __typeof (g_variant_get_uint16) g_variant_get_uint16 __attribute((alias("IA__g_variant_get_uint16"), visibility("default"))); - -#undef g_variant_get_int32 -extern __typeof (g_variant_get_int32) g_variant_get_int32 __attribute((alias("IA__g_variant_get_int32"), visibility("default"))); - -#undef g_variant_get_uint32 -extern __typeof (g_variant_get_uint32) g_variant_get_uint32 __attribute((alias("IA__g_variant_get_uint32"), visibility("default"))); - -#undef g_variant_get_int64 -extern __typeof (g_variant_get_int64) g_variant_get_int64 __attribute((alias("IA__g_variant_get_int64"), visibility("default"))); - -#undef g_variant_get_uint64 -extern __typeof (g_variant_get_uint64) g_variant_get_uint64 __attribute((alias("IA__g_variant_get_uint64"), visibility("default"))); - -#undef g_variant_get_handle -extern __typeof (g_variant_get_handle) g_variant_get_handle __attribute((alias("IA__g_variant_get_handle"), visibility("default"))); - -#undef g_variant_get_double -extern __typeof (g_variant_get_double) g_variant_get_double __attribute((alias("IA__g_variant_get_double"), visibility("default"))); - -#undef g_variant_get_string -extern __typeof (g_variant_get_string) g_variant_get_string __attribute((alias("IA__g_variant_get_string"), visibility("default"))); - -#undef g_variant_dup_string -extern __typeof (g_variant_dup_string) g_variant_dup_string __attribute((alias("IA__g_variant_dup_string"), visibility("default"))); - -#undef g_variant_get_variant -extern __typeof (g_variant_get_variant) g_variant_get_variant __attribute((alias("IA__g_variant_get_variant"), visibility("default"))); - -#undef g_variant_get_strv -extern __typeof (g_variant_get_strv) g_variant_get_strv __attribute((alias("IA__g_variant_get_strv"), visibility("default"))); - -#undef g_variant_dup_strv -extern __typeof (g_variant_dup_strv) g_variant_dup_strv __attribute((alias("IA__g_variant_dup_strv"), visibility("default"))); - -#undef g_variant_new_maybe -extern __typeof (g_variant_new_maybe) g_variant_new_maybe __attribute((alias("IA__g_variant_new_maybe"), visibility("default"))); - -#undef g_variant_new_array -extern __typeof (g_variant_new_array) g_variant_new_array __attribute((alias("IA__g_variant_new_array"), visibility("default"))); - -#undef g_variant_new_tuple -extern __typeof (g_variant_new_tuple) g_variant_new_tuple __attribute((alias("IA__g_variant_new_tuple"), visibility("default"))); - -#undef g_variant_new_dict_entry -extern __typeof (g_variant_new_dict_entry) g_variant_new_dict_entry __attribute((alias("IA__g_variant_new_dict_entry"), visibility("default"))); - -#undef g_variant_get_maybe -extern __typeof (g_variant_get_maybe) g_variant_get_maybe __attribute((alias("IA__g_variant_get_maybe"), visibility("default"))); - -#undef g_variant_get_fixed_array -extern __typeof (g_variant_get_fixed_array) g_variant_get_fixed_array __attribute((alias("IA__g_variant_get_fixed_array"), visibility("default"))); - -#undef g_variant_print -extern __typeof (g_variant_print) g_variant_print __attribute((alias("IA__g_variant_print"), visibility("default"))); - -#undef g_variant_print_string -extern __typeof (g_variant_print_string) g_variant_print_string __attribute((alias("IA__g_variant_print_string"), visibility("default"))); - -#undef g_variant_hash -extern __typeof (g_variant_hash) g_variant_hash __attribute((alias("IA__g_variant_hash"), visibility("default"))); - -#undef g_variant_equal -extern __typeof (g_variant_equal) g_variant_equal __attribute((alias("IA__g_variant_equal"), visibility("default"))); - -#undef g_variant_iter_copy -extern __typeof (g_variant_iter_copy) g_variant_iter_copy __attribute((alias("IA__g_variant_iter_copy"), visibility("default"))); - -#undef g_variant_iter_free -extern __typeof (g_variant_iter_free) g_variant_iter_free __attribute((alias("IA__g_variant_iter_free"), visibility("default"))); - -#undef g_variant_iter_init -extern __typeof (g_variant_iter_init) g_variant_iter_init __attribute((alias("IA__g_variant_iter_init"), visibility("default"))); - -#undef g_variant_iter_n_children -extern __typeof (g_variant_iter_n_children) g_variant_iter_n_children __attribute((alias("IA__g_variant_iter_n_children"), visibility("default"))); - -#undef g_variant_iter_new -extern __typeof (g_variant_iter_new) g_variant_iter_new __attribute((alias("IA__g_variant_iter_new"), visibility("default"))); - -#undef g_variant_iter_next_value -extern __typeof (g_variant_iter_next_value) g_variant_iter_next_value __attribute((alias("IA__g_variant_iter_next_value"), visibility("default"))); - -#undef g_variant_builder_add_value -extern __typeof (g_variant_builder_add_value) g_variant_builder_add_value __attribute((alias("IA__g_variant_builder_add_value"), visibility("default"))); - -#undef g_variant_builder_init -extern __typeof (g_variant_builder_init) g_variant_builder_init __attribute((alias("IA__g_variant_builder_init"), visibility("default"))); - -#undef g_variant_builder_clear -extern __typeof (g_variant_builder_clear) g_variant_builder_clear __attribute((alias("IA__g_variant_builder_clear"), visibility("default"))); - -#undef g_variant_builder_open -extern __typeof (g_variant_builder_open) g_variant_builder_open __attribute((alias("IA__g_variant_builder_open"), visibility("default"))); - -#undef g_variant_builder_close -extern __typeof (g_variant_builder_close) g_variant_builder_close __attribute((alias("IA__g_variant_builder_close"), visibility("default"))); - -#undef g_variant_builder_end -extern __typeof (g_variant_builder_end) g_variant_builder_end __attribute((alias("IA__g_variant_builder_end"), visibility("default"))); - -#undef g_variant_builder_new -extern __typeof (g_variant_builder_new) g_variant_builder_new __attribute((alias("IA__g_variant_builder_new"), visibility("default"))); - -#undef g_variant_builder_unref -extern __typeof (g_variant_builder_unref) g_variant_builder_unref __attribute((alias("IA__g_variant_builder_unref"), visibility("default"))); - -#undef g_variant_builder_ref -extern __typeof (g_variant_builder_ref) g_variant_builder_ref __attribute((alias("IA__g_variant_builder_ref"), visibility("default"))); - -#undef g_variant_new_va -extern __typeof (g_variant_new_va) g_variant_new_va __attribute((alias("IA__g_variant_new_va"), visibility("default"))); - -#undef g_variant_get_va -extern __typeof (g_variant_get_va) g_variant_get_va __attribute((alias("IA__g_variant_get_va"), visibility("default"))); - -#undef g_variant_new -extern __typeof (g_variant_new) g_variant_new __attribute((alias("IA__g_variant_new"), visibility("default"))); - -#undef g_variant_get -extern __typeof (g_variant_get) g_variant_get __attribute((alias("IA__g_variant_get"), visibility("default"))); - -#undef g_variant_builder_add -extern __typeof (g_variant_builder_add) g_variant_builder_add __attribute((alias("IA__g_variant_builder_add"), visibility("default"))); - -#undef g_variant_get_child -extern __typeof (g_variant_get_child) g_variant_get_child __attribute((alias("IA__g_variant_get_child"), visibility("default"))); - -#undef g_variant_iter_next -extern __typeof (g_variant_iter_next) g_variant_iter_next __attribute((alias("IA__g_variant_iter_next"), visibility("default"))); - -#undef g_variant_iter_loop -extern __typeof (g_variant_iter_loop) g_variant_iter_loop __attribute((alias("IA__g_variant_iter_loop"), visibility("default"))); - -#undef g_variant_new_from_data -extern __typeof (g_variant_new_from_data) g_variant_new_from_data __attribute((alias("IA__g_variant_new_from_data"), visibility("default"))); - -#undef g_variant_get_normal_form -extern __typeof (g_variant_get_normal_form) g_variant_get_normal_form __attribute((alias("IA__g_variant_get_normal_form"), visibility("default"))); - -#undef g_variant_byteswap -extern __typeof (g_variant_byteswap) g_variant_byteswap __attribute((alias("IA__g_variant_byteswap"), visibility("default"))); - -#endif -#if IN_FILE(__G_VARIANT_PARSER_C__) -#undef g_variant_new_parsed -extern __typeof (g_variant_new_parsed) g_variant_new_parsed __attribute((alias("IA__g_variant_new_parsed"), visibility("default"))); - -#undef g_variant_new_parsed_va -extern __typeof (g_variant_new_parsed_va) g_variant_new_parsed_va __attribute((alias("IA__g_variant_new_parsed_va"), visibility("default"))); - -#undef g_variant_parse -extern __typeof (g_variant_parse) g_variant_parse __attribute((alias("IA__g_variant_parse"), visibility("default"))); - -#undef g_variant_parser_get_error_quark -extern __typeof (g_variant_parser_get_error_quark) g_variant_parser_get_error_quark __attribute((alias("IA__g_variant_parser_get_error_quark"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_VARIANT_TYPE_INFO_H__) -#if IN_FILE(__G_VARIANT_TYPE_INFO_C__) -#undef g_variant_type_info_get_type_string -extern __typeof (g_variant_type_info_get_type_string) g_variant_type_info_get_type_string __attribute((alias("IA__g_variant_type_info_get_type_string"), visibility("default"))); - -#undef g_variant_type_info_query -extern __typeof (g_variant_type_info_query) g_variant_type_info_query __attribute((alias("IA__g_variant_type_info_query"), visibility("default"))); - -#undef g_variant_type_info_element -extern __typeof (g_variant_type_info_element) g_variant_type_info_element __attribute((alias("IA__g_variant_type_info_element"), visibility("default"))); - -#undef g_variant_type_info_query_element -extern __typeof (g_variant_type_info_query_element) g_variant_type_info_query_element __attribute((alias("IA__g_variant_type_info_query_element"), visibility("default"))); - -#undef g_variant_type_info_n_members -extern __typeof (g_variant_type_info_n_members) g_variant_type_info_n_members __attribute((alias("IA__g_variant_type_info_n_members"), visibility("default"))); - -#undef g_variant_type_info_member_info -extern __typeof (g_variant_type_info_member_info) g_variant_type_info_member_info __attribute((alias("IA__g_variant_type_info_member_info"), visibility("default"))); - -#undef g_variant_type_info_get -extern __typeof (g_variant_type_info_get) g_variant_type_info_get __attribute((alias("IA__g_variant_type_info_get"), visibility("default"))); - -#undef g_variant_type_info_ref -extern __typeof (g_variant_type_info_ref) g_variant_type_info_ref __attribute((alias("IA__g_variant_type_info_ref"), visibility("default"))); - -#undef g_variant_type_info_unref -extern __typeof (g_variant_type_info_unref) g_variant_type_info_unref __attribute((alias("IA__g_variant_type_info_unref"), visibility("default"))); - -#undef g_variant_type_info_assert_no_infos -extern __typeof (g_variant_type_info_assert_no_infos) g_variant_type_info_assert_no_infos __attribute((alias("IA__g_variant_type_info_assert_no_infos"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_VARIANT_SERIALISER_H__) -#if IN_FILE(__G_VARIANT_SERIALISER_C__) -#undef g_variant_serialised_byteswap -extern __typeof (g_variant_serialised_byteswap) g_variant_serialised_byteswap __attribute((alias("IA__g_variant_serialised_byteswap"), visibility("default"))); - -#undef g_variant_serialised_get_child -extern __typeof (g_variant_serialised_get_child) g_variant_serialised_get_child __attribute((alias("IA__g_variant_serialised_get_child"), visibility("default"))); - -#undef g_variant_serialised_is_normal -extern __typeof (g_variant_serialised_is_normal) g_variant_serialised_is_normal __attribute((alias("IA__g_variant_serialised_is_normal"), visibility("default"))); - -#undef g_variant_serialised_n_children -extern __typeof (g_variant_serialised_n_children) g_variant_serialised_n_children __attribute((alias("IA__g_variant_serialised_n_children"), visibility("default"))); - -#undef g_variant_serialiser_is_object_path -extern __typeof (g_variant_serialiser_is_object_path) g_variant_serialiser_is_object_path __attribute((alias("IA__g_variant_serialiser_is_object_path"), visibility("default"))); - -#undef g_variant_serialiser_is_signature -extern __typeof (g_variant_serialiser_is_signature) g_variant_serialiser_is_signature __attribute((alias("IA__g_variant_serialiser_is_signature"), visibility("default"))); - -#undef g_variant_serialiser_is_string -extern __typeof (g_variant_serialiser_is_string) g_variant_serialiser_is_string __attribute((alias("IA__g_variant_serialiser_is_string"), visibility("default"))); - -#undef g_variant_serialiser_needed_size -extern __typeof (g_variant_serialiser_needed_size) g_variant_serialiser_needed_size __attribute((alias("IA__g_variant_serialiser_needed_size"), visibility("default"))); - -#undef g_variant_serialiser_serialise -extern __typeof (g_variant_serialiser_serialise) g_variant_serialiser_serialise __attribute((alias("IA__g_variant_serialiser_serialise"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_VARIANT_INTERNAL_H__) -#if IN_FILE(__G_VARIANT_C__) -#undef g_variant_format_string_scan_type -extern __typeof (g_variant_format_string_scan_type) g_variant_format_string_scan_type __attribute((alias("IA__g_variant_format_string_scan_type"), visibility("default"))); - -#undef g_variant_format_string_scan -extern __typeof (g_variant_format_string_scan) g_variant_format_string_scan __attribute((alias("IA__g_variant_format_string_scan"), visibility("default"))); - -#endif -#endif -#if IN_HEADER(__G_WIN32_H__) -#if IN_FILE(__G_WIN32_H__) -#ifdef G_OS_WIN32 -#undef g_win32_error_message -extern __typeof (g_win32_error_message) g_win32_error_message __attribute((alias("IA__g_win32_error_message"), visibility("default"))); - -#undef g_win32_ftruncate -extern __typeof (g_win32_ftruncate) g_win32_ftruncate __attribute((alias("IA__g_win32_ftruncate"), visibility("default"))); - -#undef g_win32_get_package_installation_directory_of_module -extern __typeof (g_win32_get_package_installation_directory_of_module) g_win32_get_package_installation_directory_of_module __attribute((alias("IA__g_win32_get_package_installation_directory_of_module"), visibility("default"))); - -#ifndef _WIN64 -#undef g_win32_get_package_installation_directory -extern __typeof (g_win32_get_package_installation_directory) g_win32_get_package_installation_directory __attribute((alias("IA__g_win32_get_package_installation_directory"), visibility("default"))); - -#endif -#undef g_win32_get_package_installation_directory_utf8 -extern __typeof (g_win32_get_package_installation_directory_utf8) g_win32_get_package_installation_directory_utf8 __attribute((alias("IA__g_win32_get_package_installation_directory_utf8"), visibility("default"))); - -#ifndef _WIN64 -#undef g_win32_get_package_installation_subdirectory -extern __typeof (g_win32_get_package_installation_subdirectory) g_win32_get_package_installation_subdirectory __attribute((alias("IA__g_win32_get_package_installation_subdirectory"), visibility("default"))); - -#endif -#undef g_win32_get_package_installation_subdirectory_utf8 -extern __typeof (g_win32_get_package_installation_subdirectory_utf8) g_win32_get_package_installation_subdirectory_utf8 __attribute((alias("IA__g_win32_get_package_installation_subdirectory_utf8"), visibility("default"))); - -#undef g_win32_get_windows_version -extern __typeof (g_win32_get_windows_version) g_win32_get_windows_version __attribute((alias("IA__g_win32_get_windows_version"), visibility("default"))); - -#undef g_win32_getlocale -extern __typeof (g_win32_getlocale) g_win32_getlocale __attribute((alias("IA__g_win32_getlocale"), visibility("default"))); - -#undef g_win32_locale_filename_from_utf8 -extern __typeof (g_win32_locale_filename_from_utf8) g_win32_locale_filename_from_utf8 __attribute((alias("IA__g_win32_locale_filename_from_utf8"), visibility("default"))); - -#endif -#endif -#endif -#if IN_HEADER(__G_HOST_UTILS_H__) -#if IN_FILE(__G_HOST_UTILS_C__) -#undef g_hostname_is_non_ascii -extern __typeof (g_hostname_is_non_ascii) g_hostname_is_non_ascii __attribute((alias("IA__g_hostname_is_non_ascii"), visibility("default"))); - -#undef g_hostname_is_ascii_encoded -extern __typeof (g_hostname_is_ascii_encoded) g_hostname_is_ascii_encoded __attribute((alias("IA__g_hostname_is_ascii_encoded"), visibility("default"))); - -#undef g_hostname_is_ip_address -extern __typeof (g_hostname_is_ip_address) g_hostname_is_ip_address __attribute((alias("IA__g_hostname_is_ip_address"), visibility("default"))); - -#undef g_hostname_to_ascii -extern __typeof (g_hostname_to_ascii) g_hostname_to_ascii __attribute((alias("IA__g_hostname_to_ascii"), visibility("default"))); - -#undef g_hostname_to_unicode -extern __typeof (g_hostname_to_unicode) g_hostname_to_unicode __attribute((alias("IA__g_hostname_to_unicode"), visibility("default"))); - -#endif -#endif - -#endif /* G_HAVE_GNUC_VISIBILITY */ -#endif /* DISABLE_VISIBILITY */ diff --git a/glib/galloca.h b/glib/galloca.h index 356587f..8876836 100644 --- a/glib/galloca.h +++ b/glib/galloca.h @@ -57,7 +57,54 @@ G_END_DECLS # endif /* !_MSC_VER && !__DMC__ */ #endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */ +/** + * g_alloca: + * @size: number of bytes to allocate. + * + * Allocates @size bytes on the stack; these bytes will be freed when the current + * stack frame is cleaned up. This macro essentially just wraps the alloca() + * function present on most UNIX variants. + * Thus it provides the same advantages and pitfalls as alloca(): + * + * + * + alloca() is very fast, as on most systems it's implemented by just adjusting + * the stack pointer register. + * + * + * + It doesn't cause any memory fragmentation, within its scope, separate alloca() + * blocks just build up and are released together at function end. + * + * + * - Allocation sizes have to fit into the current stack frame. For instance in a + * threaded environment on Linux, the per-thread stack size is limited to 2 Megabytes, + * so be sparse with alloca() uses. + * + * + * - Allocation failure due to insufficient stack space is not indicated with a %NULL + * return like e.g. with malloc(). Instead, most systems probably handle it the same + * way as out of stack space situations from infinite function recursion, i.e. + * with a segmentation fault. + * + * + * - Special care has to be taken when mixing alloca() with GNU C variable sized arrays. + * Stack space allocated with alloca() in the same scope as a variable sized array + * will be freed together with the variable sized array upon exit of that scope, and + * not upon exit of the enclosing function scope. + * + * + * + * Returns: space for @size bytes, allocated on the stack + */ #define g_alloca(size) alloca (size) +/** + * g_newa: + * @struct_type: Type of memory chunks to be allocated + * @n_structs: Number of chunks to be allocated + * + * Wraps g_alloca() in a more typesafe manner. + * + * Returns: Pointer to stack space for @n_structs chunks of type @struct_type + */ #define g_newa(struct_type, n_structs) ((struct_type*) g_alloca (sizeof (struct_type) * (gsize) (n_structs))) #endif /* __G_ALLOCA_H__ */ diff --git a/glib/garray.c b/glib/garray.c index a2bca94..ac9a354 100644 --- a/glib/garray.c +++ b/glib/garray.c @@ -40,7 +40,6 @@ #include "gmessages.h" #include "gqsort.h" -#include "galias.h" /** * SECTION: arrays @@ -693,8 +692,6 @@ g_array_maybe_expand (GRealArray *array, } } -/* Pointer Array - */ /** * SECTION: arrays_pointer * @title: Pointer Arrays @@ -1075,13 +1072,12 @@ g_ptr_array_remove_index_fast (GPtrArray *farray, g_return_val_if_fail (index_ < array->len, NULL); result = array->pdata[index_]; - + + if (array->element_free_func != NULL) + array->element_free_func (array->pdata[index_]); + if (index_ != array->len - 1) - { - if (array->element_free_func != NULL) - array->element_free_func (array->pdata[index_]); - array->pdata[index_] = array->pdata[array->len - 1]; - } + array->pdata[index_] = array->pdata[array->len - 1]; array->len -= 1; @@ -1310,8 +1306,6 @@ g_ptr_array_foreach (GPtrArray *array, (*func) (array->pdata[i], user_data); } -/* Byte arrays - */ /** * SECTION: arrays_byte * @title: Byte Arrays @@ -1591,6 +1585,3 @@ g_byte_array_sort_with_data (GByteArray *array, { g_array_sort_with_data ((GArray *) array, compare_func, user_data); } - -#define __G_ARRAY_C__ -#include "galiasdef.c" diff --git a/glib/gasyncqueue.c b/glib/gasyncqueue.c index 65e95a8..97672e7 100644 --- a/glib/gasyncqueue.c +++ b/glib/gasyncqueue.c @@ -26,15 +26,73 @@ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "gasyncqueue.h" +#include "gmem.h" +#include "gqueue.h" +#include "gtestutils.h" +#include "gthread.h" + +/** + * SECTION: async_queues + * @title: Asynchronous Queues + * @short_description: asynchronous communication between threads + * + * Often you need to communicate between different threads. In general + * it's safer not to do this by shared memory, but by explicit message + * passing. These messages only make sense asynchronously for + * multi-threaded applications though, as a synchronous operation could + * as well be done in the same thread. + * + * Asynchronous queues are an exception from most other GLib data + * structures, as they can be used simultaneously from multiple threads + * without explicit locking and they bring their own builtin reference + * counting. This is because the nature of an asynchronous queue is that + * it will always be used by at least 2 concurrent threads. + * + * For using an asynchronous queue you first have to create one with + * g_async_queue_new(). A newly-created queue will get the reference + * count 1. Whenever another thread is creating a new reference of (that + * is, pointer to) the queue, it has to increase the reference count + * (using g_async_queue_ref()). Also, before removing this reference, + * the reference count has to be decreased (using g_async_queue_unref()). + * After that the queue might no longer exist so you must not access + * it after that point. + * + * A thread, which wants to send a message to that queue simply calls + * g_async_queue_push() to push the message to the queue. + * + * A thread, which is expecting messages from an asynchronous queue + * simply calls g_async_queue_pop() for that queue. If no message is + * available in the queue at that point, the thread is now put to sleep + * until a message arrives. The message will be removed from the queue + * and returned. The functions g_async_queue_try_pop() and + * g_async_queue_timed_pop() can be used to only check for the presence + * of messages or to only wait a certain time for messages respectively. + * + * For almost every function there exist two variants, one that locks + * the queue and one that doesn't. That way you can hold the queue lock + * (acquire it with g_async_queue_lock() and release it with + * g_async_queue_unlock()) over multiple queue accessing instructions. + * This can be necessary to ensure the integrity of the queue, but should + * only be used when really necessary, as it can make your life harder + * if used unwisely. Normally you should only use the locking function + * variants (those without the suffix _unlocked) + */ + +/** + * GAsyncQueue: + * + * The GAsyncQueue struct is an opaque data structure, which represents + * an asynchronous queue. It should only be accessed through the + * g_async_queue_* functions. + */ struct _GAsyncQueue { GMutex *mutex; GCond *cond; - GQueue *queue; + GQueue queue; GDestroyNotify item_free_func; guint waiting_threads; gint32 ref_count; @@ -58,7 +116,7 @@ g_async_queue_new (void) GAsyncQueue* retval = g_new (GAsyncQueue, 1); retval->mutex = g_mutex_new (); retval->cond = NULL; - retval->queue = g_queue_new (); + g_queue_init (&retval->queue); retval->waiting_threads = 0; retval->ref_count = 1; retval->item_free_func = NULL; @@ -170,8 +228,8 @@ g_async_queue_unref (GAsyncQueue *queue) if (queue->cond) g_cond_free (queue->cond); if (queue->item_free_func) - g_queue_foreach (queue->queue, (GFunc) queue->item_free_func, NULL); - g_queue_free (queue->queue); + g_queue_foreach (&queue->queue, (GFunc) queue->item_free_func, NULL); + g_queue_clear (&queue->queue); g_free (queue); } } @@ -242,7 +300,7 @@ g_async_queue_push_unlocked (GAsyncQueue* queue, gpointer data) g_return_if_fail (g_atomic_int_get (&queue->ref_count) > 0); g_return_if_fail (data); - g_queue_push_head (queue->queue, data); + g_queue_push_head (&queue->queue, data); if (queue->waiting_threads > 0) g_cond_signal (queue->cond); } @@ -328,7 +386,7 @@ g_async_queue_push_sorted_unlocked (GAsyncQueue *queue, sd.func = func; sd.user_data = user_data; - g_queue_insert_sorted (queue->queue, + g_queue_insert_sorted (&queue->queue, data, (GCompareDataFunc)g_async_queue_invert_compare, &sd); @@ -343,7 +401,7 @@ g_async_queue_pop_intern_unlocked (GAsyncQueue *queue, { gpointer retval; - if (!g_queue_peek_tail_link (queue->queue)) + if (!g_queue_peek_tail_link (&queue->queue)) { if (try) return NULL; @@ -354,23 +412,23 @@ g_async_queue_pop_intern_unlocked (GAsyncQueue *queue, if (!end_time) { queue->waiting_threads++; - while (!g_queue_peek_tail_link (queue->queue)) + while (!g_queue_peek_tail_link (&queue->queue)) g_cond_wait (queue->cond, queue->mutex); queue->waiting_threads--; } else { queue->waiting_threads++; - while (!g_queue_peek_tail_link (queue->queue)) + while (!g_queue_peek_tail_link (&queue->queue)) if (!g_cond_timed_wait (queue->cond, queue->mutex, end_time)) break; queue->waiting_threads--; - if (!g_queue_peek_tail_link (queue->queue)) + if (!g_queue_peek_tail_link (&queue->queue)) return NULL; } } - retval = g_queue_pop_tail (queue->queue); + retval = g_queue_pop_tail (&queue->queue); g_assert (retval); @@ -541,7 +599,7 @@ g_async_queue_length (GAsyncQueue* queue) g_return_val_if_fail (g_atomic_int_get (&queue->ref_count) > 0, 0); g_mutex_lock (queue->mutex); - retval = queue->queue->length - queue->waiting_threads; + retval = queue->queue.length - queue->waiting_threads; g_mutex_unlock (queue->mutex); return retval; @@ -568,7 +626,7 @@ g_async_queue_length_unlocked (GAsyncQueue* queue) g_return_val_if_fail (queue, 0); g_return_val_if_fail (g_atomic_int_get (&queue->ref_count) > 0, 0); - return queue->queue->length - queue->waiting_threads; + return queue->queue.length - queue->waiting_threads; } /** @@ -644,7 +702,7 @@ g_async_queue_sort_unlocked (GAsyncQueue *queue, sd.func = func; sd.user_data = user_data; - g_queue_sort (queue->queue, + g_queue_sort (&queue->queue, (GCompareDataFunc)g_async_queue_invert_compare, &sd); } @@ -661,6 +719,3 @@ _g_async_queue_get_mutex (GAsyncQueue* queue) return queue->mutex; } - -#define __G_ASYNCQUEUE_C__ -#include "galiasdef.c" diff --git a/glib/gatomic-gcc.c b/glib/gatomic-gcc.c index 7b33b19..9f28cee 100644 --- a/glib/gatomic-gcc.c +++ b/glib/gatomic-gcc.c @@ -20,8 +20,7 @@ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "gatomic.h" gint g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic, @@ -87,6 +86,3 @@ void *atomic = newval; __sync_synchronize (); } - -#define __G_ATOMIC_C__ -#include "galiasdef.c" diff --git a/glib/gatomic.c b/glib/gatomic.c index baa73e7..845c866 100644 --- a/glib/gatomic.c +++ b/glib/gatomic.c @@ -27,9 +27,46 @@ #include #endif -#include "glib.h" +#include "gatomic.h" #include "gthreadprivate.h" -#include "galias.h" + +/** + * SECTION:atomic_operations + * @title: Atomic Operations + * @short_description: basic atomic integer and pointer operations + * @see_also: #GMutex + * + * The following functions can be used to atomically access integers and + * pointers. They are implemented as inline assembler function on most + * platforms and use slower fall-backs otherwise. Using them can sometimes + * save you from using a performance-expensive #GMutex to protect the + * integer or pointer. + * + * The most important usage is reference counting. Using + * g_atomic_int_inc() and g_atomic_int_dec_and_test() makes reference + * counting a very fast operation. + * + * You must not directly read integers or pointers concurrently + * accessed by multiple threads, but use the atomic accessor functions + * instead. That is, always use g_atomic_int_get() and g_atomic_pointer_get() + * for read outs. They provide the neccessary synchonization mechanisms + * like memory barriers to access memory locations concurrently. + * + * + * If you are using those functions for anything apart from + * simple reference counting, you should really be aware of the implications + * of doing that. There are literally thousands of ways to shoot yourself + * in the foot. So if in doubt, use a #GMutex. If you don't know, what + * memory barriers are, do not use anything but g_atomic_int_inc() and + * g_atomic_int_dec_and_test(). + * + * + * It is not safe to set an integer or pointer just by assigning + * to it, when it is concurrently accessed by other threads with the following + * functions. Use g_atomic_int_compare_and_exchange() or + * g_atomic_pointer_compare_and_exchange() respectively. + * + */ #if defined (__GNUC__) # if defined (G_ATOMIC_I486) @@ -847,6 +884,19 @@ g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomi /* We have to use the slow, but safe locking method */ static GMutex *g_atomic_mutex; +/** + * g_atomic_int_exchange_and_add: + * @atomic: a pointer to an integer + * @val: the value to add to *@atomic + * + * Atomically adds @val to the integer pointed to by @atomic. + * It returns the value of *@atomic just before the addition + * took place. Also acts as a memory barrier. + * + * Returns: the value of *@atomic before the addition. + * + * Since: 2.4 + */ gint g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic, gint val) @@ -861,7 +911,16 @@ g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic, return result; } - +/** + * g_atomic_int_add: + * @atomic: a pointer to an integer + * @val: the value to add to *@atomic + * + * Atomically adds @val to the integer pointed to by @atomic. + * Also acts as a memory barrier. + * + * Since: 2.4 + */ void g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic, gint val) @@ -871,6 +930,20 @@ g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic, g_mutex_unlock (g_atomic_mutex); } +/** + * g_atomic_int_compare_and_exchange: + * @atomic: a pointer to an integer + * @oldval: the assumed old value of *@atomic + * @newval: the new value of *@atomic + * + * Compares @oldval with the integer pointed to by @atomic and + * if they are equal, atomically exchanges *@atomic with @newval. + * Also acts as a memory barrier. + * + * Returns: %TRUE, if *@atomic was equal @oldval. %FALSE otherwise. + * + * Since: 2.4 + */ gboolean g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic, gint oldval, @@ -891,6 +964,20 @@ g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic, return result; } +/** + * g_atomic_pointer_compare_and_exchange: + * @atomic: a pointer to a #gpointer + * @oldval: the assumed old value of *@atomic + * @newval: the new value of *@atomic + * + * Compares @oldval with the pointer pointed to by @atomic and + * if they are equal, atomically exchanges *@atomic with @newval. + * Also acts as a memory barrier. + * + * Returns: %TRUE, if *@atomic was equal @oldval. %FALSE otherwise. + * + * Since: 2.4 + */ gboolean g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic, gpointer oldval, @@ -912,6 +999,18 @@ g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomi } #ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED + +/** + * g_atomic_int_get: + * @atomic: a pointer to an integer + * + * Reads the value of the integer pointed to by @atomic. + * Also acts as a memory barrier. + * + * Returns: the value of *@atomic + * + * Since: 2.4 + */ gint (g_atomic_int_get) (volatile gint G_GNUC_MAY_ALIAS *atomic) { @@ -924,6 +1023,16 @@ gint return result; } +/** + * g_atomic_int_set: + * @atomic: a pointer to an integer + * @newval: the new value + * + * Sets the value of the integer pointed to by @atomic. + * Also acts as a memory barrier. + * + * Since: 2.10 + */ void (g_atomic_int_set) (volatile gint G_GNUC_MAY_ALIAS *atomic, gint newval) @@ -933,6 +1042,17 @@ void g_mutex_unlock (g_atomic_mutex); } +/** + * g_atomic_pointer_get: + * @atomic: a pointer to a #gpointer. + * + * Reads the value of the pointer pointed to by @atomic. + * Also acts as a memory barrier. + * + * Returns: the value to add to *@atomic. + * + * Since: 2.4 + */ gpointer (g_atomic_pointer_get) (volatile gpointer G_GNUC_MAY_ALIAS *atomic) { @@ -945,6 +1065,16 @@ gpointer return result; } +/** + * g_atomic_pointer_set: + * @atomic: a pointer to a #gpointer + * @newval: the new value + * + * Sets the value of the pointer pointed to by @atomic. + * Also acts as a memory barrier. + * + * Since: 2.10 + */ void (g_atomic_pointer_set) (volatile gpointer G_GNUC_MAY_ALIAS *atomic, gpointer newval) @@ -1053,6 +1183,3 @@ void g_atomic_pointer_set (atomic, newval); } #endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */ - -#define __G_ATOMIC_C__ -#include "galiasdef.c" diff --git a/glib/gatomic.h b/glib/gatomic.h index 7d9c318..ddd39b8 100644 --- a/glib/gatomic.h +++ b/glib/gatomic.h @@ -64,20 +64,40 @@ void g_atomic_pointer_set (volatile gpointer G_GNUC_MAY_ALI #else # define g_atomic_int_get(atomic) \ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \ - (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (void *) (atomic))) + (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *) (atomic))) # define g_atomic_int_set(atomic, newval) \ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \ - (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (void *) (atomic), (newval))) + (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval))) # define g_atomic_pointer_get(atomic) \ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \ - (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void *) (atomic))) + (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic))) # define g_atomic_pointer_set(atomic, newval) \ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \ - (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void *) (atomic), (newval))) + (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval))) #endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */ +/** + * g_atomic_int_inc: + * @atomic: a pointer to an integer. + * + * Atomically increments the integer pointed to by @atomic by 1. + * + * Since: 2.4 + */ #define g_atomic_int_inc(atomic) (g_atomic_int_add ((atomic), 1)) -#define g_atomic_int_dec_and_test(atomic) \ + +/** + * g_atomic_int_dec_and_test: + * @atomic: a pointer to an integer + * + * Atomically decrements the integer pointed to by @atomic by 1. + * + * Returns: %TRUE if the integer pointed to by @atomic is 0 + * after decrementing it + * + * Since: 2.4 + */ +#define g_atomic_int_dec_and_test(atomic) \ (g_atomic_int_exchange_and_add ((atomic), -1) == 1) G_END_DECLS diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index 238d9cf..ae16ef8 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -21,22 +21,21 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* - * MT safe ; except for g_on_error_stack_trace, but who wants thread safety +/* + * MT safe ; except for g_on_error_stack_trace, but who wants thread safety * then */ #include "config.h" +#include "glibconfig.h" #include #include #include #include -#include "glib.h" -#include "gprintfint.h" #ifdef HAVE_SYS_TIME_H #include @@ -61,12 +60,19 @@ #include /* for bzero on BSD systems */ #ifdef G_OS_WIN32 -# define STRICT /* Strict typing, please */ +# define STRICT /* Strict typing, please */ # define _WIN32_WINDOWS 0x0401 /* to get IsDebuggerPresent */ # include # undef STRICT #endif +#include "gbacktrace.h" + +#include "gtypes.h" +#include "gmain.h" +#include "gprintfint.h" + + #ifndef NO_FD_SET # define SELECT_MASK fd_set #else @@ -77,7 +83,6 @@ # endif #endif -#include "galias.h" #ifndef G_OS_WIN32 static void stack_trace (char **args); @@ -97,27 +102,27 @@ g_on_error_query (const gchar *prg_name) if (!prg_name) prg_name = g_get_prgname (); - + retry: - + if (prg_name) _g_fprintf (stdout, - "%s (pid:%u): %s%s%s: ", - prg_name, - (guint) getpid (), - query1, - query2, - query3); + "%s (pid:%u): %s%s%s: ", + prg_name, + (guint) getpid (), + query1, + query2, + query3); else _g_fprintf (stdout, - "(process:%u): %s%s: ", - (guint) getpid (), - query1, - query3); + "(process:%u): %s%s: ", + (guint) getpid (), + query1, + query3); fflush (stdout); - + if (isatty(0) && isatty(1)) - fgets (buf, 8, stdin); + fgets (buf, 8, stdin); else strcpy (buf, "E\n"); @@ -125,20 +130,20 @@ g_on_error_query (const gchar *prg_name) && buf[1] == '\n') _exit (0); else if ((buf[0] == 'P' || buf[0] == 'p') - && buf[1] == '\n') + && buf[1] == '\n') return; else if (prg_name - && (buf[0] == 'S' || buf[0] == 's') - && buf[1] == '\n') + && (buf[0] == 'S' || buf[0] == 's') + && buf[1] == '\n') { g_on_error_stack_trace (prg_name); goto retry; } else if ((buf[0] == 'H' || buf[0] == 'h') - && buf[1] == '\n') + && buf[1] == '\n') { while (glib_on_error_halt) - ; + ; glib_on_error_halt = TRUE; return; } @@ -147,10 +152,10 @@ g_on_error_query (const gchar *prg_name) #else if (!prg_name) prg_name = g_get_prgname (); - + MessageBox (NULL, "g_on_error_query called, program terminating", - (prg_name && *prg_name) ? prg_name : NULL, - MB_OK|MB_ICONERROR); + (prg_name && *prg_name) ? prg_name : NULL, + MB_OK|MB_ICONERROR); _exit(0); #endif } @@ -303,6 +308,3 @@ stack_trace (char **args) } #endif /* !G_OS_WIN32 */ - -#define __G_BACKTRACE_C__ -#include "galiasdef.c" diff --git a/glib/gbacktrace.h b/glib/gbacktrace.h index 2e74b49..43a0c46 100644 --- a/glib/gbacktrace.h +++ b/glib/gbacktrace.h @@ -52,16 +52,16 @@ void g_on_error_stack_trace (const gchar *prg_name); * Actual use is strongly discouraged of course ;) */ #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2 -# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END +# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END #elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86) -# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END +# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END #elif defined (_MSC_VER) -# define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END +# define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END #elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2 -# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END -#else /* !__i386__ && !__alpha__ */ -# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END -#endif /* __i386__ */ +# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END +#else /* !__i386__ && !__alpha__ */ +# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END +#endif /* __i386__ */ G_END_DECLS diff --git a/glib/gbase64.c b/glib/gbase64.c index 59a911a..8a492de 100644 --- a/glib/gbase64.c +++ b/glib/gbase64.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -28,13 +28,13 @@ #include #include "gbase64.h" -#include "glib.h" +#include "gtestutils.h" #include "glibintl.h" -#include "galias.h" /** - * SECTION:base64 Base64 Encoding + * SECTION:base64 + * @title: Base64 Encoding * @short_description: encodes and decodes data in Base64 format * * Base64 is an encoding that allows a sequence of arbitrary bytes to be @@ -54,7 +54,7 @@ */ static const char base64_alphabet[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * g_base64_encode_step: @@ -66,10 +66,10 @@ static const char base64_alphabet[] = * @save: Saved state between steps, initialize to 0 * * Incrementally encode a sequence of binary data into its Base-64 stringified - * representation. By calling this function multiple times you can convert + * representation. By calling this function multiple times you can convert * data in chunks to avoid having to have the full encoded data in memory. * - * When all of the data has been converted you must call + * When all of the data has been converted you must call * g_base64_encode_close() to flush the saved state. * * The output buffer must be large enough to fit all the data that will @@ -79,7 +79,7 @@ static const char base64_alphabet[] = * ((@len / 3 + 1) * 4 + 4) / 72 + 1 bytes of extra space. * * @break_lines is typically used when putting base64-encoded data in emails. - * It breaks the lines at 72 columns instead of putting all of the text on + * It breaks the lines at 72 columns instead of putting all of the text on * the same line. This avoids problems with long lines in the email system. * * Return value: The number of bytes of output that was written @@ -87,16 +87,16 @@ static const char base64_alphabet[] = * Since: 2.12 */ gsize -g_base64_encode_step (const guchar *in, - gsize len, - gboolean break_lines, - gchar *out, - gint *state, - gint *save) +g_base64_encode_step (const guchar *in, + gsize len, + gboolean break_lines, + gchar *out, + gint *state, + gint *save) { char *outptr; const guchar *inptr; - + g_return_val_if_fail (in != NULL, 0); g_return_val_if_fail (out != NULL, 0); g_return_val_if_fail (state != NULL, 0); @@ -104,75 +104,75 @@ g_base64_encode_step (const guchar *in, if (len <= 0) return 0; - + inptr = in; outptr = out; - + if (len + ((char *) save) [0] > 2) { const guchar *inend = in+len-2; int c1, c2, c3; int already; - + already = *state; - + switch (((char *) save) [0]) - { - case 1: - c1 = ((unsigned char *) save) [1]; + { + case 1: + c1 = ((unsigned char *) save) [1]; goto skip1; - case 2: + case 2: c1 = ((unsigned char *) save) [1]; - c2 = ((unsigned char *) save) [2]; + c2 = ((unsigned char *) save) [2]; goto skip2; - } - - /* - * yes, we jump into the loop, no i'm not going to change it, - * it's beautiful! + } + + /* + * yes, we jump into the loop, no i'm not going to change it, + * it's beautiful! */ while (inptr < inend) - { - c1 = *inptr++; - skip1: - c2 = *inptr++; - skip2: - c3 = *inptr++; - *outptr++ = base64_alphabet [ c1 >> 2 ]; - *outptr++ = base64_alphabet [ c2 >> 4 | - ((c1&0x3) << 4) ]; - *outptr++ = base64_alphabet [ ((c2 &0x0f) << 2) | - (c3 >> 6) ]; - *outptr++ = base64_alphabet [ c3 & 0x3f ]; - /* this is a bit ugly ... */ - if (break_lines && (++already) >= 19) - { - *outptr++ = '\n'; - already = 0; - } - } - + { + c1 = *inptr++; + skip1: + c2 = *inptr++; + skip2: + c3 = *inptr++; + *outptr++ = base64_alphabet [ c1 >> 2 ]; + *outptr++ = base64_alphabet [ c2 >> 4 | + ((c1&0x3) << 4) ]; + *outptr++ = base64_alphabet [ ((c2 &0x0f) << 2) | + (c3 >> 6) ]; + *outptr++ = base64_alphabet [ c3 & 0x3f ]; + /* this is a bit ugly ... */ + if (break_lines && (++already) >= 19) + { + *outptr++ = '\n'; + already = 0; + } + } + ((char *)save)[0] = 0; len = 2 - (inptr - inend); *state = already; } - + if (len>0) { char *saveout; - + /* points to the slot for the next char to save */ saveout = & (((char *)save)[1]) + ((char *)save)[0]; - + /* len can only be 0 1 or 2 */ switch(len) - { - case 2: *saveout++ = *inptr++; - case 1: *saveout++ = *inptr++; - } + { + case 2: *saveout++ = *inptr++; + case 1: *saveout++ = *inptr++; + } ((char *)save)[0] += len; } - + return outptr - out; } @@ -195,9 +195,9 @@ g_base64_encode_step (const guchar *in, */ gsize g_base64_encode_close (gboolean break_lines, - gchar *out, - gint *state, - gint *save) + gchar *out, + gint *state, + gint *save) { int c1, c2; char *outptr = out; @@ -208,7 +208,7 @@ g_base64_encode_close (gboolean break_lines, c1 = ((unsigned char *) save) [1]; c2 = ((unsigned char *) save) [2]; - + switch (((char *) save) [0]) { case 2: @@ -226,10 +226,10 @@ g_base64_encode_close (gboolean break_lines, } if (break_lines) *outptr++ = '\n'; - + *save = 0; *state = 0; - + return outptr - out; } @@ -242,21 +242,20 @@ g_base64_encode_close (gboolean break_lines, * representation. * * Return value: a newly allocated, zero-terminated Base-64 encoded - * string representing @data. The returned string must + * string representing @data. The returned string must * be freed with g_free(). * * Since: 2.12 */ gchar * -g_base64_encode (const guchar *data, +g_base64_encode (const guchar *data, gsize len) { gchar *out; gint state = 0, outlen; gint save = 0; - g_return_val_if_fail (data != NULL, NULL); - g_return_val_if_fail (len > 0, NULL); + g_return_val_if_fail (data != NULL || len == 0, NULL); /* We can use a smaller limit here, since we know the saved state is 0, +1 is needed for trailing \0, also check for unlikely integer overflow */ @@ -293,7 +292,7 @@ static const unsigned char mime_base64_rank[256] = { }; /** - * g_base64_decode_step: + * g_base64_decode_step: * @in: binary input data * @len: max length of @in data to decode * @out: output buffer @@ -301,24 +300,24 @@ static const unsigned char mime_base64_rank[256] = { * @save: Saved state between steps, initialize to 0 * * Incrementally decode a sequence of binary data from its Base-64 stringified - * representation. By calling this function multiple times you can convert + * representation. By calling this function multiple times you can convert * data in chunks to avoid having to have the full encoded data in memory. * * The output buffer must be large enough to fit all the data that will * be written to it. Since base64 encodes 3 bytes in 4 chars you need * at least: (@len / 4) * 3 + 3 bytes (+ 3 may be needed in case of non-zero * state). - * + * * Return value: The number of bytes of output that was written * * Since: 2.12 **/ gsize -g_base64_decode_step (const gchar *in, - gsize len, - guchar *out, - gint *state, - guint *save) +g_base64_decode_step (const gchar *in, + gsize len, + guchar *out, + gint *state, + guint *save) { const guchar *inptr; guchar *outptr; @@ -335,10 +334,10 @@ g_base64_decode_step (const gchar *in, if (len <= 0) return 0; - + inend = (const guchar *)in+len; outptr = out; - + /* convert 4 base64 bytes to 3 normal bytes */ v=*save; i=*state; @@ -349,26 +348,26 @@ g_base64_decode_step (const gchar *in, c = *inptr++; rank = mime_base64_rank [c]; if (rank != 0xff) - { - last[1] = last[0]; - last[0] = c; - v = (v<<6) | rank; - i++; - if (i==4) - { - *outptr++ = v>>16; - if (last[1] != '=') - *outptr++ = v>>8; - if (last[0] != '=') - *outptr++ = v; - i=0; - } - } + { + last[1] = last[0]; + last[0] = c; + v = (v<<6) | rank; + i++; + if (i==4) + { + *outptr++ = v>>16; + if (last[1] != '=') + *outptr++ = v>>8; + if (last[0] != '=') + *outptr++ = v; + i=0; + } + } } - + *save = v; *state = i; - + return outptr - out; } @@ -387,29 +386,27 @@ g_base64_decode_step (const gchar *in, */ guchar * g_base64_decode (const gchar *text, - gsize *out_len) + gsize *out_len) { guchar *ret; gsize input_length; gint state = 0; guint save = 0; - + g_return_val_if_fail (text != NULL, NULL); g_return_val_if_fail (out_len != NULL, NULL); input_length = strlen (text); - g_return_val_if_fail (input_length > 1, NULL); - /* We can use a smaller limit here, since we know the saved state is 0, +1 used to avoid calling g_malloc0(0), and hence retruning NULL */ ret = g_malloc0 ((input_length / 4) * 3 + 1); - + *out_len = g_base64_decode_step (text, input_length, ret, &state, &save); - - return ret; + + return ret; } - + /** * g_base64_decode_inplace: * @text: zero-terminated string with base64 text to decode @@ -429,7 +426,7 @@ g_base64_decode_inplace (gchar *text, { gint input_length, state = 0; guint save = 0; - + g_return_val_if_fail (text != NULL, NULL); g_return_val_if_fail (out_len != NULL, NULL); @@ -438,10 +435,6 @@ g_base64_decode_inplace (gchar *text, g_return_val_if_fail (input_length > 1, NULL); *out_len = g_base64_decode_step (text, input_length, (guchar *) text, &state, &save); - - return (guchar *) text; -} - -#define __G_BASE64_C__ -#include "galiasdef.c" + return (guchar *) text; +} diff --git a/glib/gbase64.h b/glib/gbase64.h index 2f7c49f..930389a 100644 --- a/glib/gbase64.h +++ b/glib/gbase64.h @@ -9,7 +9,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -29,27 +29,27 @@ G_BEGIN_DECLS -gsize g_base64_encode_step (const guchar *in, - gsize len, - gboolean break_lines, - gchar *out, - gint *state, - gint *save); -gsize g_base64_encode_close (gboolean break_lines, - gchar *out, - gint *state, - gint *save); -gchar* g_base64_encode (const guchar *data, - gsize len) G_GNUC_MALLOC; -gsize g_base64_decode_step (const gchar *in, - gsize len, - guchar *out, - gint *state, - guint *save); -guchar *g_base64_decode (const gchar *text, - gsize *out_len) G_GNUC_MALLOC; -guchar *g_base64_decode_inplace (gchar *text, - gsize *out_len); +gsize g_base64_encode_step (const guchar *in, + gsize len, + gboolean break_lines, + gchar *out, + gint *state, + gint *save); +gsize g_base64_encode_close (gboolean break_lines, + gchar *out, + gint *state, + gint *save); +gchar* g_base64_encode (const guchar *data, + gsize len) G_GNUC_MALLOC; +gsize g_base64_decode_step (const gchar *in, + gsize len, + guchar *out, + gint *state, + guint *save); +guchar *g_base64_decode (const gchar *text, + gsize *out_len) G_GNUC_MALLOC; +guchar *g_base64_decode_inplace (gchar *text, + gsize *out_len); G_END_DECLS diff --git a/glib/gbitlock.c b/glib/gbitlock.c index 915aa7c..1b8c417 100644 --- a/glib/gbitlock.c +++ b/glib/gbitlock.c @@ -29,7 +29,6 @@ #include "gthreadprivate.h" #include "config.h" -#include "galias.h" #ifdef G_BIT_LOCK_FORCE_FUTEX_EMULATION #undef HAVE_FUTEX @@ -295,6 +294,3 @@ g_bit_unlock (volatile gint *address, if (g_atomic_int_get (&g_bit_lock_contended[class])) g_futex_wake (address); } - -#define __G_BITLOCK_C__ -#include "galiasdef.c" diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c index 01c7e63..db2a8bc 100644 --- a/glib/gbookmarkfile.c +++ b/glib/gbookmarkfile.c @@ -55,7 +55,50 @@ #include "gtimer.h" #include "gutils.h" -#include "galias.h" + +/** + * SECTION:bookmarkfile + * @title: Bookmark file parser + * @short_description: parses files containing bookmarks + * + * GBookmarkFile lets you parse, edit or create files containing bookmarks + * to URI, along with some meta-data about the resource pointed by the URI + * like its MIME type, the application that is registering the bookmark and + * the icon that should be used to represent the bookmark. The data is stored + * using the + * Desktop Bookmark + * Specification. + * + * The syntax of the bookmark files is described in detail inside the Desktop + * Bookmark Specification, here is a quick summary: bookmark files use a + * sub-class of the XML Bookmark Exchange Language + * specification, consisting of valid UTF-8 encoded XML, under the + * xbel root element; each bookmark is stored inside a + * bookmark element, using its URI: no relative paths can + * be used inside a bookmark file. The bookmark may have a user defined title + * and description, to be used instead of the URI. Under the + * metadata element, with its owner + * attribute set to http://freedesktop.org, is stored the + * meta-data about a resource pointed by its URI. The meta-data consists of + * the resource's MIME type; the applications that have registered a bookmark; + * the groups to which a bookmark belongs to; a visibility flag, used to set + * the bookmark as "private" to the applications and groups that has it + * registered; the URI and MIME type of an icon, to be used when displaying + * the bookmark inside a GUI. + * |[FIXME: MISSING XINCLUDE CONTENT]| + * + * A bookmark file might contain more than one bookmark; each bookmark + * is accessed through its URI. + * + * The important caveat of bookmark files is that when you add a new + * bookmark you must also add the application that is registering it, using + * g_bookmark_file_add_application() or g_bookmark_file_set_app_info(). + * If a bookmark has no applications then it won't be dumped when creating + * the on disk representation, using g_bookmark_file_to_data() or + * g_bookmark_file_to_file(). + * + * The #GBookmarkFile parser was added in GLib 2.12. + */ /* XBEL 1.0 standard entities */ #define XBEL_VERSION "1.0" @@ -1650,9 +1693,7 @@ g_bookmark_file_load_from_data (GBookmarkFile *bookmark, gboolean retval; g_return_val_if_fail (bookmark != NULL, FALSE); - g_return_val_if_fail (data != NULL, FALSE); - g_return_val_if_fail (length != 0, FALSE); - + if (length == (gsize) -1) length = strlen (data); @@ -1661,7 +1702,7 @@ g_bookmark_file_load_from_data (GBookmarkFile *bookmark, g_bookmark_file_clear (bookmark); g_bookmark_file_init (bookmark); } - + parse_error = NULL; retval = g_bookmark_file_parse (bookmark, data, length, &parse_error); if (!retval) @@ -3704,6 +3745,3 @@ g_bookmark_file_get_icon (GBookmarkFile *bookmark, return TRUE; } - -#define __G_BOOKMARK_FILE_C__ -#include "galiasdef.c" diff --git a/glib/gbookmarkfile.h b/glib/gbookmarkfile.h index bdf97c0..f663ebf 100644 --- a/glib/gbookmarkfile.h +++ b/glib/gbookmarkfile.h @@ -29,10 +29,31 @@ G_BEGIN_DECLS -/* GError enumeration +/** + * G_BOOKMARK_FILE_ERROR: + * + * Error domain for bookmark file parsing. + * Errors in this domain will be from the #GBookmarkFileError + * enumeration. See #GError for information on error domains. */ #define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ()) + +/** + * GBookmarkFileError: + * @G_BOOKMARK_FILE_ERROR_INVALID_URI: URI was ill-formed + * @G_BOOKMARK_FILE_ERROR_INVALID_VALUE: a requested field was not found + * @G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED: a requested application did + * not register a bookmark + * @G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND: a requested URI was not found + * @G_BOOKMARK_FILE_ERROR_READ: document was ill formed + * @G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING: the text being parsed was + * in an unknown encoding + * @G_BOOKMARK_FILE_ERROR_WRITE: an error occurred while writing + * @G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND: requested file was not found + * + * Error codes returned by bookmark file parsing. + */ typedef enum { G_BOOKMARK_FILE_ERROR_INVALID_URI, @@ -47,8 +68,11 @@ typedef enum GQuark g_bookmark_file_error_quark (void); -/* - * GBookmarkFile +/** + * GBookmarkFile: + * + * The GBookmarkFile struct contains only + * private data and should not be directly accessed. */ typedef struct _GBookmarkFile GBookmarkFile; diff --git a/glib/gbuffer.c b/glib/gbuffer.c index 4eb83df..f7e3044 100644 --- a/glib/gbuffer.c +++ b/glib/gbuffer.c @@ -27,7 +27,6 @@ #include #include -#include "galias.h" typedef struct { @@ -138,7 +137,7 @@ g_buffer_free_usernotify (GBuffer *buffer) GUserNotifyBuffer *ubuffer = (GUserNotifyBuffer *) buffer; ubuffer->user_destroy (ubuffer->user_data); - g_slice_free (GBuffer, buffer); + g_slice_free (GUserNotifyBuffer, ubuffer); } /* < private > diff --git a/glib/gcache.c b/glib/gcache.c index 9c69122..6a6163c 100644 --- a/glib/gcache.c +++ b/glib/gcache.c @@ -21,17 +21,19 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "gcache.h" + +#include "ghash.h" +#include "gtestutils.h" /** * SECTION: caches @@ -157,12 +159,12 @@ g_cache_node_destroy (GCacheNode *node) **/ GCache* g_cache_new (GCacheNewFunc value_new_func, - GCacheDestroyFunc value_destroy_func, - GCacheDupFunc key_dup_func, - GCacheDestroyFunc key_destroy_func, - GHashFunc hash_key_func, - GHashFunc hash_value_func, - GEqualFunc key_equal_func) + GCacheDestroyFunc value_destroy_func, + GCacheDupFunc key_dup_func, + GCacheDestroyFunc key_destroy_func, + GHashFunc hash_key_func, + GHashFunc hash_value_func, + GEqualFunc key_equal_func) { GCache *cache; @@ -221,7 +223,7 @@ g_cache_destroy (GCache *cache) **/ gpointer g_cache_insert (GCache *cache, - gpointer key) + gpointer key) { GCacheNode *node; gpointer value; @@ -256,7 +258,7 @@ g_cache_insert (GCache *cache, **/ void g_cache_remove (GCache *cache, - gconstpointer value) + gconstpointer value) { GCacheNode *node; gpointer key; @@ -295,8 +297,8 @@ g_cache_remove (GCache *cache, **/ void g_cache_key_foreach (GCache *cache, - GHFunc func, - gpointer user_data) + GHFunc func, + gpointer user_data) { g_return_if_fail (cache != NULL); g_return_if_fail (func != NULL); @@ -318,14 +320,11 @@ g_cache_key_foreach (GCache *cache, **/ void g_cache_value_foreach (GCache *cache, - GHFunc func, - gpointer user_data) + GHFunc func, + gpointer user_data) { g_return_if_fail (cache != NULL); g_return_if_fail (func != NULL); g_hash_table_foreach (cache->key_table, func, user_data); } - -#define __G_CACHE_C__ -#include "galiasdef.c" diff --git a/glib/gcache.h b/glib/gcache.h index 283783d..7d60d58 100644 --- a/glib/gcache.h +++ b/glib/gcache.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public diff --git a/glib/gchecksum.c b/glib/gchecksum.c index ad90727..b0d10c1 100644 --- a/glib/gchecksum.c +++ b/glib/gchecksum.c @@ -22,12 +22,14 @@ #include -#include "glibconfig.h" #include "gchecksum.h" -#include "glib.h" + +#include "gmem.h" +#include "gstrfuncs.h" +#include "gtestutils.h" +#include "gtypes.h" #include "glibintl.h" -#include "galias.h" /** * SECTION: checksum @@ -63,7 +65,7 @@ typedef struct { guint32 buf[4]; guint32 bits[2]; - + guchar data[MD5_DATASIZE]; guchar digest[MD5_DIGEST_LEN]; @@ -209,9 +211,9 @@ md5_sum_init (Md5sum *md5) * reflect the addition of 16 longwords of new data. md5_sum_update() * blocks the data and converts bytes into longwords for this routine. */ -static void -md5_transform (guint32 buf[4], - guint32 const in[16]) +static void +md5_transform (guint32 buf[4], + guint32 const in[16]) { register guint32 a, b, c, d; @@ -223,7 +225,7 @@ md5_transform (guint32 buf[4], /* This is the central step in the MD5 algorithm. */ #define md5_step(f, w, x, y, z, data, s) \ - ( w += f (x, y, z) + data, w = w << s | w >> (32 - s), w += x ) + ( w += f (x, y, z) + data, w = w << s | w >> (32 - s), w += x ) a = buf[0]; b = buf[1]; @@ -246,7 +248,7 @@ md5_transform (guint32 buf[4], md5_step (F1, d, a, b, c, in[13] + 0xfd987193, 12); md5_step (F1, c, d, a, b, in[14] + 0xa679438e, 17); md5_step (F1, b, c, d, a, in[15] + 0x49b40821, 22); - + md5_step (F2, a, b, c, d, in[1] + 0xf61e2562, 5); md5_step (F2, d, a, b, c, in[6] + 0xc040b340, 9); md5_step (F2, c, d, a, b, in[11] + 0x265e5a51, 14); @@ -342,7 +344,7 @@ md5_sum_update (Md5sum *md5, } memcpy (p, data, bit); - + md5_byte_reverse (md5->data, 16); md5_transform (md5->buf, (guint32 *) md5->data); @@ -354,7 +356,7 @@ md5_sum_update (Md5sum *md5, while (length >= MD5_DATASIZE) { memcpy (md5->data, data, MD5_DATASIZE); - + md5_byte_reverse (md5->data, 16); md5_transform (md5->buf, (guint32 *) md5->data); @@ -390,7 +392,7 @@ md5_sum_close (Md5sum *md5) { /* Two lots of padding: Pad the first block to 64 bytes */ memset (p, 0, count); - + md5_byte_reverse (md5->data, 16); md5_transform (md5->buf, (guint32 *) md5->data); @@ -411,7 +413,7 @@ md5_sum_close (Md5sum *md5) md5_transform (md5->buf, (guint32 *) md5->data); md5_byte_reverse ((guchar *) md5->buf, 4); - + memcpy (md5->digest, md5->buf, 16); /* Reset buffers in case they contain sensitive data */ @@ -603,7 +605,7 @@ sha1_transform (guint32 buf[5], subRound (D, E, A, B, C, f2, K2, expand (in, 37)); subRound (C, D, E, A, B, f2, K2, expand (in, 38)); subRound (B, C, D, E, A, f2, K2, expand (in, 39)); - + subRound (A, B, C, D, E, f3, K3, expand (in, 40)); subRound (E, A, B, C, D, f3, K3, expand (in, 41)); subRound (D, E, A, B, C, f3, K3, expand (in, 42)); @@ -694,7 +696,7 @@ sha1_sum_update (Sha1sum *sha1, memcpy (p, buffer, count); return; } - + memcpy (p, buffer, dataCount); sha_byte_reverse (sha1->data, SHA1_DATASIZE); @@ -708,7 +710,7 @@ sha1_sum_update (Sha1sum *sha1, while (count >= SHA1_DATASIZE) { memcpy (sha1->data, buffer, SHA1_DATASIZE); - + sha_byte_reverse (sha1->data, SHA1_DATASIZE); sha1_transform (sha1->buf, sha1->data); @@ -1076,7 +1078,7 @@ sha256_sum_digest (Sha256sum *sha256, * * Return value: the checksum length, or -1 if @checksum_type is * not supported. - * + * * Since: 2.16 */ gssize @@ -1107,7 +1109,7 @@ g_checksum_type_get_length (GChecksumType checksum_type) * g_checksum_new: * @checksum_type: the desired type of checksum * - * Creates a new #GChecksum, using the checksum algorithm @checksum_type. + * Creates a new #GChecksum, using the checksum algorithm @checksum_type. * If the @checksum_type is not known, %NULL is returned. * A #GChecksum can be used to compute the checksum, or digest, of an * arbitrary binary blob, using different hashing algorithms. @@ -1121,7 +1123,7 @@ g_checksum_type_get_length (GChecksumType checksum_type) * will be closed and it won't be possible to call g_checksum_update() * on it anymore. * - * Return value: the newly created #GChecksum, or %NULL. + * Return value: the newly created #GChecksum, or %NULL. * Use g_checksum_free() to free the memory allocated by it. * * Since: 2.16 @@ -1240,7 +1242,7 @@ g_checksum_update (GChecksum *checksum, gssize length) { g_return_if_fail (checksum != NULL); - g_return_if_fail (data != NULL); + g_return_if_fail (length == 0 || data != NULL); if (length < 0) length = strlen ((const gchar *) data); @@ -1278,13 +1280,13 @@ g_checksum_update (GChecksum *checksum, * * Once this function has been called the #GChecksum can no longer be * updated with g_checksum_update(). - * - * The hexadecimal characters will be lower case. + * + * The hexadecimal characters will be lower case. * * Return value: the hexadecimal representation of the checksum. The * returned string is owned by the checksum and should not be modified * or freed. - * + * * Since: 2.16 */ G_CONST_RETURN gchar * @@ -1293,7 +1295,7 @@ g_checksum_get_string (GChecksum *checksum) gchar *str = NULL; g_return_val_if_fail (checksum != NULL, NULL); - + if (checksum->digest_str) return checksum->digest_str; @@ -1398,7 +1400,7 @@ g_checksum_get_digest (GChecksum *checksum, * Computes the checksum for a binary @data of @length. This is a * convenience wrapper for g_checksum_new(), g_checksum_get_string() * and g_checksum_free(). - * + * * The hexadecimal string returned will be in lower case. * * Return value: the digest of the binary data as a string in hexadecimal. @@ -1415,7 +1417,7 @@ g_compute_checksum_for_data (GChecksumType checksum_type, gchar *retval; g_return_val_if_fail (IS_VALID_TYPE (checksum_type), NULL); - g_return_val_if_fail (data != NULL, NULL); + g_return_val_if_fail (length == 0 || data != NULL, NULL); checksum = g_checksum_new (checksum_type); if (!checksum) @@ -1435,7 +1437,7 @@ g_compute_checksum_for_data (GChecksumType checksum_type, * @length: the length of the string, or -1 if the string is null-terminated. * * Computes the checksum of a string. - * + * * The hexadecimal string returned will be in lower case. * * Return value: the checksum as a hexadecimal string. The returned string @@ -1449,13 +1451,10 @@ g_compute_checksum_for_string (GChecksumType checksum_type, gssize length) { g_return_val_if_fail (IS_VALID_TYPE (checksum_type), NULL); - g_return_val_if_fail (str != NULL, NULL); + g_return_val_if_fail (length == 0 || str != NULL, NULL); if (length < 0) length = strlen (str); return g_compute_checksum_for_data (checksum_type, (const guchar *) str, length); } - -#define __G_CHECKSUM_C__ -#include "galiasdef.c" diff --git a/glib/gchecksum.h b/glib/gchecksum.h index 03f1e86..57aea10 100644 --- a/glib/gchecksum.h +++ b/glib/gchecksum.h @@ -38,8 +38,8 @@ G_BEGIN_DECLS * The hashing algorithm to be used by #GChecksum when performing the * digest of some data. * - * Note that the #GChecksumType enumeration may be extended at a later - * date to include new hashing algorithm types. + * Note that the #GChecksumType enumeration may be extended at a later + * date to include new hashing algorithm types. * * Since: 2.16 */ @@ -60,26 +60,26 @@ typedef enum { */ typedef struct _GChecksum GChecksum; -gssize g_checksum_type_get_length (GChecksumType checksum_type); +gssize g_checksum_type_get_length (GChecksumType checksum_type); -GChecksum * g_checksum_new (GChecksumType checksum_type); -void g_checksum_reset (GChecksum *checksum); -GChecksum * g_checksum_copy (const GChecksum *checksum); -void g_checksum_free (GChecksum *checksum); -void g_checksum_update (GChecksum *checksum, - const guchar *data, - gssize length); -G_CONST_RETURN gchar *g_checksum_get_string (GChecksum *checksum); -void g_checksum_get_digest (GChecksum *checksum, - guint8 *buffer, - gsize *digest_len); +GChecksum * g_checksum_new (GChecksumType checksum_type); +void g_checksum_reset (GChecksum *checksum); +GChecksum * g_checksum_copy (const GChecksum *checksum); +void g_checksum_free (GChecksum *checksum); +void g_checksum_update (GChecksum *checksum, + const guchar *data, + gssize length); +G_CONST_RETURN gchar *g_checksum_get_string (GChecksum *checksum); +void g_checksum_get_digest (GChecksum *checksum, + guint8 *buffer, + gsize *digest_len); -gchar *g_compute_checksum_for_data (GChecksumType checksum_type, - const guchar *data, - gsize length); -gchar *g_compute_checksum_for_string (GChecksumType checksum_type, - const gchar *str, - gssize length); +gchar *g_compute_checksum_for_data (GChecksumType checksum_type, + const guchar *data, + gsize length); +gchar *g_compute_checksum_for_string (GChecksumType checksum_type, + const gchar *str, + gssize length); G_END_DECLS diff --git a/glib/gcompletion.c b/glib/gcompletion.c index 904f850..710e6c0 100644 --- a/glib/gcompletion.c +++ b/glib/gcompletion.c @@ -32,8 +32,13 @@ #include -#include "glib.h" -#include "galias.h" +#include "gstrfuncs.h" +#include "gmessages.h" +#include "gunicode.h" + +#undef G_DISABLE_DEPRECATED + +#include "gcompletion.h" /** * SECTION: completion @@ -58,6 +63,9 @@ * retrieves the item's string from the data structure. You can change * the way in which strings are compared by setting a different * #GCompletionStrncmpFunc in g_completion_set_compare(). + * + * GCompletion has been marked as deprecated, since this API is rarely + * used and not very actively maintained. **/ /** @@ -132,6 +140,8 @@ g_completion_new (GCompletionFunc func) * @items: the list of items to add. * * Adds items to the #GCompletion. + * + * Deprecated: 2.26: Rarely used API **/ void g_completion_add_items (GCompletion* cmp, @@ -168,6 +178,8 @@ g_completion_add_items (GCompletion* cmp, * @items: the items to remove. * * Removes items from a #GCompletion. + * + * Deprecated: 2.26: Rarely used API **/ void g_completion_remove_items (GCompletion* cmp, @@ -197,6 +209,8 @@ g_completion_remove_items (GCompletion* cmp, * @cmp: the #GCompletion. * * Removes all items from the #GCompletion. + * + * Deprecated: 2.26: Rarely used API **/ void g_completion_clear_items (GCompletion* cmp) @@ -276,6 +290,8 @@ completion_check_cache (GCompletion* cmp, * not be changed. * * Since: 2.4 + * + * Deprecated: 2.26: Rarely used API **/ GList* g_completion_complete_utf8 (GCompletion *cmp, @@ -320,6 +336,8 @@ g_completion_complete_utf8 (GCompletion *cmp, * * Attempts to complete the string @prefix using the #GCompletion * target items. + * + * Deprecated: 2.26: Rarely used API **/ GList* g_completion_complete (GCompletion* cmp, @@ -388,6 +406,8 @@ g_completion_complete (GCompletion* cmp, * @cmp: the #GCompletion. * * Frees all memory used by the #GCompletion. + * + * Deprecated: 2.26: Rarely used API **/ void g_completion_free (GCompletion* cmp) @@ -405,6 +425,8 @@ g_completion_free (GCompletion* cmp) * * Sets the function to use for string comparisons. The default string * comparison function is strncmp(). + * + * Deprecated: 2.26: Rarely used API **/ void g_completion_set_compare(GCompletion *cmp, @@ -467,6 +489,3 @@ main (int argc, return 0; } #endif - -#define __G_COMPLETION_C__ -#include "galiasdef.c" diff --git a/glib/gcompletion.h b/glib/gcompletion.h index 900883e..04c024f 100644 --- a/glib/gcompletion.h +++ b/glib/gcompletion.h @@ -56,6 +56,8 @@ struct _GCompletion GCompletionStrncmpFunc strncmp_func; }; +#ifndef G_DISABLE_DEPRECATED + GCompletion* g_completion_new (GCompletionFunc func); void g_completion_add_items (GCompletion* cmp, GList* items); @@ -72,6 +74,8 @@ void g_completion_set_compare (GCompletion *cmp, GCompletionStrncmpFunc strncmp_func); void g_completion_free (GCompletion* cmp); +#endif + G_END_DECLS #endif /* __G_COMPLETION_H__ */ diff --git a/glib/gconvert.c b/glib/gconvert.c index 520c32a..52a3dd8 100644 --- a/glib/gconvert.c +++ b/glib/gconvert.c @@ -21,8 +21,7 @@ */ #include "config.h" - -#include "glib.h" +#include "glibconfig.h" #ifndef G_OS_WIN32 #include @@ -32,10 +31,6 @@ #include #include -#include "gprintfint.h" -#include "gthreadprivate.h" -#include "gunicode.h" - #ifdef G_OS_WIN32 #include "win_iconv.c" #endif @@ -46,6 +41,21 @@ #undef STRICT #endif +#include "gconvert.h" + +#include "gprintfint.h" +#include "gslist.h" +#include "gstrfuncs.h" +#include "gtestutils.h" +#include "gthread.h" +#include "gthreadprivate.h" +#include "gunicode.h" + +#ifdef NEED_ICONV_CACHE +#include "glist.h" +#include "ghash.h" +#endif + #include "glibintl.h" #if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H) @@ -55,7 +65,127 @@ #error GNU libiconv not in use but included iconv.h is from libiconv #endif -#include "galias.h" + +/** + * SECTION:conversions + * @title: Character Set Conversion + * @short_description: Convert strings between different character sets + * + * The g_convert() family of function wraps the functionality of iconv(). In + * addition to pure character set conversions, GLib has functions to deal + * with the extra complications of encodings for file names. + * + * + * File Name Encodings + * + * Historically, Unix has not had a defined encoding for file + * names: a file name is valid as long as it does not have path + * separators in it ("/"). However, displaying file names may + * require conversion: from the character set in which they were + * created, to the character set in which the application + * operates. Consider the Spanish file name + * "Presentación.sxi". If the + * application which created it uses ISO-8859-1 for its encoding, + * + * + * Character: P r e s e n t a c i ó n . s x i + * Hex code: 50 72 65 73 65 6e 74 61 63 69 f3 6e 2e 73 78 69 + * + * + * However, if the application use UTF-8, the actual file name on + * disk would look like this: + * + * + * Character: P r e s e n t a c i ó n . s x i + * Hex code: 50 72 65 73 65 6e 74 61 63 69 c3 b3 6e 2e 73 78 69 + * + * + * Glib uses UTF-8 for its strings, and GUI toolkits like GTK+ + * that use Glib do the same thing. If you get a file name from + * the file system, for example, from readdir(3) or from g_dir_read_name(), + * and you wish to display the file name to the user, you + * will need to convert it into UTF-8. The + * opposite case is when the user types the name of a file he + * wishes to save: the toolkit will give you that string in + * UTF-8 encoding, and you will need to convert it to the + * character set used for file names before you can create the + * file with open(2) or fopen(3). + * + * + * By default, Glib assumes that file names on disk are in UTF-8 + * encoding. This is a valid assumption for file systems which + * were created relatively recently: most applications use UTF-8 + * encoding for their strings, and that is also what they use for + * the file names they create. However, older file systems may + * still contain file names created in "older" encodings, such as + * ISO-8859-1. In this case, for compatibility reasons, you may + * want to instruct Glib to use that particular encoding for file + * names rather than UTF-8. You can do this by specifying the + * encoding for file names in the G_FILENAME_ENCODING + * environment variable. For example, if your installation uses + * ISO-8859-1 for file names, you can put this in your + * ~/.profile: + * + * + * export G_FILENAME_ENCODING=ISO-8859-1 + * + * + * Glib provides the functions g_filename_to_utf8() and + * g_filename_from_utf8() to perform the necessary conversions. These + * functions convert file names from the encoding specified in + * G_FILENAME_ENCODING to UTF-8 and vice-versa. + * illustrates how + * these functions are used to convert between UTF-8 and the + * encoding for file names in the file system. + * + *
    + * Conversion between File Name Encodings + * + *
    + * + * Checklist for Application Writers + * + * This section is a practical summary of the detailed + * description above. You can use this as a checklist of + * things to do to make sure your applications process file + * name encodings correctly. + * + * + * + * If you get a file name from the file system from a function + * such as readdir(3) or gtk_file_chooser_get_filename(), + * you do not need to do any conversion to pass that + * file name to functions like open(2), rename(2), or + * fopen(3) — those are "raw" file names which the file + * system understands. + * + * + * If you need to display a file name, convert it to UTF-8 first by + * using g_filename_to_utf8(). If conversion fails, display a string like + * "Unknown file name". Do not + * convert this string back into the encoding used for file names if you + * wish to pass it to the file system; use the original file name instead. + * For example, the document window of a word processor could display + * "Unknown file name" in its title bar but still let the user save the + * file, as it would keep the raw file name internally. This can happen + * if the user has not set the G_FILENAME_ENCODING + * environment variable even though he has files whose names are not + * encoded in UTF-8. + * + * + * If your user interface lets the user type a file name for saving or + * renaming, convert it to the encoding used for file names in the file + * system by using g_filename_from_utf8(). Pass the converted file name + * to functions like fopen(3). If conversion fails, ask the user to enter + * a different file name. This can happen if the user types Japanese + * characters when G_FILENAME_ENCODING is set to + * ISO-8859-1, for example. + * + * + * + *
    + */ /* We try to terminate strings in unknown charsets with this many zero bytes * to ensure that multibyte strings really are nul-terminated when we return @@ -2125,6 +2255,3 @@ g_filename_display_name (const gchar *filename) return display_name; } - -#define __G_CONVERT_C__ -#include "galiasdef.c" diff --git a/glib/gconvert.h b/glib/gconvert.h index c4f274f..e4c20d7 100644 --- a/glib/gconvert.h +++ b/glib/gconvert.h @@ -35,7 +35,19 @@ G_BEGIN_DECLS -typedef enum +/** + * GConvertError: + * @G_CONVERT_ERROR_NO_CONVERSION: Conversion between the requested character + * sets is not supported. + * @G_CONVERT_ERROR_ILLEGAL_SEQUENCE: Invalid byte sequence in conversion input. + * @G_CONVERT_ERROR_FAILED: Conversion failed for some reason. + * @G_CONVERT_ERROR_PARTIAL_INPUT: Partial character sequence at end of input. + * @G_CONVERT_ERROR_BAD_URI: URI is invalid. + * @G_CONVERT_ERROR_NOT_ABSOLUTE_PATH: Pathname is not an absolute path. + * + * Error codes returned by character set conversion routines. + */ +typedef enum { G_CONVERT_ERROR_NO_CONVERSION, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, @@ -45,10 +57,22 @@ typedef enum G_CONVERT_ERROR_NOT_ABSOLUTE_PATH } GConvertError; +/** + * G_CONVERT_ERROR: + * + * Error domain for character set conversions. Errors in this domain will + * be from the #GConvertError enumeration. See #GError for information on + * error domains. + */ #define G_CONVERT_ERROR g_convert_error_quark() GQuark g_convert_error_quark (void); -/* Thin wrappers around iconv +/** + * GIconv: + * + * The GIConv struct wraps an + * iconv() conversion descriptor. It contains private data + * and should only be accessed using the following functions. */ typedef struct _GIConv *GIConv; diff --git a/glib/gdataset.c b/glib/gdataset.c index ffc4b96..cd3a51e 100644 --- a/glib/gdataset.c +++ b/glib/gdataset.c @@ -23,10 +23,10 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe ; except for g_data*_foreach() */ @@ -34,9 +34,15 @@ #include -#include "glib.h" +#include "gdataset.h" + #include "gdatasetprivate.h" -#include "galias.h" +#include "ghash.h" +#include "gquark.h" +#include "gstrfuncs.h" +#include "gtestutils.h" +#include "gthread.h" +#include "glib_trace.h" /** * SECTION: datasets @@ -994,8 +1000,10 @@ GQuark g_quark_try_string (const gchar *string) { GQuark quark = 0; - g_return_val_if_fail (string != NULL, 0); - + + if (string == NULL) + return 0; + G_LOCK (g_quark_global); if (g_quark_ht) quark = GPOINTER_TO_UINT (g_hash_table_lookup (g_quark_ht, string)); @@ -1004,6 +1012,38 @@ g_quark_try_string (const gchar *string) return quark; } +#define QUARK_STRING_BLOCK_SIZE (4096 - sizeof (gsize)) +static char *quark_block = NULL; +static int quark_block_offset = 0; + +/* HOLDS: g_quark_global_lock */ +static char * +quark_strdup(const gchar *string) +{ + gchar *copy; + gsize len; + + len = strlen (string) + 1; + + /* For strings longer than half the block size, fall back + to strdup so that we fill our blocks at least 50%. */ + if (len > QUARK_STRING_BLOCK_SIZE / 2) + return g_strdup (string); + + if (quark_block == NULL || + QUARK_STRING_BLOCK_SIZE - quark_block_offset < len) + { + quark_block = g_malloc (QUARK_STRING_BLOCK_SIZE); + quark_block_offset = 0; + } + + copy = quark_block + quark_block_offset; + memcpy (copy, string, len); + quark_block_offset += len; + + return copy; +} + /* HOLDS: g_quark_global_lock */ static inline GQuark g_quark_from_string_internal (const gchar *string, @@ -1015,8 +1055,11 @@ g_quark_from_string_internal (const gchar *string, quark = GPOINTER_TO_UINT (g_hash_table_lookup (g_quark_ht, string)); if (!quark) - quark = g_quark_new (duplicate ? g_strdup (string) : (gchar *)string); - + { + quark = g_quark_new (duplicate ? quark_strdup (string) : (gchar *)string); + TRACE(GLIB_QUARK_NEW(string, quark)); + } + return quark; } @@ -1178,6 +1221,3 @@ g_intern_static_string (const gchar *string) return result; } - -#define __G_DATASET_C__ -#include "galiasdef.c" diff --git a/glib/gdatasetprivate.h b/glib/gdatasetprivate.h index fdbb87a..80d0ccf 100644 --- a/glib/gdatasetprivate.h +++ b/glib/gdatasetprivate.h @@ -28,7 +28,7 @@ #ifndef __G_DATASETPRIVATE_H__ #define __G_DATASETPRIVATE_H__ -#include +#include G_BEGIN_DECLS diff --git a/glib/gdate.c b/glib/gdate.c index b31c033..2fab2f2 100644 --- a/glib/gdate.c +++ b/glib/gdate.c @@ -29,14 +29,13 @@ */ #include "config.h" +#include "glibconfig.h" #define DEBUG_MSG(x) /* */ #ifdef G_ENABLE_DEBUG /* #define DEBUG_MSG(args) g_message args ; */ #endif -#include "glib.h" - #include #include #include @@ -46,7 +45,18 @@ #include #endif -#include "galias.h" +#include "gdate.h" + +#include "gconvert.h" +#include "gmem.h" +#include "gstrfuncs.h" +#include "gtestutils.h" +#include "gthread.h" +#include "gunicode.h" + +#ifdef G_OS_WIN32 +#include "garray.h" +#endif GDate* g_date_new (void) @@ -946,6 +956,8 @@ g_date_set_time (GDate *date, * @tv_usec member is ignored, because #GDate can't make use of the * additional precision. * + * The time to date conversion is done using the user's current timezone. + * * Since: 2.10 */ void @@ -1899,7 +1911,3 @@ g_date_strftime (gchar *s, return retval; #endif } - -#define __G_DATE_C__ -#include "galiasdef.c" - diff --git a/glib/gdatetime.c b/glib/gdatetime.c new file mode 100644 index 0000000..7f83591 --- /dev/null +++ b/glib/gdatetime.c @@ -0,0 +1,2426 @@ +/* gdatetime.c + * + * Copyright (C) 2009-2010 Christian Hergert + * Copyright (C) 2010 Thiago Santos + * Copyright (C) 2010 Emmanuele Bassi + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the + * licence, or (at your option) any later version. + * + * This is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + * USA. + * + * Authors: Christian Hergert + * Thiago Santos + * Emmanuele Bassi + * Ryan Lortie + */ + +/* Algorithms within this file are based on the Calendar FAQ by + * Claus Tondering. It can be found at + * http://www.tondering.dk/claus/cal/calendar29.txt + * + * Copyright and disclaimer + * ------------------------ + * This document is Copyright (C) 2008 by Claus Tondering. + * E-mail: claus@tondering.dk. (Please include the word + * "calendar" in the subject line.) + * The document may be freely distributed, provided this + * copyright notice is included and no money is charged for + * the document. + * + * This document is provided "as is". No warranties are made as + * to its correctness. + */ + +/* Prologue {{{1 */ + +#include "config.h" + +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "gdatetime.h" + +#include "gatomic.h" +#include "gfileutils.h" +#include "ghash.h" +#include "gmain.h" +#include "gmappedfile.h" +#include "gstrfuncs.h" +#include "gtestutils.h" +#include "gthread.h" +#include "gtimezone.h" + +#include "glibintl.h" + +#ifndef G_OS_WIN32 +#include +#include +#endif /* !G_OS_WIN32 */ + +/** + * SECTION:date-time + * @title: GDateTime + * @short_description: A structure representing Date and Time + * @see_also: #GTimeZone + * + * #GDateTime is a structure that combines a Gregorian date and time + * into a single structure. It provides many conversion and methods to + * manipulate dates and times. Time precision is provided down to + * microseconds and the time can range (proleptically) from 0001-01-01 + * 00:00:00 to 9999-12-31 23:59:59.999999. #GDateTime follows POSIX + * time in the sense that it is oblivious to leap seconds. + * + * #GDateTime is an immutable object; once it has been created it cannot + * be modified further. All modifiers will create a new #GDateTime. + * Nearly all such functions can fail due to the date or time going out + * of range, in which case %NULL will be returned. + * + * #GDateTime is reference counted: the reference count is increased by calling + * g_date_time_ref() and decreased by calling g_date_time_unref(). When the + * reference count drops to 0, the resources allocated by the #GDateTime + * structure are released. + * + * Many parts of the API may produce non-obvious results. As an + * example, adding two months to January 31st will yield March 31st + * whereas adding one month and then one month again will yield either + * March 28th or March 29th. Also note that adding 24 hours is not + * always the same as adding one day (since days containing daylight + * savings time transitions are either 23 or 25 hours in length). + * + * #GDateTime is available since GLib 2.26. + */ + +struct _GDateTime +{ + /* 1 is 0001-01-01 in Proleptic Gregorian */ + gint32 days; + + /* Microsecond timekeeping within Day */ + guint64 usec; + + /* TimeZone information */ + GTimeZone *tz; + gint interval; + + volatile gint ref_count; +}; + +/* Time conversion {{{1 */ + +#define UNIX_EPOCH_START 719163 +#define INSTANT_TO_UNIX(instant) \ + ((instant)/USEC_PER_SECOND - UNIX_EPOCH_START * SEC_PER_DAY) +#define UNIX_TO_INSTANT(unix) \ + (((unix) + UNIX_EPOCH_START * SEC_PER_DAY) * USEC_PER_SECOND) + +#define DAYS_IN_4YEARS 1461 /* days in 4 years */ +#define DAYS_IN_100YEARS 36524 /* days in 100 years */ +#define DAYS_IN_400YEARS 146097 /* days in 400 years */ + +#define USEC_PER_SECOND (G_GINT64_CONSTANT (1000000)) +#define USEC_PER_MINUTE (G_GINT64_CONSTANT (60000000)) +#define USEC_PER_HOUR (G_GINT64_CONSTANT (3600000000)) +#define USEC_PER_MILLISECOND (G_GINT64_CONSTANT (1000)) +#define USEC_PER_DAY (G_GINT64_CONSTANT (86400000000)) +#define SEC_PER_DAY (G_GINT64_CONSTANT (86400)) + +#define GREGORIAN_LEAP(y) ((((y) % 4) == 0) && (!((((y) % 100) == 0) && (((y) % 400) != 0)))) +#define JULIAN_YEAR(d) ((d)->julian / 365.25) +#define DAYS_PER_PERIOD (G_GINT64_CONSTANT (2914695)) + +#define GET_AMPM(d,l) ((g_date_time_get_hour (d) < 12) \ + /* Translators: 'before midday' indicator */ \ + ? (l ? C_("GDateTime", "am") \ + /* Translators: 'before midday' indicator */ \ + : C_("GDateTime", "AM")) \ + /* Translators: 'after midday' indicator */ \ + : (l ? C_("GDateTime", "pm") \ + /* Translators: 'after midday' indicator */ \ + : C_("GDateTime", "PM"))) + +#define WEEKDAY_ABBR(d) (get_weekday_name_abbr (g_date_time_get_day_of_week (datetime))) +#define WEEKDAY_FULL(d) (get_weekday_name (g_date_time_get_day_of_week (datetime))) + +#define MONTH_ABBR(d) (get_month_name_abbr (g_date_time_get_month (datetime))) +#define MONTH_FULL(d) (get_month_name (g_date_time_get_month (datetime))) + +/* Translators: this is the preferred format for expressing the date */ +#define GET_PREFERRED_DATE(d) (g_date_time_format ((d), C_("GDateTime", "%m/%d/%y"))) + +/* Translators: this is the preferred format for expressing the time */ +#define GET_PREFERRED_TIME(d) (g_date_time_format ((d), C_("GDateTime", "%H:%M:%S"))) + +#define SECS_PER_MINUTE (60) +#define SECS_PER_HOUR (60 * SECS_PER_MINUTE) +#define SECS_PER_DAY (24 * SECS_PER_HOUR) +#define SECS_PER_YEAR (365 * SECS_PER_DAY) +#define SECS_PER_JULIAN (DAYS_PER_PERIOD * SECS_PER_DAY) + +static const guint16 days_in_months[2][13] = +{ + { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } +}; + +static const guint16 days_in_year[2][13] = +{ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } +}; + +static const gchar * +get_month_name (gint month) +{ + switch (month) + { + case 1: + return C_("full month name", "January"); + case 2: + return C_("full month name", "February"); + case 3: + return C_("full month name", "March"); + case 4: + return C_("full month name", "April"); + case 5: + return C_("full month name", "May"); + case 6: + return C_("full month name", "June"); + case 7: + return C_("full month name", "July"); + case 8: + return C_("full month name", "August"); + case 9: + return C_("full month name", "September"); + case 10: + return C_("full month name", "October"); + case 11: + return C_("full month name", "November"); + case 12: + return C_("full month name", "December"); + + default: + g_warning ("Invalid month number %d", month); + } + + return NULL; +} + +static const gchar * +get_month_name_abbr (gint month) +{ + switch (month) + { + case 1: + return C_("abbreviated month name", "Jan"); + case 2: + return C_("abbreviated month name", "Feb"); + case 3: + return C_("abbreviated month name", "Mar"); + case 4: + return C_("abbreviated month name", "Apr"); + case 5: + return C_("abbreviated month name", "May"); + case 6: + return C_("abbreviated month name", "Jun"); + case 7: + return C_("abbreviated month name", "Jul"); + case 8: + return C_("abbreviated month name", "Aug"); + case 9: + return C_("abbreviated month name", "Sep"); + case 10: + return C_("abbreviated month name", "Oct"); + case 11: + return C_("abbreviated month name", "Nov"); + case 12: + return C_("abbreviated month name", "Dec"); + + default: + g_warning ("Invalid month number %d", month); + } + + return NULL; +} + +static const gchar * +get_weekday_name (gint day) +{ + switch (day) + { + case 1: + return C_("full weekday name", "Monday"); + case 2: + return C_("full weekday name", "Tuesday"); + case 3: + return C_("full weekday name", "Wednesday"); + case 4: + return C_("full weekday name", "Thursday"); + case 5: + return C_("full weekday name", "Friday"); + case 6: + return C_("full weekday name", "Saturday"); + case 7: + return C_("full weekday name", "Sunday"); + + default: + g_warning ("Invalid week day number %d", day); + } + + return NULL; +} + +static const gchar * +get_weekday_name_abbr (gint day) +{ + switch (day) + { + case 1: + return C_("abbreviated weekday name", "Mon"); + case 2: + return C_("abbreviated weekday name", "Tue"); + case 3: + return C_("abbreviated weekday name", "Wed"); + case 4: + return C_("abbreviated weekday name", "Thu"); + case 5: + return C_("abbreviated weekday name", "Fri"); + case 6: + return C_("abbreviated weekday name", "Sat"); + case 7: + return C_("abbreviated weekday name", "Sun"); + + default: + g_warning ("Invalid week day number %d", day); + } + + return NULL; +} + +static inline gint +ymd_to_days (gint year, + gint month, + gint day) +{ + gint64 days; + + days = (year - 1) * 365 + ((year - 1) / 4) - ((year - 1) / 100) + + ((year - 1) / 400); + + days += days_in_year[0][month - 1]; + if (GREGORIAN_LEAP (year) && month > 2) + day++; + + days += day; + + return days; +} + +static void +g_date_time_get_week_number (GDateTime *datetime, + gint *week_number, + gint *day_of_week, + gint *day_of_year) +{ + gint a, b, c, d, e, f, g, n, s, month, day, year; + + g_date_time_get_ymd (datetime, &year, &month, &day); + + if (month <= 2) + { + a = g_date_time_get_year (datetime) - 1; + b = (a / 4) - (a / 100) + (a / 400); + c = ((a - 1) / 4) - ((a - 1) / 100) + ((a - 1) / 400); + s = b - c; + e = 0; + f = day - 1 + (31 * (month - 1)); + } + else + { + a = year; + b = (a / 4) - (a / 100) + (a / 400); + c = ((a - 1) / 4) - ((a - 1) / 100) + ((a - 1) / 400); + s = b - c; + e = s + 1; + f = day + (((153 * (month - 3)) + 2) / 5) + 58 + s; + } + + g = (a + b) % 7; + d = (f + g - e) % 7; + n = f + 3 - d; + + if (week_number) + { + if (n < 0) + *week_number = 53 - ((g - s) / 5); + else if (n > 364 + s) + *week_number = 1; + else + *week_number = (n / 7) + 1; + } + + if (day_of_week) + *day_of_week = d + 1; + + if (day_of_year) + *day_of_year = f + 1; +} + +/* Lifecycle {{{1 */ + +static GDateTime * +g_date_time_alloc (GTimeZone *tz) +{ + GDateTime *datetime; + + datetime = g_slice_new0 (GDateTime); + datetime->tz = g_time_zone_ref (tz); + datetime->ref_count = 1; + + return datetime; +} + +/** + * g_date_time_ref: + * @datetime: a #GDateTime + * + * Atomically increments the reference count of @datetime by one. + * + * Return value: the #GDateTime with the reference count increased + * + * Since: 2.26 + */ +GDateTime * +g_date_time_ref (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, NULL); + g_return_val_if_fail (datetime->ref_count > 0, NULL); + + g_atomic_int_inc (&datetime->ref_count); + + return datetime; +} + +/** + * g_date_time_unref: + * @datetime: a #GDateTime + * + * Atomically decrements the reference count of @datetime by one. + * + * When the reference count reaches zero, the resources allocated by + * @datetime are freed + * + * Since: 2.26 + */ +void +g_date_time_unref (GDateTime *datetime) +{ + g_return_if_fail (datetime != NULL); + g_return_if_fail (datetime->ref_count > 0); + + if (g_atomic_int_dec_and_test (&datetime->ref_count)) + { + g_time_zone_unref (datetime->tz); + g_slice_free (GDateTime, datetime); + } +} + +/* Internal state transformers {{{1 */ +/*< internal > + * g_date_time_to_instant: + * @datetime: a #GDateTime + * + * Convert a @datetime into an instant. + * + * An instant is a number that uniquely describes a particular + * microsecond in time, taking time zone considerations into account. + * (ie: "03:00 -0400" is the same instant as "02:00 -0500"). + * + * An instant is always positive but we use a signed return value to + * avoid troubles with C. + */ +static gint64 +g_date_time_to_instant (GDateTime *datetime) +{ + gint64 offset; + + offset = g_time_zone_get_offset (datetime->tz, datetime->interval); + offset *= USEC_PER_SECOND; + + return datetime->days * USEC_PER_DAY + datetime->usec - offset; +} + +/*< internal > + * g_date_time_from_instant: + * @tz: a #GTimeZone + * @instant: a instant in time + * + * Creates a #GDateTime from a time zone and an instant. + * + * This might fail if the time ends up being out of range. + */ +static GDateTime * +g_date_time_from_instant (GTimeZone *tz, + gint64 instant) +{ + GDateTime *datetime; + gint64 offset; + + if (instant < 0 || instant > G_GINT64_CONSTANT (1000000000000000000)) + return NULL; + + datetime = g_date_time_alloc (tz); + datetime->interval = g_time_zone_find_interval (tz, + G_TIME_TYPE_UNIVERSAL, + INSTANT_TO_UNIX (instant)); + offset = g_time_zone_get_offset (datetime->tz, datetime->interval); + offset *= USEC_PER_SECOND; + + instant += offset; + + datetime->days = instant / USEC_PER_DAY; + datetime->usec = instant % USEC_PER_DAY; + + if (datetime->days < 1 || 3652059 < datetime->days) + { + g_date_time_unref (datetime); + datetime = NULL; + } + + return datetime; +} + + +/*< internal > + * g_date_time_deal_with_date_change: + * @datetime: a #GDateTime + * + * This function should be called whenever the date changes by adding + * days, months or years. It does three things. + * + * First, we ensure that the date falls between 0001-01-01 and + * 9999-12-31 and return %FALSE if it does not. + * + * Next we update the ->interval field. + * + * Finally, we ensure that the resulting date and time pair exists (by + * ensuring that our time zone has an interval containing it) and + * adjusting as required. For example, if we have the time 02:30:00 on + * March 13 2010 in Toronto and we add 1 day to it, we would end up with + * 2:30am on March 14th, which doesn't exist. In that case, we bump the + * time up to 3:00am. + */ +static gboolean +g_date_time_deal_with_date_change (GDateTime *datetime) +{ + GTimeType was_dst; + gint64 full_time; + gint64 usec; + + if (datetime->days < 1 || datetime->days > 3652059) + return FALSE; + + was_dst = g_time_zone_is_dst (datetime->tz, datetime->interval); + + full_time = datetime->days * USEC_PER_DAY + datetime->usec; + + + usec = full_time % USEC_PER_SECOND; + full_time /= USEC_PER_SECOND; + full_time -= UNIX_EPOCH_START * SEC_PER_DAY; + + datetime->interval = g_time_zone_adjust_time (datetime->tz, + was_dst, + &full_time); + full_time += UNIX_EPOCH_START * SEC_PER_DAY; + full_time *= USEC_PER_SECOND; + full_time += usec; + + datetime->days = full_time / USEC_PER_DAY; + datetime->usec = full_time % USEC_PER_DAY; + + /* maybe daylight time caused us to shift to a different day, + * but it definitely didn't push us into a different year */ + return TRUE; +} + +static GDateTime * +g_date_time_replace_days (GDateTime *datetime, + gint days) +{ + GDateTime *new; + + new = g_date_time_alloc (datetime->tz); + new->interval = datetime->interval; + new->usec = datetime->usec; + new->days = days; + + if (!g_date_time_deal_with_date_change (new)) + { + g_date_time_unref (new); + new = NULL; + } + + return new; +} + +/* now/unix/timeval Constructors {{{1 */ + +/*< internal > + * g_date_time_new_from_timeval: + * @tz: a #GTimeZone + * @tv: a #GTimeVal + * + * Creates a #GDateTime corresponding to the given #GTimeVal @tv in the + * given time zone @tz. + * + * The time contained in a #GTimeVal is always stored in the form of + * seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the + * given time zone. + * + * This call can fail (returning %NULL) if @tv represents a time outside + * of the supported range of #GDateTime. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +static GDateTime * +g_date_time_new_from_timeval (GTimeZone *tz, + const GTimeVal *tv) +{ + return g_date_time_from_instant (tz, tv->tv_usec + + UNIX_TO_INSTANT (tv->tv_sec)); +} + +/*< internal > + * g_date_time_new_from_unix: + * @tz: a #GTimeZone + * @t: the Unix time + * + * Creates a #GDateTime corresponding to the given Unix time @t in the + * given time zone @tz. + * + * Unix time is the number of seconds that have elapsed since 1970-01-01 + * 00:00:00 UTC, regardless of the time zone given. + * + * This call can fail (returning %NULL) if @t represents a time outside + * of the supported range of #GDateTime. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +static GDateTime * +g_date_time_new_from_unix (GTimeZone *tz, + gint64 secs) +{ + return g_date_time_from_instant (tz, UNIX_TO_INSTANT (secs)); +} + +/** + * g_date_time_new_now: + * @tz: a #GTimeZone + * + * Creates a #GDateTime corresponding to this exact instant in the given + * time zone @tz. The time is as accurate as the system allows, to a + * maximum accuracy of 1 microsecond. + * + * This function will always succeed unless the system clock is set to + * truly insane values (or unless GLib is still being used after the + * year 9999). + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_now (GTimeZone *tz) +{ + GTimeVal tv; + + g_get_current_time (&tv); + + return g_date_time_new_from_timeval (tz, &tv); +} + +/** + * g_date_time_new_now_local: + * + * Creates a #GDateTime corresponding to this exact instant in the local + * time zone. + * + * This is equivalent to calling g_date_time_new_now() with the time + * zone returned by g_time_zone_new_local(). + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_now_local (void) +{ + GDateTime *datetime; + GTimeZone *local; + + local = g_time_zone_new_local (); + datetime = g_date_time_new_now (local); + g_time_zone_unref (local); + + return datetime; +} + +/** + * g_date_time_new_now_utc: + * + * Creates a #GDateTime corresponding to this exact instant in UTC. + * + * This is equivalent to calling g_date_time_new_now() with the time + * zone returned by g_time_zone_new_utc(). + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_now_utc (void) +{ + GDateTime *datetime; + GTimeZone *utc; + + utc = g_time_zone_new_utc (); + datetime = g_date_time_new_now (utc); + g_time_zone_unref (utc); + + return datetime; +} + +/** + * g_date_time_new_from_unix_local: + * @t: the Unix time + * + * Creates a #GDateTime corresponding to the given Unix time @t in the + * local time zone. + * + * Unix time is the number of seconds that have elapsed since 1970-01-01 + * 00:00:00 UTC, regardless of the local time offset. + * + * This call can fail (returning %NULL) if @t represents a time outside + * of the supported range of #GDateTime. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_from_unix_local (gint64 t) +{ + GDateTime *datetime; + GTimeZone *local; + + local = g_time_zone_new_local (); + datetime = g_date_time_new_from_unix (local, t); + g_time_zone_unref (local); + + return datetime; +} + +/** + * g_date_time_new_from_unix_utc: + * @t: the Unix time + * + * Creates a #GDateTime corresponding to the given Unix time @t in UTC. + * + * Unix time is the number of seconds that have elapsed since 1970-01-01 + * 00:00:00 UTC. + * + * This call can fail (returning %NULL) if @t represents a time outside + * of the supported range of #GDateTime. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_from_unix_utc (gint64 t) +{ + GDateTime *datetime; + GTimeZone *utc; + + utc = g_time_zone_new_utc (); + datetime = g_date_time_new_from_unix (utc, t); + g_time_zone_unref (utc); + + return datetime; +} + +/** + * g_date_time_new_from_timeval_local: + * @tv: a #GTimeVal + * + * Creates a #GDateTime corresponding to the given #GTimeVal @tv in the + * local time zone. + * + * The time contained in a #GTimeVal is always stored in the form of + * seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the + * local time offset. + * + * This call can fail (returning %NULL) if @tv represents a time outside + * of the supported range of #GDateTime. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_from_timeval_local (const GTimeVal *tv) +{ + GDateTime *datetime; + GTimeZone *local; + + local = g_time_zone_new_local (); + datetime = g_date_time_new_from_timeval (local, tv); + g_time_zone_unref (local); + + return datetime; +} + +/** + * g_date_time_new_from_timeval_utc: + * @tv: a #GTimeVal + * + * Creates a #GDateTime corresponding to the given #GTimeVal @tv in UTC. + * + * The time contained in a #GTimeVal is always stored in the form of + * seconds elapsed since 1970-01-01 00:00:00 UTC. + * + * This call can fail (returning %NULL) if @tv represents a time outside + * of the supported range of #GDateTime. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new_from_timeval_utc (const GTimeVal *tv) +{ + GDateTime *datetime; + GTimeZone *utc; + + utc = g_time_zone_new_utc (); + datetime = g_date_time_new_from_timeval (utc, tv); + g_time_zone_unref (utc); + + return datetime; +} + +/* full new functions {{{1 */ + +/** + * g_date_time_new: + * @tz: a #GTimeZone + * @year: the year component of the date + * @month: the month component of the date + * @day: the day component of the date + * @hour: the hour component of the date + * @minute: the minute component of the date + * @seconds: the number of seconds past the minute + * + * Creates a new #GDateTime corresponding to the given date and time in + * the time zone @tz. + * + * The @year must be between 1 and 9999, @month between 1 and 12 and @day + * between 1 and 28, 29, 30 or 31 depending on the month and the year. + * + * @hour must be between 0 and 23 and @minute must be between 0 and 59. + * + * @seconds must be at least 0.0 and must be strictly less than 60.0. + * It will be rounded down to the nearest microsecond. + * + * If the given time is not representable in the given time zone (for + * example, 02:30 on March 14th 2010 in Toronto, due to daylight savings + * time) then the time will be rounded up to the nearest existing time + * (in this case, 03:00). If this matters to you then you should verify + * the return value for containing the same as the numbers you gave. + * + * In the case that the given time is ambiguous in the given time zone + * (for example, 01:30 on November 7th 2010 in Toronto, due to daylight + * savings time) then the time falling within standard (ie: + * non-daylight) time is taken. + * + * It not considered a programmer error for the values to this function + * to be out of range, but in the case that they are, the function will + * return %NULL. + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_new (GTimeZone *tz, + gint year, + gint month, + gint day, + gint hour, + gint minute, + gdouble seconds) +{ + GDateTime *datetime; + gint64 full_time; + + datetime = g_date_time_alloc (tz); + datetime->days = ymd_to_days (year, month, day); + datetime->usec = (hour * USEC_PER_HOUR) + + (minute * USEC_PER_MINUTE) + + (gint64) (seconds * USEC_PER_SECOND); + + full_time = SEC_PER_DAY * + (ymd_to_days (year, month, day) - UNIX_EPOCH_START) + + SECS_PER_HOUR * hour + + SECS_PER_MINUTE * minute + + (int) seconds; + + datetime->interval = g_time_zone_adjust_time (datetime->tz, + G_TIME_TYPE_STANDARD, + &full_time); + + full_time += UNIX_EPOCH_START * SEC_PER_DAY; + datetime->days = full_time / SEC_PER_DAY; + datetime->usec = (full_time % SEC_PER_DAY) * USEC_PER_SECOND; + datetime->usec += ((int) (seconds * USEC_PER_SECOND)) % USEC_PER_SECOND; + + return datetime; +} + +/** + * g_date_time_new_local: + * @year: the year component of the date + * @month: the month component of the date + * @day: the day component of the date + * @hour: the hour component of the date + * @minute: the minute component of the date + * @seconds: the number of seconds past the minute + * + * Creates a new #GDateTime corresponding to the given date and time in + * the local time zone. + * + * This call is equivalent to calling g_date_time_new() with the time + * zone returned by g_time_zone_new_local(). + * + * Returns: a #GDateTime, or %NULL + * + * Since: 2.26. + **/ +GDateTime * +g_date_time_new_local (gint year, + gint month, + gint day, + gint hour, + gint minute, + gdouble seconds) +{ + GDateTime *datetime; + GTimeZone *local; + + local = g_time_zone_new_local (); + datetime = g_date_time_new (local, year, month, day, hour, minute, seconds); + g_time_zone_unref (local); + + return datetime; +} + +/** + * g_date_time_new_utc: + * @year: the year component of the date + * @month: the month component of the date + * @day: the day component of the date + * @hour: the hour component of the date + * @minute: the minute component of the date + * @seconds: the number of seconds past the minute + * + * Creates a new #GDateTime corresponding to the given date and time in + * UTC. + * + * This call is equivalent to calling g_date_time_new() with the time + * zone returned by g_time_zone_new_utc(). + * + * Returns: a #GDateTime, or %NULL + * + * Since: 2.26. + **/ +GDateTime * +g_date_time_new_utc (gint year, + gint month, + gint day, + gint hour, + gint minute, + gdouble seconds) +{ + GDateTime *datetime; + GTimeZone *utc; + + utc = g_time_zone_new_utc (); + datetime = g_date_time_new (utc, year, month, day, hour, minute, seconds); + g_time_zone_unref (utc); + + return datetime; +} + +/* Adders {{{1 */ + +/** + * g_date_time_add: + * @datetime: a #GDateTime + * @timespan: a #GTimeSpan + * + * Creates a copy of @datetime and adds the specified timespan to the copy. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add (GDateTime *datetime, + GTimeSpan timespan) +{ + return g_date_time_from_instant (datetime->tz, timespan + + g_date_time_to_instant (datetime)); +} + +/** + * g_date_time_add_years: + * @datetime: a #GDateTime + * @years: the number of years + * + * Creates a copy of @datetime and adds the specified number of years to the + * copy. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime * +g_date_time_add_years (GDateTime *datetime, + gint years) +{ + gint year, month, day; + + g_return_val_if_fail (datetime != NULL, NULL); + + if (years < -10000 || years > 10000) + return NULL; + + g_date_time_get_ymd (datetime, &year, &month, &day); + year += years; + + /* only possible issue is if we've entered a year with no February 29 + */ + if (month == 2 && day == 29 && !GREGORIAN_LEAP (year)) + day = 28; + + return g_date_time_replace_days (datetime, ymd_to_days (year, month, day)); +} + +/** + * g_date_time_add_months: + * @datetime: a #GDateTime + * @months: the number of months + * + * Creates a copy of @datetime and adds the specified number of months to the + * copy. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add_months (GDateTime *datetime, + gint months) +{ + gint year, month, day; + + g_return_val_if_fail (datetime != NULL, NULL); + g_date_time_get_ymd (datetime, &year, &month, &day); + + if (months < -120000 || months > 120000) + return NULL; + + year += months / 12; + month += months % 12; + if (month < 1) + { + month += 12; + year--; + } + else if (month > 12) + { + month -= 12; + year++; + } + + day = MIN (day, days_in_months[GREGORIAN_LEAP (year)][month]); + + return g_date_time_replace_days (datetime, ymd_to_days (year, month, day)); +} + +/** + * g_date_time_add_weeks: + * @datetime: a #GDateTime + * @weeks: the number of weeks + * + * Creates a copy of @datetime and adds the specified number of weeks to the + * copy. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add_weeks (GDateTime *datetime, + gint weeks) +{ + g_return_val_if_fail (datetime != NULL, NULL); + + return g_date_time_add_days (datetime, weeks * 7); +} + +/** + * g_date_time_add_days: + * @datetime: a #GDateTime + * @days: the number of days + * + * Creates a copy of @datetime and adds the specified number of days to the + * copy. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add_days (GDateTime *datetime, + gint days) +{ + g_return_val_if_fail (datetime != NULL, NULL); + + if (days < -3660000 || days > 3660000) + return NULL; + + return g_date_time_replace_days (datetime, datetime->days + days); +} + +/** + * g_date_time_add_hours: + * @datetime: a #GDateTime + * @hours: the number of hours to add + * + * Creates a copy of @datetime and adds the specified number of hours + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add_hours (GDateTime *datetime, + gint hours) +{ + return g_date_time_add (datetime, hours * USEC_PER_HOUR); +} + +/** + * g_date_time_add_minutes: + * @datetime: a #GDateTime + * @minutes: the number of minutes to add + * + * Creates a copy of @datetime adding the specified number of minutes. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add_minutes (GDateTime *datetime, + gint minutes) +{ + return g_date_time_add (datetime, minutes * USEC_PER_MINUTE); +} + + +/** + * g_date_time_add_seconds: + * @datetime: a #GDateTime + * @seconds: the number of seconds to add + * + * Creates a copy of @datetime and adds the specified number of seconds. + * + * Return value: the newly created #GDateTime which should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime* +g_date_time_add_seconds (GDateTime *datetime, + gdouble seconds) +{ + return g_date_time_add (datetime, seconds * USEC_PER_SECOND); +} + +/** + * g_date_time_add_full: + * @datetime: a #GDateTime + * @years: the number of years to add + * @months: the number of months to add + * @days: the number of days to add + * @hours: the number of hours to add + * @minutes: the number of minutes to add + * @seconds: the number of seconds to add + * + * Creates a new #GDateTime adding the specified values to the current date and + * time in @datetime. + * + * Return value: the newly created #GDateTime that should be freed with + * g_date_time_unref(). + * + * Since: 2.26 + */ +GDateTime * +g_date_time_add_full (GDateTime *datetime, + gint years, + gint months, + gint days, + gint hours, + gint minutes, + gdouble seconds) +{ + gint year, month, day; + gint64 full_time; + GDateTime *new; + gint interval; + + g_return_val_if_fail (datetime != NULL, NULL); + g_date_time_get_ymd (datetime, &year, &month, &day); + + months += years * 12; + + if (months < -120000 || months > 120000) + return NULL; + + if (days < -3660000 || days > 3660000) + return NULL; + + year += months / 12; + month += months % 12; + if (month < 1) + { + month += 12; + year--; + } + else if (month > 12) + { + month -= 12; + year++; + } + + day = MIN (day, days_in_months[GREGORIAN_LEAP (year)][month]); + + /* full_time is now in unix (local) time */ + full_time = datetime->usec / USEC_PER_SECOND + SEC_PER_DAY * + (ymd_to_days (year, month, day) + days - UNIX_EPOCH_START); + + interval = g_time_zone_adjust_time (datetime->tz, + g_time_zone_is_dst (datetime->tz, + datetime->interval), + &full_time); + + /* move to UTC unix time */ + full_time -= g_time_zone_get_offset (datetime->tz, interval); + + /* convert back to an instant, add back fractional seconds */ + full_time += UNIX_EPOCH_START * SEC_PER_DAY; + full_time = full_time * USEC_PER_SECOND + + datetime->usec % USEC_PER_SECOND; + + /* do the actual addition now */ + full_time += (hours * USEC_PER_HOUR) + + (minutes * USEC_PER_MINUTE) + + (gint64) (seconds * USEC_PER_SECOND); + + /* find the new interval */ + interval = g_time_zone_find_interval (datetime->tz, + G_TIME_TYPE_UNIVERSAL, + INSTANT_TO_UNIX (full_time)); + + /* convert back into local time */ + full_time += USEC_PER_SECOND * + g_time_zone_get_offset (datetime->tz, interval); + + /* split into days and usec of a new datetime */ + new = g_date_time_alloc (datetime->tz); + new->interval = interval; + new->days = full_time / USEC_PER_DAY; + new->usec = full_time % USEC_PER_DAY; + + /* XXX validate */ + + return new; +} + +/* Compare, difference, hash, equal {{{1 */ +/** + * g_date_time_compare: + * @dt1: first #GDateTime to compare + * @dt2: second #GDateTime to compare + * + * #GCompareFunc-compatible comparison for #GDateTime's. Both + * #GDateTime<-- -->'s must be non-%NULL. + * + * Return value: 0 for equal, less than zero if dt1 is less than dt2, greater + * than zero if dt2 is greator than dt1. + * + * Since: 2.26 + */ +gint +g_date_time_compare (gconstpointer dt1, + gconstpointer dt2) +{ + gint64 difference; + + difference = g_date_time_difference ((GDateTime *) dt1, (GDateTime *) dt2); + + if (difference < 0) + return -1; + + else if (difference > 0) + return 1; + + else + return 0; +} + +/** + * g_date_time_difference: + * @end: a #GDateTime + * @begin: a #GDateTime + * + * Calculates the difference in time between @end and @begin. The + * #GTimeSpan that is returned is effectively @end - @begin (ie: + * positive if the first simparameter is larger). + * + * Return value: the difference between the two #GDateTime, as a time + * span expressed in microseconds. + * + * Since: 2.26 + */ +GTimeSpan +g_date_time_difference (GDateTime *end, + GDateTime *begin) +{ + g_return_val_if_fail (begin != NULL, 0); + g_return_val_if_fail (end != NULL, 0); + + return g_date_time_to_instant (end) - + g_date_time_to_instant (begin); +} + +/** + * g_date_time_hash: + * @datetime: a #GDateTime + * + * Hashes @datetime into a #guint, suitable for use within #GHashTable. + * + * Return value: a #guint containing the hash + * + * Since: 2.26 + */ +guint +g_date_time_hash (gconstpointer datetime) +{ + return g_date_time_to_instant ((GDateTime *) datetime); +} + +/** + * g_date_time_equal: + * @dt1: a #GDateTime + * @dt2: a #GDateTime + * + * Checks to see if @dt1 and @dt2 are equal. + * + * Equal here means that they represent the same moment after converting + * them to the same time zone. + * + * Return value: %TRUE if @dt1 and @dt2 are equal + * + * Since: 2.26 + */ +gboolean +g_date_time_equal (gconstpointer dt1, + gconstpointer dt2) +{ + return g_date_time_difference ((GDateTime *) dt1, (GDateTime *) dt2) == 0; +} + +/* Year, Month, Day Getters {{{1 */ +/** + * g_date_time_get_ymd: + * @datetime: a #GDateTime. + * @year: (out): the return location for the gregorian year, or %NULL. + * @month: (out): the return location for the month of the year, or %NULL. + * @day: (out): the return location for the day of the month, or %NULL. + * + * Retrieves the Gregorian day, month, and year of a given #GDateTime. + * + * Since: 2.26 + **/ +void +g_date_time_get_ymd (GDateTime *datetime, + gint *year, + gint *month, + gint *day) +{ + gint the_year; + gint the_month; + gint the_day; + gint remaining_days; + gint y100_cycles; + gint y4_cycles; + gint y1_cycles; + gint preceding; + gboolean leap; + + g_return_if_fail (datetime != NULL); + + remaining_days = datetime->days; + + /* + * We need to convert an offset in days to its year/month/day representation. + * Leap years makes this a little trickier than it should be, so we use + * 400, 100 and 4 years cycles here to get to the correct year. + */ + + /* Our days offset starts sets 0001-01-01 as day 1, if it was day 0 our + * math would be simpler, so let's do it */ + remaining_days--; + + the_year = (remaining_days / DAYS_IN_400YEARS) * 400 + 1; + remaining_days = remaining_days % DAYS_IN_400YEARS; + + y100_cycles = remaining_days / DAYS_IN_100YEARS; + remaining_days = remaining_days % DAYS_IN_100YEARS; + the_year += y100_cycles * 100; + + y4_cycles = remaining_days / DAYS_IN_4YEARS; + remaining_days = remaining_days % DAYS_IN_4YEARS; + the_year += y4_cycles * 4; + + y1_cycles = remaining_days / 365; + the_year += y1_cycles; + remaining_days = remaining_days % 365; + + if (y1_cycles == 4 || y100_cycles == 4) { + g_assert (remaining_days == 0); + + /* special case that indicates that the date is actually one year before, + * in the 31th of December */ + the_year--; + the_month = 12; + the_day = 31; + goto end; + } + + /* now get the month and the day */ + leap = y1_cycles == 3 && (y4_cycles != 24 || y100_cycles == 3); + + g_assert (leap == GREGORIAN_LEAP(the_year)); + + the_month = (remaining_days + 50) >> 5; + preceding = (days_in_year[0][the_month - 1] + (the_month > 2 && leap)); + if (preceding > remaining_days) + { + /* estimate is too large */ + the_month -= 1; + preceding -= leap ? days_in_months[1][the_month] + : days_in_months[0][the_month]; + } + + remaining_days -= preceding; + g_assert(0 <= remaining_days); + + the_day = remaining_days + 1; + +end: + if (year) + *year = the_year; + if (month) + *month = the_month; + if (day) + *day = the_day; +} + +/** + * g_date_time_get_year: + * @datetime: A #GDateTime + * + * Retrieves the year represented by @datetime in the Gregorian calendar. + * + * Return value: the year represented by @datetime + * + * Since: 2.26 + */ +gint +g_date_time_get_year (GDateTime *datetime) +{ + gint year; + + g_return_val_if_fail (datetime != NULL, 0); + + g_date_time_get_ymd (datetime, &year, NULL, NULL); + + return year; +} + +/** + * g_date_time_get_month: + * @datetime: a #GDateTime + * + * Retrieves the month of the year represented by @datetime in the Gregorian + * calendar. + * + * Return value: the month represented by @datetime + * + * Since: 2.26 + */ +gint +g_date_time_get_month (GDateTime *datetime) +{ + gint month; + + g_return_val_if_fail (datetime != NULL, 0); + + g_date_time_get_ymd (datetime, NULL, &month, NULL); + + return month; +} + +/** + * g_date_time_get_day_of_month: + * @datetime: a #GDateTime + * + * Retrieves the day of the month represented by @datetime in the gregorian + * calendar. + * + * Return value: the day of the month + * + * Since: 2.26 + */ +gint +g_date_time_get_day_of_month (GDateTime *datetime) +{ + gint day_of_year, + i; + const guint16 *days; + guint16 last = 0; + + g_return_val_if_fail (datetime != NULL, 0); + + days = days_in_year[GREGORIAN_LEAP (g_date_time_get_year (datetime)) ? 1 : 0]; + g_date_time_get_week_number (datetime, NULL, NULL, &day_of_year); + + for (i = 1; i <= 12; i++) + { + if (days [i] >= day_of_year) + return day_of_year - last; + last = days [i]; + } + + g_warn_if_reached (); + return 0; +} + +/* Week of year / day of week getters {{{1 */ +/** + * g_date_time_get_week_numbering_year: + * @datetime: a #GDateTime + * + * Returns the ISO 8601 week-numbering year in which the week containing + * @datetime falls. + * + * This function, taken together with g_date_time_get_week_of_year() and + * g_date_time_get_day_of_week() can be used to determine the full ISO + * week date on which @datetime falls. + * + * This is usually equal to the normal Gregorian year (as returned by + * g_date_time_get_year()), except as detailed below: + * + * For Thursday, the week-numbering year is always equal to the usual + * calendar year. For other days, the number is such that every day + * within a complete week (Monday to Sunday) is contained within the + * same week-numbering year. + * + * For Monday, Tuesday and Wednesday occuring near the end of the year, + * this may mean that the week-numbering year is one greater than the + * calendar year (so that these days have the same week-numbering year + * as the Thursday occuring early in the next year). + * + * For Friday, Saturaday and Sunday occuring near the start of the year, + * this may mean that the week-numbering year is one less than the + * calendar year (so that these days have the same week-numbering year + * as the Thursday occuring late in the previous year). + * + * An equivalent description is that the week-numbering year is equal to + * the calendar year containing the majority of the days in the current + * week (Monday to Sunday). + * + * Note that January 1 0001 in the proleptic Gregorian calendar is a + * Monday, so this function never returns 0. + * + * Returns: the ISO 8601 week-numbering year for @datetime + * + * Since: 2.26 + **/ +gint +g_date_time_get_week_numbering_year (GDateTime *datetime) +{ + gint year, month, day, weekday; + + g_date_time_get_ymd (datetime, &year, &month, &day); + weekday = g_date_time_get_day_of_week (datetime); + + /* January 1, 2, 3 might be in the previous year if they occur after + * Thursday. + * + * Jan 1: Friday, Saturday, Sunday => day 1: weekday 5, 6, 7 + * Jan 2: Saturday, Sunday => day 2: weekday 6, 7 + * Jan 3: Sunday => day 3: weekday 7 + * + * So we have a special case if (day - weekday) <= -4 + */ + if (month == 1 && (day - weekday) <= -4) + return year - 1; + + /* December 29, 30, 31 might be in the next year if they occur before + * Thursday. + * + * Dec 31: Monday, Tuesday, Wednesday => day 31: weekday 1, 2, 3 + * Dec 30: Monday, Tuesday => day 30: weekday 1, 2 + * Dec 29: Monday => day 29: weekday 1 + * + * So we have a special case if (day - weekday) >= 28 + */ + else if (month == 12 && (day - weekday) >= 28) + return year + 1; + + else + return year; +} + +/** + * g_date_time_get_week_of_year: + * @datetime: a #GDateTime + * + * Returns the ISO 8601 week number for the week containing @datetime. + * The ISO 8601 week number is the same for every day of the week (from + * Moday through Sunday). That can produce some unusual results + * (described below). + * + * The first week of the year is week 1. This is the week that contains + * the first Thursday of the year. Equivalently, this is the first week + * that has more than 4 of its days falling within the calendar year. + * + * The value 0 is never returned by this function. Days contained + * within a year but occuring before the first ISO 8601 week of that + * year are considered as being contained in the last week of the + * previous year. Similarly, the final days of a calendar year may be + * considered as being part of the first ISO 8601 week of the next year + * if 4 or more days of that week are contained within the new year. + * + * Returns: the ISO 8601 week number for @datetime. + * + * Since: 2.26 + */ +gint +g_date_time_get_week_of_year (GDateTime *datetime) +{ + gint weeknum; + + g_return_val_if_fail (datetime != NULL, 0); + + g_date_time_get_week_number (datetime, &weeknum, NULL, NULL); + + return weeknum; +} + +/** + * g_date_time_get_day_of_week: + * @datetime: a #GDateTime + * + * Retrieves the ISO 8601 day of the week on which @datetime falls (1 is + * Monday, 2 is Tuesday... 7 is Sunday). + * + * Return value: the day of the week + * + * Since: 2.26 + */ +gint +g_date_time_get_day_of_week (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, 0); + + return (datetime->days - 1) % 7 + 1; +} + +/* Day of year getter {{{1 */ +/** + * g_date_time_get_day_of_year: + * @datetime: a #GDateTime + * + * Retrieves the day of the year represented by @datetime in the Gregorian + * calendar. + * + * Return value: the day of the year + * + * Since: 2.26 + */ +gint +g_date_time_get_day_of_year (GDateTime *datetime) +{ + gint doy = 0; + + g_return_val_if_fail (datetime != NULL, 0); + + g_date_time_get_week_number (datetime, NULL, NULL, &doy); + return doy; +} + +/* Time component getters {{{1 */ + +/** + * g_date_time_get_hour: + * @datetime: a #GDateTime + * + * Retrieves the hour of the day represented by @datetime + * + * Return value: the hour of the day + * + * Since: 2.26 + */ +gint +g_date_time_get_hour (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, 0); + + return (datetime->usec / USEC_PER_HOUR); +} + +/** + * g_date_time_get_minute: + * @datetime: a #GDateTime + * + * Retrieves the minute of the hour represented by @datetime + * + * Return value: the minute of the hour + * + * Since: 2.26 + */ +gint +g_date_time_get_minute (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, 0); + + return (datetime->usec % USEC_PER_HOUR) / USEC_PER_MINUTE; +} + +/** + * g_date_time_get_second: + * @datetime: a #GDateTime + * + * Retrieves the second of the minute represented by @datetime + * + * Return value: the second represented by @datetime + * + * Since: 2.26 + */ +gint +g_date_time_get_second (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, 0); + + return (datetime->usec % USEC_PER_MINUTE) / USEC_PER_SECOND; +} + +/** + * g_date_time_get_microsecond: + * @datetime: a #GDateTime + * + * Retrieves the microsecond of the date represented by @datetime + * + * Return value: the microsecond of the second + * + * Since: 2.26 + */ +gint +g_date_time_get_microsecond (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, 0); + + return (datetime->usec % USEC_PER_SECOND); +} + +/** + * g_date_time_get_seconds: + * @datetime: a #GDateTime + * + * Retrieves the number of seconds since the start of the last minute, + * including the fractional part. + * + * Returns: the number of seconds + * + * Since: 2.26 + **/ +gdouble +g_date_time_get_seconds (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, 0); + + return (datetime->usec % USEC_PER_MINUTE) / 1000000.0; +} + +/* Exporters {{{1 */ +/** + * g_date_time_to_unix: + * @datetime: a #GDateTime + * + * Gives the Unix time corresponding to @datetime, rounding down to the + * nearest second. + * + * Unix time is the number of seconds that have elapsed since 1970-01-01 + * 00:00:00 UTC, regardless of the time zone associated with @datetime. + * + * Returns: the Unix time corresponding to @datetime + * + * Since: 2.26 + **/ +gint64 +g_date_time_to_unix (GDateTime *datetime) +{ + return INSTANT_TO_UNIX (g_date_time_to_instant (datetime)); +} + +/** + * g_date_time_to_timeval: + * @datetime: a #GDateTime + * @tv: a #GTimeVal to modify + * + * Stores the instant in time that @datetime represents into @tv. + * + * The time contained in a #GTimeVal is always stored in the form of + * seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the time + * zone associated with @datetime. + * + * On systems where 'long' is 32bit (ie: all 32bit systems and all + * Windows systems), a #GTimeVal is incapable of storing the entire + * range of values that #GDateTime is capable of expressing. On those + * systems, this function returns %FALSE to indicate that the time is + * out of range. + * + * On systems where 'long' is 64bit, this function never fails. + * + * Returns: %TRUE if successful, else %FALSE + * + * Since: 2.26 + **/ +gboolean +g_date_time_to_timeval (GDateTime *datetime, + GTimeVal *tv) +{ + tv->tv_sec = INSTANT_TO_UNIX (g_date_time_to_instant (datetime)); + tv->tv_usec = datetime->usec % USEC_PER_SECOND; + + return TRUE; +} + +/* Timezone queries {{{1 */ +/** + * g_date_time_get_utc_offset: + * @datetime: a #GDateTime + * + * Determines the offset to UTC in effect at the time and in the time + * zone of @datetime. + * + * The offset is the number of microseconds that you add to UTC time to + * arrive at local time for the time zone (ie: negative numbers for time + * zones west of GMT, positive numbers for east). + * + * If @datetime represents UTC time, then the offset is always zero. + * + * Returns: the number of microseconds that should be added to UTC to + * get the local time + * + * Since: 2.26 + **/ +GTimeSpan +g_date_time_get_utc_offset (GDateTime *datetime) +{ + gint offset; + + g_return_val_if_fail (datetime != NULL, 0); + + offset = g_time_zone_get_offset (datetime->tz, datetime->interval); + + return (gint64) offset * USEC_PER_SECOND; +} + +/** + * g_date_time_get_timezone_abbreviation: + * @datetime: a #GDateTime + * + * Determines the time zone abbreviation to be used at the time and in + * the time zone of @datetime. + * + * For example, in Toronto this is currently "EST" during the winter + * months and "EDT" during the summer months when daylight savings + * time is in effect. + * + * Returns: (transfer none): the time zone abbreviation. The returned + * string is owned by the #GDateTime and it should not be + * modified or freed + * + * Since: 2.26 + **/ +const gchar * +g_date_time_get_timezone_abbreviation (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, NULL); + + return g_time_zone_get_abbreviation (datetime->tz, datetime->interval); +} + +/** + * g_date_time_is_daylight_savings: + * @datetime: a #GDateTime + * + * Determines if daylight savings time is in effect at the time and in + * the time zone of @datetime. + * + * Returns: %TRUE if daylight savings time is in effect + * + * Since: 2.26 + **/ +gboolean +g_date_time_is_daylight_savings (GDateTime *datetime) +{ + g_return_val_if_fail (datetime != NULL, FALSE); + + return g_time_zone_is_dst (datetime->tz, datetime->interval); +} + +/* Timezone convert {{{1 */ +/** + * g_date_time_to_timezone: + * @datetime: a #GDateTime + * @tz: the new #GTimeZone + * + * Create a new #GDateTime corresponding to the same instant in time as + * @datetime, but in the time zone @tz. + * + * This call can fail in the case that the time goes out of bounds. For + * example, converting 0001-01-01 00:00:00 UTC to a time zone west of + * Greenwich will fail (due to the year 0 being out of range). + * + * You should release the return value by calling g_date_time_unref() + * when you are done with it. + * + * Returns: a new #GDateTime, or %NULL + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_to_timezone (GDateTime *datetime, + GTimeZone *tz) +{ + return g_date_time_from_instant (tz, g_date_time_to_instant (datetime)); +} + +/** + * g_date_time_to_local: + * @datetime: a #GDateTime + * + * Creates a new #GDateTime corresponding to the same instant in time as + * @datetime, but in the local time zone. + * + * This call is equivalent to calling g_date_time_to_timezone() with the + * time zone returned by g_time_zone_new_local(). + * + * Returns: the newly created #GDateTime + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_to_local (GDateTime *datetime) +{ + GDateTime *new; + GTimeZone *local; + + local = g_time_zone_new_local (); + new = g_date_time_to_timezone (datetime, local); + g_time_zone_unref (local); + + return new; +} + +/** + * g_date_time_to_utc: + * @datetime: a #GDateTime + * + * Creates a new #GDateTime corresponding to the same instant in time as + * @datetime, but in UTC. + * + * This call is equivalent to calling g_date_time_to_timezone() with the + * time zone returned by g_time_zone_new_utc(). + * + * Returns: the newly created #GDateTime + * + * Since: 2.26 + **/ +GDateTime * +g_date_time_to_utc (GDateTime *datetime) +{ + GDateTime *new; + GTimeZone *utc; + + utc = g_time_zone_new_utc (); + new = g_date_time_to_timezone (datetime, utc); + g_time_zone_unref (utc); + + return new; +} + +/* Format {{{1 */ +/** + * g_date_time_format: + * @datetime: A #GDateTime + * @format: a valid UTF-8 string, containing the format for the + * #GDateTime + * + * Creates a newly allocated string representing the requested @format. + * + * The following format specifiers are supported: + * + * + * + * %%a: + * + * the abbreviated weekday name according to the current locale + * + * + * %%A: + * + * the full weekday name according to the current locale + * + * + * %%b: + * + * the abbreviated month name according to the current locale + * + * + * %%B: + * + * the full month name according to the current locale + * + * + * %%d: + * + * the day of the month as a decimal number (range 01 to 31) + * + * + * %%e: + * + * the day of the month as a decimal number (range 1 to 31) + * + * + * %%F: + * + * equivalent to %%Y-%%m-%%d (the ISO 8601 date + * format) + * + * + * %%h: + * + * equivalent to %%b + * + * + * %%H: + * + * the hour as a decimal number using a 24-hour clock (range 00 to + * 23) + * + * + * %%I: + * + * the hour as a decimal number using a 12-hour clock (range 01 to + * 12) + * + * + * %%j: + * + * the day of the year as a decimal number (range 001 to 366) + * + * + * %%k: + * + * the hour (24-hour clock) as a decimal number (range 0 to 23); + * single digits are preceded by a blank + * + * + * %%l: + * + * the hour (12-hour clock) as a decimal number (range 1 to 12); + * single digits are preceded by a blank + * + * + * %%m: + * + * the month as a decimal number (range 01 to 12) + * + * + * %%M: + * + * the minute as a decimal number (range 00 to 59) + * + * + * %%N: + * + * the micro-seconds as a decimal number + * + * + * %%p: + * + * either "AM" or "PM" according to the given time value, or the + * corresponding strings for the current locale. Noon is treated as + * "PM" and midnight as "AM". + * + * + * %%P: + * + * like %%p but lowercase: "am" or "pm" or a corresponding string for + * the current locale + * + * + * %%r: + * + * the time in a.m. or p.m. notation + * + * + * %%R: + * + * the time in 24-hour notation (%%H:%%M) + * + * + * %%s: + * + * the number of seconds since the Epoch, that is, since 1970-01-01 + * 00:00:00 UTC + * + * + * %%S: + * + * the second as a decimal number (range 00 to 60) + * + * + * %%t: + * + * a tab character + * + * + * %%u: + * + * the day of the week as a decimal, range 1 to 7, Monday being 1 + * + * + * %%W: + * + * the week number of the current year as a decimal number + * + * + * %%x: + * + * the preferred date representation for the current locale without + * the time + * + * + * %%X: + * + * the preferred time representation for the current locale without + * the date + * + * + * %%y: + * + * the year as a decimal number without the century + * + * + * %%Y: + * + * the year as a decimal number including the century + * + * + * %%z: + * + * the time-zone as hour offset from UTC + * + * + * %%Z: + * + * the time zone or name or abbreviation + * + * + * %%%: + * + * a literal %% character + * + * + * + * Returns: a newly allocated string formatted to the requested format + * or %NULL in the case that there was an error. The string + * should be freed with g_free(). + * + * Since: 2.26 + */ +gchar * +g_date_time_format (GDateTime *datetime, + const gchar *format) +{ + GString *outstr; + gchar *tmp; + gunichar c; + glong utf8len; + gboolean in_mod; + + g_return_val_if_fail (datetime != NULL, NULL); + g_return_val_if_fail (format != NULL, NULL); + g_return_val_if_fail (g_utf8_validate (format, -1, NULL), NULL); + + outstr = g_string_sized_new (strlen (format) * 2); + utf8len = g_utf8_strlen (format, -1); + in_mod = FALSE; + + for (; *format; format = g_utf8_next_char(format)) + { + c = g_utf8_get_char (format); + + switch (c) + { + case '%': + if (!in_mod) + { + in_mod = TRUE; + break; + } + /* Fall through */ + default: + if (in_mod) + { + switch (c) + { + case 'a': + g_string_append (outstr, WEEKDAY_ABBR (datetime)); + break; + case 'A': + g_string_append (outstr, WEEKDAY_FULL (datetime)); + break; + case 'b': + g_string_append (outstr, MONTH_ABBR (datetime)); + break; + case 'B': + g_string_append (outstr, MONTH_FULL (datetime)); + break; + case 'd': + g_string_append_printf (outstr, "%02d", g_date_time_get_day_of_month (datetime)); + break; + case 'e': + g_string_append_printf (outstr, "%2d", g_date_time_get_day_of_month (datetime)); + break; + case 'F': + g_string_append_printf (outstr, "%d-%02d-%02d", + g_date_time_get_year (datetime), + g_date_time_get_month (datetime), + g_date_time_get_day_of_month (datetime)); + break; + case 'h': + g_string_append (outstr, MONTH_ABBR (datetime)); + break; + case 'H': + g_string_append_printf (outstr, "%02d", g_date_time_get_hour (datetime)); + break; + case 'I': + if (g_date_time_get_hour (datetime) == 0) + g_string_append (outstr, "12"); + else + g_string_append_printf (outstr, "%02d", g_date_time_get_hour (datetime) % 12); + break; + case 'j': + g_string_append_printf (outstr, "%03d", g_date_time_get_day_of_year (datetime)); + break; + case 'k': + g_string_append_printf (outstr, "%2d", g_date_time_get_hour (datetime)); + break; + case 'l': + if (g_date_time_get_hour (datetime) == 0) + g_string_append (outstr, "12"); + else + g_string_append_printf (outstr, "%2d", g_date_time_get_hour (datetime) % 12); + break; + case 'm': + g_string_append_printf (outstr, "%02d", g_date_time_get_month (datetime)); + break; + case 'M': + g_string_append_printf (outstr, "%02d", g_date_time_get_minute (datetime)); + break; + case 'N': + g_string_append_printf (outstr, "%"G_GUINT64_FORMAT, datetime->usec % USEC_PER_SECOND); + break; + case 'p': + g_string_append (outstr, GET_AMPM (datetime, FALSE)); + break; + case 'P': + g_string_append (outstr, GET_AMPM (datetime, TRUE)); + break; + case 'r': + { + gint hour = g_date_time_get_hour (datetime) % 12; + if (hour == 0) + hour = 12; + g_string_append_printf (outstr, "%02d:%02d:%02d %s", + hour, + g_date_time_get_minute (datetime), + g_date_time_get_second (datetime), + GET_AMPM (datetime, FALSE)); + } + break; + case 'R': + g_string_append_printf (outstr, "%02d:%02d", + g_date_time_get_hour (datetime), + g_date_time_get_minute (datetime)); + break; + case 's': + g_string_append_printf (outstr, "%" G_GINT64_FORMAT, g_date_time_to_unix (datetime)); + break; + case 'S': + g_string_append_printf (outstr, "%02d", g_date_time_get_second (datetime)); + break; + case 't': + g_string_append_c (outstr, '\t'); + break; + case 'u': + g_string_append_printf (outstr, "%d", g_date_time_get_day_of_week (datetime)); + break; + case 'W': + g_string_append_printf (outstr, "%d", g_date_time_get_day_of_year (datetime) / 7); + break; + case 'x': + { + tmp = GET_PREFERRED_DATE (datetime); + g_string_append (outstr, tmp); + g_free (tmp); + } + break; + case 'X': + { + tmp = GET_PREFERRED_TIME (datetime); + g_string_append (outstr, tmp); + g_free (tmp); + } + break; + case 'y': + g_string_append_printf (outstr, "%02d", g_date_time_get_year (datetime) % 100); + break; + case 'Y': + g_string_append_printf (outstr, "%d", g_date_time_get_year (datetime)); + break; + case 'z': + if (datetime->tz != NULL) + { + gint64 offset = g_date_time_get_utc_offset (datetime) + / USEC_PER_SECOND; + + g_string_append_printf (outstr, "%c%02d%02d", + offset >= 0 ? '+' : '-', + (int) offset / 3600, + (int) offset / 60 % 60); + } + else + g_string_append (outstr, "+0000"); + break; + case 'Z': + g_string_append (outstr, g_date_time_get_timezone_abbreviation (datetime)); + break; + case '%': + g_string_append_c (outstr, '%'); + break; + case 'n': + g_string_append_c (outstr, '\n'); + break; + default: + goto bad_format; + } + in_mod = FALSE; + } + else + g_string_append_unichar (outstr, c); + } + } + + return g_string_free (outstr, FALSE); + +bad_format: + g_string_free (outstr, TRUE); + return NULL; +} + + +/* Epilogue {{{1 */ +/* vim:set foldmethod=marker: */ diff --git a/glib/gdatetime.h b/glib/gdatetime.h new file mode 100644 index 0000000..b76df89 --- /dev/null +++ b/glib/gdatetime.h @@ -0,0 +1,217 @@ +/* + * Copyright (C) 2009-2010 Christian Hergert + * Copyright © 2010 Codethink Limited + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the + * licence, or (at your option) any later version. + * + * This is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + * USA. + * + * Authors: Christian Hergert + * Thiago Santos + * Emmanuele Bassi + * Ryan Lortie + */ + +#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __G_DATE_TIME_H__ +#define __G_DATE_TIME_H__ + +#include + +G_BEGIN_DECLS + +/** + * G_TIME_SPAN_DAY: + * + * Evaluates to a time span of one day. + * + * Since: 2.26 + */ +#define G_TIME_SPAN_DAY (G_GINT64_CONSTANT (86400000000)) + +/** + * G_TIME_SPAN_HOUR: + * + * Evaluates to a time span of one hour. + * + * Since: 2.26 + */ +#define G_TIME_SPAN_HOUR (G_GINT64_CONSTANT (3600000000)) + +/** + * G_TIME_SPAN_MINUTE: + * + * Evaluates to a time span of one minute. + * + * Since: 2.26 + */ +#define G_TIME_SPAN_MINUTE (G_GINT64_CONSTANT (60000000)) + +/** + * G_TIME_SPAN_SECOND: + * + * Evaluates to a time span of one second. + * + * Since: 2.26 + */ +#define G_TIME_SPAN_SECOND (G_GINT64_CONSTANT (1000000)) + +/** + * G_TIME_SPAN_MILLISECOND: + * + * Evaluates to a time span of one millisecond. + * + * Since: 2.26 + */ +#define G_TIME_SPAN_MILLISECOND (G_GINT64_CONSTANT (1000)) + +/** + * GTimeSpan: + * + * A value representing an interval of time, in microseconds. + * + * Since: 2.26 + */ +typedef gint64 GTimeSpan; + +/** + * GDateTime: + * + * GDateTime is an opaque structure whose members + * cannot be accessed directly. + * + * Since: 2.26 + */ +typedef struct _GDateTime GDateTime; + +void g_date_time_unref (GDateTime *datetime); +GDateTime * g_date_time_ref (GDateTime *datetime); + +GDateTime * g_date_time_new_now (GTimeZone *tz); +GDateTime * g_date_time_new_now_local (void); +GDateTime * g_date_time_new_now_utc (void); + +GDateTime * g_date_time_new_from_unix_local (gint64 t); +GDateTime * g_date_time_new_from_unix_utc (gint64 t); + +GDateTime * g_date_time_new_from_timeval_local (const GTimeVal *tv); +GDateTime * g_date_time_new_from_timeval_utc (const GTimeVal *tv); + +GDateTime * g_date_time_new (GTimeZone *tz, + gint year, + gint month, + gint day, + gint hour, + gint minute, + gdouble seconds); +GDateTime * g_date_time_new_local (gint year, + gint month, + gint day, + gint hour, + gint minute, + gdouble seconds); +GDateTime * g_date_time_new_utc (gint year, + gint month, + gint day, + gint hour, + gint minute, + gdouble seconds); + +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add (GDateTime *datetime, + GTimeSpan timespan); + +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_years (GDateTime *datetime, + gint years); +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_months (GDateTime *datetime, + gint months); +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_weeks (GDateTime *datetime, + gint weeks); +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_days (GDateTime *datetime, + gint days); + +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_hours (GDateTime *datetime, + gint hours); +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_minutes (GDateTime *datetime, + gint minutes); +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_seconds (GDateTime *datetime, + gdouble seconds); + +G_GNUC_WARN_UNUSED_RESULT +GDateTime * g_date_time_add_full (GDateTime *datetime, + gint years, + gint months, + gint days, + gint hours, + gint minutes, + gdouble seconds); + +gint g_date_time_compare (gconstpointer dt1, + gconstpointer dt2); +GTimeSpan g_date_time_difference (GDateTime *end, + GDateTime *begin); +guint g_date_time_hash (gconstpointer datetime); +gboolean g_date_time_equal (gconstpointer dt1, + gconstpointer dt2); + +void g_date_time_get_ymd (GDateTime *datetime, + gint *year, + gint *month, + gint *day); + +gint g_date_time_get_year (GDateTime *datetime); +gint g_date_time_get_month (GDateTime *datetime); +gint g_date_time_get_day_of_month (GDateTime *datetime); + +gint g_date_time_get_week_numbering_year (GDateTime *datetime); +gint g_date_time_get_week_of_year (GDateTime *datetime); +gint g_date_time_get_day_of_week (GDateTime *datetime); + +gint g_date_time_get_day_of_year (GDateTime *datetime); + +gint g_date_time_get_hour (GDateTime *datetime); +gint g_date_time_get_minute (GDateTime *datetime); +gint g_date_time_get_second (GDateTime *datetime); +gint g_date_time_get_microsecond (GDateTime *datetime); +gdouble g_date_time_get_seconds (GDateTime *datetime); + +gint64 g_date_time_to_unix (GDateTime *datetime); +gboolean g_date_time_to_timeval (GDateTime *datetime, + GTimeVal *tv); + +GTimeSpan g_date_time_get_utc_offset (GDateTime *datetime); +const gchar * g_date_time_get_timezone_abbreviation (GDateTime *datetime); +gboolean g_date_time_is_daylight_savings (GDateTime *datetime); + +GDateTime * g_date_time_to_timezone (GDateTime *datetime, + GTimeZone *tz); +GDateTime * g_date_time_to_local (GDateTime *datetime); +GDateTime * g_date_time_to_utc (GDateTime *datetime); + +gchar * g_date_time_format (GDateTime *datetime, + const gchar *format) G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* __G_DATE_TIME_H__ */ diff --git a/glib/gdir.c b/glib/gdir.c index c6997ae..0f0a17f 100644 --- a/glib/gdir.c +++ b/glib/gdir.c @@ -34,12 +34,14 @@ #include #endif -#include "glib.h" #include "gdir.h" +#include "gconvert.h" +#include "gfileutils.h" +#include "gstrfuncs.h" +#include "gtestutils.h" #include "glibintl.h" -#include "galias.h" #if defined (_MSC_VER) && !defined (HAVE_DIRENT_H) #include "../build/win32/dirent/dirent.h" @@ -68,7 +70,8 @@ struct _GDir * g_dir_open() fails. * * Opens a directory for reading. The names of the files in the - * directory can then be retrieved using g_dir_read_name(). + * directory can then be retrieved using g_dir_read_name(). Note + * that the ordering is not defined. * * Return value: a newly allocated #GDir on success, %NULL on failure. * If non-%NULL, you must free the result with g_dir_close() @@ -176,9 +179,16 @@ g_dir_open (const gchar *path, * g_dir_read_name: * @dir: a #GDir* created by g_dir_open() * - * Retrieves the name of the next entry in the directory. The '.' and - * '..' entries are omitted. On Windows, the returned name is in - * UTF-8. On Unix, it is in the on-disk encoding. + * Retrieves the name of another entry in the directory, or %NULL. + * The order of entries returned from this function is not defined, + * and may vary by file system or other operating-system dependent + * factors. + * + * On Unix, the '.' and '..' entries are omitted, and the returned + * name is in the on-disk encoding. + * + * On Windows, as is true of all GLib functions which operate on + * filenames, the returned name is in UTF-8. * * Return value: The entry's name or %NULL if there are no * more entries. The return value is owned by GLib and @@ -302,6 +312,3 @@ g_dir_close (GDir *dir) #endif g_free (dir); } - -#define __G_DIR_C__ -#include "galiasdef.c" diff --git a/glib/gerror.c b/glib/gerror.c index 4327f9a..1f39739 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -26,9 +26,10 @@ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "gerror.h" +#include "gstrfuncs.h" +#include "gtestutils.h" /** * g_error_new_valist: @@ -384,6 +385,3 @@ g_propagate_prefixed_error (GError **dest, va_end (ap); } } - -#define __G_ERROR_C__ -#include "galiasdef.c" diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 76335fa..185a756 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -19,8 +19,7 @@ */ #include "config.h" - -#include "glib.h" +#include "glibconfig.h" #include #ifdef HAVE_UNISTD_H @@ -49,10 +48,11 @@ #define O_BINARY 0 #endif +#include "gfileutils.h" + #include "gstdio.h" #include "glibintl.h" -#include "galias.h" /** * g_mkdir_with_parents: @@ -1057,6 +1057,9 @@ write_to_temp_file (const gchar *contents, * it returns %FALSE and sets @error. The error domain is #G_FILE_ERROR. * Possible error codes are those in the #GFileError enumeration. * + * Note that the name for the temporary file is constructed by appending up + * to 7 characters to @filename. + * * Return value: %TRUE on success, %FALSE if an error occurred * * Since: 2.8 @@ -2015,6 +2018,3 @@ g_file_open_tmp (const gchar *tmpl, } #endif - -#define __G_FILEUTILS_C__ -#include "galiasdef.c" diff --git a/glib/ghash.c b/glib/ghash.c index 417ed5d..5f2df05 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -32,8 +32,11 @@ #include /* memset */ -#include "glib.h" -#include "galias.h" +#include "ghash.h" + +#include "gatomic.h" +#include "gtestutils.h" + /** * SECTION: hash_tables @@ -1456,6 +1459,3 @@ g_hash_table_get_values (GHashTable *hash_table) return retval; } - -#define __G_HASH_C__ -#include "galiasdef.c" diff --git a/glib/ghook.c b/glib/ghook.c index d038ee2..1406b58 100644 --- a/glib/ghook.c +++ b/glib/ghook.c @@ -24,17 +24,18 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "ghook.h" + +#include "gtestutils.h" /* --- functions --- */ @@ -633,6 +634,3 @@ g_hook_compare_ids (GHook *new_hook, return 0; } - -#define __G_HOOK_C__ -#include "galiasdef.c" diff --git a/glib/ghostutils.c b/glib/ghostutils.c index 3871456..99afe9a 100644 --- a/glib/ghostutils.c +++ b/glib/ghostutils.c @@ -21,17 +21,20 @@ #include "config.h" -#include "glib.h" -#include "glibintl.h" - #include -#include "galias.h" +#include "ghostutils.h" + +#include "garray.h" +#include "gmem.h" +#include "gstring.h" +#include "gstrfuncs.h" +#include "glibintl.h" + /** * SECTION:ghostutils * @short_description: Internet hostname utilities - * @include: glib.h * * Functions for manipulating internet hostnames; in particular, for * converting between Unicode and ASCII-encoded forms of @@ -300,7 +303,8 @@ idna_is_prohibited (gunichar ch) /* RFC 3491 IDN cleanup algorithm. */ static gchar * nameprep (const gchar *hostname, - gint len) + gint len, + gboolean *is_unicode) { gchar *name, *tmp = NULL, *p; @@ -333,12 +337,15 @@ nameprep (const gchar *hostname, /* If there are no UTF8 characters, we're done. */ if (!contains_non_ascii (name, len)) { + *is_unicode = FALSE; if (name == (gchar *)hostname) return len == -1 ? g_strdup (hostname) : g_strndup (hostname, len); else return name; } + *is_unicode = TRUE; + /* Normalize */ name = g_utf8_normalize (name, len, G_NORMALIZE_NFKC); g_free (tmp); @@ -380,6 +387,26 @@ nameprep (const gchar *hostname, return name; } +/* RFC 3490, section 3.1 says '.', 0x3002, 0xFF0E, and 0xFF61 count as + * label-separating dots. @str must be '\0'-terminated. + */ +#define idna_is_dot(str) ( \ + ((guchar)(str)[0] == '.') || \ + ((guchar)(str)[0] == 0xE3 && (guchar)(str)[1] == 0x80 && (guchar)(str)[2] == 0x82) || \ + ((guchar)(str)[0] == 0xEF && (guchar)(str)[1] == 0xBC && (guchar)(str)[2] == 0x8E) || \ + ((guchar)(str)[0] == 0xEF && (guchar)(str)[1] == 0xBD && (guchar)(str)[2] == 0xA1) ) + +static const gchar * +idna_end_of_label (const gchar *str) +{ + for (; *str; str = g_utf8_next_char (str)) + { + if (idna_is_dot (str)) + return str; + } + return str; +} + /** * g_hostname_to_ascii: * @hostname: a valid UTF-8 or ASCII hostname @@ -401,16 +428,16 @@ g_hostname_to_ascii (const gchar *hostname) gssize llen, oldlen; gboolean unicode; - label = name = nameprep (hostname, -1); - if (!name) - return NULL; + label = name = nameprep (hostname, -1, &unicode); + if (!name || !unicode) + return name; out = g_string_new (NULL); do { unicode = FALSE; - for (p = label; *p && *p != '.'; p++) + for (p = label; *p && !idna_is_dot (p); p++) { if ((guchar)*p > 0x80) unicode = TRUE; @@ -434,7 +461,9 @@ g_hostname_to_ascii (const gchar *hostname) goto fail; label += llen; - if (*label && *++label) + if (*label) + label = g_utf8_next_char (label); + if (*label) g_string_append_c (out, '.'); } while (*label); @@ -582,7 +611,7 @@ g_hostname_to_unicode (const gchar *hostname) do { - llen = strcspn (hostname, "."); + llen = idna_end_of_label (hostname) - hostname; if (!g_ascii_strncasecmp (hostname, IDNA_ACE_PREFIX, IDNA_ACE_PREFIX_LEN)) { hostname += IDNA_ACE_PREFIX_LEN; @@ -595,7 +624,8 @@ g_hostname_to_unicode (const gchar *hostname) } else { - gchar *canonicalized = nameprep (hostname, llen); + gboolean unicode; + gchar *canonicalized = nameprep (hostname, llen, &unicode); if (!canonicalized) { @@ -607,7 +637,9 @@ g_hostname_to_unicode (const gchar *hostname) } hostname += llen; - if (*hostname && *++hostname) + if (*hostname) + hostname = g_utf8_next_char (hostname); + if (*hostname) g_string_append_c (out, '.'); } while (*hostname); @@ -640,8 +672,10 @@ g_hostname_is_ascii_encoded (const gchar *hostname) { if (!g_ascii_strncasecmp (hostname, IDNA_ACE_PREFIX, IDNA_ACE_PREFIX_LEN)) return TRUE; - hostname = strchr (hostname, '.'); - if (!hostname++) + hostname = idna_end_of_label (hostname); + if (*hostname) + hostname = g_utf8_next_char (hostname); + if (!*hostname) return FALSE; } } @@ -764,6 +798,3 @@ g_hostname_is_ip_address (const gchar *hostname) /* If there's nothing left to parse, then it's ok. */ return !*p; } - -#define __G_HOST_UTILS_C__ -#include "galiasdef.c" diff --git a/glib/giochannel.c b/glib/giochannel.c index 68acd60..e70e40a 100644 --- a/glib/giochannel.c +++ b/glib/giochannel.c @@ -42,13 +42,12 @@ #undef G_DISABLE_DEPRECATED -#include "glib.h" - #include "giochannel.h" +#include "gstrfuncs.h" +#include "gtestutils.h" #include "glibintl.h" -#include "galias.h" /** * SECTION: iochannels @@ -645,7 +644,7 @@ g_io_create_watch (GIOChannel *channel, * * This internally creates a main loop source using g_io_create_watch() * and attaches it to the main loop context with g_source_attach(). - * You can do these steps manuallt if you need greater control. + * You can do these steps manually if you need greater control. * * Returns: the event source id */ @@ -2579,6 +2578,3 @@ g_io_channel_error_quark (void) { return g_quark_from_static_string ("g-io-channel-error-quark"); } - -#define __G_IOCHANNEL_C__ -#include "galiasdef.c" diff --git a/glib/giounix.c b/glib/giounix.c index 0e89d5c..5624ac9 100644 --- a/glib/giounix.c +++ b/glib/giounix.c @@ -24,10 +24,10 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ @@ -43,8 +43,12 @@ #include #include -#include "glib.h" -#include "galias.h" +#include "giochannel.h" + +#include "gerror.h" +#include "gfileutils.h" +#include "gstrfuncs.h" +#include "gtestutils.h" /* * Unix IO Channels @@ -344,6 +348,7 @@ g_io_unix_create_watch (GIOChannel *channel, source = g_source_new (&g_io_watch_funcs, sizeof (GIOUnixWatch)); + g_source_set_name (source, "GIOChannel (Unix)"); watch = (GIOUnixWatch *)source; watch->channel = channel; @@ -449,7 +454,10 @@ g_io_channel_new_file (const gchar *filename, MODE_R = 1 << 0, MODE_W = 1 << 1, MODE_A = 1 << 2, - MODE_PLUS = 1 << 3 + MODE_PLUS = 1 << 3, + MODE_R_PLUS = MODE_R | MODE_PLUS, + MODE_W_PLUS = MODE_W | MODE_PLUS, + MODE_A_PLUS = MODE_A | MODE_PLUS } mode_num; struct stat buffer; @@ -500,15 +508,16 @@ g_io_channel_new_file (const gchar *filename, case MODE_A: flags = O_WRONLY | O_APPEND | O_CREAT; break; - case MODE_R | MODE_PLUS: + case MODE_R_PLUS: flags = O_RDWR; break; - case MODE_W | MODE_PLUS: + case MODE_W_PLUS: flags = O_RDWR | O_TRUNC | O_CREAT; break; - case MODE_A | MODE_PLUS: + case MODE_A_PLUS: flags = O_RDWR | O_APPEND | O_CREAT; break; + case MODE_PLUS: default: g_assert_not_reached (); flags = 0; @@ -551,12 +560,13 @@ g_io_channel_new_file (const gchar *filename, channel->is_readable = FALSE; channel->is_writeable = TRUE; break; - case MODE_R | MODE_PLUS: - case MODE_W | MODE_PLUS: - case MODE_A | MODE_PLUS: + case MODE_R_PLUS: + case MODE_W_PLUS: + case MODE_A_PLUS: channel->is_readable = TRUE; channel->is_writeable = TRUE; break; + case MODE_PLUS: default: g_assert_not_reached (); } @@ -640,6 +650,3 @@ g_io_channel_unix_get_fd (GIOChannel *channel) GIOUnixChannel *unix_channel = (GIOUnixChannel *)channel; return unix_channel->fd; } - -#define __G_IO_UNIX_C__ -#include "galiasdef.c" diff --git a/glib/giowin32.c b/glib/giowin32.c index ae2dcde..c632c59 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -84,7 +84,6 @@ #include "gstdio.h" #include "glibintl.h" -#include "galias.h" typedef struct _GIOWin32Channel GIOWin32Channel; typedef struct _GIOWin32Watch GIOWin32Watch; @@ -1167,6 +1166,7 @@ g_io_win32_msg_create_watch (GIOChannel *channel, GSource *source; source = g_source_new (&g_io_watch_funcs, sizeof (GIOWin32Watch)); + g_source_set_name (source, "GIOChannel (Win32)"); watch = (GIOWin32Watch *)source; watch->channel = channel; @@ -2239,6 +2239,3 @@ g_io_channel_win32_new_stream_socket (int socket) } #endif - -#define __G_IO_WIN32_C__ -#include "galiasdef.c" diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index 2226e70..10ca2a2 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -1,6 +1,8 @@ /* gkeyfile.c - key file parser * * Copyright 2004 Red Hat, Inc. + * Copyright 2009-2010 Collabora Ltd. + * Copyright 2009 Nokia Corporation * * Written by Ray Strode * Matthias Clasen @@ -63,7 +65,6 @@ #include "gstrfuncs.h" #include "gutils.h" -#include "galias.h" typedef struct _GKeyFileGroup GKeyFileGroup; @@ -2161,6 +2162,156 @@ g_key_file_set_integer (GKeyFile *key_file, } /** + * g_key_file_get_int64: + * @key_file: a non-%NULL #GKeyFile + * @group_name: a non-%NULL group name + * @key: a non-%NULL key + * @error: return location for a #GError + * + * Returns the value associated with @key under @group_name as a signed + * 64-bit integer. This is similar to g_key_file_get_integer() but can return + * 64-bit results without truncation. + * + * Returns: the value associated with the key as a signed 64-bit integer, or + * 0 if the key was not found or could not be parsed. + * + * Since: 2.26 + */ +gint64 +g_key_file_get_int64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + GError **error) +{ + gchar *s, *end; + gint64 v; + + g_return_val_if_fail (key_file != NULL, -1); + g_return_val_if_fail (group_name != NULL, -1); + g_return_val_if_fail (key != NULL, -1); + + s = g_key_file_get_value (key_file, group_name, key, error); + + if (s == NULL) + return 0; + + v = g_ascii_strtoll (s, &end, 10); + + if (*s == '\0' || *end != '\0') + { + g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE, + "Key '%s' in group '%s' has value '%s' where int64 was expected", + key, group_name, s); + return 0; + } + + g_free (s); + return v; +} + +/** + * g_key_file_set_int64: + * @key_file: a #GKeyFile + * @group_name: a group name + * @key: a key + * @value: an integer value + * + * Associates a new integer value with @key under @group_name. + * If @key cannot be found then it is created. + * + * Since: 2.26 + **/ +void +g_key_file_set_int64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + gint64 value) +{ + gchar *result; + + g_return_if_fail (key_file != NULL); + + result = g_strdup_printf ("%" G_GINT64_FORMAT, value); + g_key_file_set_value (key_file, group_name, key, result); + g_free (result); +} + +/** + * g_key_file_get_uint64: + * @key_file: a non-%NULL #GKeyFile + * @group_name: a non-%NULL group name + * @key: a non-%NULL key + * @error: return location for a #GError + * + * Returns the value associated with @key under @group_name as an unsigned + * 64-bit integer. This is similar to g_key_file_get_integer() but can return + * large positive results without truncation. + * + * Returns: the value associated with the key as an unsigned 64-bit integer, + * or 0 if the key was not found or could not be parsed. + * + * Since: 2.26 + */ +guint64 +g_key_file_get_uint64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + GError **error) +{ + gchar *s, *end; + guint64 v; + + g_return_val_if_fail (key_file != NULL, -1); + g_return_val_if_fail (group_name != NULL, -1); + g_return_val_if_fail (key != NULL, -1); + + s = g_key_file_get_value (key_file, group_name, key, error); + + if (s == NULL) + return 0; + + v = g_ascii_strtoull (s, &end, 10); + + if (*s == '\0' || *end != '\0') + { + g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE, + "Key '%s' in group '%s' has value '%s' where uint64 was expected", + key, group_name, s); + return 0; + } + + g_free (s); + return v; +} + +/** + * g_key_file_set_uint64: + * @key_file: a #GKeyFile + * @group_name: a group name + * @key: a key + * @value: an integer value + * + * Associates a new integer value with @key under @group_name. + * If @key cannot be found then it is created. + * + * Since: 2.26 + **/ +void +g_key_file_set_uint64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + guint64 value) +{ + gchar *result; + + g_return_if_fail (key_file != NULL); + + result = g_strdup_printf ("%" G_GUINT64_FORMAT, value); + g_key_file_set_value (key_file, group_name, key, result); + g_free (result); +} + +/** * g_key_file_get_integer_list: * @key_file: a #GKeyFile * @group_name: a group name @@ -3777,6 +3928,3 @@ g_key_file_parse_comment_as_value (GKeyFile *key_file, return g_string_free (string, FALSE); } - -#define __G_KEY_FILE_C__ -#include "galiasdef.c" diff --git a/glib/gkeyfile.h b/glib/gkeyfile.h index b19124c..e16dc61 100644 --- a/glib/gkeyfile.h +++ b/glib/gkeyfile.h @@ -136,6 +136,22 @@ void g_key_file_set_integer (GKeyFile *key_file, const gchar *group_name, const gchar *key, gint value); +gint64 g_key_file_get_int64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + GError **error); +void g_key_file_set_int64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + gint64 value); +guint64 g_key_file_get_uint64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + GError **error); +void g_key_file_set_uint64 (GKeyFile *key_file, + const gchar *group_name, + const gchar *key, + guint64 value); gdouble g_key_file_get_double (GKeyFile *key_file, const gchar *group_name, const gchar *key, diff --git a/glib/glib-object.h b/glib/glib-object.h index 8687ef1..10cff1b 100644 --- a/glib/glib-object.h +++ b/glib/glib-object.h @@ -22,6 +22,7 @@ #define __GLIB_GOBJECT_H_INSIDE__ /* topmost include file for GObject header files */ +#include #include #include #include diff --git a/glib/glib.h b/glib/glib.h index e07ec82..06d0190 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ #include #include #include +#include #include #include #include diff --git a/glib/glib.py b/glib/glib.py index 0953aee..135f4bc 100644 --- a/glib/glib.py +++ b/glib/glib.py @@ -115,10 +115,7 @@ class GHashPrinter: try: string_hash = read_global_var ("g_str_hash") except: - try: - string_hash = read_global_var ("IA__g_str_hash") - except: - string_hash = None + string_hash = None if self.val != 0 and string_hash != None and self.val["hash_func"] == string_hash: self.keys_are_strings = True diff --git a/glib/glib.rc b/glib/glib.rc index f116137..e27182a 100644 --- a/glib/glib.rc +++ b/glib/glib.rc @@ -1,8 +1,8 @@ #include VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,24,2,0 - PRODUCTVERSION 2,24,2,0 + FILEVERSION 2,27,5,0 + PRODUCTVERSION 2,27,5,0 FILEFLAGSMASK 0 FILEFLAGS 0 FILEOS VOS__WINDOWS32 @@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO BEGIN VALUE "CompanyName", "The GLib developer community" VALUE "FileDescription", "GLib" - VALUE "FileVersion", "2.24.2.0" + VALUE "FileVersion", "2.27.5.0" VALUE "InternalName", "libglib-2.0-0" VALUE "LegalCopyright", "Copyright © 1995-2010 Peter Mattis, Spencer Kimball, Josh MacDonald and others." VALUE "OriginalFilename", "libglib-2.0-0.dll" VALUE "ProductName", "GLib" - VALUE "ProductVersion", "2.24.2" + VALUE "ProductVersion", "2.27.5" END END BLOCK "VarFileInfo" diff --git a/glib/glib.stp.in b/glib/glib.stp.in new file mode 100644 index 0000000..95d3351 --- /dev/null +++ b/glib/glib.stp.in @@ -0,0 +1,84 @@ +global gquarks + +/* This is needed to keep track of gquark for use in other probes.*/ +probe process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("quark__new") +{ + gquarks[pid(), $arg2] = user_string($arg1) +} + +/** + * probe glib.quark_new - Called when a #GQuark is initially created + * @quark: integer value for the quark + * @str: string form of the quark + */ +probe glib.quark_new = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("quark__new") +{ + str = user_string ($arg1); + quark = $arg2; + probestr = sprintf("glib.quark_new(%s) -> %d", str, quark); +} + +/** + * probe glib.mem_alloc - Called when a malloc block is initially requested + * @mem: Raw memory pointer returned + * @n_bytes: number of bytes + * @zeroed: Boolean value, %TRUE if this block was filled with NUL bytes + * @failable: Boolean value, %TRUE if program execution can continue on allocation failure + */ +probe glib.mem_alloc = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("mem__alloc") +{ + mem = $arg1; + n_bytes = $arg2; + zeroed = $arg3; + failable = $arg4; + probestr = sprintf("glib.mem_alloc(n_bytes=%d) -> %p", n_bytes, mem); +} + +/** + * probe glib.mem_free - Called when a malloc block freed + */ +probe glib.mem_free = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("mem__free") +{ + mem = $arg1; /* ARG: @mem: Raw memory pointer */ + probestr = sprintf("glib.mem_free(mem=%p)", mem); +} + +/** + * probe glib.mem_realloc - Called when a malloc block is resized + * @mem: Raw memory pointer returned + * @old_mem: Original memory pointer + * @n_bytes: number of bytes + * @failable: Boolean value, %TRUE if program execution can continue on allocation failure + */ +probe glib.mem_realloc = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("mem__realloc") +{ + mem = $arg1; + old_mem = $arg2; + n_bytes = $arg3; + failable = $arg4; + probestr = sprintf("glib.mem_realloc(old_mem=%p, n_bytes=%d) -> %p", old_mem, n_bytes, mem); +} + +/** + * probe glib.slice_alloc - Called when g_slice_alloc() is used + * @mem: Raw memory pointer returned + * @n_bytes: number of bytes + */ +probe glib.slice_alloc = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("slice__alloc") +{ + mem = $arg1; + n_bytes = $arg2; + probestr = sprintf("glib.slice_alloc(n_bytes=%d) -> %p", n_bytes, mem); +} + +/** + * probe glib.slice_free - Called when memory slice is freed + * @mem: Raw memory pointer returned + * @n_bytes: Number of bytes + */ +probe glib.slice_free = process("@ABS_GLIB_RUNTIME_LIBDIR@/libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@").mark("slice__free") +{ + mem = $arg1; + n_bytes = $arg2; + probestr = sprintf("glib.slice_free(n_bytes=%d) -> %p", n_bytes, mem); +} diff --git a/glib/glib.symbols b/glib/glib.symbols index f9a0d8d..0c4b0d1 100644 --- a/glib/glib.symbols +++ b/glib/glib.symbols @@ -1,7 +1,5 @@ /* This file lists all exported symbols. It is used to generate - * the glib.def file used to control exports on Windows and the - * galias.h/galiasdef.c files used to avoid PLT entries for - * internal uses of exported functions (see makegalias.pl). + * the glib.def file used to control exports on Windows. * * Every symbol must be included in the right * #ifdef IN_HEADER(sym) #endif and @@ -325,6 +323,73 @@ g_date_valid_year G_GNUC_CONST #endif #endif +#if IN_HEADER(__G_DATE_TIME_H__) +#if IN_FILE(__G_DATE_TIME_C__) +g_date_time_add +g_date_time_add_days +g_date_time_add_full +g_date_time_add_hours +g_date_time_add_minutes +g_date_time_add_months +g_date_time_add_seconds +g_date_time_add_weeks +g_date_time_add_years +g_date_time_compare +g_date_time_difference +g_date_time_equal +g_date_time_format G_GNUC_MALLOC +g_date_time_get_day_of_month +g_date_time_get_day_of_week +g_date_time_get_day_of_year +g_date_time_get_hour +g_date_time_get_microsecond +g_date_time_get_minute +g_date_time_get_month +g_date_time_get_second +g_date_time_get_seconds +g_date_time_get_timezone_abbreviation +g_date_time_get_utc_offset +g_date_time_get_week_numbering_year +g_date_time_get_week_of_year +g_date_time_get_year +g_date_time_get_ymd +g_date_time_hash +g_date_time_is_daylight_savings +g_date_time_new +g_date_time_new_from_timeval_local +g_date_time_new_from_timeval_utc +g_date_time_new_from_unix_local +g_date_time_new_from_unix_utc +g_date_time_new_local +g_date_time_new_now +g_date_time_new_now_local +g_date_time_new_now_utc +g_date_time_new_utc +g_date_time_ref +g_date_time_to_local +g_date_time_to_timeval +g_date_time_to_timezone +g_date_time_to_unix +g_date_time_to_utc +g_date_time_unref +#endif +#endif + +#if IN_HEADER(__G_TIME_ZONE_H__) +#if IN_FILE(__G_TIME_ZONE_C__) +g_time_zone_new +g_time_zone_new_local +g_time_zone_new_utc +g_time_zone_ref +g_time_zone_unref +g_time_zone_adjust_time +g_time_zone_find_interval +g_time_zone_get_abbreviation +g_time_zone_get_offset +g_time_zone_is_dst +#endif +#endif + #if IN_HEADER(__G_DIR_H__) #if IN_FILE(__G_DIR_C__) g_dir_close @@ -533,6 +598,8 @@ g_key_file_get_groups G_GNUC_MALLOC g_key_file_get_double g_key_file_get_double_list G_GNUC_MALLOC g_key_file_get_integer +g_key_file_get_int64 +g_key_file_get_uint64 g_key_file_get_integer_list G_GNUC_MALLOC g_key_file_get_keys G_GNUC_MALLOC g_key_file_get_locale_string G_GNUC_MALLOC @@ -557,6 +624,8 @@ g_key_file_set_comment g_key_file_set_double g_key_file_set_double_list g_key_file_set_integer +g_key_file_set_int64 +g_key_file_set_uint64 g_key_file_set_integer_list g_key_file_set_list_separator g_key_file_set_locale_string @@ -580,6 +649,7 @@ g_list_find_custom g_list_first g_list_foreach g_list_free +g_list_free_full g_list_free_1 g_list_index g_list_insert @@ -614,6 +684,8 @@ g_child_watch_add g_child_watch_add_full g_child_watch_source_new g_get_current_time +g_get_monotonic_time +g_get_real_time g_main_context_acquire g_main_context_add_poll g_main_context_check @@ -639,6 +711,8 @@ g_main_context_set_poll_func g_main_context_unref g_main_context_wait g_main_context_wakeup +g_main_context_invoke +g_main_context_invoke_full g_main_depth g_main_current_source g_main_loop_get_context @@ -648,24 +722,32 @@ g_main_loop_quit g_main_loop_ref g_main_loop_run g_main_loop_unref +g_source_add_child_source g_source_add_poll g_source_attach g_source_destroy g_source_get_can_recurse g_source_get_context +g_source_get_time +#ifndef G_DISABLE_DEPRECATED g_source_get_current_time +#endif g_source_get_id +g_source_get_name g_source_get_priority g_source_new g_source_ref g_source_remove g_source_remove_by_funcs_user_data g_source_remove_by_user_data +g_source_remove_child_source g_source_remove_poll g_source_set_callback g_source_set_callback_indirect g_source_set_can_recurse g_source_set_funcs +g_source_set_name +g_source_set_name_by_id g_source_is_destroyed g_source_set_priority g_source_unref @@ -1040,6 +1122,8 @@ g_sequence_remove_range g_sequence_move_range g_sequence_search g_sequence_search_iter +g_sequence_lookup +g_sequence_lookup_iter g_sequence_get g_sequence_set g_sequence_iter_is_begin @@ -1074,6 +1158,7 @@ g_slist_find g_slist_find_custom g_slist_foreach g_slist_free +g_slist_free_full g_slist_free_1 g_slist_index g_slist_insert @@ -1204,6 +1289,7 @@ g_strdown g_strv_length g_strip_context G_GNUC_FORMAT(1) g_dgettext G_GNUC_FORMAT(2) +g_dcgettext G_GNUC_FORMAT(2) g_dngettext G_GNUC_FORMAT(3) g_dpgettext G_GNUC_FORMAT(2) g_dpgettext2 G_GNUC_FORMAT(3) @@ -1561,6 +1647,7 @@ g_get_host_name g_setenv PRIVATE #endif g_listenv +g_get_environ #ifdef G_OS_WIN32 g_find_program_in_path_utf8 g_get_current_dir_utf8 @@ -1592,6 +1679,7 @@ g_get_user_cache_dir g_get_user_config_dir g_get_user_data_dir g_reload_user_special_dirs_cache +g_get_user_runtime_dir g_get_user_special_dir #ifndef _WIN64 g_get_user_name PRIVATE @@ -1631,6 +1719,8 @@ g_regex_get_pattern g_regex_get_max_backref g_regex_get_capture_count g_regex_get_string_number +g_regex_get_compile_flags +g_regex_get_match_flags g_regex_escape_string g_regex_match_simple g_regex_match @@ -1700,6 +1790,7 @@ g_variant_type_checked_ g_variant_unref g_variant_ref g_variant_ref_sink +g_variant_is_floating g_variant_n_children g_variant_get_child_value g_variant_get_size @@ -1714,6 +1805,7 @@ g_variant_get_type_string g_variant_is_of_type g_variant_is_container g_variant_classify +g_variant_compare g_variant_new_boolean g_variant_new_byte @@ -1732,6 +1824,8 @@ g_variant_new_signature g_variant_is_signature g_variant_new_variant g_variant_new_strv +g_variant_new_bytestring +g_variant_new_bytestring_array g_variant_get_boolean g_variant_get_byte @@ -1748,6 +1842,10 @@ g_variant_dup_string g_variant_get_variant g_variant_get_strv g_variant_dup_strv +g_variant_get_bytestring +g_variant_dup_bytestring +g_variant_get_bytestring_array +g_variant_dup_bytestring_array g_variant_new_maybe g_variant_new_array @@ -1787,6 +1885,8 @@ g_variant_get g_variant_builder_add g_variant_get_child +g_variant_lookup_value +g_variant_lookup g_variant_iter_next g_variant_iter_loop @@ -1798,6 +1898,7 @@ g_variant_byteswap #if IN_FILE(__G_VARIANT_PARSER_C__) g_variant_new_parsed g_variant_new_parsed_va +g_variant_builder_add_parsed g_variant_parse g_variant_parser_get_error_quark #endif diff --git a/glib/glib_probes.d b/glib/glib_probes.d new file mode 100644 index 0000000..9232e1b --- /dev/null +++ b/glib/glib_probes.d @@ -0,0 +1,8 @@ +provider glib { + probe mem__alloc(void*, unsigned int, unsigned int, unsigned int); + probe mem__realloc(void*, void *, unsigned int, unsigned int); + probe mem__free(void*); + probe slice__alloc(void*, unsigned int); + probe slice__free(void*, unsigned int); + probe quark__new(char *, unsigned int); +}; diff --git a/gio/fen/fen-sub.h b/glib/glib_trace.h similarity index 57% rename from gio/fen/fen-sub.h rename to glib/glib_trace.h index ad232bc..789e88d 100644 --- a/gio/fen/fen-sub.h +++ b/glib/glib_trace.h @@ -1,8 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:set expandtab ts=4 shiftwidth=4: */ -/* - * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. +/* GLIB - Library of useful routines for C programming + * + * Copyright (C) 2009,2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,21 +17,27 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * - * Authors: Lin Ma + * Author: Alexander Larsson */ -#include +#ifndef __GLIBTRACE_H__ +#define __GLIBTRACE_H__ -#ifndef _FEN_SUB_H_ -#define _FEN_SUB_H_ +#ifndef SIZEOF_CHAR +#error "config.h must be included prior to glib_trace.h" +#endif -typedef struct _fen_sub -{ - gpointer user_data; - gboolean is_mondir; -} fen_sub; +#ifdef HAVE_DTRACE -fen_sub* _fen_sub_new (gpointer udata, gboolean is_mondir); -void _fen_sub_delete (fen_sub *sub); +/* include the generated probes header and put markers in code */ +#include "glib_probes.h" +#define TRACE(probe) probe -#endif _FEN_SUB_H_ +#else + +/* Wrap the probe to allow it to be removed when no systemtap available */ +#define TRACE(probe) + +#endif + +#endif /* __GLIBTRACE_H__ */ diff --git a/glibconfig.h.win32 b/glib/glibconfig.h.win32 similarity index 99% rename from glibconfig.h.win32 rename to glib/glibconfig.h.win32 index 3aa29ee..e995d10 100644 --- a/glibconfig.h.win32 +++ b/glib/glibconfig.h.win32 @@ -157,8 +157,8 @@ typedef unsigned __int64 guintptr; #define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END #define GLIB_MAJOR_VERSION 2 -#define GLIB_MINOR_VERSION 24 -#define GLIB_MICRO_VERSION 2 +#define GLIB_MINOR_VERSION 27 +#define GLIB_MICRO_VERSION 5 #define G_OS_WIN32 #define G_PLATFORM_WIN32 diff --git a/glibconfig.h.win32.in b/glib/glibconfig.h.win32.in similarity index 100% rename from glibconfig.h.win32.in rename to glib/glibconfig.h.win32.in diff --git a/glib/glibintl.h b/glib/glibintl.h index 47a7910..6d79a26 100644 --- a/glib/glibintl.h +++ b/glib/glibintl.h @@ -13,6 +13,7 @@ G_CONST_RETURN gchar *glib_gettext (const gchar *str) G_GNUC_FORMAT(1); #define _(String) glib_gettext(String) /* Split out this in the code, but keep it in the same domain for now */ #define P_(String) glib_gettext(String) +#define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1) #ifdef gettext_noop #define N_(String) gettext_noop(String) @@ -23,6 +24,7 @@ G_CONST_RETURN gchar *glib_gettext (const gchar *str) G_GNUC_FORMAT(1); #define _(String) (String) #define N_(String) (String) #define P_(String) (String) +#define C_(Context,String) (String) #define textdomain(String) ((String) ? (String) : "messages") #define gettext(String) (String) #define dgettext(Domain,String) (String) diff --git a/glib/glist.c b/glib/glist.c index 252330a..6664964 100644 --- a/glib/glist.c +++ b/glib/glist.c @@ -21,17 +21,18 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "glist.h" + +#include "gtestutils.h" /** * SECTION: linked_lists_double @@ -171,7 +172,8 @@ g_list_alloc (void) * * * If list elements contain dynamically-allocated memory, - * they should be freed first. + * you should either use g_list_free_full() or free them manually + * first. * */ void @@ -199,6 +201,24 @@ g_list_free_1 (GList *list) } /** + * g_list_free_full: + * @list: a pointer to a #GList + * @free_func: the function to be called to free each element's data + * + * Convenience method, which frees all the memory used by a #GList, and + * calls the specified destroy function on every element's data. + * + * Since: 2.28 + */ +void +g_list_free_full (GList *list, + GDestroyNotify free_func) +{ + g_list_foreach (list, (GFunc) free_func, NULL); + g_list_free (list); +} + +/** * g_list_append: * @list: a pointer to a #GList * @data: the data for the new element @@ -1148,6 +1168,3 @@ g_list_sort_with_data (GList *list, { return g_list_sort_real (list, (GFunc) compare_func, user_data); } - -#define __G_LIST_C__ -#include "galiasdef.c" diff --git a/glib/glist.h b/glib/glist.h index e74ed96..275005c 100644 --- a/glib/glist.h +++ b/glib/glist.h @@ -50,6 +50,8 @@ GList* g_list_alloc (void) G_GNUC_WARN_UNUSED_RESULT; void g_list_free (GList *list); void g_list_free_1 (GList *list); #define g_list_free1 g_list_free_1 +void g_list_free_full (GList *list, + GDestroyNotify free_func); GList* g_list_append (GList *list, gpointer data) G_GNUC_WARN_UNUSED_RESULT; GList* g_list_prepend (GList *list, diff --git a/glib/gmacros.h b/glib/gmacros.h index b3ff7ee..9f9c25d 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -107,6 +107,13 @@ #define G_GNUC_DEPRECATED #endif /* __GNUC__ */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define G_GNUC_DEPRECATED_FOR(f) \ + __attribute__((deprecated("Use " #f " instead"))) +#else +#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED +#endif /* __GNUC__ */ + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) # define G_GNUC_MAY_ALIAS __attribute__((may_alias)) #else diff --git a/glib/gmain.c b/glib/gmain.c index e04c7b5..d0e7f17 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -24,14 +24,30 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ +#ifndef _WIN32 +/* for pipe2; need to define it first to avoid + * other headers pulling in unistd.h + */ +/* The meaning of_GNU_SOURCE that is intended here is present only on + * Linux; avoid the possibility that some misguided header in MinGW + * looks at it. Ideally we should define _GNU_SOURCE only on platforms + * where we know what it means and that is what we want here + * (i.e. Linux with glibc). After all, there might be some other POSIX + * platform even where _GNU_SOURCE is used for some unrelated change + * in semantics that isn't wanted. Sigh. + */ +#define _GNU_SOURCE +#endif + #include "config.h" +#include "glibconfig.h" /* Uncomment the next line (and the corresponding line in gpoll.c) to * enable debugging printouts if the environment variable @@ -46,10 +62,6 @@ #define G_MAIN_POLL_DEBUG #endif -#define _GNU_SOURCE /* for pipe2 */ - -#include "glib.h" -#include "gthreadprivate.h" #include #include #include @@ -77,7 +89,100 @@ #include #endif -#include "galias.h" +#include "gmain.h" + +#include "garray.h" +#include "giochannel.h" +#include "ghash.h" +#include "ghook.h" +#include "gqueue.h" +#include "gstrfuncs.h" +#include "gtestutils.h" +#include "gthreadprivate.h" + +#ifdef G_OS_WIN32 +#include "gwin32.h" +#endif + +#ifdef G_MAIN_POLL_DEBUG +#include "gtimer.h" +#endif + +/** + * SECTION:main + * @title: The Main Event Loop + * @short_description: manages all available sources of events + * + * The main event loop manages all the available sources of events for + * GLib and GTK+ applications. These events can come from any number of + * different types of sources such as file descriptors (plain files, + * pipes or sockets) and timeouts. New types of event sources can also + * be added using g_source_attach(). + * + * To allow multiple independent sets of sources to be handled in + * different threads, each source is associated with a #GMainContext. + * A GMainContext can only be running in a single thread, but + * sources can be added to it and removed from it from other threads. + * + * Each event source is assigned a priority. The default priority, + * #G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher priorities. + * Values greater than 0 denote lower priorities. Events from high priority + * sources are always processed before events from lower priority sources. + * + * Idle functions can also be added, and assigned a priority. These will + * be run whenever no events with a higher priority are ready to be processed. + * + * The #GMainLoop data type represents a main event loop. A GMainLoop is + * created with g_main_loop_new(). After adding the initial event sources, + * g_main_loop_run() is called. This continuously checks for new events from + * each of the event sources and dispatches them. Finally, the processing of + * an event from one of the sources leads to a call to g_main_loop_quit() to + * exit the main loop, and g_main_loop_run() returns. + * + * It is possible to create new instances of #GMainLoop recursively. + * This is often used in GTK+ applications when showing modal dialog + * boxes. Note that event sources are associated with a particular + * #GMainContext, and will be checked and dispatched for all main + * loops associated with that GMainContext. + * + * GTK+ contains wrappers of some of these functions, e.g. gtk_main(), + * gtk_main_quit() and gtk_events_pending(). + * + * Creating new source types + * One of the unusual features of the #GMainLoop functionality + * is that new types of event source can be created and used in + * addition to the builtin type of event source. A new event source + * type is used for handling GDK events. A new source type is created + * by deriving from the #GSource structure. + * The derived type of source is represented by a structure that has + * the #GSource structure as a first element, and other elements specific + * to the new source type. To create an instance of the new source type, + * call g_source_new() passing in the size of the derived structure and + * a table of functions. These #GSourceFuncs determine the behavior of + * the new source type. + * New source types basically interact with the main context + * in two ways. Their prepare function in #GSourceFuncs can set a timeout + * to determine the maximum amount of time that the main loop will sleep + * before checking the source again. In addition, or as well, the source + * can add file descriptors to the set that the main context checks using + * g_source_add_poll(). + * + * Customizing the main loop iteration + * Single iterations of a #GMainContext can be run with + * g_main_context_iteration(). In some cases, more detailed control + * of exactly how the details of the main loop work is desired, for + * instance, when integrating the #GMainLoop with an external main loop. + * In such cases, you can call the component functions of + * g_main_context_iteration() directly. These functions are + * g_main_context_prepare(), g_main_context_query(), + * g_main_context_check() and g_main_context_dispatch(). + * The operation of these functions can best be seen in terms + * of a state diagram, as shown in . + *
    States of a Main Context + * + *
    + *
    + */ /* Types */ @@ -159,8 +264,10 @@ struct _GMainContext GPollFunc poll_func; - GTimeVal current_time; - gboolean time_is_current; + gint64 time; + gboolean time_is_fresh; + gint64 real_time; + gboolean real_time_is_fresh; }; struct _GSourceCallback @@ -181,9 +288,9 @@ struct _GMainLoop struct _GTimeoutSource { GSource source; - GTimeVal expiration; + gint64 expiration; guint interval; - guint granularity; + gboolean seconds; }; struct _GChildWatchSource @@ -206,6 +313,12 @@ struct _GPollRec gint priority; }; +struct _GSourcePrivate +{ + GSList *child_sources; + GSource *parent_source; +}; + #ifdef G_THREADS_ENABLED #define LOCK_CONTEXT(context) g_static_mutex_lock (&context->mutex) #define UNLOCK_CONTEXT(context) g_static_mutex_unlock (&context->mutex) @@ -237,6 +350,9 @@ static void g_source_unref_internal (GSource *source, static void g_source_destroy_internal (GSource *source, GMainContext *context, gboolean have_lock); +static void g_source_set_priority_unlocked (GSource *source, + GMainContext *context, + gint priority); static void g_main_context_poll (GMainContext *context, gint timeout, gint priority, @@ -286,8 +402,6 @@ static gint child_watch_wake_up_pipe[2] = {0, 0}; G_LOCK_DEFINE_STATIC (main_context_list); static GSList *main_context_list = NULL; -static gint timer_perturb = -1; - GSourceFuncs g_timeout_funcs = { g_timeout_prepare, @@ -503,7 +617,8 @@ g_main_context_new (void) context->pending_dispatches = g_ptr_array_new (); - context->time_is_current = FALSE; + context->time_is_fresh = FALSE; + context->real_time_is_fresh = FALSE; #ifdef G_THREADS_ENABLED if (g_thread_supported ()) @@ -742,12 +857,21 @@ g_source_list_add (GSource *source, { GSource *tmp_source, *last_source; - last_source = NULL; - tmp_source = context->source_list; - while (tmp_source && tmp_source->priority <= source->priority) + if (source->priv && source->priv->parent_source) { - last_source = tmp_source; - tmp_source = tmp_source->next; + /* Put the source immediately before its parent */ + tmp_source = source->priv->parent_source; + last_source = source->priv->parent_source->prev; + } + else + { + last_source = NULL; + tmp_source = context->source_list; + while (tmp_source && tmp_source->priority <= source->priority) + { + last_source = tmp_source; + tmp_source = tmp_source->next; + } } source->next = tmp_source; @@ -779,6 +903,39 @@ g_source_list_remove (GSource *source, source->next = NULL; } +static guint +g_source_attach_unlocked (GSource *source, + GMainContext *context) +{ + guint result = 0; + GSList *tmp_list; + + source->context = context; + result = source->source_id = context->next_id++; + + source->ref_count++; + g_source_list_add (source, context); + + tmp_list = source->poll_fds; + while (tmp_list) + { + g_main_context_add_poll_unlocked (context, source->priority, tmp_list->data); + tmp_list = tmp_list->next; + } + + if (source->priv) + { + tmp_list = source->priv->child_sources; + while (tmp_list) + { + g_source_attach_unlocked (tmp_list->data, context); + tmp_list = tmp_list->next; + } + } + + return result; +} + /** * g_source_attach: * @source: a #GSource @@ -795,7 +952,6 @@ g_source_attach (GSource *source, GMainContext *context) { guint result = 0; - GSList *tmp_list; g_return_val_if_fail (source->context == NULL, 0); g_return_val_if_fail (!SOURCE_DESTROYED (source), 0); @@ -805,18 +961,7 @@ g_source_attach (GSource *source, LOCK_CONTEXT (context); - source->context = context; - result = source->source_id = context->next_id++; - - source->ref_count++; - g_source_list_add (source, context); - - tmp_list = source->poll_fds; - while (tmp_list) - { - g_main_context_add_poll_unlocked (context, source->priority, tmp_list->data); - tmp_list = tmp_list->next; - } + result = g_source_attach_unlocked (source, context); #ifdef G_THREADS_ENABLED /* Now wake up the main loop if it is waiting in the poll() */ @@ -866,6 +1011,24 @@ g_source_destroy_internal (GSource *source, tmp_list = tmp_list->next; } } + + if (source->priv && source->priv->child_sources) + { + /* This is safe because even if a child_source finalizer or + * closure notify tried to modify source->priv->child_sources + * from outside the lock, it would fail since + * SOURCE_DESTROYED(source) is now TRUE. + */ + tmp_list = source->priv->child_sources; + while (tmp_list) + { + g_source_destroy_internal (tmp_list->data, context, TRUE); + g_source_unref_internal (tmp_list->data, context, TRUE); + tmp_list = tmp_list->next; + } + g_slist_free (source->priv->child_sources); + source->priv->child_sources = NULL; + } g_source_unref_internal (source, context, TRUE); } @@ -1013,6 +1176,98 @@ g_source_remove_poll (GSource *source, } /** + * g_source_add_child_source: + * @source:a #GSource + * @child_source: a second #GSource that @source should "poll" + * + * Adds @child_source to @source as a "polled" source; when @source is + * added to a #GMainContext, @child_source will be automatically added + * with the same priority, when @child_source is triggered, it will + * cause @source to dispatch (and won't call @child_source's own + * callback), and when @source is destroyed, it will destroy + * @child_source as well. (@source will also still be dispatched if + * its own prepare/check functions indicate that it is ready.) + * + * If you need @child_source to do anything on its own when it + * triggers, you can call g_source_set_dummy_callback() on it to set a + * callback that does nothing (except return %TRUE if appropriate). + * + * @source will hold a reference on @child_source while @child_source + * is attached to it. + * + * Since: 2.28 + **/ +void +g_source_add_child_source (GSource *source, + GSource *child_source) +{ + GMainContext *context; + + g_return_if_fail (source != NULL); + g_return_if_fail (child_source != NULL); + g_return_if_fail (!SOURCE_DESTROYED (source)); + g_return_if_fail (!SOURCE_DESTROYED (child_source)); + g_return_if_fail (child_source->context == NULL); + g_return_if_fail (child_source->priv == NULL || child_source->priv->parent_source == NULL); + + context = source->context; + + if (context) + LOCK_CONTEXT (context); + + if (!source->priv) + source->priv = g_slice_new0 (GSourcePrivate); + if (!child_source->priv) + child_source->priv = g_slice_new0 (GSourcePrivate); + + source->priv->child_sources = g_slist_prepend (source->priv->child_sources, + g_source_ref (child_source)); + child_source->priv->parent_source = source; + g_source_set_priority_unlocked (child_source, context, source->priority); + + if (context) + { + UNLOCK_CONTEXT (context); + g_source_attach (child_source, context); + } +} + +/** + * g_source_remove_child_source: + * @source:a #GSource + * @child_source: a #GSource previously passed to + * g_source_add_child_source(). + * + * Detaches @child_source from @source and destroys it. + * + * Since: 2.28 + **/ +void +g_source_remove_child_source (GSource *source, + GSource *child_source) +{ + GMainContext *context; + + g_return_if_fail (source != NULL); + g_return_if_fail (child_source != NULL); + g_return_if_fail (child_source->priv != NULL && child_source->priv->parent_source == source); + g_return_if_fail (!SOURCE_DESTROYED (source)); + g_return_if_fail (!SOURCE_DESTROYED (child_source)); + + context = source->context; + + if (context) + LOCK_CONTEXT (context); + + source->priv->child_sources = g_slist_remove (source->priv->child_sources, child_source); + g_source_destroy_internal (child_source, context, TRUE); + g_source_unref_internal (child_source, context, TRUE); + + if (context) + UNLOCK_CONTEXT (context); +} + +/** * g_source_set_callback_indirect: * @source: the source * @callback_data: pointer to callback data "object" @@ -1157,35 +1412,19 @@ g_source_set_funcs (GSource *source, source->source_funcs = funcs; } -/** - * g_source_set_priority: - * @source: a #GSource - * @priority: the new priority. - * - * Sets the priority of a source. While the main loop is being - * run, a source will be dispatched if it is ready to be dispatched and no sources - * at a higher (numerically smaller) priority are ready to be dispatched. - **/ -void -g_source_set_priority (GSource *source, - gint priority) +static void +g_source_set_priority_unlocked (GSource *source, + GMainContext *context, + gint priority) { GSList *tmp_list; - GMainContext *context; - - g_return_if_fail (source != NULL); - - context = source->context; - - if (context) - LOCK_CONTEXT (context); source->priority = priority; if (context) { /* Remove the source from the context's source and then - * add it back so it is sorted in the correct plcae + * add it back so it is sorted in the correct place */ g_source_list_remove (source, source->context); g_source_list_add (source, source->context); @@ -1201,9 +1440,44 @@ g_source_set_priority (GSource *source, tmp_list = tmp_list->next; } } - - UNLOCK_CONTEXT (source->context); } + + if (source->priv && source->priv->child_sources) + { + tmp_list = source->priv->child_sources; + while (tmp_list) + { + g_source_set_priority_unlocked (tmp_list->data, context, priority); + tmp_list = tmp_list->next; + } + } +} + +/** + * g_source_set_priority: + * @source: a #GSource + * @priority: the new priority. + * + * Sets the priority of a source. While the main loop is being run, a + * source will be dispatched if it is ready to be dispatched and no + * sources at a higher (numerically smaller) priority are ready to be + * dispatched. + **/ +void +g_source_set_priority (GSource *source, + gint priority) +{ + GMainContext *context; + + g_return_if_fail (source != NULL); + + context = source->context; + + if (context) + LOCK_CONTEXT (context); + g_source_set_priority_unlocked (source, context, priority); + if (context) + UNLOCK_CONTEXT (source->context); } /** @@ -1271,6 +1545,88 @@ g_source_get_can_recurse (GSource *source) return (source->flags & G_SOURCE_CAN_RECURSE) != 0; } + +/** + * g_source_set_name: + * @source: a #GSource + * @name: debug name for the source + * + * Sets a name for the source, used in debugging and profiling. + * The name defaults to #NULL. + * + * The source name should describe in a human-readable way + * what the source does. For example, "X11 event queue" + * or "GTK+ repaint idle handler" or whatever it is. + * + * It is permitted to call this function multiple times, but is not + * recommended due to the potential performance impact. For example, + * one could change the name in the "check" function of a #GSourceFuncs + * to include details like the event type in the source name. + * + * Since: 2.26 + **/ +void +g_source_set_name (GSource *source, + const char *name) +{ + g_return_if_fail (source != NULL); + + /* setting back to NULL is allowed, just because it's + * weird if get_name can return NULL but you can't + * set that. + */ + + g_free (source->name); + source->name = g_strdup (name); +} + +/** + * g_source_get_name: + * @source: a #GSource + * + * Gets a name for the source, used in debugging and profiling. + * The name may be #NULL if it has never been set with + * g_source_set_name(). + * + * Return value: the name of the source + * Since: 2.26 + **/ +G_CONST_RETURN char* +g_source_get_name (GSource *source) +{ + g_return_val_if_fail (source != NULL, NULL); + + return source->name; +} + +/** + * g_source_set_name_by_id: + * @tag: a #GSource ID + * @name: debug name for the source + * + * Sets the name of a source using its ID. + * + * This is a convenience utility to set source names from the return + * value of g_idle_add(), g_timeout_add(), etc. + * + * Since: 2.26 + **/ +void +g_source_set_name_by_id (guint tag, + const char *name) +{ + GSource *source; + + g_return_if_fail (tag > 0); + + source = g_main_context_find_source_by_id (NULL, tag); + if (source == NULL) + return; + + g_source_set_name (source, name); +} + + /** * g_source_ref: * @source: a #GSource @@ -1323,17 +1679,25 @@ g_source_unref_internal (GSource *source, source->callback_data = NULL; source->callback_funcs = NULL; - if (context && !SOURCE_DESTROYED (source)) + if (context) { - g_warning (G_STRLOC ": ref_count == 0, but source is still attached to a context!"); - source->ref_count++; + if (!SOURCE_DESTROYED (source)) + g_warning (G_STRLOC ": ref_count == 0, but source was still attached to a context!"); + g_source_list_remove (source, context); } - else if (context) - g_source_list_remove (source, context); if (source->source_funcs->finalize) - source->source_funcs->finalize (source); - + { + if (context) + UNLOCK_CONTEXT (context); + source->source_funcs->finalize (source); + if (context) + LOCK_CONTEXT (context); + } + + g_free (source->name); + source->name = NULL; + g_slist_free (source->poll_fds); source->poll_fds = NULL; g_free (source); @@ -1586,8 +1950,10 @@ g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, /** * g_get_current_time: * @result: #GTimeVal structure in which to store current time. - * + * * Equivalent to the UNIX gettimeofday() function, but portable. + * + * You may find g_get_real_time() to be more convenient. **/ void g_get_current_time (GTimeVal *result) @@ -1622,6 +1988,121 @@ g_get_current_time (GTimeVal *result) #endif } +/** + * g_get_real_time: + * + * Queries the system wall-clock time. + * + * This call is functionally equivalent to g_get_current_time() except + * that the return value is often more convenient than dealing with a + * #GTimeVal. + * + * You should only use this call if you are actually interested in the real + * wall-clock time. g_get_monotonic_time() is probably more useful for + * measuring intervals. + * + * Returns: the number of microseconds since January 1, 1970 UTC. + * + * Since: 2.28 + **/ +gint64 +g_get_real_time (void) +{ + GTimeVal tv; + + g_get_current_time (&tv); + + return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec; +} + +/** + * g_get_monotonic_time: + * + * Queries the system monotonic time, if available. + * + * On POSIX systems with clock_gettime() and %CLOCK_MONOTONIC this call + * is a very shallow wrapper for that. Otherwise, we make a best effort + * that probably involves returning the wall clock time (with at least + * microsecond accuracy, subject to the limitations of the OS kernel). + * + * Note that, on Windows, "limitations of the OS kernel" is a rather + * substantial statement. Depending on the configuration of the system, + * the wall clock time is updated as infrequently as 64 times a second + * (which is approximately every 16ms). + * + * Returns: the monotonic time, in microseconds + * + * Since: 2.28 + **/ +gint64 +g_get_monotonic_time (void) +{ +#ifdef HAVE_CLOCK_GETTIME + /* librt clock_gettime() is our first choice */ + { + static int clockid = CLOCK_REALTIME; + struct timespec ts; + +#ifdef HAVE_MONOTONIC_CLOCK + /* We have to check if we actually have monotonic clock support. + * + * There is no thread safety issue here since there is no harm if we + * check twice. + */ + { + static gboolean checked; + + if G_UNLIKELY (!checked) + { + if (sysconf (_SC_MONOTONIC_CLOCK) >= 0) + clockid = CLOCK_MONOTONIC; + checked = TRUE; + } + } +#endif + + clock_gettime (clockid, &ts); + + /* In theory monotonic time can have any epoch. + * + * glib presently assumes the following: + * + * 1) The epoch comes some time after the birth of Jesus of Nazareth, but + * not more than 10000 years later. + * + * 2) The current time also falls sometime within this range. + * + * These two reasonable assumptions leave us with a maximum deviation from + * the epoch of 10000 years, or 315569520000000000 seconds. + * + * If we restrict ourselves to this range then the number of microseconds + * will always fit well inside the constraints of a int64 (by a factor of + * about 29). + * + * If you actually hit the following assertion, probably you should file a + * bug against your operating system for being excessively silly. + **/ + g_assert (G_GINT64_CONSTANT (-315569520000000000) < ts.tv_sec && + ts.tv_sec < G_GINT64_CONSTANT (315569520000000000)); + + return (((gint64) ts.tv_sec) * 1000000) + (ts.tv_nsec / 1000); + } +#else + /* It may look like we are discarding accuracy on Windows (since its + * current time is expressed in 100s of nanoseconds) but according to + * many sources, the time is only updated 64 times per second, so + * microsecond accuracy is more than enough. + */ + { + GTimeVal tv; + + g_get_current_time (&tv); + + return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec; + } +#endif +} + static void g_main_dispatch_free (gpointer dispatch) { @@ -1858,7 +2339,6 @@ g_source_is_destroyed (GSource *source) return SOURCE_DESTROYED (source); } - /* Temporarily remove all this source's file descriptors from the * poll(), so that if data comes available for one of the file descriptors * we don't continually spin in the poll() @@ -2208,7 +2688,8 @@ g_main_context_prepare (GMainContext *context, LOCK_CONTEXT (context); - context->time_is_current = FALSE; + context->time_is_fresh = FALSE; + context->real_time_is_fresh = FALSE; if (context->in_check_or_prepare) { @@ -2283,7 +2764,15 @@ g_main_context_prepare (GMainContext *context, context->in_check_or_prepare--; if (result) - source->flags |= G_SOURCE_READY; + { + GSource *ready_source = source; + + while (ready_source) + { + ready_source->flags |= G_SOURCE_READY; + ready_source = ready_source->priv ? ready_source->priv->parent_source : NULL; + } + } } if (source->flags & G_SOURCE_READY) @@ -2372,7 +2861,10 @@ g_main_context_query (GMainContext *context, { *timeout = context->timeout; if (*timeout != 0) - context->time_is_current = FALSE; + { + context->time_is_fresh = FALSE; + context->real_time_is_fresh = FALSE; + } } UNLOCK_CONTEXT (context); @@ -2472,7 +2964,15 @@ g_main_context_check (GMainContext *context, context->in_check_or_prepare--; if (result) - source->flags |= G_SOURCE_READY; + { + GSource *ready_source = source; + + while (ready_source) + { + ready_source->flags |= G_SOURCE_READY; + ready_source = ready_source->priv ? ready_source->priv->parent_source : NULL; + } + } } if (source->flags & G_SOURCE_READY) @@ -3095,6 +3595,8 @@ g_main_context_remove_poll_unlocked (GMainContext *context, * calling g_get_current_time() directly is that when * checking multiple sources, GLib can cache a single value * instead of having to repeatedly get the system time. + * + * Deprecated: 2.28: use g_source_get_time() instead **/ void g_source_get_current_time (GSource *source, @@ -3108,18 +3610,60 @@ g_source_get_current_time (GSource *source, LOCK_CONTEXT (context); - if (!context->time_is_current) + if (!context->real_time_is_fresh) { - g_get_current_time (&context->current_time); - context->time_is_current = TRUE; + context->real_time = g_get_real_time (); + context->real_time_is_fresh = TRUE; } - *timeval = context->current_time; + timeval->tv_sec = context->real_time / 1000000; + timeval->tv_usec = context->real_time % 1000000; UNLOCK_CONTEXT (context); } /** + * g_source_get_time: + * @source: a #GSource + * + * Gets the time to be used when checking this source. The advantage of + * calling this function over calling g_get_monotonic_time() directly is + * that when checking multiple sources, GLib can cache a single value + * instead of having to repeatedly get the system monotonic time. + * + * The time here is the system monotonic time, if available, or some + * other reasonable alternative otherwise. See g_get_monotonic_time(). + * + * Returns: the monotonic time in microseconds + * + * Since: 2.28 + **/ +gint64 +g_source_get_time (GSource *source) +{ + GMainContext *context; + gint64 result; + + g_return_val_if_fail (source->context != NULL, 0); + + context = source->context; + + LOCK_CONTEXT (context); + + if (!context->time_is_fresh) + { + context->time = g_get_monotonic_time (); + context->time_is_fresh = TRUE; + } + + result = context->time; + + UNLOCK_CONTEXT (context); + + return result; +} + +/** * g_main_context_set_poll_func: * @context: a #GMainContext * @func: the function to call to poll all file descriptors @@ -3250,160 +3794,92 @@ g_main_context_is_owner (GMainContext *context) static void g_timeout_set_expiration (GTimeoutSource *timeout_source, - GTimeVal *current_time) + gint64 current_time) { - guint seconds = timeout_source->interval / 1000; - guint msecs = timeout_source->interval - seconds * 1000; + timeout_source->expiration = current_time + timeout_source->interval * 1000; - timeout_source->expiration.tv_sec = current_time->tv_sec + seconds; - timeout_source->expiration.tv_usec = current_time->tv_usec + msecs * 1000; - if (timeout_source->expiration.tv_usec >= 1000000) - { - timeout_source->expiration.tv_usec -= 1000000; - timeout_source->expiration.tv_sec++; - } - if (timer_perturb==-1) - { - /* - * we want a per machine/session unique 'random' value; try the dbus - * address first, that has a UUID in it. If there is no dbus, use the - * hostname for hashing. - */ - const char *session_bus_address = g_getenv ("DBUS_SESSION_BUS_ADDRESS"); - if (!session_bus_address) - session_bus_address = g_getenv ("HOSTNAME"); - if (session_bus_address) - timer_perturb = ABS ((gint) g_str_hash (session_bus_address)); - else - timer_perturb = 0; - } - if (timeout_source->granularity) + if (timeout_source->seconds) { - gint remainder; - gint gran; /* in usecs */ - gint perturb; + static gint timer_perturb = -1; - gran = timeout_source->granularity * 1000; - perturb = timer_perturb % gran; - /* - * We want to give each machine a per machine pertubation; - * shift time back first, and forward later after the rounding - */ - - timeout_source->expiration.tv_usec -= perturb; - if (timeout_source->expiration.tv_usec < 0) + if (timer_perturb == -1) { - timeout_source->expiration.tv_usec += 1000000; - timeout_source->expiration.tv_sec--; + /* + * we want a per machine/session unique 'random' value; try the dbus + * address first, that has a UUID in it. If there is no dbus, use the + * hostname for hashing. + */ + const char *session_bus_address = g_getenv ("DBUS_SESSION_BUS_ADDRESS"); + if (!session_bus_address) + session_bus_address = g_getenv ("HOSTNAME"); + if (session_bus_address) + timer_perturb = ABS ((gint) g_str_hash (session_bus_address)) % 1000000; + else + timer_perturb = 0; } - remainder = timeout_source->expiration.tv_usec % gran; - if (remainder >= gran/4) /* round up */ - timeout_source->expiration.tv_usec += gran; - timeout_source->expiration.tv_usec -= remainder; - /* shift back */ - timeout_source->expiration.tv_usec += perturb; + /* We want the microseconds part of the timeout to land on the + * 'timer_perturb' mark, but we need to make sure we don't try to + * set the timeout in the past. We do this by ensuring that we + * always only *increase* the expiration time by adding a full + * second in the case that the microsecond portion decreases. + */ + if (timer_perturb < timeout_source->expiration % 1000000) + timeout_source->expiration += 1000000; - /* the rounding may have overflown tv_usec */ - while (timeout_source->expiration.tv_usec > 1000000) - { - timeout_source->expiration.tv_usec -= 1000000; - timeout_source->expiration.tv_sec++; - } + timeout_source->expiration = + ((timeout_source->expiration / 1000000) * 1000000) + timer_perturb; } } static gboolean g_timeout_prepare (GSource *source, - gint *timeout) + gint *timeout) { - glong sec; - glong msec; - GTimeVal current_time; - - GTimeoutSource *timeout_source = (GTimeoutSource *)source; + GTimeoutSource *timeout_source = (GTimeoutSource *) source; + gint64 now = g_source_get_time (source); - g_source_get_current_time (source, ¤t_time); - - sec = timeout_source->expiration.tv_sec - current_time.tv_sec; - msec = (timeout_source->expiration.tv_usec - current_time.tv_usec) / 1000; - - /* We do the following in a rather convoluted fashion to deal with - * the fact that we don't have an integral type big enough to hold - * the difference of two timevals in millseconds. - */ - if (sec < 0 || (sec == 0 && msec < 0)) - msec = 0; - else + if (now < timeout_source->expiration) { - glong interval_sec = timeout_source->interval / 1000; - glong interval_msec = timeout_source->interval % 1000; - - if (msec < 0) - { - msec += 1000; - sec -= 1; - } - - if (sec > interval_sec || - (sec == interval_sec && msec > interval_msec)) - { - /* The system time has been set backwards, so we - * reset the expiration time to now + timeout_source->interval; - * this at least avoids hanging for long periods of time. - */ - g_timeout_set_expiration (timeout_source, ¤t_time); - msec = MIN (G_MAXINT, timeout_source->interval); - } - else - { - msec = MIN (G_MAXINT, (guint)msec + 1000 * (guint)sec); - } + /* Round up to ensure that we don't try again too early */ + *timeout = (timeout_source->expiration - now + 999) / 1000; + return FALSE; } - *timeout = (gint)msec; - - return msec == 0; + *timeout = 0; + return TRUE; } static gboolean g_timeout_check (GSource *source) { - GTimeVal current_time; - GTimeoutSource *timeout_source = (GTimeoutSource *)source; + GTimeoutSource *timeout_source = (GTimeoutSource *) source; + gint64 now = g_source_get_time (source); - g_source_get_current_time (source, ¤t_time); - - return ((timeout_source->expiration.tv_sec < current_time.tv_sec) || - ((timeout_source->expiration.tv_sec == current_time.tv_sec) && - (timeout_source->expiration.tv_usec <= current_time.tv_usec))); + return timeout_source->expiration <= now; } static gboolean g_timeout_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data) + GSourceFunc callback, + gpointer user_data) { GTimeoutSource *timeout_source = (GTimeoutSource *)source; + gboolean again; if (!callback) { g_warning ("Timeout source dispatched without callback\n" - "You must call g_source_set_callback()."); + "You must call g_source_set_callback()."); return FALSE; } - - if (callback (user_data)) - { - GTimeVal current_time; - g_source_get_current_time (source, ¤t_time); - g_timeout_set_expiration (timeout_source, ¤t_time); + again = callback (user_data); - return TRUE; - } - else - return FALSE; + if (again) + g_timeout_set_expiration (timeout_source, g_source_get_time (source)); + + return again; } /** @@ -3423,13 +3899,10 @@ g_timeout_source_new (guint interval) { GSource *source = g_source_new (&g_timeout_funcs, sizeof (GTimeoutSource)); GTimeoutSource *timeout_source = (GTimeoutSource *)source; - GTimeVal current_time; timeout_source->interval = interval; + g_timeout_set_expiration (timeout_source, g_get_monotonic_time ()); - g_get_current_time (¤t_time); - g_timeout_set_expiration (timeout_source, ¤t_time); - return source; } @@ -3455,13 +3928,11 @@ g_timeout_source_new_seconds (guint interval) { GSource *source = g_source_new (&g_timeout_funcs, sizeof (GTimeoutSource)); GTimeoutSource *timeout_source = (GTimeoutSource *)source; - GTimeVal current_time; - timeout_source->interval = 1000*interval; - timeout_source->granularity = 1000; + timeout_source->interval = 1000 * interval; + timeout_source->seconds = TRUE; - g_get_current_time (¤t_time); - g_timeout_set_expiration (timeout_source, ¤t_time); + g_timeout_set_expiration (timeout_source, g_get_monotonic_time ()); return source; } @@ -4168,5 +4639,112 @@ g_idle_remove_by_data (gpointer data) return g_source_remove_by_funcs_user_data (&g_idle_funcs, data); } -#define __G_MAIN_C__ -#include "galiasdef.c" +/** + * g_main_context_invoke: + * @context: a #GMainContext, or %NULL + * @function: function to call + * @data: data to pass to @function + * + * Invokes a function in such a way that @context is owned during the + * invocation of @function. + * + * If @context is %NULL then the global default main context — as + * returned by g_main_context_default() — is used. + * + * If @context is owned by the current thread, @function is called + * directly. Otherwise, if @context is the thread-default main context + * of the current thread and g_main_context_acquire() succeeds, then + * @function is called and g_main_context_release() is called + * afterwards. + * + * In any other case, an idle source is created to call @function and + * that source is attached to @context (presumably to be run in another + * thread). The idle source is attached with #G_PRIORITY_DEFAULT + * priority. If you want a different priority, use + * g_main_context_invoke_full(). + * + * Note that, as with normal idle functions, @function should probably + * return %FALSE. If it returns %TRUE, it will be continuously run in a + * loop (and may prevent this call from returning). + * + * Since: 2.28 + **/ +void +g_main_context_invoke (GMainContext *context, + GSourceFunc function, + gpointer data) +{ + g_main_context_invoke_full (context, + G_PRIORITY_DEFAULT, + function, data, NULL); +} + +/** + * g_main_context_invoke_full: + * @context: a #GMainContext, or %NULL + * @priority: the priority at which to run @function + * @function: function to call + * @data: data to pass to @function + * @notify: a function to call when @data is no longer in use, or %NULL. + * + * Invokes a function in such a way that @context is owned during the + * invocation of @function. + * + * This function is the same as g_main_context_invoke() except that it + * lets you specify the priority incase @function ends up being + * scheduled as an idle and also lets you give a #GDestroyNotify for @data. + * + * @notify should not assume that it is called from any particular + * thread or with any particular context acquired. + * + * Since: 2.28 + **/ +void +g_main_context_invoke_full (GMainContext *context, + gint priority, + GSourceFunc function, + gpointer data, + GDestroyNotify notify) +{ + g_return_if_fail (function != NULL); + + if (!context) + context = g_main_context_default (); + + if (g_main_context_is_owner (context)) + { + while (function (data)); + if (notify != NULL) + notify (data); + } + + else + { + GMainContext *thread_default; + + thread_default = g_main_context_get_thread_default (); + + if (!thread_default) + thread_default = g_main_context_default (); + + if (thread_default == context && g_main_context_acquire (context)) + { + while (function (data)); + + g_main_context_release (context); + + if (notify != NULL) + notify (data); + } + else + { + GSource *source; + + source = g_idle_source_new (); + g_source_set_priority (source, priority); + g_source_set_callback (source, function, data, notify); + g_source_attach (source, context); + g_source_unref (source); + } + } +} diff --git a/glib/gmain.h b/glib/gmain.h index 15fe54e..bd94651 100644 --- a/glib/gmain.h +++ b/glib/gmain.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -30,16 +30,113 @@ G_BEGIN_DECLS -typedef struct _GMainContext GMainContext; /* Opaque */ -typedef struct _GMainLoop GMainLoop; /* Opaque */ -typedef struct _GSource GSource; -typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs; -typedef struct _GSourceFuncs GSourceFuncs; +/** + * GMainContext: + * + * The GMainContext struct is an opaque data + * type representing a set of sources to be handled in a main loop. + */ +typedef struct _GMainContext GMainContext; + +/** + * GMainLoop: + * + * The GMainLoop struct is an opaque data type + * representing the main event loop of a GLib or GTK+ application. + */ +typedef struct _GMainLoop GMainLoop; + +/** + * GSource: + * + * The GSource struct is an opaque data type + * representing an event source. + */ +typedef struct _GSource GSource; +typedef struct _GSourcePrivate GSourcePrivate; + +/** + * GSourceCallbackFuncs: + * @ref: Called when a reference is added to the callback object + * @unref: Called when a reference to the callback object is dropped + * @get: Called to extract the callback function and data from the + * callback object. + + * The GSourceCallbackFuncs struct contains + * functions for managing callback objects. + */ +typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs; + +/** + * GSourceFuncs: + * @prepare: Called before all the file descriptors are polled. If the + * source can determine that it is ready here (without waiting for the + * results of the poll() call) it should return %TRUE. It can also return + * a @timeout_ value which should be the maximum timeout (in milliseconds) + * which should be passed to the poll() call. The actual timeout used will + * be -1 if all sources returned -1, or it will be the minimum of all the + * @timeout_ values returned which were >= 0. + * @check: Called after all the file descriptors are polled. The source + * should return %TRUE if it is ready to be dispatched. Note that some + * time may have passed since the previous prepare function was called, + * so the source should be checked again here. + * @dispatch: Called to dispatch the event source, after it has returned + * %TRUE in either its @prepare or its @check function. The @dispatch + * function is passed in a callback function and data. The callback + * function may be %NULL if the source was never connected to a callback + * using g_source_set_callback(). The @dispatch function should call the + * callback function with @user_data and whatever additional parameters + * are needed for this type of event source. + * @finalize: Called when the source is finalized. + * @closure_callback: + * @closure_marshal: + * + * The GSourceFuncs struct contains a table of + * functions used to handle event sources in a generic manner. + * + * For idle sources, the prepare and check functions always return %TRUE + * to indicate that the source is always ready to be processed. The prepare + * function also returns a timeout value of 0 to ensure that the poll() call + * doesn't block (since that would be time wasted which could have been spent + * running the idle function). + * + * For timeout sources, the prepare and check functions both return %TRUE + * if the timeout interval has expired. The prepare function also returns + * a timeout value to ensure that the poll() call doesn't block too long + * and miss the next timeout. + * + * For file descriptor sources, the prepare function typically returns %FALSE, + * since it must wait until poll() has been called before it knows whether + * any events need to be processed. It sets the returned timeout to -1 to + * indicate that it doesn't mind how long the poll() call blocks. In the + * check function, it tests the results of the poll() call to see if the + * required condition has been met, and returns %TRUE if so. + */ +typedef struct _GSourceFuncs GSourceFuncs; + +/** + * GPid: + * + * A type which is used to hold a process identification. + * + * On UNIX, processes are identified by a process id (an integer), + * while Windows uses process handles (which are pointers). + */ typedef gboolean (*GSourceFunc) (gpointer data); + +/** + * GChildWatchFunc: + * @pid: the process id of the child process + * @status: Status information about the child process, + * see waitpid(2) for more information about this field + * @data: user data passed to g_child_watch_add() + * + * The type of functions to be called when a child exists. + */ typedef void (*GChildWatchFunc) (GPid pid, - gint status, - gpointer data); + gint status, + gpointer data); struct _GSource { /*< private >*/ @@ -60,8 +157,9 @@ struct _GSource GSource *prev; GSource *next; - gpointer reserved1; - gpointer reserved2; + char *name; + + GSourcePrivate *priv; }; struct _GSourceCallbackFuncs @@ -69,9 +167,9 @@ struct _GSourceCallbackFuncs void (*ref) (gpointer cb_data); void (*unref) (gpointer cb_data); void (*get) (gpointer cb_data, - GSource *source, - GSourceFunc *func, - gpointer *data); + GSource *source, + GSourceFunc *func, + gpointer *data); }; typedef void (*GSourceDummyMarshal) (void); @@ -79,25 +177,70 @@ typedef void (*GSourceDummyMarshal) (void); struct _GSourceFuncs { gboolean (*prepare) (GSource *source, - gint *timeout_); + gint *timeout_); gboolean (*check) (GSource *source); gboolean (*dispatch) (GSource *source, - GSourceFunc callback, - gpointer user_data); + GSourceFunc callback, + gpointer user_data); void (*finalize) (GSource *source); /* Can be NULL */ /* For use by g_source_set_closure */ - GSourceFunc closure_callback; + GSourceFunc closure_callback; GSourceDummyMarshal closure_marshal; /* Really is of type GClosureMarshal */ }; /* Standard priorities */ +/** + * G_PRIORITY_HIGH: + * + * Use this for high priority event sources. + * + * It is not used within GLib or GTK+. + */ #define G_PRIORITY_HIGH -100 + +/** + * G_PRIORITY_DEFAULT: + * + * Use this for default priority event sources. + * + * In GLib this priority is used when adding timeout functions + * with g_timeout_add(). In GDK this priority is used for events + * from the X server. + */ #define G_PRIORITY_DEFAULT 0 + +/** + * G_PRIORITY_HIGH_IDLE: + * + * Use this for high priority idle functions. + * + * GTK+ uses #G_PRIORITY_HIGH_IDLE + 10 for resizing operations, + * and #G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is + * done to ensure that any pending resizes are processed before any + * pending redraws, so that widgets are not redrawn twice unnecessarily.) + */ #define G_PRIORITY_HIGH_IDLE 100 + +/** + * G_PRIORITY_DEFAULT_IDLE: + * + * Use this for default priority idle functions. + * + * In GLib this priority is used when adding idle functions with + * g_idle_add(). + */ #define G_PRIORITY_DEFAULT_IDLE 200 -#define G_PRIORITY_LOW 300 + +/** + * G_PRIORITY_LOW: + * + * Use this for very low priority background tasks. + * + * It is not used within GLib or GTK+. + */ +#define G_PRIORITY_LOW 300 /* GMainContext: */ @@ -107,18 +250,18 @@ void g_main_context_unref (GMainContext *context); GMainContext *g_main_context_default (void); gboolean g_main_context_iteration (GMainContext *context, - gboolean may_block); + gboolean may_block); gboolean g_main_context_pending (GMainContext *context); /* For implementation of legacy interfaces */ GSource *g_main_context_find_source_by_id (GMainContext *context, - guint source_id); + guint source_id); GSource *g_main_context_find_source_by_user_data (GMainContext *context, - gpointer user_data); + gpointer user_data); GSource *g_main_context_find_source_by_funcs_user_data (GMainContext *context, - GSourceFuncs *funcs, - gpointer user_data); + GSourceFuncs *funcs, + gpointer user_data); /* Low level functions for implementing custom main loops. */ @@ -127,33 +270,33 @@ gboolean g_main_context_acquire (GMainContext *context); void g_main_context_release (GMainContext *context); gboolean g_main_context_is_owner (GMainContext *context); gboolean g_main_context_wait (GMainContext *context, - GCond *cond, - GMutex *mutex); + GCond *cond, + GMutex *mutex); gboolean g_main_context_prepare (GMainContext *context, - gint *priority); + gint *priority); gint g_main_context_query (GMainContext *context, - gint max_priority, - gint *timeout_, - GPollFD *fds, - gint n_fds); + gint max_priority, + gint *timeout_, + GPollFD *fds, + gint n_fds); gint g_main_context_check (GMainContext *context, - gint max_priority, - GPollFD *fds, - gint n_fds); + gint max_priority, + GPollFD *fds, + gint n_fds); void g_main_context_dispatch (GMainContext *context); void g_main_context_set_poll_func (GMainContext *context, - GPollFunc func); + GPollFunc func); GPollFunc g_main_context_get_poll_func (GMainContext *context); /* Low level functions for use by source implementations */ void g_main_context_add_poll (GMainContext *context, - GPollFD *fd, - gint priority); + GPollFD *fd, + gint priority); void g_main_context_remove_poll (GMainContext *context, - GPollFD *fd); + GPollFD *fd); gint g_main_depth (void); GSource *g_main_current_source (void); @@ -167,7 +310,7 @@ GMainContext *g_main_context_get_thread_default (void); /* GMainLoop: */ GMainLoop *g_main_loop_new (GMainContext *context, - gboolean is_running); + gboolean is_running); void g_main_loop_run (GMainLoop *loop); void g_main_loop_quit (GMainLoop *loop); GMainLoop *g_main_loop_ref (GMainLoop *loop); @@ -178,45 +321,60 @@ GMainContext *g_main_loop_get_context (GMainLoop *loop); /* GSource: */ GSource *g_source_new (GSourceFuncs *source_funcs, - guint struct_size); + guint struct_size); GSource *g_source_ref (GSource *source); void g_source_unref (GSource *source); guint g_source_attach (GSource *source, - GMainContext *context); + GMainContext *context); void g_source_destroy (GSource *source); void g_source_set_priority (GSource *source, - gint priority); + gint priority); gint g_source_get_priority (GSource *source); void g_source_set_can_recurse (GSource *source, - gboolean can_recurse); + gboolean can_recurse); gboolean g_source_get_can_recurse (GSource *source); guint g_source_get_id (GSource *source); GMainContext *g_source_get_context (GSource *source); void g_source_set_callback (GSource *source, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); + GSourceFunc func, + gpointer data, + GDestroyNotify notify); void g_source_set_funcs (GSource *source, GSourceFuncs *funcs); gboolean g_source_is_destroyed (GSource *source); +void g_source_set_name (GSource *source, + const char *name); +G_CONST_RETURN char* g_source_get_name (GSource *source); +void g_source_set_name_by_id (guint tag, + const char *name); + + /* Used to implement g_source_connect_closure and internally*/ void g_source_set_callback_indirect (GSource *source, - gpointer callback_data, - GSourceCallbackFuncs *callback_funcs); + gpointer callback_data, + GSourceCallbackFuncs *callback_funcs); + +void g_source_add_poll (GSource *source, + GPollFD *fd); +void g_source_remove_poll (GSource *source, + GPollFD *fd); -void g_source_add_poll (GSource *source, - GPollFD *fd); -void g_source_remove_poll (GSource *source, - GPollFD *fd); +void g_source_add_child_source (GSource *source, + GSource *child_source); +void g_source_remove_child_source (GSource *source, + GSource *child_source); +#ifndef G_DISABLE_DEPRECATED void g_source_get_current_time (GSource *source, - GTimeVal *timeval); + GTimeVal *timeval); +#endif +gint64 g_source_get_time (GSource *source); /* void g_source_connect_closure (GSource *source, GClosure *closure); @@ -231,27 +389,108 @@ GSource *g_timeout_source_new_seconds (guint interval); /* Miscellaneous functions */ -void g_get_current_time (GTimeVal *result); +void g_get_current_time (GTimeVal *result); +gint64 g_get_monotonic_time (void); +gint64 g_get_real_time (void); /* ============== Compat main loop stuff ================== */ #ifndef G_DISABLE_DEPRECATED -/* Legacy names for GMainLoop functions +/** + * g_main_new: + * @is_running: set to %TRUE to indicate that the loop is running. This + * is not very important since calling g_main_run() will set this + * to %TRUE anyway. + * + * Creates a new #GMainLoop for th default main context. + * + * Returns: a new #GMainLoop + * + * Deprecated: 2.2: Use g_main_loop_new() instead + */ +#define g_main_new(is_running) g_main_loop_new (NULL, is_running) + +/** + * g_main_run: + * @loop: a #GMainLoop + * + * Runs a main loop until it stops running. + * + * Deprecated: 2.2: Use g_main_loop_run() instead */ -#define g_main_new(is_running) g_main_loop_new (NULL, is_running); #define g_main_run(loop) g_main_loop_run(loop) -#define g_main_quit(loop) g_main_loop_quit(loop) -#define g_main_destroy(loop) g_main_loop_unref(loop) -#define g_main_is_running(loop) g_main_loop_is_running(loop) -/* Functions to manipulate the default main loop +/** + * g_main_quit: + * @loop: a #GMainLoop + * + * Stops the #GMainLoop. + * If g_main_run() was called to run the #GMainLoop, it will now return. + * + * Deprecated: 2.2: Use g_main_loop_quit() instead */ +#define g_main_quit(loop) g_main_loop_quit(loop) -#define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) -#define g_main_pending() g_main_context_pending (NULL) +/** + * g_main_destroy: + * @loop: a #GMainLoop + * + * Frees the memory allocated for the #GMainLoop. + * + * Deprecated: 2.2: Use g_main_loop_unref() instead + */ +#define g_main_destroy(loop) g_main_loop_unref(loop) -#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) +/** + * g_main_is_running: + * @loop: a #GMainLoop + * + * Checks if the main loop is running. + * + * Returns: %TRUE if the main loop is running + * + * Deprecated: 2.2: Use g_main_loop_is_running() instead + */ +#define g_main_is_running(loop) g_main_loop_is_running(loop) + +/** + * g_main_iteration: + * @may_block: set to %TRUE if it should block (i.e. wait) until an event + * source becomes ready. It will return after an event source has been + * processed. If set to %FALSE it will return immediately if no event + * source is ready to be processed. + * + * Runs a single iteration for the default #GMainContext. + * + * Returns: %TRUE if more events are pending. + * + * Deprecated: 2.2: Use g_main_context_iteration() instead. + */ +#define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) + +/** + * g_main_pending: + * + * Checks if any events are pending for the default #GMainContext + * (i.e. ready to be processed). + * + * Returns: %TRUE if any events are pending. + * + * Deprected: 2.2: Use g_main_context_pending() instead. + */ +#define g_main_pending() g_main_context_pending (NULL) + +/** + * g_main_set_poll_func: + * @func: the function to call to poll all file descriptors + * + * Sets the function to use for the handle polling of file descriptors + * for the default main context. + * + * Deprecated: 2.2: Use g_main_context_set_poll_func() again + */ +#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) #endif /* G_DISABLE_DEPRECATED */ @@ -259,41 +498,50 @@ void g_get_current_time (GTimeVal *result); gboolean g_source_remove (guint tag); gboolean g_source_remove_by_user_data (gpointer user_data); gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, - gpointer user_data); + gpointer user_data); /* Idles, child watchers and timeouts */ guint g_timeout_add_full (gint priority, - guint interval, - GSourceFunc function, - gpointer data, - GDestroyNotify notify); + guint interval, + GSourceFunc function, + gpointer data, + GDestroyNotify notify); guint g_timeout_add (guint interval, - GSourceFunc function, - gpointer data); + GSourceFunc function, + gpointer data); guint g_timeout_add_seconds_full (gint priority, guint interval, GSourceFunc function, gpointer data, GDestroyNotify notify); guint g_timeout_add_seconds (guint interval, - GSourceFunc function, - gpointer data); + GSourceFunc function, + gpointer data); guint g_child_watch_add_full (gint priority, - GPid pid, - GChildWatchFunc function, - gpointer data, - GDestroyNotify notify); + GPid pid, + GChildWatchFunc function, + gpointer data, + GDestroyNotify notify); guint g_child_watch_add (GPid pid, - GChildWatchFunc function, - gpointer data); + GChildWatchFunc function, + gpointer data); guint g_idle_add (GSourceFunc function, - gpointer data); + gpointer data); guint g_idle_add_full (gint priority, - GSourceFunc function, - gpointer data, - GDestroyNotify notify); + GSourceFunc function, + gpointer data, + GDestroyNotify notify); gboolean g_idle_remove_by_data (gpointer data); +void g_main_context_invoke_full (GMainContext *context, + gint priority, + GSourceFunc function, + gpointer data, + GDestroyNotify notify); +void g_main_context_invoke (GMainContext *context, + GSourceFunc function, + gpointer data); + /* Hook for GClosure / GSource integration. Don't touch */ GLIB_VAR GSourceFuncs g_timeout_funcs; GLIB_VAR GSourceFuncs g_child_watch_funcs; diff --git a/glib/gmappedfile.c b/glib/gmappedfile.c index 42f1322..2af6630 100644 --- a/glib/gmappedfile.c +++ b/glib/gmappedfile.c @@ -56,7 +56,6 @@ #include "glibintl.h" -#include "galias.h" #ifndef _O_BINARY #define _O_BINARY 0 @@ -343,6 +342,3 @@ g_mapped_file_unref (GMappedFile *file) if (g_atomic_int_dec_and_test (&file->ref_count)) g_mapped_file_destroy (file); } - -#define __G_MAPPED_FILE_C__ -#include "galiasdef.c" diff --git a/glib/gmarkup.c b/glib/gmarkup.c index 74be8cb..b9e8c31 100644 --- a/glib/gmarkup.c +++ b/glib/gmarkup.c @@ -27,9 +27,13 @@ #include #include -#include "glib.h" +#include "gmarkup.h" + +#include "galloca.h" +#include "gstrfuncs.h" +#include "gstring.h" +#include "gtestutils.h" #include "glibintl.h" -#include "galias.h" GQuark g_markup_error_quark (void) @@ -1963,7 +1967,7 @@ g_markup_parse_context_get_user_data (GMarkupParseContext *context) **/ void g_markup_parse_context_push (GMarkupParseContext *context, - GMarkupParser *parser, + const GMarkupParser *parser, gpointer user_data) { GMarkupRecursionTracker *tracker; @@ -2092,12 +2096,11 @@ append_escaped_text (GString *str, * from being processed according to the XML rules for normalization * of line endings and attribute values. * - * Note also that if given a string containing them, this function - * will produce character references in the range of &#x1; .. - * &#x1f; for all control sequences except for tabstop, newline - * and carriage return. The character references in this range are - * not valid XML 1.0, but they are valid XML 1.1 and will be accepted - * by the GMarkup parser. + * Note also that this function will produce character references in + * the range of &#x1; ... &#x1f; for all control sequences + * except for tabstop, newline and carriage return. The character + * references in this range are not valid XML 1.0, but they are + * valid XML 1.1 and will be accepted by the GMarkup parser. * * Return value: a newly allocated string with the escaped text **/ @@ -2780,6 +2783,3 @@ failure: return FALSE; } - -#define __G_MARKUP_C__ -#include "galiasdef.c" diff --git a/glib/gmarkup.h b/glib/gmarkup.h index d5fb158..7bfc086 100644 --- a/glib/gmarkup.h +++ b/glib/gmarkup.h @@ -113,7 +113,7 @@ gboolean g_markup_parse_context_parse (GMarkupParseContext *context, gssize text_len, GError **error); void g_markup_parse_context_push (GMarkupParseContext *context, - GMarkupParser *parser, + const GMarkupParser *parser, gpointer user_data); gpointer g_markup_parse_context_pop (GMarkupParseContext *context); diff --git a/glib/gmem.c b/glib/gmem.c index 36e04dd..7212ae4 100644 --- a/glib/gmem.c +++ b/glib/gmem.c @@ -30,14 +30,17 @@ #include "config.h" +#include "gmem.h" + #include #include #include -#include "glib.h" -#include "gthreadprivate.h" +#include "gbacktrace.h" +#include "gtestutils.h" +#include "gthread.h" +#include "glib_trace.h" -#include "galias.h" #define MEM_PROFILE_TABLE_SIZE 4096 @@ -47,7 +50,7 @@ * g_mem_profile(). * REALLOC_0_WORKS is defined if g_realloc (NULL, x) works. * SANE_MALLOC_PROTOS is defined if the systems malloc() and friends functions - * match the corresponding GLib prototypes, keep configure.in and gmem.h in sync here. + * match the corresponding GLib prototypes, keep configure.ac and gmem.h in sync here. * g_mem_gc_friendly is TRUE, freed memory should be 0-wiped. */ @@ -118,8 +121,37 @@ static GMemVTable glib_mem_vtable = { standard_try_realloc, }; +/** + * SECTION:memory + * @Short_Description: general memory-handling + * @Title: Memory Allocation + * + * These functions provide support for allocating and freeing memory. + * + * + * If any call to allocate memory fails, the application is terminated. + * This also means that there is no need to check if the call succeeded. + * + * + * + * It's important to match g_malloc() with g_free(), plain malloc() with free(), + * and (if you're using C++) new with delete and new[] with delete[]. Otherwise + * bad things can happen, since these allocators may use different memory + * pools (and new/delete call constructors and destructors). See also + * g_mem_set_vtable(). + * + */ /* --- functions --- */ +/** + * g_malloc: + * @n_bytes: the number of bytes to allocate + * + * Allocates @n_bytes bytes of memory. + * If @n_bytes is 0 it returns %NULL. + * + * Returns: a pointer to the allocated memory + */ gpointer g_malloc (gsize n_bytes) { @@ -130,6 +162,7 @@ g_malloc (gsize n_bytes) gpointer mem; mem = glib_mem_vtable.malloc (n_bytes); + TRACE (GLIB_MEM_ALLOC((void*) mem, (unsigned int) n_bytes, 0, 0)); if (mem) return mem; @@ -137,9 +170,20 @@ g_malloc (gsize n_bytes) G_STRLOC, n_bytes); } + TRACE(GLIB_MEM_ALLOC((void*) NULL, (int) n_bytes, 0, 0)); + return NULL; } +/** + * g_malloc0: + * @n_bytes: the number of bytes to allocate + * + * Allocates @n_bytes bytes of memory, initialized to 0's. + * If @n_bytes is 0 it returns %NULL. + * + * Returns: a pointer to the allocated memory + */ gpointer g_malloc0 (gsize n_bytes) { @@ -150,6 +194,7 @@ g_malloc0 (gsize n_bytes) gpointer mem; mem = glib_mem_vtable.calloc (1, n_bytes); + TRACE (GLIB_MEM_ALLOC((void*) mem, (unsigned int) n_bytes, 1, 0)); if (mem) return mem; @@ -157,20 +202,38 @@ g_malloc0 (gsize n_bytes) G_STRLOC, n_bytes); } + TRACE(GLIB_MEM_ALLOC((void*) NULL, (int) n_bytes, 1, 0)); + return NULL; } +/** + * g_realloc: + * @mem: the memory to reallocate + * @n_bytes: new size of the memory in bytes + * + * Reallocates the memory pointed to by @mem, so that it now has space for + * @n_bytes bytes of memory. It returns the new address of the memory, which may + * have been moved. @mem may be %NULL, in which case it's considered to + * have zero-length. @n_bytes may be 0, in which case %NULL will be returned + * and @mem will be freed unless it is %NULL. + * + * Returns: the new address of the allocated memory + */ gpointer g_realloc (gpointer mem, gsize n_bytes) { + gpointer newmem; + if (G_UNLIKELY (!g_mem_initialized)) g_mem_init_nomessage(); if (G_LIKELY (n_bytes)) { - mem = glib_mem_vtable.realloc (mem, n_bytes); - if (mem) - return mem; + newmem = glib_mem_vtable.realloc (mem, n_bytes); + TRACE (GLIB_MEM_REALLOC((void*) newmem, (void*)mem, (unsigned int) n_bytes, 0)); + if (newmem) + return newmem; g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes", G_STRLOC, n_bytes); @@ -179,9 +242,18 @@ g_realloc (gpointer mem, if (mem) glib_mem_vtable.free (mem); + TRACE (GLIB_MEM_REALLOC((void*) NULL, (void*)mem, 0, 0)); + return NULL; } +/** + * g_free: + * @mem: the memory to free + * + * Frees the memory pointed to by @mem. + * If @mem is %NULL it simply returns. + */ void g_free (gpointer mem) { @@ -189,25 +261,56 @@ g_free (gpointer mem) g_mem_init_nomessage(); if (G_LIKELY (mem)) glib_mem_vtable.free (mem); + TRACE(GLIB_MEM_FREE((void*) mem)); } +/** + * g_try_malloc: + * @n_bytes: number of bytes to allocate. + * + * Attempts to allocate @n_bytes, and returns %NULL on failure. + * Contrast with g_malloc(), which aborts the program on failure. + * + * Returns: the allocated memory, or %NULL. + */ gpointer g_try_malloc (gsize n_bytes) { + gpointer mem; + if (G_UNLIKELY (!g_mem_initialized)) g_mem_init_nomessage(); if (G_LIKELY (n_bytes)) - return glib_mem_vtable.try_malloc (n_bytes); + mem = glib_mem_vtable.try_malloc (n_bytes); else - return NULL; + mem = NULL; + + TRACE (GLIB_MEM_ALLOC((void*) mem, (unsigned int) n_bytes, 0, 1)); + + return mem; } +/** + * g_try_malloc0: + * @n_bytes: number of bytes to allocate + * + * Attempts to allocate @n_bytes, initialized to 0's, and returns %NULL on + * failure. Contrast with g_malloc0(), which aborts the program on failure. + * + * Since: 2.8 + * Returns: the allocated memory, or %NULL + */ gpointer g_try_malloc0 (gsize n_bytes) { gpointer mem; - mem = g_try_malloc (n_bytes); + if (G_UNLIKELY (!g_mem_initialized)) + g_mem_init_nomessage(); + if (G_LIKELY (n_bytes)) + mem = glib_mem_vtable.try_malloc (n_bytes); + else + mem = NULL; if (mem) memset (mem, 0, n_bytes); @@ -215,24 +318,53 @@ g_try_malloc0 (gsize n_bytes) return mem; } +/** + * g_try_realloc: + * @mem: previously-allocated memory, or %NULL. + * @n_bytes: number of bytes to allocate. + * + * Attempts to realloc @mem to a new size, @n_bytes, and returns %NULL + * on failure. Contrast with g_realloc(), which aborts the program + * on failure. If @mem is %NULL, behaves the same as g_try_malloc(). + * + * Returns: the allocated memory, or %NULL. + */ gpointer g_try_realloc (gpointer mem, gsize n_bytes) { + gpointer newmem; + if (G_UNLIKELY (!g_mem_initialized)) g_mem_init_nomessage(); if (G_LIKELY (n_bytes)) - return glib_mem_vtable.try_realloc (mem, n_bytes); + newmem = glib_mem_vtable.try_realloc (mem, n_bytes); + else + { + newmem = NULL; + if (mem) + glib_mem_vtable.free (mem); + } - if (mem) - glib_mem_vtable.free (mem); + TRACE (GLIB_MEM_REALLOC((void*) newmem, (void*)mem, (unsigned int) n_bytes, 1)); - return NULL; + return newmem; } -#define SIZE_OVERFLOWS(a,b) (G_UNLIKELY ((a) > G_MAXSIZE / (b))) +#define SIZE_OVERFLOWS(a,b) (G_UNLIKELY ((b) > 0 && (a) > G_MAXSIZE / (b))) +/** + * g_malloc_n: + * @n_blocks: the number of blocks to allocate + * @n_block_bytes: the size of each block in bytes + * + * This function is similar to g_malloc(), allocating (@n_blocks * @n_block_bytes) bytes, + * but care is taken to detect possible overflow during multiplication. + * + * Since: 2.24 + * Returns: a pointer to the allocated memory + */ gpointer g_malloc_n (gsize n_blocks, gsize n_block_bytes) @@ -249,6 +381,17 @@ g_malloc_n (gsize n_blocks, return g_malloc (n_blocks * n_block_bytes); } +/** + * g_malloc0_n: + * @n_blocks: the number of blocks to allocate + * @n_block_bytes: the size of each block in bytes + * + * This function is similar to g_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes, + * but care is taken to detect possible overflow during multiplication. + * + * Since: 2.24 + * Returns: a pointer to the allocated memory + */ gpointer g_malloc0_n (gsize n_blocks, gsize n_block_bytes) @@ -265,6 +408,18 @@ g_malloc0_n (gsize n_blocks, return g_malloc0 (n_blocks * n_block_bytes); } +/** + * g_realloc_n: + * @mem: the memory to reallocate + * @n_blocks: the number of blocks to allocate + * @n_block_bytes: the size of each block in bytes + * + * This function is similar to g_realloc(), allocating (@n_blocks * @n_block_bytes) bytes, + * but care is taken to detect possible overflow during multiplication. + * + * Since: 2.24 + * Returns: the new address of the allocated memory + */ gpointer g_realloc_n (gpointer mem, gsize n_blocks, @@ -282,6 +437,17 @@ g_realloc_n (gpointer mem, return g_realloc (mem, n_blocks * n_block_bytes); } +/** + * g_try_malloc_n: + * @n_blocks: the number of blocks to allocate + * @n_block_bytes: the size of each block in bytes + * + * This function is similar to g_try_malloc(), allocating (@n_blocks * @n_block_bytes) bytes, + * but care is taken to detect possible overflow during multiplication. + * + * Since: 2.24 + * Returns: the allocated memory, or %NULL. + */ gpointer g_try_malloc_n (gsize n_blocks, gsize n_block_bytes) @@ -292,6 +458,17 @@ g_try_malloc_n (gsize n_blocks, return g_try_malloc (n_blocks * n_block_bytes); } +/** + * g_try_malloc0_n: + * @n_blocks: the number of blocks to allocate + * @n_block_bytes: the size of each block in bytes + * + * This function is similar to g_try_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes, + * but care is taken to detect possible overflow during multiplication. + * + * Since: 2.24 + * Returns: the allocated memory, or %NULL + */ gpointer g_try_malloc0_n (gsize n_blocks, gsize n_block_bytes) @@ -302,6 +479,18 @@ g_try_malloc0_n (gsize n_blocks, return g_try_malloc0 (n_blocks * n_block_bytes); } +/** + * g_try_realloc_n: + * @mem: previously-allocated memory, or %NULL. + * @n_blocks: the number of blocks to allocate + * @n_block_bytes: the size of each block in bytes + * + * This function is similar to g_try_realloc(), allocating (@n_blocks * @n_block_bytes) bytes, + * but care is taken to detect possible overflow during multiplication. + * + * Since: 2.24 + * Returns: the allocated memory, or %NULL. + */ gpointer g_try_realloc_n (gpointer mem, gsize n_blocks, @@ -335,7 +524,7 @@ static gboolean vtable_set = FALSE; * * Checks whether the allocator used by g_malloc() is the system's * malloc implementation. If it returns %TRUE memory allocated with - * malloc() can be used interchangeable with memory allocated using g_malloc(). + * malloc() can be used interchangeable with memory allocated using g_malloc(). * This function is useful for avoiding an extra copy of allocated memory returned * by a non-GLib-based API. * @@ -349,6 +538,18 @@ g_mem_is_system_malloc (void) return !vtable_set; } +/** + * g_mem_set_vtable: + * @vtable: table of memory allocation routines. + * + * Sets the #GMemVTable to use for memory allocation. You can use this to provide + * custom memory allocation routines. This function must be called + * before using any other GLib functions. The @vtable only needs to + * provide malloc(), realloc(), and free() functions; GLib can provide default + * implementations of the others. The malloc() and realloc() implementations + * should return %NULL on failure, GLib will handle error-checking for you. + * @vtable is copied, so need not persist after this function has been called. + */ void g_mem_set_vtable (GMemVTable *vtable) { @@ -374,6 +575,14 @@ g_mem_set_vtable (GMemVTable *vtable) /* --- memory profiling and checking --- */ #ifdef G_DISABLE_CHECKS +/** + * glib_mem_profiler_table: + * + * A #GMemVTable containing profiling variants of the memory + * allocation functions. Use them together with g_mem_profile() + * in order to get information about the memory allocation pattern + * of your program. + */ GMemVTable *glib_mem_profiler_table = &glib_mem_vtable; void g_mem_profile (void) @@ -474,6 +683,22 @@ profile_print_locked (guint *local_data, g_print (" --- none ---\n"); } +/** + * g_mem_profile: + * @void: + * + * Outputs a summary of memory usage. + * + * It outputs the frequency of allocations of different sizes, + * the total number of bytes which have been allocated, + * the total number of bytes which have been freed, + * and the difference between the previous two values, i.e. the number of bytes + * still in use. + * + * Note that this function will not output anything unless you have + * previously installed the #glib_mem_profiler_table with g_mem_set_vtable(). + */ + void g_mem_profile (void) { @@ -1129,6 +1354,12 @@ g_allocator_free (GAllocator *allocator) #ifdef ENABLE_GC_FRIENDLY_DEFAULT gboolean g_mem_gc_friendly = TRUE; #else +/** + * g_mem_gc_friendly: + * + * This variable is %TRUE if the G_DEBUG environment variable + * includes the key gc-friendly. + */ gboolean g_mem_gc_friendly = FALSE; #endif @@ -1164,6 +1395,3 @@ _g_mem_thread_init_noprivate_nomessage (void) gmem_profile_mutex = g_mutex_new (); #endif } - -#define __G_MEM_C__ -#include "galiasdef.c" diff --git a/glib/gmem.h b/glib/gmem.h index 54f153b..01d953e 100644 --- a/glib/gmem.h +++ b/glib/gmem.h @@ -36,10 +36,29 @@ G_BEGIN_DECLS +/** + * GMemVTable: + * @malloc: function to use for allocating memory. + * @realloc: function to use for reallocating memory. + * @free: function to use to free memory. + * @calloc: function to use for allocating zero-filled memory. + * @try_malloc: function to use for allocating memory without a default error handler. + * @try_realloc: function to use for reallocating memory without a default error handler. + * + * A set of functions used to perform memory allocation. The same #GMemVTable must + * be used for all allocations in the same program; a call to g_mem_set_vtable(), + * if it exists, should be prior to any use of GLib. + */ typedef struct _GMemVTable GMemVTable; #if GLIB_SIZEOF_VOID_P > GLIB_SIZEOF_LONG +/** + * G_MEM_ALIGN: + * + * Indicates the number of bytes to which memory will be aligned on the + * current platform. + */ # define G_MEM_ALIGN GLIB_SIZEOF_VOID_P #else /* GLIB_SIZEOF_VOID_P <= GLIB_SIZEOF_LONG */ # define G_MEM_ALIGN GLIB_SIZEOF_LONG @@ -85,7 +104,7 @@ gpointer g_try_realloc_n (gpointer mem, gsize __n = (gsize) (n_structs); \ gsize __s = sizeof (struct_type); \ gpointer __p; \ - if (__s == 1) \ + if (__s == 1) \ __p = g_##func (__n); \ else if (__builtin_constant_p (__n) && \ (__s == 0 || __n <= G_MAXSIZE / __s)) \ @@ -120,11 +139,98 @@ gpointer g_try_realloc_n (gpointer mem, #endif +/** + * g_new: + * @struct_type: the type of the elements to allocate + * @n_structs: the number of elements to allocate + * + * Allocates @n_structs elements of type @struct_type. + * The returned pointer is cast to a pointer to the given type. + * If @n_structs is 0 it returns %NULL. + * Care is taken to avoid overflow when calculating the size of the allocated block. + * + * Since the returned pointer is already casted to the right type, + * it is normally unnecessary to cast it explicitly, and doing + * so might hide memory allocation errors. + * + * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type + */ #define g_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc) +/** + * g_new0: + * @struct_type: the type of the elements to allocate. + * @n_structs: the number of elements to allocate. + * + * Allocates @n_structs elements of type @struct_type, initialized to 0's. + * The returned pointer is cast to a pointer to the given type. + * If @n_structs is 0 it returns %NULL. + * Care is taken to avoid overflow when calculating the size of the allocated block. + * + * Since the returned pointer is already casted to the right type, + * it is normally unnecessary to cast it explicitly, and doing + * so might hide memory allocation errors. + * + * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type. + */ #define g_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc0) +/** + * g_renew: + * @struct_type: the type of the elements to allocate + * @mem: the currently allocated memory + * @n_structs: the number of elements to allocate + * + * Reallocates the memory pointed to by @mem, so that it now has space for + * @n_structs elements of type @struct_type. It returns the new address of + * the memory, which may have been moved. + * Care is taken to avoid overflow when calculating the size of the allocated block. + * + * Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type + */ #define g_renew(struct_type, mem, n_structs) _G_RENEW (struct_type, mem, n_structs, realloc) +/** + * g_try_new: + * @struct_type: the type of the elements to allocate + * @n_structs: the number of elements to allocate + * + * Attempts to allocate @n_structs elements of type @struct_type, and returns + * %NULL on failure. Contrast with g_new(), which aborts the program on failure. + * The returned pointer is cast to a pointer to the given type. + * The function returns %NULL when @n_structs is 0 of if an overflow occurs. + * + * Since: 2.8 + * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type + */ #define g_try_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, try_malloc) +/** + * g_try_new0: + * @struct_type: the type of the elements to allocate + * @n_structs: the number of elements to allocate + * + * Attempts to allocate @n_structs elements of type @struct_type, initialized + * to 0's, and returns %NULL on failure. Contrast with g_new0(), which aborts + * the program on failure. + * The returned pointer is cast to a pointer to the given type. + * The function returns %NULL when @n_structs is 0 of if an overflow occurs. + * + * Since: 2.8 + * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type + */ #define g_try_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, try_malloc0) +/** + * g_try_renew: + * @struct_type: the type of the elements to allocate + * @mem: the currently allocated memory + * @n_structs: the number of elements to allocate + * + * Attempts to reallocate the memory pointed to by @mem, so that it now has + * space for @n_structs elements of type @struct_type, and returns %NULL on + * failure. Contrast with g_renew(), which aborts the program on failure. + * It returns the new address of the memory, which may have been moved. + * The function returns %NULL if an overflow occurs. + * + * Since: 2.8 + * Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type + */ #define g_try_renew(struct_type, mem, n_structs) _G_RENEW (struct_type, mem, n_structs, try_realloc) diff --git a/glib/gmessages.c b/glib/gmessages.c index 9a3eec3..245e454 100644 --- a/glib/gmessages.c +++ b/glib/gmessages.c @@ -21,10 +21,10 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ @@ -41,11 +41,18 @@ #include #include -#include "glib.h" +#include "gmessages.h" + +#include "gbacktrace.h" +#include "gconvert.h" #include "gdebug.h" +#include "gmem.h" #include "gprintfint.h" +#include "gtestutils.h" +#include "gthread.h" #include "gthreadprivate.h" -#include "galias.h" +#include "gstrfuncs.h" +#include "gstring.h" #ifdef G_OS_WIN32 #include /* For getpid() */ @@ -56,6 +63,7 @@ # undef STRICT #endif + /* --- structures --- */ typedef struct _GLogDomain GLogDomain; typedef struct _GLogHandler GLogHandler; @@ -575,12 +583,6 @@ g_return_if_fail_warning (const char *log_domain, const char *pretty_function, const char *expression) { - /* - * Omit the prefix used by the PLT-reduction - * technique used in GTK+. - */ - if (g_str_has_prefix (pretty_function, "IA__")) - pretty_function += 4; g_log (log_domain, G_LOG_LEVEL_CRITICAL, "%s: assertion `%s' failed", @@ -616,12 +618,6 @@ g_assert_warning (const char *log_domain, const char *pretty_function, const char *expression) { - /* - * Omit the prefix used by the PLT-reduction - * technique used in GTK+. - */ - if (g_str_has_prefix (pretty_function, "IA__")) - pretty_function += 4; g_log (log_domain, G_LOG_LEVEL_ERROR, expression @@ -1161,6 +1157,3 @@ _g_debug_init (void) g_log_set_always_fatal (fatal_mask); } } - -#define __G_MESSAGES_C__ -#include "galiasdef.c" diff --git a/glib/gnode.c b/glib/gnode.c index 7d3dfce..22d1937 100644 --- a/glib/gnode.c +++ b/glib/gnode.c @@ -24,17 +24,18 @@ * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. + * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -/* +/* * MT safe */ #include "config.h" -#include "glib.h" -#include "galias.h" +#include "gnode.h" + +#include "gtestutils.h" /** * SECTION: trees-nary @@ -1276,6 +1277,3 @@ g_node_children_foreach (GNode *node, } } } - -#define __G_NODE_C__ -#include "galiasdef.c" diff --git a/glib/gnode.h b/glib/gnode.h index f68e8b3..205d47c 100644 --- a/glib/gnode.h +++ b/glib/gnode.h @@ -250,7 +250,8 @@ GNode* g_node_last_sibling (GNode *node); * * Gets the previous sibling of a #GNode. * - * Returns: the previous sibling of @node, or %NULL if @node is %NULL + * Returns: the previous sibling of @node, or %NULL if @node is the first + * node or %NULL */ #define g_node_prev_sibling(node) ((node) ? \ ((GNode*) (node))->prev : NULL) @@ -261,7 +262,8 @@ GNode* g_node_last_sibling (GNode *node); * * Gets the next sibling of a #GNode. * - * Returns: the next sibling of @node, or %NULL if @node is %NULL + * Returns: the next sibling of @node, or %NULL if @node is the last node + * or %NULL */ #define g_node_next_sibling(node) ((node) ? \ ((GNode*) (node))->next : NULL) diff --git a/glib/gnulib/Makefile.am b/glib/gnulib/Makefile.am index 5f5ef06..ae8283d 100644 --- a/glib/gnulib/Makefile.am +++ b/glib/gnulib/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in include $(top_srcdir)/Makefile.decl -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -DG_LOG_DOMAIN=\"GLib\" \ +INCLUDES = $(glib_INCLUDES) -DG_LOG_DOMAIN=\"GLib\" \ $(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION noinst_LTLIBRARIES = libgnulib.la diff --git a/glib/gnulib/Makefile.in b/glib/gnulib/Makefile.in index a7eae3d..d376395 100644 --- a/glib/gnulib/Makefile.in +++ b/glib/gnulib/Makefile.in @@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/glib/libcharset/codeset.m4 \ $(top_srcdir)/glib/libcharset/glibc21.m4 \ $(top_srcdir)/m4macros/glib-gettext.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -92,6 +92,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABS_GLIB_RUNTIME_LIBDIR = @ABS_GLIB_RUNTIME_LIBDIR@ +ABS_TAPSET_DIR = @ABS_TAPSET_DIR@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ @@ -116,11 +117,14 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DBUS1_CFLAGS = @DBUS1_CFLAGS@ +DBUS1_LIBS = @DBUS1_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_MEM_POOLS = @DISABLE_MEM_POOLS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -134,13 +138,16 @@ GIO = @GIO@ GIO_MODULE_DIR = @GIO_MODULE_DIR@ GLIBC21 = @GLIBC21@ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_LINK_FLAGS = @GLIB_LINK_FLAGS@ GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_RT_LIBS = @GLIB_RT_LIBS@ GLIB_RUNTIME_LIBDIR = @GLIB_RUNTIME_LIBDIR@ GLIB_VERSION = @GLIB_VERSION@ GLIB_WIN32_STATIC_COMPILATION_DEFINE = @GLIB_WIN32_STATIC_COMPILATION_DEFINE@ @@ -187,6 +194,8 @@ LIB_EXE_MACHINE_FLAG = @LIB_EXE_MACHINE_FLAG@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LTP = @LTP@ +LTP_GENHTML = @LTP_GENHTML@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ @@ -194,6 +203,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ @@ -219,6 +229,8 @@ PCRE_WARN_CFLAGS = @PCRE_WARN_CFLAGS@ PERL = @PERL@ PERL_PATH = @PERL_PATH@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORMDEP = @PLATFORMDEP@ POFILES = @POFILES@ POSUB = @POSUB@ @@ -235,6 +247,7 @@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHTOOL = @SHTOOL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -244,11 +257,13 @@ XGETTEXT = @XGETTEXT@ XMLCATALOG = @XMLCATALOG@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ XSLTPROC = @XSLTPROC@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -264,11 +279,17 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +config_h_INCLUDES = @config_h_INCLUDES@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gio_INCLUDES = @gio_INCLUDES@ +glib_INCLUDES = @glib_INCLUDES@ +gmodule_INCLUDES = @gmodule_INCLUDES@ +gobject_INCLUDES = @gobject_INCLUDES@ +gthread_INCLUDES = @gthread_INCLUDES@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -282,7 +303,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ @@ -311,7 +331,7 @@ GTESTER_REPORT = $(top_builddir)/glib/gtester-report # for the GLIB package # initialize variables for unconditional += appending EXTRA_DIST = makefile.msc TEST_PROGS = -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -DG_LOG_DOMAIN=\"GLib\" \ +INCLUDES = $(glib_INCLUDES) -DG_LOG_DOMAIN=\"GLib\" \ $(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION noinst_LTLIBRARIES = libgnulib.la @@ -618,13 +638,16 @@ uninstall-am: ### testing rules # test: run all tests in cwd and subdirs -test: ${TEST_PROGS} -@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} +test: test-nonrecursive @OS_UNIX_TRUE@ @ for subdir in $(SUBDIRS) . ; do \ @OS_UNIX_TRUE@ test "$$subdir" = "." -o "$$subdir" = "po" || \ @OS_UNIX_TRUE@ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ @OS_UNIX_TRUE@ done +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} +@OS_UNIX_TRUE@ @test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + # test-report: run tests in subdirs and generate report # perf-report: run tests in subdirs with -m perf and generate report # full-report: like test-report: with -m perf and -m slow @@ -651,8 +674,12 @@ test-report perf-report full-report: ${TEST_PROGS} ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ @@ -661,9 +688,29 @@ test-report perf-report full-report: ${TEST_PROGS} rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } -.PHONY: test test-report perf-report full-report -# run make test as part of make check -check-local: test +.PHONY: test test-report perf-report full-report test-nonrecursive + +.PHONY: lcov genlcov lcov-clean +# use recursive makes in order to ignore errors during check +lcov: + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) genlcov + +# we have to massage the lcov.info file slightly to hide the effect of libtool +# placing the objects files in the .libs/ directory separate from the *.c +# we also have to delete tests/.libs/libmoduletestplugin_*.gcda +genlcov: + rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda + $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool + LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info + +lcov-clean: + -$(LTP) --directory $(top_builddir) -z + -rm -rf glib-lcov.info glib-lcov + -find -name '*.gcda' -print | xargs rm + +# run tests in cwd as part of make check +check-local: test-nonrecursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/glib/gnulib/g-gnulib.h b/glib/gnulib/g-gnulib.h index 6dbf2e9..88f3e0e 100644 --- a/glib/gnulib/g-gnulib.h +++ b/glib/gnulib/g-gnulib.h @@ -21,7 +21,6 @@ #include "config.h" #include #include "glib/glib.h" -#include "glib/galias.h" /* Private namespace for gnulib functions */ #define asnprintf _g_gnulib_asnprintf diff --git a/glib/goption.c b/glib/goption.c index 9747d47..f09c7e1 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -18,43 +18,49 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + /** * SECTION:option * @Short_description: parses commandline options * @Title: Commandline option parser - * - * The GOption commandline parser is intended to be a simpler replacement for the - * popt library. It supports short and long commandline options, as shown in the - * following example: - * + * + * The GOption commandline parser is intended to be a simpler replacement + * for the popt library. It supports short and long commandline options, + * as shown in the following example: + * * testtreemodel -r 1 --max-size 20 --rand --display=:1.0 -vb -- file1 file2 - * - * The example demonstrates a number of features of the GOption commandline parser + * + * The example demonstrates a number of features of the GOption + * commandline parser * * Options can be single letters, prefixed by a single dash. Multiple * short options can be grouped behind a single dash. * * Long options are prefixed by two consecutive dashes. * - * Options can have an extra argument, which can be a number, a string or a - * filename. For long options, the extra argument can be appended with an - * equals sign after the option name. + * Options can have an extra argument, which can be a number, a string or + * a filename. For long options, the extra argument can be appended with + * an equals sign after the option name, which is useful if the extra + * argument starts with a dash, which would otherwise cause it to be + * interpreted as another option. * * Non-option arguments are returned to the application as rest arguments. * - * An argument consisting solely of two dashes turns off further parsing, - * any remaining arguments (even those starting with a dash) are returned + * An argument consisting solely of two dashes turns off further parsing, + * any remaining arguments (even those starting with a dash) are returned * to the application as rest arguments. * - * - * Another important feature of GOption is that it can automatically generate - * nicely formatted help output. Unless it is explicitly turned off with - * g_option_context_set_help_enabled(), GOption will recognize the - * , , - * and groupname options - * (where groupname is the name of a #GOptionGroup) - * and write a text similar to the one shown in the following example to stdout. - * + * + * Another important feature of GOption is that it can automatically + * generate nicely formatted help output. Unless it is explicitly turned + * off with g_option_context_set_help_enabled(), GOption will recognize + * the , , + * and + * groupname options + * (where groupname is the name of a + * #GOptionGroup) and write a text similar to the one shown in the + * following example to stdout. + * * * Usage: * testtreemodel [OPTION...] - test tree model performance @@ -69,10 +75,10 @@ * -m, --max-size=M Test up to 2^M items * --display=DISPLAY X display to use * -v, --verbose Be verbose - * -b, --beep Beep when done + * -b, --beep Beep when done * --rand Randomize the data * - * + * * GOption groups options in #GOptionGroups, which makes it easy to * incorporate options from multiple sources. The intended use for this is * to let applications collect option groups from the libraries it uses, @@ -80,21 +86,22 @@ * to g_option_context_parse(). See gtk_get_option_group() for an example. * * If an option is declared to be of type string or filename, GOption takes - * care of converting it to the right encoding; strings are returned in UTF-8, - * filenames are returned in the GLib filename encoding. Note that this only - * works if setlocale() has been called before g_option_context_parse(). - * + * care of converting it to the right encoding; strings are returned in + * UTF-8, filenames are returned in the GLib filename encoding. Note that + * this only works if setlocale() has been called before + * g_option_context_parse(). + * * Here is a complete example of setting up GOption to parse the example * commandline above and produce the example help output. - * + * * * static gint repeats = 2; * static gint max_size = 8; * static gboolean verbose = FALSE; * static gboolean beep = FALSE; * static gboolean rand = FALSE; - * - * static GOptionEntry entries[] = + * + * static GOptionEntry entries[] = * { * { "repeats", 'r', 0, G_OPTION_ARG_INT, &repeats, "Average over N repetitions", "N" }, * { "max-size", 'm', 0, G_OPTION_ARG_INT, &max_size, "Test up to 2^M items", "M" }, @@ -103,13 +110,13 @@ * { "rand", 0, 0, G_OPTION_ARG_NONE, &rand, "Randomize the data", NULL }, * { NULL } * }; - * - * int + * + * int * main (int argc, char *argv[]) * { * GError *error = NULL; * GOptionContext *context; - * + * * context = g_option_context_new ("- test tree model performance"); * g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); * g_option_context_add_group (context, gtk_get_option_group (TRUE)); @@ -118,27 +125,25 @@ * g_print ("option parsing failed: %s\n", error->message); * exit (1); * } - * - * // ... - * + * + * /* ... */ + * * } * */ #include "config.h" -#include "goption.h" -#include "glib.h" -#include "glibintl.h" -#include "gprintf.h" - -#include "galias.h" - #include #include #include #include +#include "goption.h" + +#include "gprintf.h" +#include "glibintl.h" + #define TRANSLATE(group, str) (((group)->translate_func ? (* (group)->translate_func) ((str), (group)->translate_data) : (str))) #define NO_ARG(entry) ((entry)->arg == G_OPTION_ARG_NONE || \ @@ -148,11 +153,11 @@ #define OPTIONAL_ARG(entry) ((entry)->arg == G_OPTION_ARG_CALLBACK && \ (entry)->flags & G_OPTION_FLAG_OPTIONAL_ARG) -typedef struct +typedef struct { GOptionArg arg_type; - gpointer arg_data; - union + gpointer arg_data; + union { gboolean bool; gint integer; @@ -161,10 +166,10 @@ typedef struct gdouble dbl; gint64 int64; } prev; - union + union { gchar *str; - struct + struct { gint len; gchar **data; @@ -188,17 +193,17 @@ struct _GOptionContext GTranslateFunc translate_func; GDestroyNotify translate_notify; - gpointer translate_data; + gpointer translate_data; guint help_enabled : 1; guint ignore_unknown : 1; - + GOptionGroup *main_group; /* We keep a list of change so we can revert them */ GList *changes; - - /* We also keep track of all argv elements + + /* We also keep track of all argv elements * that should be NULLed or modified. */ GList *pending_nulls; @@ -215,7 +220,7 @@ struct _GOptionGroup GTranslateFunc translate_func; GDestroyNotify translate_notify; - gpointer translate_data; + gpointer translate_data; GOptionEntry *entries; gint n_entries; @@ -226,9 +231,9 @@ struct _GOptionGroup }; static void free_changes_list (GOptionContext *context, - gboolean revert); + gboolean revert); static void free_pending_nulls (GOptionContext *context, - gboolean perform_nulls); + gboolean perform_nulls); static int @@ -267,14 +272,14 @@ _g_utf8_strwidth (const gchar *p, return 0; /* this case may not be quite correct */ - + len += _g_unichar_get_width (g_utf8_get_char (p)); - p = g_utf8_next_char (p); + p = g_utf8_next_char (p); while (p - start < max && *p) { len += _g_unichar_get_width (g_utf8_get_char (p)); - p = g_utf8_next_char (p); + p = g_utf8_next_char (p); } } @@ -292,10 +297,10 @@ g_option_error_quark (void) * g_option_context_new: * @parameter_string: a string which is displayed in * the first line of output, after the - * usage summary + * usage summary * programname [OPTION...] * - * Creates a new option context. + * Creates a new option context. * * The @parameter_string can serve multiple purposes. It can be used * to add descriptions for "rest" arguments, which are not parsed by @@ -337,9 +342,9 @@ g_option_context_new (const gchar *parameter_string) /** * g_option_context_free: - * @context: a #GOptionContext + * @context: a #GOptionContext * - * Frees context and all the groups which have been + * Frees context and all the groups which have been * added to it. * * Please note that parsed arguments need to be freed separately (see @@ -347,23 +352,23 @@ g_option_context_new (const gchar *parameter_string) * * Since: 2.6 */ -void g_option_context_free (GOptionContext *context) +void g_option_context_free (GOptionContext *context) { g_return_if_fail (context != NULL); g_list_foreach (context->groups, (GFunc)g_option_group_free, NULL); g_list_free (context->groups); - if (context->main_group) + if (context->main_group) g_option_group_free (context->main_group); free_changes_list (context, FALSE); free_pending_nulls (context, FALSE); - + g_free (context->parameter_string); g_free (context->summary); g_free (context->description); - + if (context->translate_notify) (* context->translate_notify) (context->translate_data); @@ -376,12 +381,12 @@ void g_option_context_free (GOptionContext *context) * @context: a #GOptionContext * @help_enabled: %TRUE to enable , %FALSE to disable it * - * Enables or disables automatic generation of + * Enables or disables automatic generation of * output. By default, g_option_context_parse() recognizes * , , * , * and groupname and creates - * suitable output to stdout. + * suitable output to stdout. * * Since: 2.6 */ @@ -397,19 +402,19 @@ void g_option_context_set_help_enabled (GOptionContext *context, /** * g_option_context_get_help_enabled: * @context: a #GOptionContext - * + * * Returns whether automatic generation * is turned on for @context. See g_option_context_set_help_enabled(). - * + * * Returns: %TRUE if automatic help generation is turned on. * * Since: 2.6 */ -gboolean -g_option_context_get_help_enabled (GOptionContext *context) +gboolean +g_option_context_get_help_enabled (GOptionContext *context) { g_return_val_if_fail (context != NULL, FALSE); - + return context->help_enabled; } @@ -418,12 +423,12 @@ g_option_context_get_help_enabled (GOptionContext *context) * @context: a #GOptionContext * @ignore_unknown: %TRUE to ignore unknown options, %FALSE to produce * an error when unknown options are met - * - * Sets whether to ignore unknown options or not. If an argument is - * ignored, it is left in the @argv array after parsing. By default, + * + * Sets whether to ignore unknown options or not. If an argument is + * ignored, it is left in the @argv array after parsing. By default, * g_option_context_parse() treats unknown options as error. - * - * This setting does not affect non-option arguments (i.e. arguments + * + * This setting does not affect non-option arguments (i.e. arguments * which don't start with a dash). But note that GOption cannot reliably * determine whether a non-option belongs to a preceding unknown option. * @@ -431,7 +436,7 @@ g_option_context_get_help_enabled (GOptionContext *context) **/ void g_option_context_set_ignore_unknown_options (GOptionContext *context, - gboolean ignore_unknown) + gboolean ignore_unknown) { g_return_if_fail (context != NULL); @@ -441,12 +446,12 @@ g_option_context_set_ignore_unknown_options (GOptionContext *context, /** * g_option_context_get_ignore_unknown_options: * @context: a #GOptionContext - * + * * Returns whether unknown options are ignored or not. See * g_option_context_set_ignore_unknown_options(). - * + * * Returns: %TRUE if unknown options are ignored. - * + * * Since: 2.6 **/ gboolean @@ -461,7 +466,7 @@ g_option_context_get_ignore_unknown_options (GOptionContext *context) * g_option_context_add_group: * @context: a #GOptionContext * @group: the group to add - * + * * Adds a #GOptionGroup to the @context, so that parsing with @context * will recognize the options in the group. Note that the group will * be freed together with the context when g_option_context_free() is @@ -472,7 +477,7 @@ g_option_context_get_ignore_unknown_options (GOptionContext *context) **/ void g_option_context_add_group (GOptionContext *context, - GOptionGroup *group) + GOptionGroup *group) { GList *list; @@ -487,9 +492,9 @@ g_option_context_add_group (GOptionContext *context, GOptionGroup *g = (GOptionGroup *)list->data; if ((group->name == NULL && g->name == NULL) || - (group->name && g->name && strcmp (group->name, g->name) == 0)) - g_warning ("A group named \"%s\" is already part of this GOptionContext", - group->name); + (group->name && g->name && strcmp (group->name, g->name) == 0)) + g_warning ("A group named \"%s\" is already part of this GOptionContext", + group->name); } context->groups = g_list_append (context->groups, group); @@ -499,17 +504,17 @@ g_option_context_add_group (GOptionContext *context, * g_option_context_set_main_group: * @context: a #GOptionContext * @group: the group to set as main group - * - * Sets a #GOptionGroup as main group of the @context. - * This has the same effect as calling g_option_context_add_group(), - * the only difference is that the options in the main group are + * + * Sets a #GOptionGroup as main group of the @context. + * This has the same effect as calling g_option_context_add_group(), + * the only difference is that the options in the main group are * treated differently when generating output. * * Since: 2.6 **/ void g_option_context_set_main_group (GOptionContext *context, - GOptionGroup *group) + GOptionGroup *group) { g_return_if_fail (context != NULL); g_return_if_fail (group != NULL); @@ -520,16 +525,16 @@ g_option_context_set_main_group (GOptionContext *context, return; } - + context->main_group = group; } /** * g_option_context_get_main_group: * @context: a #GOptionContext - * + * * Returns a pointer to the main group of @context. - * + * * Return value: the main group of @context, or %NULL if @context doesn't * have a main group. Note that group belongs to @context and should * not be modified or freed. @@ -551,22 +556,22 @@ g_option_context_get_main_group (GOptionContext *context) * @translation_domain: a translation domain to use for translating * the output for the options in @entries * with gettext(), or %NULL - * - * A convenience function which creates a main group if it doesn't + * + * A convenience function which creates a main group if it doesn't * exist, adds the @entries to it and sets the translation domain. - * + * * Since: 2.6 **/ void g_option_context_add_main_entries (GOptionContext *context, - const GOptionEntry *entries, - const gchar *translation_domain) + const GOptionEntry *entries, + const gchar *translation_domain) { g_return_if_fail (entries != NULL); if (!context->main_group) context->main_group = g_option_group_new (NULL, NULL, NULL, NULL, NULL); - + g_option_group_add_entries (context->main_group, entries); g_option_group_set_translation_domain (context->main_group, translation_domain); } @@ -584,16 +589,16 @@ calculate_max_length (GOptionGroup *group) entry = &group->entries[i]; if (entry->flags & G_OPTION_FLAG_HIDDEN) - continue; + continue; len = _g_utf8_strwidth (entry->long_name, -1); - + if (entry->short_name) - len += 4; - + len += 4; + if (!NO_ARG (entry) && entry->arg_description) - len += 1 + _g_utf8_strwidth (TRANSLATE (group, entry->arg_description), -1); - + len += 1 + _g_utf8_strwidth (TRANSLATE (group, entry->arg_description), -1); + max_length = MAX (max_length, len); } @@ -602,12 +607,12 @@ calculate_max_length (GOptionGroup *group) static void print_entry (GOptionGroup *group, - gint max_length, - const GOptionEntry *entry, + gint max_length, + const GOptionEntry *entry, GString *string) { GString *str; - + if (entry->flags & G_OPTION_FLAG_HIDDEN) return; @@ -615,19 +620,19 @@ print_entry (GOptionGroup *group, return; str = g_string_new (NULL); - + if (entry->short_name) g_string_append_printf (str, " -%c, --%s", entry->short_name, entry->long_name); else g_string_append_printf (str, " --%s", entry->long_name); - + if (entry->arg_description) g_string_append_printf (str, "=%s", TRANSLATE (group, entry->arg_description)); - + g_string_append_printf (string, "%s%*s %s\n", str->str, - (int) (max_length + 4 - _g_utf8_strwidth (str->str, -1)), "", - entry->description ? TRANSLATE (group, entry->description) : ""); - g_string_free (str, TRUE); + (int) (max_length + 4 - _g_utf8_strwidth (str->str, -1)), "", + entry->description ? TRANSLATE (group, entry->description) : ""); + g_string_free (str, TRUE); } static gboolean @@ -702,9 +707,9 @@ context_has_h_entry (GOptionContext *context) } /** - * g_option_context_get_help: + * g_option_context_get_help: * @context: a #GOptionContext - * @main_help: if %TRUE, only include the main group + * @main_help: if %TRUE, only include the main group * @group: the #GOptionGroup to create help for, or %NULL * * Returns a formatted, translated help text for the given context. @@ -721,8 +726,8 @@ context_has_h_entry (GOptionContext *context) */ gchar * g_option_context_get_help (GOptionContext *context, - gboolean main_help, - GOptionGroup *group) + gboolean main_help, + GOptionGroup *group) { GList *list; gint max_length, len; @@ -741,18 +746,18 @@ g_option_context_get_help (GOptionContext *context, { for (i = 0; i < context->main_group->n_entries; i++) - { - entry = &context->main_group->entries[i]; - if (entry->long_name[0] == 0) - { - rest_description = TRANSLATE (context->main_group, entry->arg_description); - break; - } - } + { + entry = &context->main_group->entries[i]; + if (entry->long_name[0] == 0) + { + rest_description = TRANSLATE (context->main_group, entry->arg_description); + break; + } + } } - g_string_append_printf (string, "%s\n %s %s", - _("Usage:"), g_get_prgname(), _("[OPTION...]")); + g_string_append_printf (string, "%s\n %s %s", + _("Usage:"), g_get_prgname(), _("[OPTION...]")); if (rest_description) { @@ -780,17 +785,17 @@ g_option_context_get_help (GOptionContext *context, if (context->main_group) { for (i = 0; i < context->main_group->n_entries; i++) - { - entry = &context->main_group->entries[i]; - g_hash_table_insert (shadow_map, - (gpointer)entry->long_name, - entry); - - if (seen[(guchar)entry->short_name]) - entry->short_name = 0; - else - seen[(guchar)entry->short_name] = TRUE; - } + { + entry = &context->main_group->entries[i]; + g_hash_table_insert (shadow_map, + (gpointer)entry->long_name, + entry); + + if (seen[(guchar)entry->short_name]) + entry->short_name = 0; + else + seen[(guchar)entry->short_name] = TRUE; + } } list = context->groups; @@ -798,20 +803,20 @@ g_option_context_get_help (GOptionContext *context, { GOptionGroup *g = list->data; for (i = 0; i < g->n_entries; i++) - { - entry = &g->entries[i]; - if (g_hash_table_lookup (shadow_map, entry->long_name) && - !(entry->flags & G_OPTION_FLAG_NOALIAS)) - entry->long_name = g_strdup_printf ("%s-%s", g->name, entry->long_name); - else - g_hash_table_insert (shadow_map, (gpointer)entry->long_name, entry); - - if (seen[(guchar)entry->short_name] && - !(entry->flags & G_OPTION_FLAG_NOALIAS)) - entry->short_name = 0; - else - seen[(guchar)entry->short_name] = TRUE; - } + { + entry = &g->entries[i]; + if (g_hash_table_lookup (shadow_map, entry->long_name) && + !(entry->flags & G_OPTION_FLAG_NOALIAS)) + entry->long_name = g_strdup_printf ("%s-%s", g->name, entry->long_name); + else + g_hash_table_insert (shadow_map, (gpointer)entry->long_name, entry); + + if (seen[(guchar)entry->short_name] && + !(entry->flags & G_OPTION_FLAG_NOALIAS)) + entry->short_name = 0; + else + seen[(guchar)entry->short_name] = TRUE; + } list = list->next; } @@ -836,7 +841,7 @@ g_option_context_get_help (GOptionContext *context, while (list != NULL) { GOptionGroup *g = list->data; - + /* First, we check the --help- options */ len = _g_utf8_strwidth ("--help-", -1) + _g_utf8_strwidth (g->name, -1); max_length = MAX (max_length, len); @@ -844,7 +849,7 @@ g_option_context_get_help (GOptionContext *context, /* Then we go through the entries */ len = calculate_max_length (g); max_length = MAX (max_length, len); - + list = list->next; } @@ -857,27 +862,27 @@ g_option_context_get_help (GOptionContext *context, token = context_has_h_entry (context) ? '?' : 'h'; - g_string_append_printf (string, "%s\n -%c, --%-*s %s\n", - _("Help Options:"), token, max_length - 4, "help", - _("Show help options")); - + g_string_append_printf (string, "%s\n -%c, --%-*s %s\n", + _("Help Options:"), token, max_length - 4, "help", + _("Show help options")); + /* We only want --help-all when there are groups */ if (list) - g_string_append_printf (string, " --%-*s %s\n", - max_length, "help-all", + g_string_append_printf (string, " --%-*s %s\n", + max_length, "help-all", _("Show all help options")); - + while (list) - { - GOptionGroup *g = list->data; + { + GOptionGroup *g = list->data; + + if (group_has_visible_entries (context, g, FALSE)) + g_string_append_printf (string, " --help-%-*s %s\n", + max_length - 5, g->name, + TRANSLATE (g, g->help_description)); - if (group_has_visible_entries (context, g, FALSE)) - g_string_append_printf (string, " --help-%-*s %s\n", - max_length - 5, g->name, - TRANSLATE (g, g->help_description)); - - list = list->next; - } + list = list->next; + } g_string_append (string, "\n"); } @@ -902,24 +907,24 @@ g_option_context_get_help (GOptionContext *context, list = context->groups; while (list) - { - GOptionGroup *g = list->data; - - if (group_has_visible_entries (context, g, FALSE)) - { - g_string_append (string, g->description); - g_string_append (string, "\n"); - for (i = 0; i < g->n_entries; i++) - if (!(g->entries[i].flags & G_OPTION_FLAG_IN_MAIN)) - print_entry (g, max_length, &g->entries[i], string); - - g_string_append (string, "\n"); - } - - list = list->next; - } + { + GOptionGroup *g = list->data; + + if (group_has_visible_entries (context, g, FALSE)) + { + g_string_append (string, g->description); + g_string_append (string, "\n"); + for (i = 0; i < g->n_entries; i++) + if (!(g->entries[i].flags & G_OPTION_FLAG_IN_MAIN)) + print_entry (g, max_length, &g->entries[i], string); + + g_string_append (string, "\n"); + } + + list = list->next; + } } - + /* Print application options if --help or --help-all has been specified */ if ((main_help || !group) && (group_has_visible_entries (context, context->main_group, TRUE) || @@ -930,25 +935,25 @@ g_option_context_get_help (GOptionContext *context, g_string_append (string, _("Application Options:")); g_string_append (string, "\n"); if (context->main_group) - for (i = 0; i < context->main_group->n_entries; i++) - print_entry (context->main_group, max_length, - &context->main_group->entries[i], string); + for (i = 0; i < context->main_group->n_entries; i++) + print_entry (context->main_group, max_length, + &context->main_group->entries[i], string); while (list != NULL) - { - GOptionGroup *g = list->data; + { + GOptionGroup *g = list->data; + + /* Print main entries from other groups */ + for (i = 0; i < g->n_entries; i++) + if (g->entries[i].flags & G_OPTION_FLAG_IN_MAIN) + print_entry (g, max_length, &g->entries[i], string); - /* Print main entries from other groups */ - for (i = 0; i < g->n_entries; i++) - if (g->entries[i].flags & G_OPTION_FLAG_IN_MAIN) - print_entry (g, max_length, &g->entries[i], string); - - list = list->next; - } + list = list->next; + } g_string_append (string, "\n"); } - + if (context->description) { g_string_append (string, TRANSLATE (context, context->description)); @@ -961,8 +966,8 @@ g_option_context_get_help (GOptionContext *context, G_GNUC_NORETURN static void print_help (GOptionContext *context, - gboolean main_help, - GOptionGroup *group) + gboolean main_help, + GOptionGroup *group) { gchar *help; @@ -970,27 +975,27 @@ print_help (GOptionContext *context, g_print ("%s", help); g_free (help); - exit (0); + exit (0); } static gboolean parse_int (const gchar *arg_name, - const gchar *arg, - gint *result, - GError **error) + const gchar *arg, + gint *result, + GError **error) { gchar *end; glong tmp; errno = 0; tmp = strtol (arg, &end, 0); - + if (*arg == '\0' || *end != '\0') { g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Cannot parse integer value '%s' for %s"), - arg, arg_name); + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Cannot parse integer value '%s' for %s"), + arg, arg_name); return FALSE; } @@ -998,9 +1003,9 @@ parse_int (const gchar *arg_name, if (*result != tmp || errno == ERANGE) { g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Integer value '%s' for %s out of range"), - arg, arg_name); + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Integer value '%s' for %s out of range"), + arg, arg_name); return FALSE; } @@ -1010,44 +1015,44 @@ parse_int (const gchar *arg_name, static gboolean parse_double (const gchar *arg_name, - const gchar *arg, - gdouble *result, - GError **error) + const gchar *arg, + gdouble *result, + GError **error) { gchar *end; gdouble tmp; errno = 0; tmp = g_strtod (arg, &end); - + if (*arg == '\0' || *end != '\0') { g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Cannot parse double value '%s' for %s"), - arg, arg_name); + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Cannot parse double value '%s' for %s"), + arg, arg_name); return FALSE; } if (errno == ERANGE) { g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Double value '%s' for %s out of range"), - arg, arg_name); + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Double value '%s' for %s out of range"), + arg, arg_name); return FALSE; } *result = tmp; - + return TRUE; } static gboolean parse_int64 (const gchar *arg_name, - const gchar *arg, - gint64 *result, - GError **error) + const gchar *arg, + gint64 *result, + GError **error) { gchar *end; gint64 tmp; @@ -1058,48 +1063,48 @@ parse_int64 (const gchar *arg_name, if (*arg == '\0' || *end != '\0') { g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Cannot parse integer value '%s' for %s"), - arg, arg_name); + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Cannot parse integer value '%s' for %s"), + arg, arg_name); return FALSE; } if (errno == ERANGE) { g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Integer value '%s' for %s out of range"), - arg, arg_name); + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Integer value '%s' for %s out of range"), + arg, arg_name); return FALSE; } *result = tmp; - + return TRUE; } static Change * get_change (GOptionContext *context, - GOptionArg arg_type, - gpointer arg_data) + GOptionArg arg_type, + gpointer arg_data) { GList *list; Change *change = NULL; - + for (list = context->changes; list != NULL; list = list->next) { change = list->data; if (change->arg_data == arg_data) - goto found; + goto found; } change = g_new0 (Change, 1); change->arg_type = arg_type; change->arg_data = arg_data; - + context->changes = g_list_prepend (context->changes, change); - + found: return change; @@ -1107,8 +1112,8 @@ get_change (GOptionContext *context, static void add_pending_null (GOptionContext *context, - gchar **ptr, - gchar *value) + gchar **ptr, + gchar *value) { PendingNull *n; @@ -1118,15 +1123,15 @@ add_pending_null (GOptionContext *context, context->pending_nulls = g_list_prepend (context->pending_nulls, n); } - + static gboolean parse_arg (GOptionContext *context, - GOptionGroup *group, - GOptionEntry *entry, - const gchar *value, - const gchar *option_name, - GError **error) - + GOptionGroup *group, + GOptionEntry *entry, + const gchar *value, + const gchar *option_name, + GError **error) + { Change *change; @@ -1136,206 +1141,206 @@ parse_arg (GOptionContext *context, { case G_OPTION_ARG_NONE: { - change = get_change (context, G_OPTION_ARG_NONE, - entry->arg_data); + change = get_change (context, G_OPTION_ARG_NONE, + entry->arg_data); - *(gboolean *)entry->arg_data = !(entry->flags & G_OPTION_FLAG_REVERSE); - break; - } + *(gboolean *)entry->arg_data = !(entry->flags & G_OPTION_FLAG_REVERSE); + break; + } case G_OPTION_ARG_STRING: { - gchar *data; - - data = g_locale_to_utf8 (value, -1, NULL, NULL, error); - - if (!data) - return FALSE; - - change = get_change (context, G_OPTION_ARG_STRING, - entry->arg_data); - g_free (change->allocated.str); - - change->prev.str = *(gchar **)entry->arg_data; - change->allocated.str = data; - - *(gchar **)entry->arg_data = data; - break; + gchar *data; + + data = g_locale_to_utf8 (value, -1, NULL, NULL, error); + + if (!data) + return FALSE; + + change = get_change (context, G_OPTION_ARG_STRING, + entry->arg_data); + g_free (change->allocated.str); + + change->prev.str = *(gchar **)entry->arg_data; + change->allocated.str = data; + + *(gchar **)entry->arg_data = data; + break; } case G_OPTION_ARG_STRING_ARRAY: { - gchar *data; + gchar *data; - data = g_locale_to_utf8 (value, -1, NULL, NULL, error); + data = g_locale_to_utf8 (value, -1, NULL, NULL, error); - if (!data) - return FALSE; + if (!data) + return FALSE; - change = get_change (context, G_OPTION_ARG_STRING_ARRAY, - entry->arg_data); + change = get_change (context, G_OPTION_ARG_STRING_ARRAY, + entry->arg_data); - if (change->allocated.array.len == 0) - { - change->prev.array = *(gchar ***)entry->arg_data; - change->allocated.array.data = g_new (gchar *, 2); - } - else - change->allocated.array.data = - g_renew (gchar *, change->allocated.array.data, - change->allocated.array.len + 2); + if (change->allocated.array.len == 0) + { + change->prev.array = *(gchar ***)entry->arg_data; + change->allocated.array.data = g_new (gchar *, 2); + } + else + change->allocated.array.data = + g_renew (gchar *, change->allocated.array.data, + change->allocated.array.len + 2); - change->allocated.array.data[change->allocated.array.len] = data; - change->allocated.array.data[change->allocated.array.len + 1] = NULL; + change->allocated.array.data[change->allocated.array.len] = data; + change->allocated.array.data[change->allocated.array.len + 1] = NULL; - change->allocated.array.len ++; + change->allocated.array.len ++; - *(gchar ***)entry->arg_data = change->allocated.array.data; + *(gchar ***)entry->arg_data = change->allocated.array.data; - break; + break; } - + case G_OPTION_ARG_FILENAME: { - gchar *data; + gchar *data; #ifdef G_OS_WIN32 - data = g_locale_to_utf8 (value, -1, NULL, NULL, error); - - if (!data) - return FALSE; + data = g_locale_to_utf8 (value, -1, NULL, NULL, error); + + if (!data) + return FALSE; #else - data = g_strdup (value); + data = g_strdup (value); #endif - change = get_change (context, G_OPTION_ARG_FILENAME, - entry->arg_data); - g_free (change->allocated.str); - - change->prev.str = *(gchar **)entry->arg_data; - change->allocated.str = data; - - *(gchar **)entry->arg_data = data; - break; + change = get_change (context, G_OPTION_ARG_FILENAME, + entry->arg_data); + g_free (change->allocated.str); + + change->prev.str = *(gchar **)entry->arg_data; + change->allocated.str = data; + + *(gchar **)entry->arg_data = data; + break; } case G_OPTION_ARG_FILENAME_ARRAY: { - gchar *data; - + gchar *data; + #ifdef G_OS_WIN32 - data = g_locale_to_utf8 (value, -1, NULL, NULL, error); - - if (!data) - return FALSE; + data = g_locale_to_utf8 (value, -1, NULL, NULL, error); + + if (!data) + return FALSE; #else - data = g_strdup (value); + data = g_strdup (value); #endif - change = get_change (context, G_OPTION_ARG_STRING_ARRAY, - entry->arg_data); + change = get_change (context, G_OPTION_ARG_STRING_ARRAY, + entry->arg_data); - if (change->allocated.array.len == 0) - { - change->prev.array = *(gchar ***)entry->arg_data; - change->allocated.array.data = g_new (gchar *, 2); - } - else - change->allocated.array.data = - g_renew (gchar *, change->allocated.array.data, - change->allocated.array.len + 2); + if (change->allocated.array.len == 0) + { + change->prev.array = *(gchar ***)entry->arg_data; + change->allocated.array.data = g_new (gchar *, 2); + } + else + change->allocated.array.data = + g_renew (gchar *, change->allocated.array.data, + change->allocated.array.len + 2); - change->allocated.array.data[change->allocated.array.len] = data; - change->allocated.array.data[change->allocated.array.len + 1] = NULL; + change->allocated.array.data[change->allocated.array.len] = data; + change->allocated.array.data[change->allocated.array.len + 1] = NULL; - change->allocated.array.len ++; + change->allocated.array.len ++; - *(gchar ***)entry->arg_data = change->allocated.array.data; + *(gchar ***)entry->arg_data = change->allocated.array.data; - break; + break; } - + case G_OPTION_ARG_INT: { - gint data; - - if (!parse_int (option_name, value, - &data, - error)) - return FALSE; - - change = get_change (context, G_OPTION_ARG_INT, - entry->arg_data); - change->prev.integer = *(gint *)entry->arg_data; - *(gint *)entry->arg_data = data; - break; + gint data; + + if (!parse_int (option_name, value, + &data, + error)) + return FALSE; + + change = get_change (context, G_OPTION_ARG_INT, + entry->arg_data); + change->prev.integer = *(gint *)entry->arg_data; + *(gint *)entry->arg_data = data; + break; } case G_OPTION_ARG_CALLBACK: { - gchar *data; - gboolean retval; - - if (!value && entry->flags & G_OPTION_FLAG_OPTIONAL_ARG) - data = NULL; - else if (entry->flags & G_OPTION_FLAG_NO_ARG) - data = NULL; - else if (entry->flags & G_OPTION_FLAG_FILENAME) - { + gchar *data; + gboolean retval; + + if (!value && entry->flags & G_OPTION_FLAG_OPTIONAL_ARG) + data = NULL; + else if (entry->flags & G_OPTION_FLAG_NO_ARG) + data = NULL; + else if (entry->flags & G_OPTION_FLAG_FILENAME) + { #ifdef G_OS_WIN32 - data = g_locale_to_utf8 (value, -1, NULL, NULL, error); + data = g_locale_to_utf8 (value, -1, NULL, NULL, error); #else - data = g_strdup (value); + data = g_strdup (value); #endif - } - else - data = g_locale_to_utf8 (value, -1, NULL, NULL, error); - - if (!(entry->flags & (G_OPTION_FLAG_NO_ARG|G_OPTION_FLAG_OPTIONAL_ARG)) && - !data) - return FALSE; - - retval = (* (GOptionArgFunc) entry->arg_data) (option_name, data, group->user_data, error); - - if (!retval && error != NULL && *error == NULL) - g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_FAILED, - _("Error parsing option %s"), option_name); - - g_free (data); - - return retval; - - break; + } + else + data = g_locale_to_utf8 (value, -1, NULL, NULL, error); + + if (!(entry->flags & (G_OPTION_FLAG_NO_ARG|G_OPTION_FLAG_OPTIONAL_ARG)) && + !data) + return FALSE; + + retval = (* (GOptionArgFunc) entry->arg_data) (option_name, data, group->user_data, error); + + if (!retval && error != NULL && *error == NULL) + g_set_error (error, + G_OPTION_ERROR, G_OPTION_ERROR_FAILED, + _("Error parsing option %s"), option_name); + + g_free (data); + + return retval; + + break; } case G_OPTION_ARG_DOUBLE: { - gdouble data; - - if (!parse_double (option_name, value, - &data, - error)) - { - return FALSE; - } - - change = get_change (context, G_OPTION_ARG_DOUBLE, - entry->arg_data); - change->prev.dbl = *(gdouble *)entry->arg_data; - *(gdouble *)entry->arg_data = data; - break; + gdouble data; + + if (!parse_double (option_name, value, + &data, + error)) + { + return FALSE; + } + + change = get_change (context, G_OPTION_ARG_DOUBLE, + entry->arg_data); + change->prev.dbl = *(gdouble *)entry->arg_data; + *(gdouble *)entry->arg_data = data; + break; } case G_OPTION_ARG_INT64: { gint64 data; - if (!parse_int64 (option_name, value, - &data, - error)) - { - return FALSE; - } - - change = get_change (context, G_OPTION_ARG_INT64, - entry->arg_data); - change->prev.int64 = *(gint64 *)entry->arg_data; - *(gint64 *)entry->arg_data = data; - break; + if (!parse_int64 (option_name, value, + &data, + error)) + { + return FALSE; + } + + change = get_change (context, G_OPTION_ARG_INT64, + entry->arg_data); + change->prev.int64 = *(gint64 *)entry->arg_data; + *(gint64 *)entry->arg_data = data; + break; } default: g_assert_not_reached (); @@ -1346,81 +1351,81 @@ parse_arg (GOptionContext *context, static gboolean parse_short_option (GOptionContext *context, - GOptionGroup *group, - gint idx, - gint *new_idx, - gchar arg, - gint *argc, - gchar ***argv, - GError **error, - gboolean *parsed) + GOptionGroup *group, + gint idx, + gint *new_idx, + gchar arg, + gint *argc, + gchar ***argv, + GError **error, + gboolean *parsed) { gint j; - + for (j = 0; j < group->n_entries; j++) { if (arg == group->entries[j].short_name) - { - gchar *option_name; - gchar *value = NULL; - - option_name = g_strdup_printf ("-%c", group->entries[j].short_name); - - if (NO_ARG (&group->entries[j])) - value = NULL; - else - { - if (*new_idx > idx) - { - g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_FAILED, - _("Error parsing option %s"), option_name); - g_free (option_name); - return FALSE; - } - - if (idx < *argc - 1) - { - if (!OPTIONAL_ARG (&group->entries[j])) - { - value = (*argv)[idx + 1]; - add_pending_null (context, &((*argv)[idx + 1]), NULL); - *new_idx = idx + 1; - } - else - { - if ((*argv)[idx + 1][0] == '-') - value = NULL; - else - { - value = (*argv)[idx + 1]; - add_pending_null (context, &((*argv)[idx + 1]), NULL); - *new_idx = idx + 1; - } - } - } - else if (idx >= *argc - 1 && OPTIONAL_ARG (&group->entries[j])) - value = NULL; - else - { - g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Missing argument for %s"), option_name); - g_free (option_name); - return FALSE; - } - } - - if (!parse_arg (context, group, &group->entries[j], - value, option_name, error)) - { - g_free (option_name); - return FALSE; - } - - g_free (option_name); - *parsed = TRUE; - } + { + gchar *option_name; + gchar *value = NULL; + + option_name = g_strdup_printf ("-%c", group->entries[j].short_name); + + if (NO_ARG (&group->entries[j])) + value = NULL; + else + { + if (*new_idx > idx) + { + g_set_error (error, + G_OPTION_ERROR, G_OPTION_ERROR_FAILED, + _("Error parsing option %s"), option_name); + g_free (option_name); + return FALSE; + } + + if (idx < *argc - 1) + { + if (!OPTIONAL_ARG (&group->entries[j])) + { + value = (*argv)[idx + 1]; + add_pending_null (context, &((*argv)[idx + 1]), NULL); + *new_idx = idx + 1; + } + else + { + if ((*argv)[idx + 1][0] == '-') + value = NULL; + else + { + value = (*argv)[idx + 1]; + add_pending_null (context, &((*argv)[idx + 1]), NULL); + *new_idx = idx + 1; + } + } + } + else if (idx >= *argc - 1 && OPTIONAL_ARG (&group->entries[j])) + value = NULL; + else + { + g_set_error (error, + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Missing argument for %s"), option_name); + g_free (option_name); + return FALSE; + } + } + + if (!parse_arg (context, group, &group->entries[j], + value, option_name, error)) + { + g_free (option_name); + return FALSE; + } + + g_free (option_name); + *parsed = TRUE; + } } return TRUE; @@ -1428,146 +1433,146 @@ parse_short_option (GOptionContext *context, static gboolean parse_long_option (GOptionContext *context, - GOptionGroup *group, - gint *idx, - gchar *arg, - gboolean aliased, - gint *argc, - gchar ***argv, - GError **error, - gboolean *parsed) + GOptionGroup *group, + gint *idx, + gchar *arg, + gboolean aliased, + gint *argc, + gchar ***argv, + GError **error, + gboolean *parsed) { gint j; for (j = 0; j < group->n_entries; j++) { if (*idx >= *argc) - return TRUE; + return TRUE; if (aliased && (group->entries[j].flags & G_OPTION_FLAG_NOALIAS)) - continue; + continue; if (NO_ARG (&group->entries[j]) && - strcmp (arg, group->entries[j].long_name) == 0) - { - gchar *option_name; - gboolean retval; - - option_name = g_strconcat ("--", group->entries[j].long_name, NULL); - retval = parse_arg (context, group, &group->entries[j], - NULL, option_name, error); - g_free(option_name); - - add_pending_null (context, &((*argv)[*idx]), NULL); - *parsed = TRUE; - - return retval; - } + strcmp (arg, group->entries[j].long_name) == 0) + { + gchar *option_name; + gboolean retval; + + option_name = g_strconcat ("--", group->entries[j].long_name, NULL); + retval = parse_arg (context, group, &group->entries[j], + NULL, option_name, error); + g_free (option_name); + + add_pending_null (context, &((*argv)[*idx]), NULL); + *parsed = TRUE; + + return retval; + } else - { - gint len = strlen (group->entries[j].long_name); - - if (strncmp (arg, group->entries[j].long_name, len) == 0 && - (arg[len] == '=' || arg[len] == 0)) - { - gchar *value = NULL; - gchar *option_name; - - add_pending_null (context, &((*argv)[*idx]), NULL); - option_name = g_strconcat ("--", group->entries[j].long_name, NULL); - - if (arg[len] == '=') - value = arg + len + 1; - else if (*idx < *argc - 1) - { - if (!(group->entries[j].flags & G_OPTION_FLAG_OPTIONAL_ARG)) - { - value = (*argv)[*idx + 1]; - add_pending_null (context, &((*argv)[*idx + 1]), NULL); - (*idx)++; - } - else - { - if ((*argv)[*idx + 1][0] == '-') - { - gboolean retval; - retval = parse_arg (context, group, &group->entries[j], - NULL, option_name, error); - *parsed = TRUE; - g_free (option_name); - return retval; - } - else - { - value = (*argv)[*idx + 1]; - add_pending_null (context, &((*argv)[*idx + 1]), NULL); - (*idx)++; - } - } - } - else if (*idx >= *argc - 1 && - group->entries[j].flags & G_OPTION_FLAG_OPTIONAL_ARG) - { - gboolean retval; - retval = parse_arg (context, group, &group->entries[j], - NULL, option_name, error); - *parsed = TRUE; - g_free (option_name); - return retval; - } - else - { - g_set_error (error, - G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - _("Missing argument for %s"), option_name); - g_free (option_name); - return FALSE; - } - - if (!parse_arg (context, group, &group->entries[j], - value, option_name, error)) - { - g_free (option_name); - return FALSE; - } - - g_free (option_name); - *parsed = TRUE; - } - } + { + gint len = strlen (group->entries[j].long_name); + + if (strncmp (arg, group->entries[j].long_name, len) == 0 && + (arg[len] == '=' || arg[len] == 0)) + { + gchar *value = NULL; + gchar *option_name; + + add_pending_null (context, &((*argv)[*idx]), NULL); + option_name = g_strconcat ("--", group->entries[j].long_name, NULL); + + if (arg[len] == '=') + value = arg + len + 1; + else if (*idx < *argc - 1) + { + if (!(group->entries[j].flags & G_OPTION_FLAG_OPTIONAL_ARG)) + { + value = (*argv)[*idx + 1]; + add_pending_null (context, &((*argv)[*idx + 1]), NULL); + (*idx)++; + } + else + { + if ((*argv)[*idx + 1][0] == '-') + { + gboolean retval; + retval = parse_arg (context, group, &group->entries[j], + NULL, option_name, error); + *parsed = TRUE; + g_free (option_name); + return retval; + } + else + { + value = (*argv)[*idx + 1]; + add_pending_null (context, &((*argv)[*idx + 1]), NULL); + (*idx)++; + } + } + } + else if (*idx >= *argc - 1 && + group->entries[j].flags & G_OPTION_FLAG_OPTIONAL_ARG) + { + gboolean retval; + retval = parse_arg (context, group, &group->entries[j], + NULL, option_name, error); + *parsed = TRUE; + g_free (option_name); + return retval; + } + else + { + g_set_error (error, + G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + _("Missing argument for %s"), option_name); + g_free (option_name); + return FALSE; + } + + if (!parse_arg (context, group, &group->entries[j], + value, option_name, error)) + { + g_free (option_name); + return FALSE; + } + + g_free (option_name); + *parsed = TRUE; + } + } } - + return TRUE; } static gboolean parse_remaining_arg (GOptionContext *context, - GOptionGroup *group, - gint *idx, - gint *argc, - gchar ***argv, - GError **error, - gboolean *parsed) + GOptionGroup *group, + gint *idx, + gint *argc, + gchar ***argv, + GError **error, + gboolean *parsed) { gint j; for (j = 0; j < group->n_entries; j++) { if (*idx >= *argc) - return TRUE; + return TRUE; if (group->entries[j].long_name[0]) - continue; + continue; g_return_val_if_fail (group->entries[j].arg == G_OPTION_ARG_CALLBACK || group->entries[j].arg == G_OPTION_ARG_STRING_ARRAY || - group->entries[j].arg == G_OPTION_ARG_FILENAME_ARRAY, FALSE); - + group->entries[j].arg == G_OPTION_ARG_FILENAME_ARRAY, FALSE); + add_pending_null (context, &((*argv)[*idx]), NULL); - + if (!parse_arg (context, group, &group->entries[j], (*argv)[*idx], "", error)) - return FALSE; - + return FALSE; + *parsed = TRUE; return TRUE; } @@ -1577,7 +1582,7 @@ parse_remaining_arg (GOptionContext *context, static void free_changes_list (GOptionContext *context, - gboolean revert) + gboolean revert) { GList *list; @@ -1586,36 +1591,36 @@ free_changes_list (GOptionContext *context, Change *change = list->data; if (revert) - { - switch (change->arg_type) - { - case G_OPTION_ARG_NONE: - *(gboolean *)change->arg_data = change->prev.bool; - break; - case G_OPTION_ARG_INT: - *(gint *)change->arg_data = change->prev.integer; - break; - case G_OPTION_ARG_STRING: - case G_OPTION_ARG_FILENAME: + { + switch (change->arg_type) + { + case G_OPTION_ARG_NONE: + *(gboolean *)change->arg_data = change->prev.bool; + break; + case G_OPTION_ARG_INT: + *(gint *)change->arg_data = change->prev.integer; + break; + case G_OPTION_ARG_STRING: + case G_OPTION_ARG_FILENAME: g_free (change->allocated.str); - *(gchar **)change->arg_data = change->prev.str; - break; - case G_OPTION_ARG_STRING_ARRAY: - case G_OPTION_ARG_FILENAME_ARRAY: - g_strfreev (change->allocated.array.data); - *(gchar ***)change->arg_data = change->prev.array; - break; - case G_OPTION_ARG_DOUBLE: - *(gdouble *)change->arg_data = change->prev.dbl; - break; - case G_OPTION_ARG_INT64: - *(gint64 *)change->arg_data = change->prev.int64; - break; - default: - g_assert_not_reached (); - } - } - + *(gchar **)change->arg_data = change->prev.str; + break; + case G_OPTION_ARG_STRING_ARRAY: + case G_OPTION_ARG_FILENAME_ARRAY: + g_strfreev (change->allocated.array.data); + *(gchar ***)change->arg_data = change->prev.array; + break; + case G_OPTION_ARG_DOUBLE: + *(gdouble *)change->arg_data = change->prev.dbl; + break; + case G_OPTION_ARG_INT64: + *(gint64 *)change->arg_data = change->prev.int64; + break; + default: + g_assert_not_reached (); + } + } + g_free (change); } @@ -1625,7 +1630,7 @@ free_changes_list (GOptionContext *context, static void free_pending_nulls (GOptionContext *context, - gboolean perform_nulls) + gboolean perform_nulls) { GList *list; @@ -1634,17 +1639,17 @@ free_pending_nulls (GOptionContext *context, PendingNull *n = list->data; if (perform_nulls) - { - if (n->value) - { - /* Copy back the short options */ - *(n->ptr)[0] = '-'; - strcpy (*n->ptr + 1, n->value); - } - else - *n->ptr = NULL; - } - + { + if (n->value) + { + /* Copy back the short options */ + *(n->ptr)[0] = '-'; + strcpy (*n->ptr + 1, n->value); + } + else + *n->ptr = NULL; + } + g_free (n->value); g_free (n); } @@ -1658,41 +1663,41 @@ free_pending_nulls (GOptionContext *context, * @context: a #GOptionContext * @argc: a pointer to the number of command line arguments * @argv: a pointer to the array of command line arguments - * @error: a return location for errors - * + * @error: a return location for errors + * * Parses the command line arguments, recognizing options - * which have been added to @context. A side-effect of + * which have been added to @context. A side-effect of * calling this function is that g_set_prgname() will be * called. * * If the parsing is successful, any parsed arguments are - * removed from the array and @argc and @argv are updated + * removed from the array and @argc and @argv are updated * accordingly. A '--' option is stripped from @argv - * unless there are unparsed options before and after it, - * or some of the options after it start with '-'. In case - * of an error, @argc and @argv are left unmodified. + * unless there are unparsed options before and after it, + * or some of the options after it start with '-'. In case + * of an error, @argc and @argv are left unmodified. * * If automatic support is enabled - * (see g_option_context_set_help_enabled()), and the + * (see g_option_context_set_help_enabled()), and the * @argv array contains one of the recognized help options, * this function will produce help output to stdout and * call exit (0). * - * Note that function depends on the - * current locale for + * Note that function depends on the + * current locale for * automatic character set conversion of string and filename * arguments. - * - * Return value: %TRUE if the parsing was successful, + * + * Return value: %TRUE if the parsing was successful, * %FALSE if an error occurred * * Since: 2.6 **/ gboolean g_option_context_parse (GOptionContext *context, - gint *argc, - gchar ***argv, - GError **error) + gint *argc, + gchar ***argv, + GError **error) { gint i, j, k; GList *list; @@ -1701,15 +1706,15 @@ g_option_context_parse (GOptionContext *context, if (!g_get_prgname()) { if (argc && argv && *argc) - { - gchar *prgname; - - prgname = g_path_get_basename ((*argv)[0]); - g_set_prgname (prgname); - g_free (prgname); - } + { + gchar *prgname; + + prgname = g_path_get_basename ((*argv)[0]); + g_set_prgname (prgname); + g_free (prgname); + } else - g_set_prgname (""); + g_set_prgname (""); } /* Call pre-parse hooks */ @@ -1717,22 +1722,22 @@ g_option_context_parse (GOptionContext *context, while (list) { GOptionGroup *group = list->data; - + if (group->pre_parse_func) - { - if (!(* group->pre_parse_func) (context, group, - group->user_data, error)) - goto fail; - } - + { + if (!(* group->pre_parse_func) (context, group, + group->user_data, error)) + goto fail; + } + list = list->next; } if (context->main_group && context->main_group->pre_parse_func) { if (!(* context->main_group->pre_parse_func) (context, context->main_group, - context->main_group->user_data, error)) - goto fail; + context->main_group->user_data, error)) + goto fail; } if (argc && argv) @@ -1742,198 +1747,198 @@ g_option_context_parse (GOptionContext *context, gint separator_pos = 0; for (i = 1; i < *argc; i++) - { - gchar *arg, *dash; - gboolean parsed = FALSE; - - if ((*argv)[i][0] == '-' && (*argv)[i][1] != '\0' && !stop_parsing) - { - if ((*argv)[i][1] == '-') - { - /* -- option */ - - arg = (*argv)[i] + 2; - - /* '--' terminates list of arguments */ - if (*arg == 0) - { - separator_pos = i; - stop_parsing = TRUE; - continue; - } - - /* Handle help options */ - if (context->help_enabled) - { - if (strcmp (arg, "help") == 0) - print_help (context, TRUE, NULL); - else if (strcmp (arg, "help-all") == 0) - print_help (context, FALSE, NULL); - else if (strncmp (arg, "help-", 5) == 0) - { - list = context->groups; - - while (list) - { - GOptionGroup *group = list->data; - - if (strcmp (arg + 5, group->name) == 0) - print_help (context, FALSE, group); - - list = list->next; - } - } - } - - if (context->main_group && - !parse_long_option (context, context->main_group, &i, arg, - FALSE, argc, argv, error, &parsed)) - goto fail; - - if (parsed) - continue; - - /* Try the groups */ - list = context->groups; - while (list) - { - GOptionGroup *group = list->data; - - if (!parse_long_option (context, group, &i, arg, - FALSE, argc, argv, error, &parsed)) - goto fail; - - if (parsed) - break; - - list = list->next; - } - - if (parsed) - continue; - - /* Now look for ---